[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 29ae5fb 15/36: Add \LTXtable to l
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 29ae5fb 15/36: Add \LTXtable to list of file-loading commands |
Date: |
Thu, 22 Dec 2016 13:08:11 +0000 (UTC) |
branch: externals/auctex
commit 29ae5fbdd4029c941de4d6ac6b5a4906d4b4d505
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
Add \LTXtable to list of file-loading commands
* style/ltxtable.el (LaTeX-ltxtable-file-regexp): New variable.
("ltxtable"): Make AUCTeX and RefTeX aware of \LTXtable as file
loading command.
Add fontification support.
---
style/ltxtable.el | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/style/ltxtable.el b/style/ltxtable.el
index 93dd218..4ce184b 100644
--- a/style/ltxtable.el
+++ b/style/ltxtable.el
@@ -31,10 +31,20 @@
;;; Code:
+(defvar LaTeX-ltxtable-file-regexp
+ `(,(concat "\\LTXtable"
+ "{\(?:[^}]+\)}"
+ "{\(\.*[^#}%\\\.
]+\)\(\.[^#}%\\\.
]+\)?}")
+ 1 TeX-auto-file)
+ "Matches the file argument of \LTXtable marco from ltxtable package.
+The regexp for the 2. argument is the same as for \"input\" and
+\"include\" entries in `LaTeX-auto-regexp-list'.")
+
(TeX-add-style-hook
"ltxtable"
(lambda ()
(TeX-run-style-hooks "tabularx" "longtable")
+
(TeX-add-symbols
'("LTXtable"
(TeX-arg-length "Width" "1.0\linewidth")
@@ -42,7 +52,29 @@
(lambda ()
(let ((longtable (file-relative-name
(read-file-name "File with longtable: "))))
- (format "%s" longtable)))))))
+ (format "%s" longtable))))))
+
+ ;; Make sure that \LTXtable stays in its own line:
+ (LaTeX-paragraph-commands-add-locally "LTXtable")
+
+ ;; Tell AUCTeX about a new file-include command:
+ (TeX-auto-add-regexp LaTeX-ltxtable-file-regexp)
+
+ ;; Tell RefTeX about a new file-include command: Add
+ ;; LTXtable{<width>} as a regexp (without \) to
+ ;; `reftex-include-file-commands' and run
+ ;; `reftex-compile-variables'. Do this all only once.
+ (when (and (boundp 'reftex-include-file-commands)
+ (not (string-match "LTXtable"
+ (mapconcat #'identity
reftex-include-file-commands "|"))))
+ (add-to-list 'reftex-include-file-commands "LTXtable{\(?:[^}]+\)}" t)
+ (reftex-compile-variables))
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("LTXtable" "{{"))
+ 'textual)))
LaTeX-dialect)
(defvar LaTeX-ltxtable-package-options nil
- [AUCTeX-diffs] [elpa] externals/auctex updated (1b5875c -> 2e7ca50), Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 80d2a08 10/36: Min fix to kpfonts package, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 29ae5fb 15/36: Add \LTXtable to list of file-loading commands,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex eb748ea 18/36: Fix query for defined colors in style/ntheorem.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 7518a8a 31/36: Mention that arguments to *-operator must be in braces, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex e4aba95 21/36: Support RefTeX with `reftex-add-label-environments' in style/mathtools.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 66ed2ac 30/36: Add test for new column counting code, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex f04e5f7 09/36: Add style file for amsfonts package, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 1aa46c3 23/36: ; Use third argument of `TeX-argument-insert', Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 40da84e 20/36: Support RefTeX with `reftex-add-label-environments' in style/empheq.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex d6890e8 04/36: Improve caption and label insertion in style/subcaption.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex b44d524 35/36: Uniform font-lock updates/don't break prettify (bug#25245), Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 79c8264 19/36: Fix query for defined colors in style/textpos.el, Tassilo Horn, 2016/12/22