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.
-
+DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0,
+ doc: /* Return combination limit of window WINDOW.
If the return value is nil, child windows of WINDOW can be recombined with
-WINDOW's siblings. A return value of non-nil means that child windows of
+WINDOW's siblings. A return value of t means that child windows of
WINDOW are never \(re-)combined with WINDOW's siblings. */)
(Lisp_Object window)
{
- return decode_any_window (window)->nest;
+ return decode_any_window (window)->combination_limit;
}
-DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0,
- doc: /* Set nest status of window WINDOW to STATUS; return STATUS.
-If WINDOW is omitted or nil, it defaults to the selected window.
-
-If STATUS is nil, child windows of WINDOW can be recombined with WINDOW's
-siblings. STATUS non-nil means that child windows of WINDOW are never
-\(re-)combined with WINDOW's siblings. */)
- (Lisp_Object window, Lisp_Object status)
+DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
+ doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT.
+If LIMIT is nil, child windows of WINDOW can be recombined with
+WINDOW's siblings. LIMIT t means that child windows of WINDOW are
+never \(re-)combined with WINDOW's siblings. Other values are reserved
+for future use. */)
+ (Lisp_Object window, Lisp_Object limit)
{
register struct window *w = decode_any_window (window);
- w->nest = status;
+ w->combination_limit = limit;
- return w->nest;
+ return w->combination_limit;
}
DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
Scoordinates_in_window_p, 2, 2, 0,
doc: /* Return non-nil if COORDINATES are in WINDOW.
+WINDOW must be a live window.
COORDINATES is a cons of the form (X . Y), X and Y being distances
measured in characters from the upper-left corner of the frame.
\(0 . 0) denotes the character in the upper left corner of the
int x, y;
Lisp_Object lx, ly;
- CHECK_WINDOW (window);
+ CHECK_LIVE_WINDOW (window);
w = XWINDOW (window);
f = XFRAME (w->frame);
CHECK_CONS (coordinates);
w = XWINDOW (window);
parent = w->parent;
- if (!NILP (parent) && NILP (w->nest))
+ if (!NILP (parent) && NILP (w->combination_limit))
{
p = XWINDOW (parent);
if (((!NILP (p->vchild) && !NILP (w->vchild))
DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
- doc: /* Return window following WINDOW in cyclic ordering of windows.
+ doc: /* Return live window after WINDOW in the cyclic ordering of windows.
WINDOW must be a live window and defaults to the selected one. The
optional arguments MINIBUF and ALL-FRAMES specify the set of windows to
consider.
DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
- doc: /* Return window preceding WINDOW in cyclic ordering of windows.
+ doc: /* Return live window before WINDOW in the cyclic ordering of windows.
WINDOW must be a live window and defaults to the selected one. The
optional arguments MINIBUF and ALL-FRAMES specify the set of windows to
consider.
others.
If WINDOW is not on the list of windows returned, some other window will
-be listed first but no error is signalled. */)
+be listed first but no error is signaled. */)
(Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
{
return window_list_1 (window, minibuf, all_frames);
replace_window (root, window, 1);
- /* Reset WINDOW's splits status. */
- w->splits = Qnil;
-
/* This must become SWINDOW anyway ....... */
if (!NILP (w->buffer) && !resize_failed)
{
error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name)));
else
/* WINDOW is weakly dedicated to its buffer, reset
- dedicatedness. */
+ dedication. */
w->dedicated = Qnil;
call1 (Qrecord_window_buffer, window);
p->start = Qnil;
p->pointm = Qnil;
p->buffer = Qnil;
- p->splits = Qnil;
- p->nest = Qnil;
+ p->combination_limit = Qnil;
p->window_parameters = Qnil;
}
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->combination_limit = w->window_parameters = Qnil;
w->prev_buffers = w->next_buffers = Qnil;
/* Initialize non-Lisp data. */
w->desired_matrix = w->current_matrix = 0;
int horflag
/* HORFLAG is 1 when we split side-by-side, 0 otherwise. */
= EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright);
- int do_nest = 0;
+ int combination_limit = 0;
CHECK_WINDOW (old);
o = XWINDOW (old);
CHECK_NUMBER (total_size);
- /* Set do_nest to 1 if we have to make a new parent window. We do
- that if either `window-nest' is non-nil, or OLD has no parent, or
- OLD is ortho-combined. */
- do_nest =
- !NILP (Vwindow_nest)
+ /* Set combination_limit to 1 if we have to make a new parent window.
+ We do that if either `window-combination-limit' is t, or OLD has no
+ parent, or OLD is ortho-combined. */
+ combination_limit =
+ !NILP (Vwindow_combination_limit)
|| NILP (o->parent)
|| NILP (horflag
? (XWINDOW (o->parent)->hchild)
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 (!do_nest && !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);
}
/* This is our point of no return. */
- if (do_nest)
+ if (combination_limit)
{
/* Save the old value of o->normal_cols/lines. It gets corrupted
by make_parent_window and we need it below for assigning it to
make_parent_window (old, horflag);
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;
+ /* Store value of `window-combination-limit' in new parent's
+ combination_limit slot. */
+ p->combination_limit = Vwindow_combination_limit;
/* These get applied below. */
p->new_total = horflag ? o->total_cols : o->total_lines;
p->new_normal = new_normal;
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)
{
/* Put SIBLING into PARENT's place. */
replace_window (parent, sibling, 0);
/* Have SIBLING inherit the following three slot values from
- PARENT (the nest slot is not inherited). */
+ PARENT (the combination_limit 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. */
also erase the entire frame and redraw it (when `auto-resize-tool-bars'
is set to `grow-only', this resets the tool-bar's height to the minimum
height needed); if `recenter-redisplay' has the special value `tty',
-then only tty frame are redrawn.
+then only tty frames are redrawn.
Just C-u as prefix means put point in the center of the window
and redisplay normally--don't erase and redraw the frame. */)
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 combination_limit, window_parameters;
};
#define SAVED_WINDOW_N(swv,n) \
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->combination_limit = p->combination_limit;
w->window_parameters = p->window_parameters;
XSETFASTINT (w->last_modified, 0);
XSETFASTINT (w->last_overlay_modified, 0);
/* Return a pointer to the glyph W's physical cursor is on. Value is
- null if W's current matrix is invalid, so that no meaningfull glyph
+ null if W's current matrix is invalid, so that no meaningful glyph
can be returned. */
struct glyph *
get_phys_cursor_glyph (struct window *w)
{
struct glyph_row *row;
struct glyph *glyph;
+ int hpos = w->phys_cursor.hpos;
+
+ if (!(w->phys_cursor.vpos >= 0
+ && w->phys_cursor.vpos < w->current_matrix->nrows))
+ return NULL;
+
+ row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
+ if (!row->enabled_p)
+ return NULL;
- if (w->phys_cursor.vpos >= 0
- && w->phys_cursor.vpos < w->current_matrix->nrows
- && (row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos),
- row->enabled_p)
- && row->used[TEXT_AREA] > w->phys_cursor.hpos)
- glyph = row->glyphs[TEXT_AREA] + w->phys_cursor.hpos;
+ if (XINT (w->hscroll))
+ {
+ /* When the window is hscrolled, cursor hpos can legitimately be
+ out of bounds, but we draw the cursor at the corresponding
+ window margin in that case. */
+ if (!row->reversed_p && hpos < 0)
+ hpos = 0;
+ if (row->reversed_p && hpos >= row->used[TEXT_AREA])
+ hpos = row->used[TEXT_AREA] - 1;
+ }
+
+ if (row->used[TEXT_AREA] > hpos
+ && 0 <= hpos)
+ glyph = row->glyphs[TEXT_AREA] + hpos;
else
glyph = NULL;
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->combination_limit = w->combination_limit;
p->window_parameters = w->window_parameters;
if (!NILP (w->buffer))
{
ignore_positions non-zero means ignore non-matching scroll positions
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. */
+ This ignores a couple of things like the dedication status of
+ window, combination_limit and the like. This might have to be
+ fixed. */
int
compare_window_configurations (Lisp_Object configuration1, Lisp_Object configuration2, int ignore_positions)
Vwindow_configuration_change_hook = Qnil;
DEFVAR_LISP ("recenter-redisplay", Vrecenter_redisplay,
- doc: /* If non-nil, then the `recenter' command with a nil argument
-will redraw the entire frame; the special value `tty' causes the
-frame to be redrawn only if it is a tty frame. */);
+ doc: /* Non-nil means `recenter' redraws entire frame.
+If this option is non-nil, then the `recenter' command with a nil
+argument 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: /* If t, 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.
-
-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. */);
- Vwindow_splits = Qnil;
-
- DEFVAR_LISP ("window-nest", Vwindow_nest,
- doc: /* Non-nil means splitting a window makes a new parent window.
+for displaying the new window from the window to split. Deleting and
+resizing a window preferably resizes one adjacent window only.
+
+If this variable is t, 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.
+
+Other values are reserved for future use.
+
+This variable takes no effect if `window-combination-limit' is non-nil. */);
+ Vwindow_combination_resize = Qnil;
+
+ DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit,
+ doc: /* If t, splitting a window makes a new parent window.
If this variable is nil, splitting a window will create a new parent
window only if the window has no parent window or the window shall
-become a combination orthogonal to the one it it is part of.
+become a combination orthogonal to the one it is part of.
+
+If this variable is t, splitting a window always creates a new parent
+window. If all splits behave this way, each frame's window tree is a
+binary tree and every window but the frame's root window has exactly one
+sibling.
-If this variable is non-nil, splitting a window always creates a new
-parent window. If all splits behave this way, each frame's window tree
-is a binary tree and every window but the frame's root window has
-exactly one sibling.
+Other values are reserved for future use.
-The value of this variable is also assigned to the nest status of the
-new parent window. The nest status of a window can be retrieved via the
-function `window-nest' and altered by the function `set-window-nest'. */);
- Vwindow_nest = Qnil;
+The value of this variable is also assigned to the combination limit of
+the new parent window. The combination limit of a window can be
+retrieved via the function `window-combination-limit' and altered by the
+function `set-window-combination-limit'. */);
+ Vwindow_combination_limit = Qnil;
defsubr (&Sselected_window);
defsubr (&Sminibuffer_window);
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_combination_limit);
+ defsubr (&Sset_window_combination_limit);
defsubr (&Swindow_use_time);
defsubr (&Swindow_top_line);
defsubr (&Swindow_left_column);