From f237ab27468ffb4f5eede6634bb560f5c5c6bf8a Mon Sep 17 00:00:00 2001 From: teranisi Date: Sat, 2 Aug 2003 15:07:32 +0000 Subject: [PATCH] * elmo.el (elmo-folder-list-messages): Treat killed-list only when visible-only is non-nil. (elmo-folder-confirm-appends): Changed message. (elmo-folder-synchronize): Added argument disable-killed. * elmo-multi.el (elmo-folder-synchronize): Added argument disable-killed. * elmo-pipe.el (elmo-folder-synchronize): Ditto. * wl-summary.el (wl-summary-rescan): Added argument disable-kill (wl-summary-rescan): Set wl-summary-scored as nil. (wl-summary-sync-force-update): Follow the change above. (wl-summary-sync): Ditto. (wl-summary-sync-update): Added argument disable-killed. (wl-summary-insert-headers): Set visible-only argument for elmo-folder-list-messages. (wl-summary-input-range): Added update-nokill, update-noscore, all-nokill, all-noscore and mark. --- elmo/ChangeLog | 10 +++++++++ elmo/elmo-multi.el | 6 ++++-- elmo/elmo-pipe.el | 7 +++++-- elmo/elmo.el | 45 ++++++++++++++++++++++++----------------- wl/ChangeLog | 10 +++++++++ wl/wl-summary.el | 57 ++++++++++++++++++++++++++++++++++++---------------- 6 files changed, 96 insertions(+), 39 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 2081060..3f017cc 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,15 @@ 2003-08-02 Yuuichi Teranishi + * elmo.el (elmo-folder-list-messages): Treat killed-list only when + visible-only is non-nil. + (elmo-folder-confirm-appends): Changed message. + (elmo-folder-synchronize): Added argument disable-killed. + + * elmo-multi.el (elmo-folder-synchronize): Added argument + disable-killed. + + * elmo-pipe.el (elmo-folder-synchronize): Ditto. + * elmo-version.el (elmo-version): Up to 2.11.5. * elmo-multi.el (elmo-folder-search): Use nil for 1st argument of diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index a4c2313..511a942 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -85,10 +85,12 @@ (elmo-folder-set-msgdb-internal fld nil))) (luna-define-method elmo-folder-synchronize ((folder elmo-multi-folder) - &optional ignore-msgdb + &optional + disable-killed + ignore-msgdb no-check) (dolist (fld (elmo-multi-folder-children-internal folder)) - (elmo-folder-synchronize fld ignore-msgdb no-check)) + (elmo-folder-synchronize fld disable-killed ignore-msgdb no-check)) 0) (luna-define-method elmo-folder-expand-msgdb-path ((folder diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index 8643762..6a4a2db 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -332,7 +332,9 @@ (elmo-pipe-folder-dst-internal folder))) (luna-define-method elmo-folder-synchronize ((folder elmo-pipe-folder) - &optional ignore-msgdb + &optional + disable-killed + ignore-msgdb no-check) (let ((src-folder (elmo-pipe-folder-src-internal folder)) (dst-folder (elmo-pipe-folder-dst-internal folder))) @@ -347,7 +349,8 @@ (elmo-pipe-folder-copied-list-load folder))) (elmo-pipe-drain src-folder dst-folder)))) (elmo-folder-synchronize - (elmo-pipe-folder-dst-internal folder) ignore-msgdb no-check)) + (elmo-pipe-folder-dst-internal folder) + disable-killed ignore-msgdb no-check)) (luna-define-method elmo-folder-list-flagged ((folder elmo-pipe-folder) flag diff --git a/elmo/elmo.el b/elmo/elmo.el index b61152c..e263146 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -214,12 +214,14 @@ If second optional IN-MSGDB is non-nil, only messages in the msgdb are listed.") (let ((list (if in-msgdb t (elmo-folder-list-messages-internal folder visible-only)))) - (elmo-living-messages - (if (listp list) - list - ;; Use current list. - (elmo-msgdb-list-messages (elmo-folder-msgdb folder))) - (elmo-folder-killed-list-internal folder)))) + (setq list + (if (listp list) + list + ;; Use current list. + (elmo-msgdb-list-messages (elmo-folder-msgdb folder)))) + (if visible-only + (elmo-living-messages list (elmo-folder-killed-list-internal folder)) + list))) (luna-define-generic elmo-folder-list-unreads (folder) "Return a list of unread message numbers contained in FOLDER.") @@ -1395,8 +1397,9 @@ FIELD is a symbol of the field.") in (string-to-int in)) (if (< len in) (throw 'end len)) - (if (y-or-n-p (format "%d messages are not appeared. OK? " - (max (- len in) 0))) + (if (y-or-n-p (format + "%d messages are killed (not appeared). OK? " + (max (- len in) 0))) (throw 'end in)))) (nthcdr (max (- len in) 0) appends)) (if (and elmo-folder-update-threshold @@ -1477,40 +1480,46 @@ FIELD is a symbol of the field.") (elmo-folder-set-msgdb-internal folder (elmo-msgdb-clear))) (luna-define-generic elmo-folder-synchronize (folder - &optional ignore-msgdb + &optional + disable-killed + ignore-msgdb no-check) "Synchronize the folder data to the newest status. FOLDER is the ELMO folder structure. +If optional DISABLE-KILLED is non-nil, killed messages are also synchronized. If optional IGNORE-MSGDB is non-nil, current msgdb is thrown away except -flag status. If IGNORE-MSGDB is 'visible-only, only visible messages -\(the messages which are not in the killed-list\) are thrown away and -synchronized. +flag status. If NO-CHECK is non-nil, rechecking folder is skipped. Return a list of a cross-posted message number. If update process is interrupted, return nil.") (luna-define-method elmo-folder-synchronize ((folder elmo-folder) - &optional ignore-msgdb no-check) + &optional + disable-killed + ignore-msgdb + no-check) (let ((killed-list (elmo-folder-killed-list-internal folder)) (before-append t) number-alist old-msgdb diff diff-2 delete-list new-list new-msgdb mark - flag-table crossed after-append numbers) + flag-table crossed after-append) (setq old-msgdb (elmo-folder-msgdb folder)) (setq flag-table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (when ignore-msgdb (elmo-msgdb-flag-table (elmo-folder-msgdb folder) flag-table) - (elmo-folder-clear folder (eq ignore-msgdb 'visible-only))) - (setq numbers (sort (elmo-folder-list-messages folder nil t) '<)) + (elmo-folder-clear folder (not disable-killed))) (unless no-check (elmo-folder-check folder)) (condition-case nil (progn (message "Checking folder diff...") (setq diff (elmo-list-diff (elmo-folder-list-messages folder - (eq 'visible-only ignore-msgdb)) - numbers)) + (not disable-killed)) + (elmo-folder-list-messages + folder + (not disable-killed) + 'in-msgdb))) (message "Checking folder diff...done") (setq new-list (elmo-folder-confirm-appends (car diff))) ;; Set killed list as ((1 . MAX-OF-DISAPPEARED)) diff --git a/wl/ChangeLog b/wl/ChangeLog index 0446832..c104ea8 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,5 +1,15 @@ 2003-08-02 Yuuichi Teranishi + * wl-summary.el (wl-summary-rescan): Added argument disable-kill + (wl-summary-rescan): Set wl-summary-scored as nil. + (wl-summary-sync-force-update): Follow the change above. + (wl-summary-sync): Ditto. + (wl-summary-sync-update): Added argument disable-killed. + (wl-summary-insert-headers): Set visible-only argument for + elmo-folder-list-messages. + (wl-summary-input-range): Added update-nokill, update-noscore, + all-nokill, all-noscore and mark. + * Version number is increased to 2.11.5. * wl-draft.el (wl-draft): Set buffer-undo-list as nil. diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 0ef23c0..a02ff5a 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -847,7 +847,8 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (or ml-name (setq ml-name (match-string 1 delivered-to)))) (and (setq mailing-list (elmo-message-entity-field entity 'mailing-list)) - (string-match "\\(^\\|; \\)contact \\([^@]+\\)-[^-@]+@" mailing-list) ; *-help@, *-owner@, etc. + ;; *-help@, *-owner@, etc. + (string-match "\\(^\\|; \\)contact \\([^@]+\\)-[^-@]+@" mailing-list) (or ml-name (setq ml-name (match-string 2 mailing-list)))) (cons (and ml-name (car (split-string ml-name " "))) (and ml-count (string-to-int ml-count))))) @@ -880,7 +881,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (interactive) (wl-summary-rescan "list-info")) -(defun wl-summary-rescan (&optional sort-by) +(defun wl-summary-rescan (&optional sort-by disable-killed) "Rescan current folder without updating." (interactive) (let ((elmo-mime-charset wl-summary-buffer-mime-charset) @@ -890,7 +891,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (inhibit-read-only t) (buffer-read-only nil) (numbers (elmo-folder-list-messages wl-summary-buffer-elmo-folder - nil t)) ; in-msgdb + (not disable-killed) t)) ; in-msgdb expunged) (erase-buffer) (message "Re-scanning...") @@ -910,6 +911,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (setq wl-thread-entity-hashtb (elmo-make-hash (* num 2)) wl-thread-entity-list nil wl-thread-entities nil + wl-summary-scored nil wl-summary-buffer-number-list nil wl-summary-buffer-target-mark-list nil wl-summary-buffer-temp-mark-list nil @@ -945,7 +947,6 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (wl-thread-insert-top) (message "Inserting thread...done"))) (when wl-use-scoring - (setq wl-summary-scored nil) (wl-summary-score-headers (wl-summary-rescore-msgs wl-summary-buffer-number-list) t) @@ -1133,7 +1134,7 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (defun wl-summary-sync-force-update (&optional unset-cursor no-check) (interactive) - (wl-summary-sync-update unset-cursor nil no-check)) + (wl-summary-sync-update unset-cursor nil nil no-check)) (defsubst wl-summary-sync-all-init () (wl-summary-cleanup-temp-marks) @@ -1164,7 +1165,11 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." ((string= range "rescan-noscore") (let ((msg (wl-summary-message-number)) wl-use-scoring) - (wl-summary-rescan) + (wl-summary-rescan nil t) + (and msg (wl-summary-jump-to-msg msg)))) + ((string= range "mark") + (let ((msg (wl-summary-message-number))) + (wl-summary-sync-marks) (and msg (wl-summary-jump-to-msg msg)))) ((string= range "cache-status") (let ((msg (wl-summary-message-number))) @@ -1175,12 +1180,15 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (wl-summary-goto-folder-subr (concat "/" range "/" (elmo-folder-name-internal folder)) - 'force-update nil nil t)) + 'force-update nil nil t)) (t - (wl-summary-sync-update unset-cursor - (cond ((string= range "all") 'all) - ((string= range "all-visible") - 'visible-only))))))) + (let ((wl-use-scoring (if (string-match "noscore" range) + nil + wl-use-scoring))) + (wl-summary-sync-update unset-cursor + (or (string-match "nokill" range) + (string-match "noscore" range)) + (string-match "all" range))))))) (defvar wl-summary-edit-addresses-candidate-fields ;; First element becomes default. @@ -1710,7 +1718,10 @@ If ARG is non-nil, checking is omitted." (setq diffs (cdr diffs))) (if (interactive-p) (message "%s" mes))))) -(defun wl-summary-sync-update (&optional unset-cursor sync-all no-check) +(defun wl-summary-sync-update (&optional unset-cursor + disable-killed + sync-all + no-check) "Update the summary view to the newest folder status." (interactive) (let* ((folder wl-summary-buffer-elmo-folder) @@ -1733,14 +1744,17 @@ If ARG is non-nil, checking is omitted." ;;(wl-summary-flush-pending-append-operations seen-list)) (goto-char (point-max)) (wl-folder-confirm-existence folder (elmo-folder-plugged-p folder)) - (setq crossed (elmo-folder-synchronize folder sync-all no-check)) + (setq crossed (elmo-folder-synchronize folder + disable-killed + sync-all + no-check)) (if crossed (progn ;; Setup sync-all (if sync-all (wl-summary-sync-all-init)) (setq diff (elmo-list-diff (elmo-folder-list-messages folder - 'visible-only + (not disable-killed) 'in-msgdb) wl-summary-buffer-number-list)) (setq append-list (car diff)) @@ -2395,7 +2409,7 @@ If ARG, without confirm." wl-summary-alike-hashtb))) (defun wl-summary-insert-headers (folder func mime-decode) - (let ((numbers (elmo-folder-list-messages folder t t)) + (let ((numbers (elmo-folder-list-messages folder nil t)) ov this last alike) (buffer-disable-undo (current-buffer)) (make-local-variable 'wl-summary-alike-hashtb) @@ -3299,9 +3313,18 @@ Return non-nil if the mark is updated" (defun wl-summary-input-range (folder) "returns update or all or rescan." ;; for the case when parts are expanded in the bottom of the folder - (let ((input-range-list '("update" "all" "rescan" "first:" "last:" + (let ((input-range-list '("no-sync" + "first:" + "last:" "cache-status" - "no-sync" "rescan-noscore" "all-visible")) + "rescan" + "rescan-noscore" + "update" + "update-nokill" + "update-noscore" + "all" + "all-nokill" + "all-noscore")) (default (or (wl-get-assoc-list-value wl-folder-sync-range-alist folder) -- 1.7.10.4