APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1293912524 0
# Node ID 47298dcf2e8f5c682b0de506fe079c93d9e639d1
# Parent d0bb90d90736edce79c191c51c5592f8ee49ced7
Be more helpful in printing ephemerons, weak lists, and weak boxes.
2011-01-01 Aidan Kehoe <kehoea(a)parhasard.net>
* data.c (print_ephemeron, print_weak_list, print_weak_box):
Be more helpful in printing these structures; show their contents,
print their UIDs so it's possible to distinguish between them.
diff -r d0bb90d90736 -r 47298dcf2e8f src/ChangeLog
--- a/src/ChangeLog Thu Dec 30 13:46:50 2010 +0000
+++ b/src/ChangeLog Sat Jan 01 20:08:44 2011 +0000
@@ -1,3 +1,9 @@
+2011-01-01 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * data.c (print_ephemeron, print_weak_list, print_weak_box):
+ Be more helpful in printing these structures; show their contents,
+ print their UIDs so it's possible to distinguish between them.
+
2010-12-30 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.h (DECLARE_N_KEYWORDS_8, DECLARE_N_KEYWORDS_9)
diff -r d0bb90d90736 -r 47298dcf2e8f src/data.c
--- a/src/data.c Thu Dec 30 13:46:50 2010 +0000
+++ b/src/data.c Sat Jan 01 20:08:44 2011 +0000
@@ -2612,14 +2612,19 @@
static void
print_weak_list (Lisp_Object obj, Lisp_Object printcharfun,
- int UNUSED (escapeflag))
+ int escapeflag)
{
if (print_readably)
- printing_unreadable_lisp_object (obj, 0);
+ {
+ printing_unreadable_lisp_object (obj, 0);
+ }
- write_fmt_string_lisp (printcharfun, "#<weak-list %s %S>", 2,
- encode_weak_list_type (XWEAK_LIST (obj)->type),
- XWEAK_LIST (obj)->list);
+ write_ascstring (printcharfun, "#<weak-list :type ");
+ print_internal (encode_weak_list_type (XWEAK_LIST (obj)->type),
+ printcharfun, escapeflag);
+ write_ascstring (printcharfun, " :list ");
+ print_internal (XWEAK_LIST (obj)->list, printcharfun, escapeflag);
+ write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj));
}
static int
@@ -3087,12 +3092,16 @@
}
static void
-print_weak_box (Lisp_Object obj, Lisp_Object printcharfun,
- int UNUSED (escapeflag))
+print_weak_box (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
if (print_readably)
- printing_unreadable_lisp_object (obj, 0);
- write_fmt_string (printcharfun, "#<weak-box>"); /* #### fix */
+ {
+ printing_unreadable_lisp_object (obj, 0);
+ }
+
+ write_ascstring (printcharfun, "#<weak-box ");
+ print_internal (XWEAK_BOX (obj)->value, printcharfun, escapeflag);
+ write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj));
}
static int
@@ -3309,12 +3318,20 @@
}
static void
-print_ephemeron (Lisp_Object obj, Lisp_Object printcharfun,
- int UNUSED (escapeflag))
+print_ephemeron (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
if (print_readably)
- printing_unreadable_lisp_object (obj, 0);
- write_fmt_string (printcharfun, "#<ephemeron>"); /* #### fix */
+ {
+ printing_unreadable_lisp_object (obj, 0);
+ }
+
+ write_ascstring (printcharfun, "#<ephemeron :key ");
+ print_internal (XEPHEMERON (obj)->key, printcharfun, escapeflag);
+ write_ascstring (printcharfun, " :value ");
+ print_internal (XEPHEMERON (obj)->value, printcharfun, escapeflag);
+ write_ascstring (printcharfun, " :finalizer ");
+ print_internal (XEPHEMERON_FINALIZER (obj), printcharfun, escapeflag);
+ write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj));
}
static int
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches