aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2013-06-25 18:52:09 -0700
committerGlenn Morris2013-06-25 18:52:09 -0700
commitf2136e1e28e9b3f0eb2aef6ebaf6be37024e7bb9 (patch)
treef21176d2fe8c09f7d5da1e88dfb37d2abd60fafc /lisp
parenta343d218fd889e57ab80565815366734fb606b37 (diff)
downloademacs-f2136e1e28e9b3f0eb2aef6ebaf6be37024e7bb9.tar.gz
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/ChangeLog6
-rw-r--r--lisp/info-xref.el21
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 @@
12013-06-26 Glenn Morris <rgm@gnu.org>
2
3 * info-xref.el: Update for Texinfo 5 change in *note format.
4 (info-xref-node-re, info-xref-note-re): New constants.
5 (info-xref-check-buffer): Use info-xref-note-re.
6
12013-06-26 Stefan Monnier <monnier@iro.umontreal.ca> 72013-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * simple.el (set-variable): Use read-from-minibuffer (bug#14710). 9 * 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."
367 (forward-line))) 367 (forward-line)))
368 (info-xref-check-buffer)))))))) 368 (info-xref-check-buffer))))))))
369 369
370(defconst info-xref-node-re "\\(?1:\\(([^)]*)\\)[^.,]+\\)"
371 "Regexp with subexp 1 matching (manual)node.")
372
373;; "@xref{node,crossref,manual}." produces:
374;; texinfo 4 or 5:
375;; *Note crossref: (manual)node.
376;; "@xref{node,,manual}." produces:
377;; texinfo 4:
378;; *Note node: (manual)node.
379;; texinfo 5:
380;; *Note (manual)node::.
381(defconst info-xref-note-re
382 (concat "\\*[Nn]ote[ \n\t]+\\(?:"
383 "[^:]*:[ \n\t]+" info-xref-node-re "\\|"
384 info-xref-node-re "::\\)[.,]")
385 "Regexp matching a \"*note...\" link.")
386
370(defun info-xref-check-buffer () 387(defun info-xref-check-buffer ()
371 "Check external references in the info file in the current buffer. 388 "Check external references in the info file in the current buffer.
372This should be the raw file contents, not `Info-mode'." 389This should be the raw file contents, not `Info-mode'."
373 (goto-char (point-min)) 390 (goto-char (point-min))
374 (while (re-search-forward 391 (while (re-search-forward info-xref-note-re nil t)
375 "\\*[Nn]ote[ \n\t]+[^:]*:[ \n\t]+\\(\\(([^)]*)\\)[^.,]+\\)[.,]"
376 nil t)
377 (save-excursion 392 (save-excursion
378 (goto-char (match-beginning 1)) ;; start of nodename as error position 393 (goto-char (match-beginning 1)) ;; start of nodename as error position
379 (info-xref-check-node (match-string 1))))) 394 (info-xref-check-node (match-string 1)))))