[Top][All Lists]

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

Re: desktop.el: autosave?

From: Juri Linkov
Subject: Re: desktop.el: autosave?
Date: Tue, 04 Dec 2007 00:57:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

>> 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.

Juri Linkov

reply via email to

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