Fix up partial nnimap fetching.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 27 Sep 2010 19:24:26 +0000 (21:24 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 27 Sep 2010 19:24:26 +0000 (21:24 +0200)
lisp/ChangeLog
lisp/gnus-sum.el
lisp/nnimap.el

index 6414631..8863656 100644 (file)
@@ -1,7 +1,12 @@
 2010-09-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-request-article): Don't partial-fetch single-part
+       parts.
+       (nnimap-request-article): Work with the t setting, too.
+
        * gnus-sum.el (gnus-summary-exit): Kill the article buffer later, so
        that you don't get flashes of other buffers.
+       (gnus-summary-show-complete-article): Intern before setting.
 
 2010-09-27  David Engster  <dengste@eml.cc>
 
index 798a529..54a7300 100644 (file)
@@ -9362,9 +9362,11 @@ article currently."
   (let ((gnus-keep-backlog nil)
        (gnus-use-cache nil)
        (gnus-agent nil)
-       (variable (format "%s-fetch-partial-articles"
-                         (car (gnus-find-method-for-group
-                               gnus-newsgroup-name))))
+       (variable (intern
+                  (format "%s-fetch-partial-articles"
+                          (car (gnus-find-method-for-group
+                                gnus-newsgroup-name)))
+                  obarray))
        old-val)
     (unwind-protect
        (progn
index 138833c..4be9153 100644 (file)
@@ -422,13 +422,11 @@ textual parts.")
        (with-current-buffer (nnimap-buffer)
          (erase-buffer)
          (when nnimap-fetch-partial-articles
-           (if (eq nnimap-fetch-partial-articles t)
-               (setq parts '(1))
-             (nnimap-command "UID FETCH %d (BODYSTRUCTURE)" article)
-             (goto-char (point-min))
-             (when (re-search-forward "FETCH.*BODYSTRUCTURE" nil t)
-               (setq structure (ignore-errors (read (current-buffer)))
-                     parts (nnimap-find-wanted-parts structure)))))
+           (nnimap-command "UID FETCH %d (BODYSTRUCTURE)" article)
+           (goto-char (point-min))
+           (when (re-search-forward "FETCH.*BODYSTRUCTURE" nil t)
+             (setq structure (ignore-errors (read (current-buffer)))
+                   parts (nnimap-find-wanted-parts structure))))
          (when (if parts
                    (nnimap-get-partial-article article parts structure)
                  (nnimap-get-whole-article article))
@@ -551,7 +549,9 @@ textual parts.")
                        (number-to-string num)
                      (format "%s.%s" prefix num))))
            (setcar (nthcdr 9 sub) id)
-           (when (string-match nnimap-fetch-partial-articles type)
+           (when (if (eq nnimap-fetch-partial-articles t)
+                     (equal id "1")
+                   (string-match nnimap-fetch-partial-articles type))
              (push id parts))))
        (incf num)))
     (nreverse parts)))