Commit 89d61221 authored by Martin Rudalics's avatar Martin Rudalics

Don't handle splits status.

* window.h (window): Remove splits slot.
* window.c (Fwindow_splits, Fset_window_splits): Remove.
(Fdelete_other_windows_internal, make_parent_window)
(make_window, Fsplit_window_internal, Fdelete_window_internal)
(Fset_window_configuration, save_window_save): Don't deal with
split status of windows.
(saved_window): Remove splits slot.
(Vwindow_splits): Rewrite doc-string.
* window.el (window-resize, delete-window): Use window-splits
variable instead of function.
(window-state-get-1, window-state-put-2, window-state-put):
Don't deal with windows' splits status.
* windows.texi (Splitting Windows, Deleting Windows): Remove
references to splits status of windows.
parent 98282f6f
2011-11-12 Martin Rudalics <rudalics@gmx.at>
* windows.texi (Splitting Windows, Deleting Windows): Remove
references to splits status of windows.
2011-11-10 Glenn Morris <rgm@gnu.org>
* buffers.texi (Read Only Buffers): Expand a bit on why
......
......@@ -855,42 +855,13 @@ resize all windows that are part of the same combination as
this may allow @code{split-window} to succeed even if @var{window} is
a fixed-size window or too small to ordinarily split.
In any case, the value of this variable is assigned to the splits status
of the new window and, provided old and new window form a new
combination, of the old window as well. The splits status of a window
can be retrieved by invoking the function @code{window-splits} and
altered by the function @code{set-window-splits} described next.
If @code{window-nest} (see below) is non-@code{nil}, the space for the
new window is exclusively taken from the old window, but the splits
status of the involved windows is nevertheless set as described here.
@end defopt
@defun window-splits &optional window
This function returns the splits status of @var{window}. The argument
@var{window} can be any window and defaults to the selected one.
@cindex splits status
The @dfn{splits status} of a window specifies how resizing and deleting
that window may affect the size of other windows in the same window
combination. More precisely, if @var{window}'s splits status is
@code{nil} and @var{window} is resized, the corresponding space is
preferably taken from (or given to) @var{window}'s right sibling. When
@var{window} is deleted, its space is given to its left sibling. If
@var{window}'s splits status is non-@code{nil}, resizing and deleting
@var{window} may resize @emph{all} windows in @var{window}'s
combination.
The splits status is initially set by @code{split-window}
from the current value of the variable @code{window-splits} (see above)
and can be reset by the function @code{set-window-splits} (see below).
@end defun
Also if this variable is non-@code{nil}, subsequent resizing and
deleting @var{window} will usually affect @emph{all} windows in
@var{window}'s combination.
@defun set-window-splits window &optional status
This function sets the splits status (see above) of @var{window} to
@var{status}. The argument @var{window} can be any window and defaults
to the selected one. The return value is @var{status}.
@end defun
The setting of this variable has no effect if @code{window-nest} (see
below) is non-@code{nil}.
@end defopt
To illustrate the use of @code{window-splits} consider the following
window configuration:
......@@ -1208,12 +1179,11 @@ window parameters. If the @code{delete-window} parameter specifies a
function, that function is called with @var{window} as its sole
argument.
If the splits status of @var{window} (@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 the
splits status of @var{window} is non-@code{nil}, its space is
proportionally distributed among the remaining windows in the same
combination.
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.
@end deffn
@deffn Command delete-other-windows &optional window
......
2011-11-12 Martin Rudalics <rudalics@gmx.at>
* window.el (window-resize, delete-window): Use window-splits
variable instead of function.
(window-state-get-1, window-state-put-2, window-state-put):
Don't deal with windows' splits status.
2011-11-12 Glenn Morris <rgm@gnu.org>
* apropos.el (apropos-do-all, apropos-library, apropos-value)
......
......@@ -1482,12 +1482,12 @@ 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 window))
(if (and (not window-splits)
(window-combined-p window horizontal)
(setq sibling (or (window-right window) (window-left window)))
(window-sizable-p sibling (- delta) horizontal ignore))
;; If window-splits returns nil for WINDOW, WINDOW is part of
;; an iso-combination, and WINDOW's neighboring right or left
;; If window-splits 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
(/ (float delta)
......@@ -2389,8 +2389,7 @@ non-side window, signal an error."
(sibling (or (window-left window) (window-right window))))
(window--resize-reset frame horizontal)
(cond
((and (not (window-splits window))
sibling (window-sizable-p sibling size))
((and (not window-splits) sibling (window-sizable-p sibling size))
;; Resize WINDOW's sibling.
(window--resize-this-window sibling size horizontal nil t)
(set-window-new-normal
......@@ -3585,7 +3584,6 @@ specific buffers."
(total-width . ,(window-total-size window t))
(normal-height . ,(window-normal-size window))
(normal-width . ,(window-normal-size window t))
(splits . ,(window-splits window))
(nest . ,(window-nest window))
,@(let (list)
(dolist (parameter (window-parameters window))
......@@ -3740,7 +3738,6 @@ value can be also stored on disk and read back in a new session."
(nest (cdr (assq 'nest item)))
(parameters (cdr (assq 'parameters item)))
(state (cdr (assq 'buffer item))))
(when splits (set-window-splits window splits))
(when nest (set-window-nest window nest))
;; Process parameters.
(when parameters
......@@ -3828,7 +3825,7 @@ windows can get as small as `window-safe-min-height' and
(cdr (assq 'total-width state)))))
(min-height (cdr (assq 'min-height head)))
(min-width (cdr (assq 'min-width head)))
window-splits selected)
selected)
(if (and (not totals)
(or (> min-height (window-total-size window))
(> min-width (window-total-size window t)))
......
2011-11-12 Martin Rudalics <rudalics@gmx.at>
* window.h (window): Remove splits slot.
* window.c (Fwindow_splits, Fset_window_splits): Remove.
(Fdelete_other_windows_internal, make_parent_window)
(make_window, Fsplit_window_internal, Fdelete_window_internal)
(Fset_window_configuration, save_window_save): Don't deal with
split status of windows.
(saved_window): Remove splits slot.
(Vwindow_splits): Rewrite doc-string.
2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
* xfns.c (unwind_create_frame):
......
......@@ -465,41 +465,6 @@ Return nil if WINDOW has no previous sibling. */)
return decode_any_window (window)->prev;
}
DEFUN ("window-splits", Fwindow_splits, Swindow_splits, 0, 1, 0,
doc: /* Return splits status for the window WINDOW.
If WINDOW is omitted or nil, it defaults to the selected window.
If the value returned by this function is nil and WINDOW is resized, the
corresponding space is preferably taken from (or given to) WINDOW's
right sibling. When WINDOW is deleted, its space is given to its left
sibling.
If the value returned by this function is non-nil, resizing and deleting
WINDOW may resize all windows in the same combination. */)
(Lisp_Object window)
{
return decode_any_window (window)->splits;
}
DEFUN ("set-window-splits", Fset_window_splits, Sset_window_splits, 2, 2, 0,
doc: /* Set splits status of window WINDOW to STATUS.
If WINDOW is omitted or nil, it defaults to the selected window.
If STATUS is nil and WINDOW is later resized, the corresponding space is
preferably taken from (or given to) WINDOW's right sibling. When WINDOW
is deleted, its space is given to its left sibling.
If STATUS is non-nil, resizing and deleting WINDOW may resize all
windows in the same combination. */)
(Lisp_Object window, Lisp_Object status)
{
register struct window *w = decode_any_window (window);
w->splits = status;
return w->splits;
}
DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0,
doc: /* Return nest status of window WINDOW.
If WINDOW is omitted or nil, it defaults to the selected window.
......@@ -2769,9 +2734,6 @@ window-start value is reasonable when this function is called. */)
replace_window (root, window, 1);
/* Reset WINDOW's splits status. */
w->splits = Qnil;
/* This must become SWINDOW anyway ....... */
if (!NILP (w->buffer) && !resize_failed)
{
......@@ -3286,7 +3248,6 @@ make_parent_window (Lisp_Object window, int horflag)
p->start = Qnil;
p->pointm = Qnil;
p->buffer = Qnil;
p->splits = Qnil;
p->nest = Qnil;
p->window_parameters = Qnil;
}
......@@ -3334,7 +3295,7 @@ make_window (void)
w->start_at_line_beg = w->display_table = w->dedicated = Qnil;
w->base_line_number = w->base_line_pos = w->region_showing = Qnil;
w->column_number_displayed = w->redisplay_end_trigger = Qnil;
w->splits = w->nest = w->window_parameters = Qnil;
w->nest = w->window_parameters = Qnil;
w->prev_buffers = w->next_buffers = Qnil;
/* Initialize non-Lisp data. */
w->desired_matrix = w->current_matrix = 0;
......@@ -3776,10 +3737,6 @@ set correctly. See the code of `split-window' for how this is done. */)
p = XWINDOW (o->parent);
/* Store value of `window-nest' in new parent's nest slot. */
p->nest = Vwindow_nest;
/* Have PARENT inherit splits slot value from OLD. */
p->splits = o->splits;
/* Store value of `window-splits' in OLD's splits slot. */
o->splits = Vwindow_splits;
/* These get applied below. */
p->new_total = horflag ? o->total_cols : o->total_lines;
p->new_normal = new_normal;
......@@ -3830,9 +3787,6 @@ set correctly. See the code of `split-window' for how this is done. */)
n->scroll_bar_width = r->scroll_bar_width;
n->vertical_scroll_bar_type = r->vertical_scroll_bar_type;
/* Store `window-splits' in NEW's splits slot. */
n->splits = Vwindow_splits;
/* Directly assign orthogonal coordinates and sizes. */
if (horflag)
{
......@@ -3972,7 +3926,6 @@ Signal an error when WINDOW is the only window on its frame. */)
PARENT (the nest slot is not inherited). */
s->normal_cols = p->normal_cols;
s->normal_lines = p->normal_lines;
s->splits = p->splits;
/* Mark PARENT as deleted. */
p->vchild = p->hchild = Qnil;
/* Try to merge SIBLING into its new parent. */
......@@ -5359,7 +5312,7 @@ struct saved_window
Lisp_Object left_margin_cols, right_margin_cols;
Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins;
Lisp_Object scroll_bar_width, vertical_scroll_bar_type, dedicated;
Lisp_Object splits, nest, window_parameters;
Lisp_Object nest, window_parameters;
};
#define SAVED_WINDOW_N(swv,n) \
......@@ -5590,7 +5543,6 @@ the return value is nil. Otherwise the value is t. */)
w->scroll_bar_width = p->scroll_bar_width;
w->vertical_scroll_bar_type = p->vertical_scroll_bar_type;
w->dedicated = p->dedicated;
w->splits = p->splits;
w->nest = p->nest;
w->window_parameters = p->window_parameters;
XSETFASTINT (w->last_modified, 0);
......@@ -5869,7 +5821,6 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
p->scroll_bar_width = w->scroll_bar_width;
p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
p->dedicated = w->dedicated;
p->splits = w->splits;
p->nest = w->nest;
p->window_parameters = w->window_parameters;
if (!NILP (w->buffer))
......@@ -6333,7 +6284,7 @@ freeze_window_starts (struct frame *f, int freeze_p)
and the like.
This ignores a couple of things like the dedicatedness status of
window, splits, nest and the like. This might have to be fixed. */
window, nest and the like. This might have to be fixed. */
int
compare_window_configurations (Lisp_Object configuration1, Lisp_Object configuration2, int ignore_positions)
......@@ -6545,16 +6496,7 @@ 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.
The value of this variable is also assigned to the split status of the
new window and, provided the old and new window form a new combination,
to the window that was split as well. The split status of a window can
be retrieved with the function `window-splits' and altered by the
function `set-window-splits'.
If the value of the variable `window-nest' is non-nil, the space for the
new window is exclusively taken from the window that shall be split, but
the split status of the window that is split as well as that of the new
window are still set to the value of this variable. */);
This variable takes no effect if `window-nest' is non-nil. */);
Vwindow_splits = Qnil;
DEFVAR_LISP ("window-nest", Vwindow_nest,
......@@ -6591,8 +6533,6 @@ function `window-nest' and altered by the function `set-window-nest'. */);
defsubr (&Swindow_left_child);
defsubr (&Swindow_next_sibling);
defsubr (&Swindow_prev_sibling);
defsubr (&Swindow_splits);
defsubr (&Sset_window_splits);
defsubr (&Swindow_nest);
defsubr (&Sset_window_nest);
defsubr (&Swindow_use_time);
......
......@@ -258,10 +258,6 @@ struct window
must run the redisplay-end-trigger-hook. */
Lisp_Object redisplay_end_trigger;
/* Non-nil means deleting or resizing this window distributes
space among all windows in the same combination. */
Lisp_Object splits;
/* Non-nil means this window's child windows are never
(re-)combined. */
Lisp_Object nest;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment