[Top][All Lists]

[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: Sun, 30 Aug 2009 23:54:34 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

>> I agree that running `file' is a simpler solution.
> PLEASE do not base Emacs infrastructure on external programs, unless
> they come with Emacs.

There are many features in Emacs that depend on external programs,
e.g. `ls' for dired, `find' and `grep', `man', `ispell', `shell',
`gdb', `diff', VCS tools, etc.

> `file' is not available on every platform, and even on those it is,

When `libmagic' is available, then usually `file' is available as well
on the same platform.

> the quality and extent of its database is unclear and so cannot be
> relied upon.
> I really don't understand why linking against a simple free library is
> an issue, but if it is, we should find a different solution using some
> database internal to Emacs, as we did until now.

If someone thinks adding the magic number database to Emacs is important,
then fine, let's do it.  But this doesn't preclude from using `file'
since we already have many such pairs of external programs and their
emulations for the case when an external program is not available, e.g.
`ls' and ls-lisp, `grep' and multi-occur, `shell' and eshell, etc.

> In any case, invoking external programs without being smart about
> their non-existence is not something we should have in Emacs.

My patch fails gracefully when `file' is not available, I tried
removing `file' without any problem.  The function just returns nil.

Juri Linkov

reply via email to

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