bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58158: 29.0.50; [overlay] Interval tree iteration considered harmful


From: Dmitry Gutov
Subject: bug#58158: 29.0.50; [overlay] Interval tree iteration considered harmful
Date: Sat, 8 Oct 2022 21:50:39 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 07.10.2022 22:47, Eli Zaretskii wrote:
Date: Fri, 7 Oct 2022 01:36:17 +0300
Cc: 58158@debbugs.gnu.org, monnier@iro.umontreal.ca
From: Dmitry Gutov <dgutov@yandex.ru>

On 30.09.2022 09:11, Eli Zaretskii wrote:
"M-x xref-query-replace-in-results RET"

JFYI this command has the convenient binding 'r' in Xref output buffers.

It also works only when invoked from the Xref buffer, right?

Yep.

But we also have commands like xref-find-references-and-replace and dired-do-find-regexp-and-replace.

Btw, what am I doing wrong below?

  emacs -Q
  C-x C-f src/character.h RET
  M-x visit-tags-table RET RET
  M-. char_string RET
  r whatever RET

Unexpected result: "No suitable matches here".  Huh? what did I miss?

We can't replace over "find definition" matches: they are more abstract and don't contain the necessary information to perform the replacement (such as the length of a match, for instance).

And such xrefs might navigate you to the beginning of the line, for example, rather than to the beginning of the name.

But that makes sense, doesn't it? If replacing over "find definitions" results worked fine, in the end you would get a codebase where all declarations of a method 'foo' got renamed, but all callsites of it remain unchanged. That couldn't have been your intention, could it?

The error message could use some improvement, I suppose, but I'm not sure how to make it better.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]