Function: pages-next-page

pages-next-page is an interactive and byte-compiled function defined in page-ext.el.gz.

Signature

(pages-next-page &optional COUNT)

Documentation

Move to the next page bounded by the page-delimiter variable.

With arg (prefix if interactive), move that many pages.

Key Bindings

Aliases

next-page (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/page-ext.el.gz
(defun pages-next-page (&optional count)
  "Move to the next page bounded by the `page-delimiter' variable.
With arg (prefix if interactive), move that many pages."
  (interactive "p")
  (or count (setq count 1))
  (widen)
  ;; Cannot use forward-page because of problems at page boundaries.
  (if (>= count 0)
      (while (and (> count 0) (not (eobp)))
        (if (re-search-forward page-delimiter nil t)
            nil
          (goto-char (point-max)))
        (setq count (1- count)))
    ;; If COUNT is negative, we want to go back -COUNT + 1 page boundaries.
    ;; The first page boundary we reach is the top of the current page,
    ;; which doesn't count.
    (while (and (< count 1) (not (bobp)))
      (if (re-search-backward page-delimiter nil t)
          (when (= count 0)
            (goto-char (match-end 0)))
        (goto-char (point-min)))
      (setq count (1+ count))))
  (narrow-to-page)
  (goto-char (point-min))
  (recenter 0))