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

    Consider environments defined with newfloat package
    
    * style/subcaption.el ("subcaption"): Offer environments defined
    with newfloat package when declaring the sub-caption feature.
---
 style/subcaption.el | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/style/subcaption.el b/style/subcaption.el
index e40dc80dbf..cd3312d3eb 100644
--- a/style/subcaption.el
+++ b/style/subcaption.el
@@ -1,6 +1,6 @@
 ;;; subcaption.el --- AUCTeX style for `subcaption.sty' (v1.3)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015--2021 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2022 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <ar...@gnu.org>
 ;; Maintainer: auctex-de...@gnu.org
@@ -141,16 +141,26 @@ caption, insert only a caption."
        completing-read (TeX-argument-prompt t nil "Numbering scheme")
        '("arabic" "roman" "Roman" "alph" "Alph" "fnsymbol")]
       (TeX-arg-eval
-       completing-read (TeX-argument-prompt nil nil "Type")
-       '("figure" "table")))
+       completing-read
+       (TeX-argument-prompt nil nil "Type")
+       (append
+        (when (and (fboundp 'LaTeX-newfloat-DeclareFloatingEnvironment-list)
+                   (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+          (mapcar #'car (LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+        '("figure" "table"))))
 
     '("DeclareCaptionSubType*"
       [TeX-arg-eval completing-read
                     (TeX-argument-prompt t nil "Numbering scheme")
                     '("arabic" "roman" "Roman" "alph" "Alph" "fnsymbol")]
-      (TeX-arg-eval completing-read
-                    (TeX-argument-prompt nil nil "Type")
-                    '("figure" "table"))))
+      (TeX-arg-eval
+       completing-read
+       (TeX-argument-prompt nil nil "Type")
+       (append
+        (when (and (fboundp 'LaTeX-newfloat-DeclareFloatingEnvironment-list)
+                   (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+          (mapcar #'car (LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+        '("figure" "table")))))
 
    ;; \subcaption(box)? and \subfloat macros should get their own lines
    (LaTeX-paragraph-commands-add-locally

Reply via email to