Wizard
Wizard

Reputation: 22113

"&optional" in (prettify-symbols-mode &optional ARG)

using Emacs Lisp:

Upon invoking describe-function to review prettify-symbols-mode

(prettify-symbols-mode &optional ARG)

What does &optional mean? is & is a 'logand'?

Upvotes: 0

Views: 250

Answers (1)

jeffkowalski
jeffkowalski

Reputation: 354

&optional in an argument list mean that the arguments that follow are not required. If the caller provides them then they'll be assigned to the respective variables. If not, then the variables will be nil.

See also https://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.html

The '&' in front of 'optional' makes it possible for the defun to recognize '&optional' as a keyword and not an argument itself.

Upvotes: 4

Related Questions