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

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

Re: outrageous comment syntax


From: rgb
Subject: Re: outrageous comment syntax
Date: 1 Nov 2005 15:36:54 -0800
User-agent: G2/0.2

Ian Zimmerman wrote:
> comment-start-skip's value is
> "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *"
> Local in buffer simple-haskell.el; global value is nil
>
> Documentation:
> *Regexp to match the start of a comment plus everything up to its body.
> If there are any \(...\) pairs, the comment delimiter text is held to begin
> at the place matched by the close of the first pair.
>
>
> However, I have a language with two comment syntaxes, one of which
> depends on leading context and the other doesn't.  How in the world can
> I set this variable properly?  The context must be within the first
> group, and it cannot be :-(

When you san "cannot be" I assume you mean that use of shy groups
(?: ...) is insufficient to your needs?

I suggested a generalized fix for problems such as this a couple
months ago.  I'm not sure how to tell if it was dismissed, or if it's
in some state of analysis or even implementation.

Basically it involved a seemingly simple change to regexp primatives
to accept symbols as well as strings.  Accepting a symbol was a
compromise to my original suggestion of allowing functions to be
passed which apparently introduces problems.

The idea is to make regexp handling work more like font-lock.  With
font-lock routines, anywhere a regexp is legal you can pass a function
which is expected to behave like re-search...  When I say `behave
like' I mean in the way it leaves point, returns t or nil depending on
success and setting of match-data.

This would give everyone with problems such as this the ability to
simply code a custom solution without having to hack up an otherwise
useful package that simply needs search results to do it's job.



reply via email to

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