note
LanX
<I>> Probably this is emacs. </I><P>
what else? ;-)<P>
<I>> May be i miss a command like M-x goto-definition in some mode?</I><P>
well these are several questions ... point for point.
<UL>
<LI> you said the mouse is needed<p>
nope <p>
every x-action is bound to a function and can be bound to a key too, and the function <C>word-at-point</C> gives you the word under the cursor. So you can freely combine any mouse-action with the <C>word-at-point</C> .
<p>
Tip: <C>C-h k</C> doesn't only show you the keybinding of the next keystrokes, but also of the following mouse actions. Hence you can see what is triggered and use it in your own scripts.
<LI> getting all "local" subs
<p>
<C>cperl-mode</C> supports <C>imenu</C> , which scans the current buffer for every sub declaration.
<p>
Just go to the menu bar and click <C><menu-bar> <Perl> <Tools> <Imenu></C> and you'll see a list of all subs in the buffer.
<LI> jumping to the sub at point
<p>
When called interactively with <C>M-x imenu</C> or a key-binding like <C>C-c i</C> or <C>M-Ret</C> (personal binding) offers all alternatives in the mini-buffer (the bottom line) but defaulting to the word at point.
<p>
For instance in my bindings <C>M-RET RET</C> lets me jump to that definition.
<LI> automatically showing that a sub is local
<p>
Cperl mode has a setting to automatically show a mini-description for any Perl construct under the cursor In the message area. See <C><menu-bar> <Perl> <Toggle...> <Auto-help on Perl constructs></C>
<p>
One could also hack this interface to show information for the sub at point using the data from imenu
<LI> Choroba mentioned etags/ctags
<p>
These is necessary for bigger projects where the definition is in another file. I was only replying to the "local" requirement. ( Tags are tricky in a language which can only be parse by its own runtime engine ;)
</UL><P>
HTH! :)
<P>
<H5> TL DR </H5><P>
<C>M-x imenu</C><P>
<div class="pmsig"><div class="pmsig-708738">
<p>Cheers Rolf<br>
<sub>(addicted to the Perl Programming Language :)
<br> <i> [id://1153804|Wikisyntax for the Monastery]</i>
<small><strike>Football</strike>Perl is like chess, only without the dice</small>
</sub> <P>
</div></div><!-- Wiki2Monks {"version":1.142} -->
1232441
1232534