summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-07-16 07:50:41 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-07-17 20:19:04 -0700
commitec1ce8e8592332eb1a21da12b5193086ab9301a8 (patch)
tree730b16c30896a4bbc381932675b2d36619372ae3
parent1dcbd49bf1fb3d739fab7f22e87e6c43e29b3037 (diff)
downloaddotfiles-ec1ce8e8592332eb1a21da12b5193086ab9301a8.tar.gz
add workaround for Emacs bug#56592
-rw-r--r--.emacs.d/init.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index d69806b8..8ddd2b89 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -2985,12 +2985,17 @@ mutt's review view, after exiting EDITOR."
(with-eval-after-load 'gnus-start
(add-hook 'gnus-started-hook #'spw/sync-notmuch-nnselect-groups))
-;; Rescan nnmaildir+fmail:inbox too, else rescanning the nnselect group will
-;; not display any new mail.
-(defun spw/gnus-request-group-scan (group _info)
- (when (eq 'nnselect (car (gnus-find-method-for-group group)))
- (gnus-activate-group "nnmaildir+fmail:inbox" 'scan)))
-(advice-add 'gnus-request-group-scan :before #'spw/gnus-request-group-scan)
+;; Work around Emacs bug#56592.
+;;
+;; Also rescans nnmaildir+fmail:inbox whenever we M-g in an nnselect group,
+;; which ensures new mail is displayed. (Previously we achieved the latter by
+;; advising `gnus-request-group-scan' (see b9adb797). We will likely need to
+;; restore that when removing this workaround, when bug#56592 is fixed.)
+(defun spw/gnus-summary-exit (&rest _ignore)
+ (call-process "notmuch" nil nil nil "new" "--no-hooks")
+ (with-current-buffer gnus-group-buffer
+ (gnus-group-get-new-news t)))
+(advice-add 'gnus-summary-exit :after #'spw/gnus-summary-exit)
(defun spw/gnus-group-nnselect-query (group)
(when-let ((specs (gnus-group-get-parameter group 'nnselect-specs t)))