wl-summary-set-mark.
(wl-summary-score-update-all-lines): Kill expunged messages.
* wl-expire.el (wl-expire-hide): Use elmo-folder-kill-messages.
* elmo-msgdb.el (elmo-msgdb-append-to-killed-list): Abolish.
* elmo-imap4.el (elmo-folder-list-messages-plugged): Fixed.
(elmo-imap4-folder-diff-plugged): Use uidnext to calculate number of
messages.
* elmo.el (elmo-folder-kill-messages-before): New function.
(elmo-folder-kill-messages): Ditto.
(elmo-folder-synchronize): Use elmo-folder-kill-messages-before.
* elmo-imap4.el (elmo-folder-list-messages-plugged):
Don't use elmo-msgdb-max-of-killed. It is harmful when messages are
killed not by synchronize (e.g. scoring).
+2003-07-22 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-msgdb.el (elmo-msgdb-append-to-killed-list): Abolish.
+
+ * elmo-imap4.el (elmo-folder-list-messages-plugged): Fixed.
+ (elmo-imap4-folder-diff-plugged): Use uidnext to calculate number of
+ messages.
+
+ * elmo.el (elmo-folder-kill-messages-before): New function.
+ (elmo-folder-kill-messages): Ditto.
+ (elmo-folder-synchronize): Use elmo-folder-kill-messages-before.
+
+ * elmo-imap4.el (elmo-folder-list-messages-plugged):
+ Don't use elmo-msgdb-max-of-killed. It is harmful when messages are
+ killed not by synchronize (e.g. scoring).
+
2003-07-22 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* elmo.el (elmo-folder-search-fast): Return t if condition is not
(luna-define-method elmo-folder-list-messages-plugged ((folder
elmo-imap4-folder)
- &optional nohide)
+ &optional
+ enable-killed)
(elmo-imap4-list folder
- (let ((max (elmo-msgdb-max-of-killed
- (elmo-folder-killed-list-internal folder))))
- (if (or nohide
- (null (eq max 0)))
- (format "uid %d:*" (1+ max))
+ (let ((killed
+ (elmo-folder-killed-list-internal
+ folder)))
+ (if (and killed
+ (eq (length killed) 1)
+ (consp (car killed))
+ (eq (car (car killed)) 1))
+ (format "uid %d:*" (cdr (car killed)))
"all"))))
(luna-define-method elmo-folder-list-unreads-plugged
(defsubst elmo-imap4-folder-diff-plugged (folder)
(let ((session (elmo-imap4-get-session folder))
- messages new unread response killed)
+ messages new unread response killed uidnext)
;;; (elmo-imap4-commit spec)
(with-current-buffer (elmo-network-session-buffer session)
(setq elmo-imap4-status-callback nil)
(elmo-imap4-mailbox
(elmo-imap4-folder-mailbox-internal
folder))
- " (recent unseen messages)")))
+ " (recent unseen messages uidnext)")))
(setq response (elmo-imap4-response-value response 'status))
(setq messages (elmo-imap4-response-value response 'messages))
+ (setq uidnext (elmo-imap4-response-value response 'uidnext))
(setq killed (elmo-msgdb-killed-list-load (elmo-folder-msgdb-path folder)))
- (if killed
- (setq messages (- messages
- (elmo-msgdb-killed-list-length
- killed))))
+ ;;
+ (when killed
+ (when (and (consp (car killed))
+ (eq (car (car killed)) 1))
+ (setq messages (- uidnext (cdr (car killed)) 1)))
+ (setq messages (- messages
+ (elmo-msgdb-killed-list-length (cdr killed)))))
(setq new (elmo-imap4-response-value response 'recent)
unread (elmo-imap4-response-value response 'unseen))
(if (< unread new) (setq new unread))
(defun elmo-msgdb-set-as-killed (killed-list msg)
(elmo-number-set-append killed-list msg))
-(defun elmo-msgdb-append-to-killed-list (folder msgs)
- (elmo-folder-set-killed-list-internal
- folder
- (elmo-number-set-append-list
- (elmo-folder-killed-list-internal folder)
- msgs)))
-
(defun elmo-msgdb-killed-list-length (killed-list)
(let ((killed killed-list)
(ret-val 0))
(or result
(and err (signal (car err) (cdr err))))))
+(defun elmo-folder-kill-messages-before (folder msg)
+ (elmo-folder-set-killed-list-internal
+ folder
+ (list (cons 1 msg))))
+
+(defun elmo-folder-kill-messages (folder numbers)
+ "Kill(hide) messages in the FOLDER with NUMBERS."
+ (elmo-folder-set-killed-list-internal
+ folder
+ (elmo-number-set-append-list (elmo-folder-killed-list-internal
+ folder) numbers)))
+
+
(luna-define-method elmo-folder-clear ((folder elmo-folder)
&optional keep-killed)
(unless keep-killed
(condition-case nil
(progn
(message "Checking folder diff...")
- ;; TODO: killed list is loaded in elmo-folder-open and
- ;; list-messages use internal killed-list-folder.
(setq diff (elmo-list-diff (elmo-folder-list-messages
folder
(eq 'visible-only ignore-msgdb))
numbers))
(message "Checking folder diff...done")
(setq new-list (elmo-folder-confirm-appends (car diff)))
- ;; Set killed list.
+ ;; Set killed list as ((1 . MAX-OF-DISAPPEARED))
(when (and (not (eq (length (car diff))
(length new-list)))
(setq diff-2 (elmo-list-diff (car diff) new-list)))
- (elmo-msgdb-append-to-killed-list folder (car diff-2)))
+ (elmo-folder-kill-messages-before folder
+ (nth (- (length (car diff-2)) 1)
+ (car diff-2))))
(setq delete-list (cadr diff))
(if (or (equal diff '(nil nil))
(equal diff '(nil))
+2003-07-22 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl-score.el (wl-summary-score-update-all-lines): Use
+ wl-summary-set-mark.
+ (wl-summary-score-update-all-lines): Kill expunged messages.
+
+ * wl-expire.el (wl-expire-hide): Use elmo-folder-kill-messages.
+
2003-07-21 Yuuichi Teranishi <teranisi@gohome.org>
* wl-score.el (wl-summary-score-update-all-lines): Don't use msgdb
(let ((mess (format "Hiding %s msgs..." (length hide-list))))
(message "%s" mess)
(elmo-folder-detach-messages folder hide-list)
- (elmo-msgdb-append-to-killed-list folder hide-list)
+ (elmo-folder-kill-messages folder hide-list)
(elmo-folder-commit folder)
(message "%sdone" mess)
(cons hide-list (length hide-list))))
((and wl-summary-target-above
(> score wl-summary-target-above))
(if visible
- (wl-summary-mark-line "*"))
- (setq wl-summary-buffer-target-mark-list
- (cons num wl-summary-buffer-target-mark-list))))
+ (wl-summary-set-mark "*"))))
(setq alist (cdr alist))
(when (> count elmo-display-progress-threshold)
(setq i (1+ i))
'wl-summary-score-update-all-lines "Updating score..."
(/ (* i 100) count))))
(when dels
- (let ((marks dels))
- (while marks
- (elmo-message-set-flag wl-summary-buffer-elmo-folder
- (pop marks) 'read)))
- ;; XXX Does this work?? XXX
- ;; XXX should it be in the killed list?
+ ;;(let ((marks dels))
+ ;;(while marks
+ ;;(elmo-message-set-flag wl-summary-buffer-elmo-folder
+ ;; (pop marks) 'read)))
+ (elmo-folder-kill-messages wl-summary-buffer-elmo-folder dels)
(wl-summary-delete-messages-on-buffer dels))
(when (and update update-unread)
;; Update Folder mode