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-timeMinimal interval in seconds before next smooth scrolling.
pixel-last-scroll-timeTime when the last scrolling was made, in second since the epoch.
pixel-resolution-fine-flagSet scrolling resolution to pixels instead of a line.
pixel-scroll-modeNon-nil if Pixel-Scroll mode is enabled.
pixel-scroll-mode-hookHook run after entering or leaving ‘pixel-scroll-mode’.
pixel-scroll-precision-initial-velocity-factorFactor applied to the initial velocity before momentum scrolling begins.
pixel-scroll-precision-interpolate-miceWhether or not to interpolate scrolling from a mouse.
pixel-scroll-precision-interpolate-pageWhether or not to interpolate scrolling via the Page Down and Page Up keys.
pixel-scroll-precision-interpolation-between-scrollThe number of seconds between each step of an interpolated scroll.
pixel-scroll-precision-interpolation-factorA factor to apply to the distance of an interpolated scroll.
pixel-scroll-precision-interpolation-total-timeThe total time in seconds to spend interpolating a large scroll.
pixel-scroll-precision-large-scroll-heightPixels that must be scrolled before an animation is performed.
pixel-scroll-precision-modeNon-nil if Pixel-Scroll-Precision mode is enabled.
pixel-scroll-precision-mode-hookHook run after entering or leaving ‘pixel-scroll-precision-mode’.
pixel-scroll-precision-mode-mapThe key map used by ‘pixel-scroll-precision-mode’.
pixel-scroll-precision-momentum-min-velocityThe minimum scrolled pixels per second before momentum scrolling starts.
pixel-scroll-precision-momentum-secondsThe maximum duration in seconds of momentum scrolling.
pixel-scroll-precision-momentum-tickNumber of seconds between each momentum scroll.
pixel-scroll-precision-use-momentumIf non-nil, continue to scroll the display after wheel movement stops.
pixel-waitIdle time on each step of pixel scroll specified in second.

Defined functions (32)

pixel--whistlestop-line-up()
pixel--whistlestop-pixel-up(N)
pixel-bob-at-top-p(AMT)
pixel-eob-at-top-p()
pixel-line-height(&optional POS)
pixel-point-and-height-at-unseen-line()
pixel-point-at-bottom-p(AMT)
pixel-point-at-top-p(AMT)
pixel-point-at-unseen-line()
pixel-posn-y-at-point()
pixel-scroll-accumulate-velocity(DELTA)
pixel-scroll-calculate-velocity(STATE)
pixel-scroll-down(&optional ARG)
pixel-scroll-down-and-set-window-vscroll(VSCROLL)
pixel-scroll-in-rush-p()
pixel-scroll-interpolate-down()
pixel-scroll-interpolate-up()
pixel-scroll-kinetic-state(&optional WINDOW)
pixel-scroll-mode(&optional ARG)
pixel-scroll-pixel-down(AMT)
pixel-scroll-pixel-up(AMT)
pixel-scroll-precision(EVENT)
pixel-scroll-precision-interpolate(DELTA &optional OLD-WINDOW FACTOR)
pixel-scroll-precision-mode(&optional ARG)
pixel-scroll-precision-scroll-down(DELTA)
pixel-scroll-precision-scroll-down-page(DELTA)
pixel-scroll-precision-scroll-up(DELTA)
pixel-scroll-precision-scroll-up-page(DELTA)
pixel-scroll-start-momentum(EVENT)
pixel-scroll-up(&optional ARG)
pixel-visible-pos-in-window()
pixel-visual-line-height()

Defined faces (0)