auctex-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 8ae405b919 14/30: Save regexp groups


From: Tassilo Horn
Subject: [elpa] externals/auctex 8ae405b919 14/30: Save regexp groups
Date: Thu, 7 Dec 2023 03:51:07 -0500 (EST)

branch: externals/auctex
commit 8ae405b9195d1c449949d930d0b2bf91458cbf48
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Save regexp groups
    
    * latex.el (LaTeX-auto-minimal-regexp-list)
    (LaTeX-auto-class-regexp-list): Use shy groups where possible.
---
 latex.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/latex.el b/latex.el
index 7bada4224c..5e8845554c 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)




reply via email to

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