aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorChong Yidong2012-04-09 20:36:01 +0800
committerChong Yidong2012-04-09 20:36:01 +0800
commitb4d3bc10dc84f6b01a2b6b215d0e489555aa6edd (patch)
treeefc38746407c5604b926f192b6f1339dbac410d1 /src/eval.c
parent9e40dda4c65e2b5a3dba82c180a20bb5c4687540 (diff)
downloademacs-b4d3bc10dc84f6b01a2b6b215d0e489555aa6edd.tar.gz
emacs-b4d3bc10dc84f6b01a2b6b215d0e489555aa6edd.zip
Remove defining user variables via * in docstring.
* lisp/apropos.el (apropos-variable): * lisp/files-x.el (read-file-local-variable): * lisp/simple.el (set-variable): * lisp/woman.el (woman-mini-help): * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Callers changed. * lisp/custom.el (custom-variable-p): Return nil for non-symbol arguments instead of signaling an error. (user-variable-p): Obsolete alias for custom-variable-p. * lisp/erc/erc.el (erc-cmd-SET): Call custom-variable-p instead of user-variable-p. * src/callint.c (Finteractive, Fcall_interactively): * src/minibuf.c (Fread_variable): Callers changed. * src/eval.c (Fuser_variable_p, user_variable_p_eh) (lisp_indirect_variable): Functions deleted. (Fdefvar): Caller changed. * doc/lispref/commands.texi (Interactive Codes): * doc/lispref/help.texi (Accessing Documentation): * doc/lispref/minibuf.texi (High-Level Completion): Callers changed. * doc/lispref/customize.texi (Variable Definitions): Remove user-variable-p.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/eval.c b/src/eval.c
index 4a3f5083b3b..1a6501a2b68 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -808,8 +808,6 @@ The optional argument DOCSTRING is a documentation string for the
808variable. 808variable.
809 809
810To define a user option, use `defcustom' instead of `defvar'. 810To define a user option, use `defcustom' instead of `defvar'.
811The function `user-variable-p' also identifies a variable as a user
812option if its DOCSTRING starts with *, but this behavior is obsolete.
813usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) 811usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
814 (Lisp_Object args) 812 (Lisp_Object args)
815{ 813{
@@ -923,71 +921,6 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
923 return sym; 921 return sym;
924} 922}
925 923
926/* Error handler used in Fuser_variable_p. */
927static Lisp_Object
928user_variable_p_eh (Lisp_Object ignore)
929{
930 return Qnil;
931}
932
933static Lisp_Object
934lisp_indirect_variable (Lisp_Object sym)
935{
936 struct Lisp_Symbol *s = indirect_variable (XSYMBOL (sym));
937 XSETSYMBOL (sym, s);
938 return sym;
939}
940
941DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0,
942 doc: /* Return t if VARIABLE is intended to be set and modified by users.
943\(The alternative is a variable used internally in a Lisp program.)
944
945This function returns t if (i) the first character of its
946documentation is `*', or (ii) it is customizable (its property list
947contains a non-nil value of `standard-value' or `custom-autoload'), or
948\(iii) it is an alias for a user variable.
949
950But condition (i) is considered obsolete, so for most purposes this is
951equivalent to `custom-variable-p'. */)
952 (Lisp_Object variable)
953{
954 Lisp_Object documentation;
955
956 if (!SYMBOLP (variable))
957 return Qnil;
958
959 /* If indirect and there's an alias loop, don't check anything else. */
960 if (XSYMBOL (variable)->redirect == SYMBOL_VARALIAS
961 && NILP (internal_condition_case_1 (lisp_indirect_variable, variable,
962 Qt, user_variable_p_eh)))
963 return Qnil;
964
965 while (1)
966 {
967 documentation = Fget (variable, Qvariable_documentation);
968 if (INTEGERP (documentation) && XINT (documentation) < 0)
969 return Qt;
970 if (STRINGP (documentation)
971 && ((unsigned char) SREF (documentation, 0) == '*'))
972 return Qt;
973 /* If it is (STRING . INTEGER), a negative integer means a user variable. */
974 if (CONSP (documentation)
975 && STRINGP (XCAR (documentation))
976 && INTEGERP (XCDR (documentation))
977 && XINT (XCDR (documentation)) < 0)
978 return Qt;
979 /* Customizable? See `custom-variable-p'. */
980 if ((!NILP (Fget (variable, intern ("standard-value"))))
981 || (!NILP (Fget (variable, intern ("custom-autoload")))))
982 return Qt;
983
984 if (!(XSYMBOL (variable)->redirect == SYMBOL_VARALIAS))
985 return Qnil;
986
987 /* An indirect variable? Let's follow the chain. */
988 XSETSYMBOL (variable, SYMBOL_ALIAS (XSYMBOL (variable)));
989 }
990}
991 924
992DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0, 925DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0,
993 doc: /* Bind variables according to VARLIST then eval BODY. 926 doc: /* Bind variables according to VARLIST then eval BODY.
@@ -3789,7 +3722,6 @@ alist of active lexical bindings. */);
3789 defsubr (&Sdefvar); 3722 defsubr (&Sdefvar);
3790 defsubr (&Sdefvaralias); 3723 defsubr (&Sdefvaralias);
3791 defsubr (&Sdefconst); 3724 defsubr (&Sdefconst);
3792 defsubr (&Suser_variable_p);
3793 defsubr (&Slet); 3725 defsubr (&Slet);
3794 defsubr (&SletX); 3726 defsubr (&SletX);
3795 defsubr (&Swhile); 3727 defsubr (&Swhile);