A colleague using a class I wrote reports
that AUCTeX is inserting guillemets when he hits the double-quote key. Investigation showed that TeX-language-fr-hook is being called even though the document itself is not in French.
If I understand a comment from @egreg in response to my colleague's question (Double-quote produces guillemets in emacs)
the reason AUCTeX thinks the comment is in French might be something like \usepackage[french]{babel}.
In fact there is this code in the class: \iffrench
\RequirePackage[english,francais]{babel}\fi
This conditional branch is only triggered if the french option to our class is chosen by the user. It seems that AUCTeX is taking that line to mean that the document is in French, regardless. How can I arrange it so the \usepackage is hidden from AUCTeX or only has an effect when it's intended to?
For full context see Double-quote produces guillemets in emacs
Edit: Below are a few lines from the *Messages* buffer in emacs that may be useful in tracing the problem:
Loading /var/lib/auctex/emacs24/msp.elc...done
Loading /usr/share/emacs/site-lisp/auctex/style/babel.el (source)...done
Loading /var/lib/auctex/emacs24/francais.elc...done
Loading /usr/share/emacs/site-lisp/auctex/style/francais.el (source)...done
Loading /usr/share/emacs/site-lisp/auctex/style/frenchb.el (source)...done
Loading /var/lib/auctex/emacs24/english.elc...done
\usepackagein a class it would be better to use\RequirePackageanyway (it's the same thing but auctex may not know that:-) or\@nameuse{RequirePackage}[french]{babel}or... – David Carlisle Jul 18 '14 at 20:23\RequirePackage[french]{babel}. When I posted the question I was piggybacking on a suggestion in the other posting and I didn't check carefully. I've now corrected my posting. We'll see what MTS says about @nameuse. – Silvio Levy Jul 18 '14 at 20:51style/french.el. Removing"french"from run hooks in her/his auto-generated style file should suffice. – giordano Jul 18 '14 at 20:58emacs -q, so it seems that my custom settings are not the problem. – MTS Jul 18 '14 at 21:22\usepackagecommand to\@nameuse{RequirePackage}[french]{babel}didn't fix the problem either. – MTS Jul 18 '14 at 21:24~/.emacs.d/elpa/auctex-11.86/style/i have lisp versions of various latex packages including babel.el do you have anywhere in your load path a lisp version of the class – David Carlisle Jul 18 '14 at 21:57~/.emacs.d/elpa/auctex-11.87.5/style/babel.elI have babel.el (and babel.elc). – MTS Jul 18 '14 at 22:02\documentclass{wibble}and auctex has awibble.elthat says it's french it will do that whatever the tex code actually does unless you force things back in sync – David Carlisle Jul 18 '14 at 22:08auto/subdirectory of the directory in which the class file is situated. – giordano Jul 18 '14 at 22:22auto/subdirectory there; the class file is in a subdirectory of/usr/local/texlive/texmf-local/tex/latex/, where I don't have write permission as a regular user. – MTS Jul 18 '14 at 22:34french.el. How is called this class? Following David's example, if it's calledwibble, after opening your document visit the*Messages*buffer, there should be a lineLoading /path/to/wibble.el...done. Where is the style file? – giordano Jul 19 '14 at 09:24/var/lib/auctex/emacs24/msp.elcwould help, but the answer should work anyway. – giordano Jul 20 '14 at 10:07TeX-parse-selfandTeX-auto-saveto nil in .emacs. – doed Aug 25 '14 at 17:40