[ESS] Jumping to (or listing) functions in a given file?

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Jul 21 20:14:43 CEST 2010


Nice!

The imenu/ido works *almost* perfect.

Say I have these two S4 defs:

setMethod("something", c(x="character"),
function(x, ...) {
})

setMethod("something", c(x="integer"),
function(x, ...) {
})

Using Imenu in an emacs gui, "something" is repeated twice, w/o the
ability to distinguish the "character" version vs the "integer"
version.

Using imenu/ido from the terminal, "something" is only listed once.

Changing the regex used in ess-5.11::ess-menu.el from
    ("Methods" "^.*set\\(Group\\|Replace\\)?Method(\"\\(.+\\)\"," 2)
to
    ("Methods" "^.*set\\(Group\\|Replace\\)?Method(\"\\(.+\\)\",?" 2)

Now includes
something", c(x="integer
something", c(x"character

which seems to work better in both the GUI and when using this via
terminal + Imenu stuff you pointed to.

Although I reckon an even better regex could be jimmied up (to include
all params beings S4-dispatched against?), perhaps this might be a
good enhancement in base ess for now?

Thanks for the Imenu tip, using it w/ ido is awesome.

-steve

On Wed, Jul 21, 2010 at 1:37 PM, Short, Tom <TShort at epri.com> wrote:
>
> Steve, check out Imenu:
>
> http://www.emacswiki.org/emacs/ImenuMode
>
> I like to access the Imenu entries through Anything:
>
> http://www.emacswiki.org/emacs/ImenuMode#toc11
>
> It looks like ido access is possible, too:
>
> http://www.emacswiki.org/emacs/ImenuMode#toc10
>
> - Tom
>
>
>> -----Original Message-----
>> From: ess-help-bounces at stat.math.ethz.ch
>> [mailto:ess-help-bounces at stat.math.ethz.ch] On Behalf Of
>> Steve Lianoglou
>> Sent: Wednesday, July 21, 2010 13:11
>> To: ESS-help at stat.math.ethz.ch
>> Subject: [ESS] Jumping to (or listing) functions in a given file?
>>
>> Hi all,
>>
>> Still an emacs n00b, sorry if it's a basic question.
>>
>> Is there some easy way to help navigate/jump between
>> functions in the current buffer I'm working in?
>>
>> As a reference, TextMate has a great little widget that you
>> invoke via cmd-shift-T. When invoked, a small pop up appears
>> listing all functions in the current window (parsing is done
>> via the language definition, I reckon). You can start typing
>> the name of the function, and it'll filter down the list
>> until you hit the one you want (or you could up/down arrow
>> through your options).
>>
>> Back to emacs, I'm imagining invoking some command that lists
>> all of the functions in my working buffer down in the
>> minibuffer that I could navigate through "as usual" (ie. I'm
>> using ido to get the fuzzy-matching in there).
>>
>> It would be great if this "thing" could parse functions in an
>> S4-aware manner.
>>
>> Pipe-dream? Already there (hopefully no ctags required(?))?
>>
>> Thanks,
>> -steve
>>
>> --
>> Steve Lianoglou
>> Graduate Student: Computational Systems Biology
>>  | Memorial Sloan-Kettering Cancer Center
>>  | Weill Medical College of Cornell University Contact Info:
>> http://cbio.mskcc.org/~lianos/contact
>>
>> ______________________________________________
>> ESS-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>>
>



-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the ESS-help mailing list