branch: externals/auctex commit e8528e03aaad55a7720f7d7506088917962283c9 Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Update style/subfiles.el to package version 2.1 * style/subfiles.el (LaTeX-subfiles-class-options): Use \' to match the empty string at the end of the file extension. ("subfiles"): Add support for \subfileinclude macro. --- style/subfiles.el | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/style/subfiles.el b/style/subfiles.el index f23cc9f..5434f99 100644 --- a/style/subfiles.el +++ b/style/subfiles.el @@ -54,7 +54,7 @@ (read-file-name "Main file: " nil nil nil nil (lambda (texfiles) - (string-match "\\.tex$" texfiles))) + (string-match "\\.tex\\'" texfiles))) (TeX-master-directory))) (TeX-add-style-hook @@ -70,30 +70,37 @@ (file-name-sans-extension master-file)))) (TeX-add-symbols - '("subfile" TeX-arg-file)) + '("subfile" TeX-arg-file) + '("subfileinclude" TeX-arg-file)) - ;; Ensure that \subfile stays in one line - (LaTeX-paragraph-commands-add-locally "subfile") + ;; Ensure that \subfile and \subfileinclude stay in one line + (LaTeX-paragraph-commands-add-locally '("subfile" "subfileinclude")) ;; 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" + "\\\\subfile\\(?:include\\)?" "{\\(\\.*[^#}%\\\\\\.\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) + (not (string-match "subfile" + (mapconcat #'identity + reftex-include-file-commands + "|")))) + (make-local-variable 'reftex-include-file-commands) + (add-to-list 'reftex-include-file-commands "subfile\\(?:include\\)?" t) (reftex-compile-variables)) - ;; The following code will fontify `\subfile{}' like \input. + ;; The following code will fontify \subfile{} and + ;; \subfileinclude{} like \input. (when (and (featurep 'font-latex) (eq TeX-install-font-lock 'font-latex-setup)) - (font-latex-add-keywords '(("subfile" "{")) + (font-latex-add-keywords '(("subfile" "{") + ("subfileinclude" "{")) 'reference))) TeX-dialect)