emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32console.c,v


From: Jason Rumney
Subject: [Emacs-diffs] Changes to emacs/src/w32console.c,v
Date: Fri, 30 Nov 2007 17:15:47 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Jason Rumney <jasonr>   07/11/30 17:15:47

Index: w32console.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32console.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- w32console.c        30 Nov 2007 13:57:21 -0000      1.55
+++ w32console.c        30 Nov 2007 17:15:46 -0000      1.56
@@ -506,22 +506,24 @@
 
   char_attr = char_attr_normal;
 
-  if (face->foreground != FACE_TTY_DEFAULT_FG_COLOR
-      && face->foreground != FACE_TTY_DEFAULT_COLOR)
-    char_attr = (char_attr & 0xfff0) + (face->foreground % 16);
-
-  if (face->background != FACE_TTY_DEFAULT_BG_COLOR
-      && face->background != FACE_TTY_DEFAULT_COLOR)
-    char_attr = (char_attr & 0xff0f) + ((face->background % 16) << 4);
+  /* Reverse the default color if requested. If background and
+     foreground are specified, then they have been reversed already.  */
+  if (face->tty_reverse_p)
+    char_attr = (char_attr & 0xff00) + ((char_attr & 0x000f) << 4)
+      + ((char_attr & 0x00f0) >> 4);
 
   /* Before the terminal is properly initialized, all colors map to 0.
-     If we get a face like this, use the normal terminal attributes.  */
+     Don't try to resolve them.  */
   if (NILP (Vtty_defined_color_alist))
-    char_attr = char_attr_normal;
+    return char_attr;
 
-  if (face->tty_reverse_p)
-    char_attr = (char_attr & 0xff00) + ((char_attr & 0x000f) << 4)
-      + ((char_attr & 0x00f0) >> 4);
+  if (face->foreground >= 0
+      && face->foreground < 16)
+    char_attr = (char_attr & 0xfff0) + face->foreground;
+
+  if (face->background >= 0
+      && face->background < 16)
+    char_attr = (char_attr & 0xff0f) + (face->background << 4);
 
   return char_attr;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]