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.
The simplest way to enter a minibuffer argument is to type the text you want, terminated by RET which exits the minibuffer. You can cancel the command that wants the argument, and get out of the minibuffer, by typing C-g .
The minibuffer is where Emacs commands read complicated arguments, such as file names, buffer names, Emacs command names, or Lisp expressions. We call it the “minibuffer” because it's a special-purpose buffer with a small amount of screen space.
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*
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With