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: Sun, 11 Nov 2012 17:55:59 +0100

> Emacs doesn't count in lines, it counts in pixels.  And since a line
> has a finite size, where exactly those 70% end is not well determined
> (is it the top of the line, the bottom of the line, somewhere in
> between?).

I don't see the point of using pixel as unit of measure here.  The
unit should be the line, because the problem to solve here can
(should) be expressed in terms of lines; going down to the pixel level
is unnecessary and confusing, IMO.

So, given a window which is W lines high, the line L that is X % from
the top of the window can be determined as

L = round((X/100)*(W-1))+1

Conversely, the percentage X from the top of the window can be determined as

X = 100*(L-1)/(W-1)

Therefore, testing with a window of W=11 lines high makes the above
calculations quite easy, because each line counts as 10%.

-- 
Dani Moncayo





reply via email to

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