From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: using libmagic in Emacs? Date: Mon, 24 Aug 2009 22:08:02 -0400 Message-ID: References: <87ocqco7fi.fsf@mail.jurta.org> <87y6pb8lqh.fsf@mail.jurta.org> <87my5qngab.fsf@mail.jurta.org> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1251166101 7014 80.91.229.12 (25 Aug 2009 02:08:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Aug 2009 02:08:21 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, joakim@verona.se, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 25 04:08:13 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 1MflSG-0004HE-OJ for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2009 04:08:13 +0200 Original-Received: from localhost ([127.0.0.1]:38270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MflSG-0002sn-7n for ged-emacs-devel@m.gmane.org; Mon, 24 Aug 2009 22:08:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MflSC-0002s3-Nu for emacs-devel@gnu.org; Mon, 24 Aug 2009 22:08:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MflS8-0002rD-71 for emacs-devel@gnu.org; Mon, 24 Aug 2009 22:08:08 -0400 Original-Received: from [199.232.76.173] (port=37438 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MflS8-0002rA-33 for emacs-devel@gnu.org; Mon, 24 Aug 2009 22:08:04 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:34802) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MflS7-0001iG-H9 for emacs-devel@gnu.org; Mon, 24 Aug 2009 22:08:03 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MflS6-0004Ky-JY; Mon, 24 Aug 2009 22:08:02 -0400 In-reply-to: <87my5qngab.fsf@mail.jurta.org> (message from Juri Linkov on Mon, 24 Aug 2009 03:17:18 +0300) 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:114570 Archived-At: For instance, Java archive files have the .jar extension but build on the ZIP file format, so they can be visited in Emacs with the help of `archive-mode'. Enterprise Java archives with the .ear extension and Web application Java archives with the .war extension all are based on the ZIP file format as well as OpenDocument files with extensions .odt .ods .odb .odp .odg .odf, Firefox add-ons (.xpi), Keyhole Markup (.kmz), and many other file types that can be potentially opened in Emacs if were identified as archive files by libmagic. How hard would it be to change the code in Emacs to recognize these using the existing mechanism? Using ImageMagick in Emacs can support over 100 image file formats. It won't possible to recognize all them without libmagic. Maybe this is useful. Is there an easy way to recognize files that could be passed to ImageMagick? Emacs can process different MIME-type detected by libmagic. That is not useful for visiting files in Emacs, since Emacs has no special handling for many of these mime types. If some other Lisp code is interested in the mime type of a file, there is a much easier way to find it out: run `file'. To complicate Emacs with another library just to make that operation a little faster is a step in the wrong direction.