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

Peter Dyballa Peter_Dyballa at Web.DE
Sat Jan 27 05:06:11 EST 2007

Am 27.01.2007 um 04:13 schrieb Charilaos Skiadas:

>>> Isn't there a way to tell emacs to treat all files with extension  
>>> "tex" as tex files too?
>> The issue here is that TeXshop's use of %! can make some of its  
>> source files incompatible with at least
>> emacs.
> Actually for me this is not the issue. The issue, for me, is the  
> inability of emacs to understand as a tex file something that is  
> plainly and without any doubt a tex file.

You did not pay attention! GNU Emacs does not rely on your  
understanding of what "is plainly and without any doubt a tex file."  
Because a file contents, with what file name extension ever, that  
starts with %! is a PostScript contents. You should learn this fact  
starting today, a thing your PostScript printer could tell you at once.

GNU Emacs first looks at the contents of a file – similiar to the  
UNIX file command and many other routines, that for example check  
whether the binary is executable on this hardware in this software  
environment and whether the shared library fits into both. (Just  
imagine that you wanted to save file.text and forgot, in a hurry, to  
enter the last character or the key was blocked on the keyboard which  
did not see or whatever.) And by this means it's also possible to put  
at the bottom of the file settings for "local variables" into the  
file that determine how this file contents will be treated, or you do  
this on the first line, just as TeXShop tries to do it. (And a bit  
more is possible, too.)

If this first step fails, then GNU Emacs tries to determine the kind  
of file by its extension. Heuristics for both are incorporated into  
GNU Emacs. As usual both heuristics can be adapted to local  
circumstances or customs. Examples for doing this were given.

This approach is a bit human. At least a few humans are clever and do  
not rely as computers do on the primitive idea that one test can  
determine everything without error.

TeXShop's usurpation of %! is bad.  %? would make more sense: is what  
follows the question mark something with a meaning for me, TeXShop?



Some day we may discover how to make magnets that can point in any  

------------------------- 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 MacOSX-TeX mailing list