Re: File type misclassification
> In contrast, %! is far too generic to be useful. It may be a
> heuristic for a PostScript interpreter to decide whether it is getting
> fed PostScript on stdin. But it does not sound like a useful
> heuristic for a text editor to decide whether a named file contains
> PostScript code or anything else.
Complete agreement. But it still means that TeXshop should avoid the "%!"
magic characters because they have a conflicting meaning in some contexts.
I don't claim that TeXshop should change for the sake of Emacs: it should
change because its choice is fundamentally wrong, whether that bites Emacs
users or not is irrelevant.
>> This said, I'd be happy to see the %! entry removed from
>> magic-mode-alist, because I think magic-mode-alist should really be
>> kept to its absolute strictest minimum.
> I don't think that "%!PS" has comparable potential to do accidental
> harm. Whether it does noticeable good is a different question
> altogether.
Obviously using a stricter regexp is good in my book since it means that
magic-mode-alist is used less often.
> However, dvips -i produces PostScript files where the extension is
> replaced by a serial number. Those will not be recognized as
> PostScript without magic number detection. "%!PS" is completely
> sufficient for that purpose, however.
Well, I find the likelihood of someone trying to edit with Emacs the output
of "dvips -i" sufficiently low that it doesn't justify in my eye the use of
a magic-mode-alist entry for it. That's just an opinion. Maybe a better
solution is to make dvips output file names of the form foo.NNN.ps rather
than foo.ps.NNN.
> So I think that "%!PS" _does_ have some usefulness, and it is clearly
> not as overboard as "%!".
We agree that it's a step in the right direction.
Stefan
Reply to: