From unknown Wed Jun 18 23:07:51 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65805 <65805@debbugs.gnu.org> To: bug#65805 <65805@debbugs.gnu.org> Subject: Status: 30.0.50; quoted-insert doesn't work in zap-to-char Reply-To: bug#65805 <65805@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:07:51 +0000 retitle 65805 30.0.50; quoted-insert doesn't work in zap-to-char reassign 65805 emacs submitter 65805 Filipp Gunbin severity 65805 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 10:53:56 2023 Received: (at submit) by debbugs.gnu.org; 7 Sep 2023 14:53:56 +0000 Received: from localhost ([127.0.0.1]:40872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeGOJ-0001I8-Kq for submit@debbugs.gnu.org; Thu, 07 Sep 2023 10:53:55 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeGOF-0001Hr-7E for submit@debbugs.gnu.org; Thu, 07 Sep 2023 10:53:54 -0400 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 1qeGO7-0004CA-P2 for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 10:53:43 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeGO5-0002xO-GB for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 10:53:43 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 42F4F5C015E for ; Thu, 7 Sep 2023 10:53:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 07 Sep 2023 10:53:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1694098419; x=1694184819; bh=wONsDlsUXPg4xNs1jZxMwqv6/ zIhVsZBf92m26Skm/M=; b=b7GfB2RTFS3nKT0Aza602bpUCI+qbJQTddmhjQ0Vu MC+aibZKre9dEME76T5fRvExE3RwWXqF7MR1OBja11IjX7RG/EnwXz2lZWpah43P bztYxTFUZfxiPLnhZWprQqfzapkfocK0ZR1teXp8jyr/He0Eh3d1NOYG076PkURR euaLx4IJVFxuzvEtLf2lbW2GPmz/2KjOGFzz8xFq0RiNBxIquRzYyxaKNe1P4pLr CvQQENB4YxXBg+f3SVkTruGxRJkdeq0F1fEyQswJxg1CdPLa1u5NNm10mBfXlnnF a27vdllkTV85Elk9RiMK2iQPH5wK6uPnJUxOo5HALcp+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694098419; x=1694184819; bh=wONsDlsUXPg4xNs1jZxMwqv6/zIhVsZBf92 m26Skm/M=; b=c5klp/Mc7apRYw+Nq2Cx1Pl3ze8eKJWaRAPcR0Qd0Al2oshzzmF XsFBlZH0KpL3q7p4/mCEMDjSiDxPaMLY3ogexla3J8PWP0nNbjmfy2vZgcExLoF3 +iMulGsxm94Wl5LQeovsbNVGyu/ctTDaYR8xylwnyy9HDat5XHaFq0lglMlep6ub Iv0lDIcRPFxiJDGYoWWMci72XqC/0e+wlt6/8068W3OP7PKg2b1wUcs4iLwZhIb4 7BFD12XZscWigTwjwfEcwgqX7qL+2ZLMIoU5oY7FSLt5/Wdst5twr0Ez8o9KyF3L oxso1hKxhStWNWiuIqX716CMVBzNIFv3HfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehhedgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufgffkfggtgesthdtredttd ertdenucfhrhhomhephfhilhhiphhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghs thhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpeetkefggfejudejkeevheduteffud ffjeeutdevveefueevgfeiieeuueelkeduudenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehfghhunhgsihhnsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: id48c41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 7 Sep 2023 10:53:38 -0400 (EDT) From: Filipp Gunbin To: bug-gnu-emacs@gnu.org Subject: 30.0.50; quoted-insert doesn't work in zap-to-char User-Agent: Gnus/5.13 (Gnus v5.13) Mail-Followup-To: bug-gnu-emacs@gnu.org Date: Thu, 07 Sep 2023 17:53:33 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.29; envelope-from=fgunbin@fastmail.fm; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, I'm not sure this should be treated as bug (and can be fixed), but still I find it inconvenient. - emacs -Q - Open new buffer in text mode - Type "foo C-q C-i bar" - Now, with point at "foo", isearch for tab character works: "C-s C-q C-i" - But zap-to-char doesn't: "M-z C-q C-i RET" displays "Wrong answer" Thanks. In GNU Emacs 30.0.50 (build 27, x86_64-apple-darwin20.6.0, NS appkit-2022.70 Version 11.7.7 (Build 20G1345)) of 2023-09-06 built on fgunbin.local Repository revision: 7055e47cde4d18b50ef11a1422a64d69f8a550a2 Repository branch: master System Description: macOS 11.7.7 Configured using: 'configure --enable-check-lisp-object-type --with-file-notification=no' Configured features: ACL GLIB GNUTLS LCMS2 LIBXML2 MODULES NS PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS WEBP XIM ZLIB Important settings: value of $LC_ALL: ru_RU.UTF-8 value of $LC_CTYPE: UTF-8 locale-coding-system: utf-8-unix From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 11:08:09 2023 Received: (at 65805) by debbugs.gnu.org; 7 Sep 2023 15:08:09 +0000 Received: from localhost ([127.0.0.1]:40926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeGc4-0001oo-P1 for submit@debbugs.gnu.org; Thu, 07 Sep 2023 11:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeGc2-0001o9-CM for 65805@debbugs.gnu.org; Thu, 07 Sep 2023 11:08:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeGbu-0002Uy-Lo; Thu, 07 Sep 2023 11:07:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=sEtGlWc2h4ixM5yjq/Tn/o7HmghObrWtnGTRTSrbT9c=; b=QYkRrkhTcU7F ttJUZas5O+uMTQ2Y8SE3JH+Ygx10C8GhzSAUNzpW8yMbdXIjvCkMg1QzJ4dOTCq9mqlhmCWZ1IHQt ge+YfYBaB1Hxmd5Q6AZ0hCN+4nroCu+xGtFOBtwW83v0gOx1Irg2xFGUcNneLg/SEzjMzFZ9wDMGs xqtw1tbeXQXmXAshNQr+JKxhvzaqJNTp/ayByJxp/Plh1Yr/HUeoqnAeGoOZVoNgU3OIcVzc0OPg7 OjCfGuCDJHilCBg/EIS3Ot2BCW0kjbHzKnWGxzECyP6/j34hxSSPCMMjPICpKVrV3yqSxX3LJda7v P2I8favfzv378xFqAHfClw==; Date: Thu, 07 Sep 2023 18:07:46 +0300 Message-Id: <834jk6yqbh.fsf@gnu.org> From: Eli Zaretskii To: Filipp Gunbin , Stefan Monnier In-Reply-To: (message from Filipp Gunbin on Thu, 07 Sep 2023 17:53:33 +0300) Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65805 Cc: 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Filipp Gunbin > Date: Thu, 07 Sep 2023 17:53:33 +0300 > > Hi, I'm not sure this should be treated as bug (and can be fixed), but > still I find it inconvenient. > > - emacs -Q > - Open new buffer in text mode > - Type "foo C-q C-i bar" > - Now, with point at "foo", isearch for tab character works: "C-s C-q C-i" > - But zap-to-char doesn't: "M-z C-q C-i RET" displays "Wrong answer" That's because we switched to using read-from-minibuffer (via read-char-from-minibuffer) instead of using read-char, for the dubious benefit of being able to use history in this command, see bug#10477. And read-from-minibuffer interprets some characters specially. Stefan, is there a way to have this cake and eat it, too? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 12:47:16 2023 Received: (at 65805) by debbugs.gnu.org; 7 Sep 2023 16:47:16 +0000 Received: from localhost ([127.0.0.1]:41251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeIA0-00048i-Ay for submit@debbugs.gnu.org; Thu, 07 Sep 2023 12:47:16 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeI9w-00048T-Tb for 65805@debbugs.gnu.org; Thu, 07 Sep 2023 12:47:14 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9879710006B; Thu, 7 Sep 2023 12:47:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694105224; bh=g7zjLdJGrMGsm+Z21qn0A6GTlE37pZ7zSWdVcuHuDp0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=J6EMm4s4tW8Rq5HqdBE2jbsGYtVF5Mx5K73SjSPvXbEtFKhMSHEirX+PRaM4R4dvW nasCBmdwuHKnqiwnqvuHTvc1QEfP9ImzxtJtikNPDU4vccE4UIzCRUJalTq4P/+NhP bk6kSpmPX7daBFP4q5w4vrmRmBeSXAGRkKm50TeFeTE1qzxfqMWUB0DLabsvlsf21J VF4SS1LbdzVFRM0vloN4gH2TMJSd8UHACjgeMDyZGKnkb71jce9Ko+y6WRlf/0LuU1 jnFq/ouc3iVjiWlF5hYP5sfbT9FidykyniaZ+ugSZK6CGQf8zVyvoYoohfgcx8e3oj AK/txYJ0ZIFig== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8F09C100046; Thu, 7 Sep 2023 12:47:04 -0400 (EDT) Received: from pastel (69-165-136-223.dsl.teksavvy.com [69.165.136.223]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 68D71120296; Thu, 7 Sep 2023 12:47:04 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char In-Reply-To: <834jk6yqbh.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 07 Sep 2023 18:07:46 +0300") Message-ID: References: <834jk6yqbh.fsf@gnu.org> Date: Thu, 07 Sep 2023 12:47:03 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.076 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65805 Cc: Filipp Gunbin , 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii [2023-09-07 18:07:46] wrote: >> From: Filipp Gunbin >> Date: Thu, 07 Sep 2023 17:53:33 +0300 >> >> Hi, I'm not sure this should be treated as bug (and can be fixed), but >> still I find it inconvenient. >> >> - emacs -Q >> - Open new buffer in text mode >> - Type "foo C-q C-i bar" >> - Now, with point at "foo", isearch for tab character works: "C-s C-q C-i" >> - But zap-to-char doesn't: "M-z C-q C-i RET" displays "Wrong answer" > > That's because we switched to using read-from-minibuffer (via > read-char-from-minibuffer) instead of using read-char, for the dubious > benefit of being able to use history in this command, see bug#10477. > And read-from-minibuffer interprets some characters specially. > > Stefan, is there a way to have this cake and eat it, too? How 'bout the patch below? AFAICT it would also make it unnecessary to use `read-char-from-minibuffer-insert-char`. Stefan diff --git a/lisp/subr.el b/lisp/subr.el index 216981eaf31..5b268e9a069 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3733,7 +3733,14 @@ read-char-from-minibuffer read-char-from-minibuffer-map)) ;; Protect this-command when called from pre-command-hook (bug#45029) (this-command this-command) - (result (progn + (result (minibuffer-with-setup-hook + (lambda () + (add-hook 'post-command-hook + (lambda () + (if (= (1+ (minibuffer-prompt-end)) + (point-max)) + (exit-minibuffer))) + 'local)) ;; Disable text conversion if it is enabled. ;; (bug#65370) (when (fboundp 'set-text-conversion-style) From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 13:17:41 2023 Received: (at 65805) by debbugs.gnu.org; 7 Sep 2023 17:17:41 +0000 Received: from localhost ([127.0.0.1]:41283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeIdR-0004xm-0v for submit@debbugs.gnu.org; Thu, 07 Sep 2023 13:17:41 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:55211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeIdO-0004xV-HT for 65805@debbugs.gnu.org; Thu, 07 Sep 2023 13:17:39 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2088C60002; Thu, 7 Sep 2023 17:17:28 +0000 (UTC) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char In-Reply-To: (Stefan Monnier via's message of "Thu, 07 Sep 2023 12:47:03 -0400") Organization: LINKOV.NET References: <834jk6yqbh.fsf@gnu.org> Date: Thu, 07 Sep 2023 20:13:10 +0300 Message-ID: <86msxx3nw9.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65805 Cc: Eli Zaretskii , Filipp Gunbin , 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > AFAICT it would also make it unnecessary to use > `read-char-from-minibuffer-insert-char`. > > @@ -3733,7 +3733,14 @@ read-char-from-minibuffer > read-char-from-minibuffer-map)) > ;; Protect this-command when called from pre-command-hook (bug#45029) > (this-command this-command) > - (result (progn > + (result (minibuffer-with-setup-hook > + (lambda () > + (add-hook 'post-command-hook > + (lambda () > + (if (= (1+ (minibuffer-prompt-end)) > + (point-max)) > + (exit-minibuffer))) > + 'local)) I have a patch where exit-minibuffer in read-char-from-minibuffer-map is bound to a new command that ensures that the minibuffer contains exactly 1 character before exiting. But need more testing to see what is better. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 13:48:50 2023 Received: (at 65805) by debbugs.gnu.org; 7 Sep 2023 17:48:50 +0000 Received: from localhost ([127.0.0.1]:41347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeJ7a-0005qH-DN for submit@debbugs.gnu.org; Thu, 07 Sep 2023 13:48:50 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeJ7W-0005q1-01 for 65805@debbugs.gnu.org; Thu, 07 Sep 2023 13:48:48 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4F7A980348; Thu, 7 Sep 2023 13:48:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694108912; bh=aW+LGHTHR2rmaLdrCtManT1mKC1CSFfjADTljScgQ+U=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=cz5WwIXipUAiuK4N8HGPI2YZyFuswbXLkE1sQkRAki0R0iPg+1/wmIRuZQ684hxuX xR9DMkIzFpd3Piu9AvtlovE7K355Wq/mib5xrxHJsweOrZpA+Yvv5SfaSx4jY/zM4c zyu5tl8on0hlKEa2FgAkGzyV12gLkQCsPyyfSclLkDscrOgEYJkd6BPZE7hG30rMeD uknAV/FN1ERxv/74PaWMK/8OBLJTYObfD6rzXStthmAnzRZ2+yVEqCz9NDSCO/UHAl wR7ia9fvK+8uLROiMZDlcnlvsXCn79PA5VQ5/SHcDkIOubwplbQwCfofaZk7tetEea 1UBcBabN1a0OQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8CD75805A7; Thu, 7 Sep 2023 13:48:32 -0400 (EDT) Received: from pastel (69-165-136-223.dsl.teksavvy.com [69.165.136.223]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5C29812031F; Thu, 7 Sep 2023 13:48:32 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char In-Reply-To: <86msxx3nw9.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 07 Sep 2023 20:13:10 +0300") Message-ID: References: <834jk6yqbh.fsf@gnu.org> <86msxx3nw9.fsf@mail.linkov.net> Date: Thu, 07 Sep 2023 13:48:31 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.029 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65805 Cc: Eli Zaretskii , Filipp Gunbin , 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> @@ -3733,7 +3733,14 @@ read-char-from-minibuffer >> read-char-from-minibuffer-map)) >> ;; Protect this-command when called from pre-command-hook (bug#45029) >> (this-command this-command) >> - (result (progn >> + (result (minibuffer-with-setup-hook >> + (lambda () >> + (add-hook 'post-command-hook >> + (lambda () >> + (if (= (1+ (minibuffer-prompt-end)) >> + (point-max)) >> + (exit-minibuffer))) >> + 'local)) > > I have a patch where exit-minibuffer in read-char-from-minibuffer-map > is bound to a new command that ensures that the minibuffer contains > exactly 1 character before exiting. But need more testing to see > what is better. `read-char-from-minibuffer` usually doesn't require the user to use an explicit key to exit (because it tries to mimic `read-char`). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 10 03:18:14 2023 Received: (at 65805) by debbugs.gnu.org; 10 Sep 2023 07:18:14 +0000 Received: from localhost ([127.0.0.1]:48868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfEhy-0003dB-Ci for submit@debbugs.gnu.org; Sun, 10 Sep 2023 03:18:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfEhu-0003cy-SV for 65805@debbugs.gnu.org; Sun, 10 Sep 2023 03:18:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfEhl-00050B-Ui; Sun, 10 Sep 2023 03:18:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=fU2FtWEJf7BdhUp4+US67GTF1xwsIGUSOYQfWm11onY=; b=gv+sP7R4xBTd E8uyxza09YNGRlaCY7ByGAtNhxkmu/91+7+SNA1BvmdyQRqbnaFizCf+3xQho3TCxeadMxNpIV/8J 6npJCS0mTWtQK8cP+b+VM/0jU5KFRckljo+9VdikZ0N3KrCzKtVQjXlB+5QUuDaE8X/te5UsyI6bL HwEUvjOhrIvi/haoqWE4MJp9Bbk0vFDGNEuX26XPX9zykz25SJ+cmayKPU5Z6RAdv9M3Zv/d/7e4h sMTCFkkwGNMYXb8AdaoswkgnRJXQ04NyysvZnvE16bo2dUulyyMnUXELbB9sMiNOAA/Dcca9Ioscs nlfnW9o3qRpStYrC3nCYVA==; Date: Sun, 10 Sep 2023 10:17:39 +0300 Message-Id: <83v8cisdik.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Thu, 07 Sep 2023 12:47:03 -0400) Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char References: <834jk6yqbh.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65805 Cc: fgunbin@fastmail.fm, 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Filipp Gunbin , 65805@debbugs.gnu.org > Date: Thu, 07 Sep 2023 12:47:03 -0400 > > Eli Zaretskii [2023-09-07 18:07:46] wrote: > > > That's because we switched to using read-from-minibuffer (via > > read-char-from-minibuffer) instead of using read-char, for the dubious > > benefit of being able to use history in this command, see bug#10477. > > And read-from-minibuffer interprets some characters specially. > > > > Stefan, is there a way to have this cake and eat it, too? > > How 'bout the patch below? Is this appropriate for emacs-29? > AFAICT it would also make it unnecessary to use > `read-char-from-minibuffer-insert-char`. Not sure I understand what are you proposing here about that function. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 10 19:14:48 2023 Received: (at 65805) by debbugs.gnu.org; 10 Sep 2023 23:14:48 +0000 Received: from localhost ([127.0.0.1]:51525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfTdf-00015L-Pv for submit@debbugs.gnu.org; Sun, 10 Sep 2023 19:14:48 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfTdd-000158-Rg for 65805@debbugs.gnu.org; Sun, 10 Sep 2023 19:14:46 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BD6278075E; Sun, 10 Sep 2023 19:14:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694387675; bh=2TlBFWRmKZMtmlzecphHndD72f6APsdrmyPjsXG04gE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DCCHn1jyc7aIkDDznMZ6b9ksRI1VD9rYhaLgqXSgDzCqtKU7CYJS5JmKMX0mkxjdO GLEtwocopYQWqmT5R75o1oLsXEKgW8WLz/YJZfiVSnq9snpHEp0BeU3/KfgoeR6oKu jTtqtEoagS+vOs9L0f/tX8d1Bi6sZ3kTuLwgcZPSA75oTacRskDA0X4nvm8zBwm3nf +Ba+2sG1JArim5BSKr2E/2dBfC6qQDsvsS8Dz7bjlBSjRe+G/nHm71vVjYkAYXUTUH ZIqd9aqX6gQlg6ciYSVcgK6KqfKwTbM8EqddFuKDJFSxareg4knh2ETantFsKOye3Z 7y63FDjF4Hh+A== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A6A9F8007C; Sun, 10 Sep 2023 19:14:35 -0400 (EDT) Received: from alfajor (unknown [104.247.229.91]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6F9A2120223; Sun, 10 Sep 2023 19:14:35 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char In-Reply-To: <83v8cisdik.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 10 Sep 2023 10:17:39 +0300") Message-ID: References: <834jk6yqbh.fsf@gnu.org> <83v8cisdik.fsf@gnu.org> Date: Sun, 10 Sep 2023 19:14:34 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.089 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65805 Cc: fgunbin@fastmail.fm, 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> > That's because we switched to using read-from-minibuffer (via >> > read-char-from-minibuffer) instead of using read-char, for the dubious >> > benefit of being able to use history in this command, see bug#10477. >> > And read-from-minibuffer interprets some characters specially. >> > Stefan, is there a way to have this cake and eat it, too? >> How 'bout the patch below? Had a missing `nil`. > Is this appropriate for emacs-29? It looks fairly safe, but is it a regression in Emacs-29 or was it already there in Emacs-28? If it's not a regression in Emacs-29, I'd keep it in `master`. >> AFAICT it would also make it unnecessary to use >> `read-char-from-minibuffer-insert-char`. > Not sure I understand what are you proposing here about that function. `read-char-from-minibuffer-insert-char` is a function which just inserts a char and then exits the minibuffer. With my patch, `self-insert-command` should work as well for that. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 07:44:45 2023 Received: (at 65805) by debbugs.gnu.org; 11 Sep 2023 11:44:45 +0000 Received: from localhost ([127.0.0.1]:52267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qffLR-00027m-8v for submit@debbugs.gnu.org; Mon, 11 Sep 2023 07:44:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qffLO-00027X-Lz for 65805@debbugs.gnu.org; Mon, 11 Sep 2023 07:44:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qffLF-00024B-82; Mon, 11 Sep 2023 07:44:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=XUz2k7TbNBy8FqAuyhaJVxMpeFD2rLWR6ZRNrjGMH2s=; b=l1evzVAsSPHN 40qazREkkOE18i37YnkOrAP8vik7vO6Zt+nvN17SMEuZN77s3PI3NI9VWAFUWizIOfEaOhl8awh2S hf8DU4eLhzuDC6bJ6OoO8k16TpzYjWnmmm76bQlu82Ba240z94aqJHDd3Z1ISKobKgaN1JGLIwSS0 AUjCj2832wlNZRYOKESm6OsAkJbb5Zgk6CA9/E8NfTtx5CxgYt2w52qlZbMFeJpFZofguM/7kQJcB Hkk861vpk2VBBOwKwggvIA9ybeUkSHFC5ZqHPt10tCB4afK/Y13NE3jhnD/UG+g/kKAEmdO2ELWIV ubiDwRGxWOXnAzHoHP4GjQ==; Date: Mon, 11 Sep 2023 14:44:12 +0300 Message-Id: <83v8chq6ib.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sun, 10 Sep 2023 19:14:34 -0400) Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char References: <834jk6yqbh.fsf@gnu.org> <83v8cisdik.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65805 Cc: fgunbin@fastmail.fm, 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: fgunbin@fastmail.fm, 65805@debbugs.gnu.org > Date: Sun, 10 Sep 2023 19:14:34 -0400 > > >> > That's because we switched to using read-from-minibuffer (via > >> > read-char-from-minibuffer) instead of using read-char, for the dubious > >> > benefit of being able to use history in this command, see bug#10477. > >> > And read-from-minibuffer interprets some characters specially. > >> > Stefan, is there a way to have this cake and eat it, too? > >> How 'bout the patch below? > > Had a missing `nil`. > > > Is this appropriate for emacs-29? > > It looks fairly safe, but is it a regression in Emacs-29 or was it > already there in Emacs-28? It was already in Emacs 28. > If it's not a regression in Emacs-29, I'd keep it in `master`. OK, then please install on master and close this bug when you do. > >> AFAICT it would also make it unnecessary to use > >> `read-char-from-minibuffer-insert-char`. > > Not sure I understand what are you proposing here about that function. > > `read-char-from-minibuffer-insert-char` is a function which just inserts > a char and then exits the minibuffer. With my patch, > `self-insert-command` should work as well for that. I'm okay with making such a change, but we'd probably need a compatibility shim if we do that? So maybe it isn't worth the hassle, just make read-char-from-minibuffer-insert-char obsolete? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 13:00:58 2023 Received: (at 65805-done) by debbugs.gnu.org; 12 Sep 2023 17:00:58 +0000 Received: from localhost ([127.0.0.1]:59886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg6kz-0005rh-UB for submit@debbugs.gnu.org; Tue, 12 Sep 2023 13:00:58 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qg6kv-0005rP-MZ for 65805-done@debbugs.gnu.org; Tue, 12 Sep 2023 13:00:56 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3B1FC444AAF; Tue, 12 Sep 2023 13:00:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694538041; bh=BOXIrqHIktW5xWFUOWq7b5BCdZ6j1bSkhzPUbRbOdM8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=V3iWSS8xoLj8hXEzOrEd71U1OsWYcLh1Jn5paZg6ciBKhrf6PaojsWC15xh1G0ets Moj1Er6xpl+jkbzaoKKuVqpBGsK6SMZdParxxGGFjaOqSyiwZbtUzNuUf61WiIdOYV ln8S/Wu5sFpatlah0laE3Z0WChuRz+ms79IVSM4wJcm6/LlLLI71od21TBANttnnPc a6hKHZ2yOWnUeztrueCrq56P60Sb7j61nDsIFn3gZzA4OHzIfx59AjqKzZbPf2BheW /W12YTcg3ylm7sLHIrIc9zjKHjHJ1LUzMWq/6hv2rQETUhh9XQptshsGM0ipGp5zVL mlAj90Cc/PTIg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CA2C1444AAB; Tue, 12 Sep 2023 13:00:41 -0400 (EDT) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 97ECB12020A; Tue, 12 Sep 2023 13:00:41 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char In-Reply-To: <83v8chq6ib.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Sep 2023 14:44:12 +0300") Message-ID: References: <834jk6yqbh.fsf@gnu.org> <83v8cisdik.fsf@gnu.org> <83v8chq6ib.fsf@gnu.org> Date: Tue, 12 Sep 2023 13:00:40 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65805-done Cc: 65805-done@debbugs.gnu.org, fgunbin@fastmail.fm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > OK, then please install on master and close this bug when you do. Done, closing. >> `read-char-from-minibuffer-insert-char` is a function which just inserts >> a char and then exits the minibuffer. With my patch, >> `self-insert-command` should work as well for that. > > I'm okay with making such a change, but we'd probably need a > compatibility shim if we do that? So maybe it isn't worth the hassle, > just make read-char-from-minibuffer-insert-char obsolete? Actually, it's still used at one place. We could get rid of that use as well, but I haven't bothered (yet :-). Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 13 12:49:26 2023 Received: (at 65805) by debbugs.gnu.org; 13 Sep 2023 16:49:26 +0000 Received: from localhost ([127.0.0.1]:35809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgT3O-0002By-B5 for submit@debbugs.gnu.org; Wed, 13 Sep 2023 12:49:26 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:41157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgT3K-0002Bh-W9 for 65805@debbugs.gnu.org; Wed, 13 Sep 2023 12:49:24 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 54EED24000B; Wed, 13 Sep 2023 16:49:08 +0000 (UTC) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char In-Reply-To: (Stefan Monnier's message of "Thu, 07 Sep 2023 13:48:31 -0400") Organization: LINKOV.NET References: <834jk6yqbh.fsf@gnu.org> <86msxx3nw9.fsf@mail.linkov.net> Date: Wed, 13 Sep 2023 19:39:32 +0300 Message-ID: <86pm2mtatn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65805 Cc: Eli Zaretskii , Filipp Gunbin , 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> I have a patch where exit-minibuffer in read-char-from-minibuffer-map >> is bound to a new command that ensures that the minibuffer contains >> exactly 1 character before exiting. But need more testing to see >> what is better. > > `read-char-from-minibuffer` usually doesn't require the user to use an > explicit key to exit (because it tries to mimic `read-char`). I don't remember how I got into a situation that required typing RET to exit the minibuffer. Probably pasted a character into the minibuffer with C-y. I see that your patch handles this now. @@ -3499,7 +3499,7 @@ read-char-from-minibuffer-map (let ((map (make-sparse-keymap))) (set-keymap-parent map minibuffer-local-map) - (define-key map [remap self-insert-command] #'read-char-from-minibuffer-insert-char) + ;; (define-key map [remap self-insert-command] #'read-char-from-minibuffer-insert-char) (define-key map [remap exit-minibuffer] #'read-char-from-minibuffer-insert-other) Maybe remapping exit-minibuffer is not needed anymore too? @@ -3530,7 +3530,7 @@ read-char-from-minibuffer-insert-other such key, this command discard all minibuffer input and displays an error message." (interactive) - (when (minibufferp) + (when (minibufferp) ;;FIXME: Why? Because of bug#45029. Maybe this bug number should be mentioned in the comments. @@ -3578,6 +3578,10 @@ read-char-from-minibuffer (interactive) (let ((help-form msg)) ; lexically bound msg (help-form-show))))) + ;; FIXME: We use `read-char-from-minibuffer-insert-char' + ;; here only as a kind of alias of `self-insert-command' + ;; to prevent those keys from being remapped to + ;; `read-char-from-minibuffer-insert-other'. (dolist (char chars) (define-key map (vector char) #'read-char-from-minibuffer-insert-char)) (define-key map [remap self-insert-command] #'read-char-from-minibuffer-insert-other) Interesting that [remap self-insert-command] is applied even to the commands explicitly bound to 'self-insert-command' in the same keymap. I see no way to override this. So 'read-char-from-minibuffer-insert-char' can't be replaced with 'self-insert-command'. @@ -3589,7 +3593,15 @@ read-char-from-minibuffer read-char-from-minibuffer-map)) ;; Protect this-command when called from pre-command-hook (bug#45029) (this-command this-command) - (result (progn + (result (minibuffer-with-setup-hook + (lambda () + (add-hook 'post-command-hook + (lambda () + ;; FIXME: Should we use `<='? + (if (= (1+ (minibuffer-prompt-end)) + (point-max)) + (exit-minibuffer))) + nil 'local)) I think we should use `<=' to handle the case when a string with more than 1 character is pasted with 'C-y'. This still requires some special-handling like I intended to do in a new command that exits the minibuffer where it should remove extra characters to leave only one: either the first or the last one. Perhaps leaving the first character makes more sense. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 13 13:50:05 2023 Received: (at 65805) by debbugs.gnu.org; 13 Sep 2023 17:50:05 +0000 Received: from localhost ([127.0.0.1]:35962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgU04-0000gl-LN for submit@debbugs.gnu.org; Wed, 13 Sep 2023 13:50:05 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgTzw-0000g4-A7 for 65805@debbugs.gnu.org; Wed, 13 Sep 2023 13:50:02 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7EE1680551; Wed, 13 Sep 2023 13:49:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694627384; bh=RJ5GPaB+ShfX8zBowhJwK2TnN540SIzgCiy4d/iTgh4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=in6jOXwfyd3Z99w29UNpmiA/ATVA1WqDsmGDiUUtjd9fIWEeiRQB2dDYVXjC3rApc BeRCZlgjwyd9kRHmJHV49fx1sTytxNxx7XFVRTq1Cru4dvmx/zkk1LCDRtZ2T74mot 3axKvC7D33SiIbHG6NRZXPTH9l4vdwdRziOH/7KZVyb5c5mw9EZux7LmffxARPNi+J 5tvlg5qdY8toQ+zPHmhYJTxCqa2nPncrNdTiHrFxyARB7owxnOspKehqHho+mN0Vd4 UPvzrhi55jP3xzvF6dGa6jqCQsYeRlz88hz0BVyp/flq/wgh/rBpxI2ryamA4zJuvc F5g2UCfhD6GEw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2408F803A6; Wed, 13 Sep 2023 13:49:44 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0F5591203C7; Wed, 13 Sep 2023 13:49:44 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char In-Reply-To: <86pm2mtatn.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 13 Sep 2023 19:39:32 +0300") Message-ID: References: <834jk6yqbh.fsf@gnu.org> <86msxx3nw9.fsf@mail.linkov.net> <86pm2mtatn.fsf@mail.linkov.net> Date: Wed, 13 Sep 2023 13:48:34 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.100 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65805 Cc: Eli Zaretskii , Filipp Gunbin , 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> `read-char-from-minibuffer` usually doesn't require the user to use an >> explicit key to exit (because it tries to mimic `read-char`). > I don't remember how I got into a situation that required typing RET > to exit the minibuffer. Probably pasted a character into the minibuffer > with C-y. I see that your patch handles this now. Yes, I tested `C-y` as well :-) Tho the ideal behavior when doing things like "C-y inserts a string of length > 1" is unclear. > @@ -3499,7 +3499,7 @@ read-char-from-minibuffer-map > (let ((map (make-sparse-keymap))) > (set-keymap-parent map minibuffer-local-map) > > - (define-key map [remap self-insert-command] #'read-char-from-minibuffer-insert-char) > + ;; (define-key map [remap self-insert-command] #'read-char-from-minibuffer-insert-char) > (define-key map [remap exit-minibuffer] #'read-char-from-minibuffer-insert-other) > > Maybe remapping exit-minibuffer is not needed anymore too? I think it's still needed (RET would otherwise cause exit with an empty minibuffer, and hence no "char"). > @@ -3530,7 +3530,7 @@ read-char-from-minibuffer-insert-other > such key, this command discard all minibuffer input and displays > an error message." > (interactive) > - (when (minibufferp) > + (when (minibufferp) ;;FIXME: Why? > > Because of bug#45029. Thank you. > Maybe this bug number should be mentioned in the comments. [ Or maybe I should have bothered to `C-x v h` :-( ] > Interesting that [remap self-insert-command] is applied even to the > commands explicitly bound to 'self-insert-command' in the same keymap. Indeed, the command remapping doesn't pay attention to "in which keymap did I find this binding". We could try and refine it, but it could be a lot of work, I think. > I see no way to override this. So 'read-char-from-minibuffer-insert-char' > can't be replaced with 'self-insert-command'. Exactly. We could use something like: (defalias 'read-char-from-minibuffer-insert-char 'self-insert-command) > @@ -3589,7 +3593,15 @@ read-char-from-minibuffer > read-char-from-minibuffer-map)) > ;; Protect this-command when called from pre-command-hook (bug#45029) > (this-command this-command) > - (result (progn > + (result (minibuffer-with-setup-hook > + (lambda () > + (add-hook 'post-command-hook > + (lambda () > + ;; FIXME: Should we use `<='? > + (if (= (1+ (minibuffer-prompt-end)) > + (point-max)) > + (exit-minibuffer))) > + nil 'local)) > > I think we should use `<=' to handle the case when a string with > more than 1 character is pasted with 'C-y'. Indeed, that's one option. But I was thinking that maybe we should try and signal an error. Do the users really expect that yanking a string into that prompt will end up picking just the first char of that string? Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 14 03:00:48 2023 Received: (at 65805) by debbugs.gnu.org; 14 Sep 2023 07:00:48 +0000 Received: from localhost ([127.0.0.1]:36656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qggLI-0006PQ-1a for submit@debbugs.gnu.org; Thu, 14 Sep 2023 03:00:48 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:55317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qggLB-0006Ou-KS for 65805@debbugs.gnu.org; Thu, 14 Sep 2023 03:00:42 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 986A560009; Thu, 14 Sep 2023 07:00:28 +0000 (UTC) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char In-Reply-To: (Stefan Monnier's message of "Wed, 13 Sep 2023 13:48:34 -0400") Organization: LINKOV.NET References: <834jk6yqbh.fsf@gnu.org> <86msxx3nw9.fsf@mail.linkov.net> <86pm2mtatn.fsf@mail.linkov.net> Date: Thu, 14 Sep 2023 09:45:05 +0300 Message-ID: <86h6nxuuby.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65805 Cc: Eli Zaretskii , Filipp Gunbin , 65805@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> @@ -3499,7 +3499,7 @@ read-char-from-minibuffer-map >> (let ((map (make-sparse-keymap))) >> (set-keymap-parent map minibuffer-local-map) >> >> - (define-key map [remap self-insert-command] #'read-char-from-minibuffer-insert-char) >> + ;; (define-key map [remap self-insert-command] #'read-char-from-minibuffer-insert-char) >> (define-key map [remap exit-minibuffer] #'read-char-from-minibuffer-insert-other) >> >> Maybe remapping exit-minibuffer is not needed anymore too? > > I think it's still needed (RET would otherwise cause exit with an empty > minibuffer, and hence no "char"). Hmm, maybe then RET should be bound to a command that signals an error since the behavior is undefined for the case when the minibuffer gets more characters than one, or when the minibuffer is empty. >> I see no way to override this. So 'read-char-from-minibuffer-insert-char' >> can't be replaced with 'self-insert-command'. > > Exactly. We could use something like: > > (defalias 'read-char-from-minibuffer-insert-char 'self-insert-command) I have only one doubt how this will affect the users who already bind this command in own configs. Probably there should be no problems. >> @@ -3589,7 +3593,15 @@ read-char-from-minibuffer >> + (result (minibuffer-with-setup-hook >> + (lambda () >> + (add-hook 'post-command-hook >> + (lambda () >> + ;; FIXME: Should we use `<='? >> + (if (= (1+ (minibuffer-prompt-end)) >> + (point-max)) >> + (exit-minibuffer))) >> + nil 'local)) >> >> I think we should use `<=' to handle the case when a string with >> more than 1 character is pasted with 'C-y'. > > Indeed, that's one option. But I was thinking that maybe we should try > and signal an error. Do the users really expect that yanking a string > into that prompt will end up picking just the first char of that string? Picking just the first char looks like a random choice. So indeed maybe better to signal an error. From unknown Wed Jun 18 23:07:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Oct 2023 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator