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

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

Re: auto-save-desktop?


From: Steve Wainstead
Subject: Re: auto-save-desktop?
Date: Sun, 20 Apr 2003 18:36:54 -0400
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3) Gecko/20030312

I have two lines in my .emacs that take care of it.

;; load the desktop on startup
(desktop-load-default)
;; automatically save the desktop on exit.
(setq desktop-enable t)


Manually, just do M-x desktop-read to load the last saved desktop.

~swain


gebser@ameritech.net wrote:
This sounds great.  I've always wanted a way to save a session like
you've described. So I put your code verbatim into my .emacs. Question now is: how do I retrieve a session after coming back from,
say, an X crash???

tnx,
ken

At 15:30 (UTC-0400) on Thu, 17 Apr 2003 Steve Wainstead said:

= I'm trying this for now:
= = (defun desktop-auto-save ()
=    "Added to auto-save-hook so the desktop is not lost."
=    (desktop-save "~/")
=    (message "Wrote desktop.")
=    )
= = (add-hook 'auto-save-hook 'desktop-auto-save t) = = Your code worked fine too... thanks!
= ~swain
= = Ehud Karni wrote:
= > -----BEGIN PGP SIGNED MESSAGE-----
= > Hash: SHA1
= > = > On Tue, 15 Apr 2003 10:24:50 -0400, Steve Wainstead <swain@ampira.com> wrote: = > = >>Does anyone know of an extension (or an existing way in Emacs that I = >>missed) to automatically save the desktop? I'd like Emacs to do = >>desktop-save to a user-specified file periodically; I lost my X session = >>yesterday and had several open files. = > = > = > I have the following code on my .emacs : = > = > (defun desktop-save-in-home-dir ()
= >   "save desktop on home directory"
= >        (if (buffer-file-name)          ;; do only for real files
= >            (let (find-file-hooks       ;; must - do not loop on this 
function
= >                  kill-buffer-hook)     ;; must - do not loop on this 
function
= >                (desktop-save "~/")
= >                ))
= >        nil)
= > = > (add-hook 'find-file-hooks 'desktop-save-in-home-dir t)
= > (add-hook 'kill-buffer-hook 'desktop-save-in-home-dir t)
= > = > Ehud. = > = > = > - -- = > Ehud Karni Tel: +972-3-7966-561 /"\
= >  Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
= >  Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
= >  http://www.mvs.co.il  FAX:  1-815-5509341  / \
= >  mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry
= > -----BEGIN PGP SIGNATURE-----
= > Comment: use http://www.keyserver.net/ to get my key (and others)
= > = > iD8DBQE+nCwtLFvTvpjqOY0RAtkHAJ485I4poJObLlrvsv05NDqTiptGEACfYjcp
= > PtfBs2pChwPdIa0Ac0hJBN0=
= > =aMF1
= > -----END PGP SIGNATURE-----
= > = > = = _______________________________________________
= Help-gnu-emacs mailing list
= Help-gnu-emacs@gnu.org
= http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
=



reply via email to

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