[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unifying emacs "go to definition" functionality
From: |
Helmut Eller |
Subject: |
Re: unifying emacs "go to definition" functionality |
Date: |
Wed, 20 Feb 2013 09:52:06 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
On Wed, Feb 20 2013, Brendan Miller wrote:
> 5. SLIME uses etags keybindings, but I don't think it uses etags stack.
SLIME does use the etags stack but with different keybindings. We use
M-. to push and M-, to pop. M-* is bound to the same command as M-, for
compatibility but most people prefer M-, because , and . are adjacent on
their keyboards and M-* is usually quite hard to type.
I think M-, is the better choice and it should be the standard.
[...]
> 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.
Using the etags stack is pretty easy. A more difficult problem is how
to deal with names that have multiple definitions or definitions that
have multiple source locations. E.g. in Emacs Lisp a variable and a
function can have the same name or in C a function can have a prototype
definition in a .h file and the actual definition is a .c file. This
problem is especially important with languages that have multiple
methods with the same name.
In SLIME, when a name has multiple definitions we display all
definitions (one per line with some context) in a special buffer and the
user must then choose which one he wants (the next/previous-line
commands in that buffer automatically displays the source of the current
definition in the other buffer).
The autocomplete package uses something like a menu for this problem.
etags jumps to the first candidate and provides something like
next/previous-definition commands, but I think that solution is very
hard to use. At least it drives me nuts, because I never know how many
more definitions there are and I can't remember the key bindings.
Helmut