diff options
| author | Richard M. Stallman | 2002-03-03 20:02:08 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-03-03 20:02:08 +0000 |
| commit | ae02e06a51271468e880d85acff4b600a9cb2421 (patch) | |
| tree | 512806931b12a5c2bb83b3c45841a4441d3fda77 /src | |
| parent | 63a7fdcf324566d9d11d62be3568106c390ec22e (diff) | |
| download | emacs-ae02e06a51271468e880d85acff4b600a9cb2421.tar.gz emacs-ae02e06a51271468e880d85acff4b600a9cb2421.zip | |
(display_mode_element): Move the places where
bytepos, charpos, this, and lisp_string are set.
Use lisp_string to set bytepos.
(display_mode_element): Merge properties specified with
:propertize onto those that come with the string.
(redisplay_internal): Call clear_image_cache only if HAVE_WINDOW_SYSTEM.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 8d38537e180..f57269cec03 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -8878,9 +8878,11 @@ redisplay_internal (preserve_echo_area) | |||
| 8878 | 8878 | ||
| 8879 | if (FRAME_WINDOW_P (f) || f == sf) | 8879 | if (FRAME_WINDOW_P (f) || f == sf) |
| 8880 | { | 8880 | { |
| 8881 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 8881 | if (clear_face_cache_count % 50 == 0 | 8882 | if (clear_face_cache_count % 50 == 0 |
| 8882 | && FRAME_WINDOW_P (f)) | 8883 | && FRAME_WINDOW_P (f)) |
| 8883 | clear_image_cache (f, 0); | 8884 | clear_image_cache (f, 0); |
| 8885 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 8884 | 8886 | ||
| 8885 | /* Mark all the scroll bars to be removed; we'll redeem | 8887 | /* Mark all the scroll bars to be removed; we'll redeem |
| 8886 | the ones we want when we redisplay their windows. */ | 8888 | the ones we want when we redisplay their windows. */ |
| @@ -13598,8 +13600,7 @@ display_mode_element (it, depth, field_width, precision, elt, props) | |||
| 13598 | { | 13600 | { |
| 13599 | /* A string: output it and check for %-constructs within it. */ | 13601 | /* A string: output it and check for %-constructs within it. */ |
| 13600 | unsigned char c; | 13602 | unsigned char c; |
| 13601 | unsigned char *this = XSTRING (elt)->data; | 13603 | unsigned char *this, *lisp_string; |
| 13602 | unsigned char *lisp_string = this; | ||
| 13603 | 13604 | ||
| 13604 | if (!NILP (props)) | 13605 | if (!NILP (props)) |
| 13605 | { | 13606 | { |
| @@ -13607,6 +13608,23 @@ display_mode_element (it, depth, field_width, precision, elt, props) | |||
| 13607 | oprops = Ftext_properties_at (make_number (0), elt); | 13608 | oprops = Ftext_properties_at (make_number (0), elt); |
| 13608 | if (NILP (Fequal (props, oprops))) | 13609 | if (NILP (Fequal (props, oprops))) |
| 13609 | { | 13610 | { |
| 13611 | /* If the starting string has properties, | ||
| 13612 | merge the specified ones onto the existing ones. */ | ||
| 13613 | if (! NILP (oprops)) | ||
| 13614 | { | ||
| 13615 | Lisp_Object tem; | ||
| 13616 | |||
| 13617 | oprops = Fcopy_sequence (oprops); | ||
| 13618 | tem = props; | ||
| 13619 | while (CONSP (tem)) | ||
| 13620 | { | ||
| 13621 | oprops = Fplist_put (oprops, XCAR (tem), | ||
| 13622 | XCAR (XCDR (tem))); | ||
| 13623 | tem = XCDR (XCDR (tem)); | ||
| 13624 | } | ||
| 13625 | props = oprops; | ||
| 13626 | } | ||
| 13627 | |||
| 13610 | aelt = Fassoc (elt, mode_line_proptrans_alist); | 13628 | aelt = Fassoc (elt, mode_line_proptrans_alist); |
| 13611 | if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt)))) | 13629 | if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt)))) |
| 13612 | elt = XCAR (aelt); | 13630 | elt = XCAR (aelt); |
| @@ -13621,6 +13639,9 @@ display_mode_element (it, depth, field_width, precision, elt, props) | |||
| 13621 | } | 13639 | } |
| 13622 | } | 13640 | } |
| 13623 | 13641 | ||
| 13642 | this = XSTRING (elt)->data; | ||
| 13643 | lisp_string = this; | ||
| 13644 | |||
| 13624 | if (literal) | 13645 | if (literal) |
| 13625 | { | 13646 | { |
| 13626 | prec = precision - n; | 13647 | prec = precision - n; |
| @@ -13689,20 +13710,24 @@ display_mode_element (it, depth, field_width, precision, elt, props) | |||
| 13689 | else if (c != 0) | 13710 | else if (c != 0) |
| 13690 | { | 13711 | { |
| 13691 | int multibyte; | 13712 | int multibyte; |
| 13692 | unsigned char *spec | 13713 | int bytepos, charpos; |
| 13714 | unsigned char *spec; | ||
| 13715 | |||
| 13716 | bytepos = percent_position - lisp_string; | ||
| 13717 | charpos = (STRING_MULTIBYTE (elt) | ||
| 13718 | ? string_byte_to_char (elt, bytepos) | ||
| 13719 | : bytepos); | ||
| 13720 | |||
| 13721 | spec | ||
| 13693 | = decode_mode_spec (it->w, c, field, prec, &multibyte); | 13722 | = decode_mode_spec (it->w, c, field, prec, &multibyte); |
| 13694 | 13723 | ||
| 13695 | if (frame_title_ptr) | 13724 | if (frame_title_ptr) |
| 13696 | n += store_frame_title (spec, field, prec); | 13725 | n += store_frame_title (spec, field, prec); |
| 13697 | else | 13726 | else |
| 13698 | { | 13727 | { |
| 13699 | int nglyphs_before, bytepos, charpos, nwritten; | 13728 | int nglyphs_before, nwritten; |
| 13700 | 13729 | ||
| 13701 | nglyphs_before = it->glyph_row->used[TEXT_AREA]; | 13730 | nglyphs_before = it->glyph_row->used[TEXT_AREA]; |
| 13702 | bytepos = percent_position - XSTRING (elt)->data; | ||
| 13703 | charpos = (STRING_MULTIBYTE (elt) | ||
| 13704 | ? string_byte_to_char (elt, bytepos) | ||
| 13705 | : bytepos); | ||
| 13706 | nwritten = display_string (spec, Qnil, elt, | 13731 | nwritten = display_string (spec, Qnil, elt, |
| 13707 | charpos, 0, it, | 13732 | charpos, 0, it, |
| 13708 | field, prec, 0, | 13733 | field, prec, 0, |