Browse files

Fix process restarting.

  • Loading branch information...
1 parent 3758409 commit fbb07b2a08b99dc9459b9677a315cf7992c9545c @chrisdone chrisdone committed Jun 8, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 haskell-process.el
@@ -437,12 +437,14 @@ changed. Restarts the process if that is the case."
(haskell-interactive-mode-echo session "Restarting process ...")
(haskell-process-set (haskell-session-process session) 'is-restarting t)
(delete-process existing-process)))
- (let ((process (haskell-process-make (haskell-session-name session)))
+ (let ((process (or (haskell-session-process session)
+ (haskell-process-make (haskell-session-name session))))
(old-queue (haskell-process-get (haskell-session-process session)
- ;; Continue the command queue in case we're restarting the process:
(haskell-session-set-process session process)
(haskell-process-set-session process session)
+ (haskell-process-set-cmd process 'none)
+ (haskell-process-set (haskell-session-process session) 'is-restarting nil)
(let ((default-directory (haskell-session-cabal-dir session)))
(unless (haskell-session-get session 'current-dir)
(haskell-session-set-current-dir session (haskell-process-prompt-dir session)))
@@ -549,8 +551,9 @@ changed. Restarts the process if that is the case."
(lambda (process _)
(haskell-process-session process)
- (nth (random (length haskell-interactive-greetings))
- haskell-interactive-greetings))))))
+ (concat (nth (random (length haskell-interactive-greetings))
+ haskell-interactive-greetings)
+ " (if I break, run M-x haskell-process-clear)"))))))
(defun haskell-process-sentinel (proc event)
"The sentinel for the process pipe."

0 comments on commit fbb07b2

Please sign in to comment.