]> git.eshelyaron.com Git - emacs.git/commitdiff
Use read-key in amp-y-or-n-p (bug#75886)
authorGerd Möllmann <gerd@gnu.org>
Thu, 6 Feb 2025 04:31:38 +0000 (05:31 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Feb 2025 08:41:45 +0000 (09:41 +0100)
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Use read-key
so that C-g in recognized when defined in input-decode-map.

(cherry picked from commit ea04dd8ca93d609c0ee475c4acf58a56dfc0f1f3)

lisp/emacs-lisp/map-ynp.el

index 14cbbfda033056ba18087195265807abd455a7d4..18277b60fb89594a23fb778da65747d9eb681b45 100644 (file)
@@ -185,7 +185,12 @@ The function's value is the number of actions taken."
                            (let ((overriding-text-conversion-style nil))
                              (when (fboundp 'set-text-conversion-style)
                                (set-text-conversion-style text-conversion-style))
-                            (setq char (read-event)))
+                             ;; Do NOT use read-event here.  That
+                             ;; function does not consult
+                             ;; input-decode-map (bug#75886).
+                            (setq char (read-key))
+                             (when (eq char ?\C-g)
+                               (signal 'quit nil)))
                          (when (fboundp 'set-text-conversion-style)
                            (set-text-conversion-style text-conversion-style)))
                       ;; Show the answer to the question.