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

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

Re: desktop mode, periodic save


From: Xah
Subject: Re: desktop mode, periodic save
Date: Thu, 28 Feb 2008 10:01:27 -0800 (PST)
User-agent: G2/1.0

how can i write a elisp code so that a function is called every 10
minutes.

I found “sleep-for” but it freezes emacs for the period.

Thanks.

  Xah
  address@hidden
∑ http://xahlee.org/

☄


On Feb 10, 12:54 pm, Xah <address@hidden> wrote:
> i'm usingdesktop.el, with the intention so that in case of crashing
> (emacs or OS), i can still have emacs open files i have left open when
> crashed.
>
> However,desktopmode by default doesn't save periodically, so that
> after a crash, i lost the info of opened files. (i think this defeats
> the main purpose ofdesktopmode)
>
> So i added adesktop-save to find-file-hook. Like this:
>
> (desktop-save-mode 1)
> (add-hook 'find-file-hook (lambda () (desktop-save "~/")))
>
> But the problem with this is that, when i launch emacs (no crash
> involved), it will ask me to override thedesktopfile each time it
> opens a file (due to previousdesktopsave)
>
> I think the solution is to add the hook only when the initialization
> is complete. How can i do that?
>
>   Xah
>   address@hidden
>http://xahlee.org/
>
>



reply via email to

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