From 3bd748ebbaa2eef993a551cea1c7ddecc563f8d7 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 28 Jul 2020 00:46:30 +0200 Subject: [PATCH] Fix problem with new-mail-mark in Gnus with non-unique names * lisp/gnus/gnus-group.el (gnus-group-new-mail): Call with Gnus group name. (gnus-group-catchup): Ditto. * lisp/gnus/gnus-sum.el (gnus-summary-exit): Ditto. * lisp/gnus/nnimap.el (nnimap-update-info): Store Gnus group name. * lisp/gnus/nnmail.el (nnmail-check-duplication): Store unique Gnus names in the history instead of backend-specific (possibly duplicated) group names (bug#41842). --- lisp/gnus/gnus-group.el | 4 ++-- lisp/gnus/gnus-sum.el | 2 +- lisp/gnus/nnimap.el | 3 +-- lisp/gnus/nnmail.el | 8 +++++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index b207c4f1e06..97e10a37a21 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1768,7 +1768,7 @@ already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated." (get-text-property (point-at-bol) 'gnus-unread)) (defun gnus-group-new-mail (group) - (if (nnmail-new-mail-p (gnus-group-real-name group)) + (if (nnmail-new-mail-p group) gnus-new-mail-mark ?\s)) @@ -3600,7 +3600,7 @@ or nil if no action could be taken." (marks (gnus-info-marks (nth 1 entry))) (unread (gnus-sequence-of-unread-articles group))) ;; Remove entries for this group. - (nnmail-purge-split-history (gnus-group-real-name group)) + (nnmail-purge-split-history group) ;; Do the updating only if the newsgroup isn't killed. (if (not (numberp (car entry))) (gnus-message 1 "Can't catch up %s; non-active group" group) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index d731893ecec..c1216a0cc24 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -7311,7 +7311,7 @@ If FORCE (the prefix), also save the .newsrc file(s)." (when gnus-use-cache (gnus-cache-write-active)) ;; Remove entries for this group. - (nnmail-purge-split-history (gnus-group-real-name group)) + (nnmail-purge-split-history group) ;; Make all changes in this group permanent. (unless quit-config (gnus-run-hooks 'gnus-exit-group-hook) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 3c4e75ede82..be8ad9a6723 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1670,8 +1670,7 @@ If LIMIT, first try to limit the search to the N last articles." (when (and active recent (> (car (last recent)) (cdr active))) - (push (list (cons (gnus-group-real-name group) 0)) - nnmail-split-history))) + (push (list (cons group 0)) nnmail-split-history))) ;; Note the active level for the next run-through. (gnus-group-set-parameter info 'active (gnus-active group)) (gnus-group-set-parameter info 'uidvalidity uidvalidity) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 3be843c91f1..729f8e347c7 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -1749,7 +1749,13 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." (nreverse (nnmail-article-group artnum-func)))))) ;; Add the group-art list to the history list. (if group-art - (push group-art nnmail-split-history) + ;; We need to get the unique Gnus group name for this article + ;; -- there may be identically named groups from several + ;; backends. + (push (cons (gnus-group-prefixed-name (car group-art) + gnus-command-method) + (cdr group-art)) + nnmail-split-history) (delete-region (point-min) (point-max))))) ;;; Get new mail. -- 2.39.5