问题描述
那么,不是在当前活动窗口的下方(或右侧)创建一个拆分窗口,而是将其显示在所有现有窗口下方且框架高度的一半?而且,关闭后,框架布局会恢复到调用 C-x C-b 之前的样子吗?
So, instead of creating a split window under (or to the right of) the currently active window, it would appear below all the existed ones with a half of the frame height? And, after closing, frame layout would be restored as it was before calling C-x C-b?
我想查看打开文件的完整路径.
I’d like see the full paths to opened files.
推荐答案
另见我之前对您的相关问题的回答:https:///stackoverflow.com/a/21544307/2112489
See also my previous answer to your related issue: https://stackoverflow.com/a/21544307/2112489
另见@phils 的相关回答,其中包括一个不错的 halve-other-window-height
函数:https://stackoverflow.com/a/4988206/2112489
See also a related answer by @phils, which includes a nice halve-other-window-height
function: https://stackoverflow.com/a/4988206/2112489
另见内置库存函数 display-buffer-below-selected
或 display-buffer-at-bottom
,它们在最新版本的 Emacs 中可用主干——我不确定每个功能是什么时候首次引入的.它们在 window.el
中.
See also the built-in stock functions display-buffer-below-selected
or display-buffer-at-bottom
, which are available in a recent version of Emacs Trunk -- I'm not sure when each function was first introduced. They are in window.el
.
split-window
函数的文档字符串在相关部分说明:SIZE 默认为一半WINDOW 的大小.这是第二个可选参数——即,split-window(&可选窗口大小侧像素)
The doc-string of the function split-window
states in relevant part: SIZE defaults to half ofWINDOW's size. That is the second optional argument -- i.e., split-window (&optional window size side pixelwise)
不要羞于修改这些东西——你可以让它做任何你想做的事.如果想在窗口显示后自动选择窗口,那么你可以在 lawlist-display-buffer-below
函数的底部添加:(select-window (get-buffer-window (buffer-name buffer)))
-- 当然,在右边留下两个右括号 -- 即 let
绑定的一个右括号和 let
绑定的一个右括号defun
.
Don't be shy about modifying these things -- you can make it do whatever you want. If want to select the window automatically after it is displayed, then you can add this to the bottom of the lawlist-display-buffer-below
function: (select-window (get-buffer-window (buffer-name buffer)))
-- leaving, of course, two closing parenthesis to the right -- i.e., one closing parentheis for the let
binding and one closing parenthesis for the 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)))
这篇关于如何使 *Buffer List* 出现在其他窗口下方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!