Function: smart-scroll-down
smart-scroll-down is an interactive and byte-compiled function defined
in hmouse-drv.el.
Signature
(smart-scroll-down)
Documentation
Scroll down according to value of smart-scroll-proportional.
If smart-scroll-proportional is nil or if point is on the bottom window line, scroll down (backward) a windowful. Otherwise, try to bring current line to the bottom of the window. Leave point at end of line and return t if scrolled, nil if not.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hmouse-drv.el
;; The smart keys scroll buffers when pressed at the end of lines.
;; These next two functions do the scrolling and keep point at the end
;; of line to simplify repeated scrolls when using keyboard smart keys.
;;
;; These functions may also be used to test whether the scroll action would
;; be successful: no action is taken if it would fail (because the beginning
;; or end of a buffer is already showing) and nil is returned.
;; t is returned whenever scrolling is performed.
(defun smart-scroll-down ()
"Scroll down according to value of smart-scroll-proportional.
If smart-scroll-proportional is nil or if point is on the bottom
window line, scroll down (backward) a windowful. Otherwise, try
to bring current line to the bottom of the window. Leave point
at end of line and return t if scrolled, nil if not."
(interactive)
(let ((rtn t))
(if smart-scroll-proportional
;; If selected line is already last in window, then scroll backward
;; a windowful, otherwise make it last in window.
(if (>= (point) (save-excursion
(goto-char (1- (window-end)))
(beginning-of-line) (point)))
(if (pos-visible-in-window-p (point-min))
(setq rtn nil)
(scroll-down))
(recenter -1))
(if (pos-visible-in-window-p (point-min))
(setq rtn nil)
(scroll-down)))
(end-of-line)
(or rtn (progn (beep) (message "Beginning of buffer")))
rtn))