changeset 563:183866b06e0b

[xemacs-hg @ 2001-05-24 07:50:48 by ben] Makefile.in.in, abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, casetab.c, chartab.c, cmdloop.c, cmds.c, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console.c, data.c, database.c, debug.c, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, dired.c, doc.c, doprnt.c, dragdrop.c, editfns.c, eldap.c, eldap.h, elhash.c, emacs-widget-accessors.c, emacs.c, emodules.c, esd.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, filelock.c, floatfns.c, fns.c, font-lock.c, frame-gtk.c, frame-x.c, frame.c, general-slots.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-gtk.c, gui-x.c, gui.c, gutter.c, hpplay.c, indent.c, input-method-xlib.c, insdel.c, intl.c, keymap.c, libsst.c, libsst.h, linuxplay.c, lisp.h, lread.c, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, miscplay.c, miscplay.h, mule-ccl.c, mule-charset.c, mule-wnnfns.c, mule.c, nas.c, ntplay.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, ralloc.c, rangetab.c, redisplay.c, scrollbar.c, search.c, select-gtk.c, select-x.c, select.c, sgiplay.c, sheap.c, sound.c, specifier.c, sunplay.c, symbols.c, symeval.h, symsinit.h, syntax.c, sysdep.c, toolbar-msw.c, toolbar.c, tooltalk.c, ui-byhand.c, ui-gtk.c, undo.c, unexaix.c, unexapollo.c, unexconvex.c, unexec.c, widget.c, win32.c, window.c: -- defsymbol -> DEFSYMBOL. -- add an error type to all errors. -- eliminate the error functions in eval.c that let you just use Qerror as the type. -- redo the error API to be more consistent, sensibly named, and easier to use. -- redo the error hierarchy somewhat. create new errors: structure-formation-error, gui-error, invalid-constant, stack-overflow, out-of-memory, process-error, network-error, sound-error, printing-unreadable-object, base64-conversion- error; coding-system-error renamed to text-conversion error; some others. -- fix Mule problems in error strings in emodules.c, tooltalk.c. -- fix error handling in mswin open-network-stream. -- Mule-ize all sound files and clean up the headers. -- nativesound.h -> sound.h and used for all sound files. -- move some shared stuff into glyphs-shared.c: first attempt at eliminating some of the massive GTK code duplication. xemacs.mak: add glyphs-shared.c. xemacs-faq.texi: document how to debug X errors subr.el: fix doc string to reflect reality
author ben
date Thu, 24 May 2001 07:51:33 +0000
parents c775bd016b32
children 001628b7a5b3
files lisp/ChangeLog lisp/subr.el man/ChangeLog man/xemacs-faq.texi nt/ChangeLog nt/xemacs.mak src/ChangeLog src/Makefile.in.in src/abbrev.c src/alloc.c src/buffer.c src/bytecode.c src/callint.c src/callproc.c src/casetab.c src/chartab.c src/cmdloop.c src/cmds.c src/console-msw.c src/console-msw.h src/console-stream.c src/console-tty.c src/console-x.c src/console.c src/data.c src/database.c src/debug.c src/depend src/device-gtk.c src/device-msw.c src/device-tty.c src/device-x.c src/device.c src/dialog-gtk.c src/dialog-msw.c src/dialog-x.c src/dialog.c src/dired-msw.c src/dired.c src/doc.c src/doprnt.c src/dragdrop.c src/editfns.c src/eldap.c src/eldap.h src/elhash.c src/emacs-widget-accessors.c src/emacs.c src/emodules.c src/esd.c src/eval.c src/event-Xt.c src/event-gtk.c src/event-msw.c src/event-stream.c src/events.c src/extents.c src/faces.c src/file-coding.c src/fileio.c src/filelock.c src/floatfns.c src/fns.c src/font-lock.c src/frame-gtk.c src/frame-x.c src/frame.c src/general-slots.h src/glade.c src/glyphs-gtk.c src/glyphs-msw.c src/glyphs-shared.c src/glyphs-widget.c src/glyphs-x.c src/glyphs.c src/glyphs.h src/gpmevent.c src/gui-gtk.c src/gui-x.c src/gui.c src/gutter.c src/hpplay.c src/indent.c src/input-method-xlib.c src/insdel.c src/intl.c src/keymap.c src/libsst.c src/libsst.h src/linuxplay.c src/lisp.h src/lread.c src/lstream.c src/lstream.h src/macros.c src/marker.c src/md5.c src/menubar-gtk.c src/menubar-msw.c src/menubar-x.c src/menubar.c src/minibuf.c src/miscplay.c src/miscplay.h src/mule-ccl.c src/mule-charset.c src/mule-wnnfns.c src/mule.c src/nas.c src/nativesound.h src/ntplay.c src/ntproc.c src/objects-gtk.c src/objects-msw.c src/objects-x.c src/objects.c src/postgresql.c src/print.c src/process-nt.c src/process-unix.c src/process.c src/ralloc.c src/rangetab.c src/redisplay.c src/scrollbar.c src/search.c src/select-gtk.c src/select-x.c src/select.c src/sgiplay.c src/sheap.c src/sound.c src/sound.h src/specifier.c src/sunplay.c src/symbols.c src/symeval.h src/symsinit.h src/syntax.c src/sysdep.c src/toolbar-msw.c src/toolbar.c src/tooltalk.c src/ui-byhand.c src/ui-gtk.c src/undo.c src/unexaix.c src/unexapollo.c src/unexconvex.c src/unexec.c src/widget.c src/win32.c src/window.c
diffstat 153 files changed, 5388 insertions(+), 3524 deletions(-) [+]
line wrap: on
line diff
--- 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  <ben@xemacs.org>
+
+	* subr.el:
+	* subr.el (error):
+	fix doc string to reflect reality
+
 2001-05-23  Ben Wing  <ben@xemacs.org>
 
 	* behavior-defs.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
--- 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  <ben@xemacs.org>
+
+	* 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  <youngs@xemacs.org>
 
 	* xemacs/packages.texi (Local.rules): Update to reflect new dir tree.
--- 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 <rossini@@biostat.washington.edu>
 @author Ben Wing <ben@@xemacs.org>
@@ -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.
--- 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  <ben@xemacs.org>
+
+	* xemacs.mak (DOC):
+	* xemacs.mak (TEMACS_OBJS):
+	add glyphs-shared.c.
+
 2001-05-23  Ben Wing  <ben@xemacs.org>
 
 	* xemacs.mak (installation):
--- 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 \
--- 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  <ben@xemacs.org>
+
+	* 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  <ben@xemacs.org>
+
+	* glyphs-shared.c: New.  Try just a bit to start eliminating
+	the massive code duplication in *-gtk.c.
+
+2001-05-16  Ben Wing  <ben@xemacs.org>
+
+	* 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  <ben@xemacs.org>
 
 	* event-msw.c (winsock_writer):
--- 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\
--- 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);
 }
 
--- 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);
   }
 
--- 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 #<killed buffer>");
+	printing_unreadable_object ("#<killed buffer>");
       else
-	error ("printing unreadable object #<buffer %s>",
-	       XSTRING_DATA (b->name));
+	printing_unreadable_object ("#<buffer %s>", XSTRING_DATA (b->name));
     }
   else if (!BUFFER_LIVE_P (b))
     write_c_string ("#<killed buffer>", 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);
--- 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
 }
 
--- 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);
--- 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 */
--- 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 #<case-table 0x%x", ct->header.uid);
+    printing_unreadable_object ("#<case-table 0x%x", ct->header.uid);
   write_c_string ("#<case-table ", printcharfun);
   sprintf (buf, "0x%x>", 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);
--- 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);
--- 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);
--- 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);
--- 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);
 }
--- 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);
--- 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;
--- 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);
--- 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
 		{
--- 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 #<console %s 0x%x>",
-	   XSTRING_DATA (con->name), con->header.uid);
+    printing_unreadable_object ("#<console %s 0x%x>",
+				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[] = {
--- 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 #<weak-list>");
+    printing_unreadable_object ("#<weak-list>");
 
   write_c_string ("#<weak-list ", printcharfun);
   print_internal (encode_weak_list_type (XWEAK_LIST (obj)->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
--- 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 #<database 0x%x>", db->header.uid);
+    printing_unreadable_object ("#<database 0x%x>", db->header.uid);
 
   write_c_string ("#<database \"", printcharfun);
   print_internal (db->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);
--- 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);
--- 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
--- 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
--- 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 #<msprinter-settings 0x%x>",
-           dm->header.uid);
+    printing_unreadable_object ("#<msprinter-settings 0x%x>",
+				dm->header.uid);
   write_c_string ("#<msprinter-settings", printcharfun);
   if (dm->printer_name)
     {
--- 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
--- 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
--- 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 #<device %s 0x%x>",
-	   XSTRING_DATA (d->name), d->header.uid);
+    printing_unreadable_object ("#<device %s 0x%x>",
+				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
--- 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
--- 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
--- 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);
 
--- 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));
 }
--- 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);
 }
--- 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);
--- 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 */;
                 }
--- 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,
--- 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
--- 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
--- 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 #<ldap %s>",
-           XSTRING_DATA (ldap->host));
+    printing_unreadable_object ("#<ldap %s>", XSTRING_DATA (ldap->host));
 
   write_c_string ("#<ldap ", printcharfun);
   print_internal (ldap->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);
--- 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)
 
--- 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
--- 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);
--- 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
--- 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
--- 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 <config.h>
-#endif
+#include "lisp.h"
 
-#include "lisp.h"
 #include "miscplay.h"
+#include "sound.h"
+
+#include "sysfile.h"
 
 #include <esd.h>
 
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
 
 /* 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;
       }
     }
--- 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);
--- 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
--- 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)
--- 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);
 	  }
       }
   }
--- 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
--- 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 #<event>");
+    printing_unreadable_object ("#<event>");
 
   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");
--- 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 #<destroyed extent>");
+	    printing_unreadable_object ("#<destroyed extent>");
 	  else
-	    error ("printing unreadable object #<extent 0x%lx>",
+	    printing_unreadable_object ("#<extent 0x%lx>",
 		   (long) XEXTENT (obj));
 	}
 
@@ -3049,7 +3049,7 @@
   else
     {
       if (print_readably)
-	error ("printing unreadable object #<extent>");
+	printing_unreadable_object ("#<extent>");
       write_c_string ("#<extent", printcharfun);
     }
   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);
--- 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
--- 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 #<coding_system 0x%x>",
-	   c->header.uid);
+    printing_unreadable_object ("#<coding_system 0x%x>", c->header.uid);
 
   write_c_string ("#<coding_system ", printcharfun);
   print_internal (c->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],
--- 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);
--- 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
--- 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'
--- 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);
--- 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);
--- 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);
--- 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
--- 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 #<frame %s 0x%x>",
-           XSTRING_DATA (frm->name), frm->header.uid);
+    printing_unreadable_object ("#<frame %s 0x%x>",
+				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);
--- 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);
--- 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
--- 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
 }
 
--- 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
--- /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 <config.h>
+#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);
+}
--- 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
--- 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
--- 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 #<image-instance 0x%x>",
+    printing_unreadable_object ("#<image-instance 0x%x>",
            ii->header.uid);
   write_c_string ("#<image-instance (", printcharfun);
   print_internal (Fimage_instance_type (obj), printcharfun, 0);
@@ -1303,7 +1304,7 @@
   if (EQ (type, Qsubwindow))    return IMAGE_SUBWINDOW;
   if (EQ (type, Qwidget))    return IMAGE_WIDGET;
 
-  maybe_signal_simple_error ("Invalid image-instance type", type,
+  maybe_invalid_constant ("Invalid image-instance type", type,
 			     Qimage, errb);
 
   return IMAGE_UNKNOWN; /* not reached */
@@ -1376,8 +1377,8 @@
 incompatible_image_types (Lisp_Object instantiator, int given_dest_mask,
 			  int desired_dest_mask)
 {
-  signal_error
-    (Qerror,
+  signal_error_1
+    (Qinvalid_argument,
      list2
      (emacs_doprnt_string_lisp_2
       ((const Bufbyte *)
@@ -1457,7 +1458,7 @@
   Lisp_Object governing_domain;
 
   if (IMAGE_INSTANCEP (data))
-    signal_simple_error ("Image instances not allowed here", data);
+    invalid_argument ("Image instances not allowed here", data);
   image_validate (data);
   domain = decode_domain (domain);
   /* instantiate_image_instantiator() will abort if given an
@@ -1470,7 +1471,7 @@
   /* After normalizing the data, it's always either an image instance (which
      we filtered out above) or a vector. */
   if (EQ (INSTANTIATOR_TYPE (data), Qinherit))
-    signal_simple_error ("Inheritance not allowed here", data);
+    invalid_argument ("Inheritance not allowed here", data);
   governing_domain =
     get_image_instantiator_governing_domain (data, domain);
   ii = instantiate_image_instantiator (governing_domain, domain, data,
@@ -2141,15 +2142,33 @@
 DOESNT_RETURN
 signal_image_error (const char *reason, Lisp_Object frob)
 {
-  signal_error (Qimage_conversion_error,
-		list2 (build_translated_string (reason), frob));
+  signal_error (Qimage_conversion_error, reason, frob);
 }
 
 DOESNT_RETURN
 signal_image_error_2 (const char *reason, Lisp_Object frob0, Lisp_Object frob1)
 {
-  signal_error (Qimage_conversion_error,
-		list3 (build_translated_string (reason), frob0, frob1));
+  signal_error_2 (Qimage_conversion_error, reason, frob0, frob1);
+}
+
+DOESNT_RETURN
+signal_double_image_error (const char *string1, const char *string2,
+			   Lisp_Object data)
+{
+  signal_error_1 (Qimage_conversion_error,
+                list3 (build_translated_string (string1),
+		       build_translated_string (string2),
+		       data));
+}
+
+DOESNT_RETURN
+signal_double_image_error_2 (const char *string1, const char *string2,
+			     Lisp_Object data1, Lisp_Object data2)
+{
+  signal_error_1 (Qimage_conversion_error,
+                list4 (build_translated_string (string1),
+		       build_translated_string (string2),
+		       data1, data2));
 }
 
 /****************************************************************************
@@ -2475,9 +2494,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));
 
   if (NILP (file)) /* no conversion necessary */
     RETURN_UNGCPRO (inst);
@@ -2518,7 +2537,7 @@
       !CONSP (XCDR (data)) ||
       !CONSP (XCDR (XCDR (data))) ||
       !NILP (XCDR (XCDR (XCDR (data)))))
-    signal_simple_error ("Must be list of 3 elements", data);
+    sferror ("Must be list of 3 elements", data);
 
   width  = XCAR (data);
   height = XCAR (XCDR (data));
@@ -2527,13 +2546,13 @@
   CHECK_STRING (bits);
 
   if (!NATNUMP (width))
-    signal_simple_error ("Width must be a natural number", width);
+    invalid_argument ("Width must be a natural number", width);
 
   if (!NATNUMP (height))
-    signal_simple_error ("Height must be a natural number", height);
+    invalid_argument ("Height must be a natural number", height);
 
   if (((XINT (width) * XINT (height)) / 8) > 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 0x%x>", glyph->header.uid);
+    printing_unreadable_object ("#<glyph 0x%x>", glyph->header.uid);
 
   write_c_string ("#<glyph (", printcharfun);
   print_internal (Fglyph_type (obj), printcharfun, 0);
@@ -3756,7 +3774,7 @@
   if (EQ (type, Qpointer)) return GLYPH_POINTER;
   if (EQ (type, Qicon))    return GLYPH_ICON;
 
-  maybe_signal_simple_error ("Invalid glyph type", type, Qimage, errb);
+  maybe_invalid_constant ("Invalid glyph type", type, Qimage, errb);
 
   return GLYPH_UNKNOWN;
 }
@@ -4708,7 +4726,7 @@
   Lisp_Object height = find_keyword_in_vector (instantiator, Q_pixel_height);
 
   if (NILP (frame))
-    signal_simple_error ("No selected frame", device);
+    invalid_state ("No selected frame", device);
 
   if (!(dest_mask & IMAGE_SUBWINDOW_MASK))
     incompatible_image_types (instantiator, dest_mask, IMAGE_SUBWINDOW_MASK);
@@ -5008,7 +5026,7 @@
 
   /* image instances */
 
-  defsymbol (&Qimage_instancep, "image-instance-p");
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qimage_instancep);
 
   DEFSYMBOL (Qnothing_image_instance_p);
   DEFSYMBOL (Qtext_image_instance_p);
@@ -5082,7 +5100,7 @@
   DEFSUBR (Fglyph_animated_timeout_handler);
 
   /* Errors */
-  DEFERROR_STANDARD (Qimage_conversion_error, Qio_error);
+  DEFERROR_STANDARD (Qimage_conversion_error, Qconversion_error);
 }
 
 static const struct lrecord_description image_specifier_description[] = {
--- a/src/glyphs.h	Thu May 24 06:30:21 2001 +0000
+++ b/src/glyphs.h	Thu May 24 07:51:33 2001 +0000
@@ -382,7 +382,15 @@
                                                  int given_dest_mask,
                                                  int desired_dest_mask));
 DECLARE_DOESNT_RETURN (signal_image_error (const char *, Lisp_Object));
-DECLARE_DOESNT_RETURN (signal_image_error_2 (const char *, Lisp_Object, Lisp_Object));
+DECLARE_DOESNT_RETURN (signal_image_error_2 (const char *, Lisp_Object,
+					     Lisp_Object));
+DECLARE_DOESNT_RETURN (signal_double_image_error (const char *string1,
+						  const char *string2,
+						  Lisp_Object data));
+DECLARE_DOESNT_RETURN (signal_double_image_error_2 (const char *string1,
+						    const char *string2,
+						    Lisp_Object data1,
+						    Lisp_Object data2));
 
 /************************************************************************/
 /*			Image Specifier Object				*/
--- a/src/gpmevent.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/gpmevent.c	Thu May 24 07:51:33 2001 +0000
@@ -536,7 +536,7 @@
 
 	if (noninteractive)
 	{
-		error ("Can't connect to GPM in batch mode.");
+	 invalid_operation ("Can't connect to GPM in batch mode.", Qunbound);
 	}
 
 	if (!console_name)
@@ -560,7 +560,7 @@
 	*/
 	if (!NILP (Fgpm_enabled_p (device)))
 	{
-		error ("GPM already enabled for this console.");
+	 invalid_operation ("GPM already enabled for this console.", Qunbound);
 	}
 
 	conn.eventMask = GPM_DOWN|GPM_UP|GPM_MOVE|GPM_DRAG;
--- a/src/gui-gtk.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/gui-gtk.c	Thu May 24 07:51:33 2001 +0000
@@ -82,7 +82,7 @@
 syms_of_gui_gtk (void)
 {
 #ifdef HAVE_POPUPS
-  defsymbol (&Qmenu_no_selection_hook, "menu-no-selection-hook");
+  DEFSYMBOL (Qmenu_no_selection_hook);
 #endif
 }
 
--- a/src/gui-x.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/gui-x.c	Thu May 24 07:51:33 2001 +0000
@@ -405,12 +405,12 @@
       return 1;
     }
   else if (!GUI_ITEMP (gui_item))
-    syntax_error ("need a string or a gui_item here", gui_item);
+    invalid_argument ("need a string or a gui_item here", gui_item);
 
   pgui = XGUI_ITEM (gui_item);
 
   if (!NILP (pgui->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
--- 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 #<gui-item 0x%x>", g->header.uid);
+    printing_unreadable_object ("#<gui-item 0x%x>", g->header.uid);
 
   write_c_string ("#<gui-item ", printcharfun);
   sprintf (buf, "0x%x>", 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
--- 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
--- 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 <config.h>
 #include "lisp.h"
 
-#include "nativesound.h"
+#include "sound.h"
 
-#include <stdlib.h>
-#include <stdio.h>
 #ifdef HPUX10
 #include <Alib.h>
 #include <CUlib.h>
@@ -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
--- 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
--- 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);
--- 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!  */
--- 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);
--- 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 0x%x>", keymap->header.uid);
+    printing_unreadable_object ("#<keymap 0x%x>", keymap->header.uid);
   write_c_string ("#<keymap ", printcharfun);
   if (!NILP (keymap->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;
     }
 
--- 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 <config.h>
 #include "lisp.h"
-#endif
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#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 );
--- 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_ */
--- 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 <config.h>
-#endif
+#include "lisp.h"
 
 #include "miscplay.h"
-#include "nativesound.h"
+#include "sound.h"
 
-#include <errno.h>
-#include <fcntl.h>
-#include SOUNDCARD_H_FILE /* Path computed by configure */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#include <sys/signal.h>
-#include <unistd.h>
-
-#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);
 }
--- 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;
--- 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"));
--- 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)
--- 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
--- 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
--- 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 #<marker 0x%lx>", (long) marker);
+    printing_unreadable_object ("#<marker 0x%lx>", (long) marker);
 
   write_c_string (GETTEXT ("#<marker "), printcharfun);
   if (!marker->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));
 }
--- 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;
--- 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));
--- 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;
 }
--- 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);
--- 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.
--- 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
--- 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 <config.h>
-#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 <stdlib.h>
 
 #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 **))
--- 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 <stdlib.h>
-
 #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 **));
--- 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.
--- 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 #<charset %s 0x%x>",
-           string_data (XSYMBOL (CHARSET_NAME (cs))->name),
-	   cs->header.uid);
+    printing_unreadable_object ("#<charset %s 0x%x>",
+				string_data (XSYMBOL (CHARSET_NAME (cs))->
+					     name),
+				cs->header.uid);
 
   write_c_string ("#<charset ", printcharfun);
   print_internal (CHARSET_NAME (cs), printcharfun, 0);
@@ -522,7 +523,7 @@
     }
 
   if (!lb)
-    signal_simple_error
+    invalid_operation
       ("No more character sets free for this dimension",
        make_int (dimension));
 
@@ -567,7 +568,7 @@
   Lisp_Object charset = Ffind_charset (name);
 
   if (NILP (charset))
-    signal_simple_error ("No such charset", name);
+    invalid_argument ("No such charset", name);
   return charset;
 }
 
@@ -682,7 +683,7 @@
 
   charset = Ffind_charset (name);
   if (!NILP (charset))
-    signal_simple_error ("Cannot redefine existing charset", name);
+    invalid_operation ("Cannot redefine existing charset", name);
 
   {
     EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, props)
@@ -704,7 +705,7 @@
 	    CHECK_INT (value);
 	    dimension = XINT (value);
 	    if (dimension < 1 || dimension > 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
--- 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");
--- 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);
--- 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 <config.h>
 #include "lisp.h"
+
+#include "sound.h"
+
 #include "sysdep.h"
 #include "syssignal.h"
-#endif
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 
 /* NAS <= 1.2p5 defines {BIG,LITTLE}_ENDIAN in <audio/fileutil.h>,
    conflicting with GNU libc (at least); newer versions avoid this
@@ -92,8 +86,6 @@
 #define NAS_BIG_ENDIAN BIG_ENDIAN
 #endif
 
-#ifdef emacs
-
 #    define XTOOLKIT
 #    define XTEVENTS
 #    define ROBUST_PLAY
@@ -112,19 +104,12 @@
 	jmp_buf AuXtErrorJump;
 #    endif
 
-     /* The GETTEXT is correct. --ben */
-#    define warn(str) warn_when_safe (Qnas, Qwarning, "nas: %s ", GETTEXT (str))
-
 #    define play_sound_file nas_play_sound_file
 #    define play_sound_data nas_play_sound_data
 #    define wait_for_sounds nas_wait_for_sounds
 #    define init_play       nas_init_play
 #    define close_down_play nas_close_down_play
 
-#else /* !emacs */
-#    define warn(str) fprintf (stderr, "%s\n", (str))
-#endif /* emacs */
-
 #ifdef XTOOLKIT
 #    include <X11/Intrinsic.h>
 #    include <audio/Xtutil.h>
@@ -138,7 +123,7 @@
 
 extern Lisp_Object Vsynchronous_sounds;
 
-static Sound SoundOpenDataForReading (unsigned char *data, int length);
+static Sound SoundOpenDataForReading (UChar_Binary *data, int length);
 
 static AuServer       *aud;
 
@@ -150,31 +135,31 @@
 static Display *aud_server;
 static XtInputId input_id;
 #else
-static char *aud_server;
+static Extbyte *aud_server;
 #endif /* XTOOLKIT */
 
-char *
+Extbyte *
 init_play (
 #ifdef XTOOLKIT
 	   Display *display
 #else
-	   char *server
+	   Extbyte *server
 #endif
 	   );
