2001-08-17 Simon Josefsson <jas@extundo.com>
authorSimon Josefsson <jas@extundo.com>
Fri, 17 Aug 2001 18:24:00 +0000 (18:24 +0000)
committerSimon Josefsson <jas@extundo.com>
Fri, 17 Aug 2001 18:24:00 +0000 (18:24 +0000)
* imap.el (imap-wait-for-tag): If process-status isn't open or
run, return nil instead of sit-for looping.

lisp/ChangeLog
lisp/imap.el

index b80af58..95c411c 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-17  Simon Josefsson  <jas@extundo.com>
+
+       * imap.el (imap-wait-for-tag): If process-status isn't open or
+       run, return nil instead of sit-for looping.
+
 2001-08-17 10:41:14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * lpath.el (featurep): fbind xml-parse-region.
index 20437d0..7ae1df3 100644 (file)
@@ -1631,19 +1631,19 @@ on failure."
 (defun imap-wait-for-tag (tag &optional buffer)
   (with-current-buffer (or buffer (current-buffer))
     (while (and (null imap-continuation)
+               (memq (process-status imap-process) '(open run))
                (< imap-reached-tag tag))
-      (or (and (not (memq (process-status imap-process) '(open run)))
-              (sit-for 1))
-         (let ((len (/ (point-max) 1024))
-               message-log-max)
-           (unless (< len 10)
-             (message "imap read: %dk" len))
-           (accept-process-output imap-process 1))))
+      (let ((len (/ (point-max) 1024))
+           message-log-max)
+       (unless (< len 10)
+         (message "imap read: %dk" len))
+       (accept-process-output imap-process 1)))
     (message "")
-    (or (assq tag imap-failed-tags)
-       (if imap-continuation
-           'INCOMPLETE
-         'OK))))
+    (and (memq (process-status imap-process) '(open run))
+        (or (assq tag imap-failed-tags)
+            (if imap-continuation
+                'INCOMPLETE
+              'OK)))))
 
 (defun imap-sentinel (process string)
   (delete-process process))