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

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

Re: rotate split windows


From: Chris Menzel
Subject: Re: rotate split windows
Date: Tue, 5 Dec 2006 21:03:06 +0000 (UTC)
User-agent: slrn/0.9.8.1 (FreeBSD)

On 05 Dec 2006 11:09:28 +0100, Marco Wahl <mw@visenso.de> said:
> Markus Triska <triska@gmx.at> writes:
>
>> Add this to your .emacs:
>> 
>> 
>> (defun rotate-split ()
>>   (interactive)
>>   (let ((root (car (window-tree))))
>> [...]
>
> Calling the function gives
>
> car: Symbol's function definition is void: window-tree
>
> Is there an alternative for
>
> $ emacs --version
> GNU Emacs 21.3.1

Give this a try:

(defun rotate-window-buffers()
  (interactive)
  (let* ((windows (window-list))
         (buffers (mapcar #'window-buffer windows))
         (wpoints (mapcar #'window-point windows))
         (w (pop windows)))
         (setq windows (append windows `(,w)))
         (mapc (lambda(w)
                 (let ((b (pop buffers))
                       (p (pop wpoints)))
                       (set-window-buffer w b)
                       (set-window-point w p)))
               windows)))

(define-key global-map [f7] 'rotate-window-buffers)



reply via email to

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