From: Dave Love Date: Fri, 30 Oct 1998 19:07:09 +0000 (+0000) Subject: (describe-variable): Hyperlink the definition. X-Git-Tag: emacs-20.4~1358 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3476e1595542523a3c26ba719b49eea6249d62dc;p=emacs.git (describe-variable): Hyperlink the definition. --- diff --git a/lisp/help.el b/lisp/help.el index 850cf3078d9..2e2b9459b53 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -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