help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: cc-mode in emacs 23.2 goes into infinte loop


From: Jim Diamond
Subject: Re: cc-mode in emacs 23.2 goes into infinte loop
Date: Sun, 23 Jan 2011 12:47:48 -0400
User-agent: slrn/0.9.9p1 (Linux)

On 2011-01-23 at 05:54 AST, rusi <rustompmody@gmail.com> wrote:
> On Jan 23, 3:41 am, jdiam...@snipthis.AcadiaU.ca wrote:
>> I have the following file...
>
> snipped
>
>>     (setq zsd-c-font-lock-keywords-3 nil)
>
> No I dont have an answer (and please excuse my hijacking your question
> for mine :-) )
> but do you know where I can find out about things like
> foo-font-lock-keywords-{1,2,3}?
>
> Both C and lisp modes are too deep-structured for me to easily figure
> out...
>
> IOW just looking for a typical, simple language mode that uses font-
> lock correctly...

Jorgen has maybe already answered your question.  In addition to his
message...

The -1, -2, -3 jazz for cc mode can be explained by this relatively
short snippet from cc-fonts.el:

(defconst c-font-lock-keywords-1 (c-lang-const c-matchers-1 c)
  "Minimal font locking for C mode.
Fontifies only preprocessor directives (in addition to the syntactic
fontification of strings and comments).")

(defconst c-font-lock-keywords-2 (c-lang-const c-matchers-2 c)
  "Fast normal font locking for C mode.
In addition to `c-font-lock-keywords-1', this adds fontification of
keywords, simple types, declarations that are easy to recognize, the
user defined types on `c-font-lock-extra-types', and the doc comment
styles specified by `c-doc-comment-style'.")

(defconst c-font-lock-keywords-3 (c-lang-const c-matchers-3 c)
  "Accurate normal font locking for C mode.
Like `c-font-lock-keywords-2' but detects declarations in a more
accurate way that works in most cases for arbitrary types without the
need for `c-font-lock-extra-types'.")

(defvar c-font-lock-keywords c-font-lock-keywords-3
  "Default expressions to highlight in C mode.")


So not every mode needs 3 choices, there are three choices in cc mode
to suit different tastes.

Cheers.
                                Jim


reply via email to

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