[ESS] Using anything.el for R help / object browsing

Mathieu Basille basille at biomserv.univ-lyon1.fr
Fri Dec 5 20:16:50 CET 2008


It is actually a bit more complicated than expected. If I open a .R 
file, and associate a R buffer, everything works as expected, in both 
buffers: I can select what I want with the "pattern" expression.

However, if I open a .Rnw file, and associate a R buffer, the pattern is 
not working any more, in both buffers (nothing happens while typing). 
Actually, I have the iESS menus, everything is in its right place, but 
the selection with the pattern is not working...

The different modes seem to be recognized. Well, I can live with that 
anyway :)
Cheers,
Mathieu.



Short, Tom a écrit :
> As far as the .Rnw file, someone who knows more about that may be able to comment more. I tried an Rnw file, and anything-mode worked after I set the default code mode to R-mode (before that, I wasn't getting the ESS menu). If you see the ESS menu in the menu bar, and the file has an associated R process, I think it should work.
> 
> - Tom
> 
> 
> 
> -----Original Message-----
> From: Mathieu Basille [mailto:basille at biomserv.univ-lyon1.fr] 
> Sent: Friday, December 05, 2008 11:44 AM
> To: Short, Tom
> Cc: ess-help at stat.math.ethz.ch
> Subject: Re: [ESS] Using anything.el for R help / object browsing
> 
> Thanks Tom, it now works beautifully! The solution was quite obvious, 
> but as Emacs was running without errors, I thought that the problem was 
> not anymore in the .emacs...
> I can now browse through buffers, Imenus items, Files, R objects. This 
> is quite impressive. I guess I now just have to get used to it.
> 
> Oh, one more thing: for any reason, if I'm in a .Rnw file (associated or 
> not to a R buffer), the completion/selection does not work at all. It 
> does work, however, in .R .tex or other text files... I really don't see 
> where the problem is, though. Any idea?
> 
> Rodney, thanks for the warning. I'm not using SAS anyway, and I'm quite 
> sure that F12 was not used before.
> 
> Mathieu.
> 
> 
> Short, Tom a écrit :
>> Mathieu,
>>
>> Either comment out the "anything-c-source-recentf" line in the "(setq anything-sources" section or add (require 'recentf) to your .emacs. That's for showing/searching your recent file history.
>>
>> - Tom
>>
>>
>>
>> -----Original Message-----
>> From: Mathieu Basille [mailto:basille at biomserv.univ-lyon1.fr] 
>> Sent: Friday, December 05, 2008 10:42 AM
>> To: Short, Tom
>> Cc: ess-help at stat.math.ethz.ch
>> Subject: Re: [ESS] Using anything.el for R help / object browsing
>>
>> Hello,
>>
>> I just installed anything to have a look at it (I'm so curious...).
>> The installation went fine, and Emacs run without any error message (I 
>> had first to integrate anything-c-source-occur in my .emacs : 
>> http://www.emacswiki.org/emacs/AnythingSources#toc13).
>>
>> Anyway, when I hit F12, Emacs blinks once and tell me in a mini-buffer:
>> "Candidates must either be a function, a variable or a list: recentf-list"
>> And then, nothing happens. Quite frustrating, I have to say :D
>>
>> (I checked that F12 was only dedicated to anything)
>>
>> Any idea?
>> Mathieu.
>>
>>
>>
>> ts8 a écrit :
>>> Anything.el is a great emacs extension. I use anything.el in emacs for buffer
>>> switching, finding recent files, and file searching on my disk. Here is more
>>> information on anything:
>>>
>>> http://www.emacswiki.org/emacs/Anything
>>>
>>> It's been called quicksilver for emacs. You can use it for searching and
>>> much more. I've extended it to act as an R help finder and object browser.
>>> Part of my .emacs configuration is given below.  
>>>
>>> I've attached the configuration I use in my .emacs, but I'm not sure the
>>> attachment will go through (I'm using nabble to post). In any case, you can
>>> find it here, too:
>>>
>>> http://www.emacswiki.org/emacs/AnythingSources#toc38
>>>
>>> With this configuration, I hit F12, and it pops up a temporary buffer. In
>>> that buffer, it lists the current buffers, recent files, R objects, Imenu
>>> items (including R functions), files in the current directory, occur in the
>>> buffer (very handy), files on my disk (using locate), and emacs commands. I
>>> can use the left and right arrows to jump between categories and the up and
>>> down arrows to move between items. As I type, it narrows the selection to
>>> match the regular expression entered. For the R objects, if I hit <enter>,
>>> the default action brings up help on the object (as long as the buffer has
>>> an associated R process). If I hit tab, I can get more options, and I
>>> currently implemented head, tail, str, summary, dput, and print. The results
>>> all appear in their own buffer. This makes it a quick object browser, like
>>> rdired. It's a mouthful to explain, but it's easy once you see it.
>>>
>>> (require 'anything)   ;; http://www.emacswiki.org/emacs/anything.el
>>> (require 'anything-config) ;;
>>> http://www.emacswiki.org/emacs/anything-config.el
>>>
>>> (global-set-key [f12] 'anything)
>>>
>>> (setq anything-sources
>>>       (list anything-c-source-buffers
>>>             anything-c-source-recentf
>>>             anything-c-source-R-help
>>>             anything-c-source-imenu
>>>             anything-c-source-files-in-current-dir
>>>             anything-c-source-occur
>>>             anything-c-source-locate
>>>             anything-c-source-emacs-commands
>>> ))
>>>
>>>
>>> http://www.nabble.com/file/p20847205/R-anything-config.el
>>> R-anything-config.el 
>>
> 
> 


-- 

mathieu at lbbe:~$ whoami
 > Mathieu Basille, PhD

mathieu at lbbe:~$ locate
 > Laboratoire de Biométrie et Biologie Évolutive
 > Université Claude Bernard Lyon 1 - France
 > http://lbbe.univ-lyon1.fr/

mathieu at lbbe:~$ info
 > http://ase-research.org/basille

mathieu at lbbe:~$ fortune
 > ``If you can't win by reason, go for volume.''
 > Calvin, by Bill Watterson.




More information about the ESS-help mailing list