all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Gabriele Nicolardi <gabriele@medialab.sissa.it>
Cc: 69342@debbugs.gnu.org
Subject: bug#69342: query-replace: ignore events not binded in query-replace-map
Date: Thu, 29 Feb 2024 19:34:19 +0200	[thread overview]
Message-ID: <86sf1bjj70.fsf@mail.linkov.net> (raw)
In-Reply-To: <93c69078-769f-460f-bfb6-4e942af7e102@medialab.sissa.it> (Gabriele Nicolardi's message of "Sun, 25 Feb 2024 09:19:29 +0100")

> 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	other threads:[~2024-02-29 17:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 22:16 bug#69342: query-replace: ignore events not binded in query-replace-map Gabriele Nicolardi
     [not found] ` <handler.69342.B.170872663926258.ack@debbugs.gnu.org>
2024-02-23 22:33   ` bug#69342: Acknowledgement (query-replace: ignore events not binded in query-replace-map) Gabriele Nicolardi
2024-02-25  7:28 ` bug#69342: query-replace: ignore events not binded in query-replace-map Juri Linkov
2024-02-25  8:19   ` Gabriele Nicolardi
2024-02-29 17:34     ` Juri Linkov [this message]
2024-03-02 17:22   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86sf1bjj70.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=69342@debbugs.gnu.org \
    --cc=gabriele@medialab.sissa.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.