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

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

[elpa] externals/auctex ac8d479 69/78: Support newfloat.el.


From: Tassilo Horn
Subject: [elpa] externals/auctex ac8d479 69/78: Support newfloat.el.
Date: Mon, 19 Oct 2015 09:11:15 +0000

branch: externals/auctex
commit ac8d4795781144d9ebc3ec0629efb77bc4d9b9d6
Author: Arash Esbati <address@hidden>
Commit: Mosè Giordano <address@hidden>

    Support newfloat.el.
    
    * style/wrapfig.el ("wrapfig"): Check for new floating
    environments definded through "newfloat.el" and offer them as
    completion to "wrapfloat" environment.
    
    Signed-off-by: Mosè Giordano <address@hidden>
---
 ChangeLog        |    6 ++++++
 style/wrapfig.el |   15 +++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b287587..62199eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-08  Arash Esbati  <address@hidden>
+
+       * style/wrapfig.el ("wrapfig"): Check for new floating
+       environments definded through "newfloat.el" and offer them as
+       completion to "wrapfloat" environment.
+
 2015-10-05  Mos� Giordano  <address@hidden>
 
        * context.el (TeX-ConTeXt-sentinel): Parse ConTeXt Mark IV output.
diff --git a/style/wrapfig.el b/style/wrapfig.el
index 097e5ad..64bb265 100644
--- a/style/wrapfig.el
+++ b/style/wrapfig.el
@@ -1,6 +1,6 @@
 ;;; wrapfig.el --- AUCTeX style for `wrapfig.sty' version v3.6
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <esbati'at'gmx.de>
 ;; Maintainer: address@hidden
@@ -78,11 +78,22 @@
            (format "{%s}" width))))))
     ;;
     ;; \begin{wrapfloat}{<Type>}[No.lines]{Placement}[Overhang]{Width} ... 
\end{wrapfloat}
+    ;;
+    ;; <Type> can be a new floating environment defined with
+    ;; "\DeclareFloatingEnvironment" from newfloat.el.  We check if
+    ;; the function `LaTeX-newfloat-DeclareFloatingEnvironment-list'
+    ;; is bound and returns non-nil before offering environment for
+    ;; completion.  Otherwise, just ask user without completion.
     '("wrapfloat"
       (lambda (env &rest ignore)
        (LaTeX-insert-environment
         env
-        (let ((floattype (TeX-read-string "Float type: "))
+        (let ((floattype (if (and (fboundp 
'LaTeX-newfloat-DeclareFloatingEnvironment-list)
+                                  
(LaTeX-newfloat-DeclareFloatingEnvironment-list))
+                             (completing-read
+                              "Float type: "
+                              (mapcar 'car 
(LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+                           (TeX-read-string "Float type: ")))
               (narrow    (TeX-read-string "(Optional) Number of narrow lines: 
"))
               (placement (completing-read
                           "Placement: " '(("r") ("R")



reply via email to

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