emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107654: For line prefixes, use defau


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107654: For line prefixes, use default face; don't inherit from previous line.
Date: Thu, 22 Mar 2012 15:08:17 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107654
fixes bug(s): http://debbugs.gnu.org/4281
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Thu 2012-03-22 15:08:17 +0800
message:
  For line prefixes, use default face; don't inherit from previous line.
  
  * src/dispextern.h (struct it): New member string_from_prefix_prop_p.
  
  * src/xdisp.c (push_prefix_prop): Renamed from push_display_prop.
  Mark string as coming from a prefix property.
  (handle_face_prop): Use default face for prefix strings.
  (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
modified:
  src/ChangeLog
  src/dispextern.h
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-03-21 07:02:13 +0000
+++ b/src/ChangeLog     2012-03-22 07:08:17 +0000
@@ -1,3 +1,12 @@
+2012-03-22  Chong Yidong  <address@hidden>
+
+       * dispextern.h (struct it): New member string_from_prefix_prop_p.
+
+       * xdisp.c (push_prefix_prop): Renamed from push_display_prop.
+       Mark string as coming from a prefix property.
+       (handle_face_prop): Use default face for prefix strings (Bug#4281).
+       (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
+
 2012-03-21  Chong Yidong  <address@hidden>
 
        * xfaces.c (Vface_remapping_alist): Doc fix.

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2012-01-19 07:21:25 +0000
+++ b/src/dispextern.h  2012-03-22 07:08:17 +0000
@@ -2152,6 +2152,10 @@
      Don't handle some `display' properties in these strings.  */
   unsigned string_from_display_prop_p : 1;
 
+  /* 1 means `string' comes from a `line-prefix' or `wrap-prefix'
+     property.  */
+  unsigned string_from_prefix_prop_p : 1;
+
   /* 1 means we are iterating an object that came from a value of a
      `display' property.  */
   unsigned from_disp_prop_p : 1;
@@ -2272,6 +2276,7 @@
     bidi_dir_t paragraph_embedding;
     unsigned multibyte_p : 1;
     unsigned string_from_display_prop_p : 1;
+    unsigned string_from_prefix_prop_p : 1;
     unsigned display_ellipsis_p : 1;
     unsigned avoid_cursor_p : 1;
     unsigned bidi_p:1;

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-03-18 16:57:39 +0000
+++ b/src/xdisp.c       2012-03-22 07:08:17 +0000
@@ -3673,7 +3673,9 @@
             with, so that overlay strings appear in the same face as
             surrounding text, unless they specify their own
             faces.  */
-         base_face_id = underlying_face_id (it);
+         base_face_id = it->string_from_prefix_prop_p
+           ? DEFAULT_FACE_ID
+           : underlying_face_id (it);
        }
 
       new_face_id = face_at_string_position (it->w,
@@ -5576,6 +5578,7 @@
   p->font_height = it->font_height;
   p->voffset = it->voffset;
   p->string_from_display_prop_p = it->string_from_display_prop_p;
+  p->string_from_prefix_prop_p = it->string_from_prefix_prop_p;
   p->display_ellipsis_p = 0;
   p->line_wrap = it->line_wrap;
   p->bidi_p = it->bidi_p;
@@ -5685,6 +5688,7 @@
   it->font_height = p->font_height;
   it->voffset = p->voffset;
   it->string_from_display_prop_p = p->string_from_display_prop_p;
+  it->string_from_prefix_prop_p = p->string_from_prefix_prop_p;
   it->line_wrap = p->line_wrap;
   it->bidi_p = p->bidi_p;
   it->paragraph_embedding = p->paragraph_embedding;
@@ -6115,6 +6119,8 @@
   it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
   it->sp = 0;
   it->string_from_display_prop_p = 0;
+  it->string_from_prefix_prop_p = 0;
+
   it->from_disp_prop_p = 0;
   it->face_before_selective_p = 0;
   if (it->bidi_p)
@@ -18539,7 +18545,7 @@
    `line-prefix' and `wrap-prefix' properties.  */
 
 static int
-push_display_prop (struct it *it, Lisp_Object prop)
+push_prefix_prop (struct it *it, Lisp_Object prop)
 {
   struct text_pos pos =
     STRINGP (it->string) ? it->current.string_pos : it->current.pos;
@@ -18563,6 +18569,7 @@
        }
 
       it->string = prop;
+      it->string_from_prefix_prop_p = 1;
       it->multibyte_p = STRING_MULTIBYTE (it->string);
       it->current.overlay_string_index = -1;
       IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = 0;
@@ -18649,7 +18656,7 @@
       if (NILP (prefix))
        prefix = Vline_prefix;
     }
-  if (! NILP (prefix) && push_display_prop (it, prefix))
+  if (! NILP (prefix) && push_prefix_prop (it, prefix))
     {
       /* If the prefix is wider than the window, and we try to wrap
         it, it would acquire its own wrap prefix, and so on till the


reply via email to

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