unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 43519@debbugs.gnu.org
Subject: bug#43519: 28.0.50; Overlay at end of minibuf hides minibuf's real content
Date: Mon, 21 Sep 2020 13:25:01 -0400	[thread overview]
Message-ID: <jwvwo0n2hgh.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83y2l3xm15.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 21 Sep 2020 17:05:42 +0300")

>> Do you know why we don't do it this way, IOW why don't we first try to
>> keep window-start unchanged and see if point ends up within view?
> Because this way we have no control on where the mini-window's display
> will start, and consequently what will be visible in the mini-window.

Indeed, then we'll just rely on the "generic" behavior, which is
admittedly not focused on single-line (or few lines) windows, but at
least in the current case it works better (and simplifies the code
slightly).

> In particular, if point is at EOB, redisplay could (and normally does)
> decide not to position point on the last screen line of the window,
> which means we may have some of the text not visible for no good
> reason -- not a good thing when user interaction is concerned.

Not sure I understand what you mean.
If point is at EOB, redisplay will make sure EOB is visible.

Or do you mean a situation like:
- minibuffer holds "foo\n"
- the mini window is a single line
- point is at EOB
In which case we'd end up displaying the empty line instead of display "foo"?

AFAICT our ad-hoc scrolling code gives the same result as the generic
scrolling code in that case.

I've been trying out the patch below and haven't bumped into any
surprising behavior yet, but admittedly, I probably lack creativity.

> More generally, since the mini-window is usually small and user
> interaction requires to make sure the user sees the important parts of
> the buffer text (if not all of it), we want tighter control on what
> will end up on display, and the way to do that is via setting
> window-start.

That makes sense in general, but I'm curious to see what are the
concrete cases where our "generic" scrolling logic leads to worse
behavior than the ad-hoc one used here.

So far the patch below fixed the original problem and I haven't been
able to see any regression yet.

>>     (setq max-mini-window-height 1)
>> with
>>     (setq resize-mini-windows nil)
>> the problem doesn't appear, even though resizing is in fact disabled in
>> both cases.
> Disabling resize-mini-windows means the mini-window is not resized at
> all as part of redisplay.

Yes, of course, I was just using it to illustrate what happens when we
don't use the ad-hoc scrolling code from resize_mini_window in the case
where there is in practice no resizing anyway.

> And besides, this is a user option, so having some code disregard it
> is unfriendly, to say the least, even if we do that temporarily.

Oh yes,


        Stefan


diff --git a/src/xdisp.c b/src/xdisp.c
index dfcb1d73e4..b25aa07f1f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11885,14 +11885,18 @@ resize_mini_window (struct window *w, bool exact_p)
       if (height > max_height)
 	{
 	  height = (max_height / unit) * unit;
-	  init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID);
-	  move_it_vertically_backward (&it, height - unit);
-	  start = it.current.pos;
+	  /* bug#43519: Let the redisplay choose the window start!
+           *
+           * init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID);
+	   * move_it_vertically_backward (&it, height - unit);
+	   * start = it.current.pos; */
 	}
       else
