Mercurial > emacs
comparison lisp/jit-lock.el @ 62864:a30c3081abf5
(jit-lock-function, jit-lock-after-change): Do nothing if memory is full.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 29 May 2005 08:40:37 +0000 |
parents | c905fcf5e3d9 |
children | 6fb026ad601f 01137c1fdbe9 |
comparison
equal
deleted
inserted
replaced
62863:3c095150855a | 62864:a30c3081abf5 |
---|---|
296 | 296 |
297 (defun jit-lock-function (start) | 297 (defun jit-lock-function (start) |
298 "Fontify current buffer starting at position START. | 298 "Fontify current buffer starting at position START. |
299 This function is added to `fontification-functions' when `jit-lock-mode' | 299 This function is added to `fontification-functions' when `jit-lock-mode' |
300 is active." | 300 is active." |
301 (when jit-lock-mode | 301 (when (and jit-lock-mode (not (memory-full-p))) |
302 (if (null jit-lock-defer-time) | 302 (if (null jit-lock-defer-time) |
303 ;; No deferral. | 303 ;; No deferral. |
304 (jit-lock-fontify-now start (+ start jit-lock-chunk-size)) | 304 (jit-lock-fontify-now start (+ start jit-lock-chunk-size)) |
305 ;; Record the buffer for later fontification. | 305 ;; Record the buffer for later fontification. |
306 (unless (memq (current-buffer) jit-lock-defer-buffers) | 306 (unless (memq (current-buffer) jit-lock-defer-buffers) |
538 START and END are the start and end of the changed text. OLD-LEN | 538 START and END are the start and end of the changed text. OLD-LEN |
539 is the pre-change length. | 539 is the pre-change length. |
540 This function ensures that lines following the change will be refontified | 540 This function ensures that lines following the change will be refontified |
541 in case the syntax of those lines has changed. Refontification | 541 in case the syntax of those lines has changed. Refontification |
542 will take place when text is fontified stealthily." | 542 will take place when text is fontified stealthily." |
543 (when jit-lock-mode | 543 (when (and jit-lock-mode (not (memory-full-p))) |
544 (save-excursion | 544 (save-excursion |
545 (with-buffer-prepared-for-jit-lock | 545 (with-buffer-prepared-for-jit-lock |
546 ;; It's important that the `fontified' property be set from the | 546 ;; It's important that the `fontified' property be set from the |
547 ;; beginning of the line, else font-lock will properly change the | 547 ;; beginning of the line, else font-lock will properly change the |
548 ;; text's face, but the display will have been done already and will | 548 ;; text's face, but the display will have been done already and will |