emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r111071: Speed up fontification wh


From: Alan Mackenzie
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111071: Speed up fontification where there's large brace blocks.
Date: Sun, 23 Dec 2012 11:36:15 +0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111071
committer: Alan Mackenzie <address@hidden>
branch nick: emacs-24
timestamp: Sun 2012-12-23 11:36:15 +0000
message:
  Speed up fontification where there's large brace blocks.
  progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Add a limit to a
  call of c-beginning-of-decl-1.
modified:
  lisp/ChangeLog
  lisp/progmodes/cc-fonts.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-12-21 19:16:15 +0000
+++ b/lisp/ChangeLog    2012-12-23 11:36:15 +0000
@@ -1,3 +1,9 @@
+2012-12-23  Alan Mackenzie  <address@hidden>
+
+       Speed up fontification where there's large brace blocks.
+       * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Add a limit
+       to a call of c-beginning-of-decl-1.
+
 2012-12-21  Chong Yidong  <address@hidden>
 
        * sort.el (sort-subr): Doc fix (Bug#13056).

=== modified file 'lisp/progmodes/cc-fonts.el'
--- a/lisp/progmodes/cc-fonts.el        2012-01-19 07:21:25 +0000
+++ b/lisp/progmodes/cc-fonts.el        2012-12-23 11:36:15 +0000
@@ -1591,6 +1591,7 @@
   ;; prevent a repeat invocation.  See elisp/lispref page "Search-based
   ;; Fontification".
   (let* ((paren-state (c-parse-state))
+        (decl-search-lim (c-determine-limit 1000))
         decl-context in-typedef ps-elt)
     ;; Are we in any nested struct/union/class/etc. braces?
     (while paren-state
@@ -1599,7 +1600,7 @@
       (when (and (atom ps-elt)
                 (eq (char-after ps-elt) ?\{))
        (goto-char ps-elt)
-       (setq decl-context (c-beginning-of-decl-1)
+       (setq decl-context (c-beginning-of-decl-1 decl-search-lim)
              in-typedef (looking-at c-typedef-key))
        (if in-typedef (c-forward-token-2))
        (when (and c-opt-block-decls-with-vars-key


reply via email to

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