From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.help Subject: Re: rotate split windows Date: Mon, 04 Dec 2006 20:54:37 +0100 Message-ID: <87u00bl9mq.fsf@gmx.at> References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165264902 5810 80.91.229.10 (4 Dec 2006 20:41:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Dec 2006 20:41:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 04 21:41:41 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GrKcw-0001Ye-VR for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Dec 2006 21:41:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GrKcw-0002Xb-Ri for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Dec 2006 15:41:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Original-Newsgroups: gnu.emacs.help Cancel-Lock: sha1:iPQGOC4kntrz28v+Z6nVe1/Qhr0= Original-Lines: 42 Original-NNTP-Posting-Host: news-access-from.tuwien.ac.at Original-X-Trace: 1165261992 tunews.univie.ac.at 12642 192.35.241.118 Original-X-Complaints-To: abuse@tuwien.ac.at Original-Xref: shelby.stanford.edu gnu.emacs.help:143654 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39256 Archived-At: "wim yedema" writes: > I would like to be able to "rotate" the split between windows, eg: > from (A, B) vertical to (A, B) horizonal, to (B, A) vertical, to (B, > A) horizontal, and the other way around. Can anyone tell me how to > do this? Add this to your .emacs: (defun rotate-split () (interactive) (let ((root (car (window-tree)))) (if (listp root) (let* ((w1 (nth 2 root)) (w2 (nth 3 root)) (b1 (window-buffer w1)) (b2 (window-buffer w2))) (cond ((car root) ; currently vertically split (delete-window w2) (set-window-buffer (split-window-horizontally) b2)) (t ; currently horizontally split (delete-window w1) (set-window-buffer (split-window-vertically) b1)))) (message "Root window not split")))) and invoke it with M-x rotate-split. You can add this: (global-set-key [f9] 'rotate-split) to bind it to the function key F9 (for example). The clockwise direction is analogous. All the best, Markus Triska