GNU bug report logs - #36217
style hooks not automatically applied for non-master files

Previous Next

Package: auctex;

Reported by: Ryan Kavanagh <rak <at> debian.org>

Date: Sat, 15 Jun 2019 01:30:02 UTC

Severity: normal

Tags: notabug

Found in version 12.1.2

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36217 in the body.
You can then email your comments to 36217 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#36217; Package auctex. (Sat, 15 Jun 2019 01:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ryan Kavanagh <rak <at> debian.org>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Sat, 15 Jun 2019 01:30:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ryan Kavanagh <rak <at> debian.org>
To: submit <at> debbugs.gnu.org
Subject: style hooks not automatically applied for non-master files
Date: Fri, 14 Jun 2019 21:29:39 -0400
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#36217; Package auctex. (Wed, 19 Jun 2019 11:06:02 GMT) Full text and rfc822 format available.

Message #8 received at 36217 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Ryan Kavanagh <rak <at> debian.org>
Cc: 36217 <at> debbugs.gnu.org
Subject: Re: bug#36217: style hooks not automatically applied for non-master
 files
Date: Wed, 19 Jun 2019 20:05:37 +0900
Hi Ryan,

>>>>> Ryan Kavanagh <rak <at> debian.org> writes:
> Steps to reproduce
> ------------------

> Create the following directory hierarchy

>     foo/
>         main.tex
>         foo.tex

> with the following contents:

[ ... ]

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

In my humble opinion, this is an expected behavior of AUCTeX.  By
default, AUCTeX does not propagate information about parent (master)
file to its child file.

Perhaps something similar to what you want is the user option
`TeX-auto-save'.  When this is enabled, auto/main.el is created
automatically whenever you save main.tex.

,----[ Info node (auctex)Parsing Files ]
| AUCTeX depends heavily on being able to extract information from the
| buffers by parsing them.  Since parsing the buffer can be somewhat slow,
| the parsing is initially disabled.  You are encouraged to enable them by
| adding the following lines to your '.emacs' file.
| 
|      (setq TeX-parse-self t) ; Enable parse on load.
|      (setq TeX-auto-save t) ; Enable parse on save.
| 
|    The latter command will make AUCTeX store the parsed information in
| an 'auto' subdirectory in the directory each time the TeX files are
| stored, *note Automatic Local::.
`----

Regards,
Ikumi Keita




Information forwarded to bug-auctex <at> gnu.org:
bug#36217; Package auctex. (Tue, 05 Mar 2024 09:14:01 GMT) Full text and rfc822 format available.

Message #11 received at 36217 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: Ryan Kavanagh <rak <at> debian.org>, 36217 <at> debbugs.gnu.org
Subject: Re: bug#36217: style hooks not automatically applied for non-master
 files
Date: Tue, 05 Mar 2024 10:12:15 +0100
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:

> Hi Ryan,
>
>>>>>> Ryan Kavanagh <rak <at> debian.org> writes:
>> Steps to reproduce
>> ------------------
>
>> Create the following directory hierarchy
>
>>     foo/
>>         main.tex
>>         foo.tex
>
>> with the following contents:
>
> [ ... ]
>
>> 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".
>
> In my humble opinion, this is an expected behavior of AUCTeX.  By
> default, AUCTeX does not propagate information about parent (master)
> file to its child file.
>
> Perhaps something similar to what you want is the user option
> `TeX-auto-save'.  When this is enabled, auto/main.el is created
> automatically whenever you save main.tex.
>
> ,----[ Info node (auctex)Parsing Files ]
> | AUCTeX depends heavily on being able to extract information from the
> | buffers by parsing them.  Since parsing the buffer can be somewhat slow,
> | the parsing is initially disabled.  You are encouraged to enable them by
> | adding the following lines to your '.emacs' file.
> | 
> |      (setq TeX-parse-self t) ; Enable parse on load.
> |      (setq TeX-auto-save t) ; Enable parse on save.
> | 
> |    The latter command will make AUCTeX store the parsed information in
> | an 'auto' subdirectory in the directory each time the TeX files are
> | stored, *note Automatic Local::.
> `----

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

No further comments, so I'm closing this report.

Best, Arash




Added tag(s) notabug. Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 05 Mar 2024 09:15:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 36217 <at> debbugs.gnu.org and Ryan Kavanagh <rak <at> debian.org> Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 05 Mar 2024 09:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 02 Apr 2024 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 23 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.