[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can emacs be made to right Messages buffer to disc?
From: |
Xah |
Subject: |
Re: Can emacs be made to right Messages buffer to disc? |
Date: |
Thu, 3 Jul 2008 12:48:59 -0700 (PDT) |
User-agent: |
G2/1.0 |
Nordlöw wrote:
«I believe a better solution would be to auto-save the buffer reguarly
using a time interval. Somebody know how?»
You can use the run-with-timer function. Here's a example snippet:
; record opened files (session) every 5 min
(run-with-timer 600 600 'desktop-save "~/")
Xah
∑ http://xahlee.org/
☄
On Jul 3, 8:18 am, Nordlöw <per.nord...@gmail.com> wrote:
> > (defun save-messages-buffer ()
> > (with-current-buffer (get-buffer "*Messages*")
> > (save-buffer 0))) ; or just (basic-save-buffer)
>
> > (add-hook 'pre-command-hook 'save-messages-buffer)
> > (add-hook 'post-command-hook 'save-messages-buffer)
>
> This behaviour is not that useable as it constantly clutters the
> minibuffer with the message "Wrote ~/.emacs_message". Can we make save-
> buffer() silent perhaps?
>
> It also writes to disc every time every time we navigate in the source
> code which I believe is not that good for performance. I believe a
> better solution would be to auto-save the buffer reguarly using a time
> interval. Somebody know how?
>
> /Nordlöw