unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: rms@gnu.org
Cc: monnier@IRO.UMontreal.CA, joakim@verona.se, emacs-devel@gnu.org
Subject: Re: using libmagic in Emacs?
Date: Mon, 24 Aug 2009 03:17:18 +0300	[thread overview]
Message-ID: <87my5qngab.fsf@mail.jurta.org> (raw)
In-Reply-To: <E1MfN5i-0006qY-5N@fencepost.gnu.org> (Richard Stallman's message of "Sun, 23 Aug 2009 20:07:18 -0400")

> 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/




  reply	other threads:[~2009-08-24  0:17 UTC|newest]

Thread overview: 119+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-18 18:35 using libmagic in Emacs? joakim
2009-08-18 19:23 ` Stefan Monnier
2009-08-18 20:01   ` Chong Yidong
2009-08-18 20:35     ` joakim
2009-08-18 21:11       ` Stefan Monnier
2009-08-19  2:58         ` Eli Zaretskii
2009-08-19  3:21           ` Stefan Monnier
2009-08-19 13:47             ` Chong Yidong
2009-08-19 15:57               ` joakim
2009-08-19 19:46               ` next bugfix release? [was: Re: using libmagic in Emacs?] Dan Nicolaescu
2009-08-19 21:06                 ` next bugfix release? Chong Yidong
2009-08-19 21:53                   ` Dan Nicolaescu
2009-08-19 22:56                   ` Alan Mackenzie
2009-08-19 23:16                     ` Nick Roberts
2009-08-20  9:02                       ` Lennart Borgman
2009-08-20 11:19                         ` Eric M. Ludlam
2009-08-20 15:13                       ` Alan Mackenzie
2009-08-20 15:47                         ` Lennart Borgman
2009-08-19 19:05             ` installing features on trunk (was: using libmagic in Emacs?) Eli Zaretskii
2009-08-21 18:59               ` Bidi support Stefan Monnier
2009-08-21 20:44                 ` Eli Zaretskii
2009-08-22  3:39                   ` Stefan Monnier
2009-08-22  8:18                   ` Jason Rumney
2009-08-22  5:39                 ` Stephen J. Turnbull
2009-08-22  7:31                   ` Eli Zaretskii
2009-08-24  1:45                   ` Kenichi Handa
2009-08-24  3:12                     ` Eli Zaretskii
2009-08-24  7:17                       ` Kenichi Handa
2009-08-24  3:25                     ` Stephen J. Turnbull
2009-08-19  0:57   ` using libmagic in Emacs? Juri Linkov
2009-08-20  3:42     ` Richard Stallman
2009-08-22 23:36       ` Juri Linkov
2009-08-24  0:07         ` Richard Stallman
2009-08-24  0:17           ` Juri Linkov [this message]
2009-08-24  7:33             ` joakim
2009-08-25  2:08             ` Richard Stallman
2009-08-25  2:19               ` Miles Bader
2009-08-25  5:09                 ` joakim
2009-08-25 13:27                 ` James Cloos
2009-08-25 21:41                 ` Thien-Thi Nguyen
2009-08-25 17:36               ` Stefan Monnier
2009-08-25 20:37               ` Juri Linkov
2009-08-29 23:19               ` Juri Linkov
2009-08-30  3:09                 ` Eli Zaretskii
2009-08-30 20:54                   ` Juri Linkov
2009-08-31  2:49                     ` Eli Zaretskii
2009-08-31 16:17                       ` Juri Linkov
2009-08-31 17:58                         ` Eli Zaretskii
2009-09-01 12:16                           ` Richard Stallman
2009-09-01 16:12                             ` Stefan Monnier
2009-09-01 21:20                               ` Richard Stallman
2009-09-03 19:42                                 ` Stefan Monnier
2009-09-04  7:52                                   ` Richard Stallman
2009-08-31 22:21                       ` Richard Stallman
2009-08-31  3:33                   ` Richard Stallman
2009-08-31 15:03                     ` Chong Yidong
2009-08-31 16:19                       ` Juri Linkov
2009-08-31 23:47                       ` Stefan Monnier
2009-09-01  3:16                         ` Eli Zaretskii
2009-09-01  5:37                           ` Stefan Monnier
2009-09-01 12:16                       ` Richard Stallman
2009-08-25 20:36           ` Juri Linkov
2009-08-19 22:49   ` joakim
2009-08-19 23:20     ` Dan Nicolaescu
2009-08-20  1:03     ` Stephen J. Turnbull
2009-08-20  3:12       ` Eli Zaretskii
2009-08-20  4:50         ` Stephen J. Turnbull
2009-08-20 18:20           ` Eli Zaretskii
2009-08-21  0:19             ` Stephen J. Turnbull
2009-08-20 18:32         ` Richard Stallman
2009-08-21 19:10           ` Stefan Monnier
2009-08-22  5:03             ` Stephen J. Turnbull
2009-08-23  1:03               ` Stefan Monnier
2009-08-20 13:57     ` Stefan Monnier
2009-08-20 19:19       ` joakim
2009-08-20 22:08         ` Andreas Schwab
2009-08-21  9:55           ` joakim
2009-08-21 11:01             ` Eli Zaretskii
2009-08-21 17:38               ` joakim
2009-08-21 17:46                 ` Rupert Swarbrick
2009-08-21 18:31                 ` Andreas Schwab
2009-08-21 19:13                   ` Drew Adams
2009-08-21 18:42                 ` Eli Zaretskii
2009-08-21 21:48                   ` joakim
2009-08-21 22:46                     ` Andreas Schwab
2009-08-22 20:18                       ` joakim
2009-08-22 23:13                         ` Ken Raeburn
2009-08-23 23:38                           ` joakim
2009-08-24  3:05                             ` Eli Zaretskii
2009-08-24 12:30                               ` joakim
2009-08-23  3:24                         ` Eli Zaretskii
2009-08-21 19:18               ` Stefan Monnier
2009-08-21 13:19             ` Andreas Schwab
2009-08-20 18:32     ` Richard Stallman
2009-08-20 20:27       ` Reiner Steib
2009-08-21 14:08         ` Richard Stallman
2009-08-21 19:16       ` Stefan Monnier
2009-08-28  0:27 ` Language identification (was: using libmagic in Emacs) Juri Linkov
2009-08-28  4:58   ` Language identification Stefan Monnier
2009-08-28  9:00     ` Stephen J. Turnbull
2009-08-28 14:56       ` Stefan Monnier
2009-08-29  4:11         ` Stephen J. Turnbull
2009-08-29 14:21           ` Chong Yidong
2009-08-29  0:46       ` Richard Stallman
2009-08-29  4:13         ` Stephen J. Turnbull
2009-08-29 15:28           ` Stefan Monnier
2009-08-29 16:27             ` Stephen J. Turnbull
2009-08-28 19:16     ` Juri Linkov
2009-08-29  1:12       ` Stefan Monnier
2009-08-30 16:01         ` Richard Stallman
2009-08-29 20:20       ` Richard Stallman
2009-08-29 22:48         ` Juri Linkov
2009-08-31  3:32           ` Richard Stallman
2009-08-31  8:42             ` David Kastrup
2009-08-31  8:59             ` Jan D.
2009-08-31  3:33           ` Richard Stallman
2009-08-28  6:45   ` Alex Ott
2009-08-28  6:46   ` Alex Ott
2009-08-28 19:08     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87my5qngab.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).