C-xC-s now checks syntax even if not modified.

This commit is contained in:
Kazu Yamamoto 2010-04-23 18:38:11 +09:00
parent 585ebe5e1d
commit e847ed6dab
2 changed files with 8 additions and 0 deletions

View File

@ -49,4 +49,10 @@
nil)
'end-of-line)))))
(defun ghc-save-buffer ()
(interactive)
(if (buffer-modified-p)
(save-buffer)
(flymake-start-syntax-check)))
(provide 'ghc-command)

View File

@ -40,6 +40,7 @@
(defvar ghc-help-key "\e?")
(defvar ghc-insert-key "\et")
(defvar ghc-sort-key "\es")
(defvar ghc-check-key "\C-x\C-s")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
@ -59,6 +60,7 @@
(define-key haskell-mode-map ghc-help-key 'ghc-display-errors)
(define-key haskell-mode-map ghc-insert-key 'ghc-insert-template)
(define-key haskell-mode-map ghc-sort-key 'ghc-sort-lines)
(define-key haskell-mode-map ghc-check-key 'ghc-save-buffer)
(ghc-comp-init)
(setq ghc-initialized t)))