(pop3-stream-length): New variable.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 29 Sep 2010 19:39:28 +0000 (21:39 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 29 Sep 2010 19:39:28 +0000 (21:39 +0200)
lisp/ChangeLog
lisp/pop3.el

index 10ece92..58e17f6 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * pop3.el (pop3-send-streaming-command, pop3-stream-length): New
+       variable.
+
        * nnimap.el (nnimap-insert-partial-structure): Get the type from the
        correct slot, too.
 
index d2953dc..20fe560 100644 (file)
@@ -82,6 +82,15 @@ valid value is 'apop'."
   :version "22.1" ;; Oort Gnus
   :group 'pop3)
 
+(defcustom pop3-stream-length 100
+  "How many messages should be requested at one time.
+The lower the number, the more latency-sensitive the fetching
+will be.  If your pop3 server doesn't support streaming at all,
+set this to 1."
+  :type 'number
+  :version "24.1"
+  :group 'pop3)
+
 (defcustom pop3-leave-mail-on-server nil
   "*Non-nil if the mail is to be left on the POP server after fetching.
 
@@ -156,7 +165,7 @@ Use streaming commands."
     (while (>= count i)
       (process-send-string process (format "%s %d\r\n" command i))
       ;; Only do 100 messages at a time to avoid pipe stalls.
-      (when (zerop (% i 100))
+      (when (zerop (% i pop3-stream-length))
        (pop3-wait-for-messages process i total-size))
       (incf i)))
   (pop3-wait-for-messages process count total-size))