From be2b3f0ea74a18b42b6973e76f4c3b3e44405395 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Tue, 4 Aug 2015 13:46:38 +0900 Subject: [PATCH 1/3] Revert "Fix typo to set process running status" This reverts commit b52c0a5d767282369f2748c5ec070b802ed8e23c. --- elisp/ghc-process.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elisp/ghc-process.el b/elisp/ghc-process.el index 7ecfa34..0519549 100644 --- a/elisp/ghc-process.el +++ b/elisp/ghc-process.el @@ -34,7 +34,7 @@ (if ghc-process-running (error "ghc process already running") (progn - (setq ghc-process-running t) + (when ghc-process-running t) (if hook1 (funcall hook1)) (let* ((cbuf (current-buffer)) (name ghc-process-process-name) From 475b2ea02e7b1784d309ea653672ded6611917e8 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Tue, 4 Aug 2015 13:47:39 +0900 Subject: [PATCH 2/3] Revert "don't silently ignore case when ghc process is already running in ghc-with-process" This reverts commit ac31e6edc27e252c984ab4be1df205b09866876f. --- elisp/ghc-process.el | 45 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/elisp/ghc-process.el b/elisp/ghc-process.el index 0519549..b44416e 100644 --- a/elisp/ghc-process.el +++ b/elisp/ghc-process.el @@ -18,8 +18,7 @@ (defvar-local ghc-process-original-buffer nil) (defvar-local ghc-process-original-file nil) (defvar-local ghc-process-callback nil) -(defvar-local ghc-process-hook nil - "Hook that will be called upon successfull completion of ghc-mod command.") +(defvar-local ghc-process-hook nil) (defvar ghc-command "ghc-mod") @@ -31,28 +30,26 @@ (defun ghc-with-process (cmd callback &optional hook1 hook2) (unless ghc-process-process-name (setq ghc-process-process-name (ghc-get-project-root))) - (if ghc-process-running - (error "ghc process already running") - (progn - (when ghc-process-running t) - (if hook1 (funcall hook1)) - (let* ((cbuf (current-buffer)) - (name ghc-process-process-name) - (buf (get-buffer-create (concat " ghc-mod:" name))) - (file (buffer-file-name)) - (cpro (get-process name))) - (ghc-with-current-buffer buf - (setq ghc-process-original-buffer cbuf) - (setq ghc-process-original-file file) - (setq ghc-process-callback callback) - (setq ghc-process-hook hook2) - (erase-buffer) - (let ((pro (ghc-get-process cpro name buf))) - (process-send-string pro cmd) - (when ghc-debug - (ghc-with-debug-buffer - (insert (format "%% %s" cmd)))) - pro)))))) + (when (and ghc-process-process-name (not ghc-process-running)) + (setq ghc-process-running t) + (if hook1 (funcall hook1)) + (let* ((cbuf (current-buffer)) + (name ghc-process-process-name) + (buf (get-buffer-create (concat " ghc-mod:" name))) + (file (buffer-file-name)) + (cpro (get-process name))) + (ghc-with-current-buffer buf + (setq ghc-process-original-buffer cbuf) + (setq ghc-process-original-file file) + (setq ghc-process-callback callback) + (setq ghc-process-hook hook2) + (erase-buffer) + (let ((pro (ghc-get-process cpro name buf))) + (process-send-string pro cmd) + (when ghc-debug + (ghc-with-debug-buffer + (insert (format "%% %s" cmd)))) + pro))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From de448f8ade149c22f3e4863462733ea5799838e9 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 12 Aug 2015 12:58:47 +0900 Subject: [PATCH 3/3] layout only. --- elisp/ghc-comp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elisp/ghc-comp.el b/elisp/ghc-comp.el index 2b26a16..2209ca2 100644 --- a/elisp/ghc-comp.el +++ b/elisp/ghc-comp.el @@ -127,7 +127,7 @@ unloaded modules are loaded") (interactive) (if (ghc-should-scroll) (ghc-scroll-completion-buffer) - (ghc-try-complete))) + (ghc-try-complete))) (defun ghc-should-scroll () (let ((window (ghc-completion-window)))