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

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

[elpa] externals/auctex 6a31d4e 14/36: Support new floats defined with n


From: Tassilo Horn
Subject: [elpa] externals/auctex 6a31d4e 14/36: Support new floats defined with newfloat package
Date: Thu, 22 Dec 2016 13:08:11 +0000 (UTC)

branch: externals/auctex
commit 6a31d4e79ecc6f8921a60f268751efae9f9da4f4
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>

    Support new floats defined with newfloat package
    
    * style/caption.el (LaTeX-caption-update-key-val-options): Append
    new floating environments defined with "newfloat.sty" as values to
    "type*?" keys in `LaTeX-caption-key-val-options-local'.
---
 style/caption.el |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/style/caption.el b/style/caption.el
index a9fdec4..d8699fa 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -176,12 +176,25 @@ in `caption'-completions."
              (when (and (string-equal key "labelformat")
                         (boundp 'LaTeX-subcaption-key-val-options))
                (pushnew (list "subrefformat"
-                              (delete-dups (apply 'append (list val) 
val-match)))
+                              (delete-dups (apply #'append (list val) 
val-match)))
                         opts :test #'equal))
-             (pushnew (list key (delete-dups (apply 'append (list val) 
val-match)))
+             (pushnew (list key (delete-dups (apply #'append (list val) 
val-match)))
                       opts :test #'equal))
          (pushnew (list key (list val)) opts :test #'equal)))
-      (setq LaTeX-caption-key-val-options-local (copy-alist opts)))))
+      (setq LaTeX-caption-key-val-options-local (copy-alist opts))))
+  ;; Support for environments defined with newfloat.sty: These
+  ;; environments are added to "type" and "type*" key:
+  (when (and (member "newfloat" (TeX-style-list))
+            (fboundp 'LaTeX-newfloat-DeclareFloatingEnvironment-list)
+            (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+    (dolist (key '("type" "type*"))
+      (let* ((val (mapcar #'car 
(LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+            (val-match (cdr (assoc key LaTeX-caption-key-val-options-local)))
+            (temp (copy-alist LaTeX-caption-key-val-options-local))
+            (opts (assq-delete-all (car (assoc key temp)) temp)))
+       (pushnew (list key (delete-dups (apply #'append val val-match)))
+                opts :test #'equal)
+       (setq LaTeX-caption-key-val-options-local (copy-alist opts))))))
 
 (defun LaTeX-arg-caption-command (optional &optional prompt)
   "Insert caption-commands from `caption.sty'. If OPTIONAL,



reply via email to

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