From 5af32641077077cb50bac42a58e6bb108a6cfa6e Mon Sep 17 00:00:00 2001 From: yoichi Date: Mon, 16 Apr 2007 11:56:22 +0000 Subject: [PATCH] * elmo-imap4.el (elmo-folder-delete): Don't call close for mailbox with \Noselect attribute. --- elmo/ChangeLog | 5 +++++ elmo/elmo-imap4.el | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7c26b10..bf9cb76 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2007-04-16 Yoichi NAKAYAMA + + * elmo-imap4.el (elmo-folder-delete): Don't call close for mailbox + with \Noselect attribute. + 2007-04-15 Yoichi NAKAYAMA * elmo-imap4.el (elmo-folder-list-subfolders): Fix handling of diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 49dad35..451066a 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -2087,8 +2087,9 @@ Return nil if no complete line has arrived." t) (luna-define-method elmo-folder-delete ((folder elmo-imap4-folder)) - (let ((msgs (and (elmo-folder-exists-p folder) - (elmo-folder-list-messages folder)))) + (let* ((exists (elmo-folder-exists-p folder)) + (msgs (and exists + (elmo-folder-list-messages folder)))) (when (yes-or-no-p (format "%sDelete msgdb and substance of \"%s\"? " (if (> (length msgs) 0) (format "%d msg(s) exists. " (length msgs)) @@ -2097,7 +2098,9 @@ Return nil if no complete line has arrived." (let ((session (elmo-imap4-get-session folder))) (when (elmo-imap4-folder-mailbox-internal folder) (when msgs (elmo-folder-delete-messages-internal folder msgs)) - (elmo-imap4-send-command-wait session "close") + ;; close selected mailbox except one with \Noselect attribute + (when exists + (elmo-imap4-send-command-wait session "close")) (elmo-imap4-send-command-wait session (list "delete " -- 1.7.10.4