我想让Emacs中的编辑窗口始终显示在窗口的底部,并且始终是一定的高度.到目前为止,我将以下几行放在我的.emacs文件中:
(setq split-height-threshold 0)
(setq compilation-window-height 10)
Run Code Online (Sandbox Code Playgroud)
...当我只有一个窗口打开时,它确实有效,但只要我将屏幕水平分割成两个窗口(即中间的分界线从顶部到底部),编译窗口停止尊重高度变量,并在中间分开窗口.
我该如何解决?
ffe*_*tte 15
我会使用这样的东西,从EmacsWiki中自由改编:
(defun my-compilation-hook ()
(when (not (get-buffer-window "*compilation*"))
(save-selected-window
(save-excursion
(let* ((w (split-window-vertically))
(h (window-height w)))
(select-window w)
(switch-to-buffer "*compilation*")
(shrink-window (- h compilation-window-height)))))))
(add-hook 'compilation-mode-hook 'my-compilation-hook)
Run Code Online (Sandbox Code Playgroud)
如果*compilation*缓冲区不可见,则会垂直分割窗口,将新打开的窗口调整为10行高,然后打开*compilation*缓冲区.