From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: syntax parsing of non-contiguous regions Date: Mon, 21 Sep 2009 22:13:45 +0200 Message-ID: <4AB7DE79.7010408@easy-emacs.de> References: <4AB53B94.2070307@googlemail.com> <4AB68EDF.7090902@easy-emacs.de> <4AB7D3D4.3000901@googlemail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253564149 29916 80.91.229.12 (21 Sep 2009 20:15:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Sep 2009 20:15:49 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Alexander Katovsky Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 21 22:15:42 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MppIU-0005go-0H for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Sep 2009 22:15:42 +0200 Original-Received: from localhost ([127.0.0.1]:49863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MppIT-0006Cr-4y for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Sep 2009 16:15:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MppI0-0006A0-MA for help-gnu-emacs@gnu.org; Mon, 21 Sep 2009 16:15:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MppHw-00062i-1e for help-gnu-emacs@gnu.org; Mon, 21 Sep 2009 16:15:12 -0400 Original-Received: from [199.232.76.173] (port=35731 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MppHv-00062c-V0 for help-gnu-emacs@gnu.org; Mon, 21 Sep 2009 16:15:07 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.186]:61812) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MppHv-0002dH-A1 for help-gnu-emacs@gnu.org; Mon, 21 Sep 2009 16:15:07 -0400 Original-Received: from [192.168.178.27] (p54BEAA8A.dip0.t-ipconnect.de [84.190.170.138]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MKv1o-1MppHt3jyK-0000pJ; Mon, 21 Sep 2009 22:15:06 +0200 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <4AB7D3D4.3000901@googlemail.com> X-Provags-ID: V01U2FsdGVkX19JOt56dgSx0rjFsvMfYA9nadGX5fU1DO/HnUu YKXHgsCkD3Nani3piizGiCp9ugHnp5x3WhMuVkoslEeNZBUqx6 djtF9XRi6gLi3y5lANMHysOWKnCD56VvppbBEJ0+Mw= X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68348 Archived-At: Alexander Katovsky wrote: > Hi, > > Thanks for your reply. The reason that I want to do this is to make a > major mode that supports embedded code (i.e. two major modes). I > have a strategy for doing this that would be well suited to my > specific problem and is different from the multi-mode implementations > I have seen. The new mode will be derived from the primary mode. The > fontification in the primary mode will provide a hook that the derived > mode can use to fontify the embedded code. This will work very > elegantly if I can define the embedded code as a comment in the > derived mode. In this way, the parent mode will simply ignore the > embedded code entirely, so that it will not interfere in any way with > the primary code, and I can decide what to do with it later. > > ok. IMHO you don't need syntax-stuff installing a new comment-style. New comment-settings inside a let should work: (let ((comment-start "%{") (comment-end "}%")) MY-HIDE-or-IGNORE- functions In case your comment-move-functions are buggy: try comment-lor.el Andreas -- https://code.launchpad.net/s-x-emacs-werkstatt/ http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/