GNU bug report logs -
#55110
29.0.50; Regression in query-replace prompt
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Mon, 25 Apr 2022 15:46:01 UTC
Severity: normal
Fixed in version 29.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55110 in the body.
You can then email your comments to 55110 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
arstoffel <at> gmail.com, bug-gnu-emacs <at> gnu.org
:
bug#55110
; Package
emacs
.
(Mon, 25 Apr 2022 15:46:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> linkov.net>
:
New bug report received and forwarded. Copy sent to
arstoffel <at> gmail.com, bug-gnu-emacs <at> gnu.org
.
(Mon, 25 Apr 2022 15:46:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
X-Debbugs-Cc: Augusto Stoffel <arstoffel <at> gmail.com>
I noticed a recent regression after minibuffer-lazy-highlight changes:
0. emacs -Q
1. perform one query-replace to add some FROM and TO to its history:
M-% a RET b RET
2. check that isearch still works in the minibuffer history:
M-% C-r a
3. activate the region, e.g. C-SPC and move point
4. try to isearch in the history again:
M-% C-r a
It fails with: [Failing I-search backward: a]
Maybe this is caused by minibuffer-lazy-highlight-setup
that sets filter to replace--region-filter in the minibuffer
instead of the original buffer?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55110
; Package
emacs
.
(Tue, 26 Apr 2022 19:43:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 55110 <at> debbugs.gnu.org (full text, mbox):
Thanks for the heads up, I'll take a look at this some time soon.
On Mon, 25 Apr 2022 at 18:37, Juri Linkov <juri <at> linkov.net> wrote:
> Maybe this is caused by minibuffer-lazy-highlight-setup
> that sets filter to replace--region-filter in the minibuffer
> instead of the original buffer?
Most likely, yes. `replace--region-filter' is modified globally, so a
similar problem should happen if you temporarily leave the minibuffer
and do Isearch in any other buffer.
If that's the case, I think we would have two options:
1) Add a quick fix for the minibuffer Isearch only.
2) A more complicated change that solves the issue generally by saving
the region filter in the fashion of isearch-lazy-highlight-regexp et
alii.
WDYT?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55110
; Package
emacs
.
(Wed, 27 Apr 2022 07:47:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 55110 <at> debbugs.gnu.org (full text, mbox):
>> Maybe this is caused by minibuffer-lazy-highlight-setup
>> that sets filter to replace--region-filter in the minibuffer
>> instead of the original buffer?
>
> Most likely, yes. `replace--region-filter' is modified globally, so a
> similar problem should happen if you temporarily leave the minibuffer
> and do Isearch in any other buffer.
>
> If that's the case, I think we would have two options:
>
> 1) Add a quick fix for the minibuffer Isearch only.
>
> 2) A more complicated change that solves the issue generally by saving
> the region filter in the fashion of isearch-lazy-highlight-regexp et
> alii.
>
> WDYT?
Recently we fixed a similar problem in `perform-replace'
by creating a dynamically bound value in `let':
(let ((opos (point-marker))
;; Restore original isearch filter to allow
;; using isearch in a recursive edit even
;; when perform-replace was started from
;; `xref--query-replace-1' that let-binds
;; `isearch-filter-predicate' (bug#53758).
(isearch-filter-predicate #'isearch-filter-visible))
So maybe a buffer-local value of `isearch-filter-predicate'
in the minibuffer would help.
Also I recommend to make all hooks in `minibuffer-lazy-highlight-setup'
local by adding the argument LOCAL to add-hook/remove-hook.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55110
; Package
emacs
.
(Sat, 14 May 2022 16:03:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 55110 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Wed, 27 Apr 2022 at 10:44, Juri Linkov <juri <at> linkov.net> wrote:
>>> Maybe this is caused by minibuffer-lazy-highlight-setup
>>> that sets filter to replace--region-filter in the minibuffer
>>> instead of the original buffer?
>>
>> Most likely, yes. `replace--region-filter' is modified globally, so a
>> similar problem should happen if you temporarily leave the minibuffer
>> and do Isearch in any other buffer.
>>
>> If that's the case, I think we would have two options:
>>
>> 1) Add a quick fix for the minibuffer Isearch only.
>>
>> 2) A more complicated change that solves the issue generally by saving
>> the region filter in the fashion of isearch-lazy-highlight-regexp et
>> alii.
>>
>> WDYT?
>
> Recently we fixed a similar problem in `perform-replace'
> by creating a dynamically bound value in `let':
>
> (let ((opos (point-marker))
> ;; Restore original isearch filter to allow
> ;; using isearch in a recursive edit even
> ;; when perform-replace was started from
> ;; `xref--query-replace-1' that let-binds
> ;; `isearch-filter-predicate' (bug#53758).
> (isearch-filter-predicate #'isearch-filter-visible))
>
> So maybe a buffer-local value of `isearch-filter-predicate'
> in the minibuffer would help.
Yes, that indeed solves the problem. See attached patch.
> Also I recommend to make all hooks in `minibuffer-lazy-highlight-setup'
> local by adding the argument LOCAL to add-hook/remove-hook.
Indeed, the minibuffer lazy highlight feature is currently incompatible
with recursive minibuffers. The patch fixes that as well.
There's a caveat, though: isearch in a recursive minibuffer is again
affected by the presence of an inappropriate filter function. Fixing
that in a robust way might require a bigger refactoring of the lazy
highlight feature, I think. Another option might be to make
`replace--region-filter' also check for the value of `(current-buffer)'.
[0001-Make-minibuffer-lazy-highlight-setup-buffer-local-wh.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#55110
; Package
emacs
.
(Sun, 15 May 2022 18:47:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 55110 <at> debbugs.gnu.org (full text, mbox):
>> So maybe a buffer-local value of `isearch-filter-predicate'
>> in the minibuffer would help.
>
> Yes, that indeed solves the problem. See attached patch.
Thanks, pushed.
>> Also I recommend to make all hooks in `minibuffer-lazy-highlight-setup'
>> local by adding the argument LOCAL to add-hook/remove-hook.
>
> Indeed, the minibuffer lazy highlight feature is currently incompatible
> with recursive minibuffers. The patch fixes that as well.
>
> There's a caveat, though: isearch in a recursive minibuffer is again
> affected by the presence of an inappropriate filter function. Fixing
> that in a robust way might require a bigger refactoring of the lazy
> highlight feature, I think. Another option might be to make
> `replace--region-filter' also check for the value of `(current-buffer)'.
I see no problem to fix this because every minibuffer uses own buffer,
so they have separate buffer-local variables.
bug marked as fixed in version 29.0.50, send any further explanations to
55110 <at> debbugs.gnu.org and Juri Linkov <juri <at> linkov.net>
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Wed, 08 Jun 2022 16:41:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 07 Jul 2022 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 348 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.