src.nth.io/

summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2015-05-11 09:45:31 -0500
committerLuke Hoersten <[email protected]>2015-05-11 09:45:31 -0500
commitabbf43598820d2ed5b703a675296e505d80d602d (patch)
tree0c6cc57eaa5d3e71fb6e61ea2dc14b9cc092e111 /elisp
parent3881850f00dd71599fddbf3204c60c14467975a1 (diff)
Lots of random changes. Stopped using Chris Done's haskell-flycheck.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/haskell-flycheck.el97
-rw-r--r--elisp/haskell-init.el16
2 files changed, 10 insertions, 103 deletions
diff --git a/elisp/haskell-flycheck.el b/elisp/haskell-flycheck.el
deleted file mode 100644
index 4248718..0000000
--- a/elisp/haskell-flycheck.el
+++ /dev/null
@@ -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)
diff --git a/elisp/haskell-init.el b/elisp/haskell-init.el
index 77fa7c3..735d788 100644
--- a/elisp/haskell-init.el
+++ b/elisp/haskell-init.el
@@ -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)