[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [h-e-w] Restoring killed buffers
From: |
Drew Adams |
Subject: |
RE: [h-e-w] Restoring killed buffers |
Date: |
Sat, 22 Jul 2006 14:15:03 -0700 |
Having killed *scratch* buffer containing important information
multiple times, I have put the following into my .emacs:
(push (lambda () (not (member (buffer-name) '("*scratch*"))))
kill-buffer-query-functions)
It was useful... but not enough. After closing emacs several times
while important information was in *scratch*, I added:
(add-hook 'auto-save-hook (lambda () (if (equal
(current-buffer) (get-buffer "*scratch*")) (save-buffer))))
(add-hook 'kill-emacs-hook (lambda () (with-current-buffer
(get-buffer "*scratch*") (save-buffer))))
(with-current-buffer (get-buffer "*scratch*")
(setq buffer-file-name "e:\\programs\\configs\\home\\.scratch.emcs")
(revert-buffer nil t t)
(setq buffer-save-without-query t))
I have yet to break *this* setting ;)
Good idea. I tend to just open a new file buffer foo.el and use that, for the
same reason. Granted, emacs-lisp-mode is different from Lisp Interaction Mode,
but the former gives me most of what I would use *scratch* for.