summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-07-08 16:33:28 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-07-08 16:33:28 +0200
commit8ab0c04c2c77260e2342515151ed75a87907c007 (patch)
tree88611493f34bc784facb292a44165d19a46e2dd5 /lisp
parentcd1313b7f128e19b3a6554b4e410a71da370a66f (diff)
downloademacs-8ab0c04c2c77260e2342515151ed75a87907c007.tar.gz
emacs-8ab0c04c2c77260e2342515151ed75a87907c007.tar.bz2
emacs-8ab0c04c2c77260e2342515151ed75a87907c007.zip
Make desktop-kill more robust
* lisp/desktop.el (desktop-kill): Allow exiting Emacs even if we can't delete the desktop file (bug#20762).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/desktop.el5
1 files changed, 4 insertions, 1 deletions
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)
;; ----------------------------------------------------------------------------