]> git.eshelyaron.com Git - emacs.git/commitdiff
(help-xref-button): Do nothing if text already has the help-xref property.
authorRichard M. Stallman <rms@gnu.org>
Mon, 30 Nov 1998 23:55:42 +0000 (23:55 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 30 Nov 1998 23:55:42 +0000 (23:55 +0000)
(describe-variable): Revert previous change to hyperlink to source.

lisp/help.el

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