Subject: Re: bug#32252: [PATCH] %o and %x now format signed numbers

From: Paul Eggert <[email-masked]>
Date: Mon, 23 Jul 2018 16:30:34 -0700

On 07/23/2018 12:49 PM, Drew Adams wrote:
> 1. I don't see where the doc now mentions variable `binary-as-signed'.

binary-as-signed is intentionally documented only in its doc string. The 
intent is that it be like the variable read-integer-overflow-as-float. 
That is, although it's present if someone actually needs it, we're 
hoping actual use cases are so rare that we can obsolete the variable 
soon. This is also why it's not a user option.

> I don't see where the doc mentions what the output is for %o and %x - for a negative number or a positive number.

For %o the Elisp manual says "Replace the specification with the 
base-eight representation of an
integer", and there is similar wording for %x and %X. It might be 
helpful to nail down negative-integer handling with wording like "Format 
a negative integer with a leading @samp{-} followed by the absolute value."

> 3. Why the change in the default behavior?

The primary motivation is that the old behavior can't reasonably be 
extended to bignums. Also, it's long been an annoyance that the old 
behavior was machine dependent: (format "%x" -1) yields different 
answers depending on what machine you're running on. The proposed change 
would make this usage portable, and would make it obvious what bignums 
should do.