From unknown Fri Jun 13 11:05:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36712: 27.0.50; nnimap unconditionally setting marks in a loop Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Jul 2019 01:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36712 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 36712@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156341220728747 (code B ref -1); Thu, 18 Jul 2019 01:11:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Jul 2019 01:10:07 +0000 Received: from localhost ([127.0.0.1]:53207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnuvv-0007Tb-B0 for submit@debbugs.gnu.org; Wed, 17 Jul 2019 21:10:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:53862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnuvt-0007TT-Ow for submit@debbugs.gnu.org; Wed, 17 Jul 2019 21:10:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53006) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnuvs-0001DR-OT for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 21:10:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnuvr-0006on-BL for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 21:10:04 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:44588 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hnuvp-0006fk-PY for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 21:10:02 -0400 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 F3DA4FA42A for ; Thu, 18 Jul 2019 01:09:50 +0000 (UTC) From: Eric Abrahamsen Date: Wed, 17 Jul 2019 18:09:45 -0700 Message-ID: <87k1cg4086.fsf@ericabrahamsen.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 52.70.2.18 X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain I started doing some very basic profiling of Gnus, and noticed that getting new mail was resulting in a couple thousand calls to `gnus-info-set-entry', as well as some of the range manipulation functions. It looks like updating IMAP group marks using qresync would loop over all possible flag/mark pairs and unconditionally set everything, even when there was nothing to set. With fewer than 100 IMAP groups in total, that was a couple thousand extra function calls. Most of them with nil arguments, but still. I'm not super familiar with the code in question, but the attached diff looks like it will pull the qresync behavior in line with the non-qresync behavior, so I'm hoping it's correct. It cuts way down on function calls, anyway! In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-07-15 built on slip Repository revision: c687f25ee24bd29d623a23819eef930937252b25 Windowing system distributor 'The X.Org Foundation', version 11.0.12005000 System Description: Arch Linux --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nnimap-dont-add-marks.diff diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 67c5db1e04..5f8e9d5ec0 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1702,18 +1702,19 @@ nnimap-update-qresync-info (cdr (or (assoc (caddr type) flags) ; %Flagged (assoc (intern (cadr type) obarray) flags) (assoc (cadr type) flags))))) ; "\Flagged" - (setq marks (delq ticks marks)) - (pop ticks) - ;; Add the new marks we got. - (setq ticks (gnus-add-to-range ticks new-marks)) - ;; Remove the marks from messages that don't have them. - (setq ticks (gnus-remove-from-range - ticks - (gnus-compress-sequence - (gnus-sorted-complement existing new-marks)))) - (when ticks - (push (cons (car type) ticks) marks))) - (gnus-info-set-marks info marks t)) + (when new-marks + (setq marks (delq ticks marks)) + (pop ticks) + ;; Add the new marks we got. + (setq ticks (gnus-add-to-range ticks new-marks)) + ;; Remove the marks from messages that don't have them. + (setq ticks (gnus-remove-from-range + ticks + (gnus-compress-sequence + (gnus-sorted-complement existing new-marks)))) + (when ticks + (push (cons (car type) ticks) marks)) + (gnus-info-set-marks info marks t)))) ;; Add vanished to the list of unexisting articles. (when vanished (let* ((old-unexists (assq 'unexist marks)) --=-=-=-- From unknown Fri Jun 13 11:05:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36712: Acknowledgement (27.0.50; nnimap unconditionally setting marks in a loop) Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jul 2019 15:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36712 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 36712@debbugs.gnu.org Received: via spool by 36712-submit@debbugs.gnu.org id=B36712.156406873529138 (code B ref 36712); Thu, 25 Jul 2019 15:33:01 +0000 Received: (at 36712) by debbugs.gnu.org; 25 Jul 2019 15:32:15 +0000 Received: from localhost ([127.0.0.1]:40266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqfj5-0007Zu-7z for submit@debbugs.gnu.org; Thu, 25 Jul 2019 11:32:15 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:47578 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqfj3-0007Zh-9Q for 36712@debbugs.gnu.org; Thu, 25 Jul 2019 11:32:13 -0400 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 48DA2FA097 for <36712@debbugs.gnu.org>; Thu, 25 Jul 2019 15:32:07 +0000 (UTC) From: Eric Abrahamsen References: <87k1cg4086.fsf@ericabrahamsen.net> Date: Thu, 25 Jul 2019 08:32:05 -0700 In-Reply-To: (GNU bug Tracking System's message of "Thu, 18 Jul 2019 01:11:02 +0000") Message-ID: <87blxigmfe.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Well, I'm fairly sure now this is the right thing to do. I'll leave this open for a few more days, then push a fix. From unknown Fri Jun 13 11:05:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36712: Acknowledgement (27.0.50; nnimap unconditionally setting marks in a loop) Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jul 2019 17:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36712 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 36712@debbugs.gnu.org Received: via spool by 36712-submit@debbugs.gnu.org id=B36712.156407424513884 (code B ref 36712); Thu, 25 Jul 2019 17:05:02 +0000 Received: (at 36712) by debbugs.gnu.org; 25 Jul 2019 17:04:05 +0000 Received: from localhost ([127.0.0.1]:40339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqh9w-0003br-SJ for submit@debbugs.gnu.org; Thu, 25 Jul 2019 13:04:05 -0400 Received: from quimby.gnus.org ([80.91.231.51]:46744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqh9u-0003bV-Q3 for 36712@debbugs.gnu.org; Thu, 25 Jul 2019 13:04:03 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hqh9r-0006KB-5P; Thu, 25 Jul 2019 19:04:01 +0200 From: Lars Ingebrigtsen References: <87k1cg4086.fsf@ericabrahamsen.net> <87blxigmfe.fsf@ericabrahamsen.net> Date: Thu, 25 Jul 2019 19:03:58 +0200 In-Reply-To: <87blxigmfe.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 25 Jul 2019 08:32:05 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen writes: > Well, I'm fairly sure now this is the right thing to do. I'll leave this > open for a few more days, then push a fix. I think your patch looks correct... Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen writes: > Well, I'm fairly sure now this is the right thing to do. I'll leave this > open for a few more days, then push a fix. I think your patch looks correct... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Jun 13 11:05:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36712: Acknowledgement (27.0.50; nnimap unconditionally setting marks in a loop) Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jul 2019 19:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36712 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 36712@debbugs.gnu.org, 36712-done@debbugs.gnu.org Received: via spool by 36712-submit@debbugs.gnu.org id=B36712.15640828055321 (code B ref 36712); Thu, 25 Jul 2019 19:27:02 +0000 Received: (at 36712) by debbugs.gnu.org; 25 Jul 2019 19:26:45 +0000 Received: from localhost ([127.0.0.1]:40468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqjO0-0001Ng-RF for submit@debbugs.gnu.org; Thu, 25 Jul 2019 15:26:45 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:52222 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqjNy-0001NN-Kb; Thu, 25 Jul 2019 15:26:42 -0400 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 3AABCFA097; Thu, 25 Jul 2019 19:26:36 +0000 (UTC) From: Eric Abrahamsen References: <87k1cg4086.fsf@ericabrahamsen.net> <87blxigmfe.fsf@ericabrahamsen.net> Date: Thu, 25 Jul 2019 12:26:34 -0700 In-Reply-To: (Lars Ingebrigtsen's message of "Thu, 25 Jul 2019 19:03:58 +0200") Message-ID: <87blxhhq51.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 07/25/19 19:03 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen writes: > >> Well, I'm fairly sure now this is the right thing to do. I'll leave this >> open for a few more days, then push a fix. > > I think your patch looks correct... Okay, I went ahead and pushed it. Thanks! From unknown Fri Jun 13 11:05:35 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Eric Abrahamsen Subject: bug#36712: closed (Re: bug#36712: Acknowledgement (27.0.50; nnimap unconditionally setting marks in a loop)) Message-ID: References: <87blxhhq51.fsf@ericabrahamsen.net> <87k1cg4086.fsf@ericabrahamsen.net> X-Gnu-PR-Message: they-closed 36712 X-Gnu-PR-Package: emacs Reply-To: 36712@debbugs.gnu.org Date: Thu, 25 Jul 2019 19:27:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1564082823-5367-1" This is a multi-part message in MIME format... ------------=_1564082823-5367-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #36712: 27.0.50; nnimap unconditionally setting marks in a loop which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 36712@debbugs.gnu.org. --=20 36712: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36712 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1564082823-5367-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36712-done) by debbugs.gnu.org; 25 Jul 2019 19:26:44 +0000 Received: from localhost ([127.0.0.1]:40466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqjO0-0001Nd-JF for submit@debbugs.gnu.org; Thu, 25 Jul 2019 15:26:44 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:52222 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqjNy-0001NN-Kb; Thu, 25 Jul 2019 15:26:42 -0400 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 3AABCFA097; Thu, 25 Jul 2019 19:26:36 +0000 (UTC) From: Eric Abrahamsen To: Lars Ingebrigtsen Subject: Re: bug#36712: Acknowledgement (27.0.50; nnimap unconditionally setting marks in a loop) References: <87k1cg4086.fsf@ericabrahamsen.net> <87blxigmfe.fsf@ericabrahamsen.net> Date: Thu, 25 Jul 2019 12:26:34 -0700 In-Reply-To: (Lars Ingebrigtsen's message of "Thu, 25 Jul 2019 19:03:58 +0200") Message-ID: <87blxhhq51.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36712-done Cc: 36712@debbugs.gnu.org, 36712-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 07/25/19 19:03 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen writes: > >> Well, I'm fairly sure now this is the right thing to do. I'll leave this >> open for a few more days, then push a fix. > > I think your patch looks correct... Okay, I went ahead and pushed it. Thanks! ------------=_1564082823-5367-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Jul 2019 01:10:07 +0000 Received: from localhost ([127.0.0.1]:53207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnuvv-0007Tb-B0 for submit@debbugs.gnu.org; Wed, 17 Jul 2019 21:10:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:53862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnuvt-0007TT-Ow for submit@debbugs.gnu.org; Wed, 17 Jul 2019 21:10:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53006) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnuvs-0001DR-OT for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 21:10:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnuvr-0006on-BL for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 21:10:04 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:44588 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hnuvp-0006fk-PY for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 21:10:02 -0400 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 F3DA4FA42A for ; Thu, 18 Jul 2019 01:09:50 +0000 (UTC) From: Eric Abrahamsen To: bug-gnu-emacs@gnu.org Subject: 27.0.50; nnimap unconditionally setting marks in a loop Date: Wed, 17 Jul 2019 18:09:45 -0700 Message-ID: <87k1cg4086.fsf@ericabrahamsen.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 52.70.2.18 X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain I started doing some very basic profiling of Gnus, and noticed that getting new mail was resulting in a couple thousand calls to `gnus-info-set-entry', as well as some of the range manipulation functions. It looks like updating IMAP group marks using qresync would loop over all possible flag/mark pairs and unconditionally set everything, even when there was nothing to set. With fewer than 100 IMAP groups in total, that was a couple thousand extra function calls. Most of them with nil arguments, but still. I'm not super familiar with the code in question, but the attached diff looks like it will pull the qresync behavior in line with the non-qresync behavior, so I'm hoping it's correct. It cuts way down on function calls, anyway! In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-07-15 built on slip Repository revision: c687f25ee24bd29d623a23819eef930937252b25 Windowing system distributor 'The X.Org Foundation', version 11.0.12005000 System Description: Arch Linux --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nnimap-dont-add-marks.diff diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 67c5db1e04..5f8e9d5ec0 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1702,18 +1702,19 @@ nnimap-update-qresync-info (cdr (or (assoc (caddr type) flags) ; %Flagged (assoc (intern (cadr type) obarray) flags) (assoc (cadr type) flags))))) ; "\Flagged" - (setq marks (delq ticks marks)) - (pop ticks) - ;; Add the new marks we got. - (setq ticks (gnus-add-to-range ticks new-marks)) - ;; Remove the marks from messages that don't have them. - (setq ticks (gnus-remove-from-range - ticks - (gnus-compress-sequence - (gnus-sorted-complement existing new-marks)))) - (when ticks - (push (cons (car type) ticks) marks))) - (gnus-info-set-marks info marks t)) + (when new-marks + (setq marks (delq ticks marks)) + (pop ticks) + ;; Add the new marks we got. + (setq ticks (gnus-add-to-range ticks new-marks)) + ;; Remove the marks from messages that don't have them. + (setq ticks (gnus-remove-from-range + ticks + (gnus-compress-sequence + (gnus-sorted-complement existing new-marks)))) + (when ticks + (push (cons (car type) ticks) marks)) + (gnus-info-set-marks info marks t)))) ;; Add vanished to the list of unexisting articles. (when vanished (let* ((old-unexists (assq 'unexist marks)) --=-=-=-- ------------=_1564082823-5367-1--