[Top][All Lists]
[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 16:17:12 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
address@hidden (Kim F. Storm) writes:
> "Juanma Barranquero" <address@hidden> writes:
>
>> On 3/20/07, David Kastrup <address@hidden> wrote:
>>
>>> opening the following file in emacs-snapshot from Ubuntu Edgy
>>> (sorry, I don't have a fresher CVS Emacs at work) will throw the
>>> buffer into PostScript mode, presumably because it starts with "%!".
>>> This seems rather like overkill.
>>
>> Yep. It's magic-mode-alist's doing:
>>
>> ("%![^V]" . ps-mode)
>
> First line of the file reads:
>
> %!TEX encoding = UTF-8 Unicode
>
>
> I see three fixes:
>
>
> 1) Restrict the magic for PostScript files to %!PS
>
> ("%!PS" . ps-mode)
And probably EPS?
>
> 2) Recognize the specific case of TEX
>
> ("%![^VT]" . ps-mode)
I don't think that there is a special case here: it would be my guess
that the author just picked that string by chance.
[Google]
Sigh. Seems like a magic string for the "TeXshop" TeX editor. But I
think just ruling out [VT] is still asking for trouble.
> 3) Remove it from magic-mode-alist.
Also an option in my book. But I think we should start by making the
string much more discriminatory. There is no harm if we overdo it: in
general, the file extension will catch what we don't, effectively
giving us option 3) for those cases.
--
David Kastrup
- File type misclassification, David Kastrup, 2007/03/20
- Re: File type misclassification, Juanma Barranquero, 2007/03/20
- Re: File type misclassification, Kim F. Storm, 2007/03/20
- Re: File type misclassification, Stefan Monnier, 2007/03/20
- Re: File type misclassification, David Kastrup, 2007/03/20
- Re: File type misclassification, Stefan Monnier, 2007/03/20
- Re: File type misclassification, David Kastrup, 2007/03/21
- Re: File type misclassification, Stefan Monnier, 2007/03/21
- Re: File type misclassification, Juanma Barranquero, 2007/03/21
- Re: File type misclassification, David Kastrup, 2007/03/21
- Re: File type misclassification, Juanma Barranquero, 2007/03/21