help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Saving the Messages buffer


From: Emanuel Berg
Subject: Re: Saving the Messages buffer
Date: Wed, 22 Jan 2014 19:35:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Sivaram Neelakantan <nsivaram.net@gmail.com> writes:

> Simply saving the buffer to the same named file with
> overwrite option?

If you don't want to use `auto-save-mode', how about
scheduling the save with the Emacs' "collaborative"
(non-preemptive) idle-timer?

The first argument says how many seconds you should be
idle before Emacs fires off the defun. The `t' says
this shouldn't just happens once, but at every such
instance.

But if you are idle all day, and still get changes to
*Messages*, the function will only be run once, because
(what I can see) it waits for non-idleness before it
resets.

(run-with-idle-timer 10 t
 (lambda ()
   (with-current-buffer "*Messages*"
     (write-file "~/emacs_messages" nil) )))

-- 
underground experts united:
http://user.it.uu.se/~embe8573


reply via email to

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