2011-08-29 31 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

相關問題