]> git.eshelyaron.com Git - emacs.git/commitdiff
Print dead xwidgets specially
authorPo Lu <luangruo@yahoo.com>
Sat, 1 Jan 2022 00:54:51 +0000 (08:54 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 1 Jan 2022 00:54:51 +0000 (08:54 +0800)
* src/print.c (print_vectorlike) <PVEC_XWIDGET>: Print "killed
xwidget" for dead xwidgets.

src/print.c

index 214f1d12c111594cf8a07d950878c75f2927ea31..9f3d8317ae3926a7b0bc6e3c4abcd9f378f374e5 100644 (file)
@@ -1524,16 +1524,21 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag,
     case PVEC_XWIDGET:
 #ifdef HAVE_XWIDGETS
       {
+       if (NILP (XXWIDGET (obj)->buffer))
+         print_c_string ("#<killed xwidget>", printcharfun);
+       else
+         {
 #ifdef USE_GTK
-       int len = sprintf (buf, "#<xwidget %u %p>",
-                          XXWIDGET (obj)->xwidget_id,
-                          XXWIDGET (obj)->widget_osr);
+           int len = sprintf (buf, "#<xwidget %u %p>",
+                              XXWIDGET (obj)->xwidget_id,
+                              XXWIDGET (obj)->widget_osr);
 #else
-       int len = sprintf (buf, "#<xwidget %u %p>",
-                          XXWIDGET (obj)->xwidget_id,
-                          XXWIDGET (obj)->xwWidget);
+           int len = sprintf (buf, "#<xwidget %u %p>",
+                              XXWIDGET (obj)->xwidget_id,
+                              XXWIDGET (obj)->xwWidget);
 #endif
-       strout (buf, len, len, printcharfun);
+           strout (buf, len, len, printcharfun);
+         }
        break;
       }
 #else