[Top][All Lists]
[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.
- Re: C file recoginzed as image file, (continued)
- Re: C file recoginzed as image file, Lennart Borgman (gmail), 2007/01/10
- Re: C file recoginzed as image file, Richard Stallman, 2007/01/10
- Re: C file recoginzed as image file, Eli Zaretskii, 2007/01/09
- Re: C file recoginzed as image file, Lennart Borgman (gmail), 2007/01/09
- Re: C file recoginzed as image file, Chris Moore, 2007/01/09
- Re: C file recoginzed as image file, Lennart Borgman (gmail), 2007/01/09
- Re: C file recoginzed as image file, Chris Moore, 2007/01/10
- Re: C file recoginzed as image file, Lennart Borgman (gmail), 2007/01/10
- Re: C file recoginzed as image file, Richard Stallman, 2007/01/09
- Re: C file recoginzed as image file, Lennart Borgman (gmail), 2007/01/09
- Re: C file recoginzed as image file,
Stephen J. Turnbull <=
- Re: C file recoginzed as image file, Juanma Barranquero, 2007/01/08
- Re: C file recoginzed as image file, David Kastrup, 2007/01/08
- Re: C file recoginzed as image file, Juanma Barranquero, 2007/01/08
- Re: C file recoginzed as image file, David Kastrup, 2007/01/08
- Re: C file recoginzed as image file, Juanma Barranquero, 2007/01/08
- Re: C file recoginzed as image file, David Kastrup, 2007/01/09
- Re: C file recoginzed as image file, Juanma Barranquero, 2007/01/09
- Re: C file recoginzed as image file, Chris Moore, 2007/01/09
- Re: C file recoginzed as image file, Juanma Barranquero, 2007/01/09
- Re: C file recoginzed as image file, Stefan Monnier, 2007/01/09