bug-auctex
[Top][All Lists]
Advanced

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

bug#36217: style hooks not automatically applied for non-master files


From: Ryan Kavanagh
Subject: bug#36217: style hooks not automatically applied for non-master files
Date: Fri, 14 Jun 2019 21:29:39 -0400
User-agent: NeoMutt/20180716

Package: auctex
Version: 12.1.2

WLOG, assume the TeX-master file is called "main.tex".

Style hooks for non-master files do not get applied unless the file
"auto/main.el" exists and has the appropriate "TeX-add-style-hook"
invocations. This is problematic when, e.g., you checkout a multi-file
LaTeX document from a VCS or when you accidentally remove the "auto"
subdirectory.

Expected behaviour
------------------

When I open a non-master file, AUCTeX should apply all of the style
hooks from the master file, even when auto/main.el does not exist.

Steps to reproduce
------------------

Create the following directory hierarchy

    foo/
        main.tex
        foo.tex

with the following contents:

==> main.tex <== BEGIN
\documentclass{minimal}
\usepackage{cleveref}
\begin{document}
\section{Foo}
\label{sec:foo}
Contents of \cref{sec:foo} are input by the command:
\input{foo.tex}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
==> main.tex <== END

==> foo.tex <== BEGIN
This is the content of \cref{sec:foo}.
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% End:
==> foo.tex <== END

Then

1. Make sure foo/auto does not exist.

2. Open foo.tex and notice that \cref{sec:foo} is not syntax-highlighted

3. Exit emacs and open main.tex.  Notice that \cref{sec:foo} has
highlighting.

4. Open foo.tex again. Same problem as #2. At this point, the 'auto/'
directory does not yet exist.

5. Exit emacs and open main.tex. Go 'C-c C-n' and exit.

6. Open foo.tex and observe that '\cref' has highlighting. This is
because 'auto/main.el' runs the style hook "cleveref".

Workaround
----------
1. Open the TeX-master file
2. Call TeX-normal-mode (C-c C-n) to regenerate the auto/main.el

-- 
|)|/  Ryan Kavanagh      | GPG: 4E46 9519 ED67 7734 268F
|\|\  https://rak.ac     |      BD95 8F7B F8FC 4A11 C97A

Attachment: signature.asc
Description: PGP signature


reply via email to

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