[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char
From: |
Stefan Monnier |
Subject: |
bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char |
Date: |
Thu, 07 Sep 2023 12:47:03 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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)
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Filipp Gunbin, 2023/09/07
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Eli Zaretskii, 2023/09/07
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char,
Stefan Monnier <=
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Juri Linkov, 2023/09/07
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Stefan Monnier, 2023/09/07
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Juri Linkov, 2023/09/13
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Stefan Monnier, 2023/09/13
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Juri Linkov, 2023/09/14
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Eli Zaretskii, 2023/09/10
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Stefan Monnier, 2023/09/10
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Eli Zaretskii, 2023/09/11
- bug#65805: 30.0.50; quoted-insert doesn't work in zap-to-char, Stefan Monnier, 2023/09/12