Function: help-xref-button

help-xref-button is an autoloaded and byte-compiled function defined in help-mode.el.gz.

Signature

(help-xref-button MATCH-NUMBER TYPE &rest ARGS)

Documentation

Make a hyperlink for cross-reference text previously matched.

MATCH-NUMBER is the subexpression of interest in the last matched regexp. TYPE is the type of button to use. Any remaining arguments are passed to the button's help-function when it is invoked. See help-make-xrefs.

This function removes quotes surrounding the match if the variable help-clean-buttons is non-nil.

Source Code

;; Defined in /usr/src/emacs/lisp/help-mode.el.gz
;;;###autoload
(defun help-xref-button (match-number type &rest args)
  "Make a hyperlink for cross-reference text previously matched.
MATCH-NUMBER is the subexpression of interest in the last matched
regexp.  TYPE is the type of button to use.  Any remaining arguments are
passed to the button's help-function when it is invoked.
See `help-make-xrefs'.

This function removes quotes surrounding the match if the
variable `help-clean-buttons' is non-nil."
  ;; Don't mung properties we've added specially in some instances.
  (let ((beg (match-beginning match-number))
        (end (match-end match-number)))
    (unless (button-at beg)
      (make-text-button beg end 'type type 'help-args args)
      (when (and help-clean-buttons
                 (> beg (point-min))
                 (save-excursion
                   (goto-char (1- beg))
                   (looking-at "['`‘]"))
                 (< end (point-max))
                 (save-excursion
                   (goto-char end)
                   (looking-at "['’]")))
        (delete-region end (1+ end))
        (delete-region (1- beg) beg)))))