您可以在入口/出口挂钩上设置ediff的功能以保存/恢复窗口配置,以及创建新框架。这似乎这样的伎俩在Emacs 24.3 - 我不明白为什么它会在旧版本不能正常工作:至少在Emacs
(defvar pre-ediff-window-configuration nil
"window configuration to use")
(defvar new-ediff-frame-to-use nil
"new frame for ediff to use")
(defun save-my-window-configuration()
(interactive)
(setq pre-ediff-window-configuration (current-window-configuration))
(select-frame-set-input-focus (setq new-ediff-frame-to-use (new-frame))))
(add-hook 'ediff-before-setup-hook 'save-my-window-configuration)
(defun restore-my-window-configuration()
(interactive)
(when (framep new-ediff-frame-to-use)
(delete-frame new-ediff-frame-to-use)
(setq new-ediff-frame-to-use nil))
(when (window-configuration-p pre-ediff-window-configuration)
(set-window-configuration pre-ediff-window-configuration)))
(add-hook 'ediff-after-quit-hook-internal 'restore-my-window-configuration)
请使用Emacs的术语重新编写问题? Emacs有一个或多个*帧*,每个*帧包含一个或多个*窗口*,每个窗口显示单个缓冲区。您可以通过拆分旧窗口来创建新窗口(例如'C-x 2')。您可以使用例如'C-x 5 2'创建新框架。起初我以为你刚刚用“窗格”代替了“窗格”,但最后我不能确定,就像你提到“垂直将窗格重新分成两个窗格”一样。由于ediff提供了一些围绕窗口/框架使用的选项,有一个更精确的问题将会有所帮助。 – phils
谢谢phils。我实际上意识到了这种区别,但意外地使用了'pane'而不是'frame'。对困惑感到抱歉。 –
我更新了帖子。谢谢@phils –