From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric M. Ludlam" Newsgroups: gmane.emacs.devel Subject: Re[2]: Multiple major modes Date: Tue, 12 Jun 2007 16:14:20 -0400 Message-ID: <200706122014.l5CKEKV1021902@projectile.siege-engine.com> References: <466E7A93.3050705@gmail.com> <466E81AA.3030202@gnu.org> <466E9822.2050508@gmail.com> <466EAB9D.9020408@gnu.org> <466EEA71.2070700@gmail.com> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1181681918 9603 80.91.229.12 (12 Jun 2007 20:58:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Jun 2007 20:58:38 +0000 (UTC) Cc: sdl.web@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, jasonr@gnu.org To: "Lennart Borgman (gmail)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 12 22:58:35 2007 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 1HyDRe-00032C-OX for ged-emacs-devel@m.gmane.org; Tue, 12 Jun 2007 22:58:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyDRe-0006lo-79 for ged-emacs-devel@m.gmane.org; Tue, 12 Jun 2007 16:58:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HyCkz-0001rj-Ie for emacs-devel@gnu.org; Tue, 12 Jun 2007 16:14:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HyCky-0001pI-Hi for emacs-devel@gnu.org; Tue, 12 Jun 2007 16:14:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyCky-0001op-C6 for emacs-devel@gnu.org; Tue, 12 Jun 2007 16:14:24 -0400 Original-Received: from static-71-184-83-10.bstnma.fios.verizon.net ([71.184.83.10] helo=projectile.siege-engine.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HyCkx-0000Bt-3w; Tue, 12 Jun 2007 16:14:23 -0400 Original-Received: from projectile.siege-engine.com (localhost.localdomain [127.0.0.1]) by projectile.siege-engine.com (8.12.8/8.12.8) with ESMTP id l5CKEKYE021906; Tue, 12 Jun 2007 16:14:20 -0400 Original-Received: (from zappo@localhost) by projectile.siege-engine.com (8.12.8/8.12.8/Submit) id l5CKEKV1021902; Tue, 12 Jun 2007 16:14:20 -0400 In-reply-to: <466EEA71.2070700@gmail.com> (lennart.borgman@gmail.com) X-detected-kernel: Linux 2.4-2.6 X-Mailman-Approved-At: Tue, 12 Jun 2007 16:58:27 -0400 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:72712 Archived-At: [ ... ] >>> "Lennart Borgman (gmail)" seems to think that: >Stefan Monnier wrote: >>> and something that should be addressed without imposing restrictions on >>> specialized major modes. >> >> Actually, I think that in order to address it well, we will need to impose >> restrictions on major modes (though only on the ones involved in >> multiple-major-mode buffers) and maybe also on minor modes. My parsing tool (semantic, referenced earlier) solved some problems w/ lots of mode-specific configurations via 'mode-local' variables and methods. David Ponce wrote this, and suggested it here once before. I don't recall what the end resolution was on it. A multi-mode style thing would likely be simplified if key behaviors were all defined via mode-local configurations, as that would allow the multi-mode manager to get a complete query list of all configuration differences without running the major-mode function. http://cedet.cvs.sourceforge.net/cedet/cedet/common/mode-local.el?view=log This tools has a spiff macro `with-mode-local', which lets you run a bunch of code as if some other mode were active. This is used in our grammar file so we can operate on grammar syntax w/ lisp syntax mixed in. We can also operate on tags from other buffers by momentarily using features of the originating major-mode. Enjoy Eric >I think so to. I have seen some areas where some form of coherence is >necessary: > >- fontification >- indentation >- parsing > >I think nxml-mode is a very good candidate for those that can be used in >a multiple-major-mode buffers, since a mix of for example XHTML and PHP >is common. > >This might seem impossible, since such code could not be valid XHTML. >Actually it is not, the rng parser used in nxhtml-mode is quite good on >guessing an apropriate state for completion. (But do not ask me what the >rng parser does, I do not understand it.) > -- Eric Ludlam: zappo@gnu.org, eric@siege-engine.com Home: http://www.ludlam.net Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net GNU: www.gnu.org