Commit 6f9ff3d7 authored by Sergey Organov's avatar Sergey Organov Committed by Lars Ingebrigtsen
Browse files

Avoid failing in desktop-clear due to killed buffers

* lisp/desktop.el (desktop-clear): check that buffer is not already
killed before attempting to kill it. A buffer might become killed as
part of regular operation as a side-effect of killing another buffer,
and then attempt to kill it again causes error (bug#49692).

Copyright-paperwork-exempt: yes
parent 0dcc4449
Pipeline #11533 failed with stages
in 1 minute and 11 seconds
...@@ -706,8 +706,9 @@ if different)." ...@@ -706,8 +706,9 @@ if different)."
"\\)\\'"))) "\\)\\'")))
(dolist (buffer (buffer-list)) (dolist (buffer (buffer-list))
(let ((bufname (buffer-name buffer))) (let ((bufname (buffer-name buffer)))
(unless (or (eq (aref bufname 0) ?\s) ;; Don't kill internal buffers (unless (or (null bufname)
(string-match-p preserve-regexp bufname)) (eq (aref bufname 0) ?\s) ;; Don't kill internal buffers
(string-match-p preserve-regexp bufname))
(kill-buffer buffer))))) (kill-buffer buffer)))))
(delete-other-windows) (delete-other-windows)
(when (and desktop-restore-frames (when (and desktop-restore-frames
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment