[Top][All Lists]

[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/ (FreeBSD)

On 05 Dec 2006 11:09:28 +0100, Marco Wahl <address@hidden> said:
> Markus Triska <address@hidden> 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()
  (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)))

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

reply via email to

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