all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* xref-collect-references picks wrong search backend
@ 2015-09-10 15:40 Stephen Leake
  2015-09-11  1:12 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Leake @ 2015-09-10 15:40 UTC (permalink / raw)
  To: emacs-devel

My use case:

I'm browsing Emacs source code (elisp, C, texinfo, etc).

I have run Gnu Global on the Emacs root directory, mostly to find out if
that's useful (so far not, because etags is better, but in other projects
it could be useful).

I'm in an elisp file, and invoke M-? on an elisp function.

That calls xref-collect-references, which let-binds
(semantic-symref-tool 'detect) and calls
semantic-symref-find-references-by-name. That uses a search backend from
semantic-symref-tool-alist, and chooses global.

But global doesn't process elisp files (perhaps it should, but that's
another issue), so no references are found.

I'm actually using an experimental multi-language project setup that
provides an xref-find-function that calls xref-collect-references
directly for elisp searches, so I suggest the following solution:

- Add an optional symref-tool arg to xref-collect-references; my
  xref-find-function can set that to 'grep for elisp searches.

  elisp--xref-find-references could also set it to 'grep.


-- 
-- Stephe



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xref-collect-references picks wrong search backend
  2015-09-10 15:40 xref-collect-references picks wrong search backend Stephen Leake
@ 2015-09-11  1:12 ` Dmitry Gutov
  2015-09-11 15:57   ` Stephen Leake
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2015-09-11  1:12 UTC (permalink / raw)
  To: Stephen Leake, emacs-devel

On 09/10/2015 06:40 PM, Stephen Leake wrote:

> I have run Gnu Global on the Emacs root directory, mostly to find out if
> that's useful (so far not, because etags is better, but in other projects
> it could be useful).

Maybe you should run it in the src/ directory, not the top level one. 
This way, files outside of it won't try to use GNU Global.

> I'm actually using an experimental multi-language project setup that
> provides an xref-find-function that calls xref-collect-references
> directly for elisp searches, so I suggest the following solution:
>
> - Add an optional symref-tool arg to xref-collect-references; my
>    xref-find-function can set that to 'grep for elisp searches.

If you'll find that useful, sure.

But semantic-symref-find-references-by-name in the default 
implementation was just a way to get out something working quickly.

We might even have to bypass it altogether and always use Grep (in the 
default implementation), because any problems with semantic-symref (like 
GTAGS being out of date, or, like in this case, the tagging program 
skipping whole classes of files) are entirely opaque to the user.

 > elisp--xref-find-references could also set it to 'grep.

Since its definition is pretty much the same as the etags one, I was 
going to merge them and put in the new "default" backend.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xref-collect-references picks wrong search backend
  2015-09-11  1:12 ` Dmitry Gutov
@ 2015-09-11 15:57   ` Stephen Leake
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2015-09-11 15:57 UTC (permalink / raw)
  To: emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 09/10/2015 06:40 PM, Stephen Leake wrote:
>
>> I'm actually using an experimental multi-language project setup that
>> provides an xref-find-function that calls xref-collect-references
>> directly for elisp searches, so I suggest the following solution:
>>
>> - Add an optional symref-tool arg to xref-collect-references; my
>>    xref-find-function can set that to 'grep for elisp searches.
>
> If you'll find that useful, sure.

Ok.

>> elisp--xref-find-references could also set it to 'grep.
>
> Since its definition is pretty much the same as the etags one, I was
> going to merge them and put in the new "default" backend.

I don't follow.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-11 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-10 15:40 xref-collect-references picks wrong search backend Stephen Leake
2015-09-11  1:12 ` Dmitry Gutov
2015-09-11 15:57   ` Stephen Leake

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.