auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 482dddb6eb1441c5ed500


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 482dddb6eb1441c5ed500b97065bf72e46624e6d
Date: Sun, 19 Jul 2015 15:50:25 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  482dddb6eb1441c5ed500b97065bf72e46624e6d (commit)
       via  107f106697148ca18e5a25a0ed0fbf9bb930fdb2 (commit)
       via  e301b716c93418f8de5f03bb3d5d3d6b121f5085 (commit)
       via  d27e77316a03c8f1fab9ad403ad349724c2d7b6c (commit)
       via  24a2a9d1d91751a86c5227d8cf54a6757f554276 (commit)
       via  1202f8321edbaecbfcd03dde22804c87ce95ce8a (commit)
       via  c2c7dd9bfdaecaef29496504a317fa40ca56c9dd (commit)
      from  609470047cfbfffa91e81cd8a3c38f57b9d80ff9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 482dddb6eb1441c5ed500b97065bf72e46624e6d
Author: Arash Esbati <address@hidden>
Date:   Sun Jul 19 14:30:53 2015 +0200

    Query for default first arg when (re-)defining env's.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 32bd62d..1825cd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-07-18  Arash Esbati  <address@hidden>
 
+       * latex.el (LaTeX-common-initialization): Query for the default
+       value of first arg when (re-)defining new environments.
+
        * Makefile.in (STYLESRC): Add new style.
 
        * style/vwcol.el: New file.
diff --git a/latex.el b/latex.el
index 22aab5e..0fb1641 100644
--- a/latex.el
+++ b/latex.el
@@ -6227,6 +6227,10 @@ i.e. you do _not_ have to cater for this yourself by 
adding \\\\' or $."
        [ "Number of arguments" ] [ "Default value for first argument" ] t)
      '("renewcommand*" TeX-arg-macro
        [ "Number of arguments" ] [ "Default value for first argument" ] t)
+     '("newenvironment" TeX-arg-define-environment
+       [ "Number of arguments" ] [ "Default value for first argument" ] t t)
+     '("renewenvironment" TeX-arg-environment
+       [ "Number of arguments" ] [ "Default value for first argument" ] t t)
      '("usepackage" LaTeX-arg-usepackage)
      '("RequirePackage" LaTeX-arg-usepackage)
      '("ProvidesPackage" (TeX-arg-file-name-sans-extension "Package name")

commit 107f106697148ca18e5a25a0ed0fbf9bb930fdb2
Author: Arash Esbati <address@hidden>
Date:   Sat Jul 18 09:50:34 2015 +0200

    Add new style vwcol.el.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 9832d21..32bd62d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 
        * Makefile.in (STYLESRC): Add new style.
 
+       * style/vwcol.el: New file.
+
+       * Makefile.in (STYLESRC): Add new style.
+
        * style/textpos.el: New file.
 
        * Makefile.in (STYLESRC): Add new style.
diff --git a/Makefile.in b/Makefile.in
index 03ff367..853c2b3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -149,7 +149,8 @@ STYLESRC = style/prosper.el \
           style/geometry.el  style/ltablex.el   style/ltxtable.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/mnras.el     style/environ.el   style/textpos.el \
+          style/vwcol.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/vwcol.el b/style/vwcol.el
new file mode 100644
index 0000000..0a74edf
--- /dev/null
+++ b/style/vwcol.el
@@ -0,0 +1,71 @@
+;;; vwcol.el --- AUCTeX style for `vwcol.sty' (v0.2)
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-07-04
+;; 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 `vwcol.sty' (v0.2) from 2015/02/10.
+;; `vwcol.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-vwcol-key-val-options
+  '(("widths")
+    ("sep"       ("fill"))
+    ("presep"    ("true" "false"))
+    ("postsep"   ("true" "false"))
+    ("sidesep"   ("true" "false"))
+    ("rule"      ("none" "0pt"))
+    ("prerule"   ("true" "false"))
+    ("postrule"  ("true" "false"))
+    ("siderule"  ("true" "false"))
+    ("justify"   ("ragged" "flush" "raggedleft" "center"))
+    ("rulecolor")
+    ("indent")
+    ("lines"))
+  "Key=value options for vwcol macros and environments.")
+
+(TeX-add-style-hook
+ "vwcol"
+ (lambda ()
+
+   (LaTeX-add-environments
+    '("vwcol" LaTeX-env-args
+      [ TeX-arg-key-val LaTeX-vwcol-key-val-options ]))
+
+   (TeX-add-symbols
+    '("vwcolsetup" (TeX-arg-key-val LaTeX-vwcol-key-val-options)))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("vwcolsetup" "{"))
+                             'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-vwcol-package-options '("quiet")
+  "Package options for the vwcol package.")
+
+;;; vwcol.el ends here

commit e301b716c93418f8de5f03bb3d5d3d6b121f5085
Author: Arash Esbati <address@hidden>
Date:   Sat Jul 18 09:44:16 2015 +0200

    Add new style textpos.el.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 13d1120..9832d21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 
        * Makefile.in (STYLESRC): Add new style.
 
+       * style/textpos.el: New file.
+
+       * Makefile.in (STYLESRC): Add new style.
+
        * style/environ.el: New file.
 
        * style/tabulary.el ("tabulary"): Add `LCRJ' to
