在Emacs中,如何更改minibuffer完成列表窗口? [英] In Emacs, how do I change the minibuffer completion list window?

查看:224
本文介绍了在Emacs中,如何更改minibuffer完成列表窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为minibuffer完成列表设置一个特定的窗口。目前,我在这个配置中有3个窗口:

  ______ 
| | |
| ____ | |
| ____ | _ |

在这种情况下,我想使用左下角的窗口进行minibuffer完成列表。 / p>

目前,它似乎在一个窗口随机,大多数时候它喜欢使用最右边的窗口,这太薄了,无法显示完成列表,没有我有水平滚动,这是刺激性的。



另外,我使用的是一个名为 revive.el 从文件(〜/ .revive.el)恢复我的窗口配置。 p>

解决方案

开始尝试使用 minibuffer-scroll-window (原来不是用户可定制的)。我尝试了这种方法:

 (add-to-list'special-display-buffer-names'(* Completions *我的显示完成))

(defun my-display-completions(buf)
将* completions *缓冲区放在正确的位置
(let((windows (delete(minibuffer-window)(window-list))))
(if(eq 1(length windows))
(progn
(select-window(car windows))
(split-vertical-vertical)))
(let((target-window(window-at 0( - (frame-height)2)))
(弹出窗口t) )
(set-window-buffer target-window buf)
target-window))

这可以通过将单个窗口分为两部分,并在底部窗口中显示 * Completions * ,或者如果已显示2个或更多窗口,则使用左下角的窗口显示 * Completions *


I would like to set a specific window for the minibuffer completion list. Currently, I have 3 windows in this configuration:

 ______
|    | |
|____| |
|____|_|

In this case, I'd like to use the bottom left window for the minibuffer completion list.

Currently, it seems to a window at random, and most of the time it likes to use the far right window, which is too thin to show the completion list without me having to scroll horizontally, which is irritating.

Also, I'm using a lisp script called revive.el to restore my window configuration from a file (~/.revive.el) when I load Emacs.

解决方案

After starting down the path of trying to use minibuffer-scroll-window (which turns out to not be user customizable). I tried this approach:

(add-to-list 'special-display-buffer-names '("*Completions*" my-display-completions))

(defun my-display-completions (buf)
  "put the *completions* buffer in the right spot"
  (let ((windows (delete (minibuffer-window) (window-list))))
    (if (eq 1 (length windows))
        (progn 
          (select-window (car windows))
          (split-window-vertically)))
    (let ((target-window (window-at 0 (- (frame-height) 2)))
          (pop-up-windows t))
      (set-window-buffer target-window buf)
      target-window)))

This works by splitting the sole window in two and displaying *Completions* in the bottom window, or, if there are already 2 or more windows shown, using the bottom-left window to show the *Completions*.

这篇关于在Emacs中,如何更改minibuffer完成列表窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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