-char *
+Extbyte *
 init_play (
 #ifdef XTOOLKIT
 	   Display *display
 #else
-	   char *server
+	   Extbyte *server
 #endif
 	   )
 {
-  char *err_message;
+  Extbyte *err_message;
   SIGTYPE (*old_sigpipe) (int);
 
 #ifdef XTOOLKIT
-  char * server = DisplayString (display);
+  Extbyte * server = DisplayString (display);
   XtAppContext app_context = XtDisplayToApplicationContext (display);
 
   aud_server = display;
@@ -250,7 +235,7 @@
 
 {
   AuCloseServer (aud);
-  warn ("disconnected from audio server");
+  sound_warn ("disconnected from audio server");
 }
 
  /********************************************************************\
@@ -282,7 +267,7 @@
 static void
 do_caching_play (Sound s,
 		 int volume,
-		 unsigned char *buf)
+		 UChar_Binary *buf)
 
 {
   AuBucketAttributes *list, b;
@@ -305,7 +290,7 @@
 	      return;
 	    }
 
-	  if (SoundReadFile ((char *) my_buf, SoundNumBytes (s), s) != SoundNumBytes (s))
+	  if (SoundReadFile ((Extbyte *) my_buf, SoundNumBytes (s), s) != SoundNumBytes (s))
 	    {
 	      free (my_buf);
 	      return;
@@ -358,9 +343,9 @@
     }
 }
 
-int play_sound_file (char *sound_file, int volume);
+int play_sound_file (Extbyte *sound_file, int volume);
 int
-play_sound_file (char *sound_file,
+play_sound_file (Extbyte *sound_file,
 		 int volume)
 {
   SIGTYPE (*old_sigpipe) (int);
@@ -377,7 +362,7 @@
   if (aud==NULL) {
     if (aud_server != NULL)
       {
-	char *m;
+	Extbyte *m;
 	/* attempt to reconect */
 	if ((m=init_play (aud_server))!= NULL)
 	  {
@@ -390,7 +375,7 @@
       }
     else
       {
-	warn ("Attempt to play with no audio init\n");
+	sound_warn ("Attempt to play with no audio init\n");
 #ifdef ROBUST_PLAY
 	signal (SIGPIPE, old_sigpipe);
 #endif
@@ -451,9 +436,9 @@
   return 1;
 }
 
-int play_sound_data (unsigned char *data, int length, int volume);
+int play_sound_data (UChar_Binary *data, int length, int volume);
 int
-play_sound_data (unsigned char *data,
+play_sound_data (UChar_Binary *data,
 		 int length, 
 		 int volume)
 {
@@ -478,7 +463,7 @@
   if (aud == NULL) {
     if (aud_server != NULL)
       {
-	char *m;
+	Extbyte *m;
 	/* attempt to reconect */
 	if ((m = init_play (aud_server)) != NULL)
 	  {
@@ -490,7 +475,7 @@
       }
     else
       {
-	warn ("Attempt to play with no audio init\n");
+	sound_warn ("Attempt to play with no audio init\n");
 #ifdef ROBUST_PLAY
 	signal (SIGPIPE, old_sigpipe);
 #endif
@@ -500,7 +485,7 @@
 
   if ((s=SoundOpenDataForReading (data, length))==NULL)
     {
-      warn ("unknown sound type");
+      sound_warn ("unknown sound type");
 #ifdef ROBUST_PLAY
       signal (SIGPIPE, old_sigpipe);
 #endif
@@ -518,7 +503,7 @@
     }
   else
     {
-      warn ("only understand snd and wave files at the moment");
+      sound_warn ("only understand snd and wave files at the moment");
       SoundCloseFile (s);
 #ifdef ROBUST_PLAY
       signal (SIGPIPE, old_sigpipe);
@@ -579,9 +564,9 @@
 CatchIoErrorAndJump (AuServer *old_aud)
 {
   if (old_aud)
-    warn ("Audio Server connection broken"); 
+    sound_warn ("Audio Server connection broken"); 
   else
-    warn ("Audio Server connection broken because of signal");
+    sound_warn ("Audio Server connection broken because of signal");
 
 #ifdef XTEVENTS
 #ifdef XTOOLKIT
@@ -637,14 +622,14 @@
 
 /* Create a name from the sound. */
 
-static char *
-NameFromData (const char *buf,
+static Extbyte *
+NameFromData (const Char_Binary *buf,
 	      int len)
 
 {
-  char name[9];
+  Extbyte name[9];
   int i;
-  char *s;
+  Extbyte *s;
 
   buf+=len/2;
   len -= len/2;
@@ -667,11 +652,11 @@
 
   if (i==8)
     {
-      strcpy (s = (char *) malloc (10), name);
+      strcpy (s = (Extbyte *) malloc (10), name);
     }
   else 
     {
-      strcpy (s = (char *) malloc (15), "short sound");
+      strcpy (s = (Extbyte *) malloc (15), "short sound");
     }
 
   return s;
@@ -682,7 +667,7 @@
  */
 
 static SndInfo *
-SndOpenDataForReading (const char *data,
+SndOpenDataForReading (const Char_Binary *data,
 		       int length)
 
 {
@@ -699,7 +684,7 @@
 
   if (NAS_LITTLE_ENDIAN)
     {
-      char            n;
+      Char_Binary            n;
     
       swapl (&si->h.magic, n);
       swapl (&si->h.dataOffset, n);
@@ -719,7 +704,7 @@
 
   if (size)
     {
-      if (!(si->comment = (char *) malloc (size + 1)))
+      if (!(si->comment = (Extbyte *) malloc (size + 1)))
 	{
 	  free (si);
 	  return NULL;
@@ -748,7 +733,7 @@
 #define Err()		{ return NULL; }
 #define readFourcc(_f)	dread(_f, sizeof(RIFF_FOURCC), 1)
 #define cmpID(_x, _y)							      \
-    strncmp((char *) (_x), (char *) (_y), sizeof(RIFF_FOURCC))
+    strncmp((Char_Binary *) (_x), (Char_Binary *) (_y), sizeof(RIFF_FOURCC))
 #define PAD2(_x)	(((_x) + 1) & ~1)
 
 /* These functions here are for faking file I/O from buffer. */
@@ -777,7 +762,7 @@
   
   if (file_posn + nread <= file_len)
     {
-      memcpy(buf, (char *) file_data + file_posn, size * nitems);
+      memcpy(buf, (Char_Binary *) file_data + file_posn, size * nitems);
       file_posn += nread;
       return nitems;
     }
@@ -792,7 +777,7 @@
 dgetc (void)
 {
   if (file_posn < file_len)
-    return ((char *)file_data)[file_posn++];
+    return ((Char_Binary *)file_data)[file_posn++];
   else
     return -1;
 }
@@ -846,7 +831,7 @@
 readChunk (RiffChunk *c)
 {
     int             status;
-    char            n;
+    Char_Binary            n;
 
     if ((status = dread(c, sizeof(RiffChunk), 1)))
 	if (NAS_BIG_ENDIAN)
@@ -859,7 +844,7 @@
    read the wave data from a buffer in memory. */
 
 static WaveInfo *
-WaveOpenDataForReading (const char *data,
+WaveOpenDataForReading (const Char_Binary *data,
 			int length)
 {
     RiffChunk       ck;
@@ -912,7 +897,7 @@
 		    /* ICMT chunk */
 		    if (!cmpID(&c.ckID, RIFF_InfoIcmtID))
 		    {
-			if (!(wi->comment = (char *) malloc(c.ckSize)) ||
+			if (!(wi->comment = (Extbyte *) malloc(c.ckSize)) ||
 			    !dread(wi->comment, c.ckSize, 1))
 			    Err();
 
@@ -993,7 +978,7 @@
 
 
 static Sound
-SoundOpenDataForReading (unsigned char *data,
+SoundOpenDataForReading (UChar_Binary *data,
 			 int length)
 
 {
@@ -1002,7 +987,7 @@
   if (!(s = (Sound) malloc (sizeof (SoundRec))))
     return NULL;
 
-  if ((s->formatInfo = SndOpenDataForReading ((char *) data, length)) != NULL)
+  if ((s->formatInfo = SndOpenDataForReading ((Char_Binary *) data, length)) != NULL)
     {
       if (!((int(*)(Sound))(SoundFileInfo[SoundFileFormatSnd].toSound)) (s))
 	{
@@ -1011,7 +996,7 @@
 	  return NULL;
 	}
     }
-  else if ((s->formatInfo = WaveOpenDataForReading ((char *) data, length)) != NULL)
+  else if ((s->formatInfo = WaveOpenDataForReading ((Char_Binary *) data, length)) != NULL)
     {
       if (!((int(*)(Sound))(SoundFileInfo[SoundFileFormatWave].toSound)) (s))
 	{
--- a/src/nativesound.h	Thu May 24 06:30:21 2001 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/* Sound functions.
-   Copyright (C) 2000 Free Software Foundation, Inc.
-
-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. */
-
-/* These are defined in the appropriate file (sunplay.c, sgiplay.c,
-   or hpplay.c). */
-
-void play_sound_file (char *name, int volume);
-int play_sound_data (unsigned char *data, int length, int volume);
--- a/src/ntplay.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/ntplay.c	Thu May 24 07:51:33 2001 +0000
@@ -18,35 +18,45 @@
 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.*/
 
+/* Synched up with: Not in FSF. */
+
+/* This file Mule-ized by Ben Wing, 5-15-01. */
+
 #include <config.h>
 #include "lisp.h"
 
-#include "sysfile.h"
+#include "sound.h"
 #include "nt.h"
-#include "nativesound.h"
+
+#include "sysfile.h"
 
-static int play_sound_data_1 (unsigned char *data, int length,
-			       int volume, int convert);
+static int play_sound_data_1 (UChar_Binary *data, int length,
+			      int volume, int convert);
 
-void play_sound_file (char *sound_file, int volume)
+void
+play_sound_file (Extbyte *sound_file, int volume)
 {
   DWORD flags = SND_ASYNC | SND_NODEFAULT | SND_FILENAME;
   OFSTRUCT ofs;
-  Lisp_Object fname = Ffile_name_nondirectory (build_string (sound_file));
+  Lisp_Object fname =
+    Ffile_name_nondirectory (build_ext_string (sound_file, Qmswindows_tstr));
+  Extbyte *fnameext;
 
   CHECK_STRING (fname);
-  if (OpenFile (XSTRING_DATA (fname), &ofs, OF_EXIST) < 0)
+  LISP_STRING_TO_EXTERNAL (fname, fnameext, Qmswindows_tstr);
+
+  if (OpenFile (fnameext, &ofs, OF_EXIST) < 0)
     {
       /* file isn't in the path so read it as data */
       int size;
-      unsigned char* data;
+      UChar_Binary* data;
       int ofd = open (sound_file, O_RDONLY | OPEN_BINARY, 0);
       
       if (ofd <0)
 	return;
 
       size = lseek (ofd, 0, SEEK_END);
-      data = (unsigned char *)xmalloc (size);
+      data = (UChar_Binary *)xmalloc (size);
       lseek (ofd, 0, SEEK_SET);
       
       if (!data)
@@ -66,16 +76,17 @@
       play_sound_data_1 (data, size, 100, FALSE);
     }
   else 
-    PlaySound (XSTRING_DATA (fname), NULL, flags);
+    PlaySound (fnameext, NULL, flags);
 }
 
 /* mswindows can't cope with playing a sound from alloca space so we
    have to convert if necessary */
-static int play_sound_data_1 (unsigned char *data, int length, int volume,
-			       int convert_to_malloc)
+static int
+play_sound_data_1 (UChar_Binary *data, int length, int volume,
+		   int convert_to_malloc)
 {
   DWORD flags = SND_ASYNC | SND_MEMORY | SND_NODEFAULT;
-  static unsigned char* sound_data=0;
+  static UChar_Binary* sound_data=0;
   if (sound_data)
     {
       PlaySound (NULL, NULL, flags);
@@ -85,7 +96,7 @@
 
   if (convert_to_malloc)
     {
-      sound_data = (unsigned char *)xmalloc (length);
+      sound_data = (UChar_Binary *)xmalloc (length);
       memcpy (sound_data, data, length);
     }
   else
@@ -97,7 +108,8 @@
   return 1;
 }
 
-int play_sound_data (unsigned char *data, int length, int volume)
+int
+play_sound_data (UChar_Binary *data, int length, int volume)
 {
   return play_sound_data_1 (data, length, volume, TRUE);
 }
--- a/src/ntproc.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/ntproc.c	Thu May 24 07:51:33 2001 +0000
@@ -935,10 +935,6 @@
   return rc;
 }
 
-#if 0
-/* Sync with FSF Emacs 19.34.6 note: ifdef'ed out in XEmacs */
-extern int report_file_error (const char *, Lisp_Object);
-#endif
 /* The following two routines are used to manipulate stdin, stdout, and
    stderr of our child processes.
 
@@ -976,7 +972,8 @@
 		       0, 
 		       TRUE, 
 		       DUPLICATE_SAME_ACCESS))
-    report_file_error ("Duplicating input handle for child", Qnil);
+    mswindows_report_process_error ("Duplicating input handle for child",
+				    Qunbound, GetLastError ());
   
   if (!DuplicateHandle (parent,
 		       (HANDLE) _get_osfhandle (out),
@@ -985,7 +982,8 @@
 		       0,
 		       TRUE,
 		       DUPLICATE_SAME_ACCESS))
-    report_file_error ("Duplicating output handle for child", Qnil);
+    mswindows_report_process_error ("Duplicating output handle for child",
+				    Qunbound, GetLastError ());
   
   if (!DuplicateHandle (parent,
 		       (HANDLE) _get_osfhandle (err),
@@ -994,17 +992,21 @@
 		       0,
 		       TRUE,
 		       DUPLICATE_SAME_ACCESS))
-    report_file_error ("Duplicating error handle for child", Qnil);
+    mswindows_report_process_error ("Duplicating error handle for child",
+				    Qunbound, GetLastError ());
 
   /* and store them as our std handles */
   if (!SetStdHandle (STD_INPUT_HANDLE, newstdin))
-    report_file_error ("Changing stdin handle", Qnil);
+    mswindows_report_process_error ("Changing stdin handle",
+				    Qunbound, GetLastError ());
   
   if (!SetStdHandle (STD_OUTPUT_HANDLE, newstdout))
-    report_file_error ("Changing stdout handle", Qnil);
+    mswindows_report_process_error ("Changing stdout handle",
+				    Qunbound, GetLastError ());
 
   if (!SetStdHandle (STD_ERROR_HANDLE, newstderr))
-    report_file_error ("Changing stderr handle", Qnil);
+    mswindows_report_process_error ("Changing stderr handle",
+				    Qunbound, GetLastError ());
 }
 
 void
@@ -1289,8 +1291,8 @@
 void
 vars_of_ntproc (void)
 {
-  defsymbol (&Qhigh, "high");
-  defsymbol (&Qlow, "low");
+  DEFSYMBOL (Qhigh);
+  DEFSYMBOL (Qlow);
 
   DEFVAR_LISP ("win32-quote-process-args", &Vwin32_quote_process_args /*
     Non-nil enables quoting of process arguments to ensure correct parsing.
--- a/src/objects-gtk.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/objects-gtk.c	Thu May 24 07:51:33 2001 +0000
@@ -94,15 +94,15 @@
   
   if (result == FALSE)
     {
-      maybe_signal_simple_error ("unrecognized color", make_string (name, len),
-				 Qcolor, errb);
+      maybe_invalid_argument ("unrecognized color", make_string (name, len),
+			  Qcolor, errb);
       return 0;
     }
   result = allocate_nearest_color (cmap, visual, color);
   if (!result)
     {
-      maybe_signal_simple_error ("couldn't allocate color",
-				 make_string (name, len), Qcolor, errb);
+      maybe_signal_error (Qgui_error, "couldn't allocate color",
+			  make_string (name, len), Qcolor, errb);
       return 0;
     }
 
@@ -227,8 +227,8 @@
 
   if (!gf)
     {
-      maybe_signal_simple_error ("couldn't load font", f->name,
-				 Qfont, errb);
+      maybe_signal_error (Qgui_error, "couldn't load font", f->name,
+			  Qfont, errb);
       return 0;
     }
 
--- a/src/objects-msw.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/objects-msw.c	Thu May 24 07:51:33 2001 +0000
@@ -1184,7 +1184,8 @@
       COLOR_INSTANCE_MSWINDOWS_COLOR (c) = color;
       return 1;
     }
-  maybe_signal_simple_error ("Unrecognized color", name, Qcolor, errb);
+  maybe_signal_error (Qinvalid_constant,
+			   "Unrecognized color", name, Qcolor, errb);
   return(0);
 }
 
@@ -1301,7 +1302,7 @@
 
   if (fields < 0)
   {
-    maybe_signal_simple_error ("Invalid font", name, Qfont, errb);
+    maybe_signal_error (Qinvalid_argument, "Invalid font", name, Qfont, errb);
     return (0);
   }
 
@@ -1312,7 +1313,7 @@
   }
   else
   {
-    maybe_signal_simple_error ("Must specify a font name", name, Qfont, errb);
+    maybe_signal_error (Qinvalid_argument, "Must specify a font name", name, Qfont, errb);
     return (0);
   }
 
@@ -1344,7 +1345,7 @@
 	}
       else
 	{
-	  maybe_signal_simple_error ("Invalid font weight", name, Qfont, errb);
+	  maybe_signal_error (Qinvalid_constant, "Invalid font weight", name, Qfont, errb);
 	  return (0);
 	}
     }
@@ -1356,7 +1357,7 @@
 	logfont.lfItalic = TRUE;
       else
       {
-        maybe_signal_simple_error ("Invalid font weight or style", name, Qfont, errb);
+        maybe_signal_error (Qinvalid_constant, "Invalid font weight or style", name, Qfont, errb);
 	return (0);
       }
 
@@ -1371,7 +1372,7 @@
     pt = 10;	/* #### Should we reject strings that don't specify a size? */
   else if ((pt=atoi(points)) == 0)
     {
-      maybe_signal_simple_error ("Invalid font pointsize", name, Qfont, errb);
+      maybe_signal_error (Qinvalid_argument, "Invalid font pointsize", name, Qfont, errb);
       return (0);
     }
 
@@ -1401,7 +1402,7 @@
 	logfont.lfStrikeOut = TRUE;
       else
         {
-          maybe_signal_simple_error ("Invalid font effect", name, Qfont, errb);
+          maybe_signal_error (Qinvalid_constant, "Invalid font effect", name, Qfont, errb);
 	  return (0);
 	}
 
@@ -1413,7 +1414,7 @@
 	    logfont.lfStrikeOut = TRUE;
 	  else
 	    {
-	      maybe_signal_simple_error ("Invalid font effect", name,
+	      maybe_signal_error (Qinvalid_constant, "Invalid font effect", name,
 					 Qfont, errb);
 	      return (0);
 	    }
@@ -1456,7 +1457,7 @@
 
   if (i == countof (charset_map))	/* No matching charset */
     {
-      maybe_signal_simple_error ("Invalid charset", name, Qfont, errb);
+      maybe_signal_error (Qinvalid_argument, "Invalid charset", name, Qfont, errb);
       return 0;
     }
 
@@ -1493,14 +1494,14 @@
 	}
       if (NILP (fonttail))
 	{
-	  maybe_signal_simple_error ("No matching font", name, Qfont, errb);
+	  maybe_signal_error (Qinvalid_argument, "No matching font", name, Qfont, errb);
 	  return 0;
 	}
     }
 
   if ((hfont = CreateFontIndirect(&logfont)) == NULL)
   {
-    maybe_signal_simple_error ("Couldn't create font", name, Qfont, errb);
+    maybe_signal_error (Qgui_error, "Couldn't create font", name, Qfont, errb);
     return 0;
   }
 
@@ -1519,7 +1520,7 @@
   if (!hfont2)
     {
       mswindows_finalize_font_instance (f);
-      maybe_signal_simple_error ("Couldn't map font", name, Qfont, errb);
+      maybe_signal_error (Qgui_error, "Couldn't map font", name, Qfont, errb);
       return 0;
     }
   GetTextMetrics (hdc, &metrics);
--- a/src/objects-x.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/objects-x.c	Thu May 24 07:51:33 2001 +0000
@@ -242,14 +242,15 @@
   }
   if (!result)
     {
-      maybe_signal_simple_error ("Unrecognized color", name, Qcolor, errb);
+      maybe_signal_error (Qgui_error, "Unrecognized color",
+			  name, Qcolor, errb);
       return 0;
     }
   result = allocate_nearest_color (dpy, cmap, visual, color);
   if (!result)
     {
-      maybe_signal_simple_error ("Couldn't allocate color", name, Qcolor,
-				 errb);
+      maybe_signal_error (Qgui_error, "Couldn't allocate color",
+			  name, Qcolor, errb);
       return 0;
     }
 
@@ -374,8 +375,8 @@
 
   if (!xf)
     {
-      maybe_signal_simple_error ("Couldn't load font", f->name,
-				 Qfont, errb);
+      maybe_signal_error (Qgui_error, "Couldn't load font", f->name, Qfont,
+			  errb);
       return 0;
     }
 
@@ -383,8 +384,8 @@
     {
       /* yes, this has been known to happen. */
       XFreeFont (dpy, xf);
-      maybe_signal_simple_error ("X font is too small", f->name,
-				 Qfont, errb);
+      maybe_signal_error (Qgui_error, "X font is too small", f->name, Qfont,
+			  errb);
       return 0;
     }
 
@@ -792,8 +793,8 @@
 	  Lisp_Object font_instance;
 	  XSETFONT_INSTANCE (font_instance, f);
 
-	  maybe_signal_simple_error ("Couldn't determine font truename",
-				     font_instance, Qfont, errb);
+	  maybe_signal_error (Qgui_error, "Couldn't determine font truename",
+			      font_instance, Qfont, errb);
 	  /* Ok, just this once, return the font name as the truename.
 	     (This is only used by Fequal() right now.) */
 	  return f->name;
--- a/src/objects.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/objects.c	Thu May 24 07:51:33 2001 +0000
@@ -45,7 +45,7 @@
   Lisp_Object obj;
   XSETOBJ (obj, ptr);
 
-  signal_simple_error
+  invalid_operation
     ("Can't dump an emacs containing window system objects", obj);
 }
 
@@ -74,7 +74,7 @@
   char buf[100];
   Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
   if (print_readably)
-    error ("printing unreadable object #<color-instance 0x%x>",
+    printing_unreadable_object ("#<color-instance 0x%x>",
            c->header.uid);
   write_c_string ("#<color-instance ", printcharfun);
   print_internal (c->name, printcharfun, 0);
@@ -254,7 +254,7 @@
   char buf[200];
   Lisp_Font_Instance *f = XFONT_INSTANCE (obj);
   if (print_readably)
-    error ("printing unreadable object #<font-instance 0x%x>", f->header.uid);
+    printing_unreadable_object ("#<font-instance 0x%x>", f->header.uid);
   write_c_string ("#<font-instance ", printcharfun);
   print_internal (f->name, printcharfun, 1);
   write_c_string (" on ", printcharfun);
@@ -421,8 +421,8 @@
 
   if (NILP (f->device))
     {
-      maybe_signal_simple_error ("Couldn't determine font truename",
-				 font_instance, Qfont, errb);
+      maybe_signal_error (Qgui_error, "Couldn't determine font truename",
+			       font_instance, Qfont, errb);
       return Qnil;
     }
 
@@ -545,12 +545,12 @@
 	  if (DEVICE_TTY_P (d))
 	    return Vthe_null_color_instance;
 	  else
-	    signal_simple_error ("Color instantiator [] only valid on TTY's",
+	    gui_error ("Color instantiator [] only valid on TTY's",
 				 device);
 
 	case 1:
 	  if (NILP (COLOR_SPECIFIER_FACE (XCOLOR_SPECIFIER (specifier))))
-	    signal_simple_error ("Color specifier not attached to a face",
+	    gui_error ("Color specifier not attached to a face",
 				 instantiator);
 	  return (FACE_PROPERTY_INSTANCE_1
 		  (Fget_face (XVECTOR_DATA (instantiator)[0]),
@@ -571,7 +571,7 @@
       if (DEVICE_TTY_P (d))
 	return Vthe_null_color_instance;
       else
-	signal_simple_error ("Color instantiator [] only valid on TTY's",
+	gui_error ("Color instantiator [] only valid on TTY's",
 			     device);
     }
   else
@@ -588,7 +588,7 @@
   if (VECTORP (instantiator))
     {
       if (XVECTOR_LENGTH (instantiator) > 2)
-	signal_simple_error ("Inheritance vector must be of size 0 - 2",
+	sferror ("Inheritance vector must be of size 0 - 2",
 			     instantiator);
       else if (XVECTOR_LENGTH (instantiator) > 0)
 	{
@@ -599,14 +599,14 @@
 	    {
 	      Lisp_Object field = XVECTOR_DATA (instantiator)[1];
 	      if (!EQ (field, Qforeground) && !EQ (field, Qbackground))
-		signal_simple_error
+		invalid_constant
 		  ("Inheritance field must be `foreground' or `background'",
 		   field);
 	    }
 	}
     }
   else
-    signal_simple_error ("Invalid color instantiator", instantiator);
+    invalid_argument ("Invalid color instantiator", instantiator);
 }
 
 static void
@@ -801,13 +801,13 @@
     {
       if (XVECTOR_LENGTH (instantiator) != 1)
 	{
-	  signal_simple_error
+	  sferror
 	    ("Vector length must be one for font inheritance", instantiator);
 	}
       Fget_face (XVECTOR_DATA (instantiator)[0]);
     }
   else
-    signal_simple_error ("Must be string, vector, or font-instance",
+    invalid_argument ("Must be string, vector, or font-instance",
 			 instantiator);
 }
 
@@ -894,7 +894,7 @@
 	{
 	  if (NILP (FACE_BOOLEAN_SPECIFIER_FACE
 		    (XFACE_BOOLEAN_SPECIFIER (specifier))))
-	    signal_simple_error
+	    gui_error
 	      ("Face-boolean specifier not attached to a face", instantiator);
 	  prop = FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY
 	    (XFACE_BOOLEAN_SPECIFIER (specifier));
@@ -937,15 +937,15 @@
 	      && !EQ (field, Qdim)
 	      && !EQ (field, Qblinking)
 	      && !EQ (field, Qreverse))
-	    signal_simple_error ("Invalid face-boolean inheritance field",
+	    invalid_constant ("Invalid face-boolean inheritance field",
 				 field);
 	}
     }
   else if (VECTORP (instantiator))
-    signal_simple_error ("Wrong length for face-boolean inheritance spec",
+    sferror ("Wrong length for face-boolean inheritance spec",
 			 instantiator);
   else
-    signal_simple_error ("Face-boolean instantiator must be nil, t, or vector",
+    invalid_argument ("Face-boolean instantiator must be nil, t, or vector",
 			 instantiator);
 }
 
@@ -1000,14 +1000,14 @@
   DEFSUBR (Ffont_specifier_p);
   DEFSUBR (Fface_boolean_specifier_p);
 
-  defsymbol (&Qcolor_instancep, "color-instance-p");
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qcolor_instancep);
   DEFSUBR (Fmake_color_instance);
   DEFSUBR (Fcolor_instance_p);
   DEFSUBR (Fcolor_instance_name);
   DEFSUBR (Fcolor_instance_rgb_components);
   DEFSUBR (Fvalid_color_name_p);
 
-  defsymbol (&Qfont_instancep, "font-instance-p");
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qfont_instancep);
   DEFSUBR (Fmake_font_instance);
   DEFSUBR (Ffont_instance_p);
   DEFSUBR (Ffont_instance_name);
@@ -1020,7 +1020,7 @@
   DEFSUBR (Flist_fonts);
 
   /* Qcolor, Qfont defined in general.c */
-  defsymbol (&Qface_boolean, "face-boolean");
+  DEFSYMBOL (Qface_boolean);
 }
 
 static const struct lrecord_description color_specifier_description[] = {
--- a/src/postgresql.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/postgresql.c	Thu May 24 07:51:33 2001 +0000
@@ -113,15 +113,15 @@
 Lisp_Object Vpg_coding_system;
 #endif
 
-#define CHECK_LIVE_CONNECTION(P) { \
-	if (!P || (PQstatus (P) != CONNECTION_OK)) { \
-		char *e = "bad value"; \
-		if (P) e = PQerrorMessage (P); \
-		error ("dead connection [%s]", e); \
-	} }
-#define PUKE_IF_NULL(p) { \
-	if (!p) error ("bad value"); \
-	}
+#define CHECK_LIVE_CONNECTION(P) do {					\
+	if (!P || (PQstatus (P) != CONNECTION_OK)) {			\
+		char *e = "bad value";					\
+		if (P) e = PQerrorMessage (P);				\
+	 signal_ferror (Qprocess_error, "dead connection [%s]", e);	\
+	} } while (0)
+#define PUKE_IF_NULL(p) do {						 \
+	if (!p) signal_error (Qinvalid_argument, "bad value", Qunbound); \
+	} while (0)
 
 static Lisp_Object VXPGHOST;
 static Lisp_Object VXPGUSER;
@@ -220,7 +220,7 @@
     strcpy (buf, "#<PGconn connecting>"); /* evil! */
 
   if (print_readably)
-    error ("printing unreadable object %s", buf);
+    printing_unreadable_object ("%s", buf);
   else
     write_c_string (buf, printcharfun);
 }
@@ -245,8 +245,8 @@
   Lisp_PGconn *pgconn = (Lisp_PGconn *)header;
 
   if (for_disksave)
-    signal_simple_error ("Can't dump an emacs containing PGconn objects",
-                         make_pgconn (pgconn));
+    invalid_operation ("Can't dump an emacs containing PGconn objects",
+		       make_pgconn (pgconn));
 
   if (pgconn->pgconn)
     {
@@ -335,7 +335,7 @@
     strcpy (buf, "#<PGresult DEAD>"); /* evil! */
 
   if (print_readably)
-    error ("printing unreadable object %s", buf);
+    printing_unreadable_object ("%s", buf);
   else
     write_c_string (buf, printcharfun);
 }
@@ -364,8 +364,8 @@
   Lisp_PGresult *pgresult = (Lisp_PGresult *)header;
 
   if (for_disksave)
-    signal_simple_error ("Can't dump an emacs containing PGresult objects",
-                         make_pgresult (pgresult));
+    invalid_operation ("Can't dump an emacs containing PGresult objects",
+		       make_pgresult (pgresult));
 
   if (pgresult->pgresult)
     {
@@ -482,7 +482,7 @@
 	  buf[sizeof (buf) - 1] = '\0';
 	  PQfinish (P);
 	}
-      error ("libpq: %s", buf);
+      signal_ferror (Qprocess_error, "libpq: %s", buf);
     }
 }
 
@@ -525,7 +525,7 @@
 	  buf[sizeof (buf) - 1] = '\0';
 	  PQfinish (P);
 	}
-      error ("libpq: %s", buf);
+      signal_ferror (Qprocess_error, "libpq: %s", buf);
     }
 }
 
@@ -549,7 +549,7 @@
       /* Something Bad has happened */
       {
 	char *e = PQerrorMessage (P);
-	error ("libpq: %s", e);
+	signal_ferror (Qprocess_error, "libpq: %s", e);
       }
     case PGRES_POLLING_OK:
       return Qpgres_polling_ok;
@@ -561,7 +561,7 @@
       return Qpgres_polling_active;
     default:
       /* they've added a new field we don't know about */
-      error ("Help!  Unknown status code %08x from backend!", polling_status);
+      signal_ferror (Qprocess_error, "Help!  Unknown status code %08x from backend!", polling_status);
     }
 }
 
@@ -599,7 +599,7 @@
 		      C_STRING_ALLOCA, c_encoding, Qnative);
 
   if ((rc = PQsetClientEncoding (P, c_encoding)) < 0)
-    error ("bad encoding");
+    signal_error (Qinvalid_argument, "bad encoding", Qunbound);
   else
     return make_int (rc);
 }
@@ -715,7 +715,7 @@
   if (PQresetStart (P)) return Qt;
   {
     char *e = PQerrorMessage (P);
-    error ("libpq: %s", e);
+    signal_ferror (Qprocess_error, "libpq: %s", e);
   }
 }
 
@@ -739,7 +739,7 @@
       /* Something Bad has happened */
       {
 	char *e = PQerrorMessage (P);
-	error ("libpq: %s", e);
+	signal_ferror (Qprocess_error, "libpq: %s", e);
       }
     case PGRES_POLLING_OK:
       return Qpgres_polling_ok;
@@ -751,7 +751,7 @@
       return Qpgres_polling_active;
     default:
       /* they've added a new field we don't know about */
-      error ("Help!  Unknown status code %08x from backend!", polling_status);
+      signal_ferror (Qprocess_error, "Help!  Unknown status code %08x from backend!", polling_status);
     }
 }
 #endif
@@ -859,7 +859,7 @@
 #endif /* HAVE_POSTGRESQLV7 */
 	default:
 	  /* they've added a new field we don't know about */
-	  error ("Help!  Unknown connection status code %08x from backend!", cst);
+	  signal_ferror (Qprocess_error, "Help!  Unknown connection status code %08x from backend!", cst);
 	}
     }
   else if (EQ (field, Qpqerrormessage))
@@ -875,7 +875,7 @@
      */
     return make_int (PQbackendPID(P));
   else
-    error ("bad PGconn accessor");
+    signal_error (Qinvalid_argument, "bad PGconn accessor", Qunbound);
 }
 
 /* Query functions */
@@ -902,7 +902,7 @@
   {
     char *tag, buf[BLCKSZ];
 
-    if (!R) error ("query: out of memory");
+    if (!R) out_of_memory ("query: out of memory", Qunbound);
     else
       switch (PQresultStatus (R))
 	{
@@ -918,7 +918,7 @@
 	  strncpy (buf, PQresultErrorMessage (R), sizeof (buf));
 	  buf [sizeof (buf) - 1] = '\0';
 	  PQclear (R);
-	  error (tag, buf);
+	  signal_ferror (Qprocess_error, tag, buf);
 	  /*NOTREACHED*/
 	default:
 	  break;
@@ -951,7 +951,7 @@
 		      C_STRING_ALLOCA, c_query, Qnative);
 
   if (PQsendQuery (P, c_query)) return Qt;
-  else error ("async query: %s", PQerrorMessage (P));
+  else signal_ferror (Qprocess_error, "async query: %s", PQerrorMessage (P));
 }
 
 DEFUN ("pq-get-result", Fpq_get_result, 1, 1, 0, /*
@@ -989,7 +989,7 @@
 	strncpy (buf, PQresultErrorMessage (R), sizeof (buf));
 	buf[sizeof (buf) - 1] = '\0';
 	PQclear (R);
-	error (tag, buf);
+	signal_ferror (Qprocess_error, tag, buf);
 	/*NOTREACHED*/
       default:
 	break;
@@ -1025,7 +1025,7 @@
   case PGRES_FATAL_ERROR: return Qpgres_fatal_error;
   default:
     /* they've added a new field we don't know about */
-    error ("Help!  Unknown exec status code %08x from backend!", est);
+    signal_ferror (Qprocess_error, "Help!  Unknown exec status code %08x from backend!", est);
   }
 }
 
@@ -1434,10 +1434,10 @@
   else if (EQ (status, Qpgres_bad_response)) est = PGRES_BAD_RESPONSE;
   else if (EQ (status, Qpgres_nonfatal_error)) est = PGRES_NONFATAL_ERROR;
   else if (EQ (status, Qpgres_fatal_error)) est = PGRES_FATAL_ERROR;
-  else signal_simple_error ("bad status symbol", status);
+  else invalid_constant ("bad status symbol", status);
 
   R = PQmakeEmptyPGresult (P, est);
-  if (!R) error ("out of memory?");
+  if (!R) out_of_memory (0, Qunbound);
 
   lpgr = allocate_pgresult ();
   lpgr->pgresult = R;
@@ -1582,11 +1582,11 @@
   INIT_LRECORD_IMPLEMENTATION (pgconn);
   INIT_LRECORD_IMPLEMENTATION (pgresult);
 #endif
-  defsymbol (&Qpostgresql, "postgresql");
+  DEFSYMBOL (Qpostgresql);
 
   /* opaque exported types */
-  defsymbol (&Qpgconnp, "pgconnp");
-  defsymbol (&Qpgresultp, "pgresultp");
+  DEFSYMBOL (Qpgconnp);
+  DEFSYMBOL (Qpgresultp);
 
   /* connection status types */
   defsymbol (&Qpg_connection_ok, "pg::connection-ok");
--- a/src/print.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/print.c	Thu May 24 07:51:33 2001 +0000
@@ -784,7 +784,12 @@
     while (!NILP (tail))
       {
 	write_c_string (first ? ": " : ", ", stream);
-	print_internal (Fcar (tail), stream, 1);
+	/* Most errors have an explanatory string as their first argument,
+	   and it looks better not to put the quotes around it. */
+	print_internal (Fcar (tail), stream,
+			!(first && STRINGP (Fcar (tail))) ||
+			!NILP (Fget (type, Qerror_lacks_explanatory_string,
+				     Qnil)));
 	tail = Fcdr (tail);
 	first = 0;
       }
@@ -1062,7 +1067,7 @@
 	if (EQ (obj, tortoise) && len > 0)
 	  {
 	    if (print_readably)
-	      error ("printing unreadable circular list");
+	      printing_unreadable_object ("circular list");
 	    else
 	      write_c_string ("... <circular list>", printcharfun);
 	    break;
@@ -1176,9 +1181,10 @@
   char buf[200];
 
   if (print_readably)
-    error ("printing unreadable object #<%s 0x%x>",
-	   LHEADER_IMPLEMENTATION (&header->lheader)->name,
-	   header->uid);
+    printing_unreadable_object
+      ("#<%s 0x%x>",
+       LHEADER_IMPLEMENTATION (&header->lheader)->name,
+       header->uid);
 
   sprintf (buf, "#<%s 0x%x>",
 	   LHEADER_IMPLEMENTATION (&header->lheader)->name,
@@ -1239,7 +1245,7 @@
   print_depth++;
 
   if (print_depth > PRINT_CIRCLE)
-    error ("Apparently circular structure being printed");
+    signal_error (Qstack_overflow, "Apparently circular structure being printed", Qunbound);
 
   switch (XTYPE (obj))
     {
@@ -1355,8 +1361,8 @@
 	char buf[128];
 	/* We're in trouble if this happens! */
 	if (print_readably)
-	  error ("printing illegal data type #o%03o",
-		 (int) XTYPE (obj));
+	  ty(e_error (Qinternal_error, "printing illegal data type #o%03o",
+		      (int) XTYPE (obj));
 	write_c_string ("#<EMACS BUG: ILLEGAL DATATYPE ",
 			printcharfun);
 	sprintf (buf, "(#o%3o)", (int) XTYPE (obj));
@@ -1578,7 +1584,7 @@
       CHECK_LIVE_DEVICE (device);
       if (!DEVICE_TTY_P (XDEVICE (device)) &&
 	  !DEVICE_STREAM_P (XDEVICE (device)))
-	signal_simple_error ("Must be tty or stream device", device);
+	wtaerror ("Must be tty or stream device", device);
       con = XCONSOLE (DEVICE_CONSOLE (XDEVICE (device)));
       if (DEVICE_TTY_P (XDEVICE (device)))
 	file = 0;
@@ -1624,7 +1630,7 @@
       filename = Fexpand_file_name (filename, Qnil);
       termscript = fopen ((char *) XSTRING_DATA (filename), "w");
       if (termscript == NULL)
-	report_file_error ("Opening termscript", list1 (filename));
+	report_file_error ("Opening termscript", filename);
     }
   return Qnil;
 }
@@ -1770,14 +1776,14 @@
 void
 syms_of_print (void)
 {
-  defsymbol (&Qstandard_output, "standard-output");
+  DEFSYMBOL (Qstandard_output);
 
-  defsymbol (&Qprint_length, "print-length");
+  DEFSYMBOL (Qprint_length);
 
-  defsymbol (&Qprint_string_length, "print-string-length");
+  DEFSYMBOL (Qprint_string_length);
 
-  defsymbol (&Qdisplay_error, "display-error");
-  defsymbol (&Qprint_message_label, "print-message-label");
+  DEFSYMBOL (Qdisplay_error);
+  DEFSYMBOL (Qprint_message_label);
 
   DEFSUBR (Fprin1);
   DEFSUBR (Fprin1_to_string);
@@ -1790,10 +1796,10 @@
   DEFSUBR (Falternate_debugging_output);
   DEFSUBR (Fexternal_debugging_output);
   DEFSUBR (Fopen_termscript);
-  defsymbol (&Qexternal_debugging_output, "external-debugging-output");
-  defsymbol (&Qalternate_debugging_output, "alternate-debugging-output");
+  DEFSYMBOL (Qexternal_debugging_output);
+  DEFSYMBOL (Qalternate_debugging_output);
 #ifdef HAVE_MS_WINDOWS
-  defsymbol (&Qmswindows_debugging_output, "mswindows-debugging-output");
+  DEFSYMBOL (Qmswindows_debugging_output);
 #endif
   DEFSUBR (Fwith_output_to_temp_buffer);
 }
--- a/src/process-nt.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/process-nt.c	Thu May 24 07:51:33 2001 +0000
@@ -2,7 +2,7 @@
    Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995
    Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996, 2000 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -618,7 +618,7 @@
   if (signo != SIGKILL && signo != SIGTERM
       && signo != SIGQUIT && signo != SIGINT
       && signo != SIGHUP)
-    invalid_argument ("Signal number not supported", make_int (signo));
+    invalid_constant ("Signal number not supported", make_int (signo));
 }
   
 /*-----------------------------------------------------------------------*/
@@ -655,21 +655,20 @@
   WSAStartup (MAKEWORD (1,1), &wsa_data);
 }
 
-/*
- * Fork off a subprocess. P is a pointer to newly created subprocess
- * object. If this function signals, the caller is responsible for
- * deleting (and finalizing) the process object.
- *
- * The method must return PID of the new process, a (positive??? ####) number
- * which fits into Lisp_Int. No return value indicates an error, the method
- * must signal an error instead.
- */
+DOESNT_RETURN
+mswindows_report_process_error (const char *string, Lisp_Object data,
+				int errnum)
+{
+  report_file_type_error (Qprocess_error, mswindows_lisp_error (errnum),
+			  string, data);
+}
 
-static void
-signal_cannot_launch (Lisp_Object image_file, DWORD err)
+static DOESNT_RETURN
+mswindows_report_winsock_error (const char *string, Lisp_Object data,
+				int errnum)
 {
-  mswindows_set_errno (err);
-  report_file_error ("Error starting", image_file);
+  report_file_type_error (Qnetwork_error, mswindows_lisp_error (errnum),
+			  string, data);
 }
 
 static void
@@ -701,6 +700,16 @@
     return 1;
 }
 
+/*
+ * Fork off a subprocess. P is a pointer to newly created subprocess
+ * object. If this function signals, the caller is responsible for
+ * deleting (and finalizing) the process object.
+ *
+ * The method must return PID of the new process, a (positive??? ####) number
+ * which fits into Lisp_Int. No return value indicates an error, the method
+ * must signal an error instead.
+ */
+
 static int
 nt_create_process (Lisp_Process *p,
 		   Lisp_Object *argv, int nargv,
@@ -739,8 +748,11 @@
 	  image_type = xSHGetFileInfoA (progname, 0, NULL, 0, SHGFI_EXETYPE);
 	}
       if (image_type == 0)
-	signal_cannot_launch (program, (GetLastError () == ERROR_FILE_NOT_FOUND
-					? ERROR_BAD_FORMAT : GetLastError ()));
+	mswindows_report_process_error
+	  ("Error starting",
+	   program,
+	   GetLastError () == ERROR_FILE_NOT_FOUND
+	   ? ERROR_BAD_FORMAT : GetLastError ());
       windowed = HIWORD (image_type) != 0;
     }
   else /* NT 3.5; we have no idea so just guess. */
@@ -963,7 +975,9 @@
 	    CloseHandle (hmyshove);
 	    CloseHandle (hmyslurp);
 	  }
-	signal_cannot_launch (program, GetLastError ());
+	mswindows_report_process_error
+	  ("Error starting",
+	   program, GetLastError ());
       }
 
     /* The process started successfully */
