GNU bug report logs -
#60285
xref-query-replace-in-results could show an arrow pointing to the current item being replaced
Previous Next
To reply to this bug, email your comments to 60285 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60285
; Package
emacs
.
(Fri, 23 Dec 2022 19:17:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Daniel Martín <mardani29 <at> yahoo.es>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 23 Dec 2022 19:17:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Severity: wishlist
When you use xref-query-replace-in-results to replace some references,
it'd be great if the xref buffer showed an overlay arrow (see
xref--set-arrow) pointing to the reference being edited. That'd give
better context about the reference that is being edited and the global
progress of the query replace operation.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60285
; Package
emacs
.
(Sat, 24 Dec 2022 17:46:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 60285 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 23/12/2022 21:16, Daniel Martín via Bug reports for GNU Emacs, the
Swiss army knife of text editors wrote:
> Severity: wishlist
>
> When you use xref-query-replace-in-results to replace some references,
> it'd be great if the xref buffer showed an overlay arrow (see
> xref--set-arrow) pointing to the reference being edited. That'd give
> better context about the reference that is being edited and the global
> progress of the query replace operation.
SGTM.
Here's a patch which seems to work. It's a little tricky, though, and
I'm at a loss with better variable names in some places.
Wish we had some unit tests here.
[xref-replace-with-arrow.diff (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60285
; Package
emacs
.
(Sun, 01 Jan 2023 11:24:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 60285 <at> debbugs.gnu.org (full text, mbox):
Dmitry Gutov <dgutov <at> yandex.ru> writes:
> On 23/12/2022 21:16, Daniel Martín via Bug reports for GNU Emacs, the
> Swiss army knife of text editors wrote:
>> Severity: wishlist
>> When you use xref-query-replace-in-results to replace some
>> references,
>> it'd be great if the xref buffer showed an overlay arrow (see
>> xref--set-arrow) pointing to the reference being edited. That'd give
>> better context about the reference that is being edited and the global
>> progress of the query replace operation.
>
> SGTM.
>
> Here's a patch which seems to work. It's a little tricky, though, and
> I'm at a loss with better variable names in some places.
>
> Wish we had some unit tests here.
Thanks. It works well, but there are some corner cases. For example,
as you can undo or go to the previous match during the query replace,
the arrow should point to the previous result, if possible.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60285
; Package
emacs
.
(Wed, 04 Jan 2023 23:49:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 60285 <at> debbugs.gnu.org (full text, mbox):
On 01/01/2023 13:23, Daniel Martín wrote:
> Dmitry Gutov<dgutov <at> yandex.ru> writes:
>
>> On 23/12/2022 21:16, Daniel Martín via Bug reports for GNU Emacs, the
>> Swiss army knife of text editors wrote:
>>> Severity: wishlist
>>> When you use xref-query-replace-in-results to replace some
>>> references,
>>> it'd be great if the xref buffer showed an overlay arrow (see
>>> xref--set-arrow) pointing to the reference being edited. That'd give
>>> better context about the reference that is being edited and the global
>>> progress of the query replace operation.
>> SGTM.
>>
>> Here's a patch which seems to work. It's a little tricky, though, and
>> I'm at a loss with better variable names in some places.
>>
>> Wish we had some unit tests here.
> Thanks. It works well, but there are some corner cases.
Thanks for testing.
> For example,
> as you can undo or go to the previous match during the query replace,
> the arrow should point to the previous result, if possible.
Hmm, I'm not sure how to implement that. Some new hook inside
perform-replace?
Maybe Juri has some ideas.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60285
; Package
emacs
.
(Thu, 05 Jan 2023 17:57:03 GMT)
Full text and
rfc822 format available.
Message #17 received at 60285 <at> debbugs.gnu.org (full text, mbox):
>> For example,
>> as you can undo or go to the previous match during the query replace,
>> the arrow should point to the previous result, if possible.
>
> Hmm, I'm not sure how to implement that. Some new hook inside
> perform-replace?
>
> Maybe Juri has some ideas.
Indeed, there is a special hook for such cases:
'replace-update-post-hook'.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60285
; Package
emacs
.
(Mon, 16 Jan 2023 01:43:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 60285 <at> debbugs.gnu.org (full text, mbox):
On 05/01/2023 19:55, Juri Linkov wrote:
>>> For example,
>>> as you can undo or go to the previous match during the query replace,
>>> the arrow should point to the previous result, if possible.
>> Hmm, I'm not sure how to implement that. Some new hook inside
>> perform-replace?
>>
>> Maybe Juri has some ideas.
> Indeed, there is a special hook for such cases:
> 'replace-update-post-hook'.
That one seems problematic. First of all, I think (?) that we need to
update the arrow's position when the replacement prompt appears, not
after a replacement.
Second, it fires in all cases -- whether the replacement is going
forward, or it being undone, is that right? I suppose this will mean
we'll need to maintain a reverse mapping: from the markers back to the
Xref buffer lines. Hopefully they will be in expected position after the
"undo" actions too.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60285
; Package
emacs
.
(Mon, 16 Jan 2023 17:47:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 60285 <at> debbugs.gnu.org (full text, mbox):
>> Indeed, there is a special hook for such cases:
>> 'replace-update-post-hook'.
>
> That one seems problematic. First of all, I think (?) that we need to
> update the arrow's position when the replacement prompt appears, not after
> a replacement.
Maybe another pre-hook is needed that will run before the prompt?
> Second, it fires in all cases -- whether the replacement is going forward,
> or it being undone, is that right? I suppose this will mean we'll need to
> maintain a reverse mapping: from the markers back to the Xref buffer
> lines. Hopefully they will be in expected position after the "undo" actions
> too.
This needs more experimentation to see how it works.
This bug report was last modified 1 year and 345 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.