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

Jonathan Kew jonathan_kew at sil.org
Sat Jan 27 05:55:09 EST 2007

On 27 Jan 2007, at 10:06 am, Peter Dyballa wrote:

> 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.

I've been reluctant to jump into this debate, but this is too much!  
Peter, it is absurd to claim that any file beginning with "%!" is  
PostScript. It's a hint, a clue, nothing more. PostScript does not  
"own" those particular two bytes. Emacs's "understanding" in this  
case is every bit as crude as relying on a file extension. And all  
your PostScript printer can "tell you" is that everything after the  
"%" is irrelevant to it; the line is merely a comment, and therefore  
ignored, as far as it is concerned.

> 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.

I guess you're referring to the extension as primitive; the Emacs  
approach also seems rather primitive, if it jumps to a conclusion on  
the basis of those two bytes alone, regardless of the fact that the  
rest of the file looks nothing like PostScript -- something that your  
printer will surely confirm if you offer it the document!

It's good that Emacs's approach can be customized; it's just  
unfortunate that the initial configuration is apparently so simple- 
minded. Checking for the four-byte sequence "%!PS" would be a far  
better default.

Rather than just complaining, how about submitting a patch to Dick  
that would enable TeXShop to recognize several forms of metadata in  
files, including Emacs-compatible styles and any others that are in  
common use? That should be *in addition to* continuing to recognize  
the %!TEX comments that it already supports, so that the many happy  
users who have such files, and don't care what Emacs thinks of them,  
aren't *forced* to make changes.


------------------------- 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