emacs-devel
[Top][All Lists]
Advanced

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

Re: C file recoginzed as image file


From: Stephen J. Turnbull
Subject: Re: C file recoginzed as image file
Date: Tue, 09 Jan 2007 02:09:25 +0900

Stefan Monnier writes:

 > If the intersection of the two sets is a singleton, then use that
 > major-mode,

Hear, hear!  Suggestion: s/two/N/.

There may be metadata available (eg, from url.el).

 > otherwise query the user to decide whether to believe the file name
 > or the contents.

If the contents look like OGG to Emacs's heuristic, I doubt libpng or
ImageMagick will take the user's word that it's PNG.

In general, I think that users would prefer information from metadata,
then file names, then contents.  So I suggest that (1) if there's
metadata giving a MIME type, for example, then display using that type
if all available heuristics agree (in the sense of a singleton
intersection), otherwise warn the user and suggest one or more
commands that can be used to force a codec compatible with the
content; (2) else if the file extension heuristic is available, then
display using that type if all available heuristics agree, otherwise
warn and suggest; (3) else use the contents.

YMMV, so if you think a different order of precedence is appropriate,
you can amend the algorithm in the obvious way.





reply via email to

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