unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Eric Wayman <ericwayman@fastmail.fm>
Cc: 24314-done@debbugs.gnu.org, info@fsf.org
Subject: bug#24314: Mistake in GNU Emacs Lisp Reference Manual
Date: Fri, 26 Aug 2016 22:14:25 +0300	[thread overview]
Message-ID: <83lgzjcpgu.fsf@gnu.org> (raw)
In-Reply-To: <20160826140719.1c963f67@debian> (message from Eric Wayman on Fri, 26 Aug 2016 14:07:19 -0400)

> Date: Fri, 26 Aug 2016 14:07:19 -0400
> From: Eric Wayman <ericwayman@fastmail.fm>
> 
> In section 4.7, Formatting Strings
> (https://www.gnu.org/software/emacs/manual/html_node/elisp/Formatting-Strings.html#Formatting-Strings)
> it says:
> 
>     "The precision is a decimal-point ‘.’ followed by a digit-string...
>     Precision has no effect for other specification characters."
> 
> However, running
> 
>     (format "%.10d" 23)
> 
> produces
> 
>     0000000023
> 
> which clearly does have an effect (i.e. padding the integer with zeroes
> to the left).

Thanks.  This is already fixed in the development sources of what
will become Emacs 25.1.  The manual now says:

     All the specification characters allow an optional “precision” before
  the character (after the width, if present).  The precision is a
  decimal-point ‘.’ followed by a digit-string.  For the floating-point
  specifications (‘%e’, ‘%f’, ‘%g’), the precision specifies how many
  decimal places to show; if zero, the decimal-point itself is also
  omitted.  For ‘%s’ and ‘%S’, the precision truncates the string to the
  given width, so ‘%.3s’ shows only the first three characters of the
  representation for OBJECT.  For other specification characters, the
  effect of precision is what the local library functions of the ‘printf’
  family produce.

(I clarified the last sentence just now.)





      reply	other threads:[~2016-08-26 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 18:07 bug#24314: Mistake in GNU Emacs Lisp Reference Manual Eric Wayman
2016-08-26 19:14 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83lgzjcpgu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24314-done@debbugs.gnu.org \
    --cc=ericwayman@fastmail.fm \
    --cc=info@fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).