Commit 3476e159 authored by Dave Love's avatar Dave Love
Browse files

(describe-variable): Hyperlink the definition.

parent e0a3686b
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment