From 6e3830d21a2cea48e3fa8caaddcab63d68daab38 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 7 Aug 2022 17:00:48 -0700 Subject: work around Emacs bug#56592 by advising gnus-summary-read-group --- .emacs.d/init.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 68a9c99d..00edbb7f 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -3025,12 +3025,14 @@ mutt's review view, after exiting EDITOR." (gnus-activate-group "nnmaildir+fmail:inbox" 'scan))) (advice-add 'gnus-request-group-scan :before #'spw/gnus-request-group-scan) -;; This, plus `gnus-suppress-duplicates' t, works around Emacs bug#56592 -;; (though want duplicate suppression turned on independently of that). -(defun spw/update-notmuch () - (call-process "notmuch" nil nil nil "new" "--no-hooks")) -(with-eval-after-load 'gnus-sum - (add-hook 'gnus-summary-exit-hook #'spw/update-notmuch)) +;; This works around Emacs bug#56592 without relying on duplicate suppression. +(defun spw/gnus-summary-read-group (group &rest _ignore) + (when (string-prefix-p "nnselect:" group) + (with-current-buffer gnus-group-buffer + (save-excursion + (gnus-group-goto-group group) + (gnus-group-get-new-news-this-group 1))))) +(advice-add 'gnus-summary-read-group :before #'spw/gnus-summary-read-group) (defun spw/gnus-group-nnselect-query (group) (when-let ((specs (gnus-group-get-parameter group 'nnselect-specs t))) -- cgit v1.2.3