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

From: Juri Linkov <[email-masked]>
Date: Sun, 27 Apr 2014 11:22:39 +0300

> This is horrible.  I started a GUI emacs session, and there were errors
> loading the desktop.  I loaded the file .emacs.desktop into my emacs
> session to see what the problem was.  And lo and behold, that file had
> already been overwritten by Emacs.  :-(

I lost my desktop too. :-(  After starting a GUI session, loading the
desktop failed to read \.\.\. characters.  I see the only way how
\.\.\. got into the desktop: some mode temporarily changed the buffer-local
value of `print-length' that abbreviated a value while saving the desktop.
I added precautions against this problem on the emacs-24 branch.

But the remaining problem is that it overwrote the desktop with the
broken file while leaving no backups of the previous desktop.

> This is crazy.  What's the point of overwriting .emacs.desktop at
> startup?  It's either going to be overwriting itself with a functionally
> identical copy, or (as in the current case) its going to be losing
> information needed for debugging.

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.