[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hook to exit gnus upon C-x C-c?
From: |
Martin Christensen |
Subject: |
Re: hook to exit gnus upon C-x C-c? |
Date: |
Sat, 24 Jul 2004 20:59:01 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>>>>> "Albert" == Albert Reiner <areiner@tph.tuwien.ac.at> writes:
Albert> Hi, how would one set up a hook to quit Gnus, if it is
Albert> running, before exiting Emacs?
I use this in my .gnus.el:
(defun gnus-group-exit-save-buffers-kill-emacs ()
(interactive)
"Quit Gnus, Save buffers and Kill Emacs"
(cond
((fboundp 'gnus-group-exit) (gnus-group-exit)))
(save-buffers-kill-emacs))
(global-set-key "\C-x\C-c" 'gnus-group-exit-save-buffers-kill-emacs)
(add-hook 'gnus-after-exiting-gnus-hook '(lambda () (global-set-key "\C-x\C-c"
'save-buffers-kill-emacs)))
You could also advise save-buffers-kill-emacs to do the same, which is
slightly more elegant, but since I already had this running, I can't
be arsed to change it. :-)
Martin
- --
Homepage: http://www.cs.auc.dk/~factotum/
GPG public key: http://www.cs.auc.dk/~factotum/gpgkey.txt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using Mailcrypt+GnuPG <http://www.gnupg.org>
iEYEARECAAYFAkECsXIACgkQYu1fMmOQldWeWQCgjO7ESBdUf4OjUpUDTc5A+U43
kRoAoN10pDxv3WcO98+6OqgFgYedi1xL
=M0l4
-----END PGP SIGNATURE-----