diff --git a/Makefile.in b/Makefile.in
index 0552e52..03ff367 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -149,7 +149,7 @@ STYLESRC = style/prosper.el \
           style/geometry.el  style/ltablex.el   style/ltxtable.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/mnras.el     style/environ.el   style/textpos.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/textpos.el b/style/textpos.el
new file mode 100644
index 0000000..6732361
--- /dev/null
+++ b/style/textpos.el
@@ -0,0 +1,111 @@
+;;; textpos.el --- AUCTeX style for `textpos.sty' version v1.7j
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-07-04
+;; 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 `textpos.sty' version v1.7j from
+;; 2014/01/03.  `textpos.sty' is part of TeXLive.
+
+;;; Code:
+
+(defun LaTeX-env-arg-textpos (env)
+  "Query for the arguments of `textpos' environment and insert
+them."
+  (let* ((hsize (TeX-read-string "Width: "))
+        (ho    (TeX-read-string "(Optional) X reference point: "))
+        (vo    (when (not (string-equal ho ""))
+                 (TeX-read-string "Y reference point: ")))
+        (hpos  (TeX-read-string "X placement point: "))
+        (vpos  (TeX-read-string "Y placement point: ")))
+    (LaTeX-insert-environment
+     env
+     (concat
+      (when (and hsize (not (string-equal hsize "")))
+       (format "{%s}" hsize))
+      (when (and ho (not (string-equal ho ""))
+                vo (not (string-equal vo "")))
+       (format "[%s,%s]" ho vo))
+      (when (and hpos (not (string-equal hpos ""))
+                vpos (not (string-equal vpos "")))
+       (format "(%s,%s)" hpos vpos))))))
+
+(defun LaTeX-arg-textpos-tpgrid (optional)
+  "Query and insert the optional argument of `\\TPGrid'."
+  (let* ((x (TeX-read-string "(Optional) X start coordinate: "))
+        (y (when (not (string-equal x ""))
+             (TeX-read-string "Y start coordinate: "))))
+    (when (and (not (string-equal x ""))
+              (not (string-equal y "")))
+      (TeX-argument-insert (format "%s,%s" x y) optional))))
+
+(TeX-add-style-hook
+ "textpos"
+ (lambda ()
+
+   (TeX-run-style-hooks "everyshi" "color")
+
+   (LaTeX-add-environments
+    ;; \begin{textpos}{<hsize>}[<ho>,<vo>](<hpos>,<vpos>) ... \end{textpos}
+    '("textpos"  LaTeX-env-arg-textpos)
+    '("textpos*" LaTeX-env-arg-textpos))
+
+   (TeX-add-symbols
+    '("TPGrid" [ LaTeX-arg-textpos-tpgrid ]
+              "Horizontal fraction" "Vertical fraction")
+
+    '("TPMargin"  (TeX-arg-length "Margin around textblock"))
+    '("TPMargin*" (TeX-arg-length "Margin around textblock"))
+
+    ;; We ignore the `\textblock...color' (i.e. without `u') versions
+    '("textblockcolour"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((color (completing-read "Color name: "
+                                      (LaTeX-color-definecolor-list))))
+          (format "%s" color)))))
+
+    '("textblockrulecolour"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((color (completing-read "Color name: "
+                                      (LaTeX-color-definecolor-list))))
+          (format "%s" color)))))
+
+   '("TPshowboxestrue")
+   '("TPshowboxesfalse")
+
+   '("textblocklabel" t)
+   '("textblockorigin" "Horizontal position" "Vertical position"))
+
+   ;; Add the lengths defined by textpos.sty
+   (LaTeX-add-lengths "TPHorizModule" "TPVertModule" "TPboxrulesize"))
+ LaTeX-dialect)
+
+(defvar LaTeX-textpos-package-options
+  '("showboxes" "noshowtext" "absolute" "overlay" "verbose" "quiet")
+  "Package options for the textpos package.")
+
+;;; textpos.el ends here

