"%"pMu": window %p (`%s')%s\n%s",
history_tick++,
w,
- ((BUFFERP (w->buffer)
- && STRINGP (BVAR (XBUFFER (w->buffer), name)))
- ? SSDATA (BVAR (XBUFFER (w->buffer), name))
+ ((BUFFERP (w->contents)
+ && STRINGP (BVAR (XBUFFER (w->contents), name)))
+ ? SSDATA (BVAR (XBUFFER (w->contents), name))
: "???"),
paused_p ? " ***paused***" : "",
msg);
if (NUMBERP (margin))
{
- int width = XFASTINT (w->total_cols);
+ int width = w->total_cols;
double d = max (0, XFLOATINT (margin));
d = min (width / 2 - 1, d);
n = (int) ((double) total_glyphs / width * d);
if (f->current_matrix)
clear_glyph_matrix (f->current_matrix);
+#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
/* Clear the matrix of the menu bar window, if such a window exists.
The menu bar window is currently used to display menus on X when
no toolkit support is compiled in. */
if (WINDOWP (f->menu_bar_window))
clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
+#endif
/* Clear the matrix of the tool-bar window, if any. */
if (WINDOWP (f->tool_bar_window))
if (f->desired_matrix)
clear_glyph_matrix (f->desired_matrix);
+#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
if (WINDOWP (f->menu_bar_window))
clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix);
+#endif
if (WINDOWP (f->tool_bar_window))
clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix);
{
while (w)
{
- if (!NILP (w->hchild))
- {
- eassert (WINDOWP (w->hchild));
- clear_window_matrices (XWINDOW (w->hchild), desired_p);
- }
- else if (!NILP (w->vchild))
- {
- eassert (WINDOWP (w->vchild));
- clear_window_matrices (XWINDOW (w->vchild), desired_p);
- }
+ if (WINDOWP (w->contents))
+ clear_window_matrices (XWINDOW (w->contents), desired_p);
else
{
if (desired_p)
struct glyph_row *row = matrix->rows;
struct glyph_row *last_text_row = NULL;
struct buffer *saved = current_buffer;
- struct buffer *buffer = XBUFFER (w->buffer);
+ struct buffer *buffer = XBUFFER (w->contents);
int c;
/* This can sometimes happen for a fresh window. */
vertically below other windows. */
in_horz_combination_p
= (!NILP (XWINDOW (window)->parent)
- && !NILP (XWINDOW (XWINDOW (window)->parent)->hchild));
+ && WINDOW_HORIZONTAL_COMBINATION_P (XWINDOW (XWINDOW (window)->parent)));
/* For WINDOW and all windows on the same level. */
do
/* Get the dimension of the window sub-matrix for W, depending
on whether this is a combination or a leaf window. */
- if (!NILP (w->hchild))
- dim = allocate_matrices_for_frame_redisplay (w->hchild, x, y,
- dim_only_p,
- window_change_flags);
- else if (!NILP (w->vchild))
- dim = allocate_matrices_for_frame_redisplay (w->vchild, x, y,
+ if (WINDOWP (w->contents))
+ dim = allocate_matrices_for_frame_redisplay (w->contents, x, y,
dim_only_p,
window_change_flags);
else
}
#endif /* HAVE_WINDOW_SYSTEM */
- return XINT (w->total_cols);
+ return w->total_cols;
}
{
while (w)
{
- if (!NILP (w->vchild))
- allocate_matrices_for_window_redisplay (XWINDOW (w->vchild));
- else if (!NILP (w->hchild))
- allocate_matrices_for_window_redisplay (XWINDOW (w->hchild));
+ if (WINDOWP (w->contents))
+ allocate_matrices_for_window_redisplay (XWINDOW (w->contents));
else
{
/* W is a leaf window. */
{
while (w)
{
- if (!NILP (w->hchild))
+ if (WINDOWP (w->contents))
{
- if (showing_window_margins_p (XWINDOW (w->hchild)))
+ if (showing_window_margins_p (XWINDOW (w->contents)))
return 1;
}
- else if (!NILP (w->vchild))
- {
- if (showing_window_margins_p (XWINDOW (w->vchild)))
- return 1;
- }
- else if (!NILP (w->left_margin_cols)
- || !NILP (w->right_margin_cols))
+ else if (!NILP (w->left_margin_cols) || !NILP (w->right_margin_cols))
return 1;
w = NILP (w->next) ? 0 : XWINDOW (w->next);
{
w = XWINDOW (window);
- if (!NILP (w->hchild))
- fake_current_matrices (w->hchild);
- else if (!NILP (w->vchild))
- fake_current_matrices (w->vchild);
+ if (WINDOWP (w->contents))
+ fake_current_matrices (w->contents);
else
{
int i;
/* Set window dimensions to frame dimensions and allocate or
adjust glyph matrices of W. */
- wset_top_line (w, make_number (0));
- wset_left_col (w, make_number (0));
- wset_total_lines (w, make_number (FRAME_MENU_BAR_LINES (f)));
- wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f)));
+ w->top_line = 0;
+ w->left_col = 0;
+ w->total_lines = FRAME_MENU_BAR_LINES (f);
+ w->total_cols = FRAME_TOTAL_COLS (f);
allocate_matrices_for_window_redisplay (w);
}
#endif /* not USE_X_TOOLKIT && not USE_GTK */
else
w = XWINDOW (f->tool_bar_window);
- wset_top_line (w, make_number (FRAME_MENU_BAR_LINES (f)));
- wset_left_col (w, make_number (0));
- wset_total_lines (w, make_number (FRAME_TOOL_BAR_LINES (f)));
- wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f)));
+ w->top_line = FRAME_MENU_BAR_LINES (f);
+ w->left_col = 0;
+ w->total_lines = FRAME_TOOL_BAR_LINES (f);
+ w->total_cols = FRAME_TOTAL_COLS (f);
allocate_matrices_for_window_redisplay (w);
}
#endif
if (!NILP (f->root_window))
free_window_matrices (XWINDOW (f->root_window));
+#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
/* Free the dummy window for menu bars without X toolkit and its
glyph matrices. */
if (!NILP (f->menu_bar_window))
w->desired_matrix = w->current_matrix = NULL;
fset_menu_bar_window (f, Qnil);
}
+#endif
/* Free the tool bar window and its glyph matrices. */
if (!NILP (f->tool_bar_window))
{
while (w)
{
- if (!NILP (w->hchild))
- free_window_matrices (XWINDOW (w->hchild));
- else if (!NILP (w->vchild))
- free_window_matrices (XWINDOW (w->vchild));
+ if (WINDOWP (w->contents))
+ free_window_matrices (XWINDOW (w->contents));
else
{
/* This is a leaf window. Free its memory and reset fields
{
while (w)
{
- if (!NILP (w->hchild))
- build_frame_matrix_from_window_tree (matrix, XWINDOW (w->hchild));
- else if (!NILP (w->vchild))
- build_frame_matrix_from_window_tree (matrix, XWINDOW (w->vchild));
+ if (WINDOWP (w->contents))
+ build_frame_matrix_from_window_tree (matrix, XWINDOW (w->contents));
else
build_frame_matrix_from_leaf_window (matrix, w);
{
while (w)
{
- if (!NILP (w->hchild))
- mirror_make_current (XWINDOW (w->hchild), frame_row);
- else if (!NILP (w->vchild))
- mirror_make_current (XWINDOW (w->vchild), frame_row);
+ if (WINDOWP (w->contents))
+ mirror_make_current (XWINDOW (w->contents), frame_row);
else
{
/* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS
struct glyph_row *window_row, *window_row_end, *frame_row;
int left, right, x, width;
- /* Preconditions: W must be a leaf window on a tty frame. */
- eassert (NILP (w->hchild) && NILP (w->vchild));
+ /* Preconditions: W must be a live window on a tty frame. */
+ eassert (BUFFERP (w->contents));
eassert (!FRAME_WINDOW_P (f));
left = margin_glyphs_to_reserve (w, 1, w->left_margin_cols);
while (w && !found)
{
- if (!NILP (w->hchild))
- found = frame_row_to_window (XWINDOW (w->hchild), row);
- else if (!NILP (w->vchild))
- found = frame_row_to_window (XWINDOW (w->vchild), row);
+ if (WINDOWP (w->contents))
+ found = frame_row_to_window (XWINDOW (w->contents), row);
else if (row >= WINDOW_TOP_EDGE_LINE (w)
&& row < WINDOW_BOTTOM_EDGE_LINE (w))
found = w;
{
while (w)
{
- if (!NILP (w->hchild))
- mirror_line_dance (XWINDOW (w->hchild), unchanged_at_top,
- nlines, copy_from, retained_p);
- else if (!NILP (w->vchild))
- mirror_line_dance (XWINDOW (w->vchild), unchanged_at_top,
+ if (WINDOWP (w->contents))
+ mirror_line_dance (XWINDOW (w->contents), unchanged_at_top,
nlines, copy_from, retained_p);
else
{
{
while (w)
{
- if (!NILP (w->hchild))
- check_window_matrix_pointers (XWINDOW (w->hchild));
- else if (!NILP (w->vchild))
- check_window_matrix_pointers (XWINDOW (w->vchild));
+ if (WINDOWP (w->contents))
+ check_window_matrix_pointers (XWINDOW (w->contents));
else
{
struct frame *f = XFRAME (w->frame);
when pending input is detected. */
update_begin (f);
+#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
/* Update the menu bar on X frames that don't have toolkit
support. */
if (WINDOWP (f->menu_bar_window))
update_window (XWINDOW (f->menu_bar_window), 1);
+#endif
/* Update the tool-bar window, if present. */
if (WINDOWP (f->tool_bar_window))
while (w && !paused_p)
{
- if (!NILP (w->hchild))
- paused_p |= update_window_tree (XWINDOW (w->hchild), force_p);
- else if (!NILP (w->vchild))
- paused_p |= update_window_tree (XWINDOW (w->vchild), force_p);
+ if (WINDOWP (w->contents))
+ paused_p |= update_window_tree (XWINDOW (w->contents), force_p);
else if (w->must_be_updated_p)
paused_p |= update_window (w, force_p);
rif->update_window_begin_hook (w);
yb = window_text_bottom_y (w);
- row = desired_matrix->rows;
- end = row + desired_matrix->nrows - 1;
+ row = MATRIX_ROW (desired_matrix, 0);
+ end = MATRIX_MODE_LINE_ROW (desired_matrix);
/* Take note of the header line, if there is one. We will
update it below, after updating all of the window's lines. */
{
while (w)
{
- if (!NILP (w->hchild))
- set_window_update_flags (XWINDOW (w->hchild), on_p);
- else if (!NILP (w->vchild))
- set_window_update_flags (XWINDOW (w->vchild), on_p);
+ if (WINDOWP (w->contents))
+ set_window_update_flags (XWINDOW (w->contents), on_p);
else
w->must_be_updated_p = on_p;
row_table[row_entry_pool[i].bucket] = NULL;
/* Value is 1 to indicate that we scrolled the display. */
- return 0 < nruns;
+ return nruns > 0;
}
/* We used to set current_buffer directly here, but that does the
wrong thing with `face-remapping-alist' (bug#2044). */
- Fset_buffer (w->buffer);
+ Fset_buffer (w->contents);
itdata = bidi_shelve_cache ();
SET_TEXT_POS_FROM_MARKER (startp, w->start);
CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
*dx = x0 + it.first_visible_x - it.current_x;
*dy = *y - it.current_y;
- string = w->buffer;
+ string = w->contents;
if (STRINGP (it.string))
string = it.string;
*pos = it.current;
if (STRINGP (it.string))
BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos));
else
- BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer),
+ BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->contents),
CHARPOS (pos->pos));
}
FrameCols (FRAME_TTY (f)) = newwidth;
if (WINDOWP (f->tool_bar_window))
- wset_total_cols (XWINDOW (f->tool_bar_window), make_number (newwidth));
+ XWINDOW (f->tool_bar_window)->total_cols = newwidth;
}
FRAME_LINES (f) = newheight;
if (noninteractive)
putchar (07);
else if (!INTERACTIVE) /* Stop executing a keyboard macro. */
- error ("Keyboard macro terminated by a command ringing the bell");
+ {
+ const char *msg
+ = "Keyboard macro terminated by a command ringing the bell";
+ Fsignal (Quser_error, Fcons (build_string (msg), Qnil));
+ }
else
ring_bell (XFRAME (selected_frame));
}
duration += XINT (milliseconds) / 1000.0;
}
- if (0 < duration)
+ if (duration > 0)
{
EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (duration);
wait_reading_process_output (min (EMACS_SECS (t), WAIT_READING_MAX),
if (INTEGERP (timeout))
{
sec = XINT (timeout);
- if (! (0 < sec))
+ if (sec <= 0)
return Qt;
nsec = 0;
}
inverse_video = 0;
cursor_in_echo_area = 0;
- terminal_type = (char *) 0;
/* Now is the time to initialize this; it's used by init_sys_modes
during startup. */
/* If no window system has been specified, try to use the terminal. */
if (! isatty (0))
- {
- fatal ("standard input is not a tty");
- exit (1);
- }
+ fatal ("standard input is not a tty");
#ifdef WINDOWSNT
terminal_type = "w32console";
#else
- /* Look at the TERM variable. */
- terminal_type = (char *) getenv ("TERM");
+ terminal_type = getenv ("TERM");
#endif
if (!terminal_type)
{