emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add function to rotate/transpose all windows


From: pranshu sharma
Subject: Re: Add function to rotate/transpose all windows
Date: Sun, 06 Oct 2024 12:54:13 +1000
User-agent: Gnus/5.13 (Gnus v5.13)

martin rudalics <rudalics@gmx.at> writes:

>> Say window window-tree-pixel-sizes retruns:
>>
>> ((t (918 . 562) (#<window 7 on *scratch*> (442 . 562)) (#<window 23 on
>> *scratch*> (476 . 562))))
>>
>> Then if you C-x 1, and then:
>> (window-rebuild-tree
>>    '((t (918 . 562) (#<window 7 on *scratch*> (442 . 562)) (#<window 23 on
>>     *scratch*> (476 . 562)))))
>>
>> It should rebuild the whole thing to the orignal
>
> Yes.  That would be useful to (1) make a window state and store it
> somewhere (2) arbitrarily alter the frame's configuration and (3) put
> the state back into its frame.  It's obviously the same thing
> 'save-window-excursion' does but there's a twist: When a frame gets
> deleted, you cannot restore the window configuration in it.
> 'window-build-tree' could do it and 'undelete-frame' could use it.  It
> has one drawback: We can't collect the dead windows as long as the saved
> state needs them.  BTW I have no idea why 'undelete-frame-mode' does not
> try to resurrect a deleted frame as we do with windows.

I was thinking more about making it easier to programticly change the
layout, as window-configurations are in C source, which is far from
userland.  This would make it possible to do stuff like recursivly go
through window tree and do whatver you want, eg make vertical split
windows a bit larger.


>>> One thing 'window-tree-pixel-sizes' should then possibly do is to
>>> include the identity of internal windows so 'window-rebuild-tree'
>>> could resurrect them as well.
>>
>> idk what you mean by this, is the identity not included in window object
>> itself, as in does refer argument not work with it?
>
> No.  Look at your your example above: All we know about the parent
> window is what type of combination it is and what sizes it has.

Do you mean the windows lile #<window nnn>, that are not included in
(window-tree) and return nil in window-live-p?

If so, what do we need to know about them apart from sizes,
transpose-windows and that know nothing about them and still work.

>> also I found that when using tabs from tab-bar-mode, calling functions
>> like flip windows 2 times in a row will fuck up the tabs.
>
> In what sense does it "fuck up the tabs"?
>

It just makes them dissapear in gui, and in terminal it makes them blank.

Try this:
C-x t n
C-x 2
C-x 3
M-x flip-windows
C-x z



reply via email to

[Prev in Thread] Current Thread [Next in Thread]