From f345a9e46987d426dc128e31a963399011343b46 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 24 Mar 2023 17:42:07 -0700 Subject: now we advise gnus-summary-exit, prompt when exiting without saving --- .emacs.d/init.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 94a5c81c..52cb4e56 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -3605,6 +3605,14 @@ mutt's review view, after exiting EDITOR." (apply orig-fun args))) (advice-add 'gnus-summary-exit :around #'spw/gnus-summary-exit) +(defun spw/gnus-summary-exit-no-update (&optional no-questions) + (list (or (and (spw/gnus-specs-search-notmuch-p) + (not (eq (current-buffer) + spw/saveable-notmuch-nnselect-summary))) + no-questions))) +(advice-add 'gnus-summary-exit-no-update + :filter-args #'spw/gnus-summary-exit-no-update) + (defun gnus-user-format-function-summary (_ignore) (if (and (spw/gnus-specs-search-notmuch-p) (not (eq (current-buffer) spw/saveable-notmuch-nnselect-summary))) @@ -3895,10 +3903,6 @@ mutt's review view, after exiting EDITOR." (define-key gnus-summary-mode-map [f5] #'spw/gnus-fastmail-learn-spam) (define-key gnus-summary-mode-map "\C-z\C-s" #'spw/gnus-fastmail-learn-spam)) -(defun spw/gnus-with-expert (orig-fun &rest args) - (let ((gnus-expert-user t)) (apply orig-fun args))) -(advice-add #'gnus-summary-exit-no-update :around #'spw/gnus-with-expert) - ;;;; rcirc -- cgit v1.2.3