unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 19950@debbugs.gnu.org
Subject: bug#19950: 25.0.50; Gnus nnimap -- don't split messages back into original group
Date: Fri, 27 Feb 2015 13:48:54 +0800	[thread overview]
Message-ID: <874mq7vr95.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87ioepnx98.fsf@ericabrahamsen.net>

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

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> If this is acceptable, does it need a CHANGELOG mention? I've gotten
>> pretty confused about what's LOG-worthy, and what isn't.
>
> The ChangeLog duplicates the commit messages, and since every commit should
> have a commit message, then every commit should add that same message
> to the relevant ChangeLog.
>
> At least for now, until we finally change our procedure to auto-generate
> the ChangeLog files (should be "real soon now", tho there hasn't been
> much activity in this area of late).

Thanks to you both! Here's a new patch with ChangeLog added. I'll just
leave this here until Lars sees it...


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Don-t-split-imap-messages-back-into-original-group.patch --]
[-- Type: text/x-diff, Size: 1814 bytes --]

From ffbbdec9909bc08d853d239b798bd33726e6fa82 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Wed, 18 Feb 2015 17:51:37 +0800
Subject: [PATCH] Don't split imap messages back into original group

* lisp/nnimap.el (nnimap-split-incoming-mail): If a message is already
  in the group it should be split to, don't re-copy it into the group.
---
 lisp/ChangeLog |  4 ++++
 lisp/nnimap.el | 15 +++++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2047481..011e3cd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2015-02-27  Eric Abrahamsen  <eric@ericabrahamsen.net>
+	* lisp/nnimap.el (nnimap-split-incoming-mail): If a message is already
+	in the group it should be split to, don't re-copy it into the group.
+
 2015-02-26  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part):
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 369d9d3..c476be6 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -2086,12 +2086,15 @@ Return the server's response to the SELECT or EXAMINE command."
 		    (ranges (cdr spec)))
 		(if (eq group 'junk)
 		    (setq junk-articles ranges)
-		  (push (list (nnimap-send-command
-			       "UID COPY %s %S"
-			       (nnimap-article-ranges ranges)
-			       (utf7-encode group t))
-			      ranges)
-			sequences))))
+		  ;; Don't copy if the message is already in its
+		  ;; target group.
+		  (unless (string= group nnimap-inbox)
+		   (push (list (nnimap-send-command
+				"UID COPY %s %S"
+				(nnimap-article-ranges ranges)
+				(utf7-encode group t))
+			       ranges)
+			 sequences)))))
 	    ;; Wait for the last COPY response...
 	    (when sequences
 	      (nnimap-wait-for-response (caar sequences))
-- 
2.3.1


  reply	other threads:[~2015-02-27  5:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  3:54 bug#19950: 25.0.50; Gnus nnimap -- don't split messages back into original group Eric Abrahamsen
2015-02-26  5:10 ` bug#19950: 25.0.50; nnimap: " Ivan Shmakov
2015-02-26 14:21 ` bug#19950: 25.0.50; Gnus nnimap -- " Stefan Monnier
2015-02-27  5:48   ` Eric Abrahamsen [this message]
2015-03-25  2:32     ` Eric Abrahamsen
2015-03-25  2:49 ` bug#19950: closing 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=874mq7vr95.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=19950@debbugs.gnu.org \
    /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).