GNU bug report logs - #50867
27.2; window-toggle-side-windows adds an extra window

Previous Next

Package: emacs;

Reported by: Indrajeet Khandekar <indrajeet.khandekar <at> taranawireless.com>

Date: Tue, 28 Sep 2021 15:09:02 UTC

Severity: normal

Tags: fixed

Found in version 27.2

Fixed in version 28.1

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Indrajeet Khandekar <indrajeet.khandekar <at> taranawireless.com>, 50867 <at> debbugs.gnu.org
Subject: bug#50867: 27.2; window-toggle-side-windows adds an extra window
Date: Wed, 29 Sep 2021 11:28:02 +0200
> 1. start a vanila emacs session
> 2. using scratch buffer, use follow display buffer alist configuration
>
> (setq display-buffer-alist
>            '(("\\*\\(Async Shell Command\\|Shell Command Output\\)\\*"
>           (display-buffer-reuse-window display-buffer-in-side-window)
>           (window-width . 0.40)
>           (side . right)
>           (slot . 0))))
>
> 3. split the window horizontally using `C-x 3`
> 4. run `M-x async-shell-command ls RET`
> 5. run `M-x window-toggle-side-windows`
> 6. run `M-x window-toggle-side-windows`
>
> You will see that there is an extra, window added, to the frame.
>
>
>
> In GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95))
> of 2021-03-28 built on builder10-14.porkrind.org
> Windowing system distributor 'Apple', version 10.3.2022
> System Description:  macOS 11.6

Thanks for the report.  I hopefully fixed this now for Emacs 28.  If you
want this to work for Emacs 27, please apply the patch below and either
rebuild Emacs or put the definition of 'window-toggle-side-windows' into
your .emacs.

All the best, martin


diff --git a/lisp/window.el b/lisp/window.el
index b240b16f24..1b02eff17b 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1212,7 +1216,8 @@ window-toggle-side-windows
      ((setq state (frame-parameter frame 'window-state))
       ;; A window state was saved for FRAME.  Restore it and put the
       ;; current root window into its main window.
-      (let ((main-state (window-state-get (frame-root-window frame))))
+      (let ((window-combination-resize t)
+            (main-state (window-state-get (frame-root-window frame))))
         (window-state-put state (frame-root-window frame) t)
         (window-state-put main-state (window-main-window frame)))
       (window--sides-reverse-frame frame))




This bug report was last modified 3 years and 294 days ago.

Previous Next


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