]> git.eshelyaron.com Git - emacs.git/commitdiff
Make desktop-kill more robust
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 8 Jul 2021 14:33:28 +0000 (16:33 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 8 Jul 2021 14:33:28 +0000 (16:33 +0200)
* lisp/desktop.el (desktop-kill): Allow exiting Emacs even if we
can't delete the desktop file (bug#20762).

lisp/desktop.el

index ae8d026acc4b94e64e1e27282bf455af3dc6610c..b9467c87527a3a7c7b8e6fbdd6d46ac5b45f5040 100644 (file)
@@ -759,7 +759,10 @@ is nil, ask the user where to save the desktop."
        (unless (yes-or-no-p "Error while saving the desktop.  Ignore? ")
         (signal (car err) (cdr err))))))
   ;; If we own it, we don't anymore.
-  (when (eq (emacs-pid) (desktop-owner)) (desktop-release-lock))
+  (when (eq (emacs-pid) (desktop-owner))
+    ;; Allow exiting Emacs even if we can't delete the desktop file.
+    (ignore-error 'file-error
+      (desktop-release-lock)))
   t)
 
 ;; ----------------------------------------------------------------------------