mu4e-util: allow ESC to exit a choice selection

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 02b5bc805c
but was inadvertently removed in
0354fa4fac, so more detail was added to
the comment.
This commit is contained in:
Sean Farley 2023-06-22 12:12:41 -07:00
parent 0bdab5ae06
commit 91464002b8
1 changed files with 4 additions and 0 deletions

View File

@ -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)))
(when (eq kar ?\e) (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))