From: Augusto Stoffel <arstoffel@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 59918@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#59918: 29.0.60; query-replace in the minibuffer lazy-highlights original buffer
Date: Mon, 12 Dec 2022 20:05:52 +0100 [thread overview]
Message-ID: <87o7s8o31r.fsf@gmail.com> (raw)
In-Reply-To: <83iligqyva.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Dec 2022 20:07:53 +0200")
On Mon, 12 Dec 2022 at 20:07, Eli Zaretskii wrote:
>> Cc: 59918@debbugs.gnu.org
>> From: Juri Linkov <juri@linkov.net>
>> Date: Mon, 12 Dec 2022 19:43:25 +0200
>>
>> >> 1. (setq enable-recursive-minibuffers t)
>> >> 1. M-! is C-a
>> >> 2. M-% is
>> >>
>> >> Matches are lazy-highlighted in the original buffer,
>> >> but the replacement is going to be used to replace
>> >> matches in the minibuffer.
>> >
>> > I guess this happens because minibuffer-selected-window returns the
>> > original buffer. I think this patch does the trick?
>>
>> We need to wait until Eli decides whether to install this
>> to emacs-29 or master.
>
> I admit that I don't understand the patch. minibuffer-selected-window
> returns a window, not a buffer, and it returns the window that you
> didn't want, AFAIU.
The check in the patch is whether the buffer of the
minibuffer-selected-window is the current buffer. It's meant to fail
when you are about to start a recursive minibuffer.
> Or maybe I don't understand the root cause -- could one of you please
> elaborate on what happens and why this is the right patch?
The original code assumed that when you are about to activate a
minibuffer, the current buffer will become the (window-buffer
(minibuffer-selected-window)). This is not true if you are entering a
recursive minibuffer, hence the check.
It may or may not be the best patch, but I would say it's the safe one
if were to fix this in Emacs 29. I would also say the issue rare and
basically cosmetic.
> Also, was this code introduced in Emacs 28/29 or earlier?
New in Emacs 29.
next prev parent reply other threads:[~2022-12-12 19:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-09 7:42 bug#59918: 29.0.60; query-replace in the minibuffer lazy-highlights original buffer Juri Linkov
2022-12-10 17:20 ` Juri Linkov
2022-12-10 18:36 ` Eli Zaretskii
2022-12-11 11:40 ` Augusto Stoffel
2022-12-12 17:43 ` Juri Linkov
2022-12-12 18:07 ` Eli Zaretskii
2022-12-12 19:05 ` Augusto Stoffel [this message]
2022-12-12 19:28 ` Eli Zaretskii
2022-12-12 22:42 ` Augusto Stoffel
2022-12-13 12:05 ` Eli Zaretskii
2022-12-13 17:39 ` 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=87o7s8o31r.fsf@gmail.com \
--to=arstoffel@gmail.com \
--cc=59918@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=juri@linkov.net \
/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.