diff options
| author | Eli Zaretskii | 2025-02-08 13:47:11 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-02-08 13:47:11 +0200 |
| commit | 223ee56aae7cf052419cf026bce4d7ea29671286 (patch) | |
| tree | e924d6502fd94c7daa522db7f1622cc440e28c1d | |
| parent | be4cf26c16794021ae790f1eb82fccea6efaa354 (diff) | |
| download | emacs-223ee56aae7cf052419cf026bce4d7ea29671286.tar.gz emacs-223ee56aae7cf052419cf026bce4d7ea29671286.zip | |
; Avoid passive tense in Emacs manual
* doc/lispref/variables.texi (Defining Variables): Avoid passive
tense (bug#76135).
| -rw-r--r-- | doc/lispref/variables.texi | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index b56dfb6077b..7bc9243649c 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -499,33 +499,37 @@ initializes it only if it is originally void. | |||
| 499 | Definitions}. | 499 | Definitions}. |
| 500 | 500 | ||
| 501 | @defspec defvar symbol [value [doc-string]] | 501 | @defspec defvar symbol [value [doc-string]] |
| 502 | This special form defines @var{symbol} as a variable. Note that | 502 | This special form defines @var{symbol} as a variable and optionally |
| 503 | @var{symbol} is not evaluated; the symbol to be defined should appear | 503 | initializes and documents it. Note that it doesn't evaluate |
| 504 | explicitly in the @code{defvar} form. The variable is marked as | 504 | @var{symbol}; the symbol to be defined should appear explicitly in the |
| 505 | @dfn{special}, meaning that it should always be dynamically bound | 505 | @code{defvar} form. @code{defvar} also marks @var{symbol} as |
| 506 | @dfn{special}, meaning that its bindings should always be dynamic | ||
| 506 | (@pxref{Variable Scoping}). | 507 | (@pxref{Variable Scoping}). |
| 507 | 508 | ||
| 508 | If @var{value} is specified, and @var{symbol} is void (i.e., it has no | 509 | If @var{value} is specified, and @var{symbol} is void (i.e., it has no |
| 509 | dynamically bound value; @pxref{Void Variables}), then @var{value} is | 510 | dynamically bound value; @pxref{Void Variables}), then @code{defvar} |
| 510 | evaluated and @var{symbol} is set to the result. But if @var{symbol} | 511 | evaluates @var{value}, and initializes @var{symbol} by setting it to the |
| 511 | is not void, @var{value} is not evaluated, and @var{symbol}'s value is | 512 | result of the evaluation. But if @var{symbol} is not void, |
| 512 | left unchanged. If @var{value} is omitted, the value of @var{symbol} | 513 | @code{defvar} does not evaluate @var{value}, and leaves @var{symbol}'s |
| 513 | is not changed in any case. | 514 | value unchanged. If @var{value} is omitted, @code{defvar} doesn't |
| 515 | change the value of @var{symbol} in any case. | ||
| 514 | 516 | ||
| 515 | Note that specifying a value, even @code{nil}, marks the variable as | 517 | Note that specifying a value, even @code{nil}, marks the variable as |
| 516 | special permanently. Whereas if @var{value} is omitted then the | 518 | special permanently. Whereas if @var{value} is omitted, then |
| 517 | variable is only marked special locally (i.e.@: within the current | 519 | @code{defvar} marks the variable special only locally (i.e.@: within the |
| 518 | lexical scope, or file if at the top-level). This can be useful for | 520 | current lexical scope, or within the current file, if @code{defvar} is |
| 519 | suppressing byte compilation warnings, see @ref{Compiler Errors}. | 521 | at the top-level). This can be useful for suppressing byte compilation |
| 520 | 522 | warnings, see @ref{Compiler Errors}. | |
| 521 | If @var{symbol} has a buffer-local binding in the current buffer, | 523 | |
| 522 | @code{defvar} acts on the default value, which is buffer-independent, | 524 | If @var{symbol} has a buffer-local binding in the current buffer, and |
| 523 | rather than the buffer-local binding. It sets the default value if | 525 | @var{value} is specified, @code{defvar} modifies the default value of |
| 524 | the default value is void. @xref{Buffer-Local Variables}. | 526 | @var{symbol}, which is buffer-independent, rather than the buffer-local |
| 525 | 527 | binding. It sets the default value if the default value is void. | |
| 526 | If @var{symbol} is already let bound (e.g., if the @code{defvar} | 528 | @xref{Buffer-Local Variables}. |
| 527 | form occurs in a @code{let} form), then @code{defvar} sets the toplevel | 529 | |
| 528 | default value, like @code{set-default-toplevel-value}. | 530 | If @var{symbol} is already let bound (e.g., if the @code{defvar} form |
| 531 | occurs in a @code{let} form), then @code{defvar} sets the toplevel | ||
| 532 | default value of @var{symbol}, like @code{set-default-toplevel-value}. | ||
| 529 | The let binding remains in effect until its binding construct exits. | 533 | The let binding remains in effect until its binding construct exits. |
| 530 | @xref{Variable Scoping}. | 534 | @xref{Variable Scoping}. |
| 531 | 535 | ||