Merge pull request #2506 from seanfarley/smf/esc

mu4e-util: allow ESC to exit a choice selection
This commit is contained in:
Dirk-Jan C. Binnema 2023-06-22 23:40:20 +03:00 committed by GitHub
commit 32cdc0ce43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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))