From 799ec9a8bb26e874c5d4d7d7f270cd17e5fa1e92 Mon Sep 17 00:00:00 2001 From: Fice T Date: Sun, 1 May 2016 15:08:09 -0600 Subject: [PATCH] Put cursor in the echo area at prompt restart --- haskell.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/haskell.el b/haskell.el index a3dc618b2..c55b48252 100644 --- a/haskell.el +++ b/haskell.el @@ -249,7 +249,8 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." (defun haskell-process-prompt-restart (process) "Prompt to restart the died PROCESS." - (let ((process-name (haskell-process-name process))) + (let ((process-name (haskell-process-name process)) + (cursor-in-echo-area t)) (if haskell-process-suggest-restart (progn (haskell-mode-toggle-interactive-prompt-state) @@ -257,7 +258,7 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." (cond ((string-match "You need to re-run the 'configure' command." (haskell-process-response process)) - (cl-case (read-event + (cl-case (read-char-choice (concat "The Haskell process ended. Cabal wants you to run " (propertize "cabal configure" @@ -268,7 +269,8 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." "Cabal said:\n\n" (propertize (haskell-process-response process) 'face - 'font-lock-comment-face))) + 'font-lock-comment-face)) + '(?l ?n ?y)) (?y (let ((default-directory (haskell-session-cabal-dir (haskell-process-session process)))) @@ -283,12 +285,13 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'." (insert response))))) (?n))) (t - (cl-case (read-event + (cl-case (read-char-choice (propertize - (format "The Haskell process `%s' has died. Restart? (y, n, l: show process log)" + (format "The Haskell process `%s' has died. Restart? (y, n, l: show process log) " process-name) 'face - 'minibuffer-prompt)) + 'minibuffer-prompt) + '(?l ?n ?y)) (?y (haskell-process-start (haskell-process-session process))) (?l (let* ((response (haskell-process-response process)) (buffer (get-buffer "*haskell-process-log*")))