From unknown Mon Aug 18 02:33:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#34792 <34792@debbugs.gnu.org> To: bug#34792 <34792@debbugs.gnu.org> Subject: Status: 27.0.50; format %x and %X don't print as unsigned Reply-To: bug#34792 <34792@debbugs.gnu.org> Date: Mon, 18 Aug 2025 09:33:12 +0000 retitle 34792 27.0.50; format %x and %X don't print as unsigned reassign 34792 emacs submitter 34792 Ivan Andrus severity 34792 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 08 19:58:42 2019 Received: (at submit) by debbugs.gnu.org; 9 Mar 2019 00:58:42 +0000 Received: from localhost ([127.0.0.1]:36857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2QK2-0005kP-12 for submit@debbugs.gnu.org; Fri, 08 Mar 2019 19:58:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2QJz-0005kB-LG for submit@debbugs.gnu.org; Fri, 08 Mar 2019 19:58:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:41360) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2QJu-0003Qs-9P for submit@debbugs.gnu.org; Fri, 08 Mar 2019 19:58:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2QJt-0000Af-Co for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 19:58:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2QJs-0003P9-HW for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 19:58:33 -0500 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:46085) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2QJs-0003Jy-9B for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2019 19:58:32 -0500 Received: by mail-io1-xd2c.google.com with SMTP id k21so18262318ior.13 for ; Fri, 08 Mar 2019 16:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=MrpfVv8+nMMMiv/R79zNWueGDcp9XJPQ+GjOrTkZM50=; b=iqJCxo7IinT1+jWFH5DNxNonunoWdEldAZF+Ohm7W4u4Fl21Kx/2z3YA3tDXCfrYmm L4rsHGyk0UBnBGs5Ocu7j918Xc6bSle6IBV6dWwzfb8uAEaxZwS3JzZfMsUOXqCg1jmC adUiKz7TeUa8AKJoXMp8ol+e00uSJ6lPMrcbN8nmXO9pWLhBwf7lIl0LRj/02Bwr1AW8 kK/6e0ep5CP1ffz6TyZNAphmLciFHaNki+/XswwU6yRryJ4rU0MQoTpaNrXG2AMCfdH5 ZHjQZ/c+Zfs5WqmgEO5eWmch9YvKcMHrfzIHdazO6qv3fdw7T4lYVMPjBP/ZNGJL32sV INDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=MrpfVv8+nMMMiv/R79zNWueGDcp9XJPQ+GjOrTkZM50=; b=sing/FAUa13z5THg5X67nQQMOIfAy8H4PjYlk9s10g7Bj2110QTjw6lCNC6DxIxp7B BY+dcXoXAPQm3ps7lwyRJuSI2+s+8PPvr1CbXEOcgcP7cV9bo80inuFCDc5PEJBHs60a XXo3tdYhqD18tqzbLlEDqKMSNSs2aapOlSJ/2xtnb4kKDuerbx8OvmK3BBWY+2KWFfK3 gUAH2GSVyOUxn/4Z31NAwQfci2AA8Bqpfdodz53GLULBFd/CkdzmxWkP3Rp1HMD//1cd c+KBQwvI+I0u8zaGK07Xisut1tfB93wDaAuznxnPF+FQLUxuHO2kPzeM/iOFQfPLGgFV GlRw== X-Gm-Message-State: APjAAAV2A+D9qTB0Y4p/hxDeD06iZuW9rvK64BvlKzOZmv3BhEas0bil C8IRVPbaYKzPaTiB7PrPgd9L2eUK X-Google-Smtp-Source: APXvYqz5/eOCYvLz/aTUHxr1GYh3Kwg8jc/9CXlqFG2jue+BKpAk6e7DymY6c1QpI21XbgAHp+KL3A== X-Received: by 2002:a6b:5d17:: with SMTP id r23mr481876iob.295.1552093103354; Fri, 08 Mar 2019 16:58:23 -0800 (PST) Received: from [192.168.0.4] (174-23-196-245.slkc.qwest.net. [174.23.196.245]) by smtp.gmail.com with ESMTPSA id j17sm3638766ioa.82.2019.03.08.16.58.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 16:58:22 -0800 (PST) From: Ivan Andrus Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: 27.0.50; format %x and %X don't print as unsigned Message-Id: <79489389-7B99-4F84-BC48-3AF622B8EF26@gmail.com> Date: Fri, 8 Mar 2019 17:58:19 -0700 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3445.102.3) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d2c X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) The following snippets return strings with negative signs, but the docstring of format says they should be unsigned. I get the same results from emacs -Q as well (format "%s_%X%X" "bob" (random) (random)) ;; "bob_143E5019B284E085-3D71BF28F82AFD0" (format "%s_%x%x" "bob" (random) (random)) ;; "bob_114d97ac7a6b2a84-15fcceadc374b70e" -Ivan In GNU Emacs 27.0.50 (build 7, x86_64-apple-darwin18.2.0, NS = appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-03-08 built on iandrus-macOS Repository revision: dd77d672d8a9529ce8d4a0649be1b44bbd1a03b1 Repository branch: master Windowing system distributor 'Apple', version 10.3.1671 System Description: Mac OS X 10.14.3 Recent messages: Mark set Occurrence 1/2 in buffer find-function-library: Symbol=E2=80=99s function definition is void: ## = [2 times] C-h C-u is undefined Mark saved where search started Mark set [2 times] "bob_-3D1C1371061ABEA-1D876D356D7D25DF" Saving file /Users/iandrus/.emacs.d/init.el... Wrote /Users/iandrus/.emacs.d/init.el Undo! [2 times] Configured using: 'configure = PKG_CONFIG_PATH=3D/opt/X11/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgcon= fig --with-sound=3Dyes --with-ns --with-modules --with-file-notification=3Dyes= --enable-gcc-warnings=3Dwarn-only --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-xml2 --with-imagemagick --with-json --with-xft --with-libotf --with-gnutls=3Dno --with-makeinfo --with-libgmp' Configured features: RSVG IMAGEMAGICK GLIB NOTIFY KQUEUE ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS XIM NS MODULES THREADS PDUMPER GMP Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: ELisp:Dyn From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 08 21:03:58 2019 Received: (at 34792) by debbugs.gnu.org; 9 Mar 2019 02:03:58 +0000 Received: from localhost ([127.0.0.1]:36872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2RLC-0007Ll-J0 for submit@debbugs.gnu.org; Fri, 08 Mar 2019 21:03:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2RLB-0007LY-Ck for 34792@debbugs.gnu.org; Fri, 08 Mar 2019 21:03:57 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2RL6-0006Ab-5o; Fri, 08 Mar 2019 21:03:52 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1h2RL4-00059o-3E; Fri, 08 Mar 2019 21:03:50 -0500 From: Glenn Morris To: Ivan Andrus Subject: Re: bug#34792: 27.0.50; format %x and %X don't print as unsigned References: <79489389-7B99-4F84-BC48-3AF622B8EF26@gmail.com> X-Spook: AIMSX La Familia Crest Dirty bomb Avalanche Human to X-Ran: %T|N0>'?V65Xt7_q*DwG5e(Ddag|iMJwN\\ehu3$l2A8t?7'GX2,]~%8]~J]6D#_#HQYRt X-Hue: cyan X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 08 Mar 2019 21:03:49 -0500 In-Reply-To: <79489389-7B99-4F84-BC48-3AF622B8EF26@gmail.com> (Ivan Andrus's message of "Fri, 8 Mar 2019 17:58:19 -0700") Message-ID: <1vwol8ls6y.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 34792 Cc: 34792@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ivan Andrus wrote: > The following snippets return strings with negative signs, but the > docstring of format says they should be unsigned. See etc/NEWS 'Numbers formatted via...' I don't understand the "bignums, a planned feature." in that entry. It makes it sound like bignum will be implemented in future, but they already are? Also the sense of the entry seems backwards, since binary-as-unsigned is nil by default (but from editfns.c I see "it depends"). Anyway, it seems like the doc the 'format' function wasn't updated. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 09 13:49:04 2019 Received: (at 34792) by debbugs.gnu.org; 9 Mar 2019 18:49:04 +0000 Received: from localhost ([127.0.0.1]:37414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2h1r-0006Gc-PJ for submit@debbugs.gnu.org; Sat, 09 Mar 2019 13:49:04 -0500 Received: from mail-it1-f180.google.com ([209.85.166.180]:38394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2h1p-0006G8-Ov for 34792@debbugs.gnu.org; Sat, 09 Mar 2019 13:49:02 -0500 Received: by mail-it1-f180.google.com with SMTP id l66so1321317itg.3 for <34792@debbugs.gnu.org>; Sat, 09 Mar 2019 10:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LnWDUodq0L2SGG0peqY6ta1v/KB44jLUy8INziQoX2c=; b=vYsDfRT01zWCivWayLFyZPO9LLCnGTgS3wM8XAwkTkShAHA8dfNUahZVV6qMUG4EK7 eozk1SYCo+iLvpzPBI1eiZTiq4Z7bDFndzJy7tnMK7AMmTWibjcAmFyKCRdBTeSJS23l IEsgIZByqNn27NsuwnN2qs2TwfRJr+DCcmq0QyTyIfwWH6qvVWIvxaIKEkNOY+9HKc4c fBMSaG3XBNKjhh9NWd+BtS7O90Ir+2Yv9qK1z2jCrcERFqcN4xmG2giJDYJFW8fg8uKv NMImjbZlJpKx3y2wl8NGkcoP97WeiSGbLbg/glQl2hOsUplpVjEC8nPk0uGv5RGFjnHb ZqUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LnWDUodq0L2SGG0peqY6ta1v/KB44jLUy8INziQoX2c=; b=rULfoi1Fma94yBW+KVuc5u/0WMXjNDRToKiaRpzttUBJhYStO8fWx9j0UvxUT20u/B SOFP+Ua6b8ZEOlM/wG8wexIThj3DNUg9DjDTa/wZgQulwjQosbFork1EtvWBeDkOuko8 SctkgqnQxsdTWI7olK7q+6js9VSxiLProUYMDL9S3fSZ4GJge2gDN0jOOxhXKjh7CdNB R+YPLuSRAUeioJ+zpPEotZ4L6akC8aNeYYTm9PvRxjragzRnjXRKaVbX2sbZ0tTeOxJ7 nTVpIyfMBbpOw7Ewd3Xwcud/nIGLZpxx+r3ilx8AJL0WJU6jF9jvznavqJkfyfAcntA6 JHrw== X-Gm-Message-State: APjAAAVIll/FsFcbqLZ0J4YAvouoeHW//8vwXJmNf4LVW1NCgA2yFt25 hnU1F4VrALNXQX5tMDyL8J0= X-Google-Smtp-Source: APXvYqxSGGkVlZJbDV6DXpQYEeXfQapB5STJkqreZusvmgK8lB/OUcaNVndLi5LroUKzRv7BJxXI7g== X-Received: by 2002:a24:7a85:: with SMTP id a127mr12213163itc.46.1552157335795; Sat, 09 Mar 2019 10:48:55 -0800 (PST) Received: from [192.168.0.4] (174-23-196-245.slkc.qwest.net. [174.23.196.245]) by smtp.gmail.com with ESMTPSA id y16sm368568ion.64.2019.03.09.10.48.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Mar 2019 10:48:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: bug#34792: 27.0.50; format %x and %X don't print as unsigned From: Ivan Andrus In-Reply-To: <1vwol8ls6y.fsf@fencepost.gnu.org> Date: Sat, 9 Mar 2019 11:48:51 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <9DBA5B35-1F73-457B-8ADE-A495CB326F17@gmail.com> References: <79489389-7B99-4F84-BC48-3AF622B8EF26@gmail.com> <1vwol8ls6y.fsf@fencepost.gnu.org> To: Glenn Morris X-Mailer: Apple Mail (2.3445.102.3) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34792 Cc: 34792@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Mar 8, 2019, at 7:03 PM, Glenn Morris wrote: >=20 > Ivan Andrus wrote: >=20 >> The following snippets return strings with negative signs, but the >> docstring of format says they should be unsigned.=20 >=20 > See etc/NEWS 'Numbers formatted via...' >=20 > I don't understand the "bignums, a planned feature." in that entry. > It makes it sound like bignum will be implemented in future, but they > already are? >=20 > Also the sense of the entry seems backwards, since binary-as-unsigned = is > nil by default (but from editfns.c I see "it depends"). >=20 > Anyway, it seems like the doc the 'format' function wasn't updated. Thanks! I should have thought to check NEWS. I took the liberty for pushing a change to the docstring to master. = Hopefully, it's acceptable. -Ivan= From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 09 13:49:31 2019 Received: (at control) by debbugs.gnu.org; 9 Mar 2019 18:49:31 +0000 Received: from localhost ([127.0.0.1]:37417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2h2J-0006HK-B2 for submit@debbugs.gnu.org; Sat, 09 Mar 2019 13:49:31 -0500 Received: from mail-io1-f51.google.com ([209.85.166.51]:36031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2h2I-0006H6-Ae for control@debbugs.gnu.org; Sat, 09 Mar 2019 13:49:30 -0500 Received: by mail-io1-f51.google.com with SMTP id f6so658565iop.3 for ; Sat, 09 Mar 2019 10:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=XHQ/EpDGMBAfFYYq4zfoZIu2Xy6ae6VDh1qV3McZt8I=; b=H7rM+x3Na10b0U/Q2rXhjhOKSpvDJqcYDfQXmnQ/9RzQpWVrprROx0OQZLEdGMoMud 4SQl16HWC/2fWCG3o8MP8Khjz44wgTEVlXMUoGzY1tOISs555lDCHqaF4xgm1DxLaQCu /t2Q1OwW2mgxAlKLxuQqMyJnhji/ew/F2awvIo1NrHG/O1ItpmaOwC6hzbnJ4Qp6dprn wnT23k4nq++AMH5LyI7W7I9dJ+eue+HXWz13XU/G3EC3dyldlnR0RdBicRDqDdiViwAQ n/wdbvYe7CzBkpRvOsY9nq4QCgdpw99xgRJKVgVwJsVLEA6NLtPnDhS2ObZLtUKjcleL 8ipg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=XHQ/EpDGMBAfFYYq4zfoZIu2Xy6ae6VDh1qV3McZt8I=; b=iY1M2GaO6OlKLfMJb6Vd8BHsi1CzJ9zj1B6Ebn5XAEOY92M9T7TbVcmB0G7wLElDuf W1ZRDkbFv1sc6yV4GfmkEwNfGo445+jzTSSjp0NhwJc4CFlqAxZ0Ye7+YwpZnwrngQtn bAiAoiT2u41B8BLhN78CuTFuOP5B+Ms8vDKhU+x18E/+zE4dpm3GZ0sQUif2ynEKz5Tc ZY9kKtIk+5hHnJnFvzcyHnlOgNcDfI+d8ib/GXjYUUrSzMiuePgn3UKsHDWYbCbcVqEa Gp5ZKmKzR001EW4D8aap/IGvn2RVUnUWj8VkoeTUqIf/dFNEchPcJWmGyobIHbgSOd9g KXrw== X-Gm-Message-State: APjAAAX0ecogx9Q61x0CavuO38i29X90Qitt7EBpgEFOAgVdNzzC+waj 5G0aVWBiPeJTI7V4XWxSACV80Q18 X-Google-Smtp-Source: APXvYqwqUfGnA89ZuKtyvFqT86jWwouTZH6SsXlIwbUou0PAgjJrsGH1KiH410rfYmBshSGO+N35/Q== X-Received: by 2002:a6b:f816:: with SMTP id o22mr13410273ioh.196.1552157364108; Sat, 09 Mar 2019 10:49:24 -0800 (PST) Received: from [192.168.0.4] (174-23-196-245.slkc.qwest.net. [174.23.196.245]) by smtp.gmail.com with ESMTPSA id y16sm368568ion.64.2019.03.09.10.49.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Mar 2019 10:49:23 -0800 (PST) From: Ivan Andrus Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Controll message for bug #34792 Message-Id: Date: Sat, 9 Mar 2019 11:49:22 -0700 To: control@debbugs.gnu.org X-Mailer: Apple Mail (2.3445.102.3) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 34792 From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 09 17:54:30 2019 Received: (at 34792) by debbugs.gnu.org; 9 Mar 2019 22:54:30 +0000 Received: from localhost ([127.0.0.1]:37504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2krO-0005c0-1E for submit@debbugs.gnu.org; Sat, 09 Mar 2019 17:54:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h2krM-0005bo-Ha for 34792@debbugs.gnu.org; Sat, 09 Mar 2019 17:54:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2krG-0007RI-Mc; Sat, 09 Mar 2019 17:54:22 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1h2krE-0000Wf-Ik; Sat, 09 Mar 2019 17:54:20 -0500 From: Glenn Morris To: 34792@debbugs.gnu.org Subject: Re: bug#34792: 27.0.50; format %x and %X don't print as unsigned References: <79489389-7B99-4F84-BC48-3AF622B8EF26@gmail.com> <1vwol8ls6y.fsf@fencepost.gnu.org> <9DBA5B35-1F73-457B-8ADE-A495CB326F17@gmail.com> X-Spook: UMTS airframe Port militia Infrastructure security X-Ran: {+,Q`:1"r{kL1r1se=wjb94j~S%wvf/qNc![58M76c{$:xn.iiEb-qB70&;`HhP[2kx+?m X-Hue: black X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sat, 09 Mar 2019 17:54:19 -0500 In-Reply-To: <9DBA5B35-1F73-457B-8ADE-A495CB326F17@gmail.com> (Ivan Andrus's message of "Sat, 9 Mar 2019 11:48:51 -0700") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 34792 Cc: Ivan Andrus , Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) (Adding explicit cc:) >> See etc/NEWS 'Numbers formatted via...' >> >> I don't understand the "bignums, a planned feature." in that entry. >> It makes it sound like bignum will be implemented in future, but they >> already are? >> >> Also the sense of the entry seems backwards, since binary-as-unsigned is >> nil by default (but from editfns.c I see "it depends"). >> >> Anyway, it seems like the doc the 'format' function wasn't updated. > > Thanks! I should have thought to check NEWS. > > I took the liberty for pushing a change to the docstring to master. I think this area may still need some updating. (It feels like it predates the addition of bignum support?) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 11 02:49:16 2019 Received: (at 34792) by debbugs.gnu.org; 11 Mar 2019 06:49:16 +0000 Received: from localhost ([127.0.0.1]:38579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h3EkN-00055y-SS for submit@debbugs.gnu.org; Mon, 11 Mar 2019 02:49:16 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:52818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h3EkL-00055l-5G for 34792@debbugs.gnu.org; Mon, 11 Mar 2019 02:49:14 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8EBB51614E4; Sun, 10 Mar 2019 23:49:07 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 1YIaGasWvgpO; Sun, 10 Mar 2019 23:49:06 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7394816155E; Sun, 10 Mar 2019 23:49:06 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id QTCXqc84uerH; Sun, 10 Mar 2019 23:49:06 -0700 (PDT) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 426051614E4; Sun, 10 Mar 2019 23:49:06 -0700 (PDT) Subject: Re: bug#34792: 27.0.50; format %x and %X don't print as unsigned To: Glenn Morris , 34792@debbugs.gnu.org References: <79489389-7B99-4F84-BC48-3AF622B8EF26@gmail.com> <1vwol8ls6y.fsf@fencepost.gnu.org> <9DBA5B35-1F73-457B-8ADE-A495CB326F17@gmail.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sun, 10 Mar 2019 23:49:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------00F2E106D578633E4F6A90CF" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34792 Cc: Ivan Andrus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is a multi-part message in MIME format. --------------00F2E106D578633E4F6A90CF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Glenn Morris wrote: > I think this area may still need some updating. > (It feels like it predates the addition of bignum support?) Yes, you're right on both counts. I installed the attached patches to master to try to fix this. --------------00F2E106D578633E4F6A90CF Content-Type: text/x-patch; name="0001-Improve-binary-as-unsigned-treatment-Bug-34792.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Improve-binary-as-unsigned-treatment-Bug-34792.patch" >From 9b4d34fa7884d6b67ec19593c5d2d3b587434966 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 10 Mar 2019 23:39:48 -0700 Subject: [PATCH 1/2] Improve binary-as-unsigned treatment (Bug#34792) * etc/NEWS: * src/editfns.c (Fformat, binary_as_unsigned): Update now that we always have bignums. (syms_of_editfns) [!defined lisp_h_FIXNUMP]: Remove now-obsolete code, since lisp_h_FIXNUMP is always defined now. * test/src/editfns-tests.el (read-large-integer): Simplify, now that we can assume binary-as-unsigned defaults to nil. --- etc/NEWS | 6 +++--- src/editfns.c | 14 +++++--------- test/src/editfns-tests.el | 11 +++++------ 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 0a1d9ea222..3dc21dfe89 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1490,10 +1490,10 @@ between two strings. '(quote x)' instead of 'x you will have to bind it to nil where applicable. +++ -** Numbers formatted via '%o' or '%x' may now be formatted as signed integers. +** Numbers formatted via '%o' or '%x' are now formatted as signed integers. This avoids problems in calls like '(read (format "#x%x" -1))', and is -more compatible with bignums, a planned feature. To get this -behavior, set the experimental variable 'binary-as-unsigned' to nil, +more compatible with bignums. To get the traditional machine-dependent +behavior, set the experimental variable 'binary-as-unsigned' to t, and if the new behavior breaks your code please email 32252@debbugs.gnu.org. Because '%o' and '%x' can now format signed integers, they now support the '+' and space flags. diff --git a/src/editfns.c b/src/editfns.c index f5a9e0a640..7f11037f1e 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3001,8 +3001,8 @@ the next available argument, or the argument explicitly specified: %S means print any object as an s-expression (using `prin1'). The argument used for %d, %o, %x, %e, %f, %g or %c must be a number. -The value of `binary-as-unsigned' determines whether it's printed as - signed or unsigned by %o, %x, and %X. +%o, %x, and %X treat arguments as unsigned if `binary-as-unsigned' is t + (this is experimental; email 32252@debbugs.gnu.org if you need it). Use %% to put a single % into the output. A %-sequence other than %% may contain optional field number, flag, @@ -4485,17 +4485,13 @@ functions if all the text being accessed has this property. */); binary_as_unsigned, doc: /* Non-nil means `format' %x and %o treat integers as unsigned. This has machine-dependent results. Nil means to treat integers as -signed, which is portable; for example, if N is a negative integer, -(read (format "#x%x") N) returns N only when this variable is nil. +signed, which is portable and is the default; for example, if N is a +negative integer, (read (format "#x%x") N) returns N only when this +variable is nil. This variable is experimental; email 32252@debbugs.gnu.org if you need it to be non-nil. */); - /* For now, default to true if bignums exist, false in traditional Emacs. */ -#ifdef lisp_h_FIXNUMP binary_as_unsigned = false; -#else - binary_as_unsigned = true; -#endif defsubr (&Spropertize); defsubr (&Schar_equal); diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index a01dc4a478..449f00f378 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -184,12 +184,11 @@ transpose-test-get-byte-positions 'integer)) (should (eq (type-of (read (format "#32rG%x" most-positive-fixnum))) 'integer)) - (let ((binary-as-unsigned nil)) - (dolist (fmt '("%d" "%s" "#o%o" "#x%x")) - (dolist (val (list most-negative-fixnum (1+ most-negative-fixnum) - -1 0 1 - (1- most-positive-fixnum) most-positive-fixnum)) - (should (eq val (read (format fmt val)))))))) + (dolist (fmt '("%d" "%s" "#o%o" "#x%x")) + (dolist (val (list most-negative-fixnum (1+ most-negative-fixnum) + -1 0 1 + (1- most-positive-fixnum) most-positive-fixnum)) + (should (eq val (read (format fmt val))))))) (ert-deftest format-%o-invalid-float () (should-error (format "%o" -1e-37) -- 2.17.1 --------------00F2E106D578633E4F6A90CF Content-Type: text/x-patch; name="0002-src-editfns.c-Fix-docstring-typo.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-src-editfns.c-Fix-docstring-typo.patch" >From 27466c62fdc977e8d3b23c5ae4f529a64ac7374f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 10 Mar 2019 23:46:26 -0700 Subject: [PATCH 2/2] * src/editfns.c: Fix docstring typo. --- src/editfns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editfns.c b/src/editfns.c index 7f11037f1e..d6ad7474fe 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -4486,7 +4486,7 @@ functions if all the text being accessed has this property. */); doc: /* Non-nil means `format' %x and %o treat integers as unsigned. This has machine-dependent results. Nil means to treat integers as signed, which is portable and is the default; for example, if N is a -negative integer, (read (format "#x%x") N) returns N only when this +negative integer, (read (format "#x%x" N)) returns N only when this variable is nil. This variable is experimental; email 32252@debbugs.gnu.org if you need -- 2.17.1 --------------00F2E106D578633E4F6A90CF-- From unknown Mon Aug 18 02:33:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 08 Apr 2019 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator