emacs-devel
[Top][All Lists]
Advanced

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

Re: line continuation and font-lock


From: Stefan Monnier
Subject: Re: line continuation and font-lock
Date: Mon, 06 Feb 2006 03:37:55 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> I wonder how I can handle the line continuation character of groff in
> font-lock.  Contrary to other languages, a trailing `\' is handled on
> the input level, before anything else.

Actually, C does the same thing (the \+LF is removed by cpp).

> Consequently, for proper fontification, I have to handle trailing
> backslashes earlier than anything else, too.  Looking into the
> documentation I wasn't able to find a method to do that.

Probably your best bet is to deifne a function (groff-bolp POS) which
when called at BOL returns t only if the previous line doesn't end with \.
Then use "^" in your regexps but filter out the false positives by using

     (if (groff-bolp (match-beginning 0)) font-lock-foo-face)

as the FACE expression.


        Stefan




reply via email to

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