monnier pushed a commit to branch externals/auctex
in repository elpa.
commit fffbd5f197b1e6ee54a25697312671556af5936f
Author: Tassilo Horn <[email protected]>
Date: Tue Jul 9 08:40:36 2013 +0200
Add default tabular-like env for use in tables.
* latex.el (LaTeX-default-tabular-environment): New variable.
(LaTeX-env-figure): Use it instead of hard-coding "tabular".
* style/tabularx.el ("tabularx"): Set
`LaTeX-default-tabular-environment' to "tabularx".
---
ChangeLog | 8 ++++++++
latex.el | 7 ++++++-
style/tabularx.el | 2 ++
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7a52e8e..309aa3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-07-09 Tassilo Horn <[email protected]>
+
+ * latex.el (LaTeX-default-tabular-environment): New variable.
+ (LaTeX-env-figure): Use it instead of hard-coding "tabular".
+
+ * style/tabularx.el ("tabularx"): Set
+ `LaTeX-default-tabular-environment' to "tabularx".
+
2013-06-29 Mos� Giordano <[email protected]>
* bib-cite.el: Replace `save-excursion'+`set-buffer' with
diff --git a/latex.el b/latex.el
index 0051004..95854a0 100644
--- a/latex.el
+++ b/latex.el
@@ -502,6 +502,11 @@ is non-nil and the current environment is \"document\"."
variable overrides `LaTeX-default-environment'.")
(make-variable-buffer-local 'LaTeX-default-document-environment)
+(defvar LaTeX-default-tabular-environment "tabular"
+ "The default tabular-like environment used when inserting a table env.
+Styles such as tabularx may set it according to their needs.")
+(make-variable-buffer-local 'LaTeX-default-tabular-environment)
+
(defvar LaTeX-environment-history nil)
;; Variable used to cache the current environment, e.g. for repeated
@@ -1003,7 +1008,7 @@ job to this function."
;; Suppose an existing tabular environment should just
;; be wrapped into a table if there is an active region.
(not active-mark))
- (LaTeX-env-array "tabular"))))
+ (LaTeX-environment-menu LaTeX-default-tabular-environment))))
(defun LaTeX-env-array (environment)
"Insert ENVIRONMENT with position and column specifications.
diff --git a/style/tabularx.el b/style/tabularx.el
index f7d9ea7..6f1005d 100644
--- a/style/tabularx.el
+++ b/style/tabularx.el
@@ -37,6 +37,8 @@
(TeX-add-style-hook
"tabularx"
(lambda ()
+ ;; Make tabularx the default tabular environment
+ (setq LaTeX-default-tabular-environment "tabularx")
;; New symbols
(TeX-add-symbols
"tracingtabularx"