[Top][All Lists]

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

Re: using libmagic in Emacs?

From: Miles Bader
Subject: Re: using libmagic in Emacs?
Date: Tue, 25 Aug 2009 11:19:37 +0900

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

   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)



reply via email to

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