]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/replace.el (perform-replace): Accept default bindings in lookup-key.
authorJuri Linkov <juri@linkov.net>
Sat, 2 Mar 2024 17:22:30 +0000 (19:22 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 3 Mar 2024 17:04:56 +0000 (18:04 +0100)
Set ACCEPT-DEFAULT arg of lookup-key to t (bug#69342).
This will allow the users to ignore unbound keys with
‘(define-key query-replace-map [t] 'ignore)’.

(cherry picked from commit ebab7276139888266ae0f27bd3b2874e2ed8c077)

lisp/replace.el

index 61a1cc7714c00c0e0abaa8b548e0858afcff878e..0b4b7cb915f9de4324cae34fb6881b8a863184db 100644 (file)
@@ -2918,7 +2918,7 @@ characters."
 
     ;; If last typed key in previous call of multi-buffer perform-replace
     ;; was `automatic-all', don't ask more questions in next files
-    (when (eq (lookup-key map (vector last-input-event)) 'automatic-all)
+    (when (eq (lookup-key map (vector last-input-event) t) 'automatic-all)
       (setq query-flag nil multi-buffer t))
 
     (cond
@@ -3102,7 +3102,7 @@ characters."
                  ;; read-event that clobbers the match data.
                  (set-match-data real-match-data)
                  (setq key (vector key))
-                 (setq def (lookup-key map key))
+                 (setq def (lookup-key map key t))
                  ;; Restore the match data while we process the command.
                  (cond ((eq def 'help)
                         (let ((display-buffer-overriding-action