diff options
| author | Miles Bader | 2001-10-20 10:33:48 +0000 |
|---|---|---|
| committer | Miles Bader | 2001-10-20 10:33:48 +0000 |
| commit | 54800acbf3ed5419cc813ca50ddd2c13816bc7f9 (patch) | |
| tree | f125e91afcd4650b7686c00470f393e44f6d78a7 /src | |
| parent | e568708bb19fb0a12ec57a839cd4d3c067ba4b47 (diff) | |
| download | emacs-54800acbf3ed5419cc813ca50ddd2c13816bc7f9.tar.gz emacs-54800acbf3ed5419cc813ca50ddd2c13816bc7f9.zip | |
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
(term_init): Don't set them.
Turn off any standout/underline modes that require magic cookies.
(ins_del_lines, highlight_if_desired, background_highlight)
(turn_on_highlight, turn_off_highlight, reset_terminal_modes):
Remove special processing for magic-cookie standout modes.
(turn_off_face, turn_on_face): Remove special processing for
underline magic-cookie glitch.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/term.c | 96 |
2 files changed, 36 insertions, 68 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 50bfe171455..0e7071be054 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -64,6 +64,14 @@ | |||
| 64 | (clear_end_of_line_raw): Renamed to `clear_end_of_line'. | 64 | (clear_end_of_line_raw): Renamed to `clear_end_of_line'. |
| 65 | (clear_to_end): Call `clear_end_of_line' instead of | 65 | (clear_to_end): Call `clear_end_of_line' instead of |
| 66 | `clear_end_of_line_raw'. | 66 | `clear_end_of_line_raw'. |
| 67 | (TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Vars removed. | ||
| 68 | (term_init): Don't set them. | ||
| 69 | Turn off any standout/underline modes that require magic cookies. | ||
| 70 | (ins_del_lines, highlight_if_desired, background_highlight) | ||
| 71 | (turn_on_highlight, turn_off_highlight, reset_terminal_modes): | ||
| 72 | Remove special processing for magic-cookie standout modes. | ||
| 73 | (turn_off_face, turn_on_face): Remove special processing for | ||
| 74 | underline magic-cookie glitch. | ||
| 67 | 75 | ||
| 68 | 2001-10-19 Richard M. Stallman <rms@gnu.org> | 76 | 2001-10-19 Richard M. Stallman <rms@gnu.org> |
| 69 | 77 | ||
diff --git a/src/term.c b/src/term.c index dc75820bde8..f157bbf5fee 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -322,10 +322,6 @@ char *TS_enter_reverse_mode; | |||
| 322 | 322 | ||
| 323 | char *TS_exit_underline_mode, *TS_enter_underline_mode; | 323 | char *TS_exit_underline_mode, *TS_enter_underline_mode; |
| 324 | 324 | ||
| 325 | /* "ug" -- number of blanks left by underline. */ | ||
| 326 | |||
| 327 | int TN_magic_cookie_glitch_ul; | ||
| 328 | |||
| 329 | /* "as"/"ae" -- start/end alternate character set. Not really | 325 | /* "as"/"ae" -- start/end alternate character set. Not really |
| 330 | supported, yet. */ | 326 | supported, yet. */ |
| 331 | 327 | ||
| @@ -361,13 +357,6 @@ int TF_underscore; /* termcap ul flag: _ underlines if over-struck on | |||
| 361 | int TF_teleray; /* termcap xt flag: many weird consequences. | 357 | int TF_teleray; /* termcap xt flag: many weird consequences. |
| 362 | For t1061. */ | 358 | For t1061. */ |
| 363 | 359 | ||
| 364 | int TF_xs; /* Nonzero for "xs". If set together with | ||
| 365 | TN_standout_width == 0, it means don't bother | ||
| 366 | to write any end-standout cookies. */ | ||
| 367 | |||
| 368 | int TN_standout_width; /* termcap sg number: width occupied by standout | ||
| 369 | markers */ | ||
| 370 | |||
| 371 | static int RPov; /* # chars to start a TS_repeat */ | 360 | static int RPov; /* # chars to start a TS_repeat */ |
| 372 | 361 | ||
| 373 | static int delete_in_insert_mode; /* delete mode == insert mode */ | 362 | static int delete_in_insert_mode; /* delete mode == insert mode */ |
| @@ -475,19 +464,13 @@ reset_terminal_modes () | |||
| 475 | { | 464 | { |
| 476 | if (FRAME_TERMCAP_P (XFRAME (selected_frame))) | 465 | if (FRAME_TERMCAP_P (XFRAME (selected_frame))) |
| 477 | { | 466 | { |
| 478 | if (TN_standout_width < 0) | 467 | turn_off_highlight (); |
| 479 | turn_off_highlight (); | ||
| 480 | turn_off_insert (); | 468 | turn_off_insert (); |
| 481 | OUTPUT_IF (TS_end_keypad_mode); | 469 | OUTPUT_IF (TS_end_keypad_mode); |
| 482 | OUTPUT_IF (TS_cursor_normal); | 470 | OUTPUT_IF (TS_cursor_normal); |
| 483 | OUTPUT_IF (TS_end_termcap_modes); | 471 | OUTPUT_IF (TS_end_termcap_modes); |
| 484 | OUTPUT_IF (TS_orig_pair); | 472 | OUTPUT_IF (TS_orig_pair); |
| 485 | /* Output raw CR so kernel can track the cursor hpos. */ | 473 | /* Output raw CR so kernel can track the cursor hpos. */ |
| 486 | /* But on magic-cookie terminals this can erase an end-standout | ||
| 487 | marker and cause the rest of the frame to be in standout, so | ||
| 488 | move down first. */ | ||
| 489 | if (TN_standout_width >= 0) | ||
| 490 | cmputc ('\n'); | ||
| 491 | cmputc ('\r'); | 474 | cmputc ('\r'); |
| 492 | } | 475 | } |
| 493 | else if (reset_terminal_modes_hook) | 476 | else if (reset_terminal_modes_hook) |
| @@ -573,33 +556,22 @@ turn_off_insert () | |||
| 573 | insert_mode = 0; | 556 | insert_mode = 0; |
| 574 | } | 557 | } |
| 575 | 558 | ||
| 576 | /* Handle highlighting when TN_standout_width (termcap sg) is not specified. | 559 | /* Handle highlighting. */ |
| 577 | In these terminals, output is affected by the value of standout | ||
| 578 | mode when the output is written. | ||
| 579 | |||
| 580 | These functions are called on all terminals, but do nothing | ||
| 581 | on terminals whose standout mode does not work that way. */ | ||
| 582 | 560 | ||
| 583 | void | 561 | void |
| 584 | turn_off_highlight () | 562 | turn_off_highlight () |
| 585 | { | 563 | { |
| 586 | if (TN_standout_width < 0) | 564 | if (standout_mode) |
| 587 | { | 565 | OUTPUT_IF (TS_end_standout_mode); |
| 588 | if (standout_mode) | 566 | standout_mode = 0; |
| 589 | OUTPUT_IF (TS_end_standout_mode); | ||
| 590 | standout_mode = 0; | ||
| 591 | } | ||
| 592 | } | 567 | } |
| 593 | 568 | ||
| 594 | static void | 569 | static void |
| 595 | turn_on_highlight () | 570 | turn_on_highlight () |
| 596 | { | 571 | { |
| 597 | if (TN_standout_width < 0) | 572 | if (!standout_mode) |
| 598 | { | 573 | OUTPUT_IF (TS_standout_mode); |
| 599 | if (!standout_mode) | 574 | standout_mode = 1; |
| 600 | OUTPUT_IF (TS_standout_mode); | ||
| 601 | standout_mode = 1; | ||
| 602 | } | ||
| 603 | } | 575 | } |
| 604 | 576 | ||
| 605 | static void | 577 | static void |
| @@ -646,8 +618,6 @@ tty_show_cursor () | |||
| 646 | void | 618 | void |
| 647 | background_highlight () | 619 | background_highlight () |
| 648 | { | 620 | { |
| 649 | if (TN_standout_width >= 0) | ||
| 650 | return; | ||
| 651 | if (inverse_video) | 621 | if (inverse_video) |
| 652 | turn_on_highlight (); | 622 | turn_on_highlight (); |
| 653 | else | 623 | else |
| @@ -659,8 +629,6 @@ background_highlight () | |||
| 659 | static void | 629 | static void |
| 660 | highlight_if_desired () | 630 | highlight_if_desired () |
| 661 | { | 631 | { |
| 662 | if (TN_standout_width >= 0) | ||
| 663 | return; | ||
| 664 | if (inverse_video) | 632 | if (inverse_video) |
| 665 | turn_on_highlight (); | 633 | turn_on_highlight (); |
| 666 | else | 634 | else |
| @@ -1222,13 +1190,6 @@ ins_del_lines (vpos, n) | |||
| 1222 | set_scroll_region (0, specified_window); | 1190 | set_scroll_region (0, specified_window); |
| 1223 | } | 1191 | } |
| 1224 | 1192 | ||
| 1225 | if (TN_standout_width >= 0) | ||
| 1226 | { | ||
| 1227 | register int lower_limit | ||
| 1228 | = (scroll_region_ok | ||
| 1229 | ? specified_window | ||
| 1230 | : FRAME_HEIGHT (sf)); | ||
| 1231 | } | ||
| 1232 | if (!scroll_region_ok && memory_below_frame && n < 0) | 1193 | if (!scroll_region_ok && memory_below_frame && n < 0) |
| 1233 | { | 1194 | { |
| 1234 | cursor_to (FRAME_HEIGHT (sf) + n, 0); | 1195 | cursor_to (FRAME_HEIGHT (sf) + n, 0); |
| @@ -1935,10 +1896,7 @@ turn_on_face (f, face_id) | |||
| 1935 | && MAY_USE_WITH_COLORS_P (NC_BLINK)) | 1896 | && MAY_USE_WITH_COLORS_P (NC_BLINK)) |
| 1936 | OUTPUT1_IF (TS_enter_blink_mode); | 1897 | OUTPUT1_IF (TS_enter_blink_mode); |
| 1937 | 1898 | ||
| 1938 | if (face->tty_underline_p | 1899 | if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (NC_UNDERLINE)) |
| 1939 | /* Don't underline if that's difficult. */ | ||
| 1940 | && TN_magic_cookie_glitch_ul <= 0 | ||
| 1941 | && MAY_USE_WITH_COLORS_P (NC_UNDERLINE)) | ||
| 1942 | OUTPUT1_IF (TS_enter_underline_mode); | 1900 | OUTPUT1_IF (TS_enter_underline_mode); |
| 1943 | 1901 | ||
| 1944 | if (TN_max_colors > 0) | 1902 | if (TN_max_colors > 0) |
| @@ -2000,9 +1958,7 @@ turn_off_face (f, face_id) | |||
| 2000 | if (face->tty_alt_charset_p) | 1958 | if (face->tty_alt_charset_p) |
| 2001 | OUTPUT_IF (TS_exit_alt_charset_mode); | 1959 | OUTPUT_IF (TS_exit_alt_charset_mode); |
| 2002 | 1960 | ||
| 2003 | if (face->tty_underline_p | 1961 | if (face->tty_underline_p) |
| 2004 | /* We don't underline if that's difficult. */ | ||
| 2005 | && TN_magic_cookie_glitch_ul <= 0) | ||
| 2006 | OUTPUT_IF (TS_exit_underline_mode); | 1962 | OUTPUT_IF (TS_exit_underline_mode); |
| 2007 | } | 1963 | } |
| 2008 | 1964 | ||
| @@ -2180,7 +2136,6 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2180 | 2136 | ||
| 2181 | TS_enter_underline_mode = tgetstr ("us", address); | 2137 | TS_enter_underline_mode = tgetstr ("us", address); |
| 2182 | TS_exit_underline_mode = tgetstr ("ue", address); | 2138 | TS_exit_underline_mode = tgetstr ("ue", address); |
| 2183 | TN_magic_cookie_glitch_ul = tgetnum ("ug"); | ||
| 2184 | TS_enter_bold_mode = tgetstr ("md", address); | 2139 | TS_enter_bold_mode = tgetstr ("md", address); |
| 2185 | TS_enter_dim_mode = tgetstr ("mh", address); | 2140 | TS_enter_dim_mode = tgetstr ("mh", address); |
| 2186 | TS_enter_blink_mode = tgetstr ("mb", address); | 2141 | TS_enter_blink_mode = tgetstr ("mb", address); |
| @@ -2228,7 +2183,6 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2228 | TF_insmode_motion = tgetflag ("mi"); | 2183 | TF_insmode_motion = tgetflag ("mi"); |
| 2229 | TF_standout_motion = tgetflag ("ms"); | 2184 | TF_standout_motion = tgetflag ("ms"); |
| 2230 | TF_underscore = tgetflag ("ul"); | 2185 | TF_underscore = tgetflag ("ul"); |
| 2231 | TF_xs = tgetflag ("xs"); | ||
| 2232 | TF_teleray = tgetflag ("xt"); | 2186 | TF_teleray = tgetflag ("xt"); |
| 2233 | 2187 | ||
| 2234 | term_get_fkeys (address); | 2188 | term_get_fkeys (address); |
| @@ -2254,7 +2208,6 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2254 | FRAME_HEIGHT (sf), FRAME_WIDTH (sf)); | 2208 | FRAME_HEIGHT (sf), FRAME_WIDTH (sf)); |
| 2255 | 2209 | ||
| 2256 | min_padding_speed = tgetnum ("pb"); | 2210 | min_padding_speed = tgetnum ("pb"); |
| 2257 | TN_standout_width = tgetnum ("sg"); | ||
| 2258 | TabWidth = tgetnum ("tw"); | 2211 | TabWidth = tgetnum ("tw"); |
| 2259 | 2212 | ||
| 2260 | #ifdef VMS | 2213 | #ifdef VMS |
| @@ -2283,11 +2236,24 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2283 | Wcm.cm_tab = "\t"; | 2236 | Wcm.cm_tab = "\t"; |
| 2284 | */ | 2237 | */ |
| 2285 | 2238 | ||
| 2239 | /* We don't support standout modes that use `magic cookies', so | ||
| 2240 | turn off any that do. */ | ||
| 2241 | if (TS_standout_mode && tgetnum ("sg") >= 0) | ||
| 2242 | { | ||
| 2243 | TS_standout_mode = 0; | ||
| 2244 | TS_end_standout_mode = 0; | ||
| 2245 | } | ||
| 2246 | if (TS_enter_underline_mode && tgetnum ("ug") >= 0) | ||
| 2247 | { | ||
| 2248 | TS_enter_underline_mode = 0; | ||
| 2249 | TS_exit_underline_mode = 0; | ||
| 2250 | } | ||
| 2251 | |||
| 2252 | /* If there's no standout mode, try to use underlining instead. */ | ||
| 2286 | if (TS_standout_mode == 0) | 2253 | if (TS_standout_mode == 0) |
| 2287 | { | 2254 | { |
| 2288 | TN_standout_width = tgetnum ("ug"); | 2255 | TS_standout_mode = TS_enter_underline_mode; |
| 2289 | TS_end_standout_mode = tgetstr ("ue", address); | 2256 | TS_end_standout_mode = TS_exit_underline_mode; |
| 2290 | TS_standout_mode = tgetstr ("us", address); | ||
| 2291 | } | 2257 | } |
| 2292 | 2258 | ||
| 2293 | /* If no `se' string, try using a `me' string instead. | 2259 | /* If no `se' string, try using a `me' string instead. |
| @@ -2304,10 +2270,8 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2304 | if (TF_teleray) | 2270 | if (TF_teleray) |
| 2305 | { | 2271 | { |
| 2306 | Wcm.cm_tab = 0; | 2272 | Wcm.cm_tab = 0; |
| 2307 | /* Teleray: most programs want a space in front of TS_standout_mode, | 2273 | /* We can't support standout mode, because it uses magic cookies. */ |
| 2308 | but Emacs can do without it (and give one extra column). */ | 2274 | TS_standout_mode = 0; |
| 2309 | TS_standout_mode = "\033RD"; | ||
| 2310 | TN_standout_width = 1; | ||
| 2311 | /* But that means we cannot rely on ^M to go to column zero! */ | 2275 | /* But that means we cannot rely on ^M to go to column zero! */ |
| 2312 | CR = 0; | 2276 | CR = 0; |
| 2313 | /* LF can't be trusted either -- can alter hpos */ | 2277 | /* LF can't be trusted either -- can alter hpos */ |
| @@ -2407,10 +2371,6 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", | |||
| 2407 | && TS_end_standout_mode | 2371 | && TS_end_standout_mode |
| 2408 | && !strcmp (TS_standout_mode, TS_end_standout_mode)); | 2372 | && !strcmp (TS_standout_mode, TS_end_standout_mode)); |
| 2409 | 2373 | ||
| 2410 | /* Remove width of standout marker from usable width of line */ | ||
| 2411 | if (TN_standout_width > 0) | ||
| 2412 | SET_FRAME_WIDTH (sf, FRAME_WIDTH (sf) - TN_standout_width); | ||
| 2413 | |||
| 2414 | UseTabs = tabs_safe_p () && TabWidth == 8; | 2374 | UseTabs = tabs_safe_p () && TabWidth == 8; |
| 2415 | 2375 | ||
| 2416 | scroll_region_ok | 2376 | scroll_region_ok |