]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure that gnus-summary-attach-article finds the right articles
authorEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 18 Jan 2020 19:08:11 +0000 (11:08 -0800)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 18 Jan 2020 19:08:11 +0000 (11:08 -0800)
* lisp/gnus/gnus-msg.el (gnus-summary-attach-article): Before
iterating over the articles to attach, first close any open
article. Using `set-buffer' required `gnus-summary-select-article' to
re-set the buffer every time, meaning we never got off the original
article.

lisp/gnus/gnus-msg.el

index 466a62713ed093fc8f21d6be17f0ee3fa9651fd8..daaea3980b5353633a819b4d7d301ecd7b10389e 100644 (file)
@@ -1985,13 +1985,14 @@ process-mark several articles, they will all be attached."
                                       buffers t nil nil (car buffers))))
       (gnus-summary-mail-other-window)
       (setq destination (current-buffer)))
+    (gnus-summary-expand-window)
     (gnus-summary-iterate n
       (gnus-summary-select-article)
-      (set-buffer destination)
-      ;; Attach at the end of the buffer.
-      (save-excursion
-       (goto-char (point-max))
-       (message-forward-make-body-mime gnus-original-article-buffer)))
+      (with-current-buffer destination
+       ;; Attach at the end of the buffer.
+       (save-excursion
+        (goto-char (point-max))
+        (message-forward-make-body-mime gnus-original-article-buffer))))
     (gnus-configure-windows 'message t)))
 
 (provide 'gnus-msg)