diff options
| author | Chong Yidong | 2008-02-26 16:34:36 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-02-26 16:34:36 +0000 |
| commit | 6329325d6b89c0fb0cff60fc458dc08cfcdd85de (patch) | |
| tree | 82b74fd491eb9f82b9d6b185c5483bcd613e6d37 | |
| parent | 6667db4e2122bd90f0058049a604e584226dbfd9 (diff) | |
| download | emacs-6329325d6b89c0fb0cff60fc458dc08cfcdd85de.tar.gz emacs-6329325d6b89c0fb0cff60fc458dc08cfcdd85de.zip | |
(Fformat): Doc fix.
| -rw-r--r-- | src/editfns.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/editfns.c b/src/editfns.c index a8e9c8603bb..c9acebd9d29 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3383,7 +3383,10 @@ DEFUN ("format", Fformat, Sformat, 1, MANY, 0, | |||
| 3383 | doc: /* Format a string out of a format-string and arguments. | 3383 | doc: /* Format a string out of a format-string and arguments. |
| 3384 | The first argument is a format control string. | 3384 | The first argument is a format control string. |
| 3385 | The other arguments are substituted into it to make the result, a string. | 3385 | The other arguments are substituted into it to make the result, a string. |
| 3386 | It may contain %-sequences meaning to substitute the next argument. | 3386 | |
| 3387 | The format control string may contain %-sequences meaning to substitute | ||
| 3388 | the next available argument: | ||
| 3389 | |||
| 3387 | %s means print a string argument. Actually, prints any object, with `princ'. | 3390 | %s means print a string argument. Actually, prints any object, with `princ'. |
| 3388 | %d means print as number in decimal (%o octal, %x hex). | 3391 | %d means print as number in decimal (%o octal, %x hex). |
| 3389 | %X is like %x, but uses upper case. | 3392 | %X is like %x, but uses upper case. |
| @@ -3393,12 +3396,34 @@ It may contain %-sequences meaning to substitute the next argument. | |||
| 3393 | or decimal-point notation, whichever uses fewer characters. | 3396 | or decimal-point notation, whichever uses fewer characters. |
| 3394 | %c means print a number as a single character. | 3397 | %c means print a number as a single character. |
| 3395 | %S means print any object as an s-expression (using `prin1'). | 3398 | %S means print any object as an s-expression (using `prin1'). |
| 3396 | The argument used for %d, %o, %x, %e, %f, %g or %c must be a number. | 3399 | |
| 3400 | The argument used for %d, %o, %x, %e, %f, %g or %c must be a number. | ||
| 3397 | Use %% to put a single % into the output. | 3401 | Use %% to put a single % into the output. |
| 3398 | 3402 | ||
| 3399 | The basic structure of a %-sequence is | 3403 | A %-sequence may contain optional flag, width, and precision |
| 3400 | % <flags> <width> <precision> character | 3404 | specifiers, as follows: |
| 3401 | where flags is [-+ #0]+, width is [0-9]+, and precision is .[0-9]+ | 3405 | |
| 3406 | %<flags><width><precision>character | ||
| 3407 | |||
| 3408 | where flags is [+ #-0]+, width is [0-9]+, and precision is .[0-9]+ | ||
| 3409 | |||
| 3410 | The + flag character inserts a + before any positive number, while a | ||
| 3411 | space inserts a space before any positive number; these flags only | ||
| 3412 | affect %d, %e, %f, and %g sequences, and the + flag takes precedence. | ||
| 3413 | The # flag means to use an alternate display form for %o, %x, %X, %e, | ||
| 3414 | %f, and %g sequences. The - and 0 flags affect the width specifier, | ||
| 3415 | as described below. | ||
| 3416 | |||
| 3417 | The width specifier supplies a lower limit for the length of the | ||
| 3418 | printed representation. The padding, if any, normally goes on the | ||
| 3419 | left, but it goes on the right if the - flag is present. The padding | ||
| 3420 | character is normally a space, but it is 0 if the 0 flag is present. | ||
| 3421 | The - flag takes precedence over the 0 flag. | ||
| 3422 | |||
| 3423 | For %e, %f, and %g sequences, the number after the "." in the | ||
| 3424 | precision specifier says how many decimal places to show; if zero, the | ||
| 3425 | decimal point itself is omitted. For %s and %S, the precision | ||
| 3426 | specifier truncates the string to the given width. | ||
| 3402 | 3427 | ||
| 3403 | usage: (format STRING &rest OBJECTS) */) | 3428 | usage: (format STRING &rest OBJECTS) */) |
| 3404 | (nargs, args) | 3429 | (nargs, args) |