From 50a2c5f9e9925374318c37001e98bdd4bae770a2 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 15 Jul 2002 15:38:49 +0000 Subject: [PATCH] (describe-variable): Show documentation for aliased variable if alias does not have its own. --- lisp/help-fns.el | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 996f6a48aaa..250926b18a4 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -435,23 +435,25 @@ it is displayed along with the global value." (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 -- 2.39.5