]> code.delx.au - gnu-emacs/commitdiff
(term_init): If "op" isn't available, don't support color
authorGerd Moellmann <gerd@gnu.org>
Fri, 12 Nov 1999 14:35:43 +0000 (14:35 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 12 Nov 1999 14:35:43 +0000 (14:35 +0000)
because we can't switch back to the default foreground and
background.

src/ChangeLog
src/term.c

index 3e1aca9c656255896ec3dc517b5551b1ef231b66..3b90332764e3dd35638e49f90d7c70e8cd65a85f 100644 (file)
@@ -1,5 +1,9 @@
 1999-11-12  Gerd Moellmann  <gerd@gnu.org>
 
+       * 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.
 
index 80e49028818dba8c916d3fe776accb4755ccd42a..fc6fa1031872b9cd6d3f78fa96610288854646b8 100644 (file)
@@ -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