From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: using libmagic in Emacs? Date: Mon, 31 Aug 2009 05:49:44 +0300 Message-ID: <83ljl0ae9j.fsf@gnu.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> <874orp58fp.fsf@mail.jurta.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1251687126 20469 80.91.229.12 (31 Aug 2009 02:52:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Aug 2009 02:52:06 +0000 (UTC) Cc: joakim@verona.se, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 31 04:51:58 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 1Mhwzu-0001O2-7u for ged-emacs-devel@m.gmane.org; Mon, 31 Aug 2009 04:51:58 +0200 Original-Received: from localhost ([127.0.0.1]:33278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mhwzt-00042u-NO for ged-emacs-devel@m.gmane.org; Sun, 30 Aug 2009 22:51:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mhwzo-00042c-Dn for emacs-devel@gnu.org; Sun, 30 Aug 2009 22:51:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mhwzm-00042Q-Nl for emacs-devel@gnu.org; Sun, 30 Aug 2009 22:51:51 -0400 Original-Received: from [199.232.76.173] (port=43176 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mhwzm-00042N-Iv for emacs-devel@gnu.org; Sun, 30 Aug 2009 22:51:50 -0400 Original-Received: from mtaout2.012.net.il ([84.95.2.4]:24730) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mhwzm-0001TY-25 for emacs-devel@gnu.org; Sun, 30 Aug 2009 22:51:50 -0400 Original-Received: from conversion-daemon.i_mtaout2.012.net.il by i_mtaout2.012.net.il (HyperSendmail v2004.12) id <0KP700500ZUS6M00@i_mtaout2.012.net.il> for emacs-devel@gnu.org; Mon, 31 Aug 2009 05:51:47 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.144.38]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KP700E02ZYBQ0J0@i_mtaout2.012.net.il>; Mon, 31 Aug 2009 05:51:47 +0300 (IDT) In-reply-to: <874orp58fp.fsf@mail.jurta.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 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:114890 Archived-At: > From: Juri Linkov > Cc: emacs-devel@gnu.org, joakim@verona.se > Date: Sun, 30 Aug 2009 23:54:34 +0300 > > >> 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. I said infrastructure, not features. Of those you mentioned only `ls' is used in infrastructure, and that's precisely why we had to write ls-lisp.el. > > `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. No. libmagic can be bundled and compiled with Emacs. `file' needs to be present. > > 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. And that is graceful how?