The very end of `desktop-save' contains:

  (setq default-directory dirname)
  (when (file-exists-p filename) (delete-file filename))
  (let ((coding-system-for-write 'emacs-mule))
    (write-region (point-min) (point-max) filename nil 'nomessage))))

The code to delete the desktop file before writing into it has
existed, AFAICS, since release 1.1 of desktop.el.

However, it is bringing me pain on Windows. If I try to exit Emacs
while viewing the .emacs.desktop from a command shell, Emacs tries to
delete the file (and apparently succeeds), and then tries to write it
anew (and it fails). After exiting the viewer program, .emacs.desktop
no longer exists. Not nice.

It is really necessary to delete the file prior to `write-region' it?
Are there use cases where that is an advantage?

-- 
                    /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to