(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.")
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
(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))
(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)))))
(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)
(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...")
(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
(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)
(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)
((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)))
(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.
(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)
;;(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))
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)
(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)