emacs, unsplit a particular window split

EmacsElisp

Emacs Problem Overview


I often want to unsplit window as follows:

+--------------+-------------+			   +--------------+-------------+
|              |             |			   |              |   	       	|
|              |             |			   |              |   	       	|
|              |             |			   |              |   	       	|
+--------------+             |     -->	   |              |   	       	|
|              |             |			   |              |   	       	|
|              |             |			   |              |            	|
|              |             |			   |              |             |
+--------------+-------------+			   +--------------+-------------+



+--------------+--------------+			   +-----------------------------+
|              |              |			   |                             |
|              |              |			   |                             |
|              |              |			   |                             |
+--------------+--------------+    --> 	   +-----------------------------+
|                             |			   |                             |
|                             |			   |                             |
|                             |			   |                             |
+-----------------------------+			   +-----------------------------+

Currently, I start with ctrl-x 1 and then split vertically/horizontally. but my real qustion is how can one remove a particular window split with out disturbing the other window structure? Is there any elisp function in built?

Emacs Solutions


Solution 1 - Emacs

You can use the C-x0 key combination to delete the current window.

Solution 2 - Emacs

Rémi's answer is what you're looking for, but winner mode is also extremely useful for getting you back to previous window configurations after making any arbitrary changes (such as restoring those multiple-splits after typing C-x1).

You can enable it in your init file with:

(winner-mode 1) ;"C-c <left>" and "C-c <right>" undo and re-do window changes.

Also see: http://www.emacswiki.org/emacs/CategoryWindows

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkindaheroView Question on Stackoverflow
Solution 1 - EmacsRémiView Answer on Stackoverflow
Solution 2 - EmacsphilsView Answer on Stackoverflow