all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: xref-query-replace
Date: Sat, 09 Jan 2016 18:36:19 +0200	[thread overview]
Message-ID: <831t9qogl8.fsf@gnu.org> (raw)
In-Reply-To: <56912C28.8010002@yandex.ru> (message from Dmitry Gutov on Sat, 9 Jan 2016 18:50:00 +0300)

> Cc: emacs-devel@gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Sat, 9 Jan 2016 18:50:00 +0300
> 
> On 01/09/2016 06:28 PM, Eli Zaretskii wrote:
> > Is this command supposed to work?
> 
> You invoke it from an xref output buffer, to perform replacement across 
> the results of a "find references" or "find regexp" command.

That's what I believe I tried.  See below.

> 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?)

> > If so, could someone please explain
> > what its argument FROM means?
> 
> Regexp to match within each match. So, if you made a search for 
> xref-query-replace, you can easily replace "query" with "interactive" in 
> all those matches.

That's what I thought.

> Yes, it's a bit convoluted.

It isn't, really.  The doc string and the prompts could use some
improvement to be less confusing, but they only confused me because
the expected thing didn't happen.

> > I tried the command with both ELisp and etags back-ends, and it seems
> > to always say "No suitable matches here".  The doc string says just
> >
> >    "Perform interactive replacement in all current matches."
> >
> > but what are "current matches"?  Matches of what?
> 
> Matches for input you've given previously to xref-find-regexp?

That's what I thought.

OK, so here's the recipe that didn't work for me on the emacs-25
branch:

  emacs -Q
  M-. deactivate-mark RET

You are now presented with a *xref* buffer with 2 matches, and that
buffer's window is selected.

  r RET ddd RET

Result: "No suitable matches here".

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?)  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?



  reply	other threads:[~2016-01-09 16:36 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   ` Eli Zaretskii [this message]
2016-01-09 16:48     ` xref-query-replace Dmitry Gutov
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=831t9qogl8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dgutov@yandex.ru \
    --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.