GNU bug report logs - #5718
scroll-margin in buffer with small line count.

Previous Next

Package: emacs;

Reported by: Oleksandr Gavenko <gavenkoa <at> gmail.com>

Date: Sun, 14 Mar 2010 17:28:02 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: npostavs <at> users.sourceforge.net
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: ahyatt <at> gmail.com, 5718 <at> debbugs.gnu.org, gavenkoa <at> gmail.com
Subject: bug#5718: scroll-margin in buffer with small line count.
Date: Sun, 15 Jan 2017 16:43:34 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: npostavs <at> users.sourceforge.net
>> Cc: 5718 <at> debbugs.gnu.org,  ahyatt <at> gmail.com,  gavenkoa <at> gmail.com
>> Date: Fri, 13 Jan 2017 23:18:56 -0500
>> 
>> Looks like the same kind of problem as the other case, I can fix it
>> again by subtracting frame_line_height, though again, subtracting the
>> partial height is probably more correct.
>
> I think you are right on both counts.  Computing the partial height of
> the last visible line shouldn't be hard, I think.  Let me know if you
> need help with that.

Yeah, I'm still a bit lost in all the different structures.  It seems
(it.last_visible_y % frame_line_height) might work.  The matrix row
stuff in xdisp seems a more direct way of getting it, though I guess
that's not really usable from window.c?  What would be the idiomatic way
of doing this?

#define MR_PARTIALLY_VISIBLE(ROW)	\
  ((ROW)->height != (ROW)->visible_height)


By the way, in window_scroll_pixel_based (lines 5139 to 5158) the
position of "it" is saved twice, and it looks like the first one of
these can never be used (because the second overwrites it), correct?

      ptrdiff_t charpos, bytepos;
      bool partial_p;

      /* Save our position, for the   <---------------- Useless?
	 window_scroll_pixel_based_preserve_y case.  */
      charpos = IT_CHARPOS (it);
      bytepos = IT_BYTEPOS (it);

      /* We moved the window start towards BEGV, so PT may be now
	 in the scroll margin at the bottom.  */
      move_it_to (&it, PT, -1,
		  (it.last_visible_y - WINDOW_HEADER_LINE_HEIGHT (w)
		   - this_scroll_margin - 1 - frame_line_height),
		  -1,
		  MOVE_TO_POS | MOVE_TO_Y);

      /* Save our position, in case it's correct.  */
      charpos = IT_CHARPOS (it);
      bytepos = IT_BYTEPOS (it);





This bug report was last modified 8 years and 168 days ago.

Previous Next


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