Skip to content

Commit 704dd8d

Browse files
committed
Merge pull request #1309 from fice-t/prompt
Put cursor in the echo area at prompt restart
2 parents 7649af3 + 799ec9a commit 704dd8d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

haskell.el

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,16 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'."
249249

250250
(defun haskell-process-prompt-restart (process)
251251
"Prompt to restart the died PROCESS."
252-
(let ((process-name (haskell-process-name process)))
252+
(let ((process-name (haskell-process-name process))
253+
(cursor-in-echo-area t))
253254
(if haskell-process-suggest-restart
254255
(progn
255256
(haskell-mode-toggle-interactive-prompt-state)
256257
(unwind-protect
257258
(cond
258259
((string-match "You need to re-run the 'configure' command."
259260
(haskell-process-response process))
260-
(cl-case (read-event
261+
(cl-case (read-char-choice
261262
(concat
262263
"The Haskell process ended. Cabal wants you to run "
263264
(propertize "cabal configure"
@@ -268,7 +269,8 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'."
268269
"Cabal said:\n\n"
269270
(propertize (haskell-process-response process)
270271
'face
271-
'font-lock-comment-face)))
272+
'font-lock-comment-face))
273+
'(?l ?n ?y))
272274
(?y (let ((default-directory
273275
(haskell-session-cabal-dir
274276
(haskell-process-session process))))
@@ -283,12 +285,13 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'."
283285
(insert response)))))
284286
(?n)))
285287
(t
286-
(cl-case (read-event
288+
(cl-case (read-char-choice
287289
(propertize
288-
(format "The Haskell process `%s' has died. Restart? (y, n, l: show process log)"
290+
(format "The Haskell process `%s' has died. Restart? (y, n, l: show process log) "
289291
process-name)
290292
'face
291-
'minibuffer-prompt))
293+
'minibuffer-prompt)
294+
'(?l ?n ?y))
292295
(?y (haskell-process-start (haskell-process-session process)))
293296
(?l (let* ((response (haskell-process-response process))
294297
(buffer (get-buffer "*haskell-process-log*")))

0 commit comments

Comments
 (0)