diff options
author | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2011-07-03 15:02:43 +0200 |
---|---|---|
committer | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2011-07-03 15:02:43 +0200 |
commit | a9ab721e7fdbedd15e520f74c9c90154a8c36669 (patch) | |
tree | 6f286ed15fac8d6e5e269a75dce1de63b47948bd /doc/lispref/strings.texi | |
parent | 79414ae4dfe70ef065a4afbcbfbcfbdec359fd8c (diff) | |
download | emacs-a9ab721e7fdbedd15e520f74c9c90154a8c36669.tar.gz |
Clarify what the "-" and "0" flags mean in the `format' function
(bug#6659).
Diffstat (limited to 'doc/lispref/strings.texi')
-rw-r--r-- | doc/lispref/strings.texi | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 05ac40e90c1..2b8911277cd 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -856,14 +856,16 @@ with @samp{0x} or @samp{0X}. For @samp{%e}, @samp{%f}, and @samp{%g}, the @samp{#} flag means include a decimal point even if the precision is zero. + The flag @samp{0} ensures that the padding consists of @samp{0} +characters instead of spaces. This flag is ignored for non-numerical +specification characters like @samp{%s}, @samp{%S} and @samp{%c}. +These specification characters accept the @samp{0} flag, but still pad +with @emph{spaces}. + The flag @samp{-} causes the padding inserted by the width specifier, if any, to be inserted on the right rather than the left. -The flag @samp{0} ensures that the padding consists of @samp{0} -characters instead of spaces, inserted on the left. These flags are -ignored for specification characters for which they do not make sense: -@samp{%s}, @samp{%S} and @samp{%c} accept the @samp{0} flag, but still -pad with @emph{spaces} on the left. If both @samp{-} and @samp{0} are -present and valid, @samp{-} takes precedence. +If both @samp{-} and @samp{0} are present, the @samp{0} flag is +ignored. @example @group |