summaryrefslogtreecommitdiff
path: root/src/print.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2021-11-06 13:58:52 +0800
committerLars Ingebrigtsen <larsi@gnus.org>2021-11-07 02:59:41 +0100
commitcd1f02e1e39c187f795f7b09aa5baee22f5b058d (patch)
tree2596cb09c607cef5acc263fb71e5bc0db40f9396 /src/print.c
parenteb5a079feed99379dacf8c6ced449a65e8069c4b (diff)
downloademacs-cd1f02e1e39c187f795f7b09aa5baee22f5b058d.tar.gz
Make xwidgets print nicer
* src/print.c (print_vectorlike): Print xwidgets with ID and widget pointer, and print xwidget views separately.
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/print.c b/src/print.c
index c13294c8e62..eca389158f9 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1521,8 +1521,20 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag,
printchar ('>', printcharfun);
break;
- case PVEC_XWIDGET: case PVEC_XWIDGET_VIEW:
- print_c_string ("#<xwidget ", printcharfun);
+ case PVEC_XWIDGET:
+#ifdef HAVE_XWIDGETS
+ {
+ int len = sprintf (buf, "#<xwidget %u %p>",
+ XXWIDGET (obj)->xwidget_id,
+ XXWIDGET (obj)->widget_osr);
+ strout (buf, len, len, printcharfun);
+ break;
+ }
+#else
+ emacs_abort ();
+#endif
+ case PVEC_XWIDGET_VIEW:
+ print_c_string ("#<xwidget view", printcharfun);
printchar ('>', printcharfun);
break;