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: antlr-mode.el - need some support by python.el Date: Tue, 17 Feb 2015 19:00:59 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424217704 8353 80.91.229.3 (18 Feb 2015 00:01:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2015 00:01:44 +0000 (UTC) Cc: "=?windows-1252?Q?Fabi?= =?windows-1252?Q?=E1n?= E.Gallina" , "emacs-devel@gnu.org" To: "Wedler\, Christoph" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 18 01:01:35 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YNs58-00036r-Uj for ged-emacs-devel@m.gmane.org; Wed, 18 Feb 2015 01:01:35 +0100 Original-Received: from localhost ([::1]:47842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNs58-0002mR-H1 for ged-emacs-devel@m.gmane.org; Tue, 17 Feb 2015 19:01:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNs4v-0002mM-7e for emacs-devel@gnu.org; Tue, 17 Feb 2015 19:01:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNs4s-0003zl-1G for emacs-devel@gnu.org; Tue, 17 Feb 2015 19:01:21 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:46682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNs4r-0003zZ-Ty for emacs-devel@gnu.org; Tue, 17 Feb 2015 19:01:17 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlgJAPOG1lRMCpq3/2dsb2JhbABbgwaDX8Y4BAICgQ1EAQEBAQEBfIQNAQQBViMFCws0EhQYDSSIOAjOIwEBAQcBAQEBHo94B4QqBYonjziOGoF5gUUihAwggTMkgRwBAQE X-IPAS-Result: AlgJAPOG1lRMCpq3/2dsb2JhbABbgwaDX8Y4BAICgQ1EAQEBAQEBfIQNAQQBViMFCws0EhQYDSSIOAjOIwEBAQcBAQEBHo94B4QqBYonjziOGoF5gUUihAwggTMkgRwBAQE X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="110762096" Original-Received: from 76-10-154-183.dsl.teksavvy.com (HELO pastel.home) ([76.10.154.183]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Feb 2015 19:01:16 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 566CD3462; Tue, 17 Feb 2015 19:00:59 -0500 (EST) In-Reply-To: (Christoph Wedler's message of "Tue, 17 Feb 2015 10:55:54 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183218 Archived-At: > This is exactly the difference between 5 (yours) and 4 (mine) below I think we're misunderstanding each other. > Actually not. In both cases, the submode provides the code. > In 4, the sub mode provides a function to compute the initial parse > state given the string / chunks. It can do that quite simply by > inserting it/them into a temporary buffer and using a function which > computes the syntactic context at the end of that buffer - most major > mode already have such a function. In other words: the effort for the > submode is small. IIUC you're suggesting that the submode provides a function "get-state" to the outer mode, and the outer mode calls this "get-state" with some "previous-chunk-descriptor" (either buffer positions or a string) on the previous chunk and then passes the result to the submode. > In 5, they follow your idea: [...] > To me, that seems to be more work. The only difference is that the submode doesn't provide "get-state" to the outer mode, instead the outer mode provides the "previous-chunk-descriptor" and the submode calls "get-state" on it if it wants to. > Performance-wise, this could be better in the literate programming use > case, but not in my use case. I think the two are pretty much identical. >> In any case your patch looks good, feel free to install it. > If I might come back to your offer from last month (concerning > antlr-mode.el, actually) - it would be excellent if you could apply the > prog-mode.el.patch to the Emacs repository... OK, will do, Stefan