changeset 86907:0f135bf21932

(w32_face_attributes): Comment previous change.
author Jason Rumney <jasonr@gnu.org>
date Sat, 01 Dec 2007 15:57:41 +0000
parents 3f2865b28572
children 6e9e38d61817
files src/w32console.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32console.c	Sat Dec 01 15:15:47 2007 +0000
+++ b/src/w32console.c	Sat Dec 01 15:57:41 2007 +0000
@@ -517,12 +517,15 @@
   if (NILP (Vtty_defined_color_alist))
     return char_attr;
 
-  if (face->foreground >= 0
-      && face->foreground < 16)
+  /* Colors should be in the range 0...15 unless they are one of
+     FACE_TTY_DEFAULT_COLOR, FACE_TTY_DEFAULT_FG_COLOR or
+     FACE_TTY_DEFAULT_BG_COLOR.  Other out of range colors are
+     invalid, so it is better to use the default color if they ever
+     get through to here.  */
+  if (face->foreground >= 0 && face->foreground < 16)
     char_attr = (char_attr & 0xfff0) + face->foreground;
 
-  if (face->background >= 0
-      && face->background < 16)
+  if (face->background >= 0 && face->background < 16)
     char_attr = (char_attr & 0xff0f) + (face->background << 4);
 
   return char_attr;