From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steve Wainstead Newsgroups: gmane.emacs.help Subject: Re: auto-save-desktop? Date: Thu, 17 Apr 2003 15:30:50 -0400 Organization: PANIX Public Access Internet and UNIX, NYC Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1050608032 10684 80.91.224.249 (17 Apr 2003 19:33:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 17 Apr 2003 19:33:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 17 21:33:50 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 196F7q-0002jA-00 for ; Thu, 17 Apr 2003 21:32:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 196F61-0000h5-0C for gnu-help-gnu-emacs@m.gmane.org; Thu, 17 Apr 2003 15:30:57 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: gwy-1.corp.ampira.com Original-X-Trace: reader1.panix.com 1050607569 16854 65.244.88.252 (17 Apr 2003 19:26:09 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Thu, 17 Apr 2003 19:26:09 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:112071 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:8571 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8571 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 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----- > >