aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorPaul Eggert2012-02-24 22:41:40 -0800
committerPaul Eggert2012-02-24 22:41:40 -0800
commita89654f8f34114db543cb91363e8fded6d73e986 (patch)
tree5ac508597ef2aa460308b4b26c244779e48cdb40 /src/eval.c
parent6e6c82a4e687708d5a7a3887f92db45bd74da276 (diff)
parent67b0de11479247cb8bd8491e10e0b464046f18be (diff)
downloademacs-a89654f8f34114db543cb91363e8fded6d73e986.tar.gz
emacs-a89654f8f34114db543cb91363e8fded6d73e986.zip
Merge from trunk.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/src/eval.c b/src/eval.c
index ed3c811f28a..7f3bf6a866f 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -752,17 +752,15 @@ The return value is BASE-VARIABLE. */)
752 752
753DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, 753DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0,
754 doc: /* Define SYMBOL as a variable, and return SYMBOL. 754 doc: /* Define SYMBOL as a variable, and return SYMBOL.
755You are not required to define a variable in order to use it, 755You are not required to define a variable in order to use it, but
756but the definition can supply documentation and an initial value 756defining it lets you supply an initial value and documentation, which
757in a way that tags can recognize. 757can be referred to by the Emacs help facilities and other programming
758 758tools. The `defvar' form also declares the variable as \"special\",
759INITVALUE is evaluated, and used to set SYMBOL, only if SYMBOL's value is void. 759so that it is always dynamically bound even if `lexical-binding' is t.
760If SYMBOL is buffer-local, its default value is what is set; 760
761 buffer-local values are not affected. 761The optional argument INITVALUE is evaluated, and used to set SYMBOL,
762INITVALUE and DOCSTRING are optional. 762only if SYMBOL's value is void. If SYMBOL is buffer-local, its
763If DOCSTRING starts with *, this variable is identified as a user option. 763default value is what is set; buffer-local values are not affected.
764 This means that M-x set-variable recognizes it.
765 See also `user-variable-p'.
766If INITVALUE is missing, SYMBOL's value is not set. 764If INITVALUE is missing, SYMBOL's value is not set.
767 765
768If SYMBOL has a local binding, then this form affects the local 766If SYMBOL has a local binding, then this form affects the local
@@ -771,6 +769,13 @@ load a file defining variables, with this form or with `defconst' or
771`defcustom', you should always load that file _outside_ any bindings 769`defcustom', you should always load that file _outside_ any bindings
772for these variables. \(`defconst' and `defcustom' behave similarly in 770for these variables. \(`defconst' and `defcustom' behave similarly in
773this respect.) 771this respect.)
772
773The optional argument DOCSTRING is a documentation string for the
774variable.
775
776To define a user option, use `defcustom' instead of `defvar'.
777The function `user-variable-p' also identifies a variable as a user
778option if its DOCSTRING starts with *, but this behavior is obsolete.
774usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) 779usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
775 (Lisp_Object args) 780 (Lisp_Object args)
776{ 781{
@@ -845,15 +850,19 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
845 850
846DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0, 851DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0,
847 doc: /* Define SYMBOL as a constant variable. 852 doc: /* Define SYMBOL as a constant variable.
848The intent is that neither programs nor users should ever change this value. 853This declares that neither programs nor users should ever change the
849Always sets the value of SYMBOL to the result of evalling INITVALUE. 854value. This constancy is not actually enforced by Emacs Lisp, but
850If SYMBOL is buffer-local, its default value is what is set; 855SYMBOL is marked as a special variable so that it is never lexically
851 buffer-local values are not affected. 856bound.
852DOCSTRING is optional. 857
853 858The `defconst' form always sets the value of SYMBOL to the result of
854If SYMBOL has a local binding, then this form sets the local binding's 859evalling INITVALUE. If SYMBOL is buffer-local, its default value is
855value. However, you should normally not make local bindings for 860what is set; buffer-local values are not affected. If SYMBOL has a
856variables defined with this form. 861local binding, then this form sets the local binding's value.
862However, you should normally not make local bindings for variables
863defined with this form.
864
865The optional DOCSTRING specifies the variable's documentation string.
857usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) 866usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
858 (Lisp_Object args) 867 (Lisp_Object args)
859{ 868{