From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24314: Mistake in GNU Emacs Lisp Reference Manual Date: Fri, 26 Aug 2016 22:14:25 +0300 Message-ID: <83lgzjcpgu.fsf@gnu.org> References: <20160826140719.1c963f67@debian> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1472238922 27943 195.159.176.226 (26 Aug 2016 19:15:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 Aug 2016 19:15:22 +0000 (UTC) Cc: 24314-done@debbugs.gnu.org, info@fsf.org To: Eric Wayman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 26 21:15:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdMay-0006m8-Mh for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Aug 2016 21:15:16 +0200 Original-Received: from localhost ([::1]:33540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdMaw-0002EU-6C for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Aug 2016 15:15:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdMaq-0002CM-KZ for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2016 15:15:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdMak-0005Fp-Qp for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2016 15:15:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdMak-0005Fg-OX for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2016 15:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bdMak-0003SF-Kr for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2016 15:15:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Aug 2016 19:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 24314 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 24314@debbugs.gnu.org, eliz@gnu.org, ericwayman@fastmail.fm Original-Received: via spool by 24314-done@debbugs.gnu.org id=D24314.147223885913193 (code D ref 24314); Fri, 26 Aug 2016 19:15:02 +0000 Original-Received: (at 24314-done) by debbugs.gnu.org; 26 Aug 2016 19:14:19 +0000 Original-Received: from localhost ([127.0.0.1]:41698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdMa3-0003Qj-MH for submit@debbugs.gnu.org; Fri, 26 Aug 2016 15:14:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdMa1-0003QS-UO for 24314-done@debbugs.gnu.org; Fri, 26 Aug 2016 15:14:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdMZt-0004yk-Me for 24314-done@debbugs.gnu.org; Fri, 26 Aug 2016 15:14:12 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdMZt-0004yT-JH; Fri, 26 Aug 2016 15:14:09 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4336 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bdMZs-0007h1-8k; Fri, 26 Aug 2016 15:14:09 -0400 In-reply-to: <20160826140719.1c963f67@debian> (message from Eric Wayman on Fri, 26 Aug 2016 14:07:19 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122699 Archived-At: > Date: Fri, 26 Aug 2016 14:07:19 -0400 > From: Eric Wayman > > 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.)