Commit f58790da authored by Richard M. Stallman's avatar Richard M. Stallman

(help-xref-info-regexp): Allow linebreaks and capital.

(help-make-xrefs): Do Info case first.
parent 6c8719f1
...@@ -938,7 +938,7 @@ The words preceding the quoted symbol can be used in doc strings to ...@@ -938,7 +938,7 @@ The words preceding the quoted symbol can be used in doc strings to
distinguish references to variables, functions and symbols.") distinguish references to variables, functions and symbols.")
(defvar help-xref-info-regexp (defvar help-xref-info-regexp
"\\<info\\s-+node\\s-`\\([^']+\\)'" "\\<[Ii]nfo[ \t\n]+node[ \t\n]+`\\([^']+\\)'"
"Regexp matching doc string references to an Info node.") "Regexp matching doc string references to an Info node.")
(defun help-setup-xref (item interactive-p) (defun help-setup-xref (item interactive-p)
...@@ -980,6 +980,14 @@ that." ...@@ -980,6 +980,14 @@ that."
;; The following should probably be abstracted out. ;; The following should probably be abstracted out.
(unwind-protect (unwind-protect
(progn (progn
;; Info references
(save-excursion
(while (re-search-forward help-xref-info-regexp nil t)
(let ((data (match-string 1)))
(save-match-data
(unless (string-match "^([^)]+)" data)
(setq data (concat "(emacs)" data))))
(help-xref-button 1 #'info data))))
;; Quoted symbols ;; Quoted symbols
(save-excursion (save-excursion
(while (re-search-forward help-xref-symbol-regexp nil t) (while (re-search-forward help-xref-symbol-regexp nil t)
...@@ -1003,14 +1011,6 @@ that." ...@@ -1003,14 +1011,6 @@ that."
(help-xref-button 6 #'describe-variable sym)) (help-xref-button 6 #'describe-variable sym))
((fboundp sym) ((fboundp sym)
(help-xref-button 6 #'describe-function sym))))))) (help-xref-button 6 #'describe-function sym)))))))
;; Info references
(save-excursion
(while (re-search-forward help-xref-info-regexp nil t)
(let ((data (match-string 1)))
(save-match-data
(unless (string-match "^([^)]+)" data)
(setq data (concat "(emacs)" data))))
(help-xref-button 1 #'info data))))
;; An obvious case of a key substitution: ;; An obvious case of a key substitution:
(save-excursion (save-excursion
(while (re-search-forward (while (re-search-forward
......
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