help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switch buffers in two frames


From: HS
Subject: Re: Switch buffers in two frames
Date: 3 Feb 2007 17:45:21 -0800
User-agent: G2/1.0

On Feb 3, 7:14 am, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Am 03.02.2007 um 07:16 schrieb Vols:
>
> > How can I switch the buffers between FrameA and Frame B and how to
> > bind the keyboard? Thanks
>
> Why can't you switch the frames?
>
> C-x o switches to another buffer ...
>
> --
> Greetings
>
>    Pete
>
> Make it simple, as simple as possible but no simpler.
>                                Albert Einstein

You're probably talking about a Swap Windows ?
If so, here is Yegge's version:

;; someday might want to rotate windows if more than 2 of them
(defun swap-windows ()
 "If you have 2 windows, it swaps them." (interactive) (cond ((not (=
(count-windows) 2)) (message "You need exactly 2 windows to do
this."))
 (t
 (let* ((w1 (first (window-list)))
         (w2 (second (window-list)))
         (b1 (window-buffer w1))
         (b2 (window-buffer w2))
         (s1 (window-start w1))
         (s2 (window-start w2)))
 (set-window-buffer w1 b2)
 (set-window-buffer w2 b1)
 (set-window-start w1 s2)
 (set-window-start w2 s1)))))

You can bind it with something like:
(global-set-key [f12] 'swap-windows)

Regards,
HS



reply via email to

[Prev in Thread] Current Thread [Next in Thread]