File: pixel-scroll.el.html
This file contains two somewhat related features.
The first is a global minor mode which makes Emacs try to scroll each line smoothly.
Scrolling a line up by set-window-vscroll and that by scroll-up
give similar display as shown below.
A: (scroll-up 1)
B: (set-window-vscroll nil (frame-char-height) t)
Also scrolling a pixel up by set-window-vscroll and that by
scroll-up give similar display, when vscroll is the last pixel of
the line, as shown below.
A: (scroll-up 1)
B: (set-window-vscroll nil (1- (frame-char-height) t)) (scroll-up 1)
When point reaches to the top of a window on scroll by
set-window-vscroll, vscroll is set to zero. To scroll a line
smoothly and continuously, this package scrolls a line by following
sequences.
(vertical-motion 1)
(dolist (vs (number-sequence 1 (1- (frame-char-height))))
(set-window-vscroll nil vs t) (sit-for 0))
(scroll-up 1)
The second is another global minor mode that redefines wheel-up
and wheel-down to a command that tries to scroll the display
according to the precise movement of a trackpad or mouse.
But it operates in a much more intelligent manner than simply setting the vscroll. It will set window start to the position closest to the position at the top-left corner of the window if vscroll were set accordingly, in a smart and fast manner, and only set vscroll the rest of the way. There is no visible difference, but it is much faster, and doesn't move the display by a huge portion if vscroll is reset for some reason.
It also tries to move point out of the way, so redisplay will not recenter the display as it scrolls. This works well almost all of the time, but is impossible to get right with images larger than the window they're displayed in. A feature that will allow redisplay to skip recentering is in the works, and will completely resolve this problem.
Defined variables (20)
pixel-dead-time | Minimal interval in seconds before next smooth scrolling. |
pixel-last-scroll-time | Time when the last scrolling was made, in second since the epoch. |
pixel-resolution-fine-flag | Set scrolling resolution to pixels instead of a line. |
pixel-scroll-mode | Non-nil if Pixel-Scroll mode is enabled. |
pixel-scroll-mode-hook | Hook run after entering or leaving ‘pixel-scroll-mode’. |
pixel-scroll-precision-initial-velocity-factor | Factor applied to the initial velocity before momentum scrolling begins. |
pixel-scroll-precision-interpolate-mice | Whether or not to interpolate scrolling from a mouse. |
pixel-scroll-precision-interpolate-page | Whether or not to interpolate scrolling via the Page Down and Page Up keys. |
pixel-scroll-precision-interpolation-between-scroll | The number of seconds between each step of an interpolated scroll. |
pixel-scroll-precision-interpolation-factor | A factor to apply to the distance of an interpolated scroll. |
pixel-scroll-precision-interpolation-total-time | The total time in seconds to spend interpolating a large scroll. |
pixel-scroll-precision-large-scroll-height | Pixels that must be scrolled before an animation is performed. |
pixel-scroll-precision-mode | Non-nil if Pixel-Scroll-Precision mode is enabled. |
pixel-scroll-precision-mode-hook | Hook run after entering or leaving ‘pixel-scroll-precision-mode’. |
pixel-scroll-precision-mode-map | The key map used by ‘pixel-scroll-precision-mode’. |
pixel-scroll-precision-momentum-min-velocity | The minimum scrolled pixels per second before momentum scrolling starts. |
pixel-scroll-precision-momentum-seconds | The maximum duration in seconds of momentum scrolling. |
pixel-scroll-precision-momentum-tick | Number of seconds between each momentum scroll. |
pixel-scroll-precision-use-momentum | If non-nil, continue to scroll the display after wheel movement stops. |
pixel-wait | Idle time on each step of pixel scroll specified in second. |