emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105931: Merge changes made in Gnus t


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105931: Merge changes made in Gnus trunk.
Date: Mon, 26 Sep 2011 21:59:47 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105931
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Mon 2011-09-26 21:59:47 +0000
message:
  Merge changes made in Gnus trunk.
  
  nnimap.el (nnimap-wait-for-response): Message less (bug#9540).
  nnheader.el (nnheader-message-maybe): New function.
  shr.el (shr-tag-table): Render totally broken tables better.
  mml.el (mml-generate-mime-1): Don't alter the contents if we're computing the 
boundary.
  pop3.el (pop3-number-of-responses): Removed.
   (pop3-wait-for-messages): Rewrite to take linear time instead of exponential 
time.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/mml.el
  lisp/gnus/nnheader.el
  lisp/gnus/nnimap.el
  lisp/gnus/pop3.el
  lisp/gnus/shr.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-09-24 23:09:56 +0000
+++ b/lisp/gnus/ChangeLog       2011-09-26 21:59:47 +0000
@@ -1,3 +1,20 @@
+2011-09-26  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * nnimap.el (nnimap-wait-for-response): Message less (bug#9540).
+
+       * nnheader.el (nnheader-message-maybe): New function.
+
+       * shr.el (shr-tag-table): Render totally broken tables better.
+
+       * mml.el (mml-generate-mime-1): Don't alter the contents if we're
+       computing the boundary.
+
+2011-09-26  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * pop3.el (pop3-number-of-responses): Remove.
+       (pop3-wait-for-messages): Rewrite to take linear time instead of
+       exponential time.
+
 2011-09-24  Lars Magne Ingebrigtsen  <address@hidden>
 
        * gnus-sum.el (gnus-summary-show-article): Bind `shr-ignore-cache' to

=== modified file 'lisp/gnus/mml.el'
--- a/lisp/gnus/mml.el  2011-09-22 04:43:36 +0000
+++ b/lisp/gnus/mml.el  2011-09-26 21:59:47 +0000
@@ -540,7 +540,8 @@
                      (mml-to-mime)
                      ;; Update handle so mml-compute-boundary can
                      ;; detect collisions with the nested parts.
-                     (setcdr (assoc 'contents cont) (buffer-string)))
+                     (unless mml-inhibit-compute-boundary
+                       (setcdr (assoc 'contents cont) (buffer-string))))
                    (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b")))
                      ;; ignore 0x1b, it is part of iso-2022-jp
                      (setq encoding (mm-body-7-or-8))))

=== modified file 'lisp/gnus/nnheader.el'
--- a/lisp/gnus/nnheader.el     2011-05-02 03:37:06 +0000
+++ b/lisp/gnus/nnheader.el     2011-09-26 21:59:47 +0000
@@ -1112,6 +1112,13 @@
                       '(buffer-string)))))
        (insert-buffer-substring ,buffer ,start ,end))))
 
+(defvar nnheader-last-message-time '(0 0))
+(defun nnheader-message-maybe (&rest args)
+  (let ((now (current-time)))
+    (when (> (float-time (time-subtract now nnheader-last-message-time)) 1)
+      (setq nnheader-last-message-time now)
+      (apply 'nnheader-message args))))
+
 (when (featurep 'xemacs)
   (require 'nnheaderxm))
 

=== modified file 'lisp/gnus/nnimap.el'
--- a/lisp/gnus/nnimap.el       2011-09-21 22:34:54 +0000
+++ b/lisp/gnus/nnimap.el       2011-09-26 21:59:47 +0000
@@ -1723,7 +1723,8 @@
                                      (looking-at "\\*"))))
                        (not (looking-at (format "%d .*\n" sequence)))))
            (when messagep
-             (nnheader-message 7 "nnimap read %dk" (/ (buffer-size) 1000)))
+             (nnheader-message-maybe
+              7 "nnimap read %dk" (/ (buffer-size) 1000)))
            (nnheader-accept-process-output process)
            (goto-char (point-max)))
           openp)

=== modified file 'lisp/gnus/pop3.el'
--- a/lisp/gnus/pop3.el 2011-09-21 22:34:54 +0000
+++ b/lisp/gnus/pop3.el 2011-09-26 21:59:47 +0000
@@ -167,17 +167,30 @@
 
 (defun pop3-send-streaming-command (process command count total-size)
   (erase-buffer)
-  (let ((i 1))
+  (let ((i 1)
+       (start-point (point-min))
+       (waited-for 0))
     (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 pop3-stream-length))
-       (pop3-wait-for-messages process i total-size))
-      (incf i)))
-  (pop3-wait-for-messages process count total-size))
+       (setq start-point
+             (pop3-wait-for-messages process pop3-stream-length
+                                     total-size start-point))
+       (incf waited-for pop3-stream-length))
+      (incf i))
+    (pop3-wait-for-messages process (- count waited-for)
+                           total-size start-point)))
 
-(defun pop3-wait-for-messages (process count total-size)
-  (while (< (pop3-number-of-responses total-size) count)
+(defun pop3-wait-for-messages (process count total-size start-point)
+  (while (> count 0)
+    (goto-char start-point)
+    (while (or (and (re-search-forward "^\\+OK" nil t)
+                   (or (not total-size)
+                       (re-search-forward "^\\.\r?\n" nil t)))
+              (re-search-forward "^-ERR " nil t))
+      (decf count)
+      (setq start-point (point)))
     (unless (memq (process-status process) '(open run))
       (error "pop3 process died"))
     (when total-size
@@ -185,7 +198,8 @@
               (truncate (/ (buffer-size) 1000))
               (truncate (* (/ (* (buffer-size) 1.0)
                               total-size) 100))))
-    (pop3-accept-process-output process)))
+    (pop3-accept-process-output process))
+  start-point)
 
 (defun pop3-write-to-file (file)
   (let ((pop-buffer (current-buffer))
@@ -219,17 +233,6 @@
          (delete-char 1))
        (write-region (point-min) (point-max) file nil 'nomesg)))))
 
-(defun pop3-number-of-responses (endp)
-  (let ((responses 0))
-    (save-excursion
-      (goto-char (point-min))
-      (while (or (and (re-search-forward "^\\+OK" nil t)
-                     (or (not endp)
-                         (re-search-forward "^\\.\r?\n" nil t)))
-                (re-search-forward "^-ERR " nil t))
-       (incf responses)))
-    responses))
-
 (defun pop3-logon (process)
   (let ((pop3-password pop3-password))
     ;; for debugging only

=== modified file 'lisp/gnus/shr.el'
--- a/lisp/gnus/shr.el  2011-09-24 23:09:56 +0000
+++ b/lisp/gnus/shr.el  2011-09-26 21:59:47 +0000
@@ -1055,44 +1055,53 @@
         (nheader (if header (shr-max-columns header)))
         (nbody (if body (shr-max-columns body)))
         (nfooter (if footer (shr-max-columns footer))))
-    (shr-tag-table-1
-     (nconc
-      (if caption `((tr (td ,@caption))))
-      (if header
+    (if (and (not caption)
+            (not header)
+            (not (cdr (assq 'tbody cont)))
+            (not (cdr (assq 'tr cont)))
+            (not footer))
+       ;; The table is totally invalid and just contains random junk.
+       ;; Try to output it anyway.
+       (shr-generic cont)
+      ;; It's a real table, so render it.
+      (shr-tag-table-1
+       (nconc
+       (if caption `((tr (td ,@caption))))
+       (if header
+           (if footer
+               ;; hader + body + footer
+               (if (= nheader nbody)
+                   (if (= nbody nfooter)
+                       `((tr (td (table (tbody ,@header ,@body ,@footer)))))
+                     (nconc `((tr (td (table (tbody ,@header ,@body)))))
+                            (if (= nfooter 1)
+                                footer
+                              `((tr (td (table (tbody ,@footer))))))))
+                 (nconc `((tr (td (table (tbody ,@header)))))
+                        (if (= nbody nfooter)
+                            `((tr (td (table (tbody ,@body ,@footer)))))
+                          (nconc `((tr (td (table (tbody ,@body)))))
+                                 (if (= nfooter 1)
+                                     footer
+                                   `((tr (td (table (tbody ,@footer))))))))))
+             ;; header + body
+             (if (= nheader nbody)
+                 `((tr (td (table (tbody ,@header ,@body)))))
+               (if (= nheader 1)
+                   `(,@header (tr (td (table (tbody ,@body)))))
+                 `((tr (td (table (tbody ,@header))))
+                   (tr (td (table (tbody ,@body))))))))
          (if footer
-             ;; hader + body + footer
-             (if (= nheader nbody)
-                 (if (= nbody nfooter)
-                     `((tr (td (table (tbody ,@header ,@body ,@footer)))))
-                   (nconc `((tr (td (table (tbody ,@header ,@body)))))
-                          (if (= nfooter 1)
-                              footer
-                            `((tr (td (table (tbody ,@footer))))))))
-               (nconc `((tr (td (table (tbody ,@header)))))
-                      (if (= nbody nfooter)
-                          `((tr (td (table (tbody ,@body ,@footer)))))
-                        (nconc `((tr (td (table (tbody ,@body)))))
-                               (if (= nfooter 1)
-                                   footer
-                                 `((tr (td (table (tbody ,@footer))))))))))
-           ;; header + body
-           (if (= nheader nbody)
-               `((tr (td (table (tbody ,@header ,@body)))))
-             (if (= nheader 1)
-                 `(,@header (tr (td (table (tbody ,@body)))))
-               `((tr (td (table (tbody ,@header))))
-                 (tr (td (table (tbody ,@body))))))))
-       (if footer
-           ;; body + footer
-           (if (= nbody nfooter)
-               `((tr (td (table (tbody ,@body ,@footer)))))
-             (nconc `((tr (td (table (tbody ,@body)))))
-                    (if (= nfooter 1)
-                        footer
-                      `((tr (td (table (tbody ,@footer))))))))
-         (if caption
-             `((tr (td (table (tbody ,@body)))))
-           body)))))
+             ;; body + footer
+             (if (= nbody nfooter)
+                 `((tr (td (table (tbody ,@body ,@footer)))))
+               (nconc `((tr (td (table (tbody ,@body)))))
+                      (if (= nfooter 1)
+                          footer
+                        `((tr (td (table (tbody ,@footer))))))))
+           (if caption
+               `((tr (td (table (tbody ,@body)))))
+             body))))))
     (when bgcolor
       (shr-colorize-region start (point) (cdr (assq 'color shr-stylesheet))
                           bgcolor))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]