[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: |
Sun, 10 Feb 2008 12:54:34 -0800 (PST) |
User-agent: |
G2/1.0 |
i'm using desktop.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, desktop mode 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 of desktop mode)
So i added a desktop-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 the desktop file each time it
opens a file (due to previous desktop save)
I think the solution is to add the hook only when the initialization
is complete. How can i do that?
Xah
xah@xahlee.org
∑ http://xahlee.org/
☄
On Feb 1, 8:07 am, Xah Lee <x...@xahlee.org> wrote:
> I usedesktopmode, so that in case of crashing (emacs or OS), i can
> know which files i was working on or needs to work on.
>
> However, by default, thedesktopmode doesn't seems to save
> periodically, so that when OS crash, i lost the info about which files
> that was open or needs to work on.
>
> I'm doing this as a solution:
>
> (desktop-save-mode 1)
>
> (add-hook 'find-file-hook (lambda () (desktop-save "~/")))
>
> Is there a variable that i should use instead?
>
> thx.
>
> Xah
> x...@xahlee.org
> ∑http://xahlee.org/
>
> ☄