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: Mon, 24 Aug 2009 09:33:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Juri Linkov <address@hidden> writes:
>
> 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
...
>
> 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.

I agree completely with Juri, it is these two cases that motivates me to
work on the libmagic support.

There are a great deal of formats Emacs is able to open, but not to
recognize, such as all the many different Java archive formats Juri
mentions. There are compressed image formats like SVG. 

Also, if we decide to merge the imagemagick patch, hundreds of new
image file formats will be supported, that libmagic will help identify.

Notice that I do not propose to replace Emacs current file recognition,
only to expand it when libmagic is available. We can also expand a bit
of the current handling to take care of a few well known cases, such as
the jpeg one. If no libmagic, then Emacs will behave as today, or
slightly better. If libmagic, many new file formats will open
correctly.

I honestly cant see any drawbacks with this aproach, other than me
consuming some list resources while developing the patch. I hope to be
able to reciprocate with improved documentation for developing Emacs
primitives.

Lets also not forget the friendly competition from other free text
editors. Emacs IMHO does the right thing with files more often than
other editors, lets improve on this strength!


--
Joakim Verona




reply via email to

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