From 17b89f5754995e14ddb5c912ce8bf3df86a2cd1f Mon Sep 17 00:00:00 2001 From: teranisi Date: Sun, 3 Oct 2004 09:22:48 +0000 Subject: [PATCH] * elmo.el (elmo-message-flags): Abolish optional argument `msgid'. (elmo-generic-folder-append-messages): If src message exists but has no flag, pass (read) for the FLAG argument of `elmo-folder-append-buffer'. Otherwise, pass nil. * elmo-split.el (elmo-split-subr): Likewise. * elmo-pipe.el (elmo-message-flags): Abolish optional argument `msgid'. * elmo-multi.el (elmo-message-flags): Ditto. * elmo-filter.el (elmo-message-flags): Ditto. --- elmo/ChangeLog | 13 +++++++++++++ elmo/elmo-filter.el | 5 ++--- elmo/elmo-multi.el | 5 ++--- elmo/elmo-pipe.el | 5 ++--- elmo/elmo-split.el | 14 ++++++++++---- elmo/elmo.el | 28 +++++++++++----------------- 6 files changed, 40 insertions(+), 30 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index cf709ee..263839b 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,18 @@ 2004-10-03 Yuuichi Teranishi + * elmo.el (elmo-message-flags): Abolish optional argument `msgid'. + (elmo-generic-folder-append-messages): If src message exists but + has no flag, pass (read) for the FLAG argument of + `elmo-folder-append-buffer'. Otherwise, pass nil. + + * elmo-split.el (elmo-split-subr): Likewise. + + * elmo-pipe.el (elmo-message-flags): Abolish optional argument `msgid'. + + * elmo-multi.el (elmo-message-flags): Ditto. + + * elmo-filter.el (elmo-message-flags): Ditto. + * elmo.el (elmo-folder-append-buffer): Fix docstring. (elmo-generic-folder-append-messages): If elmo-message-flags return nil, pass (read) for the FLAG argument of elmo-folder-append-buffer. diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index a4be176..52ce271 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -317,10 +317,9 @@ (elmo-filter-folder-target-internal folder) number flag)) -(luna-define-method elmo-message-flags ((folder elmo-filter-folder) number - &optional msgid) +(luna-define-method elmo-message-flags ((folder elmo-filter-folder) number) (elmo-message-flags (elmo-filter-folder-target-internal folder) - number msgid)) + number)) (luna-define-method elmo-message-set-cached ((folder elmo-filter-folder) number cached) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 3df09b0..c709fc3 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -206,10 +206,9 @@ (let ((pair (elmo-multi-real-folder-number folder number))) (elmo-message-flag-available-p (car pair) (cdr pair) flag))) -(luna-define-method elmo-message-flags ((folder elmo-multi-folder) number - &optional msgid) +(luna-define-method elmo-message-flags ((folder elmo-multi-folder) number) (let ((pair (elmo-multi-real-folder-number folder number))) - (elmo-message-flags (car pair) (cdr pair) msgid))) + (elmo-message-flags (car pair) (cdr pair)))) (defun elmo-multi-split-numbers (folder numlist &optional as-is) (let ((numbers (sort numlist '<)) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index a6bddd3..5e02dab 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -341,9 +341,8 @@ (luna-define-method elmo-folder-count-flags ((folder elmo-pipe-folder)) (elmo-folder-count-flags (elmo-pipe-folder-dst-internal folder))) -(luna-define-method elmo-message-flags ((folder elmo-pipe-folder) number - &optional msgid) - (elmo-message-flags (elmo-pipe-folder-dst-internal folder) number msgid)) +(luna-define-method elmo-message-flags ((folder elmo-pipe-folder) number) + (elmo-message-flags (elmo-pipe-folder-dst-internal folder) number)) (luna-define-method elmo-message-field ((folder elmo-pipe-folder) number field) diff --git a/elmo/elmo-split.el b/elmo/elmo-split.el index 310f031..5fb5fbe 100644 --- a/elmo/elmo-split.el +++ b/elmo/elmo-split.el @@ -337,10 +337,16 @@ If prefix argument ARG is specified, do a reharsal (no harm)." nil (current-buffer) 'unread)) (run-hooks 'elmo-split-fetch-hook) (setq elmo-split-message-entity (mime-parse-buffer)) - (setq flags (elmo-message-flags - folder - msg - (elmo-msgdb-get-message-id-from-buffer))) + (setq flags + (let ((this-id (elmo-message-field folder + msg + 'message-id))) + (and this-id + (string= this-id + (elmo-msgdb-get-message-id-from-buffer)) + (or (elmo-message-flags folder msg) + ;; message exists, but no flag. + '(read))))) (catch 'terminate (dolist (rule (append elmo-split-rule default-rule)) (setq elmo-split-match-string-internal nil) diff --git a/elmo/elmo.el b/elmo/elmo.el index e000593..2d7c04a 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -459,25 +459,17 @@ Return newly created temporary directory name which contains temporary files.") (luna-define-generic elmo-message-file-p (folder number) "Return t if message in the FOLDER with NUMBER is a file.") -(luna-define-generic elmo-message-flags (folder number &optional msgid) +(luna-define-generic elmo-message-flags (folder number) "Return a list of flags. FOLDER is a ELMO folder structure. -NUMBER is a number of the message. -If optional argument MSGID is specified, -the message with NUMBER checks whether it has MSGID.") +NUMBER is a number of the message.") (luna-define-method elmo-message-flag-available-p ((folder elmo-folder) number flag) (elmo-msgdb-flag-available-p (elmo-folder-msgdb folder) flag)) -(luna-define-method elmo-message-flags ((folder elmo-folder) number - &optional msgid) - (if msgid - (let ((this-id (elmo-message-field folder number 'message-id))) - (and this-id - (string= this-id msgid) - (elmo-msgdb-flags (elmo-folder-msgdb folder) number))) - (elmo-msgdb-flags (elmo-folder-msgdb folder) number))) +(luna-define-method elmo-message-flags ((folder elmo-folder) number) + (elmo-msgdb-flags (elmo-folder-msgdb folder) number)) (defsubst elmo-message-flagged-p (folder number flag) "Return non-nil if the message is set FLAG. @@ -1058,11 +1050,13 @@ If optional argument IF-EXISTS is nil, load on demand. (> (buffer-size) 0) (elmo-folder-append-buffer folder - (or (elmo-message-flags - src-folder - (car numbers) - (elmo-msgdb-get-message-id-from-buffer)) - '(read)) + (let ((this-id (elmo-message-field src-folder (car numbers) + 'message-id))) + (and this-id + (string= this-id + (elmo-msgdb-get-message-id-from-buffer)) + (or (elmo-message-flags src-folder (car numbers)) + '(read)))) (if same-number (car numbers)))))) (error (setq failure t))) ;; FETCH & APPEND finished -- 1.7.10.4