bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69342: query-replace: ignore events not binded in query-replace-map


From: Juri Linkov
Subject: bug#69342: query-replace: ignore events not binded in query-replace-map
Date: Thu, 29 Feb 2024 19:34:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

> I suppose this feature will be available starting from Emacs version 30,
> right?

Yes, not before the next release.

> In the meantime, I was suggested this code on StackExchange
> (https://emacs.stackexchange.com/a/80494/15606):
>
> (defvar my-do-nothing-map
>   (let ((map (make-keymap)))
>     (set-char-table-range (nth 1 map) t 'ignore)
>     map))
>
> (set-keymap-parent query-replace-map my-do-nothing-map)
>
> and it seems to work with the actual version of query-replace.

Interesting hack.

> @@ -3111,7 +3111,7 @@ perform-replace
>                 ;; 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

Still this could be fixed as well.  Only one thing that I don't understand
is why lookup-key ignores bindings for [t] by default.  This requires adding
ACCEPT-DEFAULT=t to all calls.  But ok, this can't be changed now.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]