@@ -1140,14 +1154,15 @@
 #define SOCK_TIMER_ID 666
 #define XM_SOCKREPLY (WM_USER + 666)
 
+/* Return 0 for success, or error code */
+
 static int
-get_internet_address (Lisp_Object host, struct sockaddr_in *address,
-		      Error_behavior errb)
+get_internet_address (Lisp_Object host, struct sockaddr_in *address)
 {
   char buf [MAXGETHOSTSTRUCT];
   HWND hwnd;
   HANDLE hasync;
-  int success = 0;
+  int errcode = 0;
 
   address->sin_family = AF_INET;
 
@@ -1157,7 +1172,7 @@
     if (inaddr != INADDR_NONE)
       {
 	address->sin_addr.s_addr = inaddr;
-	return 1;
+	return 0;
       }
   }
 
@@ -1170,7 +1185,10 @@
   hasync = WSAAsyncGetHostByName (hwnd, XM_SOCKREPLY, XSTRING_DATA (host),
 				  buf, sizeof (buf));
   if (hasync == NULL)
-    goto done;
+    {
+      errcode = WSAGetLastError ();
+      goto done;
+    }
 
   /* Set a timer to poll for quit every 250 ms */
   SetTimer (hwnd, SOCK_TIMER_ID, 250, NULL);
@@ -1182,14 +1200,7 @@
       if (msg.message == XM_SOCKREPLY)
 	{
 	  /* Ok, got an answer */
-	  if (WSAGETASYNCERROR(msg.lParam) == NO_ERROR)
-	    success = 1;
-	  else
-	    {
-	      warn_when_safe(Qstream, Qwarning,
-			     "cannot get IP address for host \"%s\"",
-			     XSTRING_DATA (host));
-	    }
+	  errcode = WSAGETASYNCERROR (msg.lParam);
 	  goto done;
 	}
       else if (msg.message == WM_TIMER && msg.wParam == SOCK_TIMER_ID)
@@ -1208,13 +1219,13 @@
  done:
   KillTimer (hwnd, SOCK_TIMER_ID);
   DestroyWindow (hwnd);
-  if (success)
+  if (!errcode)
     {
       /* BUF starts with struct hostent */
       struct hostent* he = (struct hostent*) buf;
       address->sin_addr.s_addr = *(unsigned long*)he->h_addr_list[0];
     }
-  return success;
+  return errcode;
 }
 
 static Lisp_Object
@@ -1222,7 +1233,7 @@
 {
   struct sockaddr_in address;
 
-  if (!get_internet_address (host, &address, ERROR_ME_NOT))
+  if (get_internet_address (host, &address)) /* error */
     return host;
 
   if (address.sin_family == AF_INET)
@@ -1247,11 +1258,12 @@
   SOCKET s;
   int port;
   int retval;
+  int errnum;
 
   CHECK_STRING (host);
 
   if (!EQ (protocol, Qtcp))
-    invalid_argument ("Unsupported protocol", protocol);
+    invalid_constant ("Unsupported protocol", protocol);
 
   if (INTP (service))
     port = htons ((unsigned short) XINT (service));
@@ -1265,12 +1277,16 @@
       port = svc_info->s_port;
     }
 
-  get_internet_address (host, &address, ERROR_ME);
+  retval = get_internet_address (host, &address);
+  if (retval)
+    mswindows_report_winsock_error ("Getting IP address", host,
+				    retval);
   address.sin_port = port;
 
   s = socket (address.sin_family, SOCK_STREAM, 0);
   if (s < 0)
-    report_file_error ("error creating socket", list1 (name));
+    mswindows_report_winsock_error ("Creating socket", name,
+				    WSAGetLastError ());
 
   /* We don't want to be blocked on connect */
   {
@@ -1280,11 +1296,69 @@
   
   retval = connect (s, (struct sockaddr *) &address, sizeof (address));
   if (retval != NO_ERROR && WSAGetLastError() != WSAEWOULDBLOCK)
-    goto connect_failed;
+    {
+      errnum = WSAGetLastError ();
+      goto connect_failed;
+    }
+
+#if 0 /* PUTA! I thought getsockopt() was failing, so I created the
+	 following based on the code in get_internet_address(), but
+	 it was my own fault down below.  Both versions should work. */
   /* Wait while connection is established */
+  {
+    HWND hwnd;
+
+  /* Create a window which will receive completion messages */
+    hwnd = CreateWindow ("STATIC", NULL, WS_OVERLAPPED, 0, 0, 1, 1,
+			 NULL, NULL, NULL, NULL);
+    assert (hwnd);
+
+    /* Post request */
+    if (WSAAsyncSelect (s, hwnd, XM_SOCKREPLY, FD_CONNECT))
+      {
+	errnum = WSAGetLastError ();
+	goto done;
+      }
+
+    /* Set a timer to poll for quit every 250 ms */
+    SetTimer (hwnd, SOCK_TIMER_ID, 250, NULL);
+
+    while (1)
+      {
+	MSG msg;
+	GetMessage (&msg, hwnd, 0, 0);
+	if (msg.message == XM_SOCKREPLY)
+	  {
+	    /* Ok, got an answer */
+	    errnum = WSAGETASYNCERROR (msg.lParam);
+	    goto done;
+	  }
+
+	else if (msg.message == WM_TIMER && msg.wParam == SOCK_TIMER_ID)
+	  {
+	    if (QUITP)
+	      {
+		WSAAsyncSelect (s, hwnd, XM_SOCKREPLY, 0);
+		KillTimer (hwnd, SOCK_TIMER_ID);
+		DestroyWindow (hwnd);
+		REALLY_QUIT;
+	      }
+	  }
+	DispatchMessage (&msg);
+      }
+
+  done:
+    WSAAsyncSelect (s, hwnd, XM_SOCKREPLY, 0);
+    KillTimer (hwnd, SOCK_TIMER_ID);
+    DestroyWindow (hwnd);
+    if (errnum)
+      goto connect_failed;
+  }
+
+#else
   while (1)
     {
-      fd_set fdset;
+      fd_set fdwriteset, fdexceptset;
       struct timeval tv;
       int nsel;
 
@@ -1298,21 +1372,44 @@
       tv.tv_sec = 0;
       tv.tv_usec = 250 * 1000;
 
-      FD_ZERO (&fdset);
-      FD_SET (s, &fdset);
-      nsel = select (0, NULL, &fdset, &fdset, &tv);
+      FD_ZERO (&fdwriteset);
+      FD_SET (s, &fdwriteset);
+      FD_ZERO (&fdexceptset);
+      FD_SET (s, &fdexceptset);
+      nsel = select (0, NULL, &fdwriteset, &fdexceptset, &tv);
+
+      if (nsel == SOCKET_ERROR)
+	{
+	  errnum = WSAGetLastError ();
+	  goto connect_failed;
+	}
 
       if (nsel > 0)
 	{
 	  /* Check: was connection successful or not? */
-	  tv.tv_usec = 0;
-	  nsel = select (0, NULL, NULL, &fdset, &tv);
-	  if (nsel > 0)
-	    goto connect_failed;
+	  if (FD_ISSET (s, &fdwriteset))
+	    break;
+	  else if (FD_ISSET (s, &fdexceptset))
+	    {
+	      int store_me_harder = sizeof (errnum);
+	      /* OK, we finally can get the REAL error code.  Any paths
+		 in this code that lead to a call of WSAGetLastError()
+		 indicate probable logic failure. */
+	      if (getsockopt (s, SOL_SOCKET, SO_ERROR, (char *) &errnum,
+			      &store_me_harder))
+		errnum = WSAGetLastError ();
+	      goto connect_failed;
+	    }
 	  else
-	    break;
+	    {
+	      signal_error (Qinternal_error,
+			    "Porra, esse caralho de um sistema de operacao",
+			    Qunbound);
+	      break;
+	    }
 	}
     }
+#endif
 
   /* We are connected at this point */
   *vinfd = (void*)s;
@@ -1321,23 +1418,13 @@
 		   0, FALSE, DUPLICATE_SAME_ACCESS);
   return;
 
- connect_failed:  
-  closesocket (s);
-  if (INTP (service))
-    {
-      warn_when_safe (Qstream, Qwarning,
-		      "failure to open network stream to host \"%s\" for service \"%d\"",
-		      XSTRING_DATA (host),
-		      (unsigned short) XINT (service));
-    }
-  else
-    {
-      warn_when_safe (Qstream, Qwarning,
-		      "failure to open network stream to host \"%s\" for service \"%s\"",
-		      XSTRING_DATA (host),
-		      XSTRING_DATA (service));
-    }
-  report_file_error ("connection failed", list2 (host, name));
+ connect_failed:
+  {
+    closesocket (s);
+    mswindows_report_winsock_error ("Connection failed",
+				    list3 (Qunbound, host, service),
+				    errnum);
+  }
 }
 
 #endif
--- a/src/process-unix.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/process-unix.c	Thu May 24 07:51:33 2001 +0000
@@ -479,8 +479,8 @@
       numeric_addr = inet_addr ((char *) XSTRING_DATA (host));
       if (NUMERIC_ADDR_ERROR)
 	{
-	  maybe_error (Qprocess, errb,
-		       "Unknown host \"%s\"", XSTRING_DATA (host));
+	  maybe_signal_error (Qio_error, "Unknown host", host,
+				   Qprocess, errb);
 	  return 0;
 	}
 
@@ -1074,7 +1074,7 @@
       int save_errno = errno;
       close_descriptor_pair (forkin, forkout);
       errno = save_errno;
-      report_file_error ("Doing fork", Qnil);
+      report_process_error ("Doing fork", Qunbound);
     }
 
   /* #### dmoore - why is this commented out, otherwise we leave
@@ -1104,7 +1104,7 @@
     close_descriptor_pair (forkin, forkout);
     close_descriptor_pair (inchannel, outchannel);
     errno = save_errno;
-    report_file_error ("Opening pty or pipe", Qnil);
+    report_process_error ("Opening pty or pipe", Qunbound);
     return 0; /* not reached */
   }
 }
@@ -1293,11 +1293,15 @@
 	     the unwritten data. */
 	  writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM(p)), chunkbuf,
 				    chunklen);
