2011-08-29 22 views

回答

1

undo-tree包使用标准的Emacs缓冲显示功能来显示树窗口(而不是一个特定的功能)。要控制Emacs如何拆分窗口,您可以自定义变量split-window-preferred-functionsplit-height-thresholdsplit-width-threshold。另请查阅功能split-window-sensibly的文档。

如果你都OK使用Emacs一般更喜欢并排侧窗在顶部和底部的人,把这段代码在你的init文件:

(setq split-height-threshold 0) 

(如果你想并排。只有侧窗为undo-tree-visualize,故事是更复杂一点)

+3

如果只需要撤消树,则可以在包含撤消树可视化函数的通知中临时设置该变量。 – Tom

+0

@Tom我会给你一个upvote,如果你在答案中写出该建议的代码片段;) –

+1

@DanielDinnyes我知道这是一年半后,但你可以检查我的答案,该代码段。 :) – meqif

5

按@汤姆suggestion,我刮起了只适用于撤销树的解决方案:

(defadvice undo-tree-visualize (around undo-tree-split-side-by-side activate) 
    "Split undo-tree side-by-side" 
    (let ((split-height-threshold nil) 
     (split-width-threshold 0)) 
    ad-do-it)) 

2017-04-29defadvice现在已弃用advice-add。上述解决方案的更新版本如下:

(defun undo-tree-split-side-by-side (original-function &rest args) 
    "Split undo-tree side-by-side" 
    (let ((split-height-threshold nil) 
     (split-width-threshold 0)) 
    (apply original-function args))) 

(advice-add 'undo-tree-visualize :around #'undo-tree-split-side-by-side) 
+0

试过了,看起来不错,thx! –

+0

谢谢!我尝试了它,并且完美地工作。 – wdkrnls

相关问题