-	SET_TEXT_POS (start, BEGV, BEGV_BYTE);
+	{
+	  SET_TEXT_POS (start, BEGV, BEGV_BYTE);
 
-      SET_MARKER_FROM_TEXT_POS (w->start, start);
+          SET_MARKER_FROM_TEXT_POS (w->start, start);
+        }
 
       if (EQ (Vresize_mini_windows, Qgrow_only))
 	{






  reply	other threads:[~2020-09-21 17:25 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-19 17:54 bug#43519: 28.0.50; Overlay at end of minibuf hides minibuf's real content Stefan Monnier
2020-09-19 18:52 ` Eli Zaretskii
2020-09-19 19:42   ` Stefan Monnier
2020-09-19 20:10     ` Eli Zaretskii
2020-09-19 22:06       ` Stefan Monnier
2020-09-20  8:52         ` Eli Zaretskii
2020-09-20 21:04           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20 21:31             ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21  6:50               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 14:17                 ` Eli Zaretskii
2020-09-21 15:02                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 15:33                     ` Eli Zaretskii
2020-09-21 15:44                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 16:10                         ` Eli Zaretskii
2020-09-21 16:27                           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 17:30                             ` Eli Zaretskii
2020-09-21 18:42                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 19:37                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 19:37                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22  6:57                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22  6:57                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 14:11                                 ` Eli Zaretskii
2020-09-22 15:52                                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 16:10                                     ` Eli Zaretskii
2020-09-22 21:01                                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 17:28                   ` Stefan Monnier
2020-09-21 17:47                     ` Eli Zaretskii
2020-09-21 18:45                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 19:37                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22  6:58                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 14:14                         ` Eli Zaretskii
2020-09-21 14:04               ` Eli Zaretskii
2020-09-21 14:31                 ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 14:47                   ` Eli Zaretskii
2020-09-21 14:02             ` Eli Zaretskii
2020-09-21 14:18               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 14:45                 ` Eli Zaretskii
2020-09-21 15:26                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 15:39                     ` Eli Zaretskii
2020-09-21 16:00                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20 22:40           ` Stefan Monnier
2020-09-21  7:04             ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 14:05             ` Eli Zaretskii
2020-09-21 17:25               ` Stefan Monnier [this message]
2020-09-21 17:45                 ` Eli Zaretskii
2020-09-21 19:17                   ` Stefan Monnier
2020-09-21 19:47                     ` Eli Zaretskii
2020-09-22  5:26                       ` Eli Zaretskii
2020-09-22 14:00                         ` Stefan Monnier
2020-09-22 14:02                         ` Eli Zaretskii
2020-09-22 15:51                           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 16:06                             ` Eli Zaretskii
2020-09-22 16:17                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 16:47                                 ` Eli Zaretskii
2020-09-22 16:49                                 ` Eli Zaretskii
2020-09-22 20:06                                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23  2:40                                     ` Eli Zaretskii
2020-09-23  7:15                                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 14:34                                         ` Eli Zaretskii
2020-09-21 20:05                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 20:49                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 18:35                       ` Stefan Monnier
2020-09-22  6:58                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22  6:58                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20  1:00 ` bug#43519: (no subject) Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20  6:08   ` Eli Zaretskii
2020-09-20  8:27 ` bug#43519: 28.0.50; Overlay at end of minibuf hides minibuf's real content Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20  9:03   ` Eli Zaretskii
2020-09-20 10:12     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20 10:52       ` Eli Zaretskii
2020-09-20 19:50 ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] <<jwvft7dveii.fsf@iro.umontreal.ca>
     [not found] ` <<83wo0p1twr.fsf@gnu.org>
     [not found]   ` <<jwvh7rta7et.fsf-monnier+emacs@gnu.org>
     [not found]     ` <<83r1qx1q9v.fsf@gnu.org>
     [not found]       ` <<jwvzh5l8med.fsf-monnier+emacs@gnu.org>
     [not found]         ` <<838sd425l2.fsf@gnu.org>
     [not found]           ` <<jwvd02g5bnp.fsf-monnier+emacs@gnu.org>
     [not found]             ` <<83y2l3xm15.fsf@gnu.org>
     [not found]               ` <<jwvwo0n2hgh.fsf-monnier+emacs@gnu.org>
     [not found]                 ` <<83eemvxbvg.fsf@gnu.org>
     [not found]                   ` <<jwv363b2b48.fsf@iro.umontreal.ca>
     [not found]                     ` <<837dsmykrn.fsf@gnu.org>
     [not found]                       ` <<E1kKapF-0007yc-Mb@fencepost.gnu.org>
     [not found]                         ` <<831ritykni.fsf@gnu.org>
     [not found]                           ` <<alpine.NEB.2.22.394.2009221712130453.10035@sdf.lonestar.org>
     [not found]                             ` <<83k0wlx0cz.fsf@gnu.org>
     [not found]                               ` <<alpine.NEB.2.22.394.2009221808130453.16638@sdf.lonestar.org>
     [not found]                                 ` <<83d02dwyfa.fsf@gnu.org>
2020-09-22 20:03                                   ` 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=jwvwo0n2hgh.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=43519@debbugs.gnu.org \
    --cc=eliz@gnu.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).