-	  signal (SIGPIPE, old_sigpipe);
-	  if (writeret < 0)
-	    /* This is a real error.  Blocking errors are handled
-	       specially inside of the filedesc stream. */
-	    report_file_error ("writing to process", list1 (proc));
+	  {
+	    int save_errno = errno;
+	    signal (SIGPIPE, old_sigpipe);
+	    errno = save_errno;
+	    if (writeret < 0)
+	      /* This is a real error.  Blocking errors are handled
+		 specially inside of the filedesc stream. */
+	      report_process_error ("writing to process", proc);
+	  }
 	  while (Lstream_was_blocked_p (XLSTREAM (p->pipe_outstream)))
 	    {
 	      /* Buffer is full.  Wait, accepting input;
@@ -1541,8 +1545,9 @@
 #ifdef ESRCH
       if (errno != ESRCH)
 #endif
-	error ("kill (%ld, %ld) failed: %s",
-	       (long) pgid, (long) signo, strerror (errno));
+	signal_ferror_with_frob (Qio_error, lisp_strerror (errno),
+				 "kill (pgid=%ld, signo=%ld) failed",
+				 (long) pgid, (long) signo);
     }
 }
 
@@ -1586,11 +1591,11 @@
   retval = getaddrinfo (ext_host, NULL, &hints, &res);
   if (retval != 0)
     {
-      char *gai_error;
+      Bufbyte *gai_error;
 
       EXTERNAL_TO_C_STRING (gai_strerror (retval), gai_error, Qnative);
-      maybe_error (Qprocess, ERROR_ME_NOT,
-		   "%s \"%s\"", gai_error, XSTRING_DATA (host));
+      maybe_signal_error (Qio_error, gai_error, host,
+			       Qprocess, ERROR_ME_NOT);
       canonname = host;
     }
   else
@@ -1641,7 +1646,7 @@
   CHECK_STRING (host);
 
   if (!EQ (protocol, Qtcp) && !EQ (protocol, Qudp))
-    invalid_argument ("Unsupported protocol", protocol);
+    invalid_constant ("Unsupported protocol", protocol);
 
   {
 #ifdef USE_GETADDRINFO
@@ -1680,10 +1685,10 @@
     retval = getaddrinfo (ext_host, portstring, &hints, &res);
     if (retval != 0)
       {
-	char *gai_error;
+	Bufbyte *gai_error;
 
 	EXTERNAL_TO_C_STRING (gai_strerror (retval), gai_error, Qnative);
-	error ("%s/%s %s", XSTRING_DATA (host), portstring, gai_error);
+	signal_error (Qio_error, gai_error, list2 (host, service));
       }
 
     /* address loop */
@@ -1848,9 +1853,10 @@
 	errno = xerrno;
 
 	if (failed_connect)
-	  report_file_error ("connection failed", list2 (host, name));
+	  report_network_error ("connection failed", list3 (Qunbound, host,
+							    name));
 	else
-	  report_file_error ("error creating socket", list1 (name));
+	  report_network_error ("error creating socket", name);
       }
   }
 
@@ -1858,8 +1864,10 @@
   outch = dup (s);
   if (outch < 0)
     {
+      int save_errno = errno;
       close (s); /* this used to be leaked; from Kyle Jones */
-      report_file_error ("error duplicating socket", list1 (name));
+      errno = save_errno;
+      report_network_error ("error duplicating socket", name);
     }
 
   set_socket_nonblocking_maybe (inch, port, "tcp");
@@ -1913,15 +1921,17 @@
   thettl = (unsigned char) XINT (ttl);
 
   if ((udp = getprotobyname ("udp")) == NULL)
-    type_error (Qinvalid_operation, "No info available for UDP protocol");
+    invalid_operation ("No info available for UDP protocol", Qunbound);
 
   /* Init the sockets. Yes, I need 2 sockets. I couldn't duplicate one. */
   if ((rs = socket (PF_INET, SOCK_DGRAM, udp->p_proto)) < 0)
-    report_file_error ("error creating socket", list1(name));
+    report_network_error ("error creating socket", name);
   if ((ws = socket (PF_INET, SOCK_DGRAM, udp->p_proto)) < 0)
     {
+      int save_errno = errno;
       close (rs);
-      report_file_error ("error creating socket", list1(name));
+      errno = save_errno;
+      report_network_error ("error creating socket", name);
     }
 
   /* This will be used for both sockets */
@@ -1942,9 +1952,12 @@
   /* bind socket name */
   if (bind (rs, (struct sockaddr *)&sa, sizeof(sa)))
     {
+      int save_errno = errno;
       close (rs);
       close (ws);
-      report_file_error ("error binding socket", list2(name, port));
+      errno = save_errno;
+      report_network_error ("error binding socket", list3 (Qunbound, name,
+							   port));
     }
 
   /* join multicast group */
@@ -1953,9 +1966,12 @@
   if (setsockopt (rs, IPPROTO_IP, IP_ADD_MEMBERSHIP,
 		  &imr, sizeof (struct ip_mreq)) < 0)
     {
+      int save_errno = errno;
       close (ws);
       close (rs);
-      report_file_error ("error adding membership", list2(name, dest));
+      errno = save_errno;
+      report_network_error ("error adding membership", list3 (Qunbound, name,
+							      dest));
     }
 
   /* Socket configuration for writing ----------------------- */
@@ -2018,7 +2034,8 @@
 #endif
 
       errno = xerrno;
-      report_file_error ("error connecting socket", list2(name, port));
+      report_network_error ("error connecting socket", list3 (Qunbound, name,
+							      port));
     }
 
 #ifdef CONNECT_NEEDS_SLOWED_INTERRUPTS
@@ -2029,9 +2046,11 @@
   if (setsockopt (ws, IPPROTO_IP, IP_MULTICAST_TTL,
 		  &thettl, sizeof (thettl)) < 0)
     {
+      int save_errno = errno;
       close (rs);
       close (ws);
-      report_file_error ("error setting ttl", list2(name, ttl));
+      errno = save_errno;
+      report_network_error ("error setting ttl", list3 (Qunbound, name, ttl));
     }
 
   set_socket_nonblocking_maybe (rs, theport, "udp");
--- a/src/process.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/process.c	Thu May 24 07:51:33 2001 +0000
@@ -109,6 +109,9 @@
 extern Lisp_Object Vlisp_EXEC_SUFFIXES;
 Lisp_Object Vnull_device;
 
+Lisp_Object Qprocess_error;
+Lisp_Object Qnetwork_error;
+
 
 
 static Lisp_Object
@@ -138,8 +141,7 @@
   Lisp_Process *process = XPROCESS (object);
 
   if (print_readably)
-    error ("printing unreadable object #<process %s>",
-           XSTRING_DATA (process->name));
+    printing_unreadable_object ("#<process %s>", XSTRING_DATA (process->name));
 
   if (!escapeflag)
     {
@@ -342,7 +344,7 @@
       if (BUFFERP (buffer))
 	goto have_buffer_object;
 
-      error ("Process %s does not exist", XSTRING_DATA (name));
+      invalid_argument ("Process does not exist", name);
     }
   else if (NILP (name))
     {
@@ -359,8 +361,7 @@
       if (PROCESSP (process))
 	return process;
 
-      error ("Buffer %s has no process",
-	     XSTRING_DATA (XBUFFER (buffer)->name));
+      invalid_argument ("Buffer has no process", buffer);
     }
   else
     return get_process (Fsignal (Qwrong_type_argument,
@@ -414,6 +415,18 @@
 /*                          creating a process                          */
 /************************************************************************/
 
+DOESNT_RETURN
+report_process_error (const char *string, Lisp_Object data)
+{
+  report_error_with_errno (Qprocess_error, string, data);
+}
+
+DOESNT_RETURN
+report_network_error (const char *string, Lisp_Object data)
+{
+  report_error_with_errno (Qnetwork_error, string, data);
+}
+
 Lisp_Object
 make_process_internal (Lisp_Object name)
 {
@@ -469,11 +482,13 @@
 init_process_io_handles (Lisp_Process *p, void* in, void* out, int flags)
 {
   USID usid = event_stream_create_stream_pair (in, out,
-					       &p->pipe_instream, &p->pipe_outstream,
+					       &p->pipe_instream,
+					       &p->pipe_outstream,
 					       flags);
 
   if (usid == USID_ERROR)
-    report_file_error ("Setting up communication with subprocess", Qnil);
+    signal_error (Qprocess_error, "Setting up communication with subprocess",
+		  Qunbound);
 
   if (usid != USID_DONTHASH)
     {
@@ -587,8 +602,8 @@
   /* dmoore - if you re-enable this code, you have to gcprotect
      current_buffer through the above calls. */
   if (NILP (Ffile_accessible_directory_p (current_dir)))
-    report_file_error ("Setting current directory",
-		       list1 (current_buffer->directory));
+    signal_error (Qprocess_error, "Setting current directory",
+		  current_buffer->directory);
 #endif /* 0 */
 
   /* If program file name is not absolute, search our path for it */
@@ -602,7 +617,7 @@
       NGCPRO1 (tem);
       locate_file (Vexec_path, program, Vlisp_EXEC_SUFFIXES, &tem, X_OK);
       if (NILP (tem))
-	report_file_error ("Searching for program", list1 (program));
+	signal_error (Qprocess_error, "Searching for program", program);
       program = Fexpand_file_name (tem, Qnil);
       NUNGCPRO;
     }
@@ -617,7 +632,7 @@
       locate_file (list1 (build_string ("")), program, Vlisp_EXEC_SUFFIXES,
 		   &tem, X_OK);
       if (NILP (tem))
-	report_file_error ("Searching for program", list1 (program));
+	signal_error (Qprocess_error, "Searching for program", program);
       program = tem;
       NUNGCPRO;
     }
@@ -989,7 +1004,7 @@
   GCPRO2 (process, lstream);
 
   if (NILP (DATA_OUTSTREAM (XPROCESS (process))))
-    signal_simple_error ("Process not open for writing", process);
+    invalid_operation ("Process not open for writing", process);
 
   if (nonrelocatable)
     lstream =
@@ -1691,7 +1706,7 @@
 
 #undef handle_signal
 
-      error ("Undefined signal name %s", name);
+      invalid_constant ("Undefined signal name", signal_);
       return 0; /* Unreached */
     }
 }
@@ -1717,8 +1732,7 @@
   process = get_process (process);
 
   if (network_connection_p (process))
-    error ("Network connection %s is not a subprocess",
-	   XSTRING_DATA (XPROCESS(process)->name));
+    invalid_operation ("Network connection is not a subprocess", process);
   CHECK_LIVE_PROCESS (process);
 
   MAYBE_PROCMETH (kill_child_process, (process, signo, current_group, nomsg));
@@ -1764,7 +1778,9 @@
 #ifdef SIGKILL
   process_send_signal (process, SIGKILL, !NILP (current_group), 0);
 #else
-  error ("kill-process: Not supported on this system");
+  signal_error (Qunimplemented,
+		     "kill-process: Not supported on this system",
+		     Qunbound);
 #endif
   return process;
 }
@@ -1779,7 +1795,9 @@
 #ifdef SIGQUIT
   process_send_signal (process, SIGQUIT, !NILP (current_group), 0);
 #else
-  error ("quit-process: Not supported on this system");
+  signal_error (Qunimplemented,
+		     "quit-process: Not supported on this system",
+		     Qunbound);
 #endif
   return process;
 }
@@ -1794,7 +1812,9 @@
 #ifdef SIGTSTP
   process_send_signal (process, SIGTSTP, !NILP (current_group), 0);
 #else
-  error ("stop-process: Not supported on this system");
+  signal_error (Qunimplemented,
+		     "stop-process: Not supported on this system",
+		     Qunbound);
 #endif
   return process;
 }
@@ -1809,7 +1829,9 @@
 #ifdef SIGCONT
   process_send_signal (process, SIGCONT, !NILP (current_group), 0);
 #else
-  error ("continue-process: Not supported on this system");
+  signal_error (Qunimplemented,
+		     "continue-process: Not supported on this system",
+		     Qunbound);
 #endif
   return process;
 }
@@ -1844,7 +1866,7 @@
 
   /* Make sure the process is really alive.  */
   if (! EQ (XPROCESS (process)->status_symbol, Qrun))
-    error ("Process %s not running", XSTRING_DATA (XPROCESS (process)->name));
+    invalid_operation ("Process not running", process);
 
   if (!MAYBE_INT_PROCMETH (process_send_eof, (process)))
     {
@@ -2023,20 +2045,23 @@
 {
   INIT_LRECORD_IMPLEMENTATION (process);
 
-  defsymbol (&Qprocessp, "processp");
-  defsymbol (&Qprocess_live_p, "process-live-p");
-  defsymbol (&Qrun, "run");
-  defsymbol (&Qstop, "stop");
-  defsymbol (&Qopen, "open");
-  defsymbol (&Qclosed, "closed");
+  DEFSYMBOL (Qprocessp);
+  DEFSYMBOL (Qprocess_live_p);
+  DEFSYMBOL (Qrun);
+  DEFSYMBOL (Qstop);
+  DEFSYMBOL (Qopen);
+  DEFSYMBOL (Qclosed);
 
-  defsymbol (&Qtcp, "tcp");
-  defsymbol (&Qudp, "udp");
+  DEFSYMBOL (Qtcp);
+  DEFSYMBOL (Qudp);
 
 #ifdef HAVE_MULTICAST
-  defsymbol(&Qmulticast, "multicast"); /* Used for occasional warnings */
+  DEFSYMBOL (Qmulticast); /* Used for occasional warnings */
 #endif
 
+  DEFERROR_STANDARD (Qprocess_error, Qio_error);
+  DEFERROR_STANDARD (Qnetwork_error, Qio_error);
+
   DEFSUBR (Fprocessp);
   DEFSUBR (Fprocess_live_p);
   DEFSUBR (Fget_process);
--- a/src/ralloc.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/ralloc.c	Thu May 24 07:51:33 2001 +0000
@@ -2048,18 +2048,18 @@
 syms_of_ralloc (void)
 {
 #ifdef MMAP_METERING
-  defsymbol (&Qmmap_times_mapped, "mmap-times-mapped");
-  defsymbol (&Qmmap_pages_mapped, "mmap-pages-mapped");
-  defsymbol (&Qmmap_times_unmapped, "mmap-times-unmapped");
-  defsymbol (&Qmmap_times_remapped, "mmap-times-remapped");
-  defsymbol (&Qmmap_didnt_copy, "mmap-didnt-copy");
-  defsymbol (&Qmmap_pages_copied, "mmap-pages-copied");
-  defsymbol (&Qmmap_average_bumpval, "mmap-average-bumpval");
-  defsymbol (&Qmmap_wastage, "mmap-wastage");
-  defsymbol (&Qmmap_live_pages, "mmap-live-pages");
-  defsymbol (&Qmmap_addr_looked_up, "mmap-addr-looked-up");
-  defsymbol (&Qmmap_hash_worked, "mmap-hash-worked");
-  defsymbol (&Qmmap_addrlist_size, "mmap-addrlist-size");
+  DEFSYMBOL (Qmmap_times_mapped);
+  DEFSYMBOL (Qmmap_pages_mapped);
+  DEFSYMBOL (Qmmap_times_unmapped);
+  DEFSYMBOL (Qmmap_times_remapped);
+  DEFSYMBOL (Qmmap_didnt_copy);
+  DEFSYMBOL (Qmmap_pages_copied);
+  DEFSYMBOL (Qmmap_average_bumpval);
+  DEFSYMBOL (Qmmap_wastage);
+  DEFSYMBOL (Qmmap_live_pages);
+  DEFSYMBOL (Qmmap_addr_looked_up);
+  DEFSYMBOL (Qmmap_hash_worked);
+  DEFSYMBOL (Qmmap_addrlist_size);
   DEFSUBR (Fmmap_allocator_status);
 #endif /* MMAP_METERING */
 }
--- a/src/rangetab.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/rangetab.c	Thu May 24 07:51:33 2001 +0000
@@ -416,7 +416,7 @@
   CHECK_INT_COERCE_CHAR (end);
   last = XINT (end);
   if (first > last)
-    signal_simple_error_2 ("start must be <= end", start, end);
+    invalid_argument_2 ("start must be <= end", start, end);
 
   put_range_table (range_table, first, last, value);
   verify_range_table (XRANGE_TABLE (range_table));
@@ -505,13 +505,13 @@
       Lisp_Object range = XCAR (rest);
       rest = XCDR (rest);
       if (!CONSP (rest))
-	signal_simple_error ("Invalid list format", value);
+	sferror ("Invalid list format", value);
       if (!INTP (range) && !CHARP (range)
 	  && !(CONSP (range) && CONSP (XCDR (range))
 	       && NILP (XCDR (XCDR (range)))
 	       && (INTP (XCAR (range)) || CHARP (XCAR (range)))
 	       && (INTP (XCAR (XCDR (range))) || CHARP (XCAR (XCDR (range))))))
-	signal_simple_error ("Invalid range format", range);
+	sferror ("Invalid range format", range);
     }
 
   return 1;
@@ -744,8 +744,8 @@
 {
   INIT_LRECORD_IMPLEMENTATION (range_table);
 
-  defsymbol (&Qrange_tablep, "range-table-p");
-  defsymbol (&Qrange_table, "range-table");
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qrange_tablep);
+  DEFSYMBOL (Qrange_table);
 
   DEFSUBR (Frange_table_p);
   DEFSUBR (Fmake_range_table);
--- a/src/redisplay.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/redisplay.c	Thu May 24 07:51:33 2001 +0000
@@ -9232,17 +9232,16 @@
 void
 syms_of_redisplay (void)
 {
-  defsymbol (&Qcursor_in_echo_area, "cursor-in-echo-area");
+  DEFSYMBOL (Qcursor_in_echo_area);
 #ifndef INHIBIT_REDISPLAY_HOOKS
-  defsymbol (&Qpre_redisplay_hook, "pre-redisplay-hook");
-  defsymbol (&Qpost_redisplay_hook, "post-redisplay-hook");
+  DEFSYMBOL (Qpre_redisplay_hook);
+  DEFSYMBOL (Qpost_redisplay_hook);
 #endif /* INHIBIT_REDISPLAY_HOOKS */
-  defsymbol (&Qdisplay_warning_buffer, "display-warning-buffer");
-  defsymbol (&Qbar_cursor, "bar-cursor");
-  defsymbol (&Qredisplay_end_trigger_functions,
-	     "redisplay-end-trigger-functions");
-  defsymbol (&Qtop_bottom, "top-bottom");
-  defsymbol (&Qbuffer_list_changed_hook, "buffer-list-changed-hook");
+  DEFSYMBOL (Qdisplay_warning_buffer);
+  DEFSYMBOL (Qbar_cursor);
+  DEFSYMBOL (Qredisplay_end_trigger_functions);
+  DEFSYMBOL (Qtop_bottom);
+  DEFSYMBOL (Qbuffer_list_changed_hook);
 
   DEFSUBR (Fredisplay_echo_area);
   DEFSUBR (Fredraw_frame);
--- a/src/scrollbar.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/scrollbar.c	Thu May 24 07:51:33 2001 +0000
@@ -894,23 +894,23 @@
 void
 syms_of_scrollbar (void)
 {
-  defsymbol (&Qscrollbar_line_up, "scrollbar-line-up");
-  defsymbol (&Qscrollbar_line_down, "scrollbar-line-down");
-  defsymbol (&Qscrollbar_page_up, "scrollbar-page-up");
-  defsymbol (&Qscrollbar_page_down, "scrollbar-page-down");
-  defsymbol (&Qscrollbar_to_top, "scrollbar-to-top");
-  defsymbol (&Qscrollbar_to_bottom, "scrollbar-to-bottom");
-  defsymbol (&Qscrollbar_vertical_drag, "scrollbar-vertical-drag");
+  DEFSYMBOL (Qscrollbar_line_up);
+  DEFSYMBOL (Qscrollbar_line_down);
+  DEFSYMBOL (Qscrollbar_page_up);
+  DEFSYMBOL (Qscrollbar_page_down);
+  DEFSYMBOL (Qscrollbar_to_top);
+  DEFSYMBOL (Qscrollbar_to_bottom);
+  DEFSYMBOL (Qscrollbar_vertical_drag);
 
-  defsymbol (&Qscrollbar_char_left, "scrollbar-char-left");
-  defsymbol (&Qscrollbar_char_right, "scrollbar-char-right");
-  defsymbol (&Qscrollbar_page_left, "scrollbar-page-left");
-  defsymbol (&Qscrollbar_page_right, "scrollbar-page-right");
-  defsymbol (&Qscrollbar_to_left, "scrollbar-to-left");
-  defsymbol (&Qscrollbar_to_right, "scrollbar-to-right");
-  defsymbol (&Qscrollbar_horizontal_drag, "scrollbar-horizontal-drag");
+  DEFSYMBOL (Qscrollbar_char_left);
+  DEFSYMBOL (Qscrollbar_char_right);
+  DEFSYMBOL (Qscrollbar_page_left);
+  DEFSYMBOL (Qscrollbar_page_right);
+  DEFSYMBOL (Qscrollbar_to_left);
+  DEFSYMBOL (Qscrollbar_to_right);
+  DEFSYMBOL (Qscrollbar_horizontal_drag);
 
-  defsymbol (&Qinit_scrollbar_from_resources, "init-scrollbar-from-resources");
+  DEFSYMBOL (Qinit_scrollbar_from_resources);
 
   /* #### All these functions should be moved into Lisp.
      See comment above. */
--- a/src/search.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/search.c	Thu May 24 07:51:33 2001 +0000
@@ -126,7 +126,7 @@
 static void
 matcher_overflow (void)
 {
-  error ("Stack overflow in regexp matcher");
+  stack_overflow ("Stack overflow in regexp matcher", Qunbound);
 }
 
 /* Compile a regexp and signal a Lisp error if anything goes wrong.
@@ -159,7 +159,7 @@
   re_set_syntax (old);
   if (val)
     {
-      maybe_signal_error (Qinvalid_regexp, list1 (build_string (val)),
+      maybe_signal_error (Qinvalid_regexp, 0, build_string (val),
 			  Qsearch, errb);
       return 0;
     }
@@ -829,7 +829,7 @@
 	  if (c < 0400 && syntax_spec_code[c] < (unsigned char) Smax)
 	    fastmap[c] = 1;
 	  else
-	    signal_simple_error ("Invalid syntax designator",
+	    invalid_argument ("Invalid syntax designator",
 				 make_char (c));
 	}
       else
@@ -1037,7 +1037,8 @@
       CHECK_INT_COERCE_MARKER (limit);
       lim = XINT (limit);
       if (n > 0 ? lim < BUF_PT (buf) : lim > BUF_PT (buf))
-	error ("Invalid search limit (wrong side of point)");
+	invalid_argument ("Invalid search limit (wrong side of point)",
+			  Qunbound);
       if (lim > BUF_ZV (buf))
 	lim = BUF_ZV (buf);
       if (lim < BUF_BEGV (buf))
@@ -2280,7 +2281,7 @@
     {
       CHECK_STRING (string);
       if (!EQ (last_thing_searched, Qt))
-	error ("last thing matched was not a string");
+ invalid_argument ("last thing matched was not a string", Qunbound);
       /* If the match data
 	 were abstracted into a special "match data" type instead
 	 of the typical half-assed "let the implementation be
@@ -2302,7 +2303,7 @@
 	    args_out_of_range (strbuffer, make_int (search_regs.num_regs));
 	}
       if (!BUFFERP (last_thing_searched))
-	error ("last thing matched was not a buffer");
+ invalid_argument ("last thing matched was not a buffer", Qunbound);
       buffer = last_thing_searched;
       buf = XBUFFER (buffer);
     }
@@ -2313,7 +2314,7 @@
 				/* but some C compilers blew it */
 
   if (search_regs.num_regs == 0)
-    error ("replace-match called before any match found");
+    signal_error (Qinvalid_operation, "replace-match called before any match found", Qunbound);
 
   if (NILP (string))
     {
@@ -2747,7 +2748,7 @@
   Charcount len;
 
   if (NILP (last_thing_searched))
-    /*error ("match-data called before any match found");*/
+    /*error ("match-data called before any match found", Qunbound);*/
     return Qnil;
 
   data = alloca_array (Lisp_Object, 2 * search_regs.num_regs);
@@ -2982,6 +2983,7 @@
 
   DEFERROR_STANDARD (Qsearch_failed, Qinvalid_operation);
   DEFERROR_STANDARD (Qinvalid_regexp, Qsyntax_error);
+  Fput (Qinvalid_regexp, Qerror_lacks_explanatory_string, Qt);
 
   DEFSUBR (Flooking_at);
   DEFSUBR (Fposix_looking_at);
--- a/src/select-gtk.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/select-gtk.c	Thu May 24 07:51:33 2001 +0000
@@ -288,7 +288,7 @@
   wait_delaying_user_input (selection_reply_done, 0);
 
   if (selection_reply_timed_out)
-    error ("timed out waiting for reply from selection owner");
+    signal_error (Qselection_conversion_error, "timed out waiting for reply from selection owner", Qunbound);
 
   unbind_to (speccount, Qnil);
 
@@ -462,17 +462,18 @@
     {
       if (XGetSelectionOwner (display, selection_atom))
 	/* there is a selection owner */
-	signal_error
-	  (Qselection_conversion_error,
-	   Fcons (build_string ("selection owner couldn't convert"),
-		  Fcons (x_atom_to_symbol (d, selection_atom),
-			 actual_type ?
-			 list2 (target_type, x_atom_to_symbol (d, actual_type)) :
-			 list1 (target_type))));
+	signal_error (Qselection_conversion_error,
+		      "selection owner couldn't convert",
+		      Fcons (Qunbound,
+			     Fcons (x_atom_to_symbol (d, selection_atom),
+				    actual_type ?
+				    list2 (target_type,
+					   x_atom_to_symbol (d, actual_type)) :
+				    list1 (target_type))));
       else
-	signal_error (Qerror,
-		      list2 (build_string ("no selection"),
-			     x_atom_to_symbol (d, selection_atom)));
+	signal_error (Qselection_conversion_error,
+		      "no selection",
+		      x_atom_to_symbol (d, selection_atom));
     }
 
   if (actual_type == DEVICE_XATOM_INCR (d))
@@ -765,10 +766,8 @@
 	      (*(GdkAtom **) data_ret) [i] =
 		symbol_to_gtk_atom (d, XVECTOR_DATA (obj) [i], 0);
 	    else
-              signal_error (Qerror, /* Qselection_error */
-                            list2 (build_string
-		   ("all elements of the vector must be of the same type"),
-                                   obj));
+              syntax_error
+		("all elements of the vector must be of the same type", obj);
 	}
 #if 0 /* #### MULTIPLE doesn't work yet */
       else if (VECTORP (XVECTOR_DATA (obj) [0]))
@@ -784,10 +783,8 @@
 	      {
 		Lisp_Object pair = XVECTOR_DATA (obj) [i];
 		if (XVECTOR_LENGTH (pair) != 2)
-		  signal_error (Qerror,
-                                list2 (build_string
-       ("elements of the vector must be vectors of exactly two elements"),
-				  pair));
+		  syntax_error
+		    ("elements of the vector must be vectors of exactly two elements", pair);
 
 		(*(GdkAtom **) data_ret) [i * 2] =
 		  symbol_to_gtk_atom (d, XVECTOR_DATA (pair) [0], 0);
@@ -795,10 +792,8 @@
 		  symbol_to_gtk_atom (d, XVECTOR_DATA (pair) [1], 0);
 	      }
 	    else
-	      signal_error (Qerror,
-                            list2 (build_string
-		   ("all elements of the vector must be of the same type"),
-                                   obj));
+	      syntax_error
+		("all elements of the vector must be of the same type", obj);
 	}
 #endif
       else
@@ -811,10 +806,8 @@
 	    if (CONSP (XVECTOR_DATA (obj) [i]))
 	      *format_ret = 32;
 	    else if (!INTP (XVECTOR_DATA (obj) [i]))
-	      signal_error (Qerror, /* Qselection_error */
-                            list2 (build_string
-	("all elements of the vector must be integers or conses of integers"),
-                                   obj));
+	      syntax_error
+		("all elements of the vector must be integers or conses of integers", obj);
 
 	  *data_ret = (unsigned char *) xmalloc (*size_ret * (*format_ret/8));
 	  for (i = 0; i < (int) (*size_ret); i++)
@@ -827,9 +820,7 @@
 	}
     }
   else
