summaryrefslogtreecommitdiff
path: root/doc/lispref/variables.texi
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2014-01-06 07:36:13 +0800
committerChong Yidong <cyd@gnu.org>2014-01-06 07:36:13 +0800
commit81c7d631e9a46662d02e09cae74e24f4bb6cb20c (patch)
tree54afea46133ea78781f9a34067845cd522f26e9a /doc/lispref/variables.texi
parent0215e125539d96ec561ff693ad2b5c059e868599 (diff)
downloademacs-81c7d631e9a46662d02e09cae74e24f4bb6cb20c.tar.gz
emacs-81c7d631e9a46662d02e09cae74e24f4bb6cb20c.tar.bz2
emacs-81c7d631e9a46662d02e09cae74e24f4bb6cb20c.zip
More doc updates.
* backups.texi (Making Backups): Document backup-buffer change. * commands.texi (Defining Commands): Document the interactive-form property more carefully. Document interactive-only. * compile.texi (Compiler Errors): Copyedits. Note that the details for byte-compile-warnings are in its docstring. * customize.texi (Variable Definitions): Likewise. * files.texi (Visiting Files): Copyedits. (Testing Accessibility): Mention ACLs. Move file-modes here from File Attributes. (Truenames): Move file-equal-p here from Kinds of Files. (File Attributes): Move file-newer-than-file-p here from Testing Accessibility. (Extended Attributes): New node. Add file-extended-attributes. (Changing Files): Document set-file-extended-attributes. * minibuf.texi (Minibuffer Contents): Remove obsolete function minibuffer-completion-contents. * variables.texi (Defining Variables): Note that defvar acts always on the dynamic value.
Diffstat (limited to 'doc/lispref/variables.texi')
-rw-r--r--doc/lispref/variables.texi21
1 files changed, 13 insertions, 8 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index a80a6c0b1e3..dbeebcc6ee6 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -416,18 +416,23 @@ explicitly in the @code{defvar} form. The variable is marked as
@dfn{special}, meaning that it should always be dynamically bound
(@pxref{Variable Scoping}).
-If @var{symbol} is void and @var{value} is specified, @code{defvar}
-evaluates @var{value} and sets @var{symbol} to the result. But if
-@var{symbol} already has a value (i.e., it is not void), @var{value}
-is not even evaluated, and @var{symbol}'s value remains unchanged. If
-@var{value} is omitted, the value of @var{symbol} is not changed in
-any case.
+If @var{value} is specified, and @var{symbol} is void (i.e., it has no
+dynamically bound value; @pxref{Void Variables}), then @var{value} is
+evaluated and @var{symbol} is set to the result. But if @var{symbol}
+is not void, @var{value} is not evaluated, and @var{symbol}'s value is
+left unchanged. If @var{value} is omitted, the value of @var{symbol}
+is not changed in any case.
If @var{symbol} has a buffer-local binding in the current buffer,
-@code{defvar} operates on the default value, which is buffer-independent,
-not the current (buffer-local) binding. It sets the default value if
+@code{defvar} acts on the default value, which is buffer-independent,
+rather than the buffer-local binding. It sets the default value if
the default value is void. @xref{Buffer-Local Variables}.
+If @var{symbol} is already lexically bound (e.g., if the @code{defvar}
+form occurs in a @code{let} form with lexical binding enabled), then
+@code{defvar} sets the dynamic value. The lexical binding remains in
+effect until its binding construct exits. @xref{Variable Scoping}.
+
When you evaluate a top-level @code{defvar} form with @kbd{C-M-x} in
Emacs Lisp mode (@code{eval-defun}), a special feature of
@code{eval-defun} arranges to set the variable unconditionally, without