[OS X TeX] Emacs 22.92, %! and TeXShop

Peter Dyballa Peter_Dyballa at Web.DE
Fri Jan 26 10:37:23 CET 2007


Am 26.01.2007 um 02:34 schrieb Stephen Moye:

> I just started using emacs 22.92 -- I have been using emacs 22.50.  
> Unlike v22.50, when I open a TeXShop TeX file with emacs 22.92, it  
> is opened as a PostScript file. I imagined that it had something to  
> do with the first line of the file:
>
> 	%!TEX TS-program = latex
>
> Sure enough, I went digging using
>
> 	C-h v auto-mode-alist
>
> and found a line in files.el:
>
> 	("%![^V]" . ps-mode)
>
> in addition to what I expected:
>
> 	("\\.[tT]e[xX]\\'" . tex-mode)
>
> So emacs is looking inside the file to make a better guess about  
> what kind of file it is. I tried changing
>
> 	("%![^V]" . ps-mode)
>
> to
>
> 	("%![^VT]" . ps-mode)
>
> but that did not work.

(Did you re-byte-compile files.el? Did you create a new Emacs?  
Files.el is dumped into GNU Emacs.)

"Markers" inside the file take precedence over file name extensions.  
Actually Emacs' description of what makes a PostScript file is  
faulty. %! at the start of the first line is not enough (although it  
mostly works). I corrected Emacs' setting with

	(add-to-list 'magic-mode-alist '("%!PS-Adobe" . ps-mode))

which seems to work fine.


>
> I really like emacs 22.nn, but this is a bit of a bother. Can I put  
> something in my .emacs file to counter this unwanted cleverness? I  
> know that I can put
>
> 	%-*-latex-*-
>
> as the first line of the file and both emacs and TeXShop will be  
> happy, but that seems an unnecessary complication.

Yes. The reason is in TeXShop: it's author(s) make it an  
imperialistic device similiar to Adobe Reader and its PDF plug-in:  
the first line is allowed to only contain what TeXShop understands.  
It won't keep pace with GNU Emacs that helpfully accepts a line like

	%!TEX TS-program = latex	-*- mode: LaTeX; coding: iso-8859-9; -*-

>
> Any suggestions? Or, alternatively, where else should I more  
> appropriately post this query?
>

Forget TeXShop! Dump it on the dung-hill of computer history!

Of course you can complain on the Mac OS X TeX list, but Dick Koch  
does not seem to like a helpful design in TeXShop.

And of course you can teach Emacs to understand the TeXShop syntax.  
Particularly AUCTeX could be taught to use the TS-program for  
compilation instead of

	%%% TeX-command-default: "<some engine file>"


Would be interesting to now what other TeXing applications use to  
remember the file's mode and TeXing command – to which extent their  
imperialism has grown ...

--
Greetings

   Pete

There is no national science just as there is no national  
multiplication table; what is national is no longer science.
                                       -- Anton Checov



------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list