From unknown Mon Aug 18 04:45:15 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#5082: 23.1.50; print-circle and make-hash-table Reply-To: =?UTF-8?Q?=E5=B7=9D=E5=B9=A1=E5=A4=AA=E4=B8=80?= , 5082@debbugs.gnu.org Resent-From: =?UTF-8?Q?=E5=B7=9D=E5=B9=A1=E5=A4=AA=E4=B8=80?= Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 30 Nov 2009 15:15:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 5082 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125959377521452 (code B ref -1); Mon, 30 Nov 2009 15:15:04 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 30 Nov 2009 15:09:35 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL,GMAIL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAUF9Y0X021448 for ; Mon, 30 Nov 2009 07:09:35 -0800 Received: from mx10.gnu.org ([199.232.76.166]:45564) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1NF7sb-0001BP-1H for emacs-pretest-bug@gnu.org; Mon, 30 Nov 2009 10:09:33 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NF7sa-000360-Fh for emacs-pretest-bug@gnu.org; Mon, 30 Nov 2009 10:09:33 -0500 Received: from mail-bw0-f215.google.com ([209.85.218.215]:58726) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NF7sa-00035o-5I for emacs-pretest-bug@gnu.org; Mon, 30 Nov 2009 10:09:32 -0500 Received: by bwz7 with SMTP id 7so2103178bwz.26 for ; Mon, 30 Nov 2009 07:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=OFRdpCAbDWfJY30h8EGDVQvwJ/4/+5gXb1zCde40aio=; b=u4a3D5idnnUWzPYF3JGklPPIA7zTWhRjklN/dRzMONL9vLq3M6H3+kEUsdmqZvuz45 yOroQxsemX7wya7TSer2d0YZF2Q0VrdoQmo+ZaEWu4/9Vm+NQl58/06TQXCyBxsae5gH 3Cie0g/x+6KHSCZx61waslnCK0Feq5lzAo980= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=x7ZFHird/cEa8gBQiiWaYEdUmTU4cVpfM9l6cK8djtIE9H+ZX6wR/kZM69VZMwDdp2 GGSvyXj47DKT76k1IZxhg8a0CDXwvONn2giSBrvzGbK2TIOvkDRn1vjPTBxsMWOLNo1q OQ2Xo+MDLYaBTXRVqeq+oxdraxlyctKurNHJA= MIME-Version: 1.0 Received: by 10.204.148.71 with SMTP id o7mr748252bkv.144.1259593770264; Mon, 30 Nov 2009 07:09:30 -0800 (PST) Date: Tue, 1 Dec 2009 00:09:30 +0900 Message-ID: <270879b0911300709o29a12798m2ae6c6194c25e53@mail.gmail.com> From: =?UTF-8?Q?=E5=B7=9D=E5=B9=A1=E5=A4=AA=E4=B8=80?= To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Dear Emacs Developers, I've found an Emacs behavior that seems a bug concerning to `print-circle' and make-hash-table, so I would like to report it. By setting `print-circle' to `t', printing Lisp Object with recursive or repetitive list should be displayed as #N= and #N# syntax. However, it seems this is not true when printing lisp objects within hash tables (which become possible in Emacs 23.1.50.) Following is an example. Is it possible to display the repetitive lisp object within printed hash tables by #N= and #N# syntax, when `print-circle' is set to `t'? I notify this behavior as a bug, but it may not be so. I apologize in that case. (let ((print-circle t) (x (list 10 20)) (y (make-hash-table))) (insert (format "%S\n" (list x x))) (puthash 1 x y) (puthash 2 x y) (insert (format "%S\n" y)) (setcar x 3) (insert (format "%S\n" y))) Result: > (#1=(10 20) #1#) > #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 > data (1 (10 20) 2 (10 20))) > #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 > data (1 (3 20) 2 (3 20))) nil Cordially Yours, -- ---------------------------------------------------------------------  KAWABATA, Taichi   E-mail: kawabata.taichi@gmail.com From unknown Mon Aug 18 04:45:15 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: =?UTF-8?Q?=E5=B7=9D=E5=B9=A1=E5=A4=AA=E4=B8=80?= Subject: bug#5082 closed by Stefan Monnier (Re: bug#5082: 23.1.50; print-circle and make-hash-table) Message-ID: References: <270879b0911300709o29a12798m2ae6c6194c25e53@mail.gmail.com> X-Emacs-PR-Message: they-closed 5082 X-Emacs-PR-Package: emacs Reply-To: 5082@debbugs.gnu.org Date: Mon, 30 Nov 2009 21:15:05 +0000 Content-Type: multipart/mixed; boundary="----------=_1259615705-27141-1" This is a multi-part message in MIME format... ------------=_1259615705-27141-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #5082: 23.1.50; print-circle and make-hash-table It has been closed by Stefan Monnier . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Stefan Monnier by replying to this email. --=20 5082: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D5082 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1259615705-27141-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 5082-done) by emacsbugs.donarmstrong.com; 30 Nov 2009 21:08:41 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.8 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAUL8dlK026683 for <5082-done@emacsbugs.donarmstrong.com>; Mon, 30 Nov 2009 13:08:41 -0800 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nAUL8cEc029407; Mon, 30 Nov 2009 16:08:39 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id D91E93A280; Mon, 30 Nov 2009 16:08:38 -0500 (EST) From: Stefan Monnier To: =?utf-8?B?5bed5bmh5aSq5LiA?= Subject: Re: bug#5082: 23.1.50; print-circle and make-hash-table Message-ID: References: <270879b0911300709o29a12798m2ae6c6194c25e53@mail.gmail.com> Date: Mon, 30 Nov 2009 16:08:38 -0500 In-Reply-To: <270879b0911300709o29a12798m2ae6c6194c25e53@mail.gmail.com> (=?utf-8?B?IuW3neW5oQnlpKrkuIAiJ3M=?= message of "Tue, 1 Dec 2009 00:09:30 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3417=0 > I've found an Emacs behavior that seems a bug concerning to `print-circle' > and make-hash-table, so I would like to report it. Thanks for catching this bug and for the clear testcase. I've installed the patch below which should fix it. Stefan === modified file 'src/print.c' --- src/print.c 2009-11-24 15:30:54 +0000 +++ src/print.c 2009-11-30 21:03:36 +0000 @@ -1420,6 +1420,13 @@ size &= PSEUDOVECTOR_SIZE_MASK; for (i = 0; i < size; i++) print_preprocess (XVECTOR (obj)->contents[i]); + if (HASH_TABLE_P (obj)) + { /* For hash tables, the key_and_value slot is past + `size' because it needs to be marked specially in case + the table is weak. */ + struct Lisp_Hash_Table *h = XHASH_TABLE (obj); + print_preprocess (h->key_and_value); + } break; default: ------------=_1259615705-27141-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 30 Nov 2009 15:09:35 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL,GMAIL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAUF9Y0X021448 for ; Mon, 30 Nov 2009 07:09:35 -0800 Received: from mx10.gnu.org ([199.232.76.166]:45564) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1NF7sb-0001BP-1H for emacs-pretest-bug@gnu.org; Mon, 30 Nov 2009 10:09:33 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NF7sa-000360-Fh for emacs-pretest-bug@gnu.org; Mon, 30 Nov 2009 10:09:33 -0500 Received: from mail-bw0-f215.google.com ([209.85.218.215]:58726) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NF7sa-00035o-5I for emacs-pretest-bug@gnu.org; Mon, 30 Nov 2009 10:09:32 -0500 Received: by bwz7 with SMTP id 7so2103178bwz.26 for ; Mon, 30 Nov 2009 07:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=OFRdpCAbDWfJY30h8EGDVQvwJ/4/+5gXb1zCde40aio=; b=u4a3D5idnnUWzPYF3JGklPPIA7zTWhRjklN/dRzMONL9vLq3M6H3+kEUsdmqZvuz45 yOroQxsemX7wya7TSer2d0YZF2Q0VrdoQmo+ZaEWu4/9Vm+NQl58/06TQXCyBxsae5gH 3Cie0g/x+6KHSCZx61waslnCK0Feq5lzAo980= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=x7ZFHird/cEa8gBQiiWaYEdUmTU4cVpfM9l6cK8djtIE9H+ZX6wR/kZM69VZMwDdp2 GGSvyXj47DKT76k1IZxhg8a0CDXwvONn2giSBrvzGbK2TIOvkDRn1vjPTBxsMWOLNo1q OQ2Xo+MDLYaBTXRVqeq+oxdraxlyctKurNHJA= MIME-Version: 1.0 Received: by 10.204.148.71 with SMTP id o7mr748252bkv.144.1259593770264; Mon, 30 Nov 2009 07:09:30 -0800 (PST) Date: Tue, 1 Dec 2009 00:09:30 +0900 Message-ID: <270879b0911300709o29a12798m2ae6c6194c25e53@mail.gmail.com> Subject: 23.1.50; print-circle and make-hash-table From: =?ISO-2022-JP?B?GyRCQG5IKEJAMGwbKEI=?= To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Dear Emacs Developers, I've found an Emacs behavior that seems a bug concerning to `print-circle' and make-hash-table, so I would like to report it. By setting `print-circle' to `t', printing Lisp Object with recursive or repetitive list should be displayed as #N= and #N# syntax. However, it seems this is not true when printing lisp objects within hash tables (which become possible in Emacs 23.1.50.) Following is an example. Is it possible to display the repetitive lisp object within printed hash tables by #N= and #N# syntax, when `print-circle' is set to `t'? I notify this behavior as a bug, but it may not be so. I apologize in that case. (let ((print-circle t) (x (list 10 20)) (y (make-hash-table))) (insert (format "%S\n" (list x x))) (puthash 1 x y) (puthash 2 x y) (insert (format "%S\n" y)) (setcar x 3) (insert (format "%S\n" y))) Result: > (#1=(10 20) #1#) > #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 > data (1 (10 20) 2 (10 20))) > #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 > data (1 (3 20) 2 (3 20))) nil Cordially Yours, -- ---------------------------------------------------------------------  KAWABATA, Taichi   E-mail: kawabata.taichi@gmail.com ------------=_1259615705-27141-1--