branch: externals/auctex commit ac8d4795781144d9ebc3ec0629efb77bc4d9b9d6 Author: Arash Esbati <esb...@gmx.de> Commit: Mosè Giordano <m...@gnu.org>
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 <m...@gnu.org> --- 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 <esb...@gmx.de> + + * 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 <m...@gnu.org> * 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: auctex-de...@gnu.org @@ -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")