unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Pankaj Jangid <p4j@j4d.net>
Cc: 39112@debbugs.gnu.org
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	[thread overview]
Message-ID: <874kwzm3g8.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87r203nvwk.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 13 Jan 2020 08:50:03 -0800")

[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Pankaj Jangid <p4j@j4d.net> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: attach-article-fix.diff --]
[-- Type: text/x-patch, Size: 772 bytes --]

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)

  reply	other threads:[~2020-01-13 21:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 10:24 bug#39112: 27.0.60; gnus-summary-attach-article 'S A' with multiple articles selected repeats latest article Pankaj Jangid
2020-01-13 16:50 ` Eric Abrahamsen
2020-01-13 21:49   ` Eric Abrahamsen [this message]
2020-01-14  3:42     ` Pankaj Jangid
2020-01-18  5:07       ` Eric Abrahamsen
2020-01-18  9:25         ` Pankaj Jangid
2020-01-18 18:34           ` Eric Abrahamsen
2020-01-18 18:43             ` Eli Zaretskii
2020-01-18 19:15               ` Eric Abrahamsen
2020-01-18 19:19                 ` Eric Abrahamsen
2020-01-18 19:43                   ` Eli Zaretskii
2020-01-18 21:57                     ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kwzm3g8.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=39112@debbugs.gnu.org \
    --cc=p4j@j4d.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).