From: Chong Yidong Date: Wed, 25 Jan 2012 05:48:11 +0000 (+0800) Subject: Tweak custom-variable-p and user-variable-p docs. X-Git-Tag: emacs-pretest-24.0.93~74 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0b21c100be8937efef4a5b51c67750c05cfe31e2;p=emacs.git Tweak custom-variable-p and user-variable-p docs. * lisp/custom.el (custom-variable-p): Doc fix. * src/eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p. --- diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index f704a3c9397..13490c479a2 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -126,7 +126,7 @@ TUTORIAL.zh abbrevs.texi cyd ack.texi -anti.texi +anti.texi cyd arevert-xtra.texi cyd basic.texi cyd buffers.texi cyd diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eff83cb8460..e1038b89072 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-01-25 Chong Yidong + + * custom.el (custom-variable-p): Doc fix. + 2012-01-25 Glenn Morris * progmodes/compile.el (compilation-next-error-function): diff --git a/lisp/custom.el b/lisp/custom.el index 2ccfe094933..132576ac6e2 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -591,8 +591,10 @@ If NOSET is non-nil, don't bother autoloading LOAD when setting the variable." ;; This test is also in the C code of `user-variable-p'. (defun custom-variable-p (variable) - "Return non-nil if VARIABLE is a custom variable. -This recursively follows aliases." + "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))) diff --git a/src/ChangeLog b/src/ChangeLog index c8b1e654830..f9236f159cd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-01-25 Chong Yidong + + * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p. + 2012-01-21 Chong Yidong * floatfns.c (Fcopysign): Make the second argument non-optional, diff --git a/src/eval.c b/src/eval.c index 7b1c516d756..dbd06e7c1b1 100644 --- a/src/eval.c +++ b/src/eval.c @@ -926,13 +926,14 @@ lisp_indirect_variable (Lisp_Object 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.) -A variable is a user variable if -\(1) the first character of its documentation is `*', or -\(2) it is customizable (its property list contains a non-nil value - of `standard-value' or `custom-autoload'), or -\(3) it is an alias for another user variable. -Return nil if VARIABLE is an alias and there is a loop in the -chain of symbols. */) + +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;