From: teranisi Date: Tue, 22 Jul 2003 13:36:55 +0000 (+0000) Subject: * elmo-pop3.el (elmo-pop3-exists-exactly): Set default value as nil. X-Git-Tag: elmo-mark-restart~9 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d92ecd5a78dde62b31dcb8cbcb0721be3648ebb;p=elisp%2Fwanderlust.git * elmo-pop3.el (elmo-pop3-exists-exactly): Set default value as nil. (elmo-pop3-get-session): Make msgdb directory after session. (elmo-folder-exists-p): Check exactly at the first time even when the elmo-pop3-exists-exactly is nil. * elmo-pipe.el (elmo-folder-open-internal): Don't drain here. (elmo-folder-list-messages): Define instead of elmo-folder-list-messages-internal. (elmo-folder-check): Check destination folder. (elmo-folder-synchronize): Drain the pipe. * elmo-localdir.el (elmo-folder-append-messages): Don't cause an error when msgdb is not loaded. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index dc8148a..dc83a66 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,19 @@ 2003-07-22 Yuuichi Teranishi + * elmo-pop3.el (elmo-pop3-exists-exactly): Set default value as nil. + (elmo-pop3-get-session): Make msgdb directory after session. + (elmo-folder-exists-p): Check exactly at the first time even when the + elmo-pop3-exists-exactly is nil. + + * elmo-pipe.el (elmo-folder-open-internal): Don't drain here. + (elmo-folder-list-messages): Define instead of + elmo-folder-list-messages-internal. + (elmo-folder-check): Check destination folder. + (elmo-folder-synchronize): Drain the pipe. + + * elmo-localdir.el (elmo-folder-append-messages): Don't cause an error + when msgdb is not loaded. + * elmo-msgdb.el (elmo-msgdb-append-to-killed-list): Abolish. * elmo-imap4.el (elmo-folder-list-messages-plugged): Fixed. diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 780031b..4ed3d22 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -232,7 +232,7 @@ (table (elmo-flag-table-load (elmo-folder-msgdb-path folder))) (succeeds numbers) (next-num (1+ (car (elmo-folder-status folder)))) - mark flag) + mark flag id) (while numbers (setq mark (elmo-message-mark src-folder (car numbers)) flag (cond @@ -248,11 +248,10 @@ (int-to-string (if same-number (car numbers) next-num)) dir)) - (elmo-flag-table-set table - (elmo-message-field - src-folder (car numbers) - 'message-id) - flag) + ;; src folder's msgdb is loaded. + (when (setq id (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)) (not same-number)) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index cc9a2d5..4c22abe 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -149,27 +149,16 @@ copied-list)) (luna-define-method elmo-folder-open-internal ((folder elmo-pipe-folder)) - (elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder)) - (let ((src-folder (elmo-pipe-folder-src-internal folder)) - (dst-folder (elmo-pipe-folder-dst-internal folder))) - (when (and (elmo-folder-plugged-p src-folder) - (elmo-folder-plugged-p dst-folder)) - (if (elmo-pipe-folder-copy-internal folder) - (elmo-pipe-folder-copied-list-save - folder - (elmo-pipe-drain src-folder - dst-folder - 'copy - (elmo-pipe-folder-copied-list-load folder))) - (elmo-pipe-drain src-folder dst-folder))))) + (elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder))) (luna-define-method elmo-folder-close-internal ((folder elmo-pipe-folder)) (elmo-folder-close-internal(elmo-pipe-folder-dst-internal folder))) -(luna-define-method elmo-folder-list-messages-internal - ((folder elmo-pipe-folder) &optional nohide) - (elmo-folder-list-messages-internal (elmo-pipe-folder-dst-internal - folder) nohide)) +(luna-define-method elmo-folder-list-messages ((folder elmo-pipe-folder) + &optional visible-only in-msgdb) + ;; Use target folder's killed-list in the pipe folder. + (elmo-folder-list-messages (elmo-pipe-folder-dst-internal + folder) visible-only in-msgdb)) (luna-define-method elmo-folder-list-unreads ((folder elmo-pipe-folder)) (elmo-folder-list-unreads (elmo-pipe-folder-dst-internal folder))) @@ -236,8 +225,7 @@ (elmo-message-use-cache-p (elmo-pipe-folder-dst-internal folder) number)) (luna-define-method elmo-folder-check ((folder elmo-pipe-folder)) - (elmo-folder-close-internal folder) - (elmo-folder-open-internal folder)) + (elmo-folder-check (elmo-pipe-folder-dst-internal folder))) (luna-define-method elmo-folder-plugged-p ((folder elmo-pipe-folder)) (and (elmo-folder-plugged-p (elmo-pipe-folder-src-internal folder)) @@ -329,6 +317,18 @@ (luna-define-method elmo-folder-synchronize ((folder elmo-pipe-folder) &optional ignore-msgdb no-check) + (let ((src-folder (elmo-pipe-folder-src-internal folder)) + (dst-folder (elmo-pipe-folder-dst-internal folder))) + (when (and (elmo-folder-plugged-p src-folder) + (elmo-folder-plugged-p dst-folder)) + (if (elmo-pipe-folder-copy-internal folder) + (elmo-pipe-folder-copied-list-save + folder + (elmo-pipe-drain src-folder + dst-folder + 'copy + (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)) diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 0d9c9d7..201c670 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -56,7 +56,11 @@ If server doesn't accept asynchronous commands, this variable should be set as non-nil.") -(defvar elmo-pop3-exists-exactly t) +(defcustom elmo-pop3-exists-exactly nil + "If non-nil, POP3 folder existence is checked everytime before the session." + :type 'boolean + :group 'elmo) + (defvar sasl-mechanism-alist) (defvar elmo-pop3-total-size nil) @@ -168,19 +172,23 @@ If IF-EXISTS is `any-exists', get BIFF session or normal session if exists." nil (elmo-pop3-folder-use-uidl-internal folder)))) - (if (eq if-exists 'any-exists) - (or (elmo-network-get-session 'elmo-pop3-session - "POP3" - folder if-exists) - (elmo-network-get-session 'elmo-pop3-session - "BIFF-POP3" - folder if-exists)) - (elmo-network-get-session 'elmo-pop3-session - (concat - (if (elmo-folder-biff-internal folder) - "BIFF-") - "POP3") - folder if-exists)))) + (prog1 + (if (eq if-exists 'any-exists) + (or (elmo-network-get-session 'elmo-pop3-session + "POP3" + folder if-exists) + (elmo-network-get-session 'elmo-pop3-session + "BIFF-POP3" + folder if-exists)) + (elmo-network-get-session 'elmo-pop3-session + (concat + (if (elmo-folder-biff-internal folder) + "BIFF-") + "POP3") + folder if-exists)) + ;; For saving existency. + (unless (file-exists-p (elmo-folder-msgdb-path folder)) + (elmo-make-directory (elmo-folder-msgdb-path folder)))))) (defun elmo-pop3-send-command (process command &optional no-erase no-log) (with-current-buffer (process-buffer process) @@ -469,7 +477,11 @@ If IF-EXISTS is `any-exists', get BIFF session or normal session if exists." (setq session (elmo-pop3-get-session folder)) (if session (elmo-network-close-session session))))) - (file-directory-p (elmo-folder-msgdb-path folder)))) + (or (file-directory-p (elmo-folder-msgdb-path folder)) + ;; First time. + (when (elmo-folder-plugged-p folder) + (let ((elmo-pop3-exists-exactly t)) + (elmo-folder-exists-p folder)))))) (defun elmo-pop3-parse-uidl-response (string) (let ((buffer (current-buffer))