From 451077ade556c49de63270e3237c72b34aed3474 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 8 Feb 2012 15:59:05 +0100 Subject: [PATCH] In server-unselect-display make sure that buffer is live before killing it --- lisp/server.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/server.el b/lisp/server.el index 79858e6d83e..61787db2162 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -403,14 +403,15 @@ If CLIENT is non-nil, add a description of it to the logged message." ;; Rewritten to avoid inadvertently killing the current buffer after ;; `delete-frame' removed FRAME (Bug#10729). (let ((buffer (frame-parameter frame 'server-dummy-buffer))) - (if (and (one-window-p 'nomini frame) - (eq (window-buffer (frame-first-window frame)) buffer)) - ;; The temp frame still only shows one buffer, and that is the - ;; internal temp buffer. - (delete-frame frame) - (set-frame-parameter frame 'visibility t) - (set-frame-parameter frame 'server-dummy-buffer nil)) - (kill-buffer buffer)))) + (when (buffer-live-p buffer) + (if (and (one-window-p 'nomini frame) + (eq (window-buffer (frame-first-window frame)) buffer)) + ;; The temp frame still only shows one buffer, and that is the + ;; internal temp buffer. + (delete-frame frame) + (set-frame-parameter frame 'visibility t) + (set-frame-parameter frame 'server-dummy-buffer nil)) + (kill-buffer buffer))))) (defun server-handle-delete-frame (frame) "Delete the client connection when the emacsclient frame is deleted. -- 2.39.2