diff options
| author | Chong Yidong | 2012-04-09 20:36:01 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-04-09 20:36:01 +0800 |
| commit | b4d3bc10dc84f6b01a2b6b215d0e489555aa6edd (patch) | |
| tree | efc38746407c5604b926f192b6f1339dbac410d1 /src/eval.c | |
| parent | 9e40dda4c65e2b5a3dba82c180a20bb5c4687540 (diff) | |
| download | emacs-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.c | 68 |
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 | |||
| 808 | variable. | 808 | variable. |
| 809 | 809 | ||
| 810 | To define a user option, use `defcustom' instead of `defvar'. | 810 | To define a user option, use `defcustom' instead of `defvar'. |
| 811 | The function `user-variable-p' also identifies a variable as a user | ||
| 812 | option if its DOCSTRING starts with *, but this behavior is obsolete. | ||
| 813 | usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | 811 | usage: (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. */ | ||
| 927 | static Lisp_Object | ||
| 928 | user_variable_p_eh (Lisp_Object ignore) | ||
| 929 | { | ||
| 930 | return Qnil; | ||
| 931 | } | ||
| 932 | |||
| 933 | static Lisp_Object | ||
| 934 | lisp_indirect_variable (Lisp_Object sym) | ||
| 935 | { | ||
| 936 | struct Lisp_Symbol *s = indirect_variable (XSYMBOL (sym)); | ||
| 937 | XSETSYMBOL (sym, s); | ||
| 938 | return sym; | ||
| 939 | } | ||
| 940 | |||
| 941 | DEFUN ("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 | |||
| 945 | This function returns t if (i) the first character of its | ||
| 946 | documentation is `*', or (ii) it is customizable (its property list | ||
| 947 | contains a non-nil value of `standard-value' or `custom-autoload'), or | ||
| 948 | \(iii) it is an alias for a user variable. | ||
| 949 | |||
| 950 | But condition (i) is considered obsolete, so for most purposes this is | ||
| 951 | equivalent 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 | ||
| 992 | DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0, | 925 | DEFUN ("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); |