I previously asked how to switch R sessions in ESS, and the use of C-x C-s
has sped up my workflow greatly.
我之前曾问过如何在ESS中切换R会话,并且使用C-x C-s大大加快了我的工作流程。
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?
但是,如果我有多个R会话(即使只有3个),也很难记住哪个是R,哪个是R:2,哪个是R:3。有没有办法让ESS,Emacs或tramp根据运行R的服务器/目录自动命名不同的r会话?
2 个解决方案
#1
6
[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.
新版本的ESS(> 12.09)对缓冲区名称而不是内部进程名称进行操作。现在,您可以使用M-x rename-buffer重命名您的劣质缓冲区,这样做是正确的。您还可以配置ess-gen-proc-buffer-name-function以在启动时设置进程缓冲区的自动自定义重命名。
[/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.
R,R:2 etk是ESS中的过程名称。大约一年前我在ess邮件列表上问了这个问题。似乎没有直接改变这种行为的方法。这是一个emacs功能而不是ESS。您可以更改与进程关联的缓冲区名称,但进程名称将保持不变。
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.
Uniquify更改缓冲区名称,我可以看到。在任何情况下,在最近版本的emacs中,具有相同文件名的缓冲区都被指定为部分路径以使它们唯一。因此看起来uniquify被用于基本emacs文件,但不适用于其他东西,如proc名称。
#2
2
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.
不确定是否自动重命名(你可以在ESS邮件列表中询问)但我有时会使用M-x rename-buffer来完成它应该做的事情。
#1
6
[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.
新版本的ESS(> 12.09)对缓冲区名称而不是内部进程名称进行操作。现在,您可以使用M-x rename-buffer重命名您的劣质缓冲区,这样做是正确的。您还可以配置ess-gen-proc-buffer-name-function以在启动时设置进程缓冲区的自动自定义重命名。
[/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.
R,R:2 etk是ESS中的过程名称。大约一年前我在ess邮件列表上问了这个问题。似乎没有直接改变这种行为的方法。这是一个emacs功能而不是ESS。您可以更改与进程关联的缓冲区名称,但进程名称将保持不变。
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.
Uniquify更改缓冲区名称,我可以看到。在任何情况下,在最近版本的emacs中,具有相同文件名的缓冲区都被指定为部分路径以使它们唯一。因此看起来uniquify被用于基本emacs文件,但不适用于其他东西,如proc名称。
#2
2
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.
不确定是否自动重命名(你可以在ESS邮件列表中询问)但我有时会使用M-x rename-buffer来完成它应该做的事情。