[Top][All Lists]

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

Re: [AUCTeX] Problem with latex2e style hook --- LaTeX/Texinfo collision

From: Ivan Andrus
Subject: Re: [AUCTeX] Problem with latex2e style hook --- LaTeX/Texinfo collision
Date: Thu, 14 Aug 2014 10:26:27 -0600

On Aug 14, 2014, at 7:39 AM, Mosè Giordano <address@hidden> wrote:

Hi Vincent,

2014-08-14 11:42 GMT+02:00 Vincent Belaïche <address@hidden>:
Dear all,

I have found a problem with AUCTeX. Here is the observed problem: when I
edit a Texinfo file named latex2e.texi 'C-c C-f' does not provide
Texinfo-font-list but LaTeX-font-list. The problem happens only if
latex2e.texi is not the first file I am editing, but I have edited some
LaTeX file --- say foo.tex --- before that.

Note: latex2e.texi is the english version of unofficial LaTeX manual
maintained by Karl Berry and myself on GNA!  latexrefman project. I
don't think that we are going to change the filename --- everybody
should be free to name their files in the way they like!

The root of the problem is in AUCTeX latex.el as follows

(TeX-add-style-hook "latex2e"
            ;; Use new fonts for `\documentclass' documents.
            (lambda ()
          (setq TeX-font-list LaTeX-font-list)
          (setq TeX-font-replace-function 'TeX-font-replace-macro)
          (run-hooks 'LaTeX2e-hook)))

After editing foo.tex the LaTeX mode is invoked, which in turns evaluate
(LaTeX-common-initialization), which in turn adds the "latex2e" style
hook as above.

Now, after texinfo-mode invocation on latex2e.texi, TeX-font-list is
correctly pointing to Texinfo-font-list. But then, when 'C-c C-f' is
called, then (TeX-update-style) is evaluated, and then the The latex2e
style hook pushed to TeX-style-hook-list by prior editing of foo.tex is
run, which has the effect of evaluating (setq TeX-font-list
LaTeX-font-list): that is the problem.

This is due to a long-standing bug: AUCTeX doesn't use file extensions
in style hooks, so there is always a clash between two files with the
same base name (I used to have a LaTeX master file and the
corresponding bibliography file with the same base name, I had to
change my workflow when switched to AUCTeX) or even, as in your case,
a real file and a fictitious file (the latex2e style hook).
Unfortunately, fixing this bug would require a large and
breaking-backward-compatibility work.

Just a thought for a workaround. Does it work to access the 
file through a symlink with a different name?


reply via email to

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