Chinaunix首页 | 论坛 | 博客
  • 博客访问: 120786
  • 博文数量: 24
  • 博客积分: 3030
  • 博客等级: 中校
  • 技术积分: 580
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-11 10:58
文章分类

全部博文(24)

文章存档

2011年(2)

2010年(4)

2009年(10)

2008年(8)

我的朋友

分类: LINUX

2009-07-24 17:34:52

  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) |
0

上一篇:hi where am I?

下一篇:what are you doing?

给主人留下些什么吧!~~