我的 Windows 配置如下所示:
+----------+-----------+
| | |
| | |
| | |
| | |
| | |
| +-----------+
| | |
+----------+-----------+
我将右下角的窗口用于特殊显示(如帮助、完成等),但当我调用使用的命令(find-file-other-window
等)时,emacs 坚持使用该窗口display-buffer
,并调整该窗口的大小。这很烦人......有没有办法让emacs不使用那个窗口?我正在考虑提供建议display-buffer
,但它是 c 中的一个函数。对此有什么想法吗?
编辑:
很大程度上基于 Trey 的回答,到目前为止,这对我有用:
(setq special-display-function 'my-display-buffer)
(setq special-display-regexps '(".*"))
(defun display-special-buffer (buf)
"put the special buffers in the right spot (bottom rigt)"
(let ((target-window (window-at (- (frame-width) 4) (- (frame-height) 4)))
(pop-up-windows t))
(set-window-buffer target-window buf)
target-window))
(defun my-display-buffer (buf)
"put all buffers in a window other than the one in the bottom right"
(message (buffer-name buf))
(if (member (buffer-name buf) special-display-buffer-names)
(display-special-buffer buf)
(progn
(let ((pop-up-windows t)
(windows (delete (window-at (- (frame-width) 4) (- (frame-height) 4))
(delete (minibuffer-window) (window-list)))))
(message (buffer-name (window-buffer (car windows))))
(set-window-buffer (car (cdr windows)) buf)
(car (cdr windows))))))