* wl-summary.el (wl-summary-sync-update): Utilize lazy-highlight.
authoryoichi <yoichi>
Thu, 17 Jun 2004 17:38:43 +0000 (17:38 +0000)
committeryoichi <yoichi>
Thu, 17 Jun 2004 17:38:43 +0000 (17:38 +0000)
* wl-thread.el (wl-thread-get-parent-list): Don't check
disconnected ancestors, neglecting needless work in
`wl-thread-update-indent-string-thread'.

* wl.el (wl-save): Take prefix argument to execute remaining marks.
* wl-summary.el (wl-summary-cleanup-temp-marks): Abolish unused
argument, add argument default-keep to keep marks by default.

wl/ChangeLog
wl/wl-summary.el
wl/wl-thread.el
wl/wl.el

index 0853604..62feb08 100644 (file)
@@ -1,5 +1,15 @@
 2004-06-18  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
+       * wl-summary.el (wl-summary-sync-update): Utilize lazy-highlight.
+
+       * wl-thread.el (wl-thread-get-parent-list): Don't check
+       disconnected ancestors, neglecting needless work in
+       `wl-thread-update-indent-string-thread'.
+
+       * wl.el (wl-save): Take prefix argument to execute remaining marks.
+       * wl-summary.el (wl-summary-cleanup-temp-marks): Abolish unused
+       argument, add argument default-keep to keep marks by default.
+
        * Version number is increased to 2.11.30.
 
        * wl-vars.el (wl-draft-reply-with-argument-list): Fix
index 7d518f0..ecaa60c 100644 (file)
@@ -1089,18 +1089,22 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'."
 (defun wl-summary-thread-modified-p ()
   wl-summary-buffer-thread-modified)
 
