emacs-devel
[Top][All Lists]
Advanced

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

font-locking and open parens in column zero


From: martin rudalics
Subject: font-locking and open parens in column zero
Date: Sun, 10 Sep 2006 12:09:15 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

NEWS contains the entry:


+++
*** font-lock: in modes like C and Lisp where the fontification assumes that
an open-paren in column 0 is always outside of any string or comment,
font-lock now highlights any such open-paren-in-column-zero in bold-red
if it is inside a string or a comment, to indicate that it can cause
trouble with fontification and/or indentation.


This entry is wrong: In C mode open parens in column 0 are not
highlighted in bold-red, probably due to the test

             (eq (or syntax-begin-function
                     font-lock-beginning-of-syntax-function)
                 'beginning-of-defun)

in `font-lock-compile-keywords' which fails since
`syntax-begin-function' equals `c-beginning-of-syntax' in C mode.

I'd propose to either not mention C mode in the NEWS entry or change
`font-lock-compile-keywords' appropriately, for example, by setting and
checking a property of the involved symbols.

In addition, it might seem reasonable to check whether the settings of
`open-paren-in-column-0-is-defun-start' conflict with the approach used
by `font-lock-compile-keywords'.  Currently, any user settings for
`open-paren-in-column-0-is-defun-start' are overridden by C mode.





reply via email to

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