emacs-devel
[Top][All Lists]
Advanced

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

Re: desktop.el: autosave?


From: Reuben Thomas
Subject: Re: desktop.el: autosave?
Date: Thu, 6 Dec 2007 14:56:12 +0000 (GMT)
User-agent: Alpine 0.99999 (DEB 796 2007-11-08)

On Tue, 4 Dec 2007, Juri Linkov wrote:

I use in .emacs:
 (defun my-desktop-save ()
   (interactive)
   ;; `desktop-owner' is a new function in Emacs 22.1.50 to check
   ;; for conflicts between two running Emacs instances.
   ;; We don't want automatic saving in the second Emacs process.
   (if (and (fboundp 'desktop-owner) (eq (desktop-owner) (emacs-pid)))
       (desktop-save "~")))

Why did you not use desktop-save-in-desktop-dir?

This was enough for .emacs, but for desktop.el a proper variable
to save the desktop in is surely `desktop-dirname'.  Even though
`desktop-save-in-desktop-dir' is a method that does this, I think we
can't use it, because when `desktop-dirname' is nil initially, it asks
in the minibuffer where to save the desktop (by using `call-interactively'),
but this is not a good thing to do in a function called by a timer.

Perhaps it should do nothing when called by a timer and `desktop-dirname'
is nil.

Seems sensible, but can't you achieve this result by having the timer call my-desktop-save non-interactively?

--
http://rrt.sc3d.org/ | Astrophysics: it's not exactly rocket science




reply via email to

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