diff options
author | Glenn Morris <rgm@gnu.org> | 2013-06-25 18:52:09 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-06-25 18:52:09 -0700 |
commit | f2136e1e28e9b3f0eb2aef6ebaf6be37024e7bb9 (patch) | |
tree | f21176d2fe8c09f7d5da1e88dfb37d2abd60fafc /lisp | |
parent | a343d218fd889e57ab80565815366734fb606b37 (diff) | |
download | emacs-f2136e1e28e9b3f0eb2aef6ebaf6be37024e7bb9.tar.gz emacs-f2136e1e28e9b3f0eb2aef6ebaf6be37024e7bb9.tar.bz2 emacs-f2136e1e28e9b3f0eb2aef6ebaf6be37024e7bb9.zip |
info-xref.el: Update for Texinfo 5 change in *note format
* lisp/info-xref.el (info-xref-node-re, info-xref-note-re): New constants.
(info-xref-check-buffer): Use info-xref-note-re.
* test/automated/info-xref.el: New file.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/info-xref.el | 21 |
2 files changed, 24 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4cd17401bdd..1c43c23fa5d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-06-26 Glenn Morris <rgm@gnu.org> + + * info-xref.el: Update for Texinfo 5 change in *note format. + (info-xref-node-re, info-xref-note-re): New constants. + (info-xref-check-buffer): Use info-xref-note-re. + 2013-06-26 Stefan Monnier <monnier@iro.umontreal.ca> * simple.el (set-variable): Use read-from-minibuffer (bug#14710). diff --git a/lisp/info-xref.el b/lisp/info-xref.el index 90a8d4968de..c38e23bab8a 100644 --- a/lisp/info-xref.el +++ b/lisp/info-xref.el @@ -367,13 +367,28 @@ in the path." (forward-line))) (info-xref-check-buffer)))))))) +(defconst info-xref-node-re "\\(?1:\\(([^)]*)\\)[^.,]+\\)" + "Regexp with subexp 1 matching (manual)node.") + +;; "@xref{node,crossref,manual}." produces: +;; texinfo 4 or 5: +;; *Note crossref: (manual)node. +;; "@xref{node,,manual}." produces: +;; texinfo 4: +;; *Note node: (manual)node. +;; texinfo 5: +;; *Note (manual)node::. +(defconst info-xref-note-re + (concat "\\*[Nn]ote[ \n\t]+\\(?:" + "[^:]*:[ \n\t]+" info-xref-node-re "\\|" + info-xref-node-re "::\\)[.,]") + "Regexp matching a \"*note...\" link.") + (defun info-xref-check-buffer () "Check external references in the info file in the current buffer. This should be the raw file contents, not `Info-mode'." (goto-char (point-min)) - (while (re-search-forward - "\\*[Nn]ote[ \n\t]+[^:]*:[ \n\t]+\\(\\(([^)]*)\\)[^.,]+\\)[.,]" - nil t) + (while (re-search-forward info-xref-note-re nil t) (save-excursion (goto-char (match-beginning 1)) ;; start of nodename as error position (info-xref-check-node (match-string 1))))) |