Function: doc-view-scroll-down-or-previous-page

doc-view-scroll-down-or-previous-page is an interactive and byte-compiled function defined in doc-view.el.gz.

Signature

(doc-view-scroll-down-or-previous-page &optional ARG)

Documentation

Scroll page down ARG lines if possible, else goto previous page.

When doc-view-continuous is non-nil, scrolling downward at the top edge of the page moves to the previous page. Otherwise, goto previous page only on typing DEL (ARG is nil).

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/doc-view.el.gz
(defun doc-view-scroll-down-or-previous-page (&optional arg)
  "Scroll page down ARG lines if possible, else goto previous page.
When `doc-view-continuous' is non-nil, scrolling downward
at the top edge of the page moves to the previous page.
Otherwise, goto previous page only on typing DEL (ARG is nil)."
  (interactive "P")
  (if (or doc-view-continuous (null arg))
      (let ((hscroll (window-hscroll))
	    (cur-page (doc-view-current-page)))
	(when (= (window-vscroll nil t) (image-scroll-down arg))
	  (doc-view-previous-page)
	  (when (/= cur-page (doc-view-current-page))
	    (image-eob)
	    (image-bol 1))
	  (set-window-hscroll (selected-window) hscroll)))
    (image-scroll-down arg)))