aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2012-04-09 20:36:01 +0800
committerChong Yidong <[email protected]>2012-04-09 20:36:01 +0800
commitb4d3bc10dc84f6b01a2b6b215d0e489555aa6edd (patch)
treeefc38746407c5604b926f192b6f1339dbac410d1 /src
parent9e40dda4c65e2b5a3dba82c180a20bb5c4687540 (diff)
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')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/callint.c4
-rw-r--r--src/eval.c68
-rw-r--r--src/minibuf.c11
4 files changed, 17 insertions, 75 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c1fcfcf243..7c3dd115c5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2012-04-09 Chong Yidong <[email protected]>
+
+ * eval.c (Fuser_variable_p, user_variable_p_eh)
+ (lisp_indirect_variable): Functions deleted.
+ (Fdefvar): Caller changed.
+
+ * callint.c (Finteractive, Fcall_interactively):
+ * minibuf.c (Fread_variable): Callers changed.
+
2012-04-09 Eli Zaretskii <[email protected]>
* xdisp.c (set_cursor_from_row): If the display string appears in
diff --git a/src/callint.c b/src/callint.c
index e09210f1bb..96e2e10b9d 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -97,7 +97,7 @@ r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O.
s -- Any string. Does not inherit the current input method.
S -- Any symbol.
U -- Mouse up event discarded by a previous k or K argument.
-v -- Variable name: symbol that is user-variable-p.
+v -- Variable name: symbol that is `custom-variable-p'.
x -- Lisp expression read but not evaluated.
X -- Lisp expression read and evaluated.
z -- Coding system.
@@ -748,7 +748,7 @@ invoke it. If KEYS is omitted or nil, the return value of
break;
case 'v': /* Variable name: symbol that is
- user-variable-p. */
+ custom-variable-p. */
args[i] = Fread_variable (callint_message, Qnil);
visargs[i] = last_minibuf_string;
break;
diff --git a/src/eval.c b/src/eval.c
index 4a3f5083b3..1a6501a2b6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -808,8 +808,6 @@ The optional argument DOCSTRING is a documentation string for the
variable.
To define a user option, use `defcustom' instead of `defvar'.
-The function `user-variable-p' also identifies a variable as a user
-option if its DOCSTRING starts with *, but this behavior is obsolete.
usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
(Lisp_Object args)
{
@@ -923,71 +921,6 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
return sym;
}
-/* Error handler used in Fuser_variable_p. */
-static Lisp_Object
-user_variable_p_eh (Lisp_Object ignore)
-{
- return Qnil;
-}
-
-static Lisp_Object
-lisp_indirect_variable (Lisp_Object sym)
-{
- struct Lisp_Symbol *s = indirect_variable (XSYMBOL (sym));
- XSETSYMBOL (sym, s);
- return sym;
-}
-
-DEFUN ("user-variable-p", Fuser_variable_p, Suser_variable_p, 1, 1, 0,
- doc: /* Return t if VARIABLE is intended to be set and modified by users.
-\(The alternative is a variable used internally in a Lisp program.)
-
-This function returns t if (i) the first character of its
-documentation is `*', or (ii) it is customizable (its property list
-contains a non-nil value of `standard-value' or `custom-autoload'), or
-\(iii) it is an alias for a user variable.
-
-But condition (i) is considered obsolete, so for most purposes this is
-equivalent to `custom-variable-p'. */)
- (Lisp_Object variable)
-{
- Lisp_Object documentation;
-
- if (!SYMBOLP (variable))
- return Qnil;
-
- /* If indirect and there's an alias loop, don't check anything else. */
- if (XSYMBOL (variable)->redirect == SYMBOL_VARALIAS
- && NILP (internal_condition_case_1 (lisp_indirect_variable, variable,
- Qt, user_variable_p_eh)))
- return Qnil;
-
- while (1)
- {
- documentation = Fget (variable, Qvariable_documentation);
- if (INTEGERP (documentation) && XINT (documentation) < 0)
- return Qt;
- if (STRINGP (documentation)
- && ((unsigned char) SREF (documentation, 0) == '*'))
- return Qt;
- /* If it is (STRING . INTEGER), a negative integer means a user variable. */
- if (CONSP (documentation)
- && STRINGP (XCAR (documentation))
- && INTEGERP (XCDR (documentation))
- && XINT (XCDR (documentation)) < 0)
- return Qt;
- /* Customizable? See `custom-variable-p'. */
- if ((!NILP (Fget (variable, intern ("standard-value"))))
- || (!NILP (Fget (variable, intern ("custom-autoload")))))
- return Qt;
-
- if (!(XSYMBOL (variable)->redirect == SYMBOL_VARALIAS))
- return Qnil;
-
- /* An indirect variable? Let's follow the chain. */
- XSETSYMBOL (variable, SYMBOL_ALIAS (XSYMBOL (variable)));
- }
-}
DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0,
doc: /* Bind variables according to VARLIST then eval BODY.
@@ -3789,7 +3722,6 @@ alist of active lexical bindings. */);
defsubr (&Sdefvar);
defsubr (&Sdefvaralias);
defsubr (&Sdefconst);
- defsubr (&Suser_variable_p);
defsubr (&Slet);
defsubr (&SletX);
defsubr (&Swhile);
diff --git a/src/minibuf.c b/src/minibuf.c
index a9bdf06b73..05f9419ba3 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -72,7 +72,7 @@ Lisp_Object Qcompletion_ignore_case;
static Lisp_Object Qminibuffer_completion_table;
static Lisp_Object Qminibuffer_completion_predicate;
static Lisp_Object Qminibuffer_completion_confirm;
-static Lisp_Object Quser_variable_p;
+static Lisp_Object Qcustom_variable_p;
static Lisp_Object Qminibuffer_default;
@@ -1094,10 +1094,11 @@ Prompt with PROMPT. */)
#endif /* NOTDEF */
DEFUN ("read-variable", Fread_variable, Sread_variable, 1, 2, 0,
- doc: /* Read the name of a user variable and return it as a symbol.
+ doc: /* Read the name of a user option and return it as a symbol.
Prompt with PROMPT. By default, return DEFAULT-VALUE or its first element
if it is a list.
-A user variable is one for which `user-variable-p' returns non-nil. */)
+A user option, or customizable variable, is one for which
+`custom-variable-p' returns non-nil. */)
(Lisp_Object prompt, Lisp_Object default_value)
{
Lisp_Object name, default_string;
@@ -1110,7 +1111,7 @@ A user variable is one for which `user-variable-p' returns non-nil. */)
default_string = default_value;
name = Fcompleting_read (prompt, Vobarray,
- Quser_variable_p, Qt,
+ Qcustom_variable_p, Qt,
Qnil, Qnil, default_string, Qnil);
if (NILP (name))
return name;
@@ -1975,11 +1976,11 @@ syms_of_minibuf (void)
staticpro (&last_minibuf_string);
last_minibuf_string = Qnil;
- DEFSYM (Quser_variable_p, "user-variable-p");
DEFSYM (Qminibuffer_history, "minibuffer-history");
DEFSYM (Qbuffer_name_history, "buffer-name-history");
Fset (Qbuffer_name_history, Qnil);
+ DEFSYM (Qcustom_variable_p, "custom-variable-p");
DEFSYM (Qminibuffer_setup_hook, "minibuffer-setup-hook");
DEFSYM (Qminibuffer_exit_hook, "minibuffer-exit-hook");
DEFSYM (Qhistory_length, "history-length");