-    signal_error (Qerror, /* Qselection_error */
-                  list2 (build_string ("unrecognized selection data"),
-                         obj));
+    invalid_argument ("unrecognized selection data", obj);
 
   *type_ret = symbol_to_gtk_atom (d, type, 0);
 }
--- a/src/select-x.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/select-x.c	Thu May 24 07:51:33 2001 +0000
@@ -400,12 +400,12 @@
 	  selection = XCDR (selection);
 
 	if (NILP (selection))
-	  signal_error (Qselection_conversion_error,
-			build_string ("no selection"));
+	  signal_error (Qselection_conversion_error, "no selection",
+			     Qunbound);
 
 	if (!STRINGP (selection))
 	  signal_error (Qselection_conversion_error,
-			build_string ("couldn't convert selection to string"));
+			     "couldn't convert selection to string", Qunbound);
 
 
 	XmClipboardCopyByName (dpy, window, *data_id,
@@ -513,7 +513,7 @@
       int prop_id;
 
       if (x_window_to_frame (d, window)) /* #### debug */
-	error ("attempt to transfer an INCR to ourself!");
+ invalid_operation ("attempt to transfer an INCR to ourself!", Qunbound);
 #if 0
       stderr_out ("\nINCR %d\n", bytes_remaining);
 #endif
@@ -861,9 +861,7 @@
       Lisp_Object vec2 = XVECTOR_DATA (obj) [i];
       CHECK_VECTOR (vec2);
       if (XVECTOR_LENGTH (vec2) != 2)
-	signal_error (Qerror, list2 (build_string
-				     ("vectors must be of length 2"),
-                                     vec2));
+	sferror ("vectors must be of length 2", vec2);
       XVECTOR_DATA (vec) [i] = make_vector (2, Qnil);
       XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [0] = XVECTOR_DATA (vec2) [0];
       XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [1] = XVECTOR_DATA (vec2) [1];
@@ -938,7 +936,7 @@
   wait_delaying_user_input (selection_reply_done, 0);
 
   if (selection_reply_timed_out)
-    error ("timed out waiting for reply from selection owner");
+    signal_error (Qselection_conversion_error, "timed out waiting for reply from selection owner", Qunbound);
 
   unbind_to (speccount, Qnil);
 
@@ -1116,17 +1114,18 @@
     {
       if (XGetSelectionOwner (display, selection_atom))
 	/* there is a selection owner */
-	signal_error
-	  (Qselection_conversion_error,
-	   Fcons (build_string ("selection owner couldn't convert"),
-		  Fcons (x_atom_to_symbol (d, selection_atom),
-			 actual_type ?
-			 list2 (target_type, x_atom_to_symbol (d, actual_type)) :
-			 list1 (target_type))));
+	signal_error (Qselection_conversion_error,
+		      "selection owner couldn't convert",
+		      Fcons (Qunbound,
+			     Fcons (x_atom_to_symbol (d, selection_atom),
+				    actual_type ?
+				    list2 (target_type,
+					   x_atom_to_symbol (d, actual_type)) :
+				    list1 (target_type))));
       else
-	signal_error (Qerror,
-		      list2 (build_string ("no selection"),
-			     x_atom_to_symbol (d, selection_atom)));
+	signal_error (Qselection_conversion_error,
+		      "no selection",
+		      x_atom_to_symbol (d, selection_atom));
     }
 
   if (actual_type == DEVICE_XATOM_INCR (d))
@@ -1382,10 +1381,8 @@
 	      (*(Atom **) data_ret) [i] =
 		symbol_to_x_atom (d, XVECTOR_DATA (obj) [i], 0);
 	    else
-              signal_error (Qerror, /* Qselection_error */
-                            list2 (build_string
-		   ("all elements of the vector must be of the same type"),
-                                   obj));
+              syntax_error
+		("all elements of the vector must be of the same type", obj);
 	}
 #if 0 /* #### MULTIPLE doesn't work yet */
       else if (VECTORP (XVECTOR_DATA (obj) [0]))
@@ -1401,10 +1398,8 @@
 	      {
 		Lisp_Object pair = XVECTOR_DATA (obj) [i];
 		if (XVECTOR_LENGTH (pair) != 2)
-		  signal_error (Qerror,
-                                list2 (build_string
-       ("elements of the vector must be vectors of exactly two elements"),
-				  pair));
+		  syntax_error
+		    ("elements of the vector must be vectors of exactly two elements", pair);
 
 		(*(Atom **) data_ret) [i * 2] =
 		  symbol_to_x_atom (d, XVECTOR_DATA (pair) [0], 0);
@@ -1412,10 +1407,8 @@
 		  symbol_to_x_atom (d, XVECTOR_DATA (pair) [1], 0);
 	      }
 	    else
-	      signal_error (Qerror,
-                            list2 (build_string
-		   ("all elements of the vector must be of the same type"),
-                                   obj));
+	      syntax_error
+		("all elements of the vector must be of the same type", obj);
 	}
 #endif
       else
@@ -1428,10 +1421,8 @@
 	    if (CONSP (XVECTOR_DATA (obj) [i]))
 	      *format_ret = 32;
 	    else if (!INTP (XVECTOR_DATA (obj) [i]))
-	      signal_error (Qerror, /* Qselection_error */
-                            list2 (build_string
-	("all elements of the vector must be integers or conses of integers"),
-                                   obj));
+	      syntax_error
+		("all elements of the vector must be integers or conses of integers", obj);
 
 	  *data_ret = (unsigned char *) xmalloc (*size_ret * (*format_ret/8));
 	  for (i = 0; i < (int) (*size_ret); i++)
@@ -1444,9 +1435,7 @@
 	}
     }
   else
-    signal_error (Qerror, /* Qselection_error */
-                  list2 (build_string ("unrecognized selection data"),
-                         obj));
+    invalid_argument ("unrecognized selection data", obj);
 
   *type_ret = symbol_to_x_atom (d, type, 0);
 }
@@ -1540,7 +1529,7 @@
 	 EQ (symbol, QCUT_BUFFER5) ||				\
 	 EQ (symbol, QCUT_BUFFER6) ||				\
 	 EQ (symbol, QCUT_BUFFER7)))				\
-    signal_simple_error ("Doesn't name a cutbuffer", symbol);	\
+    invalid_constant ("Doesn't name a cutbuffer", symbol);	\
 } while (0)
 
 DEFUN ("x-get-cutbuffer-internal", Fx_get_cutbuffer_internal, 1, 1, 0, /*
@@ -1567,9 +1556,9 @@
   if (!data) return Qnil;
 
   if (format != 8 || type != XA_STRING)
-    signal_simple_error_2 ("Cut buffer doesn't contain 8-bit STRING data",
-			   x_atom_to_symbol (d, type),
-			   make_int (format));
+    invalid_state_2 ("Cut buffer doesn't contain 8-bit STRING data",
+		     x_atom_to_symbol (d, type),
+		     make_int (format));
 
   /* We cheat - if the string contains an ESC character, that's
      technically not allowed in a STRING, so we assume it's
@@ -1713,8 +1702,7 @@
 #endif /* CUT_BUFFER_SUPPORT */
 
   /* Unfortunately, timeout handlers must be lisp functions. */
-  defsymbol (&Qx_selection_reply_timeout_internal,
-             "x-selection-reply-timeout-internal");
+  DEFSYMBOL (Qx_selection_reply_timeout_internal);
   DEFSUBR (Fx_selection_reply_timeout_internal);
 
 #ifdef CUT_BUFFER_SUPPORT
--- a/src/select.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/select.c	Thu May 24 07:51:33 2001 +0000
@@ -154,7 +154,8 @@
   int owned_p = 0;
 
   CHECK_SYMBOL (selection_name);
-  if (NILP (selection_value)) error ("selection-value may not be nil.");
+  if (NILP (selection_value))
+    invalid_argument ("`selection-value' may not be nil", Qunbound);
 
   if (NILP (device))
     device = Fselected_device (Qnil);
@@ -162,8 +163,8 @@
   if (!EQ (how_to_add, Qappend) && !EQ (how_to_add, Qt)
       && !EQ (how_to_add, Qreplace_existing)
       && !EQ (how_to_add, Qreplace_all) && !NILP (how_to_add))
-    error ("how-to-add must be nil, append, replace_all, "
-	   "replace_existing or t.");
+    invalid_constant ("`how-to-add' must be nil, append, replace_all, "
+		      "replace_existing or t", how_to_add);
 
 #ifdef MULE
   if (NILP (data_type))
@@ -226,7 +227,9 @@
 						   Vselection_appender_alist);
 
 	      if (NILP (function))
-		error ("cannot append selections of supplied types.");
+		signal_error (Qinvalid_argument,
+			      "Cannot append selections of supplied types (no function)",
+			      data_type);
 
 	      function = XCDR (function);
 
@@ -237,10 +240,14 @@
 				       selection_value);
 
 	      if (NILP (selection_value))
-		error ("cannot append selections of supplied types.");
+		signal_error (Qinvalid_argument,
+			      "Cannot append selections of supplied types (function returned nil)",
+			      data_type);
 	    }
 	  else
-	    error ("cannot append selections of supplied types.");
+	    signal_error_2 (Qinvalid_argument, "Cannot append selections of supplied types (data type nil and both values not strings)",
+			    XCDR (prev_real_value),
+			    selection_value);
 	}
 
       selection_data = Fcons (data_type, selection_value);
@@ -743,27 +750,27 @@
   DEFSUBR (Fselection_data_type_name);
 
   /* Lisp Functions */
-  defsymbol (&Qselect_convert_in, "select-convert-in");
-  defsymbol (&Qselect_convert_out, "select-convert-out");
-  defsymbol (&Qselect_coerce, "select-coerce");
+  DEFSYMBOL (Qselect_convert_in);
+  DEFSYMBOL (Qselect_convert_out);
+  DEFSYMBOL (Qselect_coerce);
 
   /* X Atoms */
-  defsymbol (&QPRIMARY, "PRIMARY");
-  defsymbol (&QSECONDARY, "SECONDARY");
-  defsymbol (&QSTRING, "STRING");
-  defsymbol (&QINTEGER, "INTEGER");
-  defsymbol (&QCLIPBOARD, "CLIPBOARD");
-  defsymbol (&QTIMESTAMP, "TIMESTAMP");
-  defsymbol (&QTEXT, "TEXT");
-  defsymbol (&QDELETE, "DELETE");
-  defsymbol (&QMULTIPLE, "MULTIPLE");
-  defsymbol (&QINCR, "INCR");
+  DEFSYMBOL (QPRIMARY);
+  DEFSYMBOL (QSECONDARY);
+  DEFSYMBOL (QSTRING);
+  DEFSYMBOL (QINTEGER);
+  DEFSYMBOL (QCLIPBOARD);
+  DEFSYMBOL (QTIMESTAMP);
+  DEFSYMBOL (QTEXT);
+  DEFSYMBOL (QDELETE);
+  DEFSYMBOL (QMULTIPLE);
+  DEFSYMBOL (QINCR);
   defsymbol (&QEMACS_TMP, "_EMACS_TMP_");
-  defsymbol (&QTARGETS, "TARGETS");
-  defsymbol (&QATOM, "ATOM");
+  DEFSYMBOL (QTARGETS);
+  DEFSYMBOL (QATOM);
   defsymbol (&QATOM_PAIR, "ATOM_PAIR");
   defsymbol (&QCOMPOUND_TEXT, "COMPOUND_TEXT");
-  defsymbol (&QNULL, "NULL");
+  DEFSYMBOL (QNULL);
 
   /* Windows formats - these all start with CF_ */
   defsymbol (&QCF_TEXT, "CF_TEXT");
@@ -790,10 +797,10 @@
   defsymbol (&QCF_DSPENHMETAFILE, "CF_DSPENHMETAFILE");
 
   /* Selection strategies */
-  defsymbol (&Qreplace_all, "replace-all");
-  defsymbol (&Qreplace_existing, "replace-existing");
+  DEFSYMBOL (Qreplace_all);
+  DEFSYMBOL (Qreplace_existing);
 
-  DEFERROR_STANDARD (Qselection_conversion_error, Qio_error);
+  DEFERROR_STANDARD (Qselection_conversion_error, Qconversion_error);
 }
 
 void
--- a/src/sgiplay.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/sgiplay.c	Thu May 24 07:51:33 2001 +0000
@@ -21,17 +21,15 @@
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized by Ben Wing, 5-15-01. */
+
 #include <config.h>
 #include "lisp.h"
 
-#include <string.h>
-#include <sys/file.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <audio.h>
-#include <netinet/in.h>		/* for ntohl() etc. */
+#include "sound.h"
+
+#include "sysfile.h"
+#include "sysproc.h" /* netinet/in.h for ntohl() etc. */
 
 /* Configuration options */
 
@@ -91,14 +89,6 @@
 #define DEFAULT_CHANNEL_COUNT	     1
 #define DEFAULT_FORMAT	      AFmulaw8
 
-/* Exports */
-
-/* all compilers on machines that have the SGI audio library
-   understand prototypes, right? */
-
-extern void play_sound_file (char *, int);
-extern void play_sound_data (unsigned char *, int, int);
-
 /* Data structures */
 
 /* an AudioContext describes everything we want to know about how a
@@ -182,8 +172,8 @@
 /* Forward declarations */
 
 static Lisp_Object close_sound_file (Lisp_Object);
-static AudioContext audio_initialize (unsigned char *, int, int);
-static void play_internal (unsigned char *, int, AudioContext);
+static AudioContext audio_initialize (UChar_Binary *, int, int);
+static void play_internal (UChar_Binary *, int, AudioContext);
 static void drain_audio_port (AudioContext);
 static void write_mulaw_8_chunk (void *, void *, AudioContext);
 static void write_linear_chunk (void *, void *, AudioContext);
@@ -209,11 +199,11 @@
 }
 
 void
-play_sound_file (char *sound_file, int volume)
+play_sound_file (Extbyte *sound_file, int volume)
 {
   int count = specpdl_depth ();
   int input_fd;
-  unsigned char buffer[CHUNKSIZE];
+  UChar_Binary buffer[CHUNKSIZE];
   int bytes_read;
   AudioContext ac = (AudioContext) 0;
 
@@ -264,7 +254,7 @@
 }
 
 void
-play_sound_data (unsigned char *data, int length, int volume)
+play_sound_data (UChar_Binary *data, int length, int volume)
 {
   int count = specpdl_depth ();
   AudioContext ac;
@@ -278,7 +268,7 @@
 }
 
 static AudioContext
-audio_initialize (unsigned char *data, int length, int volume)
+audio_initialize (UChar_Binary *data, int length, int volume)
 {
   Lisp_Object audio_port_state[3];
   static AudioContextRec desc;
@@ -293,7 +283,7 @@
   if (LOOKING_AT_SND_HEADER_P (data))
     {
       if (parse_snd_header (data, length, & desc)==-1)
-	report_file_error ("decoding .snd header", Qnil);
+	report_sound_error ("decoding .snd header", Qunbound);
     }
   else
 #endif
@@ -322,17 +312,17 @@
 }
 
 static void
-play_internal (unsigned char *data, int length, AudioContext ac)
+play_internal (UChar_Binary *data, int length, AudioContext ac)
 {
-  unsigned char * limit;
+  UChar_Binary * limit;
   if (ac == (AudioContext) 0)
     return;
 
-  data = (unsigned char *) ac->ac_data;
+  data = (UChar_Binary *) ac->ac_data;
   limit = data + ac->ac_size;
   while (data < limit)
     {
-      unsigned char * chunklimit = data + CHUNKSIZE;
+      UChar_Binary * chunklimit = data + CHUNKSIZE;
 
       if (chunklimit > limit)
 	chunklimit = limit;
@@ -375,8 +365,8 @@
 static void
 write_mulaw_8_chunk (void *buffer, void *chunklimit, AudioContext ac)
 {
-  unsigned char * data = (unsigned char *) buffer;
-  unsigned char * limit = (unsigned char *) chunklimit;
+  UChar_Binary * data = (UChar_Binary *) buffer;
+  UChar_Binary * limit = (UChar_Binary *) chunklimit;
   short * obuf, * bufp;
   long n_samples = limit - data;
 
@@ -398,7 +388,7 @@
   switch (ac->ac_format)
     {
     case AFlinear16: n_samples = (short *) limit - (short *) data; break;
-    case AFlinear8:  n_samples =  (char *) limit -  (char *) data; break;
+    case AFlinear8:  n_samples =  (Char_Binary *) limit -  (Char_Binary *) data; break;
     default: n_samples =  (long *) limit -  (long *) data; break;
     }
   ALwritesamps (ac->ac_port, data, (long) n_samples);
@@ -457,7 +447,7 @@
     {
       if ((open_audio_port (return_ac, desc))==-1)
 	{
-	  report_file_error ("Open audio port", Qnil);
+	  report_sound_error ("Open audio port", Qunbound);
 	  return (AudioContext) 0;
 	}
     }
@@ -514,7 +504,7 @@
   ALfreeconfig (config);
   if (return_ac->ac_port==0)
     {
-      report_file_error ("Opening audio output port", Qnil);
+      report_sound_error ("Opening audio output port", Qunbound);
       return -1;
     }
   return 0;
@@ -530,8 +520,8 @@
     case 2: ALsetchannels (config, AL_STEREO); break;
 #endif /* HAVE_STEREO */
     default:
-      report_file_error ("Unsupported channel count",
-			 Fcons (make_int (nchan), Qnil));
+      report_sound_error ("Unsupported channel count",
+			  make_int (nchan));
       return -1;
     }
   return 0;
@@ -567,8 +557,7 @@
 #endif
 #endif
     default:
-      report_file_error ("Unsupported audio format",
-			 Fcons (make_int (format), Qnil));
+      report_sound_error ("Unsupported audio format", make_int (format));
       return -1;
     }
   old_samplesize = ALgetwidth (config);
@@ -612,7 +601,7 @@
   int dataFormat;
   int samplingRate;
   int channelCount;
-  char info[4];
+  Char_Binary info[4];
 }
 SNDSoundStruct;
 #define SOUND_TO_HOST_INT(x) ntohl(x)
@@ -684,8 +673,8 @@
     }
   desc->ac_output_rate = SOUND_TO_HOST_INT (hp->samplingRate);
   desc->ac_nchan = SOUND_TO_HOST_INT (hp->channelCount);
-  desc->ac_data = (char *) header + SOUND_TO_HOST_INT (hp->dataLocation);
-  limit = (char *) header + length - (char *) desc->ac_data;
+  desc->ac_data = (Char_Binary *) header + SOUND_TO_HOST_INT (hp->dataLocation);
+  limit = (Char_Binary *) header + length - (Char_Binary *) desc->ac_data;
   desc->ac_size = SOUND_TO_HOST_INT (hp->dataSize);
   if (desc->ac_size > limit) desc->ac_size = limit;
   return 0;
--- a/src/sheap.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/sheap.c	Thu May 24 07:51:33 2001 +0000
@@ -110,7 +110,7 @@
 
   if (stream == NULL)
     report_file_error ("Opening sheap adjustment file",
-		       Fcons (build_string ("sheap-adjust.h"), Qnil));
+		       build_string ("sheap-adjust.h"));
 
   fprintf (stream,
 	   "/*\tDo not edit this file!\n"
--- a/src/sound.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/sound.c	Thu May 24 07:51:33 2001 +0000
@@ -21,6 +21,8 @@
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized by Ben Wing, 5-15-01. */
+
 /* Originally written by Jamie Zawinski.
    Hacked on quite a bit by various others. */
 
@@ -32,22 +34,22 @@
 #ifdef HAVE_X_WINDOWS
 #include "console-x.h"
 #endif
-
 #include "device.h"
 #include "redisplay.h"
+#include "sound.h"
+
 #include "sysdep.h"
 
 #include "sysfile.h"
 
 #ifdef HAVE_NATIVE_SOUND
 # include "sysproc.h"
-# include "nativesound.h"
 #endif
 
 #ifdef HAVE_ESD_SOUND
-extern int esd_play_sound_file (char *file, int vol);
-extern int esd_play_sound_data (unsigned char *data, size_t length, int vol);
-# define DEVICE_CONNECTED_TO_ESD_P(x) 1 /* FIXME: better check */
+extern int esd_play_sound_file (Extbyte *file, int vol);
+extern int esd_play_sound_data (UChar_Binary *data, size_t length, int vol);
+# define DEVICE_CONNECTED_TO_ESD_P(x) 1 /* #### better check */
 #endif
 
 Fixnum bell_volume;
@@ -56,16 +58,21 @@
 Lisp_Object Vsynchronous_sounds;
 Lisp_Object Vnative_sound_only_on_console;
 Lisp_Object Q_volume, Q_pitch, Q_duration, Q_sound;
+Lisp_Object Qsound_error;
 
 
 #ifdef HAVE_NAS_SOUND
-extern int nas_play_sound_file (char *name, int volume);
-extern int nas_play_sound_data (unsigned char *data, int length, int volume);
+extern int nas_play_sound_file (Extbyte *name, int volume);
+extern int nas_play_sound_data (UChar_Binary *data, int length, int volume);
 extern int nas_wait_for_sounds (void);
-extern char *nas_init_play (Display *);
+extern Extbyte *nas_init_play (Display *);
+#endif
 
-Lisp_Object Qnas;
-#endif
+DOESNT_RETURN
+report_sound_error (const Char_ASCII *string, Lisp_Object data)
+{
+  report_error_with_errno (Qsound_error, string, data);
+}
 
 DEFUN ("play-sound-file", Fplay_sound_file, 1, 3, "fSound file name: ", /*
 Play the named sound file on DEVICE's speaker at the specified volume
@@ -107,10 +114,12 @@
 	     fails.  --hniksic */
 	  if (NILP (Ffile_exists_p (file)))
 	    file =
-	      signal_simple_continuable_error ("File does not exist", file);
+	      signal_continuable_error (Qfile_error,
+					"File does not exist", file);
 	  else
 	    file =
-	      signal_simple_continuable_error ("File is unreadable", file);
+	      signal_continuable_error (Qfile_error,
+					"File is unreadable", file);
 	}
     }
   UNGCPRO;
@@ -118,7 +127,7 @@
 #ifdef HAVE_NAS_SOUND
   if (DEVICE_CONNECTED_TO_NAS_P (d))
     {
-      char *fileext;
+      Extbyte *fileext;
 
       LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
       /* #### NAS code should allow specification of a device. */
@@ -130,7 +139,7 @@
 #ifdef HAVE_ESD_SOUND
   if (DEVICE_CONNECTED_TO_ESD_P (d))
     {
-      char *fileext;
+      Extbyte *fileext;
       int result;
 
       LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
@@ -147,13 +156,13 @@
 #ifdef HAVE_NATIVE_SOUND
   if (NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d))
     {
-      const char *fileext;
+      Extbyte *fileext;
 
       LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
       /* The sound code doesn't like getting SIGIO interrupts.
 	 Unix sucks! */
       stop_interrupts ();
-      play_sound_file ((char *) fileext, vol);
+      play_sound_file (fileext, vol);
       start_interrupts ();
       QUIT;
     }
@@ -311,13 +320,13 @@
 #ifdef HAVE_NAS_SOUND
   if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound))
     {
-      const Extbyte *soundext;
+      const UChar_Binary *soundext;
       Extcount soundextlen;
 
       TO_EXTERNAL_FORMAT (LISP_STRING, sound,
 			  ALLOCA, (soundext, soundextlen),
 			  Qbinary);
-      if (nas_play_sound_data ((unsigned char*)soundext, soundextlen, vol))
+      if (nas_play_sound_data (soundext, soundextlen, vol))
 	return Qnil;
     }
 #endif /* HAVE_NAS_SOUND */
@@ -325,7 +334,7 @@
 #ifdef HAVE_ESD_SOUND
   if (DEVICE_CONNECTED_TO_ESD_P (d) && STRINGP (sound))
     {
-      Extbyte *soundext;
+      UChar_Binary *soundext;
       Extcount soundextlen;
       int succes;
 
@@ -334,7 +343,7 @@
       
       /* #### ESD uses alarm(). But why should we also stop SIGIO? */
       stop_interrupts ();
-      succes = esd_play_sound_data ((unsigned char *) soundext, soundextlen, vol);
+      succes = esd_play_sound_data (soundext, soundextlen, vol);
       start_interrupts ();
       QUIT;
       if(succes)
@@ -346,7 +355,7 @@
   if ((NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d))
       && STRINGP (sound))
     {
-      const Extbyte *soundext;
+      UChar_Binary *soundext;
       Extcount soundextlen;
       int succes;
 
@@ -355,7 +364,7 @@
 			  Qbinary);
       /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */
       stop_interrupts ();
-      succes = play_sound_data ((unsigned char*)soundext, soundextlen, vol);
+      succes = play_sound_data (soundext, soundextlen, vol);
       start_interrupts ();
       QUIT;
       if (succes)
@@ -403,7 +412,7 @@
 
   if (NILP (arg) && !NILP (Vexecuting_macro))
     /* Stop executing a keyboard macro. */
-    error ("Keyboard macro terminated by a command ringing the bell");
+    invalid_operation ("Keyboard macro terminated by a command ringing the bell", Qunbound);
   
   if (d == last_bell_device && now-last_bell_time < bell_inhibit_time)
     return Qnil;
@@ -453,7 +462,7 @@
 #ifdef HAVE_X_WINDOWS
   if (DEVICE_X_P (d))
     {
-      char *err_message = nas_init_play (DEVICE_X_DISPLAY (d));
+      Extbyte *err_message = nas_init_play (DEVICE_X_DISPLAY (d));
       DEVICE_CONNECTED_TO_NAS_P (d) = !err_message;
       /* Print out the message? */
     }
