Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I rename R sessions in ESS?

Tags:

emacs

r

tramp

ess

I previously asked how to switch R sessions in ESS, and the use of C-x C-s has sped up my workflow greatly.

However, if I have multiple R sessions (even as few as 3), it can be difficult to remember which on is R, which is R:2, and which is R:3. Is there a way to get ESS, Emacs, or tramp to automatically name the different r sessions based on server / directory that R is running in?

like image 523
David LeBauer Avatar asked Jan 04 '11 01:01

David LeBauer


2 Answers

[update]

New versions of ESS (> 12.09) operate on buffer names instead of internal process names. Now you can rename your inferior buffer with M-x rename-buffer and that will do the right thing. You can also configure ess-gen-proc-buffer-name-function to set up the automatic custom renaming of process buffers on startup.

[/update]

R, R:2 etk are the process names in ESS. I asked this question on ess mailing list an year or so ago. It seems like there is no straightforward way of changing this behavior. It's an emacs feature not ESS. You can change buffer names associated with the process but process names will be unchanged.

Uniquify changes buffer names as far I could see. And in any case in recent versions of emacs buffers with same file name are designated with partial paths to make them unique. So it looks like uniquify was adopted into base emacs for files, but not for other stuff like proc names.

like image 196
VitoshKa Avatar answered Oct 15 '22 19:10

VitoshKa


Not sure about automatically renaming (and you could ask that on the ESS mailing list) but I sometimes use M-x rename-buffer which does just what it is supposed to do.

like image 39
Dirk Eddelbuettel Avatar answered Oct 15 '22 17:10

Dirk Eddelbuettel