Function: pdf-view-scroll-down-or-previous-page
pdf-view-scroll-down-or-previous-page is an interactive and natively
compiled function defined in pdf-view.el.
Signature
(pdf-view-scroll-down-or-previous-page &optional ARG)
Documentation
Scroll page down ARG lines if possible, else go to the previous page.
When pdf-view-continuous is non-nil, scrolling downward at the
top edge of the page moves to the previous page. Otherwise, go
to previous page only on typing DEL (ARG is nil).
Key Bindings
pdf-view-mode-map DEL pdf-view-mode-map M-v pdf-view-mode-map S-SPC
Source Code
;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-view.el
(defun pdf-view-scroll-down-or-previous-page (&optional arg)
"Scroll page down ARG lines if possible, else go to the previous page.
When `pdf-view-continuous' is non-nil, scrolling downward at the
top edge of the page moves to the previous page. Otherwise, go
to previous page only on typing DEL (ARG is nil)."
(interactive "P")
(if (or pdf-view-continuous (null arg))
(let ((hscroll (window-hscroll))
(cur-page (pdf-view-current-page))
(win-scroll (window-vscroll nil pdf-view-have-image-mode-pixel-vscroll))
(img-scroll (image-scroll-down arg)))
(when (or
;; There is no previous line for the image to scroll to
(and img-scroll (= win-scroll img-scroll))
;; Workaround rounding/off-by-one issues.
(memq pdf-view-display-size
'(fit-height fit-page)))
(pdf-view-previous-page)
(when (/= cur-page (pdf-view-current-page))
(image-eob)
(image-bol 1))
(image-set-window-hscroll hscroll)))
(image-scroll-down arg)))