From: Gerd Moellmann Date: Mon, 22 Jan 2001 13:10:49 +0000 (+0000) Subject: (Fformat): Don't extend text properties from arguments X-Git-Tag: emacs-pretest-21.0.96~168 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=50606b4c014cb43d084f1b8fdb2634990958ebe7;p=emacs.git (Fformat): Don't extend text properties from arguments to padding chars in the result. --- diff --git a/src/ChangeLog b/src/ChangeLog index 3444e89b63e..f85dd0e7602 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-01-22 Gerd Moellmann + + * editfns.c (Fformat): Don't extend text properties from arguments + to padding chars in the result. + 2001-01-20 Eli Zaretskii * s/msdos.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS. diff --git a/src/editfns.c b/src/editfns.c index 1871c54d2b7..590d1771338 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3310,9 +3310,8 @@ Use %% to put a single % into the output.") if (STRINGP (args[n])) { - int padding, nbytes; + int padding, nbytes, start, end; int width = lisp_string_width (args[n], -1, NULL, NULL); - int start = nchars; /* If spec requires it, pad on right with spaces. */ padding = minlen - width; @@ -3320,9 +3319,11 @@ Use %% to put a single % into the output.") while (padding-- > 0) { *p++ = ' '; - nchars++; + ++nchars; } + start = nchars; + if (p > buf && multibyte && !ASCII_BYTE_P (*((unsigned char *) p - 1)) @@ -3334,6 +3335,7 @@ Use %% to put a single % into the output.") STRING_MULTIBYTE (args[n]), multibyte); p += nbytes; nchars += XSTRING (args[n])->size; + end = nchars; if (negative) while (padding-- > 0) @@ -3354,7 +3356,7 @@ Use %% to put a single % into the output.") } info[n].start = start; - info[n].end = nchars; + info[n].end = end; } } else if (INTEGERP (args[n]) || FLOATP (args[n]))