diff options
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/src/term.c b/src/term.c index 3d7a677374c..8ce2efc0929 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -122,12 +122,11 @@ enum no_color_bit | |||
| 122 | NC_STANDOUT = 1 << 0, | 122 | NC_STANDOUT = 1 << 0, |
| 123 | NC_UNDERLINE = 1 << 1, | 123 | NC_UNDERLINE = 1 << 1, |
| 124 | NC_REVERSE = 1 << 2, | 124 | NC_REVERSE = 1 << 2, |
| 125 | NC_BLINK = 1 << 3, | 125 | NC_ITALIC = 1 << 3, |
| 126 | NC_DIM = 1 << 4, | 126 | NC_DIM = 1 << 4, |
| 127 | NC_BOLD = 1 << 5, | 127 | NC_BOLD = 1 << 5, |
| 128 | NC_INVIS = 1 << 6, | 128 | NC_INVIS = 1 << 6, |
| 129 | NC_PROTECT = 1 << 7, | 129 | NC_PROTECT = 1 << 7 |
| 130 | NC_ALT_CHARSET = 1 << 8 | ||
| 131 | }; | 130 | }; |
| 132 | 131 | ||
| 133 | /* internal state */ | 132 | /* internal state */ |
| @@ -2022,17 +2021,16 @@ turn_on_face (struct frame *f, int face_id) | |||
| 2022 | if (face->tty_bold_p && MAY_USE_WITH_COLORS_P (tty, NC_BOLD)) | 2021 | if (face->tty_bold_p && MAY_USE_WITH_COLORS_P (tty, NC_BOLD)) |
| 2023 | OUTPUT1_IF (tty, tty->TS_enter_bold_mode); | 2022 | OUTPUT1_IF (tty, tty->TS_enter_bold_mode); |
| 2024 | 2023 | ||
| 2025 | if (face->tty_dim_p && MAY_USE_WITH_COLORS_P (tty, NC_DIM)) | 2024 | if (face->tty_italic_p && MAY_USE_WITH_COLORS_P (tty, NC_ITALIC)) |
| 2026 | OUTPUT1_IF (tty, tty->TS_enter_dim_mode); | 2025 | { |
| 2027 | 2026 | if (tty->TS_enter_italic_mode) | |
| 2028 | /* Alternate charset and blinking not yet used. */ | 2027 | OUTPUT1 (tty, tty->TS_enter_italic_mode); |
| 2029 | if (face->tty_alt_charset_p | 2028 | else |
| 2030 | && MAY_USE_WITH_COLORS_P (tty, NC_ALT_CHARSET)) | 2029 | /* Italics mode is unavailable on many terminals. In that |
| 2031 | OUTPUT1_IF (tty, tty->TS_enter_alt_charset_mode); | 2030 | case, map slant to dimmed text; we want italic text to |
| 2032 | 2031 | appear different and dimming is not otherwise used. */ | |
| 2033 | if (face->tty_blinking_p | 2032 | OUTPUT1 (tty, tty->TS_enter_dim_mode); |
| 2034 | && MAY_USE_WITH_COLORS_P (tty, NC_BLINK)) | 2033 | } |
| 2035 | OUTPUT1_IF (tty, tty->TS_enter_blink_mode); | ||
| 2036 | 2034 | ||
| 2037 | if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) | 2035 | if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) |
| 2038 | OUTPUT1_IF (tty, tty->TS_enter_underline_mode); | 2036 | OUTPUT1_IF (tty, tty->TS_enter_underline_mode); |
| @@ -2077,27 +2075,19 @@ turn_off_face (struct frame *f, int face_id) | |||
| 2077 | half-bright, reverse-video, standout, underline. It may or | 2075 | half-bright, reverse-video, standout, underline. It may or |
| 2078 | may not turn off alt-char-mode. */ | 2076 | may not turn off alt-char-mode. */ |
| 2079 | if (face->tty_bold_p | 2077 | if (face->tty_bold_p |
| 2080 | || face->tty_dim_p | 2078 | || face->tty_italic_p |
| 2081 | || face->tty_reverse_p | 2079 | || face->tty_reverse_p |
| 2082 | || face->tty_alt_charset_p | ||
| 2083 | || face->tty_blinking_p | ||
| 2084 | || face->tty_underline_p) | 2080 | || face->tty_underline_p) |
| 2085 | { | 2081 | { |
| 2086 | OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); | 2082 | OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); |
| 2087 | if (strcmp (tty->TS_exit_attribute_mode, tty->TS_end_standout_mode) == 0) | 2083 | if (strcmp (tty->TS_exit_attribute_mode, tty->TS_end_standout_mode) == 0) |
| 2088 | tty->standout_mode = 0; | 2084 | tty->standout_mode = 0; |
| 2089 | } | 2085 | } |
| 2090 | |||
| 2091 | if (face->tty_alt_charset_p) | ||
| 2092 | OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode); | ||
| 2093 | } | 2086 | } |
| 2094 | else | 2087 | else |
| 2095 | { | 2088 | { |
| 2096 | /* If we don't have "me" we can only have those appearances | 2089 | /* If we don't have "me" we can only have those appearances |
| 2097 | that have exit sequences defined. */ | 2090 | that have exit sequences defined. */ |
| 2098 | if (face->tty_alt_charset_p) | ||
| 2099 | OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode); | ||
| 2100 | |||
| 2101 | if (face->tty_underline_p) | 2091 | if (face->tty_underline_p) |
| 2102 | OUTPUT_IF (tty, tty->TS_exit_underline_mode); | 2092 | OUTPUT_IF (tty, tty->TS_exit_underline_mode); |
| 2103 | } | 2093 | } |
| @@ -2128,8 +2118,7 @@ tty_capable_p (struct tty_display_info *tty, unsigned int caps, | |||
| 2128 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); | 2118 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); |
| 2129 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); | 2119 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); |
| 2130 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_DIM, tty->TS_enter_dim_mode, NC_DIM); | 2120 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_DIM, tty->TS_enter_dim_mode, NC_DIM); |
| 2131 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_BLINK, tty->TS_enter_blink_mode, NC_BLINK); | 2121 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_ITALIC, tty->TS_enter_italic_mode, NC_ITALIC); |
| 2132 | TTY_CAPABLE_P_TRY (tty, TTY_CAP_ALT_CHARSET, tty->TS_enter_alt_charset_mode, NC_ALT_CHARSET); | ||
| 2133 | 2122 | ||
| 2134 | /* We can do it! */ | 2123 | /* We can do it! */ |
| 2135 | return 1; | 2124 | return 1; |
| @@ -3222,8 +3211,8 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ | |||
| 3222 | tty->TS_enter_underline_mode = tgetstr ("us", address); | 3211 | tty->TS_enter_underline_mode = tgetstr ("us", address); |
| 3223 | tty->TS_exit_underline_mode = tgetstr ("ue", address); | 3212 | tty->TS_exit_underline_mode = tgetstr ("ue", address); |
| 3224 | tty->TS_enter_bold_mode = tgetstr ("md", address); | 3213 | tty->TS_enter_bold_mode = tgetstr ("md", address); |
| 3214 | tty->TS_enter_italic_mode = tgetstr ("ZH", address); | ||
| 3225 | tty->TS_enter_dim_mode = tgetstr ("mh", address); | 3215 | tty->TS_enter_dim_mode = tgetstr ("mh", address); |
| 3226 | tty->TS_enter_blink_mode = tgetstr ("mb", address); | ||
| 3227 | tty->TS_enter_reverse_mode = tgetstr ("mr", address); | 3216 | tty->TS_enter_reverse_mode = tgetstr ("mr", address); |
| 3228 | tty->TS_enter_alt_charset_mode = tgetstr ("as", address); | 3217 | tty->TS_enter_alt_charset_mode = tgetstr ("as", address); |
| 3229 | tty->TS_exit_alt_charset_mode = tgetstr ("ae", address); | 3218 | tty->TS_exit_alt_charset_mode = tgetstr ("ae", address); |