Commit 5f373960 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(help-xref-button): Do nothing if text already has the help-xref property.

(describe-variable): Revert previous change to hyperlink to source.
parent 71c78f01
...@@ -751,14 +751,12 @@ Returns the documentation as a string, also." ...@@ -751,14 +751,12 @@ Returns the documentation as a string, also."
;; anything expects the current format.) ;; anything expects the current format.)
(let ((file-name (describe-function-find-file variable))) (let ((file-name (describe-function-find-file variable)))
(when file-name (when file-name
;; Don't quote this, or it can get re-interpreted later (princ "\n\nDefined in `")
;; by `help-make-xrefs'.
(princ "\n\nDefined in ")
(princ file-name) (princ file-name)
(princ ".") (princ "'.")
(with-current-buffer "*Help*" (with-current-buffer "*Help*"
(save-excursion (save-excursion
(re-search-backward "Defined in \\([^.]+\\)." nil t) (re-search-backward "`\\([^`']+\\)'" nil t)
(help-xref-button 1 (lambda (arg) (help-xref-button 1 (lambda (arg)
(let ((location (let ((location
(find-variable-noselect arg))) (find-variable-noselect arg)))
...@@ -1029,17 +1027,19 @@ MATCH-NUMBER is the subexpression of interest in the last matched ...@@ -1029,17 +1027,19 @@ MATCH-NUMBER is the subexpression of interest in the last matched
regexp. FUNCTION is a function to invoke when the button is regexp. FUNCTION is a function to invoke when the button is
activated, applied to DATA. DATA may be a single value or a list. activated, applied to DATA. DATA may be a single value or a list.
See `help-make-xrefs'." See `help-make-xrefs'."
(add-text-properties (match-beginning match-number) ;; Don't mung properties we've added specially in some instances.
(match-end match-number) (unless (get-text-property (match-beginning match-number) 'help-xref)
(list 'mouse-face 'highlight (add-text-properties (match-beginning match-number)
'help-xref (cons function (match-end match-number)
(if (listp data) (list 'mouse-face 'highlight
data 'help-xref (cons function
(list data))))) (if (listp data)
(if help-highlight-p data
(put-text-property (match-beginning match-number) (list data)))))
(match-end match-number) (if help-highlight-p
'face help-highlight-face))) (put-text-property (match-beginning match-number)
(match-end match-number)
'face help-highlight-face))))
;; Additional functions for (re-)creating types of help buffers. ;; Additional functions for (re-)creating types of help buffers.
......
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