]> git.eshelyaron.com Git - emacs.git/commitdiff
Backport: Remove an ambiguity from defvar's doc string. Fixes bug #25292.
authorAlan Mackenzie <acm@muc.de>
Thu, 29 Dec 2016 20:52:02 +0000 (20:52 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 30 Dec 2016 08:56:28 +0000 (08:56 +0000)
The ambiguity was whether INITVALUE is evaluated when it's not going to be
used to set SYMBOL's value.

* src/eval.c (defvar): Rewrite a paragraph of the doc string.

(cherry picked from commit 8295e97f18490a535d1188a3daf0b0fd1bf4fa0d)

src/eval.c

index b94712d45795969d7cd4698fadc49276d2b56af1..0380b115195c35925d6afd0661ce9aa9c0e39c23 100644 (file)
@@ -704,10 +704,11 @@ can be referred to by the Emacs help facilities and other programming
 tools.  The `defvar' form also declares the variable as \"special\",
 so that it is always dynamically bound even if `lexical-binding' is t.
 
-The optional argument INITVALUE is evaluated, and used to set SYMBOL,
-only if SYMBOL's value is void.  If SYMBOL is buffer-local, its
-default value is what is set; buffer-local values are not affected.
-If INITVALUE is missing, SYMBOL's value is not set.
+If SYMBOL's value is void and the optional argument INITVALUE is
+provided, INITVALUE is evaluated and the result used to set SYMBOL's
+value.  If SYMBOL is buffer-local, its default value is what is set;
+buffer-local values are not affected.  If INITVALUE is missing,
+SYMBOL's value is not set.
 
 If SYMBOL has a local binding, then this form affects the local
 binding.  This is usually not what you want.  Thus, if you need to