From c557cd6b97df3989fda0b2d19cff80bb7a9a5c70 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 8 Oct 2011 15:52:16 +0200 Subject: [PATCH] Delete dedicated frame when killing its buffer. (Bug#9699) * window.el (window--delete): Delete dedicated frame unconditionally when argument KILL is non-nil. (Bug#9699) --- lisp/ChangeLog | 5 +++++ lisp/window.el | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fdc61721a13..7bd71260763 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-10-08 Martin Rudalics + + * window.el (window--delete): Delete dedicated frame + unconditionally when argument KILL is non-nil. (Bug#9699) + 2011-10-08 Thierry Volpiatto * lisp/eshell/eshell.el (eshell-command): Avoid using hooks. diff --git a/lisp/window.el b/lisp/window.el index 74460ae6058..72b14e1852e 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2780,7 +2780,7 @@ WINDOW must be a live window and defaults to the selected one. Optional argument DEDICATED-ONLY non-nil means to delete WINDOW only if it's dedicated to its buffer. Optional argument KILL means the buffer shown in window will be killed. Return non-nil -if WINDOW gets deleted." +if WINDOW gets deleted or its frame is auto-hidden." (setq window (window-normalize-live-window window)) (unless (and dedicated-only (not (window-dedicated-p window))) (let* ((buffer (window-buffer window)) @@ -2788,8 +2788,11 @@ if WINDOW gets deleted." (cond ((eq deletable 'frame) (let ((frame (window-frame window))) - (when (functionp frame-auto-hide-function) - (funcall frame-auto-hide-function frame))) + (cond + (kill + (delete-frame frame)) + ((functionp frame-auto-hide-function) + (funcall frame-auto-hide-function frame)))) 'frame) (deletable (delete-window window) -- 2.39.2