GNU bug report logs -
#5718
scroll-margin in buffer with small line count.
Previous Next
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
Message #22 received at 5718 <at> debbugs.gnu.org (full text, mbox):
> From: npostavs <at> users.sourceforge.net
> Date: Thu, 11 Aug 2016 08:03:18 -0400
> Cc: 5718 <at> debbugs.gnu.org, Oleksandr Gavenko <gavenkoa <at> gmail.com>
>
> >> lines real-scroll-margin
> >> 3,4,5,6 1
> >> 7,8,9,10 2
> >> 11,12,13,14 3
> >>>15 4
> >>
> >> I count from 3 as when try make less lines Emacs warn.
> >>
> >> I think that whose modify scroll-margin want to see as many
> >> as possible margin value up to its customization value.
> >>
> >> This formula produce such values:
> >>
> >> best-scroll-margin = min( (line_count - 1)/2, scroll-margin)
> >>
> >> So previous table changed to:
> >>
> >> lines best-scroll-margin
> >> 3,4 1
> >> 5,6 2
> >> 7,8 3
> >>>9 4
> >>
> >> Also as you can see in proposal case
> >> user switch start work from 9 lines in window, not 15!
> >>
> >> Please implement described behaviour.
> >
> > I'm having a hard time understanding this report. However, it seems
> > like more like a wishlist request than a bug: you want to change the
> > scrolling behavior. I'm going to change this to wishlist for now, but
> > let me know if I've misunderstood, please.
>
> I think the complaint is that the `scroll-margin' effective value is
> capped at a 1/4 of the window height, as seen in this
> window_scroll_pixel_based (window.c):
>
> this_scroll_margin = max (0, scroll_margin);
> this_scroll_margin
> = min (this_scroll_margin, window_total_lines / 4);
Which reveals a subtle bug: the actual scroll margin should be 1 for 7
lines, 2 for 11, etc. The problem is that the value of
window_total_lines includes the mode line, which it shouldn't. Maybe
this should be fixed.
> Whereas, it seems more logical to cap it at half window height.
No, I think it would leave too few lines for moving the cursor. This
has been Emacs behavior since time immemoriam, so if we want to have a
different behavior, it should be implemented an opt-in option, not the
default.
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.