GNU bug report logs -
#5082
23.1.50; print-circle and make-hash-table
Previous Next
Reported by: 川幡太一 <kawabata.taichi <at> gmail.com>
Date: Mon, 30 Nov 2009 15:15:04 UTC
Severity: normal
Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5082 in the body.
You can then email your comments to 5082 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#5082
; Package
emacs
.
(Mon, 30 Nov 2009 15:15:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
川幡太一 <kawabata.taichi <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 30 Nov 2009 15:15:04 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
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 <at> gmail.com
Reply sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
You have taken responsibility.
(Mon, 30 Nov 2009 21:15:05 GMT)
Full text and
rfc822 format available.
Notification sent
to
川幡太一 <kawabata.taichi <at> gmail.com>
:
bug acknowledged by developer.
(Mon, 30 Nov 2009 21:15:05 GMT)
Full text and
rfc822 format available.
Message #10 received at 5082-done <at> emacsbugs.donarmstrong.com (full text, mbox):
> 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:
bug archived.
Request was from
Debbugs Internal Request <bug-gnu-emacs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 29 Dec 2009 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 years and 234 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.