int
window_box_width (struct window *w, int area)
{
- int cols = XFASTINT (WVAR (w, total_cols));
+ int cols = XFASTINT (w->total_cols);
int pixels = 0;
if (!w->pseudo_window_p)
if (area == TEXT_AREA)
{
- if (INTEGERP (WVAR (w, left_margin_cols)))
- cols -= XFASTINT (WVAR (w, left_margin_cols));
- if (INTEGERP (WVAR (w, right_margin_cols)))
- cols -= XFASTINT (WVAR (w, right_margin_cols));
+ if (INTEGERP (w->left_margin_cols))
+ cols -= XFASTINT (w->left_margin_cols);
+ if (INTEGERP (w->right_margin_cols))
+ cols -= XFASTINT (w->right_margin_cols);
pixels = -WINDOW_TOTAL_FRINGE_WIDTH (w);
}
else if (area == LEFT_MARGIN_AREA)
{
- cols = (INTEGERP (WVAR (w, left_margin_cols))
- ? XFASTINT (WVAR (w, left_margin_cols)) : 0);
+ cols = (INTEGERP (w->left_margin_cols)
+ ? XFASTINT (w->left_margin_cols) : 0);
pixels = 0;
}
else if (area == RIGHT_MARGIN_AREA)
{
- cols = (INTEGERP (WVAR (w, right_margin_cols))
- ? XFASTINT (WVAR (w, right_margin_cols)) : 0);
+ cols = (INTEGERP (w->right_margin_cols)
+ ? XFASTINT (w->right_margin_cols) : 0);
pixels = 0;
}
}
int
window_box_height (struct window *w)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
int height = WINDOW_TOTAL_HEIGHT (w);
eassert (height >= 0);
int
window_box_left (struct window *w, int area)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
int x;
if (w->pseudo_window_p)
if (FRAME_INITIAL_P (XFRAME (WINDOW_FRAME (w))))
return visible_p;
- if (XBUFFER (WVAR (w, buffer)) != current_buffer)
+ if (XBUFFER (w->buffer) != current_buffer)
{
old_buffer = current_buffer;
- set_buffer_internal_1 (XBUFFER (WVAR (w, buffer)));
+ set_buffer_internal_1 (XBUFFER (w->buffer));
}
- SET_TEXT_POS_FROM_MARKER (top, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (top, w->start);
/* Scrolling a minibuffer window via scroll bar when the echo area
shows long text sometimes resets the minibuffer contents behind
our backs. */
{
/* A pseudo-window is always full-width, and starts at the
left edge of the frame, plus a frame border. */
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
*x -= FRAME_INTERNAL_BORDER_WIDTH (f);
*y = FRAME_TO_WINDOW_PIXEL_Y (w, *y);
}
ptrdiff_t i;
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1;
- Lisp_Object *args = alloca (nargs * sizeof (Lisp_Object));
+ Lisp_Object *args = alloca (nargs * word_size);
args[0] = func;
va_start (ap, func);
check_window_end (struct window *w)
{
if (!MINI_WINDOW_P (w)
- && !NILP (WVAR (w, window_end_valid)))
+ && !NILP (w->window_end_valid))
{
struct glyph_row *row;
eassert ((row = MATRIX_ROW (w->current_matrix,
- XFASTINT (WVAR (w, window_end_vpos))),
+ XFASTINT (w->window_end_vpos)),
!row->enabled_p
|| MATRIX_ROW_DISPLAYS_TEXT_P (row)
|| MATRIX_ROW_VPOS (row, w->current_matrix) == 0));
/* Perhaps remap BASE_FACE_ID to a user-specified alternative. */
if (! NILP (Vface_remapping_alist))
remapped_base_face_id
- = lookup_basic_face (XFRAME (WVAR (w, frame)), base_face_id);
+ = lookup_basic_face (XFRAME (w->frame), base_face_id);
/* Use one of the mode line rows of W's desired matrix if
appropriate. */
/* The window in which we iterate over current_buffer: */
XSETWINDOW (it->window, w);
it->w = w;
- it->f = XFRAME (WVAR (w, frame));
+ it->f = XFRAME (w->frame);
it->cmp_it.id = -1;
is invisible. >0 means lines indented more than this value are
invisible. */
it->selective = (INTEGERP (BVAR (current_buffer, selective_display))
- ? clip_to_bounds
- (-1, XINT (BVAR (current_buffer, selective_display)),
- PTRDIFF_MAX)
+ ? (clip_to_bounds
+ (-1, XINT (BVAR (current_buffer, selective_display)),
+ PTRDIFF_MAX))
: (!NILP (BVAR (current_buffer, selective_display))
? -1 : 0));
it->selective_display_ellipsis_p
/* Get the position at which the redisplay_end_trigger hook should
be run, if it is to be run at all. */
- if (MARKERP (WVAR (w, redisplay_end_trigger))
- && XMARKER (WVAR (w, redisplay_end_trigger))->buffer != 0)
+ if (MARKERP (w->redisplay_end_trigger)
+ && XMARKER (w->redisplay_end_trigger)->buffer != 0)
it->redisplay_end_trigger_charpos
- = marker_position (WVAR (w, redisplay_end_trigger));
- else if (INTEGERP (WVAR (w, redisplay_end_trigger)))
+ = marker_position (w->redisplay_end_trigger);
+ else if (INTEGERP (w->redisplay_end_trigger))
it->redisplay_end_trigger_charpos =
- clip_to_bounds (PTRDIFF_MIN, XINT (WVAR (w, redisplay_end_trigger)), PTRDIFF_MAX);
+ clip_to_bounds (PTRDIFF_MIN, XINT (w->redisplay_end_trigger), PTRDIFF_MAX);
it->tab_width = SANE_TAB_WIDTH (current_buffer);
if it was a text property. */
if (!STRINGP (it->string))
- object = WVAR (it->w, buffer);
+ object = it->w->buffer;
display_replaced_p = handle_display_spec (it, propval, object, overlay,
position, bufpos,
it->what = IT_IMAGE;
it->image_id = -1; /* no image */
it->position = start_pos;
- it->object = NILP (object) ? WVAR (it->w, buffer) : object;
+ it->object = NILP (object) ? it->w->buffer : object;
it->method = GET_FROM_IMAGE;
it->from_overlay = Qnil;
it->face_id = face_id;
it->what = IT_IMAGE;
it->image_id = lookup_image (it->f, value);
it->position = start_pos;
- it->object = NILP (object) ? WVAR (it->w, buffer) : object;
+ it->object = NILP (object) ? it->w->buffer : object;
it->method = GET_FROM_IMAGE;
/* Say that we haven't consumed the characters with
it->object = p->u.stretch.object;
break;
case GET_FROM_BUFFER:
- it->object = WVAR (it->w, buffer);
+ it->object = it->w->buffer;
break;
case GET_FROM_STRING:
it->object = it->string;
else
{
it->method = GET_FROM_BUFFER;
- it->object = WVAR (it->w, buffer);
+ it->object = it->w->buffer;
}
}
it->end_charpos = p->end_charpos;
IT_STRING_BYTEPOS (*it) = -1;
it->string = Qnil;
it->method = GET_FROM_BUFFER;
- it->object = WVAR (it->w, buffer);
+ it->object = it->w->buffer;
it->area = TEXT_AREA;
it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
it->sp = 0;
else
{
it->method = GET_FROM_BUFFER;
- it->object = WVAR (it->w, buffer);
+ it->object = it->w->buffer;
}
it->dpvec = NULL;
setting face_before_selective_p. */
it->saved_face_id = it->face_id;
it->method = GET_FROM_BUFFER;
- it->object = WVAR (it->w, buffer);
+ it->object = it->w->buffer;
reseat_at_next_visible_line_start (it, 1);
it->face_before_selective_p = 1;
}
/* Record what we have and where it came from. */
it->what = IT_CHARACTER;
- it->object = WVAR (it->w, buffer);
+ it->object = it->w->buffer;
it->position = it->current.pos;
/* Normally we return the character found above, except when we
/* Since we are *trying* to run these functions, don't try to run
them again, even if they get an error. */
- WVAR (it->w, redisplay_end_trigger) = Qnil;
+ WSET (it->w, redisplay_end_trigger, Qnil);
Frun_hook_with_args (3, args);
/* Notice if it changed the face of the character we are on. */
return 0;
}
it->position = it->current.pos;
- it->object = WVAR (it->w, buffer);
+ it->object = it->w->buffer;
it->c = composition_update_it (&it->cmp_it, IT_CHARPOS (*it),
IT_BYTEPOS (*it), Qnil);
}
&& it->current_x == it->last_visible_x - 1
&& it->c != '\n'
&& it->c != '\t'
- && it->vpos < XFASTINT (WVAR (it->w, window_end_vpos)))
+ && it->vpos < XFASTINT (it->w->window_end_vpos))
{
it->continuation_lines_width += it->current_x;
it->current_x = it->hpos = it->max_ascent = it->max_descent = 0;
msg = Fformat (3, args);
len = SBYTES (msg) + 1;
- SAFE_ALLOCA (buffer, char *, len);
+ buffer = SAFE_ALLOCA (len);
memcpy (buffer, SDATA (msg), len);
message_dolog (buffer, len - 1, 1, 0);
message_log_maybe_newline ();
if (STRINGP (m))
{
- char *buffer;
USE_SAFE_ALLOCA;
-
- SAFE_ALLOCA (buffer, char *, nbytes);
+ char *buffer = SAFE_ALLOCA (nbytes);
memcpy (buffer, SDATA (m), nbytes);
message_dolog (buffer, nbytes, 1, multibyte);
SAFE_FREE ();
/* Get the frame containing the mini-buffer
that the selected frame is using. */
mini_window = FRAME_MINIBUF_WINDOW (sf);
- frame = WVAR (XWINDOW (mini_window), frame);
+ frame = XWINDOW (mini_window)->frame;
f = XFRAME (frame);
FRAME_SAMPLE_VISIBILITY (f);
set_buffer_internal_1 (XBUFFER (buffer));
if (w)
{
- WVAR (w, buffer) = buffer;
- set_marker_both (WVAR (w, pointm), buffer, BEG, BEG_BYTE);
+ WSET (w, buffer, buffer);
+ set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
}
BVAR (current_buffer, undo_list) = Qt;
if (w)
{
XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i;
- ASET (vector, i, WVAR (w, buffer)); ++i;
- ASET (vector, i, make_number (XMARKER (WVAR (w, pointm))->charpos)); ++i;
- ASET (vector, i, make_number (XMARKER (WVAR (w, pointm))->bytepos)); ++i;
+ ASET (vector, i, w->buffer); ++i;
+ ASET (vector, i, make_number (XMARKER (w->pointm)->charpos)); ++i;
+ ASET (vector, i, make_number (XMARKER (w->pointm)->bytepos)); ++i;
}
else
{
charpos = AREF (vector, 5);
bytepos = AREF (vector, 6);
- WVAR (w, buffer) = buffer;
- set_marker_both (WVAR (w, pointm), buffer,
+ WSET (w, buffer, buffer);
+ set_marker_both (w->pointm, buffer,
XFASTINT (charpos), XFASTINT (bytepos));
}
window_height_changed_p = resize_mini_window (w, 0);
/* Use the starting position chosen by resize_mini_window. */
- SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (start, w->start);
/* Display. */
clear_glyph_matrix (w->desired_matrix);
int
resize_mini_window (struct window *w, int exact_p)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
int window_height_changed_p = 0;
eassert (MINI_WINDOW_P (w));
/* By default, start display at the beginning. */
- set_marker_both (WVAR (w, start), WVAR (w, buffer),
- BUF_BEGV (XBUFFER (WVAR (w, buffer))),
- BUF_BEGV_BYTE (XBUFFER (WVAR (w, buffer))));
+ set_marker_both (w->start, w->buffer,
+ BUF_BEGV (XBUFFER (w->buffer)),
+ BUF_BEGV_BYTE (XBUFFER (w->buffer)));
/* Don't resize windows while redisplaying a window; it would
confuse redisplay functions when the size of the window they are
struct text_pos start;
struct buffer *old_current_buffer = NULL;
- if (current_buffer != XBUFFER (WVAR (w, buffer)))
+ if (current_buffer != XBUFFER (w->buffer))
{
old_current_buffer = current_buffer;
- set_buffer_internal (XBUFFER (WVAR (w, buffer)));
+ set_buffer_internal (XBUFFER (w->buffer));
}
init_iterator (&it, w, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID);
}
else
SET_TEXT_POS (start, BEGV, BEGV_BYTE);
- SET_MARKER_FROM_TEXT_POS (WVAR (w, start), start);
+ SET_MARKER_FROM_TEXT_POS (w->start, start);
if (EQ (Vresize_mini_windows, Qgrow_only))
{
/* Similarly to `with-selected-window', if the operation selects
a window on another frame, we must restore that frame's
selected window, and (for a tty) the top-frame. */
- ASET (vector, 8, FVAR (target_frame, selected_window));
+ ASET (vector, 8, target_frame->selected_window);
if (FRAME_TERMCAP_P (target_frame))
ASET (vector, 9, FRAME_TTY (target_frame)->top_frame);
}
format_mode_line_unwind_data
(f, current_buffer, selected_window, 0));
- Fselect_window (FVAR (f, selected_window), Qt);
+ Fselect_window (f->selected_window, Qt);
set_buffer_internal_1
- (XBUFFER (WVAR (XWINDOW (FVAR (f, selected_window)), buffer)));
+ (XBUFFER (XWINDOW (f->selected_window)->buffer));
fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
mode_line_target = MODE_LINE_TITLE;
title_start = MODE_LINE_NOPROP_LEN (0);
- init_iterator (&it, XWINDOW (FVAR (f, selected_window)), -1, -1,
+ init_iterator (&it, XWINDOW (f->selected_window), -1, -1,
NULL, DEFAULT_FACE_ID);
display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0);
len = MODE_LINE_NOPROP_LEN (title_start);
already wasted too much time by walking through the list with
display_mode_element, then we might need to optimize at a
higher level than this.) */
- if (! STRINGP (FVAR (f, name))
- || SBYTES (FVAR (f, name)) != len
- || memcmp (title, SDATA (FVAR (f, name)), len) != 0)
+ if (! STRINGP (f->name)
+ || SBYTES (f->name) != len
+ || memcmp (title, SDATA (f->name), len) != 0)
x_implicitly_set_name (f, make_string (title, len), Qnil);
}
}
#ifdef HAVE_NS
if (windows_or_buffers_changed
&& FRAME_NS_P (f))
- ns_set_doc_edited
- (f, Fbuffer_modified_p
- (WVAR (XWINDOW (FVAR (f, selected_window)), buffer)));
+ ns_set_doc_edited
+ (f, Fbuffer_modified_p (XWINDOW (f->selected_window)->buffer));
#endif
UNGCPRO;
}
/* This used to test w->update_mode_line, but we believe
there is no need to recompute the menu in that case. */
|| update_mode_lines
- || ((BUF_SAVE_MODIFF (XBUFFER (WVAR (w, buffer)))
- < BUF_MODIFF (XBUFFER (WVAR (w, buffer))))
+ || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+ < BUF_MODIFF (XBUFFER (w->buffer)))
!= w->last_had_star)
|| ((!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active)))
- != !NILP (WVAR (w, region_showing))))
+ && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
+ != !NILP (w->region_showing)))
{
struct buffer *prev = current_buffer;
ptrdiff_t count = SPECPDL_INDEX ();
specbind (Qinhibit_menubar_update, Qt);
- set_buffer_internal_1 (XBUFFER (WVAR (w, buffer)));
+ set_buffer_internal_1 (XBUFFER (w->buffer));
if (save_match_data)
record_unwind_save_match_data ();
if (NILP (Voverriding_local_map_menu_flag))
}
XSETFRAME (Vmenu_updating_frame, f);
- FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
+ FSET (f, menu_bar_items, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
/* Redisplay the menu bar in case we changed it. */
#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
#if defined (USE_GTK) || defined (HAVE_NS)
int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
#else
- int do_update = WINDOWP (FVAR (f, tool_bar_window))
- && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))) > 0;
+ int do_update = WINDOWP (f->tool_bar_window)
+ && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)) > 0;
#endif
if (do_update)
if (windows_or_buffers_changed
|| w->update_mode_line
|| update_mode_lines
- || ((BUF_SAVE_MODIFF (XBUFFER (WVAR (w, buffer)))
- < BUF_MODIFF (XBUFFER (WVAR (w, buffer))))
+ || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+ < BUF_MODIFF (XBUFFER (w->buffer)))
!= w->last_had_star)
|| ((!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active)))
- != !NILP (WVAR (w, region_showing))))
+ && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
+ != !NILP (w->region_showing)))
{
struct buffer *prev = current_buffer;
ptrdiff_t count = SPECPDL_INDEX ();
/* Set current_buffer to the buffer of the selected
window of the frame, so that we get the right local
keymaps. */
- set_buffer_internal_1 (XBUFFER (WVAR (w, buffer)));
+ set_buffer_internal_1 (XBUFFER (w->buffer));
/* Save match data, if we must. */
if (save_match_data)
selected_frame = frame;
/* Build desired tool-bar items from keymaps. */
- new_tool_bar = tool_bar_items
- (Fcopy_sequence (FVAR (f, tool_bar_items)), &new_n_tool_bar);
+ new_tool_bar
+ = tool_bar_items (Fcopy_sequence (f->tool_bar_items),
+ &new_n_tool_bar);
/* Redisplay the tool-bar if we changed it. */
if (new_n_tool_bar != f->n_tool_bar_items
- || NILP (Fequal (new_tool_bar, FVAR (f, tool_bar_items))))
+ || NILP (Fequal (new_tool_bar, f->tool_bar_items)))
{
/* Redisplay that happens asynchronously due to an expose event
may access f->tool_bar_items. Make sure we update both
variables within BLOCK_INPUT so no such event interrupts. */
BLOCK_INPUT;
- FVAR (f, tool_bar_items) = new_tool_bar;
+ FSET (f, tool_bar_items, new_tool_bar);
f->n_tool_bar_items = new_n_tool_bar;
w->update_mode_line = 1;
UNBLOCK_INPUT;
Otherwise, make a new string. */
/* The size of the string we might be able to reuse. */
- size = (STRINGP (FVAR (f, desired_tool_bar_string))
- ? SCHARS (FVAR (f, desired_tool_bar_string))
+ size = (STRINGP (f->desired_tool_bar_string)
+ ? SCHARS (f->desired_tool_bar_string)
: 0);
/* We need one space in the string for each image. */
size_needed = f->n_tool_bar_items;
/* Reuse f->desired_tool_bar_string, if possible. */
- if (size < size_needed || NILP (FVAR (f, desired_tool_bar_string)))
- FVAR (f, desired_tool_bar_string)
- = Fmake_string (make_number (size_needed), make_number (' '));
+ if (size < size_needed || NILP (f->desired_tool_bar_string))
+ FSET (f, desired_tool_bar_string,
+ Fmake_string (make_number (size_needed), make_number (' ')));
else
{
props = list4 (Qdisplay, Qnil, Qmenu_item, Qnil);
Fremove_text_properties (make_number (0), make_number (size),
- props, FVAR (f, desired_tool_bar_string));
+ props, f->desired_tool_bar_string);
}
/* Put a `display' property on the string for the images to display,
for (i = 0; i < f->n_tool_bar_items; ++i)
{
#define PROP(IDX) \
- AREF (FVAR (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX))
+ AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX))
int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P));
string. The string can be longer than needed when we reuse a
previous string. */
if (i + 1 == f->n_tool_bar_items)
- end = SCHARS (FVAR (f, desired_tool_bar_string));
+ end = SCHARS (f->desired_tool_bar_string);
else
end = i + 1;
Fadd_text_properties (make_number (i), make_number (end),
- props, FVAR (f, desired_tool_bar_string));
+ props, f->desired_tool_bar_string);
#undef PROP
}
static int
tool_bar_lines_needed (struct frame *f, int *n_rows)
{
- struct window *w = XWINDOW (FVAR (f, tool_bar_window));
+ struct window *w = XWINDOW (f->tool_bar_window);
struct it it;
/* tool_bar_lines_needed is called from redisplay_tool_bar after building
the desired matrix, so use (unused) mode-line row as temporary row to
init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID);
it.first_visible_x = 0;
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
- reseat_to_string (&it, NULL, FVAR (f, desired_tool_bar_string), 0, 0, 0, -1);
+ reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
it.paragraph_embedding = L2R;
while (!ITERATOR_AT_END_P (&it))
CHECK_FRAME (frame);
f = XFRAME (frame);
- if (WINDOWP (FVAR (f, tool_bar_window))
- && (w = XWINDOW (FVAR (f, tool_bar_window)),
+ if (WINDOWP (f->tool_bar_window)
+ && (w = XWINDOW (f->tool_bar_window),
WINDOW_TOTAL_LINES (w) > 0))
{
update_tool_bar (f, 1);
do anything. This means you must start with tool-bar-lines
non-zero to get the auto-sizing effect. Or in other words, you
can turn off tool-bars by specifying tool-bar-lines zero. */
- if (!WINDOWP (FVAR (f, tool_bar_window))
- || (w = XWINDOW (FVAR (f, tool_bar_window)),
+ if (!WINDOWP (f->tool_bar_window)
+ || (w = XWINDOW (f->tool_bar_window),
WINDOW_TOTAL_LINES (w) == 0))
return 0;
/* Build a string that represents the contents of the tool-bar. */
build_desired_tool_bar_string (f);
- reseat_to_string (&it, NULL, FVAR (f, desired_tool_bar_string), 0, 0, 0, -1);
+ reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
/* FIXME: This should be controlled by a user option. But it
doesn't make sense to have an R2L tool bar if the menu bar cannot
be drawn also R2L, and making the menu bar R2L is tricky due
/* This function can be called asynchronously, which means we must
exclude any possibility that Fget_text_property signals an
error. */
- charpos = min (SCHARS (FVAR (f, current_tool_bar_string)), glyph->charpos);
+ charpos = min (SCHARS (f->current_tool_bar_string), glyph->charpos);
charpos = max (0, charpos);
/* Get the text property `menu-item' at pos. The value of that
property is the start index of this item's properties in
F->tool_bar_items. */
prop = Fget_text_property (make_number (charpos),
- Qmenu_item, FVAR (f, current_tool_bar_string));
+ Qmenu_item, f->current_tool_bar_string);
if (INTEGERP (prop))
{
*prop_idx = XINT (prop);
int *hpos, int *vpos, int *prop_idx)
{
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- struct window *w = XWINDOW (FVAR (f, tool_bar_window));
+ struct window *w = XWINDOW (f->tool_bar_window);
int area;
/* Find the glyph under X/Y. */
return -1;
/* Is mouse on the highlighted item? */
- if (EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)
+ if (EQ (f->tool_bar_window, hlinfo->mouse_face_window)
&& *vpos >= hlinfo->mouse_face_beg_row
&& *vpos <= hlinfo->mouse_face_end_row
&& (*vpos > hlinfo->mouse_face_beg_row
int modifiers)
{
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- struct window *w = XWINDOW (FVAR (f, tool_bar_window));
+ struct window *w = XWINDOW (f->tool_bar_window);
int hpos, vpos, prop_idx;
struct glyph *glyph;
Lisp_Object enabled_p;
return;
/* If item is disabled, do nothing. */
- enabled_p = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P);
+ enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
if (NILP (enabled_p))
return;
show_mouse_face (hlinfo, DRAW_IMAGE_RAISED);
hlinfo->mouse_face_image_state = DRAW_IMAGE_RAISED;
- key = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_KEY);
+ key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY);
XSETFRAME (frame, f);
event.kind = TOOL_BAR_EVENT;
static void
note_tool_bar_highlight (struct frame *f, int x, int y)
{
- Lisp_Object window = FVAR (f, tool_bar_window);
+ Lisp_Object window = f->tool_bar_window;
struct window *w = XWINDOW (window);
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
/* If tool-bar item is not enabled, don't highlight it. */
- enabled_p = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P);
+ enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
if (!NILP (enabled_p))
{
/* Compute the x-position of the glyph. In front and past the
XTread_socket does the rest. */
help_echo_object = help_echo_window = Qnil;
help_echo_pos = -1;
- help_echo_string = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_HELP);
+ help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_HELP);
if (NILP (help_echo_string))
- help_echo_string = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_CAPTION);
+ help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION);
}
#endif /* HAVE_WINDOW_SYSTEM */
{
struct window *w = XWINDOW (window);
- if (WINDOWP (WVAR (w, hchild)))
- hscrolled_p |= hscroll_window_tree (WVAR (w, hchild));
- else if (WINDOWP (WVAR (w, vchild)))
- hscrolled_p |= hscroll_window_tree (WVAR (w, vchild));
+ if (WINDOWP (w->hchild))
+ hscrolled_p |= hscroll_window_tree (w->hchild);
+ else if (WINDOWP (w->vchild))
+ hscrolled_p |= hscroll_window_tree (w->vchild);
else if (w->cursor.vpos >= 0)
{
int h_margin;
/* Scroll when cursor is inside this scroll margin. */
h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w);
- if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, WVAR (w, buffer)))
+ if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer))
/* For left-to-right rows, hscroll when cursor is either
(i) inside the right hscroll margin, or (ii) if it is
inside the left margin and the window is already
/* Find point in a display of infinite width. */
saved_current_buffer = current_buffer;
- current_buffer = XBUFFER (WVAR (w, buffer));
+ current_buffer = XBUFFER (w->buffer);
if (w == XWINDOW (selected_window))
pt = PT;
else
{
- pt = marker_position (WVAR (w, pointm));
+ pt = marker_position (w->pointm);
pt = max (BEGV, pt);
pt = min (ZV, pt);
}
redisplay. */
if (w->hscroll != hscroll)
{
- XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1;
+ XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
w->hscroll = hscroll;
hscrolled_p = 1;
}
}
}
- window = WVAR (w, next);
+ window = w->next;
}
/* Value is non-zero if hscroll of any leaf window has been changed. */
if (trace_redisplay_p)
fprintf (stderr, "%p (%s): %s\n",
w,
- ((BUFFERP (WVAR (w, buffer))
- && STRINGP (BVAR (XBUFFER (WVAR (w, buffer)), name)))
- ? SSDATA (BVAR (XBUFFER (WVAR (w, buffer)), name))
+ ((BUFFERP (w->buffer)
+ && STRINGP (BVAR (XBUFFER (w->buffer), name)))
+ ? SSDATA (BVAR (XBUFFER (w->buffer), name))
: "no buffer"),
method + len);
}
require to redisplay the whole paragraph. It might be worthwhile
to find the paragraph limits and widen the range of redisplayed
lines to that, but for now just give up this optimization. */
- if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))
- && NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_paragraph_direction)))
+ if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
+ && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction)))
unchanged_p = 0;
}
reconsider_clip_changes (struct window *w, struct buffer *b)
{
if (b->clip_changed
- && !NILP (WVAR (w, window_end_valid))
+ && !NILP (w->window_end_valid)
&& w->current_matrix->buffer == b
&& w->current_matrix->zv == BUF_ZV (b)
&& w->current_matrix->begv == BUF_BEGV (b))
b->clip_changed has already been set to 1, we can skip this
check. */
if (!b->clip_changed
- && BUFFERP (WVAR (w, buffer)) && !NILP (WVAR (w, window_end_valid)))
+ && BUFFERP (w->buffer) && !NILP (w->window_end_valid))
{
ptrdiff_t pt;
if (w == XWINDOW (selected_window))
pt = PT;
else
- pt = marker_position (WVAR (w, pointm));
+ pt = marker_position (w->pointm);
- if ((w->current_matrix->buffer != XBUFFER (WVAR (w, buffer))
+ if ((w->current_matrix->buffer != XBUFFER (w->buffer)
|| pt != w->last_point)
&& check_point_in_composition (w->current_matrix->buffer,
w->last_point,
- XBUFFER (WVAR (w, buffer)), pt))
+ XBUFFER (w->buffer), pt))
b->clip_changed = 1;
}
}
selected_frame = frame;
do {
- for (tail = FVAR (XFRAME (frame), param_alist);
+ for (tail = XFRAME (frame)->param_alist;
CONSP (tail); tail = XCDR (tail))
if (CONSP (XCAR (tail))
&& (tem = XCAR (XCAR (tail)),
/* Don't examine these until after testing Vinhibit_redisplay.
When Emacs is shutting down, perhaps because its connection to
X has dropped, we should not look at them at all. */
- fr = XFRAME (WVAR (w, frame));
+ fr = XFRAME (w->frame);
sf = SELECTED_FRAME ();
if (!fr->glyphs_initialized_p)
specbind (Qinhibit_point_motion_hooks, Qt);
/* If %c is in the mode line, update it if needed. */
- if (!NILP (WVAR (w, column_number_displayed))
+ if (!NILP (w->column_number_displayed)
/* This alternative quickly identifies a common case
where no change is needed. */
&& !(PT == w->last_point
&& w->last_modified >= MODIFF
&& w->last_overlay_modified >= OVERLAY_MODIFF)
- && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ()))
+ && (XFASTINT (w->column_number_displayed) != current_column ()))
w->update_mode_line = 1;
unbind_to (count1, Qnil);
- FRAME_SCROLL_BOTTOM_VPOS (XFRAME (WVAR (w, frame))) = -1;
+ FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1;
/* The variable buffer_shared is set in redisplay_window and
indicates that we redisplay a buffer in different windows. See
the whole window. The assignment to this_line_start_pos prevents
the optimization directly below this if-statement. */
if (((!NILP (Vtransient_mark_mode)
- && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active)))
- != !NILP (WVAR (w, region_showing)))
- || (!NILP (WVAR (w, region_showing))
- && !EQ (WVAR (w, region_showing),
- Fmarker_position (BVAR (XBUFFER (WVAR (w, buffer)), mark)))))
+ && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
+ != !NILP (w->region_showing))
+ || (!NILP (w->region_showing)
+ && !EQ (w->region_showing,
+ Fmarker_position (BVAR (XBUFFER (w->buffer), mark)))))
CHARPOS (this_line_start_pos) = 0;
/* Optimize the case that only the line containing the cursor in the
&& !w->update_mode_line
&& !current_buffer->clip_changed
&& !current_buffer->prevent_redisplay_optimizations_p
- && FRAME_VISIBLE_P (XFRAME (WVAR (w, frame)))
- && !FRAME_OBSCURED_P (XFRAME (WVAR (w, frame)))
+ && FRAME_VISIBLE_P (XFRAME (w->frame))
+ && !FRAME_OBSCURED_P (XFRAME (w->frame))
/* Make sure recorded data applies to current buffer, etc. */
&& this_line_buffer == current_buffer
- && current_buffer == XBUFFER (WVAR (w, buffer))
+ && current_buffer == XBUFFER (w->buffer)
&& !w->force_start
&& !w->optional_new_start
/* Point must be on the line that we have info recorded about. */
adjusted. */
if ((it.glyph_row - 1)->displays_text_p)
{
- if (XFASTINT (WVAR (w, window_end_vpos)) < this_line_vpos)
- XSETINT (WVAR (w, window_end_vpos), this_line_vpos);
+ if (XFASTINT (w->window_end_vpos) < this_line_vpos)
+ WSET (w, window_end_vpos, make_number (this_line_vpos));
}
- else if (XFASTINT (WVAR (w, window_end_vpos)) == this_line_vpos
+ else if (XFASTINT (w->window_end_vpos) == this_line_vpos
&& this_line_vpos > 0)
- XSETINT (WVAR (w, window_end_vpos), this_line_vpos - 1);
- WVAR (w, window_end_valid) = Qnil;
+ WSET (w, window_end_vpos, make_number (this_line_vpos - 1));
+ WSET (w, window_end_valid, Qnil);
/* Update hint: No need to try to scroll in update_window. */
w->desired_matrix->no_scrolling_p = 1;
&& (EQ (selected_window,
BVAR (current_buffer, last_selected_window))
|| highlight_nonselected_windows)
- && NILP (WVAR (w, region_showing))
+ && NILP (w->region_showing)
&& NILP (Vshow_trailing_whitespace)
&& !cursor_in_echo_area)
{
if (!f->already_hscrolled_p)
{
f->already_hscrolled_p = 1;
- if (hscroll_windows (FVAR (f, root_window)))
+ if (hscroll_windows (f->root_window))
goto retry;
}
STOP_POLLING;
/* Update the display. */
- set_window_update_flags (XWINDOW (FVAR (f, root_window)), 1);
+ set_window_update_flags (XWINDOW (f->root_window), 1);
pending |= update_frame (f, 0, 0);
f->updated_p = 1;
}
and selected_window to be temporarily out-of-sync but let's make
sure this stays contained. */
select_frame_for_redisplay (old_frame);
- eassert (EQ (FVAR (XFRAME (selected_frame), selected_window),
+ eassert (EQ (XFRAME (selected_frame)->selected_window,
selected_window));
if (!pending)
struct frame *f = XFRAME (frame);
if (f->updated_p)
{
- mark_window_display_accurate (FVAR (f, root_window), 1);
+ mark_window_display_accurate (f->root_window, 1);
if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
FRAME_TERMINAL (f)->frame_up_to_date_hook (f);
}
Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
struct frame *mini_frame;
- displayed_buffer = XBUFFER (WVAR (XWINDOW (selected_window), buffer));
+ displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer);
/* Use list_of_error, not Qerror, so that
we catch only errors and don't run the debugger. */
internal_condition_case_1 (redisplay_window_1, selected_window,
/* If we pause after scrolling, some rows in the current
matrices of some windows are not valid. */
if (!WINDOW_FULL_WIDTH_P (w)
- && !FRAME_WINDOW_P (XFRAME (WVAR (w, frame))))
+ && !FRAME_WINDOW_P (XFRAME (w->frame)))
update_mode_lines = 1;
}
else
static void
mark_window_display_accurate_1 (struct window *w, int accurate_p)
{
- if (BUFFERP (WVAR (w, buffer)))
+ if (BUFFERP (w->buffer))
{
- struct buffer *b = XBUFFER (WVAR (w, buffer));
+ struct buffer *b = XBUFFER (w->buffer);
w->last_modified = accurate_p ? BUF_MODIFF(b) : 0;
w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0;
if (w == XWINDOW (selected_window))
w->last_point = BUF_PT (b);
else
- w->last_point = XMARKER (WVAR (w, pointm))->charpos;
+ w->last_point = XMARKER (w->pointm)->charpos;
}
}
if (accurate_p)
{
- WVAR (w, window_end_valid) = WVAR (w, buffer);
+ WSET (w, window_end_valid, w->buffer);
w->update_mode_line = 0;
}
}
{
struct window *w;
- for (; !NILP (window); window = WVAR (w, next))
+ for (; !NILP (window); window = w->next)
{
w = XWINDOW (window);
mark_window_display_accurate_1 (w, accurate_p);
- if (!NILP (WVAR (w, vchild)))
- mark_window_display_accurate (WVAR (w, vchild), accurate_p);
- if (!NILP (WVAR (w, hchild)))
- mark_window_display_accurate (WVAR (w, hchild), accurate_p);
+ if (!NILP (w->vchild))
+ mark_window_display_accurate (w->vchild, accurate_p);
+ if (!NILP (w->hchild))
+ mark_window_display_accurate (w->hchild, accurate_p);
}
if (accurate_p)
{
struct window *w = XWINDOW (window);
- if (!NILP (WVAR (w, hchild)))
- redisplay_windows (WVAR (w, hchild));
- else if (!NILP (WVAR (w, vchild)))
- redisplay_windows (WVAR (w, vchild));
- else if (!NILP (WVAR (w, buffer)))
+ if (!NILP (w->hchild))
+ redisplay_windows (w->hchild);
+ else if (!NILP (w->vchild))
+ redisplay_windows (w->vchild);
+ else if (!NILP (w->buffer))
{
- displayed_buffer = XBUFFER (WVAR (w, buffer));
+ displayed_buffer = XBUFFER (w->buffer);
/* Use list_of_error, not Qerror, so that
we catch only errors and don't run the debugger. */
internal_condition_case_1 (redisplay_window_0, window,
redisplay_window_error);
}
- window = WVAR (w, next);
+ window = w->next;
}
}
&& !MATRIX_ROW_CONTINUATION_LINE_P (row)
&& row->x == 0)
{
- this_line_buffer = XBUFFER (WVAR (w, buffer));
+ this_line_buffer = XBUFFER (w->buffer);
CHARPOS (this_line_start_pos)
= MATRIX_ROW_START_CHARPOS (row) + delta;
run_window_scroll_functions (Lisp_Object window, struct text_pos startp)
{
struct window *w = XWINDOW (window);
- SET_MARKER_FROM_TEXT_POS (WVAR (w, start), startp);
+ SET_MARKER_FROM_TEXT_POS (w->start, startp);
- if (current_buffer != XBUFFER (WVAR (w, buffer)))
+ if (current_buffer != XBUFFER (w->buffer))
abort ();
if (!NILP (Vwindow_scroll_functions))
{
run_hook_with_args_2 (Qwindow_scroll_functions, window,
make_number (CHARPOS (startp)));
- SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (startp, w->start);
/* In case the hook functions switch buffers. */
- if (current_buffer != XBUFFER (WVAR (w, buffer)))
- set_buffer_internal_1 (XBUFFER (WVAR (w, buffer)));
+ if (current_buffer != XBUFFER (w->buffer))
+ set_buffer_internal_1 (XBUFFER (w->buffer));
}
return startp;
int temp_scroll_step, int last_line_misfit)
{
struct window *w = XWINDOW (window);
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
struct text_pos pos, startp;
struct it it;
int this_scroll_margin, scroll_max, rc, height;
debug_method_add (w, "try_scrolling");
#endif
- SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (startp, w->start);
/* Compute scroll margin height in pixels. We scroll when point is
within this distance from the top or bottom of the window. */
if (!just_this_one_p
|| current_buffer->clip_changed
|| BEG_UNCHANGED < CHARPOS (startp))
- WVAR (w, base_line_number) = Qnil;
+ WSET (w, base_line_number, Qnil);
/* If cursor ends up on a partially visible line,
treat that as being off the bottom of the screen. */
struct text_pos pos, start_pos;
int window_start_changed_p = 0;
- SET_TEXT_POS_FROM_MARKER (start_pos, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (start_pos, w->start);
/* If window start is on a continuation line... Window start may be
< BEGV in case there's invisible text at the start of the
}
/* Set the window start there. */
- SET_MARKER_FROM_TEXT_POS (WVAR (w, start), pos);
+ SET_MARKER_FROM_TEXT_POS (w->start, pos);
window_start_changed_p = 1;
}
}
try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step)
{
struct window *w = XWINDOW (window);
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
int rc = CURSOR_MOVEMENT_CANNOT_BE_USED;
#ifdef GLYPH_DEBUG
set the cursor. */
&& !(!NILP (Vtransient_mark_mode)
&& !NILP (BVAR (current_buffer, mark_active)))
- && NILP (WVAR (w, region_showing))
+ && NILP (w->region_showing)
&& NILP (Vshow_trailing_whitespace)
/* This code is not used for mini-buffer for the sake of the case
of redisplaying to replace an echo area message; since in
larger than the window. This should really be fixed in
window.c. I don't have this on my list, now, so we do
approximately the same as the old redisplay code. --gerd. */
- && INTEGERP (WVAR (w, window_end_vpos))
- && XFASTINT (WVAR (w, window_end_vpos)) < w->current_matrix->nrows
+ && INTEGERP (w->window_end_vpos)
+ && XFASTINT (w->window_end_vpos) < w->current_matrix->nrows
&& (FRAME_WINDOW_P (f)
|| !overlay_arrow_in_current_buffer_p ()))
{
must_scroll = 1;
}
else if (rc != CURSOR_MOVEMENT_SUCCESS
- && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)))
+ && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
{
struct glyph_row *row1;
else if (scroll_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
else if (rc != CURSOR_MOVEMENT_SUCCESS
- && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)))
+ && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
{
/* With bidi-reordered rows, there could be more than
one candidate row whose start and end positions
|| (w == XWINDOW (minibuf_window)
&& NILP (echo_area_buffer[0])))
{
- struct buffer *buf = XBUFFER (WVAR (w, buffer));
+ struct buffer *buf = XBUFFER (w->buffer);
whole = BUF_ZV (buf) - BUF_BEGV (buf);
- start = marker_position (WVAR (w, start)) - BUF_BEGV (buf);
+ start = marker_position (w->start) - BUF_BEGV (buf);
/* I don't think this is guaranteed to be right. For the
moment, we'll pretend it is. */
- end = BUF_Z (buf) - XFASTINT (WVAR (w, window_end_pos)) - BUF_BEGV (buf);
+ end = BUF_Z (buf) - XFASTINT (w->window_end_pos) - BUF_BEGV (buf);
if (end < start)
end = start;
start = end = whole = 0;
/* Indicate what this scroll bar ought to be displaying now. */
- if (FRAME_TERMINAL (XFRAME (WVAR (w, frame)))->set_vertical_scroll_bar_hook)
- (*FRAME_TERMINAL (XFRAME (WVAR (w, frame)))->set_vertical_scroll_bar_hook)
+ if (FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
+ (*FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
(w, end - start, whole, start);
}
redisplay_window (Lisp_Object window, int just_this_one_p)
{
struct window *w = XWINDOW (window);
- struct frame *f = XFRAME (WVAR (w, frame));
- struct buffer *buffer = XBUFFER (WVAR (w, buffer));
+ struct frame *f = XFRAME (w->frame);
+ struct buffer *buffer = XBUFFER (w->buffer);
struct buffer *old = current_buffer;
struct text_pos lpoint, opoint, startp;
int update_mode_line;
opoint = lpoint;
/* W must be a leaf window here. */
- eassert (!NILP (WVAR (w, buffer)));
+ eassert (!NILP (w->buffer));
#ifdef GLYPH_DEBUG
*w->desired_matrix->method = 0;
#endif
else if ((w != XWINDOW (minibuf_window)
|| minibuf_level == 0)
/* When buffer is nonempty, redisplay window normally. */
- && BUF_Z (XBUFFER (WVAR (w, buffer))) == BUF_BEG (XBUFFER (WVAR (w, buffer)))
+ && BUF_Z (XBUFFER (w->buffer)) == BUF_BEG (XBUFFER (w->buffer))
/* Quail displays non-mini buffers in minibuffer window.
In that case, redisplay the window normally. */
- && !NILP (Fmemq (WVAR (w, buffer), Vminibuffer_list)))
+ && !NILP (Fmemq (w->buffer, Vminibuffer_list)))
{
/* W is a mini-buffer window, but it's not active, so clear
it. */
value. */
/* Really select the buffer, for the sake of buffer-local
variables. */
- set_buffer_internal_1 (XBUFFER (WVAR (w, buffer)));
+ set_buffer_internal_1 (XBUFFER (w->buffer));
current_matrix_up_to_date_p
- = (!NILP (WVAR (w, window_end_valid))
+ = (!NILP (w->window_end_valid)
&& !current_buffer->clip_changed
&& !current_buffer->prevent_redisplay_optimizations_p
&& w->last_modified >= MODIFF
specbind (Qinhibit_point_motion_hooks, Qt);
buffer_unchanged_p
- = (!NILP (WVAR (w, window_end_valid))
+ = (!NILP (w->window_end_valid)
&& !current_buffer->clip_changed
&& w->last_modified >= MODIFF
&& w->last_overlay_modified >= OVERLAY_MODIFF);
{
/* If window starts on a continuation line, maybe adjust the
window start in case the window's width changed. */
- if (XMARKER (WVAR (w, start))->buffer == current_buffer)
+ if (XMARKER (w->start)->buffer == current_buffer)
compute_window_start_on_continuation_line (w);
- WVAR (w, window_end_valid) = Qnil;
+ WSET (w, window_end_valid, Qnil);
}
/* Some sanity checks. */
abort ();
/* If %c is in mode line, update it if needed. */
- if (!NILP (WVAR (w, column_number_displayed))
+ if (!NILP (w->column_number_displayed)
/* This alternative quickly identifies a common case
where no change is needed. */
&& !(PT == w->last_point
&& w->last_modified >= MODIFF
&& w->last_overlay_modified >= OVERLAY_MODIFF)
- && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ()))
+ && (XFASTINT (w->column_number_displayed) != current_column ()))
update_mode_line = 1;
/* Count number of windows showing the selected buffer. An indirect
{
struct buffer *current_base, *window_base;
current_base = current_buffer;
- window_base = XBUFFER (WVAR (XWINDOW (selected_window), buffer));
+ window_base = XBUFFER (XWINDOW (selected_window)->buffer);
if (current_base->base_buffer)
current_base = current_base->base_buffer;
if (window_base->base_buffer)
window, set up appropriate value. */
if (!EQ (window, selected_window))
{
- ptrdiff_t new_pt = XMARKER (WVAR (w, pointm))->charpos;
- ptrdiff_t new_pt_byte = marker_byte_position (WVAR (w, pointm));
+ ptrdiff_t new_pt = XMARKER (w->pointm)->charpos;
+ ptrdiff_t new_pt_byte = marker_byte_position (w->pointm);
if (new_pt < BEGV)
{
new_pt = BEGV;
new_pt_byte = BEGV_BYTE;
- set_marker_both (WVAR (w, pointm), Qnil, BEGV, BEGV_BYTE);
+ set_marker_both (w->pointm, Qnil, BEGV, BEGV_BYTE);
}
else if (new_pt > (ZV - 1))
{
new_pt = ZV;
new_pt_byte = ZV_BYTE;
- set_marker_both (WVAR (w, pointm), Qnil, ZV, ZV_BYTE);
+ set_marker_both (w->pointm, Qnil, ZV, ZV_BYTE);
}
/* We don't use SET_PT so that the point-motion hooks don't run. */
}
/* If window-start is screwed up, choose a new one. */
- if (XMARKER (WVAR (w, start))->buffer != current_buffer)
+ if (XMARKER (w->start)->buffer != current_buffer)
goto recenter;
- SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (startp, w->start);
/* If someone specified a new starting point but did not insist,
check whether it can be used. */
w->force_start = 0;
w->vscroll = 0;
- WVAR (w, window_end_valid) = Qnil;
+ WSET (w, window_end_valid, Qnil);
/* Forget any recorded base line for line number display. */
if (!buffer_unchanged_p)
- WVAR (w, base_line_number) = Qnil;
+ WSET (w, base_line_number, Qnil);
/* Redisplay the mode line. Select the buffer properly for that.
Also, run the hook window-scroll-functions
MATRIX_ROW_START_BYTEPOS (row));
if (w != XWINDOW (selected_window))
- set_marker_both (WVAR (w, pointm), Qnil, PT, PT_BYTE);
+ set_marker_both (w->pointm, Qnil, PT, PT_BYTE);
else if (current_buffer == old)
SET_TEXT_POS (lpoint, PT, PT_BYTE);
sets it. So, we need to check the return value of
compute_window_start_on_continuation_line. (See also
bug#197). */
- && XMARKER (WVAR (w, start))->buffer == current_buffer
+ && XMARKER (w->start)->buffer == current_buffer
&& compute_window_start_on_continuation_line (w)
/* It doesn't make sense to force the window start like we
do at label force_start if it is already known that point
&& pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6))
{
w->force_start = 1;
- SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (startp, w->start);
goto force_start;
}
|| current_buffer->clip_changed
|| BEG_UNCHANGED < CHARPOS (startp))
/* Forget any recorded base line for line number display. */
- WVAR (w, base_line_number) = Qnil;
+ WSET (w, base_line_number, Qnil);
if (!cursor_row_fully_visible_p (w, 1, 0))
{
/* Forget any previously recorded base line for line number display. */
if (!buffer_unchanged_p)
- WVAR (w, base_line_number) = Qnil;
+ WSET (w, base_line_number, Qnil);
/* Determine the window start relative to point. */
init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
/* Set the window start position here explicitly, to avoid an
infinite loop in case the functions in window-scroll-functions
get errors. */
- set_marker_both (WVAR (w, start), Qnil, IT_CHARPOS (it), IT_BYTEPOS (it));
+ set_marker_both (w->start, Qnil, IT_CHARPOS (it), IT_BYTEPOS (it));
/* Run scroll hooks. */
startp = run_window_scroll_functions (window, it.current.pos);
line.) */
if (w->cursor.vpos < 0)
{
- if (!NILP (WVAR (w, window_end_valid))
- && PT >= Z - XFASTINT (WVAR (w, window_end_pos)))
+ if (!NILP (w->window_end_valid)
+ && PT >= Z - XFASTINT (w->window_end_pos))
{
clear_glyph_matrix (w->desired_matrix);
move_it_by_lines (&it, 1);
done:
- SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (startp, w->start);
w->start_at_line_beg = (CHARPOS (startp) == BEGV
|| FETCH_BYTE (BYTEPOS (startp) - 1) == '\n');
&& !FRAME_WINDOW_P (f)
&& !WINDOW_FULL_WIDTH_P (w))
/* Line number to display. */
- || INTEGERP (WVAR (w, base_line_pos))
+ || INTEGERP (w->base_line_pos)
/* Column number is displayed and different from the one displayed. */
- || (!NILP (WVAR (w, column_number_displayed))
- && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ())))
+ || (!NILP (w->column_number_displayed)
+ && (XFASTINT (w->column_number_displayed) != current_column ())))
/* This means that the window has a mode line. */
&& (WINDOW_WANTS_MODELINE_P (w)
|| WINDOW_WANTS_HEADER_LINE_P (w)))
}
if (!line_number_displayed
- && !BUFFERP (WVAR (w, base_line_pos)))
+ && !BUFFERP (w->base_line_pos))
{
- WVAR (w, base_line_pos) = Qnil;
- WVAR (w, base_line_number) = Qnil;
+ WSET (w, base_line_pos, Qnil);
+ WSET (w, base_line_number, Qnil);
}
finish_menu_bars:
if (FRAME_EXTERNAL_TOOL_BAR (f))
redisplay_tool_bar (f);
#else
- if (WINDOWP (FVAR (f, tool_bar_window))
+ if (WINDOWP (f->tool_bar_window)
&& (FRAME_TOOL_BAR_LINES (f) > 0
|| !NILP (Vauto_resize_tool_bars))
&& redisplay_tool_bar (f))
struct window *w = XWINDOW (window);
struct it it;
struct glyph_row *last_text_row = NULL;
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
/* Make POS the new window start. */
- set_marker_both (WVAR (w, start), Qnil, CHARPOS (pos), BYTEPOS (pos));
+ set_marker_both (w->start, Qnil, CHARPOS (pos), BYTEPOS (pos));
/* Mark cursor position as unknown. No overlay arrow seen. */
w->cursor.vpos = -1;
}
/* If bottom moved off end of frame, change mode line percentage. */
- if (XFASTINT (WVAR (w, window_end_pos)) <= 0
+ if (XFASTINT (w->window_end_pos) <= 0
&& Z != IT_CHARPOS (it))
w->update_mode_line = 1;
eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row));
w->window_end_bytepos
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
- WVAR (w, window_end_pos)
- = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row));
- WVAR (w, window_end_vpos)
- = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix));
+ WSET (w, window_end_pos,
+ make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
+ WSET (w, window_end_vpos,
+ make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
eassert
(MATRIX_ROW (w->desired_matrix,
- XFASTINT (WVAR (w, window_end_vpos)))->displays_text_p);
+ XFASTINT (w->window_end_vpos))->displays_text_p);
}
else
{
w->window_end_bytepos = Z_BYTE - ZV_BYTE;
- WVAR (w, window_end_pos) = make_number (Z - ZV);
- WVAR (w, window_end_vpos) = make_number (0);
+ WSET (w, window_end_pos, make_number (Z - ZV));
+ WSET (w, window_end_vpos, make_number (0));
}
/* But that is not valid info until redisplay finishes. */
- WVAR (w, window_end_valid) = Qnil;
+ WSET (w, window_end_valid, Qnil);
return 1;
}
static int
try_window_reusing_current_matrix (struct window *w)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
struct glyph_row *bottom_row;
struct it it;
struct run run;
/* Can't do this if region may have changed. */
if ((!NILP (Vtransient_mark_mode)
&& !NILP (BVAR (current_buffer, mark_active)))
- || !NILP (WVAR (w, region_showing))
+ || !NILP (w->region_showing)
|| !NILP (Vshow_trailing_whitespace))
return 0;
/* The variable new_start now holds the new window start. The old
start `start' can be determined from the current matrix. */
- SET_TEXT_POS_FROM_MARKER (new_start, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (new_start, w->start);
start = start_row->minpos;
start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix);
{
w->window_end_bytepos
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row);
- WVAR (w, window_end_pos)
- = make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row));
- WVAR (w, window_end_vpos)
- = make_number (MATRIX_ROW_VPOS (last_reused_text_row,
- w->current_matrix));
+ WSET (w, window_end_pos,
+ make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row)));
+ WSET (w, window_end_vpos,
+ make_number (MATRIX_ROW_VPOS (last_reused_text_row, w->current_matrix)));
}
else if (last_text_row)
{
w->window_end_bytepos
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
- WVAR (w, window_end_pos)
- = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row));
- WVAR (w, window_end_vpos)
- = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix));
+ WSET (w, window_end_pos,
+ make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
+ WSET (w, window_end_vpos,
+ make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
}
else
{
/* This window must be completely empty. */
w->window_end_bytepos = Z_BYTE - ZV_BYTE;
- WVAR (w, window_end_pos) = make_number (Z - ZV);
- WVAR (w, window_end_vpos) = make_number (0);
+ WSET (w, window_end_pos, make_number (Z - ZV));
+ WSET (w, window_end_vpos, make_number (0));
}
- WVAR (w, window_end_valid) = Qnil;
+ WSET (w, window_end_valid, Qnil);
/* Update hint: don't try scrolling again in update_window. */
w->desired_matrix->no_scrolling_p = 1;
/* Can't use this optimization with bidi-reordered glyph
rows, unless cursor is already at point. */
- if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)))
+ if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
{
if (!(w->cursor.hpos >= 0
&& w->cursor.hpos < row->used[TEXT_AREA]
{
w->window_end_bytepos
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
- WVAR (w, window_end_pos)
- = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row));
- WVAR (w, window_end_vpos)
- = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix));
+ WSET (w, window_end_pos,
+ make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
+ WSET (w, window_end_vpos,
+ make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
}
else
{
- WVAR (w, window_end_vpos)
- = make_number (XFASTINT (WVAR (w, window_end_vpos)) - nrows_scrolled);
+ WSET (w, window_end_vpos,
+ make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled));
}
- WVAR (w, window_end_valid) = Qnil;
+ WSET (w, window_end_valid, Qnil);
w->desired_matrix->no_scrolling_p = 1;
#ifdef GLYPH_DEBUG
/* Display must not have been paused, otherwise the current matrix
is not up to date. */
- eassert (!NILP (WVAR (w, window_end_valid)));
+ eassert (!NILP (w->window_end_valid));
/* A value of window_end_pos >= END_UNCHANGED means that the window
end is in the range of changed text. If so, there is no
unchanged row at the end of W's current matrix. */
- if (XFASTINT (WVAR (w, window_end_pos)) >= END_UNCHANGED)
+ if (XFASTINT (w->window_end_pos) >= END_UNCHANGED)
return NULL;
/* Set row to the last row in W's current matrix displaying text. */
- row = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos)));
+ row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
/* If matrix is entirely empty, no unchanged row exists. */
if (MATRIX_ROW_DISPLAYS_TEXT_P (row))
buffer positions in the current matrix to current buffer
positions for characters not in changed text. */
ptrdiff_t Z_old =
- MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WVAR (w, window_end_pos));
+ MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
ptrdiff_t Z_BYTE_old =
MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
ptrdiff_t last_unchanged_pos, last_unchanged_pos_old;
static void
sync_frame_with_window_matrix_rows (struct window *w)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
struct glyph_row *window_row, *window_row_end, *frame_row;
/* Preconditions: W must be a leaf window and full-width. Its frame
must have a frame matrix. */
- eassert (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild)));
+ eassert (NILP (w->hchild) && NILP (w->vchild));
eassert (WINDOW_FULL_WIDTH_P (w));
eassert (!FRAME_WINDOW_P (f));
{
struct glyph_row *row = start;
struct glyph_row *best_row = NULL;
- ptrdiff_t mindif = BUF_ZV (XBUFFER (WVAR (w, buffer))) + 1;
+ ptrdiff_t mindif = BUF_ZV (XBUFFER (w->buffer)) + 1;
int last_y;
/* If we happen to start on a header-line, skip that. */
{
struct glyph *g;
- if (NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))
+ if (NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
|| (!best_row && !row->continued_p))
return row;
/* In bidi-reordered rows, there could be several rows
static int
try_window_id (struct window *w)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
struct glyph_matrix *current_matrix = w->current_matrix;
struct glyph_matrix *desired_matrix = w->desired_matrix;
struct glyph_row *last_unchanged_at_beg_row;
#define GIVE_UP(X) return 0
#endif
- SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start));
+ SET_TEXT_POS_FROM_MARKER (start, w->start);
/* Don't use this for mini-windows because these can show
messages and mini-buffers, and we don't handle that here. */
GIVE_UP (7);
/* Verify that display wasn't paused. */
- if (NILP (WVAR (w, window_end_valid)))
+ if (NILP (w->window_end_valid))
GIVE_UP (8);
/* Can't use this if highlighting a region because a cursor movement
GIVE_UP (11);
/* Likewise if showing a region. */
- if (!NILP (WVAR (w, region_showing)))
+ if (!NILP (w->region_showing))
GIVE_UP (10);
/* Can't use this if overlay arrow position and/or string have
wrapped line can change the wrap position, altering the line
above it. It might be worthwhile to handle this more
intelligently, but for now just redisplay from scratch. */
- if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), word_wrap)))
+ if (!NILP (BVAR (XBUFFER (w->buffer), word_wrap)))
GIVE_UP (21);
/* Under bidi reordering, adding or deleting a character in the
to find the paragraph limits and widen the range of redisplayed
lines to that, but for now just give up this optimization and
redisplay from scratch. */
- if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))
- && NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_paragraph_direction)))
+ if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
+ && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction)))
GIVE_UP (22);
/* Make sure beg_unchanged and end_unchanged are up to date. Do it
This case happens with stealth-fontification. Note that although
the display is unchanged, glyph positions in the matrix have to
be adjusted, of course. */
- row = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos)));
+ row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
if (MATRIX_ROW_DISPLAYS_TEXT_P (row)
&& ((last_changed_charpos < CHARPOS (start)
&& CHARPOS (start) == BEGV)
/* Compute how many chars/bytes have been added to or removed
from the buffer. */
- Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WVAR (w, window_end_pos));
+ Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
Z_delta = Z - Z_old;
Z_delta_bytes = Z_BYTE - Z_BYTE_old;
{
/* We have to compute the window end anew since text
could have been added/removed after it. */
- WVAR (w, window_end_pos)
- = make_number (Z - MATRIX_ROW_END_CHARPOS (row));
+ WSET (w, window_end_pos,
+ make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
w->window_end_bytepos
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
/* Give up if the window ends in strings. Overlay strings
at the end are difficult to handle, so don't try. */
- row = MATRIX_ROW (current_matrix, XFASTINT (WVAR (w, window_end_vpos)));
+ row = MATRIX_ROW (current_matrix, XFASTINT (w->window_end_vpos));
if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row))
GIVE_UP (20);
/* Set last_row to the glyph row in the current matrix where the
window end line is found. It has been moved up or down in
the matrix by dvpos. */
- int last_vpos = XFASTINT (WVAR (w, window_end_vpos)) + dvpos;
+ int last_vpos = XFASTINT (w->window_end_vpos) + dvpos;
struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos);
/* If last_row is the window end line, it should display text. */
first_unchanged_at_end_row);
eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row));
- WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row));
+ WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
- WVAR (w, window_end_vpos)
- = make_number (MATRIX_ROW_VPOS (row, w->current_matrix));
+ WSET (w, window_end_vpos,
+ make_number (MATRIX_ROW_VPOS (row, w->current_matrix)));
eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "A"));
}
else if (last_text_row_at_end)
{
- WVAR (w, window_end_pos)
- = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end));
+ WSET (w, window_end_pos,
+ make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)));
w->window_end_bytepos
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end);
- WVAR (w, window_end_vpos)
- = make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix));
+ WSET (w, window_end_vpos,
+ make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)));
eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "B"));
}
/* We have displayed either to the end of the window or at the
end of the window, i.e. the last row with text is to be found
in the desired matrix. */
- WVAR (w, window_end_pos)
- = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row));
+ WSET (w, window_end_pos,
+ make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
w->window_end_bytepos
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
- WVAR (w, window_end_vpos)
- = make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix));
+ WSET (w, window_end_vpos,
+ make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)));
eassert (w->window_end_bytepos >= 0);
}
else if (first_unchanged_at_end_row == NULL
/* Displayed to end of window, but no line containing text was
displayed. Lines were deleted at the end of the window. */
int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
- int vpos = XFASTINT (WVAR (w, window_end_vpos));
+ int vpos = XFASTINT (w->window_end_vpos);
struct glyph_row *current_row = current_matrix->rows + vpos;
struct glyph_row *desired_row = desired_matrix->rows + vpos;
}
eassert (row != NULL);
- WVAR (w, window_end_vpos) = make_number (vpos + 1);
- WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row));
+ WSET (w, window_end_vpos, make_number (vpos + 1));
+ WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
eassert (w->window_end_bytepos >= 0);
IF_DEBUG (debug_method_add (w, "C"));
debug_end_vpos = XFASTINT (w->window_end_vpos));
/* Record that display has not been completed. */
- WVAR (w, window_end_valid) = Qnil;
+ WSET (w, window_end_valid, Qnil);
w->desired_matrix->no_scrolling_p = 1;
return 3;
(Lisp_Object glyphs)
{
struct window *w = XWINDOW (selected_window);
- struct buffer *buffer = XBUFFER (WVAR (w, buffer));
+ struct buffer *buffer = XBUFFER (w->buffer);
fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n",
BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer));
(Lisp_Object row, Lisp_Object glyphs)
{
struct frame *sf = SELECTED_FRAME ();
- struct glyph_matrix *m = XWINDOW (FVAR (sf, tool_bar_window))->current_matrix;
+ struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix;
EMACS_INT vpos;
CHECK_NUMBER (row);
get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
- struct buffer *buffer = XBUFFER (WVAR (w, buffer));
+ struct buffer *buffer = XBUFFER (w->buffer);
struct buffer *old = current_buffer;
const unsigned char *arrow_string = SDATA (overlay_arrow_string);
int arrow_len = SCHARS (overlay_arrow_string);
}
/* Is IT->w showing the region? */
- WVAR (it->w, region_showing) = it->region_beg_charpos > 0 ? Qt : Qnil;
+ WSET (it->w, region_showing, it->region_beg_charpos > 0 ? Qt : Qnil);
/* Clear the result glyph row and enable it. */
prepare_desired_row (row);
row->glyphs[TEXT_AREA]->charpos = -1;
row->displays_text_p = 0;
- if (!NILP (BVAR (XBUFFER (WVAR (it->w, buffer)), indicate_empty_lines))
+ if (!NILP (BVAR (XBUFFER (it->w->buffer), indicate_empty_lines))
&& (!MINI_WINDOW_P (it->w)
|| (minibuf_level && EQ (it->window, minibuf_window))))
row->indicate_empty_line_p = 1;
/* Menu bar lines are displayed in the desired matrix of the
dummy window menu_bar_window. */
struct window *menu_w;
- eassert (WINDOWP (FVAR (f, menu_bar_window)));
- menu_w = XWINDOW (FVAR (f, menu_bar_window));
+ eassert (WINDOWP (f->menu_bar_window));
+ menu_w = XWINDOW (f->menu_bar_window);
init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows,
MENU_FACE_ID);
it.first_visible_x = 0;
{
struct window *w = XWINDOW (window);
- if (WINDOWP (WVAR (w, hchild)))
- nwindows += redisplay_mode_lines (WVAR (w, hchild), force);
- else if (WINDOWP (WVAR (w, vchild)))
- nwindows += redisplay_mode_lines (WVAR (w, vchild), force);
+ if (WINDOWP (w->hchild))
+ nwindows += redisplay_mode_lines (w->hchild, force);
+ else if (WINDOWP (w->vchild))
+ nwindows += redisplay_mode_lines (w->vchild, force);
else if (force
- || FRAME_GARBAGED_P (XFRAME (WVAR (w, frame)))
+ || FRAME_GARBAGED_P (XFRAME (w->frame))
|| !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p)
{
struct text_pos lpoint;
/* Set the window's buffer for the mode line display. */
SET_TEXT_POS (lpoint, PT, PT_BYTE);
- set_buffer_internal_1 (XBUFFER (WVAR (w, buffer)));
+ set_buffer_internal_1 (XBUFFER (w->buffer));
/* Point refers normally to the selected window. For any
other window, set up appropriate value. */
{
struct text_pos pt;
- SET_TEXT_POS_FROM_MARKER (pt, WVAR (w, pointm));
+ SET_TEXT_POS_FROM_MARKER (pt, w->pointm);
if (CHARPOS (pt) < BEGV)
TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
else if (CHARPOS (pt) > (ZV - 1))
TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
}
- window = WVAR (w, next);
+ window = w->next;
}
return nwindows;
int n = 0;
old_selected_frame = selected_frame;
- selected_frame = WVAR (w, frame);
+ selected_frame = w->frame;
old_selected_window = selected_window;
XSETWINDOW (selected_window, w);
/* These will be set while the mode line specs are processed. */
line_number_displayed = 0;
- WVAR (w, column_number_displayed) = Qnil;
+ WSET (w, column_number_displayed, Qnil);
if (WINDOW_WANTS_MODELINE_P (w))
{
w = XWINDOW (window);
if (NILP (buffer))
- buffer = WVAR (w, buffer);
+ buffer = w->buffer;
CHECK_BUFFER (buffer);
/* Make formatting the modeline a non-op when noninteractive, otherwise
else
{
ptrdiff_t col = current_column ();
- WVAR (w, column_number_displayed) = make_number (col);
+ WSET (w, column_number_displayed, make_number (col));
pint2str (decode_mode_spec_buf, field_width, col);
return decode_mode_spec_buf;
}
case 'F':
/* %F displays the frame name. */
- if (!NILP (FVAR (f, title)))
- return SSDATA (FVAR (f, title));
+ if (!NILP (f->title))
+ return SSDATA (f->title);
if (f->explicit_name || ! FRAME_WINDOW_P (f))
- return SSDATA (FVAR (f, name));
+ return SSDATA (f->name);
return "Emacs";
case 'f':
if (mode_line_target == MODE_LINE_TITLE)
return "";
- startpos = XMARKER (WVAR (w, start))->charpos;
- startpos_byte = marker_byte_position (WVAR (w, start));
+ startpos = XMARKER (w->start)->charpos;
+ startpos_byte = marker_byte_position (w->start);
height = WINDOW_TOTAL_LINES (w);
/* If we decided that this buffer isn't suitable for line numbers,
don't forget that too fast. */
- if (EQ (WVAR (w, base_line_pos), WVAR (w, buffer)))
+ if (EQ (w->base_line_pos, w->buffer))
goto no_value;
/* But do forget it, if the window shows a different buffer now. */
- else if (BUFFERP (WVAR (w, base_line_pos)))
- WVAR (w, base_line_pos) = Qnil;
+ else if (BUFFERP (w->base_line_pos))
+ WSET (w, base_line_pos, Qnil);
/* If the buffer is very big, don't waste time. */
if (INTEGERP (Vline_number_display_limit)
&& BUF_ZV (b) - BUF_BEGV (b) > XINT (Vline_number_display_limit))
{
- WVAR (w, base_line_pos) = Qnil;
- WVAR (w, base_line_number) = Qnil;
+ WSET (w, base_line_pos, Qnil);
+ WSET (w, base_line_number, Qnil);
goto no_value;
}
- if (INTEGERP (WVAR (w, base_line_number))
- && INTEGERP (WVAR (w, base_line_pos))
- && XFASTINT (WVAR (w, base_line_pos)) <= startpos)
+ if (INTEGERP (w->base_line_number)
+ && INTEGERP (w->base_line_pos)
+ && XFASTINT (w->base_line_pos) <= startpos)
{
- line = XFASTINT (WVAR (w, base_line_number));
- linepos = XFASTINT (WVAR (w, base_line_pos));
+ line = XFASTINT (w->base_line_number);
+ linepos = XFASTINT (w->base_line_pos);
linepos_byte = buf_charpos_to_bytepos (b, linepos);
}
else
go back past it. */
if (startpos == BUF_BEGV (b))
{
- WVAR (w, base_line_number) = make_number (topline);
- WVAR (w, base_line_pos) = make_number (BUF_BEGV (b));
+ WSET (w, base_line_number, make_number (topline));
+ WSET (w, base_line_pos, make_number (BUF_BEGV (b)));
}
else if (nlines < height + 25 || nlines > height * 3 + 50
|| linepos == BUF_BEGV (b))
give up on line numbers for this window. */
if (position == limit_byte && limit == startpos - distance)
{
- WVAR (w, base_line_pos) = WVAR (w, buffer);
- WVAR (w, base_line_number) = Qnil;
+ WSET (w, base_line_pos, w->buffer);
+ WSET (w, base_line_number, Qnil);
goto no_value;
}
- WVAR (w, base_line_number) = make_number (topline - nlines);
- WVAR (w, base_line_pos) = make_number (BYTE_TO_CHAR (position));
+ WSET (w, base_line_number, make_number (topline - nlines));
+ WSET (w, base_line_pos, make_number (BYTE_TO_CHAR (position)));
}
/* Now count lines from the start pos to point. */
case 'p':
{
- ptrdiff_t pos = marker_position (WVAR (w, start));
+ ptrdiff_t pos = marker_position (w->start);
ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
- if (XFASTINT (WVAR (w, window_end_pos)) <= BUF_Z (b) - BUF_ZV (b))
+ if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b))
{
if (pos <= BUF_BEGV (b))
return "All";
/* Display percentage of size above the bottom of the screen. */
case 'P':
{
- ptrdiff_t toppos = marker_position (WVAR (w, start));
- ptrdiff_t botpos = BUF_Z (b) - XFASTINT (WVAR (w, window_end_pos));
+ ptrdiff_t toppos = marker_position (w->start);
+ ptrdiff_t botpos = BUF_Z (b) - XFASTINT (w->window_end_pos);
ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
if (botpos >= BUF_ZV (b))
obj = Fget_buffer_process (Fcurrent_buffer ());
if (PROCESSP (obj))
{
- p = decode_mode_spec_coding (XPROCESS (obj)->decode_coding_system,
- p, eol_flag);
- p = decode_mode_spec_coding (XPROCESS (obj)->encode_coding_system,
- p, eol_flag);
+ p = decode_mode_spec_coding
+ (PGET (XPROCESS (obj), decode_coding_system), p, eol_flag);
+ p = decode_mode_spec_coding
+ (PGET (XPROCESS (obj), encode_coding_system), p, eol_flag);
}
#endif /* subprocesses */
#endif /* 0 */
return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w));
}
- prop = buffer_local_value_1 (prop, WVAR (it->w, buffer));
+ prop = buffer_local_value_1 (prop, it->w->buffer);
if (EQ (prop, Qunbound))
prop = Qnil;
}
return OK_PIXELS (pixels);
}
- car = buffer_local_value_1 (car, WVAR (it->w, buffer));
+ car = buffer_local_value_1 (car, it->w->buffer);
if (EQ (car, Qunbound))
car = Qnil;
}
{
memset (s, 0, sizeof *s);
s->w = w;
- s->f = XFRAME (WVAR (w, frame));
+ s->f = XFRAME (w->frame);
#ifdef HAVE_NTGUI
s->hdc = hdc;
#endif
int voffset;
int glyph_not_available_p;
- eassert (s->f == XFRAME (WVAR (s->w, frame)));
+ eassert (s->f == XFRAME (s->w->frame));
eassert (s->nchars == 0);
eassert (start >= 0 && end > start);
int n = width;
if (!STRINGP (object))
- object = WVAR (it->w, buffer);
+ object = it->w->buffer;
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (it->f))
append_stretch_glyph (it, object, width, height, ascent);
font_descent = FONT_DESCENT (font) - boff;
font_height = FONT_HEIGHT (font);
- cmp->font = (void *) font;
+ cmp->font = font;
pcm = NULL;
if (! font_not_found_p)
int from_x, from_y, to_y;
eassert (updated_window && updated_row);
- f = XFRAME (WVAR (w, frame));
+ f = XFRAME (w->frame);
if (updated_row->full_width_p)
max_x = WINDOW_TOTAL_WIDTH (w);
get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
int *active_cursor)
{
- struct frame *f = XFRAME (WVAR (w, frame));
- struct buffer *b = XBUFFER (WVAR (w, buffer));
+ struct frame *f = XFRAME (w->frame);
+ struct buffer *b = XBUFFER (w->buffer);
int cursor_type = DEFAULT_CURSOR;
Lisp_Object alt_cursor;
int non_selected = 0;
}
/* Detect a nonselected window or nonselected frame. */
- else if (w != XWINDOW (FVAR (f, selected_window))
+ else if (w != XWINDOW (f->selected_window)
|| f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)
{
*active_cursor = 0;
void
erase_phys_cursor (struct window *w)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
int hpos = w->phys_cursor.hpos;
int vpos = w->phys_cursor.vpos;
display_and_set_cursor (struct window *w, int on,
int hpos, int vpos, int x, int y)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
int new_cursor_type;
int new_cursor_width;
int active_cursor;
{
while (w)
{
- if (!NILP (WVAR (w, hchild)))
- update_cursor_in_window_tree (XWINDOW (WVAR (w, hchild)), on_p);
- else if (!NILP (WVAR (w, vchild)))
- update_cursor_in_window_tree (XWINDOW (WVAR (w, vchild)), on_p);
+ if (!NILP (w->hchild))
+ update_cursor_in_window_tree (XWINDOW (w->hchild), on_p);
+ else if (!NILP (w->vchild))
+ update_cursor_in_window_tree (XWINDOW (w->vchild), on_p);
else
update_window_cursor (w, on_p);
- w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
+ w = NILP (w->next) ? 0 : XWINDOW (w->next);
}
}
void
x_update_cursor (struct frame *f, int on_p)
{
- update_cursor_in_window_tree (XWINDOW (FVAR (f, root_window)), on_p);
+ update_cursor_in_window_tree (XWINDOW (f->root_window), on_p);
}
void
x_clear_cursor (struct window *w)
{
- if (FRAME_VISIBLE_P (XFRAME (WVAR (w, frame))) && w->phys_cursor_on_p)
+ if (FRAME_VISIBLE_P (XFRAME (w->frame)) && w->phys_cursor_on_p)
update_window_cursor (w, 0);
}
enum draw_glyphs_face draw)
{
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (XFRAME (WVAR (w, frame))))
+ if (FRAME_WINDOW_P (XFRAME (w->frame)))
{
draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0);
return;
if (FRAME_WINDOW_P (f))
{
if (draw == DRAW_NORMAL_TEXT
- && !EQ (hlinfo->mouse_face_window, FVAR (f, tool_bar_window)))
+ && !EQ (hlinfo->mouse_face_window, f->tool_bar_window))
FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
else if (draw == DRAW_MOUSE_FACE)
FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
static int
coords_in_mouse_face_p (struct window *w, int hpos, int vpos)
{
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame)));
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
/* Quickly resolve the easy cases. */
if (!(WINDOWP (hlinfo->mouse_face_window)
/* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */
rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2);
if (r1 == NULL)
- r1 = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos)));
+ r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
/* If the before-string or display-string contains newlines,
rows_from_pos_range skips to its last row. Move back. */
if (!NILP (before_string) || !NILP (disp_string))
}
if (r2 == NULL)
{
- r2 = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos)));
+ r2 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
hlinfo->mouse_face_past_end = 1;
}
else if (!NILP (after_string))
/* If the after-string has newlines, advance to its last row. */
struct glyph_row *next;
struct glyph_row *last
- = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos)));
+ = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
for (next = r2 + 1;
next <= last
enum window_part area)
{
struct window *w = XWINDOW (window);
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
#ifdef HAVE_WINDOW_SYSTEM
Display_Info *dpyinfo;
{
help_echo_string = help;
XSETWINDOW (help_echo_window, w);
- help_echo_object = WVAR (w, buffer);
+ help_echo_object = w->buffer;
help_echo_pos = charpos;
}
}
{
Lisp_Object default_help
= buffer_local_value_1 (Qmode_line_default_help_echo,
- WVAR (w, buffer));
+ w->buffer);
if (STRINGP (default_help))
{
#ifdef HAVE_WINDOW_SYSTEM
/* Handle tool-bar window differently since it doesn't display a
buffer. */
- if (EQ (window, FVAR (f, tool_bar_window)))
+ if (EQ (window, f->tool_bar_window))
{
note_tool_bar_highlight (f, x, y);
return;
/* Are we in a window whose display is up to date?
And verify the buffer's text has not changed. */
- b = XBUFFER (WVAR (w, buffer));
+ b = XBUFFER (w->buffer);
if (part == ON_TEXT
- && EQ (WVAR (w, window_end_valid), WVAR (w, buffer))
+ && EQ (w->window_end_valid, w->buffer)
&& w->last_modified == BUF_MODIFF (b)
&& w->last_overlay_modified == BUF_OVERLAY_MODIFF (b))
{
if (pos > 0)
{
mouse_face = get_char_property_and_overlay
- (make_number (pos), Qmouse_face, WVAR (w, buffer), &overlay);
- buffer = WVAR (w, buffer);
+ (make_number (pos), Qmouse_face, w->buffer, &overlay);
+ buffer = w->buffer;
disp_string = object;
}
}
is the smallest. */
Lisp_Object lim1 =
NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
- ? Fmarker_position (WVAR (w, start))
+ ? Fmarker_position (w->start)
: Qnil;
Lisp_Object lim2 =
NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
? make_number (BUF_Z (XBUFFER (buffer))
- - XFASTINT (WVAR (w, window_end_pos)))
+ - XFASTINT (w->window_end_pos))
: Qnil;
if (NILP (overlay))
if (p > 0)
{
help = Fget_char_property (make_number (p),
- Qhelp_echo, WVAR (w, buffer));
+ Qhelp_echo, w->buffer);
if (!NILP (help))
{
charpos = p;
- obj = WVAR (w, buffer);
+ obj = w->buffer;
}
}
}
ptrdiff_t p = string_buffer_position (obj, start);
if (p > 0)
pointer = Fget_char_property (make_number (p),
- Qpointer, WVAR (w, buffer));
+ Qpointer, w->buffer);
}
}
else if (BUFFERP (obj)
void
x_clear_window_mouse_face (struct window *w)
{
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame)));
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
Lisp_Object window;
BLOCK_INPUT;
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
window = hlinfo->mouse_face_window;
- if (! NILP (window) && XFRAME (WVAR (XWINDOW (window), frame)) == f)
+ if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f)
{
hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
do it for frames with vertical scroll bars because either the
right scroll bar of a window, or the left scroll bar of its
neighbor will suffice as a border. */
- if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WVAR (w, frame))))
+ if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame)))
return;
if (!WINDOW_RIGHTMOST_P (w)
static int
expose_window (struct window *w, XRectangle *fr)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
XRectangle wr, r;
int mouse_face_overwritten_p = 0;
static int
expose_window_tree (struct window *w, XRectangle *r)
{
- struct frame *f = XFRAME (WVAR (w, frame));
+ struct frame *f = XFRAME (w->frame);
int mouse_face_overwritten_p = 0;
while (w && !FRAME_GARBAGED_P (f))
{
- if (!NILP (WVAR (w, hchild)))
+ if (!NILP (w->hchild))
mouse_face_overwritten_p
- |= expose_window_tree (XWINDOW (WVAR (w, hchild)), r);
- else if (!NILP (WVAR (w, vchild)))
+ |= expose_window_tree (XWINDOW (w->hchild), r);
+ else if (!NILP (w->vchild))
mouse_face_overwritten_p
- |= expose_window_tree (XWINDOW (WVAR (w, vchild)), r);
+ |= expose_window_tree (XWINDOW (w->vchild), r);
else
mouse_face_overwritten_p |= expose_window (w, r);
- w = NILP (WVAR (w, next)) ? NULL : XWINDOW (WVAR (w, next));
+ w = NILP (w->next) ? NULL : XWINDOW (w->next);
}
return mouse_face_overwritten_p;
}
TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height));
- mouse_face_overwritten_p = expose_window_tree (XWINDOW (FVAR (f, root_window)), &r);
+ mouse_face_overwritten_p = expose_window_tree (XWINDOW (f->root_window), &r);
- if (WINDOWP (FVAR (f, tool_bar_window)))
+ if (WINDOWP (f->tool_bar_window))
mouse_face_overwritten_p
- |= expose_window (XWINDOW (FVAR (f, tool_bar_window)), &r);
+ |= expose_window (XWINDOW (f->tool_bar_window), &r);
#ifdef HAVE_X_WINDOWS
#ifndef MSDOS
#ifndef USE_X_TOOLKIT
- if (WINDOWP (FVAR (f, menu_bar_window)))
+ if (WINDOWP (f->menu_bar_window))
mouse_face_overwritten_p
- |= expose_window (XWINDOW (FVAR (f, menu_bar_window)), &r);
+ |= expose_window (XWINDOW (f->menu_bar_window), &r);
#endif /* not USE_X_TOOLKIT */
#endif
#endif
if (!noninteractive)
{
struct window *m = XWINDOW (minibuf_window);
- Lisp_Object frame = WVAR (m, frame);
+ Lisp_Object frame = m->frame;
struct frame *f = XFRAME (frame);
Lisp_Object root = FRAME_ROOT_WINDOW (f);
struct window *r = XWINDOW (root);
echo_area_window = minibuf_window;
- XSETFASTINT (WVAR (r, top_line), FRAME_TOP_MARGIN (f));
- XSETFASTINT (WVAR (r, total_lines), FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f));
- XSETFASTINT (WVAR (r, total_cols), FRAME_COLS (f));
- XSETFASTINT (WVAR (m, top_line), FRAME_LINES (f) - 1);
- XSETFASTINT (WVAR (m, total_lines), 1);
- XSETFASTINT (WVAR (m, total_cols), FRAME_COLS (f));
+ WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f)));
+ WSET (r, total_lines, make_number (FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f)));
+ WSET (r, total_cols, make_number (FRAME_COLS (f)));
+ WSET (m, top_line, make_number (FRAME_LINES (f) - 1));
+ WSET (m, total_lines, make_number (1));
+ WSET (m, total_cols, make_number (FRAME_COLS (f)));
scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs;
scratch_glyph_row.glyphs[TEXT_AREA + 1]