如何在 ESS 中重命名 R 会话?

发布于 2024-10-09 21:24:53 字数 279 浏览 2 评论 0原文

我之前问过如何在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

╰ゝ天使的微笑 2024-10-16 21:24:53

[更新]

新版本的 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 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.

风轻花落早 2024-10-16 21:24:53

不确定自动重命名(您可以在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文