From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Katovsky Newsgroups: gmane.emacs.help Subject: Re: syntax parsing of non-contiguous regions Date: Mon, 21 Sep 2009 23:18:16 +0100 Message-ID: <4AB7FBA8.3040404@googlemail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253680790 1015 80.91.229.12 (23 Sep 2009 04:39:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Sep 2009 04:39:50 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?ISO-8859-1?Q?Andreas_R=F6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 23 06:39:43 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 1MqJdi-0001pl-LS for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Sep 2009 06:39:39 +0200 Original-Received: from localhost ([127.0.0.1]:39612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqJdi-0005Qo-5o for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Sep 2009 00:39:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MprCz-0006qf-Ce for help-gnu-emacs@gnu.org; Mon, 21 Sep 2009 18:18:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MprCu-0006qT-E1 for help-gnu-emacs@gnu.org; Mon, 21 Sep 2009 18:18:08 -0400 Original-Received: from [199.232.76.173] (port=46241 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MprCu-0006qQ-9I for help-gnu-emacs@gnu.org; Mon, 21 Sep 2009 18:18:04 -0400 Original-Received: from mail-ew0-f211.google.com ([209.85.219.211]:60038) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MprCu-0006kL-1B for help-gnu-emacs@gnu.org; Mon, 21 Sep 2009 18:18:04 -0400 Original-Received: by ewy7 with SMTP id 7so3447976ewy.31 for ; Mon, 21 Sep 2009 15:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=hjwSARoM1doaJiid4USnQfUucLpUB8K2f7hQ4MqoHJs=; b=I8/kCwvMDlzAu3p0TSPR0BwfO9LSwe0lyysLbIhEysliN49O05tgrMUAkPt4kn2n9P PsWRReX2MGNBe6fmSL7h5foTkhN1KZQraNQlOnhk8cIDcFe1nWY4wVOimvE4MxmPOCR5 V5ZN0wQE/Tm2j4GymQru02xWffj98mLRv5490= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=dMwJbE6CnGbcP3Vi62B1YR0dObGud1G8JpsxsnM+5yr+AiNod3cYJHoPwoumEDRotw wK40rgyBs0nmgcvXjofrd5QDW3oMvM2jZJ+61EfW4f/HsOLE15xbTHBF5tPRXUlXvZMr /rE/+z4kliINVjeLv5oHUY/bZc4ixxYNwZ14w= Original-Received: by 10.211.131.18 with SMTP id i18mr3565056ebn.76.1253571483050; Mon, 21 Sep 2009 15:18:03 -0700 (PDT) Original-Received: from ?192.168.1.65? (94-195-68-122.zone9.bethere.co.uk [94.195.68.122]) by mx.google.com with ESMTPS id 7sm62531eyg.21.2009.09.21.15.18.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Sep 2009 15:18:02 -0700 (PDT) User-Agent: Thunderbird 2.0.0.16 (X11/20080724) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Wed, 23 Sep 2009 00:39:08 -0400 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:68405 Archived-At: I'm afraid I'm being a little slow understanding you're suggestion. I've already defined comment-start and comment-end as '!' and '\n' respectively. Also, I need all the syntax motion functions (forward-sexp, parse-partial-sexp et al) to treat the embedded code as a comment so that the embedded code does not disrupt syntax motion outside. For example, suppose that my primary mode is for code consisting of named blocks with comments starting with '!' and ending with newline, and my embedded code is C. Then we could have named-block ! some comment { %{ if(a != b){} }% } Then the syntax motion functions would completely ignore the embedded code, just as it would a comment. So if point is before the first opening brace then, no matter what's inside %{}%, forward-sexp would place point at the last closing brace. And all the other syntax functions would just 'work' as well! I'd be very grateful if could explain in a little more detail exactly what the 'hide-or-ignore' functions that you suggest are and how they could be used to achieve this effect. Thanks, Alex