From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: using libmagic in Emacs? Date: Tue, 18 Aug 2009 16:01:09 -0400 Message-ID: <87praszybe.fsf@stupidchicken.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250625696 1894 80.91.229.12 (18 Aug 2009 20:01:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Aug 2009 20:01:36 +0000 (UTC) Cc: joakim@verona.se, Emacs Development To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 18 22:01:28 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 1MdUs2-0000OS-IY for ged-emacs-devel@m.gmane.org; Tue, 18 Aug 2009 22:01:26 +0200 Original-Received: from localhost ([127.0.0.1]:59593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdUs2-0004nV-1W for ged-emacs-devel@m.gmane.org; Tue, 18 Aug 2009 16:01:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdUrt-0004g2-D4 for emacs-devel@gnu.org; Tue, 18 Aug 2009 16:01:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdUro-0004cb-4h for emacs-devel@gnu.org; Tue, 18 Aug 2009 16:01:16 -0400 Original-Received: from [199.232.76.173] (port=37555 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdUrn-0004cU-Vx for emacs-devel@gnu.org; Tue, 18 Aug 2009 16:01:12 -0400 Original-Received: from pantheon-po41.its.yale.edu ([130.132.50.98]:55647) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MdUrn-0002Fr-Is for emacs-devel@gnu.org; Tue, 18 Aug 2009 16:01:11 -0400 Original-Received: from furry (dhcp128036014244.central.yale.edu [128.36.14.244]) (authenticated bits=0) by pantheon-po41.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n7IK19lK021146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 18 Aug 2009 16:01:09 -0400 Original-Received: by furry (Postfix, from userid 1000) id 6F0F3C070; Tue, 18 Aug 2009 16:01:09 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Tue, 18 Aug 2009 15:23:06 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 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:114383 Archived-At: Stefan Monnier writes: >> Would there be interest in an Emacs patch for libmagic, or is there some >> obvious reason this havent been done yet? I envision this as being an >> inteface with 2 implementations, a lisp fallback like today, and >> libmagic if available. I did a libmagick wrapper for Ocaml using Swig >> before so I have some familiarity with the API. > > 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. This development would probably have to take place in a separate branch.