From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: using libmagic in Emacs? Date: Sun, 30 Aug 2009 23:54:34 +0300 Organization: JURTA Message-ID: <874orp58fp.fsf@mail.jurta.org> References: <87ocqco7fi.fsf@mail.jurta.org> <87y6pb8lqh.fsf@mail.jurta.org> <87my5qngab.fsf@mail.jurta.org> <87eiquuq7j.fsf@mail.jurta.org> <83vdk69evw.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251666078 10897 80.91.229.12 (30 Aug 2009 21:01:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Aug 2009 21:01:18 +0000 (UTC) Cc: joakim@verona.se, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 30 23:01:11 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MhrWQ-0000jZ-Il for ged-emacs-devel@m.gmane.org; Sun, 30 Aug 2009 23:01:10 +0200 Original-Received: from localhost ([127.0.0.1]:44242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhrWP-0006p4-Pm for ged-emacs-devel@m.gmane.org; Sun, 30 Aug 2009 17:01:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MhrUo-0005sT-A5 for emacs-devel@gnu.org; Sun, 30 Aug 2009 16:59:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MhrUk-0005rt-Tw for emacs-devel@gnu.org; Sun, 30 Aug 2009 16:59:30 -0400 Original-Received: from [199.232.76.173] (port=46331 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhrUk-0005rq-OM for emacs-devel@gnu.org; Sun, 30 Aug 2009 16:59:26 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:33010 helo=mx2.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MhrUh-0000l7-Ok; Sun, 30 Aug 2009 16:59:23 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.28.7.cable.starman.ee [82.131.28.7]) by mx2.starman.ee (Postfix) with ESMTP id 9717C3F41DA; Sun, 30 Aug 2009 23:59:17 +0300 (EEST) In-Reply-To: <83vdk69evw.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 30 Aug 2009 06:09:23 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114885 Archived-At: >> 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 http://www.jurta.org/emacs/