emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104904: Clarify what the "-" and "0"


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104904: Clarify what the "-" and "0" flags mean in the `format' function
Date: Sun, 03 Jul 2011 15:02:43 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104904
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Sun 2011-07-03 15:02:43 +0200
message:
  Clarify what the "-" and "0" flags mean in the `format' function
  (bug#6659).
modified:
  doc/lispref/ChangeLog
  doc/lispref/strings.texi
  src/ChangeLog
  src/editfns.c
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2011-07-03 12:33:37 +0000
+++ b/doc/lispref/ChangeLog     2011-07-03 13:02:43 +0000
@@ -1,5 +1,8 @@
 2011-07-03  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * strings.texi (Formatting Strings): Clarify what the "-" and "0"
+       flags mean (bug#6659).
+
        * functions.texi (What Is a Function): Document the autoload
        object (bug#6496).
 

=== modified file 'doc/lispref/strings.texi'
--- a/doc/lispref/strings.texi  2011-05-29 22:41:06 +0000
+++ b/doc/lispref/strings.texi  2011-07-03 13:02:43 +0000
@@ -856,14 +856,16 @@
 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:
address@hidden, @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

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-07-03 06:17:19 +0000
+++ b/src/ChangeLog     2011-07-03 13:02:43 +0000
@@ -1,3 +1,7 @@
+2011-07-03  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
+
 2011-07-03  Paul Eggert  <address@hidden>
 
        * xsettings.c (SYSTEM_FONT): Define only when used.

=== modified file 'src/editfns.c'
--- a/src/editfns.c     2011-06-24 21:25:22 +0000
+++ b/src/editfns.c     2011-07-03 13:02:43 +0000
@@ -3557,7 +3557,8 @@
 printed representation.  The padding, if any, normally goes on the
 left, but it goes on the right if the - flag is present.  The padding
 character is normally a space, but it is 0 if the 0 flag is present.
-The - flag takes precedence over the 0 flag.
+The 0 flag is ignored if the - flag is present, or the format sequence
+is something other than %d, %e, %f, and %g.
 
 For %e, %f, and %g sequences, the number after the "." in the
 precision specifier says how many decimal places to show; if zero, the


reply via email to

[Prev in Thread] Current Thread [Next in Thread]