emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mentioning variable aliases in `describe-variable'


From: John Paul Wallington
Subject: mentioning variable aliases in `describe-variable'
Date: Wed, 10 Jul 2002 10:42:47 +0100

I think it would be nice to mention when a variable is an alias in
`describe-variable'.  What do people think ?

2002-07-10  John Paul Wallington  <address@hidden>

        * help-fns.el (describe-variable): Mention if the variable is an
        alias.

Index: help-fns.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help-fns.el,v
retrieving revision 1.12
diff -u -r1.12 help-fns.el
--- help-fns.el 27 Jun 2002 16:10:23 -0000      1.12
+++ help-fns.el 10 Jul 2002 09:35:23 -0000
@@ -438,7 +438,16 @@
                (terpri)))
            (let ((doc (documentation-property variable 
'variable-documentation)))
              (princ (or doc "Not documented as a variable.")))
-         
+           
+           ;; Mention if the variable is an alias.
+           (let ((alias (condition-case nil
+                            (indirect-variable variable)
+                          (error variable))))
+             (unless (eq alias variable)
+               (terpri)
+               (terpri)
+               (princ (format "This variable is an alias for `%s'." alias))))
+           
            ;; 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

-- 
John Paul Wallington




reply via email to

[Prev in Thread] Current Thread [Next in Thread]