GNU bug report logs - #24314
Mistake in GNU Emacs Lisp Reference Manual

Previous Next

Package: emacs;

Reported by: Eric Wayman <ericwayman <at> fastmail.fm>

Date: Fri, 26 Aug 2016 18:39:01 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eric Wayman <ericwayman <at> fastmail.fm>
Subject: bug#24314: closed (Re: bug#24314: Mistake in GNU Emacs Lisp
 Reference Manual)
Date: Fri, 26 Aug 2016 19:15:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#24314: Mistake in GNU Emacs Lisp Reference Manual

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 24314 <at> debbugs.gnu.org.

-- 
24314: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24314
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Eric Wayman <ericwayman <at> fastmail.fm>
Cc: 24314-done <at> debbugs.gnu.org, info <at> fsf.org
Subject: Re: bug#24314: Mistake in GNU Emacs Lisp Reference Manual
Date: Fri, 26 Aug 2016 22:14:25 +0300
> Date: Fri, 26 Aug 2016 14:07:19 -0400
> From: Eric Wayman <ericwayman <at> 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.)

[Message part 3 (message/rfc822, inline)]
From: Eric Wayman <ericwayman <at> fastmail.fm>
To: bug-gnu-emacs <at> gnu.org, info <at> fsf.org
Subject: Mistake in GNU Emacs Lisp Reference Manual
Date: Fri, 26 Aug 2016 14:07:19 -0400
To Whom It May Concern,

I believe I have found a mistake in the GNU Emacs Lisp Reference
Manual.

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).

Best regards,
Eric Wayman



This bug report was last modified 8 years and 306 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.