emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xdisp.c


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c
Date: Mon, 18 Oct 2004 19:01:08 -0400

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.920 emacs/src/xdisp.c:1.921
*** emacs/src/xdisp.c:1.920     Sun Oct 17 13:17:00 2004
--- emacs/src/xdisp.c   Mon Oct 18 22:53:13 2004
***************
*** 7976,7982 ****
  
    /* Copy at most PRECISION chars from STR.  */
    nbytes = strlen (str);
!   n+= c_string_width (str, nbytes, precision, &dummy, &nbytes);
    while (nbytes--)
      store_frame_title_char (*str++);
  
--- 7976,7982 ----
  
    /* Copy at most PRECISION chars from STR.  */
    nbytes = strlen (str);
!   n += c_string_width (str, nbytes, precision, &dummy, &nbytes);
    while (nbytes--)
      store_frame_title_char (*str++);
  
***************
*** 15457,15470 ****
  
            if (this - 1 != last)
              {
                /* Output to end of string or up to '%'.  Field width
                   is length of string.  Don't output more than
                   PRECISION allows us.  */
                --this;
  
!               prec = chars_in_text (last, this - last);
!               if (precision > 0 && prec > precision - n)
!                 prec = precision - n;
  
                if (frame_title_ptr)
                  n += store_frame_title (last, 0, prec);
--- 15457,15471 ----
  
            if (this - 1 != last)
              {
+               int nchars, nbytes;
+ 
                /* Output to end of string or up to '%'.  Field width
                   is length of string.  Don't output more than
                   PRECISION allows us.  */
                --this;
  
!               prec = c_string_width (last, this - last, precision - n,
!                                      &nchars, &nbytes);
  
                if (frame_title_ptr)
                  n += store_frame_title (last, 0, prec);
***************
*** 15472,15480 ****
                  {
                    int bytepos = last - lisp_string;
                    int charpos = string_byte_to_char (elt, bytepos);
                    n += store_mode_line_string (NULL,
                                                 Fsubstring (elt, make_number 
(charpos),
!                                                            make_number 
(charpos + prec)),
                                                 0, 0, 0, Qnil);
                  }
                else
--- 15473,15484 ----
                  {
                    int bytepos = last - lisp_string;
                    int charpos = string_byte_to_char (elt, bytepos);
+                   int endpos = (precision <= 0 ? SCHARS (elt)
+                                 : charpos + nchars);
+ 
                    n += store_mode_line_string (NULL,
                                                 Fsubstring (elt, make_number 
(charpos),
!                                                            make_number 
(endpos)),
                                                 0, 0, 0, Qnil);
                  }
                else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]