diff options
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/editfns.c b/src/editfns.c index f29fc510a21..a6d13545711 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3883,6 +3883,9 @@ precision specifier says how many decimal places to show; if zero, the decimal point itself is omitted. For %s and %S, the precision specifier truncates the string to the given width. +Text properties, if any, are copied from the format-string to the +produced text. + usage: (format STRING &rest OBJECTS) */) (ptrdiff_t nargs, Lisp_Object *args) { @@ -4170,6 +4173,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) convbytes += padding; if (convbytes <= buf + bufsize - p) { + info[n].start = nchars; if (! minus_flag) { memset (p, ' ', padding); @@ -4188,9 +4192,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) nbytes, STRING_MULTIBYTE (args[n]), multibyte); - info[n].start = nchars; nchars += nchars_string; - info[n].end = nchars; if (minus_flag) { @@ -4198,6 +4200,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) p += padding; nchars += padding; } + info[n].end = nchars; /* If this argument has text properties, record where in the result string it appears. */ @@ -4415,6 +4418,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) exponent_bytes = src + sprintf_bytes - e; } + info[n].start = nchars; if (! minus_flag) { memset (p, ' ', padding); @@ -4437,9 +4441,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) memcpy (p, src, exponent_bytes); p += exponent_bytes; - info[n].start = nchars; nchars += leading_zeros + sprintf_bytes + trailing_zeros; - info[n].end = nchars; if (minus_flag) { @@ -4447,6 +4449,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) p += padding; nchars += padding; } + info[n].end = nchars; continue; } |
