emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 74aaf8b 1/2: Improve finding external documents in reftext


From: Lars Ingebrigtsen
Subject: master 74aaf8b 1/2: Improve finding external documents in reftext
Date: Wed, 6 Oct 2021 05:31:21 -0400 (EDT)

branch: master
commit 74aaf8b72762ea65eb755321f0cb8561aca54479
Author: Arash Esbati <arash@gnu.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Improve finding external documents in reftext
    
    * lisp/textmodes/reftex-parse.el (reftex-parse-from-file): Extend
    regexp in order to support \externalcitedocument macro and a
    second optional argument provided by LaTeX package xr-hyper
    (bug#51054).
---
 lisp/textmodes/reftex-parse.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index c521a07..b8c75cb 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -345,7 +345,17 @@ of master file."
 
              ;; Find external document specifications
              (goto-char 1)
-             (while (re-search-forward "[\n\r][ 
\t]*\\\\externaldocument\\(\\[\\([^]]*\\)\\]\\)?{\\([^}]+\\)}" nil t)
+             (while (re-search-forward
+                     (concat "[\n\r][ \t]*"
+                             ;; Support \externalcitedocument macro
+                             "\\\\external\\(?:cite\\)?document"
+                             ;; The optional prefix
+                             "\\(\\[\\([^]]*\\)\\]\\)?"
+                             ;; The 2nd opt. arg can only be nocite
+                             "\\(?:\\[nocite\\]\\)?"
+                             ;; Mandatory file argument
+                             "{\\([^}]+\\)}")
+                     nil t)
                (push (list 'xr-doc (reftex-match-string 2)
                            (reftex-match-string 3))
                      docstruct))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]