help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Graceful Gnus exit on Emacs exit


From: Eric Abrahamsen
Subject: Re: Graceful Gnus exit on Emacs exit
Date: Tue, 21 Apr 2020 11:55:20 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Sergey Organov <sorganov@gmail.com> writes:

> Hello,
>
> Gnus v5.31 doesn't seem to install any hooks at Emacs exit that is 
> unfortunate.
>
> After some digging I came up with the following code in my .gnus.el to
> gracefully exit Gnus on Emacs exit:
>
> (defun gnus-exit ()
>   "Exit gnus without confirmation and return 't"
>   (let ((noninteractive 't)
>         (gnus-expert-user 't)
>         (gnus-interactive-exit 'quiet))
>     (gnus-group-exit) 't))
>
> (add-hook 'kill-emacs-hook 'gnus-exit)
>
> I worry why it ended up being that complex? Is there better way?

I wouldn't actually consider that to be very complex! At least not
compared to the elisp customizations I end up writing :)

The non-complex version would be:

(add-hook 'hill-emacs-hook #'gnus-group-exit)

Though you'd have to deal with the prompts.

No, I don't think there's a better way.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]