diff options
| -rw-r--r-- | lisp/jit-lock.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 43c8457c80b..fe64d871d96 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el | |||
| @@ -415,6 +415,7 @@ This functions is called after Emacs has been idle for | |||
| 415 | (unless (or executing-kbd-macro | 415 | (unless (or executing-kbd-macro |
| 416 | (window-minibuffer-p (selected-window))) | 416 | (window-minibuffer-p (selected-window))) |
| 417 | (let ((buffers (buffer-list)) | 417 | (let ((buffers (buffer-list)) |
| 418 | (outer-buffer (current-buffer)) | ||
| 418 | minibuffer-auto-raise | 419 | minibuffer-auto-raise |
| 419 | message-log-max) | 420 | message-log-max) |
| 420 | (with-local-quit | 421 | (with-local-quit |
| @@ -449,7 +450,10 @@ This functions is called after Emacs has been idle for | |||
| 449 | (point (point-min))) | 450 | (point (point-min))) |
| 450 | (while (and (setq start | 451 | (while (and (setq start |
| 451 | (jit-lock-stealth-chunk-start point)) | 452 | (jit-lock-stealth-chunk-start point)) |
| 452 | (sit-for nice)) | 453 | ;; In case sit-for runs any timers, |
| 454 | ;; give them the expected current buffer. | ||
| 455 | (with-current-buffer outer-buffer | ||
| 456 | (sit-for nice))) | ||
| 453 | 457 | ||
| 454 | ;; fontify a block. | 458 | ;; fontify a block. |
| 455 | (jit-lock-fontify-now start (+ start jit-lock-chunk-size)) | 459 | (jit-lock-fontify-now start (+ start jit-lock-chunk-size)) |
| @@ -461,7 +465,10 @@ This functions is called after Emacs has been idle for | |||
| 461 | ;; Wait a little if load is too high. | 465 | ;; Wait a little if load is too high. |
| 462 | (when (and jit-lock-stealth-load | 466 | (when (and jit-lock-stealth-load |
| 463 | (> (car (load-average)) jit-lock-stealth-load)) | 467 | (> (car (load-average)) jit-lock-stealth-load)) |
| 464 | (sit-for (or jit-lock-stealth-time 30))))))))))))) | 468 | ;; In case sit-for runs any timers, |
| 469 | ;; give them the expected current buffer. | ||
| 470 | (with-current-buffer outer-buffer | ||
| 471 | (sit-for (or jit-lock-stealth-time 30)))))))))))))) | ||
| 465 | 472 | ||
| 466 | 473 | ||
| 467 | 474 | ||