[Top][All Lists]

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

Re: address@hidden: C++-mode: Syntax highlighting: wrong color for funct

From: Stefan Monnier
Subject: Re: address@hidden: C++-mode: Syntax highlighting: wrong color for function identifier depending on the kind of whitespace that follows]
Date: Sat, 19 Mar 2005 17:30:49 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> That doesn't work very well while the thing is entered, does it? First
>>> you see "s[foo]{" while it's being entered, then you see the next line
>>> " bar", and lastly "}x". Your patterns will never see the whole
>>> construct at once. (They will however see the buffer end, or even
>>> worse some completely unrelated code that happen to be on the
>>> following lines and which might confuse them.)
>> I use font-lock-syntactic-face-function,

> (I had to investigate what that really does, in case it worked out
> some fantastic magic. But afaics it doesn't. ;)

No, no fantastic magic.  But in some cases, together with
font-lock-syntactic-keywords, it's a good way to get "multi-line keywords".
Other examples: verbatim envs in LaTeX, heredocs in sh-script, things
like that.  I also had a hack that marked strings with a missing \ at the
end of the line using this trick, but the behavior had some rough edges.

>> so I don't need to "see the whole pattern" (I basically keep track
>> of the intermediate state in the parse-partial-sexp state).
> If I understand this correctly, this means that your example falls
> under the special case when the construct can be recognized from the
> first line alone.  Unfortunately things aren't always that easy.

This trick is of restricted applicability, of course,


reply via email to

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