Mercurial > hg > xemacs-beta
comparison src/window.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 | 1d61580e0cf7 |
children | 8b63e21b0436 |
comparison
equal
deleted
inserted
replaced
4845:a3c673c0720b | 4846:a98ca4640147 |
---|---|
311 | 311 |
312 static void | 312 static void |
313 print_window (Lisp_Object obj, Lisp_Object printcharfun, | 313 print_window (Lisp_Object obj, Lisp_Object printcharfun, |
314 int UNUSED (escapeflag)) | 314 int UNUSED (escapeflag)) |
315 { | 315 { |
316 Lisp_Object buf; | |
317 | |
316 if (print_readably) | 318 if (print_readably) |
317 printing_unreadable_object ("#<window 0x%x>", XWINDOW (obj)->header.uid); | 319 printing_unreadable_lcrecord (obj, 0); |
318 | 320 |
319 write_c_string (printcharfun, "#<window"); | 321 write_c_string (printcharfun, "#<window"); |
320 if (!NILP (XWINDOW (obj)->buffer)) | 322 buf = XWINDOW_BUFFER (obj); |
321 { | 323 if (EQ (buf, Qt)) |
322 Lisp_Object name = XBUFFER (XWINDOW (obj)->buffer)->name; | 324 write_c_string (printcharfun, " during creation"); |
325 else if (!NILP (buf)) | |
326 { | |
327 | |
328 Lisp_Object name = XBUFFER (buf)->name; | |
323 write_fmt_string_lisp (printcharfun, " on %S", 1, name); | 329 write_fmt_string_lisp (printcharfun, " on %S", 1, name); |
324 } | 330 } |
325 write_fmt_string (printcharfun, " 0x%x>", XWINDOW (obj)->header.uid); | 331 write_fmt_string (printcharfun, " 0x%x>", XWINDOW (obj)->header.uid); |
326 } | 332 } |
327 | 333 |