]> git.eshelyaron.com Git - emacs.git/commitdiff
(describe-variable): Hyperlink the definition.
authorDave Love <fx@gnu.org>
Fri, 30 Oct 1998 19:07:09 +0000 (19:07 +0000)
committerDave Love <fx@gnu.org>
Fri, 30 Oct 1998 19:07:09 +0000 (19:07 +0000)
lisp/help.el

index 850cf3078d9758d2bc6b58475b63abe22ff20c6c..2e2b9459b535ddaaef96a49360f021b78ed26bf4 100644 (file)
@@ -743,6 +743,23 @@ Returns the documentation as a string, also."
                    (help-xref-button 1 #'(lambda (v)
                                            (customize-variable v)) variable)
                    ))))
+         ;; Make a hyperlink to the library if appropriate.  (Don't
+         ;; change the format of the buffer's initial line in case
+         ;; anything expects the current format.)
+         (let ((file-name (describe-function-find-file variable)))
+           (when file-name
+             (princ "\n\nDefined in `")
+             (princ file-name)
+             (princ "'.")
+             (with-current-buffer "*Help*"
+               (save-excursion
+                 (re-search-backward "`\\([^`']+\\)'" nil t)
+                 (help-xref-button 1 (lambda (arg)
+                                       (let ((location
+                                              (find-variable-noselect arg)))
+                                         (pop-to-buffer (car location))
+                                         (goto-char (cdr location))))
+                                   variable)))))
 
          (print-help-return-message)
          (save-excursion