bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12811: 24.3.50; `scroll-up/down-aggressively' don't seem to work as


From: Dani Moncayo
Subject: bug#12811: 24.3.50; `scroll-up/down-aggressively' don't seem to work as expected
Date: Tue, 6 Nov 2012 20:18:30 +0100

>> 1. Visit the attached file.
>> 2. Adjust the height of the Emacs GUI frame so that only lines 1 to 11
>> are visible.  With this setup it is easy to tell the relative position
>> of a line in the window in terms of percentage from the top or bottom,
>> since each line counts as 10% for such percentages.
>
> I guess you meant lines 1 to 10, not 11, because with 11 the
> percentages are not integral numbers of lines.

Actually I meant lines 1 to 11, because that way:
* Line 1 is 0% from the top of the window and 100% from the bottom.
* Line 11 is 0% from the bottom of the window and 100% from the top.
* Line 6 is 50% from the top and bottom of the window (i.e. the middle line).
* In general, Line N is 10(N-1)% from the top of the window and
10(11-N)% from the bottom (i.e., each like counts as 10% for these
percentages).

> IMO, it doesn't make sense to expect scroll-up/down-aggressively do
> anything useful when you move point by more than a window-full.  (In
> your case, the window is 11 (or 10) lines, and you move point by 15
> lines.)  These variables exist to control the _overlap_ between the
> current window-full of text and the next/previous one.  When you move
> by more than the window's height, so that there's no overlap at all,
> these variables are meaningless.

Good point.  I agree with you, of course.  I also thought about that
before submitting the bug report, but decided to stick (for the
moment) to the discrepancy I saw between the documentation and the
program's behavior.

The more I think about these two variables, the less they make sense
to me, and the less I like the approach behind them, which is
misguided, IMO.

So I'd like to make this request:
* Make obsolete the variables `scroll-up/down-aggressively'.
* Extend the semantics of the variable `scroll-step' to accept also a
fractional number between 0 and 1, so that for example 0.7 would mean:
"when point moves out, try to get it back into view by scrolling
up/down an amount equal to the 70% of the height of the window.  If
that fails, center in the window the line where point is".

>  E.g., what would you expect them to
> do with "C-u 100 C-n", or with "C-u 100000 M-x goto-char"? why would
> it make sense to position point anywhere but the middle of the window
> for such large scrolls?

It would not make sense, indeed, but according to the current
documentation, point should be positioned according to
`scroll-up/down-aggressively'.  Yes, that makes no sense.

> That is why what you expected never worked in Emacs, at least since
> v21.1.  The code which implements the effect of these variables was
> written under the assumption that point is only a small ways outside
> of the window, one or 2 screen lines, because this is what happens
> when you type "C-n" or "C-p" on the border of the scroll margin.

But that assumption is false in many real-life cases.

> Having said that, since the code already almost did TRT, it is much
> easier for me to fix it for this use case than to argue about the
> applicability of these variables.  So I did just that in revision
> 110795 on the emacs-24 branch.

Good, thanks.  Then perhaps the documentation should be updated to
reflect this, no?

> Just don't ask me to make C-v and M-v
> also obey these variables...

Of course I won't :).  IMO C-v and M-v should always show the
next/previous page, regardless of the "auto scrolling" control
variables.

Thanks again, and please, consider the proposal I've made before.

-- 
Dani Moncayo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]