auctex-devel
[Top][All Lists]
Advanced

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

Preparation for moving xparse.el into latex.el


From: Arash Esbati
Subject: Preparation for moving xparse.el into latex.el
Date: Tue, 07 Nov 2023 20:27:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi all,

I think it's high time to move the content of xparse.el into latex.el;
that stuff is part of LaTeX kernel for some years now and AUCTeX should
catch up.

Before doing that and eating up another 10 regexp groups, I thought I
reduce some others with this change.  I'd be grateful if others could
also have a look at this and double-check if I'm doing TRT here.

--8<---------------cut here---------------start------------->8---
diff --git a/latex.el b/latex.el
index 7bada422..5e884555 100644
--- a/latex.el
+++ b/latex.el
@@ -1734,12 +1734,12 @@ right number."

 (defvar LaTeX-auto-minimal-regexp-list
   '(("\\\\document\\(style\\|class\\)\
-\\(\\[\\(\\([^#\\%]\\|%[^\n\r]*[\n\r]\\)*\\)\\]\\)?\
+\\(?:\\[\\(\\(?:[^#\\%]\\|%[^\n\r]*[\n\r]\\)*\\)\\]\\)?\
 {\\([^#\\.\n\r]+?\\)}"
-     (3 5 1) LaTeX-auto-style)
-    ("\\\\use\\(package\\)\\(\\[\\([^]]*\\)\\]\\)?\
+     (2 3 1) LaTeX-auto-style)
+    ("\\\\use\\(package\\)\\(?:\\[\\([^]]*\\)\\]\\)?\
 {\\(\\([^#}\\.%]\\|%[^\n\r]*[\n\r]\\)+?\\)}"
-     (3 4 1) LaTeX-auto-style))
+     (2 3 1) LaTeX-auto-style))
   "Minimal list of regular expressions matching LaTeX macro definitions.")

 (defvar LaTeX-auto-label-regexp-list
@@ -1761,15 +1761,15 @@ This is necessary since index entries may contain 
commands and stuff.")

 (defvar LaTeX-auto-class-regexp-list
   `(;; \RequirePackage[<options>]{<package>}[<date>]
-    ("\\\\Require\\(Package\\)\\(\\[\\([^]]*\\)\\]\\)?\
+    ("\\\\Require\\(Package\\)\\(?:\\[\\([^]]*\\)\\]\\)?\
 {\\([^#\\.\n\r]+?\\)}"
-     (3 4 1) LaTeX-auto-style)
+     (2 3 1) LaTeX-auto-style)
     ;; \RequirePackageWithOptions{<package>}[<date>],
     ("\\\\Require\\(Package\\)WithOptions\\(\\){\\([^#\\.\n\r]+?\\)}"
      (2 3 1) LaTeX-auto-style)
     ;; \LoadClass[<options>]{<package>}[<date>]
-    ("\\\\Load\\(Class\\)\\(\\[\\([^]]*\\)\\]\\)?{\\([^#\\.\n\r]+?\\)}"
-     (3 4 1) LaTeX-auto-style)
+    ("\\\\Load\\(Class\\)\\(?:\\[\\([^]]*\\)\\]\\)?{\\([^#\\.\n\r]+?\\)}"
+     (2 3 1) LaTeX-auto-style)
     ;; \LoadClassWithOptions{<package>}[<date>]
     ("\\\\Load\\(Class\\)WithOptions\\(\\){\\([^#\\.\n\r]+?\\)}"
      (2 3 1) LaTeX-auto-style)
--8<---------------cut here---------------end--------------->8---

TIA.

Best, Arash



reply via email to

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