Skip to content

Commit

Permalink
Merge pull request #274 from Philonous/master
Browse files Browse the repository at this point in the history
Curb process restart spam
  • Loading branch information
chrisdone committed May 26, 2014
2 parents 69ead72 + 9f65077 commit cda2fc8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions haskell-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ imports become available?"
:type 'boolean
:group 'haskell-interactive)

(defcustom haskell-process-suggest-restart
t
"Suggest restarting the process when it has died"
:type 'boolean
:group 'haskell-interactive)

(defvar haskell-imported-suggested nil)
(defvar haskell-process-prompt-regex "\4")
(defvar haskell-reload-p nil)
Expand Down Expand Up @@ -1163,9 +1169,13 @@ If I break, you can:

(defun haskell-process-prompt-restart (process)
"Prompt to restart the died process."
(when (y-or-n-p (format "The Haskell process `%s' has died. Restart? "
(haskell-process-name process)))
(haskell-process-start (haskell-process-session process))))
(let ((process-name (haskell-process-name process)))
(if haskell-process-suggest-restart
(when (y-or-n-p (format "The Haskell process `%s' has died. Restart? "
process-name))
(haskell-process-start (haskell-process-session process)))
(message (format "The Haskell process `%s' is dearly departed."
process-name)))))

(defun haskell-process-live-updates (process)
"Process live updates."
Expand Down

0 comments on commit cda2fc8

Please sign in to comment.