I wrote this code yesterday evening. It swaps buffer between two windows in emacs.
It doesn't work that the number of window is not equals TWO.
[code]
(defun qw-swap-window-split ()
"This code swap two buffers in two windows, arranged left-right or
up-down. It works for one frame of two windows."
(interactive)
(if (= (count-windows) 2)
(let* ((cur-buf (window-buffer))
(next-buf (window-buffer (next-window))))
(set-window-buffer (selected-window) next-buf)
(set-window-buffer (next-window) cur-buf))))
[/code]
阅读(480) | 评论(0) | 转发(0) |