diff options
| author | Gerd Moellmann | 2001-01-22 13:10:49 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-01-22 13:10:49 +0000 |
| commit | 50606b4c014cb43d084f1b8fdb2634990958ebe7 (patch) | |
| tree | 9858143b960b9f1962803d5645d209067bfb758e /src | |
| parent | 21c2bbe069922c9c62ff0f031a4cb88a3419bb44 (diff) | |
| download | emacs-50606b4c014cb43d084f1b8fdb2634990958ebe7.tar.gz emacs-50606b4c014cb43d084f1b8fdb2634990958ebe7.zip | |
(Fformat): Don't extend text properties from arguments
to padding chars in the result.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/editfns.c | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3444e89b63e..f85dd0e7602 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2001-01-22 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * editfns.c (Fformat): Don't extend text properties from arguments | ||
| 4 | to padding chars in the result. | ||
| 5 | |||
| 1 | 2001-01-20 Eli Zaretskii <eliz@is.elta.co.il> | 6 | 2001-01-20 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 7 | ||
| 3 | * s/msdos.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS. | 8 | * 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.") | |||
| 3310 | 3310 | ||
| 3311 | if (STRINGP (args[n])) | 3311 | if (STRINGP (args[n])) |
| 3312 | { | 3312 | { |
| 3313 | int padding, nbytes; | 3313 | int padding, nbytes, start, end; |
| 3314 | int width = lisp_string_width (args[n], -1, NULL, NULL); | 3314 | int width = lisp_string_width (args[n], -1, NULL, NULL); |
| 3315 | int start = nchars; | ||
| 3316 | 3315 | ||
| 3317 | /* If spec requires it, pad on right with spaces. */ | 3316 | /* If spec requires it, pad on right with spaces. */ |
| 3318 | padding = minlen - width; | 3317 | padding = minlen - width; |
| @@ -3320,9 +3319,11 @@ Use %% to put a single % into the output.") | |||
| 3320 | while (padding-- > 0) | 3319 | while (padding-- > 0) |
| 3321 | { | 3320 | { |
| 3322 | *p++ = ' '; | 3321 | *p++ = ' '; |
| 3323 | nchars++; | 3322 | ++nchars; |
| 3324 | } | 3323 | } |
| 3325 | 3324 | ||
| 3325 | start = nchars; | ||
| 3326 | |||
| 3326 | if (p > buf | 3327 | if (p > buf |
| 3327 | && multibyte | 3328 | && multibyte |
| 3328 | && !ASCII_BYTE_P (*((unsigned char *) p - 1)) | 3329 | && !ASCII_BYTE_P (*((unsigned char *) p - 1)) |
| @@ -3334,6 +3335,7 @@ Use %% to put a single % into the output.") | |||
| 3334 | STRING_MULTIBYTE (args[n]), multibyte); | 3335 | STRING_MULTIBYTE (args[n]), multibyte); |
| 3335 | p += nbytes; | 3336 | p += nbytes; |
| 3336 | nchars += XSTRING (args[n])->size; | 3337 | nchars += XSTRING (args[n])->size; |
| 3338 | end = nchars; | ||
| 3337 | 3339 | ||
| 3338 | if (negative) | 3340 | if (negative) |
| 3339 | while (padding-- > 0) | 3341 | while (padding-- > 0) |
| @@ -3354,7 +3356,7 @@ Use %% to put a single % into the output.") | |||
| 3354 | } | 3356 | } |
| 3355 | 3357 | ||
| 3356 | info[n].start = start; | 3358 | info[n].start = start; |
| 3357 | info[n].end = nchars; | 3359 | info[n].end = end; |
| 3358 | } | 3360 | } |
| 3359 | } | 3361 | } |
| 3360 | else if (INTEGERP (args[n]) || FLOATP (args[n])) | 3362 | else if (INTEGERP (args[n]) || FLOATP (args[n])) |