]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't try to save articles in Gnus that have disappeared
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Jul 2019 15:30:22 +0000 (17:30 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Jul 2019 16:44:43 +0000 (18:44 +0200)
* lisp/gnus/gnus-sum.el (gnus-summary-save-article): Stop trying
to save articles if the articles have disappeared (bug#35188).

lisp/gnus/gnus-sum.el

index acc4132c27bc78d831fb256a6bc24c6002f4c560..7f6b936383c3288499c1b2f5a08e8d65e37383a0 100644 (file)
@@ -12188,11 +12188,15 @@ performed."
        (save-window-excursion
          (gnus-summary-select-article decode decode nil article)
          (gnus-summary-goto-subject article))
-       (with-current-buffer save-buffer
-         (erase-buffer)
-         (insert-buffer-substring (if decode
-                                      gnus-article-buffer
-                                    gnus-original-article-buffer)))
+       ;; The article may have expired.
+       (let ((art-buf (if decode
+                          gnus-article-buffer
+                        gnus-original-article-buffer)))
+         (when (zerop (buffer-size (get-buffer art-buf)))
+           (error "Couldn't select article %s" article))
+         (with-current-buffer save-buffer
+           (erase-buffer)
+           (insert-buffer-substring art-buf)))
        (setq file (gnus-article-save save-buffer file num))
        (gnus-summary-remove-process-mark article)
        (unless not-saved