emacs-devel
[Top][All Lists]
Advanced

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

Re: font-locking and open parens in column zero


From: Stefan Monnier
Subject: Re: font-locking and open parens in column zero
Date: Mon, 11 Sep 2006 10:18:57 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> That is probably obsolete, from the days before C mode started using
>> `c-beginning-of-syntax'.  This feature is no longer needed in C mode,
>> since `c-beginning-of-syntax' prevents the confusion it was meant to warn
>> the user about.

> When `c-beginning-of-syntax' doesn't find a cached position it calls
> `c-beginning-of-defun-1' which, on Emacs, calls `beginning-of-defun':

> (1) With emacs -Q open ~/src/syntax.c

> (2) Execute

> (defun foo ()
>   (interactive)
>   (re-search-forward "string-to-syntax")
>   (forward-line 6)
>   (recenter 0))

> This will fontify the entire body of `string_to_syntax' as a C string
> due to the left paren in column zero of the doc-string.

Then C-mode's font-lock-keywords should highlight this open-paren.
It's not font-lock's job to figure out what c-beginning-of-defun does.
Maybe I should completely remove this tweak in font-lock.el and move it to
lisp-modes (which other modes does it work with anyway)?


        Stefan




reply via email to

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