]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fformat): Update thissize from field_width based on
authorKenichi Handa <handa@m17n.org>
Mon, 20 Jan 2003 00:23:25 +0000 (00:23 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 20 Jan 2003 00:23:25 +0000 (00:23 +0000)
the actual width, in the string case (back-porting of the
2002-01-02 change in HEAD).

src/ChangeLog
src/editfns.c

index 75a8fb88bffe441b01158918ac48fba6da4b78d5..1b304d315664739188740c303be9f0175094a958 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-20  Kenichi Handa  <handa@m17n.org>
+
+       * editfns.c (Fformat): Update thissize from field_width based on
+       the actual width, in the string case (back-porting of the
+       2002-01-02 change in HEAD).
+
 2003-01-17  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * Version 21.3 released.
index afc84658bb22174efc560cb0d2b4769225b491a8..76a732d1ef8d09e82772fd596f9953e43dafa353 100644 (file)
@@ -3169,6 +3169,7 @@ Use %% to put a single % into the output.")
     if (*format++ == '%')
       {
        int thissize = 0;
+       int actual_width = 0;
        unsigned char *this_format_start = format - 1;
        int field_width, precision;
 
@@ -3249,6 +3250,7 @@ Use %% to put a single % into the output.")
            if (*format != 's' && *format != 'S')
              error ("Format specifier doesn't match argument type");
            thissize = CONVERTED_BYTE_SIZE (multibyte, args[n]);
+           actual_width = lisp_string_width (args[n], -1, NULL, NULL);
          }
        /* Would get MPV otherwise, since Lisp_Int's `point' to low memory.  */
        else if (INTEGERP (args[n]) && *format != 's')
@@ -3302,7 +3304,7 @@ Use %% to put a single % into the output.")
            goto string;
          }
 
-       thissize = max (field_width, thissize);
+       thissize += max (0, field_width - actual_width);
        total += thissize + 4;
       }