>From 746ae2161fac4f9a54eac1ec9cdb4a8d3269e9c8 Mon Sep 17 00:00:00 2001 From: Hugo Heagren Date: Tue, 26 Jul 2022 21:17:46 +0100 Subject: [PATCH 4/6] split-root-window-right: New function * lisp/window.el (split-root-window-right): New function to split whole frame. * doc/lispref/windows.texi (Splitting Windows): Add documentation for `split-root-window-right'. --- doc/lispref/windows.texi | 6 ++++++ lisp/window.el | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 3b0c4e4197..6734fd3e48 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1491,6 +1491,12 @@ Splitting Windows configuration is retained on the top, and a new window is created below, taking up the whole width of the frame. @var{size} is treated as by @code{split-window-below}. + +@deffn Command split-root-window-right &optional size +This function splits the whole frame in two. The current window +configuration is retained on the left, and a new window is created on +the right, taking up the whole height of the frame. @var{size} is treated +as by @code{split-window-right}. @end deffn @defopt split-window-keep-point diff --git a/lisp/window.el b/lisp/window.el index 9acc393f30..c23f3a54f2 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5761,6 +5761,15 @@ split-window-right new-window)) (defalias 'split-window-horizontally 'split-window-right) + +(defun split-root-window-right (&optional size) + "Split root window of current frame into two side-by-side windows. +The current window configuration is retained within the left +window, and a new window is created on the right, taking up the +whole height of the frame. SIZE is treated as by +`split-window-right'." + (interactive "P") + (split-window-right size (frame-root-window))) ;;; Balancing windows. -- 2.20.1