comparison src/objects.c @ 4846:a98ca4640147

clean up object print methods casetab.c, console.c, data.c, database.c, device-msw.c, device.c, eval.c, file-coding.c, frame.c, glyphs.c, gui.c, keymap.c, lisp.h, mule-charset.c, objects.c, print.c, process.c, tooltalk.c, ui-gtk.c, window.c: New function printing_unreadable_lcrecord(). Automatically prints the type name and pointer value of the object. Use it instead of printing_unreadable_object(); make that latter function local to print.c. window.c: During creation, window may have Qt as its buffer. Don't crash if trying to print such a window.
author Ben Wing <ben@xemacs.org>
date Wed, 13 Jan 2010 05:49:13 -0600
parents a23ac8f90a49
children 6ef8256a020a
comparison
equal deleted inserted replaced
4845:a3c673c0720b 4846:a98ca4640147
100 print_color_instance (Lisp_Object obj, Lisp_Object printcharfun, 100 print_color_instance (Lisp_Object obj, Lisp_Object printcharfun,
101 int escapeflag) 101 int escapeflag)
102 { 102 {
103 Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj); 103 Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
104 if (print_readably) 104 if (print_readably)
105 printing_unreadable_object ("#<color-instance 0x%x>", 105 printing_unreadable_lcrecord (obj, 0);
106 c->header.uid);
107 write_fmt_string_lisp (printcharfun, "#<color-instance %s", 1, c->name); 106 write_fmt_string_lisp (printcharfun, "#<color-instance %s", 1, c->name);
108 write_fmt_string_lisp (printcharfun, " on %s", 1, c->device); 107 write_fmt_string_lisp (printcharfun, " on %s", 1, c->device);
109 if (!NILP (c->device)) /* Vthe_null_color_instance */ 108 if (!NILP (c->device)) /* Vthe_null_color_instance */
110 MAYBE_DEVMETH (XDEVICE (c->device), print_color_instance, 109 MAYBE_DEVMETH (XDEVICE (c->device), print_color_instance,
111 (c, printcharfun, escapeflag)); 110 (c, printcharfun, escapeflag));
317 static void 316 static void
318 print_font_instance (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 317 print_font_instance (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
319 { 318 {
320 Lisp_Font_Instance *f = XFONT_INSTANCE (obj); 319 Lisp_Font_Instance *f = XFONT_INSTANCE (obj);
321 if (print_readably) 320 if (print_readably)
322 printing_unreadable_object ("#<font-instance 0x%x>", f->header.uid); 321 printing_unreadable_lcrecord (obj, 0);
323 write_fmt_string_lisp (printcharfun, "#<font-instance %S", 1, f->name); 322 write_fmt_string_lisp (printcharfun, "#<font-instance %S", 1, f->name);
324 write_fmt_string_lisp (printcharfun, " on %s", 1, f->device); 323 write_fmt_string_lisp (printcharfun, " on %s", 1, f->device);
325 if (!NILP (f->device)) 324 if (!NILP (f->device))
326 { 325 {
327 MAYBE_DEVMETH (XDEVICE (f->device), print_font_instance, 326 MAYBE_DEVMETH (XDEVICE (f->device), print_font_instance,