[gnus git] branch master updated: m0-5-109-gac8c999 =1= nnimap: revert synchronous listing of nnimap

Julien Danjou <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  ac8c99968624159a827d8f6db842d9fcc22c7a60 (commit)
      from  0c2487daffa041d5c425ac4e46f09122865e7c86 (commit)


- Log -----------------------------------------------------------------
commit ac8c99968624159a827d8f6db842d9fcc22c7a60
Author: Julien Danjou <[email protected]>
Date:   Wed Sep 5 11:35:16 2012 +0200

    nnimap: revert synchronous listing of nnimap
    
    Signed-off-by: Julien Danjou <[email protected]>

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 558add9..f7b26e9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-05  Julien Danjou  <[email protected]>
+
+	* nnimap.el (nnimap-request-list): Revert change that made listing
+	synchronous.
+
 2012-09-03  Lars Ingebrigtsen  <[email protected]>
 
 	* dgnushack.el: XEmacs 21.5 compilation fix.
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 53bc2dd..5783f29 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1200,16 +1200,29 @@ If LIMIT, first try to limit the search to the N last articles."
   (when (nnimap-change-group nil server)
     (with-current-buffer nntp-server-buffer
       (erase-buffer)
-      (dolist (response
+      (let ((groups
                (with-current-buffer (nnimap-buffer)
-                 ;; Build a list of (group result-of-EXAMINE) for each group
-                 (mapcar
-                  (lambda (group)
-                    (list group (cdr (nnimap-change-group group server nil t))))
-                  (nnimap-get-groups))))
-        (let ((group (encode-coding-string (car response) 'utf-8))
-              (response (cadr response)))
-          (when (equal (caar response) "OK")
+	       (nnimap-get-groups)))
+	    sequences responses)
+	(when groups
+	  (with-current-buffer (nnimap-buffer)
+	    (setf (nnimap-group nnimap-object) nil)
+	    (dolist (group groups)
+	      (setf (nnimap-examined nnimap-object) group)
+	      (push (list (nnimap-send-command "EXAMINE %S"
+					       (utf7-encode group t))
+			  group)
+		    sequences))
+	    (nnimap-wait-for-response (caar sequences))
+	    (setq responses
+		  (nnimap-get-responses (mapcar #'car sequences))))
+	  (dolist (response responses)
+	    (let* ((sequence (car response))
+		   (response (cadr response))
+		   (group (cadr (assoc sequence sequences)))
+		   (egroup (encode-coding-string group 'utf-8)))
+	      (when (and group
+			 (equal (caar response) "OK"))
             (let ((uidnext (nnimap-find-parameter "UIDNEXT" response))
                 highest exists)
               (dolist (elem response)
@@ -1219,16 +1232,16 @@ If LIMIT, first try to limit the search to the N last articles."
                 (setq highest (1- (string-to-number (car uidnext)))))
               (cond
                ((null highest)
-                (insert (format "%S 0 1 y\n" group)))
+		    (insert (format "%S 0 1 y\n" egroup)))
                ((zerop exists)
                 ;; Empty group.
-                (insert (format "%S %d %d y\n" group
+		    (insert (format "%S %d %d y\n" egroup
                                 highest (1+ highest))))
                (t
                 ;; Return the widest possible range.
-                (insert (format "%S %d 1 y\n" group
+		    (insert (format "%S %d 1 y\n" egroup
                                 (or highest exists)))))))))
-      t)))
+	  t)))))
 
 (deffoo nnimap-request-newgroups (date &optional server)
   (when (nnimap-change-group nil server)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    5 ++++
 lisp/nnimap.el |   71 +++++++++++++++++++++++++++++++++-----------------------
 2 files changed, 47 insertions(+), 29 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.