GNU bug report logs - #32850
27.0.50; window-swap-states doesn't swap window prev/next-buffers

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 27 Sep 2018 00:06:02 UTC

Severity: minor

Found in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #133 received at 32850 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 32850 <at> debbugs.gnu.org
Subject: Re: bug#32850: 27.0.50;
 window-swap-states doesn't swap window prev/next-buffers
Date: Tue, 30 Oct 2018 23:23:29 +0200
>>    (delete-other-windows) (split-window) (delete-window)
>
> OK.  If we document it sufficiently, let's use that.

I thought it's ugly.  But if there is no other way:

diff --git a/lisp/window.el b/lisp/window.el
index bcd4fa2959..9fdf005202 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5898,20 +5898,12 @@ window-state-put
 windows can get as small as `window-safe-min-height' and
 `window-safe-min-width'."
   (setq window-state-put-stale-windows nil)
-  (setq window (window-normalize-window window))
 
-  ;; When WINDOW is internal, reduce it to a live one to put STATE into,
-  ;; see Bug#16793.
+  ;; When WINDOW is internal or nil, create a new window.
   (unless (window-live-p window)
-    (let ((root window))
-      (setq window (catch 'live
-                     (walk-window-subtree
-                      (lambda (window)
-                        (when (and (window-live-p window)
-                                   (not (window-parameter window 'window-side)))
-                          (throw 'live window)))
-                      root)))
-      (delete-other-windows-internal window root)))
+    (delete-other-windows)
+    (setq window (split-window))
+    (delete-window))
 
   (set-window-dedicated-p window nil)
 




This bug report was last modified 6 years and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.