From a0c2d0aea21633b055e07ab980c13330c1f0d21d Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 17 Nov 2011 11:27:56 +0100 Subject: [PATCH] Rename window-splits to window-combination-resize. * window.c (Vwindow_splits): Rename to Vwindow_combination_resize. Suggested by Juri Linkov. (Fsplit_window_internal): Use Vwindow_combination_resize instead of Vwindow_splits. * window.el (window-resize, delete-window, split-window): Replace window-splits by window-combination-resize. * cus-start.el (window-splits): Replace by window-combination-resize. * windows.texi (Resizing Windows, Splitting Windows) (Deleting Windows): Use term window-combination-resize instead of window-splits. --- doc/lispref/ChangeLog | 6 ++++++ doc/lispref/windows.texi | 40 ++++++++++++++++++++-------------------- etc/NEWS | 17 +++++++++-------- lisp/ChangeLog | 7 +++++++ lisp/cus-start.el | 2 +- lisp/window.el | 19 ++++++++++--------- src/ChangeLog | 7 +++++++ src/window.c | 22 +++++++++++++--------- 8 files changed, 73 insertions(+), 47 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 3ca675a2144..0fa50492481 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,9 @@ +2011-11-17 Martin Rudalics + + * windows.texi (Resizing Windows, Splitting Windows) + (Deleting Windows): Use term window-combination-resize instead + of window-splits. + 2011-11-16 Martin Rudalics * windows.texi (Resizing Windows, Splitting Windows): Rename diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 6c5247bd144..8c99a06909b 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -633,11 +633,11 @@ The optional argument @var{ignore} has the same meaning as for the function @code{window-resizable} above. The choice of which window edges this function alters depends on the -values of the option @code{window-splits} and the combination-limit -status of the involved windows; in some cases, it may alter both edges. -@xref{Splitting Windows}. To resize by moving only the bottom or right -edge of a window, use the function @code{adjust-window-trailing-edge}, -below. +values of the option @code{window-combination-resize} and the +combination-limit status of the involved windows; in some cases, it may +alter both edges. @xref{Splitting Windows}. To resize by moving only +the bottom or right edge of a window, use the function +@code{adjust-window-trailing-edge}, below. @end defun @c The commands enlarge-window, enlarge-window-horizontally, @@ -844,7 +844,7 @@ the new root window. The following two options can be used to modify the operation of @code{split-window}. -@defopt window-splits +@defopt window-combination-resize If this variable is @code{nil}, @code{split-window} can only split a window (denoted by @var{window}) if @var{window}'s screen area is large enough to accommodate both itself and the new window. This is @@ -864,8 +864,8 @@ The setting of this variable has no effect if @code{window-combination-limit} (see below) is non-@code{nil}. @end defopt -To illustrate the use of @code{window-splits} consider the following -window configuration: +To illustrate the use of @code{window-combination-resize} consider the +following window configuration: @smallexample @group ______________________________________ @@ -886,8 +886,9 @@ window configuration: @end group @end smallexample -Splitting window @code{W3} with @code{window-splits} @code{nil} -produces a configuration where the size of @code{W2} remains unchanged: +Splitting window @code{W3} with @code{window-combination-resize} +@code{nil} produces a configuration where the size of @code{W2} remains +unchanged: @smallexample @group ______________________________________ @@ -908,10 +909,8 @@ produces a configuration where the size of @code{W2} remains unchanged: @end group @end smallexample -Splitting @code{W3} with @code{window-splits} non-@code{nil} instead -produces a configuration where all windows have approximately the same -height: - +Splitting @code{W3} with @code{window-combination-resize} non-@code{nil} +instead steals the space for @code{W4} from both @code{W2} and @code{W3}: @smallexample @group ______________________________________ @@ -979,7 +978,7 @@ return value is @var{status}. To illustrate the use of @code{window-combination-limit} consider the following configuration (throughout the following examples we shall -assume that @code{window-splits} invariantly is @code{nil}). +assume that @code{window-combination-resize} invariantly is @code{nil}). @smallexample @group ______________________________________ @@ -1184,11 +1183,12 @@ window parameters. If the @code{delete-window} parameter specifies a function, that function is called with @var{window} as its sole argument. -If @code{window-splits} (@pxref{Splitting Windows}) is @code{nil}, the -space @var{window} took up is given to its left sibling if such a window -exists and to its right sibling otherwise. If @code{window-splits} is -non-@code{nil}, the space of @var{window} is proportionally distributed -among the remaining windows in the same combination. +If @code{window-combination-resize} (@pxref{Splitting Windows}) is +@code{nil}, the space @var{window} took up is given to its left sibling +if such a window exists and to its right sibling otherwise. If +@code{window-combination-resize} is non-@code{nil}, the space of +@var{window} is proportionally distributed among the remaining windows +in the same combination. @end deffn @deffn Command delete-other-windows &optional window diff --git a/etc/NEWS b/etc/NEWS index b9e65a8b7d3..8b08707c274 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -403,16 +403,17 @@ specified by `display-buffer-fallback-action'. display actions, taking precedence over `display-buffer-base-action'. +++ -*** New option `window-nest'. -The new option `window-nest' allows to return the space obtained for -resizing or creating a window more reliably to the window from which -such space was obtained. +*** New option `window-combination-limit'. +The new option `window-combination-limit' allows to return the space +obtained for resizing or creating a window more reliably to the window +from which such space was obtained. +++ -*** New option `window-splits'. -The new option `window-splits' allows to split a window that otherwise -cannot be split because it's too small by stealing space from other -windows in the same combination. +*** New option `window-combination-resize'. +The new option `window-combination-resize' allows to split a window that +otherwise cannot be split because it's too small by stealing space from +other windows in the same combination. Subsequent resizing or deletion +of the window will resize all windows in the same combination as well. +++ *** New commands `maximize-window' and `minimize-window'. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ccb115ec471..f85404077a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2011-11-17 Martin Rudalics + + * window.el (window-resize, delete-window, split-window): + Replace window-splits by window-combination-resize. + * cus-start.el (window-splits): Replace by + window-combination-resize. + 2011-11-17 Glenn Morris * progmodes/sh-script.el (sh-font-lock-keywords-var): diff --git a/lisp/cus-start.el b/lisp/cus-start.el index c8df8985be9..1d6b42f48e6 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -400,7 +400,7 @@ since it could result in memory overflow and make Emacs crash." (const :tag "Never (nil)" :value nil) (const :tag "Only on ttys" :value tty) (other :tag "Always" t)) "23.1") - (window-splits windows boolean "24.1") + (window-combination-resize windows boolean "24.1") (window-combination-limit windows boolean "24.1") ;; xdisp.c (show-trailing-whitespace whitespace-faces boolean nil diff --git a/lisp/window.el b/lisp/window.el index 4550526b44d..10c6adc04e4 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -1482,11 +1482,11 @@ instead." ((window--resizable-p window delta horizontal ignore) (window--resize-reset frame horizontal) (window--resize-this-window window delta horizontal ignore t) - (if (and (not window-splits) + (if (and (not window-combination-resize) (window-combined-p window horizontal) (setq sibling (or (window-right window) (window-left window))) (window-sizable-p sibling (- delta) horizontal ignore)) - ;; If window-splits is nil, WINDOW is part of an + ;; If window-combination-resize is nil, WINDOW is part of an ;; iso-combination, and WINDOW's neighboring right or left ;; sibling can be resized as requested, resize that sibling. (let ((normal-delta @@ -2389,7 +2389,8 @@ non-side window, signal an error." (sibling (or (window-left window) (window-right window)))) (window--resize-reset frame horizontal) (cond - ((and (not window-splits) sibling (window-sizable-p sibling size)) + ((and (not window-combination-resize) + sibling (window-sizable-p sibling size)) ;; Resize WINDOW's sibling. (window--resize-this-window sibling size horizontal nil t) (set-window-new-normal @@ -3112,11 +3113,11 @@ frame. The selected window is not changed by this function." ;; window gets created set `window-combination-limit' to t. (setq window-combination-limit t)) - (when (and window-splits size (> size 0)) - ;; If `window-splits' is non-nil and SIZE is a non-negative - ;; integer, we cannot reasonably resize other windows. Rather - ;; bind `window-combination-limit' to t to make sure that - ;; subsequent window deletions are handled correctly. + (when (and window-combination-resize size (> size 0)) + ;; If `window-combination-resize' is non-nil and SIZE is a + ;; non-negative integer, we cannot reasonably resize other + ;; windows. Rather bind `window-combination-limit' to t to make + ;; sure that subsequent window deletions are handled correctly. (setq window-combination-limit t)) (let* ((parent-size @@ -3126,7 +3127,7 @@ frame. The selected window is not changed by this function." ;; `resize' non-nil means we are supposed to resize other ;; windows in WINDOW's combination. (resize - (and window-splits (not window-combination-limit) + (and window-combination-resize (not window-combination-limit) ;; Resize makes sense in iso-combinations only. (window-combined-p window horizontal))) ;; `old-size' is the current size of WINDOW. diff --git a/src/ChangeLog b/src/ChangeLog index bc82064afb7..bd5f9e4dd02 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-11-17 Martin Rudalics + + * window.c (Vwindow_splits): Rename to + Vwindow_combination_resize. Suggested by Juri Linkov. + (Fsplit_window_internal): Use Vwindow_combination_resize instead + of Vwindow_splits. + 2011-11-16 Juanma Barranquero * nsfns.m (Fns_font_name): diff --git a/src/window.c b/src/window.c index b34101c2f91..c8f0f169e5d 100644 --- a/src/window.c +++ b/src/window.c @@ -3702,8 +3702,8 @@ set correctly. See the code of `split-window' for how this is done. */) error ("Attempt to split minibuffer window"); else if (XINT (total_size) < (horflag ? 2 : 1)) error ("Size of new window too small (after split)"); - else if (!combination_limit && !NILP (Vwindow_splits)) - /* `window-splits' non-nil means try to resize OLD's siblings + else if (!combination_limit && !NILP (Vwindow_combination_resize)) + /* `window-combination-resize' non-nil means try to resize OLD's siblings proportionally. */ { p = XWINDOW (o->parent); @@ -6491,16 +6491,20 @@ will redraw the entire frame; the special value `tty' causes the frame to be redrawn only if it is a tty frame. */); Vrecenter_redisplay = Qtty; - DEFVAR_LISP ("window-splits", Vwindow_splits, - doc: /* Non-nil means splitting windows is handled specially. + DEFVAR_LISP ("window-combination-resize", Vwindow_combination_resize, + doc: /* Non-nil means resize window combinations proportionally. If this variable is nil, splitting a window gets the entire screen space -for displaying the new window from the window to split. If this -variable is non-nil, splitting a window may resize all windows in the -same combination. This also allows to split a window that is otherwise -too small or of fixed size. +for displaying the new window from the window to split. Deleting and +resizing a windwo preferably resizes one adjacent window only. + +If this variable is non-nil, splitting a window tries to get the space +proportionally from all windows in the same combination. This also +allows to split a window that is otherwise too small or of fixed size. +Resizing and deleting a window proportionally resize all windows in the +same combination. This variable takes no effect if `window-combination-limit' is non-nil. */); - Vwindow_splits = Qnil; + Vwindow_combination_resize = Qnil; DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit, doc: /* Non-nil means splitting a window makes a new parent window. -- 2.39.2