]> code.delx.au - gnu-emacs/commitdiff
* xfaces.c (face_for_overlay_string): Handle face remapping.
authorChong Yidong <cyd@gnu.org>
Sat, 9 Jun 2012 09:37:47 +0000 (17:37 +0800)
committerChong Yidong <cyd@gnu.org>
Sat, 9 Jun 2012 09:37:47 +0000 (17:37 +0800)
Fixes: debbugs:2066
src/ChangeLog
src/xfaces.c

index c221746824adf274c1b05bf14af2bc915b59038f..ef770cbf7ec398f5905d3fee5d5310c7698668eb 100644 (file)
@@ -1,5 +1,7 @@
 2012-06-09  Chong Yidong  <cyd@gnu.org>
 
+       * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
+
        * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
        case (Bug#9752).
 
index 84a47cf6ccf9c64992ba5e8a5c568f14d105df75..10d1c93fef8874cb1fe60f190d3097772272f88b 100644 (file)
@@ -4579,7 +4579,7 @@ lookup_named_face (struct frame *f, Lisp_Object symbol, int signal_p)
 }
 
 
-/* Return the display face-id of the basic face who's canonical face-id
+/* Return the display face-id of the basic face whose canonical face-id
    is FACE_ID.  The return value will usually simply be FACE_ID, unless that
    basic face has bee remapped via Vface_remapping_alist.  This function is
    conservative: if something goes wrong, it will simply return FACE_ID
@@ -5336,11 +5336,11 @@ realize_default_face (struct frame *f)
   /* If the `default' face is not yet known, create it.  */
   lface = lface_from_face_name (f, Qdefault, 0);
   if (NILP (lface))
-  {
+    {
        Lisp_Object frame;
        XSETFRAME (frame, f);
        lface = Finternal_make_lisp_face (Qdefault, frame);
-  }
+    }
 
 #ifdef HAVE_WINDOW_SYSTEM
   if (FRAME_WINDOW_P (f))
@@ -6111,14 +6111,14 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
 
   *endptr = endpos;
 
-  default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
-
-  /* Optimize common cases where we can use the default face.  */
+  /* Optimize common case where we can use the default face.  */
   if (NILP (prop)
-      && !(pos >= region_beg && pos < region_end))
+      && !(pos >= region_beg && pos < region_end)
+      && NILP (Vface_remapping_alist))
     return DEFAULT_FACE_ID;
 
   /* Begin with attributes from the default face.  */
+  default_face = FACE_FROM_ID (f, lookup_basic_face (f, DEFAULT_FACE_ID));
   memcpy (attrs, default_face->lface, sizeof attrs);
 
   /* Merge in attributes specified via text properties.  */