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: Sun, 10 Jan 2016 17:52:35 +0200	[thread overview]
Message-ID: <83d1t9mny4.fsf@gnu.org> (raw)
In-Reply-To: <5691D5FA.8040201@yandex.ru> (message from Dmitry Gutov on Sun, 10 Jan 2016 06:54:34 +0300)

> Cc: emacs-devel@gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Sun, 10 Jan 2016 06:54:34 +0300
> 
>     I don't understand the importance of the length, but the definition of
> 
> Knowing the length lets us determine the boundaries of the match inside the file. This information is gathered at the time the xref instance in constructed.
> 
>     a method points to a specific source line, exactly like a reference.
>     So whatever you gather from a reference could be done with a
>     definition, no?
> 
> What will I do with the source line, then? Suppose TAGS file contains an entry for the method "foo" pointing to the line
> 
>   def self.foo
> 
> And the backend returns it as one of the results for the definition of "foo". How will we determine the bounds of the match? (search-forward "foo")? What if the line looks line this?
> 
>   def self.foo(bar); @foo = bar; self.another_foo(@foo); end
> 
> We'll get false positives this way.

By "false positives" do you mean matches to text that isn't really a
reference to 'foo'?  This command is interactive, so the user can
reject irrelevant matches and accept only the relevant ones.  So I see
this issue as a less important one.  We could even display a warning
about potential false matches when the command is invoked in such a
buffer.

By contrast, having a command inexplicably fail in a buffer that looks
and feels exactly like another one, where the command does work, is a
worse problem, IMO.  If you insist on leaving things as they are, be
prepared for bug reports.

> To put it differently, neither etags, nor find-func.el provide the necessary information to create xrefs with match boundary information.

The boundary information just makes the matches more accurate, but it
doesn't invalidate them, AFAIU.

>         If we define a collective term for such xref functions, we could mention
>         it in their docstrings.
> 
>     I just don't see what kind of collective name would be possble.
> 
> Well, I wouldn't ask if I managed to come up with one. I don't see another way to resolve the issue, however. 

Then I guess it will remain unresolved.  Too bad.



  reply	other threads:[~2016-01-10 15:52 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     ` 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                           ` Eli Zaretskii [this message]
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=83d1t9mny4.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.