[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex a833aff 26/36: Use `LaTeX-item-lo
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex a833aff 26/36: Use `LaTeX-item-longtable' while inserting longtable's |
Date: |
Thu, 22 Dec 2016 13:08:12 +0000 (UTC) |
branch: externals/auctex
commit a833afff74bb3534a5bce265e2478296f8152526
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
Use `LaTeX-item-longtable' while inserting longtable's
* style/longtable.el (LaTeX-longtable-skipping-regexp): New variable.
(LaTeX-item-longtable): New function. This function is a
variation of `LaTeX-item-array' which uses
`LaTeX-longtable-skipping-regexp' when inserting ampersands.
("longtable"): Append longtable to `LaTeX-item-list'.
---
style/longtable.el | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/style/longtable.el b/style/longtable.el
index 76c397b..aeb275e 100644
--- a/style/longtable.el
+++ b/style/longtable.el
@@ -29,6 +29,23 @@
;;; Code:
+(defvar LaTeX-longtable-skipping-regexp
+ (regexp-opt '("[l]" "[r]" "[c]" ""))
+ "Regexp matching between \begin{longtable} and column specification.
+For longtable environments only.")
+
+(defun LaTeX-item-longtable (&optional suppress)
+ "Insert line break macro on the last line and suitable number of &'s.
+For longtable environments. If SUPPRESS is non-nil, do not
+insert line break macro."
+ (unless suppress
+ (save-excursion
+ (end-of-line 0)
+ (just-one-space)
+ (TeX-insert-macro "\")))
+ (LaTeX-insert-ampersands
+ LaTeX-longtable-skipping-regexp #'LaTeX-array-count-columns))
+
(TeX-add-style-hook
"longtable"
(lambda ()
@@ -64,7 +81,9 @@
(LaTeX-fill-paragraph)
;; Insert a new line and indent
(LaTeX-newline)
- (indent-according-to-mode))))))
+ (indent-according-to-mode))
+ ;; Insert suitable number of &'s, suppress line break
+ (LaTeX-item-longtable t)))))
(TeX-add-symbols
;; Commands to end table rows
@@ -91,6 +110,9 @@
;; custome values.
(add-to-list 'LaTeX-label-alist '("longtable" . LaTeX-table-label) t)
+ ;; Append longtable to `LaTeX-item-list' with `LaTeX-item-longtable'
+ (add-to-list 'LaTeX-item-list '("longtable" . LaTeX-item-longtable) t)
+
;; Fontification
(when (and (featurep 'font-latex)
(eq TeX-install-font-lock 'font-latex-setup))
- [AUCTeX-diffs] [elpa] externals/auctex 42dd1f1 22/36: Support RefTeX with `reftex-add-index-macros' in style/splitidx.el, (continued)
- [AUCTeX-diffs] [elpa] externals/auctex 42dd1f1 22/36: Support RefTeX with `reftex-add-index-macros' in style/splitidx.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex b59075b 06/36: Do not insert a new line if \label is omitted, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 945035c 24/36: Append tabular[xy] to `LaTeX-item-list', Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 0265793 25/36: Add "s" and "S" to `LaTeX-array-column-letters', Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex c5d1d02 13/36: Append entry to `LaTeX-label-alist' for new "verbatim" floats, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex e3c60cf 08/36: Add new style/bicaption.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 76db91e 27/36: Accept non-letter characters as column specifier, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex c265fc9 02/36: Add new style/FiraMono.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 25e4f33 03/36: Add new style/FiraSans.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 0d26aba 01/36: Suggest to display warnings when there are no errors in error overview, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex a833aff 26/36: Use `LaTeX-item-longtable' while inserting longtable's,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 1c9de7e 29/36: Count *-operator in column specification, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex c4cb166 33/36: Add style/ directory to TeX-style-path for tests, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 2f75f51 17/36: Add support for LaTeX core command extsubscript, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex cb6bc11 07/36: Add support for style/bicaption.el to style/caption.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 70c6499 34/36: Fix to TeX-add-local-master, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 3677ddc 28/36: Add new style/dcolumn.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 94db238 05/36: Improve caption and label insertion in style/caption.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex db3fcb9 32/36: * tex.el (TeX-add-local-master): Inherit major mode from master file., Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 2e7ca50 36/36: Merge branch 'master' into externals/auctex, Tassilo Horn, 2016/12/22