diff --git a/elisp/ghc-check.el b/elisp/ghc-check.el index ff46d9f..1820ae8 100644 --- a/elisp/ghc-check.el +++ b/elisp/ghc-check.el @@ -46,8 +46,9 @@ nil does not display errors/warnings. (defun ghc-check-syntax () (interactive) - (setq mode-line-process " -:-") ;; fixme - (ghc-with-process (ghc-check-send) 'ghc-check-callback)) + (ghc-with-process (ghc-check-send) + 'ghc-check-callback + (lambda () (setq mode-line-process " -:-")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/elisp/ghc-process.el b/elisp/ghc-process.el index 4495ec6..0b17ae4 100644 --- a/elisp/ghc-process.el +++ b/elisp/ghc-process.el @@ -25,10 +25,11 @@ (defun ghc-get-project-root () (ghc-run-ghc-mod '("root"))) -(defun ghc-with-process (cmd callback) +(defun ghc-with-process (cmd callback &optional hook) (unless ghc-process-process-name (setq ghc-process-process-name (ghc-get-project-root))) (when ghc-process-process-name + (if hook (funcall hook)) (let* ((cbuf (current-buffer)) (name ghc-process-process-name) (buf (get-buffer-create (concat " ghc-modi:" name)))