GNU bug report logs - #55312
29.0.50; Cannot set vscroll when mini-window is resized

Previous Next

Package: emacs;

Reported by: Po Lu <luangruo <at> yahoo.com>

Date: Sun, 8 May 2022 11:54:02 UTC

Severity: normal

Found in version 29.0.50

Done: Po Lu <luangruo <at> yahoo.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55312 in the body.
You can then email your comments to 55312 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#55312; Package emacs. (Sun, 08 May 2022 11:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Po Lu <luangruo <at> yahoo.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 08 May 2022 11:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Cannot set vscroll when mini-window is resized
Date: Sun, 08 May 2022 19:53:10 +0800
It seems that this code in redisplay_window always clears out the
vscroll when the mini-window is taller than a single line of text:

  /* If someone specified a new starting point but did not insist,
     check whether it can be used.  */
  if ((w->optional_new_start || window_frozen_p (w))
      && CHARPOS (startp) >= BEGV
      && CHARPOS (startp) <= ZV)
    {
      ptrdiff_t it_charpos;

      w->optional_new_start = false;
      start_display (&it, w, startp);
      move_it_to (&it, PT, 0, it.last_visible_y, -1,
		  MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
      /* Record IT's position now, since line_bottom_y might change
	 that.  */
      it_charpos = IT_CHARPOS (it);
      /* Make sure we set the force_start flag only if the cursor row
	 will be fully visible.  Otherwise, the code under force_start
	 label below will try to move point back into view, which is
	 not what the code which sets optional_new_start wants.  */
      if ((it.current_y == 0 || line_bottom_y (&it) < it.last_visible_y)
	  && !w->force_start)
	{
	  if (it_charpos == PT)
	    w->force_start = true;
	  /* IT may overshoot PT if text at PT is invisible.  */
	  else if (it_charpos > PT && CHARPOS (startp) <= PT)
	    w->force_start = true;

This can easily be reproduced by typing "M-x C-q C-j" and trying to use
`pixel-scroll-precision' with the mouse pointer on top of a window that
is not the `minibuf-scroll-window': the vscroll will not take effect,
since force_start will be set to true, and that resets the vscroll.

I think this "frozen" behavior is required to ensure that the start of
windows do not aimlessly move when the mini-window is being resized, but
it interferes with features that need to set the vscroll.

Any ideas?

Thanks in advance.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55312; Package emacs. (Sun, 08 May 2022 13:42:01 GMT) Full text and rfc822 format available.

Message #8 received at 55312 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 55312 <at> debbugs.gnu.org
Subject: Re: bug#55312: 29.0.50; Cannot set vscroll when mini-window is resized
Date: Sun, 08 May 2022 16:40:59 +0300
> Date: Sun, 08 May 2022 19:53:10 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> It seems that this code in redisplay_window always clears out the
> vscroll when the mini-window is taller than a single line of text:

Not when it's taller, but when it has been resized.

> This can easily be reproduced by typing "M-x C-q C-j" and trying to use
> `pixel-scroll-precision' with the mouse pointer on top of a window that
> is not the `minibuf-scroll-window': the vscroll will not take effect,
> since force_start will be set to true, and that resets the vscroll.
> 
> I think this "frozen" behavior is required to ensure that the start of
> windows do not aimlessly move when the mini-window is being resized, but
> it interferes with features that need to set the vscroll.
> 
> Any ideas?

If you want to allow vscroll in these cases, you'd need to either add
code which ensures the window-start of "frozen" windows is not moved
by means other than the force_start flag, or modify the code where we
handle the force_start flag so that it doesn't reset vscroll when
pixel-scroll uses it, as opposed to when vscroll is used by "normal"
scrolling commands for the purposes of scrolling tall screen lines.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55312; Package emacs. (Mon, 09 May 2022 00:31:02 GMT) Full text and rfc822 format available.

Message #11 received at 55312 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 55312 <at> debbugs.gnu.org
Subject: Re: bug#55312: 29.0.50; Cannot set vscroll when mini-window is resized
Date: Mon, 09 May 2022 08:29:45 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> If you want to allow vscroll in these cases, you'd need to either add
> code which ensures the window-start of "frozen" windows is not moved
> by means other than the force_start flag, or modify the code where we
> handle the force_start flag so that it doesn't reset vscroll when
> pixel-scroll uses it, as opposed to when vscroll is used by "normal"
> scrolling commands for the purposes of scrolling tall screen lines.

Thanks.  I think I'd prefer the latter, and will begin working on it.




Reply sent to Po Lu <luangruo <at> yahoo.com>:
You have taken responsibility. (Mon, 09 May 2022 01:40:02 GMT) Full text and rfc822 format available.

Notification sent to Po Lu <luangruo <at> yahoo.com>:
bug acknowledged by developer. (Mon, 09 May 2022 01:40:02 GMT) Full text and rfc822 format available.

Message #16 received at 55312-done <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 55312-done <at> debbugs.gnu.org
Subject: Re: bug#55312: 29.0.50; Cannot set vscroll when mini-window is resized
Date: Mon, 09 May 2022 09:38:46 +0800
Po Lu <luangruo <at> yahoo.com> writes:

> Thanks.  I think I'd prefer the latter, and will begin working on it.

Now done, so I'm closing this bug report.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55312; Package emacs. (Mon, 09 May 2022 13:50:01 GMT) Full text and rfc822 format available.

Message #19 received at 55312 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 55312 <at> debbugs.gnu.org
Subject: Re: bug#55312: 29.0.50; Cannot set vscroll when mini-window is resized
Date: Mon, 09 May 2022 16:48:56 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: 55312-done <at> debbugs.gnu.org
> Date: Mon, 09 May 2022 09:38:46 +0800
> 
> Po Lu <luangruo <at> yahoo.com> writes:
> 
> > Thanks.  I think I'd prefer the latter, and will begin working on it.
> 
> Now done, so I'm closing this bug report.

Hmm... shouldn't we reset the new flag not just when w->force_start is
non-zero?  Otherwise, the flag could survive more than a single
redisplay cycle, and affect situations that the caller of
set-window-vscroll didn't intend, no?

How about resetting the flag in mark_window_display_accurate_1 as
well?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55312; Package emacs. (Tue, 10 May 2022 00:44:02 GMT) Full text and rfc822 format available.

Message #22 received at 55312 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 55312 <at> debbugs.gnu.org
Subject: Re: bug#55312: 29.0.50; Cannot set vscroll when mini-window is resized
Date: Tue, 10 May 2022 08:43:31 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> How about resetting the flag in mark_window_display_accurate_1 as
> well?

Sure, that's fine by me too.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 07 Jun 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 318 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.