[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: creating 6 balanced windows in a single command
From: |
TheFlyingDutchman |
Subject: |
Re: creating 6 balanced windows in a single command |
Date: |
Wed, 08 Dec 2010 15:19:41 -0000 |
User-agent: |
G2/1.0 |
On Jul 20, 6:26 am, Terrence Brannon <metap...@gmail.com> wrote:
> I thought that Emacs 23 had a single command that would create 6
> balanced windows like
> this:http://www.screencast.com/users/terrence_work/folders/Jing/media/7578...
>
> If not, I suppose I could always write the simple elisp to do it in a
> command myself.
I don't know if a function already exists, but this seems to work:
; close any other open windows and then
; divide the current active window into six similar sized windows
(defun MakeSixWindows ()
(interactive)
(delete-other-windows)
(split-window-vertically)
(next-window)
(setq windowColumns
(let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))) )
(split-window-horizontally (round (* windowColumns 0.66)))
(split-window-horizontally)
(previous-multiframe-window)
(split-window-horizontally (round (* windowColumns 0.66)))
(next-window)
(split-window-horizontally)
)
; run MakeSixWindows function by pressing the F8 key
(global-set-key (kbd "<f8>") 'MakeSixWindows)