Answers:
我赞同@Nsukami的建议使用专用窗口。由于它是功能而不是命令,因此set-window-dedicated-p
直接使用可能很麻烦。使用以下命令和关联的按键绑定,您可以通过按C-c t以下按钮切换任何窗口的“专用性” :
(defun toggle-window-dedicated ()
"Control whether or not Emacs is allowed to display another
buffer in current window."
(interactive)
(message
(if (let (window (get-buffer-window (current-buffer)))
(set-window-dedicated-p window (not (window-dedicated-p window))))
"%s: Can't touch this!"
"%s is up for grabs.")
(current-buffer)))
(global-set-key (kbd "C-c t") 'toggle-window-dedicated)