/[emacs]/emacs/src/xdisp.c
ViewVC logotype

Diff of /emacs/src/xdisp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1053 by kfstorm, Thu Sep 15 12:06:39 2005 UTC revision 1.1054 by rms, Thu Sep 15 13:16:53 2005 UTC
# Line 10019  overlay_arrow_at_row (it, row) Line 10019  overlay_arrow_at_row (it, row)
10019            if (FRAME_WINDOW_P (it->f)            if (FRAME_WINDOW_P (it->f)
10020                && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0)                && WINDOW_LEFT_FRINGE_WIDTH (it->w) > 0)
10021              {              {
10022    #ifdef HAVE_WINDOW_SYSTEM
10023                if (val = Fget (var, Qoverlay_arrow_bitmap), SYMBOLP (val))                if (val = Fget (var, Qoverlay_arrow_bitmap), SYMBOLP (val))
10024                  {                  {
10025                    int fringe_bitmap;                    int fringe_bitmap;
10026                    if ((fringe_bitmap = lookup_fringe_bitmap (val)) != 0)                    if ((fringe_bitmap = lookup_fringe_bitmap (val)) != 0)
10027                      return make_number (fringe_bitmap);                      return make_number (fringe_bitmap);
10028                  }                  }
10029    #endif
10030                return make_number (-1); /* Use default arrow bitmap */                return make_number (-1); /* Use default arrow bitmap */
10031              }              }
10032            return overlay_arrow_string_or_property (var);            return overlay_arrow_string_or_property (var);
# Line 15959  display_mode_element (it, depth, field_w Line 15961  display_mode_element (it, depth, field_w
15961        {        {
15962          /* A string: output it and check for %-constructs within it.  */          /* A string: output it and check for %-constructs within it.  */
15963          unsigned char c;          unsigned char c;
15964          const unsigned char *this, *lisp_string;          int offset = 0;
15965    
15966          if (!NILP (props) || risky)          if (!NILP (props) || risky)
15967            {            {
# Line 16017  display_mode_element (it, depth, field_w Line 16019  display_mode_element (it, depth, field_w
16019                }                }
16020            }            }
16021    
16022          this = SDATA (elt);          offset = 0;
         lisp_string = this;  
