emacsで、C-x 3
して、画面を左右に2分割したあとに、左右のwindowを入れ替えるにはどうすればよいでしょうか?
1 件の回答
画面が2分割されている時に、それらの位置を入れ替える関数です。
;; from http://www.emacswiki.org/emacs/TransposeWindows
(defun swap-window-positions () ; Stephen Gildea
"*Swap the positions of this window and the next one."
(interactive)
(let ((other-window (next-window (selected-window) 'no-minibuf)))
(let ((other-window-buffer (window-buffer other-window))
(other-window-hscroll (window-hscroll other-window))
(other-window-point (window-point other-window))
(other-window-start (window-start other-window)))
(set-window-buffer other-window (current-buffer))
(set-window-hscroll other-window (window-hscroll (selected-window)))
(set-window-point other-window (point))
(set-window-start other-window (window-start (selected-window)))
(set-window-buffer (selected-window) other-window-buffer)
(set-window-hscroll (selected-window) other-window-hscroll)
(set-window-point (selected-window) other-window-point)
(set-window-start (selected-window) other-window-start))
(select-window other-window)))