From 6b6e627642b4204778c7de18798c2e734030cce6 Mon Sep 17 00:00:00 2001 From: okada Date: Wed, 19 Jul 2000 20:02:52 +0000 Subject: [PATCH] * elmo-pop3.el (elmo-pop3-commit): Do nothing when unplugged. * elmo-imap4.el (elmo-imap4-commit): Ditto. --- elmo/ChangeLog | 5 +++++ elmo/elmo-imap4.el | 34 ++++++++++++++++++---------------- elmo/elmo-pop3.el | 5 +++-- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7bb14a8..43a3598 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2000-07-20 Kenichi OKADA + + * elmo-pop3.el (elmo-pop3-commit): Do nothing when unplugged. + * elmo-imap4.el (elmo-imap4-commit): Ditto. + 2000-07-18 Yuuichi Teranishi * elmo-pop3.el (elmo-pop3-use-uidl): New variable. diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index b3d4684..4326e2d 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -427,22 +427,24 @@ Debug information is inserted in the buffer \"*IMAP4 DEBUG*\"") (elmo-imap4-read-response buffer process)))) (defun elmo-imap4-commit (spec) - (save-excursion - (let ((connection (elmo-imap4-get-connection spec)) - response ret-val beg end) - (and (not (null (elmo-imap4-spec-mailbox spec))) - (if (not (string= (elmo-imap4-connection-get-cwf connection) - (elmo-imap4-spec-mailbox spec))) - (if (null (setq response - (elmo-imap4-select-folder - (elmo-imap4-spec-mailbox spec) - connection))) - (error "Select folder failed")) - (if elmo-imap4-use-select-to-update-status - (elmo-imap4-select-folder - (elmo-imap4-spec-mailbox spec) - connection) - (elmo-imap4-check connection))))))) + (if (elmo-plugged-p (elmo-imap4-spec-hostname spec) + (elmo-imap4-spec-port spec)) + (save-excursion + (let ((connection (elmo-imap4-get-connection spec)) + response ret-val beg end) + (and (not (null (elmo-imap4-spec-mailbox spec))) + (if (not (string= (elmo-imap4-connection-get-cwf connection) + (elmo-imap4-spec-mailbox spec))) + (if (null (setq response + (elmo-imap4-select-folder + (elmo-imap4-spec-mailbox spec) + connection))) + (error "Select folder failed")) + (if elmo-imap4-use-select-to-update-status + (elmo-imap4-select-folder + (elmo-imap4-spec-mailbox spec) + connection) + (elmo-imap4-check connection)))))))) (defun elmo-imap4-check (connection) (let ((process (elmo-imap4-connection-get-process connection))) diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index cd2d074..9a7f6d6 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -819,8 +819,9 @@ 'elmo-generic-list-folder-important) (defun elmo-pop3-commit (spec) - (elmo-pop3-close-connection - (elmo-pop3-get-connection spec 'if-exists))) + (if (elmo-plugged-p (elmo-pop3-spec-hostname spec) (elmo-pop3-spec-port spec)) + (elmo-pop3-close-connection + (elmo-pop3-get-connection spec 'if-exists)))) (provide 'elmo-pop3) -- 1.7.10.4