comparison lisp/jit-lock.el @ 72431:f13889b47192

(jit-lock-fontify-now): Protect the modified status of the right buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 17 Aug 2006 15:10:21 +0000
parents a1a0b1eed3a8
children 5d642f9eff22
comparison
equal deleted inserted replaced
72430:c5805198a585 72431:f13889b47192
389 (lexical-let ((start start) 389 (lexical-let ((start start)
390 (orig-start orig-start) 390 (orig-start orig-start)
391 (buf (current-buffer))) 391 (buf (current-buffer)))
392 (run-with-timer 392 (run-with-timer
393 0 nil (lambda () 393 0 nil (lambda ()
394 (with-buffer-prepared-for-jit-lock 394 (with-current-buffer buf
395 (put-text-property start orig-start 395 (with-buffer-prepared-for-jit-lock
396 'fontified t buf)))))) 396 (put-text-property start orig-start
397 'fontified t)))))))
397 398
398 ;; Find the start of the next chunk, if any. 399 ;; Find the start of the next chunk, if any.
399 (setq start (text-property-any next end 'fontified nil)))))))) 400 (setq start (text-property-any next end 'fontified nil))))))))
400 401
401 402
575 This is run after every buffer change. The functions are called with 576 This is run after every buffer change. The functions are called with
576 the three arguments of `after-change-functions': START END OLD-LEN. 577 the three arguments of `after-change-functions': START END OLD-LEN.
577 The extended region to refontify is returned indirectly by modifying 578 The extended region to refontify is returned indirectly by modifying
578 the variables `jit-lock-start' and `jit-lock-end'. 579 the variables `jit-lock-start' and `jit-lock-end'.
579 580
580 Note that extending the region this way is not strictly necessary, 581 Note that extending the region this way is not strictly necessary, except
581 except that the nature of the redisplay code tends to otherwise leave 582 that the nature of the redisplay code tends to otherwise leave some of
582 some of the rehighlighted text displayed with the old highlight until the 583 the rehighlighted text displayed with the old highlight until the next
583 next redisplay. See comment in `jit-lock-fontify-now'.") 584 redisplay (see comment about repeated redisplay in `jit-lock-fontify-now').")
584 585
585 (defun jit-lock-after-change (start end old-len) 586 (defun jit-lock-after-change (start end old-len)
586 "Mark the rest of the buffer as not fontified after a change. 587 "Mark the rest of the buffer as not fontified after a change.
587 Installed on `after-change-functions'. 588 Installed on `after-change-functions'.
588 START and END are the start and end of the changed text. OLD-LEN 589 START and END are the start and end of the changed text. OLD-LEN