[Top][All Lists]

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

Re: unifying emacs "go to definition" functionality

From: Andreas Röhler
Subject: Re: unifying emacs "go to definition" functionality
Date: Wed, 20 Feb 2013 07:59:06 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 20.02.2013 01:28, schrieb Brendan Miller:
Right now emacs has several modules that offer "go to definition"
functionality, all of which have different implementations, and
different behavior.

1. Etags uses M-. and M-* to push and pop from a pair of tag stacks
(find-tag-marker-ring, and tags-location-ring).

2. elisp uses C-h f TAB RETURN to jump to definition. It has no tag
stack, so there's no way to jump back.

3. CEDET uses C-c , J to jump to definition. It has no tag stack,
though it pushes to the global mark ring.

4. Jedi (jump to definition/autocompletion for python) uses C-. It has
no tag stack.

5. SLIME uses etags keybindings, but I don't think it uses etags stack.

By far the etags interface (M-. to jump to definition and push the
location, M-* to pop back), is the easiest interface to use, though
the underlying tagging engine is less precise than the others.

My suggestion is that the etags key bindings and tag stack be made
generic, and that M-. trigger some kind of callback through a buffer
local variable, so that jump to definition can be handled in a mode
specific way.

Note that in addition to reusing the same keybindings, reusing the
same tag stack gives that added benefits that it's possible to
navigate through a high level language into a lower level language,
and then pop back out with M-*. I have this mocked up (in kind of a
hacky way) with elisp and C, where I can jump from elisp into the C
definition of a native function, navigate around C with etags or
CEDET, and then pop back out back into elisp again.

I'd be interested in taking a look at the implementation work behind
this in the future, but initially I just wanted to put the idea out
there for feedback.

Brendan Miller

Are backsides of etags:

need to run in advance, hard to follow when changing Emacs version

My favourite is a solution based on




reply via email to

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