]> 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>
Mon, 6 Apr 2015 22:23:29 +0000 (22:23 +0000)
cc-mode.el (c-font-lock-init): Setq font-lock-extend-region-functions to
nil.

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

index 70602581cba6892e258c2b027187e2290354aceb..38bb8afa15cd3258c7b1d392109f84cf31184ed2 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-04-06  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        python.el: Do not break IPython magic completions.  (Bug#19736)
index 42ee14072d84048fb76815a6c32992cabdd4f126..d88fe702c59451cb30548f541e1b551a1804c7ac 100644 (file)
@@ -1302,6 +1302,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)