emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File type misclassification


From: David Kastrup
Subject: Re: File type misclassification
Date: Tue, 20 Mar 2007 17:06:23 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Kim F. Storm) writes:

> David Kastrup <address@hidden> writes:
>
>>> 1) Restrict the magic for PostScript files to %!PS
>>>
>>>  ("%!PS" . ps-mode)
>>
>> And probably EPS?
>
> Dunno.
>
>>>
>>> 2) Recognize the specific case of TEX
>>>
>>>  ("%![^VT]" . ps-mode)
>
>> Sigh.  Seems like a magic string for the "TeXshop" TeX editor.  But I
>> think just ruling out [VT] is still asking for trouble.
>
> So maybe add this to the magic-mode-alist before the ps rule:
>
>   ("%!TEX" . tex-mode)

That makes "%!" even less discriminatory than your last proposal.  The
PostScript magic is _far_ too lenient.

I find strings like the following:

%!PS-Adobe-2.0

The Ghostscript example files (created manually, apparently) start
with

%!

and nothing else.  I think it perfectly feasible to detect their
document type on the file name alone.

EPS files seem to start with something like

%!PS-Adobe-2.0 EPSF-2.0

So I'd propose making the magic string for PostScript at least
%!PS

While it may be conceivable to also allow %! on a line of its own, I
would judge that too weak for content-based detection.

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]