[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex def20e7 05/57: Make AUCTeX and Re
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [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"
+ "{\(\.*[^#}%\\\.
]+\)\(\.[^#}%\\\.
]+\)?}")
+ 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
- [AUCTeX-diffs] [elpa] externals/auctex updated (a580432 -> 3dca7c4), Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 061aaf5 03/57: Mention improvements to `LaTeX-array-count-columns' in news, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex def20e7 05/57: Make AUCTeX and RefTeX aware of file loading macro \subfile,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex ac02ed2 02/57: Extend test for new column counting code with style files loaded, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 89ea0e4 19/57: Fix name of macros \lcnamecref and \lcnamecrefs, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 4747c24 29/57: Simple docfix, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 4c42f7a 25/57: Revert "Remove multi-level/invisible feature of font-latex-fontify-script", Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 1addc62 30/57: Use RefTeX for multiple citations in biblatex, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 0b16551 51/57: * Makefile.in (release-commit): Use UTF-8 coding for ChangeLog entry., Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 0766526 41/57: Don't use cl function copy-list, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex a181b14 55/57: ; make change-history-commit, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 61e56f2 40/57: Fix bug where font-latex-sub/superscript-face was not applied to ^_, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex bc47cb0 39/57: Fontify script characters with a new face, Tassilo Horn, 2017/01/11