From 7d8344ac8af19d7a88c3547fa0ab8ced01135e86 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 18 Apr 2021 02:55:22 +0100 Subject: email.org, with some notmuch fine-tuning --- gnus.org | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gnus.org') diff --git a/gnus.org b/gnus.org index 58ef9d3..44a5b8e 100644 --- a/gnus.org +++ b/gnus.org @@ -12,6 +12,28 @@ (defvar jao-gnus-use-nnml nil) (defvar jao-gnus-use-maildirs nil) #+end_src +* Startup and kill + #+begin_src emacs-lisp + ;;;;; close gnus when closing emacs, but ask when exiting + (setq gnus-interactive-exit t) + + (defun jao-gnus-started-hook () + (add-hook 'before-kill-emacs-hook 'gnus-group-exit)) + + (add-hook 'gnus-started-hook 'jao-gnus-started-hook) + + (defun jao-gnus-after-exiting-hook () + (remove-hook 'before-kill-emacs-hook 'gnus-group-exit)) + + (add-hook 'gnus-after-exiting-gnus-hook 'jao-gnus-after-exiting-hook) + + ;; define a wrapper around the save-buffers-kill-emacs + ;; to run the new hook before: + (defadvice save-buffers-kill-emacs + (before my-save-buffers-kill-emacs activate) + "Install hook when emacs exits before emacs asks to save this and that." + (run-hooks 'before-kill-emacs-hook)) + #+end_src * Looks *** Verbosity #+begin_src emacs-lisp -- cgit v1.2.3