From e7f90eab7e2c5d4a86cc5c19f81a890a55107804 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Fri, 12 Nov 1999 14:35:43 +0000 Subject: [PATCH] (term_init): If "op" isn't available, don't support color because we can't switch back to the default foreground and background. --- src/ChangeLog | 4 ++++ src/term.c | 23 ++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3e1aca9c656..3b90332764e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 1999-11-12 Gerd Moellmann + * term.c (term_init): If "op" isn't available, don't support color + because we can't switch back to the default foreground and + background. + * doc.c (Fdocumentation_property): Remove GCPRO because Fsubstitute_command_keys gcpro's the string. diff --git a/src/term.c b/src/term.c index 80e49028818..fc6fa103187 100644 --- a/src/term.c +++ b/src/term.c @@ -2213,18 +2213,23 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", MultiLeft = tgetstr ("LE", address); MultiRight = tgetstr ("RI", address); - /* SVr4/ANSI color suppert. */ + /* SVr4/ANSI color suppert. If "op" isn't available, don't support + color because we can't switch back to the default foreground and + background. */ TS_orig_pair = tgetstr ("op", address); - TS_set_foreground = tgetstr ("AF", address); - TS_set_background = tgetstr ("AB", address); - if (!TS_set_foreground) + if (TS_orig_pair) { - /* SVr4. */ - TS_set_foreground = tgetstr ("Sf", address); - TS_set_background = tgetstr ("Sb", address); + TS_set_foreground = tgetstr ("AF", address); + TS_set_background = tgetstr ("AB", address); + if (!TS_set_foreground) + { + /* SVr4. */ + TS_set_foreground = tgetstr ("Sf", address); + TS_set_background = tgetstr ("Sb", address); + } + TN_max_colors = tgetnum ("Co"); + TN_max_pairs = tgetnum ("pa"); } - TN_max_colors = tgetnum ("Co"); - TN_max_pairs = tgetnum ("pa"); MagicWrap = tgetflag ("xn"); /* Since we make MagicWrap terminals look like AutoWrap, we need to have -- 2.39.5