squash@math.ufl.edu (Jonathan King) (11/30/90)
(This is a reposting -the first time apparently did not post (?))
Hello.
When I visit a file with extension .tex I would like that its buffer
be automatically put in plain-tex-mode, and never in latex-mode.
-- If you can tell me how to do this, read no further. --
My .emacs file contains
(setq
auto-mode-alist
'( ; Determines automatic choice of major mode based on file extension.
("\\.tex$" . tex-mode) ("\\.sty$" . tex-mode)
...))
When I visit a .tex file, tex-mode apparently looks at the file and
guesses whether it is "plain", or "latex". Sometimes it guesses
wrong -in my case, whenever it guesses "latex". To try to make it
choose "plain", I put
(setq tex-default-mode 'plain-tex-mode)
in .emacs This solves the problem 90% of the time.
To get a 100% solution I tried
(setq
auto-mode-alist
'( ; Determines automatic choice of major mode based on file extension.
("\\.tex$" . plain-tex-mode) ("\\.sty$" . plain-tex-mode)
...))
*This* failed in a spectacular way. On our system, the command
tex-mode is apparently bound to execute something called cmutex.
Cmutex's keymap is called tex-mode-map (lowercase). However, the
tex-mode which comes with the standard GNU release is some other
command and *it* uses TeX-mode-map (some uppercase) for its local map.
When I made the above change to auto-mode-alist, cmutex was apparently
*not* called -the other tex mode was, and all of my key binding
naturally broke.
Out of curiosity, I'd like to know why cmutex didn't run.
Out of practicality, how can I always cause cmutex to be invoked in
its "plain" state-of-mind?
Jonathan