Commit 045dee35 authored by Gerd Moellmann's avatar Gerd Moellmann

Change

`top-line' and `top_line' to `header-line' and `header_line'.
Likewise for similar spellings.
parent e5e7779f
......@@ -3850,7 +3850,7 @@ init_buffer_once ()
/* real setup is done in loaddefs.el */
buffer_defaults.mode_line_format = build_string ("%-");
buffer_defaults.top_line_format = Qnil;
buffer_defaults.header_line_format = Qnil;
buffer_defaults.abbrev_mode = Qnil;
buffer_defaults.overwrite_mode = Qnil;
buffer_defaults.case_fold_search = Qt;
......@@ -3949,7 +3949,7 @@ init_buffer_once ()
XSETFASTINT (buffer_local_flags.indicate_empty_lines, 0x400000);
XSETFASTINT (buffer_local_flags.scroll_up_aggressively, 0x800000);
XSETFASTINT (buffer_local_flags.scroll_down_aggressively, 0x1000000);
XSETFASTINT (buffer_local_flags.top_line_format, 0x2000000);
XSETFASTINT (buffer_local_flags.header_line_format, 0x2000000);
Vbuffer_alist = Qnil;
current_buffer = 0;
......@@ -4097,10 +4097,10 @@ syms_of_buffer ()
"Default value of `mode-line-format' for buffers that don't override it.\n\
This is the same as (default-value 'mode-line-format).");
DEFVAR_LISP_NOPRO ("default-top-line-format",
&buffer_defaults.top_line_format,
"Default value of `top-line-format' for buffers that don't override it.\n\
This is the same as (default-value 'top-line-format).");
DEFVAR_LISP_NOPRO ("default-header-line-format",
&buffer_defaults.header_line_format,
"Default value of `header-line-format' for buffers that don't override it.\n\
This is the same as (default-value 'header-line-format).");
DEFVAR_LISP_NOPRO ("default-abbrev-mode",
&buffer_defaults.abbrev_mode,
......@@ -4187,7 +4187,8 @@ don't override it. This is the same as (default-value\n\
don't override it. This is the same as (default-value\n\
'scroll-down-aggressively).");
DEFVAR_PER_BUFFER ("top-line-format", &current_buffer->top_line_format,
DEFVAR_PER_BUFFER ("header-line-format",
&current_buffer->header_line_format,
Qnil,
"Analogous to `mode-line-format', but for a mode line displayed\n\
at the top of windows.");
......
......@@ -587,7 +587,7 @@ struct buffer
/* Analogous to mode_line_format for the line displayed at the top
of windows. Nil means don't display that line. */
Lisp_Object top_line_format;
Lisp_Object header_line_format;
/* Keys that are bound local to this buffer. */
Lisp_Object keymap;
......
......@@ -461,7 +461,7 @@ struct glyph_matrix
/* Non-zero means window displayed in this matrix has a top mode
line. */
unsigned top_line_p : 1;
unsigned header_line_p : 1;
#ifdef GLYPH_DEBUG
/* A string identifying the method used to display the matrix. */
......@@ -674,7 +674,7 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int));
This is always the first row in MATRIX because that's the only
way that works in frame-based redisplay. */
#define MATRIX_TOP_LINE_ROW(MATRIX) (MATRIX)->rows
#define MATRIX_HEADER_LINE_ROW(MATRIX) (MATRIX)->rows
/* Return a pointer to first row in MATRIX used for text display. */
......@@ -744,7 +744,7 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int));
#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW) \
(MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \
&& (ROW)->y < WINDOW_DISPLAY_TOP_LINE_HEIGHT ((W)))
&& (ROW)->y < WINDOW_DISPLAY_HEADER_LINE_HEIGHT ((W)))
/* Non-zero if ROW is partially visible at the bottom of window W. */
......@@ -863,9 +863,9 @@ extern struct glyph_row scratch_glyph_row;
if not known. This macro is called under circumstances where
MATRIX might not have been allocated yet. */
#define MATRIX_TOP_LINE_HEIGHT(MATRIX) \
#define MATRIX_HEADER_LINE_HEIGHT(MATRIX) \
((MATRIX) && (MATRIX)->rows \
? MATRIX_TOP_LINE_ROW (MATRIX)->height \
? MATRIX_HEADER_LINE_ROW (MATRIX)->height \
: 0)
/* Return the current height of the mode line of window W. If not
......@@ -881,10 +881,10 @@ extern struct glyph_row scratch_glyph_row;
known from W's current glyph matrix, return an estimation based on
the height of the font of the face `top-line'. */
#define CURRENT_TOP_LINE_HEIGHT(W) \
(MATRIX_TOP_LINE_HEIGHT ((W)->current_matrix) \
? MATRIX_TOP_LINE_HEIGHT ((W)->current_matrix) \
: estimate_mode_line_height (XFRAME ((W)->frame), TOP_LINE_FACE_ID))
#define CURRENT_HEADER_LINE_HEIGHT(W) \
(MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
: estimate_mode_line_height (XFRAME ((W)->frame), HEADER_LINE_FACE_ID))
/* Return the height of the desired mode line of window W. */
......@@ -893,8 +893,8 @@ extern struct glyph_row scratch_glyph_row;
/* Return the height of the desired top line of window W. */
#define DESIRED_TOP_LINE_HEIGHT(W) \
MATRIX_TOP_LINE_HEIGHT ((W)->desired_matrix)
#define DESIRED_HEADER_LINE_HEIGHT(W) \
MATRIX_HEADER_LINE_HEIGHT ((W)->desired_matrix)
/* Like FRAME_INTERNAL_BORDER_WIDTH but checks whether frame F is a
window-system frame. */
......@@ -930,9 +930,9 @@ extern struct glyph_row scratch_glyph_row;
/* Height in pixels of the top line. Zero if W doesn't have a top
line. */
#define WINDOW_DISPLAY_TOP_LINE_HEIGHT(W) \
(WINDOW_WANTS_TOP_LINE_P ((W)) \
? CURRENT_TOP_LINE_HEIGHT (W) \
#define WINDOW_DISPLAY_HEADER_LINE_HEIGHT(W) \
(WINDOW_WANTS_HEADER_LINE_P ((W)) \
? CURRENT_HEADER_LINE_HEIGHT (W) \
: 0)
/* Pixel height of window W without mode line. */
......@@ -946,7 +946,7 @@ extern struct glyph_row scratch_glyph_row;
#define WINDOW_DISPLAY_TEXT_HEIGHT(W) \
(WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \
- WINDOW_DISPLAY_MODE_LINE_HEIGHT ((W)) \
- WINDOW_DISPLAY_TOP_LINE_HEIGHT ((W)))
- WINDOW_DISPLAY_HEADER_LINE_HEIGHT ((W)))
/* Left edge of W in pixels relative to its frame. */
......@@ -1056,11 +1056,11 @@ extern struct glyph_row scratch_glyph_row;
/* Value is non-zero if window W wants a top line. */
#define WINDOW_WANTS_TOP_LINE_P(W) \
#define WINDOW_WANTS_HEADER_LINE_P(W) \
(!MINI_WINDOW_P (W) \
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W))) \
&& !NILP (XBUFFER ((W)->buffer)->top_line_format))
&& !NILP (XBUFFER ((W)->buffer)->header_line_format))
/***********************************************************************
......@@ -1266,7 +1266,7 @@ enum face_id
MODE_LINE_FACE_ID,
TOOL_BAR_FACE_ID,
BITMAP_AREA_FACE_ID,
TOP_LINE_FACE_ID,
HEADER_LINE_FACE_ID,
BASIC_FACE_ID_SENTINEL
};
......@@ -1473,7 +1473,7 @@ struct it
unsigned multibyte_p : 1;
/* 1 means window has a mode line at its top. */
unsigned top_line_p : 1;
unsigned header_line_p : 1;
/* 1 means `string' is the value of a `display' property.
Don't handle some `display' properties in these strings. */
......
......@@ -508,18 +508,18 @@ adjust_glyph_matrix (w, matrix, x, y, dim)
int i;
int new_rows;
int marginal_areas_changed_p = 0;
int top_line_changed_p = 0;
int top_line_p = 0;
int header_line_changed_p = 0;
int header_line_p = 0;
int left = -1, right = -1;
int window_x, window_y, window_width, window_height;
/* See if W had a top line that has disappeared now, or vice versa. */
if (w)
{
top_line_p = WINDOW_WANTS_TOP_LINE_P (w);
top_line_changed_p = top_line_p != matrix->top_line_p;
header_line_p = WINDOW_WANTS_HEADER_LINE_P (w);
header_line_changed_p = header_line_p != matrix->header_line_p;
}
matrix->top_line_p = top_line_p;
matrix->header_line_p = header_line_p;
/* Do nothing if MATRIX' size, position, vscroll, and marginal areas
haven't changed. This optimization is important because preserving
......@@ -535,7 +535,7 @@ adjust_glyph_matrix (w, matrix, x, y, dim)
if (!marginal_areas_changed_p
&& !fonts_changed_p
&& !top_line_changed_p
&& !header_line_changed_p
&& matrix->window_top_y == XFASTINT (w->top)
&& matrix->window_height == window_height
&& matrix->window_vscroll == w->vscroll
......@@ -584,7 +584,7 @@ adjust_glyph_matrix (w, matrix, x, y, dim)
if (w == NULL
|| row == matrix->rows + dim.height - 1
|| (row == matrix->rows && matrix->top_line_p))
|| (row == matrix->rows && matrix->header_line_p))
{
row->glyphs[TEXT_AREA]
= row->glyphs[LEFT_MARGIN_AREA];
......@@ -613,7 +613,7 @@ adjust_glyph_matrix (w, matrix, x, y, dim)
its own memory. Allocate glyph memory from the heap. */
if (dim.width > matrix->matrix_w
|| new_rows
|| top_line_changed_p
|| header_line_changed_p
|| marginal_areas_changed_p)
{
struct glyph_row *row = matrix->rows;
......@@ -628,7 +628,7 @@ adjust_glyph_matrix (w, matrix, x, y, dim)
/* The mode line never has marginal areas. */
if (row == matrix->rows + dim.height - 1
|| (row == matrix->rows && matrix->top_line_p))
|| (row == matrix->rows && matrix->header_line_p))
{
row->glyphs[TEXT_AREA]
= row->glyphs[LEFT_MARGIN_AREA];
......@@ -848,7 +848,7 @@ shift_glyph_matrix (w, matrix, start, end, dy)
xassert (start >= 0 && start < matrix->nrows);
xassert (end >= 0 && end <= matrix->nrows);
min_y = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
max_y = WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (w);
for (; start < end; ++start)
......@@ -998,7 +998,7 @@ blank_row (w, row, y)
{
int min_y, max_y;
min_y = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
max_y = WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (w);
clear_glyph_row (row);
......@@ -3602,7 +3602,7 @@ update_window (w, force_p)
{
struct glyph_row *row, *end;
struct glyph_row *mode_line_row;
struct glyph_row *top_line_row = NULL;
struct glyph_row *header_line_row = NULL;
int yb, changed_p = 0;
rif->update_window_begin_hook (w);
......@@ -3613,7 +3613,7 @@ update_window (w, force_p)
row = desired_matrix->rows;
end = row + desired_matrix->nrows - 1;
if (row->mode_line_p)
top_line_row = row++;
header_line_row = row++;
/* Update the mode line, if necessary. */
mode_line_row = MATRIX_MODE_LINE_ROW (desired_matrix);
......@@ -3634,7 +3634,7 @@ update_window (w, force_p)
/* Try reusing part of the display by inserting/deleting lines. */
if (row < end && !desired_matrix->no_scrolling_p)
{
int rc = scrolling_window (w, top_line_row != NULL);
int rc = scrolling_window (w, header_line_row != NULL);
if (rc < 0)
{
/* All rows were found to be equal. */
......@@ -3649,9 +3649,9 @@ update_window (w, force_p)
/* Update the top mode line after scrolling because a new top
line would otherwise overwrite lines at the top of the window
that can be scrolled. */
if (top_line_row && top_line_row->enabled_p)
if (header_line_row && header_line_row->enabled_p)
{
top_line_row->y = 0;
header_line_row->y = 0;
update_window_line (w, 0);
changed_p = 1;
}
......@@ -4085,7 +4085,7 @@ set_window_cursor_after_update (w)
/* Try to reuse part of the current display of W by scrolling lines.
TOP_LINE_P non-zero means W has a top mode line.
HEADER_LINE_P non-zero means W has a top mode line.
The algorithm is taken from Communications of the ACM, Apr78 "A
Technique for Isolating Differences Between Files." It should take
......@@ -4111,9 +4111,9 @@ set_window_cursor_after_update (w)
1 if we did scroll. */
static int
scrolling_window (w, top_line_p)
scrolling_window (w, header_line_p)
struct window *w;
int top_line_p;
int header_line_p;
{
struct symbol
{
......@@ -4142,7 +4142,7 @@ scrolling_window (w, top_line_p)
int yb = window_text_bottom_y (w);
/* Skip over rows equal at the start. */
i = top_line_p ? 1 : 0;
i = header_line_p ? 1 : 0;
while (i < current_matrix->nrows - 1
&& MATRIX_ROW_ENABLED_P (current_matrix, i)
&& MATRIX_ROW_ENABLED_P (desired_matrix, i)
......@@ -5121,7 +5121,7 @@ mode_line_string (w, x, y, mode_line_p, charpos)
if (mode_line_p)
row = MATRIX_MODE_LINE_ROW (w->current_matrix);
else
row = MATRIX_TOP_LINE_ROW (w->current_matrix);
row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
if (row->mode_line_p && row->enabled_p)
{
......
......@@ -4281,7 +4281,7 @@ make_lispy_event (event)
Lisp_Object string;
int charpos;
posn = part == 1 ? Qmode_line : Qtop_line;
posn = part == 1 ? Qmode_line : Qheader_line;
string = mode_line_string (w, wx, wy, part == 1, &charpos);
if (STRINGP (string))
string_info = Fcons (string, make_number (charpos));
......@@ -4564,7 +4564,7 @@ make_lispy_event (event)
else if (part == 2)
posn = Qvertical_line;
else if (part == 3)
posn = Qtop_line;
posn = Qheader_line;
else
XSETINT (posn,
buffer_posn_from_coords (XWINDOW (window),
......@@ -4645,7 +4645,7 @@ make_lispy_event (event)
else if (part == 2)
posn = Qvertical_line;
else if (part == 3)
posn = Qtop_line;
posn = Qheader_line;
else
XSETINT (posn, buffer_posn_from_coords (w, &wx, &wy));
}
......@@ -4758,7 +4758,7 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
else if (area == 2)
posn = Qvertical_line;
else if (area == 3)
posn = Qtop_line;
posn = Qheader_line;
else
XSETINT (posn, buffer_posn_from_coords (w, &wx, &wy));
}
......
......@@ -289,7 +289,7 @@ extern Lisp_Object Qscroll_bar_movement;
(Fget ((event_head), Qevent_kind))
/* Symbols to use for non-text mouse positions. */
extern Lisp_Object Qmode_line, Qvertical_line, Qtop_line;
extern Lisp_Object Qmode_line, Qvertical_line, Qheader_line;
/* Forward declaration for prototypes. */
struct input_event;
......
......@@ -480,8 +480,8 @@ coordinates_in_window (w, x, y)
&& *y >= bottom_y - CURRENT_MODE_LINE_HEIGHT (w))
/* On the mode line. */
return 2;
else if (WINDOW_WANTS_TOP_LINE_P (w)
&& *y < top_y + CURRENT_TOP_LINE_HEIGHT (w))
else if (WINDOW_WANTS_HEADER_LINE_P (w)
&& *y < top_y + CURRENT_HEADER_LINE_HEIGHT (w))
/* On the top line. */
return 4;
else if (*x < left_x || *x >= right_x)
......@@ -519,7 +519,7 @@ frame.\n\
If COORDINATES are in the text portion of WINDOW,\n\
the coordinates relative to the window are returned.\n\
If they are in the mode line of WINDOW, `mode-line' is returned.\n\
If they are in the top mode line of WINDOW, `top-line' is returned.\n\
If they are in the top mode line of WINDOW, `header-line' is returned.\n\
If they are in the bitmap-area to the left of the window,\n\
`left-bitmap-area' is returned, if they are in the area on the right of\n\
the window, `right-bitmap-area' is returned.\n\
......@@ -563,7 +563,7 @@ If they are on the border between WINDOW and its right sibling,\n\
return Qvertical_line;
case 4:
return Qtop_line;
return Qheader_line;
case 5:
return Qleft_bitmap_area;
......@@ -2089,7 +2089,7 @@ window_min_size_1 (w, width_p)
{
if (MINI_WINDOW_P (w)
|| (!WINDOW_WANTS_MODELINE_P (w)
&& !WINDOW_WANTS_TOP_LINE_P (w)))
&& !WINDOW_WANTS_HEADER_LINE_P (w)))
size = 1;
else
size = window_min_height;
......
......@@ -758,8 +758,8 @@ window_box_height (w)
if (WINDOW_WANTS_MODELINE_P (w))
height -= CURRENT_MODE_LINE_HEIGHT (w);
if (WINDOW_WANTS_TOP_LINE_P (w))
height -= CURRENT_TOP_LINE_HEIGHT (w);
if (WINDOW_WANTS_HEADER_LINE_P (w))
height -= CURRENT_HEADER_LINE_HEIGHT (w);
return height;
}
......@@ -828,8 +828,8 @@ window_box (w, area, box_x, box_y, box_width, box_height)
*box_x = window_box_left (w, area);
*box_y = (FRAME_INTERNAL_BORDER_WIDTH_SAFE (f)
+ XFASTINT (w->top) * CANON_Y_UNIT (f));
if (WINDOW_WANTS_TOP_LINE_P (w))
*box_y += CURRENT_TOP_LINE_HEIGHT (w);
if (WINDOW_WANTS_HEADER_LINE_P (w))
*box_y += CURRENT_HEADER_LINE_HEIGHT (w);
}
......@@ -1159,11 +1159,11 @@ check_window_end (w)
BASE_FACE_ID is the id of a base face to use. It must be one of
DEFAULT_FACE_ID for normal text, MODE_LINE_FACE_ID or
TOP_LINE_FACE_ID for displaying mode lines, or TOOL_BAR_FACE_ID for
HEADER_LINE_FACE_ID for displaying mode lines, or TOOL_BAR_FACE_ID for
displaying the tool-bar.
If ROW is null and BASE_FACE_ID is equal to MODE_LINE_FACE_ID or
TOP_LINE_FACE_ID, the iterator will be initialized to use the
HEADER_LINE_FACE_ID, the iterator will be initialized to use the
corresponding mode line glyph row of the desired matrix of W. */
void
......@@ -1195,8 +1195,8 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
{
if (base_face_id == MODE_LINE_FACE_ID)
row = MATRIX_MODE_LINE_ROW (w->desired_matrix);
else if (base_face_id == TOP_LINE_FACE_ID)
row = MATRIX_TOP_LINE_ROW (w->desired_matrix);
else if (base_face_id == HEADER_LINE_FACE_ID)
row = MATRIX_HEADER_LINE_ROW (w->desired_matrix);
}
/* Clear IT. */
......@@ -1349,8 +1349,8 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
it->last_visible_x -= it->continuation_pixel_width;
}
it->top_line_p = WINDOW_WANTS_TOP_LINE_P (w);
it->current_y = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w) + w->vscroll;
it->header_line_p = WINDOW_WANTS_HEADER_LINE_P (w);
it->current_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w) + w->vscroll;
}
/* Leave room for a border glyph. */
......@@ -1407,7 +1407,7 @@ start_display (it, w, pos)
{
int start_at_line_beg_p;
struct glyph_row *row;
int first_vpos = WINDOW_WANTS_TOP_LINE_P (w) ? 1 : 0;
int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
int first_y;
row = w->desired_matrix->rows + first_vpos;
......@@ -7841,7 +7841,7 @@ make_cursor_line_fully_visible (w)
{
struct glyph_matrix *matrix;
struct glyph_row *row;
int top_line_height;
int header_line_height;
/* It's not always possible to find the cursor, e.g, when a window
is full of overlay strings. Don't do anything in that case. */
......@@ -7854,8 +7854,8 @@ make_cursor_line_fully_visible (w)
/* If row->y == top y of window display area, the window isn't tall
enough to display a single line. There is nothing we can do
about it. */
top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
if (row->y == top_line_height)
header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
if (row->y == header_line_height)
return;
if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
......@@ -8000,7 +8000,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
{
aggressive = current_buffer->scroll_down_aggressively;
height = (WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (w)
- WINDOW_DISPLAY_TOP_LINE_HEIGHT (w));
- WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w));
if (NUMBERP (aggressive))
amount_to_scroll = XFLOATINT (aggressive) * height;
}
......@@ -8053,7 +8053,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
{
aggressive = current_buffer->scroll_up_aggressively;
height = (WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (w)
- WINDOW_DISPLAY_TOP_LINE_HEIGHT (w));
- WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w));
if (NUMBERP (aggressive))
amount_to_scroll = XFLOATINT (aggressive) * height;
}
......@@ -8124,7 +8124,7 @@ compute_window_start_on_continuation_line (w)
/* Find the start of the continued line. This should be fast
because scan_buffer is fast (newline cache). */
row = w->desired_matrix->rows + (WINDOW_WANTS_TOP_LINE_P (w) ? 1 : 0);
row = w->desired_matrix->rows + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0);
init_iterator (&it, w, CHARPOS (start_pos), BYTEPOS (start_pos),
row, DEFAULT_FACE_ID);
reseat_at_previous_visible_line_start (&it);
......@@ -8868,7 +8868,7 @@ redisplay_window (window, just_this_one_p)
&& XFASTINT (w->column_number_displayed) != current_column ()))
/* This means that the window has a mode line. */
&& (WINDOW_WANTS_MODELINE_P (w)
|| WINDOW_WANTS_TOP_LINE_P (w)))
|| WINDOW_WANTS_HEADER_LINE_P (w)))
{
display_mode_lines (w);
......@@ -8884,12 +8884,12 @@ redisplay_window (window, just_this_one_p)
/* If top line height has changed, arrange for a thorough
immediate redisplay using the correct mode line height. */
if (WINDOW_WANTS_TOP_LINE_P (w)
&& CURRENT_TOP_LINE_HEIGHT (w) != DESIRED_TOP_LINE_HEIGHT (w))
if (WINDOW_WANTS_HEADER_LINE_P (w)
&& CURRENT_HEADER_LINE_HEIGHT (w) != DESIRED_HEADER_LINE_HEIGHT (w))
{
fonts_changed_p = 1;
MATRIX_TOP_LINE_ROW (w->current_matrix)->height
= DESIRED_TOP_LINE_HEIGHT (w);
MATRIX_HEADER_LINE_ROW (w->current_matrix)->height
= DESIRED_HEADER_LINE_HEIGHT (w);
}
if (fonts_changed_p)
......@@ -9089,8 +9089,8 @@ try_window_reusing_current_matrix (w)
return 0;
/* If top-line visibility has changed, give up. */
if (WINDOW_WANTS_TOP_LINE_P (w)
!= MATRIX_TOP_LINE_ROW (w->current_matrix)->mode_line_p)
if (WINDOW_WANTS_HEADER_LINE_P (w)
!= MATRIX_HEADER_LINE_ROW (w->current_matrix)->mode_line_p)
return 0;
/* Give up if old or new display is scrolled vertically. We could
......@@ -9197,7 +9197,7 @@ try_window_reusing_current_matrix (w)
/* Re-compute Y positions. */
row = MATRIX_FIRST_TEXT_ROW (w->current_matrix) + nrows_scrolled;
min_y = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
max_y = it.last_visible_y;
while (row < bottom_row)
{
......@@ -9340,7 +9340,7 @@ try_window_reusing_current_matrix (w)
/* Scroll the display. */
run.current_y = first_reusable_row->y;
run.desired_y = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
run.desired_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
run.height = it.last_visible_y - run.current_y;
if (run.height)
{
......@@ -9356,7 +9356,7 @@ try_window_reusing_current_matrix (w)
bottom_row = MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w);
row = first_reusable_row;
dy = first_reusable_row->y;
min_y = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
max_y = it.last_visible_y;
while (row < first_row_to_display)
{
......@@ -10180,13 +10180,13 @@ try_window_id (w)
/* Displayed to end of window, but no line containing text was
displayed. Lines were deleted at the end of the window. */
int vpos;
int top_line_p = WINDOW_WANTS_TOP_LINE_P (w) ? 1 : 0;
int header_line_p = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
for (vpos = XFASTINT (w->window_end_vpos); vpos > 0; --vpos)
if ((w->desired_matrix->rows[vpos + top_line_p].enabled_p
&& w->desired_matrix->rows[vpos + top_line_p].displays_text_p)
|| (!w->desired_matrix->rows[vpos + top_line_p].enabled_p
&& w->current_matrix->rows[vpos + top_line_p].displays_text_p))
if ((w->desired_matrix->rows[vpos + header_line_p].enabled_p
&& w->desired_matrix->rows[vpos + header_line_p].displays_text_p)
|| (!w->desired_matrix->rows[vpos + header_line_p].enabled_p
&& w->current_matrix->rows[vpos + header_line_p].displays_text_p))
break;
w->window_end_vpos = make_number (vpos);
......@@ -10538,7 +10538,7 @@ compute_line_metrics (it)
if (FRAME_WINDOW_P (it->f))
{
int i, top_line_height;
int i, header_line_height;
/* The line may consist of one space only, that was added to
place the cursor on it. If so, the row's height hasn't been
......@@ -10577,9 +10577,9 @@ compute_line_metrics (it)
/* Compute how much of the line is visible. */
row->visible_height = row->height;
top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (it->w);
if (row->y < top_line_height)
row->visible_height -= top_line_height - row->y;
header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (it->w);
if (row->y < header_line_height)
row->visible_height -= header_line_height - row->y;
else
{
int max_y = WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (it->w);
......@@ -11296,15 +11296,17 @@ display_mode_lines (w)
w->column_number_displayed = Qnil;
if (WINDOW_WANTS_MODELINE_P (w))
display_mode_line (w, MODE_LINE_FACE_ID, current_buffer->mode_line_format);
display_mode_line (w, MODE_LINE_FACE_ID,
current_buffer->mode_line_format);
if (WINDOW_WANTS_TOP_LINE_P (w))
display_mode_line (w, TOP_LINE_FACE_ID, current_buffer->top_line_format);
if (WINDOW_WANTS_HEADER_LINE_P (w))
display_mode_line (w, HEADER_LINE_FACE_ID,
current_buffer->header_line_format);
}
/* Display mode or top line of window W. FACE_ID specifies which line
to display; it is either MODE_LINE_FACE_ID or TOP_LINE_FACE_ID.
to display; it is either MODE_LINE_FACE_ID or HEADER_LINE_FACE_ID.
FORMAT is the mode line format to display. */
static void
......
......@@ -281,7 +281,7 @@ Lisp_Object Qx_charset_registry;
/* Names of basic faces. */
Lisp_Object Qdefault, Qmodeline, Qtool_bar, Qregion, Qmargin;
Lisp_Object Qtop_line;
Lisp_Object Qheader_line;
/* Default stipple pattern used on monochrome displays. This stipple
pattern is used on monochrome displays instead of shades of gray
......@@ -5132,7 +5132,7 @@ realize_basic_faces (f)
realize_named_face (f, Qmodeline, MODE_LINE_FACE_ID);
realize_named_face (f, Qtool_bar, TOOL_BAR_FACE_ID);
realize_named_face (f, Qmargin, BITMAP_AREA_FACE_ID);
realize_named_face (f, Qtop_line, TOP_LINE_FACE_ID);
realize_named_face (f, Qheader_line, HEADER_LINE_FACE_ID);
success_p = 1;
}
......@@ -5954,7 +5954,7 @@ face_at_buffer_position (w, pos, region_beg, region_end,
REGION_BEG and REGION_END give the start and end positions of the
region; both are -1 if no region is visible. BASE_FACE_ID is the
id of the basic face to merge with. It is usually equal to
DEFAULT_FACE_ID but can be MODE_LINE_FACE_ID or TOP_LINE_FACE_ID
DEFAULT_FACE_ID but can be MODE_LINE_FACE_ID or HEADER_LINE_FACE_ID
for strings displayed in the mode or top line.
Set *ENDPTR to the next position where to check for faces in
......@@ -6248,8 +6248,8 @@ syms_of_xfaces ()
staticpro (&Qregion);
Qmargin = intern ("margin");
staticpro (&Qmargin);
Qtop_line = intern ("top-line");
staticpro (&Qtop_line);
Qheader_line = intern ("header-line");
staticpro (&Qheader_line);
defsubr (&Sinternal_make_lisp_face);
defsubr (&Sinternal_lisp_face_p);
......
......@@ -868,7 +868,7 @@ x_draw_row_bitmaps (w, row)
struct frame *f = XFRAME (w->frame);
enum bitmap_type bitmap;
struct face *face;
int top_line_height = -1;
int header_line_height = -1;
xassert (interrupt_input_blocked);
......@@ -904,8 +904,8 @@ x_draw_row_bitmaps (w, row)
? 1 : 0);
int left = window_box_left (w, -1);
if (top_line_height < 0)
top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
if (header_line_height < 0)
header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
/* In case the same realized face is used for bitmap areas and
for something displayed in the text (e.g. face `region' on
......@@ -921,7 +921,7 @@ x_draw_row_bitmaps (w, row)