tags:

views:

128

answers:

1

Most rails modes for emacs have this kind of functionality. You are in a controller file over a function "kaboosh" in "app/controller/bla.rb" and with a keyboard shortcut you switch to "app/views/kaboosh.erb" or to app/models/bla.rb".

A similar functionality exists for .c and .h files using ff-find-other-file.

I checked jump.el and findr.el but all seems a little bit complicated. I tried searching this for django projects (it would have helped a lot) but no luck.

Anyone knows a simple way (etags?) that it's easy to define the connection between current file/function and target file and then bind it to a keyboard shortcut?

+1  A: 

Tags is set up well to jump you to the definition of a function. M-. will take you to the first occurrence of a function definition, C-u M-. will take you to the next (and one after that, and after that...). Perhaps the C-u M-. solves some of your problem.

Regarding associations between files, and wanting a rails like interface, it looks like you could pull out the appropriate chunks of code and customize them for python.

Specifically, you'll need the jump package, make a similar jump schema like the rinari-jump-schema (found in rinari.el). The jump schema uses 'ruby-add-log-current-method (found in ruby-mode.el), and you'd just need to customize that to return the current method name for Python syntax.

It doesn't look like anyone has done this for Python yet, you could be the first. I believe those are the only pieces you'll need.

Trey Jackson
something like that http://rinari.rubyforge.org/Navigation.html#Navigation
Jon Romero
or better http://rope.sourceforge.net/ropemacs.html
Jon Romero
Well, the link to ropemacs.html shows an integration for python in Emacs... (granted it is limited to refactoring, documentation...).
Trey Jackson