tags:

views:

255

answers:

7

I'd like to quickly move point to a function in my Emacs buffer. I'd like to run some function and get a prompt asking me for the function name, with completion provided for every function defined in the current buffer.

I generally use etags to navigate around, but sometimes I'm looking for a framework method that's been overridden in several files. In these cases, I can find the file I need but then I'd like to quickly jump to the function there. There is a similar feature in TextMate where you can select a definition from a list in the bottom right of the editor.

A: 

Icicles is probably closer to what you are looking for:

http://www.emacswiki.org/emacs/Icicles_-_Tags_Enhancements

It's an enhancement to etags and includes (among other things) the file name with the tag so you can tell if it's the one you are looking for.

Joshua Smith
A: 

try CEDET. It is a bit difficult to set up the first, but here is an excellent tutorial: by Alex ott

And when he gets installed, you can use semantic-complete-jump. pressed tab couple times, and it is also brings up symbol definitions.

aaa
Semantic also has nice integration with Anything, and the `anything-c-source-semantic` source gives a list of everything found by semantic.
haxney
A: 

speedbar comes standard, and gives you a collapsible menu for each file in the current directory, by default middle clicking on an entry for a function definition jumps to that def. With emacs23 this was changed to the more normal leftclick.

Justin Smith
A: 

If M-. brings up the wrong method, you can type C-u M-. to find the next one with the same name.

offby1
+9  A: 

Just to jump around functions in the current file? Use imenu. It's the simplest and lightest of all the alternatives listed so far and might be enough for what you want. It's also built into Emacs and has minimum setup hassle. It features graphical and textual interface. Anything extra and you'll be better off using one of the other excellent suggestions made here.

Noufal Ibrahim
What languages are supported? C-family and Elisp, what else?
Wei Hu
I think most of the inbuilt modes work fine with imenu. It's pretty easy to add imenu support to a mode as well. It works for Python and in Cperl mode. I've used those.
Noufal Ibrahim
C# works, but see http://stackoverflow.com/questions/2240320
Cheeso
+2  A: 

You can use etags-select to select from multiple matching tags. But the answer to what you asked is imenu.

scottfrazer
A: 

global gtags is very good

chunhui