* window.h (struct window): Replace hchild, vchild and buffer slots

with the only contents slot.  This is possible because each valid
window may have either the child window (in vertical or horizontal
combination) or buffer to display (for the leaf window).  Using that,
a lof of operations to traverse and/or change window hierarchies may
be simplified.  New member horizontal is used to distinguish between
horizontal and vertical combinations of internal windows.
(WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
(WINDOW_VERTICAL_COMBINATION_P): New macros.
(WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
* window.c (wset_hchild, wset_vchild): Remove.  Adjust all users.
Use contents slot, not buffer, where appropriate.
(wset_combination): New function.
(wset_buffer): Add eassert.
(Fframe_first_window): Simplify the loop reaching first window.
(Fwindow_buffer): Use WINDOW_LEAF_P.
(Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
(Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
(unshow_buffer): Convert initial debugging check to eassert.
(replace_window, recombine_windows, Fdelete_other_windows_internal)
(make_parent_window, window_resize_check, window_resize_apply)
(resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
(Fset_window_configuration, delete_all_child_windows, save_window_save):
Adjust to match struct window changes.
(window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
(mark_window_cursors_off, count_windows, get_leaf_windows)
(foreach_window_1): Simplify the loop.
* alloc.c (mark_object): Do not check for the leaf window because
internal windows has no glyph matrices anyway.
* dispnew.c (clear_window_matrices, showing_window_margins_p)
(allocate_matrices_for_window_redisplay, fake_current_matrices)
(allocate_matrices_for_frame_redisplay, free_window_matrices)
(build_frame_matrix_from_window_tree, mirror_make_current)
(frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
(update_window_tree, set_window_update_flags): Simplify the loop.
(sync_window_with_frame_matrix_rows): Enforce live window.
Use contents slot, not buffer, where appropriate.
* frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
and WINDOW_HORIZONTAL_COMBINATION_P.
(make_frame_visible_1): Simplify the loop.
Use contents slot, not buffer, where appropriate.
* xdisp.c (hscroll_window_tree, mark_window_display_accurate)
(redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
(expose_window_tree): Likewise.
Use contents slot, not buffer, where appropriate.
* textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
to avoid deleted windows.  Use contents slot instead of buffer.
* buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
* indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
* nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
* xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
This commit is contained in:
Dmitry Antipov 2013-03-28 18:04:49 +04:00
parent 9d42d31f24
commit e74aeda863
29 changed files with 525 additions and 584 deletions

View file

@ -1,3 +1,57 @@
2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
* window.h (struct window): Replace hchild, vchild and buffer slots
with the only contents slot. This is possible because each valid
window may have either the child window (in vertical or horizontal
combination) or buffer to display (for the leaf window). Using that,
a lof of operations to traverse and/or change window hierarchies may
be simplified. New member horizontal is used to distinguish between
horizontal and vertical combinations of internal windows.
(WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
(WINDOW_VERTICAL_COMBINATION_P): New macros.
(WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
* window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
Use contents slot, not buffer, where appropriate.
(wset_combination): New function.
(wset_buffer): Add eassert.
(Fframe_first_window): Simplify the loop reaching first window.
(Fwindow_buffer): Use WINDOW_LEAF_P.
(Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
(Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
(unshow_buffer): Convert initial debugging check to eassert.
(replace_window, recombine_windows, Fdelete_other_windows_internal)
(make_parent_window, window_resize_check, window_resize_apply)
(resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
(Fset_window_configuration, delete_all_child_windows, save_window_save):
Adjust to match struct window changes.
(window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
(mark_window_cursors_off, count_windows, get_leaf_windows)
(foreach_window_1): Simplify the loop.
* alloc.c (mark_object): Do not check for the leaf window because
internal windows has no glyph matrices anyway.
* dispnew.c (clear_window_matrices, showing_window_margins_p)
(allocate_matrices_for_window_redisplay, fake_current_matrices)
(allocate_matrices_for_frame_redisplay, free_window_matrices)
(build_frame_matrix_from_window_tree, mirror_make_current)
(frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
(update_window_tree, set_window_update_flags): Simplify the loop.
(sync_window_with_frame_matrix_rows): Enforce live window.
Use contents slot, not buffer, where appropriate.
* frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
and WINDOW_HORIZONTAL_COMBINATION_P.
(make_frame_visible_1): Simplify the loop.
Use contents slot, not buffer, where appropriate.
* xdisp.c (hscroll_window_tree, mark_window_display_accurate)
(redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
(expose_window_tree): Likewise.
Use contents slot, not buffer, where appropriate.
* textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
to avoid deleted windows. Use contents slot instead of buffer.
* buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
* indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
* nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
* xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
2013-03-28 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help

View file

@ -5810,14 +5810,13 @@ mark_object (Lisp_Object arg)
case PVEC_WINDOW:
{
struct window *w = (struct window *) ptr;
bool leaf = NILP (w->hchild) && NILP (w->vchild);
mark_vectorlike (ptr);
/* Mark glyphs for leaf windows. Marking window
/* Mark glyph matrices, if any. Marking window
matrices is sufficient because frame matrices
use the same glyph memory. */
if (leaf && w->current_matrix)
if (w->current_matrix)
{
mark_glyph_matrix (w->current_matrix);
mark_glyph_matrix (w->desired_matrix);

View file

@ -1769,7 +1769,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
since anything can happen within do_yes_or_no_p. */
/* Don't kill the minibuffer now current. */
if (EQ (buffer, XWINDOW (minibuf_window)->buffer))
if (EQ (buffer, XWINDOW (minibuf_window)->contents))
return Qnil;
/* When we kill an ordinary buffer which shares it's buffer text
@ -1820,7 +1820,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
/* If the buffer now current is shown in the minibuffer and our buffer
is the sole other buffer give up. */
XSETBUFFER (tem, current_buffer);
if (EQ (tem, XWINDOW (minibuf_window)->buffer)
if (EQ (tem, XWINDOW (minibuf_window)->contents)
&& EQ (buffer, Fother_buffer (buffer, Qnil, Qnil)))
return Qnil;
@ -2406,19 +2406,19 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
{
ws = Fcons (w, ws);
if (MARKERP (XWINDOW (w)->pointm)
&& (EQ (XWINDOW (w)->buffer, buf1)
|| EQ (XWINDOW (w)->buffer, buf2)))
&& (EQ (XWINDOW (w)->contents, buf1)
|| EQ (XWINDOW (w)->contents, buf2)))
Fset_marker (XWINDOW (w)->pointm,
make_number
(BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))),
XWINDOW (w)->buffer);
(BUF_BEGV (XBUFFER (XWINDOW (w)->contents))),
XWINDOW (w)->contents);
if (MARKERP (XWINDOW (w)->start)
&& (EQ (XWINDOW (w)->buffer, buf1)
|| EQ (XWINDOW (w)->buffer, buf2)))
&& (EQ (XWINDOW (w)->contents, buf1)
|| EQ (XWINDOW (w)->contents, buf2)))
Fset_marker (XWINDOW (w)->start,
make_number
(XBUFFER (XWINDOW (w)->buffer)->last_window_start),
XWINDOW (w)->buffer);
(XBUFFER (XWINDOW (w)->contents)->last_window_start),
XWINDOW (w)->contents);
w = Fnext_window (w, Qt, Qt);
}
}
@ -3901,7 +3901,7 @@ modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
if (buffer_window_count (buf) > 0)
{
/* ... it's visible in other window than selected, */
if (buf != XBUFFER (XWINDOW (selected_window)->buffer))
if (buf != XBUFFER (XWINDOW (selected_window)->contents))
windows_or_buffers_changed = 1;
/* ... or if we modify an overlay at the end of the buffer
and so we cannot be sure that window end is still valid. */

View file

@ -1412,25 +1412,24 @@ struct glyph_string
/* Value is non-zero if window W wants a mode line. */
#define WINDOW_WANTS_MODELINE_P(W) \
(!MINI_WINDOW_P ((W)) \
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP (W->buffer) \
&& !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \
&& WINDOW_TOTAL_LINES (W) > 1)
#define WINDOW_WANTS_MODELINE_P(W) \
(!MINI_WINDOW_P ((W)) \
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP (W->contents) \
&& !NILP (BVAR (XBUFFER (W->contents), mode_line_format)) \
&& WINDOW_TOTAL_LINES (W) > 1)
/* Value is true if window W wants a header line. */
#define WINDOW_WANTS_HEADER_LINE_P(W) \
(!MINI_WINDOW_P ((W)) \
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP (W->buffer) \
&& !NILP (BVAR (XBUFFER (W->buffer), header_line_format)) \
&& WINDOW_TOTAL_LINES (W) > 1 \
+ !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)))
#define WINDOW_WANTS_HEADER_LINE_P(W) \
(!MINI_WINDOW_P ((W)) \
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP (W->contents) \
&& !NILP (BVAR (XBUFFER (W->contents), header_line_format)) \
&& WINDOW_TOTAL_LINES (W) > 1 \
+ !NILP (BVAR (XBUFFER (W->contents), mode_line_format)))
/* Return proper value to be used as baseline offset of font that has
ASCENT and DESCENT to draw characters by the font at the vertical

View file

@ -223,9 +223,9 @@ add_window_display_history (struct window *w, const char *msg, bool paused_p)
"%"pMu": window %p (`%s')%s\n%s",
history_tick++,
w,
((BUFFERP (w->buffer)
&& STRINGP (BVAR (XBUFFER (w->buffer), name)))
? SSDATA (BVAR (XBUFFER (w->buffer), name))
((BUFFERP (w->contents)
&& STRINGP (BVAR (XBUFFER (w->contents), name)))
? SSDATA (BVAR (XBUFFER (w->contents), name))
: "???"),
paused_p ? " ***paused***" : "",
msg);
@ -842,16 +842,8 @@ clear_window_matrices (struct window *w, bool desired_p)
{
while (w)
{
if (!NILP (w->hchild))
{
eassert (WINDOWP (w->hchild));
clear_window_matrices (XWINDOW (w->hchild), desired_p);
}
else if (!NILP (w->vchild))
{
eassert (WINDOWP (w->vchild));
clear_window_matrices (XWINDOW (w->vchild), desired_p);
}
if (WINDOWP (w->contents))
clear_window_matrices (XWINDOW (w->contents), desired_p);
else
{
if (desired_p)
@ -1472,7 +1464,7 @@ check_matrix_invariants (struct window *w)
struct glyph_row *row = matrix->rows;
struct glyph_row *last_text_row = NULL;
struct buffer *saved = current_buffer;
struct buffer *buffer = XBUFFER (w->buffer);
struct buffer *buffer = XBUFFER (w->contents);
int c;
/* This can sometimes happen for a fresh window. */
@ -1636,7 +1628,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
vertically below other windows. */
in_horz_combination_p
= (!NILP (XWINDOW (window)->parent)
&& !NILP (XWINDOW (XWINDOW (window)->parent)->hchild));
&& WINDOW_HORIZONTAL_COMBINATION_P (XWINDOW (XWINDOW (window)->parent)));
/* For WINDOW and all windows on the same level. */
do
@ -1645,12 +1637,8 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
/* Get the dimension of the window sub-matrix for W, depending
on whether this is a combination or a leaf window. */
if (!NILP (w->hchild))
dim = allocate_matrices_for_frame_redisplay (w->hchild, x, y,
dim_only_p,
window_change_flags);
else if (!NILP (w->vchild))
dim = allocate_matrices_for_frame_redisplay (w->vchild, x, y,
if (WINDOWP (w->contents))
dim = allocate_matrices_for_frame_redisplay (w->contents, x, y,
dim_only_p,
window_change_flags);
else
@ -1792,10 +1780,8 @@ allocate_matrices_for_window_redisplay (struct window *w)
{
while (w)
{
if (!NILP (w->vchild))
allocate_matrices_for_window_redisplay (XWINDOW (w->vchild));
else if (!NILP (w->hchild))
allocate_matrices_for_window_redisplay (XWINDOW (w->hchild));
if (WINDOWP (w->contents))
allocate_matrices_for_window_redisplay (XWINDOW (w->contents));
else
{
/* W is a leaf window. */
@ -1867,18 +1853,12 @@ showing_window_margins_p (struct window *w)
{
while (w)
{
if (!NILP (w->hchild))
if (WINDOWP (w->contents))
{
if (showing_window_margins_p (XWINDOW (w->hchild)))
if (showing_window_margins_p (XWINDOW (w->contents)))
return 1;
}
else if (!NILP (w->vchild))
{
if (showing_window_margins_p (XWINDOW (w->vchild)))
return 1;
}
else if (!NILP (w->left_margin_cols)
|| !NILP (w->right_margin_cols))
else if (!NILP (w->left_margin_cols) || !NILP (w->right_margin_cols))
return 1;
w = NILP (w->next) ? 0 : XWINDOW (w->next);
@ -1899,10 +1879,8 @@ fake_current_matrices (Lisp_Object window)
{
w = XWINDOW (window);
if (!NILP (w->hchild))
fake_current_matrices (w->hchild);
else if (!NILP (w->vchild))
fake_current_matrices (w->vchild);
if (WINDOWP (w->contents))
fake_current_matrices (w->contents);
else
{
int i;
@ -2242,10 +2220,8 @@ free_window_matrices (struct window *w)
{
while (w)
{
if (!NILP (w->hchild))
free_window_matrices (XWINDOW (w->hchild));
else if (!NILP (w->vchild))
free_window_matrices (XWINDOW (w->vchild));
if (WINDOWP (w->contents))
free_window_matrices (XWINDOW (w->contents));
else
{
/* This is a leaf window. Free its memory and reset fields
@ -2378,10 +2354,8 @@ build_frame_matrix_from_window_tree (struct glyph_matrix *matrix, struct window
{
while (w)
{
if (!NILP (w->hchild))
build_frame_matrix_from_window_tree (matrix, XWINDOW (w->hchild));
else if (!NILP (w->vchild))
build_frame_matrix_from_window_tree (matrix, XWINDOW (w->vchild));
if (WINDOWP (w->contents))
build_frame_matrix_from_window_tree (matrix, XWINDOW (w->contents));
else
build_frame_matrix_from_leaf_window (matrix, w);
@ -2645,10 +2619,8 @@ mirror_make_current (struct window *w, int frame_row)
{
while (w)
{
if (!NILP (w->hchild))
mirror_make_current (XWINDOW (w->hchild), frame_row);
else if (!NILP (w->vchild))
mirror_make_current (XWINDOW (w->vchild), frame_row);
if (WINDOWP (w->contents))
mirror_make_current (XWINDOW (w->contents), frame_row);
else
{
/* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS
@ -2744,8 +2716,8 @@ sync_window_with_frame_matrix_rows (struct window *w)
struct glyph_row *window_row, *window_row_end, *frame_row;
int left, right, x, width;
/* Preconditions: W must be a leaf window on a tty frame. */
eassert (NILP (w->hchild) && NILP (w->vchild));
/* Preconditions: W must be a live window on a tty frame. */
eassert (BUFFERP (w->contents));
eassert (!FRAME_WINDOW_P (f));
left = margin_glyphs_to_reserve (w, 1, w->left_margin_cols);
@ -2781,10 +2753,8 @@ frame_row_to_window (struct window *w, int row)
while (w && !found)
{
if (!NILP (w->hchild))
found = frame_row_to_window (XWINDOW (w->hchild), row);
else if (!NILP (w->vchild))
found = frame_row_to_window (XWINDOW (w->vchild), row);
if (WINDOWP (w->contents))
found = frame_row_to_window (XWINDOW (w->contents), row);
else if (row >= WINDOW_TOP_EDGE_LINE (w)
&& row < WINDOW_BOTTOM_EDGE_LINE (w))
found = w;
@ -2812,11 +2782,8 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
{
while (w)
{
if (!NILP (w->hchild))
mirror_line_dance (XWINDOW (w->hchild), unchanged_at_top,
nlines, copy_from, retained_p);
else if (!NILP (w->vchild))
mirror_line_dance (XWINDOW (w->vchild), unchanged_at_top,
if (WINDOWP (w->contents))
mirror_line_dance (XWINDOW (w->contents), unchanged_at_top,
nlines, copy_from, retained_p);
else
{
@ -2925,10 +2892,8 @@ check_window_matrix_pointers (struct window *w)
{
while (w)
{
if (!NILP (w->hchild))
check_window_matrix_pointers (XWINDOW (w->hchild));
else if (!NILP (w->vchild))
check_window_matrix_pointers (XWINDOW (w->vchild));
if (WINDOWP (w->contents))
check_window_matrix_pointers (XWINDOW (w->contents));
else
{
struct frame *f = XFRAME (w->frame);
@ -3194,10 +3159,8 @@ update_window_tree (struct window *w, bool force_p)
while (w && !paused_p)
{
if (!NILP (w->hchild))
paused_p |= update_window_tree (XWINDOW (w->hchild), force_p);
else if (!NILP (w->vchild))
paused_p |= update_window_tree (XWINDOW (w->vchild), force_p);
if (WINDOWP (w->contents))
paused_p |= update_window_tree (XWINDOW (w->contents), force_p);
else if (w->must_be_updated_p)
paused_p |= update_window (w, force_p);
@ -3975,10 +3938,8 @@ set_window_update_flags (struct window *w, bool on_p)
{
while (w)
{
if (!NILP (w->hchild))
set_window_update_flags (XWINDOW (w->hchild), on_p);
else if (!NILP (w->vchild))
set_window_update_flags (XWINDOW (w->vchild), on_p);
if (WINDOWP (w->contents))
set_window_update_flags (XWINDOW (w->contents), on_p);
else
w->must_be_updated_p = on_p;
@ -5125,7 +5086,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
/* We used to set current_buffer directly here, but that does the
wrong thing with `face-remapping-alist' (bug#2044). */
Fset_buffer (w->buffer);
Fset_buffer (w->contents);
itdata = bidi_shelve_cache ();
SET_TEXT_POS_FROM_MARKER (startp, w->start);
CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
@ -5171,7 +5132,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
*dx = x0 + it.first_visible_x - it.current_x;
*dy = *y - it.current_y;
string = w->buffer;
string = w->contents;
if (STRINGP (it.string))
string = it.string;
*pos = it.current;
@ -5189,7 +5150,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
if (STRINGP (it.string))
BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos));
else
BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer),
BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->contents),
CHARPOS (pos->pos));
}

View file

@ -373,7 +373,7 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o
if (NILP (object))
XSETBUFFER (object, current_buffer);
else if (WINDOWP (object))
object = XWINDOW (object)->buffer;
object = XWINDOW (object)->contents;
if (!BUFFERP (object))
/* pos-property only makes sense in buffers right now, since strings
@ -846,7 +846,7 @@ save_excursion_save (void)
? Fcopy_marker (BVAR (current_buffer, mark), Qnil)
: Qnil),
/* Selected window if current buffer is shown in it, nil otherwise. */
(EQ (XWINDOW (selected_window)->buffer, Fcurrent_buffer ())
(EQ (XWINDOW (selected_window)->contents, Fcurrent_buffer ())
? selected_window : Qnil),
BVAR (current_buffer, mark_active));
}
@ -915,7 +915,7 @@ save_excursion_restore (Lisp_Object info)
tem = XSAVE_OBJECT (info, 2);
if (WINDOWP (tem)
&& !EQ (tem, selected_window)
&& (tem1 = XWINDOW (tem)->buffer,
&& (tem1 = XWINDOW (tem)->contents,
(/* Window is live... */
BUFFERP (tem1)
/* ...and it shows the current buffer. */

View file

@ -3958,7 +3958,7 @@ by calling `format-decode', which see. */)
/* If display currently starts at beginning of line,
keep it that way. */
if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
if (XBUFFER (XWINDOW (selected_window)->contents) == current_buffer)
XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
replace_handled = 1;
@ -4108,7 +4108,7 @@ by calling `format-decode', which see. */)
/* If display currently starts at beginning of line,
keep it that way. */
if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
if (XBUFFER (XWINDOW (selected_window)->contents) == current_buffer)
XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
/* Replace the chars that we need to replace,

View file

@ -4761,7 +4761,7 @@ character at index specified by POSITION. */)
if (NILP (string))
{
if (XBUFFER (w->buffer) != current_buffer)
if (XBUFFER (w->contents) != current_buffer)
error ("Specified window is not displaying the current buffer.");
CHECK_NUMBER_COERCE_MARKER (position);
if (! (BEGV <= XINT (position) && XINT (position) < ZV))

View file

@ -159,15 +159,15 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
w->total_lines -= n;
/* Handle just the top child in a vertical split. */
if (!NILP (w->vchild))
set_menu_bar_lines_1 (w->vchild, n);
/* Adjust all children in a horizontal split. */
for (window = w->hchild; !NILP (window); window = w->next)
{
w = XWINDOW (window);
set_menu_bar_lines_1 (window, n);
}
if (WINDOW_VERTICAL_COMBINATION_P (w))
set_menu_bar_lines_1 (w->contents, n);
else if (WINDOW_HORIZONTAL_COMBINATION_P (w))
/* Adjust all children in a horizontal split. */
for (window = w->contents; !NILP (window); window = w->next)
{
w = XWINDOW (window);
set_menu_bar_lines_1 (window, n);
}
}
void
@ -421,7 +421,7 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
/* Make the chosen minibuffer window display the proper minibuffer,
unless it is already showing a minibuffer. */
if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list)))
if (NILP (Fmemq (XWINDOW (mini_window)->contents, Vminibuffer_list)))
/* Use set_window_buffer instead of Fset_window_buffer (see
discussion of bug#11984, bug#12025, bug#12026). */
set_window_buffer (mini_window,
@ -1189,7 +1189,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
/* Use set_window_buffer instead of Fset_window_buffer (see
discussion of bug#11984, bug#12025, bug#12026). */
set_window_buffer (sf->minibuffer_window,
XWINDOW (minibuf_window)->buffer, 0, 0);
XWINDOW (minibuf_window)->contents, 0, 0);
minibuf_window = sf->minibuffer_window;
/* If the dying minibuffer window was selected,
@ -1593,17 +1593,13 @@ make_frame_visible_1 (Lisp_Object window)
{
struct window *w;
for (;!NILP (window); window = w->next)
for (; !NILP (window); window = w->next)
{
w = XWINDOW (window);
if (!NILP (w->buffer))
bset_display_time (XBUFFER (w->buffer), Fcurrent_time ());
if (!NILP (w->vchild))
make_frame_visible_1 (w->vchild);
if (!NILP (w->hchild))
make_frame_visible_1 (w->hchild);
if (WINDOWP (w->contents))
make_frame_visible_1 (w->contents);
else
bset_display_time (XBUFFER (w->contents), Fcurrent_time ());
}
}
@ -1634,7 +1630,7 @@ displayed in the terminal. */)
/* Use set_window_buffer instead of Fset_window_buffer (see
discussion of bug#11984, bug#12025, bug#12026). */
set_window_buffer (sf->minibuffer_window,
XWINDOW (minibuf_window)->buffer, 0, 0);
XWINDOW (minibuf_window)->contents, 0, 0);
minibuf_window = sf->minibuffer_window;
}
@ -1665,7 +1661,7 @@ If omitted, FRAME defaults to the currently selected frame. */)
/* Use set_window_buffer instead of Fset_window_buffer (see
discussion of bug#11984, bug#12025, bug#12026). */
set_window_buffer (sf->minibuffer_window,
XWINDOW (minibuf_window)->buffer, 0, 0);
XWINDOW (minibuf_window)->contents, 0, 0);
minibuf_window = sf->minibuffer_window;
}

View file

@ -699,7 +699,7 @@ get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor)
{
Lisp_Object cmap, bm = Qnil;
if ((cmap = BVAR (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap))
if ((cmap = BVAR (XBUFFER (w->contents), fringe_cursor_alist)), !NILP (cmap))
{
bm = Fassq (cursor, cmap);
if (CONSP (bm))
@ -736,7 +736,7 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in
If partial, lookup partial bitmap in default value if not found here.
If not partial, or no partial spec is present, use non-partial bitmap. */
if ((cmap = BVAR (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap))
if ((cmap = BVAR (XBUFFER (w->contents), fringe_indicator_alist)), !NILP (cmap))
{
bm1 = Fassq (bitmap, cmap);
if (CONSP (bm1))
@ -963,7 +963,7 @@ update_window_fringes (struct window *w, int keep_current_p)
return 0;
if (!MINI_WINDOW_P (w)
&& (ind = BVAR (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind)))
&& (ind = BVAR (XBUFFER (w->contents), indicate_buffer_boundaries), !NILP (ind)))
{
if (EQ (ind, Qleft) || EQ (ind, Qright))
boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
@ -1004,7 +1004,7 @@ update_window_fringes (struct window *w, int keep_current_p)
{
if (top_ind_rn < 0 && row->visible_height > 0)
{
if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))
if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->contents))
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
row->indicate_bob_p = !NILP (boundary_top);
else
@ -1014,7 +1014,7 @@ update_window_fringes (struct window *w, int keep_current_p)
if (bot_ind_rn < 0)
{
if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))
if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->contents))
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row))
row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn;
else if (y + row->height >= yb)
@ -1024,7 +1024,7 @@ update_window_fringes (struct window *w, int keep_current_p)
}
}
empty_pos = BVAR (XBUFFER (w->buffer), indicate_empty_lines);
empty_pos = BVAR (XBUFFER (w->contents), indicate_empty_lines);
if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;

View file

@ -254,7 +254,7 @@ skip_invisible (ptrdiff_t pos, ptrdiff_t *next_boundary_p, ptrdiff_t to, Lisp_Ob
the next property change */
prop = Fget_char_property (position, Qinvisible,
(!NILP (window)
&& EQ (XWINDOW (window)->buffer, buffer))
&& EQ (XWINDOW (window)->contents, buffer))
? window : buffer);
inv_p = TEXT_PROP_MEANS_INVISIBLE (prop);
/* When counting columns (window == nil), don't skip over ellipsis text. */
@ -1826,7 +1826,7 @@ vmotion (register ptrdiff_t from, register ptrdiff_t from_byte,
/* If the window contains this buffer, use it for getting text properties.
Otherwise use the current buffer as arg for doing that. */
if (EQ (w->buffer, Fcurrent_buffer ()))
if (EQ (w->contents, Fcurrent_buffer ()))
text_prop_object = window;
else
text_prop_object = Fcurrent_buffer ();
@ -1979,14 +1979,14 @@ whether or not it is currently displayed in some window. */)
old_buffer = Qnil;
GCPRO1 (old_buffer);
if (XBUFFER (w->buffer) != current_buffer)
if (XBUFFER (w->contents) != current_buffer)
{
/* Set the window's buffer temporarily to the current buffer. */
old_buffer = w->buffer;
old_buffer = w->contents;
old_charpos = marker_position (w->pointm);
old_bytepos = marker_byte_position (w->pointm);
wset_buffer (w, Fcurrent_buffer ());
set_marker_both (w->pointm, w->buffer,
set_marker_both (w->pointm, w->contents,
BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));
}
@ -2139,7 +2139,7 @@ whether or not it is currently displayed in some window. */)
if (BUFFERP (old_buffer))
{
wset_buffer (w, old_buffer);
set_marker_both (w->pointm, w->buffer,
set_marker_both (w->pointm, w->contents,
old_charpos, old_bytepos);
}

View file

@ -1798,7 +1798,7 @@ prepare_to_modify_buffer (ptrdiff_t start, ptrdiff_t end,
/* If we're modifying the buffer other than shown in a selected window,
let redisplay consider other windows if this buffer is visible. */
if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer
if (XBUFFER (XWINDOW (selected_window)->contents) != current_buffer
&& buffer_window_count (current_buffer))
++windows_or_buffers_changed;

View file

@ -833,7 +833,7 @@ This function is called by the editor initialization to begin editing. */)
update_mode_lines = 1;
if (command_loop_level
&& current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
&& current_buffer != XBUFFER (XWINDOW (selected_window)->contents))
buffer = Fcurrent_buffer ();
else
buffer = Qnil;
@ -1395,7 +1395,7 @@ command_loop_1 (void)
Fkill_emacs (Qnil);
/* Make sure the current window's buffer is selected. */
set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
set_buffer_internal (XBUFFER (XWINDOW (selected_window)->contents));
/* Display any malloc warning that just came out. Use while because
displaying one warning can cause another. */
@ -1461,7 +1461,7 @@ command_loop_1 (void)
/* A filter may have run while we were reading the input. */
if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
set_buffer_internal (XBUFFER (XWINDOW (selected_window)->contents));
++num_input_keys;
@ -1492,7 +1492,7 @@ command_loop_1 (void)
{
struct buffer *b;
XWINDOW (selected_window)->force_start = 0;
b = XBUFFER (XWINDOW (selected_window)->buffer);
b = XBUFFER (XWINDOW (selected_window)->contents);
BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0;
}
@ -5142,7 +5142,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
if (STRINGP (string))
string_info = Fcons (string, make_number (charpos));
textpos = (w == XWINDOW (selected_window)
&& current_buffer == XBUFFER (w->buffer))
&& current_buffer == XBUFFER (w->contents))
? PT : marker_position (w->pointm);
xret = wx;
@ -9145,9 +9145,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
{
if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
if (XBUFFER (XWINDOW (selected_window)->buffer)
if (XBUFFER (XWINDOW (selected_window)->contents)
!= current_buffer)
Fset_buffer (XWINDOW (selected_window)->buffer);
Fset_buffer (XWINDOW (selected_window)->contents);
}
goto replay_sequence;
@ -9195,9 +9195,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
special-event-map, ...) might have switched the current buffer
or the selected window from under us in the mean time. */
if (fix_current_buffer
&& (XBUFFER (XWINDOW (selected_window)->buffer)
&& (XBUFFER (XWINDOW (selected_window)->contents)
!= current_buffer))
Fset_buffer (XWINDOW (selected_window)->buffer);
Fset_buffer (XWINDOW (selected_window)->contents);
current_binding = active_maps (first_event);
}
@ -9246,8 +9246,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
not the current buffer. If we're at the
beginning of a key sequence, switch buffers. */
if (WINDOWP (window)
&& BUFFERP (XWINDOW (window)->buffer)
&& XBUFFER (XWINDOW (window)->buffer) != current_buffer)
&& BUFFERP (XWINDOW (window)->contents)
&& XBUFFER (XWINDOW (window)->contents) != current_buffer)
{
ASET (raw_keybuf, raw_keybuf_count, key);
raw_keybuf_count++;
@ -9268,7 +9268,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
set_buffer_internal (XBUFFER (XWINDOW (window)->contents));
goto replay_sequence;
}
}

View file

@ -1556,8 +1556,8 @@ like in the respective argument of `key-binding'. */)
window = POSN_WINDOW (position);
if (WINDOWP (window)
&& BUFFERP (XWINDOW (window)->buffer)
&& XBUFFER (XWINDOW (window)->buffer) != current_buffer)
&& BUFFERP (XWINDOW (window)->contents)
&& XBUFFER (XWINDOW (window)->contents) != current_buffer)
{
/* Arrange to go back to the original buffer once we're done
processing the key sequence. We don't use
@ -1567,7 +1567,7 @@ like in the respective argument of `key-binding'. */)
things the same.
*/
record_unwind_current_buffer ();
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
set_buffer_internal (XBUFFER (XWINDOW (window)->contents));
}
}

View file

@ -114,7 +114,7 @@ choose_minibuf_frame (void)
/* Under X, we come here with minibuf_window being the
minibuffer window of the unused termcap window created in
init_window_once. That window doesn't have a buffer. */
buffer = XWINDOW (minibuf_window)->buffer;
buffer = XWINDOW (minibuf_window)->contents;
if (BUFFERP (buffer))
/* Use set_window_buffer instead of Fset_window_buffer (see
discussion of bug#11984, bug#12025, bug#12026). */
@ -844,7 +844,7 @@ read_minibuf_unwind (Lisp_Object data)
window = minibuf_window;
/* To keep things predictable, in case it matters, let's be in the
minibuffer when we reset the relevant variables. */
Fset_buffer (XWINDOW (window)->buffer);
Fset_buffer (XWINDOW (window)->contents);
/* Restore prompt, etc, from outer minibuffer level. */
minibuf_prompt = Fcar (minibuf_save_list);

View file

@ -1261,7 +1261,7 @@ IT_update_begin (struct frame *f)
/* If the mouse highlight is in the window that was deleted
(e.g., if it was popped by completion), clear highlight
unconditionally. */
if (NILP (w->buffer))
if (NILP (w->contents))
hlinfo->mouse_face_window = Qnil;
else
{
@ -1271,7 +1271,7 @@ IT_update_begin (struct frame *f)
break;
}
if (NILP (w->buffer) || i < w->desired_matrix->nrows)
if (NILP (w->contents) || i < w->desired_matrix->nrows)
clear_mouse_face (hlinfo);
}
}
@ -1321,7 +1321,7 @@ IT_frame_up_to_date (struct frame *f)
new_cursor = frame_desired_cursor;
else
{
struct buffer *b = XBUFFER (sw->buffer);
struct buffer *b = XBUFFER (sw->contents);
if (EQ (BVAR (b,cursor_type), Qt))
new_cursor = frame_desired_cursor;

View file

@ -619,7 +619,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
{
NSView *view;
Lisp_Object name, filename;
Lisp_Object buf = XWINDOW (f->selected_window)->buffer;
Lisp_Object buf = XWINDOW (f->selected_window)->contents;
const char *title;
NSAutoreleasePool *pool;
struct gcpro gcpro1;

View file

@ -191,7 +191,7 @@
= alloca (previous_menu_items_used * sizeof *previous_items);
/* lisp preliminaries */
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->contents;
specbind (Qinhibit_quit, Qt);
specbind (Qdebug_on_next_call, Qnil);
record_unwind_save_match_data ();

View file

@ -6532,7 +6532,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute
{
Lisp_Object str = Qnil;
struct frame *f = SELECTED_FRAME ();
struct buffer *curbuf = XBUFFER (XWINDOW (f->selected_window)->buffer);
struct buffer *curbuf = XBUFFER (XWINDOW (f->selected_window)->contents);
if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
return NSAccessibilityTextFieldRole;

View file

@ -1769,10 +1769,10 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
strout ("#<window ", -1, -1, printcharfun);
len = sprintf (buf, "%p", XWINDOW (obj));
strout (buf, len, len, printcharfun);
if (!NILP (XWINDOW (obj)->buffer))
if (BUFFERP (XWINDOW (obj)->contents))
{
strout (" on ", -1, -1, printcharfun);
print_string (BVAR (XBUFFER (XWINDOW (obj)->buffer), name),
print_string (BVAR (XBUFFER (XWINDOW (obj)->contents), name),
printcharfun);
}
PRINTCHAR ('>');

View file

@ -597,8 +597,9 @@ get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop,
if (WINDOWP (object))
{
CHECK_LIVE_WINDOW (object);
w = XWINDOW (object);
object = w->buffer;
object = w->contents;
}
if (BUFFERP (object))
{

View file

@ -5816,7 +5816,7 @@ Text larger than the specified size is clipped. */)
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->contents));
bset_truncate_lines (current_buffer, Qnil);
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);

View file

@ -396,7 +396,7 @@ set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
if (! menubar_widget)
previous_menu_items_used = 0;
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->contents;
specbind (Qinhibit_quit, Qt);
/* Don't let the debugger step into this code
because it is not reentrant. */

File diff suppressed because it is too large Load diff

View file

@ -41,14 +41,13 @@ They are deleted only by calling delete-window on them (but
this can be done implicitly). Combination windows can be created
and deleted at any time.
A leaf window has a non-nil buffer field, and also
has markers in its start and pointm fields. Non-leaf windows
have nil in these fields.
A leaf window has a buffer stored in contents field and markers in its start
and pointm fields. Non-leaf windows have nil in the latter two fields.
Non-leaf windows are either vertical or horizontal combinations.
A vertical combination window has children that are arranged on the frame
one above the next. Its vchild field points to the uppermost child.
one above the next. Its contents field points to the uppermost child.
The parent field of each of the children points to the vertical
combination window. The next field of each child points to the
child below it, or is nil for the lowest child. The prev field
@ -56,7 +55,7 @@ of each child points to the child above it, or is nil for the
highest child.
A horizontal combination window has children that are side by side.
Its hchild field points to the leftmost child. In each child
Its contents field points to the leftmost child. In each child
the next field points to the child to the right and the prev field
points to the child to the left.
@ -78,7 +77,7 @@ the root window is the minibuf window. On minibufferless screens or
minibuffer-only screens, the root window and the minibuffer window are
one and the same, so its prev and next members are nil.
A dead window has its buffer, hchild, and vchild windows all nil. */
A dead window has its contents field set to nil. */
struct cursor_pos
{
@ -102,13 +101,6 @@ struct window
Lisp_Object next;
Lisp_Object prev;
/* First child of this window: vchild is used if this is a vertical
combination, hchild if this is a horizontal combination. Of the
fields vchild, hchild and buffer, one and only one is non-nil
unless the window is dead. */
Lisp_Object hchild;
Lisp_Object vchild;
/* The window this one is a child of. */
Lisp_Object parent;
@ -123,10 +115,8 @@ struct window
Lisp_Object new_total;
Lisp_Object new_normal;
/* The buffer displayed in this window. Of the fields vchild,
hchild and buffer, one and only one is non-nil unless the window
is dead. */
Lisp_Object buffer;
/* May be buffer, window, or nil. */
Lisp_Object contents;
/* A marker pointing to where in the text to start displaying.
BIDI Note: This is the _logical-order_ start, i.e. the smallest
@ -282,6 +272,10 @@ struct window
/* Non-zero if this window is a minibuffer window. */
unsigned mini : 1;
/* Meaningful only if contents is a window, non-zero if this
internal window is used in horizontal combination. */
unsigned horizontal : 1;
/* Non-zero means must regenerate mode line of this window. */
unsigned update_mode_line : 1;
@ -428,6 +422,21 @@ wset_next_buffers (struct window *w, Lisp_Object val)
/* A handy macro. */
/* Non-zero if W is leaf (carry the buffer). */
#define WINDOW_LEAF_P(W) \
(BUFFERP ((W)->contents))
/* Non-zero if W is a member of horizontal combination. */
#define WINDOW_HORIZONTAL_COMBINATION_P(W) \
(WINDOWP ((W)->contents) && (W)->horizontal)
/* Non-zero if W is a member of vertical combination. */
#define WINDOW_VERTICAL_COMBINATION_P(W) \
(WINDOWP ((W)->contents) && !(W)->horizontal)
#define WINDOW_XFRAME(W) \
(XFRAME (WINDOW_FRAME ((W))))
@ -931,20 +940,17 @@ extern void check_frame_size (struct frame *frame, int *rows, int *cols);
struct glyph *get_phys_cursor_glyph (struct window *w);
/* Value is non-zero if WINDOW is a valid window. */
#define WINDOW_VALID_P(WINDOW) \
(WINDOWP (WINDOW) \
&& (!NILP (XWINDOW (WINDOW)->buffer) \
|| !NILP (XWINDOW (WINDOW)->vchild) \
|| !NILP (XWINDOW (WINDOW)->hchild)))
#define WINDOW_VALID_P(WINDOW) \
(WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->contents)) \
/* A window of any sort, leaf or interior, is "valid" if one
of its buffer, vchild, or hchild members is non-nil. */
/* A window of any sort, leaf or interior, is "valid" if its
contents slot is non-nil. */
#define CHECK_VALID_WINDOW(WINDOW) \
CHECK_TYPE (WINDOW_VALID_P (WINDOW), Qwindow_valid_p, WINDOW)
/* Value is non-zero if WINDOW is a live window. */
#define WINDOW_LIVE_P(WINDOW) \
(WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer))
(WINDOWP (WINDOW) && BUFFERP (XWINDOW (WINDOW)->contents))
/* A window is "live" if and only if it shows a buffer. */
#define CHECK_LIVE_WINDOW(WINDOW) \

View file

@ -1283,10 +1283,10 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
if (FRAME_INITIAL_P (XFRAME (WINDOW_FRAME (w))))
return visible_p;
if (XBUFFER (w->buffer) != current_buffer)
if (XBUFFER (w->contents) != current_buffer)
{
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (w->buffer));
set_buffer_internal_1 (XBUFFER (w->contents));
}
SET_TEXT_POS_FROM_MARKER (top, w->start);
@ -4458,7 +4458,7 @@ handle_display_prop (struct it *it)
if it was a text property. */
if (!STRINGP (it->string))
object = it->w->buffer;
object = it->w->contents;
display_replaced_p = handle_display_spec (it, propval, object, overlay,
position, bufpos,
@ -4866,7 +4866,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
it->what = IT_IMAGE;
it->image_id = -1; /* no image */
it->position = start_pos;
it->object = NILP (object) ? it->w->buffer : object;
it->object = NILP (object) ? it->w->contents : object;
it->method = GET_FROM_IMAGE;
it->from_overlay = Qnil;
it->face_id = face_id;
@ -5012,7 +5012,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
it->what = IT_IMAGE;
it->image_id = lookup_image (it->f, value);
it->position = start_pos;
it->object = NILP (object) ? it->w->buffer : object;
it->object = NILP (object) ? it->w->contents : object;
it->method = GET_FROM_IMAGE;
/* Say that we haven't consumed the characters with
@ -5836,7 +5836,7 @@ pop_it (struct it *it)
it->object = p->u.stretch.object;
break;
case GET_FROM_BUFFER:
it->object = it->w->buffer;
it->object = it->w->contents;
break;
case GET_FROM_STRING:
it->object = it->string;
@ -5849,7 +5849,7 @@ pop_it (struct it *it)
else
{
it->method = GET_FROM_BUFFER;
it->object = it->w->buffer;
it->object = it->w->contents;
}
}
it->end_charpos = p->end_charpos;
@ -6290,7 +6290,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
IT_STRING_BYTEPOS (*it) = -1;
it->string = Qnil;
it->method = GET_FROM_BUFFER;
it->object = it->w->buffer;
it->object = it->w->contents;
it->area = TEXT_AREA;
it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
it->sp = 0;
@ -7141,7 +7141,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
else
{
it->method = GET_FROM_BUFFER;
it->object = it->w->buffer;
it->object = it->w->contents;
}
it->dpvec = NULL;
@ -7714,7 +7714,7 @@ next_element_from_ellipsis (struct it *it)
setting face_before_selective_p. */
it->saved_face_id = it->face_id;
it->method = GET_FROM_BUFFER;
it->object = it->w->buffer;
it->object = it->w->contents;
reseat_at_next_visible_line_start (it, 1);
it->face_before_selective_p = 1;
}
@ -7978,7 +7978,7 @@ next_element_from_buffer (struct it *it)
/* Record what we have and where it came from. */
it->what = IT_CHARACTER;
it->object = it->w->buffer;
it->object = it->w->contents;
it->position = it->current.pos;
/* Normally we return the character found above, except when we
@ -8084,7 +8084,7 @@ next_element_from_composition (struct it *it)
return 0;
}
it->position = it->current.pos;
it->object = it->w->buffer;
it->object = it->w->contents;
it->c = composition_update_it (&it->cmp_it, IT_CHARPOS (*it),
IT_BYTEPOS (*it), Qnil);
}
@ -10003,7 +10003,7 @@ with_echo_area_buffer_unwind_data (struct window *w)
if (w)
{
XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i;
ASET (vector, i, w->buffer); ++i;
ASET (vector, i, w->contents); ++i;
ASET (vector, i, make_number (marker_position (w->pointm))); ++i;
ASET (vector, i, make_number (marker_byte_position (w->pointm))); ++i;
ASET (vector, i, make_number (marker_position (w->start))); ++i;
@ -10259,9 +10259,9 @@ resize_mini_window (struct window *w, int exact_p)
eassert (MINI_WINDOW_P (w));
/* By default, start display at the beginning. */
set_marker_both (w->start, w->buffer,
BUF_BEGV (XBUFFER (w->buffer)),
BUF_BEGV_BYTE (XBUFFER (w->buffer)));
set_marker_both (w->start, w->contents,
BUF_BEGV (XBUFFER (w->contents)),
BUF_BEGV_BYTE (XBUFFER (w->contents)));
/* Don't resize windows while redisplaying a window; it would
confuse redisplay functions when the size of the window they are
@ -10288,10 +10288,10 @@ resize_mini_window (struct window *w, int exact_p)
struct text_pos start;
struct buffer *old_current_buffer = NULL;
if (current_buffer != XBUFFER (w->buffer))
if (current_buffer != XBUFFER (w->contents))
{
old_current_buffer = current_buffer;
set_buffer_internal (XBUFFER (w->buffer));
set_buffer_internal (XBUFFER (w->contents));
}
init_iterator (&it, w, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID);
@ -10740,7 +10740,7 @@ buffer_shared_and_changed (void)
/* Nonzero if W doesn't reflect the actual state of current buffer due
to its text or overlays change. FIXME: this may be called when
XBUFFER (w->buffer) != current_buffer, which looks suspicious. */
XBUFFER (w->contents) != current_buffer, which looks suspicious. */
static int
window_outdated (struct window *w)
@ -10755,7 +10755,7 @@ window_outdated (struct window *w)
static int
window_buffer_changed (struct window *w)
{
struct buffer *b = XBUFFER (w->buffer);
struct buffer *b = XBUFFER (w->contents);
eassert (BUFFER_LIVE_P (b));
@ -11009,7 +11009,7 @@ x_consider_frame_title (Lisp_Object frame)
Fselect_window (f->selected_window, Qt);
set_buffer_internal_1
(XBUFFER (XWINDOW (f->selected_window)->buffer));
(XBUFFER (XWINDOW (f->selected_window)->contents));
fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
mode_line_target = MODE_LINE_TITLE;
@ -11128,7 +11128,7 @@ prepare_menu_bars (void)
if (windows_or_buffers_changed
&& FRAME_NS_P (f))
ns_set_doc_edited
(f, Fbuffer_modified_p (XWINDOW (f->selected_window)->buffer));
(f, Fbuffer_modified_p (XWINDOW (f->selected_window)->contents));
#endif
UNGCPRO;
}
@ -11200,7 +11200,7 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
specbind (Qinhibit_menubar_update, Qt);
set_buffer_internal_1 (XBUFFER (w->buffer));
set_buffer_internal_1 (XBUFFER (w->contents));
if (save_match_data)
record_unwind_save_match_data ();
if (NILP (Voverriding_local_map_menu_flag))
@ -11404,7 +11404,7 @@ update_tool_bar (struct frame *f, int save_match_data)
/* 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 (w->buffer));
set_buffer_internal_1 (XBUFFER (w->contents));
/* Save match data, if we must. */
if (save_match_data)
@ -12271,10 +12271,8 @@ hscroll_window_tree (Lisp_Object window)
{
struct window *w = XWINDOW (window);
if (WINDOWP (w->hchild))
hscrolled_p |= hscroll_window_tree (w->hchild);
else if (WINDOWP (w->vchild))
hscrolled_p |= hscroll_window_tree (w->vchild);
if (WINDOWP (w->contents))
hscrolled_p |= hscroll_window_tree (w->contents);
else if (w->cursor.vpos >= 0)
{
int h_margin;
@ -12294,7 +12292,7 @@ hscroll_window_tree (Lisp_Object window)
/* 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, w->buffer))
if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->contents))
/* 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
@ -12329,7 +12327,7 @@ hscroll_window_tree (Lisp_Object window)
/* Find point in a display of infinite width. */
saved_current_buffer = current_buffer;
current_buffer = XBUFFER (w->buffer);
current_buffer = XBUFFER (w->contents);
if (w == XWINDOW (selected_window))
pt = PT;
@ -12382,7 +12380,7 @@ hscroll_window_tree (Lisp_Object window)
redisplay. */
if (w->hscroll != hscroll)
{
XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1;
w->hscroll = hscroll;
hscrolled_p = 1;
}
@ -12471,9 +12469,9 @@ debug_method_add (struct window *w, char const *fmt, ...)
if (trace_redisplay_p)
fprintf (stderr, "%p (%s): %s\n",
w,
((BUFFERP (w->buffer)
&& STRINGP (BVAR (XBUFFER (w->buffer), name)))
? SSDATA (BVAR (XBUFFER (w->buffer), name))
((BUFFERP (w->contents)
&& STRINGP (BVAR (XBUFFER (w->contents), name)))
? SSDATA (BVAR (XBUFFER (w->contents), name))
: "no buffer"),
method + len);
}
@ -12537,8 +12535,8 @@ text_outside_line_unchanged_p (struct window *w,
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 (w->buffer), bidi_display_reordering))
&& NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction)))
if (!NILP (BVAR (XBUFFER (w->contents), bidi_display_reordering))
&& NILP (BVAR (XBUFFER (w->contents), bidi_paragraph_direction)))
unchanged_p = 0;
}
@ -12761,7 +12759,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
we set b->clip_changed to 1 to force updating the screen. If
b->clip_changed has already been set to 1, we can skip this
check. */
if (!b->clip_changed && BUFFERP (w->buffer) && w->window_end_valid)
if (!b->clip_changed && BUFFERP (w->contents) && w->window_end_valid)
{
ptrdiff_t pt;
@ -12770,11 +12768,11 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
else
pt = marker_position (w->pointm);
if ((w->current_matrix->buffer != XBUFFER (w->buffer)
if ((w->current_matrix->buffer != XBUFFER (w->contents)
|| pt != w->last_point)
&& check_point_in_composition (w->current_matrix->buffer,
w->last_point,
XBUFFER (w->buffer), pt))
XBUFFER (w->contents), pt))
b->clip_changed = 1;
}
}
@ -13029,11 +13027,11 @@ redisplay_internal (void)
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 (w->buffer), mark_active)))
&& !NILP (BVAR (XBUFFER (w->contents), mark_active)))
!= (w->region_showing > 0))
|| (w->region_showing
&& w->region_showing
!= XINT (Fmarker_position (BVAR (XBUFFER (w->buffer), mark)))))
!= XINT (Fmarker_position (BVAR (XBUFFER (w->contents), mark)))))
CHARPOS (this_line_start_pos) = 0;
/* Optimize the case that only the line containing the cursor in the
@ -13051,7 +13049,7 @@ redisplay_internal (void)
&& !FRAME_OBSCURED_P (XFRAME (w->frame))
/* Make sure recorded data applies to current buffer, etc. */
&& this_line_buffer == current_buffer
&& current_buffer == XBUFFER (w->buffer)
&& current_buffer == XBUFFER (w->contents)
&& !w->force_start
&& !w->optional_new_start
/* Point must be on the line that we have info recorded about. */
@ -13342,7 +13340,7 @@ redisplay_internal (void)
Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
struct frame *mini_frame;
displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer);
displayed_buffer = XBUFFER (XWINDOW (selected_window)->contents);
/* 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,
@ -13552,7 +13550,7 @@ unwind_redisplay (Lisp_Object old_frame)
static void
mark_window_display_accurate_1 (struct window *w, int accurate_p)
{
struct buffer *b = XBUFFER (w->buffer);
struct buffer *b = XBUFFER (w->contents);
w->last_modified = accurate_p ? BUF_MODIFF (b) : 0;
w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF (b) : 0;
@ -13599,11 +13597,9 @@ mark_window_display_accurate (Lisp_Object window, int accurate_p)
for (; !NILP (window); window = w->next)
{
w = XWINDOW (window);
if (!NILP (w->vchild))
mark_window_display_accurate (w->vchild, accurate_p);
else if (!NILP (w->hchild))
mark_window_display_accurate (w->hchild, accurate_p);
else if (BUFFERP (w->buffer))
if (WINDOWP (w->contents))
mark_window_display_accurate (w->contents, accurate_p);
else
mark_window_display_accurate_1 (w, accurate_p);
}
@ -13660,13 +13656,11 @@ redisplay_windows (Lisp_Object window)
{
struct window *w = XWINDOW (window);
if (!NILP (w->hchild))
redisplay_windows (w->hchild);
else if (!NILP (w->vchild))
redisplay_windows (w->vchild);
else if (!NILP (w->buffer))
if (WINDOWP (w->contents))
redisplay_windows (w->contents);
else if (BUFFERP (w->contents))
{
displayed_buffer = XBUFFER (w->buffer);
displayed_buffer = XBUFFER (w->contents);
/* 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,
@ -14313,7 +14307,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
&& !MATRIX_ROW_CONTINUATION_LINE_P (row)
&& row->x == 0)
{
this_line_buffer = XBUFFER (w->buffer);
this_line_buffer = XBUFFER (w->contents);
CHARPOS (this_line_start_pos)
= MATRIX_ROW_START_CHARPOS (row) + delta;
@ -14349,7 +14343,7 @@ run_window_scroll_functions (Lisp_Object window, struct text_pos startp)
struct window *w = XWINDOW (window);
SET_MARKER_FROM_TEXT_POS (w->start, startp);
if (current_buffer != XBUFFER (w->buffer))
if (current_buffer != XBUFFER (w->contents))
emacs_abort ();
if (!NILP (Vwindow_scroll_functions))
@ -14358,7 +14352,7 @@ run_window_scroll_functions (Lisp_Object window, struct text_pos startp)
make_number (CHARPOS (startp)));
SET_TEXT_POS_FROM_MARKER (startp, w->start);
/* In case the hook functions switch buffers. */
set_buffer_internal (XBUFFER (w->buffer));
set_buffer_internal (XBUFFER (w->contents));
}
return startp;
@ -15009,7 +15003,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
must_scroll = 1;
}
else if (rc != CURSOR_MOVEMENT_SUCCESS
&& !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
&& !NILP (BVAR (XBUFFER (w->contents), bidi_display_reordering)))
{
struct glyph_row *row1;
@ -15072,7 +15066,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
else if (scroll_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
else if (rc != CURSOR_MOVEMENT_SUCCESS
&& !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
&& !NILP (BVAR (XBUFFER (w->contents), bidi_display_reordering)))
{
/* With bidi-reordered rows, there could be more than
one candidate row whose start and end positions
@ -15179,7 +15173,7 @@ set_vertical_scroll_bar (struct window *w)
|| (w == XWINDOW (minibuf_window)
&& NILP (echo_area_buffer[0])))
{
struct buffer *buf = XBUFFER (w->buffer);
struct buffer *buf = XBUFFER (w->contents);
whole = BUF_ZV (buf) - BUF_BEGV (buf);
start = marker_position (w->start) - BUF_BEGV (buf);
/* I don't think this is guaranteed to be right. For the
@ -15213,7 +15207,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
struct buffer *buffer = XBUFFER (w->buffer);
struct buffer *buffer = XBUFFER (w->contents);
struct buffer *old = current_buffer;
struct text_pos lpoint, opoint, startp;
int update_mode_line;
@ -15268,10 +15262,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
else if ((w != XWINDOW (minibuf_window)
|| minibuf_level == 0)
/* When buffer is nonempty, redisplay window normally. */
&& BUF_Z (XBUFFER (w->buffer)) == BUF_BEG (XBUFFER (w->buffer))
&& BUF_Z (XBUFFER (w->contents)) == BUF_BEG (XBUFFER (w->contents))
/* Quail displays non-mini buffers in minibuffer window.
In that case, redisplay the window normally. */
&& !NILP (Fmemq (w->buffer, Vminibuffer_list)))
&& !NILP (Fmemq (w->contents, Vminibuffer_list)))
{
/* W is a mini-buffer window, but it's not active, so clear
it. */
@ -15293,7 +15287,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
value. */
/* Really select the buffer, for the sake of buffer-local
variables. */
set_buffer_internal_1 (XBUFFER (w->buffer));
set_buffer_internal_1 (XBUFFER (w->contents));
current_matrix_up_to_date_p
= (w->window_end_valid
@ -16584,7 +16578,7 @@ try_window_reusing_current_matrix (struct window *w)
bidi-reordered glyph rows. Let set_cursor_from_row
figure out where to put the cursor, and if it fails,
give up. */
if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
if (!NILP (BVAR (XBUFFER (w->contents), bidi_display_reordering)))
{
if (!set_cursor_from_row (w, row, w->current_matrix,
0, 0, 0, 0))
@ -16835,7 +16829,7 @@ sync_frame_with_window_matrix_rows (struct window *w)
/* Preconditions: W must be a leaf window and full-width. Its frame
must have a frame matrix. */
eassert (NILP (w->hchild) && NILP (w->vchild));
eassert (BUFFERP (w->contents));
eassert (WINDOW_FULL_WIDTH_P (w));
eassert (!FRAME_WINDOW_P (f));
@ -16877,7 +16871,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
{
struct glyph_row *row = start;
struct glyph_row *best_row = NULL;
ptrdiff_t mindif = BUF_ZV (XBUFFER (w->buffer)) + 1;
ptrdiff_t mindif = BUF_ZV (XBUFFER (w->contents)) + 1;
int last_y;
/* If we happen to start on a header-line, skip that. */
@ -16913,7 +16907,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
{
struct glyph *g;
if (NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
if (NILP (BVAR (XBUFFER (w->contents), bidi_display_reordering))
|| (!best_row && !row->continued_p))
return row;
/* In bidi-reordered rows, there could be several rows
@ -17079,7 +17073,7 @@ try_window_id (struct window *w)
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 (w->buffer), word_wrap)))
if (!NILP (BVAR (XBUFFER (w->contents), word_wrap)))
GIVE_UP (21);
/* Under bidi reordering, adding or deleting a character in the
@ -17090,8 +17084,8 @@ try_window_id (struct window *w)
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 (w->buffer), bidi_display_reordering))
&& NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction)))
if (!NILP (BVAR (XBUFFER (w->contents), bidi_display_reordering))
&& NILP (BVAR (XBUFFER (w->contents), bidi_paragraph_direction)))
GIVE_UP (22);
/* Make sure beg_unchanged and end_unchanged are up to date. Do it
@ -17956,7 +17950,7 @@ glyphs in short form, otherwise show glyphs in long form. */)
(Lisp_Object glyphs)
{
struct window *w = XWINDOW (selected_window);
struct buffer *buffer = XBUFFER (w->buffer);
struct buffer *buffer = XBUFFER (w->contents);
fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n",
BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer));
@ -18062,7 +18056,7 @@ static struct glyph_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 (w->buffer);
struct buffer *buffer = XBUFFER (w->contents);
struct buffer *old = current_buffer;
const unsigned char *arrow_string = SDATA (overlay_arrow_string);
int arrow_len = SCHARS (overlay_arrow_string);
@ -19269,7 +19263,7 @@ display_line (struct it *it)
row->glyphs[TEXT_AREA]->charpos = -1;
row->displays_text_p = 0;
if (!NILP (BVAR (XBUFFER (it->w->buffer), indicate_empty_lines))
if (!NILP (BVAR (XBUFFER (it->w->contents), indicate_empty_lines))
&& (!MINI_WINDOW_P (it->w)
|| (minibuf_level && EQ (it->window, minibuf_window))))
row->indicate_empty_line_p = 1;
@ -20084,10 +20078,8 @@ redisplay_mode_lines (Lisp_Object window, int force)
{
struct window *w = XWINDOW (window);
if (WINDOWP (w->hchild))
nwindows += redisplay_mode_lines (w->hchild, force);
else if (WINDOWP (w->vchild))
nwindows += redisplay_mode_lines (w->vchild, force);
if (WINDOWP (w->contents))
nwindows += redisplay_mode_lines (w->contents, force);
else if (force
|| FRAME_GARBAGED_P (XFRAME (w->frame))
|| !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p)
@ -20097,7 +20089,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
/* Set the window's buffer for the mode line display. */
SET_TEXT_POS (lpoint, PT, PT_BYTE);
set_buffer_internal_1 (XBUFFER (w->buffer));
set_buffer_internal_1 (XBUFFER (w->contents));
/* Point refers normally to the selected window. For any
other window, set up appropriate value. */
@ -20879,7 +20871,7 @@ are the selected window and the WINDOW's buffer). */)
XSETWINDOW (window, w);
if (NILP (buffer))
buffer = w->buffer;
buffer = w->contents;
CHECK_BUFFER (buffer);
/* Make formatting the modeline a non-op when noninteractive, otherwise
@ -22185,7 +22177,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w));
}
prop = buffer_local_value_1 (prop, it->w->buffer);
prop = buffer_local_value_1 (prop, it->w->contents);
if (EQ (prop, Qunbound))
prop = Qnil;
}
@ -22237,7 +22229,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
return OK_PIXELS (pixels);
}
car = buffer_local_value_1 (car, it->w->buffer);
car = buffer_local_value_1 (car, it->w->contents);
if (EQ (car, Qunbound))
car = Qnil;
}
@ -24089,7 +24081,7 @@ produce_stretch_glyph (struct it *it)
int n = width;
if (!STRINGP (object))
object = it->w->buffer;
object = it->w->contents;
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (it->f))
append_stretch_glyph (it, object, width, height, ascent);
@ -25485,7 +25477,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
int *active_cursor)
{
struct frame *f = XFRAME (w->frame);
struct buffer *b = XBUFFER (w->buffer);
struct buffer *b = XBUFFER (w->contents);
int cursor_type = DEFAULT_CURSOR;
Lisp_Object alt_cursor;
int non_selected = 0;
@ -26036,10 +26028,8 @@ update_cursor_in_window_tree (struct window *w, int on_p)
{
while (w)
{
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);
if (WINDOWP (w->contents))
update_cursor_in_window_tree (XWINDOW (w->contents), on_p);
else
update_window_cursor (w, on_p);
@ -27285,7 +27275,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
{
help_echo_string = help;
XSETWINDOW (help_echo_window, w);
help_echo_object = w->buffer;
help_echo_object = w->contents;
help_echo_pos = charpos;
}
}
@ -27321,7 +27311,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
{
Lisp_Object default_help
= buffer_local_value_1 (Qmode_line_default_help_echo,
w->buffer);
w->contents);
if (STRINGP (default_help))
{
@ -27596,7 +27586,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
/* Are we in a window whose display is up to date?
And verify the buffer's text has not changed. */
b = XBUFFER (w->buffer);
b = XBUFFER (w->contents);
if (part == ON_TEXT
&& w->window_end_valid
&& w->last_modified == BUF_MODIFF (b)
@ -27805,8 +27795,8 @@ note_mouse_highlight (struct frame *f, int x, int y)
if (pos > 0)
{
mouse_face = get_char_property_and_overlay
(make_number (pos), Qmouse_face, w->buffer, &overlay);
buffer = w->buffer;
(make_number (pos), Qmouse_face, w->contents, &overlay);
buffer = w->contents;
disp_string = object;
}
}
@ -27919,11 +27909,11 @@ note_mouse_highlight (struct frame *f, int x, int y)
if (p > 0)
{
help = Fget_char_property (make_number (p),
Qhelp_echo, w->buffer);
Qhelp_echo, w->contents);
if (!NILP (help))
{
charpos = p;
obj = w->buffer;
obj = w->contents;
}
}
}
@ -27974,7 +27964,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
ptrdiff_t p = string_buffer_position (obj, start);
if (p > 0)
pointer = Fget_char_property (make_number (p),
Qpointer, w->buffer);
Qpointer, w->contents);
}
}
else if (BUFFERP (obj)
@ -28417,12 +28407,9 @@ expose_window_tree (struct window *w, XRectangle *r)
while (w && !FRAME_GARBAGED_P (f))
{
if (!NILP (w->hchild))
if (WINDOWP (w->contents))
mouse_face_overwritten_p
|= expose_window_tree (XWINDOW (w->hchild), r);
else if (!NILP (w->vchild))
mouse_face_overwritten_p
|= expose_window_tree (XWINDOW (w->vchild), r);
|= expose_window_tree (XWINDOW (w->contents), r);
else
mouse_face_overwritten_p |= expose_window (w, r);

View file

@ -5964,7 +5964,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
/* W must display the current buffer. We could write this function
to use the frame and buffer of W, but right now it doesn't. */
/* eassert (XBUFFER (w->buffer) == current_buffer); */
/* eassert (XBUFFER (w->contents) == current_buffer); */
XSETFASTINT (position, pos);
@ -5974,9 +5974,9 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
/* Get the `face' or `mouse_face' text property at POS, and
determine the next position at which the property changes. */
prop = Fget_text_property (position, propname, w->buffer);
prop = Fget_text_property (position, propname, w->contents);
XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
end = Fnext_single_property_change (position, propname, w->buffer, limit1);
end = Fnext_single_property_change (position, propname, w->contents, limit1);
if (INTEGERP (end))
endpos = XINT (end);
@ -6072,7 +6072,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
/* W must display the current buffer. We could write this function
to use the frame and buffer of W, but right now it doesn't. */
/* eassert (XBUFFER (w->buffer) == current_buffer); */
/* eassert (XBUFFER (w->contents) == current_buffer); */
XSETFASTINT (position, pos);
@ -6082,9 +6082,9 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
/* Get the `face' or `mouse_face' text property at POS, and
determine the next position at which the property changes. */
prop = Fget_text_property (position, propname, w->buffer);
prop = Fget_text_property (position, propname, w->contents);
XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
end = Fnext_single_property_change (position, propname, w->buffer, limit1);
end = Fnext_single_property_change (position, propname, w->contents, limit1);
if (INTEGERP (end))
endpos = XINT (end);

View file

@ -5043,7 +5043,7 @@ Text larger than the specified size is clipped. */)
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->contents));
bset_truncate_lines (current_buffer, Qnil);
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);

View file

@ -976,7 +976,7 @@ set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
if (! menubar_widget)
previous_menu_items_used = 0;
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->contents;
specbind (Qinhibit_quit, Qt);
/* Don't let the debugger step into this code
because it is not reentrant. */