diff options
| author | Alan Mackenzie | 2015-04-05 14:40:57 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2015-04-05 14:40:57 +0000 |
| commit | c1d18b1d59ef3f0d01c8a1112976241feba2f74a (patch) | |
| tree | b16bdad5f7971cf7305a28ab5a3692de27c58b90 | |
| parent | bf8194688ece7677083075b3a2443d9d1ac24e28 (diff) | |
| download | emacs-c1d18b1d59ef3f0d01c8a1112976241feba2f74a.tar.gz emacs-c1d18b1d59ef3f0d01c8a1112976241feba2f74a.zip | |
Tidy up fix to debbugs#20240.
* jit-lock.el (jit-lock-after-change): Widen the buffer only
whilst putting the 'fontified text properties.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/jit-lock.el | 16 |
2 files changed, 13 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7f2e9987fe5..a780b08e49c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2015-04-05 Alan Mackenzie <acm@muc.de> | 1 | 2015-04-05 Alan Mackenzie <acm@muc.de> |
| 2 | 2 | ||
| 3 | * jit-lock.el (jit-lock-after-change): Widen the buffer only | ||
| 4 | whilst putting the 'fontified text properties. | ||
| 5 | |||
| 6 | 2015-04-05 Alan Mackenzie <acm@muc.de> | ||
| 7 | |||
| 3 | Rationalize use of c[ad]+r, expunging cl-c[ad]\{3,4\}r. | 8 | Rationalize use of c[ad]+r, expunging cl-c[ad]\{3,4\}r. |
| 4 | Also expunge eudc-c[ad]+r. | 9 | Also expunge eudc-c[ad]+r. |
| 5 | 10 | ||
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index d5651c62811..5f9196da645 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el | |||
| @@ -650,14 +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 | (save-restriction | 653 | (run-hook-with-args 'jit-lock-after-change-extend-region-functions |
| 654 | (widen) | 654 | start end old-len) |
| 655 | (run-hook-with-args 'jit-lock-after-change-extend-region-functions | 655 | ;; Make sure we change at least one char (in case of deletions). |
| 656 | start end old-len) | 656 | (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max))) |
| 657 | ;; Make sure we change at least one char (in case of deletions). | 657 | ;; Request refontification. |
| 658 | (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max))) | 658 | (save-restriction |
| 659 | ;; Request refontification. | 659 | (widen) |
| 660 | (put-text-property jit-lock-start jit-lock-end 'fontified nil))) | 660 | (put-text-property jit-lock-start jit-lock-end 'fontified nil))) |
| 661 | ;; Mark the change for deferred contextual refontification. | 661 | ;; Mark the change for deferred contextual refontification. |
| 662 | (when jit-lock-context-unfontify-pos | 662 | (when jit-lock-context-unfontify-pos |
| 663 | (setq jit-lock-context-unfontify-pos | 663 | (setq jit-lock-context-unfontify-pos |