Window A
++++++++
Window B
Is there a way to switch to
Window A : Window B
Is there a way to switch view without closing windows?
Window A
++++++++
Window B
Is there a way to switch to
Window A : Window B
Is there a way to switch view without closing windows?
Alternatively, there's a tranpose-frame
package on EmacsWiki that will allow you to transpose the whole frame, as well as do other transformations (rotate by by 180 degrees; rotate by 90 degrees clockwise or counterclockwise; flip horizontally or vertically).
Here's a simple function that will toggle between a horizontal and vertical split. It assumes you've only got two windows, and doesn't do any resizing:
(defun window-split-toggle ()
"Toggle between horizontal and vertical split with two windows."
(interactive)
(if (> (length (window-list)) 2)
(error "Can't toggle with more than 2 windows!")
(let ((func (if (window-full-height-p)
#'split-window-vertically
#'split-window-horizontally)))
(delete-other-windows)
(funcall func)
(save-selected-window
(other-window 1)
(switch-to-buffer (other-buffer))))))