Re: double-click on scripts behaviour

On Thu, 2004-04-29 at 04:38, Christophe Fergeau wrote:
> Hi,
> Because of the switch to shared mime info, when the user double clicks
> on an executable shell (or python, or perl) script, the dialog asking
> whether the user wants to edit it, or run it is no longer displayed.
> This happens because nautilus displays this dialog when it encounters a
> text/xxx executable file, but in the shared mime database, most scripts
> have an application/xxx mime type.
> The attached patch special cases the various scripts mime types I could
> find so that the dialog properly appears, but I'm not sure hard coding
> these mime types in nautilus is the best way to do that. Maybe the
> various scripts should be moved from application/xxx to test/xxx in the
> shared mime database (incidentally, there's already a text/x-ksh for ksh
> scripts, this should be made consistent with the other scripts mime
> types somehow).
> Thoughts?
> Christophe

This highlights one of my major problems with the current MIME database
(something that I'll get around to discussing on that list one of these
days): many documents can/should have multiple MIME types.  These MIME
types are frequently hierarchical in nature, e.g. an SVG image has the
registered "most specific" MIME type of image/svg+xml, however
application/xml and arguably text/xml both also apply.  RFC 3023
addresses this specific issue by using the magic '+xml' suffix and
declares that XML is the first 'generic format' that requires this
special treatment.  That is absolutely incorrect.  I can think of one
other format that is used in a similar fashion: zip.  At the moment Java
archives ('.jar') and documents ('.sxi', etc.) are both
zip files with a prescribed structure.  Should their MIME types be
application/x-oowriter+zip? More (potentially) controversial are
applications like AbiWord that support gzipped file formats (.abw or
.abwz files).  Is one file format application/x-abiword+xml and the
other application/x-abiword+gz? AbiWord is capable of opening both, but
it isn't capable of opening a generic gzip.

Currently, the 'sniffed' MIME type is the definitive one and is also
likely to be the incorrect one.  Sniffing a .abwz file tells us it's a
gzip, just like a .tar.gz, however AbiWord cannot open tarballs and File
Roller has no idea what to do with an AbiWord document (well, it can
decompress it, but that's not likely what you wanted to do with it).

My first reaction to your post was to say that the use of 'application/'
was misplaced, however, doing a little research seems to indicate that
it is indeed correct, but at the same time, very broken.  All of a
sudden the text editor I've registered to handle text/* must be
associated with every single programming language I use because the
scripts are considered 'applications' rather than 'text'.  That's absurd
and yet, apparently, correct.
Shahms King <shahms shahms com>

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