[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r107811: Remove defining user variabl
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r107811: Remove defining user variables via * in docstring. |
Date: |
Mon, 09 Apr 2012 20:36:01 +0800 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107811
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-04-09 20:36:01 +0800
message:
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.
modified:
doc/lispref/ChangeLog
doc/lispref/commands.texi
doc/lispref/customize.texi
doc/lispref/help.texi
doc/lispref/minibuf.texi
etc/NEWS
lisp/ChangeLog
lisp/apropos.el
lisp/custom.el
lisp/emacs-lisp/byte-opt.el
lisp/erc/ChangeLog
lisp/erc/erc.el
lisp/files-x.el
lisp/simple.el
lisp/skeleton.el
lisp/woman.el
src/ChangeLog
src/callint.c
src/eval.c
src/minibuf.c
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog 2012-04-06 06:39:35 +0000
+++ b/doc/lispref/ChangeLog 2012-04-09 12:36:01 +0000
@@ -1,3 +1,11 @@
+2012-04-09 Chong Yidong <address@hidden>
+
+ * customize.texi (Variable Definitions): Remove user-variable-p.
+
+ * commands.texi (Interactive Codes):
+ * help.texi (Accessing Documentation):
+ * minibuf.texi (High-Level Completion): Callers changed.
+
2012-04-06 Chong Yidong <address@hidden>
* minibuf.texi (Programmed Completion): Document metadata method.
=== modified file 'doc/lispref/commands.texi'
--- a/doc/lispref/commands.texi 2012-03-02 02:52:40 +0000
+++ b/doc/lispref/commands.texi 2012-04-09 12:36:01 +0000
@@ -482,7 +482,7 @@
@item v
A variable declared to be a user option (i.e., satisfying the
-predicate @code{user-variable-p}). This reads the variable using
+predicate @code{custom-variable-p}). This reads the variable using
@code{read-variable}. @xref{Definition of read-variable}. Existing,
Completion, Prompt.
=== modified file 'doc/lispref/customize.texi'
--- a/doc/lispref/customize.texi 2012-02-05 14:27:06 +0000
+++ b/doc/lispref/customize.texi 2012-04-09 12:36:01 +0000
@@ -462,14 +462,6 @@
another customizable variable.
@end defun
address@hidden user-variable-p arg
-This function is like @code{custom-variable-p}, except it also returns
address@hidden if the first character of the variable's documentation string
-is the character @samp{*}. That is an obsolete way of indicating a
-user option, so for most purposes you may consider
address@hidden as equivalent to @code{custom-variable-p}.
address@hidden defun
-
@node Customization Types
@section Customization Types
=== modified file 'doc/lispref/help.texi'
--- a/doc/lispref/help.texi 2012-03-01 07:29:48 +0000
+++ b/doc/lispref/help.texi 2012-04-09 12:36:01 +0000
@@ -218,7 +218,7 @@
@group
(princ
(format "%s\t%s\n%s\n\n" s
- (if (user-variable-p s)
+ (if (custom-variable-p s)
"Option " "Variable")
@end group
@group
=== modified file 'doc/lispref/minibuf.texi'
--- a/doc/lispref/minibuf.texi 2012-04-06 06:39:35 +0000
+++ b/doc/lispref/minibuf.texi 2012-04-09 12:36:01 +0000
@@ -1313,17 +1313,17 @@
returns @code{fill-prefix}.
In general, @code{read-variable} is similar to @code{read-command},
-but uses the predicate @code{user-variable-p} instead of
+but uses the predicate @code{custom-variable-p} instead of
@code{commandp}:
address@hidden @code{user-variable-p} example
address@hidden @code{custom-variable-p} example
@example
@group
(read-variable @var{prompt})
@equiv{}
(intern
(completing-read @var{prompt} obarray
- 'user-variable-p t nil))
+ 'custom-variable-p t nil))
@end group
@end example
@end defun
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2012-04-09 06:58:41 +0000
+++ b/etc/NEWS 2012-04-09 12:36:01 +0000
@@ -43,6 +43,13 @@
* New Modes and Packages in Emacs 24.2
* Incompatible Lisp Changes in Emacs 24.2
+
++++
+** Docstrings starting with `*' no longer indicate user options.
+Only variables defined using `defcustom' are considered user options.
+The function `user-variable-p' is now an obsolete alias for
+`custom-variable-p'.
+
* Lisp changes in Emacs 24.2
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-04-09 06:58:41 +0000
+++ b/lisp/ChangeLog 2012-04-09 12:36:01 +0000
@@ -1,3 +1,15 @@
+2012-04-09 Chong Yidong <address@hidden>
+
+ * 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.
+
+ * apropos.el (apropos-variable):
+ * files-x.el (read-file-local-variable):
+ * simple.el (set-variable):
+ * woman.el (woman-mini-help):
+ * emacs-lisp/byte-opt.el (side-effect-free-fns): Callers changed.
+
2012-04-09 Glenn Morris <address@hidden>
* startup.el (normal-top-level): Don't look for leim-list.el
=== modified file 'lisp/apropos.el'
--- a/lisp/apropos.el 2012-01-19 07:21:25 +0000
+++ b/lisp/apropos.el 2012-04-09 12:36:01 +0000
@@ -466,7 +466,7 @@
#'(lambda (symbol)
(and (boundp symbol)
(get symbol 'variable-documentation)))
- 'user-variable-p)))
+ 'custom-variable-p)))
;; For auld lang syne:
;;;###autoload
=== modified file 'lisp/custom.el'
--- a/lisp/custom.el 2012-03-25 14:05:51 +0000
+++ b/lisp/custom.el 2012-04-09 12:36:01 +0000
@@ -599,15 +599,17 @@
(put symbol 'custom-autoload (if noset 'noset t))
(custom-add-load symbol load))
-;; This test is also in the C code of `user-variable-p'.
(defun custom-variable-p (variable)
"Return non-nil if VARIABLE is a customizable variable.
A customizable variable is either (i) a variable whose property
list contains a non-nil `standard-value' or `custom-autoload'
property, or (ii) an alias for another customizable variable."
- (setq variable (indirect-variable variable))
- (or (get variable 'standard-value)
- (get variable 'custom-autoload)))
+ (when (symbolp variable)
+ (setq variable (indirect-variable variable))
+ (or (get variable 'standard-value)
+ (get variable 'custom-autoload))))
+
+(define-obsolete-function-alias 'user-variable-p 'custom-variable-p "24.2")
(defun custom-note-var-changed (variable)
"Inform Custom that VARIABLE has been set (changed).
=== modified file 'lisp/emacs-lisp/byte-opt.el'
--- a/lisp/emacs-lisp/byte-opt.el 2012-01-19 07:21:25 +0000
+++ b/lisp/emacs-lisp/byte-opt.el 2012-04-09 12:36:01 +0000
@@ -1237,7 +1237,7 @@
string-to-multibyte
tan truncate
unibyte-char-to-multibyte upcase user-full-name
- user-login-name user-original-login-name user-variable-p
+ user-login-name user-original-login-name custom-variable-p
vconcat
window-buffer window-dedicated-p window-edges window-height
window-hscroll window-minibuffer-p window-width
=== modified file 'lisp/erc/ChangeLog'
--- a/lisp/erc/ChangeLog 2012-02-09 07:48:22 +0000
+++ b/lisp/erc/ChangeLog 2012-04-09 12:36:01 +0000
@@ -1,3 +1,8 @@
+2012-04-09 Chong Yidong <address@hidden>
+
+ * erc.el (erc-cmd-SET): Call custom-variable-p instead of
+ user-variable-p.
+
2012-02-08 Glenn Morris <address@hidden>
* erc-backend.el (erc-coding-system-precedence):
=== modified file 'lisp/erc/erc.el'
--- a/lisp/erc/erc.el 2012-01-19 07:21:25 +0000
+++ b/lisp/erc/erc.el 2012-04-09 12:36:01 +0000
@@ -2616,7 +2616,7 @@
(if (consp val)
(concat "\n" (pp-to-string val))
(format " %S\n" val)))))
- (apropos-internal "^erc-" 'user-variable-p))))
+ (apropos-internal "^erc-" 'custom-variable-p))))
(current-buffer)) t)
(t nil)))
(defalias 'erc-cmd-VAR 'erc-cmd-SET)
=== modified file 'lisp/files-x.el'
--- a/lisp/files-x.el 2012-01-19 07:21:25 +0000
+++ b/lisp/files-x.el 2012-04-09 12:36:01 +0000
@@ -49,7 +49,7 @@
(format "%s: " prompt))
obarray
(lambda (sym)
- (or (user-variable-p sym)
+ (or (custom-variable-p sym)
(get sym 'safe-local-variable)
(memq sym '(mode eval coding unibyte))))
nil nil nil default nil))
=== modified file 'lisp/simple.el'
--- a/lisp/simple.el 2012-03-22 07:38:05 +0000
+++ b/lisp/simple.el 2012-04-09 12:36:01 +0000
@@ -5983,7 +5983,7 @@
With a prefix argument, set VARIABLE to VALUE buffer-locally."
(interactive
(let* ((default-var (variable-at-point))
- (var (if (user-variable-p default-var)
+ (var (if (custom-variable-p default-var)
(read-variable (format "Set variable (default %s): "
default-var)
default-var)
(read-variable "Set variable: ")))
=== modified file 'lisp/skeleton.el'
--- a/lisp/skeleton.el 2012-01-19 07:21:25 +0000
+++ b/lisp/skeleton.el 2012-04-09 12:36:01 +0000
@@ -456,7 +456,7 @@
;; obarray
;; (lambda (symbol)
;; (or (eq symbol 'eval)
-;; (user-variable-p symbol)))
+;; (custom-variable-p symbol)))
;; t)
;; comment-start str ": "
;; (read-from-minibuffer "Expression: " nil read-expression-map nil
=== modified file 'lisp/woman.el'
--- a/lisp/woman.el 2012-01-19 07:21:25 +0000
+++ b/lisp/woman.el 2012-04-09 12:36:01 +0000
@@ -1987,7 +1987,7 @@
(lambda (symbol)
(and
(or (commandp symbol)
- (user-variable-p symbol))
+ (custom-variable-p symbol))
(not (get symbol 'apropos-inhibit))))))
;; Find documentation strings:
(let ((p apropos-accumulator)
@@ -1999,7 +1999,7 @@
(if (setq doc (documentation symbol t))
(substring doc 0 (string-match "\n" doc))
"(not documented)"))
- (if (user-variable-p symbol) ; 3. variable doc
+ (if (custom-variable-p symbol) ; 3. variable doc
(if (setq doc (documentation-property
symbol 'variable-documentation t))
(substring doc 0 (string-match "\n" doc))))))
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-04-09 08:00:08 +0000
+++ b/src/ChangeLog 2012-04-09 12:36:01 +0000
@@ -1,3 +1,12 @@
+2012-04-09 Chong Yidong <address@hidden>
+
+ * 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 <address@hidden>
* xdisp.c (set_cursor_from_row): If the display string appears in
=== modified file 'src/callint.c'
--- a/src/callint.c 2012-01-19 07:21:25 +0000
+++ b/src/callint.c 2012-04-09 12:36:01 +0000
@@ -97,7 +97,7 @@
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 @@
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;
=== modified file 'src/eval.c'
--- a/src/eval.c 2012-03-12 06:34:32 +0000
+++ b/src/eval.c 2012-04-09 12:36:01 +0000
@@ -808,8 +808,6 @@
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 @@
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 @@
defsubr (&Sdefvar);
defsubr (&Sdefvaralias);
defsubr (&Sdefconst);
- defsubr (&Suser_variable_p);
defsubr (&Slet);
defsubr (&SletX);
defsubr (&Swhile);
=== modified file 'src/minibuf.c'
--- a/src/minibuf.c 2012-01-28 03:04:55 +0000
+++ b/src/minibuf.c 2012-04-09 12:36:01 +0000
@@ -72,7 +72,7 @@
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 @@
#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 @@
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 @@
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");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r107811: Remove defining user variables via * in docstring.,
Chong Yidong <=