auctex-devel
[Top][All Lists]
Advanced

[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 14:49:59 +0100

Hi Uwe,

2016-11-07 14:36 GMT+01:00 Uwe Brauer <address@hidden>:
>
>    > Hi Uwe,
>    > 2016-11-02 9:34 GMT+01:00 Uwe Brauer <address@hidden>:
>
>    > Sorry, I don't know the subfiles class, so I don't completely
>    > understand what you're asking.  You would like to run the Emacs style
>    > file associated to "main.tex" but not make "main.tex" the
>    > `TeX-master'?  This is possible with a subfiles style files which
>    > takes care of running "main.tex"'s hook (the name of the file is
>    > available in `LaTeX-provided-class-options' variable).
>
> I started to work on it, but which hook you want me to run
>
> TeX-run-style-hooks?
>
> Or run-hooks?

(TeX-run-style-hooks
 (file-name-base (cadr (assoc "subfiles" LaTeX-provided-class-options))))

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).

> BTW german.el in style (and other style as well) has a
> line which puzzles me.
> (run-hooks 'TeX-language-de-hook))
>
> But TeX-language-de-hook seems not to be defined.

Non-existing hooks are not a problem, they're completely fine.  In
this case, `TeX-language-XX-hook' are expected to be created by the
users, according to their needs.  See the manual:
https://www.gnu.org/software/auctex/manual/auctex.html#Style-Files-for-Different-Languages

> Be it as it may I can determine the name of file I want to scan using
>
>
>     (let ((subfile-master (car (cdr (car LaTeX-provided-class-options)))))
>
>
> But I am not sure whether this is this the right thing or it should be
>
>     (let ((subfile-master (file-name-sans-extension (car (cdr (car 
> LaTeX-provided-class-options))))))

The variable is an alist, so you can query it with `assoc'.  See above.

Bye,
Mosè



reply via email to

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