summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-fonts.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2011-02-13 15:25:15 -0500
committerChong Yidong <cyd@stupidchicken.com>2011-02-13 15:25:15 -0500
commitabfc152b45e356fc73c798ed770765c7d2560075 (patch)
tree221a7e73f12cc18dc1b315630de32db3657e3ef1 /lisp/progmodes/cc-fonts.el
parentd4eb88c7ab151a7cb7188c3ba03eb326ec1fa6f2 (diff)
downloademacs-abfc152b45e356fc73c798ed770765c7d2560075.tar.gz
Proper fix for CC mode Bug#7722.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Remove a narrow-to-region call that cuts context off the end (Bug#7722). * lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur): Refactor nested if-forms with a simple cond. (c-forward-<>-arglist): Revert 2011-01-31 change.
Diffstat (limited to 'lisp/progmodes/cc-fonts.el')
-rw-r--r--lisp/progmodes/cc-fonts.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 0d738700cc7..c7bb93f73e7 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1082,7 +1082,7 @@ casts and declarations are fontified. Used on level 2 and higher."
(boundp 'parse-sexp-lookup-properties))))
;; Below we fontify a whole declaration even when it crosses the limit,
- ;; to avoid gaps when lazy-lock fontifies the file a screenful at a
+ ;; to avoid gaps when jit/lazy-lock fontifies the file a block at a
;; time. That is however annoying during editing, e.g. the following is
;; a common situation while the first line is being written:
;;
@@ -1094,9 +1094,9 @@ casts and declarations are fontified. Used on level 2 and higher."
;; "some_other_variable" as an identifier, and the latter will not
;; correct itself until the second line is changed. To avoid that we
;; narrow to the limit if the region to fontify is a single line.
- (narrow-to-region
- (point-min)
- (if (<= limit (c-point 'bonl))
+ (if (<= limit (c-point 'bonl))
+ (narrow-to-region
+ (point-min)
(save-excursion
;; Narrow after any operator chars following the limit though,
;; since those characters can be useful in recognizing a
@@ -1104,8 +1104,7 @@ casts and declarations are fontified. Used on level 2 and higher."
;; after the header).
(goto-char limit)
(skip-chars-forward c-nonsymbol-chars)
- (point))
- limit))
+ (point))))
(c-find-decl-spots
limit