diff options
| author | Simon Marshall | 1997-10-28 14:17:40 +0000 |
|---|---|---|
| committer | Simon Marshall | 1997-10-28 14:17:40 +0000 |
| commit | 7a31427e9d6b824ec8d1e8ff410a310d115a3f49 (patch) | |
| tree | 43675352b0a43fc27a57fcdc8c78906b81346ae9 /lisp | |
| parent | 844a6a46703cfe056800c49e1ac82fd6755171fe (diff) | |
| download | emacs-7a31427e9d6b824ec8d1e8ff410a310d115a3f49.tar.gz emacs-7a31427e9d6b824ec8d1e8ff410a310d115a3f49.zip | |
In deferral, check saved buffers to make sure they exist and have lazy-lock on.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/lazy-lock.el | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/lisp/lazy-lock.el b/lisp/lazy-lock.el index 83f998dfd07..5aa4a68788b 100644 --- a/lisp/lazy-lock.el +++ b/lisp/lazy-lock.el | |||
| @@ -2,9 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Simon Marshall <simon@gnu.ai.mit.edu> | 5 | ;; Author: Simon Marshall <simon@gnu.org> |
| 6 | ;; Keywords: faces files | 6 | ;; Keywords: faces files |
| 7 | ;; Version: 2.08.04 | 7 | ;; Version: 2.09 |
| 8 | 8 | ||
| 9 | ;;; This file is part of GNU Emacs. | 9 | ;;; This file is part of GNU Emacs. |
| 10 | 10 | ||
| @@ -258,6 +258,7 @@ | |||
| 258 | ;; - Removed `byte-*' variables from `eval-when-compile' (Erik Naggum hint) | 258 | ;; - Removed `byte-*' variables from `eval-when-compile' (Erik Naggum hint) |
| 259 | ;; - Made various wrapping `inhibit-point-motion-hooks' (Vinicius Latorre hint) | 259 | ;; - Made various wrapping `inhibit-point-motion-hooks' (Vinicius Latorre hint) |
| 260 | ;; - Made `lazy-lock-fontify-after-idle' wrap `minibuffer-auto-raise' | 260 | ;; - Made `lazy-lock-fontify-after-idle' wrap `minibuffer-auto-raise' |
| 261 | ;; - Made `lazy-lock-fontify-after-defer' paranoid about deferred buffers | ||
| 261 | 262 | ||
| 262 | ;;; Code: | 263 | ;;; Code: |
| 263 | 264 | ||
| @@ -314,7 +315,7 @@ The value returned is the value of the last form in BODY." | |||
| 314 | ; "Submit via mail a bug report on lazy-lock.el." | 315 | ; "Submit via mail a bug report on lazy-lock.el." |
| 315 | ; (interactive) | 316 | ; (interactive) |
| 316 | ; (let ((reporter-prompt-for-summary-p t)) | 317 | ; (let ((reporter-prompt-for-summary-p t)) |
| 317 | ; (reporter-submit-bug-report "simon@gnu.ai.mit.edu" "lazy-lock 2.08.04" | 318 | ; (reporter-submit-bug-report "simon@gnu.ai.mit.edu" "lazy-lock 2.09" |
| 318 | ; '(lazy-lock-minimum-size lazy-lock-defer-on-the-fly | 319 | ; '(lazy-lock-minimum-size lazy-lock-defer-on-the-fly |
| 319 | ; lazy-lock-defer-on-scrolling lazy-lock-defer-contextually | 320 | ; lazy-lock-defer-on-scrolling lazy-lock-defer-contextually |
| 320 | ; lazy-lock-defer-time lazy-lock-stealth-time | 321 | ; lazy-lock-defer-time lazy-lock-stealth-time |
| @@ -829,12 +830,18 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'." | |||
| 829 | (defun lazy-lock-fontify-after-defer () | 830 | (defun lazy-lock-fontify-after-defer () |
| 830 | ;; Called from `timer-idle-list'. | 831 | ;; Called from `timer-idle-list'. |
| 831 | ;; Fontify all windows where deferral has occurred for its buffer. | 832 | ;; Fontify all windows where deferral has occurred for its buffer. |
| 832 | (while (and lazy-lock-buffers (not (input-pending-p))) | 833 | (save-excursion |
| 833 | (let ((windows (get-buffer-window-list (car lazy-lock-buffers) 'nomini t))) | 834 | (while (and lazy-lock-buffers (not (input-pending-p))) |
| 834 | (while windows | 835 | (let ((buffer (car lazy-lock-buffers)) windows) |
| 835 | (lazy-lock-fontify-window (car windows)) | 836 | ;; Paranoia: check that the buffer is still live and Lazy Lock mode on. |
| 836 | (setq windows (cdr windows))) | 837 | (when (buffer-live-p buffer) |
| 837 | (setq lazy-lock-buffers (cdr lazy-lock-buffers)))) | 838 | (set-buffer buffer) |
| 839 | (when lazy-lock-mode | ||
| 840 | (setq windows (get-buffer-window-list buffer 'nomini t)) | ||
| 841 | (while windows | ||
| 842 | (lazy-lock-fontify-window (car windows)) | ||
| 843 | (setq windows (cdr windows))))) | ||
| 844 | (setq lazy-lock-buffers (cdr lazy-lock-buffers))))) | ||
| 838 | ;; Add hook if fontification should now be defer-driven in this buffer. | 845 | ;; Add hook if fontification should now be defer-driven in this buffer. |
| 839 | (when (and lazy-lock-mode lazy-lock-defer-on-scrolling | 846 | (when (and lazy-lock-mode lazy-lock-defer-on-scrolling |
| 840 | (memq 'lazy-lock-fontify-after-scroll window-scroll-functions) | 847 | (memq 'lazy-lock-fontify-after-scroll window-scroll-functions) |
| @@ -1096,6 +1103,12 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'." | |||
| 1096 | (cdr (or (assq major-mode alist) (assq t alist))) | 1103 | (cdr (or (assq major-mode alist) (assq t alist))) |
| 1097 | alist))) | 1104 | alist))) |
| 1098 | 1105 | ||
| 1106 | (unless (fboundp 'buffer-live-p) | ||
| 1107 | ;; We use this to check that a buffer we have to fontify still exists. | ||
| 1108 | (defun buffer-live-p (object) | ||
| 1109 | "Return non-nil if OBJECT is an editor buffer that has not been deleted." | ||
| 1110 | (and (bufferp object) (buffer-name object)))) | ||
| 1111 | |||
| 1099 | (unless (fboundp 'get-buffer-window-list) | 1112 | (unless (fboundp 'get-buffer-window-list) |
| 1100 | ;; We use this to get all windows showing a buffer we have to fontify. | 1113 | ;; We use this to get all windows showing a buffer we have to fontify. |
| 1101 | (defun get-buffer-window-list (buffer &optional minibuf frame) | 1114 | (defun get-buffer-window-list (buffer &optional minibuf frame) |