[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using libmagic in Emacs?
From: |
Stefan Monnier |
Subject: |
Re: using libmagic in Emacs? |
Date: |
Thu, 20 Aug 2009 09:57:41 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
>> 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.
> I attach an early draft filemagic patch.
> Some notes:
> - The mime type info usualy is less granular than the free
> text info:
We can provide both. I think we'd want 2 functions: one to get the free
text info, which just returns a string (or nil), and another to get the
MIME info, which returns a cons, whose car is a symbol such as
application/octet-stream, and whose cdr is an alist representing
the additional optional info.
> file --mime /tmp/tst.xcf
> /tmp/tst.xcf: application/octet-stream; charset=binary
This would look like (application/octet-stream (charset . "binary"))
A few more comments:
- please follow the GNU coding convention. I.e. put spaces where
they need to be (e.g. around parens and operators).
- don't bother with a new file. Just put it into fileio.c.
- as someone else mentioned, CPP macros in the Makefile.in are things
we'd like to get rid of, so please don't put more of them there.
Use autoconf's m4 macros instead, thank you.
Stefan
- Re: using libmagic in Emacs?, (continued)
- Re: using libmagic in Emacs?, Dan Nicolaescu, 2009/08/19
- Re: using libmagic in Emacs?, Stephen J. Turnbull, 2009/08/19
- Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/19
- Re: using libmagic in Emacs?, Stephen J. Turnbull, 2009/08/20
- Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/20
- Re: using libmagic in Emacs?, Stephen J. Turnbull, 2009/08/20
- Re: using libmagic in Emacs?, Richard Stallman, 2009/08/20
- Re: using libmagic in Emacs?, Stefan Monnier, 2009/08/21
- Re: using libmagic in Emacs?, Stephen J. Turnbull, 2009/08/22
- Re: using libmagic in Emacs?, Stefan Monnier, 2009/08/22
- Re: using libmagic in Emacs?,
Stefan Monnier <=
- Re: using libmagic in Emacs?, joakim, 2009/08/20
- Re: using libmagic in Emacs?, Andreas Schwab, 2009/08/20
- Re: using libmagic in Emacs?, joakim, 2009/08/21
- Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/21
- Re: using libmagic in Emacs?, joakim, 2009/08/21
- Re: using libmagic in Emacs?, Rupert Swarbrick, 2009/08/21
- Re: using libmagic in Emacs?, Andreas Schwab, 2009/08/21
- RE: using libmagic in Emacs?, Drew Adams, 2009/08/21
- Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/21
- Re: using libmagic in Emacs?, joakim, 2009/08/21