Function: org-scroll

org-scroll is a byte-compiled function defined in org-macs.el.gz.

Signature

(org-scroll KEY &optional ADDITIONAL-KEYS)

Documentation

Receive KEY and scroll the current window accordingly.

When ADDITIONAL-KEYS is not nil, also include SPC and DEL in the allowed keys for scrolling, as expected in the export dispatch window.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-macs.el.gz
;;; Misc

(defun org-scroll (key &optional additional-keys)
  "Receive KEY and scroll the current window accordingly.
When ADDITIONAL-KEYS is not nil, also include SPC and DEL in the
allowed keys for scrolling, as expected in the export dispatch
window."
  (let ((scrlup (if additional-keys '(?\s ?\C-v) ?\C-v))
	(scrldn (if additional-keys `(?\d ?\M-v) ?\M-v)))
    (pcase key
      (?\C-n (if (not (pos-visible-in-window-p (point-max)))
                 (ignore-errors (scroll-up 1))
	       (message "End of buffer")
	       (sit-for 1)))
      (?\C-p (if (not (pos-visible-in-window-p (point-min)))
                 (ignore-errors (scroll-down 1))
	       (message "Beginning of buffer")
	       (sit-for 1)))
      ;; SPC or
      ((guard (memq key scrlup))
       (if (not (pos-visible-in-window-p (point-max)))
	   (scroll-up nil)
	 (message "End of buffer")
	 (sit-for 1)))
      ;; DEL
      ((guard (memq key scrldn))
       (if (not (pos-visible-in-window-p (point-min)))
	   (scroll-down nil)
	 (message "Beginning of buffer")
	 (sit-for 1))))))