From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#21182: 25.0.50; gnus: every other unread message is marked as read on each nnimap group refresh Date: Tue, 09 Feb 2016 11:57:09 +1100 Message-ID: <87d1s6itui.fsf@gnus.org> References: <877fpc8r1s.fsf@esperi.org.uk> <87h9hlawql.fsf@gnus.org> <87bn7r3tvh.fsf@esperi.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454979502 6631 80.91.229.3 (9 Feb 2016 00:58:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2016 00:58:22 +0000 (UTC) Cc: 21182@debbugs.gnu.org To: Nix Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 09 01:58:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aSwd9-0005XI-6g for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Feb 2016 01:58:11 +0100 Original-Received: from localhost ([::1]:50434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSwd8-00008R-OD for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Feb 2016 19:58:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSwd4-00007y-Ui for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2016 19:58:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSwcz-00028e-V5 for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2016 19:58:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSwcz-00028J-Rt for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2016 19:58:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aSwcz-0008QC-K5; Mon, 08 Feb 2016 19:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Tue, 09 Feb 2016 00:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21182 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 21182-submit@debbugs.gnu.org id=B21182.145497945932345 (code B ref 21182); Tue, 09 Feb 2016 00:58:01 +0000 Original-Received: (at 21182) by debbugs.gnu.org; 9 Feb 2016 00:57:39 +0000 Original-Received: from localhost ([127.0.0.1]:60705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSwcd-0008Pc-9O for submit@debbugs.gnu.org; Mon, 08 Feb 2016 19:57:39 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:38924) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSwcb-0008PU-Hw for 21182@debbugs.gnu.org; Mon, 08 Feb 2016 19:57:38 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aSwcF-0005L4-13; Tue, 09 Feb 2016 01:57:15 +0100 In-Reply-To: <87bn7r3tvh.fsf@esperi.org.uk> (Nix's message of "Mon, 08 Feb 2016 19:05:38 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aSwcF-0005L4-13 MailScanner-NULL-Check: 1455584235.79696@NWUXTEAlN0Cp8rtlcfqcpg 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: 208.118.235.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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112767 Archived-At: Nix writes: > It's hard to say -- I reverted the patch locally immediately. The > problem is that whenever this goes wrong, 50% of my unread email gets > marked as read, with no obvious way to reverse this. This is rather a > high price to pay for replicating a bug :) > > I have some sacrificial folders I could give up to the cause -- I'll see > if I can make things go wrong with them in the next day or so. I just don't understand how the following patch could have this effect... diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index ced5561..8e81abc 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -166,14 +166,21 @@ nnimap-buffer (nnimap-find-process-buffer nntp-server-buffer)) (defun nnimap-header-parameters () - (format "(UID RFC822.SIZE BODYSTRUCTURE %s)" - (format + (let (params) + (push "UID" params) + (push "RFC822.SIZE" params) + (when (nnimap-capability "X-GM-EXT-1") + (push "X-GM-LABELS" params)) So it only adds that to the params if the server supports it... + (push "BODYSTRUCTURE" params) + (push (format (if (nnimap-ver4-p) "BODY.PEEK[HEADER.FIELDS %s]" "RFC822.HEADER.LINES %s") (append '(Subject From Date Message-Id References In-Reply-To Xref) - nnmail-extra-headers)))) + nnmail-extra-headers)) + params) + (format "%s" (nreverse params)))) So on non-Gmail servers the result should be identical... - (let (article lines size string) + (let (article lines size string labels) (block nil (while (not (eobp)) (while (not (looking-at "\\* [0-9]+ FETCH")) @@ -232,6 +239,9 @@ nnimap-transform-headers t) (match-string 1))) (beginning-of-line) + (when (search-forward "X-GM-LABELS" (line-end-position) t) + (setq labels (ignore-errors (read (current-buffer))))) + (beginning-of-line) Again, it should have no effect on non-Gmail... (when lines (insert (format "Lines: %s\n" lines))) + (when labels + (insert (format "X-GM-LABELS: %s\n" labels))) ;; Most servers have a blank line after the headers, but ;; Davmail doesn't. (unless (re-search-forward "^\r$\\|^)\r?$" nil t) And ditto. So it's a mystery to me why that patch should affect anything unless you're using Gmail.. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no