emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 2c23247 62/80: Support explicitly numbered group


From: Tassilo Horn
Subject: [elpa] externals/auctex 2c23247 62/80: Support explicitly numbered group contructs
Date: Wed, 16 Oct 2019 11:07:18 -0400 (EDT)

branch: externals/auctex
commit 2c232474a6406fa7683ffaa70406757904423a46
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>

    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
             "[^] ,}\r\n\t%]+"
             ;; Close the group



reply via email to

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