有没有什么方法可以让undo-tree-mode在“水平”缓冲区中显示可视化效果(即:C-x 3与C-x 2)?

发布于 2011-08-29 13:53:23
undo-tree包使用标准的Emacs buffer显示函数来显示树窗口(而不是特定的函数)。要控制Emacs拆分窗口的方式,可以自定义变量split-window-preferred-function、split-height-threshold和split-width-threshold。另外,请查看函数split-window-sensibly的文档。
如果您对Emacs没有意见,通常更喜欢并排的窗口而不是顶部和底部的窗口,请将以下代码放入init文件中:
(setq split-height-threshold 0)(如果你只想把并排窗口放在undo-tree-visualize上,那就有点复杂了。)
发布于 2014-08-10 20:04:53
根据@Tom的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-29:defadvice现已弃用,转而支持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)https://stackoverflow.com/questions/7225054
复制相似问题