From: ueno Date: Wed, 30 Aug 2006 07:49:33 +0000 (+0000) Subject: * riece-layout.el (riece-layout-alist): Added X-Git-Tag: riece-3_1_1~5 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=214c98ce0416a5ce96f035dafbb60a488aade43d;p=elisp%2Friece.git * riece-layout.el (riece-layout-alist): Added riece-configure-windows-spiral. (riece-configure-windows-spiral): New window layout. Written by URABE Shyouhei . --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7613bcf..4a0f828 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2006-08-30 Daiki Ueno + * riece-layout.el (riece-layout-alist): Added + riece-configure-windows-spiral. + (riece-configure-windows-spiral): New window layout. Written by + URABE Shyouhei . + * riece-options.el (riece-addons): Enable riece-shrink-buffer by default. diff --git a/lisp/riece-layout.el b/lisp/riece-layout.el index 54c80b6..6583b1b 100644 --- a/lisp/riece-layout.el +++ b/lisp/riece-layout.el @@ -45,6 +45,7 @@ ("bottom-right" riece-configure-windows right bottom) ("bottom-left" riece-configure-windows left bottom) ("top" riece-configure-windows-top) + ("spiral" riece-configure-windows-spiral) ("default" . "middle-right")) "An alist mapping the names to layout functions. An element of this alist is either in the following forms: @@ -250,6 +251,52 @@ PLIST accept :command-height, :user-list-width, and :channel-list-width." (select-window (or (get-buffer-window buffer) (get-buffer-window riece-command-buffer))))) +;; +---+-------------------+---+ +;; | c | channel | u | +;; | h | | s | +;; | a | | e | +;; | n |-------------------+ r | | +---+ +;; | n | command | s | | | | +;; | e +-------------------+---+ | +-> | +;; | l | others | +-----+ +;; | s | | +;; +---+-----------------------+ +(defun riece-configure-windows-spiral () + "spiral placement of windows" +;; (interactive) + (let ((command-height 4) + (users-width 15) + (channels-width 30) + (buffer (window-buffer))) + (when (eq (selected-window) (minibuffer-window)) (other-window 1)) + (delete-other-windows) + + ;; (1) create channels window + (let ((rest (split-window (selected-window) channels-width t))) + (set-window-buffer (selected-window) riece-channel-list-buffer) + (select-window rest)) + + ;; (2) create others window + (set-window-buffer (split-window (selected-window) + (+ (/ (window-height) 2) + command-height)) + riece-others-buffer) + + ;; (3) create users window + (set-window-buffer (split-window (selected-window) + (- (window-width) users-width) t) + riece-user-list-buffer) + + ;; (4) create current channel window + (let ((rest (split-window (selected-window) + (- (window-height) command-height)))) + (set-window-buffer rest riece-command-buffer) + (set-window-buffer (selected-window) riece-channel-buffer)) + + (riece-set-window-points) + (select-window (or (get-buffer-window buffer) + (get-buffer-window riece-command-buffer))))) + (provide 'riece-layout) ;;; riece-layout.el ends here