emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6f9ff3d: Avoid failing in desktop-clear due to killed buffers


From: Lars Ingebrigtsen
Subject: master 6f9ff3d: Avoid failing in desktop-clear due to killed buffers
Date: Thu, 22 Jul 2021 08:23:01 -0400 (EDT)

branch: master
commit 6f9ff3d7493d144af182ddd6fcf512f98b78ad0c
Author: Sergey Organov <sorganov@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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
---
 lisp/desktop.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/desktop.el b/lisp/desktop.el
index b9467c8..3b25713 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]