aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2015-04-04 10:26:31 +0000
committerAlan Mackenzie2015-04-04 10:32:23 +0000
commit4fabcbfbcd8447351ae59b01b329a0dabebea872 (patch)
treefe825494bd6f5a9b1db57b864cd64d822784474f
parent4de97eafb36a155e520c27e2dee7e068e52f099b (diff)
downloademacs-4fabcbfbcd8447351ae59b01b329a0dabebea872.tar.gz
emacs-4fabcbfbcd8447351ae59b01b329a0dabebea872.zip
Fix debbugs#20240 part two (jit-lock error during `comment-dwim').
jit-lock.el (jit-lock-after-change): Widen the buffer before putting 'fontified text properties.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/jit-lock.el14
2 files changed, 15 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5757317f5e2..cab6abac615 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12015-04-04 Alan Mackenzie <acm@muc.de>
2
3 Fix debbugs#20240 part two (jit-lock error during `comment-dwim').
4
5 * jit-lock.el (jit-lock-after-change): Widen the buffer before
6 putting 'fontified text properties.
7
12015-04-03 Michael Albinus <michael.albinus@gmx.de> 82015-04-03 Michael Albinus <michael.albinus@gmx.de>
2 9
3 * net/tramp-cache.el (tramp-flush-file-property) 10 * net/tramp-cache.el (tramp-flush-file-property)
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 0faabeb879a..d5651c62811 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -650,12 +650,14 @@ will take place when text is fontified stealthily."
650 (let ((jit-lock-start start) 650 (let ((jit-lock-start start)
651 (jit-lock-end end)) 651 (jit-lock-end end))
652 (with-buffer-prepared-for-jit-lock 652 (with-buffer-prepared-for-jit-lock
653 (run-hook-with-args 'jit-lock-after-change-extend-region-functions 653 (save-restriction
654 start end old-len) 654 (widen)
655 ;; Make sure we change at least one char (in case of deletions). 655 (run-hook-with-args 'jit-lock-after-change-extend-region-functions
656 (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max))) 656 start end old-len)
657 ;; Request refontification. 657 ;; Make sure we change at least one char (in case of deletions).
658 (put-text-property jit-lock-start jit-lock-end 'fontified nil)) 658 (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max)))
659 ;; Request refontification.
660 (put-text-property jit-lock-start jit-lock-end 'fontified nil)))
659 ;; Mark the change for deferred contextual refontification. 661 ;; Mark the change for deferred contextual refontification.
660 (when jit-lock-context-unfontify-pos 662 (when jit-lock-context-unfontify-pos
661 (setq jit-lock-context-unfontify-pos 663 (setq jit-lock-context-unfontify-pos