[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using libmagic in Emacs?
From: |
Juri Linkov |
Subject: |
Re: using libmagic in Emacs? |
Date: |
Mon, 24 Aug 2009 03:17:18 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) |
> Whatever we do with the function `image-jpeg-p', we could easily make
> Emacs test these two bytes. It makes no sense to install code to link
> with libmagic just to handle that and a few other similar things.
>
> Meanwhile, for operations less common and important than visiting a file,
> running `file' is easy to do.
>
> Combining those two approaches seems much better than adding code to
> link with libmagic.
Of course, before adding code to link with libmagic we should analyze
how useful it would be. I see its usefulness at least in the following
areas:
1. Archive file types
A popular way to create new archive file types nowadays is to register
a new file extension with the old data compression and archive format.
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.
We can't track and add all new formats. This is the main task of libmagic.
2. Image file types
Using ImageMagick in Emacs can support over 100 image file formats.
It won't possible to recognize all them without libmagic.
3. MIME-types handling
Emacs can process different MIME-type detected by libmagic.
Even when Emacs has no special handling for a file type, it is
still useful to let Emacs run an external program associated
with its MIME-type for users who prefer running programs
(including GUI programs) from Emacs instead of using a window
manager's application menu.
--
Juri Linkov
http://www.jurta.org/emacs/
- Bidi support, (continued)
- Bidi support, Stephen J. Turnbull, 2009/08/22
- Re: Bidi support, Eli Zaretskii, 2009/08/22
- Re: Bidi support, Kenichi Handa, 2009/08/23
- Re: Bidi support, Eli Zaretskii, 2009/08/23
- Re: Bidi support, Kenichi Handa, 2009/08/24
- Re: Bidi support, Stephen J. Turnbull, 2009/08/23
Re: using libmagic in Emacs?, Juri Linkov, 2009/08/18
- Re: using libmagic in Emacs?, Richard Stallman, 2009/08/19
- Re: using libmagic in Emacs?, Juri Linkov, 2009/08/22
- Re: using libmagic in Emacs?, Richard Stallman, 2009/08/23
- Re: using libmagic in Emacs?,
Juri Linkov <=
- Re: using libmagic in Emacs?, joakim, 2009/08/24
- Re: using libmagic in Emacs?, Richard Stallman, 2009/08/24
- Re: using libmagic in Emacs?, Miles Bader, 2009/08/24
- Re: using libmagic in Emacs?, joakim, 2009/08/25
- Re: using libmagic in Emacs?, James Cloos, 2009/08/25
- Re: using libmagic in Emacs?, Thien-Thi Nguyen, 2009/08/25
Re: using libmagic in Emacs?, Stefan Monnier, 2009/08/25
Re: using libmagic in Emacs?, Juri Linkov, 2009/08/25
Re: using libmagic in Emacs?, Juri Linkov, 2009/08/29
Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/29