From: Lars Ingebrigtsen Date: Thu, 8 Jul 2021 14:33:28 +0000 (+0200) Subject: Make desktop-kill more robust X-Git-Tag: emacs-28.0.90~1922 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8ab0c04c2c77260e2342515151ed75a87907c007;p=emacs.git Make desktop-kill more robust * lisp/desktop.el (desktop-kill): Allow exiting Emacs even if we can't delete the desktop file (bug#20762). --- 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) ;; ----------------------------------------------------------------------------