auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex c731038844 11/60: Improve regexp


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex c731038844 11/60: Improve regexp matching new environments
Date: Fri, 8 Apr 2022 11:52:47 -0400 (EDT)

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

    Improve regexp matching new environments
    
    * style/newfloat.el
    (LaTeX-newfloat-DeclareFloatingEnvironment-regexp): Add 'p' to the
    name of the variable.  Use the function
    `LaTeX-extract-key-value-label' to build the regexp.  Be more
    restrictive when matching the type of declared environment.
---
 style/newfloat.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/style/newfloat.el b/style/newfloat.el
index 74185bd67d..5cde1d4c7a 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -1,6 +1,6 @@
 ;;; newfloat.el --- AUCTeX style for `newfloat.sty' (v1.1-109)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015--2021 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2022 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -82,15 +82,15 @@
 ;; Setup parsing for \DeclareFloatingEnvironment:
 (TeX-auto-add-type "newfloat-DeclareFloatingEnvironment" "LaTeX")
 
-(defvar LaTeX-newfloat-DeclareFloatingEnvironment-regex
+(defvar LaTeX-newfloat-DeclareFloatingEnvironment-regexp
   `(,(concat "\\\\DeclareFloatingEnvironment"
              "[ \t\n\r%]*"
-             "\\["
-             "[ \t\n\r%{}a-zA-Z0-9=,-]*"
-             "\\]"
+             "\\(?:"
+             (LaTeX-extract-key-value-label 'none)
+             "\\)?"
              "[ \t\n\r%]*"
              "{\\([^}]+\\)}"
-             "\\(?:[ %]*{\\([^}]*\\)}\\)?")
+             "\\(?:[ %]*{\\(figure\\|table\\|verbatim\\)}\\)?")
     (1 2) LaTeX-auto-newfloat-DeclareFloatingEnvironment)
   "Matches the argument of `\\DeclareFloatingEnvironment' from 
`newfloat.sty'.")
 
@@ -152,7 +152,7 @@ If `caption.el' is loaded, add the new floating environment 
to
  (lambda ()
 
    ;; Add newfloat to the parser.
-   (TeX-auto-add-regexp LaTeX-newfloat-DeclareFloatingEnvironment-regex)
+   (TeX-auto-add-regexp LaTeX-newfloat-DeclareFloatingEnvironment-regexp)
 
    ;; Commands:
    (TeX-add-symbols




reply via email to

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