From c9f7b330d18fff8b20da481229802b31b3b1f32e Mon Sep 17 00:00:00 2001 From: teranisi Date: Wed, 30 Jul 2003 04:18:12 +0000 Subject: [PATCH] * elmo-localdir.el (elmo-folder-append-messages): Don't refer mark nor message-id when msgdb of source folder is not loaded. * elmo.el (elmo-generic-folder-append-messages): Ditto. * elmo-maildir.el (elmo-folder-append-messages): Ditto. --- elmo/ChangeLog | 9 +++++++++ elmo/elmo-localdir.el | 13 ++++++++----- elmo/elmo-maildir.el | 11 +++++++---- elmo/elmo-pipe.el | 2 +- elmo/elmo.el | 12 ++++++++---- 5 files changed, 33 insertions(+), 14 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 5410bda..9533fab 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,12 @@ +2003-07-30 Yuuichi Teranishi + + * elmo-localdir.el (elmo-folder-append-messages): Don't refer + mark nor message-id when msgdb of source folder is not loaded. + + * elmo.el (elmo-generic-folder-append-messages): Ditto. + + * elmo-maildir.el (elmo-folder-append-messages): Ditto. + 2003-07-29 Yuuichi Teranishi * elmo.el (elmo-folder-length): Don't require msgdb. diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 14f30d3..7deaf26 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -228,13 +228,15 @@ ((folder elmo-localdir-folder) src-folder numbers &optional same-number) (if (elmo-folder-message-file-p src-folder) - (let ((dir (elmo-localdir-folder-directory-internal folder)) + (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder)))) + (dir (elmo-localdir-folder-directory-internal folder)) (table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (succeeds numbers) (next-num (1+ (car (elmo-folder-status folder)))) mark flag id) (while numbers - (setq mark (elmo-message-mark src-folder (car numbers)) + (setq mark (and src-msgdb-exists + (elmo-message-mark src-folder (car numbers))) flag (cond ((null mark) 'read) ((member mark (elmo-msgdb-answered-marks)) @@ -248,9 +250,10 @@ (int-to-string (if same-number (car numbers) next-num)) dir)) - ;; src folder's msgdb is loaded. - (when (setq id (elmo-message-field src-folder (car numbers) - 'message-id)) + ;; save flag-table only when src folder's msgdb is loaded. + (when (setq id (and src-msgdb-exists + (elmo-message-field src-folder (car numbers) + 'message-id))) (elmo-flag-table-set table id flag)) (elmo-progress-notify 'elmo-folder-move-messages) (if (and (setq numbers (cdr numbers)) diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index 79c1597..9492b01 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -483,12 +483,14 @@ file name for maildir directories." ((folder elmo-maildir-folder) src-folder numbers &optional same-number) (if (elmo-folder-message-file-p src-folder) - (let ((dir (elmo-maildir-folder-directory-internal folder)) + (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder)))) + (dir (elmo-maildir-folder-directory-internal folder)) (table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (succeeds numbers) filename mark flag id) (dolist (number numbers) - (setq mark (elmo-message-mark src-folder (car numbers)) + (setq mark (and src-msgdb-exists + (elmo-message-mark src-folder (car numbers))) flag (cond ((null mark) 'read) ((member mark (elmo-msgdb-answered-marks)) @@ -505,8 +507,9 @@ file name for maildir directories." (concat "new/" (file-name-nondirectory filename)) dir)) ;; src folder's msgdb is loaded. - (when (setq id (elmo-message-field src-folder (car numbers) - 'message-id)) + (when (setq id (and src-msgdb-exists + (elmo-message-field src-folder (car numbers) + 'message-id))) (elmo-flag-table-set table id flag)) (elmo-progress-notify 'elmo-folder-move-messages)) (when (elmo-folder-persistent-p folder) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index 8c3aa2e..eac1186 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -109,7 +109,7 @@ msgs len) (message "Checking %s..." (elmo-folder-name-internal src)) ;; Warnnig: some function requires msgdb - ;; but elmo-folder-open-internal do not load msgdb. + ;; but elmo-folder-open-internal do not load msgdb. (elmo-folder-open-internal src) (setq msgs (elmo-pipe-folder-list-target-messages src ignore-list) len (length msgs)) diff --git a/elmo/elmo.el b/elmo/elmo.el index 5af1bf0..13e6cc5 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1019,15 +1019,19 @@ NUMBERS is a list of message numbers, messages are searched from the list." (defun elmo-generic-folder-append-messages (folder src-folder numbers same-number) - (let (unseen table flag mark - succeed-numbers failure cache id) + (let ((src-msgdb-exists (not (zerop (elmo-folder-length src-folder)))) + unseen table flag mark + succeed-numbers failure cache id) (setq table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (with-temp-buffer (set-buffer-multibyte nil) (while numbers (setq failure nil - id (elmo-message-field src-folder (car numbers) 'message-id) - mark (elmo-message-mark src-folder (car numbers)) + id (and src-msgdb-exists + (elmo-message-field src-folder (car numbers) + 'message-id)) + mark (and src-msgdb-exists + (elmo-message-mark src-folder (car numbers))) flag (and id (cond ((null mark) 'read) -- 1.7.10.4