Sync with Oort Gnus (Translating gnus-ja.texi has not been done yet).
[elisp/gnus.git-] / lisp / imap.el
index 61306f1..1079cd2 100644 (file)
@@ -1098,11 +1098,11 @@ If EXAMINE is non-nil, do a read-only select."
 
 (defun imap-mailbox-examine-1 (mailbox &optional buffer)
   (with-current-buffer (or buffer (current-buffer))
-    (imap-mailbox-select-1 mailbox 'exmine)))
+    (imap-mailbox-select-1 mailbox 'examine)))
 
 (defun imap-mailbox-examine (mailbox &optional buffer)
   "Examine MAILBOX on server in BUFFER."
-  (imap-mailbox-select mailbox 'exmine buffer))
+  (imap-mailbox-select mailbox 'examine buffer))
 
 (defun imap-mailbox-unselect (&optional buffer)
   "Close current folder in BUFFER, without expunging articles."
@@ -1413,7 +1413,9 @@ is non-nil return theese properties."
     (imap-mailbox-put 'search 'dummy)
     (when (imap-ok-p (imap-send-command-wait (concat "UID SEARCH " predicate)))
       (if (eq (imap-mailbox-get-1 'search imap-current-mailbox) 'dummy)
-         (error "Missing SEARCH response to a SEARCH command")
+         (progn
+           (message "Missing SEARCH response to a SEARCH command (server not RFC compliant)...")
+           nil)
        (imap-mailbox-get-1 'search imap-current-mailbox)))))
 
 (defun imap-message-flag-permanent-p (flag &optional mailbox buffer)
@@ -1620,19 +1622,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))