auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Small patch for subfiles.el


From: Arash Esbati
Subject: [AUCTeX-devel] Small patch for subfiles.el
Date: Wed, 15 Feb 2017 09:19:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2

Hi Uwe,

what do you think about this small patch against subfiles.el:

--8<---------------cut here---------------start------------->8---
diff --git a/style/subfiles.el b/style/subfiles.el
index 40993157..52bc7c31 100644
--- a/style/subfiles.el
+++ b/style/subfiles.el
@@ -36,6 +36,15 @@
 (defvar LaTeX-subfiles-package-options nil
   "Package options for the subfiles package.")

+(defun LaTeX-subfiles-class-options ()
+  "Return name of the main file relative to current subfile."
+  (file-relative-name
+   (read-file-name
+    "Main file: " nil nil nil nil
+    (lambda (texfiles)
+      (string-match "\\.tex$" texfiles)))
+   (TeX-master-directory)))
+
 (TeX-add-style-hook
  "subfiles"
  (lambda ()
--8<---------------cut here---------------end--------------->8---

With this, Emacs will ask with completion for the main file to be
included in the optional argument of \documentclass in a subfile and
returns it relative to master file (usually the subfile itself).

Drawback: This does not work with XEmacs.

Best, Arash



reply via email to

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