Lots of random changes. Stopped using Chris Done's haskell-flycheck.
authorLuke Hoersten <Luke@Hoersten.org>
Mon, 11 May 2015 09:45:31 -0500
changeset 73 8167de2d2daa
parent 72 65194c801e61
child 74 1ec54926890f
Lots of random changes. Stopped using Chris Done's haskell-flycheck.
elisp/haskell-flycheck.el
elisp/haskell-init.el
init.el
--- a/elisp/haskell-flycheck.el	Sat Apr 04 20:20:01 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-;;; haskell-flycheck.el --- Flychecker using the GHCi process
-
-;; Copyright (c) 2014 Chris Done. All rights reserved.
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Code:
-
-(require 'haskell-process)
-(require 'flycheck)
-
-(defun flycheck-haskell-process-start (checker callback)
-  "Start a GHCi load with CHECKER.
-
-CALLBACK is the status callback passed by Flycheck."
-  (let ((session (haskell-session)))
-    (haskell-session-current-dir session)
-    (let ((process (haskell-process)))
-      (haskell-process-queue-command
-       process
-       (make-haskell-command
-        :state
-        (list :process process
-              :session session
-              :filename (buffer-file-name)
-              :callback callback
-              :buffer (current-buffer)
-              :original (buffer-string))
-        :go
-        (lambda (state)
-          (with-current-buffer (plist-get state :buffer)
-            (let* ((filename (plist-get state :filename)))
-              (write-region (point-min) (point-max) filename)
-              (clear-visited-file-modtime)
-              (haskell-process-send-string
-               (plist-get state :process)
-               (format ":load \"%s\""
-                       (replace-regexp-in-string
-                        "\""
-                        "\\\\\""
-                        filename))))))
-        :live (lambda (state _)
-                (when (plist-get state :original)
-                  (with-temp-buffer
-                    (insert (plist-get state :original))
-                    (write-region (point-min) (point-max) (plist-get state :filename))
-                    (plist-put state :original nil))))
-        :complete
-        (lambda (state response)
-          (let ((session (plist-get state :session))
-                (process (plist-get state :process)))
-            (haskell-process-set-response-cursor process 0)
-            (let ((errors (list))
-                  (next-error t))
-              (while next-error
-                (setq next-error
-                      (haskell-process-errors-warnings
-                       session
-                       process
-                       response
-                       t))
-                (when (consp next-error)
-                  (add-to-list 'errors
-                               (flycheck-error-new-at
-                                (plist-get next-error :line)
-                                (plist-get next-error :col)
-                                (plist-get next-error :type)
-                                (plist-get next-error :msg)
-                                :checker 'haskell-process
-                                :buffer (plist-get state :buffer)))))
-              (funcall (plist-get state :callback)
-                       'finished
-                       errors)))))))))
-
-
-(flycheck-define-generic-checker 'haskell-process
-  "A syntax and type checker for Haskell using GHCi (via the
-haskell-process Emacs module)."
-  :start 'flycheck-haskell-process-start
-  :modes '(haskell-mode)
-  :next-checkers '((warning . haskell-hlint)))
-
-;; Register as an auto-selectable checker
-(setq flycheck-checkers (cons `haskell-process flycheck-checkers))
-
-(provide 'haskell-flycheck)
--- a/elisp/haskell-init.el	Sat Apr 04 20:20:01 2015 -0500
+++ b/elisp/haskell-init.el	Mon May 11 09:45:31 2015 -0500
@@ -3,13 +3,17 @@
 
 ;; Require packages
 (require 'package-require)
-(package-require '(haskell-mode flycheck)) ;;  flycheck-haskell hindent shm
+(package-require '(flycheck yasnippet haskell-snippets haskell-mode flycheck-haskell))
+
+;; Load haskell-mode from source
+;; (add-to-list 'load-path "~/Code/elisp/haskell-mode/")
+;; (require 'haskell-mode-autoloads)
 
 (require 'haskell)
 (require 'haskell-mode)
 (require 'haskell-process)
-(require 'haskell-flycheck)
 (require 'haskell-interactive-mode)
+(require 'haskell-snippets)
 
 (defun haskell-who-calls (&optional prompt)
   "Grep the codebase to see who uses the symbol at point."
@@ -51,7 +55,7 @@
  (lambda ()
    (imenu-add-menubar-index)
    (flycheck-mode)
-   (flycheck-disable-checker `haskell-ghc)
+   (flycheck-haskell-setup)
    (haskell-indentation-mode t)
    (subword-mode)
    (interactive-haskell-mode t)))
@@ -64,9 +68,9 @@
  '(haskell-indentation-left-offset 4)
 
  '(haskell-process-type 'cabal-repl)
