emacs-devel
[Top][All Lists]
Advanced

[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: Wed, 15 Feb 2006 16:13:39 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> Currently a function is used as matcher in `font-lock-keywords' for
>>> this functionality.  It basically operates like this:

>>> (catch 'match
>>> (while (re-search-forward "<<" limit t)
>>> (let ((beg (match-beginning 0)))
>>> (search-forward ">>" limit 'move)
>>> (store-match-data (list beg (point)))
>>> (throw 'match t))))

>> I.e. equivalent to "<<\\(.\\|\n\\)*?\\(>>\\)?".

> Small point:  It might be a good idea here to write [\n\r] rather than
> just \n, in case something has changed \n's to \r's for selective display
> (Node of that name in the Elisp manual).

Last time I checked a "." in a regexp does match \r even if
selective-display is activated, so always \\(.\\|\n\\) matches *any* char.


        Stefan


PS: Furthermore, selective-display is on its way out.
The only code left that uses it (in Emacs-CVS) is in dired-aux.el,
gnus-sum.el, and locate.el, none of which interact with other major modes.




reply via email to

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