* wl-highlight.el (wl-highlight-summary): Added optional `lazy'
authorteranisi <teranisi>
Sun, 26 May 2002 13:13:44 +0000 (13:13 +0000)
committerteranisi <teranisi>
Sun, 26 May 2002 13:13:44 +0000 (13:13 +0000)
 argument and when it is non-nil, check face property before
 highlighting for each line.
(wl-highlight-summary-window): Set it.

wl/ChangeLog
wl/wl-highlight.el

index ebab707..290da80 100644 (file)
@@ -1,3 +1,10 @@
+2002-05-26  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-highlight.el (wl-highlight-summary): Added optional `lazy'
+       argument and when it is non-nil, check face property before
+       highlighting for each line.
+       (wl-highlight-summary-window): Set it.
+
 2002-05-22  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * wl-vars.el (wl-draft-disable-bcc-for-mime-bcc): New user option.
index e10e270..4391cf5 100644 (file)
@@ -954,7 +954,7 @@ Variables used:
   (interactive)
   (wl-highlight-summary (point-min)(point-max)))
 
-(defun wl-highlight-summary (start end)
+(defun wl-highlight-summary (start end &optional lazy)
   "Highlight summary between start and end.
 Faces used:
   wl-highlight-summary-unread-face      unread messages
@@ -984,9 +984,11 @@ Variables used:
       (setq i 0)
       (while (and (not (eobp))
                  (< (point) end))
-       (wl-highlight-summary-current-line nil nil
-                                          (or wl-summary-lazy-highlight
-                                              wl-summary-scored))
+       (when (or (not lazy)
+                 (null (get-text-property (point) 'face)))
+         (wl-highlight-summary-current-line nil nil
+                                            (or wl-summary-lazy-highlight
+                                                wl-summary-scored)))
        (forward-line 1))
       (unless wl-summary-lazy-highlight
        (message "Highlighting...done")))))
@@ -998,10 +1000,8 @@ This function is defined for `window-scroll-functions'"
       (with-current-buffer (window-buffer win)
        (when (eq major-mode 'wl-summary-mode)
          (wl-highlight-summary (window-start win)
-                               (save-excursion
-                                 (goto-char (window-start win))
-                                 (forward-line (frame-height))
-                                 (point)))
+                               (window-end win)
+                               'lazy)
          (set-buffer-modified-p nil)))))
 
 (defun wl-highlight-headers (&optional for-draft)