]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Stop Font Lock forcing fontification from BOL. Fixes debbugs#19669.
authorAlan Mackenzie <acm@muc.de>
Sun, 1 Feb 2015 21:20:35 +0000 (21:20 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 1 Feb 2015 21:20:35 +0000 (21:20 +0000)
cc-mode.el (c-font-lock-init): Setq font-lock-extend-region-functions to
nil.

lisp/ChangeLog
lisp/progmodes/cc-mode.el

index fd54c6886408cccb2f4e31f601e662246c680f53..2d4f71f6cecbf96a8e7ba197887a94f2696e6c2d 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-01  Alan Mackenzie  <acm@muc.de>
+
+       CC Mode: Stop Font Lock forcing fontification from BOL.  Fixes
+       debbugs#19669.
+
+       * progmodes/cc-mode.el (c-font-lock-init): Setq
+       font-lock-extend-region-functions to nil.
+
 2015-01-31  Alan Mackenzie  <acm@muc.de>
 
        Handle "#" operator properly inside macro.  Fix coding bug.
index 1cba5027f288533dd96a33921b59b6f35c22f520..50a700425bf8bade0f910ff7d960d9e05cc80a65 100644 (file)
@@ -1237,6 +1237,14 @@ This function is called from `c-common-init', once per mode initialization."
          (font-lock-mark-block-function
           . c-mark-function)))
 
+  ;; Prevent `font-lock-default-fontify-region' extending the region it will
+  ;; fontify to whole lines by removing `font-lock-extend-region-whole-lines'
+  ;; (and, coincidentally, `font-lock-extend-region-multiline' (which we do
+  ;; not need)) from `font-lock-extend-region-functions'.  (Emacs only).  This
+  ;; fixes Emacs bug #19669.
+  (when (boundp 'font-lock-extend-region-functions)
+    (setq font-lock-extend-region-functions nil))
+
   (make-local-variable 'font-lock-fontify-region-function)
   (setq font-lock-fontify-region-function 'c-font-lock-fontify-region)