* elmo-pop3.el (elmo-pop3-commit): Do nothing when unplugged.
authorokada <okada>
Wed, 19 Jul 2000 20:02:52 +0000 (20:02 +0000)
committerokada <okada>
Wed, 19 Jul 2000 20:02:52 +0000 (20:02 +0000)
* elmo-imap4.el (elmo-imap4-commit): Ditto.

elmo/ChangeLog
elmo/elmo-imap4.el
elmo/elmo-pop3.el

index 7bb14a8..43a3598 100644 (file)
@@ -1,3 +1,8 @@
+2000-07-20  Kenichi OKADA <okada@opaopa.org>
+
+       * elmo-pop3.el (elmo-pop3-commit): Do nothing when unplugged.
+       * elmo-imap4.el (elmo-imap4-commit): Ditto.
+
 2000-07-18  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo-pop3.el (elmo-pop3-use-uidl): New variable.
index b3d4684..4326e2d 100644 (file)
@@ -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)))
index cd2d074..9a7f6d6 100644 (file)
   '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)