使用R会话和并排窗口启动Emacs?

问题描述 投票:1回答:1

我很擅长自定义emacs。我希望如果我以一个以“.r”结尾的文件开头,emacs开始最大化,两个窗口并排(框架的垂直分割),在我的源代码文件中,另一个是ESS R解释器。如果我能理解这个例子,也许我可以将它推广到其他扩展和模式。我仍然没有在elisp中获得钩子的语法。

emacs ess
1个回答
1
投票

使用Emacs的常用方法是让它始终运行而不是一直打开和关闭它。

我建议您定义一个函数,使现有的Emacs以您想要的方式显示:

(defun my-R-window-configuration ()
  "Prepare the current emacs frame for R work."
  (interactive)
  ;; maximimize the current frame:
  (set-frame-parameter nil 'fullscreen 'maximized)
  ;; keep just the current window, presumably containing the R code
  (delete-other-windows)
  ;; create ESS R interaction buffer and go there
  (ess-switch-to-end-of-ESS)
  ;; go back to the code
  (other-window 1))

现在你可以在R缓冲区中进行M-x my-R-window-configuration RET来获得你想要的东西。

© www.soinside.com 2019 - 2024. All rights reserved.