2

This is a follow up to this emacs stackexchange question:

Given split windows like this:

|------|-------|
|1     |2      |
|      |       |
|------|-------|
|3     |4      |
|      |       |
|------|-------|

With C-x 0 (or the command delete-window) we can delete a window. For example, with point on window-1 if we execute C-x 0 then window-1 will be deleted. But how to control the direction of collapse i.e. - how to pick between the following two possible ways of deleting window-1:

|------|-------|
|2             |
|              |
|------|-------|
|3     |4      |
|      |       |
|------|-------|

Or,

|------|-------|
|3     |2      |
|      |       |
|      |-------|
|      |4      |
|      |       |
|------|-------|
Inspired_Blue
  • 278
  • 2
  • 12
  • This might be a duplicate question. Please search with `[window-splitting]` to see. If so, please delete this one. – Drew Sep 29 '22 at 16:14
  • @Drew: Thanks for the alert. I checked - there are 149 questions right now with the tag `[window-splitting]`. I could not find an answer to this question in any of those. Please let me know if I overlooked and I will delete this post. Thanks again! – Inspired_Blue Sep 29 '22 at 17:45
  • There is one solution that I can think of: suppose you end up with one of the layouts but you wanted the other - then swap window-2 and window-3 and then transpose the layout to go to the other layout. But this may not be always possible if there are more than 4 windows. But I imagine some other sequence of window layout transformations may transition between both the layouts. However, it will be nice if all that _extra work_ can be avoided by being able to chose the direction of collapse while deleting window! – Inspired_Blue Sep 29 '22 at 17:54
  • Thanks for checking! Sorry I was mistaken that this might be a dup. – Drew Sep 29 '22 at 18:53

0 Answers0