all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: xref-query-replace
Date: Sat, 9 Jan 2016 19:48:17 +0300	[thread overview]
Message-ID: <569139D1.5040907@yandex.ru> (raw)
In-Reply-To: <831t9qogl8.fsf@gnu.org>

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	other threads:[~2016-01-09 16:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-09 15:28 xref-query-replace Eli Zaretskii
2016-01-09 15:50 ` xref-query-replace Dmitry Gutov
2016-01-09 16:36   ` xref-query-replace Eli Zaretskii
2016-01-09 16:48     ` Dmitry Gutov [this message]
2016-01-09 17:08       ` xref-query-replace Eli Zaretskii
2016-01-09 20:05         ` xref-query-replace Dmitry Gutov
2016-01-09 20:10           ` xref-query-replace Eli Zaretskii
2016-01-09 20:22             ` xref-query-replace Dmitry Gutov
2016-01-09 20:27               ` xref-query-replace Eli Zaretskii
2016-01-09 20:35                 ` xref-query-replace Dmitry Gutov
2016-01-09 20:40                   ` xref-query-replace Eli Zaretskii
2016-01-09 20:46                     ` xref-query-replace Dmitry Gutov
2016-01-10  3:32                       ` xref-query-replace Eli Zaretskii
2016-01-10  3:54                         ` xref-query-replace Dmitry Gutov
2016-01-10 15:52                           ` xref-query-replace Eli Zaretskii
2016-01-10 16:02                             ` xref-query-replace Dmitry Gutov
2016-01-19  0:11                             ` xref-query-replace John Wiegley
2016-01-19  0:19                               ` xref-query-replace Dmitry Gutov
2016-01-19  0:28                                 ` xref-query-replace John Wiegley
2016-01-19  0:35                                   ` xref-query-replace Dmitry Gutov

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=569139D1.5040907@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.