[Top][All Lists]

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

Re: using libmagic in Emacs?

From: Richard Stallman
Subject: Re: using libmagic in Emacs?
Date: Mon, 24 Aug 2009 22:08:02 -0400

    For instance, Java archive files have the .jar extension but build on
    the ZIP file format, so they can be visited in Emacs with the help of
    `archive-mode'.  Enterprise Java archives with the .ear extension
    and Web application Java archives with the .war extension all are
    based on the ZIP file format as well as OpenDocument files with
    extensions .odt .ods .odb .odp .odg .odf, Firefox add-ons (.xpi),
    Keyhole Markup (.kmz), and many other file types that can be potentially
    opened in Emacs if were identified as archive files by libmagic.

How hard would it be to change the code in Emacs to recognize these
using the existing mechanism?

    Using ImageMagick in Emacs can support over 100 image file formats.
    It won't possible to recognize all them without libmagic.

Maybe this is useful.  Is there an easy way to recognize files that
could be passed to ImageMagick?

    Emacs can process different MIME-type detected by libmagic.

That is not useful for visiting files in Emacs, since Emacs has no
special handling for many of these mime types.

If some other Lisp code is interested in the mime type of a file,
there is a much easier way to find it out: run `file'.
To complicate Emacs with another library just to make that operation
a little faster is a step in the wrong direction.

reply via email to

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