unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Filipp Gunbin <fgunbin@fastmail.fm>, 65805@debbugs.gnu.org
Subject: bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char
Date: Thu, 07 Sep 2023 12:47:03 -0400	[thread overview]
Message-ID: <jwvjzt2djbx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <834jk6yqbh.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 07 Sep 2023 18:07:46 +0300")

Eli Zaretskii [2023-09-07 18:07:46] wrote:

>> From: Filipp Gunbin <fgunbin@fastmail.fm>
>> 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)






  reply	other threads:[~2023-09-07 16:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07 14:53 bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char Filipp Gunbin
2023-09-07 15:07 ` Eli Zaretskii
2023-09-07 16:47   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-09-07 17:13     ` Juri Linkov
2023-09-07 17:48       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 16:39         ` Juri Linkov
2023-09-13 17:48           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-14  6:45             ` Juri Linkov
2023-09-10  7:17     ` Eli Zaretskii
2023-09-10 23:14       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-11 11:44         ` Eli Zaretskii
2023-09-12 17:00           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvjzt2djbx.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65805@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=fgunbin@fastmail.fm \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).