如何在 ESS 中重命名 R 会话?
我之前问过如何在 ESS 中切换 R 会话,Cx Cs
的使用速度加快了大大提高了我的工作流程。
但是,如果我有多个 R 会话(即使只有 3 个),则可能很难记住哪个是 R
,哪个是 R:2
,哪个是R:3
。有没有办法让 ESS、Emacs 或 trapmp 根据 R 运行的服务器/目录自动命名不同的 r 会话?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
[更新]
新版本的 ESS (> 12.09) 对缓冲区名称而不是内部进程名称进行操作。现在您可以使用 Mx rename-buffer 重命名您的下级缓冲区,这将做正确的事情。您还可以配置 ess-gen-proc-buffer-name-function 来设置启动时进程缓冲区的自动自定义重命名。
[/update]
R、R:2 etk 是 ESS 中的进程名称。大约一年前,我在 ess 邮件列表上问了这个问题。似乎没有直接的方法可以改变这种行为。这是 emacs 的功能,而不是 ESS。您可以更改与进程关联的缓冲区名称,但进程名称将保持不变。
据我所知,Uniquify 更改了缓冲区名称。无论如何,在最新版本的 emacs 缓冲区中,具有相同文件名的缓冲区都指定有部分路径,以使其唯一。所以看起来 uniquify 被采用到基本 emacs 中用于文件,但没有用于其他内容,例如过程名称。
[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 configureess-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.
不确定自动重命名(您可以在 ESS 邮件列表上询问),但我有时会使用
Mx rename-buffer
来完成它应该做的事情。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.