emacs-devel
[Top][All Lists]
Advanced

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

Re: using libmagic in Emacs?


From: joakim
Subject: Re: using libmagic in Emacs?
Date: Tue, 25 Aug 2009 07:09:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Miles Bader <address@hidden> writes:

> Richard Stallman <address@hidden> writes:
>> 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'.
>
> Well, not entirely trivial of course, since Emacs then needs to
> interpret the results from the file command.
>
>> To complicate Emacs with another library just to make that operation
>> a little faster is a step in the wrong direction.
>
> I wonder how hard it would be to have some elisp that understands the
> "magic" rules that the file command uses... at first glance, they don't
> seem particularly complex; e.g., this is the first entry from
> "/usr/share/file/magic":
>
>    0  lelong          0xc3cbc6c5      RISC OS Chunk data
>    >12        string          OBJ_            \b, AOF object
>    >12        string          LIB_            \b, ALF library
>
> If there was such elisp code, Emacs could use any magic rules file on
> the system, and in addition, could distribute it's own (perhaps smaller)
> set.

I agree that the main benefit of using libmagic is getting access to the
libmagic database. 

> -Miles
-- 
Joakim Verona




reply via email to

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