From 8ab0c04c2c77260e2342515151ed75a87907c007 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 8 Jul 2021 16:33:28 +0200 Subject: [PATCH] Make desktop-kill more robust * lisp/desktop.el (desktop-kill): Allow exiting Emacs even if we can't delete the desktop file (bug#20762). --- lisp/desktop.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/desktop.el b/lisp/desktop.el index ae8d026acc4..b9467c87527 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -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) ;; ---------------------------------------------------------------------------- -- 2.39.2