【问题标题】:Start Emacs with R session and side by side windows?使用 R 会话和并排窗口启动 Emacs?
【发布时间】:2018-06-02 05:46:52
【问题描述】:

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

【问题讨论】:

    标签: emacs ess


    【解决方案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 以获得您想要的。

    【讨论】:

    • 嘿,谢谢,这很好。至于我更愿意为每个文件单独调用emacs,如果打开的文件的名称以某种终止结尾,我仍然会寻找如何在启动时调用函数的答案。但这解决了我 87.6% 的问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-11
    相关资源
    最近更新 更多