Subject: bug#48493: 28.0.50; quit-window doesn't work

From: martin rudalics <[email-masked]>
Date: Tue, 18 May 2021 10:01:20 +0200

> quit-window doesn't work properly with the master branch.
 >
 > To see the issue with emacs -Q, in any git repo:
 >
 > * C-x v L
 > * C-x 1 (if the screen is split).
 > * Hitting 'q' now doesn't close the window.
 >
 > Looks like commit 0a681590268a4039f95a5a919b6b6d4f4e880d4c is
 > the problem.

Right.  Can you try the attached patch?  pillule, please also have a
look into this.

Thanks for the report, martin
diff --git a/lisp/window.el b/lisp/window.el
index 026cde5901..8a767140bc 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5110,8 +5110,7 @@ quit-restore-window
       (set-window-parameter window 'quit-restore nil)
       ;; Make sure that WINDOW is no more dedicated.
       (set-window-dedicated-p window nil)
-      (if prev-buffer
-          (switch-to-prev-buffer window bury-or-kill)
+      (unless (switch-to-prev-buffer window bury-or-kill)
         ;; Delete WINDOW if there is no previous buffer (Bug#48367).
         (window--delete window nil (eq bury-or-kill 'kill)))))