Mercurial > hg > xemacs-beta
comparison src/print.c @ 563:183866b06e0b
[xemacs-hg @ 2001-05-24 07:50:48 by ben]
Makefile.in.in, abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, casetab.c, chartab.c, cmdloop.c, cmds.c, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console.c, data.c, database.c, debug.c, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, dired.c, doc.c, doprnt.c, dragdrop.c, editfns.c, eldap.c, eldap.h, elhash.c, emacs-widget-accessors.c, emacs.c, emodules.c, esd.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, filelock.c, floatfns.c, fns.c, font-lock.c, frame-gtk.c, frame-x.c, frame.c, general-slots.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-gtk.c, gui-x.c, gui.c, gutter.c, hpplay.c, indent.c, input-method-xlib.c, insdel.c, intl.c, keymap.c, libsst.c, libsst.h, linuxplay.c, lisp.h, lread.c, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, miscplay.c, miscplay.h, mule-ccl.c, mule-charset.c, mule-wnnfns.c, mule.c, nas.c, ntplay.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, ralloc.c, rangetab.c, redisplay.c, scrollbar.c, search.c, select-gtk.c, select-x.c, select.c, sgiplay.c, sheap.c, sound.c, specifier.c, sunplay.c, symbols.c, symeval.h, symsinit.h, syntax.c, sysdep.c, toolbar-msw.c, toolbar.c, tooltalk.c, ui-byhand.c, ui-gtk.c, undo.c, unexaix.c, unexapollo.c, unexconvex.c, unexec.c, widget.c, win32.c, window.c:
-- defsymbol -> DEFSYMBOL.
-- add an error type to all errors.
-- eliminate the error functions in eval.c that let you just
use Qerror as the type.
-- redo the error API to be more consistent, sensibly named,
and easier to use.
-- redo the error hierarchy somewhat. create new errors:
structure-formation-error, gui-error, invalid-constant,
stack-overflow, out-of-memory, process-error, network-error,
sound-error, printing-unreadable-object, base64-conversion-
error; coding-system-error renamed to text-conversion error;
some others.
-- fix Mule problems in error strings in emodules.c, tooltalk.c.
-- fix error handling in mswin open-network-stream.
-- Mule-ize all sound files and clean up the headers.
-- nativesound.h -> sound.h and used for all sound files.
-- move some shared stuff into glyphs-shared.c: first attempt
at eliminating some of the massive GTK code duplication.
xemacs.mak: add glyphs-shared.c.
xemacs-faq.texi: document how to debug X errors
subr.el: fix doc string to reflect reality
author | ben |
---|---|
date | Thu, 24 May 2001 07:51:33 +0000 |
parents | 1ccc32a20af4 |
children | 4326eeed6933 |
comparison
equal
deleted
inserted
replaced
562:c775bd016b32 | 563:183866b06e0b |
---|---|
782 print_internal (LISP_GETTEXT (errmsg), stream, 0); | 782 print_internal (LISP_GETTEXT (errmsg), stream, 0); |
783 } | 783 } |
784 while (!NILP (tail)) | 784 while (!NILP (tail)) |
785 { | 785 { |
786 write_c_string (first ? ": " : ", ", stream); | 786 write_c_string (first ? ": " : ", ", stream); |
787 print_internal (Fcar (tail), stream, 1); | 787 /* Most errors have an explanatory string as their first argument, |
788 and it looks better not to put the quotes around it. */ | |
789 print_internal (Fcar (tail), stream, | |
790 !(first && STRINGP (Fcar (tail))) || | |
791 !NILP (Fget (type, Qerror_lacks_explanatory_string, | |
792 Qnil))); | |
788 tail = Fcdr (tail); | 793 tail = Fcdr (tail); |
789 first = 0; | 794 first = 0; |
790 } | 795 } |
791 print_finish (stream, frame); | 796 print_finish (stream, frame); |
792 UNGCPRO; | 797 UNGCPRO; |
1060 if (len > 0) | 1065 if (len > 0) |
1061 write_char_internal (" ", printcharfun); | 1066 write_char_internal (" ", printcharfun); |
1062 if (EQ (obj, tortoise) && len > 0) | 1067 if (EQ (obj, tortoise) && len > 0) |
1063 { | 1068 { |
1064 if (print_readably) | 1069 if (print_readably) |
1065 error ("printing unreadable circular list"); | 1070 printing_unreadable_object ("circular list"); |
1066 else | 1071 else |
1067 write_c_string ("... <circular list>", printcharfun); | 1072 write_c_string ("... <circular list>", printcharfun); |
1068 break; | 1073 break; |
1069 } | 1074 } |
1070 if (len & 1) | 1075 if (len & 1) |
1174 struct lcrecord_header *header = | 1179 struct lcrecord_header *header = |
1175 (struct lcrecord_header *) XPNTR (obj); | 1180 (struct lcrecord_header *) XPNTR (obj); |
1176 char buf[200]; | 1181 char buf[200]; |
1177 | 1182 |
1178 if (print_readably) | 1183 if (print_readably) |
1179 error ("printing unreadable object #<%s 0x%x>", | 1184 printing_unreadable_object |
1180 LHEADER_IMPLEMENTATION (&header->lheader)->name, | 1185 ("#<%s 0x%x>", |
1181 header->uid); | 1186 LHEADER_IMPLEMENTATION (&header->lheader)->name, |
1187 header->uid); | |
1182 | 1188 |
1183 sprintf (buf, "#<%s 0x%x>", | 1189 sprintf (buf, "#<%s 0x%x>", |
1184 LHEADER_IMPLEMENTATION (&header->lheader)->name, | 1190 LHEADER_IMPLEMENTATION (&header->lheader)->name, |
1185 header->uid); | 1191 header->uid); |
1186 write_c_string (buf, printcharfun); | 1192 write_c_string (buf, printcharfun); |
1237 | 1243 |
1238 being_printed[print_depth] = obj; | 1244 being_printed[print_depth] = obj; |
1239 print_depth++; | 1245 print_depth++; |
1240 | 1246 |
1241 if (print_depth > PRINT_CIRCLE) | 1247 if (print_depth > PRINT_CIRCLE) |
1242 error ("Apparently circular structure being printed"); | 1248 signal_error (Qstack_overflow, "Apparently circular structure being printed", Qunbound); |
1243 | 1249 |
1244 switch (XTYPE (obj)) | 1250 switch (XTYPE (obj)) |
1245 { | 1251 { |
1246 case Lisp_Type_Int_Even: | 1252 case Lisp_Type_Int_Even: |
1247 case Lisp_Type_Int_Odd: | 1253 case Lisp_Type_Int_Odd: |
1353 abort (); | 1359 abort (); |
1354 #else /* not ERROR_CHECK_TYPECHECK */ | 1360 #else /* not ERROR_CHECK_TYPECHECK */ |
1355 char buf[128]; | 1361 char buf[128]; |
1356 /* We're in trouble if this happens! */ | 1362 /* We're in trouble if this happens! */ |
1357 if (print_readably) | 1363 if (print_readably) |
1358 error ("printing illegal data type #o%03o", | 1364 ty(e_error (Qinternal_error, "printing illegal data type #o%03o", |
1359 (int) XTYPE (obj)); | 1365 (int) XTYPE (obj)); |
1360 write_c_string ("#<EMACS BUG: ILLEGAL DATATYPE ", | 1366 write_c_string ("#<EMACS BUG: ILLEGAL DATATYPE ", |
1361 printcharfun); | 1367 printcharfun); |
1362 sprintf (buf, "(#o%3o)", (int) XTYPE (obj)); | 1368 sprintf (buf, "(#o%3o)", (int) XTYPE (obj)); |
1363 write_c_string (buf, printcharfun); | 1369 write_c_string (buf, printcharfun); |
1364 write_c_string | 1370 write_c_string |
1576 else | 1582 else |
1577 { | 1583 { |
1578 CHECK_LIVE_DEVICE (device); | 1584 CHECK_LIVE_DEVICE (device); |
1579 if (!DEVICE_TTY_P (XDEVICE (device)) && | 1585 if (!DEVICE_TTY_P (XDEVICE (device)) && |
1580 !DEVICE_STREAM_P (XDEVICE (device))) | 1586 !DEVICE_STREAM_P (XDEVICE (device))) |
1581 signal_simple_error ("Must be tty or stream device", device); | 1587 wtaerror ("Must be tty or stream device", device); |
1582 con = XCONSOLE (DEVICE_CONSOLE (XDEVICE (device))); | 1588 con = XCONSOLE (DEVICE_CONSOLE (XDEVICE (device))); |
1583 if (DEVICE_TTY_P (XDEVICE (device))) | 1589 if (DEVICE_TTY_P (XDEVICE (device))) |
1584 file = 0; | 1590 file = 0; |
1585 else if (!NILP (stdout_p)) | 1591 else if (!NILP (stdout_p)) |
1586 file = CONSOLE_STREAM_DATA (con)->out; | 1592 file = CONSOLE_STREAM_DATA (con)->out; |
1622 if (! NILP (filename)) | 1628 if (! NILP (filename)) |
1623 { | 1629 { |
1624 filename = Fexpand_file_name (filename, Qnil); | 1630 filename = Fexpand_file_name (filename, Qnil); |
1625 termscript = fopen ((char *) XSTRING_DATA (filename), "w"); | 1631 termscript = fopen ((char *) XSTRING_DATA (filename), "w"); |
1626 if (termscript == NULL) | 1632 if (termscript == NULL) |
1627 report_file_error ("Opening termscript", list1 (filename)); | 1633 report_file_error ("Opening termscript", filename); |
1628 } | 1634 } |
1629 return Qnil; | 1635 return Qnil; |
1630 } | 1636 } |
1631 | 1637 |
1632 #if 1 | 1638 #if 1 |
1768 | 1774 |
1769 | 1775 |
1770 void | 1776 void |
1771 syms_of_print (void) | 1777 syms_of_print (void) |
1772 { | 1778 { |
1773 defsymbol (&Qstandard_output, "standard-output"); | 1779 DEFSYMBOL (Qstandard_output); |
1774 | 1780 |
1775 defsymbol (&Qprint_length, "print-length"); | 1781 DEFSYMBOL (Qprint_length); |
1776 | 1782 |
1777 defsymbol (&Qprint_string_length, "print-string-length"); | 1783 DEFSYMBOL (Qprint_string_length); |
1778 | 1784 |
1779 defsymbol (&Qdisplay_error, "display-error"); | 1785 DEFSYMBOL (Qdisplay_error); |
1780 defsymbol (&Qprint_message_label, "print-message-label"); | 1786 DEFSYMBOL (Qprint_message_label); |
1781 | 1787 |
1782 DEFSUBR (Fprin1); | 1788 DEFSUBR (Fprin1); |
1783 DEFSUBR (Fprin1_to_string); | 1789 DEFSUBR (Fprin1_to_string); |
1784 DEFSUBR (Fprinc); | 1790 DEFSUBR (Fprinc); |
1785 DEFSUBR (Fprint); | 1791 DEFSUBR (Fprint); |
1788 DEFSUBR (Fterpri); | 1794 DEFSUBR (Fterpri); |
1789 DEFSUBR (Fwrite_char); | 1795 DEFSUBR (Fwrite_char); |
1790 DEFSUBR (Falternate_debugging_output); | 1796 DEFSUBR (Falternate_debugging_output); |
1791 DEFSUBR (Fexternal_debugging_output); | 1797 DEFSUBR (Fexternal_debugging_output); |
1792 DEFSUBR (Fopen_termscript); | 1798 DEFSUBR (Fopen_termscript); |
1793 defsymbol (&Qexternal_debugging_output, "external-debugging-output"); | 1799 DEFSYMBOL (Qexternal_debugging_output); |
1794 defsymbol (&Qalternate_debugging_output, "alternate-debugging-output"); | 1800 DEFSYMBOL (Qalternate_debugging_output); |
1795 #ifdef HAVE_MS_WINDOWS | 1801 #ifdef HAVE_MS_WINDOWS |
1796 defsymbol (&Qmswindows_debugging_output, "mswindows-debugging-output"); | 1802 DEFSYMBOL (Qmswindows_debugging_output); |
1797 #endif | 1803 #endif |
1798 DEFSUBR (Fwith_output_to_temp_buffer); | 1804 DEFSUBR (Fwith_output_to_temp_buffer); |
1799 } | 1805 } |
1800 | 1806 |
1801 void | 1807 void |