changeset 111052:09ec9197bd83

cc-mode.el (c-before-change, c-after-change): Move the setting of c-new-BEG and c-new-END from c-before-change to c-after-change.
author Alan Mackenzie <acm@muc.de>
date Tue, 19 Oct 2010 20:18:35 +0000
parents 111edd4c8e15
children b5730f66fbf4
files lisp/ChangeLog lisp/progmodes/cc-mode.el
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 19 15:24:39 2010 -0400
+++ b/lisp/ChangeLog	Tue Oct 19 20:18:35 2010 +0000
@@ -1,3 +1,9 @@
+2010-10-19  Alan Mackenzie  <acm@muc.de>
+
+	* progmodes/cc-mode.el (c-before-change, c-after-change): Move the
+	setting of c-new-BEG and c-new-END from c-before-change to
+	c-after-change.
+
 2010-10-19  Chong Yidong  <cyd@stupidchicken.com>
 
 	* cus-face.el (custom-theme-set-faces): Revert 2010-10-18 change.
--- a/lisp/progmodes/cc-mode.el	Tue Oct 19 15:24:39 2010 -0400
+++ b/lisp/progmodes/cc-mode.el	Tue Oct 19 20:18:35 2010 +0000
@@ -1029,10 +1029,6 @@
 			    (buffer-substring-no-properties type-pos term-pos)
 			    (buffer-substring-no-properties beg end)))))))
 
-	;; (c-new-BEG c-new-END) will be the region to fontify.  It may become
-	;; larger than (beg end).
-	(setq c-new-BEG beg
-	      c-new-END end)
 	(if c-get-state-before-change-functions
 	    (mapc (lambda (fn)
 		    (funcall fn beg end))
@@ -1086,6 +1082,10 @@
 	(when c-recognize-<>-arglists
 	  (c-after-change-check-<>-operators beg end))
 
+	;; (c-new-BEG c-new-END) will be the region to fontify.  It may become
+	;; larger than (beg end).
+	(setq c-new-BEG beg
+	      c-new-END end)
 	(if c-before-font-lock-function
 	    (save-excursion
 	      (funcall c-before-font-lock-function beg end old-len)))))))