[Top][All Lists]

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

Re: [AUCTeX-devel] subfiles, private macros, scan the master file

From: Mosè Giordano
Subject: Re: [AUCTeX-devel] subfiles, private macros, scan the master file
Date: Mon, 7 Nov 2016 15:11:14 +0100

2016-11-07 14:56 GMT+01:00 Uwe Brauer <address@hidden>:
>    > Hi Uwe,
>    > 2016-11-07 14:36 GMT+01:00 Uwe Brauer <address@hidden>:
>    > (TeX-run-style-hooks
>    >  (file-name-base (cadr (assoc "subfiles" LaTeX-provided-class-options))))
> Aha, I came up with
>   (let ((subfile-master (file-name-sans-extension (car (cdr (car 
> LaTeX-provided-class-options))))))
>     (TeX-run-style-hooks subfile-master))
> Besides the fact I use a (unnecessary) let, your solution is much more
> elegant. :-D

Using `assoc' makes sure you pick-up the option of the wanted class.
In rare corner cases there may be more than one entry in that alist,
your solution is not granted to pick-up the right option.

>    > should do the trick, provided that the name of the master file is the
>    > only possible option in \documentclass[...]{subfiles} (I don't know
>    > the class).
> Great I tested it, works like charm.
> Hm I am thinking of providing a very small style file for subfiles,
> because this is really nifty.
> Do you want me to send a real patch, or is a simple attachment is fine? The
> file is very small....

A patch is always better, because we can more easily preserve
authorship of the change and you can include the appropriate message.
In addition, when you add a new style file, you have also to edit, so it's never a single-file-change ;-)

When you create a new file, please copy and adapt the copyright header
from other existing files, do not do it on your own.  The previous
file you sent had a wrong format, see;a=commitdiff;h=d833e0e3efc271e6d12b82ba5bb91ecd631e620a


reply via email to

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