emacs-devel
[Top][All Lists]
Advanced

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

Re: Slow fontification in C mode buffers


From: Kentaro NAKAZAWA
Subject: Re: Slow fontification in C mode buffers
Date: Sat, 07 Jan 2012 09:09:01 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Hello, Alan.

Alan Mackenzie <address@hidden> writes:

> Would you try this patch and let me know how it goes, please.
>
>
> *** orig/cc-fonts.el  2012-01-06 12:27:14.000000000 +0000
> --- cc-fonts.el       2012-01-06 21:48:54.000000000 +0000
> ***************
> *** 1394,1399 ****
> --- 1394,1414 ----
>             (c-fontify-recorded-types-and-refs)
>             nil)
>   
> +          ((and (not c-enums-contain-decls)
> +                ;; An optimisation quickly to eliminate scans of long enum
> +                ;; declarations in the next cond arm.
> +                (let ((paren-state (c-parse-state)))
> +                  (and
> +                   (numberp (car paren-state))
> +                   (save-excursion
> +                     (goto-char (car paren-state))
> +                     (c-backward-token-2)
> +                     (or (looking-at c-brace-list-key))
> +                     (progn
> +                       (c-backward-token-2)
> +                       (looking-at c-brace-list-key))))))
> +           t)
> + 
>            (t
>             ;; Are we at a declarator?  Try to go back to the declaration
>             ;; to check this.  If we get there, check whether a "typedef"
> *** orig/cc-langs.el  2012-01-06 12:27:14.000000000 +0000
> --- cc-langs.el       2012-01-06 12:54:00.000000000 +0000
> ***************
> *** 2930,2935 ****
> --- 2930,2941 ----
>                   ; generics is not yet coded in CC Mode.
>   (c-lang-defvar c-recognize-<>-arglists (c-lang-const 
> c-recognize-<>-arglists))
>   
> + (c-lang-defconst c-enums-contain-decls
> +   "Non-nil means that an enum structure can contain declarations."
> +   t nil
> +   java t)
> + (c-lang-defvar c-enums-contain-decls (c-lang-const c-enums-contain-decls))
> + 
>   (c-lang-defconst c-recognize-paren-inits
>     "Non-nil means that parenthesis style initializers exist,
>   i.e. constructs like
>

Thank you for the patch.
I applied a patch, it came to be able to edit the attribute.h comfortably.
The original file with the problem is comfortable too.
However, some key words were not colored.

-- 
Kentaro Nakazawa



reply via email to

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