[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: martin rudalics
Subject: Re: address@hidden: C++-mode: Syntax highlighting: wrong color for function identifier depending on the kind of whitespace that follows]
Date: Thu, 16 Feb 2006 18:21:07 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> There's a fundamental mismatch between Font Lock's implementation and
> reality: Font Lock assumes that, with the exception of comments and
> strings, the fontification of a region is dependent only on text near the
> region.  This works pretty well for programming languages, but badly for
> mark-up languages.

Font Lock is not to blame here, you must improve `parse-partial-sexp'.
The following comment in font-lock has been here ever since ...

  "Perhaps one day someone will write
   some syntactic parsers for common languages and a son-of-font-lock.el could
   use them rather then relying so heavily on the keyword (regexp) pass."

> I am convinced that, in the long term, we need an analogous, fast, global
> mechanism for for locating and characterizing regions bounded by
> arbitrary delimiters - in this case "<<" and ">>", but could just as well
> be Texinfo's "{" and "}" or Lex's and Yacc's "%{", "%}" and "%%" or
> "literate programing"'s boundaries between narrative text and executable
> code, or "here documents" within a shell script.
> Until we have this, I think we'll be entangling ourselves in an ever
> stickier web of ad-hoc workarounds.

In the short term, such mechanisms needn't even be fast.

reply via email to

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