[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/jit-lock.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/jit-lock.el |
Date: |
Tue, 04 Feb 2003 06:31:56 -0500 |
Index: emacs/lisp/jit-lock.el
diff -c emacs/lisp/jit-lock.el:1.29 emacs/lisp/jit-lock.el:1.30
*** emacs/lisp/jit-lock.el:1.29 Tue Oct 1 12:54:42 2002
--- emacs/lisp/jit-lock.el Tue Feb 4 06:31:56 2003
***************
*** 38,44 ****
(progn ,@body)
(unless ,modified
(restore-buffer-modified-p nil))))))
!
(defmacro with-buffer-prepared-for-jit-lock (&rest body)
"Execute BODY in current buffer, overriding several variables.
Preserves the `buffer-modified-p' state of the current buffer."
--- 38,44 ----
(progn ,@body)
(unless ,modified
(restore-buffer-modified-p nil))))))
!
(defmacro with-buffer-prepared-for-jit-lock (&rest body)
"Execute BODY in current buffer, overriding several variables.
Preserves the `buffer-modified-p' state of the current buffer."
***************
*** 52,58 ****
buffer-file-truename)
,@body))))
!
;;; Customization.
--- 52,58 ----
buffer-file-truename)
,@body))))
!
;;; Customization.
***************
*** 82,90 ****
taking longer to fontify, you could increase the value of this variable.
See also `jit-lock-stealth-load'."
:type '(choice (const :tag "never" nil)
! (number :tag "seconds"))
:group 'jit-lock)
!
(defcustom jit-lock-stealth-load
(if (condition-case nil (load-average) (error)) 200)
--- 82,90 ----
taking longer to fontify, you could increase the value of this variable.
See also `jit-lock-stealth-load'."
:type '(choice (const :tag "never" nil)
! (number :tag "seconds"))
:group 'jit-lock)
!
(defcustom jit-lock-stealth-load
(if (condition-case nil (load-average) (error)) 200)
***************
*** 325,331 ****
;; stop at the start of the line following NEXT.
(goto-char next) (setq next (line-beginning-position 2))
(goto-char start) (setq start (line-beginning-position))
!
;; Fontify the chunk, and mark it as fontified.
;; We mark it first, to make sure that we don't indefinitely
;; re-execute this fontification if an error occurs.
--- 325,331 ----
;; stop at the start of the line following NEXT.
(goto-char next) (setq next (line-beginning-position 2))
(goto-char start) (setq start (line-beginning-position))
!
;; Fontify the chunk, and mark it as fontified.
;; We mark it first, to make sure that we don't indefinitely
;; re-execute this fontification if an error occurs.
***************
*** 378,384 ****
((< (- around start) (- next around)) start)
(t next))))
result))))
!
(defun jit-lock-stealth-fontify ()
"Fontify buffers stealthily.
--- 378,384 ----
((< (- around start) (- next around)) start)
(t next))))
result))))
!
(defun jit-lock-stealth-fontify ()
"Fontify buffers stealthily.
***************
*** 393,399 ****
(while (and buffers (not (input-pending-p)))
(let ((buffer (car buffers)))
(setq buffers (cdr buffers))
!
(with-current-buffer buffer
(when jit-lock-mode
;; This is funny. Calling sit-for with 3rd arg non-nil
--- 393,399 ----
(while (and buffers (not (input-pending-p)))
(let ((buffer (car buffers)))
(setq buffers (cdr buffers))
!
(with-current-buffer buffer
(when jit-lock-mode
;; This is funny. Calling sit-for with 3rd arg non-nil
***************
*** 447,460 ****
(while (and (setq start
(jit-lock-stealth-chunk-start point))
(sit-for nice))
!
;; fontify a block.
(jit-lock-fontify-now start (+ start jit-lock-chunk-size))
;; If stealth jit-locking is done backwards, this leads to
;; excessive O(n^2) refontification. -stef
;; (when (>= jit-lock-first-unfontify-pos start)
;; (setq jit-lock-first-unfontify-pos end))
!
;; Wait a little if load is too high.
(when (and jit-lock-stealth-load
(> (car (load-average)) jit-lock-stealth-load))
--- 447,460 ----
(while (and (setq start
(jit-lock-stealth-chunk-start point))
(sit-for nice))
!
;; fontify a block.
(jit-lock-fontify-now start (+ start jit-lock-chunk-size))
;; If stealth jit-locking is done backwards, this leads to
;; excessive O(n^2) refontification. -stef
;; (when (>= jit-lock-first-unfontify-pos start)
;; (setq jit-lock-first-unfontify-pos end))
!
;; Wait a little if load is too high.
(when (and jit-lock-stealth-load
(> (car (load-average)) jit-lock-stealth-load))
***************
*** 489,495 ****
(sit-for 0)
;; (message "Jit-Defer Done")
)))
!
(defun jit-lock-after-change (start end old-len)
"Mark the rest of the buffer as not fontified after a change.
--- 489,495 ----
(sit-for 0)
;; (message "Jit-Defer Done")
)))
!
(defun jit-lock-after-change (start end old-len)
"Mark the rest of the buffer as not fontified after a change.
***************
*** 508,514 ****
;; be inconsistent with the buffer's content.
(goto-char start)
(setq start (line-beginning-position))
!
;; If we're in text that matches a multi-line font-lock pattern,
;; make sure the whole text will be redisplayed.
;; I'm not sure this is ever necessary and/or sufficient. -stef
--- 508,514 ----
;; be inconsistent with the buffer's content.
(goto-char start)
(setq start (line-beginning-position))
!
;; If we're in text that matches a multi-line font-lock pattern,
;; make sure the whole text will be redisplayed.
;; I'm not sure this is ever necessary and/or sufficient. -stef
***************
*** 516,522 ****
(setq start (or (previous-single-property-change
start 'font-lock-multiline)
(point-min))))
!
;; Make sure we change at least one char (in case of deletions).
(setq end (min (max end (1+ start)) (point-max)))
;; Request refontification.
--- 516,522 ----
(setq start (or (previous-single-property-change
start 'font-lock-multiline)
(point-min))))
!
;; Make sure we change at least one char (in case of deletions).
(setq end (min (max end (1+ start)) (point-max)))
;; Request refontification.
***************
*** 525,531 ****
(when jit-lock-first-unfontify-pos
(setq jit-lock-first-unfontify-pos
(min jit-lock-first-unfontify-pos start))))))
!
(provide 'jit-lock)
;;; jit-lock.el ends here
--- 525,531 ----
(when jit-lock-first-unfontify-pos
(setq jit-lock-first-unfontify-pos
(min jit-lock-first-unfontify-pos start))))))
!
(provide 'jit-lock)
;;; jit-lock.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/jit-lock.el,
Juanma Barranquero <=