emacs-devel
[Top][All Lists]
Advanced

[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: Wed, 19 Aug 2009 03:57:21 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

>> There are some operations in Emacs which tries to do the same thing as
>> the "libmagic" library, which is the core of the "file" utility, does.
>>
>> For instance, in "image.el" there is functionality to look at magic
>> numbers in image files.

image.el doesn't recognize some rare JPEG formats, so libmagic will be
useful here.

>> Also, I often whish that files would open in Emacs with correct mode
>> more often when there is no file extension.

libmagick could supplement `magic-mode-alist' and `magic-fallback-mode-alist'.

> I think it's a good idea.  It may require some non-trivial changes on
> the Lisp side, since libmagic's information is not quite the same as
> what Emacs currently uses: we'll probably want to use libmagic to get
> a MIME-type and then have a table mapping mime-types to major modes or
> some such.

gnus/mailcap.el contains a table mapping MIME-types to major modes.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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