diff options
| author | Richard M. Stallman | 2005-09-15 13:16:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-09-15 13:16:53 +0000 |
| commit | 025568d9fcdf993a33c53e30a94ae50be1d972a7 (patch) | |
| tree | 006c3a7c76f3dadaf5af57cb088e7ad9964c624e /src | |
| parent | 8bfa6b96e7cf2f7d4fc7309b9d50683c87a21a31 (diff) | |
| download | emacs-025568d9fcdf993a33c53e30a94ae50be1d972a7.tar.gz emacs-025568d9fcdf993a33c53e30a94ae50be1d972a7.zip | |
(overlay_arrow_at_row): Add HAVE_WINDOW_SYSTEM conditional.
(display_mode_element): Instead of `lisp_string' and `this',
record `offset' and increment that.
`last_offset' replaces `last'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index aa81fe7a3db..e5b6980e033 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10019,12 +10019,14 @@ overlay_arrow_at_row (it, row) | |||
| 10019 | if (FRAME_WINDOW_P (it->f) | 10019 | if (FRAME_WINDOW_P (it->f) |
| 10020 | && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0) | 10020 | && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0) |
| 10021 | { | 10021 | { |
| 10022 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 10022 | if (val = Fget (var, Qoverlay_arrow_bitmap), SYMBOLP (val)) | 10023 | if (val = Fget (var, Qoverlay_arrow_bitmap), SYMBOLP (val)) |
| 10023 | { | 10024 | { |
| 10024 | int fringe_bitmap; | 10025 | int fringe_bitmap; |
| 10025 | if ((fringe_bitmap = lookup_fringe_bitmap (val)) != 0) | 10026 | if ((fringe_bitmap = lookup_fringe_bitmap (val)) != 0) |
| 10026 | return make_number (fringe_bitmap); | 10027 | return make_number (fringe_bitmap); |
| 10027 | } | 10028 | } |
| 10029 | #endif | ||
| 10028 | return make_number (-1); /* Use default arrow bitmap */ | 10030 | return make_number (-1); /* Use default arrow bitmap */ |
| 10029 | } | 10031 | } |
| 10030 | return overlay_arrow_string_or_property (var); | 10032 | return overlay_arrow_string_or_property (var); |
| @@ -15959,7 +15961,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 15959 | { | 15961 | { |
| 15960 | /* A string: output it and check for %-constructs within it. */ | 15962 | /* A string: output it and check for %-constructs within it. */ |
| 15961 | unsigned char c; | 15963 | unsigned char c; |
| 15962 | const unsigned char *this, *lisp_string; | 15964 | int offset = 0; |
| 15963 | 15965 | ||
| 15964 | if (!NILP (props) || risky) | 15966 | if (!NILP (props) || risky) |
| 15965 | { | 15967 | { |
| @@ -16017,8 +16019,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16017 | } | 16019 | } |
| 16018 | } | 16020 | } |
| 16019 | 16021 | ||
| 16020 | this = SDATA (elt); | 16022 | offset = 0; |
| 16021 | lisp_string = this; | ||
| 16022 | 16023 | ||
| 16023 | if (literal) | 16024 | if (literal) |
| 16024 | { | 16025 | { |
| @@ -16041,42 +16042,44 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16041 | break; | 16042 | break; |
| 16042 | } | 16043 | } |
| 16043 | 16044 | ||
| 16045 | /* Handle the non-literal case. */ | ||
| 16046 | |||
| 16044 | while ((precision <= 0 || n < precision) | 16047 | while ((precision <= 0 || n < precision) |
| 16045 | && *this | 16048 | && SREF (elt, offset) != 0 |
| 16046 | && (mode_line_target != MODE_LINE_DISPLAY | 16049 | && (mode_line_target != MODE_LINE_DISPLAY |
| 16047 | || it->current_x < it->last_visible_x)) | 16050 | || it->current_x < it->last_visible_x)) |
| 16048 | { | 16051 | { |
| 16049 | const unsigned char *last = this; | 16052 | int last_offset = offset; |
| 16050 | 16053 | ||
| 16051 | /* Advance to end of string or next format specifier. */ | 16054 | /* Advance to end of string or next format specifier. */ |
| 16052 | while ((c = *this++) != '\0' && c != '%') | 16055 | while ((c = SREF (elt, offset++)) != '\0' && c != '%') |
| 16053 | ; | 16056 | ; |
| 16054 | 16057 | ||
| 16055 | if (this - 1 != last) | 16058 | if (offset - 1 != last_offset) |
| 16056 | { | 16059 | { |
| 16057 | int nchars, nbytes; | 16060 | int nchars, nbytes; |
| 16058 | 16061 | ||
| 16059 | /* Output to end of string or up to '%'. Field width | 16062 | /* Output to end of string or up to '%'. Field width |
| 16060 | is length of string. Don't output more than | 16063 | is length of string. Don't output more than |
| 16061 | PRECISION allows us. */ | 16064 | PRECISION allows us. */ |
| 16062 | --this; | 16065 | offset--; |
| 16063 | 16066 | ||
| 16064 | prec = c_string_width (last, this - last, precision - n, | 16067 | prec = c_string_width (SDATA (elt) + last_offset, |
| 16068 | offset - last_offset, precision - n, | ||
| 16065 | &nchars, &nbytes); | 16069 | &nchars, &nbytes); |
| 16066 | 16070 | ||
| 16067 | switch (mode_line_target) | 16071 | switch (mode_line_target) |
| 16068 | { | 16072 | { |
| 16069 | case MODE_LINE_NOPROP: | 16073 | case MODE_LINE_NOPROP: |
| 16070 | case MODE_LINE_TITLE: | 16074 | case MODE_LINE_TITLE: |
| 16071 | n += store_mode_line_noprop (last, 0, prec); | 16075 | n += store_mode_line_noprop (SDATA (elt) + last_offset, 0, prec); |
| 16072 | break; | 16076 | break; |
| 16073 | case MODE_LINE_STRING: | 16077 | case MODE_LINE_STRING: |
| 16074 | { | 16078 | { |
| 16075 | int bytepos = last - lisp_string; | 16079 | int bytepos = last_offset; |
| 16076 | int charpos = string_byte_to_char (elt, bytepos); | 16080 | int charpos = string_byte_to_char (elt, bytepos); |
| 16077 | int endpos = (precision <= 0 | 16081 | int endpos = (precision <= 0 |
| 16078 | ? string_byte_to_char (elt, | 16082 | ? string_byte_to_char (elt, offset) |
| 16079 | this - lisp_string) | ||
| 16080 | : charpos + nchars); | 16083 | : charpos + nchars); |
| 16081 | 16084 | ||
| 16082 | n += store_mode_line_string (NULL, | 16085 | n += store_mode_line_string (NULL, |
| @@ -16087,7 +16090,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16087 | break; | 16090 | break; |
| 16088 | case MODE_LINE_DISPLAY: | 16091 | case MODE_LINE_DISPLAY: |
| 16089 | { | 16092 | { |
| 16090 | int bytepos = last - lisp_string; | 16093 | int bytepos = last_offset; |
| 16091 | int charpos = string_byte_to_char (elt, bytepos); | 16094 | int charpos = string_byte_to_char (elt, bytepos); |
| 16092 | n += display_string (NULL, elt, Qnil, 0, charpos, | 16095 | n += display_string (NULL, elt, Qnil, 0, charpos, |
| 16093 | it, 0, prec, 0, | 16096 | it, 0, prec, 0, |
| @@ -16098,12 +16101,12 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16098 | } | 16101 | } |
| 16099 | else /* c == '%' */ | 16102 | else /* c == '%' */ |
| 16100 | { | 16103 | { |
| 16101 | const unsigned char *percent_position = this; | 16104 | int percent_position = offset; |
| 16102 | 16105 | ||
| 16103 | /* Get the specified minimum width. Zero means | 16106 | /* Get the specified minimum width. Zero means |
| 16104 | don't pad. */ | 16107 | don't pad. */ |
| 16105 | field = 0; | 16108 | field = 0; |
| 16106 | while ((c = *this++) >= '0' && c <= '9') | 16109 | while ((c = SREF (elt, offset++)) >= '0' && c <= '9') |
| 16107 | field = field * 10 + c - '0'; | 16110 | field = field * 10 + c - '0'; |
| 16108 | 16111 | ||
| 16109 | /* Don't pad beyond the total padding allowed. */ | 16112 | /* Don't pad beyond the total padding allowed. */ |
| @@ -16123,7 +16126,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16123 | int bytepos, charpos; | 16126 | int bytepos, charpos; |
| 16124 | unsigned char *spec; | 16127 | unsigned char *spec; |
| 16125 | 16128 | ||
| 16126 | bytepos = percent_position - lisp_string; | 16129 | bytepos = percent_position; |
| 16127 | charpos = (STRING_MULTIBYTE (elt) | 16130 | charpos = (STRING_MULTIBYTE (elt) |
| 16128 | ? string_byte_to_char (elt, bytepos) | 16131 | ? string_byte_to_char (elt, bytepos) |
| 16129 | : bytepos); | 16132 | : bytepos); |
| @@ -16181,8 +16184,6 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 16181 | else /* c == 0 */ | 16184 | else /* c == 0 */ |
| 16182 | break; | 16185 | break; |
| 16183 | } | 16186 | } |
| 16184 | this += SDATA (elt) - lisp_string; | ||
| 16185 | lisp_string = SDATA (elt); | ||
| 16186 | } | 16187 | } |
| 16187 | } | 16188 | } |
| 16188 | break; | 16189 | break; |