From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#39112: 27.0.60; gnus-summary-attach-article 'S A' with multiple articles selected repeats latest article Date: Mon, 13 Jan 2020 13:49:59 -0800 Message-ID: <874kwzm3g8.fsf@ericabrahamsen.net> References: <0100016f9e6e96aa-7ec94d8b-c2f0-4eb0-a960-eb3ccbc23dd9-000000@email.amazonses.com> <87r203nvwk.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="86001"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 39112@debbugs.gnu.org To: Pankaj Jangid Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 13 22:53:17 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ir7cB-0014Og-MC for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Jan 2020 22:51:15 +0100 Original-Received: from localhost ([::1]:56246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ir7cA-0003Gg-Ff for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Jan 2020 16:51:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36889) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ir7bz-0003EY-Gc for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2020 16:51:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ir7by-00032m-Bo for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2020 16:51:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54282) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ir7by-00032f-80 for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2020 16:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ir7by-0002wb-7F for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2020 16:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jan 2020 21:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39112 X-GNU-PR-Package: emacs Original-Received: via spool by 39112-submit@debbugs.gnu.org id=B39112.157895221011217 (code B ref 39112); Mon, 13 Jan 2020 21:51:02 +0000 Original-Received: (at 39112) by debbugs.gnu.org; 13 Jan 2020 21:50:10 +0000 Original-Received: from localhost ([127.0.0.1]:60249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ir7b7-0002ur-Ue for submit@debbugs.gnu.org; Mon, 13 Jan 2020 16:50:10 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:35754 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ir7b5-0002uZ-OB for 39112@debbugs.gnu.org; Mon, 13 Jan 2020 16:50:08 -0500 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 42F36FA080; Mon, 13 Jan 2020 21:50:01 +0000 (UTC) In-Reply-To: <87r203nvwk.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 13 Jan 2020 08:50:03 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174553 Archived-At: --=-=-= Content-Type: text/plain Eric Abrahamsen writes: > Pankaj Jangid writes: > >> New command 'S A' ('gnus-summary-attach-article') is not working >> properly with multiple articles. >> >> * Steps >> 1. Select multiple articles in summary buffer using process mark '#' >> 2. 'S A' >> 3. Creates a new message buffer with multiple articles attached. BUT all >> the articles are same. The latest among the selected articles is >> repeated multiple times. > > That command sets up the message-mode buffer and makes it current before > iterating over the articles, so it's unable to actually find the > articles and simply repeats the last value of > gnus-original-article-buffer. Okay, that was only right by accident. The real problem was that the code inside the iterate was setting the buffer to the message-mode buffer. Then the calls to `gnus-summary-select-article' kept re-setting to the summary-buffer, but always on the same article. Anyway, would you test this patch and confirm it fixes the problem? Eric --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=attach-article-fix.diff diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 466a62713e..de5ebd3409 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1987,11 +1987,11 @@ gnus-summary-attach-article (setq destination (current-buffer))) (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) --=-=-=--