Use INTERNAL_FIELD for windows.
* src/window.h (WVAR): New macro. (struct window): Change Lisp_Object members to INTERNAL_FIELD. * src/alloc.c, src/buffer.c, src/composite.c, src/dispextern.h: * src/dispnew.c, src/editfns.c, src/fileio.c, src/font.c, src/fontset.c: * src/frame.c, src/frame.h, src/fringe.c, src/indent.c, src/insdel.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/minibuf.c, src/nsterm.m: * src/print.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/w32term.c: * src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xmenu.c: * src/xterm.c: Users changed. * admin/coccinelle/window.cocci: Semantic patch to replace direct access to Lisp_Object members of struct window to WVAR.
This commit is contained in:
parent
c1dbc63c93
commit
3a45383a47
34 changed files with 1594 additions and 1292 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
* coccinelle/window.cocci: Semantic patch to replace direct
|
||||
access to Lisp_Object members of struct window to WVAR.
|
||||
|
||||
2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
* coccinelle/frame.cocci: Semantic patch to replace direct
|
||||
|
|
242
admin/coccinelle/window.cocci
Normal file
242
admin/coccinelle/window.cocci
Normal file
|
@ -0,0 +1,242 @@
|
|||
// Change direct access to Lisp_Object fields of struct window to WVAR.
|
||||
@@
|
||||
struct window *W;
|
||||
Lisp_Object O;
|
||||
@@
|
||||
(
|
||||
- W->frame
|
||||
+ WVAR (W, frame)
|
||||
|
|
||||
- W->next
|
||||
+ WVAR (W, next)
|
||||
|
|
||||
- W->prev
|
||||
+ WVAR (W, prev)
|
||||
|
|
||||
- W->hchild
|
||||
+ WVAR (W, hchild)
|
||||
|
|
||||
- W->vchild
|
||||
+ WVAR (W, vchild)
|
||||
|
|
||||
- W->parent
|
||||
+ WVAR (W, parent)
|
||||
|
|
||||
- W->left_col
|
||||
+ WVAR (W, left_col)
|
||||
|
|
||||
- W->top_line
|
||||
+ WVAR (W, top_line)
|
||||
|
|
||||
- W->total_lines
|
||||
+ WVAR (W, total_lines)
|
||||
|
|
||||
- W->total_cols
|
||||
+ WVAR (W, total_cols)
|
||||
|
|
||||
- W->normal_lines
|
||||
+ WVAR (W, normal_lines)
|
||||
|
|
||||
- W->normal_cols
|
||||
+ WVAR (W, normal_cols)
|
||||
|
|
||||
- W->new_total
|
||||
+ WVAR (W, new_total)
|
||||
|
|
||||
- W->new_normal
|
||||
+ WVAR (W, new_normal)
|
||||
|
|
||||
- W->buffer
|
||||
+ WVAR (W, buffer)
|
||||
|
|
||||
- W->start
|
||||
+ WVAR (W, start)
|
||||
|
|
||||
- W->pointm
|
||||
+ WVAR (W, pointm)
|
||||
|
|
||||
- W->temslot
|
||||
+ WVAR (W, temslot)
|
||||
|
|
||||
- W->vertical_scroll_bar
|
||||
+ WVAR (W, vertical_scroll_bar)
|
||||
|
|
||||
- W->left_margin_cols
|
||||
+ WVAR (W, left_margin_cols)
|
||||
|
|
||||
- W->right_margin_cols
|
||||
+ WVAR (W, right_margin_cols)
|
||||
|
|
||||
- W->left_fringe_width
|
||||
+ WVAR (W, left_fringe_width)
|
||||
|
|
||||
- W->right_fringe_width
|
||||
+ WVAR (W, right_fringe_width)
|
||||
|
|
||||
- W->scroll_bar_width
|
||||
+ WVAR (W, scroll_bar_width)
|
||||
|
|
||||
- W->vertical_scroll_bar_type
|
||||
+ WVAR (W, vertical_scroll_bar_type)
|
||||
|
|
||||
- W->window_end_pos
|
||||
+ WVAR (W, window_end_pos)
|
||||
|
|
||||
- W->window_end_vpos
|
||||
+ WVAR (W, window_end_vpos)
|
||||
|
|
||||
- W->window_end_valid
|
||||
+ WVAR (W, window_end_valid)
|
||||
|
|
||||
- W->display_table
|
||||
+ WVAR (W, display_table)
|
||||
|
|
||||
- W->dedicated
|
||||
+ WVAR (W, dedicated)
|
||||
|
|
||||
- W->base_line_number
|
||||
+ WVAR (W, base_line_number)
|
||||
|
|
||||
- W->base_line_pos
|
||||
+ WVAR (W, base_line_pos)
|
||||
|
|
||||
- W->region_showing
|
||||
+ WVAR (W, region_showing)
|
||||
|
|
||||
- W->column_number_displayed
|
||||
+ WVAR (W, column_number_displayed)
|
||||
|
|
||||
- W->redisplay_end_trigger
|
||||
+ WVAR (W, redisplay_end_trigger)
|
||||
|
|
||||
- W->combination_limit
|
||||
+ WVAR (W, combination_limit)
|
||||
|
|
||||
- W->prev_buffers
|
||||
+ WVAR (W, prev_buffers)
|
||||
|
|
||||
- W->next_buffers
|
||||
+ WVAR (W, next_buffers)
|
||||
|
|
||||
- W->window_parameters
|
||||
+ WVAR (W, window_parameters)
|
||||
|
||||
|
|
||||
|
||||
- XWINDOW (O)->frame
|
||||
+ WVAR (XWINDOW (O), frame)
|
||||
|
|
||||
- XWINDOW (O)->next
|
||||
+ WVAR (XWINDOW (O), next)
|
||||
|
|
||||
- XWINDOW (O)->prev
|
||||
+ WVAR (XWINDOW (O), prev)
|
||||
|
|
||||
- XWINDOW (O)->hchild
|
||||
+ WVAR (XWINDOW (O), hchild)
|
||||
|
|
||||
- XWINDOW (O)->vchild
|
||||
+ WVAR (XWINDOW (O), vchild)
|
||||
|
|
||||
- XWINDOW (O)->parent
|
||||
+ WVAR (XWINDOW (O), parent)
|
||||
|
|
||||
- XWINDOW (O)->left_col
|
||||
+ WVAR (XWINDOW (O), left_col)
|
||||
|
|
||||
- XWINDOW (O)->top_line
|
||||
+ WVAR (XWINDOW (O), top_line)
|
||||
|
|
||||
- XWINDOW (O)->total_lines
|
||||
+ WVAR (XWINDOW (O), total_lines)
|
||||
|
|
||||
- XWINDOW (O)->total_cols
|
||||
+ WVAR (XWINDOW (O), total_cols)
|
||||
|
|
||||
- XWINDOW (O)->normal_lines
|
||||
+ WVAR (XWINDOW (O), normal_lines)
|
||||
|
|
||||
- XWINDOW (O)->normal_cols
|
||||
+ WVAR (XWINDOW (O), normal_cols)
|
||||
|
|
||||
- XWINDOW (O)->new_total
|
||||
+ WVAR (XWINDOW (O), new_total)
|
||||
|
|
||||
- XWINDOW (O)->new_normal
|
||||
+ WVAR (XWINDOW (O), new_normal)
|
||||
|
|
||||
- XWINDOW (O)->buffer
|
||||
+ WVAR (XWINDOW (O), buffer)
|
||||
|
|
||||
- XWINDOW (O)->start
|
||||
+ WVAR (XWINDOW (O), start)
|
||||
|
|
||||
- XWINDOW (O)->pointm
|
||||
+ WVAR (XWINDOW (O), pointm)
|
||||
|
|
||||
- XWINDOW (O)->temslot
|
||||
+ WVAR (XWINDOW (O), temslot)
|
||||
|
|
||||
- XWINDOW (O)->vertical_scroll_bar
|
||||
+ WVAR (XWINDOW (O), vertical_scroll_bar)
|
||||
|
|
||||
- XWINDOW (O)->left_margin_cols
|
||||
+ WVAR (XWINDOW (O), left_margin_cols)
|
||||
|
|
||||
- XWINDOW (O)->right_margin_cols
|
||||
+ WVAR (XWINDOW (O), right_margin_cols)
|
||||
|
|
||||
- XWINDOW (O)->left_fringe_width
|
||||
+ WVAR (XWINDOW (O), left_fringe_width)
|
||||
|
|
||||
- XWINDOW (O)->right_fringe_width
|
||||
+ WVAR (XWINDOW (O), right_fringe_width)
|
||||
|
|
||||
- XWINDOW (O)->scroll_bar_width
|
||||
+ WVAR (XWINDOW (O), scroll_bar_width)
|
||||
|
|
||||
- XWINDOW (O)->vertical_scroll_bar_type
|
||||
+ WVAR (XWINDOW (O), vertical_scroll_bar_type)
|
||||
|
|
||||
- XWINDOW (O)->window_end_pos
|
||||
+ WVAR (XWINDOW (O), window_end_pos)
|
||||
|
|
||||
- XWINDOW (O)->window_end_vpos
|
||||
+ WVAR (XWINDOW (O), window_end_vpos)
|
||||
|
|
||||
- XWINDOW (O)->window_end_valid
|
||||
+ WVAR (XWINDOW (O), window_end_valid)
|
||||
|
|
||||
- XWINDOW (O)->display_table
|
||||
+ WVAR (XWINDOW (O), display_table)
|
||||
|
|
||||
- XWINDOW (O)->dedicated
|
||||
+ WVAR (XWINDOW (O), dedicated)
|
||||
|
|
||||
- XWINDOW (O)->base_line_number
|
||||
+ WVAR (XWINDOW (O), base_line_number)
|
||||
|
|
||||
- XWINDOW (O)->base_line_pos
|
||||
+ WVAR (XWINDOW (O), base_line_pos)
|
||||
|
|
||||
- XWINDOW (O)->region_showing
|
||||
+ WVAR (XWINDOW (O), region_showing)
|
||||
|
|
||||
- XWINDOW (O)->column_number_displayed
|
||||
+ WVAR (XWINDOW (O), column_number_displayed)
|
||||
|
|
||||
- XWINDOW (O)->redisplay_end_trigger
|
||||
+ WVAR (XWINDOW (O), redisplay_end_trigger)
|
||||
|
|
||||
- XWINDOW (O)->combination_limit
|
||||
+ WVAR (XWINDOW (O), combination_limit)
|
||||
|
|
||||
- XWINDOW (O)->prev_buffers
|
||||
+ WVAR (XWINDOW (O), prev_buffers)
|
||||
|
|
||||
- XWINDOW (O)->next_buffers
|
||||
+ WVAR (XWINDOW (O), next_buffers)
|
||||
|
|
||||
- XWINDOW (O)->window_parameters
|
||||
+ WVAR (XWINDOW (O), window_parameters)
|
||||
)
|
|
@ -1,3 +1,14 @@
|
|||
2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
Use INTERNAL_FIELD for windows.
|
||||
* window.h (WVAR): New macro.
|
||||
(struct window): Change Lisp_Object members to INTERNAL_FIELD.
|
||||
* alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
|
||||
* fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
|
||||
* insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
|
||||
* textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
|
||||
* xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
|
||||
|
||||
2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
|
||||
|
@ -63,9 +74,9 @@
|
|||
(KVAR): Change to use INTERNAL_FIELD.
|
||||
* frame.h (FVAR): New macro.
|
||||
(struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
|
||||
* alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c
|
||||
* fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c
|
||||
* term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h,
|
||||
* alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
|
||||
* fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
|
||||
* term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
|
||||
* xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
|
||||
|
||||
2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
|
|
@ -6020,7 +6020,8 @@ mark_object (Lisp_Object arg)
|
|||
/* Mark glyphs for leaf windows. Marking window
|
||||
matrices is sufficient because frame matrices
|
||||
use the same glyph memory. */
|
||||
if (NILP (w->hchild) && NILP (w->vchild) && w->current_matrix)
|
||||
if (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild))
|
||||
&& w->current_matrix)
|
||||
{
|
||||
mark_glyph_matrix (w->current_matrix);
|
||||
mark_glyph_matrix (w->desired_matrix);
|
||||
|
|
19
src/buffer.c
19
src/buffer.c
|
@ -1557,7 +1557,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, WVAR (XWINDOW (minibuf_window), buffer)))
|
||||
return Qnil;
|
||||
|
||||
/* When we kill an ordinary buffer which shares it's buffer text
|
||||
|
@ -1608,7 +1608,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, WVAR (XWINDOW (minibuf_window), buffer))
|
||||
&& EQ (buffer, Fother_buffer (buffer, Qnil, Qnil)))
|
||||
return Qnil;
|
||||
|
||||
|
@ -2190,12 +2190,13 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
|
|||
while (NILP (Fmemq (w, ws)))
|
||||
{
|
||||
ws = Fcons (w, ws);
|
||||
if (MARKERP (XWINDOW (w)->pointm)
|
||||
&& (EQ (XWINDOW (w)->buffer, buf1)
|
||||
|| EQ (XWINDOW (w)->buffer, buf2)))
|
||||
Fset_marker (XWINDOW (w)->pointm,
|
||||
make_number (BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))),
|
||||
XWINDOW (w)->buffer);
|
||||
if (MARKERP (WVAR (XWINDOW (w), pointm))
|
||||
&& (EQ (WVAR (XWINDOW (w), buffer), buf1)
|
||||
|| EQ (WVAR (XWINDOW (w), buffer), buf2)))
|
||||
Fset_marker (WVAR (XWINDOW (w), pointm),
|
||||
make_number
|
||||
(BUF_BEGV (XBUFFER (WVAR (XWINDOW (w), buffer)))),
|
||||
WVAR (XWINDOW (w), buffer));
|
||||
w = Fnext_window (w, Qt, Qt);
|
||||
}
|
||||
}
|
||||
|
@ -3671,7 +3672,7 @@ modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
|
|||
|
||||
/* If this is a buffer not in the selected window,
|
||||
we must do other windows. */
|
||||
if (buf != XBUFFER (XWINDOW (selected_window)->buffer))
|
||||
if (buf != XBUFFER (WVAR (XWINDOW (selected_window), buffer)))
|
||||
windows_or_buffers_changed = 1;
|
||||
/* If multiple windows show this buffer, we must do other windows. */
|
||||
else if (buffer_shared > 1)
|
||||
|
|
|
@ -906,7 +906,7 @@ static Lisp_Object
|
|||
autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t limit, struct window *win, struct face *face, Lisp_Object string)
|
||||
{
|
||||
ptrdiff_t count = SPECPDL_INDEX ();
|
||||
FRAME_PTR f = XFRAME (win->frame);
|
||||
FRAME_PTR f = XFRAME (WVAR (win, frame));
|
||||
Lisp_Object pos = make_number (charpos);
|
||||
ptrdiff_t to;
|
||||
ptrdiff_t pt = PT, pt_byte = PT_BYTE;
|
||||
|
@ -942,7 +942,7 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t
|
|||
}
|
||||
else
|
||||
#endif /* not HAVE_WINDOW_SYSTEM */
|
||||
font_object = win->frame;
|
||||
font_object = WVAR (win, frame);
|
||||
lgstring = Fcomposition_get_gstring (pos, make_number (to), font_object,
|
||||
string);
|
||||
if (NILP (LGSTRING_ID (lgstring)))
|
||||
|
|
|
@ -1374,7 +1374,7 @@ struct glyph_string
|
|||
? current_mode_line_height \
|
||||
: (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
|
||||
? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
|
||||
: estimate_mode_line_height (XFRAME ((W)->frame), \
|
||||
: estimate_mode_line_height (XFRAME (WVAR (W, frame)), \
|
||||
CURRENT_MODE_LINE_FACE_ID (W))))
|
||||
|
||||
/* Return the current height of the header line of window W. If not
|
||||
|
@ -1387,7 +1387,7 @@ struct glyph_string
|
|||
? current_header_line_height \
|
||||
: (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
|
||||
? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
|
||||
: estimate_mode_line_height (XFRAME ((W)->frame), \
|
||||
: estimate_mode_line_height (XFRAME (WVAR (W, frame)),\
|
||||
HEADER_LINE_FACE_ID)))
|
||||
|
||||
/* Return the height of the desired mode line of window W. */
|
||||
|
@ -1406,8 +1406,8 @@ struct glyph_string
|
|||
(!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)) \
|
||||
&& BUFFERP (WVAR (W, buffer)) \
|
||||
&& !NILP (BVAR (XBUFFER (WVAR (W, buffer)), mode_line_format)) \
|
||||
&& WINDOW_TOTAL_LINES (W) > 1)
|
||||
|
||||
/* Value is non-zero if window W wants a header line. */
|
||||
|
@ -1416,9 +1416,10 @@ struct glyph_string
|
|||
(!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)))
|
||||
&& BUFFERP (WVAR (W, buffer)) \
|
||||
&& !NILP (BVAR (XBUFFER (WVAR (W, buffer)), header_line_format)) \
|
||||
&& WINDOW_TOTAL_LINES (W) > 1 \
|
||||
+ !NILP (BVAR (XBUFFER (WVAR (W, buffer)), mode_line_format)))
|
||||
|
||||
|
||||
/* Return proper value to be used as baseline offset of font that has
|
||||
|
|
261
src/dispnew.c
261
src/dispnew.c
|
@ -265,9 +265,9 @@ add_window_display_history (struct window *w, const char *msg, int 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 (WVAR (w, buffer))
|
||||
&& STRINGP (BVAR (XBUFFER (WVAR (w, buffer)), name)))
|
||||
? SSDATA (BVAR (XBUFFER (WVAR (w, buffer)), name))
|
||||
: "???"),
|
||||
paused_p ? " ***paused***" : "",
|
||||
msg);
|
||||
|
@ -405,7 +405,7 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin
|
|||
|
||||
if (NUMBERP (margin))
|
||||
{
|
||||
int width = XFASTINT (w->total_cols);
|
||||
int width = XFASTINT (WVAR (w, total_cols));
|
||||
double d = max (0, XFLOATINT (margin));
|
||||
d = min (width / 2 - 1, d);
|
||||
n = (int) ((double) total_glyphs / width * d);
|
||||
|
@ -475,8 +475,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
|
|||
the matrix means preventing redisplay. */
|
||||
if (matrix->pool == NULL)
|
||||
{
|
||||
left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols);
|
||||
right = margin_glyphs_to_reserve (w, dim.width, w->right_margin_cols);
|
||||
left = margin_glyphs_to_reserve (w, dim.width, WVAR (w, left_margin_cols));
|
||||
right = margin_glyphs_to_reserve (w, dim.width, WVAR (w, right_margin_cols));
|
||||
eassert (left >= 0 && right >= 0);
|
||||
marginal_areas_changed_p = (left != matrix->left_margin_glyphs
|
||||
|| right != matrix->right_margin_glyphs);
|
||||
|
@ -515,9 +515,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
|
|||
if (w)
|
||||
{
|
||||
left = margin_glyphs_to_reserve (w, dim.width,
|
||||
w->left_margin_cols);
|
||||
WVAR (w, left_margin_cols));
|
||||
right = margin_glyphs_to_reserve (w, dim.width,
|
||||
w->right_margin_cols);
|
||||
WVAR (w, right_margin_cols));
|
||||
}
|
||||
else
|
||||
left = right = 0;
|
||||
|
@ -640,9 +640,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
|
|||
|
||||
/* Window end is invalid, if inside of the rows that
|
||||
are invalidated below. */
|
||||
if (INTEGERP (w->window_end_vpos)
|
||||
&& XFASTINT (w->window_end_vpos) >= i)
|
||||
w->window_end_valid = Qnil;
|
||||
if (INTEGERP (WVAR (w, window_end_vpos))
|
||||
&& XFASTINT (WVAR (w, window_end_vpos)) >= i)
|
||||
WVAR (w, window_end_valid) = Qnil;
|
||||
|
||||
while (i < matrix->nrows)
|
||||
matrix->rows[i++].enabled_p = 0;
|
||||
|
@ -882,15 +882,15 @@ clear_window_matrices (struct window *w, int desired_p)
|
|||
{
|
||||
while (w)
|
||||
{
|
||||
if (!NILP (w->hchild))
|
||||
if (!NILP (WVAR (w, hchild)))
|
||||
{
|
||||
eassert (WINDOWP (w->hchild));
|
||||
clear_window_matrices (XWINDOW (w->hchild), desired_p);
|
||||
eassert (WINDOWP (WVAR (w, hchild)));
|
||||
clear_window_matrices (XWINDOW (WVAR (w, hchild)), desired_p);
|
||||
}
|
||||
else if (!NILP (w->vchild))
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
{
|
||||
eassert (WINDOWP (w->vchild));
|
||||
clear_window_matrices (XWINDOW (w->vchild), desired_p);
|
||||
eassert (WINDOWP (WVAR (w, vchild)));
|
||||
clear_window_matrices (XWINDOW (WVAR (w, vchild)), desired_p);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -899,11 +899,11 @@ clear_window_matrices (struct window *w, int desired_p)
|
|||
else
|
||||
{
|
||||
clear_glyph_matrix (w->current_matrix);
|
||||
w->window_end_valid = Qnil;
|
||||
WVAR (w, window_end_valid) = Qnil;
|
||||
}
|
||||
}
|
||||
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -967,7 +967,7 @@ blank_row (struct window *w, struct glyph_row *row, int y)
|
|||
clear_glyph_row (row);
|
||||
row->y = y;
|
||||
row->ascent = row->phys_ascent = 0;
|
||||
row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (w->frame));
|
||||
row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (WVAR (w, frame)));
|
||||
row->visible_height = row->height;
|
||||
|
||||
if (row->y < min_y)
|
||||
|
@ -1513,7 +1513,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 (WVAR (w, buffer));
|
||||
int c;
|
||||
|
||||
/* This can sometimes happen for a fresh window. */
|
||||
|
@ -1676,8 +1676,8 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
|
|||
points to the mini-buffer window, if any, which is arranged
|
||||
vertically below other windows. */
|
||||
in_horz_combination_p
|
||||
= (!NILP (XWINDOW (window)->parent)
|
||||
&& !NILP (XWINDOW (XWINDOW (window)->parent)->hchild));
|
||||
= (!NILP (WVAR (XWINDOW (window), parent))
|
||||
&& !NILP (WVAR (XWINDOW (WVAR (XWINDOW (window), parent)), hchild)));
|
||||
|
||||
/* For WINDOW and all windows on the same level. */
|
||||
do
|
||||
|
@ -1686,12 +1686,12 @@ 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,
|
||||
if (!NILP (WVAR (w, hchild)))
|
||||
dim = allocate_matrices_for_frame_redisplay (WVAR (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,
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
dim = allocate_matrices_for_frame_redisplay (WVAR (w, vchild), x, y,
|
||||
dim_only_p,
|
||||
window_change_flags);
|
||||
else
|
||||
|
@ -1715,10 +1715,10 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
|
|||
|| dim.width != w->desired_matrix->matrix_w
|
||||
|| dim.height != w->desired_matrix->matrix_h
|
||||
|| (margin_glyphs_to_reserve (w, dim.width,
|
||||
w->left_margin_cols)
|
||||
WVAR (w, left_margin_cols))
|
||||
!= w->desired_matrix->left_margin_glyphs)
|
||||
|| (margin_glyphs_to_reserve (w, dim.width,
|
||||
w->right_margin_cols)
|
||||
WVAR (w, right_margin_cols))
|
||||
!= w->desired_matrix->right_margin_glyphs))
|
||||
*window_change_flags |= CHANGED_LEAF_MATRIX;
|
||||
|
||||
|
@ -1747,7 +1747,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
|
|||
hmax = max (hmax, dim.height);
|
||||
|
||||
/* Next window on same level. */
|
||||
window = w->next;
|
||||
window = WVAR (w, next);
|
||||
}
|
||||
while (!NILP (window));
|
||||
|
||||
|
@ -1778,7 +1778,7 @@ static int
|
|||
required_matrix_height (struct window *w)
|
||||
{
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
|
||||
if (FRAME_WINDOW_P (f))
|
||||
{
|
||||
|
@ -1804,7 +1804,7 @@ static int
|
|||
required_matrix_width (struct window *w)
|
||||
{
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
if (FRAME_WINDOW_P (f))
|
||||
{
|
||||
int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f);
|
||||
|
@ -1821,7 +1821,7 @@ required_matrix_width (struct window *w)
|
|||
}
|
||||
#endif /* HAVE_WINDOW_SYSTEM */
|
||||
|
||||
return XINT (w->total_cols);
|
||||
return XINT (WVAR (w, total_cols));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1833,10 +1833,10 @@ 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 (!NILP (WVAR (w, vchild)))
|
||||
allocate_matrices_for_window_redisplay (XWINDOW (WVAR (w, vchild)));
|
||||
else if (!NILP (WVAR (w, hchild)))
|
||||
allocate_matrices_for_window_redisplay (XWINDOW (WVAR (w, hchild)));
|
||||
else
|
||||
{
|
||||
/* W is a leaf window. */
|
||||
|
@ -1855,7 +1855,7 @@ allocate_matrices_for_window_redisplay (struct window *w)
|
|||
adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim);
|
||||
}
|
||||
|
||||
w = NILP (w->next) ? NULL : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? NULL : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1902,20 +1902,20 @@ adjust_frame_glyphs_initially (void)
|
|||
{
|
||||
struct frame *sf = SELECTED_FRAME ();
|
||||
struct window *root = XWINDOW (FVAR (sf, root_window));
|
||||
struct window *mini = XWINDOW (root->next);
|
||||
struct window *mini = XWINDOW (WVAR (root, next));
|
||||
int frame_lines = FRAME_LINES (sf);
|
||||
int frame_cols = FRAME_COLS (sf);
|
||||
int top_margin = FRAME_TOP_MARGIN (sf);
|
||||
|
||||
/* Do it for the root window. */
|
||||
XSETFASTINT (root->top_line, top_margin);
|
||||
XSETFASTINT (root->total_lines, frame_lines - 1 - top_margin);
|
||||
XSETFASTINT (root->total_cols, frame_cols);
|
||||
XSETFASTINT (WVAR (root, top_line), top_margin);
|
||||
XSETFASTINT (WVAR (root, total_lines), frame_lines - 1 - top_margin);
|
||||
XSETFASTINT (WVAR (root, total_cols), frame_cols);
|
||||
|
||||
/* Do it for the mini-buffer window. */
|
||||
XSETFASTINT (mini->top_line, frame_lines - 1);
|
||||
XSETFASTINT (mini->total_lines, 1);
|
||||
XSETFASTINT (mini->total_cols, frame_cols);
|
||||
XSETFASTINT (WVAR (mini, top_line), frame_lines - 1);
|
||||
XSETFASTINT (WVAR (mini, total_lines), 1);
|
||||
XSETFASTINT (WVAR (mini, total_cols), frame_cols);
|
||||
|
||||
adjust_frame_glyphs (sf);
|
||||
glyphs_initialized_initially_p = 1;
|
||||
|
@ -1947,21 +1947,21 @@ showing_window_margins_p (struct window *w)
|
|||
{
|
||||
while (w)
|
||||
{
|
||||
if (!NILP (w->hchild))
|
||||
if (!NILP (WVAR (w, hchild)))
|
||||
{
|
||||
if (showing_window_margins_p (XWINDOW (w->hchild)))
|
||||
if (showing_window_margins_p (XWINDOW (WVAR (w, hchild))))
|
||||
return 1;
|
||||
}
|
||||
else if (!NILP (w->vchild))
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
{
|
||||
if (showing_window_margins_p (XWINDOW (w->vchild)))
|
||||
if (showing_window_margins_p (XWINDOW (WVAR (w, vchild))))
|
||||
return 1;
|
||||
}
|
||||
else if (!NILP (w->left_margin_cols)
|
||||
|| !NILP (w->right_margin_cols))
|
||||
else if (!NILP (WVAR (w, left_margin_cols))
|
||||
|| !NILP (WVAR (w, right_margin_cols)))
|
||||
return 1;
|
||||
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1975,18 +1975,18 @@ fake_current_matrices (Lisp_Object window)
|
|||
{
|
||||
struct window *w;
|
||||
|
||||
for (; !NILP (window); window = w->next)
|
||||
for (; !NILP (window); window = WVAR (w, next))
|
||||
{
|
||||
w = XWINDOW (window);
|
||||
|
||||
if (!NILP (w->hchild))
|
||||
fake_current_matrices (w->hchild);
|
||||
else if (!NILP (w->vchild))
|
||||
fake_current_matrices (w->vchild);
|
||||
if (!NILP (WVAR (w, hchild)))
|
||||
fake_current_matrices (WVAR (w, hchild));
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
fake_current_matrices (WVAR (w, vchild));
|
||||
else
|
||||
{
|
||||
int i;
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
struct glyph_matrix *m = w->current_matrix;
|
||||
struct glyph_matrix *fm = f->current_matrix;
|
||||
|
||||
|
@ -2188,7 +2188,7 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
|
|||
{
|
||||
FVAR (f, menu_bar_window) = make_window ();
|
||||
w = XWINDOW (FVAR (f, menu_bar_window));
|
||||
XSETFRAME (w->frame, f);
|
||||
XSETFRAME (WVAR (w, frame), f);
|
||||
w->pseudo_window_p = 1;
|
||||
}
|
||||
else
|
||||
|
@ -2196,10 +2196,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
|
|||
|
||||
/* Set window dimensions to frame dimensions and allocate or
|
||||
adjust glyph matrices of W. */
|
||||
XSETFASTINT (w->top_line, 0);
|
||||
XSETFASTINT (w->left_col, 0);
|
||||
XSETFASTINT (w->total_lines, FRAME_MENU_BAR_LINES (f));
|
||||
XSETFASTINT (w->total_cols, FRAME_TOTAL_COLS (f));
|
||||
XSETFASTINT (WVAR (w, top_line), 0);
|
||||
XSETFASTINT (WVAR (w, left_col), 0);
|
||||
XSETFASTINT (WVAR (w, total_lines), FRAME_MENU_BAR_LINES (f));
|
||||
XSETFASTINT (WVAR (w, total_cols), FRAME_TOTAL_COLS (f));
|
||||
allocate_matrices_for_window_redisplay (w);
|
||||
}
|
||||
#endif /* not USE_X_TOOLKIT && not USE_GTK */
|
||||
|
@ -2214,16 +2214,16 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
|
|||
{
|
||||
FVAR (f, tool_bar_window) = make_window ();
|
||||
w = XWINDOW (FVAR (f, tool_bar_window));
|
||||
XSETFRAME (w->frame, f);
|
||||
XSETFRAME (WVAR (w, frame), f);
|
||||
w->pseudo_window_p = 1;
|
||||
}
|
||||
else
|
||||
w = XWINDOW (FVAR (f, tool_bar_window));
|
||||
|
||||
XSETFASTINT (w->top_line, FRAME_MENU_BAR_LINES (f));
|
||||
XSETFASTINT (w->left_col, 0);
|
||||
XSETFASTINT (w->total_lines, FRAME_TOOL_BAR_LINES (f));
|
||||
XSETFASTINT (w->total_cols, FRAME_TOTAL_COLS (f));
|
||||
XSETFASTINT (WVAR (w, top_line), FRAME_MENU_BAR_LINES (f));
|
||||
XSETFASTINT (WVAR (w, left_col), 0);
|
||||
XSETFASTINT (WVAR (w, total_lines), FRAME_TOOL_BAR_LINES (f));
|
||||
XSETFASTINT (WVAR (w, total_cols), FRAME_TOTAL_COLS (f));
|
||||
allocate_matrices_for_window_redisplay (w);
|
||||
}
|
||||
#endif
|
||||
|
@ -2333,10 +2333,10 @@ 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 (!NILP (WVAR (w, hchild)))
|
||||
free_window_matrices (XWINDOW (WVAR (w, hchild)));
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
free_window_matrices (XWINDOW (WVAR (w, vchild)));
|
||||
else
|
||||
{
|
||||
/* This is a leaf window. Free its memory and reset fields
|
||||
|
@ -2348,7 +2348,7 @@ free_window_matrices (struct window *w)
|
|||
}
|
||||
|
||||
/* Next window on same level. */
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2469,14 +2469,14 @@ 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 (!NILP (WVAR (w, hchild)))
|
||||
build_frame_matrix_from_window_tree (matrix, XWINDOW (WVAR (w, hchild)));
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
build_frame_matrix_from_window_tree (matrix, XWINDOW (WVAR (w, vchild)));
|
||||
else
|
||||
build_frame_matrix_from_leaf_window (matrix, w);
|
||||
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2615,7 +2615,7 @@ spec_glyph_lookup_face (struct window *w, GLYPH *glyph)
|
|||
/* Convert the glyph's specified face to a realized (cache) face. */
|
||||
if (lface_id > 0)
|
||||
{
|
||||
int face_id = merge_faces (XFRAME (w->frame),
|
||||
int face_id = merge_faces (XFRAME (WVAR (w, frame)),
|
||||
Qt, lface_id, DEFAULT_FACE_ID);
|
||||
SET_GLYPH_FACE (*glyph, face_id);
|
||||
}
|
||||
|
@ -2736,10 +2736,10 @@ 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 (!NILP (WVAR (w, hchild)))
|
||||
mirror_make_current (XWINDOW (WVAR (w, hchild)), frame_row);
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
mirror_make_current (XWINDOW (WVAR (w, vchild)), frame_row);
|
||||
else
|
||||
{
|
||||
/* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS
|
||||
|
@ -2772,7 +2772,7 @@ mirror_make_current (struct window *w, int frame_row)
|
|||
}
|
||||
}
|
||||
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2831,16 +2831,16 @@ mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlin
|
|||
static void
|
||||
sync_window_with_frame_matrix_rows (struct window *w)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
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));
|
||||
eassert (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild)));
|
||||
eassert (!FRAME_WINDOW_P (f));
|
||||
|
||||
left = margin_glyphs_to_reserve (w, 1, w->left_margin_cols);
|
||||
right = margin_glyphs_to_reserve (w, 1, w->right_margin_cols);
|
||||
left = margin_glyphs_to_reserve (w, 1, WVAR (w, left_margin_cols));
|
||||
right = margin_glyphs_to_reserve (w, 1, WVAR (w, right_margin_cols));
|
||||
x = w->current_matrix->matrix_x;
|
||||
width = w->current_matrix->matrix_w;
|
||||
|
||||
|
@ -2872,15 +2872,15 @@ 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 (!NILP (WVAR (w, hchild)))
|
||||
found = frame_row_to_window (XWINDOW (WVAR (w, hchild)), row);
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
found = frame_row_to_window (XWINDOW (WVAR (w, vchild)), row);
|
||||
else if (row >= WINDOW_TOP_EDGE_LINE (w)
|
||||
&& row < WINDOW_BOTTOM_EDGE_LINE (w))
|
||||
found = w;
|
||||
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
|
||||
return found;
|
||||
|
@ -2903,11 +2903,11 @@ 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,
|
||||
if (!NILP (WVAR (w, hchild)))
|
||||
mirror_line_dance (XWINDOW (WVAR (w, hchild)), unchanged_at_top,
|
||||
nlines, copy_from, retained_p);
|
||||
else if (!NILP (w->vchild))
|
||||
mirror_line_dance (XWINDOW (w->vchild), unchanged_at_top,
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
mirror_line_dance (XWINDOW (WVAR (w, vchild)), unchanged_at_top,
|
||||
nlines, copy_from, retained_p);
|
||||
else
|
||||
{
|
||||
|
@ -2963,7 +2963,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
|
|||
{
|
||||
/* A copy between windows. This is an infrequent
|
||||
case not worth optimizing. */
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f));
|
||||
struct window *w2;
|
||||
struct glyph_matrix *m2;
|
||||
|
@ -3000,7 +3000,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
|
|||
}
|
||||
|
||||
/* Next window on same level. */
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3018,18 +3018,18 @@ 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 (!NILP (WVAR (w, hchild)))
|
||||
check_window_matrix_pointers (XWINDOW (WVAR (w, hchild)));
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
check_window_matrix_pointers (XWINDOW (WVAR (w, vchild)));
|
||||
else
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
check_matrix_pointers (w->desired_matrix, f->desired_matrix);
|
||||
check_matrix_pointers (w->current_matrix, f->current_matrix);
|
||||
}
|
||||
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3077,10 +3077,10 @@ check_matrix_pointers (struct glyph_matrix *window_matrix,
|
|||
static int
|
||||
window_to_frame_vpos (struct window *w, int vpos)
|
||||
{
|
||||
eassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
|
||||
eassert (!FRAME_WINDOW_P (XFRAME (WVAR (w, frame))));
|
||||
eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows);
|
||||
vpos += WINDOW_TOP_EDGE_LINE (w);
|
||||
eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame)));
|
||||
eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (WVAR (w, frame))));
|
||||
return vpos;
|
||||
}
|
||||
|
||||
|
@ -3091,7 +3091,7 @@ window_to_frame_vpos (struct window *w, int vpos)
|
|||
static int
|
||||
window_to_frame_hpos (struct window *w, int hpos)
|
||||
{
|
||||
eassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
|
||||
eassert (!FRAME_WINDOW_P (XFRAME (WVAR (w, frame))));
|
||||
hpos += WINDOW_LEFT_EDGE_COL (w);
|
||||
return hpos;
|
||||
}
|
||||
|
@ -3311,14 +3311,14 @@ update_window_tree (struct window *w, int 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 (!NILP (WVAR (w, hchild)))
|
||||
paused_p |= update_window_tree (XWINDOW (WVAR (w, hchild)), force_p);
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
paused_p |= update_window_tree (XWINDOW (WVAR (w, vchild)), force_p);
|
||||
else if (w->must_be_updated_p)
|
||||
paused_p |= update_window (w, force_p);
|
||||
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
|
||||
return paused_p;
|
||||
|
@ -3806,7 +3806,7 @@ update_text_area (struct window *w, int vpos)
|
|||
struct glyph *glyph = ¤t_row->glyphs[TEXT_AREA][i - 1];
|
||||
int left, right;
|
||||
|
||||
rif->get_glyph_overhangs (glyph, XFRAME (w->frame),
|
||||
rif->get_glyph_overhangs (glyph, XFRAME (WVAR (w, frame)),
|
||||
&left, &right);
|
||||
can_skip_p = (right == 0 && !abort_skipping);
|
||||
}
|
||||
|
@ -3838,7 +3838,8 @@ update_text_area (struct window *w, int vpos)
|
|||
{
|
||||
int left, right;
|
||||
|
||||
rif->get_glyph_overhangs (current_glyph, XFRAME (w->frame),
|
||||
rif->get_glyph_overhangs (current_glyph,
|
||||
XFRAME (WVAR (w, frame)),
|
||||
&left, &right);
|
||||
while (left > 0 && i > 0)
|
||||
{
|
||||
|
@ -3981,7 +3982,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
|
|||
|
||||
/* Update display of the left margin area, if there is one. */
|
||||
if (!desired_row->full_width_p
|
||||
&& !NILP (w->left_margin_cols))
|
||||
&& !NILP (WVAR (w, left_margin_cols)))
|
||||
{
|
||||
changed_p = 1;
|
||||
update_marginal_area (w, LEFT_MARGIN_AREA, vpos);
|
||||
|
@ -3997,7 +3998,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
|
|||
|
||||
/* Update display of the right margin area, if there is one. */
|
||||
if (!desired_row->full_width_p
|
||||
&& !NILP (w->right_margin_cols))
|
||||
&& !NILP (WVAR (w, right_margin_cols)))
|
||||
{
|
||||
changed_p = 1;
|
||||
update_marginal_area (w, RIGHT_MARGIN_AREA, vpos);
|
||||
|
@ -4030,7 +4031,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
|
|||
static void
|
||||
set_window_cursor_after_update (struct window *w)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
struct redisplay_interface *rif = FRAME_RIF (f);
|
||||
int cx, cy, vpos, hpos;
|
||||
|
||||
|
@ -4116,14 +4117,14 @@ set_window_update_flags (struct window *w, int 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 (!NILP (WVAR (w, hchild)))
|
||||
set_window_update_flags (XWINDOW (WVAR (w, hchild)), on_p);
|
||||
else if (!NILP (WVAR (w, vchild)))
|
||||
set_window_update_flags (XWINDOW (WVAR (w, vchild)), on_p);
|
||||
else
|
||||
w->must_be_updated_p = on_p;
|
||||
|
||||
w = NILP (w->next) ? 0 : XWINDOW (w->next);
|
||||
w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4806,8 +4807,8 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
|
|||
int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos);
|
||||
int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
|
||||
|
||||
if (INTEGERP (w->left_margin_cols))
|
||||
x += XFASTINT (w->left_margin_cols);
|
||||
if (INTEGERP (WVAR (w, left_margin_cols)))
|
||||
x += XFASTINT (WVAR (w, left_margin_cols));
|
||||
|
||||
/* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */
|
||||
cursor_to (f, y, x);
|
||||
|
@ -5297,9 +5298,9 @@ 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 (WVAR (w, buffer));
|
||||
itdata = bidi_shelve_cache ();
|
||||
SET_TEXT_POS_FROM_MARKER (startp, w->start);
|
||||
SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start));
|
||||
CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
|
||||
BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp)));
|
||||
start_display (&it, w, startp);
|
||||
|
@ -5343,7 +5344,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 = WVAR (w, buffer);
|
||||
if (STRINGP (it.string))
|
||||
string = it.string;
|
||||
*pos = it.current;
|
||||
|
@ -5361,7 +5362,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 (WVAR (w, buffer)),
|
||||
CHARPOS (pos->pos));
|
||||
}
|
||||
|
||||
|
@ -5761,7 +5762,7 @@ change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int
|
|||
FrameCols (FRAME_TTY (f)) = newwidth;
|
||||
|
||||
if (WINDOWP (FVAR (f, tool_bar_window)))
|
||||
XSETFASTINT (XWINDOW (FVAR (f, tool_bar_window))->total_cols, newwidth);
|
||||
XSETFASTINT (WVAR (XWINDOW (FVAR (f, tool_bar_window)), total_cols), newwidth);
|
||||
}
|
||||
|
||||
FRAME_LINES (f) = newheight;
|
||||
|
|
|
@ -366,7 +366,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 = WVAR (XWINDOW (object), buffer);
|
||||
|
||||
if (!BUFFERP (object))
|
||||
/* pos-property only makes sense in buffers right now, since strings
|
||||
|
@ -821,7 +821,7 @@ This function does not move point. */)
|
|||
Lisp_Object
|
||||
save_excursion_save (void)
|
||||
{
|
||||
int visible = (XBUFFER (XWINDOW (selected_window)->buffer)
|
||||
int visible = (XBUFFER (WVAR (XWINDOW (selected_window), buffer))
|
||||
== current_buffer);
|
||||
|
||||
return Fcons (Fpoint_marker (),
|
||||
|
@ -874,7 +874,7 @@ save_excursion_restore (Lisp_Object info)
|
|||
and cleaner never to alter the window/buffer connections. */
|
||||
tem1 = Fcar (tem);
|
||||
if (!NILP (tem1)
|
||||
&& current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
|
||||
&& current_buffer != XBUFFER (WVAR (XWINDOW (selected_window), buffer)))
|
||||
Fswitch_to_buffer (Fcurrent_buffer (), Qnil);
|
||||
#endif /* 0 */
|
||||
|
||||
|
@ -907,7 +907,7 @@ save_excursion_restore (Lisp_Object info)
|
|||
tem = XCDR (info);
|
||||
if (visible_p
|
||||
&& !EQ (tem, selected_window)
|
||||
&& (tem1 = XWINDOW (tem)->buffer,
|
||||
&& (tem1 = WVAR (XWINDOW (tem), buffer),
|
||||
(/* Window is live... */
|
||||
BUFFERP (tem1)
|
||||
/* ...and it shows the current buffer. */
|
||||
|
|
|
@ -3731,7 +3731,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
|
|||
|
||||
/* If display currently starts at beginning of line,
|
||||
keep it that way. */
|
||||
if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
|
||||
if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) == current_buffer)
|
||||
XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
|
||||
|
||||
replace_handled = 1;
|
||||
|
@ -3888,7 +3888,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
|
|||
|
||||
/* If display currently starts at beginning of line,
|
||||
keep it that way. */
|
||||
if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
|
||||
if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) == current_buffer)
|
||||
XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
|
||||
|
||||
/* Replace the chars that we need to replace,
|
||||
|
|
|
@ -3665,7 +3665,7 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w,
|
|||
}
|
||||
}
|
||||
|
||||
f = XFRAME (w->frame);
|
||||
f = XFRAME (WVAR (w, frame));
|
||||
if (! FRAME_WINDOW_P (f))
|
||||
return Qnil;
|
||||
if (! face)
|
||||
|
@ -3723,7 +3723,7 @@ font_range (ptrdiff_t pos, ptrdiff_t *limit, struct window *w, struct face *face
|
|||
|
||||
face_id = face_at_buffer_position (w, pos, 0, 0, &ignore,
|
||||
*limit, 0, -1);
|
||||
face = FACE_FROM_ID (XFRAME (w->frame), face_id);
|
||||
face = FACE_FROM_ID (XFRAME (WVAR (w, frame)), face_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1841,7 +1841,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
|
|||
if (NILP (window))
|
||||
return Qnil;
|
||||
w = XWINDOW (window);
|
||||
f = XFRAME (w->frame);
|
||||
f = XFRAME (WVAR (w, frame));
|
||||
face_id = face_at_buffer_position (w, pos, -1, -1, &dummy,
|
||||
pos + 100, 0, -1);
|
||||
}
|
||||
|
|
64
src/frame.c
64
src/frame.c
|
@ -132,15 +132,15 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
|
|||
struct window *w = XWINDOW (window);
|
||||
|
||||
w->last_modified = 0;
|
||||
XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n);
|
||||
XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n);
|
||||
XSETFASTINT (WVAR (w, top_line), XFASTINT (WVAR (w, top_line)) + n);
|
||||
XSETFASTINT (WVAR (w, total_lines), XFASTINT (WVAR (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);
|
||||
if (!NILP (WVAR (w, vchild)))
|
||||
set_menu_bar_lines_1 (WVAR (w, vchild), n);
|
||||
|
||||
/* Adjust all children in a horizontal split. */
|
||||
for (window = w->hchild; !NILP (window); window = w->next)
|
||||
for (window = WVAR (w, hchild); !NILP (window); window = WVAR (w, next))
|
||||
{
|
||||
w = XWINDOW (window);
|
||||
set_menu_bar_lines_1 (window, n);
|
||||
|
@ -289,20 +289,20 @@ make_frame (int mini_p)
|
|||
if (mini_p)
|
||||
{
|
||||
mini_window = make_window ();
|
||||
XWINDOW (root_window)->next = mini_window;
|
||||
XWINDOW (mini_window)->prev = root_window;
|
||||
WVAR (XWINDOW (root_window), next) = mini_window;
|
||||
WVAR (XWINDOW (mini_window), prev) = root_window;
|
||||
XWINDOW (mini_window)->mini = 1;
|
||||
XWINDOW (mini_window)->frame = frame;
|
||||
WVAR (XWINDOW (mini_window), frame) = frame;
|
||||
FVAR (f, minibuffer_window) = mini_window;
|
||||
}
|
||||
else
|
||||
{
|
||||
mini_window = Qnil;
|
||||
XWINDOW (root_window)->next = Qnil;
|
||||
WVAR (XWINDOW (root_window), next) = Qnil;
|
||||
FVAR (f, minibuffer_window) = Qnil;
|
||||
}
|
||||
|
||||
XWINDOW (root_window)->frame = frame;
|
||||
WVAR (XWINDOW (root_window), frame) = frame;
|
||||
|
||||
/* 10 is arbitrary,
|
||||
just so that there is "something there."
|
||||
|
@ -311,21 +311,21 @@ make_frame (int mini_p)
|
|||
SET_FRAME_COLS (f, 10);
|
||||
FRAME_LINES (f) = 10;
|
||||
|
||||
XSETFASTINT (XWINDOW (root_window)->total_cols, 10);
|
||||
XSETFASTINT (XWINDOW (root_window)->total_lines, (mini_p ? 9 : 10));
|
||||
XSETFASTINT (WVAR (XWINDOW (root_window), total_cols), 10);
|
||||
XSETFASTINT (WVAR (XWINDOW (root_window), total_lines), (mini_p ? 9 : 10));
|
||||
|
||||
if (mini_p)
|
||||
{
|
||||
XSETFASTINT (XWINDOW (mini_window)->total_cols, 10);
|
||||
XSETFASTINT (XWINDOW (mini_window)->top_line, 9);
|
||||
XSETFASTINT (XWINDOW (mini_window)->total_lines, 1);
|
||||
XSETFASTINT (WVAR (XWINDOW (mini_window), total_cols), 10);
|
||||
XSETFASTINT (WVAR (XWINDOW (mini_window), top_line), 9);
|
||||
XSETFASTINT (WVAR (XWINDOW (mini_window), total_lines), 1);
|
||||
}
|
||||
|
||||
/* Choose a buffer for the frame's root window. */
|
||||
{
|
||||
Lisp_Object buf;
|
||||
|
||||
XWINDOW (root_window)->buffer = Qt;
|
||||
WVAR (XWINDOW (root_window), buffer) = Qt;
|
||||
buf = Fcurrent_buffer ();
|
||||
/* If buf is a 'hidden' buffer (i.e. one whose name starts with
|
||||
a space), try to find another one. */
|
||||
|
@ -344,7 +344,7 @@ make_frame (int mini_p)
|
|||
|
||||
if (mini_p)
|
||||
{
|
||||
XWINDOW (mini_window)->buffer = Qt;
|
||||
WVAR (XWINDOW (mini_window), buffer) = Qt;
|
||||
set_window_buffer (mini_window,
|
||||
(NILP (Vminibuffer_list)
|
||||
? get_minibuffer (0)
|
||||
|
@ -376,7 +376,7 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
|
|||
CHECK_LIVE_WINDOW (mini_window);
|
||||
|
||||
if (!NILP (mini_window)
|
||||
&& FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb)
|
||||
&& FRAME_KBOARD (XFRAME (WVAR (XWINDOW (mini_window), frame))) != kb)
|
||||
error ("Frame and minibuffer must be on the same terminal");
|
||||
|
||||
/* Make a frame containing just a root window. */
|
||||
|
@ -406,7 +406,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 (WVAR (XWINDOW (mini_window), buffer), Vminibuffer_list)))
|
||||
Fset_window_buffer (mini_window,
|
||||
(NILP (Vminibuffer_list)
|
||||
? get_minibuffer (0)
|
||||
|
@ -439,9 +439,9 @@ make_minibuffer_frame (void)
|
|||
|
||||
mini_window = FVAR (f, minibuffer_window) = FVAR (f, root_window);
|
||||
XWINDOW (mini_window)->mini = 1;
|
||||
XWINDOW (mini_window)->next = Qnil;
|
||||
XWINDOW (mini_window)->prev = Qnil;
|
||||
XWINDOW (mini_window)->frame = frame;
|
||||
WVAR (XWINDOW (mini_window), next) = Qnil;
|
||||
WVAR (XWINDOW (mini_window), prev) = Qnil;
|
||||
WVAR (XWINDOW (mini_window), frame) = frame;
|
||||
|
||||
/* Put the proper buffer in that window. */
|
||||
|
||||
|
@ -1241,7 +1241,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
|
|||
if (EQ (FVAR (f, minibuffer_window), minibuf_window))
|
||||
{
|
||||
Fset_window_buffer (FVAR (sf, minibuffer_window),
|
||||
XWINDOW (minibuf_window)->buffer, Qnil);
|
||||
WVAR (XWINDOW (minibuf_window), buffer), Qnil);
|
||||
minibuf_window = FVAR (sf, minibuffer_window);
|
||||
|
||||
/* If the dying minibuffer window was selected,
|
||||
|
@ -1672,17 +1672,17 @@ make_frame_visible_1 (Lisp_Object window)
|
|||
{
|
||||
struct window *w;
|
||||
|
||||
for (;!NILP (window); window = w->next)
|
||||
for (;!NILP (window); window = WVAR (w, next))
|
||||
{
|
||||
w = XWINDOW (window);
|
||||
|
||||
if (!NILP (w->buffer))
|
||||
BVAR (XBUFFER (w->buffer), display_time) = Fcurrent_time ();
|
||||
if (!NILP (WVAR (w, buffer)))
|
||||
BVAR (XBUFFER (WVAR (w, buffer)), display_time) = Fcurrent_time ();
|
||||
|
||||
if (!NILP (w->vchild))
|
||||
make_frame_visible_1 (w->vchild);
|
||||
if (!NILP (w->hchild))
|
||||
make_frame_visible_1 (w->hchild);
|
||||
if (!NILP (WVAR (w, vchild)))
|
||||
make_frame_visible_1 (WVAR (w, vchild));
|
||||
if (!NILP (WVAR (w, hchild)))
|
||||
make_frame_visible_1 (WVAR (w, hchild));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1714,7 +1714,7 @@ displayed in the terminal. */)
|
|||
{
|
||||
struct frame *sf = XFRAME (selected_frame);
|
||||
Fset_window_buffer (FVAR (sf, minibuffer_window),
|
||||
XWINDOW (minibuf_window)->buffer, Qnil);
|
||||
WVAR (XWINDOW (minibuf_window), buffer), Qnil);
|
||||
minibuf_window = FVAR (sf, minibuffer_window);
|
||||
}
|
||||
|
||||
|
@ -1752,7 +1752,7 @@ If omitted, FRAME defaults to the currently selected frame. */)
|
|||
{
|
||||
struct frame *sf = XFRAME (selected_frame);
|
||||
Fset_window_buffer (FVAR (sf, minibuffer_window),
|
||||
XWINDOW (minibuf_window)->buffer, Qnil);
|
||||
WVAR (XWINDOW (minibuf_window), buffer), Qnil);
|
||||
minibuf_window = FVAR (sf, minibuffer_window);
|
||||
}
|
||||
|
||||
|
|
|
@ -511,7 +511,7 @@ typedef struct frame *FRAME_PTR;
|
|||
#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
|
||||
|
||||
/* Given a window, return its frame as a Lisp_Object. */
|
||||
#define WINDOW_FRAME(w) (w)->frame
|
||||
#define WINDOW_FRAME(w) WVAR (w, frame)
|
||||
|
||||
/* Test a frame for particular kinds of display methods. */
|
||||
#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
|
||||
|
|
14
src/fringe.c
14
src/fringe.c
|
@ -692,7 +692,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 (WVAR (w, buffer)), fringe_cursor_alist)), !NILP (cmap))
|
||||
{
|
||||
bm = Fassq (cursor, cmap);
|
||||
if (CONSP (bm))
|
||||
|
@ -729,7 +729,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 (WVAR (w, buffer)), fringe_indicator_alist)), !NILP (cmap))
|
||||
{
|
||||
bm1 = Fassq (bitmap, cmap);
|
||||
if (CONSP (bm1))
|
||||
|
@ -956,7 +956,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 (WVAR (w, buffer)), indicate_buffer_boundaries), !NILP (ind)))
|
||||
{
|
||||
if (EQ (ind, Qleft) || EQ (ind, Qright))
|
||||
boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
|
||||
|
@ -997,7 +997,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 (WVAR (w, buffer)))
|
||||
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
|
||||
row->indicate_bob_p = !NILP (boundary_top);
|
||||
else
|
||||
|
@ -1007,7 +1007,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 (WVAR (w, buffer)))
|
||||
&& !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)
|
||||
|
@ -1017,7 +1017,7 @@ update_window_fringes (struct window *w, int keep_current_p)
|
|||
}
|
||||
}
|
||||
|
||||
empty_pos = BVAR (XBUFFER (w->buffer), indicate_empty_lines);
|
||||
empty_pos = BVAR (XBUFFER (WVAR (w, buffer)), indicate_empty_lines);
|
||||
if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
|
||||
empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
|
||||
|
||||
|
@ -1740,7 +1740,7 @@ Return nil if POS is not visible in WINDOW. */)
|
|||
else if (w == XWINDOW (selected_window))
|
||||
textpos = PT;
|
||||
else
|
||||
textpos = XMARKER (w->pointm)->charpos;
|
||||
textpos = XMARKER (WVAR (w, pointm))->charpos;
|
||||
|
||||
row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
|
||||
row = row_containing_pos (w, textpos, row, NULL, 0);
|
||||
|
|
31
src/indent.c
31
src/indent.c
|
@ -258,7 +258,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 (WVAR (XWINDOW (window), buffer), buffer))
|
||||
? window : buffer);
|
||||
inv_p = TEXT_PROP_MEANS_INVISIBLE (prop);
|
||||
/* When counting columns (window == nil), don't skip over ellipsis text. */
|
||||
|
@ -1173,14 +1173,14 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
|
|||
width = window_body_cols (win);
|
||||
/* We must make room for continuation marks if we don't have fringes. */
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
if (!FRAME_WINDOW_P (XFRAME (win->frame)))
|
||||
if (!FRAME_WINDOW_P (XFRAME (WVAR (win, frame))))
|
||||
#endif
|
||||
width -= 1;
|
||||
}
|
||||
|
||||
continuation_glyph_width = 1;
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
if (FRAME_WINDOW_P (XFRAME (win->frame)))
|
||||
if (FRAME_WINDOW_P (XFRAME (WVAR (win, frame))))
|
||||
continuation_glyph_width = 0; /* In the fringe. */
|
||||
#endif
|
||||
|
||||
|
@ -1787,7 +1787,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
|
|||
? (window_body_cols (w)
|
||||
- (
|
||||
#ifdef HAVE_WINDOW_SYSTEM
|
||||
FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 :
|
||||
FRAME_WINDOW_P (XFRAME (WVAR (w, frame))) ? 0 :
|
||||
#endif
|
||||
1))
|
||||
: XINT (XCAR (topos))),
|
||||
|
@ -1837,7 +1837,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
|
|||
|
||||
/* 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 (WVAR (w, buffer), Fcurrent_buffer ()))
|
||||
text_prop_object = window;
|
||||
else
|
||||
text_prop_object = Fcurrent_buffer ();
|
||||
|
@ -1998,15 +1998,15 @@ whether or not it is currently displayed in some window. */)
|
|||
|
||||
old_buffer = Qnil;
|
||||
GCPRO3 (old_buffer, old_charpos, old_bytepos);
|
||||
if (XBUFFER (w->buffer) != current_buffer)
|
||||
if (XBUFFER (WVAR (w, buffer)) != current_buffer)
|
||||
{
|
||||
/* Set the window's buffer temporarily to the current buffer. */
|
||||
old_buffer = w->buffer;
|
||||
old_charpos = XMARKER (w->pointm)->charpos;
|
||||
old_bytepos = XMARKER (w->pointm)->bytepos;
|
||||
XSETBUFFER (w->buffer, current_buffer);
|
||||
set_marker_both
|
||||
(w->pointm, w->buffer, BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));
|
||||
old_buffer = WVAR (w, buffer);
|
||||
old_charpos = XMARKER (WVAR (w, pointm))->charpos;
|
||||
old_bytepos = XMARKER (WVAR (w, pointm))->bytepos;
|
||||
XSETBUFFER (WVAR (w, buffer), current_buffer);
|
||||
set_marker_both (WVAR (w, pointm), WVAR (w, buffer),
|
||||
BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));
|
||||
}
|
||||
|
||||
if (noninteractive)
|
||||
|
@ -2137,7 +2137,7 @@ whether or not it is currently displayed in some window. */)
|
|||
}
|
||||
move_it_in_display_line
|
||||
(&it, ZV,
|
||||
(int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5),
|
||||
(int)(cols * FRAME_COLUMN_WIDTH (XFRAME (WVAR (w, frame))) + 0.5),
|
||||
MOVE_TO_X);
|
||||
}
|
||||
|
||||
|
@ -2147,8 +2147,9 @@ whether or not it is currently displayed in some window. */)
|
|||
|
||||
if (BUFFERP (old_buffer))
|
||||
{
|
||||
w->buffer = old_buffer;
|
||||
set_marker_both (w->pointm, w->buffer, old_charpos, old_bytepos);
|
||||
WVAR (w, buffer) = old_buffer;
|
||||
set_marker_both (WVAR (w, pointm), WVAR (w, buffer),
|
||||
old_charpos, old_bytepos);
|
||||
}
|
||||
|
||||
RETURN_UNGCPRO (make_number (it.vpos));
|
||||
|
|
|
@ -1820,7 +1820,7 @@ prepare_to_modify_buffer (ptrdiff_t start, ptrdiff_t end,
|
|||
|
||||
/* Let redisplay consider other windows than selected_window
|
||||
if modifying another buffer. */
|
||||
if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
|
||||
if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer)
|
||||
++windows_or_buffers_changed;
|
||||
|
||||
if (BUF_INTERVALS (current_buffer) != 0)
|
||||
|
|
|
@ -800,7 +800,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 (WVAR (XWINDOW (selected_window), buffer)))
|
||||
buffer = Fcurrent_buffer ();
|
||||
else
|
||||
buffer = Qnil;
|
||||
|
@ -1382,8 +1382,8 @@ command_loop_1 (void)
|
|||
Fkill_emacs (Qnil);
|
||||
|
||||
/* Make sure the current window's buffer is selected. */
|
||||
if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
|
||||
set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
|
||||
if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer)
|
||||
set_buffer_internal (XBUFFER (WVAR (XWINDOW (selected_window), buffer)));
|
||||
|
||||
/* Display any malloc warning that just came out. Use while because
|
||||
displaying one warning can cause another. */
|
||||
|
@ -1452,8 +1452,8 @@ 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);
|
||||
if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
|
||||
set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
|
||||
if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer)
|
||||
set_buffer_internal (XBUFFER (WVAR (XWINDOW (selected_window), buffer)));
|
||||
|
||||
++num_input_keys;
|
||||
|
||||
|
@ -1484,7 +1484,7 @@ command_loop_1 (void)
|
|||
{
|
||||
struct buffer *b;
|
||||
XWINDOW (selected_window)->force_start = 0;
|
||||
b = XBUFFER (XWINDOW (selected_window)->buffer);
|
||||
b = XBUFFER (WVAR (XWINDOW (selected_window), buffer));
|
||||
BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0;
|
||||
}
|
||||
|
||||
|
@ -5174,8 +5174,8 @@ 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))
|
||||
? PT : XMARKER (w->pointm)->charpos;
|
||||
&& current_buffer == XBUFFER (WVAR (w, buffer)))
|
||||
? PT : XMARKER (WVAR (w, pointm))->charpos;
|
||||
|
||||
xret = wx;
|
||||
yret = wy;
|
||||
|
@ -5563,7 +5563,7 @@ make_lispy_event (struct input_event *event)
|
|||
int fuzz;
|
||||
|
||||
if (WINDOWP (event->frame_or_window))
|
||||
f = XFRAME (XWINDOW (event->frame_or_window)->frame);
|
||||
f = XFRAME (WVAR (XWINDOW (event->frame_or_window), frame));
|
||||
else if (FRAMEP (event->frame_or_window))
|
||||
f = XFRAME (event->frame_or_window);
|
||||
else
|
||||
|
@ -5731,7 +5731,7 @@ make_lispy_event (struct input_event *event)
|
|||
int is_double;
|
||||
|
||||
if (WINDOWP (event->frame_or_window))
|
||||
fr = XFRAME (XWINDOW (event->frame_or_window)->frame);
|
||||
fr = XFRAME (WVAR (XWINDOW (event->frame_or_window), frame));
|
||||
else if (FRAMEP (event->frame_or_window))
|
||||
fr = XFRAME (event->frame_or_window);
|
||||
else
|
||||
|
@ -9395,8 +9395,8 @@ 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) != current_buffer)
|
||||
Fset_buffer (XWINDOW (selected_window)->buffer);
|
||||
if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer)
|
||||
Fset_buffer (WVAR (XWINDOW (selected_window), buffer));
|
||||
}
|
||||
|
||||
orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
|
||||
|
@ -9488,8 +9488,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 (WVAR (XWINDOW (window), buffer))
|
||||
&& XBUFFER (WVAR (XWINDOW (window), buffer)) != current_buffer)
|
||||
{
|
||||
ASET (raw_keybuf, raw_keybuf_count, key);
|
||||
raw_keybuf_count++;
|
||||
|
@ -9510,7 +9510,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 (WVAR (XWINDOW (window), buffer)));
|
||||
orig_local_map = get_local_map (PT, current_buffer,
|
||||
Qlocal_map);
|
||||
orig_keymap = get_local_map (PT, current_buffer,
|
||||
|
@ -11194,7 +11194,7 @@ The `posn-' functions access elements of such lists. */)
|
|||
? window_box_left_offset (w, TEXT_AREA)
|
||||
: 0)));
|
||||
XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y)));
|
||||
frame_or_window = w->frame;
|
||||
frame_or_window = WVAR (w, frame);
|
||||
}
|
||||
|
||||
CHECK_LIVE_FRAME (frame_or_window);
|
||||
|
|
|
@ -1560,8 +1560,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 (WVAR (XWINDOW (window), buffer))
|
||||
&& XBUFFER (WVAR (XWINDOW (window), buffer)) != current_buffer)
|
||||
{
|
||||
/* Arrange to go back to the original buffer once we're done
|
||||
processing the key sequence. We don't use
|
||||
|
@ -1573,7 +1573,7 @@ like in the respective argument of `key-binding'. */)
|
|||
|
||||
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
|
||||
|
||||
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
|
||||
set_buffer_internal (XBUFFER (WVAR (XWINDOW (window), buffer)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1748,7 +1748,8 @@ typedef struct {
|
|||
vchild, and hchild members are all nil. */
|
||||
|
||||
#define CHECK_LIVE_WINDOW(x) \
|
||||
CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer), Qwindow_live_p, x)
|
||||
CHECK_TYPE (WINDOWP (x) && !NILP (WVAR (XWINDOW (x), buffer)), \
|
||||
Qwindow_live_p, x)
|
||||
|
||||
#define CHECK_PROCESS(x) \
|
||||
CHECK_TYPE (PROCESSP (x), Qprocessp, x)
|
||||
|
|
|
@ -115,7 +115,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 = WVAR (XWINDOW (minibuf_window), buffer);
|
||||
if (BUFFERP (buffer))
|
||||
Fset_window_buffer (FVAR (sf, minibuffer_window), buffer, Qnil);
|
||||
minibuf_window = FVAR (sf, minibuffer_window);
|
||||
|
@ -612,7 +612,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
|
|||
FOR_EACH_FRAME (dummy, frame)
|
||||
{
|
||||
Lisp_Object root_window = Fframe_root_window (frame);
|
||||
Lisp_Object mini_window = XWINDOW (root_window)->next;
|
||||
Lisp_Object mini_window = WVAR (XWINDOW (root_window), next);
|
||||
|
||||
if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window)
|
||||
&& !NILP (Fwindow_minibuffer_p (mini_window)))
|
||||
|
@ -687,7 +687,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
|
|||
XWINDOW (minibuf_window)->must_be_updated_p = 1;
|
||||
update_frame (XFRAME (selected_frame), 1, 1);
|
||||
{
|
||||
struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
|
||||
struct frame *f = XFRAME (WVAR (XWINDOW (minibuf_window), frame));
|
||||
struct redisplay_interface *rif = FRAME_RIF (f);
|
||||
if (rif && rif->flush_display)
|
||||
rif->flush_display (f);
|
||||
|
@ -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 (WVAR (XWINDOW (window), buffer));
|
||||
|
||||
/* Restore prompt, etc, from outer minibuffer level. */
|
||||
minibuf_prompt = Fcar (minibuf_save_list);
|
||||
|
|
|
@ -669,7 +669,7 @@ Free a pool and temporary objects it refers to (callable from C)
|
|||
external (RIF) call; for one window called before update_end
|
||||
-------------------------------------------------------------------------- */
|
||||
{
|
||||
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
|
||||
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame)));
|
||||
|
||||
/* note: this fn is nearly identical in all terms */
|
||||
if (!w->pseudo_window_p)
|
||||
|
@ -2037,7 +2037,7 @@ Free a pool and temporary objects it refers to (callable from C)
|
|||
External (RIF): Insert or delete n lines at line vpos
|
||||
-------------------------------------------------------------------------- */
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
int x, y, width, height, from_y, to_y, bottom_y;
|
||||
|
||||
NSTRACE (ns_scroll_run);
|
||||
|
@ -2116,7 +2116,7 @@ Free a pool and temporary objects it refers to (callable from C)
|
|||
full-width rows stays visible in the internal border.
|
||||
Under NS this is drawn inside the fringes. */
|
||||
if (windows_or_buffers_changed
|
||||
&& (f = XFRAME (w->frame),
|
||||
&& (f = XFRAME (WVAR (w, frame)),
|
||||
width = FRAME_INTERNAL_BORDER_WIDTH (f),
|
||||
width != 0)
|
||||
&& (height = desired_row->visible_height,
|
||||
|
|
|
@ -1775,10 +1775,11 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
|
|||
strout ("#<window ", -1, -1, printcharfun);
|
||||
len = sprintf (buf, "%d", XWINDOW (obj)->sequence_number);
|
||||
strout (buf, len, len, printcharfun);
|
||||
if (!NILP (XWINDOW (obj)->buffer))
|
||||
if (!NILP (WVAR (XWINDOW (obj), buffer)))
|
||||
{
|
||||
strout (" on ", -1, -1, printcharfun);
|
||||
print_string (BVAR (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun);
|
||||
print_string (BVAR (XBUFFER (WVAR (XWINDOW (obj), buffer)), name),
|
||||
printcharfun);
|
||||
}
|
||||
PRINTCHAR ('>');
|
||||
}
|
||||
|
|
|
@ -587,7 +587,7 @@ get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop,
|
|||
if (WINDOWP (object))
|
||||
{
|
||||
w = XWINDOW (object);
|
||||
object = w->buffer;
|
||||
object = WVAR (w, buffer);
|
||||
}
|
||||
if (BUFFERP (object))
|
||||
{
|
||||
|
|
16
src/w32fns.c
16
src/w32fns.c
|
@ -5617,7 +5617,7 @@ Text larger than the specified size is clipped. */)
|
|||
|
||||
/* Set up the frame's root window. */
|
||||
w = XWINDOW (FRAME_ROOT_WINDOW (f));
|
||||
w->left_col = w->top_line = make_number (0);
|
||||
WVAR (w, left_col) = WVAR (w, top_line) = make_number (0);
|
||||
|
||||
if (CONSP (Vx_max_tooltip_size)
|
||||
&& INTEGERP (XCAR (Vx_max_tooltip_size))
|
||||
|
@ -5625,22 +5625,22 @@ Text larger than the specified size is clipped. */)
|
|||
&& INTEGERP (XCDR (Vx_max_tooltip_size))
|
||||
&& XINT (XCDR (Vx_max_tooltip_size)) > 0)
|
||||
{
|
||||
w->total_cols = XCAR (Vx_max_tooltip_size);
|
||||
w->total_lines = XCDR (Vx_max_tooltip_size);
|
||||
WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size);
|
||||
WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
w->total_cols = make_number (80);
|
||||
w->total_lines = make_number (40);
|
||||
WVAR (w, total_cols) = make_number (80);
|
||||
WVAR (w, total_lines) = make_number (40);
|
||||
}
|
||||
|
||||
FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
|
||||
FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols));
|
||||
adjust_glyphs (f);
|
||||
w->pseudo_window_p = 1;
|
||||
|
||||
/* 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 (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer)));
|
||||
BVAR (current_buffer, truncate_lines) = Qnil;
|
||||
clear_glyph_matrix (w->desired_matrix);
|
||||
clear_glyph_matrix (w->current_matrix);
|
||||
|
@ -5702,7 +5702,7 @@ Text larger than the specified size is clipped. */)
|
|||
/* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
|
||||
not in pixels. */
|
||||
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
|
||||
w->total_cols = make_number (width);
|
||||
WVAR (w, total_cols) = make_number (width);
|
||||
FRAME_TOTAL_COLS (f) = width;
|
||||
adjust_glyphs (f);
|
||||
w->pseudo_window_p = 1;
|
||||
|
|
|
@ -394,7 +394,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
|
|||
if (! menubar_widget)
|
||||
previous_menu_items_used = 0;
|
||||
|
||||
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
|
||||
buffer = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer);
|
||||
specbind (Qinhibit_quit, Qt);
|
||||
/* Don't let the debugger step into this code
|
||||
because it is not reentrant. */
|
||||
|
|
|
@ -649,7 +649,7 @@ static void
|
|||
x_update_window_end (struct window *w, int cursor_on_p,
|
||||
int mouse_face_overwritten_p)
|
||||
{
|
||||
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
|
||||
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame)));
|
||||
|
||||
if (!w->pseudo_window_p)
|
||||
{
|
||||
|
@ -754,7 +754,7 @@ x_after_update_window_line (struct glyph_row *desired_row)
|
|||
overhead is very small. */
|
||||
if (windows_or_buffers_changed
|
||||
&& desired_row->full_width_p
|
||||
&& (f = XFRAME (w->frame),
|
||||
&& (f = XFRAME (WVAR (w, frame)),
|
||||
width = FRAME_INTERNAL_BORDER_WIDTH (f),
|
||||
width != 0)
|
||||
&& (height = desired_row->visible_height,
|
||||
|
@ -2718,7 +2718,7 @@ x_ins_del_lines (struct frame *f, int vpos, int n)
|
|||
static void
|
||||
x_scroll_run (struct window *w, struct run *run)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
int x, y, width, height, from_y, to_y, bottom_y;
|
||||
HWND hwnd = FRAME_W32_WINDOW (f);
|
||||
HRGN expect_dirty;
|
||||
|
@ -3668,7 +3668,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
|
|||
my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar));
|
||||
|
||||
/* Dissociate this scroll bar from its window. */
|
||||
XWINDOW (bar->window)->vertical_scroll_bar = Qnil;
|
||||
WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil;
|
||||
|
||||
UNBLOCK_INPUT;
|
||||
}
|
||||
|
@ -3681,7 +3681,7 @@ static void
|
|||
w32_set_vertical_scroll_bar (struct window *w,
|
||||
int portion, int whole, int position)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
struct scroll_bar *bar;
|
||||
int top, height, left, sb_left, width, sb_width;
|
||||
int window_y, window_height;
|
||||
|
@ -3721,7 +3721,7 @@ w32_set_vertical_scroll_bar (struct window *w,
|
|||
|| WINDOW_RIGHT_MARGIN_COLS (w) == 0));
|
||||
|
||||
/* Does the scroll bar exist yet? */
|
||||
if (NILP (w->vertical_scroll_bar))
|
||||
if (NILP (WVAR (w, vertical_scroll_bar)))
|
||||
{
|
||||
HDC hdc;
|
||||
BLOCK_INPUT;
|
||||
|
@ -3743,7 +3743,7 @@ w32_set_vertical_scroll_bar (struct window *w,
|
|||
/* It may just need to be moved and resized. */
|
||||
HWND hwnd;
|
||||
|
||||
bar = XSCROLL_BAR (w->vertical_scroll_bar);
|
||||
bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar));
|
||||
hwnd = SCROLL_BAR_W32_WINDOW (bar);
|
||||
|
||||
/* If already correctly positioned, do nothing. */
|
||||
|
@ -3805,7 +3805,7 @@ w32_set_vertical_scroll_bar (struct window *w,
|
|||
|
||||
w32_set_scroll_bar_thumb (bar, portion, position, whole);
|
||||
|
||||
XSETVECTOR (w->vertical_scroll_bar, bar);
|
||||
XSETVECTOR (WVAR (w, vertical_scroll_bar), bar);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3849,10 +3849,10 @@ w32_redeem_scroll_bar (struct window *window)
|
|||
struct frame *f;
|
||||
|
||||
/* We can't redeem this window's scroll bar if it doesn't have one. */
|
||||
if (NILP (window->vertical_scroll_bar))
|
||||
if (NILP (WVAR (window, vertical_scroll_bar)))
|
||||
abort ();
|
||||
|
||||
bar = XSCROLL_BAR (window->vertical_scroll_bar);
|
||||
bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar));
|
||||
|
||||
/* Unlink it from the condemned list. */
|
||||
f = XFRAME (WINDOW_FRAME (window));
|
||||
|
@ -3860,11 +3860,11 @@ w32_redeem_scroll_bar (struct window *window)
|
|||
{
|
||||
/* If the prev pointer is nil, it must be the first in one of
|
||||
the lists. */
|
||||
if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
|
||||
if (EQ (FRAME_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar)))
|
||||
/* It's not condemned. Everything's fine. */
|
||||
return;
|
||||
else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
|
||||
window->vertical_scroll_bar))
|
||||
WVAR (window, vertical_scroll_bar)))
|
||||
FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
|
||||
else
|
||||
/* If its prev pointer is nil, it must be at the front of
|
||||
|
@ -4422,8 +4422,8 @@ w32_read_socket (struct terminal *terminal, int expected,
|
|||
create event iff we don't leave the
|
||||
selected frame. */
|
||||
&& (focus_follows_mouse
|
||||
|| (EQ (XWINDOW (window)->frame,
|
||||
XWINDOW (selected_window)->frame))))
|
||||
|| (EQ (WVAR (XWINDOW (window), frame),
|
||||
WVAR (XWINDOW (selected_window), frame)))))
|
||||
{
|
||||
inev.kind = SELECT_WINDOW_EVENT;
|
||||
inev.frame_or_window = window;
|
||||
|
@ -5038,7 +5038,7 @@ static void
|
|||
x_draw_bar_cursor (struct window *w, struct glyph_row *row,
|
||||
int width, enum text_cursor_kinds kind)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
struct glyph *cursor_glyph;
|
||||
|
||||
/* If cursor is out of bounds, don't draw garbage. This can happen
|
||||
|
|
1203
src/window.c
1203
src/window.c
File diff suppressed because it is too large
Load diff
142
src/window.h
142
src/window.h
|
@ -86,142 +86,150 @@ struct cursor_pos
|
|||
int hpos, vpos;
|
||||
};
|
||||
|
||||
/* Most code should use this macro to access Lisp fields in struct window. */
|
||||
|
||||
#define WVAR(w, field) ((w)->INTERNAL_FIELD (field))
|
||||
|
||||
struct window
|
||||
{
|
||||
/* This is for Lisp; the terminal code does not refer to it. */
|
||||
struct vectorlike_header header;
|
||||
|
||||
/* The frame this window is on. */
|
||||
Lisp_Object frame;
|
||||
Lisp_Object INTERNAL_FIELD (frame);
|
||||
|
||||
/* Following (to right or down) and preceding (to left or up) child
|
||||
at same level of tree. */
|
||||
Lisp_Object next, prev;
|
||||
Lisp_Object INTERNAL_FIELD (next);
|
||||
Lisp_Object INTERNAL_FIELD (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, vchild;
|
||||
Lisp_Object INTERNAL_FIELD (hchild);
|
||||
Lisp_Object INTERNAL_FIELD (vchild);
|
||||
|
||||
/* The window this one is a child of. */
|
||||
Lisp_Object parent;
|
||||
Lisp_Object INTERNAL_FIELD (parent);
|
||||
|
||||
/* The upper left corner coordinates of this window, as integers
|
||||
relative to upper left corner of frame = 0, 0. */
|
||||
Lisp_Object left_col;
|
||||
Lisp_Object top_line;
|
||||
Lisp_Object INTERNAL_FIELD (left_col);
|
||||
Lisp_Object INTERNAL_FIELD (top_line);
|
||||
|
||||
/* The size of the window. */
|
||||
Lisp_Object total_lines;
|
||||
Lisp_Object total_cols;
|
||||
Lisp_Object INTERNAL_FIELD (total_lines);
|
||||
Lisp_Object INTERNAL_FIELD (total_cols);
|
||||
|
||||
/* The normal size of the window. */
|
||||
Lisp_Object normal_lines;
|
||||
Lisp_Object normal_cols;
|
||||
Lisp_Object INTERNAL_FIELD (normal_lines);
|
||||
Lisp_Object INTERNAL_FIELD (normal_cols);
|
||||
|
||||
/* New sizes of the window. */
|
||||
Lisp_Object new_total;
|
||||
Lisp_Object new_normal;
|
||||
Lisp_Object INTERNAL_FIELD (new_total);
|
||||
Lisp_Object INTERNAL_FIELD (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;
|
||||
Lisp_Object INTERNAL_FIELD (buffer);
|
||||
|
||||
/* A marker pointing to where in the text to start displaying.
|
||||
BIDI Note: This is the _logical-order_ start, i.e. the smallest
|
||||
buffer position visible in the window, not necessarily the
|
||||
character displayed in the top left corner of the window. */
|
||||
Lisp_Object start;
|
||||
Lisp_Object INTERNAL_FIELD (start);
|
||||
|
||||
/* A marker pointing to where in the text point is in this window,
|
||||
used only when the window is not selected.
|
||||
This exists so that when multiple windows show one buffer
|
||||
each one can have its own value of point. */
|
||||
Lisp_Object pointm;
|
||||
Lisp_Object INTERNAL_FIELD (pointm);
|
||||
|
||||
/* No permanent meaning; used by save-window-excursion's
|
||||
bookkeeping. */
|
||||
Lisp_Object temslot;
|
||||
Lisp_Object INTERNAL_FIELD (temslot);
|
||||
|
||||
/* This window's vertical scroll bar. This field is only for use
|
||||
by the window-system-dependent code which implements the
|
||||
scroll bars; it can store anything it likes here. If this
|
||||
window is newly created and we haven't displayed a scroll bar in
|
||||
it yet, or if the frame doesn't have any scroll bars, this is nil. */
|
||||
Lisp_Object vertical_scroll_bar;
|
||||
Lisp_Object INTERNAL_FIELD (vertical_scroll_bar);
|
||||
|
||||
/* Width of left and right marginal areas. A value of nil means
|
||||
no margin. */
|
||||
Lisp_Object left_margin_cols, right_margin_cols;
|
||||
Lisp_Object INTERNAL_FIELD (left_margin_cols);
|
||||
Lisp_Object INTERNAL_FIELD (right_margin_cols);
|
||||
|
||||
/* Width of left and right fringes.
|
||||
A value of nil or t means use frame values. */
|
||||
Lisp_Object left_fringe_width, right_fringe_width;
|
||||
Lisp_Object INTERNAL_FIELD (left_fringe_width);
|
||||
Lisp_Object INTERNAL_FIELD (right_fringe_width);
|
||||
|
||||
/* Pixel width of scroll bars.
|
||||
A value of nil or t means use frame values. */
|
||||
Lisp_Object scroll_bar_width;
|
||||
Lisp_Object INTERNAL_FIELD (scroll_bar_width);
|
||||
|
||||
/* Type of vertical scroll bar. A value of nil means
|
||||
no scroll bar. A value of t means use frame value. */
|
||||
Lisp_Object vertical_scroll_bar_type;
|
||||
Lisp_Object INTERNAL_FIELD (vertical_scroll_bar_type);
|
||||
|
||||
/* Z - the buffer position of the last glyph in the current matrix
|
||||
of W. Only valid if WINDOW_END_VALID is not nil. */
|
||||
Lisp_Object window_end_pos;
|
||||
Lisp_Object INTERNAL_FIELD (window_end_pos);
|
||||
/* Glyph matrix row of the last glyph in the current matrix
|
||||
of W. Only valid if WINDOW_END_VALID is not nil. */
|
||||
Lisp_Object window_end_vpos;
|
||||
Lisp_Object INTERNAL_FIELD (window_end_vpos);
|
||||
/* t if window_end_pos is truly valid.
|
||||
This is nil if nontrivial redisplay is preempted
|
||||
since in that case the frame image that window_end_pos
|
||||
did not get onto the frame. */
|
||||
Lisp_Object window_end_valid;
|
||||
Lisp_Object INTERNAL_FIELD (window_end_valid);
|
||||
|
||||
/* Display-table to use for displaying chars in this window.
|
||||
Nil means use the buffer's own display-table. */
|
||||
Lisp_Object display_table;
|
||||
Lisp_Object INTERNAL_FIELD (display_table);
|
||||
|
||||
/* Non-nil usually means window is marked as dedicated.
|
||||
Note Lisp code may set this to something beyond Qnil
|
||||
and Qt, so bitfield can't be used here. */
|
||||
Lisp_Object dedicated;
|
||||
Lisp_Object INTERNAL_FIELD (dedicated);
|
||||
|
||||
/* Line number and position of a line somewhere above the top of the
|
||||
screen. If this field is nil, it means we don't have a base
|
||||
line. */
|
||||
Lisp_Object base_line_number;
|
||||
Lisp_Object INTERNAL_FIELD (base_line_number);
|
||||
/* If this field is nil, it means we don't have a base line.
|
||||
If it is a buffer, it means don't display the line number
|
||||
as long as the window shows that buffer. */
|
||||
Lisp_Object base_line_pos;
|
||||
Lisp_Object INTERNAL_FIELD (base_line_pos);
|
||||
|
||||
/* If we have highlighted the region (or any part of it),
|
||||
this is the mark position that we used, as an integer. */
|
||||
Lisp_Object region_showing;
|
||||
Lisp_Object INTERNAL_FIELD (region_showing);
|
||||
|
||||
/* The column number currently displayed in this window's mode line,
|
||||
or nil if column numbers are not being displayed. */
|
||||
Lisp_Object column_number_displayed;
|
||||
Lisp_Object INTERNAL_FIELD (column_number_displayed);
|
||||
|
||||
/* If redisplay in this window goes beyond this buffer position,
|
||||
must run the redisplay-end-trigger-hook. */
|
||||
Lisp_Object redisplay_end_trigger;
|
||||
Lisp_Object INTERNAL_FIELD (redisplay_end_trigger);
|
||||
|
||||
/* t means this window's child windows are not (re-)combined. */
|
||||
Lisp_Object combination_limit;
|
||||
Lisp_Object INTERNAL_FIELD (combination_limit);
|
||||
|
||||
/* Alist of <buffer, window-start, window-point> triples listing
|
||||
buffers previously shown in this window. */
|
||||
Lisp_Object prev_buffers;
|
||||
Lisp_Object INTERNAL_FIELD (prev_buffers);
|
||||
|
||||
/* List of buffers re-shown in this window. */
|
||||
Lisp_Object next_buffers;
|
||||
Lisp_Object INTERNAL_FIELD (next_buffers);
|
||||
|
||||
/* An alist with parameters. */
|
||||
Lisp_Object window_parameters;
|
||||
Lisp_Object INTERNAL_FIELD (window_parameters);
|
||||
|
||||
/* No Lisp data may follow below this point without changing
|
||||
mark_object in alloc.c. The member current_matrix must be the
|
||||
|
@ -388,13 +396,13 @@ struct window
|
|||
This includes scroll bars and fringes. */
|
||||
|
||||
#define WINDOW_TOTAL_COLS(W) \
|
||||
(XFASTINT ((W)->total_cols))
|
||||
(XFASTINT (WVAR (W, total_cols)))
|
||||
|
||||
/* Return the height of window W in canonical line units.
|
||||
This includes header and mode lines, if any. */
|
||||
|
||||
#define WINDOW_TOTAL_LINES(W) \
|
||||
(XFASTINT ((W)->total_lines))
|
||||
(XFASTINT (WVAR (W, total_lines)))
|
||||
|
||||
/* Return the total pixel width of window W. */
|
||||
|
||||
|
@ -422,7 +430,7 @@ struct window
|
|||
This includes a left-hand scroll bar, if any. */
|
||||
|
||||
#define WINDOW_LEFT_EDGE_COL(W) \
|
||||
(XFASTINT ((W)->left_col))
|
||||
(XFASTINT (WVAR (W, left_col)))
|
||||
|
||||
/* Return the canonical frame column before which window W ends.
|
||||
This includes a right-hand scroll bar, if any. */
|
||||
|
@ -434,7 +442,7 @@ struct window
|
|||
This includes a header line, if any. */
|
||||
|
||||
#define WINDOW_TOP_EDGE_LINE(W) \
|
||||
(XFASTINT ((W)->top_line))
|
||||
(XFASTINT (WVAR (W, top_line)))
|
||||
|
||||
/* Return the canonical frame line before which window W ends.
|
||||
This includes a mode line, if any. */
|
||||
|
@ -539,31 +547,31 @@ struct window
|
|||
/* Width of left margin area in columns. */
|
||||
|
||||
#define WINDOW_LEFT_MARGIN_COLS(W) \
|
||||
(NILP ((W)->left_margin_cols) \
|
||||
(NILP (WVAR (W, left_margin_cols)) \
|
||||
? 0 \
|
||||
: XINT ((W)->left_margin_cols))
|
||||
: XINT (WVAR (W, left_margin_cols)))
|
||||
|
||||
/* Width of right marginal area in columns. */
|
||||
|
||||
#define WINDOW_RIGHT_MARGIN_COLS(W) \
|
||||
(NILP ((W)->right_margin_cols) \
|
||||
(NILP (WVAR (W, right_margin_cols)) \
|
||||
? 0 \
|
||||
: XINT ((W)->right_margin_cols))
|
||||
: XINT (WVAR (W, right_margin_cols)))
|
||||
|
||||
/* Width of left margin area in pixels. */
|
||||
|
||||
#define WINDOW_LEFT_MARGIN_WIDTH(W) \
|
||||
(NILP ((W)->left_margin_cols) \
|
||||
(NILP (WVAR (W, left_margin_cols)) \
|
||||
? 0 \
|
||||
: (XINT ((W)->left_margin_cols) \
|
||||
: (XINT (WVAR (W, left_margin_cols)) \
|
||||
* WINDOW_FRAME_COLUMN_WIDTH (W)))
|
||||
|
||||
/* Width of right marginal area in pixels. */
|
||||
|
||||
#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
|
||||
(NILP ((W)->right_margin_cols) \
|
||||
(NILP (WVAR (W, right_margin_cols)) \
|
||||
? 0 \
|
||||
: (XINT ((W)->right_margin_cols) \
|
||||
: (XINT (WVAR (W, right_margin_cols)) \
|
||||
* WINDOW_FRAME_COLUMN_WIDTH (W)))
|
||||
|
||||
/* Total width of fringes reserved for drawing truncation bitmaps,
|
||||
|
@ -573,8 +581,8 @@ struct window
|
|||
able to split windows horizontally nicely. */
|
||||
|
||||
#define WINDOW_FRINGE_COLS(W) \
|
||||
((INTEGERP ((W)->left_fringe_width) \
|
||||
|| INTEGERP ((W)->right_fringe_width)) \
|
||||
((INTEGERP (WVAR (W, left_fringe_width)) \
|
||||
|| INTEGERP (WVAR (W, right_fringe_width))) \
|
||||
? ((WINDOW_LEFT_FRINGE_WIDTH (W) \
|
||||
+ WINDOW_RIGHT_FRINGE_WIDTH (W) \
|
||||
+ WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
|
||||
|
@ -596,13 +604,13 @@ struct window
|
|||
/* Pixel-width of the left and right fringe. */
|
||||
|
||||
#define WINDOW_LEFT_FRINGE_WIDTH(W) \
|
||||
(INTEGERP ((W)->left_fringe_width) \
|
||||
? XFASTINT ((W)->left_fringe_width) \
|
||||
(INTEGERP (WVAR (W, left_fringe_width)) \
|
||||
? XFASTINT (WVAR (W, left_fringe_width)) \
|
||||
: FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
|
||||
|
||||
#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
|
||||
(INTEGERP ((W)->right_fringe_width) \
|
||||
? XFASTINT ((W)->right_fringe_width) \
|
||||
(INTEGERP (WVAR (W, right_fringe_width)) \
|
||||
? XFASTINT (WVAR (W, right_fringe_width)) \
|
||||
: FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
|
||||
|
||||
/* Total width of fringes in pixels. */
|
||||
|
@ -619,36 +627,36 @@ struct window
|
|||
and which side they are on. */
|
||||
|
||||
#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \
|
||||
(EQ ((w)->vertical_scroll_bar_type, Qt) \
|
||||
(EQ (WVAR (w, vertical_scroll_bar_type), Qt) \
|
||||
? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \
|
||||
: EQ ((w)->vertical_scroll_bar_type, Qleft) \
|
||||
: EQ (WVAR (w, vertical_scroll_bar_type), Qleft) \
|
||||
? vertical_scroll_bar_left \
|
||||
: EQ ((w)->vertical_scroll_bar_type, Qright) \
|
||||
: EQ (WVAR (w, vertical_scroll_bar_type), Qright) \
|
||||
? vertical_scroll_bar_right \
|
||||
: vertical_scroll_bar_none) \
|
||||
|
||||
#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \
|
||||
(EQ ((w)->vertical_scroll_bar_type, Qt) \
|
||||
(EQ (WVAR (w, vertical_scroll_bar_type), Qt) \
|
||||
? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \
|
||||
: !NILP ((w)->vertical_scroll_bar_type))
|
||||
: !NILP (WVAR (w, vertical_scroll_bar_type)))
|
||||
|
||||
#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \
|
||||
(EQ ((w)->vertical_scroll_bar_type, Qt) \
|
||||
(EQ (WVAR (w, vertical_scroll_bar_type), Qt) \
|
||||
? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \
|
||||
: EQ ((w)->vertical_scroll_bar_type, Qleft))
|
||||
: EQ (WVAR (w, vertical_scroll_bar_type), Qleft))
|
||||
|
||||
#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \
|
||||
(EQ ((w)->vertical_scroll_bar_type, Qt) \
|
||||
(EQ (WVAR (w, vertical_scroll_bar_type), Qt) \
|
||||
? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\
|
||||
: EQ ((w)->vertical_scroll_bar_type, Qright))
|
||||
: EQ (WVAR (w, vertical_scroll_bar_type), Qright))
|
||||
|
||||
/* Width that a scroll bar in window W should have, if there is one.
|
||||
Measured in pixels. If scroll bars are turned off, this is still
|
||||
nonzero. */
|
||||
|
||||
#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \
|
||||
(INTEGERP ((w)->scroll_bar_width) \
|
||||
? XFASTINT ((w)->scroll_bar_width) \
|
||||
(INTEGERP (WVAR (w, scroll_bar_width)) \
|
||||
? XFASTINT (WVAR (w, scroll_bar_width)) \
|
||||
: FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w)))
|
||||
|
||||
/* Width that a scroll bar in window W should have, if there is one.
|
||||
|
@ -656,8 +664,8 @@ struct window
|
|||
this is still nonzero. */
|
||||
|
||||
#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \
|
||||
(INTEGERP ((w)->scroll_bar_width) \
|
||||
? ((XFASTINT ((w)->scroll_bar_width) \
|
||||
(INTEGERP (WVAR (w, scroll_bar_width)) \
|
||||
? ((XFASTINT (WVAR (w, scroll_bar_width)) \
|
||||
+ WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \
|
||||
/ WINDOW_FRAME_COLUMN_WIDTH (w)) \
|
||||
: FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w)))
|
||||
|
@ -880,7 +888,7 @@ struct glyph *get_phys_cursor_glyph (struct window *w);
|
|||
/* Value is non-zero if WINDOW is a live window. */
|
||||
|
||||
#define WINDOW_LIVE_P(WINDOW) \
|
||||
(WINDOWP ((WINDOW)) && !NILP (XWINDOW ((WINDOW))->buffer))
|
||||
(WINDOWP ((WINDOW)) && !NILP (WVAR (XWINDOW ((WINDOW)), buffer)))
|
||||
|
||||
|
||||
/* These used to be in lisp.h. */
|
||||
|
|
660
src/xdisp.c
660
src/xdisp.c
File diff suppressed because it is too large
Load diff
12
src/xfaces.c
12
src/xfaces.c
|
@ -6031,7 +6031,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
|
|||
ptrdiff_t *endptr, ptrdiff_t limit,
|
||||
int mouse, int base_face_id)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
Lisp_Object attrs[LFACE_VECTOR_SIZE];
|
||||
Lisp_Object prop, position;
|
||||
ptrdiff_t i, noverlays;
|
||||
|
@ -6055,9 +6055,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, WVAR (w, buffer));
|
||||
XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
|
||||
end = Fnext_single_property_change (position, propname, w->buffer, limit1);
|
||||
end = Fnext_single_property_change (position, propname, WVAR (w, buffer), limit1);
|
||||
if (INTEGERP (end))
|
||||
endpos = XINT (end);
|
||||
|
||||
|
@ -6143,7 +6143,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
|
|||
ptrdiff_t *endptr, ptrdiff_t limit,
|
||||
int mouse, Lisp_Object overlay)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
Lisp_Object attrs[LFACE_VECTOR_SIZE];
|
||||
Lisp_Object prop, position;
|
||||
Lisp_Object frame;
|
||||
|
@ -6165,9 +6165,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, WVAR (w, buffer));
|
||||
XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
|
||||
end = Fnext_single_property_change (position, propname, w->buffer, limit1);
|
||||
end = Fnext_single_property_change (position, propname, WVAR (w, buffer), limit1);
|
||||
if (INTEGERP (end))
|
||||
endpos = XINT (end);
|
||||
|
||||
|
|
18
src/xfns.c
18
src/xfns.c
|
@ -2260,7 +2260,7 @@ free_frame_xic (struct frame *f)
|
|||
void
|
||||
xic_set_preeditarea (struct window *w, int x, int y)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
XVaNestedList attr;
|
||||
XPoint spot;
|
||||
|
||||
|
@ -5069,28 +5069,28 @@ Text larger than the specified size is clipped. */)
|
|||
|
||||
/* Set up the frame's root window. */
|
||||
w = XWINDOW (FRAME_ROOT_WINDOW (f));
|
||||
w->left_col = w->top_line = make_number (0);
|
||||
WVAR (w, left_col) = WVAR (w, top_line) = make_number (0);
|
||||
|
||||
if (CONSP (Vx_max_tooltip_size)
|
||||
&& RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX)
|
||||
&& RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX))
|
||||
{
|
||||
w->total_cols = XCAR (Vx_max_tooltip_size);
|
||||
w->total_lines = XCDR (Vx_max_tooltip_size);
|
||||
WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size);
|
||||
WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
w->total_cols = make_number (80);
|
||||
w->total_lines = make_number (40);
|
||||
WVAR (w, total_cols) = make_number (80);
|
||||
WVAR (w, total_lines) = make_number (40);
|
||||
}
|
||||
|
||||
FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
|
||||
FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols));
|
||||
adjust_glyphs (f);
|
||||
w->pseudo_window_p = 1;
|
||||
|
||||
/* 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 (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer)));
|
||||
BVAR (current_buffer, truncate_lines) = Qnil;
|
||||
clear_glyph_matrix (w->desired_matrix);
|
||||
clear_glyph_matrix (w->current_matrix);
|
||||
|
@ -5151,7 +5151,7 @@ Text larger than the specified size is clipped. */)
|
|||
/* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
|
||||
not in pixels. */
|
||||
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
|
||||
w->total_cols = make_number (width);
|
||||
WVAR (w, total_cols) = make_number (width);
|
||||
FRAME_TOTAL_COLS (f) = width;
|
||||
adjust_glyphs (f);
|
||||
clear_glyph_matrix (w->desired_matrix);
|
||||
|
|
|
@ -985,7 +985,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
|
|||
if (! menubar_widget)
|
||||
previous_menu_items_used = 0;
|
||||
|
||||
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
|
||||
buffer = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer);
|
||||
specbind (Qinhibit_quit, Qt);
|
||||
/* Don't let the debugger step into this code
|
||||
because it is not reentrant. */
|
||||
|
|
42
src/xterm.c
42
src/xterm.c
|
@ -628,7 +628,7 @@ x_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
|
|||
static void
|
||||
x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p)
|
||||
{
|
||||
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
|
||||
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame)));
|
||||
|
||||
if (!w->pseudo_window_p)
|
||||
{
|
||||
|
@ -728,7 +728,7 @@ x_after_update_window_line (struct glyph_row *desired_row)
|
|||
overhead is very small. */
|
||||
if (windows_or_buffers_changed
|
||||
&& desired_row->full_width_p
|
||||
&& (f = XFRAME (w->frame),
|
||||
&& (f = XFRAME (WVAR (w, frame)),
|
||||
width = FRAME_INTERNAL_BORDER_WIDTH (f),
|
||||
width != 0)
|
||||
&& (height = desired_row->visible_height,
|
||||
|
@ -3295,7 +3295,7 @@ x_ins_del_lines (struct frame *f, int vpos, int n)
|
|||
static void
|
||||
x_scroll_run (struct window *w, struct run *run)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
int x, y, width, height, from_y, to_y, bottom_y;
|
||||
|
||||
/* Get frame-relative bounding box of the text display area of W,
|
||||
|
@ -4244,9 +4244,9 @@ xt_action_hook (Widget widget, XtPointer client_data, String action_name,
|
|||
scroll_bar_end_scroll, 0, 0);
|
||||
w = XWINDOW (window_being_scrolled);
|
||||
|
||||
if (!NILP (XSCROLL_BAR (w->vertical_scroll_bar)->dragging))
|
||||
if (!NILP (XSCROLL_BAR (WVAR (w, vertical_scroll_bar))->dragging))
|
||||
{
|
||||
XSCROLL_BAR (w->vertical_scroll_bar)->dragging = Qnil;
|
||||
XSCROLL_BAR (WVAR (w, vertical_scroll_bar))->dragging = Qnil;
|
||||
/* The thumb size is incorrect while dragging: fix it. */
|
||||
set_vertical_scroll_bar (w);
|
||||
}
|
||||
|
@ -4277,7 +4277,7 @@ x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
|
|||
XEvent event;
|
||||
XClientMessageEvent *ev = (XClientMessageEvent *) &event;
|
||||
struct window *w = XWINDOW (window);
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
ptrdiff_t i;
|
||||
|
||||
BLOCK_INPUT;
|
||||
|
@ -4353,7 +4353,7 @@ x_scroll_bar_to_input_event (XEvent *event, struct input_event *ievent)
|
|||
ievent->timestamp = CurrentTime;
|
||||
#else
|
||||
ievent->timestamp =
|
||||
XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (w->frame)));
|
||||
XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WVAR (w, frame))));
|
||||
#endif
|
||||
ievent->part = ev->data.l[1];
|
||||
ievent->code = ev->data.l[2];
|
||||
|
@ -4954,7 +4954,7 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio
|
|||
static struct scroll_bar *
|
||||
x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
struct scroll_bar *bar
|
||||
= ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER);
|
||||
|
||||
|
@ -5180,7 +5180,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
|
|||
#endif
|
||||
|
||||
/* Dissociate this scroll bar from its window. */
|
||||
XWINDOW (bar->window)->vertical_scroll_bar = Qnil;
|
||||
WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil;
|
||||
|
||||
UNBLOCK_INPUT;
|
||||
}
|
||||
|
@ -5194,7 +5194,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
|
|||
static void
|
||||
XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
struct scroll_bar *bar;
|
||||
int top, height, left, sb_left, width, sb_width;
|
||||
int window_y, window_height;
|
||||
|
@ -5245,7 +5245,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
|
|||
#endif
|
||||
|
||||
/* Does the scroll bar exist yet? */
|
||||
if (NILP (w->vertical_scroll_bar))
|
||||
if (NILP (WVAR (w, vertical_scroll_bar)))
|
||||
{
|
||||
if (width > 0 && height > 0)
|
||||
{
|
||||
|
@ -5268,7 +5268,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
|
|||
/* It may just need to be moved and resized. */
|
||||
unsigned int mask = 0;
|
||||
|
||||
bar = XSCROLL_BAR (w->vertical_scroll_bar);
|
||||
bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar));
|
||||
|
||||
BLOCK_INPUT;
|
||||
|
||||
|
@ -5392,7 +5392,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
|
|||
}
|
||||
#endif /* not USE_TOOLKIT_SCROLL_BARS */
|
||||
|
||||
XSETVECTOR (w->vertical_scroll_bar, bar);
|
||||
XSETVECTOR (WVAR (w, vertical_scroll_bar), bar);
|
||||
}
|
||||
|
||||
|
||||
|
@ -5436,10 +5436,10 @@ XTredeem_scroll_bar (struct window *window)
|
|||
struct frame *f;
|
||||
|
||||
/* We can't redeem this window's scroll bar if it doesn't have one. */
|
||||
if (NILP (window->vertical_scroll_bar))
|
||||
if (NILP (WVAR (window, vertical_scroll_bar)))
|
||||
abort ();
|
||||
|
||||
bar = XSCROLL_BAR (window->vertical_scroll_bar);
|
||||
bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar));
|
||||
|
||||
/* Unlink it from the condemned list. */
|
||||
f = XFRAME (WINDOW_FRAME (window));
|
||||
|
@ -5447,11 +5447,11 @@ XTredeem_scroll_bar (struct window *window)
|
|||
{
|
||||
/* If the prev pointer is nil, it must be the first in one of
|
||||
the lists. */
|
||||
if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
|
||||
if (EQ (FRAME_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar)))
|
||||
/* It's not condemned. Everything's fine. */
|
||||
return;
|
||||
else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
|
||||
window->vertical_scroll_bar))
|
||||
WVAR (window, vertical_scroll_bar)))
|
||||
FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
|
||||
else
|
||||
/* If its prev pointer is nil, it must be at the front of
|
||||
|
@ -5610,7 +5610,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_e
|
|||
static void
|
||||
x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event)
|
||||
{
|
||||
FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame);
|
||||
FRAME_PTR f = XFRAME (WVAR (XWINDOW (bar->window), frame));
|
||||
|
||||
last_mouse_movement_time = event->xmotion.time;
|
||||
|
||||
|
@ -6784,8 +6784,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
|
|||
create event iff we don't leave the
|
||||
selected frame. */
|
||||
&& (focus_follows_mouse
|
||||
|| (EQ (XWINDOW (window)->frame,
|
||||
XWINDOW (selected_window)->frame))))
|
||||
|| (EQ (WVAR (XWINDOW (window), frame),
|
||||
WVAR (XWINDOW (selected_window), frame)))))
|
||||
{
|
||||
inev.ie.kind = SELECT_WINDOW_EVENT;
|
||||
inev.ie.frame_or_window = window;
|
||||
|
@ -7334,7 +7334,7 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
|
|||
static void
|
||||
x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind)
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *f = XFRAME (WVAR (w, frame));
|
||||
struct glyph *cursor_glyph;
|
||||
|
||||
/* If cursor is out of bounds, don't draw garbage. This can happen
|
||||
|
|
Loading…
Add table
Reference in a new issue