[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 19:32:12 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>>>>> 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.
>
> Same old problem where the file's content and the file's extension do not
> agree on what the file actually contains. And once again, the file
> extension is the better predictor whereas Emacs uses magic-mode-alist in
> preference to auto-mode-alist.
>
>> Sigh. Seems like a magic string for the "TeXshop" TeX editor. But I
>> think just ruling out [VT] is still asking for trouble.
>
> I think a bug report to the TeXshop is in order.
Uh, you people are joking, right? It is not a bug in TeXshop if
Emacs' magic-mode-alist goes out of control and calls everything
"PostScript".
>>> 3) Remove it from magic-mode-alist.
>> Also an option in my book.
>
> Agreed, a very good option I'd say. Especially since editing
> postscript is rather uncommon.
Since I don't seem too good at explaining what appears as common sense
to me, I'll fix the magic expression myself to "#!PS". That's still a
less drastic change than removing it altogether, and most people seem
to agree that the latter option would be quite feasible.
This won't catch "#!\n" which seems to be used in some hand-crafted PS
files, but then the handcrafted files (vasarely.ps, for example)
should be discernible by file extension, and one would have to
actually use some generic line-ending recognizer instead of "\n",
anyway, since PostScript has no fixed line-ending convention.
If others find they want even the "#!PS" gone (which I don't really
see as a problem), or add some form of "#!lineend", feel free to
discuss and fix.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
- 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 <=
- 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
- Re: File type misclassification, David Kastrup, 2007/03/21
- Re: File type misclassification, Juanma Barranquero, 2007/03/21
- Re: File type misclassification, Miles Bader, 2007/03/21
- Re: File type misclassification, Richard Stallman, 2007/03/20