From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: using libmagic in Emacs? Date: Tue, 18 Aug 2009 23:21:13 -0400 Message-ID: References: <87praszybe.fsf@stupidchicken.com> <838whgik6y.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250652096 743 80.91.229.12 (19 Aug 2009 03:21:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Aug 2009 03:21:36 +0000 (UTC) Cc: cyd@stupidchicken.com, joakim@verona.se, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 19 05:21: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 1Mdbjs-0005AR-B3 for ged-emacs-devel@m.gmane.org; Wed, 19 Aug 2009 05:21:28 +0200 Original-Received: from localhost ([127.0.0.1]:49048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mdbjr-0002Kt-7y for ged-emacs-devel@m.gmane.org; Tue, 18 Aug 2009 23:21:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mdbjm-0002Ke-9u for emacs-devel@gnu.org; Tue, 18 Aug 2009 23:21:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mdbjh-0002KS-Sp for emacs-devel@gnu.org; Tue, 18 Aug 2009 23:21:21 -0400 Original-Received: from [199.232.76.173] (port=37100 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mdbjh-0002KP-MV for emacs-devel@gnu.org; Tue, 18 Aug 2009 23:21:17 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:40722 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mdbjf-000461-BW; Tue, 18 Aug 2009 23:21:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnsFAIUMi0pFpaKZ/2dsb2JhbACBUsVoCJBhgkUIgUwFh08 X-IronPort-AV: E=Sophos;i="4.43,406,1246852800"; d="scan'208";a="43768622" Original-Received: from 69-165-162-153.dsl.teksavvy.com (HELO pastel.home) ([69.165.162.153]) by ironport2-out.teksavvy.com with ESMTP; 18 Aug 2009 23:20:39 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 8827C82F0; Tue, 18 Aug 2009 23:21:13 -0400 (EDT) In-Reply-To: <838whgik6y.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Aug 2009 05:58:13 +0300") 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:114390 Archived-At: >> >>> 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. >> >> I don't expect it to be too intrusive, so I think it can be done on the >> trunk, tho of course, each step needs to be planned with care. > So what is the rule for new features that can be installed on the > trunk at this time? The rule is: anything is possible, but ones that aren't simple and safe need to get confirmation here first. > I thought only relatively minor and safe ones, > but this one seems to break that rule, at least in my book. It looks pretty safe: the first step is to add the Lisp API, which should not impact any other code (tho it may cause temporary build failures, I guess). After that, set-auto-mode (and/or image.el, ...) will need to be tweaked to also take libmagic into account when available. This should also be fairly simple. > If this one is okay, then why not something like bidirectional > editing, for example? I was thinking of bidi for Emacs-24, but if you have code ready for it, and if it's not too intrusive, I'd be willing to consider it. > Maybe we should simply decide right here and now that Emacs 23.2 will > be delivered from the RC branch, and open the trunk for all changes, > even not-so-safe ones? Yes, that's pretty much where we're at, I think, yes. Stefan