Skip to content

Commit

Permalink
mu4e-util: allow ESC to exit a choice selection
Browse files Browse the repository at this point in the history
I occasionally find myself pressing escape to exit a menu choice in mu4e
and it's a bit unfortunate that nothing happens. As best I could tell,
since this is a C call, none of the keymaps are checked for
`(keyboard-quit)' so we need to explicitly check for ESC here

This was previously fixed in 02b5bc8
but was inadvertently removed in
0354fa4, so more detail was added to
the comment.
  • Loading branch information
seanfarley committed Jun 22, 2023
1 parent 0bdab5a commit 800fb99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mu4e/mu4e-helpers.el
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ Return the matching choice value (cdr of the cell)."
(while (not chosen)
(message nil) ;; this seems needed...
(when-let ((kar (read-char-exclusive prompt)))
(if (eq kar 27) (keyboard-quit)) ;; `read-char-exclusive' is a C
;; function and doesn't check for
;; `keyboard-quit', there we need to
;; check if ESC is pressed
(setq chosen (mu4e--matching-choice choices kar))))
chosen))

Expand Down

0 comments on commit 800fb99

Please sign in to comment.