From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: using libmagic in Emacs? Date: Tue, 18 Aug 2009 20:35:14 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250620614 17370 80.91.229.12 (18 Aug 2009 18:36:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Aug 2009 18:36:54 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 18 20:36:47 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 1MdTX4-0002pO-Hp for ged-emacs-devel@m.gmane.org; Tue, 18 Aug 2009 20:35:42 +0200 Original-Received: from localhost ([127.0.0.1]:46310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdTX3-0007OA-G0 for ged-emacs-devel@m.gmane.org; Tue, 18 Aug 2009 14:35:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdTWw-0007Nf-Rd for emacs-devel@gnu.org; Tue, 18 Aug 2009 14:35:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdTWr-0007Ka-5f for emacs-devel@gnu.org; Tue, 18 Aug 2009 14:35:33 -0400 Original-Received: from [199.232.76.173] (port=58363 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdTWr-0007KX-1b for emacs-devel@gnu.org; Tue, 18 Aug 2009 14:35:29 -0400 Original-Received: from proxy1.bredband.net ([195.54.101.71]:48536) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MdTWq-0004po-Ku for emacs-devel@gnu.org; Tue, 18 Aug 2009 14:35:28 -0400 Original-Received: from iph1.telenor.se (195.54.127.132) by proxy1.bredband.net (7.3.140.3) id 49F5A15202D01E0E for emacs-devel@gnu.org; Tue, 18 Aug 2009 20:35:25 +0200 X-SMTPAUTH-B2: joakvero X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsVkAKuRikpT44qWPGdsb2JhbACKFpBqAQEBATe9b4QZBYIq X-IronPort-AV: E=Sophos;i="4.43,403,1246831200"; d="scan'208";a="37400364" Original-Received: from ua-83-227-138-150.cust.bredbandsbolaget.se (HELO exodia) ([83.227.138.150]) by iph1.telenor.se with ESMTP; 18 Aug 2009 20:35:25 +0200 Original-Received: from localhost.localdomain (DIR-655.lan [192.168.200.113]) (authenticated bits=0) by exodia (8.14.3/8.14.3) with ESMTP id n7IIZNDe032733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 18 Aug 2009 20:35:24 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:114377 Archived-At: (This is probably a FAQ but my google skills seem to fail me) There are some operations in Emacs which tries to do the same thing as the "libmagic" library, which is the core of the "file" utility, does. For instance, in "image.el" there is functionality to look at magic numbers in image files. Also, I often whish that files would open in Emacs with correct mode more often when there is no file extension. 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. -- Joakim Verona