diff options
| author | Alan Mackenzie | 2015-02-01 21:20:35 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2015-02-01 21:20:35 +0000 |
| commit | d69e9f1c24f37f36af33b0468c5a4e100dbb09b6 (patch) | |
| tree | 528ca54aa963f0513f679a2db0e2d355736980a4 | |
| parent | a78774a6b3faa4548997d75f52ba7320e3320c69 (diff) | |
| download | emacs-d69e9f1c24f37f36af33b0468c5a4e100dbb09b6.tar.gz emacs-d69e9f1c24f37f36af33b0468c5a4e100dbb09b6.zip | |
CC Mode: Stop Font Lock forcing fontification from BOL. Fixes debbugs#19669.
cc-mode.el (c-font-lock-init): Setq font-lock-extend-region-functions to
nil.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fd54c688640..2d4f71f6cec 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2015-02-01 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | CC Mode: Stop Font Lock forcing fontification from BOL. Fixes | ||
| 4 | debbugs#19669. | ||
| 5 | |||
| 6 | * progmodes/cc-mode.el (c-font-lock-init): Setq | ||
| 7 | font-lock-extend-region-functions to nil. | ||
| 8 | |||
| 1 | 2015-01-31 Alan Mackenzie <acm@muc.de> | 9 | 2015-01-31 Alan Mackenzie <acm@muc.de> |
| 2 | 10 | ||
| 3 | Handle "#" operator properly inside macro. Fix coding bug. | 11 | Handle "#" operator properly inside macro. Fix coding bug. |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 1cba5027f28..50a700425bf 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -1237,6 +1237,14 @@ This function is called from `c-common-init', once per mode initialization." | |||
| 1237 | (font-lock-mark-block-function | 1237 | (font-lock-mark-block-function |
| 1238 | . c-mark-function))) | 1238 | . c-mark-function))) |
| 1239 | 1239 | ||
| 1240 | ;; Prevent `font-lock-default-fontify-region' extending the region it will | ||
| 1241 | ;; fontify to whole lines by removing `font-lock-extend-region-whole-lines' | ||
| 1242 | ;; (and, coincidentally, `font-lock-extend-region-multiline' (which we do | ||
| 1243 | ;; not need)) from `font-lock-extend-region-functions'. (Emacs only). This | ||
| 1244 | ;; fixes Emacs bug #19669. | ||
| 1245 | (when (boundp 'font-lock-extend-region-functions) | ||
| 1246 | (setq font-lock-extend-region-functions nil)) | ||
| 1247 | |||
| 1240 | (make-local-variable 'font-lock-fontify-region-function) | 1248 | (make-local-variable 'font-lock-fontify-region-function) |
| 1241 | (setq font-lock-fontify-region-function 'c-font-lock-fontify-region) | 1249 | (setq font-lock-fontify-region-function 'c-font-lock-fontify-region) |
| 1242 | 1250 | ||