Answers:
这是一个简单的功能,可以在水平和垂直分割之间切换。假定您只有两个窗口,并且不进行任何调整大小:
(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))))))
另外,tranpose-frame
EmacsWiki上还有一个软件包,可让您转置整个框架,以及进行其他转换(旋转180度;顺时针或逆时针旋转90度;水平或垂直翻转)。