Mercurial > emacs
changeset 46389:51248f96252a
(describe-variable): Show documentation for aliased variable if alias does not
have its own.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Mon, 15 Jul 2002 15:38:49 +0000 |
parents | 0533d978a8ab |
children | 4fbc342b5337 |
files | lisp/help-fns.el |
diffstat | 1 files changed, 15 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/help-fns.el Mon Jul 15 15:37:51 2002 +0000 +++ b/lisp/help-fns.el Mon Jul 15 15:38:49 2002 +0000 @@ -435,23 +435,25 @@ (forward-line -1) (insert "Automatically becomes buffer-local when set in any fashion.\n")))) ;; Mention if it's an alias - (let ((alias (condition-case nil + (let* ((alias (condition-case nil (indirect-variable variable) - (error variable)))) + (error variable))) + (obsolete (get variable 'byte-obsolete-variable)) + (doc (or (documentation-property variable 'variable-documentation) + (documentation-property alias 'variable-documentation)))) (unless (eq alias variable) (princ (format "This variable is an alias for `%s'." alias)) (terpri) - (terpri))) - (let ((obsolete (get variable 'byte-obsolete-variable))) - (when obsolete - (princ "This variable is obsolete") - (if (cdr obsolete) (princ (format " since %s" (cdr obsolete)))) - (princ "; ") (terpri) - (princ (if (stringp (car obsolete)) (car obsolete) - (format "use `%s' instead." (car obsolete)))) - (terpri))) - (let ((doc (documentation-property variable 'variable-documentation))) - (princ (or doc "Not documented as a variable."))) + (terpri)) + (when obsolete + (princ "This variable is obsolete") + (if (cdr obsolete) (princ (format " since %s" (cdr obsolete)))) + (princ "; ") (terpri) + (princ (if (stringp (car obsolete)) (car obsolete) + (format "use `%s' instead." (car obsolete)))) + (terpri) + (terpri)) + (princ (or doc "Not documented as a variable."))) ;; Make a link to customize if this variable can be customized. ;; Note, it is not reliable to test only for a custom-type property ;; because those are only present after the var's definition