If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), frame);
+ return decode_any_window (window)->frame;
}
DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
window = XFRAME (frame_or_window)->root_window;
}
- while (NILP (WGET (XWINDOW (window), buffer)))
+ while (NILP (XWINDOW (window)->buffer))
{
- if (! NILP (WGET (XWINDOW (window), hchild)))
- window = WGET (XWINDOW (window), hchild);
- else if (! NILP (WGET (XWINDOW (window), vchild)))
- window = WGET (XWINDOW (window), vchild);
+ if (! NILP (XWINDOW (window)->hchild))
+ window = XWINDOW (window)->hchild;
+ else if (! NILP (XWINDOW (window)->vchild))
+ window = XWINDOW (window)->vchild;
else
abort ();
}
if (NILP (norecord))
{
w->use_time = ++window_select_count;
- record_buffer (WGET (w, buffer));
+ record_buffer (w->buffer);
}
if (EQ (window, selected_window) && !inhibit_point_swap)
if (!inhibit_point_swap)
{
ow = XWINDOW (selected_window);
- if (! NILP (WGET (ow, buffer)))
- set_marker_both (WGET (ow, pointm), WGET (ow, buffer),
- BUF_PT (XBUFFER (WGET (ow, buffer))),
- BUF_PT_BYTE (XBUFFER (WGET (ow, buffer))));
+ if (! NILP (ow->buffer))
+ set_marker_both (ow->pointm, ow->buffer,
+ BUF_PT (XBUFFER (ow->buffer)),
+ BUF_PT_BYTE (XBUFFER (ow->buffer)));
}
selected_window = window;
- Fset_buffer (WGET (w, buffer));
+ Fset_buffer (w->buffer);
- BVAR (XBUFFER (WGET (w, buffer)), last_selected_window) = window;
+ BVAR (XBUFFER (w->buffer), last_selected_window) = window;
/* Go to the point recorded in the window.
This is important when the buffer is in more
redisplay_window has altered point after scrolling,
because it makes the change only in the window. */
{
- register ptrdiff_t new_point = marker_position (WGET (w, pointm));
+ register ptrdiff_t new_point = marker_position (w->pointm);
if (new_point < BEGV)
SET_PT (BEGV);
else if (new_point > ZV)
Return nil for an internal window or a deleted window. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), buffer);
+ return decode_any_window (window)->buffer;
}
DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0,
Return nil for a window with no parent (e.g. a root window). */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), parent);
+ return decode_any_window (window)->parent;
}
DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0,
(Lisp_Object window)
{
CHECK_WINDOW (window);
- return WGET (decode_any_window (window), vchild);
+ return decode_any_window (window)->vchild;
}
DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0,
(Lisp_Object window)
{
CHECK_WINDOW (window);
- return WGET (decode_any_window (window), hchild);
+ return decode_any_window (window)->hchild;
}
DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0,
Return nil if WINDOW has no next sibling. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), next);
+ return decode_any_window (window)->next;
}
DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0,
Return nil if WINDOW has no previous sibling. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), prev);
+ return decode_any_window (window)->prev;
}
DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0,
WINDOW are never \(re-)combined with WINDOW's siblings. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), combination_limit);
+ return decode_any_window (window)->combination_limit;
}
DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
integer multiple of the default character height. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), total_lines);
+ return decode_any_window (window)->total_lines;
}
DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0,
integer multiple of the default character width. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), total_cols);
+ return decode_any_window (window)->total_cols;
}
DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0,
If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), new_total);
+ return decode_any_window (window)->new_total;
}
DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0,
If HORIZONTAL is non-nil, return the normal width of WINDOW. */)
(Lisp_Object window, Lisp_Object horizontal)
{
- if (NILP (horizontal))
- return WGET (decode_any_window (window), normal_lines);
- else
- return WGET (decode_any_window (window), normal_cols);
+ struct window *w = decode_any_window (window);
+
+ return NILP (horizontal) ? w->normal_lines : w->normal_cols;
}
DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0,
If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), new_normal);
+ return decode_any_window (window)->new_normal;
}
DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0,
If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), left_col);
+ return decode_any_window (window)->left_col;
}
DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0,
If WINDOW is omitted or nil, it defaults to the selected window. */)
(Lisp_Object window)
{
- return WGET (decode_any_window (window), top_line);
+ return decode_any_window (window)->top_line;
}
/* Return the number of lines of W's body. Don't count any mode or
static int
window_body_lines (struct window *w)
{
- int height = XFASTINT (WGET (w, total_lines));
+ int height = XFASTINT (w->total_lines);
if (!MINI_WINDOW_P (w))
{
window_body_cols (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
- int width = XINT (WGET (w, total_cols));
+ int width = XINT (w->total_cols);
if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
/* Scroll bars occupy a few columns. */
/* Prevent redisplay shortcuts when changing the hscroll. */
if (w->hscroll != new_hscroll)
- XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
+ XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
w->hscroll = new_hscroll;
return make_number (new_hscroll);
See `set-window-redisplay-end-trigger' for more information. */)
(Lisp_Object window)
{
- return WGET (decode_window (window), redisplay_end_trigger);
+ return decode_window (window)->redisplay_end_trigger;
}
DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger,
(Lisp_Object window)
{
register struct window *w = decode_any_window (window);
- CHECK_LIVE_FRAME (WGET (w, frame));
+ CHECK_LIVE_FRAME (w->frame);
return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)),
Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)),
(Lisp_Object window)
{
register struct window *w = decode_any_window (window);
- CHECK_LIVE_FRAME (WGET (w, frame));
+ CHECK_LIVE_FRAME (w->frame);
return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)),
Fcons (make_number (WINDOW_TOP_EDGE_Y (w)),
static void
calc_absolute_offset (struct window *w, int *add_x, int *add_y)
{
- struct frame *f = XFRAME (WGET (w, frame));
+ struct frame *f = XFRAME (w->frame);
*add_y = f->top_pos;
#ifdef FRAME_MENUBAR_HEIGHT
*add_y += FRAME_MENUBAR_HEIGHT (f);
register struct window *w = decode_any_window (window);
int add_x, add_y;
- CHECK_LIVE_FRAME (WGET (w, frame));
+ CHECK_LIVE_FRAME (w->frame);
calc_absolute_offset (w, &add_x, &add_y);
return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x),
CHECK_LIVE_WINDOW (window);
w = XWINDOW (window);
- f = XFRAME (WGET (w, frame));
+ f = XFRAME (w->frame);
CHECK_CONS (coordinates);
lx = Fcar (coordinates);
ly = Fcdr (coordinates);
register struct window *w = decode_window (window);
if (w == XWINDOW (selected_window)
- && current_buffer == XBUFFER (WGET (w, buffer)))
+ && current_buffer == XBUFFER (w->buffer))
return Fpoint ();
- return Fmarker_position (WGET (w, pointm));
+ return Fmarker_position (w->pointm);
}
DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0,
This is updated by redisplay or by calling `set-window-start'. */)
(Lisp_Object window)
{
- return Fmarker_position (WGET (decode_window (window), start));
+ return Fmarker_position (decode_window (window)->start);
}
/* This is text temporarily removed from the doc string below.
Lisp_Object buf;
struct buffer *b;
- buf = WGET (w, buffer);
+ buf = w->buffer;
CHECK_BUFFER (buf);
b = XBUFFER (buf);
The user can compute it with vertical-motion if he wants to.
It would be nicer to do it automatically,
but that's so slow that it would probably bother people. */
- if (NILP (WGET (w, window_end_valid)))
+ if (NILP (w->window_end_valid))
return Qnil;
#endif
if (! NILP (update)
- && ! (! NILP (WGET (w, window_end_valid))
+ && ! (! NILP (w->window_end_valid)
&& w->last_modified >= BUF_MODIFF (b)
&& w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b))
&& !noninteractive)
`-l' containing a call to `rmail' with subsequent other
commands. At the end, W->start happened to be BEG, while
rmail had already narrowed the buffer. */
- if (XMARKER (WGET (w, start))->charpos < BEGV)
+ if (XMARKER (w->start)->charpos < BEGV)
SET_TEXT_POS (startp, BEGV, BEGV_BYTE);
- else if (XMARKER (WGET (w, start))->charpos > ZV)
+ else if (XMARKER (w->start)->charpos > ZV)
SET_TEXT_POS (startp, ZV, ZV_BYTE);
else
- SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start));
+ SET_TEXT_POS_FROM_MARKER (startp, w->start);
itdata = bidi_shelve_cache ();
start_display (&it, w, startp);
set_buffer_internal (old_buffer);
}
else
- XSETINT (value, BUF_Z (b) - XFASTINT (WGET (w, window_end_pos)));
+ XSETINT (value, BUF_Z (b) - XFASTINT (w->window_end_pos));
return value;
}
CHECK_NUMBER_COERCE_MARKER (pos);
if (w == XWINDOW (selected_window)
- && XBUFFER (WGET (w, buffer)) == current_buffer)
+ && XBUFFER (w->buffer) == current_buffer)
Fgoto_char (pos);
else
- set_marker_restricted (WGET (w, pointm), pos, WGET (w, buffer));
+ set_marker_restricted (w->pointm, pos, w->buffer);
/* We have to make sure that redisplay updates the window to show
the new value of point. */
register struct window *w = decode_window (window);
CHECK_NUMBER_COERCE_MARKER (pos);
- set_marker_restricted (WGET (w, start), pos, WGET (w, buffer));
+ set_marker_restricted (w->start, pos, w->buffer);
/* this is not right, but much easier than doing what is right. */
w->start_at_line_beg = 0;
if (NILP (noforce))
int x, y;
w = decode_window (window);
- buf = XBUFFER (WGET (w, buffer));
- SET_TEXT_POS_FROM_MARKER (top, WGET (w, start));
+ buf = XBUFFER (w->buffer);
+ SET_TEXT_POS_FROM_MARKER (top, w->start);
if (EQ (pos, Qt))
posint = -1;
else if (w == XWINDOW (selected_window))
posint = PT;
else
- posint = XMARKER (WGET (w, pointm))->charpos;
+ posint = XMARKER (w->pointm)->charpos;
/* If position is above window start or outside buffer boundaries,
or if window start is out of range, position is not visible. */
if (noninteractive || w->pseudo_window_p)
return Qnil;
- CHECK_BUFFER (WGET (w, buffer));
- b = XBUFFER (WGET (w, buffer));
+ CHECK_BUFFER (w->buffer);
+ b = XBUFFER (w->buffer);
/* Fail if current matrix is not up-to-date. */
- if (NILP (WGET (w, window_end_valid))
+ if (NILP (w->window_end_valid)
|| current_buffer->clip_changed
|| current_buffer->prevent_redisplay_optimizations_p
|| w->last_modified < BUF_MODIFF (b)
is the value returned by `window-dedicated-p' is t. */)
(Lisp_Object window)
{
- return WGET (decode_window (window), dedicated);
+ return decode_window (window)->dedicated;
}
DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p,
window for that buffer, and POS is a window-specific point value. */)
(Lisp_Object window)
{
- return WGET (decode_window (window), prev_buffers);
+ return decode_window (window)->prev_buffers;
}
DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers,
WINDOW must be a live window and defaults to the selected one. */)
(Lisp_Object window)
{
- return WGET (decode_window (window), next_buffers);
+ return decode_window (window)->next_buffers;
}
DEFUN ("set-window-next-buffers", Fset_window_next_buffers,
elements of the form (PARAMETER . VALUE). */)
(Lisp_Object window)
{
- return Fcopy_alist (WGET (decode_any_window (window), window_parameters));
+ return Fcopy_alist (decode_any_window (window)->window_parameters);
}
DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter,
{
Lisp_Object result;
- result = Fassq (parameter, WGET (decode_any_window (window),
- window_parameters));
+ result = Fassq (parameter, decode_any_window (window)->window_parameters);
return CDR_SAFE (result);
}
register struct window *w = decode_any_window (window);
Lisp_Object old_alist_elt;
- old_alist_elt = Fassq (parameter, WGET (w, window_parameters));
+ old_alist_elt = Fassq (parameter, w->window_parameters);
if (NILP (old_alist_elt))
WSET (w, window_parameters,
- Fcons (Fcons (parameter, value), WGET (w, window_parameters)));
+ Fcons (Fcons (parameter, value), w->window_parameters));
else
Fsetcdr (old_alist_elt, value);
return value;
WINDOW defaults to the selected window. */)
(Lisp_Object window)
{
- return WGET (decode_window (window), display_table);
+ return decode_window (window)->display_table;
}
/* Get the display table for use on window W. This is either W's
{
struct Lisp_Char_Table *dp = NULL;
- if (DISP_TABLE_P (WGET (w, display_table)))
- dp = XCHAR_TABLE (WGET (w, display_table));
- else if (BUFFERP (WGET (w, buffer)))
+ if (DISP_TABLE_P (w->display_table))
+ dp = XCHAR_TABLE (w->display_table);
+ else if (BUFFERP (w->buffer))
{
- struct buffer *b = XBUFFER (WGET (w, buffer));
+ struct buffer *b = XBUFFER (w->buffer);
if (DISP_TABLE_P (BVAR (b, display_table)))
dp = XCHAR_TABLE (BVAR (b, display_table));
Lisp_Object buf;
struct buffer *b;
- buf = WGET (w, buffer);
+ buf = w->buffer;
b = XBUFFER (buf);
- if (b != XMARKER (WGET (w, pointm))->buffer)
+ if (b != XMARKER (w->pointm)->buffer)
abort ();
#if 0
if (w == XWINDOW (selected_window)
- || ! EQ (buf, WGET (XWINDOW (selected_window), buffer)))
+ || ! EQ (buf, XWINDOW (selected_window)->buffer))
/* Do this except when the selected window's buffer
is being removed from some other window. */
#endif
selected window, while last_window_start reflects another
window which was recently showing the same buffer.
Some people might say that might be a good thing. Let's see. */
- b->last_window_start = marker_position (WGET (w, start));
+ b->last_window_start = marker_position (w->start);
/* Point in the selected window's buffer
is actually stored in that buffer, and the window's pointm isn't used.
So don't clobber point in that buffer. */
- if (! EQ (buf, WGET (XWINDOW (selected_window), buffer))
+ if (! EQ (buf, XWINDOW (selected_window)->buffer)
/* This line helps to fix Horsley's testbug.el bug. */
&& !(WINDOWP (BVAR (b, last_selected_window))
&& w != XWINDOW (BVAR (b, last_selected_window))
- && EQ (buf, WGET (XWINDOW (BVAR (b, last_selected_window)), buffer))))
+ && EQ (buf, XWINDOW (BVAR (b, last_selected_window))->buffer)))
temp_set_point_both (b,
clip_to_bounds (BUF_BEGV (b),
- XMARKER (WGET (w, pointm))->charpos,
+ XMARKER (w->pointm)->charpos,
BUF_ZV (b)),
clip_to_bounds (BUF_BEGV_BYTE (b),
- marker_byte_position (WGET (w, pointm)),
+ marker_byte_position (w->pointm),
BUF_ZV_BYTE (b)));
if (WINDOWP (BVAR (b, last_selected_window))
/* If OLD is its frame's root window, then NEW is the new
root window for that frame. */
- if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (WGET (o, frame)))))
- FSET (XFRAME (WGET (o, frame)), root_window, new);
+ if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame))))
+ FSET (XFRAME (o->frame), root_window, new);
if (setflag)
{
- WSET (n, left_col, WGET (o, left_col));
- WSET (n, top_line, WGET (o, top_line));
- WSET (n, total_cols, WGET (o, total_cols));
- WSET (n, total_lines, WGET (o, total_lines));
- WSET (n, normal_cols, WGET (o, normal_cols));
+ WSET (n, left_col, o->left_col);
+ WSET (n, top_line, o->top_line);
+ WSET (n, total_cols, o->total_cols);
+ WSET (n, total_lines, o->total_lines);
+ WSET (n, normal_cols, o->normal_cols);
WSET (o, normal_cols, make_float (1.0));
- WSET (n, normal_lines, WGET (o, normal_lines));
+ WSET (n, normal_lines, o->normal_lines);
WSET (o, normal_lines, make_float (1.0));
n->desired_matrix = n->current_matrix = 0;
n->vscroll = 0;
n->frozen_window_start_p = 0;
}
- tem = WGET (o, next);
+ tem = o->next;
WSET (n, next, tem);
if (!NILP (tem))
WSET (XWINDOW (tem), prev, new);
- tem = WGET (o, prev);
+ tem = o->prev;
WSET (n, prev, tem);
if (!NILP (tem))
WSET (XWINDOW (tem), next, new);
- tem = WGET (o, parent);
+ tem = o->parent;
WSET (n, parent, tem);
if (!NILP (tem))
{
- if (EQ (WGET (XWINDOW (tem), vchild), old))
+ if (EQ (XWINDOW (tem)->vchild, old))
WSET (XWINDOW (tem), vchild, new);
- if (EQ (WGET (XWINDOW (tem), hchild), old))
+ if (EQ (XWINDOW (tem)->hchild, old))
WSET (XWINDOW (tem), hchild, new);
}
}
int horflag;
w = XWINDOW (window);
- parent = WGET (w, parent);
- if (!NILP (parent) && NILP (WGET (w, combination_limit)))
+ parent = w->parent;
+ if (!NILP (parent) && NILP (w->combination_limit))
{
p = XWINDOW (parent);
- if (((!NILP (WGET (p, vchild)) && !NILP (WGET (w, vchild)))
- || (!NILP (WGET (p, hchild)) && !NILP (WGET (w, hchild)))))
+ if (((!NILP (p->vchild) && !NILP (w->vchild))
+ || (!NILP (p->hchild) && !NILP (w->hchild))))
/* WINDOW and PARENT are both either a vertical or a horizontal
combination. */
{
- horflag = NILP (WGET (w, vchild));
- child = horflag ? WGET (w, hchild) : WGET (w, vchild);
+ horflag = NILP (w->vchild);
+ child = horflag ? w->hchild : w->vchild;
c = XWINDOW (child);
/* Splice WINDOW's children into its parent's children and
assign new normal sizes. */
- if (NILP (WGET (w, prev)))
+ if (NILP (w->prev))
if (horflag)
WSET (p, hchild, child);
else
WSET (p, vchild, child);
else
{
- WSET (c, prev, WGET (w, prev));
- WSET (XWINDOW (WGET (w, prev)), next, child);
+ WSET (c, prev, w->prev);
+ WSET (XWINDOW (w->prev), next, child);
}
while (c)
if (horflag)
WSET (c, normal_cols,
- make_float (XFLOATINT (WGET (c, total_cols))
- / XFLOATINT (WGET (p, total_cols))));
+ make_float (XFLOATINT (c->total_cols)
+ / XFLOATINT (p->total_cols)));
else
WSET (c, normal_lines,
- make_float (XFLOATINT (WGET (c, total_lines))
- / XFLOATINT (WGET (p, total_lines))));
+ make_float (XFLOATINT (c->total_lines)
+ / XFLOATINT (p->total_lines)));
- if (NILP (WGET (c, next)))
+ if (NILP (c->next))
{
- if (!NILP (WGET (w, next)))
+ if (!NILP (w->next))
{
- WSET (c, next, WGET (w, next));
- WSET (XWINDOW (WGET (c, next)), prev, child);
+ WSET (c, next, w->next);
+ WSET (XWINDOW (c->next), prev, child);
}
c = 0;
}
else
{
- child = WGET (c, next);
+ child = c->next;
c = XWINDOW (child);
}
}
candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames)
{
struct window *w = XWINDOW (window);
- struct frame *f = XFRAME (WGET (w, frame));
+ struct frame *f = XFRAME (w->frame);
int candidate_p = 1;
- if (!BUFFERP (WGET (w, buffer)))
+ if (!BUFFERP (w->buffer))
candidate_p = 0;
else if (MINI_WINDOW_P (w)
&& (EQ (minibuf, Qlambda)
else if (NILP (all_frames))
{
eassert (WINDOWP (owindow));
- candidate_p = EQ (WGET (w, frame), WGET (XWINDOW (owindow), frame));
+ candidate_p = EQ (w->frame, XWINDOW (owindow)->frame);
}
else if (EQ (all_frames, Qvisible))
{
FRAME_SAMPLE_VISIBILITY (f);
candidate_p = FRAME_VISIBLE_P (f)
- && (FRAME_TERMINAL (XFRAME (WGET (w, frame)))
+ && (FRAME_TERMINAL (XFRAME (w->frame))
== FRAME_TERMINAL (XFRAME (selected_frame)));
}
&& !f->output_data.x->has_been_visible)
#endif
)
- && (FRAME_TERMINAL (XFRAME (WGET (w, frame)))
+ && (FRAME_TERMINAL (XFRAME (w->frame))
== FRAME_TERMINAL (XFRAME (selected_frame)));
}
else if (WINDOWP (all_frames))
candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames)
- || EQ (WGET (XWINDOW (all_frames), frame), WGET (w, frame))
- || EQ (WGET (XWINDOW (all_frames), frame), FRAME_FOCUS_FRAME (f)));
+ || EQ (XWINDOW (all_frames)->frame, w->frame)
+ || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f)));
else if (FRAMEP (all_frames))
- candidate_p = EQ (all_frames, WGET (w, frame));
+ candidate_p = EQ (all_frames, w->frame);
return candidate_p;
}
if (NILP (*all_frames))
*all_frames
= (!EQ (*minibuf, Qlambda)
- ? FRAME_MINIBUF_WINDOW (XFRAME (WGET (XWINDOW (*window), frame)))
+ ? FRAME_MINIBUF_WINDOW (XFRAME (XWINDOW (*window)->frame))
: Qnil);
else if (EQ (*all_frames, Qvisible))
;
/* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just
return the first window on the frame. */
if (FRAMEP (all_frames)
- && !EQ (all_frames, WGET (XWINDOW (window), frame)))
+ && !EQ (all_frames, XWINDOW (window)->frame))
return Fframe_first_window (all_frames);
if (next_p)
if (NILP (frame))
frame = selected_frame;
- if (!EQ (frame, WGET (XWINDOW (window), frame)))
+ if (!EQ (frame, XWINDOW (window)->frame))
error ("Window is on a different frame");
return window_list_1 (window, minibuf, frame);
switch (type)
{
case GET_BUFFER_WINDOW:
- if (EQ (WGET (w, buffer), obj)
+ if (EQ (w->buffer, obj)
/* Don't find any minibuffer window except the one that
is currently in use. */
&& (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1))
if (EQ (window, selected_window))
/* Preferably return the selected window. */
RETURN_UNGCPRO (window);
- else if (EQ (WGET (XWINDOW (window), frame), selected_frame)
+ else if (EQ (XWINDOW (window)->frame, selected_frame)
&& !frame_best_window_flag)
/* Prefer windows on the current frame (but don't
choose another one if we have one already). */
case REPLACE_BUFFER_IN_WINDOWS_SAFELY:
/* We could simply check whether the buffer shown by window
is live, and show another buffer in case it isn't. */
- if (EQ (WGET (w, buffer), obj))
+ if (EQ (w->buffer, obj))
{
/* Undedicate WINDOW. */
WSET (w, dedicated, Qnil);
/* Make WINDOW show the buffer returned by
other_buffer_safely, don't run any hooks. */
set_window_buffer
- (window, other_buffer_safely (WGET (w, buffer)), 0, 0);
+ (window, other_buffer_safely (w->buffer), 0, 0);
/* If WINDOW is the selected window, make its buffer
current. But do so only if the window shows the
current buffer (Bug#6454). */
if (EQ (window, selected_window)
- && XBUFFER (WGET (w, buffer)) == current_buffer)
- Fset_buffer (WGET (w, buffer));
+ && XBUFFER (w->buffer) == current_buffer)
+ Fset_buffer (w->buffer);
}
break;
case REDISPLAY_BUFFER_WINDOWS:
- if (EQ (WGET (w, buffer), obj))
+ if (EQ (w->buffer, obj))
{
mark_window_display_accurate (window, 0);
w->update_mode_line = 1;
/* Check for a window that has a killed buffer. */
case CHECK_ALL_WINDOWS:
- if (! NILP (WGET (w, buffer))
- && NILP (BVAR (XBUFFER (WGET (w, buffer)), name)))
+ if (! NILP (w->buffer)
+ && NILP (BVAR (XBUFFER (w->buffer), name)))
abort ();
break;
int top IF_LINT (= 0), new_top, resize_failed;
w = decode_any_window (window);
- CHECK_LIVE_FRAME (WGET (w, frame));
+ CHECK_LIVE_FRAME (w->frame);
XSETWINDOW (window, w);
- f = XFRAME (WGET (w, frame));
+ f = XFRAME (w->frame);
if (NILP (root))
/* ROOT is the frame's root window. */
/* ROOT must be an ancestor of WINDOW. */
{
r = decode_any_window (root);
- CHECK_LIVE_FRAME (WGET (r, frame));
- pwindow = WGET (XWINDOW (window), parent);
+ CHECK_LIVE_FRAME (r->frame);
+ pwindow = XWINDOW (window)->parent;
while (!NILP (pwindow))
if (EQ (pwindow, root))
break;
else
- pwindow = WGET (XWINDOW (pwindow), parent);
+ pwindow = XWINDOW (pwindow)->parent;
if (!EQ (pwindow, root))
error ("Specified root is not an ancestor of specified window");
}
else if (MINI_WINDOW_P (w)) /* && top > 0) */
error ("Can't expand minibuffer to full frame");
- if (!NILP (WGET (w, buffer)))
+ if (!NILP (w->buffer))
{
- startpos = marker_position (WGET (w, start));
+ startpos = marker_position (w->start);
top = WINDOW_TOP_EDGE_LINE (w)
- FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w)));
/* Make sure WINDOW is the frame's selected window. */
if (!EQ (window, FRAME_SELECTED_WINDOW (f)))
{
- if (EQ (selected_frame, WGET (w, frame)))
+ if (EQ (selected_frame, w->frame))
Fselect_window (window, Qnil);
else
FSET (f, selected_window, window);
{
pwindow = swindow;
while (!NILP (pwindow) && !EQ (window, pwindow))
- pwindow = WGET (XWINDOW (pwindow), parent);
+ pwindow = XWINDOW (pwindow)->parent;
if (EQ (window, pwindow))
/* If WINDOW is an ancestor of SWINDOW, then SWINDOW is ok
if (!EQ (swindow, FRAME_SELECTED_WINDOW (f)))
{
- if (EQ (selected_frame, WGET (w, frame)))
+ if (EQ (selected_frame, w->frame))
Fselect_window (swindow, Qnil);
else
FSET (f, selected_window, swindow);
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
resize_failed = 0;
- if (NILP (WGET (w, buffer)))
+ if (NILP (w->buffer))
{
/* Resize child windows vertically. */
- XSETINT (delta, XINT (WGET (r, total_lines))
- - XINT (WGET (w, total_lines)));
- WSET (w, top_line, WGET (r, top_line));
+ XSETINT (delta, XINT (r->total_lines)
+ - XINT (w->total_lines));
+ WSET (w, top_line, r->top_line);
resize_root_window (window, delta, Qnil, Qnil);
if (window_resize_check (w, 0))
window_resize_apply (w, 0);
/* Resize child windows horizontally. */
if (!resize_failed)
{
- WSET (w, left_col, WGET (r, left_col));
- XSETINT (delta, XINT (WGET (r, total_cols))
- - XINT (WGET (w, total_cols)));
- WSET (w, left_col, WGET (r, left_col));
+ WSET (w, left_col, r->left_col);
+ XSETINT (delta, XINT (r->total_cols)
+ - XINT (w->total_cols));
+ WSET (w, left_col, r->left_col);
resize_root_window (window, delta, Qt, Qnil);
if (window_resize_check (w, 1))
window_resize_apply (w, 1);
}
/* Cleanly unlink WINDOW from window-tree. */
- if (!NILP (WGET (w, prev)))
+ if (!NILP (w->prev))
/* Get SIBLING above (on the left of) WINDOW. */
{
- sibling = WGET (w, prev);
+ sibling = w->prev;
s = XWINDOW (sibling);
- WSET (s, next, WGET (w, next));
- if (!NILP (WGET (s, next)))
- WSET (XWINDOW (WGET (s, next)), prev, sibling);
+ WSET (s, next, w->next);
+ if (!NILP (s->next))
+ WSET (XWINDOW (s->next), prev, sibling);
}
else
/* Get SIBLING below (on the right of) WINDOW. */
{
- sibling = WGET (w, next);
+ sibling = w->next;
s = XWINDOW (sibling);
WSET (s, prev, Qnil);
- if (!NILP (WGET (XWINDOW (WGET (w, parent)), vchild)))
- WSET (XWINDOW (WGET (w, parent)), vchild, sibling);
+ if (!NILP (XWINDOW (w->parent)->vchild))
+ WSET (XWINDOW (w->parent), vchild, sibling);
else
- WSET (XWINDOW (WGET (w, parent)), hchild, sibling);
+ WSET (XWINDOW (w->parent), hchild, sibling);
}
/* Delete ROOT and all child windows of ROOT. */
- if (!NILP (WGET (r, vchild)))
+ if (!NILP (r->vchild))
{
- delete_all_child_windows (WGET (r, vchild));
+ delete_all_child_windows (r->vchild);
WSET (r, vchild, Qnil);
}
- else if (!NILP (WGET (r, hchild)))
+ else if (!NILP (r->hchild))
{
- delete_all_child_windows (WGET (r, hchild));
+ delete_all_child_windows (r->hchild);
WSET (r, hchild, Qnil);
}
replace_window (root, window, 1);
/* This must become SWINDOW anyway ....... */
- if (!NILP (WGET (w, buffer)) && !resize_failed)
+ if (!NILP (w->buffer) && !resize_failed)
{
/* Try to minimize scrolling, by setting the window start to the
point will cause the text at the old window start to be at the
when the display is not current, due to typeahead). */
new_top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w)));
if (new_top != top
- && startpos >= BUF_BEGV (XBUFFER (WGET (w, buffer)))
- && startpos <= BUF_ZV (XBUFFER (WGET (w, buffer))))
+ && startpos >= BUF_BEGV (XBUFFER (w->buffer))
+ && startpos <= BUF_ZV (XBUFFER (w->buffer)))
{
struct position pos;
struct buffer *obuf = current_buffer;
- Fset_buffer (WGET (w, buffer));
+ Fset_buffer (w->buffer);
/* This computation used to temporarily move point, but that
can have unwanted side effects due to text properties. */
pos = *vmotion (startpos, -top, w);
- set_marker_both (WGET (w, start), WGET (w, buffer), pos.bufpos, pos.bytepos);
+ set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
WSET (w, window_end_valid, Qnil);
w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
|| FETCH_BYTE (pos.bytepos - 1) == '\n');
struct window *w = XWINDOW (window);
struct buffer *b = XBUFFER (buffer);
ptrdiff_t count = SPECPDL_INDEX ();
- int samebuf = EQ (buffer, WGET (w, buffer));
+ int samebuf = EQ (buffer, w->buffer);
WSET (w, buffer, buffer);
whenever we resize the frame. */
w->hscroll = w->min_hscroll = 0;
w->vscroll = 0;
- set_marker_both (WGET (w, pointm), buffer, BUF_PT (b), BUF_PT_BYTE (b));
- set_marker_restricted (WGET (w, start),
+ set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
+ set_marker_restricted (w->start,
make_number (b->last_window_start),
buffer);
w->start_at_line_beg = 0;
Fset_buffer (buffer);
}
- XMARKER (WGET (w, pointm))->insertion_type = !NILP (Vwindow_point_insertion_type);
+ XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type);
if (!keep_margins_p)
{
/* This may call adjust_window_margins three times, so
temporarily disable window margins. */
- Lisp_Object save_left = WGET (w, left_margin_cols);
- Lisp_Object save_right = WGET (w, right_margin_cols);
+ Lisp_Object save_left = w->left_margin_cols;
+ Lisp_Object save_right = w->right_margin_cols;
WSET (w, left_margin_cols, Qnil);
WSET (w, right_margin_cols, Qnil);
{
if (! NILP (Vwindow_scroll_functions))
run_hook_with_args_2 (Qwindow_scroll_functions, window,
- Fmarker_position (WGET (w, start)));
+ Fmarker_position (w->start));
run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w)));
}
if (NILP (BVAR (XBUFFER (buffer), name)))
error ("Attempt to display deleted buffer");
- tem = WGET (w, buffer);
+ tem = w->buffer;
if (NILP (tem))
error ("Window is deleted");
else if (!EQ (tem, Qt))
{
if (!EQ (tem, buffer))
{
- if (EQ (WGET (w, dedicated), Qt))
+ if (EQ (w->dedicated, Qt))
/* WINDOW is strongly dedicated to its buffer, signal an
error. */
error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name)));
struct window *w = XWINDOW (object);
mark_window_display_accurate (object, 0);
w->update_mode_line = 1;
- if (BUFFERP (WGET (w, buffer)))
- XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
+ if (BUFFERP (w->buffer))
+ XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
++update_mode_lines;
return Qt;
}
{
window = display_buffer (buf, Qnil, Qnil);
- if (!EQ (WGET (XWINDOW (window), frame), selected_frame))
+ if (!EQ (XWINDOW (window)->frame, selected_frame))
Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
Vminibuf_scroll_window = window;
w = XWINDOW (window);
w->hscroll = 0;
w->min_hscroll = 0;
- set_marker_restricted_both (WGET (w, start), buf, BEG, BEG);
- set_marker_restricted_both (WGET (w, pointm), buf, BEG, BEG);
+ set_marker_restricted_both (w->start, buf, BEG, BEG);
+ set_marker_restricted_both (w->pointm, buf, BEG, BEG);
/* Run temp-buffer-show-hook, with the chosen window selected
and its buffer current. */
record_unwind_protect (Fset_buffer, prev_buffer);
record_unwind_protect (select_window_norecord, prev_window);
Fselect_window (window, Qt);
- Fset_buffer (WGET (w, buffer));
+ Fset_buffer (w->buffer);
Frun_hooks (1, &Qtemp_buffer_show_hook);
unbind_to (count, Qnil);
}
if (NILP (add))
WSET (w, new_total, size);
else
- WSET (w, new_total, make_number (XINT (WGET (w, new_total)) + XINT (size)));
+ WSET (w, new_total, make_number (XINT (w->new_total) + XINT (size)));
- return WGET (w, new_total);
+ return w->new_total;
}
DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, 1, 2, 0,
{
struct window *c;
- if (!NILP (WGET (w, vchild)))
+ if (!NILP (w->vchild))
/* W is a vertical combination. */
{
- c = XWINDOW (WGET (w, vchild));
+ c = XWINDOW (w->vchild);
if (horflag)
/* All child windows of W must have the same width as W. */
{
while (c)
{
- if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total)))
+ if ((XINT (c->new_total) != XINT (w->new_total))
|| !window_resize_check (c, horflag))
return 0;
- c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
return 1;
}
{
if (!window_resize_check (c, horflag))
return 0;
- sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total));
- c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
+ sum_of_sizes = sum_of_sizes + XINT (c->new_total);
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
- return (sum_of_sizes == XINT (WGET (w, new_total)));
+ return (sum_of_sizes == XINT (w->new_total));
}
}
- else if (!NILP (WGET (w, hchild)))
+ else if (!NILP (w->hchild))
/* W is a horizontal combination. */
{
- c = XWINDOW (WGET (w, hchild));
+ c = XWINDOW (w->hchild);
if (horflag)
/* The sum of the widths of the child windows of W must equal W's
width. */
{
if (!window_resize_check (c, horflag))
return 0;
- sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total));
- c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
+ sum_of_sizes = sum_of_sizes + XINT (c->new_total);
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
- return (sum_of_sizes == XINT (WGET (w, new_total)));
+ return (sum_of_sizes == XINT (w->new_total));
}
else
/* All child windows of W must have the same height as W. */
{
while (c)
{
- if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total)))
+ if ((XINT (c->new_total) != XINT (w->new_total))
|| !window_resize_check (c, horflag))
return 0;
- c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
return 1;
}
/* A leaf window. Make sure it's not too small. The following
hardcodes the values of `window-safe-min-width' (2) and
`window-safe-min-height' (1) which are defined in window.el. */
- return XINT (WGET (w, new_total)) >= (horflag ? 2 : 1);
+ return XINT (w->new_total) >= (horflag ? 2 : 1);
}
/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to
parent window has been set *before*. */
if (horflag)
{
- WSET (w, total_cols, WGET (w, new_total));
- if (NUMBERP (WGET (w, new_normal)))
- WSET (w, normal_cols, WGET (w, new_normal));
+ WSET (w, total_cols, w->new_total);
+ if (NUMBERP (w->new_normal))
+ WSET (w, normal_cols, w->new_normal);
- pos = XINT (WGET (w, left_col));
+ pos = XINT (w->left_col);
}
else
{
- WSET (w, total_lines, WGET (w, new_total));
- if (NUMBERP (WGET (w, new_normal)))
- WSET (w, normal_lines, WGET (w, new_normal));
+ WSET (w, total_lines, w->new_total);
+ if (NUMBERP (w->new_normal))
+ WSET (w, normal_lines, w->new_normal);
- pos = XINT (WGET (w, top_line));
+ pos = XINT (w->top_line);
}
- if (!NILP (WGET (w, vchild)))
+ if (!NILP (w->vchild))
/* W is a vertical combination. */
{
- c = XWINDOW (WGET (w, vchild));
+ c = XWINDOW (w->vchild);
while (c)
{
if (horflag)
WSET (c, top_line, make_number (pos));
window_resize_apply (c, horflag);
if (!horflag)
- pos = pos + XINT (WGET (c, total_lines));
- c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
+ pos = pos + XINT (c->total_lines);
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
}
- else if (!NILP (WGET (w, hchild)))
+ else if (!NILP (w->hchild))
/* W is a horizontal combination. */
{
- c = XWINDOW (WGET (w, hchild));
+ c = XWINDOW (w->hchild);
while (c)
{
if (horflag)
WSET (c, top_line, make_number (pos));
window_resize_apply (c, horflag);
if (horflag)
- pos = pos + XINT (WGET (c, total_cols));
- c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
+ pos = pos + XINT (c->total_cols);
+ c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
}
r = XWINDOW (FRAME_ROOT_WINDOW (f));
if (!window_resize_check (r, horflag)
- || ! EQ (WGET (r, new_total),
- (horflag ? WGET (r, total_cols) : WGET (r, total_lines))))
+ || ! EQ (r->new_total,
+ (horflag ? r->total_cols : r->total_lines)))
return Qnil;
BLOCK_INPUT;
? 1 : 0)));
WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f)));
- if (NILP (WGET (r, vchild)) && NILP (WGET (r, hchild)))
+ if (NILP (r->vchild) && NILP (r->hchild))
/* For a leaf root window just set the size. */
if (horflag)
WSET (r, total_cols, make_number (new_size));
else
{
/* old_size is the old size of the frame's root window. */
- int old_size = XFASTINT (horflag ? WGET (r, total_cols)
- : WGET (r, total_lines));
+ int old_size = XFASTINT (horflag ? r->total_cols
+ : r->total_lines);
Lisp_Object delta;
XSETINT (delta, new_size - old_size);
/* Try a "normal" resize first. */
resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil);
if (window_resize_check (r, horflag)
- && new_size == XINT (WGET (r, new_total)))
+ && new_size == XINT (r->new_total))
window_resize_apply (r, horflag);
else
{
/* Try with "reasonable" minimum sizes next. */
resize_root_window (root, delta, horflag ? Qt : Qnil, Qt);
if (window_resize_check (r, horflag)
- && new_size == XINT (WGET (r, new_total)))
+ && new_size == XINT (r->new_total))
window_resize_apply (r, horflag);
else
{
/* Finally, try with "safe" minimum sizes. */
resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe);
if (window_resize_check (r, horflag)
- && new_size == XINT (WGET (r, new_total)))
+ && new_size == XINT (r->new_total))
window_resize_apply (r, horflag);
else
{
/* Are we sure we always want 1 line here? */
WSET (m, total_lines, make_number (1));
WSET (m, top_line,
- make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines))));
+ make_number (XINT (r->top_line) + XINT (r->total_lines)));
}
}
}
parent, or OLD is ortho-combined. */
combination_limit =
!NILP (Vwindow_combination_limit)
- || NILP (WGET (o, parent))
+ || NILP (o->parent)
|| NILP (horflag
- ? (WGET (XWINDOW (WGET (o, parent)), hchild))
- : (WGET (XWINDOW (WGET (o, parent)), vchild)));
+ ? (XWINDOW (o->parent)->hchild)
+ : (XWINDOW (o->parent)->vchild));
/* We need a live reference window to initialize some parameters. */
if (WINDOW_LIVE_P (old))
/* `window-combination-resize' non-nil means try to resize OLD's siblings
proportionally. */
{
- p = XWINDOW (WGET (o, parent));
+ p = XWINDOW (o->parent);
/* Temporarily pretend we split the parent window. */
WSET (p, new_total,
- make_number (XINT (horflag ? WGET (p, total_cols) : WGET (p, total_lines))
+ make_number (XINT (horflag ? p->total_cols : p->total_lines)
- XINT (total_size)));
if (!window_resize_check (p, horflag))
error ("Window sizes don't fit");
else
/* Undo the temporary pretension. */
WSET (p, new_total,
- horflag ? WGET (p, total_cols) : WGET (p, total_lines));
+ horflag ? p->total_cols : p->total_lines);
}
else
{
if (!window_resize_check (o, horflag))
error ("Resizing old window failed");
- else if (XINT (total_size) + XINT (WGET (o, new_total))
- != XINT (horflag ? WGET (o, total_cols) : WGET (o, total_lines)))
+ else if (XINT (total_size) + XINT (o->new_total)
+ != XINT (horflag ? o->total_cols : o->total_lines))
error ("Sum of sizes of old and new window don't fit");
}
by make_parent_window and we need it below for assigning it to
p->new_normal. */
Lisp_Object new_normal
- = horflag ? WGET (o, normal_cols) : WGET (o, normal_lines);
+ = horflag ? o->normal_cols : o->normal_lines;
make_parent_window (old, horflag);
- p = XWINDOW (WGET (o, parent));
+ p = XWINDOW (o->parent);
/* Store value of `window-combination-limit' in new parent's
combination_limit slot. */
WSET (p, combination_limit, Vwindow_combination_limit);
/* These get applied below. */
- WSET (p, new_total,
- horflag ? WGET (o, total_cols) : WGET (o, total_lines));
+ WSET (p, new_total, horflag ? o->total_cols : o->total_lines);
WSET (p, new_normal, new_normal);
}
else
- p = XWINDOW (WGET (o, parent));
+ p = XWINDOW (o->parent);
windows_or_buffers_changed++;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
new = make_window ();
n = XWINDOW (new);
WSET (n, frame, frame);
- WSET (n, parent, WGET (o, parent));
+ WSET (n, parent, o->parent);
WSET (n, vchild, Qnil);
WSET (n, hchild, Qnil);
if (EQ (side, Qabove) || EQ (side, Qleft))
{
- WSET (n, prev, WGET (o, prev));
- if (NILP (WGET (n, prev)))
+ WSET (n, prev, o->prev);
+ if (NILP (n->prev))
if (horflag)
WSET (p, hchild, new);
else
WSET (p, vchild, new);
else
- WSET (XWINDOW (WGET (n, prev)), next, new);
+ WSET (XWINDOW (n->prev), next, new);
WSET (n, next, old);
WSET (o, prev, new);
}
else
{
- WSET (n, next, WGET (o, next));
- if (!NILP (WGET (n, next)))
- WSET (XWINDOW (WGET (n, next)), prev, new);
+ WSET (n, next, o->next);
+ if (!NILP (n->next))
+ WSET (XWINDOW (n->next), prev, new);
WSET (n, prev, old);
WSET (o, next, new);
}
memset (&n->last_cursor, 0, sizeof n->last_cursor);
/* Get special geometry settings from reference window. */
- WSET (n, left_margin_cols, WGET (r, left_margin_cols));
- WSET (n, right_margin_cols, WGET (r, right_margin_cols));
- WSET (n, left_fringe_width, WGET (r, left_fringe_width));
- WSET (n, right_fringe_width, WGET (r, right_fringe_width));
+ WSET (n, left_margin_cols, r->left_margin_cols);
+ WSET (n, right_margin_cols, r->right_margin_cols);
+ WSET (n, left_fringe_width, r->left_fringe_width);
+ WSET (n, right_fringe_width, r->right_fringe_width);
n->fringes_outside_margins = r->fringes_outside_margins;
- WSET (n, scroll_bar_width, WGET (r, scroll_bar_width));
- WSET (n, vertical_scroll_bar_type, WGET (r, vertical_scroll_bar_type));
+ WSET (n, scroll_bar_width, r->scroll_bar_width);
+ WSET (n, vertical_scroll_bar_type, r->vertical_scroll_bar_type);
/* Directly assign orthogonal coordinates and sizes. */
if (horflag)
{
- WSET (n, top_line, WGET (o, top_line));
- WSET (n, total_lines, WGET (o, total_lines));
+ WSET (n, top_line, o->top_line);
+ WSET (n, total_lines, o->total_lines);
}
else
{
- WSET (n, left_col, WGET (o, left_col));
- WSET (n, total_cols, WGET (o, total_cols));
+ WSET (n, left_col, o->left_col);
+ WSET (n, total_cols, o->total_cols);
}
/* Iso-coordinates and sizes are assigned by window_resize_apply,
adjust_glyphs (f);
/* Set buffer of NEW to buffer of reference window. Don't run
any hooks. */
- set_window_buffer (new, WGET (r, buffer), 0, 1);
+ set_window_buffer (new, r->buffer, 0, 1);
UNBLOCK_INPUT;
/* Maybe we should run the scroll functions in Elisp (which already
runs the configuration change hook). */
if (! NILP (Vwindow_scroll_functions))
run_hook_with_args_2 (Qwindow_scroll_functions, new,
- Fmarker_position (WGET (n, start)));
+ Fmarker_position (n->start));
/* Return NEW. */
return new;
}
int before_sibling = 0;
w = decode_any_window (window);
- CHECK_LIVE_FRAME (WGET (w, frame));
+ CHECK_LIVE_FRAME (w->frame);
XSETWINDOW (window, w);
- if (NILP (WGET (w, buffer))
- && NILP (WGET (w, hchild)) && NILP (WGET (w, vchild)))
+ if (NILP (w->buffer)
+ && NILP (w->hchild) && NILP (w->vchild))
/* It's a no-op to delete an already deleted window. */
return Qnil;
- parent = WGET (w, parent);
+ parent = w->parent;
if (NILP (parent))
/* Never delete a minibuffer or frame root window. */
error ("Attempt to delete minibuffer or sole ordinary window");
- else if (NILP (WGET (w, prev)) && NILP (WGET (w, next)))
+ else if (NILP (w->prev) && NILP (w->next))
/* Rather bow out here, this case should be handled on the Elisp
level. */
error ("Attempt to delete sole window of parent");
p = XWINDOW (parent);
- horflag = NILP (WGET (p, vchild));
+ horflag = NILP (p->vchild);
frame = WINDOW_FRAME (w);
f = XFRAME (frame);
r = XWINDOW (root);
/* Unlink WINDOW from window tree. */
- if (NILP (WGET (w, prev)))
+ if (NILP (w->prev))
/* Get SIBLING below (on the right of) WINDOW. */
{
/* before_sibling 1 means WINDOW is the first child of its
parent and thus before the sibling. */
before_sibling = 1;
- sibling = WGET (w, next);
+ sibling = w->next;
s = XWINDOW (sibling);
WSET (s, prev, Qnil);
if (horflag)
else
/* Get SIBLING above (on the left of) WINDOW. */
{
- sibling = WGET (w, prev);
+ sibling = w->prev;
s = XWINDOW (sibling);
- WSET (s, next, WGET (w, next));
- if (!NILP (WGET (s, next)))
- WSET (XWINDOW (WGET (s, next)), prev, sibling);
+ WSET (s, next, w->next);
+ if (!NILP (s->next))
+ WSET (XWINDOW (s->next), prev, sibling);
}
if (window_resize_check (r, horflag)
- && EQ (WGET (r, new_total),
- (horflag ? WGET (r, total_cols) : WGET (r, total_lines))))
+ && EQ (r->new_total,
+ (horflag ? r->total_cols : r->total_lines)))
/* We can delete WINDOW now. */
{
WSET (w, next, Qnil); /* Don't delete w->next too. */
free_window_matrices (w);
- if (!NILP (WGET (w, vchild)))
+ if (!NILP (w->vchild))
{
- delete_all_child_windows (WGET (w, vchild));
+ delete_all_child_windows (w->vchild);
WSET (w, vchild, Qnil);
}
- else if (!NILP (WGET (w, hchild)))
+ else if (!NILP (w->hchild))
{
- delete_all_child_windows (WGET (w, hchild));
+ delete_all_child_windows (w->hchild);
WSET (w, hchild, Qnil);
}
- else if (!NILP (WGET (w, buffer)))
+ else if (!NILP (w->buffer))
{
unshow_buffer (w);
- unchain_marker (XMARKER (WGET (w, pointm)));
- unchain_marker (XMARKER (WGET (w, start)));
+ unchain_marker (XMARKER (w->pointm));
+ unchain_marker (XMARKER (w->start));
WSET (w, buffer, Qnil);
}
- if (NILP (WGET (s, prev)) && NILP (WGET (s, next)))
+ if (NILP (s->prev) && NILP (s->next))
/* A matrjoshka where SIBLING has become the only child of
PARENT. */
{
replace_window (parent, sibling, 0);
/* Have SIBLING inherit the following three slot values from
PARENT (the combination_limit slot is not inherited). */
- WSET (s, normal_cols, WGET (p, normal_cols));
- WSET (s, normal_lines, WGET (p, normal_lines));
+ WSET (s, normal_cols, p->normal_cols);
+ WSET (s, normal_lines, p->normal_lines);
/* Mark PARENT as deleted. */
WSET (p, vchild, Qnil);
WSET (p, hchild, Qnil);
/* Now look whether `get-mru-window' gets us something. */
mru_window = call1 (Qget_mru_window, frame);
if (WINDOW_LIVE_P (mru_window)
- && EQ (WGET (XWINDOW (mru_window), frame), frame))
+ && EQ (XWINDOW (mru_window)->frame, frame))
new_selected_window = mru_window;
/* If all ended up well, we now promote the mru window. */
else
{
WSET (s, next, window);
- if (!NILP (WGET (w, next)))
- WSET (XWINDOW (WGET (w, next)), prev, window);
+ if (!NILP (w->next))
+ WSET (XWINDOW (w->next), prev, window);
}
error ("Deletion failed");
}
void
grow_mini_window (struct window *w, int delta)
{
- struct frame *f = XFRAME (WGET (w, frame));
+ struct frame *f = XFRAME (w->frame);
struct window *r;
Lisp_Object root, value;
/* Grow the mini-window. */
WSET (w, top_line,
- make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines))));
+ make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines)));
WSET (w, total_lines,
- make_number (XFASTINT (WGET (w, total_lines)) - XINT (value)));
+ make_number (XFASTINT (w->total_lines) - XINT (value)));
w->last_modified = 0;
w->last_overlay_modified = 0;
void
shrink_mini_window (struct window *w)
{
- struct frame *f = XFRAME (WGET (w, frame));
+ struct frame *f = XFRAME (w->frame);
struct window *r;
Lisp_Object root, value;
EMACS_INT size;
eassert (MINI_WINDOW_P (w));
- size = XINT (WGET (w, total_lines));
+ size = XINT (w->total_lines);
if (size > 1)
{
root = FRAME_ROOT_WINDOW (f);
/* Shrink the mini-window. */
WSET (w, top_line,
- make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines))));
+ make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines)));
WSET (w, total_lines, make_number (1));
w->last_modified = 0;
int height;
CHECK_WINDOW (window);
- f = XFRAME (WGET (w, frame));
+ f = XFRAME (w->frame);
- if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (WGET (w, frame))), window))
+ if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (w->frame)), window))
error ("Not a valid minibuffer window");
else if (FRAME_MINIBUF_ONLY_P (f))
error ("Cannot resize a minibuffer-only frame");
r = XWINDOW (FRAME_ROOT_WINDOW (f));
- height = XINT (WGET (r, total_lines)) + XINT (WGET (w, total_lines));
+ height = XINT (r->total_lines) + XINT (w->total_lines);
if (window_resize_check (r, 0)
- && XINT (WGET (w, new_total)) > 0
- && height == XINT (WGET (r, new_total)) + XINT (WGET (w, new_total)))
+ && XINT (w->new_total) > 0
+ && height == XINT (r->new_total) + XINT (w->new_total))
{
BLOCK_INPUT;
window_resize_apply (r, 0);
- WSET (w, total_lines, WGET (w, new_total));
+ WSET (w, total_lines, w->new_total);
WSET (w, top_line,
- make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines))));
+ make_number (XINT (r->top_line) + XINT (r->total_lines)));
windows_or_buffers_changed++;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
{
while (w)
{
- if (!NILP (WGET (w, hchild)))
- mark_window_cursors_off (XWINDOW (WGET (w, hchild)));
- else if (!NILP (WGET (w, vchild)))
- mark_window_cursors_off (XWINDOW (WGET (w, vchild)));
+ if (!NILP (w->hchild))
+ mark_window_cursors_off (XWINDOW (w->hchild));
+ else if (!NILP (w->vchild))
+ mark_window_cursors_off (XWINDOW (w->vchild));
else
w->phys_cursor_on_p = 0;
- w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
+ w = NILP (w->next) ? 0 : XWINDOW (w->next);
}
}
int
window_internal_height (struct window *w)
{
- int ht = XFASTINT (WGET (w, total_lines));
+ int ht = XFASTINT (w->total_lines);
if (!MINI_WINDOW_P (w))
{
- if (!NILP (WGET (w, parent))
- || !NILP (WGET (w, vchild))
- || !NILP (WGET (w, hchild))
- || !NILP (WGET (w, next))
- || !NILP (WGET (w, prev))
+ if (!NILP (w->parent)
+ || !NILP (w->vchild)
+ || !NILP (w->hchild)
+ || !NILP (w->next)
+ || !NILP (w->prev)
|| WINDOW_WANTS_MODELINE_P (w))
--ht;
/* If we must, use the pixel-based version which is much slower than
the line-based one but can handle varying line heights. */
- if (FRAME_WINDOW_P (XFRAME (WGET (XWINDOW (window), frame))))
+ if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame)))
window_scroll_pixel_based (window, n, whole, noerror);
else
window_scroll_line_based (window, n, whole, noerror);
int x, y, rtop, rbot, rowh, vpos;
void *itdata = NULL;
- SET_TEXT_POS_FROM_MARKER (start, WGET (w, start));
+ SET_TEXT_POS_FROM_MARKER (start, w->start);
/* Scrolling a minibuffer window via scroll bar when the echo area
shows long text sometimes resets the minibuffer contents behind
our backs. */
spos = XINT (Fline_beginning_position (Qnil));
else
spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV);
- set_marker_restricted (WGET (w, start), make_number (spos),
- WGET (w, buffer));
+ set_marker_restricted (w->start, make_number (spos),
+ w->buffer);
w->start_at_line_beg = 1;
w->update_mode_line = 1;
w->last_modified = 0;
/* If control gets here, then we vscrolled. */
- XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
+ XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
/* Don't try to change the window start below. */
vscrolled = 1;
}
/* Set the window start, and set up the window for redisplay. */
- set_marker_restricted (WGET (w, start), make_number (pos),
- WGET (w, buffer));
- bytepos = XMARKER (WGET (w, start))->bytepos;
+ set_marker_restricted (w->start, make_number (pos),
+ w->buffer);
+ bytepos = XMARKER (w->start)->bytepos;
w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
w->update_mode_line = 1;
w->last_modified = 0;
even if there is a header line. */
this_scroll_margin = max (0, scroll_margin);
this_scroll_margin
- = min (this_scroll_margin, XFASTINT (WGET (w, total_lines)) / 4);
+ = min (this_scroll_margin, XFASTINT (w->total_lines) / 4);
this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);
if (n > 0)
;
else if (window_scroll_pixel_based_preserve_y >= 0)
{
- SET_TEXT_POS_FROM_MARKER (start, WGET (w, start));
+ SET_TEXT_POS_FROM_MARKER (start, w->start);
start_display (&it, w, start);
/* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT
here because we called start_display again and did not
if (whole)
n *= max (1, ht - next_screen_context_lines);
- startpos = marker_position (WGET (w, start));
+ startpos = marker_position (w->start);
if (!NILP (Vscroll_preserve_screen_position))
{
{
/* Don't use a scroll margin that is negative or too large. */
int this_scroll_margin =
- max (0, min (scroll_margin, XINT (WGET (w, total_lines)) / 4));
+ max (0, min (scroll_margin, XINT (w->total_lines) / 4));
- set_marker_restricted_both (WGET (w, start), WGET (w, buffer), pos, pos_byte);
+ set_marker_restricted_both (w->start, w->buffer, pos, pos_byte);
w->start_at_line_beg = !NILP (bolp);
w->update_mode_line = 1;
w->last_modified = 0;
/* If selected window's buffer isn't current, make it current for
the moment. But don't screw up if window_scroll gets an error. */
- if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer)
+ if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
{
record_unwind_protect (save_excursion_restore, save_excursion_save ());
- Fset_buffer (WGET (XWINDOW (selected_window), buffer));
+ Fset_buffer (XWINDOW (selected_window)->buffer);
/* Make redisplay consider other windows than just selected_window. */
++windows_or_buffers_changed;
record_unwind_protect (save_excursion_restore, save_excursion_save ());
++windows_or_buffers_changed;
- Fset_buffer (WGET (w, buffer));
- SET_PT (marker_position (WGET (w, pointm)));
+ Fset_buffer (w->buffer);
+ SET_PT (marker_position (w->pointm));
if (NILP (arg))
window_scroll (window, 1, 1, 1);
window_scroll (window, XINT (arg), 0, 1);
}
- set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE);
+ set_marker_both (w->pointm, Qnil, PT, PT_BYTE);
unbind_to (count, Qnil);
return Qnil;
int bottom_y;
void *itdata = NULL;
- if (XBUFFER (WGET (w, buffer)) != current_buffer)
+ if (XBUFFER (w->buffer) != current_buffer)
{
old_buffer = current_buffer;
- set_buffer_internal (XBUFFER (WGET (w, buffer)));
+ set_buffer_internal (XBUFFER (w->buffer));
}
else
old_buffer = NULL;
/* In case W->start is out of the accessible range, do something
reasonable. This happens in Info mode when Info-scroll-down
calls (recenter -1) while W->start is 1. */
- if (XMARKER (WGET (w, start))->charpos < BEGV)
+ if (XMARKER (w->start)->charpos < BEGV)
SET_TEXT_POS (start, BEGV, BEGV_BYTE);
- else if (XMARKER (WGET (w, start))->charpos > ZV)
+ else if (XMARKER (w->start)->charpos > ZV)
SET_TEXT_POS (start, ZV, ZV_BYTE);
else
- SET_TEXT_POS_FROM_MARKER (start, WGET (w, start));
+ SET_TEXT_POS_FROM_MARKER (start, w->start);
itdata = bidi_shelve_cache ();
start_display (&it, w, start);
This kludge fixes a bug whereby (move-to-window-line -1)
when ZV is on the last screen line
moves to the previous screen line instead of the last one. */
- if (! FRAME_WINDOW_P (XFRAME (WGET (w, frame))))
+ if (! FRAME_WINDOW_P (XFRAME (w->frame)))
height++;
/* Add in empty lines at the bottom of the window. */
(register Lisp_Object arg)
{
struct window *w = XWINDOW (selected_window);
- struct buffer *buf = XBUFFER (WGET (w, buffer));
+ struct buffer *buf = XBUFFER (w->buffer);
struct buffer *obuf = current_buffer;
int center_p = 0;
ptrdiff_t charpos, bytepos;
/* Do this after making BUF current
in case scroll_margin is buffer-local. */
this_scroll_margin =
- max (0, min (scroll_margin, XFASTINT (WGET (w, total_lines)) / 4));
+ max (0, min (scroll_margin, XFASTINT (w->total_lines) / 4));
/* Handle centering on a graphical frame specially. Such frames can
have variable-height lines and centering point on the basis of
line counts would lead to strange effects. */
- if (FRAME_WINDOW_P (XFRAME (WGET (w, frame))))
+ if (FRAME_WINDOW_P (XFRAME (w->frame)))
{
if (center_p)
{
}
/* Set the new window start. */
- set_marker_both (WGET (w, start), WGET (w, buffer), charpos, bytepos);
+ set_marker_both (w->start, w->buffer, charpos, bytepos);
WSET (w, window_end_valid, Qnil);
w->optional_new_start = 1;
{
struct window *w = decode_window (window);
int pixel_height = window_box_height (w);
- int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame)));
+ int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (w->frame));
return make_number (line_height);
}
int this_scroll_margin;
#endif
- if (!(BUFFERP (WGET (w, buffer))
- && XBUFFER (WGET (w, buffer)) == current_buffer))
+ if (!(BUFFERP (w->buffer)
+ && XBUFFER (w->buffer) == current_buffer))
/* This test is needed to make sure PT/PT_BYTE make sense in w->buffer
when passed below to set_marker_both. */
error ("move-to-window-line called from unrelated buffer");
window = selected_window;
- start = marker_position (WGET (w, start));
+ start = marker_position (w->start);
if (start < BEGV || start > ZV)
{
int height = window_internal_height (w);
Fvertical_motion (make_number (- (height / 2)), window);
- set_marker_both (WGET (w, start), WGET (w, buffer), PT, PT_BYTE);
+ set_marker_both (w->start, w->buffer, PT, PT_BYTE);
w->start_at_line_beg = !NILP (Fbolp ());
w->force_start = 1;
}
else
- Fgoto_char (WGET (w, start));
+ Fgoto_char (w->start);
lines = displayed_window_lines (w);
data = (struct save_window_data *) XVECTOR (config);
saved_windows = XVECTOR (data->saved_windows);
- return WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame);
+ return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
}
DEFUN ("set-window-configuration", Fset_window_configuration,
window-point of the final-selected-window to the window-point of
the current-selected-window. So we have to be careful which
point of the current-buffer we copy into old_point. */
- if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer)
+ if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)
&& WINDOWP (selected_window)
- && EQ (WGET (XWINDOW (selected_window), buffer), new_current_buffer)
+ && EQ (XWINDOW (selected_window)->buffer, new_current_buffer)
&& !EQ (selected_window, data->current_window))
- old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos;
+ old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
else
old_point = PT;
else
So if possible we want this arbitrary choice of "which point" to
be the one from the to-be-selected-window so as to prevent this
window's cursor from being copied from another window. */
- if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer)
+ if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)
/* If current_window = selected_window, its point is in BUF_PT. */
&& !EQ (selected_window, data->current_window))
- old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos;
+ old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
else
old_point = BUF_PT (XBUFFER (new_current_buffer));
}
- frame = WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame);
+ frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
f = XFRAME (frame);
/* If f is a dead frame, don't bother rebuilding its window tree.
window holds garbage.) We do this now, before
restoring the window contents, and prevent it from
being done later on when we select a new window. */
- if (! NILP (WGET (XWINDOW (selected_window), buffer)))
+ if (! NILP (XWINDOW (selected_window)->buffer))
{
w = XWINDOW (selected_window);
- set_marker_both (WGET (w, pointm),
- WGET (w, buffer),
- BUF_PT (XBUFFER (WGET (w, buffer))),
- BUF_PT_BYTE (XBUFFER (WGET (w, buffer))));
+ set_marker_both (w->pointm,
+ w->buffer,
+ BUF_PT (XBUFFER (w->buffer)),
+ BUF_PT_BYTE (XBUFFER (w->buffer)));
}
windows_or_buffers_changed++;
WSET (w, next, Qnil);
if (!NILP (p->parent))
- WSET (w, parent, SAVED_WINDOW_N (saved_windows,
- XFASTINT (p->parent))->window);
+ WSET (w, parent, SAVED_WINDOW_N
+ (saved_windows, XFASTINT (p->parent))->window);
else
WSET (w, parent, Qnil);
if (!NILP (p->prev))
{
- WSET (w, prev, SAVED_WINDOW_N (saved_windows,
- XFASTINT (p->prev))->window);
- WSET (XWINDOW (WGET (w, prev)), next, p->window);
+ WSET (w, prev, SAVED_WINDOW_N
+ (saved_windows, XFASTINT (p->prev))->window);
+ WSET (XWINDOW (w->prev), next, p->window);
}
else
{
WSET (w, prev, Qnil);
- if (!NILP (WGET (w, parent)))
+ if (!NILP (w->parent))
{
- if (EQ (p->total_cols, WGET (XWINDOW (WGET (w, parent)), total_cols)))
+ if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols))
{
- WSET (XWINDOW (WGET (w, parent)), vchild, p->window);
- WSET (XWINDOW (WGET (w, parent)), hchild, Qnil);
+ WSET (XWINDOW (w->parent), vchild, p->window);
+ WSET (XWINDOW (w->parent), hchild, Qnil);
}
else
{
- WSET (XWINDOW (WGET (w, parent)), hchild, p->window);
- WSET (XWINDOW (WGET (w, parent)), vchild, Qnil);
+ WSET (XWINDOW (w->parent), hchild, p->window);
+ WSET (XWINDOW (w->parent), vchild, Qnil);
}
}
}
/* If we squirreled away the buffer in the window's height,
restore it now. */
- if (BUFFERP (WGET (w, total_lines)))
- WSET (w, buffer, WGET (w, total_lines));
+ if (BUFFERP (w->total_lines))
+ WSET (w, buffer, w->total_lines);
WSET (w, left_col, p->left_col);
WSET (w, top_line, p->top_line);
WSET (w, total_cols, p->total_cols);
{
if (NILP (XCDR (pers)))
{
- par = Fassq (XCAR (pers), WGET (w, window_parameters));
+ par = Fassq (XCAR (pers), w->window_parameters);
if (CONSP (par) && !NILP (XCDR (par)))
/* Reset a parameter to nil if and only if it
has a non-nil association. Don't make new
{
WSET (w, buffer, p->buffer);
w->start_at_line_beg = !NILP (p->start_at_line_beg);
- set_marker_restricted (WGET (w, start), p->start, WGET (w, buffer));
- set_marker_restricted (WGET (w, pointm), p->pointm,
- WGET (w, buffer));
- Fset_marker (BVAR (XBUFFER (WGET (w, buffer)), mark),
- p->mark, WGET (w, buffer));
+ set_marker_restricted (w->start, p->start, w->buffer);
+ set_marker_restricted (w->pointm, p->pointm,
+ w->buffer);
+ Fset_marker (BVAR (XBUFFER (w->buffer), mark),
+ p->mark, w->buffer);
/* As documented in Fcurrent_window_configuration, don't
restore the location of point in the buffer which was
current when the window configuration was recorded. */
if (!EQ (p->buffer, new_current_buffer)
&& XBUFFER (p->buffer) == current_buffer)
- Fgoto_char (WGET (w, pointm));
+ Fgoto_char (w->pointm);
}
- else if (!NILP (WGET (w, buffer))
- && !NILP (BVAR (XBUFFER (WGET (w, buffer)), name)))
+ else if (!NILP (w->buffer)
+ && !NILP (BVAR (XBUFFER (w->buffer), name)))
/* Keep window's old buffer; make sure the markers are
real. */
{
/* Set window markers at start of visible range. */
- if (XMARKER (WGET (w, start))->buffer == 0)
- set_marker_restricted (WGET (w, start), make_number (0),
- WGET (w, buffer));
- if (XMARKER (WGET (w, pointm))->buffer == 0)
+ if (XMARKER (w->start)->buffer == 0)
+ set_marker_restricted (w->start, make_number (0),
+ w->buffer);
+ if (XMARKER (w->pointm)->buffer == 0)
set_marker_restricted_both
- (WGET (w, pointm), WGET (w, buffer),
- BUF_PT (XBUFFER (WGET (w, buffer))),
- BUF_PT_BYTE (XBUFFER (WGET (w, buffer))));
+ (w->pointm, w->buffer,
+ BUF_PT (XBUFFER (w->buffer)),
+ BUF_PT_BYTE (XBUFFER (w->buffer)));
w->start_at_line_beg = 1;
}
else if (STRINGP (auto_buffer_name =
&& SCHARS (auto_buffer_name) != 0
&& !NILP (WSET (w, buffer, Fget_buffer_create (auto_buffer_name))))
{
- set_marker_restricted (WGET (w, start),
- make_number (0), WGET (w, buffer));
- set_marker_restricted (WGET (w, pointm),
- make_number (0), WGET (w, buffer));
+ set_marker_restricted (w->start,
+ make_number (0), w->buffer);
+ set_marker_restricted (w->pointm,
+ make_number (0), w->buffer);
w->start_at_line_beg = 1;
}
else
WSET (w, buffer, other_buffer_safely (Fcurrent_buffer ()));
/* This will set the markers to beginning of visible
range. */
- set_marker_restricted (WGET (w, start),
- make_number (0), WGET (w, buffer));
- set_marker_restricted (WGET (w, pointm),
- make_number (0), WGET (w, buffer));
+ set_marker_restricted (w->start,
+ make_number (0), w->buffer);
+ set_marker_restricted (w->pointm,
+ make_number (0), w->buffer);
w->start_at_line_beg = 1;
- if (!NILP (WGET (w, dedicated)))
+ if (!NILP (w->dedicated))
/* Record this window as dead. */
dead_windows = Fcons (window, dead_windows);
/* Make sure window is no more dedicated. */
FSET (f, root_window, data->root_window);
/* Arrange *not* to restore point in the buffer that was
current when the window configuration was saved. */
- if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer))
- set_marker_restricted (WGET (XWINDOW (data->current_window), pointm),
+ if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer))
+ set_marker_restricted (XWINDOW (data->current_window)->pointm,
make_number (old_point),
- WGET (XWINDOW (data->current_window), buffer));
+ XWINDOW (data->current_window)->buffer);
/* In the following call to `select-window', prevent "swapping out
point" in the old selected window using the buffer that has
been restored into it. We already swapped out that point from
that window's old buffer. */
select_window (data->current_window, Qnil, 1);
- BVAR (XBUFFER (WGET (XWINDOW (selected_window), buffer)), last_selected_window)
+ BVAR (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window)
= selected_window;
if (NILP (data->focus_frame)
/* Now, free glyph matrices in windows that were not reused. */
for (i = n = 0; i < n_leaf_windows; ++i)
{
- if (NILP (WGET (leaf_windows[i], buffer)))
+ if (NILP (leaf_windows[i]->buffer))
{
/* Assert it's not reused as a combination. */
- eassert (NILP (WGET (leaf_windows[i], hchild))
- && NILP (WGET (leaf_windows[i], vchild)));
+ eassert (NILP (leaf_windows[i]->hchild)
+ && NILP (leaf_windows[i]->vchild));
free_window_matrices (leaf_windows[i]);
}
- else if (EQ (WGET (leaf_windows[i], buffer), new_current_buffer))
+ else if (EQ (leaf_windows[i]->buffer, new_current_buffer))
++n;
}
w = XWINDOW (window);
- if (!NILP (WGET (w, next)))
+ if (!NILP (w->next))
/* Delete WINDOW's siblings (we traverse postorderly). */
- delete_all_child_windows (WGET (w, next));
+ delete_all_child_windows (w->next);
- WSET (w, total_lines, WGET (w, buffer)); /* See Fset_window_configuration for excuse. */
+ WSET (w, total_lines, w->buffer); /* See Fset_window_configuration for excuse. */
- if (!NILP (WGET (w, vchild)))
+ if (!NILP (w->vchild))
{
- delete_all_child_windows (WGET (w, vchild));
+ delete_all_child_windows (w->vchild);
WSET (w, vchild, Qnil);
}
- else if (!NILP (WGET (w, hchild)))
+ else if (!NILP (w->hchild))
{
- delete_all_child_windows (WGET (w, hchild));
+ delete_all_child_windows (w->hchild);
WSET (w, hchild, Qnil);
}
- else if (!NILP (WGET (w, buffer)))
+ else if (!NILP (w->buffer))
{
unshow_buffer (w);
- unchain_marker (XMARKER (WGET (w, pointm)));
- unchain_marker (XMARKER (WGET (w, start)));
+ unchain_marker (XMARKER (w->pointm));
+ unchain_marker (XMARKER (w->start));
WSET (w, buffer, Qnil);
}
count_windows (register struct window *window)
{
register int count = 1;
- if (!NILP (WGET (window, next)))
- count += count_windows (XWINDOW (WGET (window, next)));
- if (!NILP (WGET (window, vchild)))
- count += count_windows (XWINDOW (WGET (window, vchild)));
- if (!NILP (WGET (window, hchild)))
- count += count_windows (XWINDOW (WGET (window, hchild)));
+ if (!NILP (window->next))
+ count += count_windows (XWINDOW (window->next));
+ if (!NILP (window->vchild))
+ count += count_windows (XWINDOW (window->vchild));
+ if (!NILP (window->hchild))
+ count += count_windows (XWINDOW (window->hchild));
return count;
}
{
while (w)
{
- if (!NILP (WGET (w, hchild)))
- i = get_leaf_windows (XWINDOW (WGET (w, hchild)), flat, i);
- else if (!NILP (WGET (w, vchild)))
- i = get_leaf_windows (XWINDOW (WGET (w, vchild)), flat, i);
+ if (!NILP (w->hchild))
+ i = get_leaf_windows (XWINDOW (w->hchild), flat, i);
+ else if (!NILP (w->vchild))
+ i = get_leaf_windows (XWINDOW (w->vchild), flat, i);
else
flat[i++] = w;
- w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
+ w = NILP (w->next) ? 0 : XWINDOW (w->next);
}
return i;
register struct window *w;
register Lisp_Object tem, pers, par;
- for (;!NILP (window); window = WGET (w, next))
+ for (;!NILP (window); window = w->next)
{
p = SAVED_WINDOW_N (vector, i);
w = XWINDOW (window);
WSET (w, temslot, make_number (i)); i++;
p->window = window;
- p->buffer = WGET (w, buffer);
- p->left_col = WGET (w, left_col);
- p->top_line = WGET (w, top_line);
- p->total_cols = WGET (w, total_cols);
- p->total_lines = WGET (w, total_lines);
- p->normal_cols = WGET (w, normal_cols);
- p->normal_lines = WGET (w, normal_lines);
+ p->buffer = w->buffer;
+ p->left_col = w->left_col;
+ p->top_line = w->top_line;
+ p->total_cols = w->total_cols;
+ p->total_lines = w->total_lines;
+ p->normal_cols = w->normal_cols;
+ p->normal_lines = w->normal_lines;
XSETFASTINT (p->hscroll, w->hscroll);
XSETFASTINT (p->min_hscroll, w->min_hscroll);
- p->display_table = WGET (w, display_table);
- p->left_margin_cols = WGET (w, left_margin_cols);
- p->right_margin_cols = WGET (w, right_margin_cols);
- p->left_fringe_width = WGET (w, left_fringe_width);
- p->right_fringe_width = WGET (w, right_fringe_width);
+ p->display_table = w->display_table;
+ p->left_margin_cols = w->left_margin_cols;
+ p->right_margin_cols = w->right_margin_cols;
+ p->left_fringe_width = w->left_fringe_width;
+ p->right_fringe_width = w->right_fringe_width;
p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil;
- p->scroll_bar_width = WGET (w, scroll_bar_width);
- p->vertical_scroll_bar_type = WGET (w, vertical_scroll_bar_type);
- p->dedicated = WGET (w, dedicated);
- p->combination_limit = WGET (w, combination_limit);
+ p->scroll_bar_width = w->scroll_bar_width;
+ p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
+ p->dedicated = w->dedicated;
+ p->combination_limit = w->combination_limit;
p->window_parameters = Qnil;
if (!NILP (Vwindow_persistent_parameters))
/* Save values for persistent window parameters. */
if (CONSP (pers) && !NILP (XCDR (pers)))
{
- par = Fassq (XCAR (pers), WGET (w, window_parameters));
+ par = Fassq (XCAR (pers), w->window_parameters);
if (NILP (par))
/* If the window has no value for the parameter,
make one. */
}
}
- if (!NILP (WGET (w, buffer)))
+ if (!NILP (w->buffer))
{
/* Save w's value of point in the window configuration. If w
is the selected window, then get the value of point from
the buffer; pointm is garbage in the selected window. */
if (EQ (window, selected_window))
- p->pointm = build_marker (XBUFFER (WGET (w, buffer)),
- BUF_PT (XBUFFER (WGET (w, buffer))),
- BUF_PT_BYTE (XBUFFER (WGET (w, buffer))));
+ p->pointm = build_marker (XBUFFER (w->buffer),
+ BUF_PT (XBUFFER (w->buffer)),
+ BUF_PT_BYTE (XBUFFER (w->buffer)));
else
- p->pointm = Fcopy_marker (WGET (w, pointm), Qnil);
+ p->pointm = Fcopy_marker (w->pointm, Qnil);
XMARKER (p->pointm)->insertion_type
= !NILP (Vwindow_point_insertion_type);
- p->start = Fcopy_marker (WGET (w, start), Qnil);
+ p->start = Fcopy_marker (w->start, Qnil);
p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;
- tem = BVAR (XBUFFER (WGET (w, buffer)), mark);
+ tem = BVAR (XBUFFER (w->buffer), mark);
p->mark = Fcopy_marker (tem, Qnil);
}
else
p->start_at_line_beg = Qnil;
}
- if (NILP (WGET (w, parent)))
+ if (NILP (w->parent))
p->parent = Qnil;
else
- p->parent = WGET (XWINDOW (WGET (w, parent)), temslot);
+ p->parent = XWINDOW (w->parent)->temslot;
- if (NILP (WGET (w, prev)))
+ if (NILP (w->prev))
p->prev = Qnil;
else
- p->prev = WGET (XWINDOW (WGET (w, prev)), temslot);
+ p->prev = XWINDOW (w->prev)->temslot;
- if (!NILP (WGET (w, vchild)))
- i = save_window_save (WGET (w, vchild), vector, i);
- if (!NILP (WGET (w, hchild)))
- i = save_window_save (WGET (w, hchild), vector, i);
+ if (!NILP (w->vchild))
+ i = save_window_save (w->vchild, vector, i);
+ if (!NILP (w->hchild))
+ i = save_window_save (w->hchild, vector, i);
}
return i;
right_width = Qnil;
}
- if (!EQ (WGET (w, left_margin_cols), left_width)
- || !EQ (WGET (w, right_margin_cols), right_width))
+ if (!EQ (w->left_margin_cols, left_width)
+ || !EQ (w->right_margin_cols, right_width))
{
WSET (w, left_margin_cols, left_width);
WSET (w, right_margin_cols, right_width);
(Lisp_Object window)
{
struct window *w = decode_window (window);
- return Fcons (WGET (w, left_margin_cols), WGET (w, right_margin_cols));
+ return Fcons (w->left_margin_cols, w->right_margin_cols);
}
/* Do nothing on a tty. */
if (FRAME_WINDOW_P (WINDOW_XFRAME (w))
- && (!EQ (WGET (w, left_fringe_width), left_width)
- || !EQ (WGET (w, right_fringe_width), right_width)
+ && (!EQ (w->left_fringe_width, left_width)
+ || !EQ (w->right_fringe_width, right_width)
|| w->fringes_outside_margins != outside))
{
WSET (w, left_fringe_width, left_width);
|| EQ (vertical_type, Qt)))
error ("Invalid type of vertical scroll bar");
- if (!EQ (WGET (w, scroll_bar_width), width)
- || !EQ (WGET (w, vertical_scroll_bar_type), vertical_type))
+ if (!EQ (w->scroll_bar_width, width)
+ || !EQ (w->vertical_scroll_bar_type, vertical_type))
{
WSET (w, scroll_bar_width, width);
WSET (w, vertical_scroll_bar_type, vertical_type);
? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
: WINDOW_SCROLL_BAR_AREA_WIDTH (w))),
Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)),
- Fcons (WGET (w, vertical_scroll_bar_type),
+ Fcons (w->vertical_scroll_bar_type,
Fcons (Qnil, Qnil))));
}
else
CHECK_WINDOW (window);
w = XWINDOW (window);
- f = XFRAME (WGET (w, frame));
+ f = XFRAME (w->frame);
if (FRAME_WINDOW_P (f))
result = (NILP (pixels_p)
CHECK_NUMBER_OR_FLOAT (vscroll);
w = XWINDOW (window);
- f = XFRAME (WGET (w, frame));
+ f = XFRAME (w->frame);
if (FRAME_WINDOW_P (f))
{
adjust_glyphs (f);
/* Prevent redisplay shortcuts. */
- XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
+ XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
}
}
for (cont = 1; w && cont;)
{
- if (!NILP (WGET (w, hchild)))
- cont = foreach_window_1 (XWINDOW (WGET (w, hchild)), fn, user_data);
- else if (!NILP (WGET (w, vchild)))
- cont = foreach_window_1 (XWINDOW (WGET (w, vchild)), fn, user_data);
+ if (!NILP (w->hchild))
+ cont = foreach_window_1 (XWINDOW (w->hchild), fn, user_data);
+ else if (!NILP (w->vchild))
+ cont = foreach_window_1 (XWINDOW (w->vchild), fn, user_data);
else
cont = fn (w, user_data);
- w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
+ w = NILP (w->next) ? 0 : XWINDOW (w->next);
}
return cont;