[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex def20e7 05/57: Make AUCTeX and RefTeX aware of f
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex def20e7 05/57: Make AUCTeX and RefTeX aware of file loading macro \subfile |
Date: |
Wed, 11 Jan 2017 18:01:37 +0000 (UTC) |
branch: externals/auctex
commit def20e774e6d3f9f9d3ca24e2e17a8c126d8137c
Author: Uwe Brauer <address@hidden>
Commit: Arash Esbati <address@hidden>
Make AUCTeX and RefTeX aware of file loading macro \subfile
* style/subfiles.el ("subfiles"): Make subfile macro be recognized
as a paragraph command. For AUCTeX, add argument of subfile to
`TeX-auto-file'. For RefTeX, append subfile to
`reftex-include-file-commands' and run `reftex-compile-variables'
only once. Code rearrangement.
---
style/subfiles.el | 41 +++++++++++++++++++++++++++++++----------
1 file changed, 31 insertions(+), 10 deletions(-)
diff --git a/style/subfiles.el b/style/subfiles.el
index 604e4f9..44f897a 100644
--- a/style/subfiles.el
+++ b/style/subfiles.el
@@ -24,7 +24,7 @@
;; 02110-1301, USA.
;; Acknowledgements
-;; Mosè Giordano <address@hidden>
+;; Mosè Giordano <address@hidden>
;; Arash Esbati <address@hidden>
;;; Commentary:
@@ -39,18 +39,39 @@
(TeX-add-style-hook
"subfiles"
(lambda ()
- ;; The following code will fontify `\subfile{}' like include.
- (when (and (featurep 'font-latex)
- (eq TeX-install-font-lock 'font-latex-setup))
- (font-latex-add-keywords '(("subfile" "{"))
- 'reference))
- ;; The following code will run `TeX-run-style-hooks' on the subfile master
file.
- ;; Thanks to Mosè Giordano <address@hidden> for presenting a better
solution using `assoc'.
+
+ ;; The following code will run `TeX-run-style-hooks' on the subfile
+ ;; master file. Thanks to Mosè Giordano <address@hidden> for
+ ;; presenting a better solution using `assoc'.
(TeX-run-style-hooks
(file-name-base (cadr (assoc "subfiles" LaTeX-provided-class-options))))
+
(TeX-add-symbols
- '("subfile" TeX-arg-file)))
- LaTeX-dialect)
+ '("subfile" TeX-arg-file))
+
+ ;; Ensure that \subfile stays in one line
+ (LaTeX-paragraph-commands-add-locally "subfile")
+ ;; Tell AUCTeX that \subfile loads a file. regexp is the same as
+ ;; for \input or \include. This will run `TeX-run-style-hooks' on
+ ;; subfile(s) when master file is loaded.
+ (TeX-auto-add-regexp
+ `(,(concat
+ "\\\\subfile"
+ "{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}")
+ 1 TeX-auto-file))
+
+ ;; Tell RefTeX the same thing.
+ (when (and (boundp 'reftex-include-file-commands)
+ (not (member "subfile" reftex-include-file-commands)))
+ (add-to-list 'reftex-include-file-commands "subfile" t)
+ (reftex-compile-variables))
+
+ ;; The following code will fontify `\subfile{}' like \input.
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("subfile" "{"))
+ 'reference)))
+ LaTeX-dialect)
;;; subfiles.el ends here
- [elpa] externals/auctex updated (a580432 -> 3dca7c4), Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 061aaf5 03/57: Mention improvements to `LaTeX-array-count-columns' in news, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex ec3996d 08/57: Query for optional float position, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex def20e7 05/57: Make AUCTeX and RefTeX aware of file loading macro \subfile,
Tassilo Horn <=
- [elpa] externals/auctex a55b66d 07/57: Improve inserting arguments of \captionof macro, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex ac02ed2 02/57: Extend test for new column counting code with style files loaded, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex bef4873 22/57: Set `reftex-set-cite-format' to biblatex or natbib, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex c3a21f2 04/57: Print only first line of the message in error overview, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 48d397c 17/57: Add starred version of \citeauthor and \Citeauthor, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 89ea0e4 19/57: Fix name of macros \lcnamecref and \lcnamecrefs, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex bb390fe 18/57: Add fontification for varioref's referencing macros, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 8186490 06/57: Fix documentation of TeX-arg-file, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 01da194 23/57: ; * style/titletoc.el ("titletoc"): Use `TeX-arg-length'., Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 1addc62 30/57: Use RefTeX for multiple citations in biblatex, Tassilo Horn, 2017/01/11