@@ -479,14 +488,14 @@
 	 */
 
       Display *display = DEVICE_X_DISPLAY (d);
-      char *dpy = DisplayString (display);
-      char *tail = (char *) strchr (dpy, ':');
+      Extbyte *dpy = DisplayString (display);
+      Extbyte *tail = strchr (dpy, ':');
       if (! tail ||
 	  strncmp (tail, ":0", 2))
 	DEVICE_ON_CONSOLE_P (d) = 0;
       else
 	{
-	  char dpyname[255], localname[255];
+	  Extbyte dpyname[255], localname[255];
 
 	  /* some systems can't handle SIGIO or SIGALARM in gethostbyname. */
 	  stop_interrupts ();
@@ -517,7 +526,7 @@
 		DEVICE_ON_CONSOLE_P (d) = 0;
 	      else
 		{
-		  char hn [255];
+		  Extbyte hn [255];
 		  struct hostent *l;
 		  strcpy (hn, h->h_name);
 		  l = gethostbyname (localname);
@@ -547,14 +556,12 @@
 void
 syms_of_sound (void)
 {
-  defkeyword (&Q_volume,   ":volume");
-  defkeyword (&Q_pitch,    ":pitch");
-  defkeyword (&Q_duration, ":duration");
-  defkeyword (&Q_sound,    ":sound");
+  DEFKEYWORD (Q_volume);
+  DEFKEYWORD (Q_pitch);
+  DEFKEYWORD (Q_duration);
+  DEFKEYWORD (Q_sound);
 
-#ifdef HAVE_NAS_SOUND
-  defsymbol (&Qnas, "nas");
-#endif
+  DEFERROR_STANDARD (Qsound_error, Qio_error);
 
   DEFSUBR (Fplay_sound_file);
   DEFSUBR (Fplay_sound);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sound.h	Thu May 24 07:51:33 2001 +0000
@@ -0,0 +1,46 @@
+/* Sound functions.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2001 Ben Wing.
+
+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. */
+
+/* This file Mule-ized by Ben Wing, 5-15-01. */
+
+#include "buffer.h"
+
+/* Defined in *play.c */
+void play_sound_file (Extbyte *name, int volume);
+int play_sound_data (UChar_Binary *data, int length, int volume);
+
+# define sound_perror(string)						 \
+do {									 \
+  Bufbyte *errmess;							 \
+  Bufbyte *string_int;							 \
+  /* #### fix this to GET_STRERROR in my mule ws */			 \
+  EXTERNAL_TO_C_STRING (strerror (errno), errmess, Qnative);		 \
+  EXTERNAL_TO_C_STRING (string, string_int, Qnative);			 \
+  warn_when_safe (Qsound, Qerror, "audio: %s, %s", string_int, errmess); \
+} while (0)
+# define sound_warn(string)					\
+do {								\
+  Bufbyte *string_int;						\
+  EXTERNAL_TO_C_STRING (GETTEXT (string), string_int, Qnative);	\
+  warn_when_safe (Qsound, Qwarning, "audio: %s", string_int);	\
+} while (0)
--- a/src/specifier.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/specifier.c	Thu May 24 07:51:33 2001 +0000
@@ -46,10 +46,6 @@
 
 Lisp_Object Qconsole_type, Qdevice_class;
 
-Lisp_Object Qspecifier_syntax_error;
-Lisp_Object Qspecifier_argument_error;
-Lisp_Object Qspecifier_change_error;
-
 static Lisp_Object Vuser_defined_tags;
 
 typedef struct specifier_type_entry specifier_type_entry;
@@ -274,8 +270,8 @@
   Lisp_Object the_specs;
 
   if (print_readably)
-    error ("printing unreadable object #<%s-specifier 0x%x>",
-	   sp->methods->name, sp->header.uid);
+    printing_unreadable_object ("#<%s-specifier 0x%x>",
+				sp->methods->name, sp->header.uid);
 
   sprintf (buf, "#<%s-specifier global=", sp->methods->name);
   write_c_string (buf, printcharfun);
@@ -433,7 +429,7 @@
 	return Dynarr_at (the_specifier_type_entry_dynarr, i).meths;
     }
 
-  maybe_signal_type_error (Qspecifier_argument_error, "Invalid specifier type",
+  maybe_invalid_argument ("Invalid specifier type",
 			   type, Qspecifier, errb);
 
   return 0;
@@ -678,8 +674,7 @@
       !NILP (Fvalid_specifier_locale_p (locale)) ||
       !NILP (Fvalid_specifier_locale_type_p (locale)))
     return;
-  signal_type_error (Qspecifier_argument_error,
-		     "Invalid specifier locale or locale type", locale);
+  invalid_argument ("Invalid specifier locale or locale type", locale);
 }
 
 DEFUN ("specifier-locale-type-from-locale", Fspecifier_locale_type_from_locale,
@@ -690,7 +685,7 @@
 {
   /* This cannot GC. */
   if (NILP (Fvalid_specifier_locale_p (locale)))
-    signal_type_error (Qspecifier_argument_error, "Invalid specifier locale",
+    invalid_argument ("Invalid specifier locale",
 		       locale);
   if (DEVICEP (locale)) return Qdevice;
   if (FRAMEP  (locale)) return Qframe;
@@ -709,7 +704,7 @@
   else if (!NILP (Fvalid_specifier_locale_p (locale)))
     return locale;
   else
-    signal_type_error (Qspecifier_argument_error, "Invalid specifier locale",
+    invalid_argument ("Invalid specifier locale",
 		       locale);
 
   return Qnil;
@@ -725,7 +720,7 @@
   if (EQ (locale_type, Qwindow)) return LOCALE_WINDOW;
   if (EQ (locale_type, Qbuffer)) return LOCALE_BUFFER;
 
-  signal_type_error (Qspecifier_argument_error, "Invalid specifier locale type",
+  invalid_argument ("Invalid specifier locale type",
 		     locale_type);
   return LOCALE_GLOBAL; /* not reached */
 }
@@ -762,7 +757,7 @@
 check_valid_domain (Lisp_Object domain)
 {
   if (NILP (Fvalid_specifier_domain_p (domain)))
-    signal_type_error (Qspecifier_argument_error, "Invalid specifier domain",
+    invalid_argument ("Invalid specifier domain",
 		       domain);
 }
 
@@ -839,7 +834,7 @@
   if (!NILP (Fvalid_specifier_tag_p (tag_set)))
     return list1 (tag_set);
   if (NILP (Fvalid_specifier_tag_set_p (tag_set)))
-    signal_type_error (Qspecifier_argument_error, "Invalid specifier tag-set",
+    invalid_argument ("Invalid specifier tag-set",
 		       tag_set);
   return tag_set;
 }
@@ -903,7 +898,7 @@
        (tag_set))
 {
   if (NILP (Fvalid_specifier_tag_set_p (tag_set)))
-    signal_type_error (Qspecifier_argument_error, "Invalid tag set", tag_set);
+    invalid_argument ("Invalid tag set", tag_set);
   return canonicalize_tag_set (tag_set);
 }
 
@@ -945,7 +940,7 @@
   CHECK_LIVE_DEVICE (device);
 
   if (NILP (Fvalid_specifier_tag_set_p (tag_set)))
-    signal_type_error (Qspecifier_argument_error, "Invalid tag set", tag_set);
+    invalid_argument ("Invalid tag set", tag_set);
 
   return device_matches_specifier_tag_set_p (device, tag_set) ? Qt : Qnil;
 }
@@ -968,13 +963,11 @@
   CHECK_SYMBOL (tag);
   if (valid_device_class_p (tag) ||
       valid_console_type_p (tag))
-    signal_type_error (Qspecifier_change_error,
-		       "Cannot redefine built-in specifier tags", tag);
+    invalid_change ("Cannot redefine built-in specifier tags", tag);
   /* Try to prevent common instantiators and locales from being
      redefined, to reduce ambiguity */
   if (NILP (tag) || EQ (tag, Qt) || EQ (tag, Qall) || EQ (tag, Qglobal))
-    signal_type_error (Qspecifier_change_error, "Cannot define nil, t, 'all, or 'global",
-		       tag);
+    invalid_change ("Cannot define nil, t, 'all, or 'global", tag);
   assoc = assq_no_quit (tag, Vuser_defined_tags);
   if (NILP (assoc))
     {
@@ -1104,7 +1097,7 @@
   CHECK_SYMBOL (tag);
 
   if (NILP (Fvalid_specifier_tag_p (tag)))
-    signal_type_error (Qspecifier_argument_error, "Invalid specifier tag",
+    invalid_argument ("Invalid specifier tag",
 		       tag);
 
   /* Make up some predicates for the built-in types */
@@ -1232,21 +1225,21 @@
 
       if (!CONSP (rest))
 	{
-	  maybe_signal_type_error (Qspecifier_syntax_error,
+	  maybe_sferror (
 				   "Invalid instantiator list", inst_list,
 				     Qspecifier, errb);
 	  return Qnil;
 	}
       if (!CONSP (inst_pair = XCAR (rest)))
 	{
-	  maybe_signal_type_error (Qspecifier_syntax_error,
+	  maybe_sferror (
 				   "Invalid instantiator pair", inst_pair,
 				     Qspecifier, errb);
 	  return Qnil;
 	}
       if (NILP (Fvalid_specifier_tag_set_p (tag_set = XCAR (inst_pair))))
 	{
-	  maybe_signal_type_error (Qspecifier_syntax_error,
+	  maybe_invalid_argument (
 				   "Invalid specifier tag", tag_set,
 				     Qspecifier, errb);
 	  return Qnil;
@@ -1290,14 +1283,14 @@
       Lisp_Object spec, locale;
       if (!CONSP (rest) || !CONSP (spec = XCAR (rest)))
 	{
-	  maybe_signal_type_error (Qspecifier_syntax_error,
+	  maybe_sferror (
 				   "Invalid specification list", spec_list,
 				     Qspecifier, errb);
 	  return Qnil;
 	}
       if (NILP (Fvalid_specifier_locale_p (locale = XCAR (spec))))
 	{
-	  maybe_signal_type_error (Qspecifier_syntax_error,
+	  maybe_invalid_argument (
 				   "Invalid specifier locale", locale,
 				     Qspecifier, errb);
 	  return Qnil;
@@ -1348,8 +1341,7 @@
   if (EQ (Qremove_all, how_to_add))
     return SPEC_REMOVE_ALL;
 
-  signal_type_error (Qspecifier_argument_error, "Invalid `how-to-add' flag",
-		     how_to_add);
+  invalid_constant ("Invalid `how-to-add' flag", how_to_add);
 
   return SPEC_PREPEND;		/* not reached */
 }
@@ -1373,9 +1365,9 @@
 {
   if (NILP (Vunlock_ghost_specifiers)
       && GHOST_SPECIFIER_P (XSPECIFIER (spec)))
-    signal_type_error (Qspecifier_change_error,
-		       "Attempt to modify read-only specifier",
-			 list1 (spec));
+    signal_error (Qsetting_constant,
+		  "Attempt to modify read-only specifier",
+		  spec);
 }
 
 /* Helper function which unwind protects the value of
@@ -2332,7 +2324,7 @@
       CHECK_SPECIFIER (dest);
       check_modifiable_specifier (dest);
       if (XSPECIFIER (dest)->methods != XSPECIFIER (specifier)->methods)
-	error ("Specifiers not of same type");
+ invalid_argument ("Specifiers not of same type", Qunbound);
     }
 
   cl.dest = dest;
@@ -2390,7 +2382,7 @@
     }
   else
     {
-      maybe_signal_simple_error
+      maybe_sferror
 	("Matchspecs not allowed for this specifier type",
 	 intern (meths->name), Qspecifier, errb);
       return Qnil;
@@ -2597,7 +2589,9 @@
   depth = make_int (1 + XINT (depth));
   if (XINT (depth) > 20)
     {
-      maybe_error (Qspecifier, errb, "Apparent loop in specifier inheritance");
+      maybe_signal_error (Qstack_overflow,
+			  "Apparent loop in specifier inheritance",
+			  Qunbound, Qspecifier, errb);
       /* The specification is fucked; at least try the fallback
 	 (which better not be fucked, because it's not changeable
 	 from Lisp). */
@@ -3119,8 +3113,7 @@
 boolean_validate (Lisp_Object instantiator)
 {
   if (!EQ (instantiator, Qt) && !EQ (instantiator, Qnil))
-    signal_type_error (Qspecifier_argument_error, "Must be t or nil",
-		       instantiator);
+    invalid_constant ("Must be t or nil", instantiator);
 }
 
 DEFUN ("boolean-specifier-p", Fboolean_specifier_p, 1, 1, 0, /*
@@ -3261,10 +3254,6 @@
   DEFSYMBOL (Qremove_tag_set_append);
   DEFSYMBOL (Qremove_locale);
   DEFSYMBOL (Qremove_locale_type);
-
-  DEFERROR_STANDARD (Qspecifier_syntax_error, Qsyntax_error);
-  DEFERROR_STANDARD (Qspecifier_argument_error, Qinvalid_argument);
-  DEFERROR_STANDARD (Qspecifier_change_error, Qinvalid_change);
 }
 
 void
--- a/src/sunplay.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/sunplay.c	Thu May 24 07:51:33 2001 +0000
@@ -15,41 +15,19 @@
 
 /* Synched up with: Not in FSF. */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/* This file Mule-ized by Ben Wing, 5-15-01. */
 
-#if __STDC__ || defined(STDC_HEADERS)
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>	/* for open() */
-#endif
+#include <config.h>
+#include "lisp.h"
+#include "sound.h"
 
-#include <stdio.h>
-#include <string.h>
-#ifndef emacs
-#include <sys/signal.h>
-#endif
-#include <sys/fcntl.h>
-#include <sys/file.h>
+#include "sysdep.h"
+#include "sysfile.h"
+#include "syssignal.h"
 
 #include <multimedia/libaudio.h>
 #include <multimedia/audio_device.h>
 
-#ifdef emacs
-# include <config.h>
-# include "lisp.h"
-# include "sysdep.h"
-# include <errno.h>
-# include "nativesound.h"
-#include "syssignal.h"
-# 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 */
-
 static SIGTYPE (*sighup_handler) (int sig);
 static SIGTYPE (*sigint_handler) (int sig);
 static SIGTYPE sighandler (int sig);
@@ -64,7 +42,7 @@
 static Audio_hdr dev_hdr;
 
 static int
-init_device (int volume, unsigned char *data, int fd,
+init_device (int volume, UChar_Binary *data, int fd,
 	     unsigned int *header_length)
 {
 #ifdef SUNOS4_0_3
@@ -80,7 +58,7 @@
 
   if (AUDIO_SUCCESS != audio_get_play_config (audio_fd, &dev_hdr))
     {
-      perror ("Not a valid audio device");
+      sound_perror ("Not a valid audio device");
       return 1;
     }
 
@@ -89,9 +67,9 @@
 			: audio_read_filehdr (fd, &file_hdr, 0, 0)))
     {
       if (data)
-	perror ("invalid audio data");
+	sound_perror ("invalid audio data");
       else
-	perror ("invalid audio file");
+	sound_perror ("invalid audio file");
       return 1;
     }
 
@@ -105,20 +83,20 @@
       initialized_device_p = 1;
       if (AUDIO_SUCCESS != audio_set_play_config (audio_fd, &new_hdr))
 	{
-	  char buf1 [100], buf2 [100], buf3 [250];
+	  Extbyte buf1 [100], buf2 [100], buf3 [250];
 	  audio_enc_to_str (&file_hdr, buf1);
 	  audio_enc_to_str (&new_hdr, buf2);
 	  sprintf (buf3, "wanted %s, got %s", buf1, buf2);
-	  warn (buf3);
+	  sound_warn (buf3);
 	  return 1;
 	}
     }
 
   if (volume < 0 || volume > 100)
     {
-      char buf [255];
+      Extbyte buf [255];
       sprintf (buf, "volume must be between 0 and 100 (not %d)", volume);
-      warn (buf);
+      sound_warn (buf);
       return 1;
     }
   {
@@ -149,17 +127,17 @@
 
 
 void
-play_sound_file (char *sound_file, int volume)
+play_sound_file (Extbyte *sound_file, int volume)
 {
   int rrtn, wrtn;
-  unsigned char buf [255];
+  UChar_Binary buf [255];
   int file_fd;
 
   audio_fd = audio_open ();
 
   if (audio_fd < 0)
     {
-      perror ("open /dev/audio");
+      sound_perror ("open /dev/audio");
       return;
     }
 
@@ -170,19 +148,19 @@
   file_fd = open (sound_file, O_RDONLY, 0);
   if (file_fd < 0)
     {
-      perror (sound_file);
+      sound_perror (sound_file);
       goto END_OF_PLAY;
     }
 
-  if (init_device (volume, (unsigned char *) 0, file_fd, (unsigned int *) 0))
+  if (init_device (volume, (UChar_Binary *) 0, file_fd, (unsigned int *) 0))
     goto END_OF_PLAY;
 
   while (1)
     {
-      rrtn = read (file_fd, (char *) buf, sizeof (buf));
+      rrtn = read (file_fd, (Char_Binary *) buf, sizeof (buf));
       if (rrtn < 0)
 	{
-	  perror ("read");
+	  sound_perror ("read");
 	  goto END_OF_PLAY;
 	}
       if (rrtn == 0)
@@ -190,10 +168,10 @@
 
       while (1)
 	{
-	  wrtn = write (audio_fd, (char *) buf, rrtn);
+	  wrtn = write (audio_fd, (Char_Binary *) buf, rrtn);
 	  if (wrtn < 0)
 	    {
-	      perror ("write");
+	      sound_perror ("write");
 	      goto END_OF_PLAY;
 	    }
 	  if (wrtn != 0)
@@ -204,9 +182,9 @@
 	}
       if (wrtn != rrtn)
 	{
-	  char warn_buf [255];
+	  Extbyte warn_buf [255];
 	  sprintf (warn_buf, "play: rrtn = %d, wrtn = %d", rrtn, wrtn);
-	  warn (warn_buf);
+	  sound_warn (warn_buf);
 	  goto END_OF_PLAY;
 	}
     }
@@ -228,7 +206,7 @@
 
 
 int
-play_sound_data (unsigned char *data, int length, int volume)
+play_sound_data (UChar_Binary *data, int length, int volume)
 {
   int wrtn, start = 0;
   unsigned int ilen;
@@ -239,14 +217,14 @@
   if (length == 0) return 0;
 
   /* this is just to get a better error message */
-  if (strncmp (".snd\0", (char *) data, 4))
+  if (strncmp (".snd\0", (Char_Binary *) data, 4))
     {
-      warn ("Not valid audio data (bad magic number)");
+      sound_warn ("Not valid audio data (bad magic number)");
       goto END_OF_PLAY;
     }
   if (length <= sizeof (Audio_hdr))
     {
-      warn ("Not valid audio data (too short)");
+      sound_warn ("Not valid audio data (too short)");
       goto END_OF_PLAY;
     }
 
@@ -268,10 +246,10 @@
 
   while (1)
     {
-      wrtn = write (audio_fd, (char *) (data+start), length-start);
+      wrtn = write (audio_fd, (Char_Binary *) (data+start), length-start);
       if (wrtn < 0)
 	{
-	  perror ("write");
+	  sound_perror ("write");
 	  goto END_OF_PLAY;
 	}
       if (wrtn != 0)
@@ -284,9 +262,9 @@
     }
   if (wrtn != length)
     {
-      char buf [255];
+      Extbyte buf [255];
       sprintf (buf, "play: rrtn = %d, wrtn = %d", length, wrtn);
-      warn (buf);
+      sound_warn (buf);
       goto END_OF_PLAY;
     }
 
--- a/src/symbols.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/symbols.c	Thu May 24 07:51:33 2001 +0000
@@ -357,7 +357,7 @@
   if (ZEROP (bucket))
     ;
   else if (!SYMBOLP (bucket))
-    error ("Bad data in guts of obarray"); /* Like CADR error message */
+    signal_error (Qinvalid_state, "Bad data in guts of obarray", Qunbound); /* Like CADR error message */
   else
     for (tail = XSYMBOL (bucket); ;)
       {
@@ -575,13 +575,13 @@
 
   if (SYMBOL_VALUE_MAGIC_P (val) &&
       XSYMBOL_VALUE_MAGIC_TYPE (val) == SYMVAL_CONST_SPECIFIER_FORWARD)
-    signal_simple_error ("Use `set-specifier' to change a specifier's value",
-			 sym);
+    invalid_change ("Use `set-specifier' to change a specifier's value",
+		    sym);
 
   if (symbol_is_constant (sym, val)
       || (SYMBOL_IS_KEYWORD (sym) && !EQ (newval, sym)))
-    signal_error (Qsetting_constant,
-		  UNBOUNDP (newval) ? list1 (sym) : list2 (sym, newval));
+    signal_error_1 (Qsetting_constant,
+		    UNBOUNDP (newval) ? list1 (sym) : list2 (sym, newval));
 }
 
 /* Verify that it's ok to make SYM buffer-local.  This rejects
@@ -614,8 +614,7 @@
   return;
 
   not_ok:
-  signal_error (Qerror,
-		list2 (build_string ("Symbol may not be buffer-local"), sym));
+  invalid_change ("Symbol may not be buffer-local", sym);
 }
 
 DEFUN ("makunbound", Fmakunbound, 1, 1, 0, /*
@@ -1757,8 +1756,7 @@
     case SYMVAL_DEFAULT_BUFFER_FORWARD:
     case SYMVAL_DEFAULT_CONSOLE_FORWARD:
       if (UNBOUNDP (newval))
-	signal_error (Qerror,
-		      list2 (build_string ("Cannot makunbound"), symbol));
+	invalid_change ("Cannot makunbound", symbol);
       break;
 
       /* case SYMVAL_UNBOUND_MARKER: break; */
@@ -2839,7 +2837,7 @@
   if (EQ (symbol, Qlocal_predicate)) return MAGIC_HANDLER_LOCAL_PREDICATE;
   if (EQ (symbol, Qmake_local))      return MAGIC_HANDLER_MAKE_LOCAL;
 
-  signal_simple_error ("Unrecognized symbol value handler type", symbol);
+  invalid_constant ("Unrecognized symbol value handler type", symbol);
   abort ();
   return MAGIC_HANDLER_MAX;
 }
@@ -2874,7 +2872,7 @@
 
   if (abort_if_not_found)
     abort ();
-  signal_simple_error ("Unrecognized symbol-value function", funsym);
+  invalid_argument ("Unrecognized symbol-value function", funsym);
   return MAGIC_HANDLER_MAX;
 }
 
@@ -3109,7 +3107,7 @@
 
   if (SYMBOL_VALUE_MAGIC_P (valcontents)
       && !UNBOUNDP (valcontents))
-    signal_simple_error ("Variable is magic and cannot be aliased", variable);
+    invalid_change ("Variable is magic and cannot be aliased", variable);
   reject_constant_symbols (variable, Qunbound, 0, Qt);
 
   bfwd = alloc_lcrecord_type (struct symbol_value_varalias,
@@ -3244,7 +3242,7 @@
 
   XSYMBOL (Qnil)->function = Qunbound;
 
-  defsymbol (&Qt, "t");
+  DEFSYMBOL (Qt);
   XSYMBOL (Qt)->value = Qt;	/* Veritas aeterna */
   Vquit_flag = Qnil;
 
--- a/src/symeval.h	Thu May 24 06:30:21 2001 +0000
+++ b/src/symeval.h	Thu May 24 07:51:33 2001 +0000
@@ -294,6 +294,32 @@
 void defsymbol (Lisp_Object *location, const char *name);
 void defsymbol_nodump (Lisp_Object *location, const char *name);
 
+/* Defining symbols:
+
+   (1) A standard symbol is defined with DEFSYMBOL.  That means that
+       the symbol's print name can be derived from the symbol's variable
+       name by removing the initial Q and replacing underscores with hyphens.
+   (2) A keyword symbol is defined with DEFKEYWORD.  That means that
+       the symbol's print name can be derived from the symbol's variable
+       name by removing the initial Q and replacing underscores with hyphens,
+       except that the initial underscore, which comes directly after the Q,
+       is replaced by a colon.
+   (3) DEFSYMBOL_MULTIWORD_PREDICATE is used for the predicates that are
+       associated with a particular type of Lisp Object.  Because of the
+       limitations of C macros, they're always given a predicate symbol
+       whose C name simply appends `p' to the type name, modulo hyphen/
+       underscore conversion.  Properly, however, the Lisp name should have
+       `-p' if there is more than one word in the type name.
+       DEFSYMBOL_MULTIWORD_PREDICATE is for these weird symbols -- the
+       C name as supplied to the macro should end with a `p' with no
+       underscore before it, and the macro will insert a hyphen there in
+       the Lisp name.
+   (4) In case you have some weird symbol where the equivalence between
+       the C and Lisp names is more complicated (e.g. the Lisp symbol has
+       non-alphabetic, non-numeric characters in it), you can just call
+       defsymbol() (the lowercase version) directly.
+*/
+
 #define DEFSYMBOL(name) defsymbol_massage_name (&name, #name)
 #define DEFSYMBOL_NO_DUMP(name) defsymbol_massage_name_nodump (&name, #name)
 #define DEFSYMBOL_MULTIWORD_PREDICATE(name) \
--- a/src/symsinit.h	Thu May 24 06:30:21 2001 +0000
+++ b/src/symsinit.h	Thu May 24 07:51:33 2001 +0000
@@ -96,6 +96,7 @@
 void syms_of_general (void);
 void syms_of_glyphs_x (void);
 void syms_of_glyphs_eimage (void);
+void syms_of_glyphs_shared (void);
 void syms_of_glyphs_widget (void);
 void syms_of_glyphs_mswindows (void);
 void syms_of_glyphs (void);
--- a/src/syntax.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/syntax.c	Thu May 24 07:51:33 2001 +0000
@@ -1206,7 +1206,7 @@
 	      {
 		if (noerror)
 		  return Qnil;
-		error ("Containing expression ends prematurely");
+		signal_error (Qsyntax_error, "Containing expression ends prematurely", Qunbound);
 	      }
 	    break;
 
@@ -1378,7 +1378,7 @@
 	      {
 		if (noerror)
 		  return Qnil;
-		error ("Containing expression ends prematurely");
+		signal_error (Qsyntax_error, "Containing expression ends prematurely", Qunbound);
 	      }
 	    break;
 
@@ -1448,7 +1448,7 @@
 
 lose:
   if (!noerror)
-    error ("Unbalanced parentheses");
+    signal_error (Qsyntax_error, "Unbalanced parentheses", Qunbound);
   return Qnil;
 }
 
@@ -1650,7 +1650,7 @@
 	{
 	  curlevel->last = XINT (Fcar (tem));
 	  if (++curlevel == endlevel)
-	    error ("Nesting too deep for parser");
+	    signal_error (Qstack_overflow, "Nesting too deep for parser", Qunbound);
 	  curlevel->prev = -1;
 	  curlevel->last = -1;
 	  tem = Fcdr (tem);
@@ -1792,7 +1792,7 @@
 	  /* curlevel++->last ran into compiler bug on Apollo */
 	  curlevel->last = from - 1;
 	  if (++curlevel == endlevel)
-	    error ("Nesting too deep for parser");
+	    signal_error (Qstack_overflow, "Nesting too deep for parser", Qunbound);
 	  curlevel->prev = -1;
 	  curlevel->last = -1;
 	  if (targetdepth == depth) goto done;
@@ -2072,8 +2072,8 @@
 void
 syms_of_syntax (void)
 {
-  defsymbol (&Qsyntax_table_p, "syntax-table-p");
-  defsymbol (&Qsyntax_table, "syntax-table");
+  DEFSYMBOL (Qsyntax_table_p);
+  DEFSYMBOL (Qsyntax_table);
 
   DEFSUBR (Fsyntax_table_p);
   DEFSUBR (Fsyntax_table);
--- a/src/sysdep.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/sysdep.c	Thu May 24 07:51:33 2001 +0000
@@ -162,7 +162,7 @@
 #ifdef TIOCSTI
   ioctl (input_fd, TIOCSTI, &c);
 #else /* no TIOCSTI */
-  error ("Cannot stuff terminal input characters in this version of Unix.");
+  invalid_operation ("Cannot stuff terminal input characters in this version of Unix.", Qunbound);
 #endif /* no TIOCSTI */
 }
 
@@ -678,7 +678,7 @@
   pid = fork ();
 
   if (pid == -1)
-    error ("Can't spawn subshell");
+    report_process_error ("Can't spawn subshell", Qunbound);
   if (pid == 0)
 #endif /* not WIN32_NATIVE */
   {
@@ -697,7 +697,7 @@
 
     /* Waits for process completion */
     if (_spawnlp (_P_WAIT, sh, sh, NULL) != 0)
-      error ("Can't spawn subshell");
+      report_process_error ("Can't spawn subshell", Qunbound);
     else
       return; /* we're done, no need to wait for termination */
   }
@@ -3337,7 +3337,8 @@
 #ifdef F_DUPFD
   fd = fcntl (oldd, F_DUPFD, newd);
   if (fd != newd)
-    error ("can't dup2 (%i,%i) : %s", oldd, newd, strerror (errno));
+    signal_ferror_with_frob (Qfile_error, lisp_strerror (errno),
+			     "can't dup2 (%i, %i)", oldd, newd);
 #else
   fd = dup (old);
   if (fd == -1)
--- a/src/toolbar-msw.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/toolbar-msw.c	Thu May 24 07:51:33 2001 +0000
@@ -289,8 +289,7 @@
 			    {
 			      xfree (button_tbl);
 			      if (ilist) ImageList_Destroy (ilist);
-			      signal_simple_error ("Couldn't resize pixmap", 
-						   instance);
+			      gui_error ("Couldn't resize pixmap", instance);
 			    }
 			  /* we don't care if the mask fails */
 			  mask = mswindows_create_resized_mask 
@@ -312,8 +311,7 @@
 					nbuttons, nbuttons * 2 )))
 			{
 			  xfree (button_tbl);
-			  signal_simple_error ("Couldn't create image list",
-					       instance);
+			  gui_error ("Couldn't create image list", instance);
 			}
 
 		      /* make the mask actually do something */
@@ -329,7 +327,7 @@
 			{
 			  xfree (button_tbl);
 			  if (ilist) ImageList_Destroy (ilist);
-			  signal_simple_error 
+			  gui_error 
 			    ("couldn't add image to image list", instance);
 			}
 		      /* we're done with these now */
@@ -390,7 +388,7 @@
 	{
 	  xfree (button_tbl);
 	  ImageList_Destroy (ilist);
-	  error ("couldn't create toolbar");
+	  gui_error ("couldn't create toolbar", Qunbound);
 	}
 
       /* finally populate with images */
@@ -398,7 +396,7 @@
 		       (WPARAM)sizeof(TBBUTTON), (LPARAM)0) == -1) 
 	{
 	  mswindows_clear_toolbar (f, pos, 0);
-	  error ("couldn't set button structure size");
+	  gui_error ("couldn't set button structure size", Qunbound);
 	}
 
       if (vert)
@@ -426,7 +424,7 @@
 			(WPARAM)nbuttons, (LPARAM)button_tbl))
 	{
 	  mswindows_clear_toolbar (f, pos, 0);
-	  error ("couldn't add button list to toolbar");
+	  gui_error ("couldn't add button list to toolbar", Qunbound);
 	}
 
       /* vertical toolbars need more rows */
@@ -452,7 +450,7 @@
 		       (LPARAM)ilist) < 0)
 	{
 	  mswindows_clear_toolbar (f, pos, 0);
-	  error ("couldn't add image list to toolbar");
+	  gui_error ("couldn't add image list to toolbar", Qunbound);
 	}
 
       /* now display the window */
--- a/src/toolbar.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/toolbar.c	Thu May 24 07:51:33 2001 +0000
@@ -220,7 +220,7 @@
   if (EQ (position, Qbottom)) return BOTTOM_TOOLBAR;
   if (EQ (position, Qleft))   return LEFT_TOOLBAR;
   if (EQ (position, Qright))  return RIGHT_TOOLBAR;
-  signal_simple_error ("Invalid toolbar position", position);
+  invalid_constant ("Invalid toolbar position", position);
 
   return TOP_TOOLBAR; /* not reached */
 }
@@ -608,7 +608,7 @@
     }
 
   if (!CONSP (toolbar))
-    signal_simple_error ("toolbar description must be a list", toolbar);
+    sferror ("toolbar description must be a list", toolbar);
 
   /* First synchronize any existing buttons. */
   while (!NILP (toolbar) && !NILP (buttons))
@@ -618,7 +618,7 @@
       if (NILP (XCAR (toolbar)))
 	{
 	  if (pushright_seen)
-	    signal_simple_error
+	    sferror
 	      ("more than one partition (nil) in toolbar description",
 	       orig_toolbar);
 	  else
@@ -664,7 +664,7 @@
       if (NILP (XCAR (toolbar)))
 	{
 	  if (pushright_seen)
-	    signal_simple_error
+	    sferror
 	      ("more than one partition (nil) in toolbar description",
 	       orig_toolbar);
 	  else
@@ -942,9 +942,9 @@
 
 DEFINE_SPECIFIER_TYPE (toolbar);
 
-#define CTB_ERROR(msg) do {					\
-  maybe_signal_simple_error (msg, button, Qtoolbar, errb);	\
-  RETURN_SANS_WARNINGS Qnil;					\
+#define CTB_ERROR(msg) do {						    \
+									      maybe_signal_error (Qinvalid_argument, msg, button, Qtoolbar, errb); \
+  RETURN_SANS_WARNINGS Qnil;						    \
 } while (0)
 
 /* Returns Q_style if key was :style, Qt if ok otherwise, Qnil if error. */
@@ -954,8 +954,8 @@
 {
   if (!KEYWORDP (key))
     {
-      maybe_signal_simple_error_2 ("Not a keyword", key, button, Qtoolbar,
-				   errb);
+      maybe_signal_error_2 (Qinvalid_argument, "Not a keyword", key, button,
+				 Qtoolbar, errb);
       return Qnil;
     }
 
@@ -1114,18 +1114,19 @@
     return;
 
   if (!CONSP (instantiator))
-    signal_simple_error ("Toolbar spec must be list or nil", instantiator);
+    sferror ("Toolbar spec must be list or nil", instantiator);
 
   for (rest = instantiator; !NILP (rest); rest = XCDR (rest))
     {
       if (!CONSP (rest))
-	signal_simple_error ("Bad list in toolbar spec", instantiator);
+	sferror ("Bad list in toolbar spec", instantiator);
 
       if (NILP (XCAR (rest)))
 	{
 	  if (pushright_seen)
-	    error
-	      ("More than one partition (nil) in instantiator description");
+  	    sferror
+	      ("More than one partition (nil) in instantiator description",
+	       instantiator);
 	  else
 	    pushright_seen = 1;
 	}
@@ -1253,14 +1254,14 @@
 {
   INIT_LRECORD_IMPLEMENTATION (toolbar_button);
 
-  defsymbol (&Qtoolbar_buttonp, "toolbar-button-p");
-  defsymbol (&Q2D, "2D");
-  defsymbol (&Q3D, "3D");
-  defsymbol (&Q2d, "2d");
-  defsymbol (&Q3d, "3d");
-  defsymbol (&Q_size, ":size");	Fset (Q_size, Q_size);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qtoolbar_buttonp);
+  DEFSYMBOL (Q2D);
+  DEFSYMBOL (Q3D);
+  DEFSYMBOL (Q2d);
+  DEFSYMBOL (Q3d);
+  DEFKEYWORD (Q_size);
 
-  defsymbol (&Qinit_toolbar_from_resources, "init-toolbar-from-resources");
+  DEFSYMBOL (Qinit_toolbar_from_resources);
   DEFSUBR (Ftoolbar_button_p);
   DEFSUBR (Ftoolbar_button_callback);
   DEFSUBR (Ftoolbar_button_help_string);
--- a/src/tooltalk.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/tooltalk.c	Thu May 24 07:51:33 2001 +0000
@@ -167,8 +167,8 @@
   char buf[200];
 
   if (print_readably)
-    error ("printing unreadable object #<tooltalk_message 0x%x>",
-	   p->header.uid);
+    printing_unreadable_object ("#<tooltalk_message 0x%x>",
+				p->header.uid);
 
   sprintf (buf, "#<tooltalk_message id:0x%lx 0x%x>", (long) (p->m), p->header.uid);
   write_c_string (buf, printcharfun);
@@ -240,8 +240,8 @@
   char buf[200];
 
   if (print_readably)
-    error ("printing unreadable object #<tooltalk_pattern 0x%x>",
-	   p->header.uid);
+    printing_unreadable_object ("#<tooltalk_pattern 0x%x>",
+				p->header.uid);
 
   sprintf (buf, "#<tooltalk_pattern id:0x%lx 0x%x>", (long) (p->p), p->header.uid);
   write_c_string (buf, printcharfun);
@@ -300,8 +300,12 @@
 check_status (Tt_status st)
 {
   if (tt_is_err (st))
-    signal_error (Qtooltalk_error,
-		  Fcons (build_string (tt_status_message (st)), Qnil));
+    {
+      Bufbyte *err;
+
+      EXTERNAL_TO_C_STRING (tt_status_message (st), err, Qnative);
+      signal_error (Qtooltalk_error, err, Qunbound);
+    }
 }
 
 DEFUN ("receive-tooltalk-message", Freceive_tooltalk_message, 0, 2, 0, /*
@@ -672,7 +676,7 @@
 			   (XTOOLTALK_MESSAGE (message_)->plist_sym));
 
   else
-    signal_simple_error ("Invalid value for `get-tooltalk-message-attribute'",
+    invalid_constant ("Invalid value for `get-tooltalk-message-attribute'",
 			 attribute);
 
   return Qnil;
@@ -792,7 +796,7 @@
       return Fput (XTOOLTALK_MESSAGE (message_)->plist_sym, argn, value);
     }
   else
-    signal_simple_error ("Invalid value for `set-tooltalk-message-attribute'",
+    invalid_constant ("Invalid value for `set-tooltalk-message-attribute'",
 			 attribute);
 
   if (fun_str)
@@ -1291,9 +1295,9 @@
        ())
 {
   if (!NILP (Vtooltalk_fd))
-    error ("Already connected to ToolTalk.");
+    signal_error (Qio_error, "Already connected to ToolTalk", Qunbound);
   if (noninteractive)
-    error ("Can't connect to ToolTalk in batch mode.");
+    signal_error (Qio_error, "Can't connect to ToolTalk in batch mode", Qunbound);
   init_tooltalk ();
   return NILP (Vtooltalk_fd) ? Qnil : Qt;
 }
@@ -1305,14 +1309,13 @@
   INIT_LRECORD_IMPLEMENTATION (tooltalk_message);
   INIT_LRECORD_IMPLEMENTATION (tooltalk_pattern);
 
-  defsymbol (&Qtooltalk_messagep, "tooltalk-message-p");
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qtooltalk_messagep);
   DEFSUBR (Ftooltalk_message_p);
-  defsymbol (&Qtooltalk_patternp, "tooltalk-pattern-p");
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qtooltalk_patternp);
   DEFSUBR (Ftooltalk_pattern_p);
-  defsymbol (&Qtooltalk_message_handler_hook, "tooltalk-message-handler-hook");
-  defsymbol (&Qtooltalk_pattern_handler_hook, "tooltalk-pattern-handler-hook");
-  defsymbol (&Qtooltalk_unprocessed_message_hook,
-	     "tooltalk-unprocessed-message-hook");
+  DEFSYMBOL (Qtooltalk_message_handler_hook);
+  DEFSYMBOL (Qtooltalk_pattern_handler_hook);
+  DEFSYMBOL (Qtooltalk_unprocessed_message_hook);
 
   DEFSUBR (Freceive_tooltalk_message);
   DEFSUBR (Fcreate_tooltalk_message);
@@ -1335,7 +1338,7 @@
   DEFSUBR (Ftooltalk_default_session);
   DEFSUBR (Ftooltalk_open_connection);
 
-  defsymbol (&Qreceive_tooltalk_message, "receive-tooltalk-message");
+  DEFSYMBOL (Qreceive_tooltalk_message);
   defsymbol (&Qtt_address, "address");
   defsymbol (&Qtt_args_count, "args_count");
   defsymbol (&Qtt_arg_bval, "arg_bval");
--- a/src/ui-byhand.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/ui-byhand.c	Thu May 24 07:51:33 2001 +0000
@@ -27,12 +27,12 @@
 
   if (!GTK_IS_BOX (XGTK_OBJECT (box)->object))
     {
-      signal_simple_error ("Object is not a GtkBox", box);
+      wtaerror ("Object is not a GtkBox", box);
     }
 
   if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
     {
-      signal_simple_error ("Child is not a GtkWidget", child);
+      wtaerror ("Child is not a GtkWidget", child);
     }
 
   gtk_box_query_child_packing (GTK_BOX (XGTK_OBJECT (box)->object),
@@ -88,7 +88,7 @@
 
   if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
     {
-      signal_simple_error ("Not a GtkBox object", box);
+      wtaerror ("Not a GtkBox object", box);
     }
 
   gtk_button_box_get_child_size (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object),
@@ -110,7 +110,7 @@
 
   if (!GTK_IS_BUTTON_BOX (XGTK_OBJECT (box)->object))
     {
-      signal_simple_error ("Not a GtkBox object", box);
+      wtaerror ("Not a GtkBox object", box);
     }
 
   gtk_button_box_get_child_ipadding (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object),
@@ -135,7 +135,7 @@
 
   if (!GTK_IS_CALENDAR (XGTK_OBJECT (calendar)->object))
     {
-      signal_simple_error ("Not a GtkCalendar object", calendar);
+      wtaerror ("Not a GtkCalendar object", calendar);
     }
 
   gtk_calendar_get_date (GTK_CALENDAR (XGTK_OBJECT (calendar)->object),
@@ -163,7 +163,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);
     }
 
   gtk_clist_get_text (GTK_CLIST (XGTK_OBJECT (obj)->object), XINT (row), XINT (column), &text);
@@ -198,7 +198,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);
     }
 
   gtk_clist_get_selection_info (GTK_CLIST (XGTK_OBJECT (obj)->object),
@@ -221,7 +221,7 @@
 
   if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
     {
-      signal_simple_error ("Object is not a GtkCList", clist);
+      wtaerror ("Object is not a GtkCList", clist);
     }
 
   gtk_clist_get_pixmap (GTK_CLIST (XGTK_OBJECT (clist)->object),
@@ -248,7 +248,7 @@
 
   if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object))
     {
-      signal_simple_error ("Object is not a GtkCList", clist);
+      wtaerror ("Object is not a GtkCList", clist);
     }
 
   gtk_clist_get_pixtext (GTK_CLIST (XGTK_OBJECT (clist)->object),
@@ -272,7 +272,7 @@
 
   if (!GTK_IS_COLOR_SELECTION (XGTK_OBJECT (object)->object))
     {
-      signal_simple_error ("Object is not a GtkColorSelection", object);
+      wtaerror ("Object is not a GtkColorSelection", object);
     }
 
   gtk_color_selection_get_color (GTK_COLOR_SELECTION (XGTK_OBJECT (object)), rgba);
@@ -300,7 +300,7 @@
 
   if (!GTK_IS_EDITABLE (XGTK_OBJECT (obj)->object))
     {
-      signal_simple_error ("Object is not a GtkEditable", obj);
+      wtaerror ("Object is not a GtkEditable", obj);
     }
 
   gtk_editable_insert_text (GTK_EDITABLE (XGTK_OBJECT (obj)->object),
@@ -322,7 +322,7 @@
 
   if (!GTK_IS_PIXMAP (XGTK_OBJECT (object)->object))
     {
-      signal_simple_error ("Object is not a GtkPixmap", object);
+      wtaerror ("Object is not a GtkPixmap", object);
     }
 
   gtk_pixmap_get (GTK_PIXMAP (XGTK_OBJECT (object)->object), &pixmap, &mask);
@@ -345,7 +345,7 @@
 
   if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
     {
-      signal_simple_error ("Object is not a GtkCurve", curve);
+      wtaerror ("Object is not a GtkCurve", curve);
     }
 
   vector = (gfloat *) alloca (sizeof (gfloat) * XINT (length));
@@ -377,7 +377,7 @@
 
   if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object))
     {
-      signal_simple_error ("Object is not a GtkCurve", curve);
+      wtaerror ("Object is not a GtkCurve", curve);
     }
 
   c_vector = (gfloat *) alloca (sizeof (gfloat) * vec_length);
@@ -403,7 +403,7 @@
 
   if (!GTK_IS_LABEL (XGTK_OBJECT (label)->object))
     {
-      signal_simple_error ("Object is not a GtkLabel", label);
+      wtaerror ("Object is not a GtkLabel", label);
     }
 
   gtk_label_get (GTK_LABEL (XGTK_OBJECT (label)->object), &string);
@@ -424,12 +424,12 @@
 
   if (!GTK_IS_NOTEBOOK (XGTK_OBJECT (notebook)->object))
     {
-      signal_simple_error ("Object is not a GtkLabel", notebook);
+      wtaerror ("Object is not a GtkLabel", notebook);
     }
 
   if (!GTK_IS_WIDGET (XGTK_OBJECT (child)->object))
     {
-      signal_simple_error ("Object is not a GtkWidget", child);
+      wtaerror ("Object is not a GtkWidget", child);
     }
 
   gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (XGTK_OBJECT (notebook)->object),
@@ -449,7 +449,7 @@
 
   if (!GTK_IS_WIDGET (XGTK_OBJECT (widget)->object))
     {
-      signal_simple_error ("Object is not a GtkWidget", widget);
+      wtaerror ("Object is not a GtkWidget", widget);
     }
 
   gtk_widget_get_pointer (GTK_WIDGET (XGTK_OBJECT (widget)->object), &x, &y);
@@ -503,17 +503,17 @@
 
   if (!SYMBOLP (callback) && !LISTP (callback))
     {
-      signal_simple_error ("Callback must be symbol or eval-able form", callback);
+      wtaerror ("Callback must be symbol or eval-able form", callback);
     }
 
   if (!GTK_IS_TOOLBAR (XGTK_OBJECT (toolbar)->object))
     {
-      signal_simple_error ("Object is not a GtkToolbar", toolbar);
+      wtaerror ("Object is not a GtkToolbar", toolbar);
     }
 
   if (!GTK_IS_WIDGET (XGTK_OBJECT (icon)->object))
     {
-      signal_simple_error ("Object is not a GtkWidget", icon);
+      wtaerror ("Object is not a GtkWidget", icon);
     }
 
   callback = Fcons (data, callback);
--- a/src/ui-gtk.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/ui-gtk.c	Thu May 24 07:51:33 2001 +0000
@@ -85,7 +85,8 @@
 	}
       else
 	{
-	  signal_simple_error ("dll_open error", build_string (dll_error (NULL)));
+	  signal_error (Qfile_error,
+			     "dll_open error", build_string (dll_error (NULL)));
 	}
     }
   return (h ? Qt : Qnil);
@@ -309,7 +310,7 @@
   char buf[200];
 
   if (print_readably)
-    error ("printing unreadable object #<ffi %p", XFFI (obj)->function_ptr);
+    printing_unreadable_object ("#<ffi %p>", XFFI (obj)->function_ptr);
 
   write_c_string ("#<ffi ", printcharfun);
   print_internal (XFFI (obj)->function_name, printcharfun, 1);
@@ -519,7 +520,7 @@
 
   if (arg.type == GTK_TYPE_INVALID)
     {
-      signal_simple_error ("Unknown type", type);
+      sferror ("Unknown type", type);
     }
 
   /* Need to look thru the already-loaded dlls */
@@ -535,7 +536,7 @@
 
   if (!var)
     {
-      signal_simple_error ("Could not locate variable", name);
+      gui_error ("Could not locate variable", name);
     }
 
   GTK_VALUE_POINTER(arg) = var;
@@ -578,7 +579,7 @@
 
   if (!name_func)
     {
-      signal_simple_error ("Could not locate function", name);
+      gui_error ("Could not locate function", name);
     }
 
   data = allocate_ffi_data ();
@@ -607,7 +608,7 @@
 
 	  if (the_type == GTK_TYPE_INVALID)
 	    {
-	      signal_simple_error ("Unknown argument type", type);
+	      invalid_argument ("Unknown argument type", type);
 	    }
 
 	  /* All things must be reduced to their basest form... */
@@ -619,7 +620,7 @@
 
 	  if (NILP (marshaller_type))
 	    {
-	      signal_simple_error ("Do not know how to marshal", type);
+	      invalid_argument ("Do not know how to marshal", type);
 	    }
 	  marshaller = concat3 (marshaller, build_string ("_"), marshaller_type);
 	  n_args++;
@@ -635,7 +636,7 @@
 
   if (data->return_type == GTK_TYPE_INVALID)
     {
-      signal_simple_error ("Unknown return type", rettype);
+      invalid_argument ("Unknown return type", rettype);
     }
 
   import_gtk_type (data->return_type);
@@ -647,7 +648,7 @@
 
   if (!marshaller_func)
     {
-      signal_simple_error ("Could not locate marshaller function", marshaller);
+      gui_error ("Could not locate marshaller function", marshaller);
     }
 
   data->n_args = n_args;
@@ -723,7 +724,7 @@
 	  if (lisp_to_gtk_type (XCAR (tail), &the_args[n_args]))
 	    {
 	      /* There was some sort of an error */
-	      signal_simple_error ("Error converting arguments", args);
+	      gui_error ("Error converting arguments", args);
 	    }
 	  n_args++;
 	}
@@ -774,7 +775,7 @@
   char buf[200];
 
   if (print_readably)
-    error ("printing unreadable object #<GtkObject %p>", XGTK_OBJECT (obj)->object);
+    printing_unreadable_object ("#<GtkObject %p>", XGTK_OBJECT (obj)->object);
 
   write_c_string ("#<GtkObject (", printcharfun);
   if (XGTK_OBJECT (obj)->alive_p)
@@ -814,7 +815,7 @@
 
   if (!(info->arg_flags & GTK_ARG_READABLE))
     {
-      signal_simple_error ("Attempt to get write-only property", prop);
+      invalid_operation ("Attempt to get write-only property", prop);
     }
 
   gtk_object_getv (XGTK_OBJECT (obj)->object, 1, args);
@@ -878,12 +879,12 @@
 
   if (lisp_to_gtk_type (value, &args[0]))
     {
-      signal_simple_error ("Error converting to GtkType", value);
+      gui_error ("Error converting to GtkType", value);
     }
 
   if (!(info->arg_flags & GTK_ARG_WRITABLE))
     {
-      signal_simple_error ("Attemp to set read-only argument", prop);
+      invalid_operation ("Attempt to set read-only argument", prop);
     }
 
   gtk_object_setv (XGTK_OBJECT (obj)->object, 1, args);
@@ -907,7 +908,7 @@
       Lisp_Object obj;
       XSETGTK_OBJECT (obj, data);
 
-      signal_simple_error
+      invalid_operation
 	("Can't dump an emacs containing GtkObject objects", obj);
     }
 
@@ -1085,7 +1086,7 @@
   char buf[200];
 
   if (print_readably)
-    error ("printing unreadable object #<GtkBoxed %p>", XGTK_BOXED (obj)->object);
+    printing_unreadable_object ("#<GtkBoxed %p>", XGTK_BOXED (obj)->object);
 
   write_c_string ("#<GtkBoxed (", printcharfun);
   write_c_string (gtk_type_name (XGTK_BOXED (obj)->object_type), printcharfun);
@@ -1195,7 +1196,7 @@
 
   if (t == GTK_TYPE_INVALID)
     {
-      signal_simple_error ("Not a GTK type", type);
+      invalid_argument ("Not a GTK type", type);
     }
   return (make_int (GTK_FUNDAMENTAL_TYPE (t)));
 }
@@ -1231,7 +1232,7 @@
       t = gtk_type_from_name (XSTRING_DATA (type));
       if (t == GTK_TYPE_INVALID)
 	{
-	  signal_simple_error ("Not a GTK type", type);
+	  invalid_argument ("Not a GTK type", type);
 	}
     }
   else
@@ -1242,7 +1243,7 @@
 
   if (GTK_FUNDAMENTAL_TYPE (t) != GTK_TYPE_OBJECT)
     {
-      signal_simple_error ("Not a GtkObject", type);
+      invalid_argument ("Not a GtkObject", type);
     }
 
   /* Need to do stupid shit like this to get the args
@@ -1330,10 +1331,10 @@
   INIT_LRECORD_IMPLEMENTATION (emacs_ffi);
   INIT_LRECORD_IMPLEMENTATION (emacs_gtk_object);
   INIT_LRECORD_IMPLEMENTATION (emacs_gtk_boxed);
-  defsymbol (&Qemacs_ffip, "emacs-ffi-p");
-  defsymbol (&Qemacs_gtk_objectp, "emacs-gtk-object-p");
-  defsymbol (&Qemacs_gtk_boxedp, "emacs-gtk-boxed-p");
-  defsymbol (&Qvoid, "void");
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qemacs_ffip);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qemacs_gtk_objectp);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qemacs_gtk_boxedp);
+  DEFSYMBOL (Qvoid);
   DEFSUBR (Fdll_load);
   DEFSUBR (Fgtk_import_function_internal);
   DEFSUBR (Fgtk_import_variable_internal);
@@ -1643,7 +1644,7 @@
 	    }
 	  else
 	    {
-	      signal_simple_error ("Don't know how to convert object to GDK_WINDOW", obj);
+	      invalid_argument ("Don't know how to convert object to GDK_WINDOW", obj);
 	    }
 	  break;
 	}
@@ -1664,11 +1665,11 @@
 	    }
 	  else if (STRINGP (obj))
 	    {
-	      signal_simple_error ("Please use a color specifier or instance, not a string", obj);
+	      invalid_argument ("Please use a color specifier or instance, not a string", obj);
 	    }
 	  else
 	    {
-	      signal_simple_error ("Don't know hot to convert to GdkColor", obj);
+	      invalid_argument ("Don't know how to convert to GdkColor", obj);
 	    }
 	}
       else if (arg->type == GTK_TYPE_GDK_FONT)
@@ -1702,11 +1703,11 @@
 	    }
 	  else if (STRINGP (obj))
 	    {
-	      signal_simple_error ("Please use a font specifier or instance, not a string", obj);
+	      invalid_argument ("Please use a font specifier or instance, not a string", obj);
 	    }
 	  else
 	    {
-	      signal_simple_error ("Don't know hot to convert to GdkColor", obj);
+	      invalid_argument ("Don't know how to convert to GdkColor", obj);
 	    }
 	}
       else
@@ -1762,7 +1763,7 @@
 	  if (XGTK_OBJECT (obj)->alive_p)
 	    GTK_VALUE_OBJECT (*arg) = XGTK_OBJECT (obj)->object;
 	  else
-	    signal_simple_error ("Attempting to pass dead object to GTK function", obj);
+	    invalid_argument ("Attempting to pass dead object to GTK function", obj);
 	}
       break;
 
@@ -1825,14 +1826,14 @@
 
   if (NILP (alist))
     {
-      signal_simple_error ("Unkown enumeration", build_string (gtk_type_name (t)));
+      invalid_argument ("Unknown enumeration", build_string (gtk_type_name (t)));
     }
 
   value = Fassq (obj, alist);
 
   if (NILP (value))
     {
-      signal_simple_error ("Unknown value", obj);
+      invalid_argument ("Unknown value", obj);
     }
 
   CHECK_INT (XCDR (value));
@@ -1894,7 +1895,7 @@
 
   if (NILP (alist))
     {
-      signal_simple_error ("Unkown enumeration", build_string (gtk_type_name (t)));
+      invalid_argument ("Unknown enumeration", build_string (gtk_type_name (t)));
     }
 
   cell = Frassq (make_int (value), alist);
--- a/src/undo.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/undo.c	Thu May 24 07:51:33 2001 +0000
@@ -474,7 +474,7 @@
 
 		  if (XINT (car) < BUF_BEGV (current_buffer)
 		      || XINT (cdr) > BUF_ZV (current_buffer))
-		    error ("Changes to be undone are outside visible portion of buffer");
+		    signal_error (Qinvalid_operation, "Changes to be undone are outside visible portion of buffer", Qunbound);
 		  /* Set point first thing, so that undoing this undo
 		     does not send point back to where it is now.  */
 		  Fgoto_char (car, Qnil);
@@ -489,14 +489,14 @@
 		  if (pos < 0)
 		    {
 		      if (-pos < BUF_BEGV (current_buffer) || -pos > BUF_ZV (current_buffer))
-			error ("Changes to be undone are outside visible portion of buffer");
+			signal_error (Qinvalid_operation, "Changes to be undone are outside visible portion of buffer", Qunbound);
 		      BUF_SET_PT (current_buffer, -pos);
 		      Finsert (1, &membuf);
 		    }
 		  else
 		    {
 		      if (pos < BUF_BEGV (current_buffer) || pos > BUF_ZV (current_buffer))
-			error ("Changes to be undone are outside visible portion of buffer");
+			signal_error (Qinvalid_operation, "Changes to be undone are outside visible portion of buffer", Qunbound);
 		      BUF_SET_PT (current_buffer, pos);
 
 		      /* Insert before markers so that if the mark is
@@ -527,8 +527,9 @@
           else
 	    {
 	    rotten:
-	      signal_simple_continuable_error
-		("Something rotten in the state of undo", next);
+	      signal_continuable_error
+		(Qinvalid_state,
+		 "Something rotten in the state of undo", next);
 	    }
         }
       arg--;
@@ -543,7 +544,7 @@
 {
   DEFSUBR (Fprimitive_undo);
   DEFSUBR (Fundo_boundary);
-  defsymbol (&Qinhibit_read_only, "inhibit-read-only");
+  DEFSYMBOL (Qinhibit_read_only);
 }
 
 void
--- a/src/unexaix.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/unexaix.c	Thu May 24 07:51:33 2001 +0000
@@ -116,7 +116,8 @@
 {
   if (fd)
     close (fd);
-  report_file_error ("Cannot unexec", Fcons (build_string (file), Qnil));
+  report_error_with_errno (Qio_error, "Cannot unexec",
+			   build_string (file));
 }
 #endif /* emacs */
 
@@ -129,7 +130,7 @@
 {
   close (fd);
 #ifdef emacs
-  error (msg, a1, a2);
+  signal_ferror (Qio_error, msg, a1, a2);
 #else
   fprintf (stderr, msg, a1, a2);
   fprintf (stderr, "\n");
--- a/src/unexapollo.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/unexapollo.c	Thu May 24 07:51:33 2001 +0000
@@ -56,24 +56,24 @@
   status_$t status;
   /* Open the Source File. */
   if ((source_file = open (source_file_name, O_RDONLY)) < 0)
-    error ("cannot open source file for input");
+    signal_error (Qfile_error, "cannot open source file for input", Qunbound);
   /* Read the File Header. */
   if (read (source_file, &file_header, sizeof (file_header)) != sizeof (file_header))
-    error ("cannot read file header");
+    signal_error (Qfile_error, "cannot read file header", Qunbound);
   
   /* Read the Domain Header. */
   if (read (source_file, &domain_header, sizeof (domain_header))
       != sizeof (domain_header))
-    error ("cannot read domain header");
+    signal_error (Qfile_error, "cannot read domain header", Qunbound);
   /* Read the Section Headers. */
   sections =
     (struct scnhdr *) malloc (file_header.f_nscns*sizeof (struct scnhdr));
   if (sections == (struct scnhdr *) 0)
-    error ("cannot allocate section header storage");
+    out_of_memory ("cannot allocate section header storage", Qunbound);
   sections_limit = sections + file_header.f_nscns;
   if (read (source_file, sections, file_header.f_nscns*sizeof (struct scnhdr))
       != file_header.f_nscns*sizeof (struct scnhdr))
-    error ("cannot read section headers");
+    signal_error (Qfile_error, "cannot read section headers", Qunbound);
   /* Compute the new Size of the Data Section. */
   data_size = sbrk (0) - domain_header.data_start;
   delta_before_rwdi = delta_after_rwdi = data_size - domain_header.dsize;
@@ -84,7 +84,7 @@
       {
 	/* If there are relocation entries, we cannot "unrelocate" them. */
 	if (rwdi_section->s_nreloc > 0)
-	  error (".rwdi section needs relocation - cannot dump Emacs");
+	  signal_error (Qio_error, ".rwdi section needs relocation - cannot dump Emacs", Qunbound);
 	delta_after_rwdi = delta_before_rwdi - rwdi_section->s_size;
 	old_rwdi_vaddr = rwdi_section->s_vaddr;
 	rwdi_section->s_paddr = 0;
@@ -152,59 +152,59 @@
   ios_$create (target_file_name, strlen (target_file_name), coff_$uid,
 	       ios_$recreate_mode, ios_$write_opt, &target_file, &status);
   if (status.all != status_$ok)
-    error ("cannot open target file for output");
+    signal_error (Qfile_error, "cannot open target file for output", Qunbound);
   /* Write the File Header. */
   if (write (target_file, &file_header, sizeof (file_header)) != sizeof (file_header))
-    error ("cannot write file header");
+    signal_error (Qfile_error, "cannot write file header", Qunbound);
   /* Write the Domain Header. */
   if (write (target_file, &domain_header, sizeof (domain_header))
       != sizeof (domain_header))
-    error ("cannot write domain header");
+    signal_error (Qfile_error, "cannot write domain header", Qunbound);
   /* Write the Section Headers. */
   if (write (target_file, sections, file_header.f_nscns*sizeof (struct scnhdr))
       != file_header.f_nscns*sizeof (struct scnhdr))
-    error ("cannot write section headers");
+    signal_error (Qfile_error, "cannot write section headers", Qunbound);
   /* Copy the Allocated Sections. */
   for (section = sections; section != first_data_section; section++)
     if (section->s_scnptr != 0)
       CopyData (target_file, source_file, LONG_ALIGN(section->s_size));
   /* Write the Expanded Data Segment. */
   if (write (target_file, first_data_section->s_vaddr, data_size) != data_size)
-    error ("cannot write new data section");
+    signal_error (Qfile_error, "cannot write new data section", Qunbound);
   
   /* Skip over the Last Data Section and Copy until the .rwdi Section. */
   if (lseek (source_file, last_data_section->s_scnptr
 	     +old_data_section_size, L_SET) == -1)
-    error ("cannot seek past data section");
+    signal_error (Qfile_error, "cannot seek past data section", Qunbound);
   for (section = last_data_section+1; section != rwdi_section; section++)
     if (section->s_scnptr != 0)
       CopyData (target_file, source_file, LONG_ALIGN(section->s_size));
   /* Skip over the .rwdi Section and Copy Remainder of Source File. */
   if (lseek (source_file, source_file_offset_past_rwdi, L_SET) == -1)
-    error ("cannot seek past .rwdi section");
+    signal_error (Qfile_error, "cannot seek past .rwdi section", Qunbound);
   while ((byte_count = read (source_file, buffer, sizeof (buffer))) > 0)
     if (write (target_file, buffer, byte_count) != byte_count)
-      error ("cannot write data");
+      signal_error (Qfile_error, "cannot write data", Qunbound);
   /* Unrelocate .data references to Global Symbols. */
   for (section = first_data_section; section <= last_data_section; section++)
     for (i = 0; i < section->s_nreloc; i++)
       {
 	if  (lseek (source_file, section->s_relptr
 		    +i*sizeof (struct reloc)-delta_after_rwdi, L_SET) == -1)
-	  error ("cannot seek to relocation info");
+	  signal_error (Qfile_error, "cannot seek to relocation info", Qunbound);
 	if (read (source_file, &reloc_entry, sizeof (reloc_entry))
 	    != sizeof (reloc_entry))
-	  error ("cannot read reloc entry");
+	  signal_error (Qfile_error, "cannot read reloc entry", Qunbound);
 	if (lseek (source_file, reloc_entry.r_vaddr-section->s_vaddr
 		   +section->s_scnptr, L_SET) == -1)
-	  error ("cannot seek to data element");
+	  signal_error (Qfile_error, "cannot seek to data element", Qunbound);
 	if (lseek (target_file, reloc_entry.r_vaddr-section->s_vaddr
 		   +section->s_scnptr, L_SET) == -1)
-	  error ("cannot seek to data element");
+	  signal_error (Qfile_error, "cannot seek to data element", Qunbound);
 	if (read (source_file, buffer, 4) != 4)
-	  error ("cannot read data element");
+	  signal_error (Qfile_error, "cannot read data element", Qunbound);
 	if (write (target_file, buffer, 4) != 4)
-	  error ("cannot write data element");
+	  signal_error (Qfile_error, "cannot write data element", Qunbound);
       }
   
   /* Correct virtual addresses in .blocks section. */
@@ -220,11 +220,11 @@
 	{
 	  if (lseek (target_file,
 		     blocks_section->s_scnptr+section_offset, L_SET) == -1)
-	    error ("cannot seek to comp unit record");
+	    signal_error (Qfile_error, "cannot seek to comp unit record", Qunbound);
 	  /* Handle pad records before the comp unit record. */
 	  if (read (target_file, &dst_record, DST_RECORD_HDR_SIZE)
 	      != DST_RECORD_HDR_SIZE)
-	    error ("cannot read dst record tag");
+	    signal_error (Qfile_error, "cannot read dst record tag", Qunbound);
 	  if (dst_record.rec_type == dst_typ_pad)
 	    section_offset += DST_RECORD_HDR_SIZE;
 	  else if (dst_record.rec_type == dst_typ_comp_unit)
@@ -232,7 +232,7 @@
 	      comp_unit = &dst_record.rec_data.comp_unit_;
 	      if  (read (target_file, comp_unit, sizeof (*comp_unit))
 		   != sizeof (*comp_unit))
-		error ("cannot read comp unit record");
+		signal_error (Qfile_error, "cannot read comp unit record", Qunbound);
 	      if (lseek (target_file, blocks_section->s_scnptr
 			 +section_offset
 #if dst_version_major == 1 && dst_version_minor < 4
@@ -242,36 +242,36 @@
 #endif
 			 +DST_RECORD_HDR_SIZE,
 			 L_SET) == -1)
-		error ("cannot seek to section table");
+		signal_error (Qfile_error, "cannot seek to section table", Qunbound);
 	      if (read (target_file, &number_of_sections, sizeof (number_of_sections))
 		  != sizeof (number_of_sections))
-		error ("cannot read section table size");
+		signal_error (Qfile_error, "cannot read section table size", Qunbound);
 	      for (i = 0; i < number_of_sections; i++)
 		{
 		  if (read (target_file, &section_base, sizeof (section_base))
 		      != sizeof (section_base))
-		    error ("cannot read section base value");
+		    signal_error (Qfile_error, "cannot read section base value", Qunbound);
 		  if (section_base < first_changed_vaddr)
 		    continue;
 		  else if (section_base < old_rwdi_vaddr)
 		    section_base += delta_before_rwdi;
 		  else section_base += delta_after_rwdi;
 		  if (lseek (target_file, -sizeof (section_base), L_INCR) == -1)
-		    error ("cannot seek to section base value");
+		    signal_error (Qfile_error, "cannot seek to section base value", Qunbound);
 		  if (write (target_file, &section_base, sizeof (section_base))
 		      != sizeof (section_base))
-		    error ("cannot write section base");
+		    signal_error (Qfile_error, "cannot write section base", Qunbound);
 		}
 	      section_offset += comp_unit->data_size;
 	    }
-	  else error ("unexpected dst record type");
+	  else signal_error (Qfile_error, "unexpected dst record type", Qunbound);
 	}
     }
   
   if (close (source_file) == -1)
-    error("cannot close source file");
+    signal_error (Qfile_error, "cannot close source file", Qunbound);
   if (close (target_file) == -1)
-    error ("cannot close target file");
+    signal_error (Qfile_error, "cannot close target file", Qunbound);
 }
 
 
@@ -288,9 +288,9 @@
 	byte_count = sizeof (buffer);
       else byte_count = total_byte_count;
       if (read (source_file, buffer, byte_count) != byte_count)
-	error ("cannot read data");
+	signal_error (Qfile_error, "cannot read data", Qunbound);
       if (write (target_file, buffer, byte_count) != byte_count)
-	error ("cannot write data");
+	signal_error (Qfile_error, "cannot write data", Qunbound);
       total_byte_count -= byte_count;
     }
 }
--- a/src/unexconvex.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/unexconvex.c	Thu May 24 07:51:33 2001 +0000
@@ -199,7 +199,8 @@
 {
     if (fd)
 	close (fd);
-    error ("Failure operating on %s", file);
+    signal_error (Qio_error, "Failure operating on file",
+		  build_string (file));
 }
 
 #define ERROR0(msg) report_error_1 (new, msg, 0, 0); return -1
@@ -213,7 +214,7 @@
 int a1, a2;
 {
     close (fd);
-    error (msg, a1, a2);
+    signal_ferror (Qio_error, msg, a1, a2);
 }
 
 /* ****************************************************************
--- a/src/unexec.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/unexec.c	Thu May 24 07:51:33 2001 +0000
@@ -344,8 +344,8 @@
 {
   if (fd)
     close (fd);
-  report_file_error ("Cannot unexec",
-		     Fcons (build_ext_string (file, Qfile_name), Qnil));
+  report_error_with_errno (Qio_error, "Cannot unexec",
+			   build_ext_string (file, Qfile_name));
 }
 #endif /* emacs */
 
@@ -361,7 +361,7 @@
 {
   close (fd);
 #ifdef emacs
-  error (msg, a1, a2);
+  signal_ferror (Qio_error, msg, a1, a2);
 #else
   fprintf (stderr, msg, a1, a2);
   fprintf (stderr, "\n");
--- a/src/widget.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/widget.c	Thu May 24 07:51:33 2001 +0000
@@ -108,7 +108,7 @@
 void
 syms_of_widget (void)
 {
-  defsymbol (&Qwidget_type, "widget-type");
+  DEFSYMBOL (Qwidget_type);
 
   DEFSUBR (Fwidget_plist_member);
   DEFSUBR (Fwidget_put);
--- a/src/win32.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/win32.c	Thu May 24 07:51:33 2001 +0000
@@ -233,13 +233,13 @@
     return Qt;
   
   if (ret == ERROR_FILE_NOT_FOUND)
-    signal_simple_error ("file not found", document);
+    signal_error (Qfile_error, "file not found", document);
   else if (ret == ERROR_PATH_NOT_FOUND)
-    signal_simple_error ("path not found", current_dir);
+    signal_error (Qfile_error, "path not found", current_dir);
   else if (ret == ERROR_BAD_FORMAT)
-    signal_simple_error ("bad executable format", document);
+    signal_error (Qfile_error, "bad executable format", document);
   else
-    error ("internal error");
+    signal_error (Qinternal_error, "internal error", Qunbound);
 
   return Qnil;
 }
--- a/src/window.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/window.c	Thu May 24 07:51:33 2001 +0000
@@ -184,8 +184,7 @@
   char buf[200];
 
   if (print_readably)
-    error ("printing unreadable object #<window 0x%x>",
-           XWINDOW (obj)->header.uid);
+    printing_unreadable_object ("#<window 0x%x>", XWINDOW (obj)->header.uid);
 
   write_c_string ("#<window", printcharfun);
   if (!NILP (XWINDOW (obj)->buffer))
@@ -1977,7 +1976,7 @@
 	return Qnil;
 
       if (MINI_WINDOW_P (XWINDOW (window)))
-	error ("Attempt to delete the minibuffer window");
+	signal_error (Qinvalid_operation, "Attempt to delete the minibuffer window", Qunbound);
 
       /* It has been suggested that it's a good thing for C-x 0 to have this
 	 behavior, but not such a good idea for #'delete-window to have it.
@@ -2973,7 +2972,7 @@
   XSETWINDOW (window, w);
 
   if (MINI_WINDOW_P (w) && old_top > 0)
-    error ("Can't expand minibuffer to full frame");
+    invalid_operation ("Can't expand minibuffer to full frame", Qunbound);
 
   /* Ignore dedicated windows. */
   window_loop (DELETE_OTHER_WINDOWS, window, 0, w->frame, 0, Qnil);
@@ -3389,11 +3388,11 @@
   CHECK_BUFFER (buffer);
 
   if (!BUFFER_LIVE_P (XBUFFER (buffer)))
-    error ("Attempt to display deleted buffer");
+    invalid_operation ("Attempt to display deleted buffer", Qunbound);
 
   tem = w->buffer;
   if (NILP (tem))
-    error ("Window is deleted");
+    invalid_operation ("Window is deleted", Qunbound);
 
   /* While this seems like a logical thing to do, it causes problems
      because of saved window configurations.  It is possible for a
@@ -3412,8 +3411,7 @@
 				   is first being set up.  */
     {
       if (!NILP (w->dedicated) && !EQ (tem, buffer))
-	error ("Window is dedicated to buffer %s",
-	       XSTRING_DATA (XBUFFER (tem)->name));
+	signal_error (Qinvalid_operation, "Window is dedicated to buffer", tem);
 
       old_buffer_local_face_property =
 	XBUFFER (w->buffer)->buffer_local_face_property;
@@ -3475,7 +3473,7 @@
 
   /* we have already caught dead-window errors */
   if (!NILP (w->hchild) || !NILP (w->vchild))
-    error ("Trying to select non-leaf window");
+    invalid_operation ("Trying to select non-leaf window", Qunbound);
 
   w->use_time = make_int (++window_select_count);
 
@@ -3672,19 +3670,19 @@
     }
 
   if (MINI_WINDOW_P (o))
-    error ("Attempt to split minibuffer window");
+    invalid_operation ("Attempt to split minibuffer window", Qunbound);
   else if (FRAME_NO_SPLIT_P (XFRAME (WINDOW_FRAME (o))))
-    error ("Attempt to split unsplittable frame");
+    invalid_operation ("Attempt to split unsplittable frame", Qunbound);
 
   check_min_window_sizes ();
 
   if (NILP (horflag))
     {
       if (csize < window_min_height)
-	error ("Window height %d too small (after splitting)", csize);
+	signal_error (Qinvalid_operation, "Window height too small (after splitting)", make_int (csize));
       if (csize + window_min_height > window_char_height (o, 1))
-	error ("Window height %d too small (after splitting)",
-	       window_char_height (o, 1) - csize);
+	signal_error (Qinvalid_operation, "Window height too small (after splitting)",
+	       make_int (window_char_height (o, 1) - csize));
       if (NILP (o->parent)
 	  || NILP (XWINDOW (o->parent)->vchild))
 	{
@@ -3703,10 +3701,10 @@
   else
     {
       if (csize < window_min_width)
-	error ("Window width %d too small (after splitting)", csize);
+	signal_error (Qinvalid_operation, "Window width too small (after splitting)", make_int (csize));
       if (csize + window_min_width > window_char_width (o, 0))
-	error ("Window width %d too small (after splitting)",
-	       window_char_width (o, 0) - csize);
+	signal_error (Qinvalid_operation, "Window width too small (after splitting)",
+	       make_int (window_char_width (o, 0) - csize));
       if (NILP (o->parent)
 	  || NILP (XWINDOW (o->parent)->hchild))
 	{
@@ -4089,7 +4087,7 @@
   XSETWINDOW (window, win);
   f = XFRAME (win->frame);
   if (EQ (window, FRAME_ROOT_WINDOW (f)))
-    error ("Won't change only window");
+    invalid_operation ("Won't change only window", Qunbound);
 
   /* #### This is very likely incorrect and instead the char_to_pixel_
      functions should be called. */
@@ -4102,7 +4100,7 @@
       if (NILP (parent))
 	{
 	  if (widthflag)
-	    error ("No other window to side of this one");
+	    invalid_operation ("No other window to side of this one", Qunbound);
 	  break;
 	}
       if (widthflag
@@ -4354,7 +4352,7 @@
 	      (w->window_end_pos[CURRENT_DISP] == -1
 	       || (BUF_Z (b) - w->window_end_pos[CURRENT_DISP] > BUF_ZV (b))))
 	    {
-	      maybe_signal_error (Qend_of_buffer, Qnil, Qwindow, errb);
+	      maybe_signal_error_1 (Qend_of_buffer, Qnil, Qwindow, errb);
 	      return;
 	    }
 	  else
@@ -4411,7 +4409,7 @@
 	  if (vtarget > value
 	      && marker_position (w->start[CURRENT_DISP]) == BUF_BEGV (b))
 	    {
-	      maybe_signal_error (Qbeginning_of_buffer, Qnil, Qwindow, errb);
+	      maybe_signal_error_1 (Qbeginning_of_buffer, Qnil, Qwindow, errb);
 	      return;
 	    }
 	  else
@@ -4468,7 +4466,7 @@
 	}
       if (marker_position (w->start[CURRENT_DISP]) == BUF_BEGV (b))
 	{
-	  maybe_signal_error (Qbeginning_of_buffer, Qnil, Qwindow, errb);
+	  maybe_signal_error_1 (Qbeginning_of_buffer, Qnil, Qwindow, errb);
 	  return;
 	}
       else
@@ -4585,7 +4583,7 @@
   CHECK_LIVE_WINDOW (window);
 
   if (EQ (window, selected_window))
-    error ("There is no other window");
+    invalid_operation ("There is no other window", Qunbound);
 
   return window;
  }
@@ -5090,8 +5088,8 @@
   struct window_config *config = XWINDOW_CONFIGURATION (obj);
   char buf[200];
   if (print_readably)
-    error ("printing unreadable object #<window-configuration 0x%x>",
-           config->header.uid);
+    printing_unreadable_object ("#<window-configuration 0x%x>",
+				config->header.uid);
   write_c_string ("#<window-configuration ", printcharfun);
   sprintf (buf, "0x%x>", config->header.uid);
   write_c_string (buf, printcharfun);
@@ -6066,20 +6064,20 @@
   INIT_LRECORD_IMPLEMENTATION (window);
   INIT_LRECORD_IMPLEMENTATION (window_configuration);
 
-  defsymbol (&Qwindowp, "windowp");
-  defsymbol (&Qwindow_live_p, "window-live-p");
-  defsymbol (&Qwindow_configurationp, "window-configuration-p");
-  defsymbol (&Qtemp_buffer_show_hook, "temp-buffer-show-hook");
-  defsymbol (&Qdisplay_buffer, "display-buffer");
+  DEFSYMBOL (Qwindowp);
+  DEFSYMBOL (Qwindow_live_p);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qwindow_configurationp);
+  DEFSYMBOL (Qtemp_buffer_show_hook);
+  DEFSYMBOL (Qdisplay_buffer);
 
 #ifdef MEMORY_USAGE_STATS
-  defsymbol (&Qface_cache, "face-cache");
-  defsymbol (&Qglyph_cache, "glyph-cache");
-  defsymbol (&Qline_start_cache, "line-start-cache");
+  DEFSYMBOL (Qface_cache);
+  DEFSYMBOL (Qglyph_cache);
+  DEFSYMBOL (Qline_start_cache);
 #ifdef HAVE_SCROLLBARS
-  defsymbol (&Qscrollbar_instances, "scrollbar-instances");
+  DEFSYMBOL (Qscrollbar_instances);
 #endif
-  defsymbol (&Qother_redisplay, "other-redisplay");
+  DEFSYMBOL (Qother_redisplay);
   /* Qother in general.c */
 #endif