A quickie for you emacs gurus (sorry, not very zope): When I'm editing python code in emacs, is there a way of jumping to the definition of the function currently under the point? seb
On 06 Mar 2002 10:59:43 +0000 seb bacon <seb@jamkit.com> wrote:
A quickie for you emacs gurus (sorry, not very zope):
When I'm editing python code in emacs, is there a way of jumping to the definition of the function currently under the point?
seb
ctrl-c ctrl-u works under xemacs HTH, __Janko
seb bacon wrote:
A quickie for you emacs gurus (sorry, not very zope):
When I'm editing python code in emacs, is there a way of jumping to the definition of the function currently under the point?
seb
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
in python-mode u can use C-M-a for the start of def C-M-e for the end of the def
* seb bacon <seb@jamkit.com> writes:
A quickie for you emacs gurus (sorry, not very zope):
When I'm editing python code in emacs, is there a way of jumping to the definition of the function currently under the point?
C-M-a aka py-beginning-of-def-or-class will search back back for the closest preceding `def'. Does that help?
seb bacon wrote:
A quickie for you emacs gurus (sorry, not very zope):
When I'm editing python code in emacs, is there a way of jumping to the definition of the function currently under the point?
No, at least I don't now how this could be done. But you can use grep: cd $ZOPE_HOME/lib/python; grep -rsi "def fooFunction" | less grep and less are in cygwin (www.cygwin.com) By the way, the ctrl-c ctrl-u solution only jump to the beginng of the function you are in. thomas
On Wed, 2002-03-06 at 11:49, Thomas Guettler wrote:
seb bacon wrote:
A quickie for you emacs gurus (sorry, not very zope):
When I'm editing python code in emacs, is there a way of jumping to the definition of the function currently under the point?
By the way, the ctrl-c ctrl-u solution only jump to the beginng of the function you are in.
Thanks to everyone for their suggestions, but Thomas is right: I don't want to jump to the beginning of the function I'm in, but to the definition of the function I'm pointing at. seb
On 06 Mar 2002 12:00:31 +0000 seb bacon <seb@jamkit.com> wrote: Oh sorry, no I understand. I think then you need to use etags, which should give you this function, but you need to generate a TAGS file and can then use the etags commands of emacs. This works perhaps only in the current directory. HTHalm, (a little more :-) __Jankko
On Wed, 2002-03-06 at 11:49, Thomas Guettler wrote:
By the way, the ctrl-c ctrl-u solution only jump to the beginng of the function you are in.
Thanks to everyone for their suggestions, but Thomas is right: I don't want to jump to the beginning of the function I'm in, but to the definition of the function I'm pointing at.
seb
OK, so I've found out the answer. Here it is for anyone who's interested. The answer is: etags. I can now press M-. over a call to any function or class call and jump to its definition anywhere in Zope. Yay! Here's a recipie for anyone who's interested. The etags which came with my distro didn't have support for python, so I donwnloaded the latest version: ftp://fly.cnuce.cnr.it/pub/etags.c.gz But this is broken too, since it doesn't index indented functions. It was pretty simple to fix (patch applied). Then I just did something along the lines of $ find . -name '*.py' | xargs etags Having done all that, I then found out there's a tool in the Tools directory of my python distribution which does it for me >:( http://makeashorterlink.com/?T11225F7 Anyway, highly recommended. On Wed, 2002-03-06 at 12:15, Janko wrote:
On 06 Mar 2002 12:00:31 +0000 seb bacon <seb@jamkit.com> wrote:
Oh sorry, no I understand. I think then you need to use etags, which should give you this function, but you need to generate a TAGS file and can then use the etags commands of emacs. This works perhaps only in the current directory.
HTHalm, (a little more :-) __Jankko
On Wed, 2002-03-06 at 11:49, Thomas Guettler wrote:
By the way, the ctrl-c ctrl-u solution only jump to the beginng of the function you are in.
Thanks to everyone for their suggestions, but Thomas is right: I don't want to jump to the beginning of the function I'm in, but to the definition of the function I'm pointing at.
seb
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Wed, 6 Mar 2002, Janko wrote:
On 06 Mar 2002 12:00:31 +0000 seb bacon <seb@jamkit.com> wrote:
Oh sorry, no I understand. I think then you need to use etags, which should give you this function, but you need to generate a TAGS file and can then use the etags commands of emacs. This works perhaps only in the current directory.
HTHalm, (a little more :-) __Jankko
If you're not familiar, TAGS files hold function definition locations for an entire series of source code files. Once you create the TAGS File (using command etags) and use M-x visit-tags-table (not required if the TAGS file is called "TAGS" and in your current directory), you can jump to any function definition with ESC-. (or whatever the kids today are binding find-tag to). Works great. -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant
Thomas Guettler wrote:
seb bacon wrote:
A quickie for you emacs gurus (sorry, not very zope):
When I'm editing python code in emacs, is there a way of jumping to the definition of the function currently under the point?
No, at least I don't now how this could be done. But you can use grep:
cd $ZOPE_HOME/lib/python; grep -rsi "def fooFunction" | less
grep and less are in cygwin (www.cygwin.com)
sorry, it is grep -rsi "def fooFunction" * | less (note the asterisk) r: recursive s: silent (don't show warnings) i: case insensitiv grep is fun. It gives you more power than any developerstudio can give you. -E (regularexpressions) is very interesting, too thomas
* Thomas Guettler <zopestoller@thomas-guettler.de> writes: [...]
grep is fun. It gives you more power than any developerstudio can give you. -E (regularexpressions) is very interesting, too
Tune in again tomorrow when you hear Thomas Guettler squeal: "Look, Ma, http://www.gnu.org/software/emacs/windows/faq9.html#grep told me how to use grep with Emacs - and it *ROCKS*!".
participants (7)
-
Janko -
Joel Burton -
Robin S. Socha -
Robin S. Socha -
seb bacon -
Thomas Guettler -
zope-mailinglist