From: Eric Abrahamsen Date: Thu, 25 Jul 2019 19:24:43 +0000 (-0700) Subject: Don't set marks on imap groups when there are no marks to set X-Git-Tag: emacs-27.0.90~1817^2~123 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fee2aeeb75849e84a8905f29c90f231986fbf7ab;p=emacs.git Don't set marks on imap groups when there are no marks to set * lisp/gnus/nnimap.el (nnimap-update-qresync-info): This code runs in a fairly tight loop and shouldn't call all these functions if not necessary. --- diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index ad2b1a4fb63..99a610487fe 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1702,18 +1702,19 @@ If LIMIT, first try to limit the search to the N last articles." (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))