# HG changeset patch # User ben # Date 990690693 0 # Node ID 183866b06e0b35171d733cc8120dfd6496198eae # Parent c775bd016b32afc202a552fd65cbbaef7dbf2843 [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 diff -r c775bd016b32 -r 183866b06e0b lisp/ChangeLog --- a/lisp/ChangeLog Thu May 24 06:30:21 2001 +0000 +++ b/lisp/ChangeLog Thu May 24 07:51:33 2001 +0000 @@ -1,3 +1,9 @@ +2001-05-24 Ben Wing + + * subr.el: + * subr.el (error): + fix doc string to reflect reality + 2001-05-23 Ben Wing * behavior-defs.el: diff -r c775bd016b32 -r 183866b06e0b lisp/subr.el --- a/lisp/subr.el Thu May 24 06:30:21 2001 +0000 +++ b/lisp/subr.el Thu May 24 07:51:33 2001 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 1985, 1986, 1992, 1994-5, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. ;; Copyright (C) 1995 Sun Microsystems. -;; Copyright (C) 2000 Ben Wing. +;; Copyright (C) 2000, 2001 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: extensions, dumped @@ -625,38 +625,42 @@ totally defeats the purpose of having structured errors. There is now a rich set of defined errors you can use: +quit + error - syntax-error - invalid-read-syntax - list-formation-error - malformed-list - malformed-property-list - circular-list - circular-property-list - invalid-regexp - specifier-syntax-error - invalid-argument + syntax-error + invalid-read-syntax + invalid-regexp + structure-formation-error + list-formation-error + malformed-list + malformed-property-list + circular-list + circular-property-list + invalid-function + no-catch + undefined-keystroke-sequence + invalid-constant wrong-type-argument args-out-of-range wrong-number-of-arguments - invalid-function - no-catch - undefined-keystroke-sequence - specifier-argument-error invalid-state void-function cyclic-function-indirection void-variable cyclic-variable-indirection - protected-field invalid-byte-code + stack-overflow + out-of-memory + invalid-key-binding + internal-error invalid-operation invalid-change setting-constant - specifier-change-error + protected-field editing-error beginning-of-buffer end-of-buffer @@ -666,32 +670,37 @@ file-already-exists file-locked file-supersession - end-of-file - coding-system-error - image-conversion-error + end-of-file + process-error + network-error tooltalk-error + gui-error + dialog-box-error + sound-error + conversion-error + text-conversion-error + image-conversion-error + base64-conversion-error + selection-conversion-error arith-error range-error domain-error singularity-error overflow-error underflow-error - dialog-box-error search-failed - selection-conversion-error + printing-unreadable-object + unimplemented - unimplemented - - internal-error +Note the semantic differences between some of the more common errors: -The five most common errors you will probably use or base your new -errors off of are `syntax-error', `invalid-argument', `invalid-state', -`invalid-operation', and `invalid-change'. Note the semantic differences: - --- `syntax-error' is for errors in complex structures: parsed strings, lists, - and the like. --- `invalid-argument' is for errors in a simple value. Typically, the entire - value, not just one part of it, is wrong. +-- `invalid-argument' is for all cases where a bad value is encountered. +-- `invalid-constant' is for arguments where only a specific set of values + is allowed. +-- `syntax-error' is when complex structures (parsed strings, lists, + and the like) are badly formed. If the problem is just a single bad + value inside the structure, you should probably be using something else, + e.g. `invalid-constant', `wrong-type-argument', or `invalid-argument'. -- `invalid-state' means that some settings have been changed in such a way that their current state is unallowable. More and more, code is being written more carefully, and catches the error when the settings are being @@ -699,9 +708,10 @@ -- `invalid-change' means that an attempt is being made to change some settings into an invalid state. `invalid-change' is a type of `invalid-operation'. -- `invalid-operation' refers to all cases where code is trying to do something - that's disallowed. This includes file errors, buffer errors (e.g. running - off the end of a buffer), `invalid-change' as just mentioned, and - arithmetic errors. + that's disallowed, or when an error occurred during an operation. (These + two concepts are merged because there's no clear distinction between them.) +-- `io-error' refers to errors involving interaction with any external + components (files, other programs, the operating system, etc). See also `cerror', `signal', and `signal-error'." (while t (apply diff -r c775bd016b32 -r 183866b06e0b man/ChangeLog --- a/man/ChangeLog Thu May 24 06:30:21 2001 +0000 +++ b/man/ChangeLog Thu May 24 07:51:33 2001 +0000 @@ -1,3 +1,12 @@ +2001-05-24 Ben Wing + + * xemacs-faq.texi (Top): + * xemacs-faq.texi (Installation): + * xemacs-faq.texi (Q2.1.15): + * xemacs-faq.texi (Q2.1.18): + * xemacs-faq.texi (Q2.1.19): + document how to debug X errors + 2001-05-15 Steve Youngs * xemacs/packages.texi (Local.rules): Update to reflect new dir tree. diff -r c775bd016b32 -r 183866b06e0b man/xemacs-faq.texi --- a/man/xemacs-faq.texi Thu May 24 06:30:21 2001 +0000 +++ b/man/xemacs-faq.texi Thu May 24 07:51:33 2001 +0000 @@ -7,7 +7,7 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2001/04/20 11:32:18 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2001/05/24 07:50:53 $ @sp 1 @author Tony Rossini @author Ben Wing @@ -169,7 +169,7 @@ * Q2.1.15:: How to debug an XEmacs problem with a debugger. * Q2.1.16:: XEmacs crashes in @code{strcat} on HP/UX 10. * Q2.1.17:: @samp{Marker does not point anywhere}. -* Q2.1.18:: [This question intentionally left blank] +* Q2.1.18:: XEmacs is outputting lots of X errors. * Q2.1.19:: XEmacs does not follow the local timezone. * Q2.1.20:: @samp{Symbol's function definition is void: hkey-help-show.} * Q2.1.21:: [This question intentionally left blank] @@ -1224,7 +1224,7 @@ * Q2.1.15:: How to debug an XEmacs problem with a debugger. * Q2.1.16:: XEmacs crashes in @code{strcat} on HP/UX 10. * Q2.1.17:: @samp{Marker does not point anywhere}. -* Q2.1.18:: [This question intentionally left blank] +* Q2.1.18:: XEmacs is outputting lots of X errors. * Q2.1.19:: XEmacs does not follow the local timezone. * Q2.1.20:: @samp{Symbol's function definition is void: hkey-help-show.} * Q2.1.21:: [This question intentionally left blank] @@ -2014,12 +2014,13 @@ @itemize @bullet @item First of all, if the crash is at all reproducible, consider very -strongly recompiling your XEmacs with debugging symbols, with no -optimization, and with the configure options @samp{--debug=yes} and -@samp{--error-checking=all}. This will make your XEmacs run somewhat -slower but make it a lot more likely to catch the problem earlier -(closer to its source), and a lot easier to determine what's going on -with a debugger. +strongly recompiling your XEmacs with debugging symbols and with no +optimization (e.g. with GCC use the compiler flags @samp{-g -O0} -- +that's an "oh" followed by a zero), and with the configure options +@samp{--debug=yes} and @samp{--error-checking=all}. This will make your +XEmacs run somewhat slower but make it a lot more likely to catch the +problem earlier (closer to its source), and a lot easier to determine +what's going on with a debugger. @item If you're able to run XEmacs under a debugger and reproduce the crash @@ -2040,6 +2041,10 @@ declared static in eval.c. @item +If XEmacs is outputting lots of X errors, put a breakpoint on +@code{x_error_handler()}; that will tell you which call is causing them. + +@item Internally, you will probably see lots of variables that hold objects of type @code{Lisp_Object}. These are exactly what they appear to be, i.e. references to Lisp objects. Printing them out with the debugger @@ -2219,7 +2224,11 @@ @end enumerate @node Q2.1.18, Q2.1.19, Q2.1.17, Installation -@unnumberedsubsec Q2.1.18: removed +@unnumberedsubsec Q2.1.18: XEmacs is outputting lots of X errors. + +If this is happening, we would very much like to know what's causing +them. To find this out, @xref{Q2.1.15}. Try to get both a C and Lisp +backtrace, and send them to @email{xemacs-beta@@xemacs.org}. @node Q2.1.19, Q2.1.20, Q2.1.18, Installation @unnumberedsubsec Q2.1.19: XEmacs does not follow the local timezone. diff -r c775bd016b32 -r 183866b06e0b nt/ChangeLog --- a/nt/ChangeLog Thu May 24 06:30:21 2001 +0000 +++ b/nt/ChangeLog Thu May 24 07:51:33 2001 +0000 @@ -1,3 +1,9 @@ +2001-05-24 Ben Wing + + * xemacs.mak (DOC): + * xemacs.mak (TEMACS_OBJS): + add glyphs-shared.c. + 2001-05-23 Ben Wing * xemacs.mak (installation): diff -r c775bd016b32 -r 183866b06e0b nt/xemacs.mak --- a/nt/xemacs.mak Thu May 24 06:30:21 2001 +0000 +++ b/nt/xemacs.mak Thu May 24 07:51:33 2001 +0000 @@ -696,6 +696,7 @@ $(SRC)\getloadavg.c \ $(SRC)\glyphs.c \ $(SRC)\glyphs-eimage.c \ + $(SRC)\glyphs-shared.c \ $(SRC)\glyphs-widget.c \ $(SRC)\gui.c \ $(SRC)\gutter.c \ @@ -987,6 +988,7 @@ $(OUTDIR)\getloadavg.obj \ $(OUTDIR)\glyphs.obj \ $(OUTDIR)\glyphs-eimage.obj \ + $(OUTDIR)\glyphs-shared.obj \ $(OUTDIR)\glyphs-widget.obj \ $(OUTDIR)\gui.obj \ $(OUTDIR)\gutter.obj \ diff -r c775bd016b32 -r 183866b06e0b src/ChangeLog --- a/src/ChangeLog Thu May 24 06:30:21 2001 +0000 +++ b/src/ChangeLog Thu May 24 07:51:33 2001 +0000 @@ -1,3 +1,1783 @@ +2001-05-24 Ben Wing + + * Makefile.in.in (objs): + * abbrev.c (syms_of_abbrev): + * alloc.c (memory_full): + * alloc.c (Fmake_byte_code): + * alloc.c (garbage_collect_1): + * buffer.c: + * buffer.c (print_buffer): + * buffer.c (nsberror): + * buffer.c (Fget_buffer_create): + * buffer.c (Fset_buffer): + * buffer.c (Fbury_buffer): + * buffer.c (syms_of_buffer): + * bytecode.c: + * bytecode.c (execute_optimized_program): + * bytecode.c (invalid_byte_code): + * bytecode.c (check_opcode): + * bytecode.c (check_constants_index): + * bytecode.c (READ_INSTRUCTION_CHAR): + * bytecode.c (optimize_byte_code): + * bytecode.c (Ffetch_bytecode): + * bytecode.c (syms_of_bytecode): + * callint.c (check_mark): + * callint.c (Fcall_interactively): + * callint.c (syms_of_callint): + * callproc.c: + * callproc.c (Fold_call_process_internal): + * callproc.c (child_setup): + * casetab.c (print_case_table): + * casetab.c (Fget_case_table): + * casetab.c (Fput_case_table): + * casetab.c (syms_of_casetab): + * chartab.c (symbol_to_char_table_type): + * chartab.c (decode_char_table_range): + * chartab.c (check_valid_char_table_value): + * chartab.c (chartab_data_validate): + * chartab.c (check_category_char): + * chartab.c (syms_of_chartab): + * cmdloop.c (command_loop_3): + * cmdloop.c (syms_of_cmdloop): + * cmds.c (Fdelete_char): + * cmds.c (Fself_insert_command): + * cmds.c (syms_of_cmds): + * console-msw.c: + * console-msw.c (mswindows_canonicalize_console_connection): + * console-msw.c (Fmswindows_message_box): + * console-msw.c (mswindows_lisp_error): + * console-msw.c (msprinter_canonicalize_console_connection): + * console-msw.c (syms_of_console_mswindows): + * console-msw.h: + * console-stream.c (stream_init_console): + * console-stream.c (stream_init_frame_1): + * console-tty.c (tty_init_console): + * console-tty.c (syms_of_console_tty): + * console-x.c (get_display_arg_connection): + * console.c (print_console): + * console.c (decode_console_type): + * console.c (Fselect_console): + * console.c (Fget_console): + * console.c (delete_console_internal): + * console.c (syms_of_console): + * data.c: + * data.c (dead_wrong_type_argument): + * data.c (c_write_error): + * data.c (lisp_write_error): + * data.c (args_out_of_range): + * data.c (args_out_of_range_3): + * data.c (print_weak_list): + * data.c (decode_weak_list_type): + * data.c (arith_error): + * data.c (init_errors_once_early): + * data.c (syms_of_data): + * database.c (CHECK_LIVE_DATABASE): + * database.c (print_database): + * database.c (finalize_database): + * database.c (Fopen_database): + * database.c (syms_of_database): + * debug.c (Fadd_debug_class_to_check): + * debug.c (Fdelete_debug_class_to_check): + * debug.c (Fset_debug_classes_to_check): + * debug.c (Fset_debug_class_types_to_check): + * debug.c (Fdebug_types_being_checked): + * debug.c (syms_of_debug): + * device-gtk.c (gtk_init_device): + * device-gtk.c (Fgtk_display_visual_class): + * device-gtk.c (Fgtk_keysym_on_keyboard_p): + * device-gtk.c (syms_of_device_gtk): + * device-msw.c (handle_devmode_changes): + * device-msw.c (mswindows_handle_print_dialog_box): + * device-msw.c (mswindows_handle_page_setup_dialog_box): + * device-msw.c (Fmsprinter_select_settings): + * device-msw.c (Fmsprinter_apply_settings): + * device-msw.c (print_devmode): + * device-tty.c (tty_init_device): + * device-tty.c (syms_of_device_tty): + * device-x.c (sanity_check_geometry_resource): + * device-x.c (x_init_device): + * device-x.c (x_get_resource_prefix): + * device-x.c (Fx_get_resource): + * device-x.c (Fx_put_resource): + * device-x.c (Fx_display_visual_class): + * device-x.c (Fx_keysym_hash_table): + * device-x.c (Fx_keysym_on_keyboard_p): + * device-x.c (Fx_get_font_path): + * device-x.c (syms_of_device_x): + * device.c (print_device): + * device.c (Fselect_device): + * device.c (Fset_device_selected_frame): + * device.c (Fget_device): + * device.c (Fmake_device): + * device.c (Fset_device_class): + * device.c (Fdevice_system_metric): + * device.c (Fdomain_device_type): + * device.c (syms_of_device): + * dialog-gtk.c (syms_of_dialog_gtk): + * dialog-msw.c (handle_file_dialog_box): + * dialog-msw.c (handle_question_dialog_box): + * dialog-msw.c (mswindows_make_dialog_box_internal): + * dialog-msw.c (syms_of_dialog_mswindows): + * dialog-x.c (dbox_descriptor_to_widget_value): + * dialog-x.c (x_make_dialog_box_internal): + * dialog.c (Fmake_dialog_box_internal): + * dired-msw.c (mswindows_get_files): + * dired-msw.c (syms_of_dired_mswindows): + * dired.c (Fdirectory_files): + * dired.c (file_name_completion): + * dired.c (syms_of_dired): + * doc.c (get_doc_string): + * doc.c (read_doc_string): + * doc.c (Fsnarf_documentation): + * doprnt.c (parse_off_posnum): + * doprnt.c (NEXT_ASCII_BYTE): + * doprnt.c (parse_doprnt_spec): + * doprnt.c (get_doprnt_args): + * doprnt.c (emacs_doprnt_1): + * dragdrop.c (syms_of_dragdrop): + * editfns.c (Fchar_to_string): + * editfns.c (region_limit): + * editfns.c (Fformat_time_string): + * editfns.c (Fdecode_time): + * editfns.c (Fencode_time): + * editfns.c (Ftranspose_regions): + * editfns.c (syms_of_editfns): + * eldap.c (signal_ldap_error): + * eldap.c (print_ldap): + * eldap.c (finalize_ldap): + * eldap.c (Fldap_open): + * eldap.c (Fldap_search_basic): + * eldap.c (Fldap_add): + * eldap.c (Fldap_modify): + * eldap.c (syms_of_eldap): + * eldap.h (CHECK_LIVE_LDAP): + * elhash.c (hash_table_size_validate): + * elhash.c (hash_table_weakness_validate): + * elhash.c (decode_hash_table_weakness): + * elhash.c (hash_table_test_validate): + * elhash.c (decode_hash_table_test): + * elhash.c (hash_table_rehash_size_validate): + * elhash.c (hash_table_rehash_threshold_validate): + * elhash.c (hash_table_data_validate): + * elhash.c (Fmake_hash_table): + * elhash.c (syms_of_elhash): + * emacs-widget-accessors.c (Fgtk_adjustment_lower): + * emacs-widget-accessors.c (Fgtk_adjustment_upper): + * emacs-widget-accessors.c (Fgtk_adjustment_value): + * emacs-widget-accessors.c (Fgtk_adjustment_step_increment): + * emacs-widget-accessors.c (Fgtk_adjustment_page_increment): + * emacs-widget-accessors.c (Fgtk_adjustment_page_size): + * emacs-widget-accessors.c (Fgtk_widget_style): + * emacs-widget-accessors.c (Fgtk_widget_window): + * emacs-widget-accessors.c (Fgtk_widget_state): + * emacs-widget-accessors.c (Fgtk_widget_name): + * emacs-widget-accessors.c (Fgtk_widget_parent): + * emacs-widget-accessors.c (Fgtk_button_child): + * emacs-widget-accessors.c (Fgtk_button_in_button): + * emacs-widget-accessors.c (Fgtk_button_button_down): + * emacs-widget-accessors.c (Fgtk_combo_entry): + * emacs-widget-accessors.c (Fgtk_combo_button): + * emacs-widget-accessors.c (Fgtk_combo_popup): + * emacs-widget-accessors.c (Fgtk_combo_popwin): + * emacs-widget-accessors.c (Fgtk_combo_list): + * emacs-widget-accessors.c (Fgtk_gamma_curve_table): + * emacs-widget-accessors.c (Fgtk_gamma_curve_curve): + * emacs-widget-accessors.c (Fgtk_gamma_curve_gamma): + * emacs-widget-accessors.c (Fgtk_gamma_curve_gamma_dialog): + * emacs-widget-accessors.c (Fgtk_gamma_curve_gamma_text): + * emacs-widget-accessors.c (Fgtk_check_menu_item_active): + * emacs-widget-accessors.c (Fgtk_notebook_tab_pos): + * emacs-widget-accessors.c (Fgtk_text_hadj): + * emacs-widget-accessors.c (Fgtk_text_vadj): + * emacs-widget-accessors.c (Fgtk_file_selection_dir_list): + * emacs-widget-accessors.c (Fgtk_file_selection_file_list): + * emacs-widget-accessors.c (Fgtk_file_selection_selection_entry): + * emacs-widget-accessors.c (Fgtk_file_selection_selection_text): + * emacs-widget-accessors.c (Fgtk_file_selection_main_vbox): + * emacs-widget-accessors.c (Fgtk_file_selection_ok_button): + * emacs-widget-accessors.c (Fgtk_file_selection_cancel_button): + * emacs-widget-accessors.c (Fgtk_file_selection_help_button): + * emacs-widget-accessors.c (Fgtk_file_selection_action_area): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_fontsel): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_main_vbox): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_action_area): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_ok_button): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_apply_button): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_cancel_button): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_colorsel): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_main_vbox): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_ok_button): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_reset_button): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_cancel_button): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_help_button): + * emacs-widget-accessors.c (Fgtk_dialog_vbox): + * emacs-widget-accessors.c (Fgtk_dialog_action_area): + * emacs-widget-accessors.c (Fgtk_input_dialog_close_button): + * emacs-widget-accessors.c (Fgtk_input_dialog_save_button): + * emacs-widget-accessors.c (Fgtk_plug_socket_window): + * emacs-widget-accessors.c (Fgtk_plug_same_app): + * emacs-widget-accessors.c (Fgtk_object_flags): + * emacs-widget-accessors.c (Fgtk_object_ref_count): + * emacs-widget-accessors.c (Fgtk_paned_child1): + * emacs-widget-accessors.c (Fgtk_paned_child2): + * emacs-widget-accessors.c (Fgtk_paned_child1_resize): + * emacs-widget-accessors.c (Fgtk_paned_child2_resize): + * emacs-widget-accessors.c (Fgtk_paned_child1_shrink): + * emacs-widget-accessors.c (Fgtk_paned_child2_shrink): + * emacs-widget-accessors.c (Fgtk_clist_rows): + * emacs-widget-accessors.c (Fgtk_clist_columns): + * emacs-widget-accessors.c (Fgtk_clist_hadjustment): + * emacs-widget-accessors.c (Fgtk_clist_vadjustment): + * emacs-widget-accessors.c (Fgtk_clist_sort_type): + * emacs-widget-accessors.c (Fgtk_clist_focus_row): + * emacs-widget-accessors.c (Fgtk_clist_sort_column): + * emacs-widget-accessors.c (Fgtk_list_children): + * emacs-widget-accessors.c (Fgtk_list_selection): + * emacs-widget-accessors.c (Fgtk_tree_children): + * emacs-widget-accessors.c (Fgtk_tree_root_tree): + * emacs-widget-accessors.c (Fgtk_tree_tree_owner): + * emacs-widget-accessors.c (Fgtk_tree_selection): + * emacs-widget-accessors.c (Fgtk_tree_item_subtree): + * emacs-widget-accessors.c (Fgtk_scrolled_window_hscrollbar): + * emacs-widget-accessors.c (Fgtk_scrolled_window_vscrollbar): + * emacs-widget-accessors.c (Fgtk_scrolled_window_hscrollbar_visible): + * emacs-widget-accessors.c (Fgtk_scrolled_window_vscrollbar_visible): + * emacs.c (main_1): + * emacs.c (Fsplit_path): + * emacs.c (syms_of_emacs): + * emodules.c (emodules_load): + * esd.c: + * esd.c (esd_play_sound_file): + * esd.c (esd_play_sound_data): + * eval.c: + * eval.c (print_subr): + * eval.c (FletX): + * eval.c (Flet): + * eval.c (Fdefvar): + * eval.c (Fdefconst): + * eval.c (condition_case_3): + * eval.c (return_from_signal): + * eval.c (signal_error_1): + * eval.c (maybe_signal_error_1): + * eval.c (maybe_signal_continuable_error_1): + * eval.c (signal_error): + * eval.c (maybe_signal_error): + * eval.c (signal_continuable_error): + * eval.c (maybe_signal_continuable_error): + * eval.c (signal_error_2): + * eval.c (maybe_signal_error_2): + * eval.c (signal_continuable_error_2): + * eval.c (maybe_signal_continuable_error_2): + * eval.c (signal_ferror): + * eval.c (maybe_signal_ferror): + * eval.c (signal_continuable_ferror): + * eval.c (maybe_signal_continuable_ferror): + * eval.c (signal_ferror_with_frob): + * eval.c (maybe_signal_ferror_with_frob): + * eval.c (signal_continuable_ferror_with_frob): + * eval.c (maybe_signal_continuable_ferror_with_frob): + * eval.c (signal_quit): + * eval.c (signal_invalid_function_error): + * eval.c (signal_wrong_number_of_arguments_error): + * eval.c (signal_malformed_list_error): + * eval.c (signal_malformed_property_list_error): + * eval.c (signal_circular_list_error): + * eval.c (signal_circular_property_list_error): + * eval.c (syntax_error): + * eval.c (syntax_error_2): + * eval.c (maybe_syntax_error): + * eval.c (sferror): + * eval.c (sferror_2): + * eval.c (maybe_sferror): + * eval.c (invalid_argument): + * eval.c (invalid_argument_2): + * eval.c (maybe_invalid_argument): + * eval.c (invalid_constant): + * eval.c (invalid_constant_2): + * eval.c (maybe_invalid_constant): + * eval.c (invalid_operation): + * eval.c (invalid_operation_2): + * eval.c (maybe_invalid_operation): + * eval.c (invalid_change): + * eval.c (invalid_change_2): + * eval.c (maybe_invalid_change): + * eval.c (invalid_state): + * eval.c (invalid_state_2): + * eval.c (maybe_invalid_state): + * eval.c (stack_overflow): + * eval.c (out_of_memory): + * eval.c (printing_unreadable_object): + * eval.c (do_autoload): + * eval.c (Feval): + * eval.c (Ffuncall): + * eval.c (grow_specpdl): + * eval.c (syms_of_eval): + * event-Xt.c (syms_of_event_Xt): + * event-gtk.c (syms_of_event_gtk): + * event-msw.c (mswindows_need_event_in_modal_loop): + * event-msw.c (emacs_mswindows_select_process): + * event-stream.c: + * event-stream.c (check_event_stream_ok): + * event-stream.c (lisp_number_to_milliseconds): + * event-stream.c (Fnext_event): + * event-stream.c (munge_keymap_translate): + * event-stream.c (Fset_recent_keys_ring_size): + * event-stream.c (execute_command_event): + * event-stream.c (syms_of_event_stream): + * events.c (print_event): + * events.c (Fmake_event): + * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): + * events.c (Fdeallocate_event): + * events.c (Fcopy_event): + * events.c (character_to_event): + * events.c (syms_of_events): + * extents.c (print_extent): + * extents.c (Fset_extent_parent): + * extents.c (decode_map_extents_flags): + * extents.c (decode_extent_at_flag): + * extents.c (symbol_to_glyph_layout): + * extents.c (Fset_extent_property): + * extents.c (syms_of_extents): + * faces.c (face_validate): + * faces.c (Fget_face): + * faces.c (syms_of_faces): + * file-coding.c: + * file-coding.c (print_coding_system): + * file-coding.c (symbol_to_eol_type): + * file-coding.c (Fget_coding_system): + * file-coding.c (parse_charset_conversion_specs): + * file-coding.c (Fmake_coding_system): + * file-coding.c (Fcoding_system_aliasee): + * file-coding.c (Fdefine_coding_system_alias): + * file-coding.c (Fcoding_system_property): + * file-coding.c (decode_coding_category): + * file-coding.c (Fset_coding_priority_list): + * file-coding.c (syms_of_file_coding): + * fileio.c: + * fileio.c (report_file_type_error): + * fileio.c (report_error_with_errno): + * fileio.c (report_file_error): + * fileio.c (Fmake_temp_name): + * fileio.c (Ffile_truename): + * fileio.c (Fmake_directory_internal): + * fileio.c (Fdelete_directory): + * fileio.c (Fdelete_file): + * fileio.c (Fset_file_modes): + * fileio.c (syms_of_fileio): + * filelock.c (syms_of_filelock): + * floatfns.c (float_error): + * fns.c: + * fns.c (check_losing_bytecode): + * fns.c (safe_copy_tree): + * fns.c (Fget): + * fns.c (Fput): + * fns.c (Fremprop): + * fns.c (Fobject_plist): + * fns.c (internal_equal): + * fns.c (internal_old_equal): + * fns.c (Fload_average): + * fns.c (Frequire): + * fns.c (base64_conversion_error): + * fns.c (base64_decode_1): + * fns.c (syms_of_fns): + * font-lock.c (syms_of_font_lock): + * frame-gtk.c (gtk_create_widgets): + * frame-gtk.c (gtk_init_frame_1): + * frame-gtk.c (gtk_cant_notify_wm_error): + * frame-gtk.c (syms_of_frame_gtk): + * frame-x.c (x_create_widgets): + * frame-x.c (x_init_frame_1): + * frame-x.c (x_cant_notify_wm_error): + * frame-x.c (syms_of_frame_x): + * frame.c (print_frame): + * frame.c (setup_frame_without_minibuffer): + * frame.c (Fmake_frame): + * frame.c (selected_frame): + * frame.c (device_selected_frame): + * frame.c (Fset_frame_selected_window): + * frame.c (delete_frame_internal): + * frame.c (Fmake_frame_invisible): + * frame.c (store_minibuf_frame_prop): + * frame.c (syms_of_frame): + * general-slots.h: + * glade.c (Fglade_xml_textdomain): + * glyphs-gtk.c: + * glyphs-gtk.c (check_pointer_sizes): + * glyphs-gtk.c (init_image_instance_from_gdk_image): + * glyphs-gtk.c (image_instance_add_gdk_image): + * glyphs-gtk.c (init_image_instance_from_xbm_inline): + * glyphs-gtk.c (write_lisp_string_to_temp_file): + * glyphs-gtk.c (gtk_xpm_instantiate): + * glyphs-gtk.c (gtk_xface_instantiate): + * glyphs-gtk.c (gtk_resource_validate): + * glyphs-gtk.c (gtk_resource_normalize): + * glyphs-gtk.c (gtk_resource_instantiate): + * glyphs-gtk.c (check_valid_resource_symbol): + * glyphs-gtk.c (check_valid_resource_id): + * glyphs-gtk.c (font_instantiate): + * glyphs-gtk.c (cursor_font_instantiate): + * glyphs-gtk.c (gtk_subwindow_instantiate): + * glyphs-gtk.c (syms_of_glyphs_gtk): + * glyphs-msw.c: + * glyphs-msw.c (init_image_instance_from_dibitmap): + * glyphs-msw.c (image_instance_add_dibitmap): + * glyphs-msw.c (mswindows_init_image_instance_from_eimage): + * glyphs-msw.c (xpm_to_eimage): + * glyphs-msw.c (mswindows_xpm_instantiate): + * glyphs-msw.c (mswindows_resource_validate): + * glyphs-msw.c (mswindows_resource_normalize): + * glyphs-msw.c (resource_name_to_resource): + * glyphs-msw.c (mswindows_resource_instantiate): + * glyphs-msw.c (check_valid_resource_symbol): + * glyphs-msw.c (check_valid_resource_id): + * glyphs-msw.c (mswindows_xface_instantiate): + * glyphs-msw.c (mswindows_subwindow_instantiate): + * glyphs-msw.c (mswindows_widget_instantiate): + * glyphs-msw.c (add_tree_item): + * glyphs-msw.c (add_tab_item): + * glyphs-msw.c (mswindows_combo_box_instantiate): + * glyphs-msw.c (syms_of_glyphs_mswindows): + * glyphs-msw.c (console_type_create_glyphs_mswindows): + * glyphs-widget.c (check_valid_orientation): + * glyphs-widget.c (check_valid_tab_orientation): + * glyphs-widget.c (check_valid_justification): + * glyphs-widget.c (widget_validate): + * glyphs-widget.c (combo_box_validate): + * glyphs-x.c (write_lisp_string_to_temp_file): + * glyphs-x.c (check_pointer_sizes): + * glyphs-x.c (init_image_instance_from_x_image): + * glyphs-x.c (image_instance_add_x_image): + * glyphs-x.c (init_image_instance_from_xbm_inline): + * glyphs-x.c (x_xpm_instantiate): + * glyphs-x.c (x_xface_instantiate): + * glyphs-x.c (font_instantiate): + * glyphs-x.c (cursor_font_instantiate): + * glyphs-x.c (x_redisplay_widget): + * glyphs-x.c (x_subwindow_instantiate): + * glyphs-x.c (x_widget_instantiate): + * glyphs.c: + * glyphs.c (decode_device_ii_format): + * glyphs.c (process_image_string_instantiator): + * glyphs.c (if): + * glyphs.c (file_or_data_must_be_present): + * glyphs.c (data_must_be_present): + * glyphs.c (face_must_be_present): + * glyphs.c (get_image_instantiator_governing_domain): + * glyphs.c (instantiate_image_instantiator): + * glyphs.c (print_image_instance): + * glyphs.c (decode_image_instance_type): + * glyphs.c (incompatible_image_types): + * glyphs.c (make_image_instance_1): + * glyphs.c (signal_image_error): + * glyphs.c (signal_image_error_2): + * glyphs.c (signal_double_image_error_2): + * glyphs.c (simple_image_type_normalize): + * glyphs.c (check_valid_xbm_inline): + * glyphs.c (bitmap_to_lisp_data): + * glyphs.c (xbm_normalize): + * glyphs.c (xface_normalize): + * glyphs.c (pixmap_to_lisp_data): + * glyphs.c (check_valid_xpm_color_symbols): + * glyphs.c (evaluate_xpm_color_symbols): + * glyphs.c (xpm_normalize): + * glyphs.c (image_instantiate): + * glyphs.c (image_validate): + * glyphs.c (print_glyph): + * glyphs.c (decode_glyph_type): + * glyphs.c (subwindow_instantiate): + * glyphs.c (syms_of_glyphs): + * glyphs.h: + * gpmevent.c (Fgpm_enable): + * gui-gtk.c (syms_of_gui_gtk): + * gui-x.c (button_item_to_widget_value): + * gui-x.c (gui_items_to_widget_values_1): + * gui-x.c (gui_items_to_widget_values): + * gui.c: + * gui.c (gui_item_add_keyval_pair): + * gui.c (make_gui_item_from_keywords_internal): + * gui.c (widget_gui_parse_item_keywords): + * gui.c (update_gui_item_keywords): + * gui.c (signal_too_long_error): + * gui.c (print_gui_item): + * gui.c (parse_gui_item_tree_item): + * gui.c (syms_of_gui): + * gutter.c (decode_gutter_position): + * gutter.c (gutter_validate): + * gutter.c (gutter_size_validate): + * gutter.c (gutter_visible_validate): + * gutter.c (syms_of_gutter): + * hpplay.c: + * hpplay.c (player_error_internal): + * hpplay.c (myHandler): + * hpplay.c (play_bucket_internal): + * hpplay.c (play_sound_file): + * hpplay.c (play_sound_data): + * hpplay.c (vars_of_hpplay): + * indent.c (Findent_to): + * indent.c (syms_of_indent): + * input-method-xlib.c (Fx_open_xim): + * input-method-xlib.c (Fx_close_xim): + * input-method-xlib.c (syms_of_input_method_xlib): + * insdel.c (get_buffer_range_char): + * insdel.c (get_string_range_char): + * insdel.c (make_gap): + * insdel.c (buffer_insert_string_1): + * intl.c (syms_of_intl): + * keymap.c (print_keymap): + * keymap.c (traverse_keymaps): + * keymap.c (check_keymap_definition_loop): + * keymap.c (define_key_check_and_coerce_keysym): + * keymap.c (define_key_parser): + * keymap.c (key_desc_list_to_event): + * keymap.c (ensure_meta_prefix_char_keymapp): + * keymap.c (Fdefine_key): + * keymap.c (Fsingle_key_description): + * keymap.c (Ftext_char_description): + * libsst.c: + * libsst.c (dial;): + * libsst.h: + * libsst.h (sst_dtmf): + * linuxplay.c: + * linuxplay.c (audio_init): + * linuxplay.c (linux_play_data_or_file): + * linuxplay.c (play_sound_file): + * linuxplay.c (play_sound_data): + * lisp.h: + * lread.c (read_syntax_error): + * lread.c (continuable_read_syntax_error): + * lread.c (readchar): + * lread.c (pas_de_holgazan_ici): + * lread.c (load_force_doc_string_unwind): + * lread.c (Fload_internal): + * lread.c (decode_mode_1): + * lread.c (readevalloop): + * lread.c (Feval_buffer): + * lread.c (read_escape): + * lread.c (FSF_LOSSAGE): + * lread.c (read_atom_0): + * lread.c (reader_nextchar): + * lread.c (read_list_conser): + * lread.c (syms_of_lread): + * lread.c (vars_of_lread): + * lstream.c (Lstream_internal_error): + * lstream.h (wrap_lstream): + * macros.c (Fstart_kbd_macro): + * macros.c (Fend_kbd_macro): + * macros.c (pop_kbd_macro_event): + * macros.c (Fcall_last_kbd_macro): + * macros.c (Fexecute_kbd_macro): + * macros.c (syms_of_macros): + * marker.c (print_marker): + * marker.c (set_marker_internal): + * marker.c (bi_marker_position): + * marker.c (marker_position): + * marker.c (set_bi_marker_position): + * marker.c (set_marker_position): + * md5.c (md5_coding_system): + * menubar-gtk.c (menu_convert): + * menubar-gtk.c (menu_descriptor_to_widget_1): + * menubar-msw.c (mswindows_translate_menu_or_dialog_item): + * menubar-msw.c (populate_menu_add_item): + * menubar-msw.c (populate_or_checksum_helper): + * menubar-msw.c (unsafe_handle_wm_initmenupopup_1): + * menubar-msw.c (mswindows_popup_menu): + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + * menubar-x.c (x_popup_menu): + * menubar-x.c (Faccelerate_menu): + * menubar.c (syms_of_menubar): + * menubar.c (vars_of_menubar): + * minibuf.c (Ftry_completion): + * minibuf.c (syms_of_minibuf): + * miscplay.c: + * miscplay.c (parse_wave_complete): + * miscplay.c (waverequire): + * miscplay.c (parsewave): + * miscplay.c (parsesundecaudio): + * miscplay.c (sndcnv8U_2mono): + * miscplay.c (sndcnv8S_2mono): + * miscplay.c (sndcnv2monounsigned): + * miscplay.c (sndcnv2unsigned): + * miscplay.c (int2ulaw): + * miscplay.c (sndcnvULaw_2linear): + * miscplay.c (sndcnvULaw_2mono): + * miscplay.c (sndcnv16_2monoLE): + * miscplay.c (sndcnv16_2monoBE): + * miscplay.c (sndcnv2byteLE): + * miscplay.c (sndcnv2byteBE): + * miscplay.c (sndcnv2monobyteLE): + * miscplay.c (sndcnv2monobyteBE): + * miscplay.c (analyze_format): + * miscplay.h: + * miscplay.h (HEADERSZ): + * miscplay.h (parse_wave_complete): + * mule-ccl.c (Fccl_execute): + * mule-ccl.c (vars_of_mule_ccl): + * mule-charset.c (print_charset): + * mule-charset.c (get_unallocated_leading_byte): + * mule-charset.c (Fget_charset): + * mule-charset.c (Fmake_charset): + * mule-charset.c (Fcharset_from_attributes): + * mule-charset.c (Fcharset_property): + * mule-charset.c (Fset_charset_ccl_program): + * mule-charset.c (Fmake_char): + * mule-charset.c (Fchar_octet): + * mule-charset.c (lookup_composite_char): + * mule-charset.c (syms_of_mule_charset): + * mule-wnnfns.c (Fwnn_set_param): + * mule-wnnfns.c (syms_of_mule_wnn): + * mule.c (Fdefine_word_pattern): + * nas.c: + * nas.c (XTOOLKIT): + * nas.c (play_sound_file): + * nas.c (close_down_play): + * nas.c (do_caching_play): + * nas.c (play_sound_data): + * nas.c (CatchIoErrorAndJump): + * nas.c (NameFromData): + * nas.c (SndOpenDataForReading): + * nas.c (cmpID): + * nas.c (dread): + * nas.c (dgetc): + * nas.c (readChunk): + * nas.c (WaveOpenDataForReading): + * nas.c (SoundOpenDataForReading): + * ntplay.c: + * ntplay.c (play_sound_file): + * ntplay.c (play_sound_data_1): + * ntplay.c (play_sound_data): + * ntproc.c: + * ntproc.c (prepare_standard_handles): + * ntproc.c (vars_of_ntproc): + * objects-gtk.c (gtk_parse_nearest_color): + * objects-gtk.c (gtk_initialize_font_instance): + * objects-msw.c (mswindows_initialize_color_instance): + * objects-msw.c (initialize_font_instance): + * objects-x.c (x_parse_nearest_color): + * objects-x.c (x_initialize_font_instance): + * objects-x.c (x_font_instance_truename): + * objects.c (finalose): + * objects.c (print_color_instance): + * objects.c (print_font_instance): + * objects.c (font_instance_truename_internal): + * objects.c (color_instantiate): + * objects.c (color_validate): + * objects.c (font_validate): + * objects.c (face_boolean_instantiate): + * objects.c (face_boolean_validate): + * objects.c (syms_of_objects): + * postgresql.c (CHECK_LIVE_CONNECTION): + * postgresql.c (print_pgconn): + * postgresql.c (finalize_pgconn): + * postgresql.c (print_pgresult): + * postgresql.c (finalize_pgresult): + * postgresql.c (Fpq_connectdb): + * postgresql.c (Fpq_connect_start): + * postgresql.c (Fpq_connect_poll): + * postgresql.c (Fpq_set_client_encoding): + * postgresql.c (Fpq_reset_start): + * postgresql.c (Fpq_reset_poll): + * postgresql.c (Fpq_pgconn): + * postgresql.c (Fpq_exec): + * postgresql.c (Fpq_send_query): + * postgresql.c (Fpq_get_result): + * postgresql.c (Fpq_result_status): + * postgresql.c (Fpq_make_empty_pgresult): + * postgresql.c (syms_of_postgresql): + * print.c: + * print.c (print_error_message): + * print.c (print_cons): + * print.c (default_object_printer): + * print.c (Fexternal_debugging_output): + * print.c (Fopen_termscript): + * print.c (syms_of_print): + * process-nt.c: + * process-nt.c (validate_signal_number): + * process-nt.c (mswindows_report_process_error): + * process-nt.c (mswindows_report_winsock_error): + * process-nt.c (nt_create_process): + * process-nt.c (get_internet_address): + * process-nt.c (nt_canonicalize_host_name): + * process-nt.c (nt_open_network_stream): + * process-unix.c (get_internet_address): + * process-unix.c (unix_create_process): + * process-unix.c (unix_send_process): + * process-unix.c (unix_kill_child_process): + * process-unix.c (unix_canonicalize_host_name): + * process-unix.c (unix_open_network_stream): + * process-unix.c (unix_open_multicast_group): + * process.c: + * process.c (print_process): + * process.c (get_process): + * process.c (report_process_error): + * process.c (init_process_io_handles): + * process.c (Fstart_process_internal): + * process.c (send_process): + * process.c (decode_signal): + * process.c (process_send_signal): + * process.c (Fkill_process): + * process.c (Fquit_process): + * process.c (Fstop_process): + * process.c (Fcontinue_process): + * process.c (Fprocess_send_eof): + * process.c (syms_of_process): + * ralloc.c (syms_of_ralloc): + * rangetab.c (Fput_range_table): + * rangetab.c (rangetab_data_validate): + * rangetab.c (syms_of_rangetab): + * redisplay.c (syms_of_redisplay): + * scrollbar.c (syms_of_scrollbar): + * search.c (matcher_overflow): + * search.c (compile_pattern_1): + * search.c (skip_chars): + * search.c (search_command): + * search.c (Freplace_match): + * search.c (Fmatch_data): + * search.c (syms_of_search): + * select-gtk.c (gtk_get_foreign_selection): + * select-gtk.c (gtk_get_window_property_as_lisp_data): + * select-gtk.c (lisp_data_to_selection_data): + * select-x.c (motif_clipboard_cb): + * select-x.c (x_reply_selection_request): + * select-x.c (copy_multiple_data): + * select-x.c (x_get_foreign_selection): + * select-x.c (x_get_window_property_as_lisp_data): + * select-x.c (lisp_data_to_selection_data): + * select-x.c (CHECK_CUTBUFFER): + * select-x.c (Fx_get_cutbuffer_internal): + * select-x.c (syms_of_select_x): + * select.c (Fown_selection_internal): + * select.c (syms_of_select): + * sgiplay.c: + * sgiplay.c (play_sound_file): + * sgiplay.c (play_sound_data): + * sgiplay.c (audio_initialize): + * sgiplay.c (play_internal): + * sgiplay.c (write_mulaw_8_chunk): + * sgiplay.c (write_linear_chunk): + * sgiplay.c (initialize_audio_port): + * sgiplay.c (open_audio_port): + * sgiplay.c (set_channels): + * sgiplay.c (set_output_format): + * sgiplay.c (struct): + * sgiplay.c (parse_snd_header): + * sheap.c (sheap_adjust_h): + * sound.c: + * sound.c (report_sound_error): + * sound.c (Fplay_sound_file): + * sound.c (Fplay_sound): + * sound.c (Fding): + * sound.c (init_nas_sound): + * sound.c (init_native_sound): + * sound.c (syms_of_sound): + * specifier.c: + * specifier.c (print_specifier): + * specifier.c (decode_specifier_type): + * specifier.c (check_valid_locale_or_locale_type): + * specifier.c (decode_locale): + * specifier.c (decode_locale_type): + * specifier.c (check_valid_domain): + * specifier.c (decode_specifier_tag_set): + * specifier.c (Fcanonicalize_tag_set): + * specifier.c (Fdefine_specifier_tag): + * specifier.c (Fspecifier_tag_predicate): + * specifier.c (check_valid_inst_list): + * specifier.c (check_valid_spec_list): + * specifier.c (decode_how_to_add_specification): + * specifier.c (check_modifiable_specifier): + * specifier.c (Fcopy_specifier): + * specifier.c (check_valid_specifier_matchspec): + * specifier.c (specifier_instance): + * specifier.c (boolean_validate): + * specifier.c (syms_of_specifier): + * sunplay.c: + * sunplay.c (init_device): + * sunplay.c (play_sound_file): + * sunplay.c (play_sound_data): + * symbols.c (oblookup): + * symbols.c (reject_constant_symbols): + * symbols.c (verify_ok_for_buffer_local): + * symbols.c (Fset): + * symbols.c (decode_magic_handler_type): + * symbols.c (handler_type_from_function_symbol): + * symbols.c (Fdefvaralias): + * symbols.c (init_symbols_once_early): + * symeval.h: + * symsinit.h: + * syntax.c (scan_lists): + * syntax.c (scan_sexps_forward): + * syntax.c (syms_of_syntax): + * sysdep.c (stuff_char): + * sysdep.c (sys_subshell): + * sysdep.c (dup2): + * toolbar-msw.c (mswindows_output_toolbar): + * toolbar.c (decode_toolbar_position): + * toolbar.c (compute_frame_toolbar_buttons): + * toolbar.c (CTB_ERROR): + * toolbar.c (check_toolbar_button_keywords): + * toolbar.c (toolbar_validate): + * toolbar.c (syms_of_toolbar): + * tooltalk.c (print_tooltalk_message): + * tooltalk.c (print_tooltalk_pattern): + * tooltalk.c (check_status): + * tooltalk.c (Ftooltalk_open_connection): + * tooltalk.c (syms_of_tooltalk): + * ui-byhand.c (Fgtk_box_query_child_packing): + * ui-byhand.c (Fgtk_button_box_get_child_size): + * ui-byhand.c (Fgtk_calendar_get_date): + * ui-byhand.c (Fgtk_clist_get_text): + * ui-byhand.c (Fgtk_clist_get_selection): + * ui-byhand.c (Fgtk_clist_get_pixmap): + * ui-byhand.c (Fgtk_clist_get_pixtext): + * ui-byhand.c (Fgtk_color_selection_get_color): + * ui-byhand.c (Fgtk_editable_insert_text): + * ui-byhand.c (Fgtk_pixmap_get): + * ui-byhand.c (Fgtk_curve_get_vector): + * ui-byhand.c (Fgtk_curve_set_vector): + * ui-byhand.c (Fgtk_label_get): + * ui-byhand.c (Fgtk_notebook_query_tab_label_packing): + * ui-byhand.c (Fgtk_widget_get_pointer): + * ui-byhand.c (generic_toolbar_insert_item): + * ui-gtk.c (Fdll_load): + * ui-gtk.c (ffi_object_printer): + * ui-gtk.c (Fgtk_import_variable_internal): + * ui-gtk.c (Fgtk_import_function_internal): + * ui-gtk.c (Fgtk_call_function): + * ui-gtk.c (emacs_gtk_object_printer): + * ui-gtk.c (object_getprop): + * ui-gtk.c (object_putprop): + * ui-gtk.c (emacs_gtk_object_finalizer): + * ui-gtk.c (emacs_gtk_boxed_printer): + * ui-gtk.c (Fgtk_fundamental_type): + * ui-gtk.c (Fgtk_describe_type): + * ui-gtk.c (syms_of_ui_gtk): + * ui-gtk.c (lisp_to_gtk_type): + * ui-gtk.c (symbol_to_enum): + * ui-gtk.c (enum_to_symbol): + * undo.c (Fprimitive_undo): + * undo.c (syms_of_undo): + * unexaix.c (report_error): + * unexaix.c (report_error_1): + * unexapollo.c (unexec): + * unexapollo.c (CopyData): + * unexconvex.c (report_error): + * unexconvex.c (a2;): + * unexec.c (report_error): + * unexec.c (report_error_1): + * widget.c (syms_of_widget): + * win32.c (Fmswindows_shell_execute): + * window.c (print_window): + * window.c (Fdelete_window): + * window.c (Fdelete_other_windows): + * window.c (Fset_window_buffer): + * window.c (Fselect_window): + * window.c (Fsplit_window): + * window.c (change_window_height): + * window.c (window_scroll): + * window.c (Fother_window_for_scrolling): + * window.c (print_window_config): + * window.c (syms_of_window): + +2001-05-19 Ben Wing + + * glyphs-shared.c: New. Try just a bit to start eliminating + the massive code duplication in *-gtk.c. + +2001-05-16 Ben Wing + + * abbrev.c (syms_of_abbrev): + * alloc.c (memory_full): + * alloc.c (Fmake_byte_code): + * alloc.c (garbage_collect_1): + * buffer.c: + * buffer.c (print_buffer): + * buffer.c (nsberror): + * buffer.c (Fget_buffer_create): + * buffer.c (Fset_buffer): + * buffer.c (Fbury_buffer): + * buffer.c (syms_of_buffer): + * bytecode.c: + * bytecode.c (execute_optimized_program): + * bytecode.c (invalid_byte_code): + * bytecode.c (check_opcode): + * bytecode.c (check_constants_index): + * bytecode.c (READ_INSTRUCTION_CHAR): + * bytecode.c (optimize_byte_code): + * bytecode.c (Ffetch_bytecode): + * bytecode.c (syms_of_bytecode): + * callint.c (check_mark): + * callint.c (Fcall_interactively): + * callint.c (syms_of_callint): + * callproc.c: + * callproc.c (Fold_call_process_internal): + * callproc.c (child_setup): + * casetab.c (print_case_table): + * casetab.c (Fget_case_table): + * casetab.c (Fput_case_table): + * casetab.c (syms_of_casetab): + * chartab.c (symbol_to_char_table_type): + * chartab.c (decode_char_table_range): + * chartab.c (check_valid_char_table_value): + * chartab.c (chartab_data_validate): + * chartab.c (check_category_char): + * chartab.c (syms_of_chartab): + * cmdloop.c (command_loop_3): + * cmdloop.c (syms_of_cmdloop): + * cmds.c (Fdelete_char): + * cmds.c (Fself_insert_command): + * cmds.c (syms_of_cmds): + * console-msw.c: + * console-msw.c (mswindows_canonicalize_console_connection): + * console-msw.c (Fmswindows_message_box): + * console-msw.c (mswindows_output_last_error): + * console-msw.c (msprinter_canonicalize_console_connection): + * console-msw.c (syms_of_console_mswindows): + * console-msw.h: + * console-stream.c (stream_init_console): + * console-stream.c (stream_init_frame_1): + * console-tty.c (tty_init_console): + * console-tty.c (syms_of_console_tty): + * console-x.c (get_display_arg_connection): + * console.c (print_console): + * console.c (decode_console_type): + * console.c (Fselect_console): + * console.c (Fget_console): + * console.c (delete_console_internal): + * console.c (syms_of_console): + * data.c: + * data.c (dead_wrong_type_argument): + * data.c (c_write_error): + * data.c (lisp_write_error): + * data.c (args_out_of_range): + * data.c (args_out_of_range_3): + * data.c (print_weak_list): + * data.c (decode_weak_list_type): + * data.c (arith_error): + * data.c (init_errors_once_early): + * data.c (syms_of_data): + * database.c (CHECK_LIVE_DATABASE): + * database.c (print_database): + * database.c (finalize_database): + * database.c (Fopen_database): + * database.c (syms_of_database): + * debug.c (Fadd_debug_class_to_check): + * debug.c (Fdelete_debug_class_to_check): + * debug.c (Fset_debug_classes_to_check): + * debug.c (Fset_debug_class_types_to_check): + * debug.c (Fdebug_types_being_checked): + * debug.c (syms_of_debug): + * device-gtk.c (gtk_init_device): + * device-gtk.c (Fgtk_display_visual_class): + * device-gtk.c (Fgtk_keysym_on_keyboard_p): + * device-gtk.c (syms_of_device_gtk): + * device-msw.c (handle_devmode_changes): + * device-msw.c (mswindows_handle_print_dialog_box): + * device-msw.c (mswindows_handle_page_setup_dialog_box): + * device-msw.c (Fmsprinter_select_settings): + * device-msw.c (Fmsprinter_apply_settings): + * device-msw.c (print_devmode): + * device-tty.c (tty_init_device): + * device-tty.c (syms_of_device_tty): + * device-x.c (sanity_check_geometry_resource): + * device-x.c (x_init_device): + * device-x.c (x_get_resource_prefix): + * device-x.c (Fx_get_resource): + * device-x.c (Fx_put_resource): + * device-x.c (Fx_display_visual_class): + * device-x.c (Fx_keysym_hash_table): + * device-x.c (Fx_keysym_on_keyboard_p): + * device-x.c (Fx_get_font_path): + * device-x.c (syms_of_device_x): + * device.c (print_device): + * device.c (Fselect_device): + * device.c (Fset_device_selected_frame): + * device.c (Fget_device): + * device.c (Fmake_device): + * device.c (Fset_device_class): + * device.c (Fdevice_system_metric): + * device.c (Fdomain_device_type): + * device.c (syms_of_device): + * dialog-gtk.c (syms_of_dialog_gtk): + * dialog-msw.c (handle_file_dialog_box): + * dialog-msw.c (handle_question_dialog_box): + * dialog-msw.c (mswindows_make_dialog_box_internal): + * dialog-msw.c (syms_of_dialog_mswindows): + * dialog-x.c (dbox_descriptor_to_widget_value): + * dialog-x.c (x_make_dialog_box_internal): + * dialog.c (Fmake_dialog_box_internal): + * dired-msw.c (mswindows_get_files): + * dired-msw.c (syms_of_dired_mswindows): + * dired.c (Fdirectory_files): + * dired.c (file_name_completion): + * dired.c (syms_of_dired): + * doc.c (get_doc_string): + * doc.c (read_doc_string): + * doc.c (Fsnarf_documentation): + * doprnt.c (parse_off_posnum): + * doprnt.c (NEXT_ASCII_BYTE): + * doprnt.c (parse_doprnt_spec): + * doprnt.c (get_doprnt_args): + * doprnt.c (emacs_doprnt_1): + * dragdrop.c (syms_of_dragdrop): + * editfns.c (Fchar_to_string): + * editfns.c (region_limit): + * editfns.c (Fformat_time_string): + * editfns.c (Fdecode_time): + * editfns.c (Fencode_time): + * editfns.c (Ftranspose_regions): + * editfns.c (syms_of_editfns): + * eldap.c (signal_ldap_error): + * eldap.c (print_ldap): + * eldap.c (finalize_ldap): + * eldap.c (Fldap_open): + * eldap.c (Fldap_search_basic): + * eldap.c (Fldap_add): + * eldap.c (Fldap_modify): + * eldap.c (syms_of_eldap): + * eldap.h (CHECK_LIVE_LDAP): + * elhash.c (hash_table_size_validate): + * elhash.c (hash_table_weakness_validate): + * elhash.c (decode_hash_table_weakness): + * elhash.c (hash_table_test_validate): + * elhash.c (decode_hash_table_test): + * elhash.c (hash_table_rehash_size_validate): + * elhash.c (hash_table_rehash_threshold_validate): + * elhash.c (hash_table_data_validate): + * elhash.c (Fmake_hash_table): + * elhash.c (syms_of_elhash): + * emacs-widget-accessors.c (Fgtk_adjustment_lower): + * emacs-widget-accessors.c (Fgtk_adjustment_upper): + * emacs-widget-accessors.c (Fgtk_adjustment_value): + * emacs-widget-accessors.c (Fgtk_adjustment_step_increment): + * emacs-widget-accessors.c (Fgtk_adjustment_page_increment): + * emacs-widget-accessors.c (Fgtk_adjustment_page_size): + * emacs-widget-accessors.c (Fgtk_widget_style): + * emacs-widget-accessors.c (Fgtk_widget_window): + * emacs-widget-accessors.c (Fgtk_widget_state): + * emacs-widget-accessors.c (Fgtk_widget_name): + * emacs-widget-accessors.c (Fgtk_widget_parent): + * emacs-widget-accessors.c (Fgtk_button_child): + * emacs-widget-accessors.c (Fgtk_button_in_button): + * emacs-widget-accessors.c (Fgtk_button_button_down): + * emacs-widget-accessors.c (Fgtk_combo_entry): + * emacs-widget-accessors.c (Fgtk_combo_button): + * emacs-widget-accessors.c (Fgtk_combo_popup): + * emacs-widget-accessors.c (Fgtk_combo_popwin): + * emacs-widget-accessors.c (Fgtk_combo_list): + * emacs-widget-accessors.c (Fgtk_gamma_curve_table): + * emacs-widget-accessors.c (Fgtk_gamma_curve_curve): + * emacs-widget-accessors.c (Fgtk_gamma_curve_gamma): + * emacs-widget-accessors.c (Fgtk_gamma_curve_gamma_dialog): + * emacs-widget-accessors.c (Fgtk_gamma_curve_gamma_text): + * emacs-widget-accessors.c (Fgtk_check_menu_item_active): + * emacs-widget-accessors.c (Fgtk_notebook_tab_pos): + * emacs-widget-accessors.c (Fgtk_text_hadj): + * emacs-widget-accessors.c (Fgtk_text_vadj): + * emacs-widget-accessors.c (Fgtk_file_selection_dir_list): + * emacs-widget-accessors.c (Fgtk_file_selection_file_list): + * emacs-widget-accessors.c (Fgtk_file_selection_selection_entry): + * emacs-widget-accessors.c (Fgtk_file_selection_selection_text): + * emacs-widget-accessors.c (Fgtk_file_selection_main_vbox): + * emacs-widget-accessors.c (Fgtk_file_selection_ok_button): + * emacs-widget-accessors.c (Fgtk_file_selection_cancel_button): + * emacs-widget-accessors.c (Fgtk_file_selection_help_button): + * emacs-widget-accessors.c (Fgtk_file_selection_action_area): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_fontsel): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_main_vbox): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_action_area): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_ok_button): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_apply_button): + * emacs-widget-accessors.c (Fgtk_font_selection_dialog_cancel_button): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_colorsel): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_main_vbox): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_ok_button): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_reset_button): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_cancel_button): + * emacs-widget-accessors.c (Fgtk_color_selection_dialog_help_button): + * emacs-widget-accessors.c (Fgtk_dialog_vbox): + * emacs-widget-accessors.c (Fgtk_dialog_action_area): + * emacs-widget-accessors.c (Fgtk_input_dialog_close_button): + * emacs-widget-accessors.c (Fgtk_input_dialog_save_button): + * emacs-widget-accessors.c (Fgtk_plug_socket_window): + * emacs-widget-accessors.c (Fgtk_plug_same_app): + * emacs-widget-accessors.c (Fgtk_object_flags): + * emacs-widget-accessors.c (Fgtk_object_ref_count): + * emacs-widget-accessors.c (Fgtk_paned_child1): + * emacs-widget-accessors.c (Fgtk_paned_child2): + * emacs-widget-accessors.c (Fgtk_paned_child1_resize): + * emacs-widget-accessors.c (Fgtk_paned_child2_resize): + * emacs-widget-accessors.c (Fgtk_paned_child1_shrink): + * emacs-widget-accessors.c (Fgtk_paned_child2_shrink): + * emacs-widget-accessors.c (Fgtk_clist_rows): + * emacs-widget-accessors.c (Fgtk_clist_columns): + * emacs-widget-accessors.c (Fgtk_clist_hadjustment): + * emacs-widget-accessors.c (Fgtk_clist_vadjustment): + * emacs-widget-accessors.c (Fgtk_clist_sort_type): + * emacs-widget-accessors.c (Fgtk_clist_focus_row): + * emacs-widget-accessors.c (Fgtk_clist_sort_column): + * emacs-widget-accessors.c (Fgtk_list_children): + * emacs-widget-accessors.c (Fgtk_list_selection): + * emacs-widget-accessors.c (Fgtk_tree_children): + * emacs-widget-accessors.c (Fgtk_tree_root_tree): + * emacs-widget-accessors.c (Fgtk_tree_tree_owner): + * emacs-widget-accessors.c (Fgtk_tree_selection): + * emacs-widget-accessors.c (Fgtk_tree_item_subtree): + * emacs-widget-accessors.c (Fgtk_scrolled_window_hscrollbar): + * emacs-widget-accessors.c (Fgtk_scrolled_window_vscrollbar): + * emacs-widget-accessors.c (Fgtk_scrolled_window_hscrollbar_visible): + * emacs-widget-accessors.c (Fgtk_scrolled_window_vscrollbar_visible): + * emacs.c (main_1): + * emacs.c (Fsplit_path): + * emacs.c (syms_of_emacs): + * emodules.c (emodules_load): + * esd.c: + * esd.c (esd_play_sound_file): + * esd.c (esd_play_sound_data): + * eval.c: + * eval.c (print_subr): + * eval.c (FletX): + * eval.c (Flet): + * eval.c (Fdefvar): + * eval.c (Fdefconst): + * eval.c (condition_case_3): + * eval.c (return_from_signal): + * eval.c (signal_error_1): + * eval.c (maybe_signal_error_1): + * eval.c (maybe_signal_continuable_error_1): + * eval.c (signal_error): + * eval.c (maybe_signal_error): + * eval.c (signal_continuable_error): + * eval.c (maybe_signal_continuable_error): + * eval.c (signal_error_2): + * eval.c (maybe_signal_error_2): + * eval.c (signal_continuable_error_2): + * eval.c (maybe_signal_continuable_error_2): + * eval.c (signal_ferror): + * eval.c (maybe_signal_ferror): + * eval.c (signal_continuable_ferror): + * eval.c (maybe_signal_continuable_ferror): + * eval.c (signal_ferror_with_frob): + * eval.c (maybe_signal_ferror_with_frob): + * eval.c (signal_continuable_ferror_with_frob): + * eval.c (maybe_signal_continuable_ferror_with_frob): + * eval.c (signal_quit): + * eval.c (signal_invalid_function_error): + * eval.c (signal_wrong_number_of_arguments_error): + * eval.c (signal_malformed_list_error): + * eval.c (signal_malformed_property_list_error): + * eval.c (signal_circular_list_error): + * eval.c (signal_circular_property_list_error): + * eval.c (syntax_error): + * eval.c (syntax_error_2): + * eval.c (maybe_syntax_error): + * eval.c (sferror): + * eval.c (sferror_2): + * eval.c (maybe_sferror): + * eval.c (invalid_argument): + * eval.c (invalid_argument_2): + * eval.c (maybe_invalid_argument): + * eval.c (invalid_constant): + * eval.c (invalid_constant_2): + * eval.c (maybe_invalid_constant): + * eval.c (invalid_operation): + * eval.c (invalid_operation_2): + * eval.c (maybe_invalid_operation): + * eval.c (invalid_change): + * eval.c (invalid_change_2): + * eval.c (maybe_invalid_change): + * eval.c (invalid_state): + * eval.c (invalid_state_2): + * eval.c (maybe_invalid_state): + * eval.c (stack_overflow): + * eval.c (out_of_memory): + * eval.c (printing_unreadable_object): + * eval.c (do_autoload): + * eval.c (Feval): + * eval.c (Ffuncall): + * eval.c (grow_specpdl): + * eval.c (syms_of_eval): + * event-Xt.c (syms_of_event_Xt): + * event-gtk.c (syms_of_event_gtk): + * event-msw.c (mswindows_need_event_in_modal_loop): + * event-msw.c (emacs_mswindows_select_process): + * event-stream.c: + * event-stream.c (check_event_stream_ok): + * event-stream.c (lisp_number_to_milliseconds): + * event-stream.c (Fnext_event): + * event-stream.c (munge_keymap_translate): + * event-stream.c (Fset_recent_keys_ring_size): + * event-stream.c (execute_command_event): + * event-stream.c (syms_of_event_stream): + * events.c (print_event): + * events.c (Fmake_event): + * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): + * events.c (Fdeallocate_event): + * events.c (Fcopy_event): + * events.c (character_to_event): + * events.c (syms_of_events): + * extents.c (print_extent): + * extents.c (Fset_extent_parent): + * extents.c (decode_map_extents_flags): + * extents.c (decode_extent_at_flag): + * extents.c (symbol_to_glyph_layout): + * extents.c (Fset_extent_property): + * extents.c (syms_of_extents): + * faces.c (face_validate): + * faces.c (Fget_face): + * faces.c (syms_of_faces): + * file-coding.c: + * file-coding.c (print_coding_system): + * file-coding.c (symbol_to_eol_type): + * file-coding.c (Fget_coding_system): + * file-coding.c (parse_charset_conversion_specs): + * file-coding.c (Fmake_coding_system): + * file-coding.c (Fcoding_system_aliasee): + * file-coding.c (Fdefine_coding_system_alias): + * file-coding.c (Fcoding_system_property): + * file-coding.c (decode_coding_category): + * file-coding.c (Fset_coding_priority_list): + * file-coding.c (syms_of_file_coding): + * fileio.c: + * fileio.c (report_file_type_error): + * fileio.c (report_error_with_errno): + * fileio.c (report_file_error): + * fileio.c (Fmake_temp_name): + * fileio.c (Ffile_truename): + * fileio.c (Fmake_directory_internal): + * fileio.c (Fdelete_directory): + * fileio.c (Fdelete_file): + * fileio.c (Fset_file_modes): + * fileio.c (syms_of_fileio): + * filelock.c (syms_of_filelock): + * floatfns.c (float_error): + * fns.c: + * fns.c (check_losing_bytecode): + * fns.c (safe_copy_tree): + * fns.c (Fget): + * fns.c (Fput): + * fns.c (Fremprop): + * fns.c (Fobject_plist): + * fns.c (internal_equal): + * fns.c (internal_old_equal): + * fns.c (Fload_average): + * fns.c (Frequire): + * fns.c (base64_conversion_error): + * fns.c (base64_decode_1): + * fns.c (syms_of_fns): + * font-lock.c (syms_of_font_lock): + * frame-gtk.c (gtk_create_widgets): + * frame-gtk.c (gtk_init_frame_1): + * frame-gtk.c (gtk_cant_notify_wm_error): + * frame-gtk.c (syms_of_frame_gtk): + * frame-x.c (x_create_widgets): + * frame-x.c (x_init_frame_1): + * frame-x.c (x_cant_notify_wm_error): + * frame-x.c (syms_of_frame_x): + * frame.c (print_frame): + * frame.c (setup_frame_without_minibuffer): + * frame.c (Fmake_frame): + * frame.c (selected_frame): + * frame.c (device_selected_frame): + * frame.c (Fset_frame_selected_window): + * frame.c (delete_frame_internal): + * frame.c (Fmake_frame_invisible): + * frame.c (store_minibuf_frame_prop): + * frame.c (syms_of_frame): + * general-slots.h: + * glade.c (Fglade_xml_textdomain): + * glyphs-gtk.c: + * glyphs-msw.c (console_type_create_glyphs_mswindows): + * glyphs-gtk.c (check_pointer_sizes): + * glyphs-gtk.c (init_image_instance_from_gdk_image): + * glyphs-gtk.c (image_instance_add_gdk_image): + * glyphs-gtk.c (init_image_instance_from_xbm_inline): + * glyphs-gtk.c (write_lisp_string_to_temp_file): + * glyphs-gtk.c (gtk_xpm_instantiate): + * glyphs-gtk.c (gtk_xface_instantiate): + * glyphs-gtk.c (gtk_resource_validate): + * glyphs-gtk.c (gtk_resource_normalize): + * glyphs-gtk.c (gtk_resource_instantiate): + * glyphs-gtk.c (check_valid_resource_symbol): + * glyphs-gtk.c (check_valid_resource_id): + * glyphs-gtk.c (font_instantiate): + * glyphs-gtk.c (cursor_font_instantiate): + * glyphs-gtk.c (gtk_subwindow_instantiate): + * glyphs-gtk.c (syms_of_glyphs_gtk): + * glyphs-msw.c: + * glyphs-msw.c (init_image_instance_from_dibitmap): + * glyphs-msw.c (image_instance_add_dibitmap): + * glyphs-msw.c (mswindows_init_image_instance_from_eimage): + * glyphs-msw.c (xpm_to_eimage): + * glyphs-msw.c (mswindows_xpm_instantiate): + * glyphs-msw.c (mswindows_resource_validate): + * glyphs-msw.c (mswindows_resource_normalize): + * glyphs-msw.c (resource_name_to_resource): + * glyphs-msw.c (mswindows_resource_instantiate): + * glyphs-msw.c (check_valid_resource_symbol): + * glyphs-msw.c (check_valid_resource_id): + * glyphs-msw.c (mswindows_xface_instantiate): + * glyphs-msw.c (mswindows_subwindow_instantiate): + * glyphs-msw.c (mswindows_widget_instantiate): + * glyphs-msw.c (add_tree_item): + * glyphs-msw.c (add_tab_item): + * glyphs-msw.c (mswindows_combo_box_instantiate): + * glyphs-msw.c (syms_of_glyphs_mswindows): + * glyphs-widget.c (check_valid_orientation): + * glyphs-widget.c (check_valid_tab_orientation): + * glyphs-widget.c (check_valid_justification): + * glyphs-widget.c (widget_validate): + * glyphs-widget.c (combo_box_validate): + * glyphs-x.c (write_lisp_string_to_temp_file): + * glyphs-x.c (check_pointer_sizes): + * glyphs-x.c (init_image_instance_from_x_image): + * glyphs-x.c (image_instance_add_x_image): + * glyphs-x.c (init_image_instance_from_xbm_inline): + * glyphs-x.c (x_xpm_instantiate): + * glyphs-x.c (x_xface_instantiate): + * glyphs-x.c (font_instantiate): + * glyphs-x.c (cursor_font_instantiate): + * glyphs-x.c (x_redisplay_widget): + * glyphs-x.c (x_subwindow_instantiate): + * glyphs-x.c (x_widget_instantiate): + * glyphs.c: + * glyphs.c (decode_device_ii_format): + * glyphs.c (process_image_string_instantiator): + * glyphs.c (if): + * glyphs.c (file_or_data_must_be_present): + * glyphs.c (data_must_be_present): + * glyphs.c (face_must_be_present): + * glyphs.c (get_image_instantiator_governing_domain): + * glyphs.c (instantiate_image_instantiator): + * glyphs.c (print_image_instance): + * glyphs.c (decode_image_instance_type): + * glyphs.c (incompatible_image_types): + * glyphs.c (make_image_instance_1): + * glyphs.c (signal_image_error): + * glyphs.c (signal_image_error_2): + * glyphs.c (signal_double_image_error_2): + * glyphs.c (simple_image_type_normalize): + * glyphs.c (check_valid_xbm_inline): + * glyphs.c (bitmap_to_lisp_data): + * glyphs.c (xbm_normalize): + * glyphs.c (xface_normalize): + * glyphs.c (pixmap_to_lisp_data): + * glyphs.c (check_valid_xpm_color_symbols): + * glyphs.c (evaluate_xpm_color_symbols): + * glyphs.c (xpm_normalize): + * glyphs.c (image_instantiate): + * glyphs.c (image_validate): + * glyphs.c (print_glyph): + * glyphs.c (decode_glyph_type): + * glyphs.c (subwindow_instantiate): + * glyphs.c (syms_of_glyphs): + * glyphs.h: + * gpmevent.c (Fgpm_enable): + * gui-gtk.c (syms_of_gui_gtk): + * gui-x.c (button_item_to_widget_value): + * gui-x.c (gui_items_to_widget_values_1): + * gui-x.c (gui_items_to_widget_values): + * gui.c: + * gui.c (gui_item_add_keyval_pair): + * gui.c (make_gui_item_from_keywords_internal): + * gui.c (widget_gui_parse_item_keywords): + * gui.c (update_gui_item_keywords): + * gui.c (signal_too_long_error): + * gui.c (print_gui_item): + * gui.c (parse_gui_item_tree_item): + * gui.c (syms_of_gui): + * gutter.c (decode_gutter_position): + * gutter.c (gutter_validate): + * gutter.c (gutter_size_validate): + * gutter.c (gutter_visible_validate): + * gutter.c (syms_of_gutter): + * hpplay.c: + * hpplay.c (player_error_internal): + * hpplay.c (myHandler): + * hpplay.c (play_bucket_internal): + * hpplay.c (play_sound_file): + * hpplay.c (play_sound_data): + * hpplay.c (vars_of_hpplay): + * indent.c (Findent_to): + * indent.c (syms_of_indent): + * input-method-xlib.c (Fx_open_xim): + * input-method-xlib.c (Fx_close_xim): + * input-method-xlib.c (syms_of_input_method_xlib): + * insdel.c (get_buffer_range_char): + * insdel.c (get_string_range_char): + * insdel.c (make_gap): + * insdel.c (buffer_insert_string_1): + * intl.c (syms_of_intl): + * keymap.c (print_keymap): + * keymap.c (traverse_keymaps): + * keymap.c (check_keymap_definition_loop): + * keymap.c (define_key_check_and_coerce_keysym): + * keymap.c (define_key_parser): + * keymap.c (key_desc_list_to_event): + * keymap.c (ensure_meta_prefix_char_keymapp): + * keymap.c (Fdefine_key): + * keymap.c (Fsingle_key_description): + * keymap.c (Ftext_char_description): + * libsst.c: + * libsst.c (dial;): + * libsst.h: + * libsst.h (sst_dtmf): + * linuxplay.c: + * linuxplay.c (audio_init): + * linuxplay.c (linux_play_data_or_file): + * linuxplay.c (play_sound_file): + * linuxplay.c (play_sound_data): + * lisp.h: + * lread.c (read_syntax_error): + * lread.c (continuable_read_syntax_error): + * lread.c (readchar): + * lread.c (pas_de_lache_ici): + * lread.c (load_force_doc_string_unwind): + * lread.c (Fload_internal): + * lread.c (decode_mode_1): + * lread.c (readevalloop): + * lread.c (Feval_buffer): + * lread.c (read_escape): + * lread.c (FSF_LOSSAGE): + * lread.c (read_atom_0): + * lread.c (reader_nextchar): + * lread.c (read_list_conser): + * lread.c (syms_of_lread): + * lread.c (vars_of_lread): + * lstream.c (Lstream_internal_error): + * lstream.h (wrap_lstream): + * macros.c (Fstart_kbd_macro): + * macros.c (Fend_kbd_macro): + * macros.c (pop_kbd_macro_event): + * macros.c (Fcall_last_kbd_macro): + * macros.c (Fexecute_kbd_macro): + * macros.c (syms_of_macros): + * marker.c (print_marker): + * marker.c (set_marker_internal): + * marker.c (bi_marker_position): + * marker.c (marker_position): + * marker.c (set_bi_marker_position): + * marker.c (set_marker_position): + * md5.c (md5_coding_system): + * menubar-gtk.c (menu_convert): + * menubar-gtk.c (menu_descriptor_to_widget_1): + * menubar-msw.c (mswindows_translate_menu_or_dialog_item): + * menubar-msw.c (populate_menu_add_item): + * menubar-msw.c (populate_or_checksum_helper): + * menubar-msw.c (unsafe_handle_wm_initmenupopup_1): + * menubar-msw.c (mswindows_popup_menu): + * menubar-x.c (menu_item_descriptor_to_widget_value_1): + * menubar-x.c (x_popup_menu): + * menubar-x.c (Faccelerate_menu): + * menubar.c (syms_of_menubar): + * menubar.c (vars_of_menubar): + * minibuf.c (Ftry_completion): + * minibuf.c (syms_of_minibuf): + * miscplay.c: + * miscplay.c (parse_wave_complete): + * miscplay.c (waverequire): + * miscplay.c (parsewave): + * miscplay.c (parsesundecaudio): + * miscplay.c (sndcnv8U_2mono): + * miscplay.c (sndcnv8S_2mono): + * miscplay.c (sndcnv2monounsigned): + * miscplay.c (sndcnv2unsigned): + * miscplay.c (int2ulaw): + * miscplay.c (sndcnvULaw_2linear): + * miscplay.c (sndcnvULaw_2mono): + * miscplay.c (sndcnv16_2monoLE): + * miscplay.c (sndcnv16_2monoBE): + * miscplay.c (sndcnv2byteLE): + * miscplay.c (sndcnv2byteBE): + * miscplay.c (sndcnv2monobyteLE): + * miscplay.c (sndcnv2monobyteBE): + * miscplay.c (analyze_format): + * miscplay.h: + * miscplay.h (HEADERSZ): + * miscplay.h (parse_wave_complete): + * mule-ccl.c (Fccl_execute): + * mule-ccl.c (vars_of_mule_ccl): + * mule-charset.c (print_charset): + * mule-charset.c (get_unallocated_leading_byte): + * mule-charset.c (Fget_charset): + * mule-charset.c (Fmake_charset): + * mule-charset.c (Fcharset_from_attributes): + * mule-charset.c (Fcharset_property): + * mule-charset.c (Fset_charset_ccl_program): + * mule-charset.c (Fmake_char): + * mule-charset.c (Fchar_octet): + * mule-charset.c (lookup_composite_char): + * mule-charset.c (syms_of_mule_charset): + * mule-wnnfns.c (Fwnn_set_param): + * mule-wnnfns.c (syms_of_mule_wnn): + * mule.c (Fdefine_word_pattern): + * nas.c: + * nas.c (XTOOLKIT): + * nas.c (play_sound_file): + * nas.c (close_down_play): + * nas.c (do_caching_play): + * nas.c (play_sound_data): + * nas.c (CatchIoErrorAndJump): + * nas.c (NameFromData): + * nas.c (SndOpenDataForReading): + * nas.c (cmpID): + * nas.c (dread): + * nas.c (dgetc): + * nas.c (readChunk): + * nas.c (WaveOpenDataForReading): + * nas.c (SoundOpenDataForReading): + * ntplay.c: + * ntplay.c (play_sound_file): + * ntplay.c (play_sound_data_1): + * ntplay.c (play_sound_data): + * ntproc.c: + * ntproc.c (prepare_standard_handles): + * ntproc.c (vars_of_ntproc): + * objects-gtk.c (gtk_parse_nearest_color): + * objects-gtk.c (gtk_initialize_font_instance): + * objects-msw.c (mswindows_initialize_color_instance): + * objects-msw.c (initialize_font_instance): + * objects-x.c (x_parse_nearest_color): + * objects-x.c (x_initialize_font_instance): + * objects-x.c (x_font_instance_truename): + * objects.c (finalose): + * objects.c (print_color_instance): + * objects.c (print_font_instance): + * objects.c (font_instance_truename_internal): + * objects.c (color_instantiate): + * objects.c (color_validate): + * objects.c (font_validate): + * objects.c (face_boolean_instantiate): + * objects.c (face_boolean_validate): + * objects.c (syms_of_objects): + * postgresql.c (CHECK_LIVE_CONNECTION): + * postgresql.c (print_pgconn): + * postgresql.c (finalize_pgconn): + * postgresql.c (print_pgresult): + * postgresql.c (finalize_pgresult): + * postgresql.c (Fpq_connectdb): + * postgresql.c (Fpq_connect_start): + * postgresql.c (Fpq_connect_poll): + * postgresql.c (Fpq_set_client_encoding): + * postgresql.c (Fpq_reset_start): + * postgresql.c (Fpq_reset_poll): + * postgresql.c (Fpq_pgconn): + * postgresql.c (Fpq_exec): + * postgresql.c (Fpq_send_query): + * postgresql.c (Fpq_get_result): + * postgresql.c (Fpq_result_status): + * postgresql.c (Fpq_make_empty_pgresult): + * postgresql.c (syms_of_postgresql): + * print.c: + * print.c (print_error_message): + * print.c (print_cons): + * print.c (default_object_printer): + * print.c (Fexternal_debugging_output): + * print.c (Fopen_termscript): + * print.c (syms_of_print): + * process-nt.c: + * process-nt.c (validate_signal_number): + * process-nt.c (mswindows_report_process_error): + * process-nt.c (mswindows_report_winsock_error): + * process-nt.c (nt_create_process): + * process-nt.c (get_internet_address): + * process-nt.c (nt_canonicalize_host_name): + * process-nt.c (nt_open_network_stream): + * process-unix.c (get_internet_address): + * process-unix.c (unix_create_process): + * process-unix.c (unix_send_process): + * process-unix.c (unix_kill_child_process): + * process-unix.c (unix_canonicalize_host_name): + * process-unix.c (unix_open_network_stream): + * process-unix.c (unix_open_multicast_group): + * process.c: + * process.c (print_process): + * process.c (get_process): + * process.c (report_process_error): + * process.c (init_process_io_handles): + * process.c (Fstart_process_internal): + * process.c (send_process): + * process.c (decode_signal): + * process.c (process_send_signal): + * process.c (Fkill_process): + * process.c (Fquit_process): + * process.c (Fstop_process): + * process.c (Fcontinue_process): + * process.c (Fprocess_send_eof): + * process.c (syms_of_process): + * ralloc.c (syms_of_ralloc): + * rangetab.c (Fput_range_table): + * rangetab.c (rangetab_data_validate): + * rangetab.c (syms_of_rangetab): + * redisplay.c (syms_of_redisplay): + * scrollbar.c (syms_of_scrollbar): + * search.c (matcher_overflow): + * search.c (compile_pattern_1): + * search.c (skip_chars): + * search.c (search_command): + * search.c (Freplace_match): + * search.c (Fmatch_data): + * search.c (syms_of_search): + * select-gtk.c (gtk_get_foreign_selection): + * select-gtk.c (gtk_get_window_property_as_lisp_data): + * select-gtk.c (lisp_data_to_selection_data): + * select-x.c (motif_clipboard_cb): + * select-x.c (x_reply_selection_request): + * select-x.c (copy_multiple_data): + * select-x.c (x_get_foreign_selection): + * select-x.c (x_get_window_property_as_lisp_data): + * select-x.c (lisp_data_to_selection_data): + * select-x.c (CHECK_CUTBUFFER): + * select-x.c (Fx_get_cutbuffer_internal): + * select-x.c (syms_of_select_x): + * select.c (Fown_selection_internal): + * select.c (syms_of_select): + * sgiplay.c: + * sgiplay.c (play_sound_file): + * sgiplay.c (play_sound_data): + * sgiplay.c (audio_initialize): + * sgiplay.c (play_internal): + * sgiplay.c (write_mulaw_8_chunk): + * sgiplay.c (write_linear_chunk): + * sgiplay.c (initialize_audio_port): + * sgiplay.c (open_audio_port): + * sgiplay.c (set_channels): + * sgiplay.c (set_output_format): + * sgiplay.c (struct): + * sgiplay.c (parse_snd_header): + * sheap.c (sheap_adjust_h): + * sound.c: + * sound.c (report_sound_error): + * sound.c (Fplay_sound_file): + * sound.c (Fplay_sound): + * sound.c (Fding): + * sound.c (init_nas_sound): + * sound.c (init_native_sound): + * sound.c (syms_of_sound): + * specifier.c: + * specifier.c (print_specifier): + * specifier.c (decode_specifier_type): + * specifier.c (check_valid_locale_or_locale_type): + * specifier.c (decode_locale): + * specifier.c (decode_locale_type): + * specifier.c (check_valid_domain): + * specifier.c (decode_specifier_tag_set): + * specifier.c (Fcanonicalize_tag_set): + * specifier.c (Fdefine_specifier_tag): + * specifier.c (Fspecifier_tag_predicate): + * specifier.c (check_valid_inst_list): + * specifier.c (check_valid_spec_list): + * specifier.c (decode_how_to_add_specification): + * specifier.c (check_modifiable_specifier): + * specifier.c (Fcopy_specifier): + * specifier.c (check_valid_specifier_matchspec): + * specifier.c (specifier_instance): + * specifier.c (boolean_validate): + * specifier.c (syms_of_specifier): + * sunplay.c: + * sunplay.c (init_device): + * sunplay.c (play_sound_file): + * sunplay.c (play_sound_data): + * symbols.c (oblookup): + * symbols.c (reject_constant_symbols): + * symbols.c (verify_ok_for_buffer_local): + * symbols.c (Fset): + * symbols.c (decode_magic_handler_type): + * symbols.c (handler_type_from_function_symbol): + * symbols.c (Fdefvaralias): + * symbols.c (init_symbols_once_early): + * symeval.h: + * symsinit.h: + * syntax.c (scan_lists): + * syntax.c (scan_sexps_forward): + * syntax.c (syms_of_syntax): + * sysdep.c (stuff_char): + * sysdep.c (sys_subshell): + * sysdep.c (dup2): + * toolbar-msw.c (mswindows_output_toolbar): + * toolbar.c (decode_toolbar_position): + * toolbar.c (compute_frame_toolbar_buttons): + * toolbar.c (CTB_ERROR): + * toolbar.c (check_toolbar_button_keywords): + * toolbar.c (toolbar_validate): + * toolbar.c (syms_of_toolbar): + * tooltalk.c (print_tooltalk_message): + * tooltalk.c (print_tooltalk_pattern): + * tooltalk.c (check_status): + * tooltalk.c (Ftooltalk_open_connection): + * tooltalk.c (syms_of_tooltalk): + * ui-byhand.c (Fgtk_box_query_child_packing): + * ui-byhand.c (Fgtk_button_box_get_child_size): + * ui-byhand.c (Fgtk_calendar_get_date): + * ui-byhand.c (Fgtk_clist_get_text): + * ui-byhand.c (Fgtk_clist_get_selection): + * ui-byhand.c (Fgtk_clist_get_pixmap): + * ui-byhand.c (Fgtk_clist_get_pixtext): + * ui-byhand.c (Fgtk_color_selection_get_color): + * ui-byhand.c (Fgtk_editable_insert_text): + * ui-byhand.c (Fgtk_pixmap_get): + * ui-byhand.c (Fgtk_curve_get_vector): + * ui-byhand.c (Fgtk_curve_set_vector): + * ui-byhand.c (Fgtk_label_get): + * ui-byhand.c (Fgtk_notebook_query_tab_label_packing): + * ui-byhand.c (Fgtk_widget_get_pointer): + * ui-byhand.c (generic_toolbar_insert_item): + * ui-gtk.c (Fdll_load): + * ui-gtk.c (ffi_object_printer): + * ui-gtk.c (Fgtk_import_variable_internal): + * ui-gtk.c (Fgtk_import_function_internal): + * ui-gtk.c (Fgtk_call_function): + * ui-gtk.c (emacs_gtk_object_printer): + * ui-gtk.c (object_getprop): + * ui-gtk.c (object_putprop): + * ui-gtk.c (emacs_gtk_object_finalizer): + * ui-gtk.c (emacs_gtk_boxed_printer): + * ui-gtk.c (Fgtk_fundamental_type): + * ui-gtk.c (Fgtk_describe_type): + * ui-gtk.c (syms_of_ui_gtk): + * ui-gtk.c (lisp_to_gtk_type): + * ui-gtk.c (symbol_to_enum): + * ui-gtk.c (enum_to_symbol): + * undo.c (Fprimitive_undo): + * undo.c (syms_of_undo): + * unexaix.c (report_error): + * unexaix.c (report_error_1): + * unexapollo.c (unexec): + * unexapollo.c (CopyData): + * unexconvex.c (report_error): + * unexconvex.c (a2;): + * unexec.c (report_error): + * unexec.c (report_error_1): + * widget.c (syms_of_widget): + * win32.c (Fmswindows_shell_execute): + * window.c (print_window): + * window.c (Fdelete_window): + * window.c (Fdelete_other_windows): + * window.c (Fset_window_buffer): + * window.c (Fselect_window): + * window.c (Fsplit_window): + * window.c (change_window_height): + * window.c (window_scroll): + * window.c (Fother_window_for_scrolling): + * window.c (print_window_config): + * window.c (syms_of_window): + -- 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. + 2001-05-23 Ben Wing * event-msw.c (winsock_writer): diff -r c775bd016b32 -r 183866b06e0b src/Makefile.in.in --- a/src/Makefile.in.in Thu May 24 06:30:21 2001 +0000 +++ b/src/Makefile.in.in Thu May 24 07:51:33 2001 +0000 @@ -190,7 +190,7 @@ eval.o events.o $(extra_objs)\ event-stream.o extents.o faces.o\ fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o font-lock.o\ - frame.o general.o glyphs.o glyphs-eimage.o glyphs-widget.o\ + frame.o general.o glyphs.o glyphs-eimage.o glyphs-shared.o glyphs-widget.o\ gui.o gutter.o $(gui_objs) hash.o imgproc.o indent.o insdel.o intl.o\ keymap.o $(RTC_patch_objs) line-number.o lread.o lstream.o\ macros.o marker.o md5.o minibuf.o objects.o opaque.o\ diff -r c775bd016b32 -r 183866b06e0b src/abbrev.c --- a/src/abbrev.c Thu May 24 06:30:21 2001 +0000 +++ b/src/abbrev.c Thu May 24 07:51:33 2001 +0000 @@ -404,7 +404,7 @@ void syms_of_abbrev (void) { - defsymbol (&Qpre_abbrev_expand_hook, "pre-abbrev-expand-hook"); + DEFSYMBOL (Qpre_abbrev_expand_hook); DEFSUBR (Fexpand_abbrev); } diff -r c775bd016b32 -r 183866b06e0b src/alloc.c --- a/src/alloc.c Thu May 24 06:30:21 2001 +0000 +++ b/src/alloc.c Thu May 24 07:51:33 2001 +0000 @@ -236,7 +236,7 @@ Fset (Qvalues, Qnil); Vcommand_history = Qnil; - error ("Memory exhausted"); + out_of_memory ("Memory exhausted", Qunbound); } /* like malloc and realloc but check for no memory left, and block input. */ @@ -1433,7 +1433,7 @@ if (EQ (symbol, Qt) || EQ (symbol, Qnil) || SYMBOL_IS_KEYWORD (symbol)) - signal_simple_error_2 + invalid_constant_2 ("Invalid constant symbol in formal parameter list", symbol, arglist); } @@ -3271,7 +3271,7 @@ return; frame = DEVICE_SELECTED_FRAME (XDEVICE (device)); if (NILP (frame)) - signal_simple_error ("No frames exist on device", device); + invalid_state ("No frames exist on device", device); f = XFRAME (frame); } diff -r c775bd016b32 -r 183866b06e0b src/buffer.c --- a/src/buffer.c Thu May 24 06:30:21 2001 +0000 +++ b/src/buffer.c Thu May 24 07:51:33 2001 +0000 @@ -260,10 +260,9 @@ if (print_readably) { if (!BUFFER_LIVE_P (b)) - error ("printing unreadable object #"); + printing_unreadable_object ("#"); else - error ("printing unreadable object #", - XSTRING_DATA (b->name)); + printing_unreadable_object ("#", XSTRING_DATA (b->name)); } else if (!BUFFER_LIVE_P (b)) write_c_string ("#", printcharfun); @@ -306,8 +305,8 @@ nsberror (Lisp_Object spec) { if (STRINGP (spec)) - error ("No buffer named %s", XSTRING_DATA (spec)); - signal_simple_error ("Invalid buffer argument", spec); + invalid_argument ("No buffer named", spec); + invalid_argument ("Invalid buffer argument", spec); } DEFUN ("buffer-list", Fbuffer_list, 0, 1, 0, /* @@ -619,7 +618,8 @@ return buf; if (XSTRING_LENGTH (name) == 0) - error ("Empty string for buffer name is not allowed"); + invalid_argument ("Empty string for buffer name is not allowed", + Qunbound); b = allocate_buffer (); @@ -660,9 +660,9 @@ CHECK_STRING (name); name = LISP_GETTEXT (name); if (!NILP (Fget_buffer (name))) - signal_simple_error ("Buffer name already in use", name); + invalid_argument ("Buffer name already in use", name); if (XSTRING_LENGTH (name) == 0) - error ("Empty string for buffer name is not allowed"); + invalid_argument ("Empty string for buffer name is not allowed", Qunbound); b = allocate_buffer (); @@ -948,7 +948,7 @@ newname = LISP_GETTEXT (newname); if (XSTRING_LENGTH (newname) == 0) - error ("Empty string is invalid as a buffer name"); + invalid_argument ("Empty string is invalid as a buffer name", Qunbound); tem = Fget_buffer (newname); /* Don't short-circuit if UNIQUE is t. That is a useful way to rename @@ -963,8 +963,7 @@ if (!NILP (unique)) newname = Fgenerate_new_buffer_name (newname, current_buffer->name); else - error ("Buffer name \"%s\" is in use", - XSTRING_DATA (newname)); + invalid_argument ("Buffer name is in use", newname); } current_buffer->name = newname; @@ -1498,7 +1497,7 @@ { buffer = get_buffer (buffer, 0); if (NILP (buffer)) - error ("Selecting deleted or non-existent buffer"); + invalid_operation ("Selecting deleted or non-existent buffer", Qunbound); set_buffer_internal (XBUFFER (buffer)); return buffer; } @@ -1586,7 +1585,7 @@ before = get_buffer (before, 1); if (EQ (before, buffer)) - error ("Cannot place a buffer before itself"); + invalid_operation ("Cannot place a buffer before itself", Qunbound); bury_buffer_1 (buffer, before, &Vbuffer_alist); bury_buffer_1 (buffer, before, &selected_frame ()->buffer_alist); @@ -1925,12 +1924,12 @@ if (size_in_bytes == 0) break; else if (size_in_bytes < 0) - error ("Error converting to external format"); + signal_error (Qtext_conversion_error, "Error converting to external format", Qunbound); size_in_bytes = Lstream_write (writer, tempbuf, size_in_bytes); if (size_in_bytes <= 0) - error ("Error converting to external format"); + signal_error (Qtext_conversion_error, "Error converting to external format", Qunbound); } /* Closing writer will close any stream at the other end of writer. */ @@ -2063,12 +2062,12 @@ if (size_in_bytes == 0) break; else if (size_in_bytes < 0) - error ("Error converting to internal format"); + signal_error (Qtext_conversion_error, "Error converting to internal format", Qunbound); size_in_bytes = Lstream_write (writer, tempbuf, size_in_bytes); if (size_in_bytes <= 0) - error ("Error converting to internal format"); + signal_error (Qtext_conversion_error, "Error converting to internal format", Qunbound); } /* Closing writer will close any stream at the other end of writer. */ @@ -2097,31 +2096,31 @@ { INIT_LRECORD_IMPLEMENTATION (buffer); - defsymbol (&Qbuffer_live_p, "buffer-live-p"); - defsymbol (&Qbuffer_or_string_p, "buffer-or-string-p"); - defsymbol (&Qmode_class, "mode-class"); - defsymbol (&Qrename_auto_save_file, "rename-auto-save-file"); - defsymbol (&Qkill_buffer_hook, "kill-buffer-hook"); - defsymbol (&Qpermanent_local, "permanent-local"); - - defsymbol (&Qfirst_change_hook, "first-change-hook"); - defsymbol (&Qbefore_change_functions, "before-change-functions"); - defsymbol (&Qafter_change_functions, "after-change-functions"); + DEFSYMBOL (Qbuffer_live_p); + DEFSYMBOL (Qbuffer_or_string_p); + DEFSYMBOL (Qmode_class); + DEFSYMBOL (Qrename_auto_save_file); + DEFSYMBOL (Qkill_buffer_hook); + DEFSYMBOL (Qpermanent_local); + + DEFSYMBOL (Qfirst_change_hook); + DEFSYMBOL (Qbefore_change_functions); + DEFSYMBOL (Qafter_change_functions); /* #### Obsolete, for compatibility */ - defsymbol (&Qbefore_change_function, "before-change-function"); - defsymbol (&Qafter_change_function, "after-change-function"); - - defsymbol (&Qdefault_directory, "default-directory"); - - defsymbol (&Qget_file_buffer, "get-file-buffer"); - defsymbol (&Qchange_major_mode_hook, "change-major-mode-hook"); - - defsymbol (&Qfundamental_mode, "fundamental-mode"); - - defsymbol (&Qfind_file_compare_truenames, "find-file-compare-truenames"); - - defsymbol (&Qswitch_to_buffer, "switch-to-buffer"); + DEFSYMBOL (Qbefore_change_function); + DEFSYMBOL (Qafter_change_function); + + DEFSYMBOL (Qdefault_directory); + + DEFSYMBOL (Qget_file_buffer); + DEFSYMBOL (Qchange_major_mode_hook); + + DEFSYMBOL (Qfundamental_mode); + + DEFSYMBOL (Qfind_file_compare_truenames); + + DEFSYMBOL (Qswitch_to_buffer); DEFSUBR (Fbufferp); DEFSUBR (Fbuffer_live_p); diff -r c775bd016b32 -r 183866b06e0b src/bytecode.c --- a/src/bytecode.c Thu May 24 06:30:21 2001 +0000 +++ b/src/bytecode.c Thu May 24 07:51:33 2001 +0000 @@ -211,8 +211,6 @@ typedef unsigned char Opbyte; -static void invalid_byte_code_error (char *error_message, ...); - Lisp_Object * execute_rare_opcode (Lisp_Object *stack_ptr, const Opbyte *program_ptr, Opcode opcode); @@ -634,9 +632,9 @@ REGISTER Opcode opcode = (Opcode) READ_UINT_1; #ifdef ERROR_CHECK_BYTE_CODE if (stack_ptr > stack_end) - invalid_byte_code_error ("byte code stack overflow"); + stack_overflow ("byte code stack overflow", Qunbound); if (stack_ptr < stack_beg) - invalid_byte_code_error ("byte code stack underflow"); + stack_overflow ("byte code stack underflow", Qunbound); #endif #ifdef BYTE_CODE_METER @@ -842,7 +840,7 @@ #ifdef ERROR_CHECK_BYTE_CODE /* Binds and unbinds are supposed to be compiled balanced. */ if (specpdl_depth() != speccount) - invalid_byte_code_error ("unbalanced specbinding stack"); + invalid_byte_code ("unbalanced specbinding stack", Qunbound); #endif return TOP; @@ -1481,20 +1479,10 @@ } -static void -invalid_byte_code_error (char *error_message, ...) +DOESNT_RETURN +invalid_byte_code (const char *reason, Lisp_Object frob) { - Lisp_Object obj; - va_list args; - char *buf = alloca_array (char, strlen (error_message) + 128); - - sprintf (buf, "%s", error_message); - va_start (args, error_message); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (buf), Qnil, -1, - args); - va_end (args); - - signal_error (Qinvalid_byte_code, list1 (obj)); + signal_error (Qinvalid_byte_code, reason, frob); } /* Check for valid opcodes. Change this when adding new opcodes. */ @@ -1504,8 +1492,8 @@ if ((opcode < Bvarref) || (opcode == 0251) || (opcode > Bassq && opcode < Bconstant)) - invalid_byte_code_error - ("invalid opcode %d in instruction stream", opcode); + invalid_byte_code ("invalid opcode in instruction stream", + make_int (opcode)); } /* Check that IDX is a valid offset into the `constants' vector */ @@ -1513,19 +1501,20 @@ check_constants_index (int idx, Lisp_Object constants) { if (idx < 0 || idx >= XVECTOR_LENGTH (constants)) - invalid_byte_code_error - ("reference %d to constants array out of range 0, %d", + signal_ferror + (Qinvalid_byte_code, + "reference %d to constants array out of range 0, %ld", idx, XVECTOR_LENGTH (constants) - 1); } /* Get next character from Lisp instructions string. */ -#define READ_INSTRUCTION_CHAR(lvalue) do { \ - (lvalue) = charptr_emchar (ptr); \ - INC_CHARPTR (ptr); \ - *icounts_ptr++ = program_ptr - program; \ - if (lvalue > UCHAR_MAX) \ - invalid_byte_code_error \ - ("Invalid character %c in byte code string"); \ +#define READ_INSTRUCTION_CHAR(lvalue) do { \ + (lvalue) = charptr_emchar (ptr); \ + INC_CHARPTR (ptr); \ + *icounts_ptr++ = program_ptr - program; \ + if (lvalue > UCHAR_MAX) \ + invalid_byte_code \ + ("Invalid character in byte code string", make_char (lvalue)); \ } while (0) /* Get opcode from Lisp instructions string. */ @@ -1653,10 +1642,9 @@ check_constants_index (arg, constants); val = XVECTOR_DATA (constants) [arg]; if (!SYMBOLP (val)) - invalid_byte_code_error ("variable reference to non-symbol %S", val); + invalid_byte_code ("variable reference to non-symbol", val); if (EQ (val, Qnil) || EQ (val, Qt) || (SYMBOL_IS_KEYWORD (val))) - invalid_byte_code_error ("variable reference to constant symbol %s", - string_data (XSYMBOL (val)->name)); + invalid_byte_code ("variable reference to constant symbol", val); WRITE_NARGS (Bvarref); break; @@ -1669,10 +1657,9 @@ check_constants_index (arg, constants); val = XVECTOR_DATA (constants) [arg]; if (!SYMBOLP (val)) - invalid_byte_code_error ("attempt to set non-symbol %S", val); + wtaerror ("attempt to set non-symbol", val); if (EQ (val, Qnil) || EQ (val, Qt)) - invalid_byte_code_error ("attempt to set constant symbol %s", - string_data (XSYMBOL (val)->name)); + signal_error (Qsetting_constant, 0, val); /* Ignore assignments to keywords by converting to Bdiscard. For backward compatibility only - we'd like to make this an error. */ if (SYMBOL_IS_KEYWORD (val)) @@ -1691,10 +1678,10 @@ check_constants_index (arg, constants); val = XVECTOR_DATA (constants) [arg]; if (!SYMBOLP (val)) - invalid_byte_code_error ("attempt to let-bind non-symbol %S", val); + wtaerror ("attempt to let-bind non-symbol", val); if (EQ (val, Qnil) || EQ (val, Qt) || (SYMBOL_IS_KEYWORD (val))) - invalid_byte_code_error ("attempt to let-bind constant symbol %s", - string_data (XSYMBOL (val)->name)); + signal_error (Qsetting_constant, + "attempt to let-bind constant symbol", val); WRITE_NARGS (Bvarbind); break; @@ -1740,8 +1727,7 @@ jumps_ptr->to = jumps_ptr->from + arg; jumps_ptr++; if (arg >= -1 && arg <= argsize) - invalid_byte_code_error - ("goto instruction is its own target"); + invalid_byte_code ("goto instruction is its own target", Qunbound); if (arg <= SCHAR_MIN || arg > SCHAR_MAX) { @@ -2347,7 +2333,8 @@ { Lisp_Object tem = read_doc_string (f->instructions); if (!CONSP (tem)) - signal_simple_error ("Invalid lazy-loaded byte code", tem); + signal_error (Qinvalid_byte_code, + "Invalid lazy-loaded byte code", tem); /* v18 or v19 bytecode file. Need to Ebolify. */ if (f->flags.ebolified && VECTORP (XCDR (tem))) ebolify_bytecode_constants (XCDR (tem)); @@ -2412,8 +2399,8 @@ INIT_LRECORD_IMPLEMENTATION (compiled_function); DEFERROR_STANDARD (Qinvalid_byte_code, Qinvalid_state); - defsymbol (&Qbyte_code, "byte-code"); - defsymbol (&Qcompiled_functionp, "compiled-function-p"); + DEFSYMBOL (Qbyte_code); + DEFSYMBOL_MULTIWORD_PREDICATE (Qcompiled_functionp); DEFSUBR (Fbyte_code); DEFSUBR (Ffetch_bytecode); @@ -2432,7 +2419,7 @@ #endif #ifdef BYTE_CODE_METER - defsymbol (&Qbyte_code_meter, "byte-code-meter"); + DEFSYMBOL (Qbyte_code_meter); #endif } diff -r c775bd016b32 -r 183866b06e0b src/callint.c --- a/src/callint.c Thu May 24 06:30:21 2001 +0000 +++ b/src/callint.c Thu May 24 07:51:33 2001 +0000 @@ -254,11 +254,11 @@ Lisp_Object tem; if (zmacs_regions && !zmacs_region_active_p) - error ("The region is not active now"); + invalid_operation ("The region is not active now", Qunbound); tem = Fmarker_buffer (current_buffer->mark); if (NILP (tem) || (XBUFFER (tem) != current_buffer)) - error ("The mark is not set now"); + invalid_operation ("The mark is not set now", Qunbound); return marker_position (current_buffer->mark); } @@ -499,7 +499,7 @@ prompt_data = (const char *) XSTRING_DATA (specs); if (prompt_data[prompt_index] == '+') - error ("`+' is not used in `interactive' for ordinary commands"); + syntax_error ("`+' is not used in `interactive' for ordinary commands", Qunbound); else if (prompt_data[prompt_index] == '*') { prompt_index++; @@ -528,7 +528,7 @@ if (MINI_WINDOW_P (XWINDOW (window)) && ! (minibuf_level > 0 && EQ (window, minibuf_window))) - error ("Attempt to select inactive minibuffer window"); + invalid_operation ("Attempt to select inactive minibuffer window", Qunbound); #if 0 /* unclean! see event-stream.c */ /* If the current buffer wants to clean up, let it. */ @@ -737,10 +737,9 @@ #endif if (NILP (event)) - error ("%s must be bound to a mouse or misc-user event", - (SYMBOLP (function) - ? (char *) string_data (XSYMBOL (function)->name) - : "command")); + signal_error (Qinvalid_operation, + "function must be bound to a mouse or misc-user event", + function); args[argnum] = event; mouse_event_count++; break; @@ -959,9 +958,10 @@ case '+': default: { - error ("Invalid `interactive' control letter \"%c\" (#o%03o).", - prompt_data[prompt_index], - prompt_data[prompt_index]); + signal_ferror (Qsyntax_error, + "Invalid `interactive' control letter \"%c\" (#o%03o).", + prompt_data[prompt_index], + prompt_data[prompt_index]); } } #undef PROMPT @@ -1035,30 +1035,30 @@ void syms_of_callint (void) { - defsymbol (&Qcall_interactively, "call-interactively"); - defsymbol (&Qread_from_minibuffer, "read-from-minibuffer"); - defsymbol (&Qcompleting_read, "completing-read"); - defsymbol (&Qread_file_name, "read-file-name"); - defsymbol (&Qread_directory_name, "read-directory-name"); - defsymbol (&Qread_string, "read-string"); - defsymbol (&Qread_buffer, "read-buffer"); - defsymbol (&Qread_variable, "read-variable"); - defsymbol (&Qread_function, "read-function"); - defsymbol (&Qread_command, "read-command"); - defsymbol (&Qread_number, "read-number"); - defsymbol (&Qread_expression, "read-expression"); + DEFSYMBOL (Qcall_interactively); + DEFSYMBOL (Qread_from_minibuffer); + DEFSYMBOL (Qcompleting_read); + DEFSYMBOL (Qread_file_name); + DEFSYMBOL (Qread_directory_name); + DEFSYMBOL (Qread_string); + DEFSYMBOL (Qread_buffer); + DEFSYMBOL (Qread_variable); + DEFSYMBOL (Qread_function); + DEFSYMBOL (Qread_command); + DEFSYMBOL (Qread_number); + DEFSYMBOL (Qread_expression); #if defined(MULE) || defined(FILE_CODING) - defsymbol (&Qread_coding_system, "read-coding-system"); - defsymbol (&Qread_non_nil_coding_system, "read-non-nil-coding-system"); + DEFSYMBOL (Qread_coding_system); + DEFSYMBOL (Qread_non_nil_coding_system); #endif - defsymbol (&Qevents_to_keys, "events-to-keys"); - defsymbol (&Qcommand_debug_status, "command-debug-status"); - defsymbol (&Qenable_recursive_minibuffers, "enable-recursive-minibuffers"); + DEFSYMBOL (Qevents_to_keys); + DEFSYMBOL (Qcommand_debug_status); + DEFSYMBOL (Qenable_recursive_minibuffers); defsymbol (&QletX, "let*"); - defsymbol (&Qsave_excursion, "save-excursion"); + DEFSYMBOL (Qsave_excursion); #if 0 /* ill-conceived */ - defsymbol (&Qmouse_leave_buffer_hook, "mouse-leave-buffer-hook"); + DEFSYMBOL (Qmouse_leave_buffer_hook); #endif DEFSUBR (Finteractive); diff -r c775bd016b32 -r 183866b06e0b src/callproc.c --- a/src/callproc.c Thu May 24 06:30:21 2001 +0000 +++ b/src/callproc.c Thu May 24 07:51:33 2001 +0000 @@ -138,20 +138,6 @@ return Qnil; } -static Lisp_Object fork_error; -#if 0 /* UNUSED */ -static void -report_fork_error (char *string, Lisp_Object data) -{ - Lisp_Object errstring = lisp_strerror (errno); - - fork_error = Fcons (build_string (string), Fcons (errstring, data)); - - /* terminate this branch of the fork, without closing stdin/out/etc. */ - _exit (1); -} -#endif /* unused */ - DEFUN ("old-call-process-internal", Fold_call_process_internal, 1, MANY, 0, /* Call PROGRAM synchronously in separate process, with coding-system specified. Arguments are @@ -202,7 +188,7 @@ #if defined (NO_SUBPROCESSES) /* Without asynchronous processes we cannot have BUFFER == 0. */ if (nargs >= 3 && !INTP (args[2])) - error ("Operating system cannot handle asynchronous subprocesses"); + signal_error (Qunimplemented, "Operating system cannot handle asynchronous subprocesses", Qunbound); #endif /* NO_SUBPROCESSES */ /* Do all filename munging before building new_argv because GC in @@ -233,8 +219,8 @@ /* This is in FSF, but it breaks everything in the presence of ange-ftp-visited files, so away with it. */ if (NILP (Ffile_accessible_directory_p (current_dir))) - report_file_error ("Setting current directory", - Fcons (current_buffer->directory, Qnil)); + signal_error (Qprocess_error, "Setting current directory", + current_buffer->directory); #endif /* 0 */ NUNGCPRO; } @@ -308,12 +294,12 @@ new_argv[max(nargs - 3,1)] = 0; if (NILP (path)) - report_file_error ("Searching for program", Fcons (args[0], Qnil)); + signal_error (Qprocess_error, "Searching for program", args[0]); new_argv[0] = (char *) XSTRING_DATA (path); filefd = open ((char *) XSTRING_DATA (infile), O_RDONLY | OPEN_BINARY, 0); if (filefd < 0) - report_file_error ("Opening process input file", Fcons (infile, Qnil)); + report_process_error ("Opening process input file", infile); if (INTP (buffer)) { @@ -368,10 +354,9 @@ if (fd1 >= 0) close (fd1); errno = save_errno; - report_file_error ("Cannot open", Fcons(error_file, Qnil)); + report_process_error ("Cannot open", error_file); } - fork_error = Qnil; #ifdef WIN32_NATIVE pid = child_setup (filefd, fd1, fd_error, new_argv, (char *) XSTRING_DATA (current_dir)); @@ -424,9 +409,6 @@ close (fd1); } - if (!NILP (fork_error)) - signal_error (Qfile_error, fork_error); - #ifndef WIN32_NATIVE if (pid < 0) { @@ -434,7 +416,7 @@ if (fd[0] >= 0) close (fd[0]); errno = save_errno; - report_file_error ("Doing fork", Qnil); + report_process_error ("Doing fork", Qunbound); } #endif @@ -787,7 +769,7 @@ (const char* const*)env); if (cpid == -1) /* An error occurred while trying to spawn the process. */ - report_file_error ("Spawning child process", Qnil); + report_process_error ("Spawning child process", Qunbound); reset_standard_handles (in, out, err, handles); return cpid; #else /* not WIN32_NATIVE */ diff -r c775bd016b32 -r 183866b06e0b src/casetab.c --- a/src/casetab.c Thu May 24 06:30:21 2001 +0000 +++ b/src/casetab.c Thu May 24 07:51:33 2001 +0000 @@ -74,7 +74,7 @@ Lisp_Case_Table *ct = XCASE_TABLE (obj); char buf[200]; if (print_readably) - error ("printing unreadable object #header.uid); + printing_unreadable_object ("#header.uid); write_c_string ("#", ct->header.uid); write_c_string (buf, printcharfun); @@ -176,7 +176,7 @@ else if (EQ (char_case, Qupcase)) return case_table_char (character, XCASE_TABLE_UPCASE (case_table)); else - signal_simple_error ("Char case must be downcase or upcase", char_case); + invalid_constant ("Char case must be downcase or upcase", char_case); return Qnil; /* Not reached. */ } @@ -212,7 +212,7 @@ Fput_char_table (character, value, XCASE_TABLE_EQV (case_table)); } else - signal_simple_error ("Char case must be downcase or upcase", char_case); + invalid_constant ("Char case must be downcase or upcase", char_case); return Qnil; } @@ -447,9 +447,9 @@ { INIT_LRECORD_IMPLEMENTATION (case_table); - defsymbol (&Qcase_tablep, "case-table-p"); - defsymbol (&Qdowncase, "downcase"); - defsymbol (&Qupcase, "upcase"); + DEFSYMBOL_MULTIWORD_PREDICATE (Qcase_tablep); + DEFSYMBOL (Qdowncase); + DEFSYMBOL (Qupcase); DEFSUBR (Fcase_table_p); DEFSUBR (Fget_case_table); diff -r c775bd016b32 -r 183866b06e0b src/chartab.c --- a/src/chartab.c Thu May 24 06:30:21 2001 +0000 +++ b/src/chartab.c Thu May 24 07:51:33 2001 +0000 @@ -211,7 +211,7 @@ if (EQ (symbol, Qcategory)) return CHAR_TABLE_TYPE_CATEGORY; #endif - signal_simple_error ("Unrecognized char table type", symbol); + invalid_constant ("Unrecognized char table type", symbol); return CHAR_TABLE_TYPE_GENERIC; /* not reached */ } @@ -729,14 +729,14 @@ } #ifndef MULE else - signal_simple_error ("Range must be t or a character", range); + sferror ("Range must be t or a character", range); #else /* MULE */ else if (VECTORP (range)) { Lisp_Vector *vec = XVECTOR (range); Lisp_Object *elts = vector_data (vec); if (vector_length (vec) != 2) - signal_simple_error ("Length of charset row vector must be 2", + sferror ("Length of charset row vector must be 2", range); outrange->type = CHARTAB_RANGE_ROW; outrange->charset = Fget_charset (elts[0]); @@ -746,7 +746,7 @@ { case CHARSET_TYPE_94: case CHARSET_TYPE_96: - signal_simple_error ("Charset in row vector must be multi-byte", + sferror ("Charset in row vector must be multi-byte", outrange->charset); case CHARSET_TYPE_94X94: check_int_range (outrange->row, 33, 126); @@ -761,7 +761,7 @@ else { if (!CHARSETP (range) && !SYMBOLP (range)) - signal_simple_error + sferror ("Char table range must be t, charset, char, or vector", range); outrange->type = CHARTAB_RANGE_CHARSET; outrange->charset = Fget_charset (range); @@ -979,8 +979,9 @@ case CHAR_TABLE_TYPE_DISPLAY: /* #### fix this */ - maybe_signal_simple_error ("Display char tables not yet implemented", - value, Qchar_table, errb); + maybe_signal_error (Qunimplemented, + "Display char tables not yet implemented", + value, Qchar_table, errb); return 0; case CHAR_TABLE_TYPE_CHAR: @@ -1494,12 +1495,12 @@ rest = XCDR (rest); if (!CONSP (rest)) - signal_simple_error ("Invalid list format", value); + signal_error (Qlist_formation_error, "Invalid list format", value); if (CONSP (range)) { if (!CONSP (XCDR (range)) || !NILP (XCDR (XCDR (range)))) - signal_simple_error ("Invalid range format", range); + sferror ("Invalid range format", range); decode_char_table_range (XCAR (range), &dummy); decode_char_table_range (XCAR (XCDR (range)), &dummy); } @@ -1617,7 +1618,7 @@ Lisp_Char_Table *ctbl; #ifdef ERROR_CHECK_TYPECHECK if (NILP (Fcategory_table_p (table))) - signal_simple_error ("Expected category table", table); + wtaerror ("Expected category table", table); #endif ctbl = XCHAR_TABLE (table); temp = get_char_table (ch, ctbl); @@ -1806,13 +1807,13 @@ #ifdef MULE INIT_LRECORD_IMPLEMENTATION (char_table_entry); - defsymbol (&Qcategory_table_p, "category-table-p"); - defsymbol (&Qcategory_designator_p, "category-designator-p"); - defsymbol (&Qcategory_table_value_p, "category-table-value-p"); + DEFSYMBOL (Qcategory_table_p); + DEFSYMBOL (Qcategory_designator_p); + DEFSYMBOL (Qcategory_table_value_p); #endif /* MULE */ - defsymbol (&Qchar_table, "char-table"); - defsymbol (&Qchar_tablep, "char-table-p"); + DEFSYMBOL (Qchar_table); + DEFSYMBOL_MULTIWORD_PREDICATE (Qchar_tablep); DEFSUBR (Fchar_table_p); DEFSUBR (Fchar_table_type_list); diff -r c775bd016b32 -r 183866b06e0b src/cmdloop.c --- a/src/cmdloop.c Thu May 24 06:30:21 2001 +0000 +++ b/src/cmdloop.c Thu May 24 07:51:33 2001 +0000 @@ -248,7 +248,7 @@ * signal an error here to avoid the loop. */ if (in_menu_callback) - error ("Attempt to enter command_loop_3 inside menu callback"); + invalid_operation ("Attempt to enter command_loop_3 inside menu callback", Qunbound); #endif /* LWLIB_MENUBARS_LUCID */ /* This function can GC */ for (;;) @@ -606,10 +606,10 @@ void syms_of_cmdloop (void) { - defsymbol (&Qcommand_error, "command-error"); - defsymbol (&Qreally_early_error_handler, "really-early-error-handler"); - defsymbol (&Qtop_level, "top-level"); - defsymbol (&Qerrors_deactivate_region, "errors-deactivate-region"); + DEFSYMBOL (Qcommand_error); + DEFSYMBOL (Qreally_early_error_handler); + DEFSYMBOL (Qtop_level); + DEFSYMBOL (Qerrors_deactivate_region); #ifndef LISP_COMMAND_LOOP DEFSUBR (Frecursive_edit); diff -r c775bd016b32 -r 183866b06e0b src/cmds.c --- a/src/cmds.c Thu May 24 06:30:21 2001 +0000 +++ b/src/cmds.c Thu May 24 07:51:33 2001 +0000 @@ -276,14 +276,14 @@ if (n < 0) { if (pos < BUF_BEGV (buf)) - signal_error (Qbeginning_of_buffer, Qnil); + signal_error (Qbeginning_of_buffer, 0, Qunbound); else buffer_delete_range (buf, pos, BUF_PT (buf), 0); } else { if (pos > BUF_ZV (buf)) - signal_error (Qend_of_buffer, Qnil); + signal_error (Qend_of_buffer, 0, Qunbound); else buffer_delete_range (buf, BUF_PT (buf), pos, 0); } @@ -340,8 +340,8 @@ c = Fevent_to_character (Vlast_command_event, Qnil, Qnil, Qt); if (NILP (c)) - signal_simple_error ("Last typed character has no ASCII equivalent", - Fcopy_event (Vlast_command_event, Qnil)); + invalid_operation ("Last typed character has no ASCII equivalent", + Fcopy_event (Vlast_command_event, Qnil)); CHECK_CHAR_COERCE_INT (c); @@ -502,10 +502,10 @@ void syms_of_cmds (void) { - defsymbol (&Qkill_forward_chars, "kill-forward-chars"); - defsymbol (&Qself_insert_command, "self-insert-command"); - defsymbol (&Qoverwrite_mode_binary, "overwrite-mode-binary"); - defsymbol (&Qno_self_insert, "no-self-insert"); + DEFSYMBOL (Qkill_forward_chars); + DEFSYMBOL (Qself_insert_command); + DEFSYMBOL (Qoverwrite_mode_binary); + DEFSYMBOL (Qno_self_insert); DEFSUBR (Fforward_char); DEFSUBR (Fbackward_char); diff -r c775bd016b32 -r 183866b06e0b src/console-msw.c --- a/src/console-msw.c Thu May 24 06:30:21 2001 +0000 +++ b/src/console-msw.c Thu May 24 07:51:33 2001 +0000 @@ -1,5 +1,5 @@ /* Console functions for mswindows. - Copyright (C) 1996, 2000 Ben Wing. + Copyright (C) 1996, 2000, 2001 Ben Wing. This file is part of XEmacs. @@ -156,7 +156,7 @@ if (!NILP (connection)) { if (ERRB_EQ (errb, ERROR_ME)) - signal_simple_error + invalid_argument ("Invalid (non-nil) connection for mswindows device/console", connection); else @@ -530,14 +530,14 @@ #undef FROB else - signal_simple_error ("Unrecognized flag", st); + invalid_constant ("Unrecognized flag", st); } { int retval = MessageBox (NULL, msgout, titleout, sty); if (retval == 0) - error ("Out of memory when calling `mswindows-message-box'"); + out_of_memory ("When calling `mswindows-message-box'", Qunbound); #define FROB(sym, val) if (retval == val) return sym FROB (Qabort, IDABORT); @@ -549,28 +549,51 @@ FROB (Qyes, IDYES); #undef FROB - signal_simple_error ("Unknown return value from MessageBox()", - make_int (retval)); + invalid_argument ("Unknown return value from MessageBox()", + make_int (retval)); } return Qnil; } +Lisp_Object +mswindows_lisp_error (int errnum) +{ + LPTSTR lpMsgBuf; + Lisp_Object result; + Bufbyte *inres; + Bytecount len; + + FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, errnum, + /* !!#### not Mule-correct */ + MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), + /* yeah, i'm casting a char ** to a char *. ya gotta + problem widdat? */ + (LPTSTR) &lpMsgBuf, + 0, + NULL); + + TO_INTERNAL_FORMAT (C_STRING, lpMsgBuf, ALLOCA, (inres, len), + Qmswindows_tstr); + /* Messages tend to end with a period and newline */ + if (len >= 3 && !strcmp (inres + len - 3, ".\r\n")) + len -= 3; + result = make_string (inres, len); + + LocalFree (lpMsgBuf); + return result; +} + void mswindows_output_last_error (char *frob) { - LPVOID lpMsgBuf; - int errval = GetLastError(); + int errval = GetLastError (); + Lisp_Object errmess = mswindows_lisp_error (errval); - FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER - | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, errval, - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, - 0, - NULL); stderr_out ("last error during %s is %d: %s\n", - frob, errval, (char*)lpMsgBuf); + frob, errval, XSTRING_DATA (errmess)); } static Lisp_Object @@ -585,7 +608,8 @@ if (NILP (connection)) { if (ERRB_EQ (errb, ERROR_ME)) - error ("There is no default printer in the system"); + invalid_state ("There is no default printer in the system", + Qunbound); else return Qunbound; } @@ -612,40 +636,40 @@ { DEFSUBR (Fmswindows_debugging_output); - defsymbol (&Qabortretryignore, "abortretryignore"); - defsymbol (&Qapplmodal, "applmodal"); - defsymbol (&Qdefault_desktop_only, "default-desktop-only"); - defsymbol (&Qdefbutton1, "defbutton1"); - defsymbol (&Qdefbutton2, "defbutton2"); - defsymbol (&Qdefbutton3, "defbutton3"); - defsymbol (&Qdefbutton4, "defbutton4"); - /* defsymbol (&Qhelp, "help"); */ - defsymbol (&Qiconasterisk, "iconasterisk"); - defsymbol (&Qiconexclamation, "iconexclamation"); - defsymbol (&Qiconhand, "iconhand"); - defsymbol (&Qiconinformation, "iconinformation"); - defsymbol (&Qiconquestion, "iconquestion"); - defsymbol (&Qiconstop, "iconstop"); - /* defsymbol (&Qok, "ok"); */ - defsymbol (&Qokcancel, "okcancel"); - defsymbol (&Qretrycancel, "retrycancel"); - /* defsymbol (&Qright, "right"); */ - defsymbol (&Qrtlreading, "rtlreading"); - defsymbol (&Qservice_notification, "service-notification"); - defsymbol (&Qsetforeground, "setforeground"); - defsymbol (&Qsystemmodal, "systemmodal"); - defsymbol (&Qtaskmodal, "taskmodal"); - defsymbol (&Qtopmost, "topmost"); - defsymbol (&Qyesno, "yesno"); - defsymbol (&Qyesnocancel, "yesnocancel"); + DEFSYMBOL (Qabortretryignore); + DEFSYMBOL (Qapplmodal); + DEFSYMBOL (Qdefault_desktop_only); + DEFSYMBOL (Qdefbutton1); + DEFSYMBOL (Qdefbutton2); + DEFSYMBOL (Qdefbutton3); + DEFSYMBOL (Qdefbutton4); + /* DEFSYMBOL (Qhelp); */ + DEFSYMBOL (Qiconasterisk); + DEFSYMBOL (Qiconexclamation); + DEFSYMBOL (Qiconhand); + DEFSYMBOL (Qiconinformation); + DEFSYMBOL (Qiconquestion); + DEFSYMBOL (Qiconstop); + /* DEFSYMBOL (Qok); */ + DEFSYMBOL (Qokcancel); + DEFSYMBOL (Qretrycancel); + /* DEFSYMBOL (Qright); */ + DEFSYMBOL (Qrtlreading); + DEFSYMBOL (Qservice_notification); + DEFSYMBOL (Qsetforeground); + DEFSYMBOL (Qsystemmodal); + DEFSYMBOL (Qtaskmodal); + DEFSYMBOL (Qtopmost); + DEFSYMBOL (Qyesno); + DEFSYMBOL (Qyesnocancel); - /* defsymbol (&Qabort, "abort"); */ - /* defsymbol (&Qcancel, "cancel"); */ - /* defsymbol (&Qignore, "ignore"); */ - /* defsymbol (&Qno, "no"); */ - /* defsymbol (&Qok, "ok"); */ - /* defsymbol (&Qretry, "retry"); */ - /* defsymbol (&Qyes, "yes"); */ + /* DEFSYMBOL (Qabort); */ + /* DEFSYMBOL (Qcancel); */ + /* DEFSYMBOL (Qignore); */ + /* DEFSYMBOL (Qno); */ + /* DEFSYMBOL (Qok); */ + /* DEFSYMBOL (Qretry); */ + /* DEFSYMBOL (Qyes); */ DEFSUBR (Fmswindows_message_box); } diff -r c775bd016b32 -r 183866b06e0b src/console-msw.h --- a/src/console-msw.h Thu May 24 06:30:21 2001 +0000 +++ b/src/console-msw.h Thu May 24 07:51:33 2001 +0000 @@ -371,6 +371,10 @@ int mswindows_windows9x_p (void); void mswindows_output_last_error (char *frob); +DOESNT_RETURN mswindows_report_process_error (const char *string, + Lisp_Object data, + int errnum); +Lisp_Object mswindows_lisp_error (int errnum); Lisp_Object mswindows_handle_print_dialog_box (struct frame *f, Lisp_Object keys); diff -r c775bd016b32 -r 183866b06e0b src/console-stream.c --- a/src/console-stream.c Thu May 24 06:30:21 2001 +0000 +++ b/src/console-stream.c Thu May 24 07:51:33 2001 +0000 @@ -73,7 +73,7 @@ this descriptor. */ fopen ((char *) XSTRING_DATA (tty), READ_PLUS_TEXT); if (!stream_con->in) - error ("Unable to open tty %s", XSTRING_DATA (tty)); + signal_error (Qio_error, "Unable to open tty", tty); } } @@ -162,7 +162,7 @@ #if 0 struct device *d = XDEVICE (FRAME_DEVICE (f)); if (!NILP (DEVICE_FRAME_LIST (d))) - error ("Only one frame allowed on stream devices"); + invalid_operation ("Only one frame allowed on stream devices", Qunbound); #endif f->name = build_string ("stream"); f->height = 80; diff -r c775bd016b32 -r 183866b06e0b src/console-tty.c --- a/src/console-tty.c Thu May 24 06:30:21 2001 +0000 +++ b/src/console-tty.c Thu May 24 07:51:33 2001 +0000 @@ -83,7 +83,7 @@ if (!temp_type) { - error ("Cannot determine terminal type"); + invalid_state ("Cannot determine terminal type", Qunbound); } else terminal_type = build_string (temp_type); @@ -109,7 +109,7 @@ tty_con->infd = tty_con->outfd = open ((char *) XSTRING_DATA (tty), O_RDWR); if (tty_con->infd < 0) - error ("Unable to open tty %s", XSTRING_DATA (tty)); + signal_error (Qio_error, "Unable to open tty", tty); tty_con->is_stdio = 0; } @@ -339,8 +339,8 @@ { DEFSUBR (Fconsole_tty_terminal_type); DEFSUBR (Fconsole_tty_controlling_process); - defsymbol (&Qterminal_type, "terminal-type"); - defsymbol (&Qcontrolling_process, "controlling-process"); + DEFSYMBOL (Qterminal_type); + DEFSYMBOL (Qcontrolling_process); #ifdef FILE_CODING DEFSUBR (Fconsole_tty_output_coding_system); DEFSUBR (Fset_console_tty_output_coding_system); diff -r c775bd016b32 -r 183866b06e0b src/console-x.c --- a/src/console-x.c Thu May 24 06:30:21 2001 +0000 +++ b/src/console-x.c Thu May 24 07:51:33 2001 +0000 @@ -141,8 +141,7 @@ if (elt + 1 == argc) { suppress_early_error_handler_backtrace = 1; - type_error (Qinvalid_argument, - "-display specified with no arg"); + invalid_argument ("-display specified with no arg", Qunbound); } else { diff -r c775bd016b32 -r 183866b06e0b src/console.c --- a/src/console.c Thu May 24 06:30:21 2001 +0000 +++ b/src/console.c Thu May 24 07:51:33 2001 +0000 @@ -123,8 +123,8 @@ char buf[256]; if (print_readably) - error ("printing unreadable object #", - XSTRING_DATA (con->name), con->header.uid); + printing_unreadable_object ("#", + XSTRING_DATA (con->name), con->header.uid); sprintf (buf, "#<%s-console", !CONSOLE_LIVE_P (con) ? "dead" : CONSOLE_TYPE_NAME (con)); @@ -184,7 +184,7 @@ if (EQ (type, Dynarr_at (the_console_type_entry_dynarr, i).symbol)) return Dynarr_at (the_console_type_entry_dynarr, i).meths; - maybe_signal_simple_error ("Invalid console type", type, Qconsole, errb); + maybe_invalid_constant ("Invalid console type", type, Qconsole, errb); return 0; } @@ -281,10 +281,10 @@ Fselect_window (FRAME_SELECTED_WINDOW (f), Qnil); } else - error ("Can't select console with no frames."); + invalid_operation ("Can't select console with no frames", Qunbound); } else - error ("Can't select a console with no devices"); + invalid_operation ("Can't select a console with no devices", Qunbound); return Qnil; } @@ -461,9 +461,9 @@ if (NILP (console)) { if (NILP (type)) - signal_simple_error ("No such console", connection); + invalid_argument ("No such console", connection); else - signal_simple_error_2 ("No such console", type, connection); + invalid_argument_2 ("No such console", type, connection); } return console; } @@ -625,7 +625,7 @@ if (down_we_go) { if (!force) - error ("Attempt to delete the only frame"); + invalid_operation ("Attempt to delete the only frame", Qunbound); else if (from_io_error) { /* Mayday mayday! We're going down! */ @@ -1107,14 +1107,14 @@ DEFSUBR (Fset_input_mode); DEFSUBR (Fcurrent_input_mode); - defsymbol (&Qconsolep, "consolep"); - defsymbol (&Qconsole_live_p, "console-live-p"); + DEFSYMBOL (Qconsolep); + DEFSYMBOL (Qconsole_live_p); - defsymbol (&Qcreate_console_hook, "create-console-hook"); - defsymbol (&Qdelete_console_hook, "delete-console-hook"); + DEFSYMBOL (Qcreate_console_hook); + DEFSYMBOL (Qdelete_console_hook); - defsymbol (&Qsuspend_hook, "suspend-hook"); - defsymbol (&Qsuspend_resume_hook, "suspend-resume-hook"); + DEFSYMBOL (Qsuspend_hook); + DEFSYMBOL (Qsuspend_resume_hook); } static const struct lrecord_description cte_description_1[] = { diff -r c775bd016b32 -r 183866b06e0b src/data.c --- a/src/data.c Thu May 24 06:30:21 2001 +0000 +++ b/src/data.c Thu May 24 07:51:33 2001 +0000 @@ -1,7 +1,7 @@ /* Primitive operations on Lisp data types for XEmacs Lisp interpreter. Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 2000 Ben Wing. + Copyright (C) 2000, 2001 Ben Wing. This file is part of XEmacs. @@ -41,19 +41,20 @@ Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; Lisp_Object Qerror_conditions, Qerror_message; Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax; -Lisp_Object Qlist_formation_error; +Lisp_Object Qlist_formation_error, Qstructure_formation_error; Lisp_Object Qmalformed_list, Qmalformed_property_list; Lisp_Object Qcircular_list, Qcircular_property_list; -Lisp_Object Qinvalid_argument, Qwrong_type_argument, Qargs_out_of_range; +Lisp_Object Qinvalid_argument, Qinvalid_constant, Qwrong_type_argument; +Lisp_Object Qargs_out_of_range; Lisp_Object Qwrong_number_of_arguments, Qinvalid_function, Qno_catch; -Lisp_Object Qinternal_error, Qinvalid_state; +Lisp_Object Qinternal_error, Qinvalid_state, Qstack_overflow, Qout_of_memory; Lisp_Object Qvoid_variable, Qcyclic_variable_indirection; Lisp_Object Qvoid_function, Qcyclic_function_indirection; -Lisp_Object Qinvalid_operation, Qinvalid_change; +Lisp_Object Qinvalid_operation, Qinvalid_change, Qprinting_unreadable_object; Lisp_Object Qsetting_constant; Lisp_Object Qediting_error; Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; -Lisp_Object Qio_error, Qend_of_file; +Lisp_Object Qio_error, Qfile_error, Qconversion_error, Qend_of_file; Lisp_Object Qarith_error, Qrange_error, Qdomain_error; Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error; Lisp_Object Qintegerp, Qnatnump, Qsymbolp; @@ -65,6 +66,7 @@ Lisp_Object Qnumberp, Qnumber_char_or_marker_p; Lisp_Object Qbit_vectorp, Qbitp, Qcdr; +Lisp_Object Qerror_lacks_explanatory_string; Lisp_Object Qfloatp; #ifdef DEBUG_XEMACS @@ -113,7 +115,7 @@ DOESNT_RETURN dead_wrong_type_argument (Lisp_Object predicate, Lisp_Object value) { - signal_error (Qwrong_type_argument, list2 (predicate, value)); + signal_error_1 (Qwrong_type_argument, list2 (predicate, value)); } DEFUN ("wrong-type-argument", Fwrong_type_argument, 2, 2, 0, /* @@ -131,25 +133,27 @@ DOESNT_RETURN c_write_error (Lisp_Object obj) { - signal_simple_error ("Attempt to modify read-only object (c)", obj); + signal_error (Qsetting_constant, + "Attempt to modify read-only object (c)", obj); } DOESNT_RETURN lisp_write_error (Lisp_Object obj) { - signal_simple_error ("Attempt to modify read-only object (lisp)", obj); + signal_error (Qsetting_constant, + "Attempt to modify read-only object (lisp)", obj); } DOESNT_RETURN args_out_of_range (Lisp_Object a1, Lisp_Object a2) { - signal_error (Qargs_out_of_range, list2 (a1, a2)); + signal_error_1 (Qargs_out_of_range, list2 (a1, a2)); } DOESNT_RETURN args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) { - signal_error (Qargs_out_of_range, list3 (a1, a2, a3)); + signal_error_1 (Qargs_out_of_range, list3 (a1, a2, a3)); } void @@ -1582,7 +1586,7 @@ print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { if (print_readably) - error ("printing unreadable object #"); + printing_unreadable_object ("#"); write_c_string ("#type), @@ -1910,7 +1914,7 @@ if (EQ (symbol, Qvalue_assoc)) return WEAK_LIST_VALUE_ASSOC; if (EQ (symbol, Qfull_assoc)) return WEAK_LIST_FULL_ASSOC; - signal_simple_error ("Invalid weak list type", symbol); + invalid_constant ("Invalid weak list type", symbol); return WEAK_LIST_SIMPLE; /* not reached */ } @@ -2011,7 +2015,7 @@ { EMACS_REESTABLISH_SIGNAL (signo, arith_error); EMACS_UNBLOCK_SIGNAL (signo); - signal_error (Qarith_error, Qnil); + signal_error (Qarith_error, 0, Qunbound); } void @@ -2046,28 +2050,25 @@ DEFERROR (Qerror, "error", Qnil); DEFERROR_STANDARD (Qquit, Qnil); - DEFERROR (Qunimplemented, "Feature not yet implemented", Qerror); - DEFERROR_STANDARD (Qsyntax_error, Qerror); + DEFERROR_STANDARD (Qinvalid_argument, Qerror); + + DEFERROR_STANDARD (Qsyntax_error, Qinvalid_argument); DEFERROR_STANDARD (Qinvalid_read_syntax, Qsyntax_error); - DEFERROR_STANDARD (Qlist_formation_error, Qsyntax_error); - - /* Generated by list traversal macros */ + DEFERROR_STANDARD (Qstructure_formation_error, Qsyntax_error); + DEFERROR_STANDARD (Qlist_formation_error, Qstructure_formation_error); DEFERROR_STANDARD (Qmalformed_list, Qlist_formation_error); DEFERROR_STANDARD (Qmalformed_property_list, Qmalformed_list); DEFERROR_STANDARD (Qcircular_list, Qlist_formation_error); DEFERROR_STANDARD (Qcircular_property_list, Qcircular_list); - DEFERROR_STANDARD (Qinvalid_argument, Qerror); DEFERROR_STANDARD (Qwrong_type_argument, Qinvalid_argument); DEFERROR_STANDARD (Qargs_out_of_range, Qinvalid_argument); DEFERROR_STANDARD (Qwrong_number_of_arguments, Qinvalid_argument); DEFERROR_STANDARD (Qinvalid_function, Qinvalid_argument); + DEFERROR_STANDARD (Qinvalid_constant, Qinvalid_argument); DEFERROR (Qno_catch, "No catch for tag", Qinvalid_argument); - DEFERROR_STANDARD (Qinternal_error, Qerror); - - DEFERROR (Qinvalid_state, "Properties or values have been set incorrectly", - Qerror); + DEFERROR_STANDARD (Qinvalid_state, Qerror); DEFERROR (Qvoid_function, "Symbol's function definition is void", Qinvalid_state); DEFERROR (Qcyclic_function_indirection, @@ -2078,22 +2079,26 @@ DEFERROR (Qcyclic_variable_indirection, "Symbol's chain of variable indirections contains a loop", Qinvalid_state); + DEFERROR_STANDARD (Qstack_overflow, Qinvalid_state); + DEFERROR_STANDARD (Qinternal_error, Qinvalid_state); + DEFERROR_STANDARD (Qout_of_memory, Qinvalid_state); - DEFERROR (Qinvalid_operation, - "Operation not allowed or error during operation", Qerror); - DEFERROR (Qinvalid_change, "Attempt to set properties or values incorrectly", - Qinvalid_operation); + DEFERROR_STANDARD (Qinvalid_operation, Qerror); + DEFERROR_STANDARD (Qinvalid_change, Qinvalid_operation); DEFERROR (Qsetting_constant, "Attempt to set a constant symbol", Qinvalid_change); + DEFERROR_STANDARD (Qprinting_unreadable_object, Qinvalid_operation); + DEFERROR (Qunimplemented, "Feature not yet implemented", Qinvalid_operation); - DEFERROR (Qediting_error, "Invalid operation during editing", - Qinvalid_operation); + DEFERROR_STANDARD (Qediting_error, Qinvalid_operation); DEFERROR_STANDARD (Qbeginning_of_buffer, Qediting_error); DEFERROR_STANDARD (Qend_of_buffer, Qediting_error); DEFERROR (Qbuffer_read_only, "Buffer is read-only", Qediting_error); DEFERROR (Qio_error, "IO Error", Qinvalid_operation); - DEFERROR (Qend_of_file, "End of file or stream", Qio_error); + DEFERROR_STANDARD (Qfile_error, Qio_error); + DEFERROR (Qend_of_file, "End of file or stream", Qfile_error); + DEFERROR_STANDARD (Qconversion_error, Qio_error); DEFERROR (Qarith_error, "Arithmetic error", Qinvalid_operation); DEFERROR (Qrange_error, "Arithmetic range error", Qarith_error); @@ -2133,6 +2138,7 @@ DEFSYMBOL (Qnumberp); DEFSYMBOL (Qnumber_char_or_marker_p); DEFSYMBOL (Qcdr); + DEFSYMBOL (Qerror_lacks_explanatory_string); DEFSYMBOL_MULTIWORD_PREDICATE (Qweak_listp); #ifdef LISP_FLOAT_TYPE diff -r c775bd016b32 -r 183866b06e0b src/database.c --- a/src/database.c Thu May 24 06:30:21 2001 +0000 +++ b/src/database.c Thu May 24 07:51:33 2001 +0000 @@ -119,7 +119,7 @@ #define CHECK_LIVE_DATABASE(db) do { \ CHECK_DATABASE (db); \ if (!DATABASE_LIVE_P (XDATABASE(db))) \ - signal_simple_error ("Attempting to access closed database", db); \ + invalid_operation ("Attempting to access closed database", db); \ } while (0) @@ -159,7 +159,7 @@ Lisp_Database *db = XDATABASE (obj); if (print_readably) - error ("printing unreadable object #", db->header.uid); + printing_unreadable_object ("#", db->header.uid); write_c_string ("#fname, printcharfun, 0); @@ -183,7 +183,7 @@ Lisp_Object object; XSETDATABASE (object, db); - signal_simple_error + invalid_operation ("Can't dump an emacs containing database objects", object); } db->funcs->close (db); @@ -654,7 +654,7 @@ real_subtype = DB_QUEUE; #endif else - signal_simple_error ("Unsupported subtype", subtype); + invalid_constant ("Unsupported subtype", subtype); #if DB_VERSION_MAJOR == 1 dbase = dbopen (filename, accessmask, modemask, real_subtype, NULL); @@ -706,7 +706,7 @@ } #endif /* HAVE_BERKELEY_DB */ - signal_simple_error ("Unsupported database type", type); + invalid_constant ("Unsupported database type", type); return Qnil; db_done: @@ -786,19 +786,19 @@ { INIT_LRECORD_IMPLEMENTATION (database); - defsymbol (&Qdatabasep, "databasep"); + DEFSYMBOL (Qdatabasep); #ifdef HAVE_DBM - defsymbol (&Qdbm, "dbm"); + DEFSYMBOL (Qdbm); #endif #ifdef HAVE_BERKELEY_DB - defsymbol (&Qberkeley_db, "berkeley-db"); - defsymbol (&Qhash, "hash"); - defsymbol (&Qbtree, "btree"); - defsymbol (&Qrecno, "recno"); + DEFSYMBOL (Qberkeley_db); + DEFSYMBOL (Qhash); + DEFSYMBOL (Qbtree); + DEFSYMBOL (Qrecno); #if DB_VERSION_MAJOR > 2 - defsymbol (&Qqueue, "queue"); + DEFSYMBOL (Qqueue); #endif - defsymbol (&Qunknown, "unknown"); + DEFSYMBOL (Qunknown); #endif DEFSUBR (Fopen_database); diff -r c775bd016b32 -r 183866b06e0b src/debug.c --- a/src/debug.c Thu May 24 06:30:21 2001 +0000 +++ b/src/debug.c Thu May 24 07:51:33 2001 +0000 @@ -97,7 +97,7 @@ (class)) { if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) - error ("No such debug class exists"); + invalid_argument ("No such debug class exists", Qunbound); else xemacs_debug_loop (X_ADD, class, Qnil); @@ -110,7 +110,7 @@ (class)) { if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) - error ("No such debug class exists"); + invalid_argument ("No such debug class exists", Qunbound); else xemacs_debug_loop (X_DELETE, class, Qnil); @@ -148,7 +148,7 @@ LIST_LOOP (rest, classes ) { if (NILP (xemacs_debug_loop (X_VALIDATE, XCAR (rest), Qnil))) - error ("Invalid object in class list"); + sferror ("Invalid object in class list", Qunbound); } LIST_LOOP (rest, classes) @@ -166,7 +166,7 @@ { CHECK_INT (type); if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) - error ("Invalid debug class"); + invalid_argument ("Invalid debug class", Qunbound); xemacs_debug_loop (X_SETTYPE, class, type); @@ -179,7 +179,7 @@ (class)) { if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) - error ("Invalid debug class"); + invalid_argument ("Invalid debug class", Qunbound); return (xemacs_debug_loop (X_TYPE, class, Qnil)); } @@ -187,12 +187,12 @@ void syms_of_debug (void) { - defsymbol (&Qredisplay, "redisplay"); - defsymbol (&Qbuffers, "buffers"); - defsymbol (&Qfaces, "faces"); - defsymbol (&Qwindows, "windows"); - defsymbol (&Qframes, "frames"); - defsymbol (&Qdevices, "devices"); + DEFSYMBOL (Qredisplay); + DEFSYMBOL (Qbuffers); + DEFSYMBOL (Qfaces); + DEFSYMBOL (Qwindows); + DEFSYMBOL (Qframes); + DEFSYMBOL (Qdevices); DEFSUBR (Fadd_debug_class_to_check); DEFSUBR (Fdelete_debug_class_to_check); diff -r c775bd016b32 -r 183866b06e0b src/depend --- a/src/depend Thu May 24 06:30:21 2001 +0000 +++ b/src/depend Thu May 24 07:51:33 2001 +0000 @@ -119,7 +119,7 @@ emacs-widget-accessors.o: emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h dumper.h frame.h frameslots.h glyphs.h gui.h mule-charset.h nt.h paths.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h syswindows.h toolbar.h window.h winslots.h emodules.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h toolbar.h window.h winslots.h -esd.o: $(LISP_H) miscplay.h +esd.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h miscplay.h mule-charset.h sound.h sysfile.h eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h chartab.h commands.h conslots.h console.h mule-charset.h opaque.h event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h elhash.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lstream.h macros.h menubar.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h @@ -151,7 +151,7 @@ gutter.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h hash.o: $(LISP_H) hash.h hftctl.o: $(LISP_H) -hpplay.o: $(LISP_H) nativesound.h +hpplay.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h sound.h imgproc.o: $(LISP_H) imgproc.h indent.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console-gtk.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lstream.h mule-charset.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h syscommctrl.h sysdll.h systime.h syswindows.h toolbar.h tooltalk.h ui-gtk.h window.h winslots.h xintrinsic.h @@ -161,9 +161,9 @@ intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h lastfile.o: config.h -libsst.o: $(LISP_H) libsst.h +libsst.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h libsst.h mule-charset.h sound.h sysfile.h line-number.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h line-number.h mule-charset.h -linuxplay.o: $(LISP_H) miscplay.h nativesound.h sysfile.h syssignal.h +linuxplay.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h miscplay.h mule-charset.h sound.h sysfile.h syssignal.h systty.h lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h elhash.h file-coding.h lstream.h mule-charset.h opaque.h sysfile.h sysfloat.h lstream.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h insdel.h lstream.h mule-charset.h sysfile.h macros.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h @@ -172,12 +172,12 @@ md5.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h file-coding.h lstream.h mule-charset.h menubar.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h keymap.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h minibuf.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h -miscplay.o: $(LISP_H) miscplay.h sysfile.h syssignal.h -nas.o: $(LISP_H) sysdep.h syssignal.h +miscplay.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h miscplay.h mule-charset.h sound.h sysfile.h syssignal.h +nas.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h sound.h sysdep.h syssignal.h native-gtk-toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h faces.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui.h mule-charset.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h nt.o: $(LISP_H) ndir.h nt.h ntheap.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h ntheap.o: $(LISP_H) ntheap.h syswindows.h -ntplay.o: $(LISP_H) nativesound.h nt.h sysfile.h syswindows.h +ntplay.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h nt.h sound.h sysfile.h syswindows.h ntproc.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h mule-charset.h nt.h ntheap.h process.h syscommctrl.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h objects.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h @@ -197,17 +197,17 @@ scrollbar.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h search.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h insdel.h mule-charset.h opaque.h regex.h syntax.h select.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h toolbar.h window.h winslots.h -sgiplay.o: $(LISP_H) libst.h +sgiplay.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h libst.h mule-charset.h sound.h sysfile.h sysproc.h systime.h sheap.o: $(LISP_H) sheap-adjust.h signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h -sound.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h mule-charset.h nativesound.h redisplay.h sysdep.h sysfile.h sysproc.h systime.h xintrinsic.h +sound.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h mule-charset.h redisplay.h sound.h sysdep.h sysfile.h sysproc.h systime.h xintrinsic.h specifier.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h strcat.o: config.h strcmp.o: config.h strcpy.o: config.h strftime.o: $(LISP_H) sunOS-fix.o: config.h -sunplay.o: $(LISP_H) nativesound.h sysdep.h syssignal.h +sunplay.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h sound.h sysdep.h sysfile.h syssignal.h sunpro.o: $(LISP_H) symbols.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h elhash.h mule-charset.h syntax.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h extents.h mule-charset.h syntax.h @@ -215,6 +215,7 @@ sysdll.o: config.h sysdll.h termcap.o: $(LISP_H) conslots.h console.h device.h terminfo.o: config.h +testalloca.o: config.h tests.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h elhash.h lstream.h mule-charset.h opaque.h toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h tooltalk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h elhash.h mule-charset.h process.h syssignal.h tooltalk.h diff -r c775bd016b32 -r 183866b06e0b src/device-gtk.c --- a/src/device-gtk.c Thu May 24 06:30:21 2001 +0000 +++ b/src/device-gtk.c Thu May 24 07:51:33 2001 +0000 @@ -198,7 +198,7 @@ getting an empty argv array causes them to abort. */ if (NILP (Vgtk_initial_argv_list)) { - signal_simple_error ("gtk-initial-argv-list must be set before creating Gtk devices", Vgtk_initial_argv_list); + invalid_operation ("gtk-initial-argv-list must be set before creating Gtk devices", Vgtk_initial_argv_list); return; } @@ -429,7 +429,7 @@ case GDK_VISUAL_TRUE_COLOR: return intern ("true-color"); case GDK_VISUAL_DIRECT_COLOR: return intern ("direct-color"); default: - error ("display has an unknown visual class"); + invalid_state ("display has an unknown visual class", Qunbound); return Qnil; /* suppress compiler warning */ } } @@ -520,7 +520,7 @@ struct device *d = decode_device (device); if (!DEVICE_GTK_P (d)) - signal_simple_error ("Not a GTK device", device); + gui_error ("Not a GTK device", device); return (NILP (Fgethash (keysym, DEVICE_GTK_DATA (d)->x_keysym_map_hashtable, Qnil)) ? Qnil : Qt); @@ -699,8 +699,8 @@ DEFSUBR (Fgtk_ungrab_keyboard); DEFSUBR (Fgtk_init); - defsymbol (&Qinit_pre_gtk_win, "init-pre-gtk-win"); - defsymbol (&Qinit_post_gtk_win, "init-post-gtk-win"); + DEFSYMBOL (Qinit_pre_gtk_win); + DEFSYMBOL (Qinit_post_gtk_win); } void diff -r c775bd016b32 -r 183866b06e0b src/device-msw.c --- a/src/device-msw.c Thu May 24 06:30:21 2001 +0000 +++ b/src/device-msw.c Thu May 24 07:51:33 2001 +0000 @@ -631,7 +631,7 @@ if (!sync_printer_with_devmode (d, devmode, ldm->devmode, new_name)) { global_free_2_maybe (hDevNames, hDevMode); - error ("Printer device initialization I/O error, device deleted."); + signal_error (Qio_error, "Printer device initialization I/O error, device deleted", Qunbound); } } else @@ -759,17 +759,16 @@ else if (EQ (value, Qpages)) flags |= PD_PAGENUMS; else if (!EQ (value, Qall)) - invalid_argument ("Invalid value for :selected-page-button", - value); + invalid_constant ("for :selected-page-button", value); } else - syntax_error ("Unrecognized print-dialog keyword", key); + invalid_constant ("Unrecognized print-dialog keyword", key); } } if ((UNBOUNDP (device) && UNBOUNDP (settings)) || (!UNBOUNDP (device) && !UNBOUNDP (settings))) - syntax_error ("Exactly one of :device and :printer-settings must be given", + sferror ("Exactly one of :device and :printer-settings must be given", keys); return print_dialog_worker (!UNBOUNDP (device) ? device : settings, flags); @@ -829,13 +828,13 @@ plist = value; } else - syntax_error ("Unrecognized page-setup dialog keyword", key); + invalid_constant ("Unrecognized page-setup dialog keyword", key); } } if ((UNBOUNDP (device) && UNBOUNDP (settings)) || (!UNBOUNDP (device) && !UNBOUNDP (settings))) - syntax_error ("Exactly one of :device and :printer-settings must be given", + sferror ("Exactly one of :device and :printer-settings must be given", keys); if (UNBOUNDP (device)) @@ -937,8 +936,9 @@ DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d), DEVICE_MSPRINTER_NAME(d), NULL, NULL, 0); if (dm_size <= 0) - invalid_operation ("Unable to specialize settings, printer error", - device); + signal_error (Qio_error, + "Unable to specialize settings, printer error", + device); assert (XDEVMODE_SIZE (ldm) <= dm_size); ldm->devmode = xrealloc (ldm->devmode, dm_size); @@ -949,7 +949,9 @@ hold a larger one - not a big deal */ if (!sync_printer_with_devmode (d, ldm->devmode, ldm->devmode, ldm->printer_name)) - error ("Printer device initialization I/O error, device deleted."); + signal_error (Qio_error, + "Printer device initialization I/O error, device deleted", + Qunbound); if (ldm->printer_name == NULL) ldm->printer_name = xstrdup (DEVICE_MSPRINTER_NAME(d)); @@ -1006,7 +1008,9 @@ if (!sync_printer_with_devmode (d, ldm_new->devmode, ldm_current->devmode, ldm_new->printer_name)) - error ("Printer device initialization I/O error, device deleted."); + signal_error (Qio_error, + "Printer device initialization I/O error, device deleted", + Qunbound); if (ldm_new->printer_name != NULL) { @@ -1029,8 +1033,8 @@ char buf[100]; Lisp_Devmode *dm = XDEVMODE (obj); if (print_readably) - error ("printing unreadable object #", - dm->header.uid); + printing_unreadable_object ("#", + dm->header.uid); write_c_string ("#printer_name) { diff -r c775bd016b32 -r 183866b06e0b src/device-tty.c --- a/src/device-tty.c Thu May 24 06:30:21 2001 +0000 +++ b/src/device-tty.c Thu May 24 07:51:33 2001 +0000 @@ -65,22 +65,22 @@ #if 0 case TTY_UNABLE_OPEN_DATABASE: suppress_early_error_handler_backtrace = 1; - error ("Can't access terminal information database"); + signal_error (Qio_error, "Can't access terminal information database", Qunbound); break; #endif case TTY_TYPE_UNDEFINED: suppress_early_error_handler_backtrace = 1; - error ("Terminal type `%s' undefined (or can't access database?)", - XSTRING_DATA (terminal_type)); + signal_error (Qio_error, "Terminal type undefined (or can't access database?)", + terminal_type); break; case TTY_TYPE_INSUFFICIENT: suppress_early_error_handler_backtrace = 1; - error ("Terminal type `%s' not powerful enough to run Emacs", - XSTRING_DATA (terminal_type)); + signal_error (Qio_error, "Terminal type not powerful enough to run Emacs", + terminal_type); break; case TTY_SIZE_UNSPECIFIED: suppress_early_error_handler_backtrace = 1; - error ("Can't determine window size of terminal"); + signal_error (Qio_error, "Can't determine window size of terminal", Qunbound); break; case TTY_INIT_SUCCESS: break; @@ -188,8 +188,8 @@ void syms_of_device_tty (void) { - defsymbol (&Qinit_pre_tty_win, "init-pre-tty-win"); - defsymbol (&Qinit_post_tty_win, "init-post-tty-win"); + DEFSYMBOL (Qinit_pre_tty_win); + DEFSYMBOL (Qinit_post_tty_win); } void diff -r c775bd016b32 -r 183866b06e0b src/device-x.c --- a/src/device-x.c Thu May 24 06:30:21 2001 +0000 +++ b/src/device-x.c Thu May 24 07:51:33 2001 +0000 @@ -211,7 +211,7 @@ app_name, (char *) value.addr, app_class, (char *) value.addr); suppress_early_error_handler_backtrace = 1; - error ("Invalid geometry resource"); + syntax_error ("Invalid geometry resource", Qunbound); } } @@ -568,7 +568,7 @@ if (dpy == 0) { suppress_early_error_handler_backtrace = 1; - signal_simple_error ("X server not responding\n", display); + gui_error ("X server not responding\n", display); } if (STRINGP (Vx_emacs_application_class) && @@ -1285,13 +1285,14 @@ if (NILP (locale)) locale = Qglobal; if (NILP (Fvalid_specifier_locale_p (locale))) - signal_simple_error ("Invalid locale", locale); + invalid_argument ("Invalid locale", locale); if (WINDOWP (locale)) /* #### I can't come up with any coherent way of naming windows. By relative position? That seems tricky because windows can change position, be split, etc. By order of creation? That seems less than useful. */ - signal_simple_error ("Windows currently can't be resourced", locale); + signal_error (Qunimplemented, + "Windows currently can't be resourced", locale); if (!NILP (device) && !DEVICEP (device)) CHECK_DEVICE (device); @@ -1483,8 +1484,13 @@ while (namerest[0] && classrest[0]) namerest++, classrest++; if (namerest[0] || classrest[0]) - signal_simple_error_2 - ("class list and name list must be the same length", name, class); + { + maybe_signal_error_2 + (Qstructure_formation_error, + "class list and name list must be the same length", name, class, + Qresource, errb); + return Qnil; + } result = XrmQGetResource (db, namelist, classlist, &xrm_type, &xrm_value); if (result != True || xrm_type != string_quark) @@ -1504,33 +1510,32 @@ !ascii_strcasecmp (raw_result, "true") || !ascii_strcasecmp (raw_result, "yes")) return Fcons (Qt, Qnil); - return maybe_continuable_error - (Qresource, errb, - "can't convert %s: %s to a Boolean", name_string, raw_result); + return maybe_signal_continuable_error_2 + (Qinvalid_operation, "Can't convert to a Boolean", + build_string (name_string), build_string (raw_result), Qresource, + errb); } else if (EQ (type, Qinteger) || EQ (type, Qnatnum)) { int i; char c; if (1 != sscanf (raw_result, "%d%c", &i, &c)) - return maybe_continuable_error - (Qresource, errb, - "can't convert %s: %s to an integer", name_string, raw_result); + return maybe_signal_continuable_error_2 + (Qinvalid_operation, "Can't convert to an integer", + build_string (name_string), build_string (raw_result), Qresource, + errb); else if (EQ (type, Qnatnum) && i < 0) - return maybe_continuable_error - (Qresource, errb, - "invalid numerical value %d for resource %s", i, name_string); + return maybe_signal_continuable_error_2 + (Qinvalid_argument, "Invalid numerical value for resource", + make_int (i), build_string (name_string), Qresource, errb); else return make_int (i); } else { return maybe_signal_continuable_error - (Qwrong_type_argument, - list2 (build_translated_string - ("should be string, integer, natnum or boolean"), - type), - Qresource, errb); + (Qwrong_type_argument, "Should be string, integer, natnum or boolean", + type, Qresource, errb); } } @@ -1576,7 +1581,7 @@ str = (char *) XSTRING_DATA (resource_line); if (!(colon_pos = strchr (str, ':')) || strchr (str, '\n')) invalid: - signal_simple_error ("Invalid resource line", resource_line); + syntax_error ("Invalid resource line", resource_line); if (strspn (str, /* Only the following chars are allowed before the colon */ " \t.*?abcdefghijklmnopqrstuvwxyz" @@ -1625,7 +1630,7 @@ case TrueColor: return intern ("true-color"); case DirectColor: return intern ("direct-color"); default: - error ("display has an unknown visual class"); + invalid_state ("display has an unknown visual class", Qunbound); return Qnil; /* suppress compiler warning */ } } @@ -1711,7 +1716,7 @@ { struct device *d = decode_device (device); if (!DEVICE_X_P (d)) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); return DEVICE_X_DATA (d)->x_keysym_map_hash_table; } @@ -1732,7 +1737,7 @@ { struct device *d = decode_device (device); if (!DEVICE_X_P (d)) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); return (EQ (Qsans_modifiers, Fgethash (keysym, DEVICE_X_KEYSYM_MAP_HASH_TABLE (d), Qnil)) ? @@ -1755,7 +1760,7 @@ { struct device *d = decode_device (device); if (!DEVICE_X_P (d)) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); return (NILP (Fgethash (keysym, DEVICE_X_KEYSYM_MAP_HASH_TABLE (d), Qnil)) ? Qnil : Qt); @@ -1903,7 +1908,7 @@ Lisp_Object font_path = Qnil; if (!directories) - signal_simple_error ("Can't get X font path", device); + gui_error ("Can't get X font path", device); while (ndirs_return--) font_path = Fcons (build_ext_string (directories[ndirs_return], @@ -1985,9 +1990,9 @@ DEFSUBR (Fx_get_font_path); DEFSUBR (Fx_set_font_path); - defsymbol (&Qx_error, "x-error"); - defsymbol (&Qinit_pre_x_win, "init-pre-x-win"); - defsymbol (&Qinit_post_x_win, "init-post-x-win"); + DEFSYMBOL (Qx_error); + DEFSYMBOL (Qinit_pre_x_win); + DEFSYMBOL (Qinit_post_x_win); } void diff -r c775bd016b32 -r 183866b06e0b src/device.c --- a/src/device.c Thu May 24 06:30:21 2001 +0000 +++ b/src/device.c Thu May 24 07:51:33 2001 +0000 @@ -119,8 +119,8 @@ char buf[256]; if (print_readably) - error ("printing unreadable object #", - XSTRING_DATA (d->name), d->header.uid); + printing_unreadable_object ("#", + XSTRING_DATA (d->name), d->header.uid); sprintf (buf, "#<%s-device", !DEVICE_LIVE_P (d) ? "dead" : DEVICE_TYPE_NAME (d)); @@ -279,7 +279,7 @@ (XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (device)))), Qnil); else - error ("Can't select a device with no frames"); + invalid_operation ("Can't select a device with no frames", Qunbound); return Qnil; } @@ -302,7 +302,7 @@ CHECK_LIVE_FRAME (frame); if (! EQ (device, FRAME_DEVICE (XFRAME (frame)))) - error ("In `set-device-selected-frame', FRAME is not on DEVICE"); + invalid_argument ("In `set-device-selected-frame', FRAME is not on DEVICE", Qunbound); if (EQ (device, Fselected_device (Qnil))) return Fselect_frame (frame); @@ -487,9 +487,9 @@ if (NILP (device)) { if (NILP (type)) - signal_simple_error ("No such device", connection); + invalid_argument ("No such device", connection); else - signal_simple_error_2 ("No such device", type, connection); + invalid_argument_2 ("No such device", type, connection); } return device; } @@ -557,7 +557,7 @@ conmeths = decode_console_type (type, ERROR_ME_NOT); if (!conmeths) - signal_simple_error ("Invalid device type", type); + invalid_constant ("Invalid device type", type); device = Ffind_device (connection, type); if (!NILP (device)) @@ -883,9 +883,9 @@ struct device *d = decode_device (device); XSETDEVICE (device, d); if (!DEVICE_TTY_P (d)) - signal_simple_error ("Cannot change the class of this device", device); + gui_error ("Cannot change the class of this device", device); if (!EQ (class, Qcolor) && !EQ (class, Qmono) && !EQ (class, Qgrayscale)) - signal_simple_error ("Must be color, mono, or grayscale", class); + invalid_constant ("Must be color, mono, or grayscale", class); if (! EQ (DEVICE_CLASS (d), class)) { Lisp_Object frmcons; @@ -1067,7 +1067,7 @@ FROB (slow_device); FROB (security); else - signal_simple_error ("Invalid device metric symbol", metric); + invalid_constant ("Invalid device metric symbol", metric); res = DEVMETH_OR_GIVEN (d, device_system_metrics, (d, m), Qunbound); return UNBOUNDP(res) ? default_ : res; @@ -1186,7 +1186,7 @@ { if (!WINDOWP (domain) && !FRAMEP (domain) && !DEVICEP (domain) && !CONSOLEP (domain)) - signal_simple_error + invalid_argument ("Domain must be either a window, frame, device or console", domain); return domain_device_type (domain); @@ -1280,54 +1280,54 @@ DEFSUBR (Fdomain_device_type); DEFSUBR (Fdevice_printer_p); - defsymbol (&Qdevicep, "devicep"); - defsymbol (&Qdevice_live_p, "device-live-p"); + DEFSYMBOL (Qdevicep); + DEFSYMBOL (Qdevice_live_p); - defsymbol (&Qcreate_device_hook, "create-device-hook"); - defsymbol (&Qdelete_device_hook, "delete-device-hook"); + DEFSYMBOL (Qcreate_device_hook); + DEFSYMBOL (Qdelete_device_hook); /* Qcolor defined in general.c */ - defsymbol (&Qgrayscale, "grayscale"); - defsymbol (&Qmono, "mono"); + DEFSYMBOL (Qgrayscale); + DEFSYMBOL (Qmono); /* Device metrics symbols */ - defsymbol (&Qcolor_default, "color-default"); - defsymbol (&Qcolor_select, "color-select"); - defsymbol (&Qcolor_balloon, "color-balloon"); - defsymbol (&Qcolor_3d_face, "color-3d-face"); - defsymbol (&Qcolor_3d_light, "color-3d-light"); - defsymbol (&Qcolor_3d_dark, "color-3d-dark"); - defsymbol (&Qcolor_menu, "color-menu"); - defsymbol (&Qcolor_menu_highlight, "color-menu-highlight"); - defsymbol (&Qcolor_menu_button, "color-menu-button"); - defsymbol (&Qcolor_menu_disabled, "color-menu-disabled"); - defsymbol (&Qcolor_toolbar, "color-toolbar"); - defsymbol (&Qcolor_scrollbar, "color-scrollbar"); - defsymbol (&Qcolor_desktop, "color-desktop"); - defsymbol (&Qcolor_workspace, "color-workspace"); - defsymbol (&Qfont_default, "font-default"); - defsymbol (&Qfont_menubar, "font-menubar"); - defsymbol (&Qfont_dialog, "font-dialog"); - defsymbol (&Qsize_cursor, "size-cursor"); - defsymbol (&Qsize_scrollbar, "size-scrollbar"); - defsymbol (&Qsize_menu, "size-menu"); - defsymbol (&Qsize_toolbar, "size-toolbar"); - defsymbol (&Qsize_toolbar_button, "size-toolbar-button"); - defsymbol (&Qsize_toolbar_border, "size-toolbar-border"); - defsymbol (&Qsize_icon, "size-icon"); - defsymbol (&Qsize_icon_small, "size-icon-small"); - defsymbol (&Qsize_device, "size-device"); - defsymbol (&Qsize_workspace, "size-workspace"); - defsymbol (&Qoffset_workspace, "offset-workspace"); - defsymbol (&Qsize_device_mm, "size-device-mm"); - defsymbol (&Qnum_bit_planes, "num-bit-planes"); - defsymbol (&Qnum_color_cells, "num-color-cells"); - defsymbol (&Qdevice_dpi, "device-dpi"); - defsymbol (&Qmouse_buttons, "mouse-buttons"); - defsymbol (&Qswap_buttons, "swap-buttons"); - defsymbol (&Qshow_sounds, "show-sounds"); - defsymbol (&Qslow_device, "slow-device"); - defsymbol (&Qsecurity, "security"); + DEFSYMBOL (Qcolor_default); + DEFSYMBOL (Qcolor_select); + DEFSYMBOL (Qcolor_balloon); + DEFSYMBOL (Qcolor_3d_face); + DEFSYMBOL (Qcolor_3d_light); + DEFSYMBOL (Qcolor_3d_dark); + DEFSYMBOL (Qcolor_menu); + DEFSYMBOL (Qcolor_menu_highlight); + DEFSYMBOL (Qcolor_menu_button); + DEFSYMBOL (Qcolor_menu_disabled); + DEFSYMBOL (Qcolor_toolbar); + DEFSYMBOL (Qcolor_scrollbar); + DEFSYMBOL (Qcolor_desktop); + DEFSYMBOL (Qcolor_workspace); + DEFSYMBOL (Qfont_default); + DEFSYMBOL (Qfont_menubar); + DEFSYMBOL (Qfont_dialog); + DEFSYMBOL (Qsize_cursor); + DEFSYMBOL (Qsize_scrollbar); + DEFSYMBOL (Qsize_menu); + DEFSYMBOL (Qsize_toolbar); + DEFSYMBOL (Qsize_toolbar_button); + DEFSYMBOL (Qsize_toolbar_border); + DEFSYMBOL (Qsize_icon); + DEFSYMBOL (Qsize_icon_small); + DEFSYMBOL (Qsize_device); + DEFSYMBOL (Qsize_workspace); + DEFSYMBOL (Qoffset_workspace); + DEFSYMBOL (Qsize_device_mm); + DEFSYMBOL (Qnum_bit_planes); + DEFSYMBOL (Qnum_color_cells); + DEFSYMBOL (Qdevice_dpi); + DEFSYMBOL (Qmouse_buttons); + DEFSYMBOL (Qswap_buttons); + DEFSYMBOL (Qshow_sounds); + DEFSYMBOL (Qslow_device); + DEFSYMBOL (Qsecurity); } void diff -r c775bd016b32 -r 183866b06e0b src/dialog-gtk.c --- a/src/dialog-gtk.c Thu May 24 06:30:21 2001 +0000 +++ b/src/dialog-gtk.c Thu May 24 07:51:33 2001 +0000 @@ -47,7 +47,7 @@ void syms_of_dialog_gtk (void) { - defsymbol (&Qgtk_make_dialog_box_internal, "gtk-make-dialog-box-internal"); + DEFSYMBOL (Qgtk_make_dialog_box_internal); } void diff -r c775bd016b32 -r 183866b06e0b src/dialog-msw.c --- a/src/dialog-msw.c Thu May 24 06:30:21 2001 +0000 +++ b/src/dialog-msw.c Thu May 24 07:51:33 2001 +0000 @@ -375,7 +375,7 @@ ofn.Flags &= ~(OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST); } else - syntax_error ("Unrecognized file-dialog keyword", key); + invalid_constant ("Unrecognized file-dialog keyword", key); } } @@ -394,15 +394,15 @@ for (i = 0; i < countof (common_dialog_errors); i++) { if (common_dialog_errors[i].errmess == err) - signal_type_error (Qdialog_box_error, - "Creating file-dialog-box", - build_string - (common_dialog_errors[i].errname)); + signal_error (Qdialog_box_error, + "Creating file-dialog-box", + build_string + (common_dialog_errors[i].errname)); } - signal_type_error (Qdialog_box_error, - "Unknown common dialog box error???", - make_int (err)); + signal_error (Qdialog_box_error, + "Unknown common dialog box error???", + make_int (err)); } } @@ -462,15 +462,15 @@ button_row_width -= X_BUTTON_MARGIN; } else - syntax_error ("Unrecognized question-dialog keyword", key); + invalid_constant ("Unrecognized question-dialog keyword", key); } } if (Dynarr_length (dialog_items) == 0) - syntax_error ("Dialog descriptor provides no buttons", keys); + sferror ("Dialog descriptor provides no buttons", keys); if (NILP (question)) - syntax_error ("Dialog descriptor provides no question", keys); + sferror ("Dialog descriptor provides no question", keys); /* Determine the final width layout */ { @@ -659,7 +659,7 @@ (LPARAM) LISP_TO_VOID (dialog_data)); if (!did->hwnd) /* Something went wrong creating the dialog */ - signal_type_error (Qdialog_box_error, "Creating dialog", keys); + signal_error (Qdialog_box_error, "Creating dialog", keys); Vdialog_data_list = Fcons (dialog_data, Vdialog_data_list); @@ -682,7 +682,7 @@ else if (EQ (type, Qpage_setup)) return mswindows_handle_page_setup_dialog_box (f, keys); else - signal_type_error (Qunimplemented, "Dialog box type", type); + signal_error (Qunimplemented, "Dialog box type", type); return Qnil; } @@ -709,7 +709,7 @@ DEFKEYWORD (Q_no_read_only_return); /* Errors */ - DEFERROR_STANDARD (Qdialog_box_error, Qinvalid_operation); + DEFERROR_STANDARD (Qdialog_box_error, Qgui_error); } void diff -r c775bd016b32 -r 183866b06e0b src/dialog-x.c --- a/src/dialog-x.c Thu May 24 06:30:21 2001 +0000 +++ b/src/dialog-x.c Thu May 24 07:51:33 2001 +0000 @@ -151,12 +151,12 @@ buttons = value; } else - syntax_error ("Unrecognized question-dialog keyword", key); + invalid_constant ("Unrecognized question-dialog keyword", key); } } if (NILP (question)) - syntax_error ("Dialog descriptor provides no question", keys); + sferror ("Dialog descriptor provides no question", keys); /* Inhibit GC during this conversion. The reasons for this are the same as in menu_item_descriptor_to_widget_value(); see @@ -185,7 +185,7 @@ if (NILP (button)) { if (partition_seen) - syntax_error ("More than one partition (nil) seen in dbox spec", + sferror ("More than one partition (nil) seen in dbox spec", keys); partition_seen = 1; continue; @@ -221,7 +221,7 @@ n++; if (lbuttons > 9 || rbuttons > 9) - syntax_error ("Too many buttons (9)", + sferror ("Too many buttons (9)", keys); /* #### this leaks */ } @@ -231,7 +231,7 @@ } if (n == 0) - syntax_error ("Dialog boxes must have some buttons", keys); + sferror ("Dialog boxes must have some buttons", keys); { Extbyte type = (text_field_p ? 'P' : 'Q'); @@ -259,7 +259,7 @@ Widget parent, dbox; if (!EQ (type, Qquestion)) - signal_type_error (Qunimplemented, "Dialog box type", type); + signal_error (Qunimplemented, "Dialog box type", type); data = dbox_descriptor_to_widget_value (keys); diff -r c775bd016b32 -r 183866b06e0b src/dialog.c --- a/src/dialog.c Thu May 24 06:30:21 2001 +0000 +++ b/src/dialog.c Thu May 24 07:51:33 2001 +0000 @@ -45,8 +45,8 @@ CHECK_SYMBOL (type); if (!HAS_DEVMETH_P (d, make_dialog_box_internal)) - signal_type_error (Qunimplemented, - "Device does not support dialogs", f->device); + signal_error (Qunimplemented, + "Device does not support dialogs", f->device); return DEVMETH (d, make_dialog_box_internal, (f, type, keys)); } diff -r c775bd016b32 -r 183866b06e0b src/dired-msw.c --- a/src/dired-msw.c Thu May 24 06:30:21 2001 +0000 +++ b/src/dired-msw.c Thu May 24 07:51:33 2001 +0000 @@ -219,7 +219,7 @@ if (fh == INVALID_HANDLE_VALUE) { report_file_error ("Opening directory", - list1(build_string(dirfile))); + build_string (dirfile)); } } else @@ -232,7 +232,7 @@ } FindClose(fh); report_file_error ("Reading directory", - list1(build_string(dirfile))); + build_string (dirfile)); } } @@ -620,7 +620,7 @@ void syms_of_dired_mswindows (void) { - defsymbol (&Qmswindows_insert_directory, "mswindows-insert-directory"); + DEFSYMBOL (Qmswindows_insert_directory); DEFSUBR (Fmswindows_insert_directory); } diff -r c775bd016b32 -r 183866b06e0b src/dired.c --- a/src/dired.c Thu May 24 06:30:21 2001 +0000 +++ b/src/dired.c Thu May 24 07:51:33 2001 +0000 @@ -126,7 +126,7 @@ unwind-protection in case of error, but now there is. */ d = opendir ((char *) XSTRING_DATA (directory)); if (!d) - report_file_error ("Opening directory", list1 (directory)); + report_file_error ("Opening directory", directory); regex_match_object = Qt; regex_emacs_buffer = current_buffer; @@ -343,7 +343,7 @@ { d = opendir ((char *) XSTRING_DATA (Fdirectory_file_name (directory))); if (!d) - report_file_error ("Opening directory", list1 (directory)); + report_file_error ("Opening directory", directory); XCAR (locative) = make_opaque_ptr ((void *)d); /* Loop reading blocks */ @@ -942,10 +942,10 @@ void syms_of_dired (void) { - defsymbol (&Qdirectory_files, "directory-files"); - defsymbol (&Qfile_name_completion, "file-name-completion"); - defsymbol (&Qfile_name_all_completions, "file-name-all-completions"); - defsymbol (&Qfile_attributes, "file-attributes"); + DEFSYMBOL (Qdirectory_files); + DEFSYMBOL (Qfile_name_completion); + DEFSYMBOL (Qfile_name_all_completions); + DEFSYMBOL (Qfile_attributes); DEFSUBR (Fdirectory_files); DEFSUBR (Ffile_name_completion); diff -r c775bd016b32 -r 183866b06e0b src/doc.c --- a/src/doc.c Thu May 24 06:30:21 2001 +0000 +++ b/src/doc.c Thu May 24 07:51:33 2001 +0000 @@ -231,16 +231,16 @@ #endif /* CANNOT_DUMP */ if (fd < 0) - error ("Cannot open doc string file \"%s\"", - name_nonreloc ? name_nonreloc : - (char *) XSTRING_DATA (name_reloc)); + signal_error (Qfile_error, "Cannot open doc string file", + name_nonreloc ? build_string (name_nonreloc) : + name_reloc); } tem = unparesseuxify_doc_string (fd, position, name_nonreloc, name_reloc); close (fd); if (!STRINGP (tem)) - signal_error (Qerror, tem); + signal_error_1 (Qinvalid_byte_code, tem); return tem; } @@ -255,7 +255,7 @@ Lisp_Object string = get_doc_string (filepos); if (!STRINGP (string)) - signal_simple_error ("loading bytecode failed to return string", string); + invalid_state ("loading bytecode failed to return string", string); return Fread (string); } @@ -421,7 +421,7 @@ #ifndef CANNOT_DUMP if (!purify_flag) - error ("Snarf-documentation can only be called in an undumped Emacs"); + invalid_operation ("Snarf-documentation can only be called in an undumped Emacs", Qunbound); #endif CHECK_STRING (filename); @@ -446,8 +446,7 @@ fd = open (name, O_RDONLY | OPEN_BINARY, 0); if (fd < 0) - report_file_error ("Opening doc string file", - Fcons (build_string (name), Qnil)); + report_file_error ("Opening doc string file", build_string (name)); Vinternal_doc_file_name = filename; filled = 0; pos = 0; @@ -617,7 +616,7 @@ else { /* lose: */ - error ("DOC file invalid at position %d", pos); + signal_error (Qfile_error, "DOC file invalid at position", make_int (pos)); weird: /* goto lose */; } diff -r c775bd016b32 -r 183866b06e0b src/doprnt.c --- a/src/doprnt.c Thu May 24 06:30:21 2001 +0000 +++ b/src/doprnt.c Thu May 24 07:51:33 2001 +0000 @@ -130,7 +130,7 @@ while (start != end && isdigit (*start)) { if ((size_t) (arg_ptr - arg_convert) >= sizeof (arg_convert) - 1) - error ("Format converter number too large"); + syntax_error ("Format converter number too large", Qunbound); *arg_ptr++ = *start++; } *arg_ptr = '\0'; @@ -142,10 +142,10 @@ #define NEXT_ASCII_BYTE(ch) \ do { \ if (fmt == fmt_end) \ - error ("Premature end of format string"); \ + syntax_error ("Premature end of format string", Qunbound); \ ch = *fmt; \ if (ch >= 0200) \ - error ("Non-ASCII character in format converter spec"); \ + syntax_error ("Non-ASCII character in format converter spec", Qunbound); \ fmt++; \ } while (0) @@ -296,7 +296,7 @@ } if (!strchr (valid_converters, ch)) - error ("Invalid converter character %c", ch); + syntax_error ("Invalid converter character", make_char (ch)); spec.converter = ch; } @@ -356,7 +356,7 @@ } if (j == Dynarr_length (specs)) - error ("No conversion spec for argument %d", i); + syntax_error ("No conversion spec for argument", make_int (i)); ch = spec->converter; @@ -425,7 +425,7 @@ { /* allow too many args for string, but not too few */ if (nargs < get_args_needed (specs)) - signal_error (Qwrong_number_of_arguments, + signal_error_1 (Qwrong_number_of_arguments, list3 (Qformat, make_int (nargs), !NILP (format_reloc) ? format_reloc : @@ -493,7 +493,7 @@ } if (largs && (spec->argnum < 1 || spec->argnum > nargs)) - error ("Invalid repositioning argument %d", spec->argnum); + syntax_error ("Invalid repositioning argument", make_int (spec->argnum)); else if (ch == 'S' || ch == 's') { @@ -558,7 +558,7 @@ obj = make_int (XCHAR (obj)); if (!INT_OR_FLOATP (obj)) { - error ("format specifier %%%c doesn't match argument type", + syntax_error ("format specifier %%%c doesn't match argument type", ch); } else if (strchr (double_converters, ch)) @@ -585,7 +585,7 @@ a = (Emchar) arg.l; if (!valid_char_p (a)) - error ("invalid character value %d to %%c spec", a); + syntax_error ("invalid character value %d to %%c spec", a); charlen = set_charptr_emchar (charbuf, a); doprnt_1 (stream, charbuf, charlen, spec->minwidth, diff -r c775bd016b32 -r 183866b06e0b src/dragdrop.c --- a/src/dragdrop.c Thu May 24 06:30:21 2001 +0000 +++ b/src/dragdrop.c Thu May 24 07:51:33 2001 +0000 @@ -113,9 +113,9 @@ void syms_of_dragdrop (void) { - defsymbol (&Qdragdrop_MIME, "dragdrop-MIME"); - defsymbol (&Qdragdrop_URL, "dragdrop-URL"); - defsymbol (&Qdragdrop_drop_dispatch, "dragdrop-drop-dispatch"); + DEFSYMBOL (Qdragdrop_MIME); + DEFSYMBOL (Qdragdrop_URL); + DEFSYMBOL (Qdragdrop_drop_dispatch); } void diff -r c775bd016b32 -r 183866b06e0b src/editfns.c --- a/src/editfns.c Thu May 24 06:30:21 2001 +0000 +++ b/src/editfns.c Thu May 24 07:51:33 2001 +0000 @@ -111,9 +111,8 @@ { Lisp_Object ch2 = Fevent_to_character (character, Qt, Qnil, Qnil); if (NILP (ch2)) - return - signal_simple_continuable_error - ("character has no ASCII equivalent:", Fcopy_event (character, Qnil)); + invalid_argument + ("character has no ASCII equivalent:", Fcopy_event (character, Qnil)); character = ch2; } @@ -234,7 +233,7 @@ Fsignal (Qmark_inactive, Qnil); #endif m = Fmarker_position (b->mark); - if (NILP (m)) error ("There is no region now"); + if (NILP (m)) invalid_operation ("There is no region now", Qunbound); if (!!(BUF_PT (b) < XINT (m)) == !!beginningp) return make_int (BUF_PT (b)); else @@ -1110,7 +1109,7 @@ CHECK_STRING (format_string); if (! lisp_to_time (time_, &value)) - error ("Invalid time specification"); + invalid_argument ("Invalid time specification", Qunbound); /* This is probably enough. */ size = XSTRING_LENGTH (format_string) * 6 + 50; @@ -1151,7 +1150,7 @@ Lisp_Object list_args[9]; if (! lisp_to_time (specified_time, &time_spec)) - error ("Invalid time specification"); + invalid_argument ("Invalid time specification", Qunbound); decoded_time = localtime (&time_spec); list_args[0] = make_int (decoded_time->tm_sec); @@ -1228,7 +1227,7 @@ tzstring = tzbuf; } else - error ("Invalid time zone specification"); + invalid_argument ("Invalid time zone specification", Qunbound); /* Set TZ before calling mktime; merely adjusting mktime's returned value doesn't suffice, since that would mishandle leap seconds. */ @@ -1246,7 +1245,7 @@ } if (the_time == (time_t) -1) - error ("Specified time is not representable"); + invalid_argument ("Specified time is not representable", Qunbound); return wasteful_word_to_lisp (the_time); } @@ -2382,9 +2381,9 @@ len2 = endr2 - startr2; if (startr2 < endr1) - error ("transposed regions not properly ordered"); + invalid_argument ("transposed regions not properly ordered", Qunbound); else if (startr1 == endr1 || startr2 == endr2) - error ("transposed region may not be of length 0"); + invalid_argument ("transposed region may not be of length 0", Qunbound); string1 = make_string_from_buffer (buf, startr1, len1); string2 = make_string_from_buffer (buf, startr2, len2); @@ -2409,12 +2408,12 @@ void syms_of_editfns (void) { - defsymbol (&Qpoint, "point"); - defsymbol (&Qmark, "mark"); - defsymbol (&Qregion_beginning, "region-beginning"); - defsymbol (&Qregion_end, "region-end"); - defsymbol (&Qformat, "format"); - defsymbol (&Quser_files_and_directories, "user-files-and-directories"); + DEFSYMBOL (Qpoint); + DEFSYMBOL (Qmark); + DEFSYMBOL (Qregion_beginning); + DEFSYMBOL (Qregion_end); + DEFSYMBOL (Qformat); + DEFSYMBOL (Quser_files_and_directories); DEFSUBR (Fchar_equal); DEFSUBR (Fchar_Equal); @@ -2480,9 +2479,9 @@ DEFSUBR (Fsave_restriction); DEFSUBR (Ftranspose_regions); - defsymbol (&Qzmacs_update_region, "zmacs-update-region"); - defsymbol (&Qzmacs_deactivate_region, "zmacs-deactivate-region"); - defsymbol (&Qzmacs_region_buffer, "zmacs-region-buffer"); + DEFSYMBOL (Qzmacs_update_region); + DEFSYMBOL (Qzmacs_deactivate_region); + DEFSYMBOL (Qzmacs_region_buffer); } void diff -r c775bd016b32 -r 183866b06e0b src/eldap.c --- a/src/eldap.c Thu May 24 06:30:21 2001 +0000 +++ b/src/eldap.c Thu May 24 07:51:33 2001 +0000 @@ -82,7 +82,7 @@ ldap_err = ld->ld_errno; #endif } - signal_simple_error ("LDAP error", + invalid_operation ("LDAP error", build_string (ldap_err2string (ldap_err))); } @@ -113,8 +113,7 @@ Lisp_LDAP *ldap = XLDAP (obj); if (print_readably) - error ("printing unreadable object #", - XSTRING_DATA (ldap->host)); + printing_unreadable_object ("#", XSTRING_DATA (ldap->host)); write_c_string ("#host, printcharfun, 1); @@ -140,7 +139,7 @@ Lisp_LDAP *ldap = (Lisp_LDAP *) header; if (for_disksave) - signal_simple_error ("Can't dump an emacs containing LDAP objects", + invalid_operation ("Can't dump an emacs containing LDAP objects", make_ldap (ldap)); if (ldap->ld) @@ -243,7 +242,7 @@ ldap_auth = LDAP_AUTH_KRBV42; #endif else - signal_simple_error ("Invalid authentication method", value); + invalid_constant ("Invalid authentication method", value); } /* Bind DN */ else if (EQ (keyword, Qbinddn)) @@ -269,7 +268,7 @@ else if (EQ (value, Qalways)) ldap_deref = LDAP_DEREF_ALWAYS; else - signal_simple_error ("Invalid deref value", value); + invalid_constant ("Invalid deref value", value); } /* Timelimit */ else if (EQ (keyword, Qtimelimit)) @@ -297,10 +296,7 @@ speed_up_interrupts (); if (ld == NULL ) - signal_simple_error_2 ("Failed connecting to host", - host, - lisp_strerror (errno)); - + report_process_error ("Failed connecting to host", host); #ifdef HAVE_LDAP_SET_OPTION if ((err = ldap_set_option (ld, LDAP_OPT_DEREF, @@ -333,8 +329,12 @@ err = ldap_bind_s (ld, ldap_binddn, ldap_passwd, ldap_auth); if (err != LDAP_SUCCESS) - signal_simple_error ("Failed binding to the server", - build_string (ldap_err2string (err))); + { + Bufbyte *interrmess; + EXTERNAL_TO_C_STRING (ldap_err2string (err), interrmess, Qnative); + signal_error (Qprocess_error, "Failed binding to the server", + build_string (interrmess)); + } ldap = allocate_ldap (); ldap->ld = ld; @@ -459,7 +459,7 @@ else if (EQ (scope, Qsubtree)) ldap_scope = LDAP_SCOPE_SUBTREE; else - signal_simple_error ("Invalid scope", scope); + invalid_constant ("Invalid scope", scope); } /* Attributes to search */ @@ -619,7 +619,7 @@ /* Check the entry */ CHECK_CONS (entry); if (NILP (entry)) - signal_simple_error ("Cannot add void entry", entry); + invalid_operation ("Cannot add void entry", entry); /* Build the ldap_mods array */ len = XINT (Flength (entry)); @@ -735,7 +735,7 @@ else if (EQ (mod_op, Qreplace)) ldap_mods[i].mod_op |= LDAP_MOD_REPLACE; else - signal_simple_error ("Invalid LDAP modification type", mod_op); + invalid_constant ("Invalid LDAP modification type", mod_op); current = XCDR (current); CHECK_STRING (XCAR (current)); LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, Qnative); @@ -796,24 +796,24 @@ { INIT_LRECORD_IMPLEMENTATION (ldap); - defsymbol (&Qldapp, "ldapp"); - defsymbol (&Qport, "port"); - defsymbol (&Qauth, "auth"); - defsymbol (&Qbinddn, "binddn"); - defsymbol (&Qpasswd, "passwd"); - defsymbol (&Qderef, "deref"); - defsymbol (&Qtimelimit, "timelimit"); - defsymbol (&Qsizelimit, "sizelimit"); - defsymbol (&Qbase, "base"); - defsymbol (&Qonelevel, "onelevel"); - defsymbol (&Qsubtree, "subtree"); - defsymbol (&Qkrbv41, "krbv41"); - defsymbol (&Qkrbv42, "krbv42"); - defsymbol (&Qnever, "never"); - defsymbol (&Qalways, "always"); - defsymbol (&Qfind, "find"); - defsymbol (&Qadd, "add"); - defsymbol (&Qreplace, "replace"); + DEFSYMBOL (Qldapp); + DEFSYMBOL (Qport); + DEFSYMBOL (Qauth); + DEFSYMBOL (Qbinddn); + DEFSYMBOL (Qpasswd); + DEFSYMBOL (Qderef); + DEFSYMBOL (Qtimelimit); + DEFSYMBOL (Qsizelimit); + DEFSYMBOL (Qbase); + DEFSYMBOL (Qonelevel); + DEFSYMBOL (Qsubtree); + DEFSYMBOL (Qkrbv41); + DEFSYMBOL (Qkrbv42); + DEFSYMBOL (Qnever); + DEFSYMBOL (Qalways); + DEFSYMBOL (Qfind); + DEFSYMBOL (Qadd); + DEFSYMBOL (Qreplace); DEFSUBR (Fldapp); DEFSUBR (Fldap_host); diff -r c775bd016b32 -r 183866b06e0b src/eldap.h --- a/src/eldap.h Thu May 24 06:30:21 2001 +0000 +++ b/src/eldap.h Thu May 24 07:51:33 2001 +0000 @@ -51,7 +51,7 @@ #define CHECK_LIVE_LDAP(ldap) do { \ CHECK_LDAP (ldap); \ if (!XLDAP (ldap)->ld) \ - signal_simple_error ("Attempting to access closed LDAP connection", \ + invalid_operation ("Attempting to access closed LDAP connection", \ ldap); \ } while (0) diff -r c775bd016b32 -r 183866b06e0b src/elhash.c --- a/src/elhash.c Thu May 24 06:30:21 2001 +0000 +++ b/src/elhash.c Thu May 24 07:51:33 2001 +0000 @@ -578,7 +578,7 @@ if (NATNUMP (value)) return 1; - maybe_signal_error (Qwrong_type_argument, list2 (Qnatnump, value), + maybe_signal_error_1 (Qwrong_type_argument, list2 (Qnatnump, value), Qhash_table, errb); return 0; } @@ -607,7 +607,7 @@ if (EQ (value, Qkey_or_value_weak)) return 1; if (EQ (value, Qvalue_weak)) return 1; - maybe_signal_simple_error ("Invalid hash table weakness", + maybe_invalid_constant ("Invalid hash table weakness", value, Qhash_table, errb); return 0; } @@ -629,7 +629,7 @@ if (EQ (obj, Qkey_or_value_weak)) return HASH_TABLE_KEY_VALUE_WEAK; if (EQ (obj, Qvalue_weak)) return HASH_TABLE_VALUE_WEAK; - signal_simple_error ("Invalid hash table weakness", obj); + invalid_constant ("Invalid hash table weakness", obj); return HASH_TABLE_NON_WEAK; /* not reached */ } @@ -642,7 +642,7 @@ if (EQ (value, Qequal)) return 1; if (EQ (value, Qeql)) return 1; - maybe_signal_simple_error ("Invalid hash table test", + maybe_invalid_constant ("Invalid hash table test", value, Qhash_table, errb); return 0; } @@ -655,7 +655,7 @@ if (EQ (obj, Qequal)) return HASH_TABLE_EQUAL; if (EQ (obj, Qeql)) return HASH_TABLE_EQL; - signal_simple_error ("Invalid hash table test", obj); + invalid_constant ("Invalid hash table test", obj); return HASH_TABLE_EQ; /* not reached */ } @@ -665,7 +665,7 @@ { if (!FLOATP (value)) { - maybe_signal_error (Qwrong_type_argument, list2 (Qfloatp, value), + maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value), Qhash_table, errb); return 0; } @@ -674,7 +674,7 @@ double rehash_size = XFLOAT_DATA (value); if (rehash_size <= 1.0) { - maybe_signal_simple_error + maybe_invalid_argument ("Hash table rehash size must be greater than 1.0", value, Qhash_table, errb); return 0; @@ -696,7 +696,7 @@ { if (!FLOATP (value)) { - maybe_signal_error (Qwrong_type_argument, list2 (Qfloatp, value), + maybe_signal_error_1 (Qwrong_type_argument, list2 (Qfloatp, value), Qhash_table, errb); return 0; } @@ -705,7 +705,7 @@ double rehash_threshold = XFLOAT_DATA (value); if (rehash_threshold <= 0.0 || rehash_threshold >= 1.0) { - maybe_signal_simple_error + maybe_invalid_argument ("Hash table rehash threshold must be between 0.0 and 1.0", value, Qhash_table, errb); return 0; @@ -731,7 +731,7 @@ if (len & 1) { - maybe_signal_simple_error + maybe_sferror ("Hash table data must have alternating key/value pairs", value, Qhash_table, errb); return 0; @@ -909,11 +909,11 @@ else if (EQ (keyword, Q_rehash_threshold)) rehash_threshold = value; else if (EQ (keyword, Q_weakness)) weakness = value; else if (EQ (keyword, Q_type))/*obsolete*/ weakness = value; - else signal_simple_error ("Invalid hash table property keyword", keyword); + else invalid_constant ("Invalid hash table property keyword", keyword); } if (i < nargs) - signal_simple_error ("Hash table property requires a value", args[i]); + sferror ("Hash table property requires a value", args[i]); #define VALIDATE_VAR(var) \ if (!NILP (var)) hash_table_##var##_validate (Q##var, var, ERROR_ME); @@ -1665,28 +1665,28 @@ DEFSUBR (Finternal_hash_value); #endif - defsymbol (&Qhash_tablep, "hash-table-p"); - defsymbol (&Qhash_table, "hash-table"); - defsymbol (&Qhashtable, "hashtable"); - defsymbol (&Qweakness, "weakness"); - defsymbol (&Qvalue, "value"); - defsymbol (&Qkey_or_value, "key-or-value"); - defsymbol (&Qkey_and_value, "key-and-value"); - defsymbol (&Qrehash_size, "rehash-size"); - defsymbol (&Qrehash_threshold, "rehash-threshold"); + DEFSYMBOL_MULTIWORD_PREDICATE (Qhash_tablep); + DEFSYMBOL (Qhash_table); + DEFSYMBOL (Qhashtable); + DEFSYMBOL (Qweakness); + DEFSYMBOL (Qvalue); + DEFSYMBOL (Qkey_or_value); + DEFSYMBOL (Qkey_and_value); + DEFSYMBOL (Qrehash_size); + DEFSYMBOL (Qrehash_threshold); - defsymbol (&Qweak, "weak"); /* obsolete */ - defsymbol (&Qkey_weak, "key-weak"); /* obsolete */ - defsymbol (&Qkey_or_value_weak, "key-or-value-weak"); /* obsolete */ - defsymbol (&Qvalue_weak, "value-weak"); /* obsolete */ - defsymbol (&Qnon_weak, "non-weak"); /* obsolete */ + DEFSYMBOL (Qweak); /* obsolete */ + DEFSYMBOL (Qkey_weak); /* obsolete */ + DEFSYMBOL (Qkey_or_value_weak); /* obsolete */ + DEFSYMBOL (Qvalue_weak); /* obsolete */ + DEFSYMBOL (Qnon_weak); /* obsolete */ - defkeyword (&Q_test, ":test"); - defkeyword (&Q_size, ":size"); - defkeyword (&Q_rehash_size, ":rehash-size"); - defkeyword (&Q_rehash_threshold, ":rehash-threshold"); - defkeyword (&Q_weakness, ":weakness"); - defkeyword (&Q_type, ":type"); /* obsolete */ + DEFKEYWORD (Q_test); + DEFKEYWORD (Q_size); + DEFKEYWORD (Q_rehash_size); + DEFKEYWORD (Q_rehash_threshold); + DEFKEYWORD (Q_weakness); + DEFKEYWORD (Q_type); /* obsolete */ } void diff -r c775bd016b32 -r 183866b06e0b src/emacs-widget-accessors.c --- a/src/emacs-widget-accessors.c Thu May 24 06:30:21 2001 +0000 +++ b/src/emacs-widget-accessors.c Thu May 24 07:51:33 2001 +0000 @@ -10,7 +10,7 @@ if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkAdjustment", obj); + wtaerror ("Object is not a GtkAdjustment", obj); }; the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object); @@ -31,7 +31,7 @@ if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkAdjustment", obj); + wtaerror ("Object is not a GtkAdjustment", obj); }; the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object); @@ -52,7 +52,7 @@ if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkAdjustment", obj); + wtaerror ("Object is not a GtkAdjustment", obj); }; the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object); @@ -73,7 +73,7 @@ if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkAdjustment", obj); + wtaerror ("Object is not a GtkAdjustment", obj); }; the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object); @@ -94,7 +94,7 @@ if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkAdjustment", obj); + wtaerror ("Object is not a GtkAdjustment", obj); }; the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object); @@ -115,7 +115,7 @@ if (!GTK_IS_ADJUSTMENT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkAdjustment", obj); + wtaerror ("Object is not a GtkAdjustment", obj); }; the_obj = GTK_ADJUSTMENT (XGTK_OBJECT (obj)->object); @@ -136,7 +136,7 @@ if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkWidget", obj); + wtaerror ("Object is not a GtkWidget", obj); }; the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object); @@ -157,7 +157,7 @@ if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkWidget", obj); + wtaerror ("Object is not a GtkWidget", obj); }; the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object); @@ -178,7 +178,7 @@ if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkWidget", obj); + wtaerror ("Object is not a GtkWidget", obj); }; the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object); @@ -199,7 +199,7 @@ if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkWidget", obj); + wtaerror ("Object is not a GtkWidget", obj); }; the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object); @@ -220,7 +220,7 @@ if (!GTK_IS_WIDGET (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkWidget", obj); + wtaerror ("Object is not a GtkWidget", obj); }; the_obj = GTK_WIDGET (XGTK_OBJECT (obj)->object); @@ -241,7 +241,7 @@ if (!GTK_IS_BUTTON (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkButton", obj); + wtaerror ("Object is not a GtkButton", obj); }; the_obj = GTK_BUTTON (XGTK_OBJECT (obj)->object); @@ -262,7 +262,7 @@ if (!GTK_IS_BUTTON (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkButton", obj); + wtaerror ("Object is not a GtkButton", obj); }; the_obj = GTK_BUTTON (XGTK_OBJECT (obj)->object); @@ -283,7 +283,7 @@ if (!GTK_IS_BUTTON (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkButton", obj); + wtaerror ("Object is not a GtkButton", obj); }; the_obj = GTK_BUTTON (XGTK_OBJECT (obj)->object); @@ -304,7 +304,7 @@ if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCombo", obj); + wtaerror ("Object is not a GtkCombo", obj); }; the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object); @@ -325,7 +325,7 @@ if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCombo", obj); + wtaerror ("Object is not a GtkCombo", obj); }; the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object); @@ -346,7 +346,7 @@ if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCombo", obj); + wtaerror ("Object is not a GtkCombo", obj); }; the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object); @@ -367,7 +367,7 @@ if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCombo", obj); + wtaerror ("Object is not a GtkCombo", obj); }; the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object); @@ -388,7 +388,7 @@ if (!GTK_IS_COMBO (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCombo", obj); + wtaerror ("Object is not a GtkCombo", obj); }; the_obj = GTK_COMBO (XGTK_OBJECT (obj)->object); @@ -409,7 +409,7 @@ if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkGammaCurve", obj); + wtaerror ("Object is not a GtkGammaCurve", obj); }; the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object); @@ -430,7 +430,7 @@ if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkGammaCurve", obj); + wtaerror ("Object is not a GtkGammaCurve", obj); }; the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object); @@ -451,7 +451,7 @@ if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkGammaCurve", obj); + wtaerror ("Object is not a GtkGammaCurve", obj); }; the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object); @@ -472,7 +472,7 @@ if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkGammaCurve", obj); + wtaerror ("Object is not a GtkGammaCurve", obj); }; the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object); @@ -493,7 +493,7 @@ if (!GTK_IS_GAMMA_CURVE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkGammaCurve", obj); + wtaerror ("Object is not a GtkGammaCurve", obj); }; the_obj = GTK_GAMMA_CURVE (XGTK_OBJECT (obj)->object); @@ -514,7 +514,7 @@ if (!GTK_IS_CHECK_MENU_ITEM (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCheckMenuItem", obj); + wtaerror ("Object is not a GtkCheckMenuItem", obj); }; the_obj = GTK_CHECK_MENU_ITEM (XGTK_OBJECT (obj)->object); @@ -535,7 +535,7 @@ if (!GTK_IS_NOTEBOOK (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkNotebook", obj); + wtaerror ("Object is not a GtkNotebook", obj); }; the_obj = GTK_NOTEBOOK (XGTK_OBJECT (obj)->object); @@ -556,7 +556,7 @@ if (!GTK_IS_TEXT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkText", obj); + wtaerror ("Object is not a GtkText", obj); }; the_obj = GTK_TEXT (XGTK_OBJECT (obj)->object); @@ -577,7 +577,7 @@ if (!GTK_IS_TEXT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkText", obj); + wtaerror ("Object is not a GtkText", obj); }; the_obj = GTK_TEXT (XGTK_OBJECT (obj)->object); @@ -598,7 +598,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -619,7 +619,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -640,7 +640,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -661,7 +661,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -682,7 +682,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -703,7 +703,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -724,7 +724,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -745,7 +745,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -766,7 +766,7 @@ if (!GTK_IS_FILE_SELECTION (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFileSelection", obj); + wtaerror ("Object is not a GtkFileSelection", obj); }; the_obj = GTK_FILE_SELECTION (XGTK_OBJECT (obj)->object); @@ -787,7 +787,7 @@ if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFontSelectionDialog", obj); + wtaerror ("Object is not a GtkFontSelectionDialog", obj); }; the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -808,7 +808,7 @@ if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFontSelectionDialog", obj); + wtaerror ("Object is not a GtkFontSelectionDialog", obj); }; the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -829,7 +829,7 @@ if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFontSelectionDialog", obj); + wtaerror ("Object is not a GtkFontSelectionDialog", obj); }; the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -850,7 +850,7 @@ if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFontSelectionDialog", obj); + wtaerror ("Object is not a GtkFontSelectionDialog", obj); }; the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -871,7 +871,7 @@ if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFontSelectionDialog", obj); + wtaerror ("Object is not a GtkFontSelectionDialog", obj); }; the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -892,7 +892,7 @@ if (!GTK_IS_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkFontSelectionDialog", obj); + wtaerror ("Object is not a GtkFontSelectionDialog", obj); }; the_obj = GTK_FONT_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -913,7 +913,7 @@ if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkColorSelectionDialog", obj); + wtaerror ("Object is not a GtkColorSelectionDialog", obj); }; the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -934,7 +934,7 @@ if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkColorSelectionDialog", obj); + wtaerror ("Object is not a GtkColorSelectionDialog", obj); }; the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -955,7 +955,7 @@ if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkColorSelectionDialog", obj); + wtaerror ("Object is not a GtkColorSelectionDialog", obj); }; the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -976,7 +976,7 @@ if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkColorSelectionDialog", obj); + wtaerror ("Object is not a GtkColorSelectionDialog", obj); }; the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -997,7 +997,7 @@ if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkColorSelectionDialog", obj); + wtaerror ("Object is not a GtkColorSelectionDialog", obj); }; the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -1018,7 +1018,7 @@ if (!GTK_IS_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkColorSelectionDialog", obj); + wtaerror ("Object is not a GtkColorSelectionDialog", obj); }; the_obj = GTK_COLOR_SELECTION_DIALOG (XGTK_OBJECT (obj)->object); @@ -1039,7 +1039,7 @@ if (!GTK_IS_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkDialog", obj); + wtaerror ("Object is not a GtkDialog", obj); }; the_obj = GTK_DIALOG (XGTK_OBJECT (obj)->object); @@ -1060,7 +1060,7 @@ if (!GTK_IS_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkDialog", obj); + wtaerror ("Object is not a GtkDialog", obj); }; the_obj = GTK_DIALOG (XGTK_OBJECT (obj)->object); @@ -1081,7 +1081,7 @@ if (!GTK_IS_INPUT_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkInputDialog", obj); + wtaerror ("Object is not a GtkInputDialog", obj); }; the_obj = GTK_INPUT_DIALOG (XGTK_OBJECT (obj)->object); @@ -1102,7 +1102,7 @@ if (!GTK_IS_INPUT_DIALOG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkInputDialog", obj); + wtaerror ("Object is not a GtkInputDialog", obj); }; the_obj = GTK_INPUT_DIALOG (XGTK_OBJECT (obj)->object); @@ -1123,7 +1123,7 @@ if (!GTK_IS_PLUG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkPlug", obj); + wtaerror ("Object is not a GtkPlug", obj); }; the_obj = GTK_PLUG (XGTK_OBJECT (obj)->object); @@ -1144,7 +1144,7 @@ if (!GTK_IS_PLUG (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkPlug", obj); + wtaerror ("Object is not a GtkPlug", obj); }; the_obj = GTK_PLUG (XGTK_OBJECT (obj)->object); @@ -1165,7 +1165,7 @@ if (!GTK_IS_OBJECT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkObject", obj); + wtaerror ("Object is not a GtkObject", obj); }; the_obj = GTK_OBJECT (XGTK_OBJECT (obj)->object); @@ -1186,7 +1186,7 @@ if (!GTK_IS_OBJECT (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkObject", obj); + wtaerror ("Object is not a GtkObject", obj); }; the_obj = GTK_OBJECT (XGTK_OBJECT (obj)->object); @@ -1207,7 +1207,7 @@ if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkPaned", obj); + wtaerror ("Object is not a GtkPaned", obj); }; the_obj = GTK_PANED (XGTK_OBJECT (obj)->object); @@ -1228,7 +1228,7 @@ if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkPaned", obj); + wtaerror ("Object is not a GtkPaned", obj); }; the_obj = GTK_PANED (XGTK_OBJECT (obj)->object); @@ -1249,7 +1249,7 @@ if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkPaned", obj); + wtaerror ("Object is not a GtkPaned", obj); }; the_obj = GTK_PANED (XGTK_OBJECT (obj)->object); @@ -1270,7 +1270,7 @@ if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkPaned", obj); + wtaerror ("Object is not a GtkPaned", obj); }; the_obj = GTK_PANED (XGTK_OBJECT (obj)->object); @@ -1291,7 +1291,7 @@ if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkPaned", obj); + wtaerror ("Object is not a GtkPaned", obj); }; the_obj = GTK_PANED (XGTK_OBJECT (obj)->object); @@ -1312,7 +1312,7 @@ if (!GTK_IS_PANED (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkPaned", obj); + wtaerror ("Object is not a GtkPaned", obj); }; the_obj = GTK_PANED (XGTK_OBJECT (obj)->object); @@ -1333,7 +1333,7 @@ if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCList", obj); + wtaerror ("Object is not a GtkCList", obj); }; the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object); @@ -1354,7 +1354,7 @@ if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCList", obj); + wtaerror ("Object is not a GtkCList", obj); }; the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object); @@ -1375,7 +1375,7 @@ if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCList", obj); + wtaerror ("Object is not a GtkCList", obj); }; the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object); @@ -1396,7 +1396,7 @@ if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCList", obj); + wtaerror ("Object is not a GtkCList", obj); }; the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object); @@ -1417,7 +1417,7 @@ if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCList", obj); + wtaerror ("Object is not a GtkCList", obj); }; the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object); @@ -1438,7 +1438,7 @@ if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCList", obj); + wtaerror ("Object is not a GtkCList", obj); }; the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object); @@ -1459,7 +1459,7 @@ if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkCList", obj); + wtaerror ("Object is not a GtkCList", obj); }; the_obj = GTK_CLIST (XGTK_OBJECT (obj)->object); @@ -1480,7 +1480,7 @@ if (!GTK_IS_LIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkList", obj); + wtaerror ("Object is not a GtkList", obj); }; the_obj = GTK_LIST (XGTK_OBJECT (obj)->object); @@ -1501,7 +1501,7 @@ if (!GTK_IS_LIST (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkList", obj); + wtaerror ("Object is not a GtkList", obj); }; the_obj = GTK_LIST (XGTK_OBJECT (obj)->object); @@ -1522,7 +1522,7 @@ if (!GTK_IS_TREE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkTree", obj); + wtaerror ("Object is not a GtkTree", obj); }; the_obj = GTK_TREE (XGTK_OBJECT (obj)->object); @@ -1543,7 +1543,7 @@ if (!GTK_IS_TREE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkTree", obj); + wtaerror ("Object is not a GtkTree", obj); }; the_obj = GTK_TREE (XGTK_OBJECT (obj)->object); @@ -1564,7 +1564,7 @@ if (!GTK_IS_TREE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkTree", obj); + wtaerror ("Object is not a GtkTree", obj); }; the_obj = GTK_TREE (XGTK_OBJECT (obj)->object); @@ -1585,7 +1585,7 @@ if (!GTK_IS_TREE (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkTree", obj); + wtaerror ("Object is not a GtkTree", obj); }; the_obj = GTK_TREE (XGTK_OBJECT (obj)->object); @@ -1606,7 +1606,7 @@ if (!GTK_IS_TREE_ITEM (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkTreeItem", obj); + wtaerror ("Object is not a GtkTreeItem", obj); }; the_obj = GTK_TREE_ITEM (XGTK_OBJECT (obj)->object); @@ -1627,7 +1627,7 @@ if (!GTK_IS_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkScrolledWindow", obj); + wtaerror ("Object is not a GtkScrolledWindow", obj); }; the_obj = GTK_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object); @@ -1648,7 +1648,7 @@ if (!GTK_IS_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkScrolledWindow", obj); + wtaerror ("Object is not a GtkScrolledWindow", obj); }; the_obj = GTK_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object); @@ -1669,7 +1669,7 @@ if (!GTK_IS_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkScrolledWindow", obj); + wtaerror ("Object is not a GtkScrolledWindow", obj); }; the_obj = GTK_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object); @@ -1690,7 +1690,7 @@ if (!GTK_IS_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object)) { - signal_simple_error ("Object is not a GtkScrolledWindow", obj); + wtaerror ("Object is not a GtkScrolledWindow", obj); }; the_obj = GTK_SCROLLED_WINDOW (XGTK_OBJECT (obj)->object); diff -r c775bd016b32 -r 183866b06e0b src/emacs.c --- a/src/emacs.c Thu May 24 06:30:21 2001 +0000 +++ b/src/emacs.c Thu May 24 07:51:33 2001 +0000 @@ -1237,6 +1237,7 @@ defsubr() (i.e. DEFSUBR) deferror(), DEFERROR(), or DEFERROR_STANDARD() defkeyword() or DEFKEYWORD() + Fput() Order does not matter in these functions. */ @@ -1292,6 +1293,7 @@ syms_of_general (); syms_of_glyphs (); syms_of_glyphs_eimage (); + syms_of_glyphs_shared (); syms_of_glyphs_widget (); syms_of_gui (); syms_of_gutter (); @@ -2598,7 +2600,7 @@ assert (!gc_in_progress); if (run_temacs_argc < 0) - error ("I've lost my temacs-hood."); + invalid_operation ("I've lost my temacs-hood.", Qunbound); /* Need to convert the orig_invoc_name and all of the arguments to external format. */ @@ -3213,8 +3215,9 @@ while (!STRINGP (Vpath_separator) || (XSTRING_CHAR_LENGTH (Vpath_separator) != 1)) - Vpath_separator = signal_simple_continuable_error - ("`path-separator' should be set to a single-character string", + Vpath_separator = signal_continuable_error + (Qinvalid_state, + "`path-separator' should be set to a single-character string", Vpath_separator); return (split_string_by_emchar_1 @@ -3389,8 +3392,8 @@ DEFSUBR (Fsplit_string_by_char); DEFSUBR (Fsplit_path); /* #### */ - defsymbol (&Qkill_emacs_hook, "kill-emacs-hook"); - defsymbol (&Qsave_buffers_kill_emacs, "save-buffers-kill-emacs"); + DEFSYMBOL (Qkill_emacs_hook); + DEFSYMBOL (Qsave_buffers_kill_emacs); } void diff -r c775bd016b32 -r 183866b06e0b src/emodules.c --- a/src/emodules.c Thu May 24 06:30:21 2001 +0000 +++ b/src/emodules.c Thu May 24 07:51:33 2001 +0000 @@ -327,7 +327,7 @@ dlhandle = 0; if ((module == (const char *)0) || (module[0] == '\0')) - error ("Empty module name"); + invalid_argument ("Empty module name", Qunbound); /* This is to get around the fact that build_string() is not declared as taking a const char * as an argument. I HATE compiler warnings. */ @@ -336,46 +336,51 @@ GCPRO2(filename, foundname); filename = build_string (tmod); - fd = locate_file(Vmodule_load_path, filename, Vmodule_extensions, - &foundname, -1); + fd = locate_file (Vmodule_load_path, filename, Vmodule_extensions, + &foundname, -1); UNGCPRO; if (fd < 0) - signal_simple_error ("Cannot open dynamic module", filename); + signal_error (Qdll_error, "Cannot open dynamic module", filename); soname = (char *)alloca (XSTRING_LENGTH (foundname) + 1); strcpy (soname, (char *)XSTRING_DATA (foundname)); dlhandle = dll_open (soname); if (dlhandle == (dll_handle)0) - error ("Opening dynamic module: %s", dll_error (dlhandle)); + { + Bufbyte *dllerrint; + + EXTERNAL_TO_C_STRING (dll_error (dlhandle), dllerrint, Qnative); + signal_error (Qdll_error, "Opening dynamic module", + build_string (dllerrint)); + } ellcc_rev = (const long *)dll_variable (dlhandle, "emodule_compiler"); if ((ellcc_rev == (const long *)0) || (*ellcc_rev <= 0)) - error ("Missing symbol `emodule_compiler': Invalid dynamic module"); + signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_compiler'", Qunbound); if (*ellcc_rev > EMODULES_REVISION) - error ("Unsupported version `%ld(%ld)': Invalid dynamic module", - *ellcc_rev, EMODULES_REVISION); + signal_ferror (Qdll_error, "Invalid dynamic module: Unsupported version `%ld(%ld)'", *ellcc_rev, EMODULES_REVISION); f = (const char **)dll_variable (dlhandle, "emodule_name"); if ((f == (const char **)0) || (*f == (const char *)0)) - error ("Missing symbol `emodule_name': Invalid dynamic module"); + signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_name'", Qunbound); mname = (char *)alloca (strlen (*f) + 1); strcpy (mname, *f); if (mname[0] == '\0') - error ("Empty value for `emodule_name': Invalid dynamic module"); + signal_error (Qdll_error, "Invalid dynamic module: Empty value for `emodule_name'", Qunbound); f = (const char **)dll_variable (dlhandle, "emodule_version"); if ((f == (const char **)0) || (*f == (const char *)0)) - error ("Missing symbol `emodule_version': Invalid dynamic module"); + signal_error (Qdll_error, "Missing symbol `emodule_version': Invalid dynamic module", Qunbound); mver = (char *)alloca (strlen (*f) + 1); strcpy (mver, *f); f = (const char **)dll_variable (dlhandle, "emodule_title"); if ((f == (const char **)0) || (*f == (const char *)0)) - error ("Missing symbol `emodule_title': Invalid dynamic module"); + signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_title'", Qunbound); mtitle = (char *)alloca (strlen (*f) + 1); strcpy (mtitle, *f); @@ -394,25 +399,29 @@ strcat (symname, mname); modsyms = (void (*)(void))dll_function (dlhandle, symname); if (modsyms == (void (*)(void))0) - error ("Missing symbol `%s': Invalid dynamic module", symname); + { + missing_symbol: + signal_error (Qdll_error, "Invalid dynamic module: Missing symbol", + build_string (symname)); + } strcpy (symname, "vars_of_"); strcat (symname, mname); modvars = (void (*)(void))dll_function (dlhandle, symname); if (modvars == (void (*)(void))0) - error ("Missing symbol `%s': Invalid dynamic module", symname); + goto missing_symbol; strcpy (symname, "docs_of_"); strcat (symname, mname); moddocs = (void (*)(void))dll_function (dlhandle, symname); if (moddocs == (void (*)(void))0) - error ("Missing symbol `%s': Invalid dynamic module", symname); + goto missing_symbol; if (modname && modname[0] && strcmp (modname, mname)) - error ("Module name mismatch"); + signal_error (Qdll_error, "Module name mismatch", Qunbound); if (modver && modver[0] && strcmp (modver, mver)) - error ("Module version mismatch"); + signal_error (Qdll_error, "Module version mismatch", Qunbound); /* * Attempt to make a new slot for this module. If this really is the diff -r c775bd016b32 -r 183866b06e0b src/esd.c --- a/src/esd.c Thu May 24 06:30:21 2001 +0000 +++ b/src/esd.c Thu May 24 07:51:33 2001 +0000 @@ -19,32 +19,30 @@ /* Synched up with: Not in FSF. */ -#ifdef HAVE_CONFIG_H +/* This file Mule-ized by Ben Wing, 5-15-01. */ + #include -#endif +#include "lisp.h" -#include "lisp.h" #include "miscplay.h" +#include "sound.h" + +#include "sysfile.h" #include -#include -#include -#include -#include -#include /* the name given to ESD - I think this should identify ourselves */ #define ESD_NAME "xemacs" -int esd_play_sound_file(char *file, int vol); -int esd_play_sound_file(char *file, int vol) +int esd_play_sound_file (Extbyte *file, int vol); +int esd_play_sound_file (Extbyte *file, int vol) { /* #### FIXME: vol is ignored */ return esd_play_file(ESD_NAME, file, 0); } -int esd_play_sound_data(unsigned char *data, size_t length, int vol); -int esd_play_sound_data(unsigned char *data, size_t length, int vol) +int esd_play_sound_data (UChar_Binary *data, size_t length, int vol); +int esd_play_sound_data (UChar_Binary *data, size_t length, int vol) { /* #### FIXME: vol is ignored */ size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf); size_t (*sndcnv)(void **dayta,size_t *sz,void **); @@ -63,7 +61,7 @@ ffmt = analyze_format(data,&fmt,&speed,&tracks,&parsesndfile); if (ffmt != fmtRaw && ffmt != fmtSunAudio && ffmt != fmtWave) { - message(GETTEXT("audio: Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)")); + sound_warn("audio: Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)"); return 0; } @@ -87,7 +85,7 @@ flags |= ESD_BITS16; break; default: - message(GETTEXT("audio: byte format %d unimplemented"), fmt); + sound_warn ("audio: byte format %d unimplemented", fmt); return 0; } switch (tracks) @@ -95,7 +93,7 @@ case 1: flags |= ESD_MONO; break; case 2: flags |= ESD_STEREO; break; default: - message(GETTEXT("audio: %d channels - only 1 or 2 supported"), tracks); + sound_warn ("audio: %d channels - only 1 or 2 supported", tracks); return 0; } @@ -110,11 +108,11 @@ for (cptr = optr; (crtn = sndcnv((void **)&cptr,&prtn, (void **)&sptr)) > 0; ) { if ((wrtn = write(sock,sptr,crtn)) < 0) { - message(GETTEXT("audio: write error (%s)"), strerror(errno)); + sound_perror ("audio: write error"); goto END_OF_PLAY; } if (wrtn != crtn) { - message(GETTEXT("audio: only wrote %d of %d bytes"), wrtn, crtn); + sound_warn ("audio: only wrote %d of %d bytes", wrtn, crtn); goto END_OF_PLAY; } } diff -r c775bd016b32 -r 183866b06e0b src/eval.c --- a/src/eval.c Thu May 24 06:30:21 2001 +0000 +++ b/src/eval.c Thu May 24 07:51:33 2001 +0000 @@ -1,7 +1,7 @@ /* Evaluator for XEmacs Lisp interpreter. Copyright (C) 1985-1987, 1992-1994 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2000 Ben Wing. + Copyright (C) 2000, 2001 Ben Wing. This file is part of XEmacs. @@ -290,7 +290,7 @@ const char *trailer = subr->prompt ? " (interactive)>" : ">"; if (print_readably) - error ("printing unreadable object %s%s%s", header, name, trailer); + printing_unreadable_object ("%s%s%s", header, name, trailer); write_c_string (header, printcharfun); write_c_string (name, printcharfun); @@ -866,7 +866,7 @@ CHECK_CONS (tem); value = Feval (XCAR (tem)); if (!NILP (XCDR (tem))) - signal_simple_error + sferror ("`let' bindings can have only one value-form", var); } } @@ -924,7 +924,7 @@ gcpro1.nvars = idx; if (!NILP (XCDR (tem))) - signal_simple_error + sferror ("`let' bindings can have only one value-form", var); } } @@ -1096,7 +1096,7 @@ Lisp_Object doc = XCAR (args); Fput (sym, Qvariable_documentation, doc); if (!NILP (args = XCDR (args))) - error ("too many arguments"); + signal_error (Qwrong_number_of_arguments, "too many arguments", Qunbound); } } @@ -1144,7 +1144,7 @@ Lisp_Object doc = XCAR (args); Fput (sym, Qvariable_documentation, doc); if (!NILP (args = XCDR (args))) - error ("too many arguments"); + signal_error (Qwrong_number_of_arguments, "too many arguments", Qunbound); } #ifdef I18N3 @@ -1720,7 +1720,7 @@ else { invalid_condition_handler: - signal_simple_error ("Invalid condition handler", handler); + sferror ("Invalid condition handler", handler); } } @@ -1839,7 +1839,9 @@ #else /* But the reality is that that stinks, because: */ /* GACK!!! Really want some way for debug-on-quit errors to be continuable!! */ - error ("Returning a value from an error is no longer supported"); + signal_error (Qunimplemented, + "Returning a value from an error is no longer supported", + Qunbound); #endif } @@ -2017,7 +2019,7 @@ data. */ /* The simplest external error function: it would be called - signal_continuable_error() in the terminology below, but it's + signal_continuable_error_1() in the terminology below, but it's Lisp-callable. */ DEFUN ("signal", Fsignal, 2, 2, 0, /* @@ -2055,7 +2057,7 @@ /* Signal a non-continuable error. */ DOESNT_RETURN -signal_error (Lisp_Object sig, Lisp_Object data) +signal_error_1 (Lisp_Object sig, Lisp_Object data) { for (;;) Fsignal (sig, data); @@ -2221,8 +2223,8 @@ Qresource, etc.). */ void -maybe_signal_error (Lisp_Object sig, Lisp_Object data, Lisp_Object class, - Error_behavior errb) +maybe_signal_error_1 (Lisp_Object sig, Lisp_Object data, Lisp_Object class, + Error_behavior errb) { if (ERRB_EQ (errb, ERROR_ME_NOT)) return; @@ -2237,8 +2239,8 @@ according to ERRB. */ Lisp_Object -maybe_signal_continuable_error (Lisp_Object sig, Lisp_Object data, - Lisp_Object class, Error_behavior errb) +maybe_signal_continuable_error_1 (Lisp_Object sig, Lisp_Object data, + Lisp_Object class, Error_behavior errb) { if (ERRB_EQ (errb, ERROR_ME_NOT)) return Qnil; @@ -2254,14 +2256,130 @@ /****************** Error functions class 2 ******************/ -/* Class 2: Printf-like functions that signal an error. +/* Class 2: Signal an error with a string and an associated object. + Normally these functions are used to attach one associated object, + but to attach no objects, specify Qunbound for FROB, and for more + than one object, make a list of the objects with Qunbound as the + first element. (If you have specifically two objects to attach, + consider using the function in class 3 below.) These functions + signal an error of a specified type, whose data is one or more + objects (usually two), a string the related Lisp object(s) + specified as FROB. */ + +/* Out of REASON and FROB, return a list of elements suitable for passing + to signal_error_1(). */ + +Lisp_Object +build_error_data (const char *reason, Lisp_Object frob) +{ + if (EQ (frob, Qunbound)) + frob = Qnil; + else if (CONSP (frob) && EQ (XCAR (frob), Qunbound)) + frob = XCDR (frob); + else + frob = list1 (frob); + if (!reason) + return frob; + else + return Fcons (build_translated_string (reason), frob); +} + +DOESNT_RETURN +signal_error (Lisp_Object type, const char *reason, Lisp_Object frob) +{ + signal_error_1 (type, build_error_data (reason, frob)); +} + +void +maybe_signal_error (Lisp_Object type, const char *reason, + Lisp_Object frob, Lisp_Object class, + Error_behavior errb) +{ + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return; + maybe_signal_error_1 (type, build_error_data (reason, frob), class, errb); +} + +Lisp_Object +signal_continuable_error (Lisp_Object type, const char *reason, + Lisp_Object frob) +{ + return Fsignal (type, build_error_data (reason, frob)); +} + +Lisp_Object +maybe_signal_continuable_error (Lisp_Object type, const char *reason, + Lisp_Object frob, Lisp_Object class, + Error_behavior errb) +{ + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return Qnil; + return maybe_signal_continuable_error_1 (type, + build_error_data (reason, frob), + class, errb); +} + + +/****************** Error functions class 3 ******************/ + +/* Class 3: Signal an error with a string and two associated objects. + These functions signal an error of a specified type, whose data + is three objects, a string and two related Lisp objects. + (The equivalent could be accomplished using the class 2 functions, + but these are more convenient in this particular case.) */ + +DOESNT_RETURN +signal_error_2 (Lisp_Object type, const char *reason, + Lisp_Object frob0, Lisp_Object frob1) +{ + signal_error_1 (type, list3 (build_translated_string (reason), frob0, + frob1)); +} + +void +maybe_signal_error_2 (Lisp_Object type, const char *reason, + Lisp_Object frob0, Lisp_Object frob1, + Lisp_Object class, Error_behavior errb) +{ + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return; + maybe_signal_error_1 (type, list3 (build_translated_string (reason), frob0, + frob1), class, errb); +} + +Lisp_Object +signal_continuable_error_2 (Lisp_Object type, const char *reason, + Lisp_Object frob0, Lisp_Object frob1) +{ + return Fsignal (type, list3 (build_translated_string (reason), frob0, + frob1)); +} + +Lisp_Object +maybe_signal_continuable_error_2 (Lisp_Object type, const char *reason, + Lisp_Object frob0, Lisp_Object frob1, + Lisp_Object class, Error_behavior errb) +{ + /* Optimization: */ + if (ERRB_EQ (errb, ERROR_ME_NOT)) + return Qnil; + return maybe_signal_continuable_error_1 + (type, list3 (build_translated_string (reason), frob0, frob1), + class, errb); +} + + +/****************** Error functions class 4 ******************/ + +/* Class 4: Printf-like functions that signal an error. These functions signal an error of a specified type, whose data is a single string, created using the arguments. */ -/* dump an error message; called like printf */ - DOESNT_RETURN -type_error (Lisp_Object type, const char *fmt, ...) +signal_ferror (Lisp_Object type, const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2272,12 +2390,12 @@ va_end (args); /* Fsignal GC-protects its args */ - signal_error (type, list1 (obj)); + signal_error (type, 0, obj); } void -maybe_type_error (Lisp_Object type, Lisp_Object class, Error_behavior errb, - const char *fmt, ...) +maybe_signal_ferror (Lisp_Object type, Lisp_Object class, Error_behavior errb, + const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2292,11 +2410,11 @@ va_end (args); /* Fsignal GC-protects its args */ - maybe_signal_error (type, list1 (obj), class, errb); + maybe_signal_error (type, 0, obj, class, errb); } Lisp_Object -continuable_type_error (Lisp_Object type, const char *fmt, ...) +signal_continuable_ferror (Lisp_Object type, const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2311,139 +2429,8 @@ } Lisp_Object -maybe_continuable_type_error (Lisp_Object type, Lisp_Object class, - Error_behavior errb, const char *fmt, ...) -{ - Lisp_Object obj; - va_list args; - - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return Qnil; - - va_start (args, fmt); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, - args); - va_end (args); - - /* Fsignal GC-protects its args */ - return maybe_signal_continuable_error (type, list1 (obj), class, errb); -} - - -/****************** Error functions class 3 ******************/ - -/* Class 3: Signal an error with a string and an associated object. - These functions signal an error of a specified type, whose data - is two objects, a string and a related Lisp object (usually the object - where the error is occurring). */ - -DOESNT_RETURN -signal_type_error (Lisp_Object type, const char *reason, Lisp_Object frob) -{ - if (UNBOUNDP (frob)) - signal_error (type, list1 (build_translated_string (reason))); - else - signal_error (type, list2 (build_translated_string (reason), frob)); -} - -void -maybe_signal_type_error (Lisp_Object type, const char *reason, - Lisp_Object frob, Lisp_Object class, - Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - maybe_signal_error (type, list2 (build_translated_string (reason), frob), - class, errb); -} - -Lisp_Object -signal_type_continuable_error (Lisp_Object type, const char *reason, - Lisp_Object frob) -{ - return Fsignal (type, list2 (build_translated_string (reason), frob)); -} - -Lisp_Object -maybe_signal_type_continuable_error (Lisp_Object type, const char *reason, - Lisp_Object frob, Lisp_Object class, - Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return Qnil; - return maybe_signal_continuable_error - (type, list2 (build_translated_string (reason), - frob), class, errb); -} - - -/****************** Error functions class 4 ******************/ - -/* Class 4: Printf-like functions that signal an error. - These functions signal an error of a specified type, whose data - is a two objects, a string (created using the arguments) and a - Lisp object. -*/ - -DOESNT_RETURN -type_error_with_frob (Lisp_Object type, Lisp_Object frob, const char *fmt, ...) -{ - Lisp_Object obj; - va_list args; - - va_start (args, fmt); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, - args); - va_end (args); - - /* Fsignal GC-protects its args */ - signal_error (type, list2 (obj, frob)); -} - -void -maybe_type_error_with_frob (Lisp_Object type, Lisp_Object frob, - Lisp_Object class, Error_behavior errb, - const char *fmt, ...) -{ - Lisp_Object obj; - va_list args; - - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - - va_start (args, fmt); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, - args); - va_end (args); - - /* Fsignal GC-protects its args */ - maybe_signal_error (type, list2 (obj, frob), class, errb); -} - -Lisp_Object -continuable_type_error_with_frob (Lisp_Object type, Lisp_Object frob, - const char *fmt, ...) -{ - Lisp_Object obj; - va_list args; - - va_start (args, fmt); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, - args); - va_end (args); - - /* Fsignal GC-protects its args */ - return Fsignal (type, list2 (obj, frob)); -} - -Lisp_Object -maybe_continuable_type_error_with_frob (Lisp_Object type, Lisp_Object frob, - Lisp_Object class, Error_behavior errb, - const char *fmt, ...) +maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class, + Error_behavior errb, const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2458,71 +2445,27 @@ va_end (args); /* Fsignal GC-protects its args */ - return maybe_signal_continuable_error (type, list2 (obj, frob), - class, errb); + return maybe_signal_continuable_error (type, 0, obj, class, errb); } /****************** Error functions class 5 ******************/ -/* Class 5: Signal an error with a string and two associated objects. +/* Class 5: Printf-like functions that signal an error. These functions signal an error of a specified type, whose data - is three objects, a string and two related Lisp objects. */ + is a one or more objects, a string (created using the arguments) + and additional Lisp objects specified in FROB. (The syntax of FROB + is the same as for class 2.) + + There is no need for a class 6 because you can always attach 2 + objects using class 5 (for FROB, specify a list with three + elements, the first of which is Qunbound), and these functions are + not commonly used. +*/ DOESNT_RETURN -signal_type_error_2 (Lisp_Object type, const char *reason, - Lisp_Object frob0, Lisp_Object frob1) -{ - signal_error (type, list3 (build_translated_string (reason), frob0, - frob1)); -} - -void -maybe_signal_type_error_2 (Lisp_Object type, const char *reason, - Lisp_Object frob0, Lisp_Object frob1, - Lisp_Object class, Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - maybe_signal_error (type, list3 (build_translated_string (reason), frob0, - frob1), class, errb); -} - - -Lisp_Object -signal_type_continuable_error_2 (Lisp_Object type, const char *reason, - Lisp_Object frob0, Lisp_Object frob1) -{ - return Fsignal (type, list3 (build_translated_string (reason), frob0, - frob1)); -} - -Lisp_Object -maybe_signal_type_continuable_error_2 (Lisp_Object type, const char *reason, - Lisp_Object frob0, Lisp_Object frob1, - Lisp_Object class, Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return Qnil; - return maybe_signal_continuable_error - (type, list3 (build_translated_string (reason), frob0, - frob1), - class, errb); -} - - -/****************** Simple error functions class 2 ******************/ - -/* Simple class 2: Printf-like functions that signal an error. - These functions signal an error of type Qerror, whose data - is a single string, created using the arguments. */ - -/* dump an error message; called like printf */ - -DOESNT_RETURN -error (const char *fmt, ...) +signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const char *fmt, + ...) { Lisp_Object obj; va_list args; @@ -2533,11 +2476,13 @@ va_end (args); /* Fsignal GC-protects its args */ - signal_error (Qerror, list1 (obj)); + signal_error_1 (type, Fcons (obj, build_error_data (0, frob))); } void -maybe_error (Lisp_Object class, Error_behavior errb, const char *fmt, ...) +maybe_signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, + Lisp_Object class, Error_behavior errb, + const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2552,11 +2497,13 @@ va_end (args); /* Fsignal GC-protects its args */ - maybe_signal_error (Qerror, list1 (obj), class, errb); + maybe_signal_error_1 (type, Fcons (obj, build_error_data (0, frob)), class, + errb); } Lisp_Object -continuable_error (const char *fmt, ...) +signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, + const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2567,12 +2514,14 @@ va_end (args); /* Fsignal GC-protects its args */ - return Fsignal (Qerror, list1 (obj)); + return Fsignal (type, Fcons (obj, build_error_data (0, frob))); } Lisp_Object -maybe_continuable_error (Lisp_Object class, Error_behavior errb, - const char *fmt, ...) +maybe_signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, + Lisp_Object class, + Error_behavior errb, + const char *fmt, ...) { Lisp_Object obj; va_list args; @@ -2587,180 +2536,10 @@ va_end (args); /* Fsignal GC-protects its args */ - return maybe_signal_continuable_error (Qerror, list1 (obj), class, errb); -} - - -/****************** Simple error functions class 3 ******************/ - -/* Simple class 3: Signal an error with a string and an associated object. - These functions signal an error of type Qerror, whose data - is two objects, a string and a related Lisp object (usually the object - where the error is occurring). */ - -DOESNT_RETURN -signal_simple_error (const char *reason, Lisp_Object frob) -{ - signal_error (Qerror, list2 (build_translated_string (reason), frob)); -} - -void -maybe_signal_simple_error (const char *reason, Lisp_Object frob, - Lisp_Object class, Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - maybe_signal_error (Qerror, list2 (build_translated_string (reason), frob), - class, errb); -} - -Lisp_Object -signal_simple_continuable_error (const char *reason, Lisp_Object frob) -{ - return Fsignal (Qerror, list2 (build_translated_string (reason), frob)); -} - -Lisp_Object -maybe_signal_simple_continuable_error (const char *reason, Lisp_Object frob, - Lisp_Object class, Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return Qnil; - return maybe_signal_continuable_error - (Qerror, list2 (build_translated_string (reason), - frob), class, errb); -} - - -/****************** Simple error functions class 4 ******************/ - -/* Simple class 4: Printf-like functions that signal an error. - These functions signal an error of type Qerror, whose data - is a two objects, a string (created using the arguments) and a - Lisp object. -*/ - -DOESNT_RETURN -error_with_frob (Lisp_Object frob, const char *fmt, ...) -{ - Lisp_Object obj; - va_list args; - - va_start (args, fmt); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, - args); - va_end (args); - - /* Fsignal GC-protects its args */ - signal_error (Qerror, list2 (obj, frob)); -} - -void -maybe_error_with_frob (Lisp_Object frob, Lisp_Object class, - Error_behavior errb, const char *fmt, ...) -{ - Lisp_Object obj; - va_list args; - - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - - va_start (args, fmt); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, - args); - va_end (args); - - /* Fsignal GC-protects its args */ - maybe_signal_error (Qerror, list2 (obj, frob), class, errb); -} - -Lisp_Object -continuable_error_with_frob (Lisp_Object frob, const char *fmt, ...) -{ - Lisp_Object obj; - va_list args; - - va_start (args, fmt); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, - args); - va_end (args); - - /* Fsignal GC-protects its args */ - return Fsignal (Qerror, list2 (obj, frob)); -} - -Lisp_Object -maybe_continuable_error_with_frob (Lisp_Object frob, Lisp_Object class, - Error_behavior errb, const char *fmt, ...) -{ - Lisp_Object obj; - va_list args; - - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return Qnil; - - va_start (args, fmt); - obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, - args); - va_end (args); - - /* Fsignal GC-protects its args */ - return maybe_signal_continuable_error (Qerror, list2 (obj, frob), - class, errb); -} - - -/****************** Simple error functions class 5 ******************/ - -/* Simple class 5: Signal an error with a string and two associated objects. - These functions signal an error of type Qerror, whose data - is three objects, a string and two related Lisp objects. */ - -DOESNT_RETURN -signal_simple_error_2 (const char *reason, - Lisp_Object frob0, Lisp_Object frob1) -{ - signal_error (Qerror, list3 (build_translated_string (reason), frob0, - frob1)); -} - -void -maybe_signal_simple_error_2 (const char *reason, Lisp_Object frob0, - Lisp_Object frob1, Lisp_Object class, - Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - maybe_signal_error (Qerror, list3 (build_translated_string (reason), frob0, - frob1), class, errb); -} - - -Lisp_Object -signal_simple_continuable_error_2 (const char *reason, Lisp_Object frob0, - Lisp_Object frob1) -{ - return Fsignal (Qerror, list3 (build_translated_string (reason), frob0, - frob1)); -} - -Lisp_Object -maybe_signal_simple_continuable_error_2 (const char *reason, Lisp_Object frob0, - Lisp_Object frob1, Lisp_Object class, - Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return Qnil; - return maybe_signal_continuable_error - (Qerror, list3 (build_translated_string (reason), frob0, - frob1), - class, errb); + return maybe_signal_continuable_error_1 (type, + Fcons (obj, + build_error_data (0, frob)), + class, errb); } @@ -2777,7 +2556,8 @@ } -/* Used in core lisp functions for efficiency */ +/************************ convenience error functions ***********************/ + Lisp_Object signal_void_function_error (Lisp_Object function) { @@ -2801,73 +2581,191 @@ DOESNT_RETURN signal_malformed_list_error (Lisp_Object list) { - signal_error (Qmalformed_list, list1 (list)); + signal_error (Qmalformed_list, 0, list); } DOESNT_RETURN signal_malformed_property_list_error (Lisp_Object list) { - signal_error (Qmalformed_property_list, list1 (list)); + signal_error (Qmalformed_property_list, 0, list); } DOESNT_RETURN signal_circular_list_error (Lisp_Object list) { - signal_error (Qcircular_list, list1 (list)); + signal_error (Qcircular_list, 0, list); } DOESNT_RETURN signal_circular_property_list_error (Lisp_Object list) { - signal_error (Qcircular_property_list, list1 (list)); + signal_error (Qcircular_property_list, 0, list); } DOESNT_RETURN syntax_error (const char *reason, Lisp_Object frob) { - signal_type_error (Qsyntax_error, reason, frob); + signal_error (Qsyntax_error, reason, frob); } DOESNT_RETURN syntax_error_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) { - signal_type_error_2 (Qsyntax_error, reason, frob1, frob2); + signal_error_2 (Qsyntax_error, reason, frob1, frob2); +} + +void +maybe_syntax_error (const char *reason, Lisp_Object frob, + Lisp_Object class, Error_behavior errb) +{ + maybe_signal_error (Qsyntax_error, reason, frob, class, errb); +} + +DOESNT_RETURN +sferror (const char *reason, Lisp_Object frob) +{ + signal_error (Qstructure_formation_error, reason, frob); +} + +DOESNT_RETURN +sferror_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) +{ + signal_error_2 (Qstructure_formation_error, reason, frob1, frob2); +} + +void +maybe_sferror (const char *reason, Lisp_Object frob, + Lisp_Object class, Error_behavior errb) +{ + maybe_signal_error (Qstructure_formation_error, reason, frob, class, errb); } DOESNT_RETURN invalid_argument (const char *reason, Lisp_Object frob) { - signal_type_error (Qinvalid_argument, reason, frob); + signal_error (Qinvalid_argument, reason, frob); } DOESNT_RETURN invalid_argument_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) { - signal_type_error_2 (Qinvalid_argument, reason, frob1, frob2); + signal_error_2 (Qinvalid_argument, reason, frob1, frob2); +} + +void +maybe_invalid_argument (const char *reason, Lisp_Object frob, + Lisp_Object class, Error_behavior errb) +{ + maybe_signal_error (Qinvalid_argument, reason, frob, class, errb); +} + +DOESNT_RETURN +invalid_constant (const char *reason, Lisp_Object frob) +{ + signal_error (Qinvalid_constant, reason, frob); +} + +DOESNT_RETURN +invalid_constant_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) +{ + signal_error_2 (Qinvalid_constant, reason, frob1, frob2); +} + +void +maybe_invalid_constant (const char *reason, Lisp_Object frob, + Lisp_Object class, Error_behavior errb) +{ + maybe_signal_error (Qinvalid_constant, reason, frob, class, errb); } DOESNT_RETURN invalid_operation (const char *reason, Lisp_Object frob) { - signal_type_error (Qinvalid_operation, reason, frob); + signal_error (Qinvalid_operation, reason, frob); } DOESNT_RETURN invalid_operation_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) { - signal_type_error_2 (Qinvalid_operation, reason, frob1, frob2); + signal_error_2 (Qinvalid_operation, reason, frob1, frob2); +} + +void +maybe_invalid_operation (const char *reason, Lisp_Object frob, + Lisp_Object class, Error_behavior errb) +{ + maybe_signal_error (Qinvalid_operation, reason, frob, class, errb); } DOESNT_RETURN invalid_change (const char *reason, Lisp_Object frob) { - signal_type_error (Qinvalid_change, reason, frob); + signal_error (Qinvalid_change, reason, frob); } DOESNT_RETURN invalid_change_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) { - signal_type_error_2 (Qinvalid_change, reason, frob1, frob2); + signal_error_2 (Qinvalid_change, reason, frob1, frob2); +} + +void +maybe_invalid_change (const char *reason, Lisp_Object frob, + Lisp_Object class, Error_behavior errb) +{ + maybe_signal_error (Qinvalid_change, reason, frob, class, errb); +} + +DOESNT_RETURN +invalid_state (const char *reason, Lisp_Object frob) +{ + signal_error (Qinvalid_state, reason, frob); +} + +DOESNT_RETURN +invalid_state_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2) +{ + signal_error_2 (Qinvalid_state, reason, frob1, frob2); +} + +void +maybe_invalid_state (const char *reason, Lisp_Object frob, + Lisp_Object class, Error_behavior errb) +{ + maybe_signal_error (Qinvalid_state, reason, frob, class, errb); +} + +DOESNT_RETURN +wtaerror (const char *reason, Lisp_Object frob) +{ + signal_error (Qwrong_type_argument, reason, frob); +} + +DOESNT_RETURN +stack_overflow (const char *reason, Lisp_Object frob) +{ + signal_error (Qstack_overflow, reason, frob); +} + +DOESNT_RETURN +out_of_memory (const char *reason, Lisp_Object frob) +{ + signal_error (Qout_of_memory, reason, frob); +} + +DOESNT_RETURN +printing_unreadable_object (const char *fmt, ...) +{ + Lisp_Object obj; + va_list args; + + va_start (args, fmt); + obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1, + args); + va_end (args); + + /* Fsignal GC-protects its args */ + signal_error (Qprinting_unreadable_object, 0, obj); } @@ -3177,8 +3075,7 @@ || (CONSP (fun) && EQ (XCAR (fun), Qautoload))) #endif - error ("Autoloading failed to define function %s", - string_data (XSYMBOL (funname)->name)); + invalid_state ("Autoloading failed to define function", funname); UNGCPRO; } @@ -3262,7 +3159,8 @@ if (max_lisp_eval_depth < 100) max_lisp_eval_depth = 100; if (lisp_eval_depth > max_lisp_eval_depth) - error ("Lisp nesting exceeds `max-lisp-eval-depth'"); + stack_overflow ("Lisp nesting exceeds `max-lisp-eval-depth'", + Qunbound); } /* We guaranteed CONSP (form) above */ @@ -3481,7 +3379,8 @@ if (max_lisp_eval_depth < 100) max_lisp_eval_depth = 100; if (lisp_eval_depth > max_lisp_eval_depth) - error ("Lisp nesting exceeds `max-lisp-eval-depth'"); + stack_overflow ("Lisp nesting exceeds `max-lisp-eval-depth'", + Qunbound); } backtrace.pdlcount = specpdl_depth(); @@ -4801,8 +4700,9 @@ !NILP (Vdebug_on_signal)) /* Leave room for some specpdl in the debugger. */ max_specpdl_size = size_needed + 100; - continuable_error - ("Variable binding depth exceeds max-specpdl-size"); + signal_continuable_error + (Qstack_overflow, + "Variable binding depth exceeds max-specpdl-size", Qunbound); } } while (specpdl_size < size_needed) @@ -5324,27 +5224,27 @@ { INIT_LRECORD_IMPLEMENTATION (subr); - defsymbol (&Qinhibit_quit, "inhibit-quit"); - defsymbol (&Qautoload, "autoload"); - defsymbol (&Qdebug_on_error, "debug-on-error"); - defsymbol (&Qstack_trace_on_error, "stack-trace-on-error"); - defsymbol (&Qdebug_on_signal, "debug-on-signal"); - defsymbol (&Qstack_trace_on_signal, "stack-trace-on-signal"); - defsymbol (&Qdebugger, "debugger"); - defsymbol (&Qmacro, "macro"); + DEFSYMBOL (Qinhibit_quit); + DEFSYMBOL (Qautoload); + DEFSYMBOL (Qdebug_on_error); + DEFSYMBOL (Qstack_trace_on_error); + DEFSYMBOL (Qdebug_on_signal); + DEFSYMBOL (Qstack_trace_on_signal); + DEFSYMBOL (Qdebugger); + DEFSYMBOL (Qmacro); defsymbol (&Qand_rest, "&rest"); defsymbol (&Qand_optional, "&optional"); /* Note that the process code also uses Qexit */ - defsymbol (&Qexit, "exit"); - defsymbol (&Qsetq, "setq"); - defsymbol (&Qinteractive, "interactive"); - defsymbol (&Qcommandp, "commandp"); - defsymbol (&Qdefun, "defun"); - defsymbol (&Qprogn, "progn"); - defsymbol (&Qvalues, "values"); - defsymbol (&Qdisplay_warning, "display-warning"); - defsymbol (&Qrun_hooks, "run-hooks"); - defsymbol (&Qif, "if"); + DEFSYMBOL (Qexit); + DEFSYMBOL (Qsetq); + DEFSYMBOL (Qinteractive); + DEFSYMBOL (Qcommandp); + DEFSYMBOL (Qdefun); + DEFSYMBOL (Qprogn); + DEFSYMBOL (Qvalues); + DEFSYMBOL (Qdisplay_warning); + DEFSYMBOL (Qrun_hooks); + DEFSYMBOL (Qif); DEFSUBR (For); DEFSUBR (Fand); diff -r c775bd016b32 -r 183866b06e0b src/event-Xt.c --- a/src/event-Xt.c Thu May 24 06:30:21 2001 +0000 +++ b/src/event-Xt.c Thu May 24 07:51:33 2001 +0000 @@ -3247,9 +3247,9 @@ void syms_of_event_Xt (void) { - defsymbol (&Qkey_mapping, "key-mapping"); - defsymbol (&Qsans_modifiers, "sans-modifiers"); - defsymbol (&Qself_insert_command, "self-insert-command"); + DEFSYMBOL (Qkey_mapping); + DEFSYMBOL (Qsans_modifiers); + DEFSYMBOL (Qself_insert_command); } void diff -r c775bd016b32 -r 183866b06e0b src/event-gtk.c --- a/src/event-gtk.c Thu May 24 06:30:21 2001 +0000 +++ b/src/event-gtk.c Thu May 24 07:51:33 2001 +0000 @@ -1693,8 +1693,8 @@ void syms_of_event_gtk (void) { - defsymbol (&Qkey_mapping, "key-mapping"); - defsymbol (&Qsans_modifiers, "sans-modifiers"); + DEFSYMBOL (Qkey_mapping); + DEFSYMBOL (Qsans_modifiers); } void reinit_vars_of_event_gtk (void) diff -r c775bd016b32 -r 183866b06e0b src/event-msw.c --- a/src/event-msw.c Thu May 24 06:30:21 2001 +0000 +++ b/src/event-msw.c Thu May 24 07:51:33 2001 +0000 @@ -1368,7 +1368,7 @@ { /* We'll deadlock if go waiting */ if (mswindows_pending_timers_count == 0) - error ("Deadlock due to an attempt to call next-event in a wrong context"); + invalid_operation ("Deadlock due to an attempt to call next-event in a wrong context", Qunbound); /* Fetch and dispatch any pending timers */ if (GetMessage (&msg, NULL, WM_TIMER, WM_TIMER) > 0) @@ -3416,7 +3416,7 @@ HANDLE hev = get_process_input_waitable (process); if (!add_waitable_handle (hev)) - error ("Too many active processes"); + invalid_operation ("Too many active processes", Qunbound); #ifdef HAVE_WIN32_PROCESSES { @@ -3428,7 +3428,7 @@ if (!add_waitable_handle (hprocess)) { remove_waitable_handle (hev); - error ("Too many active processes"); + invalid_operation ("Too many active processes", Qunbound); } } } diff -r c775bd016b32 -r 183866b06e0b src/event-stream.c --- a/src/event-stream.c Thu May 24 06:30:21 2001 +0000 +++ b/src/event-stream.c Thu May 24 07:51:33 2001 +0000 @@ -102,6 +102,7 @@ static Fixnum auto_save_interval; Lisp_Object Qundefined_keystroke_sequence; +Lisp_Object Qinvalid_key_binding; Lisp_Object Qcommand_event_p; @@ -414,20 +415,23 @@ switch (op) { case EVENT_STREAM_PROCESS: - error ("Can't start subprocesses in -batch mode"); + invalid_operation ("Can't start subprocesses in -batch mode", + Qunbound); case EVENT_STREAM_TIMEOUT: - error ("Can't add timeouts in -batch mode"); + invalid_operation ("Can't add timeouts in -batch mode", Qunbound); case EVENT_STREAM_CONSOLE: - error ("Can't add consoles in -batch mode"); + invalid_operation ("Can't add consoles in -batch mode", Qunbound); case EVENT_STREAM_READ: - error ("Can't read events in -batch mode"); + invalid_operation ("Can't read events in -batch mode", Qunbound); default: abort (); } } else if (!event_stream) { - error ("event-stream callbacks not initialized (internal error?)"); + invalid_operation + ("event-stream callbacks not initialized (internal error?)", + Qunbound); } } @@ -1332,11 +1336,11 @@ fsecs = XINT (secs); #endif if (fsecs < 0) - signal_simple_error ("timeout is negative", secs); + invalid_argument ("timeout is negative", secs); if (!allow_0 && fsecs == 0) - signal_simple_error ("timeout is non-positive", secs); + invalid_argument ("timeout is non-positive", secs); if (fsecs >= (((unsigned int) 0xFFFFFFFF) / 1000)) - signal_simple_error + invalid_argument ("timeout would exceed 32 bits when represented in milliseconds", secs); return (unsigned long) (1000 * fsecs); @@ -2081,7 +2085,8 @@ * so we signal an error here. */ if (in_menu_callback) - error ("Attempt to call next-event inside menu callback"); + invalid_operation ("Attempt to call next-event inside menu callback", + Qunbound); #endif /* LWLIB_MENUBARS_LUCID */ if (NILP (event)) @@ -2119,7 +2124,7 @@ if (!CONSP (Vunread_command_events)) { Vunread_command_events = Qnil; - signal_error (Qwrong_type_argument, + signal_error_1 (Qwrong_type_argument, list3 (Qconsp, Vunread_command_events, Qunread_command_events)); } @@ -2128,7 +2133,7 @@ Lisp_Object e = XCAR (Vunread_command_events); Vunread_command_events = XCDR (Vunread_command_events); if (!EVENTP (e) || !command_event_p (e)) - signal_error (Qwrong_type_argument, + signal_error_1 (Qwrong_type_argument, list3 (Qcommand_event_p, e, Qunread_command_events)); redisplay (); if (!EQ (e, event)) @@ -2145,7 +2150,7 @@ if (!EVENTP (e) || !command_event_p (e)) { - signal_error (Qwrong_type_argument, + signal_error_1 (Qwrong_type_argument, list3 (Qeventp, e, Qunread_command_event)); } if (!EQ (e, event)) @@ -2235,7 +2240,7 @@ if (XEVENT_TYPE (Vlast_input_event) == dead_event) { Vlast_input_event = Fmake_event (Qnil, Qnil); - error ("Someone deallocated last-input-event!"); + invalid_state ("Someone deallocated last-input-event!", Qunbound); } if (! EQ (event, Vlast_input_event)) Fcopy_event (event, Vlast_input_event); @@ -3173,10 +3178,11 @@ return result; } - signal_simple_error ((munge == MUNGE_ME_FUNCTION_KEY ? - "Invalid binding in function-key-map" : - "Invalid binding in key-translation-map"), - result); + signal_error (Qinvalid_key_binding, + (munge == MUNGE_ME_FUNCTION_KEY ? + "Invalid binding in function-key-map" : + "Invalid binding in key-translation-map"), + result); } return Qnil; @@ -3438,7 +3444,7 @@ CHECK_INT (size); if (XINT (size) <= 0) - error ("Recent keys ring size must be positive"); + invalid_argument ("Recent keys ring size must be positive", size); if (XINT (size) == recent_keys_ring_size) return size; @@ -3873,7 +3879,7 @@ if (XEVENT (Vlast_command_event)->event_type == dead_event) { Vlast_command_event = Fmake_event (Qnil, Qnil); - error ("Someone deallocated the last-command-event!"); + invalid_state ("Someone deallocated the last-command-event!", Qunbound); } if (! EQ (event, Vlast_command_event)) @@ -4445,7 +4451,7 @@ O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, CREAT_MODE); if (fd < 0) - error ("Unable to create dribble file"); + report_file_error ("Unable to create dribble file", filename); Vdribble_file = make_filedesc_output_stream (fd, 0, 0, LSTR_CLOSING); #ifdef MULE Vdribble_file = @@ -4484,10 +4490,11 @@ INIT_LRECORD_IMPLEMENTATION (command_builder); INIT_LRECORD_IMPLEMENTATION (timeout); - defsymbol (&Qdisabled, "disabled"); - defsymbol (&Qcommand_event_p, "command-event-p"); - - DEFERROR_STANDARD (Qundefined_keystroke_sequence, Qinvalid_argument); + DEFSYMBOL (Qdisabled); + DEFSYMBOL (Qcommand_event_p); + + DEFERROR_STANDARD (Qundefined_keystroke_sequence, Qsyntax_error); + DEFERROR_STANDARD (Qinvalid_key_binding, Qinvalid_state); DEFSUBR (Frecent_keys); DEFSUBR (Frecent_keys_ring_size); @@ -4512,20 +4519,18 @@ DEFSUBR (Fopen_dribble_file); DEFSUBR (Fcurrent_event_timestamp); - defsymbol (&Qpre_command_hook, "pre-command-hook"); - defsymbol (&Qpost_command_hook, "post-command-hook"); - defsymbol (&Qunread_command_events, "unread-command-events"); - defsymbol (&Qunread_command_event, "unread-command-event"); - defsymbol (&Qpre_idle_hook, "pre-idle-hook"); - defsymbol (&Qhandle_pre_motion_command, "handle-pre-motion-command"); - defsymbol (&Qhandle_post_motion_command, "handle-post-motion-command"); - defsymbol (&Qretry_undefined_key_binding_unshifted, - "retry-undefined-key-binding-unshifted"); - defsymbol (&Qauto_show_make_point_visible, - "auto-show-make-point-visible"); - - defsymbol (&Qself_insert_defer_undo, "self-insert-defer-undo"); - defsymbol (&Qcancel_mode_internal, "cancel-mode-internal"); + DEFSYMBOL (Qpre_command_hook); + DEFSYMBOL (Qpost_command_hook); + DEFSYMBOL (Qunread_command_events); + DEFSYMBOL (Qunread_command_event); + DEFSYMBOL (Qpre_idle_hook); + DEFSYMBOL (Qhandle_pre_motion_command); + DEFSYMBOL (Qhandle_post_motion_command); + DEFSYMBOL (Qretry_undefined_key_binding_unshifted); + DEFSYMBOL (Qauto_show_make_point_visible); + + DEFSYMBOL (Qself_insert_defer_undo); + DEFSYMBOL (Qcancel_mode_internal); } void diff -r c775bd016b32 -r 183866b06e0b src/events.c --- a/src/events.c Thu May 24 06:30:21 2001 +0000 +++ b/src/events.c Thu May 24 07:51:33 2001 +0000 @@ -143,7 +143,7 @@ print_event (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { if (print_readably) - error ("Printing unreadable object #"); + printing_unreadable_object ("#"); switch (XEVENT (obj)->event_type) { @@ -458,7 +458,7 @@ (e.g. CHANNEL), which we don't want in empty events. */ e->event_type = empty_event; if (!NILP (plist)) - syntax_error ("Cannot set properties of empty event", plist); + invalid_operation ("Cannot set properties of empty event", plist); UNGCPRO; return event; } @@ -481,7 +481,7 @@ else { /* Not allowed: Qprocess, Qtimeout, Qmagic, Qeval, Qmagic_eval. */ - invalid_argument ("Invalid event type", type); + invalid_constant ("Invalid event type", type); } EVENT_CHANNEL (e) = Qnil; @@ -490,7 +490,7 @@ Fcanonicalize_plist (plist, Qnil); #define WRONG_EVENT_TYPE_FOR_PROPERTY(event_type, prop) \ - syntax_error_2 ("Invalid property for event type", prop, event_type) + invalid_argument_2 ("Invalid property for event type", prop, event_type) { EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, plist) @@ -515,7 +515,7 @@ { case key_press_event: if (!SYMBOLP (value) && !CHARP (value)) - syntax_error ("Invalid event key", value); + invalid_argument ("Invalid event key", value); e->event.key.keysym = value; break; default: @@ -561,7 +561,7 @@ else if (EQ (sym, Qbutton4)) modifiers |= XEMACS_MOD_BUTTON4; else if (EQ (sym, Qbutton5)) modifiers |= XEMACS_MOD_BUTTON5; else - syntax_error ("Invalid key modifier", sym); + invalid_constant ("Invalid key modifier", sym); } switch (e->event_type) @@ -649,7 +649,7 @@ } } else - syntax_error_2 ("Invalid property", keyword, value); + invalid_constant_2 ("Invalid property", keyword, value); } } @@ -694,24 +694,24 @@ { case key_press_event: if (UNBOUNDP (e->event.key.keysym)) - syntax_error ("A key must be specified to make a keypress event", + sferror ("A key must be specified to make a keypress event", plist); break; case button_press_event: if (!e->event.button.button) - syntax_error + sferror ("A button must be specified to make a button-press event", plist); break; case button_release_event: if (!e->event.button.button) - syntax_error + sferror ("A button must be specified to make a button-release event", plist); break; case misc_user_event: if (NILP (e->event.misc.function)) - syntax_error ("A function must be specified to make a misc-user event", + sferror ("A function must be specified to make a misc-user event", plist); break; default: @@ -735,7 +735,7 @@ CHECK_EVENT (event); if (XEVENT_TYPE (event) == dead_event) - error ("this event is already deallocated!"); + invalid_argument ("this event is already deallocated!", Qunbound); assert (XEVENT_TYPE (event) <= last_event_type); @@ -787,8 +787,9 @@ { CHECK_LIVE_EVENT (event2); if (EQ (event1, event2)) - return signal_simple_continuable_error_2 - ("copy-event called with `eq' events", event1, event2); + return signal_continuable_error_2 + (Qinvalid_argument, + "copy-event called with `eq' events", event1, event2); } assert (XEVENT_TYPE (event1) <= last_event_type); @@ -988,7 +989,7 @@ Lisp_Object k = Qnil; int m = 0; if (event->event_type == dead_event) - error ("character-to-event called with a deallocated event!"); + invalid_argument ("character-to-event called with a deallocated event!", Qunbound); #ifndef MULE c &= 255; @@ -1415,10 +1416,7 @@ { QUIT; if (EQ (ev, event)) - signal_error (Qerror, - list3 (build_string ("Cyclic event-next"), - event, - next_event)); + invalid_operation_2 ("Cyclic event-next", event, next_event); } XSET_EVENT_NEXT (event, next_event); return next_event; @@ -2323,17 +2321,17 @@ DEFSUBR (Fevent_function); DEFSUBR (Fevent_object); - defsymbol (&Qeventp, "eventp"); - defsymbol (&Qevent_live_p, "event-live-p"); - defsymbol (&Qkey_press_event_p, "key-press-event-p"); - defsymbol (&Qbutton_event_p, "button-event-p"); - defsymbol (&Qmouse_event_p, "mouse-event-p"); - defsymbol (&Qprocess_event_p, "process-event-p"); - defsymbol (&Qkey_press, "key-press"); - defsymbol (&Qbutton_press, "button-press"); - defsymbol (&Qbutton_release, "button-release"); - defsymbol (&Qmisc_user, "misc-user"); - defsymbol (&Qascii_character, "ascii-character"); + DEFSYMBOL (Qeventp); + DEFSYMBOL (Qevent_live_p); + DEFSYMBOL (Qkey_press_event_p); + DEFSYMBOL (Qbutton_event_p); + DEFSYMBOL (Qmouse_event_p); + DEFSYMBOL (Qprocess_event_p); + DEFSYMBOL (Qkey_press); + DEFSYMBOL (Qbutton_press); + DEFSYMBOL (Qbutton_release); + DEFSYMBOL (Qmisc_user); + DEFSYMBOL (Qascii_character); defsymbol (&QKbackspace, "backspace"); defsymbol (&QKtab, "tab"); diff -r c775bd016b32 -r 183866b06e0b src/extents.c --- a/src/extents.c Thu May 24 06:30:21 2001 +0000 +++ b/src/extents.c Thu May 24 07:51:33 2001 +0000 @@ -3026,9 +3026,9 @@ if (print_readably) { if (!EXTENT_LIVE_P (XEXTENT (obj))) - error ("printing unreadable object #"); + printing_unreadable_object ("#"); else - error ("printing unreadable object #", + printing_unreadable_object ("#", (long) XEXTENT (obj)); } @@ -3049,7 +3049,7 @@ else { if (print_readably) - error ("printing unreadable object #"); + printing_unreadable_object ("#"); write_c_string ("#", printcharfun); @@ -3536,7 +3536,7 @@ return Qnil; for (rest = parent; !NILP (rest); rest = extent_parent (XEXTENT (rest))) if (EQ (rest, extent)) - signal_type_error (Qinvalid_change, + signal_error (Qinvalid_change, "Circular parent chain would result", extent); if (NILP (parent)) @@ -3877,7 +3877,7 @@ EQ (sym, Qall_extents_open_closed)) { if (all_extents_specified) - error ("Only one `all-extents-*' flag may be specified"); + invalid_argument ("Only one `all-extents-*' flag may be specified", Qunbound); all_extents_specified = 1; } if (EQ (sym, Qstart_in_region) || EQ (sym, Qend_in_region) || @@ -3885,7 +3885,7 @@ EQ (sym, Qstart_or_end_in_region)) { if (in_region_specified) - error ("Only one `*-in-region' flag may be specified"); + invalid_argument ("Only one `*-in-region' flag may be specified", Qunbound); in_region_specified = 1; } @@ -3902,7 +3902,7 @@ EQ (sym, Qstart_and_end_in_region) ? ME_START_AND_END_IN_REGION : EQ (sym, Qstart_or_end_in_region) ? ME_START_OR_END_IN_REGION : EQ (sym, Qnegate_in_region) ? ME_NEGATE_IN_REGION : - (invalid_argument ("Invalid `map-extents' flag", sym), 0); + (invalid_constant ("Invalid `map-extents' flag", sym), 0); flags = XCDR (flags); } @@ -4266,7 +4266,7 @@ if (EQ (at_flag, Qbefore)) return EXTENT_AT_BEFORE; if (EQ (at_flag, Qat)) return EXTENT_AT_AT; - invalid_argument ("Invalid AT-FLAG in `extent-at'", at_flag); + invalid_constant ("Invalid AT-FLAG in `extent-at'", at_flag); return EXTENT_AT_AFTER; /* unreached */ } @@ -5072,7 +5072,7 @@ if (EQ (layout_obj, Qwhitespace)) return GL_WHITESPACE; if (EQ (layout_obj, Qtext)) return GL_TEXT; - invalid_argument ("Unknown glyph layout type", layout_obj); + invalid_constant ("Unknown glyph layout type", layout_obj); return GL_TEXT; /* unreached */ } @@ -5363,13 +5363,13 @@ else if (EQ (property, Qdetached)) { if (NILP (value)) - error ("can only set `detached' to t"); + invalid_operation ("can only set `detached' to t", Qunbound); Fdetach_extent (extent); } else if (EQ (property, Qdestroyed)) { if (NILP (value)) - error ("can only set `destroyed' to t"); + invalid_operation ("can only set `destroyed' to t", Qunbound); Fdelete_extent (extent); } else if (EQ (property, Qpriority)) @@ -6578,7 +6578,7 @@ prop = Fextent_property (extent, Qtext_prop, Qnil); if (NILP (prop)) - signal_type_error (Qinternal_error, + signal_error (Qinternal_error, "Internal error: no text-prop", extent); val = Fextent_property (extent, prop, Qnil); #if 0 @@ -6587,7 +6587,7 @@ ** with a value of Qnil. This is bad bad bad. */ if (NILP (val)) - signal_type_error_2 (Qinternal_error, + signal_error_2 (Qinternal_error, "Internal error: no text-prop", extent, prop); #endif @@ -6757,51 +6757,50 @@ INIT_LRECORD_IMPLEMENTATION (extent_info); INIT_LRECORD_IMPLEMENTATION (extent_auxiliary); - defsymbol (&Qextentp, "extentp"); - defsymbol (&Qextent_live_p, "extent-live-p"); - - defsymbol (&Qall_extents_closed, "all-extents-closed"); - defsymbol (&Qall_extents_open, "all-extents-open"); - defsymbol (&Qall_extents_closed_open, "all-extents-closed-open"); - defsymbol (&Qall_extents_open_closed, "all-extents-open-closed"); - defsymbol (&Qstart_in_region, "start-in-region"); - defsymbol (&Qend_in_region, "end-in-region"); - defsymbol (&Qstart_and_end_in_region, "start-and-end-in-region"); - defsymbol (&Qstart_or_end_in_region, "start-or-end-in-region"); - defsymbol (&Qnegate_in_region, "negate-in-region"); - - defsymbol (&Qdetached, "detached"); - defsymbol (&Qdestroyed, "destroyed"); - defsymbol (&Qbegin_glyph, "begin-glyph"); - defsymbol (&Qend_glyph, "end-glyph"); - defsymbol (&Qstart_open, "start-open"); - defsymbol (&Qend_open, "end-open"); - defsymbol (&Qstart_closed, "start-closed"); - defsymbol (&Qend_closed, "end-closed"); - defsymbol (&Qread_only, "read-only"); - /* defsymbol (&Qhighlight, "highlight"); in faces.c */ - defsymbol (&Qunique, "unique"); - defsymbol (&Qduplicable, "duplicable"); - defsymbol (&Qdetachable, "detachable"); - defsymbol (&Qpriority, "priority"); - defsymbol (&Qmouse_face, "mouse-face"); - defsymbol (&Qinitial_redisplay_function,"initial-redisplay-function"); - - - defsymbol (&Qglyph_layout, "glyph-layout"); /* backwards compatibility */ - defsymbol (&Qbegin_glyph_layout, "begin-glyph-layout"); - defsymbol (&Qend_glyph_layout, "end-glyph-layout"); - defsymbol (&Qoutside_margin, "outside-margin"); - defsymbol (&Qinside_margin, "inside-margin"); - defsymbol (&Qwhitespace, "whitespace"); + DEFSYMBOL (Qextentp); + DEFSYMBOL (Qextent_live_p); + + DEFSYMBOL (Qall_extents_closed); + DEFSYMBOL (Qall_extents_open); + DEFSYMBOL (Qall_extents_closed_open); + DEFSYMBOL (Qall_extents_open_closed); + DEFSYMBOL (Qstart_in_region); + DEFSYMBOL (Qend_in_region); + DEFSYMBOL (Qstart_and_end_in_region); + DEFSYMBOL (Qstart_or_end_in_region); + DEFSYMBOL (Qnegate_in_region); + + DEFSYMBOL (Qdetached); + DEFSYMBOL (Qdestroyed); + DEFSYMBOL (Qbegin_glyph); + DEFSYMBOL (Qend_glyph); + DEFSYMBOL (Qstart_open); + DEFSYMBOL (Qend_open); + DEFSYMBOL (Qstart_closed); + DEFSYMBOL (Qend_closed); + DEFSYMBOL (Qread_only); + /* DEFSYMBOL (Qhighlight); in faces.c */ + DEFSYMBOL (Qunique); + DEFSYMBOL (Qduplicable); + DEFSYMBOL (Qdetachable); + DEFSYMBOL (Qpriority); + DEFSYMBOL (Qmouse_face); + DEFSYMBOL (Qinitial_redisplay_function); + + + DEFSYMBOL (Qglyph_layout); /* backwards compatibility */ + DEFSYMBOL (Qbegin_glyph_layout); + DEFSYMBOL (Qend_glyph_layout); + DEFSYMBOL (Qoutside_margin); + DEFSYMBOL (Qinside_margin); + DEFSYMBOL (Qwhitespace); /* Qtext defined in general.c */ - defsymbol (&Qpaste_function, "paste-function"); - defsymbol (&Qcopy_function, "copy-function"); - - defsymbol (&Qtext_prop, "text-prop"); - defsymbol (&Qtext_prop_extent_paste_function, - "text-prop-extent-paste-function"); + DEFSYMBOL (Qpaste_function); + DEFSYMBOL (Qcopy_function); + + DEFSYMBOL (Qtext_prop); + DEFSYMBOL (Qtext_prop_extent_paste_function); DEFSUBR (Fextentp); DEFSUBR (Fextent_live_p); diff -r c775bd016b32 -r 183866b06e0b src/faces.c --- a/src/faces.c Thu May 24 06:30:21 2001 +0000 +++ b/src/faces.c Thu May 24 07:51:33 2001 +0000 @@ -327,13 +327,13 @@ if (!name_seen) { - maybe_error (Qface, errb, "No face name given"); + maybe_sferror ("No face name given", Qunbound, Qface, errb); return 0; } if (NILP (Ffind_face (valw))) { - maybe_signal_simple_error ("No such face", valw, Qface, errb); + maybe_invalid_argument ("No such face", valw, Qface, errb); return 0; } @@ -636,7 +636,7 @@ Lisp_Object face = Ffind_face (name); if (NILP (face)) - signal_simple_error ("No such face", name); + invalid_argument ("No such face", name); return face; } @@ -1828,10 +1828,10 @@ INIT_LRECORD_IMPLEMENTATION (face); /* Qdefault, Qwidget, Qleft_margin, Qright_margin defined in general.c */ - defsymbol (&Qmodeline, "modeline"); - defsymbol (&Qgui_element, "gui-element"); - defsymbol (&Qtext_cursor, "text-cursor"); - defsymbol (&Qvertical_divider, "vertical-divider"); + DEFSYMBOL (Qmodeline); + DEFSYMBOL (Qgui_element); + DEFSYMBOL (Qtext_cursor); + DEFSYMBOL (Qvertical_divider); DEFSUBR (Ffacep); DEFSUBR (Ffind_face); @@ -1842,22 +1842,22 @@ DEFSUBR (Fmake_face); DEFSUBR (Fcopy_face); - defsymbol (&Qfacep, "facep"); - defsymbol (&Qforeground, "foreground"); - defsymbol (&Qbackground, "background"); + DEFSYMBOL (Qfacep); + DEFSYMBOL (Qforeground); + DEFSYMBOL (Qbackground); /* Qfont defined in general.c */ - defsymbol (&Qdisplay_table, "display-table"); - defsymbol (&Qbackground_pixmap, "background-pixmap"); - defsymbol (&Qunderline, "underline"); - defsymbol (&Qstrikethru, "strikethru"); + DEFSYMBOL (Qdisplay_table); + DEFSYMBOL (Qbackground_pixmap); + DEFSYMBOL (Qunderline); + DEFSYMBOL (Qstrikethru); /* Qhighlight, Qreverse defined in general.c */ - defsymbol (&Qdim, "dim"); - defsymbol (&Qblinking, "blinking"); + DEFSYMBOL (Qdim); + DEFSYMBOL (Qblinking); - defsymbol (&Qinit_face_from_resources, "init-face-from-resources"); - defsymbol (&Qinit_global_faces, "init-global-faces"); - defsymbol (&Qinit_device_faces, "init-device-faces"); - defsymbol (&Qinit_frame_faces, "init-frame-faces"); + DEFSYMBOL (Qinit_face_from_resources); + DEFSYMBOL (Qinit_global_faces); + DEFSYMBOL (Qinit_device_faces); + DEFSYMBOL (Qinit_frame_faces); } void diff -r c775bd016b32 -r 183866b06e0b src/file-coding.c --- a/src/file-coding.c Thu May 24 06:30:21 2001 +0000 +++ b/src/file-coding.c Thu May 24 07:51:33 2001 +0000 @@ -37,7 +37,7 @@ #endif #include "file-coding.h" -Lisp_Object Qcoding_system_error; +Lisp_Object Qtext_conversion_error; Lisp_Object Vkeyboard_coding_system; Lisp_Object Vterminal_coding_system; @@ -376,8 +376,7 @@ { Lisp_Coding_System *c = XCODING_SYSTEM (obj); if (print_readably) - error ("printing unreadable object #", - c->header.uid); + printing_unreadable_object ("#", c->header.uid); write_c_string ("#name, printcharfun, 1); @@ -424,7 +423,7 @@ if (EQ (symbol, Qcrlf)) return EOL_CRLF; if (EQ (symbol, Qcr)) return EOL_CR; - signal_simple_error ("Unrecognized eol type", symbol); + invalid_constant ("Unrecognized eol type", symbol); return EOL_AUTODETECT; /* not reached */ } @@ -547,7 +546,7 @@ Lisp_Object coding_system = Ffind_coding_system (name); if (NILP (coding_system)) - signal_simple_error ("No such coding system", name); + invalid_argument ("No such coding system", name); return coding_system; } @@ -649,11 +648,11 @@ struct charset_conversion_spec spec; if (!CONSP (car) || !CONSP (XCDR (car)) || !NILP (XCDR (XCDR (car)))) - signal_simple_error ("Invalid charset conversion spec", car); + invalid_argument ("Invalid charset conversion spec", car); from = Fget_charset (XCAR (car)); to = Fget_charset (XCAR (XCDR (car))); if (XCHARSET_TYPE (from) != XCHARSET_TYPE (to)) - signal_simple_error_2 + invalid_operation_2 ("Attempted conversion between different charset types", from, to); spec.from_charset = from; @@ -880,7 +879,7 @@ else if (EQ (type, Qinternal)) { ty = CODESYS_INTERNAL; } #endif else - signal_simple_error ("Invalid coding system type", type); + invalid_constant ("Invalid coding system type", type); CHECK_SYMBOL (name); @@ -958,7 +957,7 @@ value); } else - signal_simple_error ("Unrecognized property", key); + invalid_constant ("Unrecognized property", key); } else if (EQ (type, Qccl)) { @@ -972,7 +971,7 @@ else if (EQ (key, Qencode)) suffix = "-ccl-encode"; else - signal_simple_error ("Unrecognized property", key); + invalid_constant ("Unrecognized property", key); /* If value is vector, register it as a ccl program associated with an newly created symbol for @@ -991,7 +990,7 @@ } /* check if the given ccl programs are valid. */ if (setup_ccl_program (&test_ccl, sym) < 0) - signal_simple_error ("Invalid CCL program", value); + invalid_argument ("Invalid CCL program", value); if (EQ (key, Qdecode)) CODING_SYSTEM_CCL_DECODE (codesys) = sym; @@ -1001,7 +1000,7 @@ } #endif /* MULE */ else - signal_simple_error ("Unrecognized property", key); + invalid_constant ("Unrecognized property", key); } } @@ -1074,7 +1073,7 @@ if (SYMBOLP (aliasee)) return aliasee; else - signal_simple_error ("Symbol is not a coding system alias", alias); + invalid_argument ("Symbol is not a coding system alias", alias); return Qnil; /* To keep the compiler happy */ } @@ -1126,7 +1125,7 @@ CHECK_SYMBOL (alias); if (!NILP (Fcoding_system_canonical_name_p (alias))) - signal_simple_error + invalid_change ("Symbol is the canonical name of a coding system and cannot be redefined", alias); @@ -1172,7 +1171,7 @@ /* Check for coding system alias loops */ if (EQ (alias, aliasee)) - alias_loop: signal_simple_error_2 + alias_loop: invalid_operation_2 ("Attempt to create a coding system alias loop", alias, aliasee); for (probe = aliasee; @@ -1311,14 +1310,14 @@ #ifdef MULE case CODESYS_PROP_ISO2022: if (type != CODESYS_ISO2022) - signal_simple_error + invalid_argument ("Property only valid in ISO2022 coding systems", prop); break; case CODESYS_PROP_CCL: if (type != CODESYS_CCL) - signal_simple_error + invalid_argument ("Property only valid in CCL coding systems", prop); break; @@ -1329,7 +1328,7 @@ } if (!ok) - signal_simple_error ("Unrecognized property", prop); + invalid_constant ("Unrecognized property", prop); if (EQ (prop, Qname)) return XCODING_SYSTEM_NAME (coding_system); @@ -1425,7 +1424,7 @@ if (EQ (coding_category_symbol[i], symbol)) return i; - signal_simple_error ("Unrecognized coding category", symbol); + invalid_constant ("Unrecognized coding category", symbol); return 0; /* not reached */ } @@ -1467,7 +1466,7 @@ int cat = decode_coding_category (XCAR (rest)); if (category_to_priority[cat] >= 0) - signal_simple_error ("Duplicate coding category in list", XCAR (rest)); + sferror ("Duplicate coding category in list", XCAR (rest)); category_to_priority[cat] = i++; } @@ -5590,7 +5589,7 @@ { INIT_LRECORD_IMPLEMENTATION (coding_system); - DEFERROR_STANDARD (Qcoding_system_error, Qio_error); + DEFERROR_STANDARD (Qtext_conversion_error, Qconversion_error); DEFSUBR (Fcoding_system_p); DEFSUBR (Ffind_coding_system); @@ -5628,50 +5627,50 @@ DEFSUBR (Fset_char_ucs); DEFSUBR (Fchar_ucs); #endif /* MULE */ - defsymbol (&Qcoding_systemp, "coding-system-p"); - defsymbol (&Qno_conversion, "no-conversion"); - defsymbol (&Qraw_text, "raw-text"); + DEFSYMBOL_MULTIWORD_PREDICATE (Qcoding_systemp); + DEFSYMBOL (Qno_conversion); + DEFSYMBOL (Qraw_text); #ifdef MULE - defsymbol (&Qbig5, "big5"); - defsymbol (&Qshift_jis, "shift-jis"); + DEFSYMBOL (Qbig5); + DEFSYMBOL (Qshift_jis); defsymbol (&Qucs4, "ucs-4"); defsymbol (&Qutf8, "utf-8"); - defsymbol (&Qccl, "ccl"); - defsymbol (&Qiso2022, "iso2022"); + DEFSYMBOL (Qccl); + DEFSYMBOL (Qiso2022); #endif /* MULE */ - defsymbol (&Qmnemonic, "mnemonic"); - defsymbol (&Qeol_type, "eol-type"); - defsymbol (&Qpost_read_conversion, "post-read-conversion"); - defsymbol (&Qpre_write_conversion, "pre-write-conversion"); - - defsymbol (&Qcr, "cr"); - defsymbol (&Qlf, "lf"); - defsymbol (&Qcrlf, "crlf"); - defsymbol (&Qeol_cr, "eol-cr"); - defsymbol (&Qeol_lf, "eol-lf"); - defsymbol (&Qeol_crlf, "eol-crlf"); + DEFSYMBOL (Qmnemonic); + DEFSYMBOL (Qeol_type); + DEFSYMBOL (Qpost_read_conversion); + DEFSYMBOL (Qpre_write_conversion); + + DEFSYMBOL (Qcr); + DEFSYMBOL (Qlf); + DEFSYMBOL (Qcrlf); + DEFSYMBOL (Qeol_cr); + DEFSYMBOL (Qeol_lf); + DEFSYMBOL (Qeol_crlf); #ifdef MULE - defsymbol (&Qcharset_g0, "charset-g0"); - defsymbol (&Qcharset_g1, "charset-g1"); - defsymbol (&Qcharset_g2, "charset-g2"); - defsymbol (&Qcharset_g3, "charset-g3"); - defsymbol (&Qforce_g0_on_output, "force-g0-on-output"); - defsymbol (&Qforce_g1_on_output, "force-g1-on-output"); - defsymbol (&Qforce_g2_on_output, "force-g2-on-output"); - defsymbol (&Qforce_g3_on_output, "force-g3-on-output"); - defsymbol (&Qno_iso6429, "no-iso6429"); - defsymbol (&Qinput_charset_conversion, "input-charset-conversion"); - defsymbol (&Qoutput_charset_conversion, "output-charset-conversion"); - - defsymbol (&Qshort, "short"); - defsymbol (&Qno_ascii_eol, "no-ascii-eol"); - defsymbol (&Qno_ascii_cntl, "no-ascii-cntl"); - defsymbol (&Qseven, "seven"); - defsymbol (&Qlock_shift, "lock-shift"); - defsymbol (&Qescape_quoted, "escape-quoted"); + DEFSYMBOL (Qcharset_g0); + DEFSYMBOL (Qcharset_g1); + DEFSYMBOL (Qcharset_g2); + DEFSYMBOL (Qcharset_g3); + DEFSYMBOL (Qforce_g0_on_output); + DEFSYMBOL (Qforce_g1_on_output); + DEFSYMBOL (Qforce_g2_on_output); + DEFSYMBOL (Qforce_g3_on_output); + DEFSYMBOL (Qno_iso6429); + DEFSYMBOL (Qinput_charset_conversion); + DEFSYMBOL (Qoutput_charset_conversion); + + DEFSYMBOL (Qshort); + DEFSYMBOL (Qno_ascii_eol); + DEFSYMBOL (Qno_ascii_cntl); + DEFSYMBOL (Qseven); + DEFSYMBOL (Qlock_shift); + DEFSYMBOL (Qescape_quoted); #endif /* MULE */ - defsymbol (&Qencode, "encode"); - defsymbol (&Qdecode, "decode"); + DEFSYMBOL (Qencode); + DEFSYMBOL (Qdecode); #ifdef MULE defsymbol (&coding_category_symbol[CODING_CATEGORY_SHIFT_JIS], diff -r c775bd016b32 -r 183866b06e0b src/fileio.c --- a/src/fileio.c Thu May 24 06:30:21 2001 +0000 +++ b/src/fileio.c Thu May 24 07:51:33 2001 +0000 @@ -1,6 +1,6 @@ /* File IO for XEmacs. Copyright (C) 1985-1988, 1992-1995 Free Software Foundation, Inc. - Copyright (C) 1996 Ben Wing. + Copyright (C) 1996, 2001 Ben Wing. This file is part of XEmacs. @@ -114,7 +114,7 @@ static Lisp_Object Vinhibit_file_name_handlers; static Lisp_Object Vinhibit_file_name_operation; -Lisp_Object Qfile_error, Qfile_already_exists; +Lisp_Object Qfile_already_exists; Lisp_Object Qauto_save_hook; Lisp_Object Qauto_save_error; @@ -126,104 +126,36 @@ EXFUN (Frunning_temacs_p, 0); +/* DATA can be anything acceptable to signal_error (). + */ + +DOESNT_RETURN +report_file_type_error (Lisp_Object errtype, Lisp_Object oserrmess, + const char *string, Lisp_Object data) +{ + struct gcpro gcpro1; + Lisp_Object errdata = build_error_data (NULL, data); + + GCPRO1 (errdata); + errdata = Fcons (build_translated_string (string), + Fcons (oserrmess, errdata)); + signal_error_1 (errtype, errdata); + UNGCPRO; /* not reached */ +} + +DOESNT_RETURN +report_error_with_errno (Lisp_Object errtype, + const char *string, Lisp_Object data) +{ + report_file_type_error (errtype, lisp_strerror (errno), string, data); +} + /* signal a file error when errno contains a meaningful value. */ DOESNT_RETURN report_file_error (const char *string, Lisp_Object data) { - /* #### dmoore - This uses current_buffer, better make sure no one - has GC'd the current buffer. File handlers are giving me a headache - maybe I'll just always protect current_buffer around all of those - calls. */ - - signal_error (Qfile_error, - Fcons (build_translated_string (string), - Fcons (lisp_strerror (errno), data))); -} - -void -maybe_report_file_error (const char *string, Lisp_Object data, - Lisp_Object class, Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - - maybe_signal_error (Qfile_error, - Fcons (build_translated_string (string), - Fcons (lisp_strerror (errno), data)), - class, errb); -} - -/* signal a file error when errno does not contain a meaningful value. */ - -DOESNT_RETURN -signal_file_error (const char *string, Lisp_Object data) -{ - signal_error (Qfile_error, - list2 (build_translated_string (string), data)); -} - -void -maybe_signal_file_error (const char *string, Lisp_Object data, - Lisp_Object class, Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - maybe_signal_error (Qfile_error, - list2 (build_translated_string (string), data), - class, errb); -} - -DOESNT_RETURN -signal_double_file_error (const char *string1, const char *string2, - Lisp_Object data) -{ - signal_error (Qfile_error, - list3 (build_translated_string (string1), - build_translated_string (string2), - data)); -} - -void -maybe_signal_double_file_error (const char *string1, const char *string2, - Lisp_Object data, Lisp_Object class, - Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - maybe_signal_error (Qfile_error, - list3 (build_translated_string (string1), - build_translated_string (string2), - data), - class, errb); -} - -DOESNT_RETURN -signal_double_file_error_2 (const char *string1, const char *string2, - Lisp_Object data1, Lisp_Object data2) -{ - signal_error (Qfile_error, - list4 (build_translated_string (string1), - build_translated_string (string2), - data1, data2)); -} - -void -maybe_signal_double_file_error_2 (const char *string1, const char *string2, - Lisp_Object data1, Lisp_Object data2, - Lisp_Object class, Error_behavior errb) -{ - /* Optimization: */ - if (ERRB_EQ (errb, ERROR_ME_NOT)) - return; - maybe_signal_error (Qfile_error, - list4 (build_translated_string (string1), - build_translated_string (string2), - data1, data2), - class, errb); + report_error_with_errno (Qfile_error, string, data); } @@ -726,7 +658,7 @@ error, or to ignore the error, which will likely result in inflooping. */ report_file_error ("Cannot create temporary name for prefix", - list1 (prefix)); + prefix); return Qnil; /* not reached */ } } @@ -1384,7 +1316,7 @@ errno = ENAMETOOLONG; goto lose; lose: - report_file_error ("Finding truename", list1 (expanded_name)); + report_file_error ("Finding truename", expanded_name); } RETURN_UNGCPRO (Qnil); } @@ -1747,7 +1679,7 @@ ifd = interruptible_open ((char *) XSTRING_DATA (filename), O_RDONLY | OPEN_BINARY, 0); if (ifd < 0) - report_file_error ("Opening input file", list1 (filename)); + report_file_error ("Opening input file", filename); record_unwind_protect (close_file_unwind, make_int (ifd)); @@ -1761,7 +1693,7 @@ { errno = 0; report_file_error ("Input and output files are the same", - list2 (filename, newname)); + list3 (Qunbound, filename, newname)); } #endif @@ -1779,7 +1711,7 @@ /* Get a better looking error message. */ errno = EISDIR; #endif /* EISDIR */ - report_file_error ("Non-regular file", list1 (filename)); + report_file_error ("Non-regular file", filename); } } #endif /* S_ISREG && S_ISLNK */ @@ -1787,7 +1719,7 @@ ofd = open( (char *) XSTRING_DATA (newname), O_WRONLY | O_CREAT | O_TRUNC | OPEN_BINARY, CREAT_MODE); if (ofd < 0) - report_file_error ("Opening output file", list1 (newname)); + report_file_error ("Opening output file", newname); { Lisp_Object ofd_locative = noseeum_cons (make_int (ofd), Qnil); @@ -1797,12 +1729,12 @@ while ((n = read_allowing_quit (ifd, buf, sizeof (buf))) > 0) { if (write_allowing_quit (ofd, buf, n) != n) - report_file_error ("I/O error", list1 (newname)); + report_file_error ("I/O error", newname); } /* Closing the output clobbers the file times on some systems. */ if (close (ofd) < 0) - report_file_error ("I/O error", list1 (newname)); + report_file_error ("I/O error", newname); if (input_file_statable_p) { @@ -1812,7 +1744,7 @@ EMACS_SET_SECS_USECS (atime, st.st_atime, 0); EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); if (lisp_string_set_file_times (newname, atime, mtime)) - report_file_error ("I/O error", list1 (newname)); + report_file_error ("I/O error", newname); } chmod ((const char *) XSTRING_DATA (newname), st.st_mode & 07777); @@ -1862,7 +1794,7 @@ dir [XSTRING_LENGTH (dirname_) - 1] = 0; if (mkdir (dir, 0777) != 0) - report_file_error ("Creating directory", list1 (dirname_)); + report_file_error ("Creating directory", dirname_); return Qnil; } @@ -1888,7 +1820,7 @@ return (call2 (handler, Qdelete_directory, dirname_)); if (rmdir ((char *) XSTRING_DATA (dirname_)) != 0) - report_file_error ("Removing directory", list1 (dirname_)); + report_file_error ("Removing directory", dirname_); return Qnil; } @@ -1913,7 +1845,7 @@ return call2 (handler, Qdelete_file, filename); if (0 > unlink ((char *) XSTRING_DATA (filename))) - report_file_error ("Removing old name", list1 (filename)); + report_file_error ("Removing old name", filename); return Qnil; } @@ -2010,7 +1942,7 @@ } else { - report_file_error ("Renaming", list2 (filename, newname)); + report_file_error ("Renaming", list3 (Qunbound, filename, newname)); } } UNGCPRO; @@ -2062,7 +1994,7 @@ Reverted to previous behavior pending a working fix. (jhar) */ #if defined(WIN32_NATIVE) /* Windows does not support this operation. */ - report_file_error ("Adding new name", Flist (2, &filename)); + signal_error_2 (Qunimplemented, "Adding new name", filename, newname); #else /* not defined(WIN32_NATIVE) */ unlink ((char *) XSTRING_DATA (newname)); @@ -2070,7 +2002,7 @@ (char *) XSTRING_DATA (newname))) { report_file_error ("Adding new name", - list2 (filename, newname)); + list3 (Qunbound, filename, newname)); } #endif /* defined(WIN32_NATIVE) */ @@ -2128,7 +2060,7 @@ (char *) XSTRING_DATA (linkname))) { report_file_error ("Making symbolic link", - list2 (filename, linkname)); + list3 (Qunbound, filename, linkname)); } #endif /* S_IFLNK */ @@ -2569,7 +2501,7 @@ return call3 (handler, Qset_file_modes, abspath, mode); if (chmod ((char *) XSTRING_DATA (abspath), XINT (mode)) < 0) - report_file_error ("Doing chmod", list1 (abspath)); + report_file_error ("Doing chmod", abspath); return Qnil; } @@ -2703,7 +2635,7 @@ int not_regular = 0; if (buf->base_buffer && ! NILP (visit)) - error ("Cannot do file visiting in an indirect buffer"); + invalid_operation ("Cannot do file visiting in an indirect buffer", Qunbound); /* No need to call Fbarf_if_buffer_read_only() here. That's called in begin_multiple_change() or wherever. */ @@ -2742,7 +2674,7 @@ #endif if ( (!NILP (start) || !NILP (end)) && !NILP (visit) ) - error ("Attempt to visit less than an entire file"); + invalid_operation ("Attempt to visit less than an entire file", Qunbound); fd = -1; @@ -2751,7 +2683,7 @@ if (fd >= 0) close (fd); badopen: if (NILP (visit)) - report_file_error ("Opening input file", list1 (filename)); + report_file_error ("Opening input file", filename); st.st_mtime = -1; goto notfound; } @@ -2801,7 +2733,7 @@ /* Supposedly happens on VMS. */ if (st.st_size < 0) - error ("File size is negative"); + signal_error (Qfile_error, "File size is negative", Qunbound); if (NILP (end)) { @@ -2809,7 +2741,7 @@ { end = make_int (st.st_size); if (XINT (end) != st.st_size) - error ("Maximum buffer size exceeded"); + out_of_memory ("Maximum buffer size exceeded", Qunbound); } } @@ -2847,8 +2779,7 @@ Bufpos bufpos; nread = read_allowing_quit (fd, buffer, sizeof buffer); if (nread < 0) - error ("IO error reading %s: %s", - XSTRING_DATA (filename), strerror (errno)); + report_file_error ("Reading", filename); else if (nread == 0) break; bufpos = 0; @@ -2886,7 +2817,7 @@ /* How much can we scan in the next step? */ trial = min (curpos, (Bufpos) sizeof (buffer)); if (lseek (fd, curpos - trial, 0) < 0) - report_file_error ("Setting file position", list1 (filename)); + report_file_error ("Setting file position", filename); total_read = 0; while (total_read < trial) @@ -2894,7 +2825,7 @@ nread = read_allowing_quit (fd, buffer + total_read, trial - total_read); if (nread <= 0) - report_file_error ("IO error reading file", list1 (filename)); + report_file_error ("IO error reading file", filename); total_read += nread; } /* Scan this bufferful from the end, comparing with @@ -2940,7 +2871,7 @@ /* Make sure point-max won't overflow after this insertion. */ if (total != XINT (make_int (total))) - error ("Maximum buffer size exceeded"); + out_of_memory ("Maximum buffer size exceeded", Qunbound); } else /* For a special file, all we can do is guess. The value of -1 @@ -2957,7 +2888,7 @@ ) { if (lseek (fd, XINT (start), 0) < 0) - report_file_error ("Setting file position", list1 (filename)); + report_file_error ("Setting file position", filename); } { @@ -3018,8 +2949,8 @@ if (saverrno != 0) { - error ("IO error reading %s: %s", - XSTRING_DATA (filename), strerror (saverrno)); + errno = saverrno; + report_file_error ("Reading", filename); } notfound: @@ -3065,7 +2996,7 @@ /* If visiting nonexistent file, return nil. */ if (buf->modtime == -1) report_file_error ("Opening input file", - list1 (filename)); + filename); } /* Decode file format */ @@ -3260,7 +3191,7 @@ if (!auto_saving) unlock_file (lockname); errno = save_errno; #endif /* CLASH_DETECTION */ - report_file_error ("Opening output file", list1 (filename)); + report_file_error ("Opening output file", filename); } { @@ -3280,7 +3211,7 @@ if (!auto_saving) unlock_file (lockname); #endif /* CLASH_DETECTION */ report_file_error ("Lseek error", - list1 (filename)); + filename); } } @@ -3379,7 +3310,7 @@ if (failure) { errno = save_errno; - report_file_error ("Writing file", list1 (fn)); + report_file_error ("Writing file", fn); } if (visiting) @@ -4146,47 +4077,47 @@ void syms_of_fileio (void) { - defsymbol (&Qexpand_file_name, "expand-file-name"); - defsymbol (&Qfile_truename, "file-truename"); - defsymbol (&Qsubstitute_in_file_name, "substitute-in-file-name"); - defsymbol (&Qdirectory_file_name, "directory-file-name"); - defsymbol (&Qfile_name_directory, "file-name-directory"); - defsymbol (&Qfile_name_nondirectory, "file-name-nondirectory"); - defsymbol (&Qunhandled_file_name_directory, "unhandled-file-name-directory"); - defsymbol (&Qfile_name_as_directory, "file-name-as-directory"); - defsymbol (&Qcopy_file, "copy-file"); - defsymbol (&Qmake_directory_internal, "make-directory-internal"); - defsymbol (&Qdelete_directory, "delete-directory"); - defsymbol (&Qdelete_file, "delete-file"); - defsymbol (&Qrename_file, "rename-file"); - defsymbol (&Qadd_name_to_file, "add-name-to-file"); - defsymbol (&Qmake_symbolic_link, "make-symbolic-link"); - defsymbol (&Qfile_exists_p, "file-exists-p"); - defsymbol (&Qfile_executable_p, "file-executable-p"); - defsymbol (&Qfile_readable_p, "file-readable-p"); - defsymbol (&Qfile_symlink_p, "file-symlink-p"); - defsymbol (&Qfile_writable_p, "file-writable-p"); - defsymbol (&Qfile_directory_p, "file-directory-p"); - defsymbol (&Qfile_regular_p, "file-regular-p"); - defsymbol (&Qfile_accessible_directory_p, "file-accessible-directory-p"); - defsymbol (&Qfile_modes, "file-modes"); - defsymbol (&Qset_file_modes, "set-file-modes"); - defsymbol (&Qfile_newer_than_file_p, "file-newer-than-file-p"); - defsymbol (&Qinsert_file_contents, "insert-file-contents"); - defsymbol (&Qwrite_region, "write-region"); - defsymbol (&Qverify_visited_file_modtime, "verify-visited-file-modtime"); - defsymbol (&Qset_visited_file_modtime, "set-visited-file-modtime"); - defsymbol (&Qcar_less_than_car, "car-less-than-car"); /* Vomitous! */ - - defsymbol (&Qauto_save_hook, "auto-save-hook"); - defsymbol (&Qauto_save_error, "auto-save-error"); - defsymbol (&Qauto_saving, "auto-saving"); - - defsymbol (&Qformat_decode, "format-decode"); - defsymbol (&Qformat_annotate_function, "format-annotate-function"); - - defsymbol (&Qcompute_buffer_file_truename, "compute-buffer-file-truename"); - DEFERROR_STANDARD (Qfile_error, Qio_error); + DEFSYMBOL (Qexpand_file_name); + DEFSYMBOL (Qfile_truename); + DEFSYMBOL (Qsubstitute_in_file_name); + DEFSYMBOL (Qdirectory_file_name); + DEFSYMBOL (Qfile_name_directory); + DEFSYMBOL (Qfile_name_nondirectory); + DEFSYMBOL (Qunhandled_file_name_directory); + DEFSYMBOL (Qfile_name_as_directory); + DEFSYMBOL (Qcopy_file); + DEFSYMBOL (Qmake_directory_internal); + DEFSYMBOL (Qdelete_directory); + DEFSYMBOL (Qdelete_file); + DEFSYMBOL (Qrename_file); + DEFSYMBOL (Qadd_name_to_file); + DEFSYMBOL (Qmake_symbolic_link); + DEFSYMBOL (Qfile_exists_p); + DEFSYMBOL (Qfile_executable_p); + DEFSYMBOL (Qfile_readable_p); + DEFSYMBOL (Qfile_symlink_p); + DEFSYMBOL (Qfile_writable_p); + DEFSYMBOL (Qfile_directory_p); + DEFSYMBOL (Qfile_regular_p); + DEFSYMBOL (Qfile_accessible_directory_p); + DEFSYMBOL (Qfile_modes); + DEFSYMBOL (Qset_file_modes); + DEFSYMBOL (Qfile_newer_than_file_p); + DEFSYMBOL (Qinsert_file_contents); + DEFSYMBOL (Qwrite_region); + DEFSYMBOL (Qverify_visited_file_modtime); + DEFSYMBOL (Qset_visited_file_modtime); + DEFSYMBOL (Qcar_less_than_car); /* Vomitous! */ + + DEFSYMBOL (Qauto_save_hook); + DEFSYMBOL (Qauto_save_error); + DEFSYMBOL (Qauto_saving); + + DEFSYMBOL (Qformat_decode); + DEFSYMBOL (Qformat_annotate_function); + + DEFSYMBOL (Qcompute_buffer_file_truename); + DEFERROR_STANDARD (Qfile_already_exists, Qfile_error); DEFSUBR (Ffind_file_name_handler); diff -r c775bd016b32 -r 183866b06e0b src/filelock.c --- a/src/filelock.c Thu May 24 06:30:21 2001 +0000 +++ b/src/filelock.c Thu May 24 07:51:33 2001 +0000 @@ -492,9 +492,8 @@ DEFSUBR (Flock_buffer); DEFSUBR (Ffile_locked_p); - defsymbol (&Qask_user_about_supersession_threat, - "ask-user-about-supersession-threat"); - defsymbol (&Qask_user_about_lock, "ask-user-about-lock"); + DEFSYMBOL (Qask_user_about_supersession_threat); + DEFSYMBOL (Qask_user_about_lock); } void diff -r c775bd016b32 -r 183866b06e0b src/floatfns.c --- a/src/floatfns.c Thu May 24 06:30:21 2001 +0000 +++ b/src/floatfns.c Thu May 24 07:51:33 2001 +0000 @@ -937,7 +937,7 @@ occurring inside a signal handler to be restartable, considering that anything could happen when the error is signaled and trapped and considering the asynchronous nature of signal handlers. */ - signal_error (Qarith_error, list1 (float_error_arg)); + signal_error (Qarith_error, 0, float_error_arg); } /* Another idea was to replace the library function `infnan' diff -r c775bd016b32 -r 183866b06e0b src/fns.c --- a/src/fns.c Thu May 24 06:30:21 2001 +0000 +++ b/src/fns.c Thu May 24 07:51:33 2001 +0000 @@ -55,6 +55,8 @@ Lisp_Object Qstring_lessp; Lisp_Object Qidentity; +Lisp_Object Qbase64_conversion_error; + static int internal_old_equal (Lisp_Object, Lisp_Object, int); Lisp_Object safe_copy_tree (Lisp_Object arg, Lisp_Object vecp, int depth); @@ -205,8 +207,8 @@ check_losing_bytecode (const char *function, Lisp_Object seq) { if (COMPILED_FUNCTIONP (seq)) - error_with_frob - (seq, + signal_ferror_with_frob + (Qinvalid_argument, seq, "As of 20.3, `%s' no longer works with compiled-function objects", function); } @@ -871,7 +873,7 @@ safe_copy_tree (Lisp_Object arg, Lisp_Object vecp, int depth) { if (depth > 200) - signal_simple_error ("Stack overflow in copy-tree", arg); + stack_overflow ("Stack overflow in copy-tree", arg); if (CONSP (arg)) { @@ -2569,7 +2571,7 @@ if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->getprop) val = XRECORD_LHEADER_IMPLEMENTATION (object)->getprop (object, property); else - signal_simple_error ("Object type has no properties", object); + invalid_operation ("Object type has no properties", object); return UNBOUNDP (val) ? default_ : val; } @@ -2591,10 +2593,10 @@ { if (! XRECORD_LHEADER_IMPLEMENTATION (object)->putprop (object, property, value)) - signal_simple_error ("Can't set property on object", property); + invalid_change ("Can't set property on object", property); } else - signal_simple_error ("Object type has no settable properties", object); + invalid_change ("Object type has no settable properties", object); return value; } @@ -2615,10 +2617,10 @@ { ret = XRECORD_LHEADER_IMPLEMENTATION (object)->remprop (object, property); if (ret == -1) - signal_simple_error ("Can't remove property from object", property); + invalid_change ("Can't remove property from object", property); } else - signal_simple_error ("Object type has no removable properties", object); + invalid_change ("Object type has no removable properties", object); return ret ? Qt : Qnil; } @@ -2635,7 +2637,7 @@ if (LRECORDP (object) && XRECORD_LHEADER_IMPLEMENTATION (object)->plist) return XRECORD_LHEADER_IMPLEMENTATION (object)->plist (object); else - signal_simple_error ("Object type has no properties", object); + invalid_operation ("Object type has no properties", object); return Qnil; } @@ -2645,7 +2647,7 @@ internal_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { if (depth > 200) - error ("Stack overflow in equal"); + stack_overflow ("Stack overflow in equal", Qunbound); QUIT; if (EQ_WITH_EBOLA_NOTICE (obj1, obj2)) return 1; @@ -2675,7 +2677,7 @@ internal_old_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) { if (depth > 200) - error ("Stack overflow in equal"); + stack_overflow ("Stack overflow in equal", Qunbound); QUIT; if (HACKEQ_UNSAFE (obj1, obj2)) return 1; @@ -3178,10 +3180,11 @@ Lisp_Object ret = Qnil; if (loads == -2) - error ("load-average not implemented for this operating system"); + signal_error (Qunimplemented, + "load-average not implemented for this operating system", + Qunbound); else if (loads < 0) - signal_simple_error ("Could not get load-average", - lisp_strerror (errno)); + invalid_operation ("Could not get load-average", lisp_strerror (errno)); while (loads-- > 0) { @@ -3349,8 +3352,7 @@ tem = Fmemq (feature, Vfeatures); if (NILP (tem)) - error ("Required feature %s was not provided", - string_data (XSYMBOL (feature)->name)); + invalid_state ("Required feature was not provided", feature); /* Once loading finishes, don't undo it. */ Vautoload_queue = Qt; @@ -3419,11 +3421,17 @@ The octets are divided into 6 bit chunks, which are then encoded into base64 characters. */ -#define ADVANCE_INPUT(c, stream) \ - ((ec = Lstream_get_emchar (stream)) == -1 ? 0 : \ - ((ec > 255) ? \ - (signal_simple_error ("Non-ascii character in base64 input", \ - make_char (ec)), 0) \ +DOESNT_RETURN +base64_conversion_error (const char *reason, Lisp_Object frob) +{ + signal_error (Qbase64_conversion_error, reason, frob); +} + +#define ADVANCE_INPUT(c, stream) \ + ((ec = Lstream_get_emchar (stream)) == -1 ? 0 : \ + ((ec > 255) ? \ + (base64_conversion_error ("Non-ascii character in base64 input", \ + make_char (ec)), 0) \ : (c = (Bufbyte)ec), 1)) static Bytind @@ -3518,33 +3526,37 @@ if (ec < 0) break; if (ec == '=') - signal_simple_error ("Illegal `=' character while decoding base64", - make_int (streampos)); + base64_conversion_error ("Illegal `=' character while decoding base64", + make_int (streampos)); value = base64_char_to_value[ec] << 18; /* Process second byte of a quadruplet. */ ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); if (ec < 0) - error ("Premature EOF while decoding base64"); + base64_conversion_error ("Premature EOF while decoding base64", + Qunbound); if (ec == '=') - signal_simple_error ("Illegal `=' character while decoding base64", - make_int (streampos)); + base64_conversion_error ("Illegal `=' character while decoding base64", + make_int (streampos)); value |= base64_char_to_value[ec] << 12; STORE_BYTE (e, value >> 16, ccnt); /* Process third byte of a quadruplet. */ ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); if (ec < 0) - error ("Premature EOF while decoding base64"); + base64_conversion_error ("Premature EOF while decoding base64", + Qunbound); if (ec == '=') { ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); if (ec < 0) - error ("Premature EOF while decoding base64"); + base64_conversion_error ("Premature EOF while decoding base64", + Qunbound); if (ec != '=') - signal_simple_error ("Padding `=' expected but not found while decoding base64", - make_int (streampos)); + base64_conversion_error + ("Padding `=' expected but not found while decoding base64", + make_int (streampos)); continue; } @@ -3554,7 +3566,8 @@ /* Process fourth byte of a quadruplet. */ ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); if (ec < 0) - error ("Premature EOF while decoding base64"); + base64_conversion_error ("Premature EOF while decoding base64", + Qunbound); if (ec == '=') continue; @@ -3766,9 +3779,11 @@ { INIT_LRECORD_IMPLEMENTATION (bit_vector); - defsymbol (&Qstring_lessp, "string-lessp"); - defsymbol (&Qidentity, "identity"); - defsymbol (&Qyes_or_no_p, "yes-or-no-p"); + DEFSYMBOL (Qstring_lessp); + DEFSYMBOL (Qidentity); + DEFSYMBOL (Qyes_or_no_p); + + DEFERROR_STANDARD (Qbase64_conversion_error, Qconversion_error); DEFSUBR (Fidentity); DEFSUBR (Frandom); diff -r c775bd016b32 -r 183866b06e0b src/font-lock.c --- a/src/font-lock.c Thu May 24 06:30:21 2001 +0000 +++ b/src/font-lock.c Thu May 24 07:51:33 2001 +0000 @@ -812,9 +812,9 @@ void syms_of_font_lock (void) { - defsymbol (&Qcomment, "comment"); - defsymbol (&Qblock_comment, "block-comment"); - defsymbol (&Qbeginning_of_defun, "beginning-of-defun"); + DEFSYMBOL (Qcomment); + DEFSYMBOL (Qblock_comment); + DEFSYMBOL (Qbeginning_of_defun); DEFSUBR (Fbuffer_syntactic_context); DEFSUBR (Fbuffer_syntactic_context_depth); diff -r c775bd016b32 -r 183866b06e0b src/frame-gtk.c --- a/src/frame-gtk.c Thu May 24 06:30:21 2001 +0000 +++ b/src/frame-gtk.c Thu May 24 07:51:33 2001 +0000 @@ -784,7 +784,7 @@ if (!GTK_IS_CONTAINER (XGTK_OBJECT (lisp_window_id)->object)) { - signal_simple_error ("Window ID must be a GtkContainer subclass", lisp_window_id); + invalid_argument ("Window ID must be a GtkContainer subclass", lisp_window_id); } shell = gtk_vbox_new (FALSE, 0); @@ -957,8 +957,8 @@ popup = Fselected_frame (device); CHECK_LIVE_FRAME (popup); if (!EQ (device, FRAME_DEVICE (XFRAME (popup)))) - signal_simple_error_2 ("Parent must be on same device as frame", - device, popup); + invalid_argument_2 ("Parent must be on same device as frame", + device, popup); } initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil); @@ -1182,7 +1182,7 @@ static void gtk_cant_notify_wm_error (void) { - error ("Can't notify window manager of iconification."); + signal_error (Qgui_error, "Can't notify window manager of iconification", Qunbound); } /* Raise frame F. */ @@ -1389,11 +1389,11 @@ void syms_of_frame_gtk (void) { - defsymbol (&Qwindow_id, "window-id"); - defsymbol (&Qtext_widget, "text-widget"); - defsymbol (&Qcontainer_widget, "container-widget"); - defsymbol (&Qshell_widget, "shell-widget"); - defsymbol (&Qdetachable_menubar, "detachable-menubar"); + DEFSYMBOL (Qwindow_id); + DEFSYMBOL (Qtext_widget); + DEFSYMBOL (Qcontainer_widget); + DEFSYMBOL (Qshell_widget); + DEFSYMBOL (Qdetachable_menubar); #ifdef HAVE_DRAGNDROP staticpro (&Vcurrent_drag_object); diff -r c775bd016b32 -r 183866b06e0b src/frame-x.c --- a/src/frame-x.c Thu May 24 06:30:21 2001 +0000 +++ b/src/frame-x.c Thu May 24 07:51:33 2001 +0000 @@ -1893,7 +1893,7 @@ #ifndef EXTERNAL_WIDGET if (!NILP (lisp_window_id)) - error ("support for external widgets was not enabled at compile-time"); + signal_error (Qunimplemented, "support for external widgets was not enabled at compile-time", Qunbound); #else if (!NILP (lisp_window_id)) { @@ -1914,7 +1914,8 @@ else sscanf (string, "%lu", &window_id); if (!is_valid_window (window_id, d)) - error ("Invalid window %lu", (unsigned long) window_id); + signal_ferror (Qinvalid_argument, "Invalid window %lu", + (unsigned long) window_id); FRAME_X_EXTERNAL_WINDOW_P (f) = 1; } else #endif /* EXTERNAL_WIDGET */ @@ -2161,8 +2162,8 @@ popup = Fselected_frame (device); CHECK_LIVE_FRAME (popup); if (!EQ (device, FRAME_DEVICE (XFRAME (popup)))) - signal_simple_error_2 ("Parent must be on same device as frame", - device, popup); + invalid_argument_2 ("Parent must be on same device as frame", + device, popup); } /* @@ -2423,7 +2424,7 @@ static void x_cant_notify_wm_error (void) { - error ("Can't notify window manager of iconification."); + signal_error (Qgui_error, "Can't notify window manager of iconification", Qunbound); } /* Raise frame F. */ @@ -2772,8 +2773,8 @@ void syms_of_frame_x (void) { - defsymbol (&Qwindow_id, "window-id"); - defsymbol (&Qx_resource_name, "x-resource-name"); + DEFSYMBOL (Qwindow_id); + DEFSYMBOL (Qx_resource_name); DEFSUBR (Fx_window_id); #ifdef HAVE_CDE diff -r c775bd016b32 -r 183866b06e0b src/frame.c --- a/src/frame.c Thu May 24 06:30:21 2001 +0000 +++ b/src/frame.c Thu May 24 07:51:33 2001 +0000 @@ -143,8 +143,8 @@ char buf[200]; if (print_readably) - error ("printing unreadable object #", - XSTRING_DATA (frm->name), frm->header.uid); + printing_unreadable_object ("#", + XSTRING_DATA (frm->name), frm->header.uid); sprintf (buf, "#<%s-frame ", !FRAME_LIVE_P (frm) ? "dead" : FRAME_TYPE_NAME (frm)); @@ -263,7 +263,7 @@ if (!NILP (mini_window) && !EQ (DEVICE_CONSOLE (XDEVICE (device)), FRAME_CONSOLE (XFRAME (XWINDOW (mini_window)->frame)))) - error ("frame and minibuffer must be on the same console"); + invalid_argument ("frame and minibuffer must be on the same console", Qunbound); /* Do not create a default minibuffer frame on printer devices. */ if (NILP (mini_window) @@ -394,7 +394,7 @@ if (!NILP (Fstring_match (make_string ((const Bufbyte *) "\\.", 2), name, Qnil, Qnil))) - signal_simple_error (". not allowed in frame names", name); + syntax_error (". not allowed in frame names", name); f = allocate_frame_core (device); XSETFRAME (frame, f); @@ -425,7 +425,7 @@ else if (EQ (minibuf, Qt) || UNBOUNDP (minibuf)) setup_normal_frame (f); else - signal_simple_error ("Invalid value for `minibuffer'", minibuf); + invalid_argument ("Invalid value for `minibuffer'", minibuf); update_frame_window_mirror (f); @@ -790,7 +790,7 @@ Lisp_Object device = Fselected_device (Qnil); Lisp_Object frame = DEVICE_SELECTED_FRAME (XDEVICE (device)); if (NILP (frame)) - signal_simple_error ("No frames exist on device", device); + gui_error ("No frames exist on device", device); return XFRAME (frame); } @@ -808,7 +808,7 @@ { Lisp_Object device; XSETDEVICE (device, d); - signal_simple_error ("No frames exist on device", device); + gui_error ("No frames exist on device", device); } return XFRAME (frame); } @@ -957,7 +957,7 @@ CHECK_LIVE_WINDOW (window); if (! EQ (frame, WINDOW_FRAME (XWINDOW (window)))) - error ("In `set-frame-selected-window', WINDOW is not on FRAME"); + invalid_argument ("In `set-frame-selected-window', WINDOW is not on FRAME", Qunbound); if (XFRAME (frame) == selected_frame ()) return Fselect_window (window, Qnil); @@ -1347,7 +1347,7 @@ So we put it back. */ if (!force && !allow_deletion_of_last_visible_frame && !other_visible_frames (f)) - error ("Attempt to delete the sole visible or iconified frame"); + invalid_operation ("Attempt to delete the sole visible or iconified frame", Qunbound); /* Does this frame have a minibuffer, and is it the surrogate minibuffer for any other frame? */ @@ -1366,7 +1366,7 @@ { /* We've found another frame whose minibuffer is on this frame. */ - signal_simple_error + gui_error ("Attempt to delete a surrogate minibuffer frame", frame); } } @@ -1389,7 +1389,7 @@ (XFRAME (this)), Qnil))) /* We've found a popup frame whose parent is this frame. */ - signal_simple_error + gui_error ("Attempt to delete a frame with live popups", frame); } } @@ -1924,7 +1924,7 @@ sel_frame = XFRAME (DEVICE_SELECTED_FRAME (d)); if (NILP (force) && !other_visible_frames (f)) - error ("Attempt to make invisible the sole visible or iconified frame"); + invalid_operation ("Attempt to make invisible the sole visible or iconified frame", Qunbound); /* Don't allow minibuf_window to remain on a deleted frame. */ if (EQ (f->minibuffer_window, minibuf_window)) @@ -2159,12 +2159,12 @@ if (WINDOWP (val)) { if (! MINI_WINDOW_P (XWINDOW (val))) - signal_simple_error + gui_error ("Surrogate minibuffer windows must be minibuffer windows", val); if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) - signal_simple_error + gui_error ("Can't change the surrogate minibuffer of a frame with its own minibuffer", frame); /* Install the chosen minibuffer window, with proper buffer. */ @@ -2173,7 +2173,7 @@ else if (EQ (val, Qt)) { if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) - signal_simple_error + gui_error ("Frame already has its own minibuffer", frame); else { @@ -3206,69 +3206,69 @@ { INIT_LRECORD_IMPLEMENTATION (frame); - defsymbol (&Qdelete_frame_hook, "delete-frame-hook"); - defsymbol (&Qselect_frame_hook, "select-frame-hook"); - defsymbol (&Qdeselect_frame_hook, "deselect-frame-hook"); - defsymbol (&Qcreate_frame_hook, "create-frame-hook"); - defsymbol (&Qcustom_initialize_frame, "custom-initialize-frame"); - defsymbol (&Qmouse_enter_frame_hook, "mouse-enter-frame-hook"); - defsymbol (&Qmouse_leave_frame_hook, "mouse-leave-frame-hook"); - defsymbol (&Qmap_frame_hook, "map-frame-hook"); - defsymbol (&Qunmap_frame_hook, "unmap-frame-hook"); - - defsymbol (&Qframep, "framep"); - defsymbol (&Qframe_live_p, "frame-live-p"); - defsymbol (&Qdelete_frame, "delete-frame"); - defsymbol (&Qsynchronize_minibuffers, "synchronize-minibuffers"); - defsymbol (&Qbuffer_predicate, "buffer-predicate"); - defsymbol (&Qframe_being_created, "frame-being-created"); - defsymbol (&Qmake_initial_minibuffer_frame, "make-initial-minibuffer-frame"); - - defsymbol (&Qframe_title_format, "frame-title-format"); - defsymbol (&Qframe_icon_title_format, "frame-icon-title-format"); - - defsymbol (&Qhidden, "hidden"); - defsymbol (&Qvisible, "visible"); - defsymbol (&Qiconic, "iconic"); - defsymbol (&Qinvisible, "invisible"); - defsymbol (&Qvisible_iconic, "visible-iconic"); - defsymbol (&Qinvisible_iconic, "invisible-iconic"); - defsymbol (&Qnomini, "nomini"); - defsymbol (&Qvisible_nomini, "visible-nomini"); - defsymbol (&Qiconic_nomini, "iconic-nomini"); - defsymbol (&Qinvisible_nomini, "invisible-nomini"); - defsymbol (&Qvisible_iconic_nomini, "visible-iconic-nomini"); - defsymbol (&Qinvisible_iconic_nomini, "invisible-iconic-nomini"); - - defsymbol (&Qminibuffer, "minibuffer"); - defsymbol (&Qunsplittable, "unsplittable"); - defsymbol (&Qinternal_border_width, "internal-border-width"); - defsymbol (&Qtop_toolbar_shadow_color, "top-toolbar-shadow-color"); - defsymbol (&Qbottom_toolbar_shadow_color, "bottom-toolbar-shadow-color"); - defsymbol (&Qbackground_toolbar_color, "background-toolbar-color"); - defsymbol (&Qtop_toolbar_shadow_pixmap, "top-toolbar-shadow-pixmap"); - defsymbol (&Qbottom_toolbar_shadow_pixmap, "bottom-toolbar-shadow-pixmap"); - defsymbol (&Qtoolbar_shadow_thickness, "toolbar-shadow-thickness"); - defsymbol (&Qscrollbar_placement, "scrollbar-placement"); - defsymbol (&Qinter_line_space, "inter-line-space"); + DEFSYMBOL (Qdelete_frame_hook); + DEFSYMBOL (Qselect_frame_hook); + DEFSYMBOL (Qdeselect_frame_hook); + DEFSYMBOL (Qcreate_frame_hook); + DEFSYMBOL (Qcustom_initialize_frame); + DEFSYMBOL (Qmouse_enter_frame_hook); + DEFSYMBOL (Qmouse_leave_frame_hook); + DEFSYMBOL (Qmap_frame_hook); + DEFSYMBOL (Qunmap_frame_hook); + + DEFSYMBOL (Qframep); + DEFSYMBOL (Qframe_live_p); + DEFSYMBOL (Qdelete_frame); + DEFSYMBOL (Qsynchronize_minibuffers); + DEFSYMBOL (Qbuffer_predicate); + DEFSYMBOL (Qframe_being_created); + DEFSYMBOL (Qmake_initial_minibuffer_frame); + + DEFSYMBOL (Qframe_title_format); + DEFSYMBOL (Qframe_icon_title_format); + + DEFSYMBOL (Qhidden); + DEFSYMBOL (Qvisible); + DEFSYMBOL (Qiconic); + DEFSYMBOL (Qinvisible); + DEFSYMBOL (Qvisible_iconic); + DEFSYMBOL (Qinvisible_iconic); + DEFSYMBOL (Qnomini); + DEFSYMBOL (Qvisible_nomini); + DEFSYMBOL (Qiconic_nomini); + DEFSYMBOL (Qinvisible_nomini); + DEFSYMBOL (Qvisible_iconic_nomini); + DEFSYMBOL (Qinvisible_iconic_nomini); + + DEFSYMBOL (Qminibuffer); + DEFSYMBOL (Qunsplittable); + DEFSYMBOL (Qinternal_border_width); + DEFSYMBOL (Qtop_toolbar_shadow_color); + DEFSYMBOL (Qbottom_toolbar_shadow_color); + DEFSYMBOL (Qbackground_toolbar_color); + DEFSYMBOL (Qtop_toolbar_shadow_pixmap); + DEFSYMBOL (Qbottom_toolbar_shadow_pixmap); + DEFSYMBOL (Qtoolbar_shadow_thickness); + DEFSYMBOL (Qscrollbar_placement); + DEFSYMBOL (Qinter_line_space); /* Qiconic already in this function. */ - defsymbol (&Qvisual_bell, "visual-bell"); - defsymbol (&Qbell_volume, "bell-volume"); - defsymbol (&Qpointer_background, "pointer-background"); - defsymbol (&Qpointer_color, "pointer-color"); - defsymbol (&Qtext_pointer, "text-pointer"); - defsymbol (&Qspace_pointer, "space-pointer"); - defsymbol (&Qmodeline_pointer, "modeline-pointer"); - defsymbol (&Qgc_pointer, "gc-pointer"); - defsymbol (&Qinitially_unmapped, "initially-unmapped"); - defsymbol (&Quse_backing_store, "use-backing-store"); - defsymbol (&Qborder_color, "border-color"); - defsymbol (&Qborder_width, "border-width"); + DEFSYMBOL (Qvisual_bell); + DEFSYMBOL (Qbell_volume); + DEFSYMBOL (Qpointer_background); + DEFSYMBOL (Qpointer_color); + DEFSYMBOL (Qtext_pointer); + DEFSYMBOL (Qspace_pointer); + DEFSYMBOL (Qmodeline_pointer); + DEFSYMBOL (Qgc_pointer); + DEFSYMBOL (Qinitially_unmapped); + DEFSYMBOL (Quse_backing_store); + DEFSYMBOL (Qborder_color); + DEFSYMBOL (Qborder_width); /* Qwidth, Qheight, Qleft, Qtop in general.c */ - defsymbol (&Qset_specifier, "set-specifier"); - defsymbol (&Qset_face_property, "set-face-property"); - defsymbol (&Qface_property_instance, "face-property-instance"); - defsymbol (&Qframe_property_alias, "frame-property-alias"); + DEFSYMBOL (Qset_specifier); + DEFSYMBOL (Qset_face_property); + DEFSYMBOL (Qface_property_instance); + DEFSYMBOL (Qframe_property_alias); DEFSUBR (Fmake_frame); DEFSUBR (Fframep); diff -r c775bd016b32 -r 183866b06e0b src/general-slots.h --- a/src/general-slots.h Thu May 24 06:30:21 2001 +0000 +++ b/src/general-slots.h Thu May 24 07:51:33 2001 +0000 @@ -103,6 +103,7 @@ SYMBOL (Qequal); SYMBOL (Qeval); SYMBOL (Qextents); +SYMBOL (Qexternal); SYMBOL (Qface); SYMBOL (Qfallback); SYMBOL (Qfile); @@ -217,6 +218,7 @@ SYMBOL (Qsignal); SYMBOL (Qsimple); SYMBOL (Qsize); +SYMBOL (Qsound); SYMBOL (Qspace); SYMBOL (Qspecifier); SYMBOL (Qstandard); diff -r c775bd016b32 -r 183866b06e0b src/glade.c --- a/src/glade.c Thu May 24 06:30:21 2001 +0000 +++ b/src/glade.c Thu May 24 07:51:33 2001 +0000 @@ -107,7 +107,7 @@ if (!GLADE_IS_XML (XGTK_OBJECT (xml)->object)) { - signal_simple_error ("Object is not a GladeXML type.", xml); + wtaerror ("Object is not a GladeXML type.", xml); } #ifdef LIBGLADE_XML_TXTDOMAIN diff -r c775bd016b32 -r 183866b06e0b src/glyphs-gtk.c --- a/src/glyphs-gtk.c Thu May 24 06:30:21 2001 +0000 +++ b/src/glyphs-gtk.c Thu May 24 07:51:33 2001 +0000 @@ -153,7 +153,6 @@ #include "bitmaps.h" DEFINE_IMAGE_INSTANTIATOR_FORMAT (gtk_resource); -Lisp_Object Q_resource_type, Q_resource_id; Lisp_Object Qgtk_resource; #ifdef HAVE_WIDGETS Lisp_Object Qgtk_widget_instantiate_internal, Qgtk_widget_property_internal; @@ -624,13 +623,13 @@ width, height, &best_width, &best_height)) /* this means that an X error of some sort occurred (we trap these so they're not fatal). */ - signal_simple_error ("XQueryBestCursor() failed?", instantiator); + gui_error ("XQueryBestCursor() failed?", instantiator); if (width > best_width || height > best_height) - error_with_frob (instantiator, - "pointer too large (%dx%d): " - "server requires %dx%d or smaller", - width, height, best_width, best_height); + signal_ferror_with_frob (Qgui_error, instantiator, + "pointer too large (%dx%d): " + "server requires %dx%d or smaller", + width, height, best_width, best_height); #endif } @@ -727,7 +726,7 @@ GdkPixmap *pixmap; if (!DEVICE_GTK_P (XDEVICE (device))) - signal_simple_error ("Not a Gtk device", device); + gui_error ("Not a Gtk device", device); d = GET_GTK_WIDGET_WINDOW (DEVICE_GTK_APP_SHELL (XDEVICE (device))); @@ -737,13 +736,13 @@ pixmap = gdk_pixmap_new (d, gdk_image->width, gdk_image->height, gdk_image->depth); if (!pixmap) - signal_simple_error ("Unable to create pixmap", instantiator); + gui_error ("Unable to create pixmap", instantiator); gc = gdk_gc_new (pixmap); if (!gc) { gdk_pixmap_unref (pixmap); - signal_simple_error ("Unable to create GC", instantiator); + gui_error ("Unable to create GC", instantiator); } gdk_draw_image (GDK_DRAWABLE (pixmap), gc, gdk_image, @@ -820,14 +819,14 @@ pixmap = gdk_pixmap_new (d, gdk_image->width, gdk_image->height, gdk_image->depth); if (!pixmap) - signal_simple_error ("Unable to create pixmap", instantiator); + gui_error ("Unable to create pixmap", instantiator); gc = gdk_gc_new (pixmap); if (!gc) { gdk_pixmap_unref (pixmap); - signal_simple_error ("Unable to create GC", instantiator); + gui_error ("Unable to create GC", instantiator); } gdk_draw_image (GDK_DRAWABLE (pixmap), gc, gdk_image, 0, 0, 0, 0, @@ -923,7 +922,7 @@ gdk_color_white(cmap, &white); if (!DEVICE_GTK_P (XDEVICE (device))) - signal_simple_error ("Not a Gtk device", device); + gui_error ("Not a Gtk device", device); if ((dest_mask & IMAGE_MONO_PIXMAP_MASK) && (dest_mask & IMAGE_COLOR_PIXMAP_MASK)) @@ -1120,8 +1119,7 @@ unlink (filename_out); errno = old_errno; } - report_file_error ("Creating temp file", - list1 (build_string (filename_out))); + report_file_error ("Creating temp file", build_string (filename_out)); } CHECK_STRING (string); @@ -1181,8 +1179,7 @@ #endif if (fubar) - report_file_error ("Writing temp file", - list1 (build_string (filename_out))); + report_file_error ("Writing temp file", build_string (filename_out)); } struct color_symbol @@ -1279,7 +1276,7 @@ unsigned int w, h; if (!DEVICE_GTK_P (XDEVICE (device))) - signal_simple_error ("Not a Gtk device", device); + gui_error ("Not a Gtk device", device); if (dest_mask & IMAGE_COLOR_PIXMAP_MASK) type = IMAGE_COLOR_PIXMAP; @@ -1454,7 +1451,7 @@ } if (emsg) - signal_simple_error_2 (emsg, data, Qimage); + gui_error_2 (emsg, data, Qimage); bp = bits = (char *) alloca (PIXELS / 8); @@ -1489,43 +1486,16 @@ NILP (find_keyword_in_vector (instantiator, Q_resource_id))) || NILP (find_keyword_in_vector (instantiator, Q_resource_type))) - signal_simple_error ("Must supply :file, :resource-id and :resource-type", + sferror ("Must supply :file, :resource-id and :resource-type", instantiator); } static Lisp_Object -gtk_resource_normalize (Lisp_Object inst, Lisp_Object console_type, Lisp_Object dest_mask) +gtk_resource_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask) { - /* This function can call lisp */ - Lisp_Object file = Qnil; - struct gcpro gcpro1, gcpro2; - Lisp_Object alist = Qnil; - - GCPRO2 (file, alist); - - file = potential_pixmap_file_instantiator (inst, Q_file, Q_data, - console_type); - - if (CONSP (file)) /* failure locating filename */ - signal_double_file_error ("Opening pixmap file", - "no such file or directory", - Fcar (file)); - - if (NILP (file)) /* no conversion necessary */ - RETURN_UNGCPRO (inst); - - alist = tagged_vector_to_alist (inst); - - { - alist = remassq_no_quit (Q_file, alist); - alist = Fcons (Fcons (Q_file, file), alist); - } - - { - Lisp_Object result = alist_to_tagged_vector (Qgtk_resource, alist); - free_alist (alist); - RETURN_UNGCPRO (result); - } + return shared_resource_normalize (inst, console_type, dest_mask, + Qgtk_resource); } static int @@ -1572,7 +1542,7 @@ Lisp_Object resource_id = find_keyword_in_vector (instantiator, Q_resource_id); if (!DEVICE_GTK_P (XDEVICE (device))) - signal_simple_error ("Not a GTK device", device); + gui_error ("Not a GTK device", device); type = resource_symbol_to_type (resource_type); @@ -1599,7 +1569,7 @@ { CHECK_SYMBOL (data); if (!resource_symbol_to_type (data)) - signal_simple_error ("invalid resource type", data); + invalid_constant ("invalid resource type", data); } static void @@ -1613,7 +1583,7 @@ !resource_name_to_resource (data, IMAGE_BITMAP) #endif ) - signal_simple_error ("invalid resource identifier", data); + invalid_constant ("invalid resource identifier", data); } #if 0 @@ -1809,11 +1779,11 @@ Lisp_Object foreground, background; if (!DEVICE_GTK_P (XDEVICE (device))) - signal_simple_error ("Not a Gtk device", device); + gui_error ("Not a Gtk device", device); if (!STRINGP (data) || strncmp ("FONT ", (char *) XSTRING_DATA (data), 5)) - signal_simple_error ("Invalid font-glyph instantiator", + invalid_argument ("Invalid font-glyph instantiator", instantiator); if (!(dest_mask & IMAGE_POINTER_MASK)) @@ -1837,10 +1807,10 @@ count = 4, mask_name[0] = 0; if (count != 2 && count != 4) - signal_simple_error ("invalid cursor specification", data); + syntax_error ("invalid cursor specification", data); source = gdk_font_load (source_name); if (! source) - signal_simple_error_2 ("couldn't load font", + gui_error_2 ("couldn't load font", build_string (source_name), data); if (count == 2) @@ -1852,8 +1822,8 @@ mask = gdk_font_load (mask_name); if (!mask) /* continuable */ - Fsignal (Qerror, list3 (build_string ("couldn't load font"), - build_string (mask_name), data)); + Fsignal (Qgui_error, list3 (build_string ("couldn't load font"), + build_string (mask_name), data)); } if (!mask) mask_char = 0; @@ -1991,7 +1961,7 @@ Lisp_Object foreground, background; if (!DEVICE_GTK_P (XDEVICE (device))) - signal_simple_error ("Not a Gtk device", device); + gui_error ("Not a Gtk device", device); if (!(dest_mask & IMAGE_POINTER_MASK)) incompatible_image_types (instantiator, dest_mask, IMAGE_POINTER_MASK); @@ -2001,7 +1971,7 @@ Qfile_name); if ((i = cursor_name_to_index (name_ext)) == -1) - signal_simple_error ("Unrecognized cursor-font name", data); + invalid_argument ("Unrecognized cursor-font name", data); gtk_initialize_pixmap_image_instance (ii, 1, IMAGE_POINTER); IMAGE_INSTANCE_GTK_CURSOR (ii) = gdk_cursor_new (i); @@ -2220,7 +2190,7 @@ Lisp_Object frame = DOMAIN_FRAME (domain); if (!DEVICE_GTK_P (XDEVICE (device))) - signal_simple_error ("Not a GTK device", device); + gui_error ("Not a GTK device", device); IMAGE_INSTANCE_TYPE (ii) = IMAGE_SUBWINDOW; @@ -2571,13 +2541,11 @@ void syms_of_glyphs_gtk (void) { - defkeyword (&Q_resource_id, ":resource-id"); - defkeyword (&Q_resource_type, ":resource-type"); #ifdef HAVE_WIDGETS - defsymbol (&Qgtk_widget_instantiate_internal, "gtk-widget-instantiate-internal"); - defsymbol (&Qgtk_widget_property_internal, "gtk-widget-property-internal"); - defsymbol (&Qgtk_widget_redisplay_internal, "gtk-widget-redisplay-internal"); - defsymbol (&Qgtk_widget_set_style, "gtk-widget-set-style"); + DEFSYMBOL (Qgtk_widget_instantiate_internal); + DEFSYMBOL (Qgtk_widget_property_internal); + DEFSYMBOL (Qgtk_widget_redisplay_internal); + DEFSYMBOL (Qgtk_widget_set_style); #endif } diff -r c775bd016b32 -r 183866b06e0b src/glyphs-msw.c --- a/src/glyphs-msw.c Thu May 24 06:30:21 2001 +0000 +++ b/src/glyphs-msw.c Thu May 24 07:51:33 2001 +0000 @@ -94,7 +94,6 @@ static COLORREF transparent_color = RGB (1,1,1); DEFINE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource); -Lisp_Object Q_resource_type, Q_resource_id; Lisp_Object Qmswindows_resource; static void @@ -367,7 +366,7 @@ 0, 0); if (!bitmap || !bmp_buf) - signal_simple_error ("Unable to create bitmap", instantiator); + signal_image_error ("Unable to create bitmap", instantiator); /* copy in the actual bitmap */ memcpy (bmp_buf, bmp_data, bmp_bits); @@ -419,7 +418,7 @@ 0,0); if (!bitmap || !bmp_buf) - signal_simple_error ("Unable to create bitmap", instantiator); + signal_image_error ("Unable to create bitmap", instantiator); /* copy in the actual bitmap */ memcpy (bmp_buf, bmp_data, bmp_bits); @@ -456,8 +455,8 @@ eimage + (width * height * 3 * slice), &bmp_bits, &bmp_data))) { - signal_simple_error ("EImage to DIBitmap conversion failed", - instantiator); + signal_image_error ("EImage to DIBitmap conversion failed", + instantiator); } /* Now create the pixmap and set up the image instance */ @@ -816,18 +815,18 @@ break; case XpmFileInvalid: { - signal_simple_error ("Invalid XPM data", image); + signal_image_error ("Invalid XPM data", image); } case XpmNoMemory: { - signal_double_file_error ("Parsing pixmap data", - "out of memory", image); + signal_double_image_error ("Parsing pixmap data", + "out of memory", image); } default: { - signal_double_file_error_2 ("Parsing pixmap data", - "unknown error", - make_int (result), image); + signal_double_image_error_2 ("Parsing pixmap data", + "unknown error", + make_int (result), image); } } @@ -972,8 +971,8 @@ if (!xpm_to_eimage (image_instance, bytes, &eimage, &width, &height, &x_hot, &y_hot, &transp, color_symbols, nsymbols)) { - signal_simple_error ("XPM to EImage conversion failed", - image_instance); + signal_image_error ("XPM to EImage conversion failed", + image_instance); } if (color_symbols) @@ -989,8 +988,8 @@ if (!(bmp_info=convert_EImage_to_DIBitmap (device, width, height, eimage, &bmp_bits, &bmp_data))) { - signal_simple_error ("XPM to EImage conversion failed", - image_instance); + signal_image_error ("XPM to EImage conversion failed", + image_instance); } xfree (eimage); @@ -1073,49 +1072,15 @@ static void mswindows_resource_validate (Lisp_Object instantiator) { - if ((NILP (find_keyword_in_vector (instantiator, Q_file)) - && - NILP (find_keyword_in_vector (instantiator, Q_resource_id))) - || - NILP (find_keyword_in_vector (instantiator, Q_resource_type))) - signal_simple_error ("Must supply :file, :resource-id and :resource-type", - instantiator); + shared_resource_validate (instantiator); } static Lisp_Object mswindows_resource_normalize (Lisp_Object inst, Lisp_Object console_type, Lisp_Object dest_mask) { - /* This function can call lisp */ - Lisp_Object file = Qnil; - struct gcpro gcpro1, gcpro2; - Lisp_Object alist = Qnil; - - GCPRO2 (file, alist); - - file = potential_pixmap_file_instantiator (inst, Q_file, Q_data, - console_type); - - if (CONSP (file)) /* failure locating filename */ - signal_double_file_error ("Opening pixmap file", - "no such file or directory", - Fcar (file)); - - if (NILP (file)) /* no conversion necessary */ - RETURN_UNGCPRO (inst); - - alist = tagged_vector_to_alist (inst); - - { - alist = remassq_no_quit (Q_file, alist); - alist = Fcons (Fcons (Q_file, file), alist); - } - - { - Lisp_Object result = alist_to_tagged_vector (Qmswindows_resource, alist); - free_alist (alist); - RETURN_UNGCPRO (result); - } + return shared_resource_normalize (inst, console_type, dest_mask, + Qmswindows_resource); } static int @@ -1218,7 +1183,7 @@ } else if (!STRINGP (name)) { - signal_simple_error ("invalid resource identifier", name); + invalid_argument ("invalid resource identifier", name); } do { @@ -1311,7 +1276,7 @@ } else if (!(resid = MAKEINTRESOURCE (resource_name_to_resource (resource_id, type)))) - signal_simple_error ("Invalid resource identifier", resource_id); + invalid_argument ("Invalid resource identifier", resource_id); /* load the image */ if (xLoadImageA) /* not in NT 3.5 */ @@ -1320,7 +1285,7 @@ LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_SHARED | (!NILP (file) ? LR_LOADFROMFILE : 0)))) - signal_simple_error ("Cannot load image", instantiator); + signal_image_error ("Cannot load image", instantiator); } else { @@ -1339,7 +1304,7 @@ } if (!himage) - signal_simple_error ("Cannot load image", instantiator); + signal_image_error ("Cannot load image", instantiator); } if (hinst) @@ -1381,7 +1346,7 @@ { CHECK_SYMBOL (data); if (!resource_symbol_to_type (data)) - signal_simple_error ("invalid resource type", data); + invalid_constant ("invalid resource type", data); } static void @@ -1392,7 +1357,7 @@ !resource_name_to_resource (data, IMAGE_ICON) && !resource_name_to_resource (data, IMAGE_BITMAP)) - signal_simple_error ("invalid resource identifier", data); + invalid_constant ("invalid resource identifier", data); } /********************************************************************** @@ -2028,7 +1993,7 @@ } if (emsg) - signal_simple_error_2 (emsg, data, Qimage); + signal_image_error_2 (emsg, data, Qimage); bp = bits = (char *) alloca (PIXELS / 8); @@ -2408,8 +2373,8 @@ NULL, /* No menu */ NULL, /* must be null for this class */ NULL)) == NULL) - signal_simple_error ("window creation failed with code", - make_int (GetLastError())); + gui_error ("window creation failed with code", + make_int (GetLastError())); wnd = CreateWindow( "STATIC", "", @@ -2547,8 +2512,8 @@ (HMENU)id, /* No menu */ NULL, /* must be null for this class */ NULL)) == NULL) - signal_simple_error ("window creation failed with code", - make_int (GetLastError())); + gui_error ("window creation failed with code", + make_int (GetLastError())); if ((wnd = CreateWindowEx( exflags /* | WS_EX_NOPARENTNOTIFY*/, @@ -2567,8 +2532,8 @@ (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), GWL_HINSTANCE), NULL)) == NULL) - signal_simple_error ("window creation failed with code", - make_int (GetLastError())); + gui_error ("window creation failed with code", + make_int (GetLastError())); IMAGE_INSTANCE_SUBWINDOW_ID (ii) = wnd; SetWindowLong (wnd, GWL_USERDATA, (LONG)LISP_TO_VOID(image_instance)); @@ -2779,7 +2744,7 @@ if ((ret = (HTREEITEM)SendMessage (wnd, TVM_INSERTITEM, 0, (LPARAM)&tvitem)) == 0) - signal_simple_error ("error adding tree view entry", item); + gui_error ("error adding tree view entry", item); return ret; } @@ -2902,7 +2867,7 @@ if ((ret = SendMessage (wnd, TCM_INSERTITEM, i, (LPARAM)&tvitem)) < 0) - signal_simple_error ("error adding tab entry", item); + gui_error ("error adding tab entry", item); return ret; } @@ -3103,7 +3068,7 @@ C_STRING_ALLOCA, lparam, Qnative); if (SendMessage (wnd, CB_ADDSTRING, 0, (LPARAM)lparam) == CB_ERR) - signal_simple_error ("error adding combo entries", instantiator); + gui_error ("error adding combo entries", instantiator); } } @@ -3214,8 +3179,6 @@ void syms_of_glyphs_mswindows (void) { - defkeyword (&Q_resource_id, ":resource-id"); - defkeyword (&Q_resource_type, ":resource-type"); } void diff -r c775bd016b32 -r 183866b06e0b src/glyphs-shared.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/glyphs-shared.c Thu May 24 07:51:33 2001 +0000 @@ -0,0 +1,103 @@ +/* mswindows-specific glyph objects. + Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1995 Board of Trustees, University of Illinois. + Copyright (C) 1995 Tinker Systems + Copyright (C) 1995, 1996 Ben Wing + Copyright (C) 1995 Sun Microsystems + Copyright (C) 1998, 1999, 2000 Andy Piper. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* taken from glyphs-*.c + HINT HINT HINT Bill Perry: Please put code here and avoid massive + duplication in *-gtk.c!!! */ + +#include +#include "lisp.h" +#include "lstream.h" + +#include "window.h" +#include "elhash.h" +#include "buffer.h" +#include "frame.h" +#include "insdel.h" +#include "opaque.h" +#include "sysdep.h" +#include "sysfile.h" +#include "faces.h" +#include "imgproc.h" + +Lisp_Object Q_resource_type, Q_resource_id; + +void +shared_resource_validate (Lisp_Object instantiator) +{ + if ((NILP (find_keyword_in_vector (instantiator, Q_file)) + && + NILP (find_keyword_in_vector (instantiator, Q_resource_id))) + || + NILP (find_keyword_in_vector (instantiator, Q_resource_type))) + sferror ("Must supply :file, :resource-id and :resource-type", + instantiator); +} + + +Lisp_Object +shared_resource_normalize (Lisp_Object inst, Lisp_Object console_type, + Lisp_Object dest_mask, Lisp_Object tag) +{ + /* This function can call lisp */ + Lisp_Object file = Qnil; + struct gcpro gcpro1, gcpro2; + Lisp_Object alist = Qnil; + + GCPRO2 (file, alist); + + file = potential_pixmap_file_instantiator (inst, Q_file, Q_data, + console_type); + + if (CONSP (file)) /* failure locating filename */ + signal_double_image_error ("Opening pixmap file", + "no such file or directory", + Fcar (file)); + + if (NILP (file)) /* no conversion necessary */ + RETURN_UNGCPRO (inst); + + alist = tagged_vector_to_alist (inst); + + { + alist = remassq_no_quit (Q_file, alist); + alist = Fcons (Fcons (Q_file, file), alist); + } + + { + Lisp_Object result = alist_to_tagged_vector (tag, alist); + free_alist (alist); + RETURN_UNGCPRO (result); + } +} + +void +syms_of_glyphs_shared (void) +{ + DEFKEYWORD (Q_resource_id); + DEFKEYWORD (Q_resource_type); +} diff -r c775bd016b32 -r 183866b06e0b src/glyphs-widget.c --- a/src/glyphs-widget.c Thu May 24 06:30:21 2001 +0000 +++ b/src/glyphs-widget.c Thu May 24 07:51:33 2001 +0000 @@ -99,7 +99,7 @@ if (!EQ (data, Qhorizontal) && !EQ (data, Qvertical)) - invalid_argument ("unknown orientation for layout", data); + invalid_constant ("unknown orientation for layout", data); } static void @@ -112,14 +112,14 @@ !EQ (data, Qleft) && !EQ (data, Qright)) - invalid_argument ("unknown orientation for tab control", data); + invalid_constant ("unknown orientation for tab control", data); } static void check_valid_justification (Lisp_Object data) { if (!EQ (data, Qleft) && !EQ (data, Qright) && !EQ (data, Qcenter)) - invalid_argument ("unknown justification for layout", data); + invalid_constant ("unknown justification for layout", data); } static void @@ -539,18 +539,18 @@ Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor); if (NILP (desc)) - syntax_error ("Must supply :descriptor", instantiator); + invalid_argument ("Must supply :descriptor", instantiator); if (VECTORP (desc)) gui_parse_item_keywords (desc); if (!NILP (find_keyword_in_vector (instantiator, Q_width)) && !NILP (find_keyword_in_vector (instantiator, Q_pixel_width))) - syntax_error ("Must supply only one of :width and :pixel-width", instantiator); + invalid_argument ("Must supply only one of :width and :pixel-width", instantiator); if (!NILP (find_keyword_in_vector (instantiator, Q_height)) && !NILP (find_keyword_in_vector (instantiator, Q_pixel_height))) - syntax_error ("Must supply only one of :height and :pixel-height", instantiator); + invalid_argument ("Must supply only one of :height and :pixel-height", instantiator); } static void @@ -558,7 +558,7 @@ { widget_validate (instantiator); if (NILP (find_keyword_in_vector (instantiator, Q_items))) - syntax_error ("Must supply item list", instantiator); + invalid_argument ("Must supply item list", instantiator); } /* we need to convert things like glyphs to images, eval expressions diff -r c775bd016b32 -r 183866b06e0b src/glyphs-x.c --- a/src/glyphs-x.c Thu May 24 06:30:21 2001 +0000 +++ b/src/glyphs-x.c Thu May 24 07:51:33 2001 +0000 @@ -680,7 +680,7 @@ errno = old_errno; } report_file_error ("Creating temp file", - list1 (build_string (filename_out))); + build_string (filename_out)); } CHECK_STRING (string); @@ -741,7 +741,7 @@ if (fubar) report_file_error ("Writing temp file", - list1 (build_string (filename_out))); + build_string (filename_out)); } #endif /* 0 */ @@ -763,13 +763,13 @@ width, height, &best_width, &best_height)) /* this means that an X error of some sort occurred (we trap these so they're not fatal). */ - signal_simple_error ("XQueryBestCursor() failed?", instantiator); + gui_error ("XQueryBestCursor() failed?", instantiator); if (width > best_width || height > best_height) - error_with_frob (instantiator, - "pointer too large (%dx%d): " - "server requires %dx%d or smaller", - width, height, best_width, best_height); + signal_ferror_with_frob (Qgui_error, instantiator, + "pointer too large (%dx%d): " + "server requires %dx%d or smaller", + width, height, best_width, best_height); } @@ -862,7 +862,7 @@ Pixmap pixmap; if (!DEVICE_X_P (XDEVICE (device))) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); dpy = DEVICE_X_DISPLAY (XDEVICE (device)); d = XtWindow(DEVICE_XT_APP_SHELL (XDEVICE (device))); @@ -874,13 +874,13 @@ pixmap = XCreatePixmap (dpy, d, ximage->width, ximage->height, ximage->depth); if (!pixmap) - signal_simple_error ("Unable to create pixmap", instantiator); + gui_error ("Unable to create pixmap", instantiator); gc = XCreateGC (dpy, pixmap, 0, NULL); if (!gc) { XFreePixmap (dpy, pixmap); - signal_simple_error ("Unable to create GC", instantiator); + gui_error ("Unable to create GC", instantiator); } XPutImage (dpy, pixmap, gc, ximage, 0, 0, 0, 0, @@ -923,13 +923,13 @@ pixmap = XCreatePixmap (dpy, d, ximage->width, ximage->height, ximage->depth); if (!pixmap) - signal_simple_error ("Unable to create pixmap", instantiator); + gui_error ("Unable to create pixmap", instantiator); gc = XCreateGC (dpy, pixmap, 0, NULL); if (!gc) { XFreePixmap (dpy, pixmap); - signal_simple_error ("Unable to create GC", instantiator); + gui_error ("Unable to create GC", instantiator); } XPutImage (dpy, pixmap, gc, ximage, 0, 0, 0, 0, @@ -1035,7 +1035,7 @@ enum image_instance_type type; if (!DEVICE_X_P (XDEVICE (device))) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); dpy = DEVICE_X_DISPLAY (XDEVICE (device)); draw = XtWindow(DEVICE_XT_APP_SHELL (XDEVICE (device))); @@ -1323,7 +1323,7 @@ unsigned int w, h; if (!DEVICE_X_P (XDEVICE (device))) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); dpy = DEVICE_X_DISPLAY (XDEVICE (device)); xs = DefaultScreenOfDisplay (dpy); @@ -1422,19 +1422,13 @@ if (force_mono) { /* second time; blow out. */ - signal_double_file_error ("Reading pixmap data", - "color allocation failed", - data); + gui_error ("XPM color allocation failed", data); } else { + /* second time; blow out. */ if (! (dest_mask & IMAGE_MONO_PIXMAP_MASK)) - { - /* second time; blow out. */ - signal_double_file_error ("Reading pixmap data", - "color allocation failed", - data); - } + gui_error ("XPM color allocation failed", data); force_mono = 1; IMAGE_INSTANCE_TYPE (ii) = IMAGE_MONO_PIXMAP; goto retry; @@ -1443,15 +1437,14 @@ case XpmNoMemory: { xpm_free (&xpmattrs); - signal_double_file_error ("Parsing pixmap data", - "out of memory", data); + out_of_memory ("Parsing pixmap data", data); } default: { xpm_free (&xpmattrs); - signal_double_file_error_2 ("Parsing pixmap data", - "unknown error code", - make_int (result), data); + signal_error_2 (Qgui_error, + "Parsing pixmap data: unknown error code", + make_int (result), data); } } @@ -1705,7 +1698,7 @@ } if (emsg) - signal_simple_error_2 (emsg, data, Qimage); + gui_error_2 (emsg, data, Qimage); bp = bits = (char *) alloca (PIXELS / 8); @@ -1948,13 +1941,13 @@ Lisp_Object foreground, background; if (!DEVICE_X_P (XDEVICE (device))) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); dpy = DEVICE_X_DISPLAY (XDEVICE (device)); if (!STRINGP (data) || strncmp ("FONT ", (char *) XSTRING_DATA (data), 5)) - signal_simple_error ("Invalid font-glyph instantiator", + invalid_argument ("Invalid font-glyph instantiator", instantiator); if (!(dest_mask & IMAGE_POINTER_MASK)) @@ -1978,12 +1971,11 @@ count = 4, mask_name[0] = 0; if (count != 2 && count != 4) - signal_simple_error ("invalid cursor specification", data); + syntax_error ("invalid cursor specification", data); source = safe_XLoadFont (dpy, source_name); if (! source) - signal_simple_error_2 ("couldn't load font", - build_string (source_name), - data); + signal_error_2 (Qgui_error, + "couldn't load font", build_string (source_name), data); if (count == 2) mask = 0; else if (!mask_name[0]) @@ -1992,9 +1984,9 @@ { mask = safe_XLoadFont (dpy, mask_name); if (!mask) - /* continuable */ - Fsignal (Qerror, list3 (build_string ("couldn't load font"), - build_string (mask_name), data)); + signal_continuable_error_2 (Qgui_error, + "couldn't load font", + build_string (mask_name), data); } if (!mask) mask_char = 0; @@ -2043,7 +2035,7 @@ Lisp_Object foreground, background; if (!DEVICE_X_P (XDEVICE (device))) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); dpy = DEVICE_X_DISPLAY (XDEVICE (device)); @@ -2052,7 +2044,7 @@ LISP_STRING_TO_EXTERNAL (data, name_ext, Qfile_name); if ((i = XmuCursorNameToIndex (name_ext)) == -1) - signal_simple_error ("Unrecognized cursor-font name", data); + invalid_argument ("Unrecognized cursor-font name", data); x_initialize_pixmap_image_instance (ii, 1, IMAGE_POINTER); IMAGE_INSTANCE_X_CURSOR (ii) = XCreateFontCursor (dpy, i); @@ -2265,7 +2257,8 @@ { Lisp_Object sw; XSETIMAGE_INSTANCE (sw, p); - signal_simple_error ("XEmacs bug: subwindow is deleted", sw); + signal_error (Qinternal_error, + "XEmacs bug: subwindow is deleted", sw); } lw_add_widget_value_arg (wv, XtNwidth, @@ -2311,7 +2304,7 @@ h = IMAGE_INSTANCE_HEIGHT (ii); if (!DEVICE_X_P (XDEVICE (device))) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); dpy = DEVICE_X_DISPLAY (XDEVICE (device)); xs = DefaultScreenOfDisplay (dpy); @@ -2472,7 +2465,7 @@ XColor fcolor, bcolor; if (!DEVICE_X_P (d)) - signal_simple_error ("Not an X device", device); + gui_error ("Not an X device", device); /* have to set the type this late in case there is no device instantiation for a widget. But we can go ahead and do it without diff -r c775bd016b32 -r 183866b06e0b src/glyphs.c --- a/src/glyphs.c Thu May 24 06:30:21 2001 +0000 +++ b/src/glyphs.c Thu May 24 07:51:33 2001 +0000 @@ -183,7 +183,7 @@ } } - maybe_signal_simple_error ("Invalid image-instantiator format", format, + maybe_invalid_argument ("Invalid image-instantiator format", format, Qimage, errb); return 0; @@ -315,7 +315,7 @@ (!NILP (XCDR (XCDR (mapping))) && (!CONSP (XCDR (XCDR (mapping))) || !NILP (XCDR (XCDR (XCDR (mapping))))))) - signal_simple_error ("Invalid mapping form", mapping); + invalid_argument ("Invalid mapping form", mapping); else { Lisp_Object exp = XCAR (mapping); @@ -400,7 +400,7 @@ } /* Oh well. */ - signal_simple_error ("Unable to interpret glyph instantiator", + invalid_argument ("Unable to interpret glyph instantiator", data); return Qnil; @@ -484,7 +484,7 @@ CHECK_VECTOR (instantiator); if (!KEYWORDP (keyword)) - signal_simple_error ("instantiator property must be a keyword", keyword); + invalid_argument ("instantiator property must be a keyword", keyword); elt = XVECTOR_DATA (instantiator); len = XVECTOR_LENGTH (instantiator); @@ -544,7 +544,7 @@ { if (NILP (find_keyword_in_vector (instantiator, Q_file)) && NILP (find_keyword_in_vector (instantiator, Q_data))) - signal_simple_error ("Must supply either :file or :data", + sferror ("Must supply either :file or :data", instantiator); } @@ -552,14 +552,14 @@ data_must_be_present (Lisp_Object instantiator) { if (NILP (find_keyword_in_vector (instantiator, Q_data))) - signal_simple_error ("Must supply :data", instantiator); + sferror ("Must supply :data", instantiator); } static void face_must_be_present (Lisp_Object instantiator) { if (NILP (find_keyword_in_vector (instantiator, Q_face))) - signal_simple_error ("Must supply :face", instantiator); + sferror ("Must supply :face", instantiator); } /* utility function useful in retrieving data from a file. */ @@ -696,11 +696,12 @@ if (governing_domain == GOVERNING_DOMAIN_WINDOW && NILP (DOMAIN_WINDOW (domain))) - signal_simple_error_2 ("Domain for this instantiator must be resolvable to a window", - instantiator, domain); + invalid_argument_2 + ("Domain for this instantiator must be resolvable to a window", + instantiator, domain); else if (governing_domain == GOVERNING_DOMAIN_FRAME && NILP (DOMAIN_FRAME (domain))) - signal_simple_error_2 + invalid_argument_2 ("Domain for this instantiator must be resolvable to a frame", instantiator, domain); @@ -767,7 +768,7 @@ GCPRO1 (ii); if (!valid_image_instantiator_format_p (INSTANTIATOR_TYPE (instantiator), DOMAIN_DEVICE (governing_domain))) - signal_simple_error + invalid_argument ("Image instantiator format is invalid in this locale.", instantiator); @@ -783,7 +784,7 @@ if (!HAS_IIFORMAT_METH_P (meths, instantiate) && (!device_meths || !HAS_IIFORMAT_METH_P (device_meths, instantiate))) - signal_simple_error + invalid_argument ("Don't know how to instantiate this image instantiator?", instantiator); @@ -905,7 +906,7 @@ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (obj); if (print_readably) - error ("printing unreadable object #", + printing_unreadable_object ("#", ii->header.uid); write_c_string ("# XSTRING_CHAR_LENGTH (bits)) - signal_simple_error ("data is too short for width and height", + invalid_argument ("data is too short for width and height", vector3 (width, height, bits)); } @@ -2592,29 +2611,29 @@ case BitmapOpenFailed: { /* should never happen */ - signal_double_file_error ("Opening bitmap file", - "no such file or directory", - name); + signal_double_image_error ("Opening bitmap file", + "no such file or directory", + name); } case BitmapFileInvalid: { if (ok_if_data_invalid) return Qt; - signal_double_file_error ("Reading bitmap file", - "invalid data in file", - name); + signal_double_image_error ("Reading bitmap file", + "invalid data in file", + name); } case BitmapNoMemory: { - signal_double_file_error ("Reading bitmap file", - "out of memory", - name); + signal_double_image_error ("Reading bitmap file", + "out of memory", + name); } default: { - signal_double_file_error_2 ("Reading bitmap file", - "unknown error code", - make_int (result), name); + signal_double_image_error_2 ("Reading bitmap file", + "unknown error code", + make_int (result), name); } } @@ -2682,9 +2701,9 @@ Q_mask_data, console_type); if (CONSP (file)) /* failure locating filename */ - signal_double_file_error ("Opening bitmap file", - "no such file or directory", - Fcar (file)); + signal_double_image_error ("Opening bitmap file", + "no such file or directory", + Fcar (file)); if (NILP (file) && NILP (mask_file)) /* no conversion necessary */ RETURN_UNGCPRO (inst); @@ -2767,9 +2786,9 @@ Q_mask_data, console_type); if (CONSP (file)) /* failure locating filename */ - signal_double_file_error ("Opening bitmap file", - "no such file or directory", - Fcar (file)); + signal_double_image_error ("Opening bitmap file", + "no such file or directory", + Fcar (file)); if (NILP (file) && NILP (mask_file)) /* no conversion necessary */ RETURN_UNGCPRO (inst); @@ -2880,20 +2899,20 @@ } case XpmNoMemory: { - signal_double_file_error ("Reading pixmap file", - "out of memory", name); + signal_double_image_error ("Reading pixmap file", + "out of memory", name); } case XpmOpenFailed: { /* should never happen? */ - signal_double_file_error ("Opening pixmap file", - "no such file or directory", name); + signal_double_image_error ("Opening pixmap file", + "no such file or directory", name); } default: { - signal_double_file_error_2 ("Parsing pixmap file", - "unknown error code", - make_int (result), name); + signal_double_image_error_2 ("Parsing pixmap file", + "unknown error code", + make_int (result), name); break; } } @@ -2914,7 +2933,7 @@ !STRINGP (XCAR (XCAR (rest))) || (!STRINGP (XCDR (XCAR (rest))) && !COLOR_SPECIFIERP (XCDR (XCAR (rest))))) - signal_simple_error ("Invalid color symbol alist", data); + sferror ("Invalid color symbol alist", data); } } @@ -2949,7 +2968,7 @@ if (NILP (value)) continue; if (!STRINGP (value) && !COLOR_SPECIFIERP (value)) - signal_simple_error + invalid_argument ("Result from xpm-color-symbols eval must be nil, string, or color", value); results = Fcons (Fcons (name, value), results); @@ -2981,9 +3000,9 @@ console_type); if (CONSP (file)) /* failure locating filename */ - signal_double_file_error ("Opening pixmap file", - "no such file or directory", - Fcar (file)); + signal_double_image_error ("Opening pixmap file", + "no such file or directory", + Fcar (file)); color_symbols = find_keyword_in_vector_or_given (inst, Q_color_symbols, Qunbound); @@ -3140,11 +3159,11 @@ if (mask & dest_mask) return instantiator; else - signal_simple_error ("Type of image instance not allowed here", + invalid_argument ("Type of image instance not allowed here", instantiator); } else - signal_simple_error_2 ("Wrong domain for image instance", + invalid_argument_2 ("Wrong domain for image instance", instantiator, domain); } /* How ugly !! An image instanciator that uses a kludgy syntax to snarf in @@ -3284,8 +3303,7 @@ #endif } else if (NILP (instance)) - signal_simple_error ("Can't instantiate image (probably cached)", - instantiator); + gui_error ("Can't instantiate image (probably cached)", instantiator); /* We found an instance. However, because we are using the glyph as the hash key instead of the instantiator, the current instantiator may not be the same as the original. Thus we @@ -3335,12 +3353,12 @@ int i; if (instantiator_len < 1) - signal_simple_error ("Vector length must be at least 1", + sferror ("Vector length must be at least 1", instantiator); meths = decode_image_instantiator_format (elt[0], ERROR_ME); if (!(instantiator_len & 1)) - signal_simple_error + sferror ("Must have alternating keyword/value pairs", instantiator); GCPRO1 (already_seen); @@ -3353,19 +3371,19 @@ CHECK_SYMBOL (keyword); if (!SYMBOL_IS_KEYWORD (keyword)) - signal_simple_error ("Symbol must begin with a colon", keyword); + invalid_argument ("Symbol must begin with a colon", keyword); for (j = 0; j < Dynarr_length (meths->keywords); j++) if (EQ (keyword, Dynarr_at (meths->keywords, j).keyword)) break; if (j == Dynarr_length (meths->keywords)) - signal_simple_error ("Unrecognized keyword", keyword); + invalid_argument ("Unrecognized keyword", keyword); if (!Dynarr_at (meths->keywords, j).multiple_p) { if (!NILP (memq_no_quit (keyword, already_seen))) - signal_simple_error + sferror ("Keyword may not appear more than once", keyword); already_seen = Fcons (keyword, already_seen); } @@ -3378,7 +3396,7 @@ MAYBE_IIFORMAT_METH (meths, validate, (instantiator)); } else - signal_simple_error ("Must be string or vector", instantiator); + invalid_argument ("Must be string or vector", instantiator); } static void @@ -3561,7 +3579,7 @@ char buf[20]; if (print_readably) - error ("printing unreadable object #", glyph->header.uid); + printing_unreadable_object ("#", glyph->header.uid); write_c_string ("#filter)) - syntax_error (":filter keyword not permitted on leaf nodes", gui_item); + sferror (":filter keyword not permitted on leaf nodes", gui_item); #ifdef HAVE_MENUBARS if (menu_entry_p && !gui_item_included_p (gui_item, Vmenubar_configuration)) @@ -533,13 +533,13 @@ #endif } else - syntax_error_2 ("Unknown style", pgui->style, gui_item); + invalid_constant_2 ("Unknown style", pgui->style, gui_item); if (!allow_text_field_p && (wv->type == TEXT_TYPE)) - syntax_error ("Text field not allowed in this context", gui_item); + sferror ("Text field not allowed in this context", gui_item); if (!NILP (pgui->selected) && EQ (pgui->style, Qtext)) - syntax_error + sferror (":selected only makes sense with :style toggle, radio or button", gui_item); return 1; @@ -584,7 +584,7 @@ { /* first one is the parent */ if (CONSP (XCAR (items))) - syntax_error ("parent item must not be a list", XCAR (items)); + sferror ("parent item must not be a list", XCAR (items)); if (parent) wv = gui_items_to_widget_values_1 (gui_object_instance, @@ -631,7 +631,7 @@ Lisp_Object wv_closure; if (NILP (items)) - syntax_error ("must have some items", items); + sferror ("must have some items", items); /* Inhibit GC during this conversion. The reasons for this are the same as in menu_item_descriptor_to_widget_value(); see diff -r c775bd016b32 -r 183866b06e0b src/gui.c --- a/src/gui.c Thu May 24 06:30:21 2001 +0000 +++ b/src/gui.c Thu May 24 07:51:33 2001 +0000 @@ -39,6 +39,8 @@ static Lisp_Object parse_gui_item_tree_list (Lisp_Object list); Lisp_Object find_keyword_in_vector (Lisp_Object vector, Lisp_Object keyword); +Lisp_Object Qgui_error; + #ifdef HAVE_POPUPS /* count of menus/dboxes currently up */ @@ -121,7 +123,7 @@ int retval = 0; if (!KEYWORDP (key)) - syntax_error_2 ("Non-keyword in gui item", key, pgui_item->name); + sferror_2 ("Non-keyword in gui item", key, pgui_item->name); if (EQ (key, Q_descriptor)) { @@ -162,11 +164,11 @@ if (SYMBOLP (val) || CHARP (val)) pgui_item->accelerator = val; else if (ERRB_EQ (errb, ERROR_ME)) - syntax_error ("Bad keyboard accelerator", val); + invalid_argument ("Bad keyboard accelerator", val); } } else if (ERRB_EQ (errb, ERROR_ME)) - syntax_error_2 ("Unknown keyword in gui item", key, + invalid_argument_2 ("Unknown keyword in gui item", key, pgui_item->name); return retval; } @@ -224,7 +226,7 @@ contents = XVECTOR_DATA (item); if (length < 1) - syntax_error ("GUI item descriptors must be at least 1 elts long", item); + sferror ("GUI item descriptors must be at least 1 elts long", item); /* length 1: [ "name" ] length 2: [ "name" callback ] @@ -259,7 +261,7 @@ { int i; if ((length - start) & 1) - syntax_error ( + sferror ( "GUI item descriptor has an odd number of keywords and values", item); @@ -287,12 +289,12 @@ contents = XVECTOR_DATA (item); if (!NILP (desc) && !STRINGP (desc) && !VECTORP (desc)) - syntax_error ("Invalid GUI item descriptor", item); + sferror ("Invalid GUI item descriptor", item); if (length & 1) { if (!SYMBOLP (contents [0])) - syntax_error ("Invalid GUI item descriptor", item); + sferror ("Invalid GUI item descriptor", item); contents++; /* Ignore the leading symbol. */ length--; } @@ -321,7 +323,7 @@ if (length & 1) { if (!SYMBOLP (contents [0])) - syntax_error ("Invalid GUI item descriptor", item); + sferror ("Invalid GUI item descriptor", item); contents++; /* Ignore the leading symbol. */ length--; } @@ -486,7 +488,7 @@ static DOESNT_RETURN signal_too_long_error (Lisp_Object name) { - syntax_error ("GUI item produces too long displayable string", name); + invalid_argument ("GUI item produces too long displayable string", name); } #ifdef HAVE_WINDOW_SYSTEM @@ -699,7 +701,7 @@ char buf[20]; if (print_readably) - error ("printing unreadable object #", g->header.uid); + printing_unreadable_object ("#", g->header.uid); write_c_string ("#", g->header.uid); @@ -771,7 +773,7 @@ CHECK_STRING (entry); } else - syntax_error ("item must be a vector or a string", entry); + sferror ("item must be a vector or a string", entry); RETURN_UNGCPRO (ret); } @@ -823,6 +825,13 @@ 0, Lisp_Gui_Item); + +DOESNT_RETURN +gui_error (const char *reason, Lisp_Object frob) +{ + signal_error (Qgui_error, reason, frob); +} + void syms_of_gui (void) { @@ -830,6 +839,8 @@ DEFSYMBOL (Qmenu_no_selection_hook); + DEFERROR_STANDARD (Qgui_error, Qio_error); + #ifdef HAVE_POPUPS DEFSUBR (Fpopup_up_p); #endif diff -r c775bd016b32 -r 183866b06e0b src/gutter.c --- a/src/gutter.c Thu May 24 06:30:21 2001 +0000 +++ b/src/gutter.c Thu May 24 07:51:33 2001 +0000 @@ -725,7 +725,7 @@ if (EQ (position, Qbottom)) return BOTTOM_GUTTER; if (EQ (position, Qleft)) return LEFT_GUTTER; if (EQ (position, Qright)) return RIGHT_GUTTER; - signal_simple_error ("Invalid gutter position", position); + invalid_constant ("Invalid gutter position", position); return TOP_GUTTER; /* not reached */ } @@ -838,7 +838,7 @@ /* Must be a string or a plist. */ if (!STRINGP (instantiator) && NILP (Fvalid_plist_p (instantiator))) - signal_simple_error ("Gutter spec must be string, plist or nil", instantiator); + sferror ("Gutter spec must be string, plist or nil", instantiator); if (!STRINGP (instantiator)) { @@ -848,7 +848,7 @@ { if (!SYMBOLP (XCAR (rest)) || !STRINGP (XCAR (XCDR (rest)))) - signal_simple_error ("Gutter plist spec must contain strings", instantiator); + sferror ("Gutter plist spec must contain strings", instantiator); } } } @@ -987,7 +987,7 @@ return; if (!INTP (instantiator) && !EQ (instantiator, Qautodetect)) - signal_simple_error ("Gutter size must be an integer or 'autodetect", instantiator); + invalid_argument ("Gutter size must be an integer or 'autodetect", instantiator); } DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /* @@ -1012,7 +1012,7 @@ return; if (!NILP (instantiator) && !EQ (instantiator, Qt) && !CONSP (instantiator)) - signal_simple_error ("Gutter visibility must be a boolean or list of symbols", + invalid_argument ("Gutter visibility must be a boolean or list of symbols", instantiator); if (CONSP (instantiator)) @@ -1022,7 +1022,7 @@ EXTERNAL_LIST_LOOP (rest, instantiator) { if (!SYMBOLP (XCAR (rest))) - signal_simple_error ("Gutter visibility must be a boolean or list of symbols", + invalid_argument ("Gutter visibility must be a boolean or list of symbols", instantiator); } } @@ -1136,10 +1136,9 @@ DEFSUBR (Fgutter_pixel_width); DEFSUBR (Fredisplay_gutter_area); - defsymbol (&Qgutter_size, "gutter-size"); - defsymbol (&Qgutter_visible, "gutter-visible"); - defsymbol (&Qdefault_gutter_position_changed_hook, - "default-gutter-position-changed-hook"); + DEFSYMBOL (Qgutter_size); + DEFSYMBOL (Qgutter_visible); + DEFSYMBOL (Qdefault_gutter_position_changed_hook); } void diff -r c775bd016b32 -r 183866b06e0b src/hpplay.c --- a/src/hpplay.c Thu May 24 06:30:21 2001 +0000 +++ b/src/hpplay.c Thu May 24 07:51:33 2001 +0000 @@ -19,6 +19,8 @@ /* Synched up with: Not in FSF. */ +/* This file Mule-ized by Ben Wing, 5-15-01. */ + /*** NAME @@ -51,10 +53,8 @@ #include #include "lisp.h" -#include "nativesound.h" +#include "sound.h" -#include -#include #ifdef HPUX10 #include #include @@ -71,22 +71,20 @@ /* Functions */ /* error handling */ -void player_error_internal( - Audio * audio, - char * text, - long errorCode - ) +void +player_error_internal (Audio * audio, Char_ASCII * text, long errorCode) { - char errorbuff[132],buf[256]; + Extbyte errorbuff[132]; + Bufbyte *interr; - AGetErrorText(audio, errorCode, errorbuff, 131); - sprintf(buf,"%s: %s\n",text,errorbuff); - error(buf); + AGetErrorText (audio, errorCode, errorbuff, 131); + EXTERNAL_TO_C_STRING (errorbuf, interr, Qnative); + + signal_error (Qsound_error, text, build_string (interr)); } -long myHandler(audio, err_event) - Audio * audio; - AErrorEvent * err_event; +long +myHandler( Audio * audio, AErrorEvent * err_event) { player_error_internal(audio, "Internal sound error", err_event->error_code); return 1; /* Must return something, was orig. an exit */ @@ -94,177 +92,154 @@ /* Playing */ void -play_bucket_internal(audio, pSBucket, volume) - Audio *audio; - SBucket *pSBucket; - long volume; +play_bucket_internal( Audio *audio, SBucket *pSBucket, long volume) { - SBPlayParams playParams; - AGainEntry gainEntry; - ATransID xid; - long status; - char * speaker; + SBPlayParams playParams; + AGainEntry gainEntry; + ATransID xid; + long status; + + playParams.priority = APriorityNormal; /* normal priority */ - playParams.priority = APriorityNormal; /* normal priority */ - - /* - * We can't signal an error, because all h*ll would break loose if - * we did. - */ - if (SYMBOLP (Vhp_play_speaker)) - { - speaker = (char *) (string_data (XSYMBOL (Vhp_play_speaker)->name)); - - /* - * setup the playback parameters - */ + /* + * We can't signal an error, because all h*ll would break loose if + * we did. + */ + if (EQ (Vhp_play_speaker, Qexternal)) + gainEntry.u.o.out_dst = AODTMonoJack; + else + gainEntry.u.o.out_dst = AODTMonoIntSpeaker; - /* speaker selection */ - if ( strcmp(speaker,"external") == 0 ) { - gainEntry.u.o.out_dst = AODTMonoJack; - } else { - gainEntry.u.o.out_dst = AODTMonoIntSpeaker; - } - } - else - { - /* - * Quietly revert to the internal speaker - */ - gainEntry.u.o.out_dst = AODTMonoIntSpeaker; - } + gainEntry.u.o.out_ch = AOCTMono; + gainEntry.gain = AUnityGain; + playParams.gain_matrix.type = AGMTOutput; /* gain matrix */ + playParams.gain_matrix.num_entries = 1; + playParams.gain_matrix.gain_entries = &gainEntry; + playParams.play_volume = hp_play_gain; /* play volume */ + playParams.pause_first = False; /* don't pause */ + playParams.start_offset.type = ATTSamples; /* start offset 0 */ + playParams.start_offset.u.samples = 0; + playParams.duration.type = ATTFullLength; /* play entire sample */ + playParams.loop_count = 1; /* play sample just once */ + playParams.previous_transaction = 0; /* no linked transaction */ + playParams.event_mask = 0; /* don't solicit any events */ - gainEntry.u.o.out_ch = AOCTMono; - gainEntry.gain = AUnityGain; - playParams.gain_matrix.type = AGMTOutput; /* gain matrix */ - playParams.gain_matrix.num_entries = 1; - playParams.gain_matrix.gain_entries = &gainEntry; - playParams.play_volume = hp_play_gain; /* play volume */ - playParams.pause_first = False; /* don't pause */ - playParams.start_offset.type = ATTSamples; /* start offset 0 */ - playParams.start_offset.u.samples = 0; - playParams.duration.type = ATTFullLength; /* play entire sample */ - playParams.loop_count = 1; /* play sample just once */ - playParams.previous_transaction = 0; /* no linked transaction */ - playParams.event_mask = 0; /* don't solicit any events */ + /* + * play the sound bucket + */ + xid = APlaySBucket( audio, pSBucket, &playParams, NULL ); - /* - * play the sound bucket - */ - xid = APlaySBucket( audio, pSBucket, &playParams, NULL ); + /* + * set close mode to prevent playback from stopping + * when we close audio connection + */ + ASetCloseDownMode( audio, AKeepTransactions, &status ); - /* - * set close mode to prevent playback from stopping - * when we close audio connection - */ - ASetCloseDownMode( audio, AKeepTransactions, &status ); - - /* - * That's all, folks! - * Always destroy bucket and close connection. - */ - ADestroySBucket( audio, pSBucket, &status ); - ACloseAudio( audio, &status ); + /* + * That's all, folks! + * Always destroy bucket and close connection. + */ + ADestroySBucket( audio, pSBucket, &status ); + ACloseAudio( audio, &status ); } void -play_sound_file (sound_file, volume) - char * sound_file; - int volume; +play_sound_file (Extbyte * sound_file, int volume) { - SBucket *pSBucket; - Audio *audio; - long status; - AErrorHandler prevHandler; /* pointer to previous handler */ - char *server; + sbucket *pSBucket; + Audio *audio; + long status; + AErrorHandler prevHandler; /* pointer to previous handler */ + Extbyte *server; - if (STRINGP(Vhp_play_server)) - server = (char *) XSTRING_DATA (Vhp_play_server); + if (STRINGP (Vhp_play_server)) + LISP_STRING_TO_EXTERNAL (Vhp_play_server, server, Qnative); + else server = ""; - /* - * open audio connection - */ - audio = AOpenAudio( server, &status ); - if( status ) { - player_error_internal( audio, "Open audio failed", status ); + /* + * open audio connection + */ + audio = AOpenAudio( server, &status ); + if( status ) + { + player_error_internal( audio, "Open audio failed", status ); } - /* replace default error handler */ - prevHandler = ASetErrorHandler(myHandler); + /* replace default error handler */ + prevHandler = ASetErrorHandler(myHandler); - /* - * Load the audio file into a sound bucket - */ + /* + * Load the audio file into a sound bucket + */ - pSBucket = ALoadAFile( audio, sound_file, AFFUnknown, 0, NULL, NULL ); + pSBucket = ALoadAFile( audio, sound_file, AFFUnknown, 0, NULL, NULL ); - /* - * Play the bucket - */ + /* + * Play the bucket + */ - play_bucket_internal(audio, pSBucket, volume); + play_bucket_internal(audio, pSBucket, volume); - ASetErrorHandler(prevHandler); + ASetErrorHandler(prevHandler); } int -play_sound_data (data, length, volume) - unsigned char * data; - int length; - int volume; +play_sound_data (UChar_Binary * data, int length, int volume) { - SBucket *pSBucket; - Audio *audio; - AErrorHandler prevHandler; - SunHeader *header; - long status; - char *server; - int result; + SBucket *pSBucket; + Audio *audio; + AErrorHandler prevHandler; + SunHeader *header; + long status; + Extbyte *server; + int result; - /* #### Finish this to return an error code. - This function signal a lisp error. How consistent with the rest. - What if this function is needed in doing the beep for the error? + /* #### Finish this to return an error code. + This function signal a lisp error. How consistent with the rest. + What if this function is needed in doing the beep for the error? - Apparently the author of this didn't read the comment in - Fplay_sound. - */ + Apparently the author of this didn't read the comment in + Fplay_sound. + */ - if (STRINGP (Vhp_play_server)) - server = (char *) XSTRING_DATA (Vhp_play_server); + if (STRINGP (Vhp_play_server)) + LISP_STRING_TO_EXTERNAL (Vhp_play_server, server, Qnative); + else server = ""; - /* open audio connection */ - audio = AOpenAudio( server, &status ); - if( status ) { - player_error_internal( audio, "Open audio failed", status ); + /* open audio connection */ + audio = AOpenAudio( server, &status ); + if(status) + { + player_error_internal( audio, "Open audio failed", status ); } - /* replace default error handler */ - prevHandler = ASetErrorHandler (myHandler); + /* replace default error handler */ + prevHandler = ASetErrorHandler (myHandler); - /* Create sound bucket */ - header = (SunHeader *) data; + /* Create sound bucket */ + header = (SunHeader *) data; - pSBucket = ACreateSBucket(audio, NULL, NULL, &status); - if (status) - player_error_internal( audio, "Bucket creation failed", status ); + pSBucket = ACreateSBucket(audio, NULL, NULL, &status); + if (status) + player_error_internal( audio, "Bucket creation failed", status ); - APutSBucketData(audio, pSBucket, 0, (char *) (data + header->header_size), header->data_length, &status); + APutSBucketData(audio, pSBucket, 0, (Char_Binary *) (data + header->header_size), header->data_length, &status); - if (status) - player_error_internal( audio, "Audio data copy failed", status ); + if (status) + player_error_internal( audio, "Audio data copy failed", status ); - /* Play sound */ - play_bucket_internal(audio, pSBucket, volume); + /* Play sound */ + play_bucket_internal(audio, pSBucket, volume); - ASetErrorHandler(prevHandler); - if (status) - player_error_internal( audio, "Audio data copy failed", status ); + ASetErrorHandler(prevHandler); + if (status) + player_error_internal( audio, "Audio data copy failed", status ); - return 1; + return 1; } void @@ -288,7 +263,7 @@ Vhp_play_speaker = intern ("internal"); - DEFVAR_INT("hp-play-gain", &hp_play_gain /* + DEFVAR_INT ("hp-play-gain", &hp_play_gain /* Global gain value for playing sounds. Default value is AUnityGain which means keep level. Please refer to the HP documentation, for instance in diff -r c775bd016b32 -r 183866b06e0b src/indent.c --- a/src/indent.c Thu May 24 06:30:21 2001 +0000 +++ b/src/indent.c Thu May 24 07:51:33 2001 +0000 @@ -311,7 +311,7 @@ if (last_visible >= BUF_BEGV (buf)) BUF_SET_PT (buf, last_visible); else - error ("Visible portion of buffer not modifiable"); + invalid_operation ("Visible portion of buffer not modifiable", Qunbound); } if (indent_tabs_mode) @@ -931,7 +931,7 @@ DEFSUBR (Fvertical_motion); DEFSUBR (Fvertical_motion_pixels); - defsymbol (&Qcoerce, "coerce"); + DEFSYMBOL (Qcoerce); } void diff -r c775bd016b32 -r 183866b06e0b src/input-method-xlib.c --- a/src/input-method-xlib.c Thu May 24 06:30:21 2001 +0000 +++ b/src/input-method-xlib.c Thu May 24 07:51:33 2001 +0000 @@ -816,7 +816,7 @@ CHECK_LIVE_FRAME (frame); f = XFRAME (frame); if (!FRAME_X_P (f)) - return signal_simple_error ("This frame is not on X device", frame); + invalid_argument ("This frame is not on X device", frame); XIM_init_frame (f); return FRAME_X_XIC (f) ? Qt : Qnil; @@ -836,7 +836,7 @@ CHECK_LIVE_FRAME (frame); f = XFRAME (frame); if (!FRAME_X_P (f)) - return signal_simple_error ("This frame is not on X device", frame); + invalid_argument ("This frame is not on X device", frame); d = XDEVICE (FRAME_DEVICE (f)); if (DEVICE_X_XIM (d)) { @@ -850,7 +850,7 @@ void syms_of_input_method_xlib (void) { - defsymbol (&Qxim_xlib, "xim-xlib"); + DEFSYMBOL (Qxim_xlib); #if 0 /* see above */ DEFSUBR (Fx_open_xim); DEFSUBR (Fx_close_xim); diff -r c775bd016b32 -r 183866b06e0b src/insdel.c --- a/src/insdel.c Thu May 24 06:30:21 2001 +0000 +++ b/src/insdel.c Thu May 24 07:51:33 2001 +0000 @@ -1272,7 +1272,7 @@ if (*from_out >= 0 && *to_out >= 0 && *from_out > *to_out) { if (flags & GB_CHECK_ORDER) - signal_simple_error_2 ("start greater than end", from, to); + invalid_argument_2 ("start greater than end", from, to); else { Bufpos temp = *from_out; @@ -1371,7 +1371,7 @@ if (*from_out >= 0 && *to_out >= 0 && *from_out > *to_out) { if (flags & GB_CHECK_ORDER) - signal_simple_error_2 ("start greater than end", from, to); + invalid_argument_2 ("start greater than end", from, to); else { Bufpos temp = *from_out; @@ -1869,7 +1869,7 @@ if (BUF_Z (buf) - BUF_BEG (buf) + BUF_GAP_SIZE (buf) + increment > EMACS_INT_MAX) - error ("Maximum buffer size exceeded"); + out_of_memory ("Maximum buffer size exceeded", Qunbound); result = BUFFER_REALLOC (buf->text->beg, BI_BUF_Z (buf) - BI_BUF_BEG (buf) + @@ -2445,7 +2445,7 @@ /* Make sure that point-max won't exceed the size of an emacs int. */ if ((length + BUF_Z (buf)) > EMACS_INT_MAX) - error ("Maximum buffer size exceeded"); + out_of_memory ("Maximum buffer size exceeded", Qunbound); /* theoretically not necessary -- caller should GCPRO. #### buffer_insert_from_buffer_1() doesn't! */ diff -r c775bd016b32 -r 183866b06e0b src/intl.c --- a/src/intl.c Thu May 24 06:30:21 2001 +0000 +++ b/src/intl.c Thu May 24 07:51:33 2001 +0000 @@ -304,7 +304,7 @@ /* defer-gettext is defined as a symbol because when it is used in menu specification strings, it is not evaluated as a function by menu_item_descriptor_to_widget_value(). */ - defsymbol (&Qdefer_gettext, "defer-gettext"); + DEFSYMBOL (Qdefer_gettext); DEFSUBR (Fignore_defer_gettext); DEFSUBR (Fgettext); diff -r c775bd016b32 -r 183866b06e0b src/keymap.c --- a/src/keymap.c Thu May 24 06:30:21 2001 +0000 +++ b/src/keymap.c Thu May 24 07:51:33 2001 +0000 @@ -256,7 +256,7 @@ Lisp_Keymap *keymap = XKEYMAP (obj); char buf[200]; if (print_readably) - error ("printing unreadable object #", keymap->header.uid); + printing_unreadable_object ("#", keymap->header.uid); write_c_string ("#name)) { @@ -387,8 +387,7 @@ keymap = get_keymap (keymap, 1, 1); if (EQ (keymap, start_keymap)) { - signal_simple_error ("Cyclic keymap indirection", - start_keymap); + invalid_argument ("Cyclic keymap indirection", start_keymap); } } } @@ -586,7 +585,7 @@ Lisp_Object maps; if (XKEYMAP (def) == to_keymap) - signal_simple_error ("Cyclic keymap definition", def); + invalid_argument ("Cyclic keymap definition", def); for (maps = keymap_submaps (def); CONSP (maps); @@ -1277,16 +1276,16 @@ /* || (XCHAR (*keysym) >= 128 && XCHAR (*keysym) < 160) */) /* yuck! Can't make the above restriction; too many compatibility problems ... */ - signal_simple_error ("keysym char must be printable", *keysym); + invalid_argument ("keysym char must be printable", *keysym); /* #### This bites! I want to be able to write (control shift a) */ if (modifiers & XEMACS_MOD_SHIFT) - signal_simple_error + invalid_argument ("The `shift' modifier may not be applied to ASCII keysyms", spec); } else { - signal_simple_error ("Unknown keysym specifier", *keysym); + invalid_argument ("Unknown keysym specifier", *keysym); } if (SYMBOLP (*keysym)) @@ -1325,7 +1324,7 @@ !strcmp (name, "BS"))) #endif /* unused */ ) - signal_simple_error + invalid_argument ("Invalid (FSF Emacs) key format (see doc of define-key)", *keysym); @@ -1447,17 +1446,14 @@ break; } default: - signal_error (Qwrong_type_argument, - list2 (build_translated_string - ("unable to bind this type of event"), - spec)); + wtaerror ("unable to bind this type of event", spec); } } else if (SYMBOLP (spec)) { /* Be nice, allow = to mean (=) */ if (bucky_sym_to_bucky_bit (spec) != 0) - signal_simple_error ("Key is a modifier name", spec); + invalid_argument ("Key is a modifier name", spec); define_key_check_and_coerce_keysym (spec, &spec, 0); returned_value->keysym = spec; returned_value->modifiers = 0; @@ -1479,19 +1475,20 @@ if (!NILP (XCDR (rest))) { if (! modifier) - signal_simple_error ("Unknown modifier", keysym); + invalid_argument ("Unknown modifier", keysym); } else { if (modifier) - signal_simple_error ("Nothing but modifiers here", + sferror ("Nothing but modifiers here", spec); } rest = XCDR (rest); QUIT; } if (!NILP (rest)) - signal_simple_error ("List must be nil-terminated", spec); + signal_error (Qlist_formation_error, + "List must be nil-terminated", spec); define_key_check_and_coerce_keysym (spec, &keysym, modifiers); returned_value->keysym = keysym; @@ -1499,7 +1496,7 @@ } else { - signal_simple_error ("Unknown key-sequence specifier", + invalid_argument ("Unknown key-sequence specifier", spec); } } @@ -1518,7 +1515,7 @@ { Lisp_Object fn, arg; if (! NILP (Fcdr (Fcdr (list)))) - signal_simple_error ("Invalid menu event desc", list); + invalid_argument ("Invalid menu event desc", list); arg = Fcar (Fcdr (list)); if (SYMBOLP (arg)) fn = Qcall_interactively; @@ -1541,7 +1538,8 @@ EQ (raw_key.keysym, Qbutton5) || EQ (raw_key.keysym, Qbutton5up) || EQ (raw_key.keysym, Qbutton6) || EQ (raw_key.keysym, Qbutton6up) || EQ (raw_key.keysym, Qbutton7) || EQ (raw_key.keysym, Qbutton7up)) - error ("Mouse-clicks can't appear in saved keyboard macros."); + invalid_operation ("Mouse-clicks can't appear in saved keyboard macros", + Qunbound); XEVENT (event)->channel = Vselected_console; XEVENT (event)->event_type = key_press_event; @@ -1724,18 +1722,19 @@ } if (EQ (keys, new_keys)) - error_with_frob (mpc_binding, - "can't bind %s: %s has a non-keymap binding", - (char *) XSTRING_DATA (Fkey_description (keys)), - (char *) XSTRING_DATA (Fsingle_key_description - (Vmeta_prefix_char))); + signal_ferror_with_frob (Qinvalid_operation, mpc_binding, + "can't bind %s: %s has a non-keymap binding", + (char *) XSTRING_DATA (Fkey_description (keys)), + (char *) XSTRING_DATA (Fsingle_key_description + (Vmeta_prefix_char))); else - error_with_frob (mpc_binding, - "can't bind %s: %s %s has a non-keymap binding", - (char *) XSTRING_DATA (Fkey_description (keys)), - (char *) XSTRING_DATA (Fkey_description (new_keys)), - (char *) XSTRING_DATA (Fsingle_key_description - (Vmeta_prefix_char))); + signal_ferror_with_frob (Qinvalid_operation, mpc_binding, + "can't bind %s: %s %s has a non-keymap binding", + (char *) XSTRING_DATA (Fkey_description (keys)), + (char *) XSTRING_DATA (Fkey_description + (new_keys)), + (char *) XSTRING_DATA (Fsingle_key_description + (Vmeta_prefix_char))); } DEFUN ("define-key", Fdefine_key, 3, 3, 0, /* @@ -1921,7 +1920,7 @@ XKEYMAP (keymap)->table, Qnil); if (!NILP (meta_map) && keymap_fullness (meta_map) != 0) - signal_simple_error_2 + invalid_operation_2 ("Map contains meta-bindings, can't bind", Fsingle_key_description (Vmeta_prefix_char), keymap); NUNGCPRO; @@ -1977,7 +1976,7 @@ keymap_store (keymap, &raw_key1, cmd); } if (NILP (Fkeymapp (cmd))) - signal_simple_error_2 ("Invalid prefix keys in sequence", + sferror_2 ("Invalid prefix keys in sequence", c, keys); if (ascii_hack && !NILP (raw_key2.keysym) && @@ -3278,7 +3277,7 @@ #endif strcpy (bufp, (char *) string_data (XSYMBOL (keysym)->name)); if (!NILP (XCDR (rest))) - signal_simple_error ("Invalid key description", + invalid_argument ("Invalid key description", key); } } @@ -3312,8 +3311,9 @@ Lisp_Object ch = Fevent_to_character (chr, Qnil, Qnil, Qt); if (NILP (ch)) return - signal_simple_continuable_error - ("character has no ASCII equivalent", Fcopy_event (chr, Qnil)); + signal_continuable_error + (Qinvalid_argument, + "character has no ASCII equivalent", Fcopy_event (chr, Qnil)); chr = ch; } diff -r c775bd016b32 -r 183866b06e0b src/libsst.c --- a/src/libsst.c Thu May 24 06:30:21 2001 +0000 +++ b/src/libsst.c Thu May 24 07:51:33 2001 +0000 @@ -15,21 +15,18 @@ /* Synched up with: Not in FSF. */ -#ifdef emacs +/* This file Mule-ized by Ben Wing, 5-15-01. */ + #include #include "lisp.h" -#endif -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif +#include "sound.h" #include "libsst.h" +#include "sysfile.h" + + #define AUDBUF 1024 int @@ -38,12 +35,12 @@ { int fd, i, gr, ger, gx; struct audio_ioctl ai; - char *ep; + Extbyte *ep; fd = open( "/dev/audio", O_RDWR ); if ( fd < 0 ) { - perror( "sst_open: open /dev/audio" ); + sound_perror( "sst_open: open /dev/audio" ); return( fd ); } @@ -53,7 +50,7 @@ i = AUDBUF; if ( ioctl( fd, AUDIOSETQSIZE, &i ) < 0 ) { - perror( "sst_open: SETQSIZE" ); + sound_perror( "sst_open: SETQSIZE" ); return( fd ); } #endif /* AUDIOSETQSIZE */ @@ -67,7 +64,7 @@ play_level = atoi( ep ); if ( play_level < 0 || play_level > 99 ) { - warn( "sst_open: SST_PLAY must be between 0 and 99" ); + sound_warn( "sst_open: SST_PLAY must be between 0 and 99" ); return( -1 ); } } @@ -80,7 +77,7 @@ record_level = atoi( ep ); if ( record_level < 0 || record_level > 99 ) { - warn( "sst_open: SST_RECORD must be between 0 and 99" ); + sound_warn( "sst_open: SST_RECORD must be between 0 and 99" ); return( -1 ); } } @@ -110,7 +107,7 @@ ai.control = AUDIO_MAP_MMR2; if ( ioctl( fd, AUDIOGETREG, &ai ) < 0 ) { - perror( "sst_open: GETREG MMR2" ); + sound_perror( "sst_open: GETREG MMR2" ); return( -1 ); } if ( (ep = getenv( "SST_EARPHONES" )) != NULL ) @@ -119,7 +116,7 @@ ai.data[0] |= AUDIO_MMR2_BITS_LS; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_open: SETREG MMR2" ); + sound_perror( "sst_open: SETREG MMR2" ); return( fd ); } @@ -136,13 +133,13 @@ ai.data[0] = 0; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_close: SETREG MMR1" ); + sound_perror( "sst_close: SETREG MMR1" ); } ai.control = AUDIO_MAP_MMR2; ai.data[0] = 0; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_close: SETREG MMR2" ); + sound_perror( "sst_close: SETREG MMR2" ); } close( fd ); } @@ -150,7 +147,7 @@ /* These are tables of values to be loaded into various gain registers. */ -static unsigned char ger_table[][2] = { +static UChar_Binary ger_table[][2] = { 0xaa, 0xaa, /* -10db */ 0x79, 0xac, 0x41, 0x99, @@ -183,7 +180,7 @@ }; -static unsigned char gr_gx_table[][2] = { +static UChar_Binary gr_gx_table[][2] = { 0x8b, 0x7c, /* -18db */ 0x8b, 0x35, 0x8b, 0x24, @@ -225,9 +222,9 @@ if ( ( value < -10 ) || ( value > 18 ) ) { - char buf [255]; + Extbyte buf [255]; sprintf (buf, "sst_set_ger: GER %d out of range", value); - warn(buf); + sound_warn(buf); return; } @@ -238,18 +235,18 @@ if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_set_ger: SETREG GER" ); + sound_perror( "sst_set_ger: SETREG GER" ); } ai.control = AUDIO_MAP_MMR1; if ( ioctl( fd, AUDIOGETREG, &ai ) < 0 ) { - perror( "sst_set_ger: GETREG MMR1" ); + sound_perror( "sst_set_ger: GETREG MMR1" ); } ai.data[0] |= AUDIO_MMR1_BITS_LOAD_GER; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_set_ger: SETREG MMR1" ); + sound_perror( "sst_set_ger: SETREG MMR1" ); } } @@ -261,9 +258,9 @@ if ( ( value < -18 ) || ( value > 12 ) ) { - char buf [255]; + Extbyte buf [255]; sprintf (buf, "sst_set_gr: GR %d out of range", value); - warn (buf); + sound_warn (buf); return; } @@ -273,18 +270,18 @@ if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_set_gr: SETREG GR" ); + sound_perror( "sst_set_gr: SETREG GR" ); } ai.control = AUDIO_MAP_MMR1; if ( ioctl( fd, AUDIOGETREG, &ai ) < 0 ) { - perror( "sst_set_gr: GETREG MMR1" ); + sound_perror( "sst_set_gr: GETREG MMR1" ); } ai.data[0] |= AUDIO_MMR1_BITS_LOAD_GR; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_set_gr: SETREG MMR1" ); + sound_perror( "sst_set_gr: SETREG MMR1" ); } } @@ -293,12 +290,12 @@ int fd, value; { struct audio_ioctl ai; - char buf [255]; + Extbyte buf [255]; if ( ( value < -18 ) || ( value > 12 ) ) { sprintf (buf, "sst_set_gx: GX %d out of range", value); - warn (buf); + sound_warn (buf); return; } @@ -311,18 +308,18 @@ if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_set_gx: SETREG GX" ); + sound_perror( "sst_set_gx: SETREG GX" ); } ai.control = AUDIO_MAP_MMR1; if ( ioctl( fd, AUDIOGETREG, &ai ) < 0 ) { - perror( "sst_set_gx: GETREG MMR1" ); + sound_perror( "sst_set_gx: GETREG MMR1" ); } ai.data[0] |= AUDIO_MMR1_BITS_LOAD_GX; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_set_gx: SETREG MMR1" ); + sound_perror( "sst_set_gx: SETREG MMR1" ); } } @@ -330,10 +327,10 @@ sst_tones( fd, dhz1, dhz2, thz, rhz, usec ) int fd, dhz1, dhz2, thz, rhz, usec; { - char buf [255]; + Extbyte buf [255]; struct audio_ioctl ai; int dval1, dval2, tval, rval; - unsigned char oldmmr2, newmmr2; + UChar_Binary oldmmr2, newmmr2; if ( dhz1 == 0 ) dval1 = 0; @@ -343,7 +340,7 @@ if ( ( dval1 < 1 ) || ( dval1 > 255 ) ) { sprintf(buf, "sst_tones: dhz1 %d out of range", dhz1 ); - warn (buf); + sound_warn (buf); return; } } @@ -356,7 +353,7 @@ if ( ( dval2 < 1 ) || ( dval2 > 255 ) ) { sprintf(buf, "sst_tones: dhz2 %d out of range", dhz2 ); - warn (buf); + sound_warn (buf); return; } } @@ -369,7 +366,7 @@ if ( ( tval < 1 ) || ( tval > 255 ) ) { sprintf(buf, "sst_tones: thz %d out of range", thz ); - warn (buf); + sound_warn (buf); return; } } @@ -382,7 +379,7 @@ if ( ( rval < 1 ) || ( rval > 255 ) ) { sprintf(buf, "sst_tones: rhz %d out of range", dhz2 ); - warn (buf); + sound_warn (buf); return; } } @@ -390,21 +387,21 @@ if ( ( dval1 != 0 || dval2 != 0 ) && ( tval != 0 || rval != 0 ) ) { sprintf(buf, "sst_tones: cannot use DTMF and TONE or RINGER at the same time", dhz2 ); - warn (buf); + sound_warn (buf); return; } if ( tval != 0 && rval != 0 ) { sprintf(buf, "sst_tones: cannot use TONE and RINGER at the same time", dhz2 ); - warn (buf); + sound_warn (buf); return; } ai.control = AUDIO_MAP_MMR2; if ( ioctl( fd, AUDIOGETREG, &ai ) < 0 ) { - perror( "sst_tones: GETREG MMR2" ); + sound_perror( "sst_tones: GETREG MMR2" ); } oldmmr2 = newmmr2 = ai.data[0]; @@ -416,7 +413,7 @@ ai.data[1] = dval2; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_tones: SETREG FTGR" ); + sound_perror( "sst_tones: SETREG FTGR" ); } } @@ -428,7 +425,7 @@ ai.data[1] = 0; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_tones: SETREG FTGR" ); + sound_perror( "sst_tones: SETREG FTGR" ); } } @@ -440,7 +437,7 @@ ai.data[1] = 0; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_tones: SETREG FTGR" ); + sound_perror( "sst_tones: SETREG FTGR" ); } } @@ -448,7 +445,7 @@ ai.data[0] = newmmr2; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_tones: SETREG MMR2" ); + sound_perror( "sst_tones: SETREG MMR2" ); } usleep( usec ); @@ -456,16 +453,16 @@ ai.data[0] = oldmmr2; if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) { - perror( "sst_tones: SETREG MMR2" ); + sound_perror( "sst_tones: SETREG MMR2" ); } } void sst_dtmf( fd, dial, usecper, usecpause ) int fd, usecper, usecpause; -char *dial; +Extbyte *dial; { - char *cp; + Extbyte *cp; for ( cp = dial; *cp != '\0'; cp++ ) { @@ -495,9 +492,9 @@ default: { - char buf [255]; + Extbyte buf [255]; sprintf( buf, "sst_dtmf: unknown dialing code '%c'", *cp ); - warn (buf); + sound_warn (buf); } } usleep( usecpause ); diff -r c775bd016b32 -r 183866b06e0b src/libsst.h --- a/src/libsst.h Thu May 24 06:30:21 2001 +0000 +++ b/src/libsst.h Thu May 24 07:51:33 2001 +0000 @@ -12,6 +12,8 @@ /* Synched up with: Not in FSF. */ +/* This file Mule-ized by Ben Wing, 5-15-01. */ + #ifndef INCLUDED_libsst_h_ #define INCLUDED_libsst_h_ @@ -40,14 +42,4 @@ void sst_tones( /* int fd, dhz1, dhz2, thz, rhz, usec */ ); void sst_dtmf( /* int fd, char *dial, int usecper, usecpause */ ); -#ifdef emacs -extern char *strerror (); -extern void message (); -# define perror(string) \ - message("audio: %s, %s", string, strerror (errno)) -# define warn(str) message ("audio: %s", GETTEXT (str)) -#else /* !emacs */ -# define warn(str) fprintf (stderr, "%s\n", (str)) -#endif /* emacs */ - #endif /* INCLUDED_libsst_h_ */ diff -r c775bd016b32 -r 183866b06e0b src/linuxplay.c --- a/src/linuxplay.c Thu May 24 06:30:21 2001 +0000 +++ b/src/linuxplay.c Thu May 24 07:51:33 2001 +0000 @@ -46,6 +46,8 @@ /* Synched up with: Not in FSF. */ +/* This file Mule-ized by Ben Wing, 5-15-01. */ + /* XEmacs beta testers say: undef this by default. */ #undef NOVOLUMECTRLFORMULAW /* Changing the volume for uLaw-encoded samples sounds very poor; possibly, @@ -53,35 +55,16 @@ driver, so undefine this symbol at your discretion */ -#ifdef HAVE_CONFIG_H #include -#endif +#include "lisp.h" #include "miscplay.h" -#include "nativesound.h" +#include "sound.h" -#include -#include -#include SOUNDCARD_H_FILE /* Path computed by configure */ -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef LINUXPLAYSTANDALONE -#define perror(str) fprintf(stderr,"audio: %s %s\n",str,strerror(errno)); -#define warn(str) fprintf(stderr,"audio: %s\n",str); -#else -#include "lisp.h" #include "syssignal.h" #include "sysfile.h" -#define perror(str) message("audio: %s, %s ",str,strerror(errno)) -#define warn(str) message("audio: %s ",GETTEXT(str)) -#endif +#include "systty.h" /* for sys/ioctl.h */ +#include SOUNDCARD_H_FILE /* Path computed by configure */ static SIGTYPE (*sighup_handler) (int); static SIGTYPE (*sigint_handler) (int); @@ -89,7 +72,7 @@ static int mix_fd; static int audio_vol; static int audio_fd; -static char *audio_dev = "/dev/dsp"; +static Char_ASCII *audio_dev = "/dev/dsp"; /* Intercept SIGINT and SIGHUP in order to close the audio and mixer devices before terminating sound output; this requires reliable @@ -123,16 +106,17 @@ others, too. Thus we do quite a lot of double checking; actually most of this is not needed right now, but it will come in handy, if the kernel's sounddriver ever changes or if third-party sounddrivers are used. */ -static int audio_init(int mixx_fd, int auddio_fd, int fmt, int speed, - int tracks, int *volume, - size_t (**sndcnv) (void **, size_t *sz, void **)) +static int +audio_init(int mixx_fd, int auddio_fd, int fmt, int speed, + int tracks, int *volume, + size_t (**sndcnv) (void **, size_t *sz, void **)) { int i,the_speed,the_stereo,the_fmt; *sndcnv = sndcnvnop; if (ioctl(auddio_fd,SNDCTL_DSP_SYNC,NULL) < 0) { - perror("SNDCTL_DSP_SYNC"); + sound_perror("SNDCTL_DSP_SYNC"); return(0); } /* Initialize sound hardware with preferred parameters */ @@ -142,7 +126,7 @@ the_fmt = fmt; if(ioctl(audio_fd,SNDCTL_DSP_SETFMT,&the_fmt) < 0) { - perror("SNDCTL_DSP_SETFMT"); + sound_perror("SNDCTL_DSP_SETFMT"); return(0); } @@ -152,19 +136,19 @@ if (((i=fmt=AFMT_U8),ioctl(audio_fd,SNDCTL_DSP_SETFMT,&i)) < 0 || fmt != i || ioctl(audio_fd,SNDCTL_DSP_SETFMT,&the_fmt) < 0 || fmt != the_fmt) { - perror("SNDCTL_DSP_SETFMT"); + sound_perror("SNDCTL_DSP_SETFMT"); return(0); } } else if (fmt == AFMT_MU_LAW && the_fmt == AFMT_U8 ) { /* the kernel will convert for us */ } else { - perror("SNDCTL_DSP_SETFMT"); + sound_perror("SNDCTL_DSP_SETFMT"); return(0); } } else if (fmt == AFMT_S8) { *sndcnv = sndcnv2unsigned; if (((i=fmt=AFMT_U8),ioctl(audio_fd,SNDCTL_DSP_SETFMT,&i)) < 0 || fmt != i || ioctl(audio_fd,SNDCTL_DSP_SETFMT,&the_fmt) < 0 || fmt != the_fmt) { - perror("SNDCTRL_DSP_SETFMT"); + sound_perror("SNDCTRL_DSP_SETFMT"); return(0); } } /* The PCSP driver does not support reading of the sampling rate via the @@ -193,11 +177,11 @@ the_fmt == AFMT_U8 ? sndcnv8U_2mono : the_fmt == AFMT_MU_LAW ? sndcnvULaw_2mono : NULL; if (*sndcnv == NULL) { /* this should not happen */ - perror("SNDCTL_DSP_STEREO"); + sound_perror("SNDCTL_DSP_STEREO"); return(0); } /* Switch to mono mode */ if (((i = 0),ioctl(audio_fd,SNDCTL_DSP_STEREO,&i)) < 0 || i) { - perror("SNDCTL_DSP_STEREO"); + sound_perror("SNDCTL_DSP_STEREO"); return(0); } /* Now double check that everything is set as expected */ if (((i = AFMT_QUERY),ioctl(audio_fd,SNDCTL_DSP_SETFMT,&i)) < 0 || @@ -210,18 +194,18 @@ i != 1)) { /* There was no way that we could set the soundcard to a meaningful mode */ - perror("SNDCTL_DSP_SETFMT and SNDCTL_DSP_STEREO"); + sound_perror("SNDCTL_DSP_SETFMT and SNDCTL_DSP_STEREO"); return(0); } } else { /* Somebody set the soundcard to stereo even though we requested mono; this should not happen... */ if (((i = the_stereo = tracks),ioctl(audio_fd,SNDCTL_DSP_STEREO,&i))<0 || i != the_stereo-1) { - perror("SNDCTL_DSP_STEREO"); + sound_perror("SNDCTL_DSP_STEREO"); return(0); } if (((i = AFMT_QUERY),ioctl(audio_fd,SNDCTL_DSP_SETFMT,&i)) < 0 || i != the_fmt) { - perror("SNDCTL_DSP_SETFMT"); + sound_perror("SNDCTL_DSP_SETFMT"); return(0); } } } /* Fail if deviations from desired sampling frequency are too big */ @@ -230,9 +214,9 @@ "the_speed" is still unchanged */ ioctl(audio_fd,SOUND_PCM_READ_RATE,&the_speed); if (speed*14 < the_speed*10 || speed*6 > the_speed*10) { - char buffer[256]; + Extbyte buffer[256]; sprintf(buffer,"SNDCTL_DSP_SPEED (req: %d, rtn: %d)",speed,the_speed); - perror(buffer); + sound_perror(buffer); return(0); } /* Use the mixer device for setting the playback volume */ @@ -282,16 +266,17 @@ Returns 1 on succes. 0 otherwise. */ -static int linux_play_data_or_file(int fd,unsigned char *data, - int length,int volume) +static int +linux_play_data_or_file(int fd, UChar_Binary *data, + int length, int volume) { size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf); size_t (*sndcnv)(void **dayta,size_t *sz,void **); fmtType ffmt; int fmt,speed,tracks; - unsigned char *pptr,*optr,*cptr,*sptr; + UChar_Binary *pptr,*optr,*cptr,*sptr; int wrtn,rrtn,crtn,prtn; - unsigned char sndbuf[SNDBUFSZ]; + UChar_Binary sndbuf[SNDBUFSZ]; /* We need to read at least the header information before we can start doing anything */ @@ -308,7 +293,7 @@ ffmt = analyze_format(data,&fmt,&speed,&tracks,&parsesndfile); if (ffmt != fmtRaw && ffmt != fmtSunAudio && ffmt != fmtWave) { - warn("Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)"); + sound_warn("Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)"); return 0; } /* The VoxWare-SDK discourages opening /dev/audio; opening /dev/dsp and @@ -316,7 +301,7 @@ if ((audio_fd=open(audio_dev, O_WRONLY | O_NONBLOCK, 0)) < 0) { /* JV. Much too verbose. In addition this can crash. See NOTE: in Fplay_sound - perror(audio_dev); */ + sound_perror(audio_dev); */ if (mix_fd > 0 && mix_fd != audio_fd) { close(mix_fd); mix_fd = -1; } return 0; } @@ -344,18 +329,18 @@ (void **)&sptr)) > 0; ) { for (;;) { if ((wrtn = write(audio_fd,sptr,crtn)) < 0) { - perror("write"); goto END_OF_PLAY; } + sound_perror("write"); goto END_OF_PLAY; } else if (wrtn) break; else if (ioctl(audio_fd,SNDCTL_DSP_SYNC,NULL) < 0) { - perror("SNDCTL_DSP_SYNC"); goto END_OF_PLAY; } } + sound_perror("SNDCTL_DSP_SYNC"); goto END_OF_PLAY; } } if (wrtn != crtn) { - char buf[255]; + Extbyte buf[255]; sprintf(buf,"play: crtn = %d, wrtn = %d",crtn,wrtn); - warn(buf); + sound_warn(buf); goto END_OF_PLAY; } } if (fd >= 0) { if ((rrtn = read(fd,sndbuf,SNDBUFSZ)) < 0) { - perror("read"); goto END_OF_PLAY; } } + sound_perror("read"); goto END_OF_PLAY; } } else break; } while (rrtn > 0); @@ -389,12 +374,13 @@ /* Call "linux_play_data_or_file" with the appropriate parameters for playing a soundfile */ -void play_sound_file (char *sound_file, int volume) +void +play_sound_file (Extbyte *sound_file, int volume) { int fd; if ((fd=open(sound_file,O_RDONLY,0)) < 0) { - perror(sound_file); + sound_perror(sound_file); return; } linux_play_data_or_file(fd,NULL,0,volume); close(fd); @@ -403,7 +389,8 @@ /* Call "linux_play_data_or_file" with the appropriate parameters for playing pre-loaded data */ -int play_sound_data (unsigned char *data, int length, int volume) +int +play_sound_data (UChar_Binary *data, int length, int volume) { return linux_play_data_or_file(-1,data,length,volume); } diff -r c775bd016b32 -r 183866b06e0b src/lisp.h --- a/src/lisp.h Thu May 24 06:30:21 2001 +0000 +++ b/src/lisp.h Thu May 24 07:51:33 2001 +0000 @@ -2360,6 +2360,9 @@ extern int find_file_compare_truenames; extern int find_file_use_truenames; +/* Defined in bytecode.c */ +DOESNT_RETURN invalid_byte_code (const char *reason, Lisp_Object frob); + /* Defined in callproc.c */ char *egetenv (const char *); @@ -2455,85 +2458,61 @@ extern int suppress_early_error_handler_backtrace; /* Defined in eval.c */ -DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, Lisp_Object)); -void maybe_signal_error (Lisp_Object, Lisp_Object, Lisp_Object, - Error_behavior); -Lisp_Object maybe_signal_continuable_error (Lisp_Object, Lisp_Object, - Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (type_error (Lisp_Object, - const char *, - ...), 2, 3); -void maybe_type_error (Lisp_Object, Lisp_Object, Error_behavior, const char *, - ...) PRINTF_ARGS (4, 5); -Lisp_Object continuable_type_error (Lisp_Object, const char *, ...) +DECLARE_DOESNT_RETURN (signal_error_1 (Lisp_Object, Lisp_Object)); +void maybe_signal_error_1 (Lisp_Object, Lisp_Object, Lisp_Object, + Error_behavior); +Lisp_Object maybe_signal_continuable_error_1 (Lisp_Object, Lisp_Object, + Lisp_Object, Error_behavior); +DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (signal_ferror (Lisp_Object, + const char *, + ...), 2, 3); +void maybe_signal_ferror (Lisp_Object, Lisp_Object, Error_behavior, + const char *, ...) PRINTF_ARGS (4, 5); +Lisp_Object signal_continuable_ferror (Lisp_Object, const char *, ...) PRINTF_ARGS (2, 3); -Lisp_Object maybe_continuable_type_error (Lisp_Object, Lisp_Object, - Error_behavior, - const char *, ...) +Lisp_Object maybe_signal_continuable_ferror (Lisp_Object, Lisp_Object, + Error_behavior, + const char *, ...) PRINTF_ARGS (4, 5); -DECLARE_DOESNT_RETURN (signal_type_error (Lisp_Object, const char *, - Lisp_Object)); -void maybe_signal_type_error (Lisp_Object, const char *, Lisp_Object, - Lisp_Object, Error_behavior); -Lisp_Object signal_type_continuable_error (Lisp_Object, const char *, - Lisp_Object); -Lisp_Object maybe_signal_type_continuable_error (Lisp_Object, const char *, - Lisp_Object, - Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (type_error_with_frob + +Lisp_Object build_error_data (const char *reason, Lisp_Object frob); +DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, const char *, + Lisp_Object)); +void maybe_signal_error (Lisp_Object, const char *, Lisp_Object, + Lisp_Object, Error_behavior); +Lisp_Object signal_continuable_error (Lisp_Object, const char *, + Lisp_Object); +Lisp_Object maybe_signal_continuable_error (Lisp_Object, const char *, + Lisp_Object, + Lisp_Object, Error_behavior); +DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (signal_ferror_with_frob (Lisp_Object, Lisp_Object, const char *, ...), 3, 4); -void maybe_type_error_with_frob (Lisp_Object, Lisp_Object, Lisp_Object, - Error_behavior, - const char *, ...) PRINTF_ARGS (5, 6); -Lisp_Object continuable_type_error_with_frob (Lisp_Object, Lisp_Object, - const char *, - ...) PRINTF_ARGS (3, 4); -Lisp_Object maybe_continuable_type_error_with_frob -(Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior, const char *, ...) +void maybe_signal_ferror_with_frob (Lisp_Object, Lisp_Object, Lisp_Object, + Error_behavior, + const char *, ...) PRINTF_ARGS (5, 6); +Lisp_Object signal_continuable_ferror_with_frob (Lisp_Object, Lisp_Object, + const char *, + ...) PRINTF_ARGS (3, 4); +Lisp_Object maybe_signal_continuable_ferror_with_frob (Lisp_Object, + Lisp_Object, + Lisp_Object, + Error_behavior, + const char *, ...) PRINTF_ARGS (5, 6); -DECLARE_DOESNT_RETURN (signal_type_error_2 (Lisp_Object, const char *, - Lisp_Object, Lisp_Object)); -void maybe_signal_type_error_2 (Lisp_Object, const char *, Lisp_Object, - Lisp_Object, Lisp_Object, Error_behavior); -Lisp_Object signal_type_continuable_error_2 (Lisp_Object, const char *, - Lisp_Object, Lisp_Object); -Lisp_Object maybe_signal_type_continuable_error_2 (Lisp_Object, const char *, - Lisp_Object, Lisp_Object, - Lisp_Object, - Error_behavior); -DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error (const char *, - ...), 1, 2); -void maybe_error (Lisp_Object, Error_behavior, const char *, - ...) PRINTF_ARGS (3, 4); -Lisp_Object continuable_error (const char *, ...) PRINTF_ARGS (1, 2); -Lisp_Object maybe_continuable_error (Lisp_Object, Error_behavior, - const char *, ...) PRINTF_ARGS (3, 4); -DECLARE_DOESNT_RETURN (signal_simple_error (const char *, Lisp_Object)); -void maybe_signal_simple_error (const char *, Lisp_Object, - Lisp_Object, Error_behavior); -Lisp_Object signal_simple_continuable_error (const char *, Lisp_Object); -Lisp_Object maybe_signal_simple_continuable_error (const char *, Lisp_Object, - Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error_with_frob - (Lisp_Object, const char *, - ...), 2, 3); -void maybe_error_with_frob (Lisp_Object, Lisp_Object, Error_behavior, - const char *, ...) PRINTF_ARGS (4, 5); -Lisp_Object continuable_error_with_frob (Lisp_Object, const char *, - ...) PRINTF_ARGS (2, 3); -Lisp_Object maybe_continuable_error_with_frob -(Lisp_Object, Lisp_Object, Error_behavior, const char *, ...) PRINTF_ARGS (4, 5); -DECLARE_DOESNT_RETURN (signal_simple_error_2 (const char *, - Lisp_Object, Lisp_Object)); -void maybe_signal_simple_error_2 (const char *, Lisp_Object, Lisp_Object, - Lisp_Object, Error_behavior); -Lisp_Object signal_simple_continuable_error_2 (const char *, - Lisp_Object, Lisp_Object); -Lisp_Object maybe_signal_simple_continuable_error_2 (const char *, Lisp_Object, - Lisp_Object, Lisp_Object, - Error_behavior); +DECLARE_DOESNT_RETURN (signal_error_2 (Lisp_Object, const char *, + Lisp_Object, Lisp_Object)); +void maybe_signal_error_2 (Lisp_Object, const char *, Lisp_Object, + Lisp_Object, Lisp_Object, Error_behavior); +Lisp_Object signal_continuable_error_2 (Lisp_Object, const char *, + Lisp_Object, Lisp_Object); +Lisp_Object maybe_signal_continuable_error_2 (Lisp_Object, const char *, + Lisp_Object, Lisp_Object, + Lisp_Object, + Error_behavior); + + DECLARE_DOESNT_RETURN (signal_malformed_list_error (Lisp_Object)); DECLARE_DOESNT_RETURN (signal_malformed_property_list_error (Lisp_Object)); DECLARE_DOESNT_RETURN (signal_circular_list_error (Lisp_Object)); @@ -2542,21 +2521,56 @@ DECLARE_DOESNT_RETURN (syntax_error (const char *reason, Lisp_Object frob)); DECLARE_DOESNT_RETURN (syntax_error_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2)); +void maybe_syntax_error (const char *, Lisp_Object, Lisp_Object, + Error_behavior); +DECLARE_DOESNT_RETURN (sferror (const char *reason, Lisp_Object frob)); +DECLARE_DOESNT_RETURN (sferror_2 (const char *reason, Lisp_Object frob1, + Lisp_Object frob2)); +void maybe_sferror (const char *, Lisp_Object, Lisp_Object, + Error_behavior); DECLARE_DOESNT_RETURN (invalid_argument (const char *reason, Lisp_Object frob)); DECLARE_DOESNT_RETURN (invalid_argument_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2)); +void maybe_invalid_argument (const char *, Lisp_Object, Lisp_Object, + Error_behavior); DECLARE_DOESNT_RETURN (invalid_operation (const char *reason, - Lisp_Object frob)); + Lisp_Object frob)); DECLARE_DOESNT_RETURN (invalid_operation_2 (const char *reason, - Lisp_Object frob1, - Lisp_Object frob2)); + Lisp_Object frob1, + Lisp_Object frob2)); +void maybe_invalid_operation (const char *, Lisp_Object, Lisp_Object, + Error_behavior); +DECLARE_DOESNT_RETURN (invalid_state (const char *reason, + Lisp_Object frob)); +DECLARE_DOESNT_RETURN (invalid_state_2 (const char *reason, + Lisp_Object frob1, + Lisp_Object frob2)); +void maybe_invalid_state (const char *, Lisp_Object, Lisp_Object, + Error_behavior); DECLARE_DOESNT_RETURN (invalid_change (const char *reason, + Lisp_Object frob)); +DECLARE_DOESNT_RETURN (invalid_change_2 (const char *reason, + Lisp_Object frob1, + Lisp_Object frob2)); +void maybe_invalid_change (const char *, Lisp_Object, Lisp_Object, + Error_behavior); +DECLARE_DOESNT_RETURN (invalid_constant (const char *reason, + Lisp_Object frob)); +DECLARE_DOESNT_RETURN (invalid_constant_2 (const char *reason, + Lisp_Object frob1, + Lisp_Object frob2)); +void maybe_invalid_constant (const char *, Lisp_Object, Lisp_Object, + Error_behavior); +DECLARE_DOESNT_RETURN (wtaerror (const char *reason, Lisp_Object frob)); +DECLARE_DOESNT_RETURN (out_of_memory (const char *reason, + Lisp_Object frob)); +DECLARE_DOESNT_RETURN (stack_overflow (const char *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (invalid_change_2 (const char *reason, - Lisp_Object frob1, - Lisp_Object frob2)); +DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (printing_unreadable_object + (const char *, + ...), 1, 2); Lisp_Object signal_void_function_error (Lisp_Object); Lisp_Object signal_invalid_function_error (Lisp_Object); @@ -2651,21 +2665,14 @@ /* Defined in fileio.c */ void record_auto_save (void); void force_auto_save_soon (void); +DECLARE_DOESNT_RETURN (report_error_with_errno (Lisp_Object errtype, + const char *string, + Lisp_Object data)); +DECLARE_DOESNT_RETURN (report_file_type_error (Lisp_Object errtype, + Lisp_Object oserrmess, + const char *string, + Lisp_Object data)); DECLARE_DOESNT_RETURN (report_file_error (const char *, Lisp_Object)); -void maybe_report_file_error (const char *, Lisp_Object, - Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN (signal_file_error (const char *, Lisp_Object)); -void maybe_signal_file_error (const char *, Lisp_Object, - Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN (signal_double_file_error (const char *, const char *, - Lisp_Object)); -void maybe_signal_double_file_error (const char *, const char *, - Lisp_Object, Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN (signal_double_file_error_2 (const char *, const char *, - Lisp_Object, Lisp_Object)); -void maybe_signal_double_file_error_2 (const char *, const char *, - Lisp_Object, Lisp_Object, Lisp_Object, - Error_behavior); Lisp_Object lisp_strerror (int); Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object); ssize_t read_allowing_quit (int, void *, size_t); @@ -2722,6 +2729,18 @@ Error_behavior decode_error_behavior_flag (Lisp_Object); Lisp_Object encode_error_behavior_flag (Error_behavior); +/* Defined in glyphs-shared.c */ +void shared_resource_validate (Lisp_Object instantiator); +Lisp_Object shared_resource_normalize (Lisp_Object inst, + Lisp_Object console_type, + Lisp_Object dest_mask, + Lisp_Object tag); +extern Lisp_Object Q_resource_type, Q_resource_id; + +/* Defined in gui.c */ +DECLARE_DOESNT_RETURN (gui_error (const char *reason, + Lisp_Object frob)); + /* Defined in indent.c */ int bi_spaces_at_point (struct buffer *, Bytind); int column_at_point (struct buffer *, Bufpos, int); @@ -2827,6 +2846,10 @@ void float_to_string (char *, double); void internal_object_printer (Lisp_Object, Lisp_Object, int); +/* Defined in process.c */ +DECLARE_DOESNT_RETURN (report_process_error (const char *, Lisp_Object)); +DECLARE_DOESNT_RETURN (report_network_error (const char *, Lisp_Object)); + /* Defined in profile.c */ void mark_profiling_info (void); void profile_increase_call_count (Lisp_Object); @@ -2870,6 +2893,7 @@ /* Defined in sound.c */ void init_device_sound (struct device *); +DECLARE_DOESNT_RETURN (report_sound_error (const Char_ASCII *, Lisp_Object)); /* Defined in specifier.c */ Lisp_Object specifier_instance (Lisp_Object, Lisp_Object, Lisp_Object, @@ -3182,10 +3206,9 @@ extern Lisp_Object Qchar_or_string_p, Qcharacterp; extern Lisp_Object Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; extern Lisp_Object Qcircular_list, Qcircular_property_list; -extern Lisp_Object Qcoding_system_error; extern Lisp_Object Qcolor_pixmap_image_instance_p; extern Lisp_Object Qcommandp, Qcompletion_ignore_case; -extern Lisp_Object Qconsole_live_p, Qconst_specifier, Qcr; +extern Lisp_Object Qconsole_live_p, Qconst_specifier, Qconversion_error, Qcr; extern Lisp_Object Qcrlf, Qcurrent_menubar, Qctext; extern Lisp_Object Qcyclic_variable_indirection, Qdecode; extern Lisp_Object Qdefun, Qdevice_live_p; @@ -3194,20 +3217,22 @@ extern Lisp_Object Qediting_error; extern Lisp_Object Qencode, Qend_of_buffer, Qend_of_file, Qend_open; extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type; -extern Lisp_Object Qerror, Qerror_conditions, Qerror_message, Qescape_quoted; +extern Lisp_Object Qerror, Qerror_conditions, Qerror_lacks_explanatory_string; +extern Lisp_Object Qerror_message, Qescape_quoted; extern Lisp_Object Qevent_live_p, Qexit, Qextent_live_p; extern Lisp_Object Qexternal_debugging_output, Qfeaturep; extern Lisp_Object Qfile_error; extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output, Qforeground; -extern Lisp_Object Qformat, Qframe_live_p; +extern Lisp_Object Qformat, Qframe_live_p, Qgui_error; extern Lisp_Object Qicon_glyph_p, Qidentity; extern Lisp_Object Qinhibit_quit, Qinhibit_read_only; extern Lisp_Object Qinput_charset_conversion; extern Lisp_Object Qinteger_char_or_marker_p, Qinteger_or_char_p; extern Lisp_Object Qinteger_or_marker_p, Qintegerp, Qinteractive; -extern Lisp_Object Qinternal_error, Qinvalid_argument; -extern Lisp_Object Qinvalid_change, Qinvalid_function, Qinvalid_operation; +extern Lisp_Object Qinternal_error, Qinvalid_argument, Qinvalid_byte_code; +extern Lisp_Object Qinvalid_change, Qinvalid_constant, Qinvalid_function; +extern Lisp_Object Qinvalid_operation; extern Lisp_Object Qinvalid_read_syntax, Qinvalid_state; extern Lisp_Object Qio_error; extern Lisp_Object Qiso2022; @@ -3220,16 +3245,17 @@ extern Lisp_Object Qmnemonic; extern Lisp_Object Qmono_pixmap_image_instance_p; extern Lisp_Object Qmouse_leave_buffer_hook; -extern Lisp_Object Qnas, Qnatnump, Qnative_layout; +extern Lisp_Object Qnatnump, Qnative_layout, Qnetwork_error; extern Lisp_Object Qno_ascii_cntl, Qno_ascii_eol, Qno_catch; extern Lisp_Object Qno_conversion, Qno_iso6429; extern Lisp_Object Qnothing_image_instance_p; -extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp; +extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp, Qout_of_memory; extern Lisp_Object Qoutput_charset_conversion; extern Lisp_Object Qoverflow_error, Qpoint, Qpointer_glyph_p; extern Lisp_Object Qpointer_image_instance_p, Qpost_read_conversion; extern Lisp_Object Qpre_write_conversion, Qprint_length; -extern Lisp_Object Qprint_string_length, Qprogn, Qquit; +extern Lisp_Object Qprint_string_length, Qprinting_unreadable_object; +extern Lisp_Object Qprogn, Qprocess_error, Qquit; extern Lisp_Object Qquote, Qrange_error, Qread_char; extern Lisp_Object Qread_from_minibuffer, Qreally_early_error_handler; extern Lisp_Object Qregion_beginning, Qregion_end; @@ -3238,12 +3264,12 @@ extern Lisp_Object Qself_insert_command, Qself_insert_defer_undo; extern Lisp_Object Qsequencep, Qset, Qsetting_constant; extern Lisp_Object Qseven, Qshift_jis, Qshort; -extern Lisp_Object Qsingularity_error; +extern Lisp_Object Qsingularity_error, Qsound_error, Qstack_overflow; extern Lisp_Object Qstandard_input, Qstandard_output; extern Lisp_Object Qstart_open; -extern Lisp_Object Qstring_lessp, Qsubwindow; +extern Lisp_Object Qstring_lessp, Qstructure_formation_error, Qsubwindow; extern Lisp_Object Qsubwindow_image_instance_p; -extern Lisp_Object Qsyntax_error, Qt; +extern Lisp_Object Qsyntax_error, Qt, Qtext_conversion_error; extern Lisp_Object Qtext_image_instance_p; extern Lisp_Object Qtop_level; extern Lisp_Object Qtrue_list_p; diff -r c775bd016b32 -r 183866b06e0b src/lread.c --- a/src/lread.c Thu May 24 06:30:21 2001 +0000 +++ b/src/lread.c Thu May 24 07:51:33 2001 +0000 @@ -220,15 +220,13 @@ static DOESNT_RETURN read_syntax_error (const char *string) { - signal_error (Qinvalid_read_syntax, - list1 (build_translated_string (string))); + signal_error (Qinvalid_read_syntax, string, Qunbound); } static Lisp_Object continuable_read_syntax_error (const char *string) { - return Fsignal (Qinvalid_read_syntax, - list1 (build_translated_string (string))); + return signal_continuable_error (Qinvalid_read_syntax, string, Qunbound); } @@ -244,7 +242,7 @@ struct buffer *b = XBUFFER (readcharfun); if (!BUFFER_LIVE_P (b)) - error ("Reading from killed buffer"); + invalid_operation ("Reading from killed buffer", Qunbound); if (BUF_PT (b) >= BUF_ZV (b)) return -1; @@ -427,13 +425,13 @@ EMACS_INT pos; if (!INTP (XCDR (victim))) - signal_simple_error ("Bogus doc string reference", victim); + invalid_byte_code ("Bogus doc string reference", victim); pos = XINT (XCDR (victim)); if (pos < 0) pos = -pos; /* kludge to mark a user variable */ tem = unparesseuxify_doc_string (fd, pos, 0, Vload_file_name_internal); if (!STRINGP (tem)) - signal_error (Qerror, tem); + signal_error_1 (Qinvalid_byte_code, tem); return tem; } @@ -473,7 +471,7 @@ NGCPRO1 (juan); ivan = Fread (juan); if (!CONSP (ivan)) - signal_simple_error ("invalid lazy-loaded byte code", ivan); + invalid_byte_code ("invalid lazy-loaded byte code", ivan); XCOMPILED_FUNCTION (john)->instructions = XCAR (ivan); /* v18 or v19 bytecode file. Need to Ebolify. */ if (XCOMPILED_FUNCTION (john)->flags.ebolified @@ -598,7 +596,7 @@ if (fd < 0) { if (NILP (noerror)) - signal_file_error ("Cannot open load file", file); + signal_error (Qfile_error, "Cannot open load file", file); else { UNGCPRO; @@ -816,7 +814,7 @@ return XINT (mode); } else - signal_simple_error ("Invalid value", mode); + invalid_argument ("Invalid value", mode); return 0; /* unreached */ } @@ -1410,7 +1408,7 @@ QUIT; if (b != 0 && !BUFFER_LIVE_P (b)) - error ("Reading from killed buffer"); + invalid_operation ("Reading from killed buffer", Qunbound); c = readchar (readcharfun); if (c == ';') @@ -1487,7 +1485,7 @@ else buf = Fget_buffer (buffer); if (NILP (buf)) - error ("No such buffer."); + invalid_argument ("No such buffer", Qunbound); if (NILP (printflag)) tem = Qsymbolp; /* #### #@[]*&$#*[& SI:NULL-STREAM */ @@ -1672,7 +1670,7 @@ Emchar c = readchar (readcharfun); if (c < 0) - signal_error (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun))); + signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); switch (c) { @@ -1690,12 +1688,12 @@ case 'M': c = readchar (readcharfun); if (c < 0) - signal_error (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun))); + signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); if (c != '-') - error ("Invalid escape character syntax"); + syntax_error ("Invalid escape character syntax", Qunbound); c = readchar (readcharfun); if (c < 0) - signal_error (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun))); + signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); if (c == '\\') c = read_escape (readcharfun); return c | 0200; @@ -1725,15 +1723,15 @@ #define ctl_modifier (0x400000) #define meta_modifier (0x800000) */ -#define FSF_LOSSAGE(mask) \ - if (fail_on_bucky_bit_character_escapes || \ - ((c = readchar (readcharfun)) != '-')) \ - error ("Invalid escape character syntax"); \ - c = readchar (readcharfun); \ - if (c < 0) \ - signal_error (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun))); \ - if (c == '\\') \ - c = read_escape (readcharfun); \ +#define FSF_LOSSAGE(mask) \ + if (fail_on_bucky_bit_character_escapes || \ + ((c = readchar (readcharfun)) != '-')) \ + syntax_error ("Invalid escape character syntax", Qunbound); \ + c = readchar (readcharfun); \ + if (c < 0) \ + signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); \ + if (c == '\\') \ + c = read_escape (readcharfun); \ return c | mask case 'S': FSF_LOSSAGE (shift_modifier); @@ -1751,13 +1749,13 @@ case 'C': c = readchar (readcharfun); if (c < 0) - signal_error (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun))); + signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); if (c != '-') - error ("Invalid escape character syntax"); + syntax_error ("Invalid escape character syntax", Qunbound); case '^': c = readchar (readcharfun); if (c < 0) - signal_error (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun))); + signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); if (c == '\\') c = read_escape (readcharfun); /* FSFmacs junk for non-ASCII controls. @@ -1853,7 +1851,7 @@ { c = readchar (readcharfun); if (c < 0) - signal_error (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun))); + signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); *saw_a_backslash = 1; } Lstream_put_emchar (XLSTREAM (Vread_buffer_stream), c); @@ -2213,7 +2211,7 @@ QUIT; c = readchar (readcharfun); if (c < 0) - signal_error (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun))); + signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun)); switch (c) { @@ -2819,7 +2817,7 @@ else #endif if (ch != '.') - signal_simple_error ("BUG! Internal reader error", elt); + signal_error (Qinternal_error, "BUG! Internal reader error", elt); else if (!s->allow_dotted_lists) read_syntax_error ("\".\" in a vector"); else @@ -3118,25 +3116,25 @@ DEFSUBR (Feval_buffer); DEFSUBR (Feval_region); - defsymbol (&Qstandard_input, "standard-input"); - defsymbol (&Qread_char, "read-char"); - defsymbol (&Qcurrent_load_list, "current-load-list"); - defsymbol (&Qload, "load"); - defsymbol (&Qload_file_name, "load-file-name"); - defsymbol (&Qfset, "fset"); + DEFSYMBOL (Qstandard_input); + DEFSYMBOL (Qread_char); + DEFSYMBOL (Qcurrent_load_list); + DEFSYMBOL (Qload); + DEFSYMBOL (Qload_file_name); + DEFSYMBOL (Qfset); #ifdef LISP_BACKQUOTES - defsymbol (&Qbackquote, "backquote"); + DEFSYMBOL (Qbackquote); defsymbol (&Qbacktick, "`"); defsymbol (&Qcomma, ","); defsymbol (&Qcomma_at, ",@"); defsymbol (&Qcomma_dot, ",."); #endif - defsymbol (&Qexists, "exists"); - defsymbol (&Qreadable, "readable"); - defsymbol (&Qwritable, "writable"); - defsymbol (&Qexecutable, "executable"); + DEFSYMBOL (Qexists); + DEFSYMBOL (Qreadable); + DEFSYMBOL (Qwritable); + DEFSYMBOL (Qexecutable); } void @@ -3292,7 +3290,7 @@ Ffset (Qload, intern ("load-internal")); #ifdef FEATUREP_SYNTAX - defsymbol (&Qfeaturep, "featurep"); + DEFSYMBOL (Qfeaturep); Fprovide(intern("xemacs")); #ifdef INFODOCK Fprovide(intern("infodock")); diff -r c775bd016b32 -r 183866b06e0b src/lstream.c --- a/src/lstream.c Thu May 24 06:30:21 2001 +0000 +++ b/src/lstream.c Thu May 24 07:51:33 2001 +0000 @@ -288,14 +288,7 @@ } #define Lstream_internal_error(reason, lstr) \ - Lstream_signal_simple_error ("Internal error: " reason, lstr) - -static void Lstream_signal_simple_error (const char *reason, Lstream *lstr) -{ - Lisp_Object obj; - XSETLSTREAM (obj, lstr); - signal_simple_error (reason, obj); -} + signal_error (Qinternal_error, reason, wrap_lstream (lstr)) void Lstream_reopen (Lstream *lstr) diff -r c775bd016b32 -r 183866b06e0b src/lstream.h --- a/src/lstream.h Thu May 24 06:30:21 2001 +0000 +++ b/src/lstream.h Thu May 24 07:51:33 2001 +0000 @@ -33,6 +33,7 @@ DECLARE_LRECORD (lstream, struct lstream); #define XLSTREAM(x) XRECORD (x, lstream, struct lstream) #define XSETLSTREAM(x, p) XSETRECORD (x, p, lstream) +#define wrap_lstream(p) wrap_object (p) #define LSTREAMP(x) RECORDP (x, lstream) /* #define CHECK_LSTREAM(x) CHECK_RECORD (x, lstream) Lstream pointers should never escape to the Lisp level, so diff -r c775bd016b32 -r 183866b06e0b src/macros.c --- a/src/macros.c Thu May 24 06:30:21 2001 +0000 +++ b/src/macros.c Thu May 24 07:51:33 2001 +0000 @@ -62,7 +62,7 @@ /* This function can GC */ struct console *con = XCONSOLE (Vselected_console); if (!NILP (con->defining_kbd_macro)) - error ("Already defining kbd macro"); + invalid_operation ("Already defining kbd macro", Qunbound); if (NILP (con->kbd_macro_builder)) con->kbd_macro_builder = make_vector (30, Qnil); @@ -105,7 +105,7 @@ int repeat; if (NILP (con->defining_kbd_macro)) - error ("Not defining kbd macro"); + invalid_operation ("Not defining kbd macro", Qunbound); if (NILP (arg)) repeat = -1; @@ -193,7 +193,7 @@ } else if (!EQ (Vexecuting_macro, Qt)) /* Some things replace the macro with Qt to force an early exit. */ - error ("junk in executing-macro"); + signal_error (Qinvalid_state, "junk in executing-macro", Qunbound); Fthrow (Qexecute_kbd_macro, Qt); } @@ -234,9 +234,9 @@ struct console *con = XCONSOLE (Vselected_console); if (!NILP (con->defining_kbd_macro)) - error ("Can't execute anonymous macro while defining one"); + invalid_operation ("Can't execute anonymous macro while defining one", Qunbound); else if (NILP (con->last_kbd_macro)) - error ("No kbd macro has been defined"); + invalid_operation ("No kbd macro has been defined", Qunbound); else Fexecute_kbd_macro (con->last_kbd_macro, prefix); return Qnil; @@ -275,7 +275,7 @@ final = indirect_function (macro, 1); if (!STRINGP (final) && !VECTORP (final)) - error ("Keyboard macros must be strings or vectors"); + invalid_argument ("Keyboard macros must be strings or vectors", Qunbound); tem = Fcons (Vexecuting_macro, make_int (executing_macro_index)); record_unwind_protect (pop_kbd_macro, tem); @@ -307,7 +307,7 @@ DEFSUBR (Fcall_last_kbd_macro); DEFSUBR (Fexecute_kbd_macro); DEFSUBR (Fcancel_kbd_macro_events); - defsymbol (&Qexecute_kbd_macro, "execute-kbd-macro"); + DEFSYMBOL (Qexecute_kbd_macro); } void diff -r c775bd016b32 -r 183866b06e0b src/marker.c --- a/src/marker.c Thu May 24 06:30:21 2001 +0000 +++ b/src/marker.c Thu May 24 07:51:33 2001 +0000 @@ -59,7 +59,7 @@ char buf[200]; if (print_readably) - error ("printing unreadable object #", (long) marker); + printing_unreadable_object ("#", (long) marker); write_c_string (GETTEXT ("#buffer) @@ -186,8 +186,8 @@ (MARKERP (position) && !XMARKER (position)->buffer)) { if (point_p) - signal_simple_error ("Can't make point-marker point nowhere", - marker); + invalid_operation ("Can't make point-marker point nowhere", + marker); if (XMARKER (marker)->buffer) unchain_marker (marker); return marker; @@ -204,7 +204,7 @@ if (!BUFFER_LIVE_P (XBUFFER (buffer))) { if (point_p) - signal_simple_error + invalid_operation ("Can't move point-marker in a killed buffer", marker); if (XMARKER (marker)->buffer) unchain_marker (marker); @@ -231,8 +231,8 @@ #ifndef moving_point_by_moving_its_marker_is_a_bug BUF_SET_PT (b, charno); /* this will move the marker */ #else /* It's not a feature, so it must be a bug */ - signal_simple_error ("DEBUG: attempt to move point via point-marker", - marker); + invalid_operation ("DEBUG: attempt to move point via point-marker", + marker); #endif } else @@ -243,7 +243,7 @@ if (m->buffer != b) { if (point_p) - signal_simple_error ("Can't change buffer of point-marker", marker); + invalid_operation ("Can't change buffer of point-marker", marker); if (m->buffer != 0) unchain_marker (marker); m->buffer = b; @@ -327,7 +327,7 @@ Bytind pos; if (!buf) - error ("Marker does not point anywhere"); + invalid_argument ("Marker does not point anywhere", Qunbound); /* FSF claims that marker indices could end up denormalized, i.e. in the gap. This is way bogus if it ever happens, and means @@ -351,7 +351,7 @@ struct buffer *buf = XMARKER (marker)->buffer; if (!buf) - error ("Marker does not point anywhere"); + invalid_argument ("Marker does not point anywhere", Qunbound); return bytind_to_bufpos (buf, bi_marker_position (marker)); } @@ -363,7 +363,7 @@ struct buffer *buf = m->buffer; if (!buf) - error ("Marker does not point anywhere"); + invalid_argument ("Marker does not point anywhere", Qunbound); #ifdef ERROR_CHECK_BUFPOS if (pos < BI_BUF_BEG (buf) || pos > BI_BUF_Z (buf)) @@ -379,7 +379,7 @@ struct buffer *buf = XMARKER (marker)->buffer; if (!buf) - error ("Marker does not point anywhere"); + invalid_argument ("Marker does not point anywhere", Qunbound); set_bi_marker_position (marker, bufpos_to_bytind (buf, pos)); } diff -r c775bd016b32 -r 183866b06e0b src/md5.c --- a/src/md5.c Thu May 24 06:30:21 2001 +0000 +++ b/src/md5.c Thu May 24 07:51:33 2001 +0000 @@ -502,7 +502,7 @@ /* Default to binary. */ coding_system = Fget_coding_system (Qbinary); else - signal_simple_error ("No such coding system", coding); + invalid_argument ("No such coding system", coding); } } return coding_system; diff -r c775bd016b32 -r 183866b06e0b src/menubar-gtk.c --- a/src/menubar-gtk.c Thu May 24 06:30:21 2001 +0000 +++ b/src/menubar-gtk.c Thu May 24 07:51:33 2001 +0000 @@ -439,7 +439,7 @@ Lisp_Object cascade = desc; desc = Fcdr (desc); if (NILP (desc)) - signal_simple_error ("keyword in menu lacks a value", + sferror ("keyword in menu lacks a value", cascade); val = Fcar (desc); desc = Fcdr (desc); @@ -458,7 +458,7 @@ || CHARP (val)) wv->accel = LISP_TO_VOID (val); else - signal_simple_error ("bad keyboard accelerator", val); + invalid_argument ("bad keyboard accelerator", val); #endif } else if (EQ (key, Q_label)) @@ -466,7 +466,7 @@ /* implement in 21.2 */ } else - signal_simple_error ("unknown menu cascade keyword", cascade); + invalid_argument ("unknown menu cascade keyword", cascade); } gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, LISP_TO_VOID (desc)); @@ -486,7 +486,7 @@ } else { - signal_simple_error ("menu name (first element) must be a string", + invalid_argument ("menu name (first element) must be a string", desc); } @@ -612,7 +612,7 @@ GtkWidget *widget = NULL; if (length < 2) - signal_simple_error ("button descriptors must be at least 2 long", descr); + sferror ("button descriptors must be at least 2 long", descr); /* length 2: [ "name" callback ] length 3: [ "name" callback active-p ] @@ -636,7 +636,7 @@ /* the new way */ int i; if (length & 1) - signal_simple_error ( + sferror ( "button descriptor has an odd number of keywords and values", descr); @@ -647,7 +647,7 @@ Lisp_Object key = contents [i++]; Lisp_Object val = contents [i++]; if (!KEYWORDP (key)) - signal_simple_error_2 ("not a keyword", key, descr); + invalid_argument_2 ("not a keyword", key, descr); if (EQ (key, Q_active)) active_p = val; else if (EQ (key, Q_suffix)) suffix = val; @@ -663,12 +663,12 @@ if ( SYMBOLP (val) || CHARP (val)) accel = val; else - signal_simple_error ("bad keyboard accelerator", val); + invalid_argument ("bad keyboard accelerator", val); } else if (EQ (key, Q_filter)) - signal_simple_error(":filter keyword not permitted on leaf nodes", descr); + sferror(":filter keyword not permitted on leaf nodes", descr); else - signal_simple_error_2 ("unknown menu item keyword", key, descr); + invalid_argument_2 ("unknown menu item keyword", key, descr); } } @@ -809,7 +809,7 @@ } else { - signal_simple_error_2 ("unknown style", style, descr); + invalid_argument_2 ("unknown style", style, descr); } gtk_widget_set_sensitive (widget, ! NILP (active_p)); diff -r c775bd016b32 -r 183866b06e0b src/menubar-msw.c --- a/src/menubar-msw.c Thu May 24 06:30:21 2001 +0000 +++ b/src/menubar-msw.c Thu May 24 07:51:33 2001 +0000 @@ -150,7 +150,7 @@ while ((ptr = (Bufbyte *) memchr (ptr, '&', len - (ptr - item))) != NULL) { if (len + 2 > maxlen) - syntax_error ("Menu item produces too long displayable string", + invalid_argument ("Menu item produces too long displayable string", error_name); memmove (ptr + 1, ptr, (len - (ptr - item)) + 1); len++; @@ -194,7 +194,7 @@ { /* Force a default accelerator */ if (len + 2 > maxlen) - syntax_error ("Menu item produces too long displayable string", + invalid_argument ("Menu item produces too long displayable string", error_name); ptr = item; memmove (ptr + 1, ptr, len + 1); @@ -373,7 +373,7 @@ menu_parse_submenu_keywords (item, gui_item); if (!STRINGP (pgui_item->name)) - syntax_error ("Menu name (first element) must be a string", + invalid_argument ("Menu name (first element) must be a string", item); if (!gui_item_included_p (gui_item, Vmenubar_configuration)) @@ -479,7 +479,7 @@ UNGCPRO; } else - syntax_error ("Malformed menu item descriptor", item); + sferror ("Malformed menu item descriptor", item); if (flush_right) item_info.fType |= MFT_RIGHTJUSTIFY; /* can't support in 3.51 */ @@ -534,7 +534,7 @@ /* Check that menu name is specified when expected */ if (NILP (pgui_item->name) && deep_p) - syntax_error ("Menu must have a name", desc); + sferror ("Menu must have a name", desc); /* Apply filter if specified */ if (!NILP (pgui_item->filter)) @@ -744,14 +744,14 @@ #ifdef DEBUG_XEMACS /* Allow to continue in a debugger after assert - not so fatal */ if (UNBOUNDP (path)) - error ("internal menu error"); + signal_error (Qinternal_error, "internal menu error", Qunbound); #endif /* Now find a desc chunk for it. If none, then probably menu open hook has played too much games around stuff */ desc = Fmenu_find_real_submenu (current_menudesc, path); if (NILP (desc)) - signal_simple_error ("This menu does not exist any more", path); + invalid_state ("This menu does not exist any more", path); /* Now, stuff it */ /* DESC may be generated by filter, so we have to gcpro it */ @@ -956,8 +956,8 @@ if (!ok) { menu_cleanup (f); - signal_simple_error ("Cannot track popup menu while in menu", - menu_desc); + invalid_operation ("Cannot track popup menu while in menu", + menu_desc); } UNGCPRO; } diff -r c775bd016b32 -r 183866b06e0b src/menubar-x.c --- a/src/menubar-x.c Thu May 24 06:30:21 2001 +0000 +++ b/src/menubar-x.c Thu May 24 07:51:33 2001 +0000 @@ -173,7 +173,7 @@ Lisp_Object cascade = desc; desc = Fcdr (desc); if (NILP (desc)) - syntax_error ("Keyword in menu lacks a value", cascade); + sferror ("Keyword in menu lacks a value", cascade); val = Fcar (desc); desc = Fcdr (desc); if (EQ (key, Q_included)) @@ -190,14 +190,14 @@ || CHARP (val)) wv->accel = LISP_TO_VOID (val); else - syntax_error ("bad keyboard accelerator", val); + invalid_argument ("bad keyboard accelerator", val); } else if (EQ (key, Q_label)) { /* implement in 21.2 */ } else - syntax_error ("Unknown menu cascade keyword", cascade); + invalid_argument ("Unknown menu cascade keyword", cascade); } if ((!NILP (config_tag) @@ -284,7 +284,7 @@ } else { - syntax_error ("Menu name (first element) must be a string", desc); + sferror ("Menu name (first element) must be a string", desc); } if (deep_p || menubar_root_p) @@ -296,7 +296,7 @@ if (menubar_root_p && NILP (child)) /* the partition */ { if (partition_seen) - syntax_error + sferror ("More than one partition (nil) in menubar description", desc); partition_seen = 1; @@ -321,9 +321,9 @@ wv = NULL; } else if (NILP (desc)) - syntax_error ("nil may not appear in menu descriptions", desc); + sferror ("nil may not appear in menu descriptions", desc); else - syntax_error ("Unrecognized menu descriptor", desc); + sferror ("Unrecognized menu descriptor", desc); menu_item_done: @@ -814,7 +814,7 @@ CHECK_STRING (XCAR (menu_desc)); data = menu_item_descriptor_to_widget_value (menu_desc, POPUP_TYPE, 1, 1); - if (! data) error ("no menu"); + if (! data) signal_error (Qgui_error, "no menu", Qunbound); menu_id = new_lwlib_id (); menu = lw_create_widget ("popup", "popup" /* data->name */, menu_id, data, @@ -1332,7 +1332,7 @@ widget_value *val; if (NILP (f->menubar_data)) - error ("Frame has no menubar."); + invalid_argument ("Frame has no menubar", Qunbound); id = XPOPUP_DATA (f->menubar_data)->id; val = lw_get_all_values (id); diff -r c775bd016b32 -r 183866b06e0b src/menubar.c --- a/src/menubar.c Thu May 24 06:30:21 2001 +0000 +++ b/src/menubar.c Thu May 24 07:51:33 2001 +0000 @@ -381,18 +381,18 @@ void syms_of_menubar (void) { - defsymbol (&Qcurrent_menubar, "current-menubar"); + DEFSYMBOL (Qcurrent_menubar); - defsymbol (&Qmenu_force, "menu-force"); - defsymbol (&Qmenu_fallback, "menu-fallback"); + DEFSYMBOL (Qmenu_force); + DEFSYMBOL (Qmenu_fallback); - defsymbol (&Qmenu_quit, "menu-quit"); - defsymbol (&Qmenu_up, "menu-up"); - defsymbol (&Qmenu_down, "menu-down"); - defsymbol (&Qmenu_left, "menu-left"); - defsymbol (&Qmenu_right, "menu-right"); - defsymbol (&Qmenu_select, "menu-select"); - defsymbol (&Qmenu_escape, "menu-escape"); + DEFSYMBOL (Qmenu_quit); + DEFSYMBOL (Qmenu_up); + DEFSYMBOL (Qmenu_down); + DEFSYMBOL (Qmenu_left); + DEFSYMBOL (Qmenu_right); + DEFSYMBOL (Qmenu_select); + DEFSYMBOL (Qmenu_escape); DEFSUBR (Fpopup_menu); DEFSUBR (Fnormalize_menu_item_name); @@ -625,7 +625,7 @@ the menubar will still be performed optimally. */ ); Vactivate_menubar_hook = Qnil; - defsymbol (&Qactivate_menubar_hook, "activate-menubar-hook"); + DEFSYMBOL (Qactivate_menubar_hook); DEFVAR_BOOL ("menubar-show-keybindings", &menubar_show_keybindings /* If true, the menubar will display keyboard equivalents. diff -r c775bd016b32 -r 183866b06e0b src/minibuf.c --- a/src/minibuf.c Thu May 24 06:30:21 2001 +0000 +++ b/src/minibuf.c Thu May 24 07:51:33 2001 +0000 @@ -393,8 +393,8 @@ Lisp_Symbol *next; if (!SYMBOLP (bucket)) { - signal_simple_error ("Bad obarray passed to try-completions", - bucket); + invalid_argument ("Bad obarray passed to try-completions", + bucket); } next = symbol_next (XSYMBOL (bucket)); elt = bucket; @@ -927,9 +927,9 @@ void syms_of_minibuf (void) { - defsymbol (&Qminibuffer_setup_hook, "minibuffer-setup-hook"); + DEFSYMBOL (Qminibuffer_setup_hook); - defsymbol (&Qcompletion_ignore_case, "completion-ignore-case"); + DEFSYMBOL (Qcompletion_ignore_case); DEFSUBR (Fminibuffer_depth); #if 0 @@ -942,10 +942,10 @@ DEFSUBR (Ftry_completion); DEFSUBR (Fall_completions); - defsymbol (&Qappend_message, "append-message"); - defsymbol (&Qclear_message, "clear-message"); - defsymbol (&Qdisplay_message, "display-message"); - defsymbol (&Qcurrent_message_label, "current-message-label"); + DEFSYMBOL (Qappend_message); + DEFSYMBOL (Qclear_message); + DEFSYMBOL (Qdisplay_message); + DEFSYMBOL (Qcurrent_message_label); } void diff -r c775bd016b32 -r 183866b06e0b src/miscplay.c --- a/src/miscplay.c Thu May 24 06:30:21 2001 +0000 +++ b/src/miscplay.c Thu May 24 07:51:33 2001 +0000 @@ -16,17 +16,18 @@ ** implied warranty. */ -#ifdef HAVE_CONFIG_H +/* Synched up with: Not in FSF. */ + +/* This file Mule-ized by Ben Wing, 5-15-01. */ + #include -#endif +#include "lisp.h" #include "miscplay.h" -#include "lisp.h" +#include "sound.h" + #include "syssignal.h" #include "sysfile.h" -#define warn(str) message("audio: %s ",GETTEXT(str)) - -#include #ifdef __GNUC__ #define UNUSED(x) ((void)(x)) @@ -53,7 +54,7 @@ int align; enum wvState state; size_t left; - unsigned char leftover[HEADERSZ]; + UChar_Binary leftover[HEADERSZ]; signed long chunklength; } wave; struct { @@ -61,13 +62,13 @@ int isdata; int skipping; size_t left; - unsigned char leftover[HEADERSZ]; + UChar_Binary leftover[HEADERSZ]; } audio; } parsestate; /* Use a global buffer as scratch-pad for possible conversions of the sampling format */ -unsigned char miscplay_sndbuf[SNDBUFSZ]; +UChar_Binary miscplay_sndbuf[SNDBUFSZ]; /* Initialize global parser state information to zero */ void reset_parsestate() @@ -81,7 +82,7 @@ { if (parsestate.wave.state != wvOutOfBlock && parsestate.wave.state != wvFatal) { - warn("Unexpected end of WAVE file"); + sound_warn("Unexpected end of WAVE file"); return 0; } else return 1; @@ -118,7 +119,7 @@ int rc = 1; if (rq > HEADERSZ) { - warn("Header size exceeded while parsing WAVE file"); + sound_warn("Header size exceeded while parsing WAVE file"); parsestate.wave.state = wvFatal; *sz = 0; return(0); } @@ -128,7 +129,7 @@ memcpy(parsestate.wave.leftover+parsestate.wave.left, *data,rq); parsestate.wave.left += rq; - (*(unsigned char **)data) += rq; + (*(UChar_Binary **)data) += rq; *sz -= rq; return(rc); } @@ -171,7 +172,7 @@ if (parsestate.wave.align != 1 && parsestate.wave.align != 2 && parsestate.wave.align != 4) { - warn("Illegal datawidth detected while parsing WAVE file"); + sound_warn("Illegal datawidth detected while parsing WAVE file"); parsestate.wave.state = wvFatal; } else parsestate.wave.state = wvOutOfBlock; @@ -199,7 +200,7 @@ else { if (parsestate.wave.chunklength > 0 && *sz > 0) { *sz -= parsestate.wave.chunklength; - (*(unsigned char **)data) += parsestate.wave.chunklength; } + (*(UChar_Binary **)data) += parsestate.wave.chunklength; } parsestate.wave.state = wvOutOfBlock; } break; case wvSoundChunk: { @@ -224,7 +225,7 @@ count = *sz; count -= rq = count % parsestate.wave.align; } *outbuf = *data; - (*(unsigned char **)data) += count; + (*(UChar_Binary **)data) += count; *sz -= count; if ((parsestate.wave.chunklength -= count) < parsestate.wave.align) { parsestate.wave.state = wvOutOfBlock; @@ -239,7 +240,7 @@ waverequire(data,sz,rq); return(count); } case wvFatalNotify: - warn("Irrecoverable error while parsing WAVE file"); + sound_warn("Irrecoverable error while parsing WAVE file"); parsestate.wave.state = wvFatal; break; case wvFatal: @@ -265,7 +266,7 @@ count = parsestate.audio.align - parsestate.audio.left); *outbuf = parsestate.audio.leftover; *sz -= count; - *data = (*(char **)data) + count; + *data = (*(Char_Binary **)data) + count; parsestate.audio.left = 0; return(parsestate.audio.align); } else { @@ -273,7 +274,7 @@ memmove(parsestate.audio.leftover + parsestate.audio.left, *data, *sz); - *data = (*(char **)data) + *sz; + *data = (*(Char_Binary **)data) + *sz; parsestate.audio.left += *sz; *sz = 0; return(0); } } @@ -285,7 +286,7 @@ *outbuf = *data; if ((parsestate.audio.left = rc % parsestate.audio.align) != 0) { memmove(parsestate.audio.leftover, - (char *)*outbuf + rc - parsestate.audio.left, + (Char_Binary *)*outbuf + rc - parsestate.audio.left, parsestate.audio.left); rc -= parsestate.audio.left; } *sz = 0; @@ -295,9 +296,9 @@ header information and determine how many bytes we need to skip until the start of the sound chunk */ if (!parsestate.audio.skipping) { - unsigned char *header = (unsigned char *) *data; + UChar_Binary *header = (UChar_Binary *) *data; if (*sz < 8) { - warn("Irrecoverable error while parsing Sun/DEC audio file"); + sound_warn("Irrecoverable error while parsing Sun/DEC audio file"); return(0); } /* Keep compatibility with Linux 68k, etc. by not relying on byte-sex */ if (header[3]) { /* Sun audio (big endian) */ @@ -317,10 +318,10 @@ if (*sz >= (size_t) parsestate.audio.skipping) { /* Skip just the header information and return the sound chunk */ int rc = *sz - parsestate.audio.skipping; - *outbuf = (char *)*data + parsestate.audio.skipping; + *outbuf = (Char_Binary *)*data + parsestate.audio.skipping; if ((parsestate.audio.left = rc % parsestate.audio.align) != 0) { memmove(parsestate.audio.leftover, - (char *)*outbuf + rc - parsestate.audio.left, + (Char_Binary *)*outbuf + rc - parsestate.audio.left, parsestate.audio.left); rc -= parsestate.audio.left; } *sz = 0; @@ -348,20 +349,20 @@ /* Convert 8 bit unsigned stereo data to 8 bit unsigned mono data */ size_t sndcnv8U_2mono(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (unsigned char)(((int)*(src) + + *dest++ = (UChar_Binary)(((int)*(src) + (int)*(src+1)) / 2); src += 2; } @@ -372,21 +373,21 @@ /* Convert 8 bit signed stereo data to 8 bit signed mono data */ size_t sndcnv8S_2mono(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc, count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (unsigned char)(((int)*((signed char *)(src)) + - (int)*((signed char *)(src+1))) / 2); + *dest++ = (UChar_Binary)(((int)*((signed Char_Binary *)(src)) + + (int)*((signed Char_Binary *)(src+1))) / 2); src += 2; } *data = src; @@ -396,21 +397,21 @@ /* Convert 8 bit signed stereo data to 8 bit unsigned mono data */ size_t sndcnv2monounsigned(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (unsigned char)(((int)*((signed char *)(src)) + - (int)*((signed char *)(src+1))) / 2) ^ 0x80; + *dest++ = (UChar_Binary)(((int)*((signed Char_Binary *)(src)) + + (int)*((signed Char_Binary *)(src+1))) / 2) ^ 0x80; src += 2; } *data = src; @@ -420,15 +421,15 @@ /* Convert 8 bit signed mono data to 8 bit unsigned mono data */ size_t sndcnv2unsigned(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; count = *sz; if (count > SNDBUFSZ) { *sz -= SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) @@ -439,7 +440,7 @@ /* Convert a number in the range -32768..32767 to an 8 bit ulaw encoded number --- I hope, I got this conversion right :-) */ -static inline signed char int2ulaw(int i) +static inline signed Char_Binary int2ulaw(int i) { /* Lookup table for fast calculation of number of bits that need shifting*/ static short int t_bits[128] = { @@ -464,7 +465,7 @@ size_t sndcnvULaw_2linear(void **data,size_t *sz,void **outbuf) { /* conversion table stolen from Linux's ulaw.h */ - static unsigned char ulaw_dsp[] = { + static UChar_Binary ulaw_dsp[] = { 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 66, 68, 70, 72, 74, 76, 78, 80, @@ -498,7 +499,7 @@ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - unsigned char *p=(unsigned char *)*data; + UChar_Binary *p=(UChar_Binary *)*data; *outbuf = *data; while ((*sz)--) @@ -508,7 +509,7 @@ } *sz = 0; *data = p; - return p - (unsigned char *)*outbuf; + return p - (UChar_Binary *)*outbuf; } /* Convert 8 bit ulaw stereo data to 8 bit ulaw mono data */ @@ -550,15 +551,15 @@ +60, +56, +52, +48, +44, +40, +36, +32, +28, +24, +20, +16, +12, +8, +4, +0}; - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) @@ -596,8 +597,8 @@ signed mono data */ size_t sndcnv16_2monoLE(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; signed short i; @@ -605,7 +606,7 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; for (count /= 2; count--; ) { @@ -614,8 +615,8 @@ (int)(src[2]) + 256*(int)(src[3])) / 2; src += 4; - *dest++ = (unsigned char)(i & 0xFF); - *dest++ = (unsigned char)((i / 256) & 0xFF); } + *dest++ = (UChar_Binary)(i & 0xFF); + *dest++ = (UChar_Binary)((i / 256) & 0xFF); } *data = src; return(rc); } @@ -624,8 +625,8 @@ signed mono data */ size_t sndcnv16_2monoBE(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; signed short i; @@ -633,7 +634,7 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; for (count /= 2; count--; ) { @@ -642,8 +643,8 @@ (int)(src[3]) + 256*(int)(src[2])) / 2; src += 4; - *dest++ = (unsigned char)((i / 256) & 0xFF); - *dest++ = (unsigned char)(i & 0xFF); } + *dest++ = (UChar_Binary)((i / 256) & 0xFF); + *dest++ = (UChar_Binary)(i & 0xFF); } *data = src; return(rc); } @@ -651,19 +652,19 @@ /* Convert 16 bit little endian signed data to 8 bit unsigned data */ size_t sndcnv2byteLE(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (unsigned char)(((signed char *)src)[1] ^ (signed char)0x80); + *dest++ = (UChar_Binary)(((signed Char_Binary *)src)[1] ^ (signed Char_Binary)0x80); src += 2; } *data = src; @@ -673,19 +674,19 @@ /* Convert 16 bit big endian signed data to 8 bit unsigned data */ size_t sndcnv2byteBE(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (unsigned char)(((signed char *)src)[0] ^ (signed char)0x80); + *dest++ = (UChar_Binary)(((signed Char_Binary *)src)[0] ^ (signed Char_Binary)0x80); src += 2; } *data = src; @@ -696,20 +697,20 @@ mono data */ size_t sndcnv2monobyteLE(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; count = *sz / 4; if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (unsigned char)(((int)((signed char *)src)[1] + - (int)((signed char *)src)[3]) / 2 ^ 0x80); + *dest++ = (UChar_Binary)(((int)((signed Char_Binary *)src)[1] + + (int)((signed Char_Binary *)src)[3]) / 2 ^ 0x80); src += 4; } *data = src; @@ -720,20 +721,20 @@ mono data */ size_t sndcnv2monobyteBE(void **data,size_t *sz,void **outbuf) { - REGISTER unsigned char *src; - REGISTER unsigned char *dest; + REGISTER UChar_Binary *src; + REGISTER UChar_Binary *dest; int rc,count; count = *sz / 4; if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (unsigned char *) *data; + src = (UChar_Binary *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (unsigned char)(((int)((signed char *)src)[0] + - (int)((signed char *)src)[2]) / 2 ^ 0x80); + *dest++ = (UChar_Binary)(((int)((signed Char_Binary *)src)[0] + + (int)((signed Char_Binary *)src)[2]) / 2 ^ 0x80); src += 4; } *data = src; @@ -743,7 +744,7 @@ /* Look at the header of the sound file and try to determine the format; we can recognize files in VOC, WAVE, and, Sun/DEC-audio format--- everything else is assumed to be raw 8 bit unsigned data sampled at 8kHz */ -fmtType analyze_format(unsigned char *format,int *fmt,int *speed, +fmtType analyze_format(UChar_Binary *format,int *fmt,int *speed, int *tracks, size_t (**parsesndfile)(void **,size_t *sz, void **)) diff -r c775bd016b32 -r 183866b06e0b src/miscplay.h --- a/src/miscplay.h Thu May 24 06:30:21 2001 +0000 +++ b/src/miscplay.h Thu May 24 07:51:33 2001 +0000 @@ -16,11 +16,13 @@ ** implied warranty. */ +/* Synched up with: Not in FSF. */ + +/* This file Mule-ized by Ben Wing, 5-15-01. */ + #ifndef INCLUDED_miscplay_h_ #define INCLUDED_miscplay_h_ -#include - #define HEADERSZ 256 /* has to be at least as big as the biggest header */ #define SNDBUFSZ 2048 /* has to be at least as big as HEADERSZ */ @@ -53,7 +55,7 @@ size_t sndcnv2monobyteLE(void **data,size_t *sz,void **outbuf); size_t sndcnv2monobyteBE(void **data,size_t *sz,void **outbuf); -fmtType analyze_format(unsigned char *format,int *fmt,int *speed, +fmtType analyze_format(UChar_Binary *format,int *fmt,int *speed, int *tracks, size_t (**parsesndfile)(void **,size_t *sz, void **)); diff -r c775bd016b32 -r 183866b06e0b src/mule-ccl.c --- a/src/mule-ccl.c Thu May 24 06:30:21 2001 +0000 +++ b/src/mule-ccl.c Thu May 24 07:51:33 2001 +0000 @@ -1993,11 +1993,11 @@ int i; if (setup_ccl_program (&ccl, ccl_prog) < 0) - error ("Invalid CCL program"); + syntax_error ("Invalid CCL program", Qunbound); CHECK_VECTOR (reg); if (XVECTOR_LENGTH (reg) != 8) - error ("Length of vector REGISTERS is not 8"); + syntax_error ("Length of vector REGISTERS is not 8", Qunbound); for (i = 0; i < 8; i++) ccl.reg[i] = (INTP (XVECTOR_DATA (reg)[i]) @@ -2009,7 +2009,7 @@ CCL_MODE_ENCODING); QUIT; if (ccl.status != CCL_STAT_SUCCESS) - error ("Error in CCL program at %dth code", ccl.ic); + signal_error (Qccl_error, "Error in CCL program at code numbered ...", make_int (ccl.ic)); for (i = 0; i < 8; i++) XSETINT (XVECTOR (reg)->contents[i], ccl.reg[i]); @@ -2050,11 +2050,11 @@ struct gcpro gcpro1, gcpro2; if (setup_ccl_program (&ccl, ccl_prog) < 0) - error ("Invalid CCL program"); + syntax_error ("Invalid CCL program", Qunbound); CHECK_VECTOR (status); if (XVECTOR (status)->size != 9) - error ("Length of vector STATUS is not 9"); + syntax_error ("Length of vector STATUS is not 9", Qunbound); CHECK_STRING (string); GCPRO2 (status, string); @@ -2087,10 +2087,10 @@ Dynarr_free (outbuf); QUIT; if (ccl.status == CCL_STAT_SUSPEND_BY_DST) - error ("Output buffer for the CCL programs overflow"); + signal_error (Qccl_error, "Output buffer for the CCL programs overflow", Qunbound); if (ccl.status != CCL_STAT_SUCCESS && ccl.status != CCL_STAT_SUSPEND_BY_SRC) - error ("Error in CCL program at %dth code", ccl.ic); + signal_error (Qccl_error, "Error in CCL program at code numbered...", make_int (ccl.ic)); return val; } @@ -2241,10 +2241,10 @@ staticpro (&Vccl_program_table); Vccl_program_table = Fmake_vector (make_int (32), Qnil); - defsymbol (&Qccl_program, "ccl-program"); - defsymbol (&Qccl_program_idx, "ccl-program-idx"); - defsymbol (&Qcode_conversion_map, "code-conversion-map"); - defsymbol (&Qcode_conversion_map_id, "code-conversion-map-id"); + DEFSYMBOL (Qccl_program); + DEFSYMBOL (Qccl_program_idx); + DEFSYMBOL (Qcode_conversion_map); + DEFSYMBOL (Qcode_conversion_map_id); DEFVAR_LISP ("code-conversion-map-vector", &Vcode_conversion_map_vector /* Vector of code conversion maps. diff -r c775bd016b32 -r 183866b06e0b src/mule-charset.c --- a/src/mule-charset.c Thu May 24 06:30:21 2001 +0000 +++ b/src/mule-charset.c Thu May 24 07:51:33 2001 +0000 @@ -404,9 +404,10 @@ char buf[200]; if (print_readably) - error ("printing unreadable object #", - string_data (XSYMBOL (CHARSET_NAME (cs))->name), - cs->header.uid); + printing_unreadable_object ("#", + string_data (XSYMBOL (CHARSET_NAME (cs))-> + name), + cs->header.uid); write_c_string ("# 2) - signal_simple_error ("Invalid value for 'dimension", value); + invalid_constant ("Invalid value for 'dimension", value); } else if (EQ (keyword, Qchars)) @@ -712,7 +713,7 @@ CHECK_INT (value); chars = XINT (value); if (chars != 94 && chars != 96) - signal_simple_error ("Invalid value for 'chars", value); + invalid_constant ("Invalid value for 'chars", value); } else if (EQ (keyword, Qcolumns)) @@ -720,7 +721,7 @@ CHECK_INT (value); columns = XINT (value); if (columns != 1 && columns != 2) - signal_simple_error ("Invalid value for 'columns", value); + invalid_constant ("Invalid value for 'columns", value); } else if (EQ (keyword, Qgraphic)) @@ -728,7 +729,7 @@ CHECK_INT (value); graphic = XINT (value); if (graphic < 0 || graphic > 1) - signal_simple_error ("Invalid value for 'graphic", value); + invalid_constant ("Invalid value for 'graphic", value); } else if (EQ (keyword, Qregistry)) @@ -744,7 +745,7 @@ else if (EQ (value, Qr2l)) direction = CHARSET_RIGHT_TO_LEFT; else - signal_simple_error ("Invalid value for 'direction", value); + invalid_constant ("Invalid value for 'direction", value); } else if (EQ (keyword, Qfinal)) @@ -752,7 +753,7 @@ CHECK_CHAR_COERCE_INT (value); final = XCHAR (value); if (final < '0' || final > '~') - signal_simple_error ("Invalid value for 'final", value); + invalid_constant ("Invalid value for 'final", value); } else if (EQ (keyword, Qccl_program)) @@ -760,19 +761,19 @@ struct ccl_program test_ccl; if (setup_ccl_program (&test_ccl, value) < 0) - signal_simple_error ("Invalid value for 'ccl-program", value); + invalid_argument ("Invalid value for 'ccl-program", value); ccl_program = value; } else - signal_simple_error ("Unrecognized property", keyword); + invalid_constant ("Unrecognized property", keyword); } } if (!final) - error ("'final must be specified"); + invalid_argument ("'final must be specified", Qunbound); if (dimension == 2 && final > 0x5F) - signal_simple_error + invalid_constant ("Final must be in the range 0x30 - 0x5F for dimension == 2", make_char (final)); @@ -824,12 +825,12 @@ charset = Fget_charset (charset); if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset))) - signal_simple_error ("Charset already has reverse-direction charset", + invalid_operation ("Charset already has reverse-direction charset", charset); CHECK_SYMBOL (new_name); if (!NILP (Ffind_charset (new_name))) - signal_simple_error ("Cannot redefine existing charset", new_name); + invalid_operation ("Cannot redefine existing charset", new_name); cs = XCHARSET (charset); @@ -888,27 +889,27 @@ CHECK_INT (dimension); dm = XINT (dimension); if (dm < 1 || dm > 2) - signal_simple_error ("Invalid value for DIMENSION", dimension); + invalid_constant ("Invalid value for DIMENSION", dimension); CHECK_INT (chars); ch = XINT (chars); if (ch != 94 && ch != 96) - signal_simple_error ("Invalid value for CHARS", chars); + invalid_constant ("Invalid value for CHARS", chars); CHECK_CHAR_COERCE_INT (final); fi = XCHAR (final); if (fi < '0' || fi > '~') - signal_simple_error ("Invalid value for FINAL", final); + invalid_constant ("Invalid value for FINAL", final); if (EQ (direction, Ql2r)) di = CHARSET_LEFT_TO_RIGHT; else if (EQ (direction, Qr2l)) di = CHARSET_RIGHT_TO_LEFT; else if (!NILP (direction)) - signal_simple_error ("Invalid value for DIRECTION", direction); + invalid_constant ("Invalid value for DIRECTION", direction); if (dm == 2 && fi > 0x5F) - signal_simple_error + invalid_constant ("Final must be in the range 0x30 - 0x5F for dimension == 2", final); if (dm == 1) @@ -994,7 +995,7 @@ /* #### Is this translation OK? If so, error checking sufficient? */ return CHARSETP (obj) ? XCHARSET_NAME (obj) : obj; } - signal_simple_error ("Unrecognized charset property name", prop); + invalid_constant ("Unrecognized charset property name", prop); return Qnil; /* not reached */ } @@ -1018,7 +1019,7 @@ charset = Fget_charset (charset); if (setup_ccl_program (&test_ccl, ccl_program) < 0) - signal_simple_error ("Invalid ccl-program", ccl_program); + invalid_argument ("Invalid ccl-program", ccl_program); XCHARSET_CCL_PROGRAM (charset) = ccl_program; face_property_was_changed (Vdefault_face, Qfont, Qglobal); return Qnil; @@ -1089,7 +1090,7 @@ if (CHARSET_DIMENSION (cs) == 1) { if (!NILP (arg2)) - signal_simple_error + invalid_argument ("Charset is of dimension one; second octet must be nil", arg2); return make_char (MAKE_CHAR (charset, a1, 0)); } @@ -1131,7 +1132,7 @@ else if (EQ (n, make_int (1))) return make_int (octet1); else - signal_simple_error ("Octet number must be 0 or 1", n); + invalid_constant ("Octet number must be 0 or 1", n); } DEFUN ("split-char", Fsplit_char, 1, 1, 0, /* @@ -1181,7 +1182,7 @@ if (UNBOUNDP (ch)) { if (composite_char_row_next >= 128) - signal_simple_error ("No more composite chars available", lispstr); + invalid_operation ("No more composite chars available", lispstr); emch = MAKE_CHAR (Vcharset_composite, composite_char_row_next, composite_char_col_next); Fputhash (make_char (emch), lispstr, @@ -1232,7 +1233,7 @@ CHECK_CHAR (ch); emch = XCHAR (ch); if (CHAR_LEADING_BYTE (emch) != LEADING_BYTE_COMPOSITE) - signal_simple_error ("Must be composite char", ch); + invalid_argument ("Must be composite char", ch); return composite_char_string (emch); } #endif /* ENABLE_COMPOSITE_CHARS */ @@ -1275,45 +1276,45 @@ DEFSUBR (Fcomposite_char_string); #endif - defsymbol (&Qcharsetp, "charsetp"); - defsymbol (&Qregistry, "registry"); - defsymbol (&Qfinal, "final"); - defsymbol (&Qgraphic, "graphic"); - defsymbol (&Qdirection, "direction"); - defsymbol (&Qreverse_direction_charset, "reverse-direction-charset"); - defsymbol (&Qshort_name, "short-name"); - defsymbol (&Qlong_name, "long-name"); + DEFSYMBOL (Qcharsetp); + DEFSYMBOL (Qregistry); + DEFSYMBOL (Qfinal); + DEFSYMBOL (Qgraphic); + DEFSYMBOL (Qdirection); + DEFSYMBOL (Qreverse_direction_charset); + DEFSYMBOL (Qshort_name); + DEFSYMBOL (Qlong_name); - defsymbol (&Ql2r, "l2r"); - defsymbol (&Qr2l, "r2l"); + DEFSYMBOL (Ql2r); + DEFSYMBOL (Qr2l); /* Charsets, compatible with FSF 20.3 Naming convention is Script-Charset[-Edition] */ - defsymbol (&Qascii, "ascii"); - defsymbol (&Qcontrol_1, "control-1"); - defsymbol (&Qlatin_iso8859_1, "latin-iso8859-1"); - defsymbol (&Qlatin_iso8859_2, "latin-iso8859-2"); - defsymbol (&Qlatin_iso8859_3, "latin-iso8859-3"); - defsymbol (&Qlatin_iso8859_4, "latin-iso8859-4"); - defsymbol (&Qthai_tis620, "thai-tis620"); - defsymbol (&Qgreek_iso8859_7, "greek-iso8859-7"); - defsymbol (&Qarabic_iso8859_6, "arabic-iso8859-6"); - defsymbol (&Qhebrew_iso8859_8, "hebrew-iso8859-8"); - defsymbol (&Qkatakana_jisx0201, "katakana-jisx0201"); - defsymbol (&Qlatin_jisx0201, "latin-jisx0201"); - defsymbol (&Qcyrillic_iso8859_5, "cyrillic-iso8859-5"); - defsymbol (&Qlatin_iso8859_9, "latin-iso8859-9"); - defsymbol (&Qjapanese_jisx0208_1978, "japanese-jisx0208-1978"); - defsymbol (&Qchinese_gb2312, "chinese-gb2312"); - defsymbol (&Qjapanese_jisx0208, "japanese-jisx0208"); - defsymbol (&Qkorean_ksc5601, "korean-ksc5601"); - defsymbol (&Qjapanese_jisx0212, "japanese-jisx0212"); - defsymbol (&Qchinese_cns11643_1, "chinese-cns11643-1"); - defsymbol (&Qchinese_cns11643_2, "chinese-cns11643-2"); - defsymbol (&Qchinese_big5_1, "chinese-big5-1"); - defsymbol (&Qchinese_big5_2, "chinese-big5-2"); + DEFSYMBOL (Qascii); + DEFSYMBOL (Qcontrol_1); + DEFSYMBOL (Qlatin_iso8859_1); + DEFSYMBOL (Qlatin_iso8859_2); + DEFSYMBOL (Qlatin_iso8859_3); + DEFSYMBOL (Qlatin_iso8859_4); + DEFSYMBOL (Qthai_tis620); + DEFSYMBOL (Qgreek_iso8859_7); + DEFSYMBOL (Qarabic_iso8859_6); + DEFSYMBOL (Qhebrew_iso8859_8); + DEFSYMBOL (Qkatakana_jisx0201); + DEFSYMBOL (Qlatin_jisx0201); + DEFSYMBOL (Qcyrillic_iso8859_5); + DEFSYMBOL (Qlatin_iso8859_9); + DEFSYMBOL (Qjapanese_jisx0208_1978); + DEFSYMBOL (Qchinese_gb2312); + DEFSYMBOL (Qjapanese_jisx0208); + DEFSYMBOL (Qkorean_ksc5601); + DEFSYMBOL (Qjapanese_jisx0212); + DEFSYMBOL (Qchinese_cns11643_1); + DEFSYMBOL (Qchinese_cns11643_2); + DEFSYMBOL (Qchinese_big5_1); + DEFSYMBOL (Qchinese_big5_2); - defsymbol (&Qcomposite, "composite"); + DEFSYMBOL (Qcomposite); } void diff -r c775bd016b32 -r 183866b06e0b src/mule-wnnfns.c --- a/src/mule-wnnfns.c Thu May 24 06:30:21 2001 +0000 +++ b/src/mule-wnnfns.c Thu May 24 07:51:33 2001 +0000 @@ -1098,7 +1098,7 @@ else if (EQ (key, Qwnn_kaikakko)) param.p15 = setval; else { - signal_simple_error ("Invalid wnn keyword", key); + invalid_constant ("Invalid wnn keyword", key); return Qnil; } } @@ -1848,14 +1848,14 @@ #endif /* Wnn6 */ DEFSUBR (Fwnn_version); - defsymbol (&Qjserver, "jserver"); - defsymbol (&Qcserver, "cserver"); - /* defsymbol (&Qtserver, "tserver"); */ - defsymbol (&Qkserver, "kserver"); + DEFSYMBOL (Qjserver); + DEFSYMBOL (Qcserver); + /* DEFSYMBOL (Qtserver); */ + DEFSYMBOL (Qkserver); - defsymbol (&Qwnn_no_uniq, "wnn-no-uniq"); - defsymbol (&Qwnn_uniq, "wnn-uniq"); - defsymbol (&Qwnn_uniq_kanji, "wnn-uniq-kanji"); + DEFSYMBOL (Qwnn_no_uniq); + DEFSYMBOL (Qwnn_uniq); + DEFSYMBOL (Qwnn_uniq_kanji); defsymbol (&Qwnn_n, "wnn_n"); defsymbol (&Qwnn_nsho, "wnn_nsho"); defsymbol (&Qwnn_hindo, "wnn_hindo"); diff -r c775bd016b32 -r 183866b06e0b src/mule.c --- a/src/mule.c Thu May 24 06:30:21 2001 +0000 +++ b/src/mule.c Thu May 24 07:51:33 2001 +0000 @@ -45,7 +45,7 @@ CHECK_CONS (pattern); len = XINT (Flength (pattern)); if (len > MAXWORDBUF) - error ("Too complicated regular expression for word!"); + invalid_argument ("Too complicated regular expression for word!", Qunbound); for (i = 0; i < len; i++) { temp = XCAR (pattern); diff -r c775bd016b32 -r 183866b06e0b src/nas.c --- a/src/nas.c Thu May 24 06:30:21 2001 +0000 +++ b/src/nas.c Thu May 24 07:51:33 2001 +0000 @@ -26,6 +26,8 @@ /* Synched up with: Not in FSF. */ +/* This file Mule-ized by Ben Wing, 5-15-01. */ + /* There are four compile-time options. * * XTOOLKIT This will be part of an Xt program. @@ -52,21 +54,13 @@ * 1998-10-01 rlt Added support for WAVE files. */ -#ifdef emacs #include #include "lisp.h" + +#include "sound.h" + #include "sysdep.h" #include "syssignal.h" -#endif - -#include -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#endif /* NAS <= 1.2p5 defines {BIG,LITTLE}_ENDIAN in