aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2012-03-22 15:08:17 +0800
committerChong Yidong2012-03-22 15:08:17 +0800
commit9f851fbd286f08f82e7648460134b52fa8172403 (patch)
tree151c019935011956d7e94358a98b3b4f0a732a46 /src
parent2bfab837e4aa3a345f0a9b6b78c62b57c33b502d (diff)
downloademacs-9f851fbd286f08f82e7648460134b52fa8172403.tar.gz
emacs-9f851fbd286f08f82e7648460134b52fa8172403.zip
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. Fixes: debbugs:4281
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/dispextern.h5
-rw-r--r--src/xdisp.c13
3 files changed, 24 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7a97859ba63..e3407a45514 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12012-03-22 Chong Yidong <cyd@gnu.org>
2
3 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4
5 * xdisp.c (push_prefix_prop): Renamed from push_display_prop.
6 Mark string as coming from a prefix property.
7 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9
12012-03-21 Chong Yidong <cyd@gnu.org> 102012-03-21 Chong Yidong <cyd@gnu.org>
2 11
3 * xfaces.c (Vface_remapping_alist): Doc fix. 12 * xfaces.c (Vface_remapping_alist): Doc fix.
diff --git a/src/dispextern.h b/src/dispextern.h
index 2c59f4f8ead..2d4aee0cb94 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2152,6 +2152,10 @@ struct it
2152 Don't handle some `display' properties in these strings. */ 2152 Don't handle some `display' properties in these strings. */
2153 unsigned string_from_display_prop_p : 1; 2153 unsigned string_from_display_prop_p : 1;
2154 2154
2155 /* 1 means `string' comes from a `line-prefix' or `wrap-prefix'
2156 property. */
2157 unsigned string_from_prefix_prop_p : 1;
2158
2155 /* 1 means we are iterating an object that came from a value of a 2159 /* 1 means we are iterating an object that came from a value of a
2156 `display' property. */ 2160 `display' property. */
2157 unsigned from_disp_prop_p : 1; 2161 unsigned from_disp_prop_p : 1;
@@ -2272,6 +2276,7 @@ struct it
2272 bidi_dir_t paragraph_embedding; 2276 bidi_dir_t paragraph_embedding;
2273 unsigned multibyte_p : 1; 2277 unsigned multibyte_p : 1;
2274 unsigned string_from_display_prop_p : 1; 2278 unsigned string_from_display_prop_p : 1;
2279 unsigned string_from_prefix_prop_p : 1;
2275 unsigned display_ellipsis_p : 1; 2280 unsigned display_ellipsis_p : 1;
2276 unsigned avoid_cursor_p : 1; 2281 unsigned avoid_cursor_p : 1;
2277 unsigned bidi_p:1; 2282 unsigned bidi_p:1;
diff --git a/src/xdisp.c b/src/xdisp.c
index 71162960faa..0d23d72dd7b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3673,7 +3673,9 @@ handle_face_prop (struct it *it)
3673 with, so that overlay strings appear in the same face as 3673 with, so that overlay strings appear in the same face as
3674 surrounding text, unless they specify their own 3674 surrounding text, unless they specify their own
3675 faces. */ 3675 faces. */
3676 base_face_id = underlying_face_id (it); 3676 base_face_id = it->string_from_prefix_prop_p
3677 ? DEFAULT_FACE_ID
3678 : underlying_face_id (it);
3677 } 3679 }
3678 3680
3679 new_face_id = face_at_string_position (it->w, 3681 new_face_id = face_at_string_position (it->w,
@@ -5576,6 +5578,7 @@ push_it (struct it *it, struct text_pos *position)
5576 p->font_height = it->font_height; 5578 p->font_height = it->font_height;
5577 p->voffset = it->voffset; 5579 p->voffset = it->voffset;
5578 p->string_from_display_prop_p = it->string_from_display_prop_p; 5580 p->string_from_display_prop_p = it->string_from_display_prop_p;
5581 p->string_from_prefix_prop_p = it->string_from_prefix_prop_p;
5579 p->display_ellipsis_p = 0; 5582 p->display_ellipsis_p = 0;
5580 p->line_wrap = it->line_wrap; 5583 p->line_wrap = it->line_wrap;
5581 p->bidi_p = it->bidi_p; 5584 p->bidi_p = it->bidi_p;
@@ -5685,6 +5688,7 @@ pop_it (struct it *it)
5685 it->font_height = p->font_height; 5688 it->font_height = p->font_height;
5686 it->voffset = p->voffset; 5689 it->voffset = p->voffset;
5687 it->string_from_display_prop_p = p->string_from_display_prop_p; 5690 it->string_from_display_prop_p = p->string_from_display_prop_p;
5691 it->string_from_prefix_prop_p = p->string_from_prefix_prop_p;
5688 it->line_wrap = p->line_wrap; 5692 it->line_wrap = p->line_wrap;
5689 it->bidi_p = p->bidi_p; 5693 it->bidi_p = p->bidi_p;
5690 it->paragraph_embedding = p->paragraph_embedding; 5694 it->paragraph_embedding = p->paragraph_embedding;
@@ -6115,6 +6119,8 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
6115 it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters)); 6119 it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
6116 it->sp = 0; 6120 it->sp = 0;
6117 it->string_from_display_prop_p = 0; 6121 it->string_from_display_prop_p = 0;
6122 it->string_from_prefix_prop_p = 0;
6123
6118 it->from_disp_prop_p = 0; 6124 it->from_disp_prop_p = 0;
6119 it->face_before_selective_p = 0; 6125 it->face_before_selective_p = 0;
6120 if (it->bidi_p) 6126 if (it->bidi_p)
@@ -18539,7 +18545,7 @@ cursor_row_p (struct glyph_row *row)
18539 `line-prefix' and `wrap-prefix' properties. */ 18545 `line-prefix' and `wrap-prefix' properties. */
18540 18546
18541static int 18547static int
18542push_display_prop (struct it *it, Lisp_Object prop) 18548push_prefix_prop (struct it *it, Lisp_Object prop)
18543{ 18549{
18544 struct text_pos pos = 18550 struct text_pos pos =
18545 STRINGP (it->string) ? it->current.string_pos : it->current.pos; 18551 STRINGP (it->string) ? it->current.string_pos : it->current.pos;
@@ -18563,6 +18569,7 @@ push_display_prop (struct it *it, Lisp_Object prop)
18563 } 18569 }
18564 18570
18565 it->string = prop; 18571 it->string = prop;
18572 it->string_from_prefix_prop_p = 1;
18566 it->multibyte_p = STRING_MULTIBYTE (it->string); 18573 it->multibyte_p = STRING_MULTIBYTE (it->string);
18567 it->current.overlay_string_index = -1; 18574 it->current.overlay_string_index = -1;
18568 IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = 0; 18575 IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = 0;
@@ -18649,7 +18656,7 @@ handle_line_prefix (struct it *it)
18649 if (NILP (prefix)) 18656 if (NILP (prefix))
18650 prefix = Vline_prefix; 18657 prefix = Vline_prefix;
18651 } 18658 }
18652 if (! NILP (prefix) && push_display_prop (it, prefix)) 18659 if (! NILP (prefix) && push_prefix_prop (it, prefix))
18653 { 18660 {
18654 /* If the prefix is wider than the window, and we try to wrap 18661 /* If the prefix is wider than the window, and we try to wrap
18655 it, it would acquire its own wrap prefix, and so on till the 18662 it, it would acquire its own wrap prefix, and so on till the