-(defun wl-summary-cleanup-temp-marks (&optional sticky)
+(defun wl-summary-cleanup-temp-marks (&optional default-keep)
   (when wl-summary-buffer-temp-mark-list
-    (if (y-or-n-p (format "Execute remaining marks in %s before cleanup? "
-                         (wl-summary-buffer-folder-name)))
+    (if (y-or-n-p (format "Execute marks in %s?%s "
+                         (wl-summary-buffer-folder-name)
+                         (if default-keep
+                             ""
+                           " (answer \"n\" to discard them)")))
        (progn
          (wl-summary-exec)
          (if wl-summary-buffer-temp-mark-list
              (error "Some execution was failed")))
       ;; temp-mark-list is remained.
       (message "")))
-  (wl-summary-delete-all-temp-marks 'no-msg)
-  (setq wl-summary-scored nil))
+  (unless default-keep
+    (wl-summary-delete-all-temp-marks 'no-msg)
+    (setq wl-summary-scored nil)))
 
 ;; a subroutine for wl-summary-exit/wl-save-status
 ;; Note that folder is not commited here.
@@ -1140,7 +1144,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'."
     (if wl-summary-buffer-exit-function
        (funcall wl-summary-buffer-exit-function)
       (if (or force-exit (not sticky))
-         (wl-summary-cleanup-temp-marks sticky))
+         (wl-summary-cleanup-temp-marks))
       (unwind-protect
          ;; save summary status
          (progn
@@ -1897,7 +1901,9 @@ This function is defined for `window-scroll-functions'"
                                                 sync-all
                                                 no-check))
          (if crossed
-             (progn
+             (let ((wl-summary-highlight
+                    (and wl-summary-highlight
+                         (not wl-summary-lazy-highlight))))
                ;; Setup sync-all
                (if sync-all (wl-summary-sync-all-init))
                (setq diff (elmo-list-diff (elmo-folder-list-messages
@@ -1915,8 +1921,7 @@ This function is defined for `window-scroll-functions'"
                (when (and wl-summary-lazy-highlight
                           wl-summary-lazy-update-mark)
                  (let (buffer-read-only)
-                   (put-text-property (point-min) (point-max) 'face nil))
-                 (run-hooks 'wl-summary-buffer-window-scroll-functions))
+                   (put-text-property (point-min) (point-max) 'face nil)))
                (setq num (length append-list))
                (setq i 0)
                (setq wl-summary-delayed-update nil)
@@ -2018,15 +2023,16 @@ This function is defined for `window-scroll-functions'"
            (progn
              (goto-char (point-max))
              (forward-line -1))
-         (if (and wl-summary-highlight
-                  (not wl-summary-lazy-highlight)
-                  (not (get-text-property (point) 'face)))
-             (save-excursion
-               (forward-line (- 0
-                                (or
-                                 wl-summary-partial-highlight-above-lines
-                                 wl-summary-highlight-partial-threshold)))
-               (wl-highlight-summary (point) (point-max))))))
+         (when wl-summary-highlight
+           (if wl-summary-lazy-highlight
+               (run-hooks 'wl-summary-buffer-window-scroll-functions)
+             (when (not (get-text-property (point) 'face))
+               (save-excursion
+                 (forward-line (- 0
+                                  (or
+                                   wl-summary-partial-highlight-above-lines
+                                   wl-summary-highlight-partial-threshold)))
+                 (wl-highlight-summary (point) (point-max))))))))
       (wl-delete-all-overlays)
       (set-buffer-modified-p nil)
       (if mes (message "%s" mes)))))
@@ -2318,7 +2324,7 @@ If ARG, without confirm."
       (setq wl-summary-last-visited-folder (wl-summary-buffer-folder-name))
       (run-hooks 'wl-summary-exit-pre-hook)
       (if (or force-exit (not (wl-summary-sticky-p)))
-         (wl-summary-cleanup-temp-marks (wl-summary-sticky-p)))
+         (wl-summary-cleanup-temp-marks))
       (wl-summary-save-view)
       (elmo-folder-commit wl-summary-buffer-elmo-folder)
       (if (and (wl-summary-sticky-p) force-exit)
index 9c82126..ce3ad81 100644 (file)
@@ -684,29 +684,51 @@ Message is inserted to the summary buffer."
          (wl-thread-update-children-number invisible-top)
          nil))))
 
+;(defun wl-thread-get-parent-list (msgs)
+;  ;; return ancestors
+;  (let* ((msgs2 msgs)
+;       myself)
+;    (while msgs2
+;      (setq myself (car msgs2)
+;          msgs2 (cdr msgs2))
+;      (while (not (eq myself (car msgs2)))
+;      (if (wl-thread-descendant-p myself (car msgs2))
+;          (setq msgs (delq (car msgs2) msgs)))
+;      (setq msgs2 (or (cdr msgs2) msgs)))
+;      (setq msgs2 (cdr msgs2)))
+;    msgs))
+
 (defun wl-thread-get-parent-list (msgs)
-  (let* ((msgs2 msgs)
-        myself)
-    (while msgs2
-      (setq myself (car msgs2)
-           msgs2 (cdr msgs2))
-      (while (not (eq myself (car msgs2)))
-       (if (wl-thread-descendant-p myself (car msgs2))
-           (setq msgs (delq (car msgs2) msgs)))
-       (setq msgs2 (or (cdr msgs2) msgs)))
-      (setq msgs2 (cdr msgs2)))
-    msgs))
+  ;; return connected ancestors
+  (let ((ptr msgs)
+       parent ret)
+    (while (car ptr)
+      (setq parent (wl-thread-entity-get-parent (wl-thread-get-entity (car ptr))))
+      (when (or (not parent)
+               (not (memq parent msgs)))
+       (setq ret (append ret (list (car ptr)))))
+      (setq ptr (cdr ptr)))
+    ret))
 
 (defun wl-thread-update-indent-string-thread (top-list)
-  (let ((top-list (wl-thread-get-parent-list top-list))
-       beg)
+  (let* ((top-list (wl-thread-get-parent-list top-list))
+        (num (length top-list))
+        (i 0)
+        beg)
     (while top-list
+      (when (or (zerop (% i 5)) (= i num))
+       (elmo-display-progress
+        'wl-thread-update-indent-string-thread
+        "Updating thread indent..."
+        (/ (* i 100) num)))
       (when (car top-list)
        (wl-summary-jump-to-msg (car top-list))
        (setq beg (point))
        (wl-thread-goto-bottom-of-sub-thread)
        (wl-thread-update-indent-string-region beg (point)))
-      (setq top-list (cdr top-list)))))
+      (setq top-list (cdr top-list)
+           i (1+ i)))
+    (message "Updating thread indent...done")))
 
 (defun wl-thread-update-children-number (entity)
   "Update the children number."
index d523243..42665e3 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -626,21 +626,21 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 
 ;;; end of wl-plugged-mode
 
-(defun wl-save ()
+(defun wl-save (&optional exec-marks)
   "Save summary and folder status."
-  (interactive)
-  (wl-save-status 'keep-summary)
+  (interactive "P")
+  (wl-save-status 'keep-summary (not exec-marks))
   (run-hooks 'wl-save-hook))
 
-(defun wl-save-status (&optional keep-summary)
+(defun wl-save-status (&optional keep-summary leave-marks)
   (message "Saving summary and folder status...")
   (let (summary-buf)
     (save-excursion
       (let ((summaries (wl-collect-summary)))
        (while summaries
          (with-current-buffer (car summaries)
-           (unless keep-summary
-             (wl-summary-cleanup-temp-marks))
+           (unless leave-marks
+             (wl-summary-cleanup-temp-marks keep-summary))
            (wl-summary-save-view)
            (elmo-folder-commit wl-summary-buffer-elmo-folder)
            (unless keep-summary