16023    
16024          if (literal)          if (literal)
16025            {            {
# Line 16041  display_mode_element (it, depth, field_w Line 16042  display_mode_element (it, depth, field_w
16042              break;              break;
16043            }            }
16044    
16045            /* Handle the non-literal case.  */
16046    
16047          while ((precision <= 0 || n < precision)          while ((precision <= 0 || n < precision)
16048                 && *this                 && SREF (elt, offset) != 0
16049                 && (mode_line_target != MODE_LINE_DISPLAY                 && (mode_line_target != MODE_LINE_DISPLAY
16050                     || it->current_x < it->last_visible_x))                     || it->current_x < it->last_visible_x))
16051            {            {
16052              const unsigned char *last = this;              int last_offset = offset;
16053    
16054              /* Advance to end of string or next format specifier.  */              /* Advance to end of string or next format specifier.  */
16055              while ((c = *this++) != '\0' && c != '%')              while ((c = SREF (elt, offset++)) != '\0' && c != '%')
16056                ;                ;
16057    
16058              if (this - 1 != last)              if (offset - 1 != last_offset)
16059                {                {
16060                  int nchars, nbytes;                  int nchars, nbytes;
16061    
16062                  /* Output to end of string or up to '%'.  Field width                  /* Output to end of string or up to '%'.  Field width
16063                     is length of string.  Don't output more than                     is length of string.  Don't output more than
16064                     PRECISION allows us.  */                     PRECISION allows us.  */
16065                  --this;                  offset--;
16066    
16067                  prec = c_string_width (last, this - last, precision - n,                  prec = c_string_width (SDATA (elt) + last_offset,
16068                                           offset - last_offset, precision - n,
16069                                         &nchars, &nbytes);                                         &nchars, &nbytes);
16070    
16071                  switch (mode_line_target)                  switch (mode_line_target)
16072                    {                    {
16073                    case MODE_LINE_NOPROP:                    case MODE_LINE_NOPROP:
16074                    case MODE_LINE_TITLE:                    case MODE_LINE_TITLE:
16075                      n += store_mode_line_noprop (last, 0, prec);                      n += store_mode_line_noprop (SDATA (elt) + last_offset, 0, prec);
16076                      break;                      break;
16077                    case MODE_LINE_STRING:                    case MODE_LINE_STRING:
16078                      {                      {
16079                        int bytepos = last - lisp_string;                        int bytepos = last_offset;
16080                        int charpos = string_byte_to_char (elt, bytepos);                        int charpos = string_byte_to_char (elt, bytepos);
16081                        int endpos = (precision <= 0                        int endpos = (precision <= 0
16082                                      ? string_byte_to_char (elt,                                      ? string_byte_to_char (elt, offset)
                                                            this - lisp_string)  
16083                                      : charpos + nchars);                                      : charpos + nchars);
16084    
16085                        n += store_mode_line_string (NULL,                        n += store_mode_line_string (NULL,
# Line 16087  display_mode_element (it, depth, field_w Line 16090  display_mode_element (it, depth, field_w
16090                      break;                      break;
16091                    case MODE_LINE_DISPLAY:                    case MODE_LINE_DISPLAY:
16092                      {                      {
16093                        int bytepos = last - lisp_string;                        int bytepos = last_offset;
16094                        int charpos = string_byte_to_char (elt, bytepos);                        int charpos = string_byte_to_char (elt, bytepos);
16095                        n += display_string (NULL, elt, Qnil, 0, charpos,                        n += display_string (NULL, elt, Qnil, 0, charpos,
16096                                             it, 0, prec, 0,                                             it, 0, prec, 0,
# Line 16098  display_mode_element (it, depth, field_w Line 16101  display_mode_element (it, depth, field_w
16101                }                }
16102              else /* c == '%' */              else /* c == '%' */
16103                {                {
16104                  const unsigned char *percent_position = this;                  int percent_position = offset;
16105    
16106                  /* Get the specified minimum width.  Zero means                  /* Get the specified minimum width.  Zero means
16107                     don't pad.  */                     don't pad.  */
16108                  field = 0;                  field = 0;
16109                  while ((c = *this++) >= '0' && c <= '9')                  while ((c = SREF (elt, offset++)) >= '0' && c <= '9')
16110                    field = field * 10 + c - '0';                    field = field * 10 + c - '0';
16111    
16112                  /* Don't pad beyond the total padding allowed.  */                  /* Don't pad beyond the total padding allowed.  */
# Line 16123  display_mode_element (it, depth, field_w Line 16126  display_mode_element (it, depth, field_w
16126                      int bytepos, charpos;                      int bytepos, charpos;
16127                      unsigned char *spec;                      unsigned char *spec;
16128    
16129                      bytepos = percent_position - lisp_string;                      bytepos = percent_position;
16130                      charpos = (STRING_MULTIBYTE (elt)                      charpos = (STRING_MULTIBYTE (elt)
16131                                 ? string_byte_to_char (elt, bytepos)                                 ? string_byte_to_char (elt, bytepos)
16132                                 : bytepos);                                 : bytepos);
# Line 16181  display_mode_element (it, depth, field_w Line 16184  display_mode_element (it, depth, field_w
16184                  else /* c == 0 */                  else /* c == 0 */
16185                    break;                    break;
16186                }                }
             this += SDATA (elt) - lisp_string;  
             lisp_string = SDATA (elt);  
16187            }            }
16188        }        }
16189        break;        break;

Legend:
Removed from v.1.1053  
changed lines
  Added in v.1.1054

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26