2001-10-07 Miles Bader The following changes remove the glyph_row `inverse_p' field, which is never set anymore, due to other changes: * dispextern.h (struct glyph_row): Remove `inverse_p' field. (reassert_line_highlight, change_line_highlight): Declarations removed. * dispnew.c (update_frame_line): Don't call reassert_line_highlight. (line_hash_code, row_equal_p, fake_current_matrices) (build_frame_matrix_from_leaf_window, update_frame_line) (update_frame_line, update_frame_line, update_frame_line): Don't use `inverse_p' field. * xterm.c (x_fix_overlapping_area, x_write_glyphs, expose_area) (expose_line, x_erase_phys_cursor): Don't use `inverse_p' field. (XTreassert_line_highlight, x_change_line_highlight): Functions removed. (x_initialize): Don't set reassert_line_highlight_hook or change_line_highlight_hook. * xdisp.c (dump_glyph_row, display_mode_line): Likewise. * w32term.c (x_fix_overlapping_area, x_write_glyphs, expose_area) (expose_line, x_erase_phys_cursor): Likewise. * w32term.c (w32_reassert_line_highlight, x_change_line_highlight): Functions removed. * w32console.c (reassert_line_highlight, change_line_highlight): Functions removed. (initialize_w32_display): Don't set reassert_line_highlight_hook or change_line_highlight_hook. (hl_mode): Function removed. (reset_terminal_modes, set_terminal_modes, update_begin) (update_end, w32_face_attributes, initialize_w32_display): (clear_frame, ins_del_lines): Don't call it. * termhooks.h (reassert_line_highlight_hook) (change_line_highlight_hook): Declarations removed. * term.c (reassert_line_highlight_hook) (change_line_highlight_hook): Variables removed. (reassert_line_highlight, change_line_highlight): Functions removed. * msdos.c (IT_reassert_line_highlight) (IT_change_line_highlight): Functions removed. (internal_terminal_init): Don't set reassert_line_highlight_hook or change_line_highlight_hook. (highlight): Variable removed. (IT_set_face, IT_update_begin, IT_update_end) (IT_set_terminal_modes): Don't set or use it. The following changes remove inverse-video support for terminals that use a `magic cookie' standout mode. Due to changes in the way mode-lines are displayed, such support no longer works anyway, and it's probable that almost no one uses such terminals anymore: * term.c (standout_requested): Variable removed. (update_end, highlight_if_desired): Don't use it. (chars_wasted, copybuf): Variables removed. (write_standout_marker): Function removed. (cursor_to, clear_to_end, clear_frame, clear_end_of_line_raw) (clear_end_of_line_raw, write_glyphs, ins_del_lines): Don't use `chars_wasted' or `copybuf'. (calculate_costs): Don't allocate `chars_wasted' or `copybuf'. Set `costs_set' to true. (cursor_to, clear_end_of_line): Test `costs_set' instead of `chars_wasted'. (clear_end_of_line): Function removed. (clear_end_of_line_raw): Renamed to `clear_end_of_line'. (clear_to_end): Call `clear_end_of_line' instead of `clear_end_of_line_raw'. Index: src/dispextern.h =================================================================== RCS file: /cvs/emacs/src/dispextern.h,v retrieving revision 1.111 diff -u -r1.111 dispextern.h --- src/dispextern.h 2001/10/01 10:53:18 1.111 +++ src/dispextern.h 2001/10/07 02:40:12 @@ -635,10 +635,6 @@ screen. */ unsigned enabled_p : 1; - /* Display this line in inverse video? Used for the mode line and - menu bar lines. */ - unsigned inverse_p : 1; - /* 1 means row displays a text line that is truncated on the left or right side. */ unsigned truncated_on_left_p : 1; @@ -2356,7 +2352,6 @@ extern void turn_off_insert P_ ((void)); extern void turn_off_highlight P_ ((void)); extern void background_highlight P_ ((void)); -extern void reassert_line_highlight P_ ((int, int)); extern void clear_frame P_ ((void)); extern void clear_end_of_line P_ ((int)); extern void clear_end_of_line_raw P_ ((int)); @@ -2368,7 +2363,6 @@ extern void term_init P_ ((char *)); extern void fatal P_ ((/* char *, ... */)); void cursor_to P_ ((int, int)); -void change_line_highlight P_ ((int, int, int, int)); /* Defined in scroll.c */ Index: src/dispnew.c =================================================================== RCS file: /cvs/emacs/src/dispnew.c,v retrieving revision 1.284 diff -u -r1.284 dispnew.c --- src/dispnew.c 2001/09/26 11:15:40 1.284 +++ src/dispnew.c 2001/10/07 02:40:40 @@ -1388,31 +1388,22 @@ if (row->enabled_p) { - if (row->inverse_p) - { - /* Give all highlighted lines the same hash code - so as to encourage scrolling to leave them in place. */ - hash = -1; - } - else - { - struct glyph *glyph = row->glyphs[TEXT_AREA]; - struct glyph *end = glyph + row->used[TEXT_AREA]; - - while (glyph < end) - { - int c = glyph->u.ch; - int face_id = glyph->face_id; - if (must_write_spaces) - c -= SPACEGLYPH; - hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c; - hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id; - ++glyph; - } + struct glyph *glyph = row->glyphs[TEXT_AREA]; + struct glyph *end = glyph + row->used[TEXT_AREA]; + + while (glyph < end) + { + int c = glyph->u.ch; + int face_id = glyph->face_id; + if (must_write_spaces) + c -= SPACEGLYPH; + hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c; + hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id; + ++glyph; + } - if (hash == 0) - hash = 1; - } + if (hash == 0) + hash = 1; } return hash; @@ -1521,7 +1512,6 @@ } if (a->truncated_on_left_p != b->truncated_on_left_p - || a->inverse_p != b->inverse_p || a->fill_line_p != b->fill_line_p || a->truncated_on_right_p != b->truncated_on_right_p || a->overlay_arrow_p != b->overlay_arrow_p @@ -2193,7 +2183,6 @@ - r->used[LEFT_MARGIN_AREA] - r->used[RIGHT_MARGIN_AREA]); r->mode_line_p = 0; - r->inverse_p = fr->inverse_p; } } } @@ -2801,9 +2790,6 @@ frame_row->used[TEXT_AREA] = window_matrix->matrix_x + window_matrix->matrix_w; - /* Or in other flags. */ - frame_row->inverse_p |= window_row->inverse_p; - /* Next row. */ ++window_y; ++frame_y; @@ -5402,16 +5388,6 @@ if (colored_spaces_p) write_spaces_p = 1; - if (desired_row->inverse_p - != (current_row->enabled_p && current_row->inverse_p)) - { - int n = current_row->enabled_p ? current_row->used[TEXT_AREA] : 0; - change_line_highlight (desired_row->inverse_p, vpos, vpos, n); - current_row->enabled_p = 0; - } - else - reassert_line_highlight (desired_row->inverse_p, vpos); - /* Current row not enabled means it has unknown contents. We must write the whole desired line in that case. */ must_write_whole_line_p = !current_row->enabled_p; @@ -5425,26 +5401,14 @@ obody = MATRIX_ROW_GLYPH_START (current_matrix, vpos); olen = current_row->used[TEXT_AREA]; - if (!current_row->inverse_p) - { - /* Ignore trailing spaces, if we can. */ - if (!write_spaces_p) - while (olen > 0 && CHAR_GLYPH_SPACE_P (obody[olen-1])) - olen--; - } - else - { - /* For an inverse-video line, make sure it's filled with - spaces all the way to the frame edge so that the reverse - video extends all the way across. */ - while (olen < FRAME_WIDTH (f) - 1) - obody[olen++] = space_glyph; - } + /* Ignore trailing spaces, if we can. */ + if (!write_spaces_p) + while (olen > 0 && CHAR_GLYPH_SPACE_P (obody[olen-1])) + olen--; } current_row->enabled_p = 1; current_row->used[TEXT_AREA] = desired_row->used[TEXT_AREA]; - current_row->inverse_p = desired_row->inverse_p; /* If desired line is empty, just clear the line. */ if (!desired_row->enabled_p) @@ -5491,20 +5455,9 @@ /* Pretend trailing spaces are not there at all, unless for one reason or another we must write all spaces. */ - if (!desired_row->inverse_p) - { - if (!write_spaces_p) - while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1])) - nlen--; - } - else - { - /* For an inverse-video line, give it extra trailing spaces all - the way to the frame edge so that the reverse video extends - all the way across. */ - while (nlen < FRAME_WIDTH (f) - 1) - nbody[nlen++] = space_glyph; - } + if (!write_spaces_p) + while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1])) + nlen--; /* If there's no i/d char, quickly do the best we can without it. */ if (!char_ins_del_ok) @@ -5553,7 +5506,7 @@ { /* If current line is blank, skip over initial spaces, if possible, and write the rest. */ - if (write_spaces_p || desired_row->inverse_p) + if (write_spaces_p) nsp = 0; else nsp = count_blanks (nbody, nlen); @@ -5571,9 +5524,7 @@ /* Compute number of leading blanks in old and new contents. */ osp = count_blanks (obody, olen); - nsp = (desired_row->inverse_p || colored_spaces_p - ? 0 - : count_blanks (nbody, nlen)); + nsp = (colored_spaces_p ? 0 : count_blanks (nbody, nlen)); /* Compute number of matching chars starting with first non-blank. */ begmatch = count_match (obody + osp, obody + olen, Index: src/msdos.c =================================================================== RCS file: /cvs/emacs/src/msdos.c,v retrieving revision 1.153 diff -u -r1.153 msdos.c --- src/msdos.c 2001/07/06 15:31:47 1.153 +++ src/msdos.c 2001/10/07 02:41:02 @@ -374,7 +374,6 @@ #ifndef HAVE_X_WINDOWS extern unsigned char ScreenAttrib; static int screen_face; -static int highlight; static int screen_size_X; static int screen_size_Y; @@ -895,12 +894,10 @@ dflt_fg = dfp->foreground; dflt_bg = dfp->background; - /* Don't use invalid colors. In particular, FACE_TTY_DEFAULT_* - colors mean use the colors of the default face, except that if - highlight is on, invert the foreground and the background. Note - that we assume all 16 colors to be available for the background, - since Emacs switches on this mode (and loses the blinking - attribute) at startup. */ + /* Don't use invalid colors. In particular, FACE_TTY_DEFAULT_* colors + mean use the colors of the default face. Note that we assume all + 16 colors to be available for the background, since Emacs switches + on this mode (and loses the blinking attribute) at startup. */ if (fg == FACE_TTY_DEFAULT_COLOR || fg == FACE_TTY_DEFAULT_FG_COLOR) fg = FRAME_FOREGROUND_PIXEL (sf); else if (fg == FACE_TTY_DEFAULT_BG_COLOR) @@ -911,8 +908,7 @@ bg = FRAME_FOREGROUND_PIXEL (sf); /* Make sure highlighted lines really stand out, come what may. */ - if ((highlight || fp->tty_reverse_p) - && (fg == dflt_fg && bg == dflt_bg)) + if (fp->tty_reverse_p && (fg == dflt_fg && bg == dflt_bg)) { unsigned long tem = fg; @@ -928,8 +924,8 @@ bg = tem2; } if (termscript) - fprintf (termscript, "", face, - highlight ? "H" : "", fp->foreground, fp->background, fg, bg); + fprintf (termscript, "", face, + fp->foreground, fp->background, fg, bg); if (fg >= 0 && fg < 16) { ScreenAttrib &= 0xf0; @@ -1936,26 +1932,10 @@ } static void -IT_reassert_line_highlight (int new, int vpos) -{ - highlight = new; -} - -static void -IT_change_line_highlight (int new_highlight, int y, int vpos, int first_unused_hpos) -{ - highlight = new_highlight; - IT_cursor_to (vpos, 0); - IT_clear_end_of_line (first_unused_hpos); -} - -static void IT_update_begin (struct frame *f) { struct display_info *display_info = FRAME_X_DISPLAY_INFO (f); struct frame *mouse_face_frame = display_info->mouse_face_mouse_frame; - - highlight = 0; BLOCK_INPUT; @@ -2013,7 +1993,6 @@ static void IT_update_end (struct frame *f) { - highlight = 0; FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0; } @@ -2150,7 +2129,6 @@ { if (termscript) fprintf (termscript, "\n"); - highlight = 0; screen_size_X = ScreenCols (); screen_size_Y = ScreenRows (); @@ -2228,8 +2206,6 @@ if (termscript) fprintf (termscript, "\n"); - highlight = 0; - if (!term_setup_done) return; @@ -2608,10 +2584,8 @@ clear_to_end_hook = IT_clear_to_end; clear_end_of_line_hook = IT_clear_end_of_line; clear_frame_hook = IT_clear_screen; - change_line_highlight_hook = IT_change_line_highlight; update_begin_hook = IT_update_begin; update_end_hook = IT_update_end; - reassert_line_highlight_hook = IT_reassert_line_highlight; frame_up_to_date_hook = IT_frame_up_to_date; /* These hooks are called by term.c without being checked. */ Index: src/term.c =================================================================== RCS file: /cvs/emacs/src/term.c,v retrieving revision 1.125 diff -u -r1.125 term.c --- src/term.c 2001/05/31 08:56:32 1.125 +++ src/term.c 2001/10/07 02:41:12 @@ -119,9 +119,6 @@ void (*ins_del_lines_hook) P_ ((int, int)); -void (*change_line_highlight_hook) P_ ((int, int, int, int)); -void (*reassert_line_highlight_hook) P_ ((int, int)); - void (*delete_glyphs_hook) P_ ((int)); void (*ring_bell_hook) P_ ((void)); @@ -388,19 +385,8 @@ /* The largest frame height in any call to calculate_costs. */ int max_frame_height; - -/* Number of chars of space used for standout marker at beginning of line, - or'd with 0100. Zero if no standout marker at all. - The length of these vectors is max_frame_height. - - Used IFF TN_standout_width >= 0. */ - -static char *chars_wasted; -static char *copybuf; - -/* nonzero means supposed to write text in standout mode. */ -int standout_requested; +int costs_set = 0; /* Nonzero if costs have been calculated. */ int insert_mode; /* Nonzero when in insert mode. */ int standout_mode; /* Nonzero when in standout mode. */ @@ -528,7 +514,6 @@ tty_show_cursor (); turn_off_insert (); background_highlight (); - standout_requested = 0; } else update_end_hook (f); @@ -677,97 +662,10 @@ { if (TN_standout_width >= 0) return; - if (!inverse_video == !standout_requested) - turn_off_highlight (); - else + if (inverse_video) turn_on_highlight (); -} - -/* Handle standout mode for terminals in which TN_standout_width >= 0. - On these terminals, standout is controlled by markers that - live inside the terminal's memory. TN_standout_width is the width - that the marker occupies in memory. Standout runs from the marker - to the end of the line on some terminals, or to the next - turn-off-standout marker (TS_end_standout_mode) string - on other terminals. */ - -/* Write a standout marker or end-standout marker at the front of the line - at vertical position vpos. */ - -static void -write_standout_marker (flag, vpos) - int flag, vpos; -{ - if (flag - || (TS_end_standout_mode && !TF_teleray && !se_is_so - && !(TF_xs && TN_standout_width == 0))) - { - cmgoto (vpos, 0); - cmplus (TN_standout_width); - OUTPUT (flag ? TS_standout_mode : TS_end_standout_mode); - chars_wasted[curY] = TN_standout_width | 0100; - } -} - -/* External interface to control of standout mode. - Call this when about to modify line at position VPOS - and not change whether it is highlighted. */ - -void -reassert_line_highlight (highlight, vpos) - int highlight; - int vpos; -{ - struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame); - if (! FRAME_TERMCAP_P (f)) - { - (*reassert_line_highlight_hook) (highlight, vpos); - return; - } - if (TN_standout_width < 0) - /* Handle terminals where standout takes affect at output time */ - standout_requested = highlight; - else if (chars_wasted && chars_wasted[vpos] == 0) - /* For terminals with standout markers, write one on this line - if there isn't one already. */ - write_standout_marker (inverse_video ? !highlight : highlight, vpos); -} - -/* Call this when about to modify line at position VPOS - and change whether it is highlighted. */ - -void -change_line_highlight (new_highlight, vpos, y, first_unused_hpos) - int new_highlight, vpos, y, first_unused_hpos; -{ - standout_requested = new_highlight; - if (! FRAME_TERMCAP_P (updating_frame)) - { - (*change_line_highlight_hook) (new_highlight, vpos, y, first_unused_hpos); - return; - } - - cursor_to (vpos, 0); - - if (TN_standout_width < 0) - background_highlight (); - /* If line starts with a marker, delete the marker */ - else if (TS_clr_line && chars_wasted[curY]) - { - turn_off_insert (); - /* On Teleray, make sure to erase the SO marker. */ - if (TF_teleray) - { - cmgoto (curY - 1, FRAME_WIDTH (XFRAME (selected_frame)) - 4); - OUTPUT ("\033S"); - curY++; /* ESC S moves to next line where the TS_standout_mode was */ - curX = 0; - } - else - cmgoto (curY, 0); /* reposition to kill standout marker */ - } - clear_end_of_line_raw (first_unused_hpos); - reassert_line_highlight (new_highlight, curY); + else + turn_off_highlight (); } @@ -788,10 +686,9 @@ /* Detect the case where we are called from reset_sys_modes and the costs have never been calculated. Do nothing. */ - if (chars_wasted == 0) + if (! costs_set) return; - hpos += chars_wasted[vpos] & 077; if (curY == vpos && curX == hpos) return; if (!TF_standout_motion) @@ -839,15 +736,13 @@ { background_highlight (); OUTPUT (TS_clr_to_bottom); - bzero (chars_wasted + curY, - FRAME_HEIGHT (XFRAME (selected_frame)) - curY); } else { for (i = curY; i < FRAME_HEIGHT (XFRAME (selected_frame)); i++) { cursor_to (i, 0); - clear_end_of_line_raw (FRAME_WIDTH (XFRAME (selected_frame))); + clear_end_of_line (FRAME_WIDTH (XFRAME (selected_frame))); } } } @@ -869,7 +764,6 @@ { background_highlight (); OUTPUT (TS_clr_frame); - bzero (chars_wasted, FRAME_HEIGHT (sf)); cmat (0, 0); } else @@ -879,32 +773,13 @@ } } -/* Clear to end of line, but do not clear any standout marker. - Assumes that the cursor is positioned at a character of real text, - which implies it cannot be before a standout marker - unless the marker has zero width. - - Note that the cursor may be moved. */ - -void -clear_end_of_line (first_unused_hpos) - int first_unused_hpos; -{ - if (FRAME_TERMCAP_P (XFRAME (selected_frame)) - && chars_wasted != 0 - && TN_standout_width == 0 && curX == 0 && chars_wasted[curY] != 0) - write_glyphs (&space_glyph, 1); - clear_end_of_line_raw (first_unused_hpos); -} - /* Clear from cursor to end of line. Assume that the line is already clear starting at column first_unused_hpos. - If the cursor is at a standout marker, erase the marker. Note that the cursor may be moved, on terminals lacking a `ce' string. */ void -clear_end_of_line_raw (first_unused_hpos) +clear_end_of_line (first_unused_hpos) int first_unused_hpos; { register int i; @@ -920,15 +795,11 @@ /* Detect the case where we are called from reset_sys_modes and the costs have never been calculated. Do nothing. */ - if (chars_wasted == 0) + if (! costs_set) return; - first_unused_hpos += chars_wasted[curY] & 077; if (curX >= first_unused_hpos) return; - /* Notice if we are erasing a magic cookie */ - if (curX == 0) - chars_wasted[curY] = 0; background_highlight (); if (TS_clr_line) { @@ -1088,7 +959,7 @@ if (AutoWrap && curY + 1 == FRAME_HEIGHT (sf) - && (curX + len - (chars_wasted[curY] & 077) == FRAME_WIDTH (sf))) + && (curX + len) == FRAME_WIDTH (sf)) len --; if (len <= 0) return; @@ -1358,20 +1229,6 @@ = (scroll_region_ok ? specified_window : FRAME_HEIGHT (sf)); - - if (n < 0) - { - bcopy (&chars_wasted[vpos - n], &chars_wasted[vpos], - lower_limit - vpos + n); - bzero (&chars_wasted[lower_limit + n], - n); - } - else - { - bcopy (&chars_wasted[vpos], ©buf[vpos], lower_limit - vpos - n); - bcopy (©buf[vpos], &chars_wasted[vpos + n], - lower_limit - vpos - n); - bzero (&chars_wasted[vpos], n); - } } if (!scroll_region_ok && memory_below_frame && n < 0) { @@ -1510,23 +1367,12 @@ once for the terminal frame of X-windows emacs, but not used afterwards. char_ins_del_vector (i.e., char_ins_del_cost) isn't used because - X turns off char_ins_del_ok. + X turns off char_ins_del_ok. */ - chars_wasted and copybuf are only used here in term.c in cases where - the term hook isn't called. */ - max_frame_height = max (max_frame_height, FRAME_HEIGHT (frame)); max_frame_width = max (max_frame_width, FRAME_WIDTH (frame)); - - if (chars_wasted != 0) - chars_wasted = (char *) xrealloc (chars_wasted, max_frame_height); - else - chars_wasted = (char *) xmalloc (max_frame_height); - if (copybuf != 0) - copybuf = (char *) xrealloc (copybuf, max_frame_height); - else - copybuf = (char *) xmalloc (max_frame_height); + costs_set = 1; if (char_ins_del_vector != 0) char_ins_del_vector @@ -1538,8 +1384,6 @@ = (int *) xmalloc (sizeof (int) + 2 * max_frame_width * sizeof (int)); - bzero (chars_wasted, max_frame_height); - bzero (copybuf, max_frame_height); bzero (char_ins_del_vector, (sizeof (int) + 2 * max_frame_width * sizeof (int))); Index: src/termhooks.h =================================================================== RCS file: /cvs/emacs/src/termhooks.h,v retrieving revision 1.55 diff -u -r1.55 termhooks.h --- src/termhooks.h 2001/10/05 09:51:00 1.55 +++ src/termhooks.h 2001/10/07 02:41:15 @@ -44,9 +44,6 @@ extern void (*ins_del_lines_hook) P_ ((int, int)); -extern void (*change_line_highlight_hook) P_ ((int, int, int, int)); -extern void (*reassert_line_highlight_hook) P_ ((int, int)); - extern void (*insert_glyphs_hook) P_ ((struct glyph *s, int n)); extern void (*write_glyphs_hook) P_ ((struct glyph *s, int n)); extern void (*delete_glyphs_hook) P_ ((int)); Index: src/w32console.c =================================================================== RCS file: /cvs/emacs/src/w32console.c,v retrieving revision 1.28 diff -u -r1.28 w32console.c --- src/w32console.c 2000/10/19 19:06:38 1.28 +++ src/w32console.c 2001/10/07 02:41:18 @@ -60,8 +60,6 @@ static void clear_frame (void); static void clear_end_of_line (int); static void ins_del_lines (int vpos, int n); -static void change_line_highlight (int, int, int, int); -static void reassert_line_highlight (int, int); static void insert_glyphs (struct glyph *start, int len); static void write_glyphs (struct glyph *string, int len); static void delete_glyphs (int n); @@ -72,7 +70,6 @@ static void update_begin (struct frame * f); static void update_end (struct frame * f); static WORD w32_face_attributes (struct frame *f, int face_id); -static int hl_mode (int new_highlight); static COORD cursor_coords; static HANDLE prev_screen, cur_screen; @@ -142,8 +139,6 @@ GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); - hl_mode (0); - /* Remember that the screen buffer might be wider than the window. */ n = FRAME_HEIGHT (f) * info.dwSize.X; dest.X = dest.Y = 0; @@ -178,7 +173,7 @@ void ins_del_lines (int vpos, int n) { - int i, nb, save_highlight; + int i, nb; SMALL_RECT scroll; COORD dest; CHAR_INFO fill; @@ -201,8 +196,6 @@ dest.X = 0; - save_highlight = hl_mode (0); - fill.Char.AsciiChar = 0x20; fill.Attributes = char_attr_normal; @@ -242,43 +235,8 @@ cursor_coords.X = 0; cursor_coords.Y = vpos; - - hl_mode (save_highlight); -} - -/* Changes attribute to use when drawing characters to control. */ -static int -hl_mode (int new_highlight) -{ - static int highlight = 0; - int old_highlight; - - old_highlight = highlight; - highlight = (new_highlight != 0); - - return old_highlight; } -/* Call this when about to modify line at position VPOS and change whether it - is highlighted. */ -void -change_line_highlight (int new_highlight, int vpos, int y, - int first_unused_hpos) -{ - hl_mode (new_highlight); - move_cursor (vpos, 0); - clear_end_of_line (first_unused_hpos); -} - -/* External interface to control of standout mode. Call this when about to - * modify line at position VPOS and not change whether it is highlighted. */ -void -reassert_line_highlight (int highlight, int vpos) -{ - hl_mode (highlight); - vpos; /* pedantic compiler silencer */ -} - #undef LEFT #undef RIGHT #define LEFT 1 @@ -497,8 +455,6 @@ void reset_terminal_modes (void) { - hl_mode (0); - #ifdef USE_SEPARATE_SCREEN SetConsoleActiveScreenBuffer (prev_screen); #else @@ -512,8 +468,6 @@ { CONSOLE_CURSOR_INFO cci; - hl_mode (0); - /* make cursor big and visible (100 on Win95 makes it disappear) */ cci.dwSize = 99; cci.bVisible = TRUE; @@ -535,13 +489,11 @@ void update_begin (struct frame * f) { - hl_mode (0); } void update_end (struct frame * f) { - hl_mode (0); SetConsoleCursorPosition (cur_screen, cursor_coords); } @@ -563,12 +515,8 @@ int face_id; { WORD char_attr; - int highlight_on_p; struct face *face = FACE_FROM_ID (f, face_id); - highlight_on_p = hl_mode (0); - hl_mode (highlight_on_p); - xassert (face != NULL); char_attr = char_attr_normal; @@ -588,7 +536,7 @@ if (((char_attr & 0x00f0) >> 4) == (char_attr & 0x000f)) char_attr ^= 0x0007; - if (face->tty_reverse_p || highlight_on_p) + if (face->tty_reverse_p) char_attr = (char_attr & 0xff00) + ((char_attr & 0x000f) << 4) + ((char_attr & 0x00f0) >> 4); @@ -634,8 +582,6 @@ clear_frame_hook = clear_frame; clear_end_of_line_hook = clear_end_of_line; ins_del_lines_hook = ins_del_lines; - change_line_highlight_hook = change_line_highlight; - reassert_line_highlight_hook = reassert_line_highlight; insert_glyphs_hook = insert_glyphs; write_glyphs_hook = write_glyphs; delete_glyphs_hook = delete_glyphs; @@ -715,7 +661,6 @@ meta_key = 1; char_attr_normal = info.wAttributes; - hl_mode (0); if (w32_use_full_screen_buffer) { Index: src/w32term.c =================================================================== RCS file: /cvs/emacs/src/w32term.c,v retrieving revision 1.109 diff -u -r1.109 w32term.c --- src/w32term.c 2001/09/04 17:40:58 1.109 +++ src/w32term.c 2001/10/07 02:42:00 @@ -365,8 +365,6 @@ enum draw_glyphs_face)); static void x_update_end P_ ((struct frame *)); static void w32_frame_up_to_date P_ ((struct frame *)); -static void w32_reassert_line_highlight P_ ((int, int)); -static void x_change_line_highlight P_ ((int, int, int, int)); static void w32_set_terminal_modes P_ ((void)); static void w32_reset_terminal_modes P_ ((void)); static void w32_cursor_to P_ ((int, int, int, int)); @@ -991,53 +989,6 @@ } -/*********************************************************************** - Line Highlighting - ***********************************************************************/ - -/* External interface to control of standout mode. Not used for W32 - frames. Aborts when called. */ - -static void -w32_reassert_line_highlight (new, vpos) - int new, vpos; -{ - struct frame *f; - - if (updating_frame) - f = updating_frame; - else - f = SELECTED_FRAME (); - - if (! FRAME_W32_P (f)) - return; - - abort (); -} - - -/* Call this when about to modify line at position VPOS and change - whether it is highlighted. Not used for W32 frames. Aborts when - called. */ - -static void -x_change_line_highlight (new_highlight, vpos, y, first_unused_hpos) - int new_highlight, vpos, y, first_unused_hpos; -{ - struct frame *f; - - if (updating_frame) - f = updating_frame; - else - f = SELECTED_FRAME (); - - if (! FRAME_W32_P (f)) - return; - - abort (); -} - - /* This is called when starting Emacs and when restarting after suspend. When starting Emacs, no window is mapped. And nothing must be done to Emacs's own window if it is suspended (though that @@ -5114,8 +5065,7 @@ && row->glyphs[area][i].overlaps_vertically_p); x_draw_glyphs (w, start_x, row, area, start, i, - (row->inverse_p - ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT), + DRAW_NORMAL_TEXT, NULL, NULL, 1); } else @@ -5151,8 +5101,7 @@ x = x_draw_glyphs (updated_window, output_cursor.x, updated_row, updated_area, hpos, hpos + len, - (updated_row->inverse_p - ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT), + DRAW_NORMAL_TEXT, &real_start, &real_end, 0); /* If we drew over the cursor, note that it is not visible any more. */ @@ -5617,7 +5566,7 @@ /* If row extends face to end of line write the whole line. */ x_draw_glyphs (w, 0, row, area, 0, row->used[area], - row->inverse_p ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT, + DRAW_NORMAL_TEXT, NULL, NULL, 0); else { @@ -5656,7 +5605,7 @@ x_draw_glyphs (w, first_x - start_x, row, area, first - row->glyphs[area], last - row->glyphs[area], - row->inverse_p ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT, + DRAW_NORMAL_TEXT, NULL, NULL, 0); } } @@ -5675,8 +5624,7 @@ if (row->mode_line_p || w->pseudo_window_p) x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA], - row->inverse_p ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT, - NULL, NULL, 0); + DRAW_NORMAL_TEXT, NULL, NULL, 0); else { if (row->used[LEFT_MARGIN_AREA]) @@ -9053,8 +9001,6 @@ /* Erase the cursor by redrawing the character underneath it. */ if (mouse_face_here_p) hl = DRAW_MOUSE_FACE; - else if (cursor_row->inverse_p) - hl = DRAW_INVERSE_VIDEO; else hl = DRAW_NORMAL_TEXT; x_draw_phys_cursor_glyph (w, cursor_row, hl); Index: src/xdisp.c =================================================================== RCS file: /cvs/emacs/src/xdisp.c,v retrieving revision 1.671 diff -u -r1.671 xdisp.c --- src/xdisp.c 2001/10/01 10:52:55 1.671 +++ src/xdisp.c 2001/10/07 02:43:03 @@ -12081,7 +12081,7 @@ fprintf (stderr, "Row Start End Used oEI>used[TEXT_AREA], row->contains_overlapping_glyphs_p, row->enabled_p, - row->inverse_p, row->truncated_on_left_p, row->truncated_on_right_p, row->overlay_arrow_p, @@ -13394,7 +13393,6 @@ compute_line_metrics (&it); it.glyph_row->full_width_p = 1; it.glyph_row->mode_line_p = 1; - it.glyph_row->inverse_p = 0; it.glyph_row->continued_p = 0; it.glyph_row->truncated_on_left_p = 0; it.glyph_row->truncated_on_right_p = 0; Index: src/xterm.c =================================================================== RCS file: /cvs/emacs/src/xterm.c,v retrieving revision 1.652 diff -u -r1.652 xterm.c --- src/xterm.c 2001/10/05 16:35:12 1.652 +++ src/xterm.c 2001/10/07 02:44:05 @@ -437,8 +437,6 @@ enum draw_glyphs_face)); static void x_update_end P_ ((struct frame *)); static void XTframe_up_to_date P_ ((struct frame *)); -static void XTreassert_line_highlight P_ ((int, int)); -static void x_change_line_highlight P_ ((int, int, int, int)); static void XTset_terminal_modes P_ ((void)); static void XTreset_terminal_modes P_ ((void)); static void XTcursor_to P_ ((int, int, int, int)); @@ -1023,32 +1021,6 @@ } -/*********************************************************************** - Line Highlighting - ***********************************************************************/ - -/* External interface to control of standout mode. Not used for X - frames. Aborts when called. */ - -static void -XTreassert_line_highlight (new, vpos) - int new, vpos; -{ - abort (); -} - - -/* Call this when about to modify line at position VPOS and change - whether it is highlighted. Not used for X frames. Aborts when - called. */ - -static void -x_change_line_highlight (new_highlight, vpos, y, first_unused_hpos) - int new_highlight, vpos, y, first_unused_hpos; -{ - abort (); -} - /* This is called when starting Emacs and when restarting after suspend. When starting Emacs, no X window is mapped. And nothing @@ -5269,9 +5241,7 @@ && row->glyphs[area][i].overlaps_vertically_p); x_draw_glyphs (w, start_x, row, area, start, i, - (row->inverse_p - ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT), - NULL, NULL, 1); + DRAW_NORMAL_TEXT, NULL, NULL, 1); } else { @@ -5306,8 +5276,7 @@ x = x_draw_glyphs (updated_window, output_cursor.x, updated_row, updated_area, hpos, hpos + len, - (updated_row->inverse_p - ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT), + DRAW_NORMAL_TEXT, &real_start, &real_end, 0); /* If we drew over the cursor, note that it is not visible any more. */ @@ -5935,10 +5904,8 @@ if (area == TEXT_AREA && row->fill_line_p) /* If row extends face to end of line write the whole line. */ - x_draw_glyphs (w, 0, row, area, - 0, row->used[area], - row->inverse_p ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT, - NULL, NULL, 0); + x_draw_glyphs (w, 0, row, area, 0, row->used[area], + DRAW_NORMAL_TEXT, NULL, NULL, 0); else { /* Set START_X to the window-relative start position for drawing glyphs of @@ -5976,7 +5943,7 @@ x_draw_glyphs (w, first_x - start_x, row, area, first - row->glyphs[area], last - row->glyphs[area], - row->inverse_p ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT, + DRAW_NORMAL_TEXT, NULL, NULL, 0); } } @@ -5996,8 +5963,7 @@ if (row->mode_line_p || w->pseudo_window_p) x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA], - row->inverse_p ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT, - NULL, NULL, 0); + DRAW_NORMAL_TEXT, NULL, NULL, 0); else { if (row->used[LEFT_MARGIN_AREA]) @@ -11441,8 +11407,6 @@ /* Erase the cursor by redrawing the character underneath it. */ if (mouse_face_here_p) hl = DRAW_MOUSE_FACE; - else if (cursor_row->inverse_p) - hl = DRAW_INVERSE_VIDEO; else hl = DRAW_NORMAL_TEXT; x_draw_phys_cursor_glyph (w, cursor_row, hl); @@ -14671,7 +14635,6 @@ clear_frame_hook = x_clear_frame; ins_del_lines_hook = x_ins_del_lines; - change_line_highlight_hook = x_change_line_highlight; delete_glyphs_hook = x_delete_glyphs; ring_bell_hook = XTring_bell; reset_terminal_modes_hook = XTreset_terminal_modes; @@ -14681,7 +14644,6 @@ set_terminal_window_hook = XTset_terminal_window; read_socket_hook = XTread_socket; frame_up_to_date_hook = XTframe_up_to_date; - reassert_line_highlight_hook = XTreassert_line_highlight; mouse_position_hook = XTmouse_position; frame_rehighlight_hook = XTframe_rehighlight; frame_raise_lower_hook = XTframe_raise_lower;