emacs-wiki-discuss
[Top][All Lists]
Advanced

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

[emacs-wiki-discuss] Don't lose your *Remember* buffer


From: Andrew J. Korty
Subject: [emacs-wiki-discuss] Don't lose your *Remember* buffer
Date: Tue, 23 Nov 2004 16:49:38 -0500
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I use the following in .emacs to keep me from accidentally destroying
a *Remember* buffer by exiting Emacs.  There's also something for Gnus
in there.  Is there a better way?  If not, enjoy.

,----
| (defun my-cleanup-then-save-buffers-kill-emacs (&optional arg)
|   "Clean up before saving buffers and killing Emacs."
|   (interactive "P")
|   ;; stop here if there's a *Remember* buffer
|   (if (get-buffer remember-buffer)
|       (remember)
|     ;; clean up Gnus
|     (and
|      (fboundp 'gnus-alive-p)
|      (gnus-alive-p)
|      (let ((gnus-interactive-exit nil))
|        (gnus-group-exit)))
|     (save-buffers-kill-emacs arg)))
| (global-set-key "\C-x\C-c" 'my-cleanup-then-save-buffers-kill-emacs)
`----

- -- 
Andrew J. Korty, Principal Security Engineer, GCIA, GCFA
Office of the Vice President for Information Technology
Indiana University
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBo7B18gM8+Mr5peERAleoAJ42XstuJ0TzKp7SzbPh38ThBWOq8ACg9r7W
DYHmSHpSnQk8xL/tEA8QEFk=
=igOx
-----END PGP SIGNATURE-----




reply via email to

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