unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Can emacs be made to right Messages buffer to disc?
Date: Thu, 3 Jul 2008 12:48:59 -0700 (PDT)	[thread overview]
Message-ID: <acc9a284-682c-4bab-84e9-b92caff60ff6@h1g2000prh.googlegroups.com> (raw)
In-Reply-To: 87aa006d-ef83-4521-989d-90520ab82513@j22g2000hsf.googlegroups.com

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



  reply	other threads:[~2008-07-03 19:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-29 14:22 Can emacs be made to right Messages buffer to disc? reader
2008-07-02  2:29 ` Kevin Rodgers
2008-07-03  3:56   ` Harry Putnam
2008-07-03  9:37     ` Thien-Thi Nguyen
     [not found] ` <mailman.14105.1214965793.18990.help-gnu-emacs@gnu.org>
2008-07-03 15:18   ` Nordlöw
2008-07-03 19:48     ` Xah [this message]
2008-07-03 20:32     ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acc9a284-682c-4bab-84e9-b92caff60ff6@h1g2000prh.googlegroups.com \
    --to=xahlee@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).