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

From: Alan Mackenzie <[email-masked]>
Date: Sun, 27 Apr 2014 09:15:55 +0000

Morning, Juri.

On Sun, Apr 27, 2014 at 11:22:39AM +0300, Juri Linkov wrote:
> > 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.

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.  Especially when there's been no change since the previous
save.

-- 
Alan Mackenzie (Nuremberg, Germany).