>From 90bbbfb68f219c0a47314eec6d11c066c2cd22a1 Mon Sep 17 00:00:00 2001 From: Arash Esbati Date: Thu, 8 Oct 2015 21:53:17 +0200 Subject: [PATCH 1/4] Support newfloat.el. * style/wrapfig.el ("wrapfig"): Check for new floating environments definded through "newfloat.el" and offer them as completion to "wrapfloat" environment. --- 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 + + * 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 * 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 ;; Maintainer: address@hidden @@ -78,11 +78,22 @@ (format "{%s}" width)))))) ;; ;; \begin{wrapfloat}{}[No.lines]{Placement}[Overhang]{Width} ... \end{wrapfloat} + ;; + ;; 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") -- 2.6.0