Mercurial > emacs
comparison src/xdisp.c @ 21244:50929073a0ba
Use STRING_BYTES and SET_STRING_BYTES.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 21 Mar 1998 07:06:14 +0000 |
parents | 482ff111ccbc |
children | 82fbf42bb989 |
comparison
equal
deleted
inserted
replaced
21243:e82a4a4fa12a | 21244:50929073a0ba |
---|---|
875 /* Set the name only if it's changed. This avoids consing | 875 /* Set the name only if it's changed. This avoids consing |
876 in the common case where it hasn't. (If it turns out that we've | 876 in the common case where it hasn't. (If it turns out that we've |
877 already wasted too much time by walking through the list with | 877 already wasted too much time by walking through the list with |
878 display_mode_element, then we might need to optimize at a higher | 878 display_mode_element, then we might need to optimize at a higher |
879 level than this.) */ | 879 level than this.) */ |
880 if (! STRINGP (f->name) || XSTRING (f->name)->size_byte != len | 880 if (! STRINGP (f->name) || STRING_BYTES (XSTRING (f->name)) != len |
881 || bcmp (frame_title_buf, XSTRING (f->name)->data, len) != 0) | 881 || bcmp (frame_title_buf, XSTRING (f->name)->data, len) != 0) |
882 x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); | 882 x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); |
883 } | 883 } |
884 #else | 884 #else |
885 #define frame_title_ptr ((char *)0) | 885 #define frame_title_ptr ((char *)0) |
3229 { | 3229 { |
3230 int old_width = minibuf_prompt_width; | 3230 int old_width = minibuf_prompt_width; |
3231 | 3231 |
3232 minibuf_prompt_width | 3232 minibuf_prompt_width |
3233 = (display_string (w, vpos, XSTRING (minibuf_prompt)->data, | 3233 = (display_string (w, vpos, XSTRING (minibuf_prompt)->data, |
3234 XSTRING (minibuf_prompt)->size_byte, | 3234 STRING_BYTES (XSTRING (minibuf_prompt)), |
3235 hpos + WINDOW_LEFT_MARGIN (w), | 3235 hpos + WINDOW_LEFT_MARGIN (w), |
3236 /* Display a space if we truncate. */ | 3236 /* Display a space if we truncate. */ |
3237 ' ', | 3237 ' ', |
3238 1, -1, | 3238 1, -1, |
3239 /* Truncate the prompt a little before the | 3239 /* Truncate the prompt a little before the |
4102 XSETFASTINT (XVECTOR (items)->contents[i + 3], hpos); | 4102 XSETFASTINT (XVECTOR (items)->contents[i + 3], hpos); |
4103 | 4103 |
4104 if (hpos < maxendcol) | 4104 if (hpos < maxendcol) |
4105 hpos = display_string (w, vpos, | 4105 hpos = display_string (w, vpos, |
4106 XSTRING (string)->data, | 4106 XSTRING (string)->data, |
4107 XSTRING (string)->size_byte, | 4107 STRING_BYTES (XSTRING (string)), |
4108 hpos, 0, 0, hpos, maxendcol, | 4108 hpos, 0, 0, hpos, maxendcol, |
4109 STRING_MULTIBYTE (string)); | 4109 STRING_MULTIBYTE (string)); |
4110 /* Put a space between items. */ | 4110 /* Put a space between items. */ |
4111 if (hpos < maxendcol) | 4111 if (hpos < maxendcol) |
4112 { | 4112 { |
4309 if (frame_title_ptr) | 4309 if (frame_title_ptr) |
4310 hpos = store_frame_title (XSTRING (tem)->data, | 4310 hpos = store_frame_title (XSTRING (tem)->data, |
4311 minendcol, maxendcol); | 4311 minendcol, maxendcol); |
4312 else | 4312 else |
4313 hpos = display_string (w, vpos, XSTRING (tem)->data, | 4313 hpos = display_string (w, vpos, XSTRING (tem)->data, |
4314 XSTRING (tem)->size_byte, | 4314 STRING_BYTES (XSTRING (tem)), |
4315 hpos, 0, 1, minendcol, maxendcol, | 4315 hpos, 0, 1, minendcol, maxendcol, |
4316 STRING_MULTIBYTE (tem)); | 4316 STRING_MULTIBYTE (tem)); |
4317 } | 4317 } |
4318 /* Give up right away for nil or t. */ | 4318 /* Give up right away for nil or t. */ |
4319 else if (!EQ (tem, elt)) | 4319 else if (!EQ (tem, elt)) |
4605 } | 4605 } |
4606 | 4606 |
4607 case 'b': | 4607 case 'b': |
4608 obj = b->name; | 4608 obj = b->name; |
4609 #if 0 | 4609 #if 0 |
4610 if (maxwidth >= 3 && XSTRING (obj)->size_byte > maxwidth) | 4610 if (maxwidth >= 3 && STRING_BYTES (XSTRING (obj)) > maxwidth) |
4611 { | 4611 { |
4612 bcopy (XSTRING (obj)->data, decode_mode_spec_buf, maxwidth - 1); | 4612 bcopy (XSTRING (obj)->data, decode_mode_spec_buf, maxwidth - 1); |
4613 decode_mode_spec_buf[maxwidth - 1] = '\\'; | 4613 decode_mode_spec_buf[maxwidth - 1] = '\\'; |
4614 decode_mode_spec_buf[maxwidth] = '\0'; | 4614 decode_mode_spec_buf[maxwidth] = '\0'; |
4615 return decode_mode_spec_buf; | 4615 return decode_mode_spec_buf; |
4639 case 'f': | 4639 case 'f': |
4640 obj = b->filename; | 4640 obj = b->filename; |
4641 #if 0 | 4641 #if 0 |
4642 if (NILP (obj)) | 4642 if (NILP (obj)) |
4643 return "[none]"; | 4643 return "[none]"; |
4644 else if (STRINGP (obj) && XSTRING (obj)->size_byte > maxwidth) | 4644 else if (STRINGP (obj) && STRING_BYTES (XSTRING (obj)) > maxwidth) |
4645 { | 4645 { |
4646 bcopy ("...", decode_mode_spec_buf, 3); | 4646 bcopy ("...", decode_mode_spec_buf, 3); |
4647 bcopy (XSTRING (obj)->data + XSTRING (obj)->size_byte - maxwidth + 3, | 4647 bcopy (XSTRING (obj)->data + STRING_BYTES (XSTRING (obj)) - maxwidth + 3, |
4648 decode_mode_spec_buf + 3, maxwidth - 3); | 4648 decode_mode_spec_buf + 3, maxwidth - 3); |
4649 return decode_mode_spec_buf; | 4649 return decode_mode_spec_buf; |
4650 } | 4650 } |
4651 #endif | 4651 #endif |
4652 break; | 4652 break; |