auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. def20e774e6d3f9f9d3ca


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. def20e774e6d3f9f9d3ca24e2e17a8c126d8137c
Date: Mon, 26 Dec 2016 11:59:10 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  def20e774e6d3f9f9d3ca24e2e17a8c126d8137c (commit)
      from  c3a21f2c6a23f229c8080dc55599d3df755e501f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit def20e774e6d3f9f9d3ca24e2e17a8c126d8137c
Author: Uwe Brauer <address@hidden>
Date:   Mon Dec 26 12:57:35 2016 +0100

    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.

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

-----------------------------------------------------------------------

Summary of changes:
 style/subfiles.el |   41 +++++++++++++++++++++++++++++++----------
 1 file changed, 31 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]