# Maximising/minimising windows

**URL:** <https://forum.systemcrafters.net/t/maximising-minimising-windows/309>\
**Category:** Emacs\
**Created:** [February 19, 2024, 11:13pm UTC](https://forum.systemcrafters.net/t/maximising-minimising-windows/309 "2024-02-19T23:13:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elegant.wheel](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@elegant.wheel](https://forum.systemcrafters.net/u/elegant.wheel)\
**Post date:** [February 19, 2024, 11:13pm UTC](https://forum.systemcrafters.net/t/maximising-minimising-windows/309/1 "2024-02-19T23:13:13Z")

</div>

I’m looking for a way to toggle maximising of a window in a frame without closing all the other windows and with the ability to restore the previous size. Similarly to tmux zooming of the panes works.

The only ways I’ve found so far either:

- only `enlargen` the window - leaving plenty of space taken up by the other windows - or
- close all the other windows destroying my layout

is there a better way?

---

<div class="post-metadata">

**Author:** ![mirkoh](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mirkoh](https://forum.systemcrafters.net/u/mirkoh)\
**Post date:** [February 19, 2024, 11:31pm UTC](https://forum.systemcrafters.net/t/maximising-minimising-windows/309/2 "2024-02-19T23:31:26Z")

</div>

Interesting use case. I’ve read about the popper package but I haven’t tried it, maybe it has that functionality.

I’m using `tab-bar-history-mode` to restore previous window configurations, for your use case you would have to maximize the current buffer and then go back to a previous window configuration. Maybe a function could be created as a convenient “toggle” command.

---

<div class="post-metadata">

**Author:** ![alphapapa](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alphapapa](https://forum.systemcrafters.net/u/alphapapa)\
**Post date:** [February 20, 2024, 4:22am UTC](https://forum.systemcrafters.net/t/maximising-minimising-windows/309/3 "2024-02-20T04:22:23Z")

</div>

I’m not sure exactly what you mean, but have you seen `winner-mode`?

---

<div class="post-metadata">

**Author:** ![mirkoh](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mirkoh](https://forum.systemcrafters.net/u/mirkoh)\
**Post date:** [February 20, 2024, 4:52am UTC](https://forum.systemcrafters.net/t/maximising-minimising-windows/309/4 "2024-02-20T04:52:53Z")

</div>

This function seems to be what you were asking @elegant.wheel, thanks for the suggestion it seems useful to me. It can work with tab-bar-history-mode or winner-mode.

```auto
(defun my/toggle-maximize ()
  (interactive)
  (if (> (count-windows) 1)
      (delete-other-windows)
    ;; (tab-bar-history-back)
   (winner-undo) 
    ))

```