commit d27e77316a03c8f1fab9ad403ad349724c2d7b6c
Author: Arash Esbati <address@hidden>
Date:   Sat Jul 18 09:42:00 2015 +0200

    Add new style environ.el.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 6eca23d..13d1120 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-07-18  Arash Esbati  <address@hidden>
 
+       * Makefile.in (STYLESRC): Add new style.
+
+       * style/environ.el: New file.
+
        * style/tabulary.el ("tabulary"): Add `LCRJ' to
        `LaTeX-array-column-letters'.
 
diff --git a/Makefile.in b/Makefile.in
index 290462c..0552e52 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -149,7 +149,7 @@ STYLESRC = style/prosper.el \
           style/geometry.el  style/ltablex.el   style/ltxtable.el \
           style/mn2e.el      style/colortbl.el  style/attachfile.el \
           style/newpxtext.el style/newpxmath.el style/pdfpages.el \
-          style/mnras.el
+          style/mnras.el     style/environ.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/environ.el b/style/environ.el
new file mode 100644
index 0000000..bac82fc
--- /dev/null
+++ b/style/environ.el
@@ -0,0 +1,127 @@
+;;; environ.el --- AUCTeX style for `environ.sty' version v0.3
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-07-04
+;; 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 `environ.sty' version v0.3 from
+;; 2014/05/04.  `environ.sty' is part of TeXLive.
+
+;; Name of new env's defined with `\NewEnviron' are automatically
+;; added to list of known env's, e.g.:
+;;
+;;     \NewEnviron{test}{<macro code>}
+;;
+;; `test' will be in completion list upon `C-c C-e'.
+
+;; More sophisticated definions must go through AUCTeX's parser, e.g.:
+;;
+;;     \NewEnviron{test}[2][]{<macro code>}
+;;
+;; After a definition like this, you have to invoke `C-c C-n' to get
+;; the correct completion.
+
+;;; Code:
+
+(defvar LaTeX-auto-environ-NewEnviron nil
+  "Temporary for parsing the arguments of `\\NewEnviron'
+from `environ' package.")
+
+(defvar LaTeX-environ-NewEnviron-regexp
+  `(,(concat "\\\\\\(?:Ren\\|N\\)ewEnviron"
+            "[ \t\n\r]*{\\([A-Za-z0-9]+\\)}%?"
+            "[ \t\n\r]*\\[?\\([0-9]?\\)\\]?%?"
+            "[ \t\n\r]*\\(\\[\\)?")
+    (1 2 3) LaTeX-auto-environ-NewEnviron)
+  "Matches the argument of `\\NewEnviron' and `\\RenewEnviron'
+from `environ.sty'.")
+
+(defun LaTeX-environ-auto-prepare ()
+  "Clear temporary variable from `environ.sty' before parsing."
+  (setq LaTeX-auto-environ-NewEnviron nil))
+
+(defun LaTeX-environ-auto-cleanup ()
+  "Process the parsed results of `\\NewEnviron'."
+  (dolist (env-args LaTeX-auto-environ-NewEnviron)
+    (let ((env  (car   env-args))
+         (args (cadr  env-args))
+         (opt  (nth 2 env-args)))
+      (cond (;; opt. 1st argument and mandatory argument(s)
+            (and args (not (string-equal args ""))
+                 opt  (not (string-equal opt  "")))
+            (add-to-list 'LaTeX-auto-environment
+                         (list env 'LaTeX-env-args (vector "argument")
+                               (1- (string-to-number args)))))
+           (;; mandatory argument(s) only
+            (and args (not (string-equal args ""))
+                 (string-equal opt ""))
+            (add-to-list 'LaTeX-auto-environment
+                         (list env (string-to-number args))))
+           (t ; No args
+            (add-to-list 'LaTeX-auto-environment (list env)))))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-environ-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-environ-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun TeX-arg-environ-final-code (_optional)
+  "Query for the presence of optional `final code' as argument to
+`\\NewEnviron' and insert the appropriate brackets."
+  (let ((fincode (y-or-n-p "With optional final code?")))
+    (when fincode
+       (insert "[]"))))
+
+(TeX-add-style-hook
+ "environ"
+ (lambda ()
+
+   ;; Add it to the parser
+   (TeX-auto-add-regexp LaTeX-environ-NewEnviron-regexp)
+
+   (TeX-add-symbols
+
+    ;; \NewEnviron{<name>}[<No.args>][<Opt.arg.>]{<Macro code>}[<Final code>]
+    '("NewEnviron"
+      (TeX-arg-define-environment "Environment")
+      [ "Number of arguments" ] [ "argument" ] t TeX-arg-environ-final-code)
+
+    '("RenewEnviron"
+      (TeX-arg-environment "Environment")
+      [ "Number of arguments" ] [ "argument" ] t TeX-arg-environ-final-code)
+
+    ;; Insert a pair of braces and we're done
+    '("environfinalcode" t)
+
+    ;; Pre-defined
+    '("BODY")
+
+    ;; Define another macro instead of \BODY
+    '("environbodyname" TeX-arg-define-macro)))
+  LaTeX-dialect)
+
+(defvar LaTeX-environ-package-options nil
+  "Package options for the environ package.")
+
+;;; environ.el ends here

commit 24a2a9d1d91751a86c5227d8cf54a6757f554276
Author: Arash Esbati <address@hidden>
Date:   Sat Jul 18 09:38:23 2015 +0200

    Add `LCRJ' to `LaTeX-array-column-letters'.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 94fcf10..6eca23d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-07-18  Arash Esbati  <address@hidden>
 
+       * style/tabulary.el ("tabulary"): Add `LCRJ' to
+       `LaTeX-array-column-letters'.
+
        * style/tabularx.el ("tabularx"): Add `X' to
        `LaTeX-array-column-letters'.
 
diff --git a/style/tabulary.el b/style/tabulary.el
index c17b96e..30e3a64 100644
--- a/style/tabulary.el
+++ b/style/tabulary.el
@@ -52,7 +52,11 @@
     '("tabulary" LaTeX-env-tabular*))
 
    ;; `tabulary' requires the array package
-   (TeX-run-style-hooks "array"))
+   (TeX-run-style-hooks "array")
+
+   ;; `tabulary.sty' adds some new column specification letters.
+   (set (make-local-variable 'LaTeX-array-column-letters)
+       (concat LaTeX-array-column-letters "L" "C" "R" "J")))
  LaTeX-dialect)
 
 ;;; tabulary.el ends here

commit 1202f8321edbaecbfcd03dde22804c87ce95ce8a
Author: Arash Esbati <address@hidden>
Date:   Sat Jul 18 09:30:15 2015 +0200

    Add `X' to `LaTeX-array-column-letters'.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 148c741..94fcf10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-07-18  Arash Esbati  <address@hidden>
 
+       * style/tabularx.el ("tabularx"): Add `X' to
+       `LaTeX-array-column-letters'.
+
        * style/array.el: Parse user-defined new column types and add them
        to `LaTeX-array-column-letters'.
 
diff --git a/style/tabularx.el b/style/tabularx.el
index a0f3ee3..5cfebc8 100644
--- a/style/tabularx.el
+++ b/style/tabularx.el
@@ -1,6 +1,6 @@
 ;;; tabularx.el --- AUCTeX style for the tabularx package.
 
-;; Copyright (C) 2009, 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2013, 2015 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <address@hidden>
 ;; Maintainer: address@hidden
@@ -55,7 +55,11 @@
     '("tabularx" LaTeX-env-tabular*))
    
    ;; `tabularx' requires array to define the column types
-   (TeX-run-style-hooks "array"))
+   (TeX-run-style-hooks "array")
+
+   ;; `tabularx.sty' adds one new column specification letter.
+   (set (make-local-variable 'LaTeX-array-column-letters)
+       (concat LaTeX-array-column-letters "X")))
  LaTeX-dialect)
 
 ;;; tabularx.el ends here

commit c2c7dd9bfdaecaef29496504a317fa40ca56c9dd
Author: Arash Esbati <address@hidden>
Date:   Sat Jul 18 09:25:42 2015 +0200

    Parse user-defined new column types.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 2813370..148c741 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-18  Arash Esbati  <address@hidden>
+
+       * style/array.el: Parse user-defined new column types and add them
+       to `LaTeX-array-column-letters'.
+
 2015-07-09  Mosè Giordano  <address@hidden>
 
        * latex/README: restore file deleted by mistake when preview/
diff --git a/style/array.el b/style/array.el
index 51a27e8..058eb92 100644
--- a/style/array.el
+++ b/style/array.el
@@ -1,6 +1,6 @@
 ;;; array.el --- AUCTeX style for `array.sty'
 
-;; Copyright (C) 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2013, 2015 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <address@hidden>
 ;; Maintainer: address@hidden
@@ -29,11 +29,57 @@
 
 ;;; Code:
 
+(require 'tex)
+
+(TeX-auto-add-type "array-newcolumntype" "LaTeX")
+
+(defvar LaTeX-array-newcolumntype-regexp
+  '("\\\\newcolumntype{\\([a-zA-Z]+\\)}"
+    1 LaTeX-auto-array-newcolumntype)
+  "Matches the argument of `\\newcolumntype' from `array'
+package.")
+
+(defun LaTeX-array-auto-prepare ()
+  "Clear `LaTeX-auto-array-newcolumntype' before parsing."
+  (setq        LaTeX-auto-array-newcolumntype nil))
+
+(defun LaTeX-array-auto-cleanup ()
+  "Move parsed column specification from
+`LaTeX-auto-array-newcolumntype' to `LaTeX-array-column-letters'."
+  (when (LaTeX-array-newcolumntype-list)
+    (LaTeX-array-update-column-letters)))
+
+(defun LaTeX-array-update-column-letters ()
+  "Update and uniquify the value of `LaTeX-array-column-letters'
+and make it buffer local. "
+  (set (make-local-variable 'LaTeX-array-column-letters)
+       (mapconcat 'identity
+                 (TeX-delete-duplicate-strings
+                  (split-string
+                   (concat LaTeX-array-column-letters
+                           (mapconcat 'car (LaTeX-array-newcolumntype-list) 
""))
+                   "" t))
+                 "")))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-array-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-array-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
 (TeX-add-style-hook
  "array"
  (lambda ()
+
+   (TeX-auto-add-regexp LaTeX-array-newcolumntype-regexp)
+
    (TeX-add-symbols
-    '("newcolumntype" "Column type" [ "Number of arguments" ] t)
+    '("newcolumntype"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((col (TeX-read-string "Column type: ")))
+          (LaTeX-add-array-newcolumntypes col)
+          (LaTeX-array-update-column-letters)
+          (format "%s" col))))
+      [ "Number of arguments" ] t)
     '("showcols" 0)
     '("firsthline" 0)
     '("lasthline" 0))
@@ -43,7 +89,8 @@
    (LaTeX-add-lengths "extratabsurround" "extrarowheight")
 
    ;; `array.sty' adds some new column specification letters.
-   (set (make-local-variable 'LaTeX-array-column-letters) "clrpmb"))
+   (set (make-local-variable 'LaTeX-array-column-letters)
+       (concat LaTeX-array-column-letters "m" "b")))
  LaTeX-dialect)
 
 (defvar LaTeX-array-package-options nil

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |   26 +++++++++++
 Makefile.in       |    3 +-
 latex.el          |    4 ++
 style/array.el    |   53 +++++++++++++++++++++-
 style/environ.el  |  127 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 style/tabularx.el |    8 +++-
 style/tabulary.el |    6 ++-
 style/textpos.el  |  111 ++++++++++++++++++++++++++++++++++++++++++++++
 style/vwcol.el    |   71 +++++++++++++++++++++++++++++
 9 files changed, 402 insertions(+), 7 deletions(-)
 create mode 100644 style/environ.el
 create mode 100644 style/textpos.el
 create mode 100644 style/vwcol.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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