如何使*缓冲区列表*出现在其他窗口下面? [英] How to make *Buffer List* appear below the other windows?

查看:89
本文介绍了如何使*缓冲区列表*出现在其他窗口下面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,而不是在当前活动的窗口的下方(或右侧)创建一个拆分窗口,它会显示在所有已存在的窗口的下方,具有一半的框架高度?而关闭后,框架布局会像调用Cx Cb一样恢复?

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 或<$ c-c> display-buffer-at-bottom ,它们在最新版本的Emacs Trunk中可用 - 我不知道每个功能是否首次被引入。它们在 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-窗口相关部分中的状态: SIZE默认为
WINDOW的大小
的一半。这是第二个可选参数 - 即 split-window(&可选窗口大小边像素)

The doc-string of the function split-window states in relevant part:  SIZE defaults to half of WINDOW'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))) - 当然,右边是两个右括号 - 也就是说,一个关闭的parentheis为 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)))

这篇关于如何使*缓冲区列表*出现在其他窗口下面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