From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: desktop mode, periodic save
Date: Sun, 10 Feb 2008 12:54:34 -0800 (PST) [thread overview]
Message-ID: <edd9ba14-38f9-4a79-8c55-d1ea74f1a6d6@c4g2000hsg.googlegroups.com> (raw)
In-Reply-To: 2a9e5387-06dd-4558-a858-5d0eb7ef7826@i29g2000prf.googlegroups.com
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/
>
> ☄
next prev parent reply other threads:[~2008-02-10 20:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-01 16:07 desktop mode, periodic save Xah Lee
2008-02-10 20:54 ` Xah [this message]
2008-02-28 18:01 ` Xah
2008-02-28 21:21 ` Thorsten Bonow
2008-02-28 21:45 ` Lowell Gilbert
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=edd9ba14-38f9-4a79-8c55-d1ea74f1a6d6@c4g2000hsg.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.