help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: syntax parsing of non-contiguous regions


From: Alexander Katovsky
Subject: Re: syntax parsing of non-contiguous regions
Date: Mon, 21 Sep 2009 23:18:16 +0100
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]