From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: using libmagic in Emacs? Date: Tue, 25 Aug 2009 23:41:24 +0200 Message-ID: <8763cbo9kr.fsf@ambire.localdomain> References: <87ocqco7fi.fsf@mail.jurta.org> <87y6pb8lqh.fsf@mail.jurta.org> <87my5qngab.fsf@mail.jurta.org> <87r5v0prd2.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251236906 21028 80.91.229.12 (25 Aug 2009 21:48:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Aug 2009 21:48:26 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 25 23:48:19 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 1Mg3sI-0003Ei-Tw for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2009 23:48:19 +0200 Original-Received: from localhost ([127.0.0.1]:37332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg3sH-0006nu-KP for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2009 17:48:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mg3sE-0006no-1D for emacs-devel@gnu.org; Tue, 25 Aug 2009 17:48:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mg3sC-0006nc-Bv for emacs-devel@gnu.org; Tue, 25 Aug 2009 17:48:12 -0400 Original-Received: from [199.232.76.173] (port=49466 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg3sC-0006nZ-6e for emacs-devel@gnu.org; Tue, 25 Aug 2009 17:48:12 -0400 Original-Received: from smtp-out112.alice.it ([85.37.17.112]:3435) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mg3sB-00076v-Nm for emacs-devel@gnu.org; Tue, 25 Aug 2009 17:48:11 -0400 Original-Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-out112.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Tue, 25 Aug 2009 23:48:09 +0200 Original-Received: from FBCMCL01B06.fbc.local ([192.168.69.87]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Tue, 25 Aug 2009 23:48:09 +0200 Original-Received: from ambire.localdomain ([79.40.68.19]) by FBCMCL01B06.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Tue, 25 Aug 2009 23:48:08 +0200 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1Mg3lc-0006VT-Jj for emacs-devel@gnu.org; Tue, 25 Aug 2009 23:41:24 +0200 In-Reply-To: <87r5v0prd2.fsf@catnip.gol.com> (Miles Bader's message of "Tue, 25 Aug 2009 11:19:37 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-OriginalArrivalTime: 25 Aug 2009 21:48:08.0209 (UTC) FILETIME=[BBC28010:01CA25CD] X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ 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:114598 Archived-At: () Miles Bader () Tue, 25 Aug 2009 11:19:37 +0900 If there was such elisp code, Emacs could use any magic rules file on the system, and in addition, could distribute it's own (perhaps smaller) set. Some proof-of-concept grade Scheme code that (re)processes the magic rules format into sexps, and also does the non-char-encoding side of file(1) is at [0]. Converted rules (v1, v2) are at [1]. (Aside) I think the best candidate for libfoo integration with Emacs would be libguile. In contrast, when i read of other libfoo proposals, i can't help but feel somewhat deflated. thi _______________________________________________ [0] http://www.gnuvola.org/software/ttn-do/ (see file magic.scm in the tarball) [1] http://www.gnuvola.org/data/index.html (see entry "de-uglified magic file")