unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregory Heytings via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 43572@debbugs.gnu.org
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: Wed, 23 Sep 2020 20:15:54 +0000	[thread overview]
Message-ID: <alpine.NEB.2.22.394.2009232148140453.30611@sdf.lonestar.org> (raw)
In-Reply-To: <837dskuvx3.fsf@gnu.org>


>
> And given the policy of displaying the last visible part, what would you 
> expect in this case?
>

I do not expect something else with the current policy, I suggest to add a 
new policy with whom the first part of the minibuffer would be displayed 
instead of its last part.

>>> How will Lisp programs decide when to set this flag and when not to 
>>> set it?  What would be the criteria?
>>
>> The criteria is simply: should the prompt and user input be displayed?
>
> How do you decide that?
>

I gave a simple and clear example of an implementation of vertical 
icomplete, which demonstrates how this feature would be used:

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

Please try it (together with my patch), you'll see what I mean.

With the current behavior (with (setq icomplete-separator "\n")), whenever 
the prompt and user input are larger than the width of Emacs' frame and 
there are too many completion candidates, the prompt and user input 
disappear, and when there are only a few completion candidates the prompt 
and user input re-appear.

With this patch the prompt and user input are always visible, and as many 
completion candidates as possible (given max-mini-window-height) are 
displayed after them.

>
> Or let me ask it differently: when will a program decide that it wants 
> the current behavior of perhaps NOT showing the prompt, if the 
> mini-window is not large enough?
>

In the use case of completion candidates displayed after point with an 
overlay at EOB, the answer is simple: never.  If at some point it becomes 
impossible to display the prompt, say because max-mini-window-height 
equals 1 and the prompt and user input are larger than the width of the 
Emacs frame, redisplay will hide the prompt, and that's fine.  As you 
said: "Displaying long stuff in a mini-window that is forced to be small 
will always present some problems, no matter what we do."

>> Doing this automatically (that is, unconditionally) would have the 
>> consequence that when point reaches the last line of the minibuffer 
>> (that is, the max-mini-window-height's line), the mini-buffer would be 
>> recentered, and the topmost lines would be hidden.
>
> What resize_mini_window does ensures that recentering doesn't happen. 
> That is why it sets w->start: it's an indication to the display engine 
> to obey that window-start position if point is visible with it.
>
> So you are trying to solve a case that doesn't need to be solved.
>

I'm not trying to solve any problem here.  You said: "If you are saying 
that any Lisp program that reads from the minibuffer will want that, then 
(assuming that others agree), it would be better to do this automatically 
in the display code."  I answered this by saying: "This is not what I'm 
saying, and I would not dare to make such a general judgment.  I only 
claim that it is better to make this possible.  There is at least one case 
where I think it is better not to do this automatically."  And I explained 
that case.

>>> Binding the variable inside the minibuffer-setup-hook will affect all 
>>> the subsequent calls to resize_mini_window, until the next call to 
>>> read-from-minibuffer resets it, which may not be what the Lisp program 
>>> wants, and could have unintended consequences.
>>
>> I can't think of such unintended consequences.  In the use case of 
>> displaying completion candidates, this (the fact that it affects all 
>> successive calls to resize_mini_window) is indeed what is wanted.
>
> Well, I _can_ think of such consequences.  As I said, resize_mini_window 
> is called in many situations that don't involve completion, so setting 
> that variable to affect all of them is a bad idea.  We need something 
> more fine-grained if we want to implement such a feature.
>

It would be very helpful if you could clarify what the consequences you 
think of are.





  reply	other threads:[~2020-09-23 20:15 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 20:57 bug#43572: Feature request: make it possible to choose whether the first lines of the minibuffer should be displayed instead of the last ones Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 15:17 ` Eli Zaretskii
2020-09-23 19:15   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 19:37     ` Eli Zaretskii
2020-09-23 20:15       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-09-24 14:24         ` Eli Zaretskii
2020-09-24 14:41           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-24 15:11             ` Eli Zaretskii
2020-09-24 16:09               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-24 16:20                 ` Eli Zaretskii
2020-09-24 16:40                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-24 17:03                     ` Eli Zaretskii
2020-09-24 21:51                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-25  6:59                         ` Eli Zaretskii
2020-09-25  8:34                           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-25  9:14                             ` Eli Zaretskii
2020-09-25 10:14                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-25 11:17                                 ` Eli Zaretskii
2020-09-25 11:34                                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 22:59       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-25 18:31   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 18:33 ` Stefan Monnier
2020-09-23 18:47   ` Eli Zaretskii
2020-09-23 23:18     ` Stefan Monnier
2020-09-24 14:34       ` Eli Zaretskii
2020-09-24 16:44         ` Stefan Monnier
2020-09-24 16:59           ` Eli Zaretskii
2020-09-27 21:59             ` Stefan Monnier
2020-09-28  6:20               ` Eli Zaretskii
2020-09-28 13:30                 ` Stefan Monnier
2020-09-28 13:44                   ` Eli Zaretskii
2020-09-28 16:58                     ` Stefan Monnier
2020-10-02 15:40                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-02 16:08                         ` Stefan Monnier
2020-10-02 16:11                         ` Eli Zaretskii
2020-10-02 16:25                           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-02 19:30                             ` Eli Zaretskii
2020-10-02 21:49                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-29 14:02                         ` Lars Ingebrigtsen
2020-09-23 19:46   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 20:00     ` Stefan Monnier
2020-09-23 22:47       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 23:20         ` Stefan Monnier
2020-09-23 23:26           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-24  2:07             ` Stefan Monnier
2020-09-24  7:45               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-24 16:26                 ` Stefan Monnier
2020-09-24  8:06               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-24 14:43                 ` Eli Zaretskii
2020-09-24 14:52                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-24 15:20                     ` Eli Zaretskii
2020-09-24 14:26         ` Eli Zaretskii
2020-09-24 14:20     ` Eli Zaretskii
2020-09-24 14:27       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-24 16:40       ` Stefan Monnier
2020-09-24 16:54         ` Eli Zaretskii
2020-09-27 16:11           ` Eli Zaretskii
2020-09-27 21:52             ` Stefan Monnier
2020-09-28  6:10               ` Eli Zaretskii
2020-09-28 13:24                 ` Stefan Monnier
2020-09-28 13:42                   ` Eli Zaretskii
2020-09-28 16:56                     ` Stefan Monnier
     [not found] <<alpine.NEB.2.22.394.2009222215560453.32542@sdf.lonestar.org>
     [not found] ` <<jwvwo0ktlge.fsf-monnier+emacs@gnu.org>
     [not found]   ` <<alpine.NEB.2.22.394.2009232116430453.29439@sdf.lonestar.org>
     [not found]     ` <<834knnuugm.fsf@gnu.org>
     [not found]       ` <<jwvimc3p2a0.fsf-monnier+emacs@gnu.org>
     [not found]         ` <<83h7rnt8s3.fsf@gnu.org>
     [not found]           ` <<833633nqru.fsf@gnu.org>
     [not found]             ` <<jwvwo0e6gcb.fsf-monnier+emacs@gnu.org>
     [not found]               ` <<83r1qmmnxu.fsf@gnu.org>
2020-09-28 15:53                 ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.NEB.2.22.394.2009232148140453.30611@sdf.lonestar.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=43572@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ghe@sdf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).