bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43572: Feature request: make it possible to choose whether the first


From: Gregory Heytings
Subject: bug#43572: Feature request: make it possible to choose whether the first lines of the minibuffer should be displayed instead of the last ones
Date: Tue, 22 Sep 2020 20:57:13 +0000
User-agent: Alpine 2.22 (NEB 394 2020-01-19)


In Emacs 27.1, the mini-window displays the last lines of the minibuffer.

This is, in general, the desired behavior, but in some cases it is not.

One case in which this behavior is not desirable is when completion candidates are displayed with an overlay at the end of the buffer. When this overlay is taller than max-mini-window-height, the prompt and the user input so far disappear. A simple example: M-: (setq max-mini-window-height 1), M-x icomplete-mode, M-x a.

Because of this behavior, and because it is counter-intuitive / not user-friendly when the prompt and user input so far disappear, those who create programs that display such completion candidates have been struggling to create overlays in such a way that they are (together with the prompt and the user input so far) not taller than max-mini-window-height. Doing this is, in general, far from trivial.

The attached patch makes it possible to (selectively) choose to display the _first_ lines of the minibuffer instead of its _last_ lines (which is and remains the default behavior). This means that displaying completion candidates becomes a trivial task: it suffices to create an overlay with completion candidates, without worrying at all about its size (or about the size of the prompt and user input), and as many of these candidates as possible will automatically be displayed.

For example, implementing vertical icomplete only requires:

(setq icomplete-separator "\n")
(add-hook 'icomplete-minibuffer-setup-hook (lambda () (setq 
start-display-at-beginning-of-minibuffer t)))

This feature request follows the discussion in bug#43519. The change proposed there by Eli Zaretskii improves the behavior w.r.t. Emacs 27.1, but it is still suboptimal to display completion candidates in a user-friendly way. For example:

Find file: <user input>|
<completion candidates>

(where | represents the cursor) will become:

<user input>|
<completion candidates>

when the user input becomes larger than a line. That is, the "Find file:" prompt and the user input on the first line will disappear.

The attached patch does not change the behavior of Emacs in any way, unless the feature it introduces is used.

Attachment: start-display-at-beginning-of-minibuffer.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]