From: Sergey Organov Date: Thu, 22 Jul 2021 12:22:26 +0000 (+0200) Subject: Avoid failing in desktop-clear due to killed buffers X-Git-Tag: emacs-28.0.90~1755 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6f9ff3d7493d144af182ddd6fcf512f98b78ad0c;p=emacs.git 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 --- diff --git a/lisp/desktop.el b/lisp/desktop.el index b9467c87527..3b257132163 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -706,8 +706,9 @@ if different)." "\\)\\'"))) (dolist (buffer (buffer-list)) (let ((bufname (buffer-name buffer))) - (unless (or (eq (aref bufname 0) ?\s) ;; Don't kill internal buffers - (string-match-p preserve-regexp bufname)) + (unless (or (null bufname) + (eq (aref bufname 0) ?\s) ;; Don't kill internal buffers + (string-match-p preserve-regexp bufname)) (kill-buffer buffer))))) (delete-other-windows) (when (and desktop-restore-frames