branch: externals/auctex
commit 2c232474a6406fa7683ffaa70406757904423a46
Author: Arash Esbati <ar...@gnu.org>
Commit: Arash Esbati <ar...@gnu.org>

    Support explicitly numbered group contructs
    
    * latex.el (LaTeX-extract-key-value-label): Add an optional
    argument for explicitly numbered group contructs.
---
 latex.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/latex.el b/latex.el
index 17a4462..602e2df 100644
--- a/latex.el
+++ b/latex.el
@@ -6694,10 +6694,12 @@ functions `TeX-arg-color' (style/color.el) or
              last-optional-rejected))
      ,@body))
 
-(defun LaTeX-extract-key-value-label (&optional key)
+(defun LaTeX-extract-key-value-label (&optional key num)
   "Return a regexp string to match a label in an optional argument.
 The optional KEY is a string which is the name of the key in the
-key=value, default is \"label\".
+key=value, default is \"label\".  NUM is an integer for an
+explicitly numbered group construct, useful when adding items to
+`reftex-label-regexps'.
 
 As an extra feature, the key can be the symbol none where the
 entire matching for the key=value is skipped.  The regexp then is
@@ -6723,6 +6725,9 @@ wrapped in \(?:...\)? then."
             "[[:space:]]*=[[:space:]]*"
             ;; Match the value; braces around the value are optional
             "{?\("
+            ;; Cater for NUM which sets the regexp group
+            (when (and num (integerp num))
+              (concat "?" (number-to-string num) ":"))
             ;; One of these chars terminates the value
             "[^] ,}
        %]+"
             ;; Close the group

_______________________________________________
auctex-diffs mailing list
auctex-di...@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-diffs

Reply via email to