- ;; '(haskell-process-args-cabal-repl '("--ghc-option=-ferror-spans" "--with-ghc=ghci-ng"))
- ;; '(haskell-process-path-ghci "ghci-ng")
- ;; '(haskell-process-args-ghci "-ferror-spans")
+ '(haskell-process-args-cabal-repl '("--ghc-option=-ferror-spans" "--with-ghc=ghci-ng"))
+ '(haskell-process-path-ghci "ghci-ng")
+ '(haskell-process-args-ghci "-ferror-spans")
  '(haskell-process-suggest-remove-import-lines t)
  '(haskell-process-auto-import-loaded-modules t)
  '(haskell-process-log t)
--- a/init.el	Sat Apr 04 20:20:01 2015 -0500
+++ b/init.el	Mon May 11 09:45:31 2015 -0500
@@ -58,7 +58,7 @@
 ;;;; Mode-Specific ;;;;
 
 ;;; text-mode
-(add-hook 'fundamental-mode-hook 'flyspell-mode)      ; spellcheck text
+(add-hook 'fundamental-mode-hook 'flyspell-mode)        ; spellcheck text
 (add-hook 'fundamental-mode-hook 'turn-on-auto-fill)    ; autofill text
 
 ;;; ido-mode
@@ -113,26 +113,28 @@
 
 ;;; packages
 (require 'package-require)
-(package-require '(auto-complete exec-path-from-shell
- expand-region rainbow-delimiters rainbow-mode solarized-theme
- visual-regexp yasnippet zencoding-mode markdown-mode move-text))
+(package-require '(exec-path-from-shell expand-region
+ rainbow-delimiters rainbow-mode solarized-theme visual-regexp
+ yasnippet zencoding-mode markdown-mode move-text powerline))
+
+;; powerline
+(require 'powerline)
+(powerline-default-theme)
+
+;;; terminal
+(global-set-key (kbd "C-c s") 'eshell) ; start shell
+(exec-path-from-shell-initialize)
+(eshell)
+(add-hook 'eshell-mode-hook (lambda () (setenv "TERM" "emacs")))
 
 ;;; custom requires
 (require 'haskell-init)
 (require 'javascript-init)
 (require 'c-init)             ; c specific elisp
 
-;;; auto-complete-mode
-(require 'auto-complete-config)
-(ac-config-default)
-(global-set-key (kbd "M-/") 'auto-complete)
-(setq-default ac-auto-start nil)
-
-;;; terminal
-(global-set-key (kbd "C-c s") 'eshell) ; start shell
-(exec-path-from-shell-initialize)
-(eshell)
-(add-hook 'eshell-mode-hook (lambda () (setenv "TERM" "emacs")))
+;; ;;; company mode
+;; (add-hook 'after-init-hook 'global-company-mode)
+;; (global-set-key (kbd "M-/") 'company-complete)
 
 ;;; uniquify
 (require 'uniquify)           ; unique buffer names with dirs
@@ -149,7 +151,7 @@
 
 ;;; yasnippets
 (setq-default yas-prompt-functions '(yas-ido-prompt yas-dropdown-prompt)) ; use ido for multiple snippets
-(setq-default yas-snippet-dirs '("~/.emacs.d/snippets"))
+;; (setq-default yas-snippet-dirs '("~/.emacs.d/snippets"))
 (yas-global-mode t)
 
 
@@ -174,8 +176,8 @@
    (add-hook x
     (lambda ()
       (linum-mode t)
-      (rainbow-delimiters-mode t)
-      (auto-complete-mode t))))
+      (subword-mode t)
+      (rainbow-delimiters-mode t))))
  '(text-mode-hook
    c-mode-common-hook
    python-mode-hook