emacs-devel
[Top][All Lists]
Advanced

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

Re: xref-query-replace


From: Dmitry Gutov
Subject: Re: xref-query-replace
Date: Sat, 9 Jan 2016 19:48:17 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Thunderbird/43.0

On 01/09/2016 07:36 PM, Eli Zaretskii wrote:

I've posted a thread about it in November:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01465.html

Thanks.  I've read it now, and it describes exactly what I did.  (Btw,
why does it say to agree to ".*"? aren't other regexps supposed to
work as well?)

Of course. These are just the steps to try it out quickly.

Same result with this recipe:

   emacs -Q
   C-x C-f src/xdisp.c
   M-.

Press RET to confirm visiting the TAGS table in src/ (you should have
one, of course).  You are now presented with a *xref* buffer that
lists many matches for "Display".  (Should xref pick up symbols inside
comments?)

etags does, apparently. Why else would xref show them?

In general, I'd say "yes", for "find references" or "find regexp" results. But not for "find definitions".

In that buffer, type:

   r RET xyzzy RET

I get the same disappointing result.

Stepping through xref-query-replace, it seems like xref-match-length
always returns nil, so no matches are collected.  Which sounds about
right, since I see no non-trivial definitions for xref-match-length,
or maybe I'm blind.

What am I doing wrong?

You're calling the "find definitions" command, not the "find references" or "find regexp".

xref-find-definitions returns a set of xrefs which we don't consider to be a set of "matches", currently. While the English language may frown on this, I think it's good that xref-query-replace doesn't work across the "find definitions" result, because if it did, you'd end up with a codebase in which the function's (definition is|definitions are) renamed, but all its usages keep referring to the old name.

Try starting with xref-find-references (bound to M-?).



reply via email to

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