Function: scroll-down-command
scroll-down-command is an interactive and byte-compiled function
defined in window.el.gz.
Signature
(scroll-down-command &optional ARG)
Documentation
Scroll text of selected window down ARG lines; or near full screen if no ARG.
If scroll-error-top-bottom is non-nil and scroll-down cannot
scroll window further, move cursor to the top line.
When point is already on that position, then signal an error.
A near full screen is next-screen-context-lines less than a full screen.
Negative ARG means scroll upward.
If ARG is the atom -, scroll upward by nearly full screen.
Probably introduced at or before Emacs version 24.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun scroll-down-command (&optional arg)
"Scroll text of selected window down ARG lines; or near full screen if no ARG.
If `scroll-error-top-bottom' is non-nil and `scroll-down' cannot
scroll window further, move cursor to the top line.
When point is already on that position, then signal an error.
A near full screen is `next-screen-context-lines' less than a full screen.
Negative ARG means scroll upward.
If ARG is the atom `-', scroll upward by nearly full screen."
(interactive "^P")
(cond
((null scroll-error-top-bottom)
(scroll-down arg))
((eq arg '-)
(scroll-up-command nil))
((< (prefix-numeric-value arg) 0)
(scroll-up-command (- (prefix-numeric-value arg))))
((bobp)
(scroll-down arg)) ; signal error
(t
(condition-case nil
(scroll-down arg)
(beginning-of-buffer
(if arg
;; When scrolling by ARG lines can't be done,
;; move by ARG lines instead.
(forward-line (- arg))
;; When ARG is nil for full-screen scrolling,
;; move to the top of the buffer.
(goto-char (point-min))))))))