> Hi Uwe,
   > 2016-11-23 18:51 GMT+01:00 Uwe Brauer <o...@mat.ucm.es>:

   > Could you please send the updated patch against current master of
   > AUCTeX?  Makefile.in has changed since then.  I'd install your patch.

Ok. Here it comes

Uwe 

# HG changeset patch
# User Uwe Brauer <o...@mat.ucm.es>
# Date 1479940341 0
#      Wed Nov 23 22:32:21 2016 +0000
# Node ID 4f7ed9f4d6636dfba413c196ca0760c359e04ba0
# Parent  c4c6aa7a5eb56560c3ca647a5ccb9b3f6c1f8c85
Add style file for subfiles package.

* Makefile.in (STYLESRC): add subfiles.el entry

* style/subfiles.el ("subfiles"): add new style.

diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -158,7 +158,7 @@
 	   style/pdflscape.el style/commath.el   style/empheq.el \
 	   style/framed.el    style/paracol.el   style/menukeys.el \
 	   style/bidi.el      style/FiraMono.el  style/FiraSans.el \
-	   style/bicaption.el style/amsfonts.el
+	   style/bicaption.el style/amsfonts.el  style/subfiles.el \
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/subfiles.el b/style/subfiles.el
new file mode 100644
--- /dev/null
+++ b/style/subfiles.el
@@ -0,0 +1,57 @@
+;;; subfiles.el --- AUCTeX style for the subfiles package.
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer <o...@mat.ucm.es>
+;; Created: 07 Nov 2016
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;; Acknowledgements
+;; Mosè Giordano  <m...@gnu.org>
+;; Arash Esbati <arash.esbati...@gmail.com>
+
+;;; Commentary:
+
+;; This file adds support for the subfiles package.
+
+;;; Code:
+
+(defvar LaTeX-subfiles-package-options nil
+  "Package options for the subfiles package.")
+
+(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 <m...@gnu.org> 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)
+
+
+;;; subfiles.el ends here
+
_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to