The documentation shown with Ctrl h k up states:
<up> runs the command previous-line (found in global-map), which is an
interactive byte-compiled Lisp function in ‘simple.el’.
It is bound to C-p and <up>.
(previous-line &optional ARG TRY-VSCROLL)
Move cursor vertically up ARG lines.
Interactively, vscroll tall lines if ‘auto-window-vscroll’ is enabled.
Non-interactively, use TRY-VSCROLL to control whether to vscroll tall
lines: if either ‘auto-window-vscroll’ or TRY-VSCROLL is nil, this
function will not vscroll.
ARG defaults to 1.
If there is no character in the target line exactly over the current column,
the cursor is positioned after the character in that line that spans this
column, or at the end of the line if it is not long enough.
If the variable ‘line-move-visual’ is non-nil, this command moves
by display lines. Otherwise, it moves by buffer lines, without
taking variable-width characters or continued lines into account.
See M-x previous-logical-line for a command that always moves by buffer lines.
The command C-x C-n can be used to create
a semipermanent goal column for this command.
Then instead of trying to move exactly vertically (or as close as possible),
this command moves to the specified goal column (or as close as possible).
The goal column is stored in the variable ‘goal-column’, which is nil
when there is no goal column. Note that setting ‘goal-column’
overrides ‘line-move-visual’ and causes this command to move by buffer
lines rather than by display lines.
This function is for interactive use only;
in Lisp code use `forward-line' with negative argument instead.
Probably introduced at or before Emacs version 29.1.
The usual behavior of &optional
values is that their default value is nil
, but the default value for ARG
is stated to be 1
.
What is then the default value of TRY-VSCROLL
?
&optional
values is that their default value isnil
, but the default value forARG
is stated to be1
.” --- 13.2.3 Features of Argument Lists: “the body of the function is free to considernil
an abbreviation for some other meaningful value.” – shynur Apr 14 '23 at 10:47nil
. What you state in your comment is only the consequence of that. – Claudio Apr 14 '23 at 11:06cl-defun
how to accomplish elisp allows you to implement this functionality. Can you provide a short code example demonstrating this? – Claudio Apr 14 '23 at 11:17(cl-defun f (&optional (a 233 supplied-p)) supplied-p)
– shynur Apr 14 '23 at 11:29previous-line
mentions that the default value ofARG
is 1, because that is specific to this function and an exception to the rule. It does not say anything aboutTRY-VSCROLL
because it is no exception: it follows the general rule. OTOH, if you find a case where an exception is NOT documented, feel free to submit a doc bug report. – NickD Apr 14 '23 at 18:38