From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: PHP mode and mmm-mode Date: Tue, 02 May 2006 10:10:51 +0200 Message-ID: <4457140B.1050205@gmx.at> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1146557682 9144 80.91.229.2 (2 May 2006 08:14:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 May 2006 08:14:42 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 02 10:14:40 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Faq1l-0005Q3-AY for ged-emacs-devel@m.gmane.org; Tue, 02 May 2006 10:14:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Faq1k-0002Df-NU for ged-emacs-devel@m.gmane.org; Tue, 02 May 2006 04:14:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Faq1Y-0002Cm-1J for emacs-devel@gnu.org; Tue, 02 May 2006 04:14:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Faq1W-0002Ca-G4 for emacs-devel@gnu.org; Tue, 02 May 2006 04:14:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Faq1W-0002CX-BN for emacs-devel@gnu.org; Tue, 02 May 2006 04:14:22 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1Faq1d-0003uK-6P for emacs-devel@gnu.org; Tue, 02 May 2006 04:14:29 -0400 Original-Received: (qmail invoked by alias); 02 May 2006 08:14:20 -0000 Original-Received: from N886P016.adsl.highway.telekom.at (EHLO [62.47.54.176]) [62.47.54.176] by mail.gmx.net (mp005) with SMTP; 02 May 2006 10:14:20 +0200 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: Michael Shulman In-Reply-To: X-Y-GMX-Trusted: 0 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:53769 Archived-At: The most simple approach would be to mark regions reserved for "other" modes by turning them into generic strings. Usually, major modes don't touch strings during indentation, font-lock colors them uniformly, parse-partial-sexp and syntax-ppss handle them. Hence there wouldn't have to be done too much to implement this - point-entered/-left hooks to switch to the appropriate mode and set the appropriate syntax-table properties. Obviously, a region reserved for a particular mode had to maintain point-entered/-left properties appropriately - likely the more expensive overhead involved. With foo-mode active, bar-mode and baz-mode would be barred off as foo-mode |bar-mode| foo-mode |baz-mode bar-mode| where text between two matching bars is a generic string. Entering bar-mode text would require to reinstall syntax-table text properties |foo-mode| bar-mode |foo-mode baz-mode| bar-mode and peform a redisplay. Things like `indent-buffer' in foo-mode would use `inhibit-point-motion-hooks' to avoid switching to another mode intermittently. In any case, the original philosophy that "each buffer has only one major mode at a time" would remain intact. AFAICT only three major modes - cc-awk, cperl, and perl - currently use generic strings for their purposes. Whether and how to accomodate them is beyond my comprehension. Just an idea - with blatant disregard for the particular needs of PHP and friends.