Subject: bug#18200: (no subject)

From: Carlos Pita <[email-masked]>
Date: Tue, 12 Aug 2014 19:08:57 -0300

The problem is that gnus-summary-insert-new-articles assumes every new
active article to be unread:

      (setq gnus-newsgroup-unreads
        (gnus-sorted-nunion gnus-newsgroup-unreads new))

It seems like a sensible assumption, doesn't it? But sadly it's wrong in
this case, because the sent mail is meant to be already read. It will be
wrong in other cases too, since a "new" message coming from the imap
server, which could be simultaneously accessed by more than one client,
is not necessarily unread.

So currently you have 3 levels of inconsistency:

1) The imap server and M-g "think" the email is read.
2) /N "thinks" the email is unread.
3) The summary buffer (before /N or M-g) "thinks" there is no email.

I believe there is a very easy way to reduce these inconsistencies to
only:

1) The imap server, M-g, /N "think" the email is read.
2) The summary buffer (before /N or M-g) "thinks" there is no email.

Then you can just say that the summary buffer isn't immediately
refreshed, which doesn't feel so bad and is easier to understand and
live with.

The fix (mod unexpected side effects) is:

Notice that gnus-summary-insert-new-articles is calling
gnus-summary-insert-articles, which already calculates the unread list
using gnus-list-of-unread-articles. So it seems to me that removing the
problematic union operation quoted above would be safe since
gnus-summary-insert-articles is already taking care of that.