Hi all,

please find attached five patches, from ChangeLog:

* Makefile.in (STYLESRC): Add new style.

* style/transparent.el: New file.

* style/filecontents.el ("filecontents"): Do not indent the
content of the `filecontents[*]'-env.

* style/hyperref.el ("hyperref"): Do not indent the content of the
`Form'-env.

* style/caption.el ("caption"): Add support for undocumented
macros `\captionbox[*]'.
(LaTeX-arg-caption-captionbox): New function.

* style/array.el ("array"): Add fontification for
`\newcolumntype'.

As always, any comments welcome.

Best, Arash

>From e575352a9842e8b257bf79d881bdd74d9a6db01d Mon Sep 17 00:00:00 2001
From: Arash Esbati <esb...@gmx.de>
Date: Sat, 22 Aug 2015 10:30:13 +0200
Subject: [PATCH 1/5] Add fontification for `\newcolumntype'.

* style/array.el ("array"): Add fontification for
`\newcolumntype'.
---
 ChangeLog      | 5 +++++
 style/array.el | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 7201d85..c60975e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-22  Arash Esbati  <esb...@gmx.de>
+
+	* style/array.el ("array"): Add fontification for
+	`\newcolumntype'.
+
 2015-08-21  Mosè Giordano  <m...@gnu.org>
 
 	* tex-buf.el (TeX-check-engine): New customizable variable.
diff --git a/style/array.el b/style/array.el
index 058eb92..645371d 100644
--- a/style/array.el
+++ b/style/array.el
@@ -90,7 +90,13 @@ and make it buffer local. "
 
    ;; `array.sty' adds some new column specification letters.
    (set (make-local-variable 'LaTeX-array-column-letters)
-	(concat LaTeX-array-column-letters "m" "b")))
+	(concat LaTeX-array-column-letters "m" "b"))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+	      (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("newcolumntype" "{[{"))
+			      'function)))
  LaTeX-dialect)
 
 (defvar LaTeX-array-package-options nil
-- 
2.5.0

>From 05c1daf6d4f347ad5f22e752c994a80540bff803 Mon Sep 17 00:00:00 2001
From: Arash Esbati <esb...@gmx.de>
Date: Sat, 22 Aug 2015 11:29:27 +0200
Subject: [PATCH 2/5] Add support for \captionbox[*].

* style/caption.el ("caption"): Add support for undocumented
macros `\captionbox[*]'.
(LaTeX-arg-caption-captionbox): New function.
---
 ChangeLog        |  4 ++++
 style/caption.el | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index c60975e..4a4812e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-08-22  Arash Esbati  <esb...@gmx.de>
 
+	* style/caption.el ("caption"): Add support for undocumented
+	macros `\captionbox[*]'.
+	(LaTeX-arg-caption-captionbox): New function.
+
 	* style/array.el ("array"): Add fontification for
 	`\newcolumntype'.
 
diff --git a/style/caption.el b/style/caption.el
index 0ec6c29..3ceb2c6 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -190,6 +190,59 @@ suffix of the command."
 	   format name))
     (TeX-argument-insert name optional)))
 
+;; Support for an undocumented feature of caption.sty:
+;; `\captionbox' sets the width of the caption equal to the width of
+;; the contents (a feature provided e.g. by `threeparttable.sty').
+;; The starred version typesets the caption without label and without
+;; entry to the list of figures or tables.
+
+;; The first mandatory argument {<heading>} contains the caption text
+;; and the label.  For now, we check if `LaTeX-label-function' is eq
+;; to `reftex-label' and run it, otherwise run
+;; `TeX-read-label'. (Thanks to M. Giordano for implementing this
+;; function!)
+
+;; Syntax:
+;; \captionbox[<list entry>]{<heading>}[<width>][<inner-pos>]{<contents>}
+;; \captionbox*{<heading>}[<width>][<inner-pos>]{<contents>}
+
+(defun LaTeX-arg-caption-captionbox (optional &optional star prompt)
+  "Query for the arguments of `\\captionbox' incl. a label and
+insert them.  If the STAR is t, then do not query for a `\\label'
+and insert only a caption."
+  (let* ((caption (TeX-read-string (TeX-argument-prompt optional prompt "Caption")))
+	 (label (unless star (if (and (boundp 'LaTeX-label-function)
+				      LaTeX-label-function
+				      (fboundp LaTeX-label-function)
+				      (eq LaTeX-label-function 'reftex-label))
+				 (funcall LaTeX-label-function nil t)
+			       (TeX-read-label optional "Label" t))))
+	 (width   (completing-read (TeX-argument-prompt t prompt "Width")
+				   (mapcar (lambda(elt) (concat TeX-esc (car elt)))
+					   (LaTeX-length-list))))
+	 (inpos   (completing-read (TeX-argument-prompt t prompt "Inner position")
+				   '("c" "l" "r" "s")))
+	 (heading (if star
+		      (format "%s" caption)
+		    (format "%s\\label{%s}" caption label))))
+    (LaTeX-indent-line)
+    (TeX-argument-insert heading optional)
+    (cond (;; 2 optional args
+	   (and width (not (string-equal width ""))
+		inpos (not (string-equal inpos "")))
+	   (insert (format "[%s][%s]" width inpos)))
+	  (;; 1st empty opt. arg, 2nd opt. arg
+	   (and (string-equal width "")
+		inpos (not (string-equal inpos "")))
+	   (insert (format "[][%s]" inpos)))
+	  (;; 1st opt. arg, 2nd empty opt. arg
+	   (and width (not (string-equal width ""))
+		(string-equal inpos ""))
+	   (insert (format "[%s]" width)))
+	  (t ; Do nothing if both empty
+	   (ignore)))
+    (LaTeX-fill-paragraph)))
+
 (TeX-add-style-hook
  "caption"
  (lambda ()
@@ -240,6 +293,10 @@ suffix of the command."
       (TeX-arg-eval completing-read (TeX-argument-prompt nil nil "Float type")
 		    LaTeX-caption-supported-float-types))
 
+    '("captionbox"  ["List entry"] (LaTeX-arg-caption-captionbox) t)
+
+    '("captionbox*" (LaTeX-arg-caption-captionbox t) t)
+
     '("ContinuedFloat" 0)
 
     '("DeclareCaptionFont"
@@ -286,7 +343,8 @@ suffix of the command."
 	      (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("caption"           "*[{")
 				("captionlistentry"  "[{")
-				("captionof"         "*[{"))
+				("captionof"         "*[{")
+				("captionbox"        "*[{[[{"))
 			      'textual)
      (font-latex-add-keywords '(("captionsetup"                  "*[{")
 				("clearcaptionsetup"             "*[{")
-- 
2.5.0

>From 7c18282948c86327daae8f3815f2f7585c775eaa Mon Sep 17 00:00:00 2001
From: Arash Esbati <esb...@gmx.de>
Date: Sat, 22 Aug 2015 11:38:59 +0200
Subject: [PATCH 3/5] Do not indent the content of the `Form'-env.

* style/hyperref.el ("hyperref"): Do not indent the content of the
`Form'-env.
---
 ChangeLog         | 3 +++
 style/hyperref.el | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 4a4812e..80978cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-08-22  Arash Esbati  <esb...@gmx.de>
 
+	* style/hyperref.el ("hyperref"): Do not indent the content of the
+	`Form'-env.
+
 	* style/caption.el ("caption"): Add support for undocumented
 	macros `\captionbox[*]'.
 	(LaTeX-arg-caption-captionbox): New function.
diff --git a/style/hyperref.el b/style/hyperref.el
index a1eee7c..45d70a1 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -1,6 +1,6 @@
 ;;; hyperref.el --- AUCTeX style for `hyperref.sty' v6.83m
 
-;; Copyright (C) 2008, 2013, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2013--2015 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <ang...@caeruleus.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -266,6 +266,10 @@
    (LaTeX-add-environments
     '("Form"))
 
+   ;; Do not indent the content of the "Form"-env; it is odd if the
+   ;; whole document is indented.
+   (add-to-list 'LaTeX-indent-environment-list '("Form" current-indentation))
+
    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl")
    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl")
    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage")
-- 
2.5.0

>From 7dc1dde9a22d7c9b73a2cf71b08a25040acd7c4a Mon Sep 17 00:00:00 2001
From: Arash Esbati <esb...@gmx.de>
Date: Sat, 22 Aug 2015 11:50:39 +0200
Subject: [PATCH 4/5] Do not indent the content of the `filecontents[*]'-env.

* style/filecontents.el ("filecontents"): Do not indent the
content of the `filecontents[*]'-env.
---
 ChangeLog             | 3 +++
 style/filecontents.el | 9 +++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 80978cf..8ca8af7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-08-22  Arash Esbati  <esb...@gmx.de>
 
+	* style/filecontents.el ("filecontents"): Do not indent the
+	content of the `filecontents[*]'-env.
+
 	* style/hyperref.el ("hyperref"): Do not indent the content of the
 	`Form'-env.
 
diff --git a/style/filecontents.el b/style/filecontents.el
index 493b6c7..20cfa98 100644
--- a/style/filecontents.el
+++ b/style/filecontents.el
@@ -1,6 +1,6 @@
 ;;; filecontents.el --- AUCTeX style for `filecontents.sty'
 
-;; Copyright (C) 2013, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013--2015 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <m...@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -38,7 +38,12 @@
  (lambda ()
    (LaTeX-add-environments
     '("filecontents" LaTeX-env-filecontents)
-    '("filecontents*" LaTeX-env-filecontents)))
+    '("filecontents*" LaTeX-env-filecontents))
+
+   (add-to-list 'LaTeX-indent-environment-list
+		'("filecontents" current-indentation))
+   (add-to-list 'LaTeX-indent-environment-list
+		'("filecontents*" current-indentation)))
  LaTeX-dialect)
 
 (defun LaTeX-env-filecontents (environment)
-- 
2.5.0

>From f43c97bea3092204d0a3ea3e4f775606877dd59d Mon Sep 17 00:00:00 2001
From: Arash Esbati <esb...@gmx.de>
Date: Sat, 22 Aug 2015 12:06:33 +0200
Subject: [PATCH 5/5] Add new style transparent.el.

* Makefile.in (STYLESRC): Add new style.

* style/transparent.el: New file.
---
 ChangeLog            |  4 ++++
 Makefile.in          |  2 +-
 style/transparent.el | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 style/transparent.el

diff --git a/ChangeLog b/ChangeLog
index 8ca8af7..5f70a33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-08-22  Arash Esbati  <esb...@gmx.de>
 
+	* Makefile.in (STYLESRC): Add new style.
+
+	* style/transparent.el: New file.
+
 	* style/filecontents.el ("filecontents"): Do not indent the
 	content of the `filecontents[*]'-env.
 
diff --git a/Makefile.in b/Makefile.in
index 853c2b3..9a3b859 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -150,7 +150,7 @@ STYLESRC = style/prosper.el \
 	   style/mn2e.el      style/colortbl.el  style/attachfile.el \
 	   style/newpxtext.el style/newpxmath.el style/pdfpages.el \
 	   style/mnras.el     style/environ.el   style/textpos.el \
-	   style/vwcol.el
+	   style/vwcol.el     style/transparent.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/transparent.el b/style/transparent.el
new file mode 100644
index 0000000..3a7fad5
--- /dev/null
+++ b/style/transparent.el
@@ -0,0 +1,53 @@
+;;; transparent.el --- AUCTeX style for `transparent.sty' (v1.0)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2015-08-15
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `transparent.sty' (v1.0) from 2007/01/08.
+;; `transparent.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "transparent"
+ (lambda ()
+   (TeX-add-symbols
+    '("transparent"     "Transparency value (between 0,1)")
+    '("texttransparent" "Transparency value (between 0,1)" t))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+	      (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("transparent"     "{"))
+			      'type-declaration)
+     (font-latex-add-keywords '(("texttransparent" "{{"))
+			      'type-command)))
+ LaTeX-dialect)
+
+(defvar LaTeX-transparent-package-options nil
+  "Package options for the transparent package.")
+
+;;; transparent.el ends here
-- 
2.5.0

_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to