From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#69342: query-replace: ignore events not binded in query-replace-map Date: Thu, 29 Feb 2024 19:34:19 +0200 Organization: LINKOV.NET Message-ID: <86sf1bjj70.fsf@mail.linkov.net> References: <864jdx11qx.fsf@mail.linkov.net> <93c69078-769f-460f-bfb6-4e942af7e102@medialab.sissa.it> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24294"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 69342@debbugs.gnu.org To: Gabriele Nicolardi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 29 18:51:02 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rfkYg-00066P-Hb for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Feb 2024 18:51:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfkYU-00022k-DO; Thu, 29 Feb 2024 12:50:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfkYH-0001pk-DH for bug-gnu-emacs@gnu.org; Thu, 29 Feb 2024 12:50:37 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rfkYE-0004e7-Pq for bug-gnu-emacs@gnu.org; Thu, 29 Feb 2024 12:50:35 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rfkYg-0003Fu-1D for bug-gnu-emacs@gnu.org; Thu, 29 Feb 2024 12:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Feb 2024 17:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69342 X-GNU-PR-Package: emacs Original-Received: via spool by 69342-submit@debbugs.gnu.org id=B69342.170922901812441 (code B ref 69342); Thu, 29 Feb 2024 17:51:01 +0000 Original-Received: (at 69342) by debbugs.gnu.org; 29 Feb 2024 17:50:18 +0000 Original-Received: from localhost ([127.0.0.1]:35291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfkXy-0003Eb-0t for submit@debbugs.gnu.org; Thu, 29 Feb 2024 12:50:18 -0500 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:38073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfkXv-0003EM-FJ for 69342@debbugs.gnu.org; Thu, 29 Feb 2024 12:50:16 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id B58D0C0003; Thu, 29 Feb 2024 17:49:40 +0000 (UTC) In-Reply-To: <93c69078-769f-460f-bfb6-4e942af7e102@medialab.sissa.it> (Gabriele Nicolardi's message of "Sun, 25 Feb 2024 09:19:29 +0100") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280797 Archived-At: > 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.