那么,不是在当前活动窗口的下方(或右侧)创建一个分割窗口,它会出现在所有已存在的窗口高度的一半之下?并且,在关闭之后,框架布局将在调用C-x C-b之前恢复?
我想查看已打开文件的完整路径。
答案 0 :(得分:1)
另请参阅我之前对您相关问题的回答:https://stackoverflow.com/a/21544307/2112489
另请参阅@phils的相关答案,其中包含一个不错的halve-other-window-height
函数:https://stackoverflow.com/a/4988206/2112489
另请参阅最新版本的Emacs Trunk中提供的内置库存函数display-buffer-below-selected
或display-buffer-at-bottom
- 我不确定每个函数何时首次引入。他们在window.el
。
函数split-window
的doc-string在相关部分中指出: SIZE默认为一半
WINDOW的大小。这是第二个可选参数 - 即split-window (&optional window size side pixelwise)
不要羞于修改这些东西 - 你可以让它做你想做的任何事情。如果要在显示窗口后自动选择窗口,则可以将其添加到lawlist-display-buffer-below
函数的底部:(select-window (get-buffer-window (buffer-name buffer)))
- 当然,左边有两个右括号 - 即,let
绑定的一个右括号和defun
的一个右括号。
(defun lawlist-list-buffers-below (&optional arg)
"Display a list of existing buffers.
The list is displayed in a buffer named \"*Buffer List*\".
See `buffer-menu' for a description of the Buffer Menu.
By default, all buffers are listed except those whose names start
with a space (which are for internal use). With prefix argument
ARG, show only buffers that are visiting files."
(interactive "P")
(lawlist-display-buffer-below (list-buffers-noselect arg) nil))
(defun lawlist-display-buffer-below (buffer alist)
(let (
(window
(cond
((get-buffer-window buffer (selected-frame)))
((window-in-direction 'below))
(t
(split-window (selected-window) nil 'below)))))
(window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)))