branch: externals/auctex
commit 1b6e5136b2a634ea9747d3515bbc6e98faa1f45c
Author: Arash Esbati <[email protected]>
Commit: Arash Esbati <[email protected]>

    ; Use `LaTeX-extract-key-value-label'
    
    * style/tcolorbox.el (LaTeX-tcolorbox-newtcolorbox-regexp)
    (LaTeX-tcolorbox-newtcbox-regexp): Use
    `LaTeX-extract-key-value-label' to build the regexp.
---
 style/tcolorbox.el | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/style/tcolorbox.el b/style/tcolorbox.el
index d8e9ffb..cae2662 100644
--- a/style/tcolorbox.el
+++ b/style/tcolorbox.el
@@ -46,6 +46,7 @@
 
 ;; Needed for auto-parsing:
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
@@ -405,13 +406,9 @@
 (defvar LaTeX-tcolorbox-newtcolorbox-regexp
   `(,(concat "\\\\\\(re\\)?newtcolorbox"
             "[ \t\n\r%]*"
-            "\\(?:\\[[^][]*"
-              "\\(?:{[^}{]*"
-                "\\(?:{[^}{]*"
-                  "\\(?:{[^}{]*}[^}{]*\\)*"
-                "}[^}{]*\\)*"
-              "}[^][]*\\)*"
-            "\\]\\)?"
+            "\\(?:"
+            (LaTeX-extract-key-value-label 'none)
+            "\\)?"
             "[ \t\n\r%]*"
             "{\\([a-zA-Z0-9]+\\)}"
             "[ \t\n\r%]*"
@@ -427,13 +424,9 @@
 (defvar LaTeX-tcolorbox-newtcbox-regexp
   `(,(concat "\\\\\\(re\\)?newtcbox"
             "[ \t\n\r%]*"
-            "\\(?:\\[[^][]*"
-              "\\(?:{[^}{]*"
-                "\\(?:{[^}{]*"
-                  "\\(?:{[^}{]*}[^}{]*\\)*"
-                "}[^}{]*\\)*"
-              "}[^][]*\\)*"
-            "\\]\\)?"
+            "\\(?:"
+            (LaTeX-extract-key-value-label 'none)
+            "\\)?"
             "[ \t\n\r%]*"
             "{\\\\\\([a-zA-Z]+\\)}"
             "[ \t\n\r%]*"

Reply via email to