Subject: Re: bug#17351: Trunk emacs splats .emacs.desktop at startup

From: Juri Linkov <[email-masked]>
Date: Sun, 27 Apr 2014 12:52:01 +0300

>> If after startup you paused for 30 seconds then auto-saving overwrote
>> your desktop indeed.  It seems we need to keep a backup of the desktop
>> from the previous session when saving the desktop in a new session
>> for the case when the desktop gets broken by the errors in it.
>
> Yes, I think so.  This needs to be mentioned in the manual, too.  30
> seconds seems a very short time (by default) to trigger this saving of
> the desktop.

30 seconds of idle time before desktop auto-saving is the default value
inherited from `auto-save-timeout' used for file auto-saving.  But they
don't need to be the same.  In ~/.emacs I customized it to 60 seconds,
and maybe this default value would be better for everyone.

> Especially when there's been no change since the previous save.

Actually auto-saving already checks for changes and doesn't write the
identical desktop.  In practice this happens rarely, only when the session
left inactive, because any minuscule change in window configuration
(such as displaying a buffer with error messages) causes the desktop file
to be overwritten with new contents.