changeset 793:e38acbeb1cae

[xemacs-hg @ 2002-03-29 04:46:17 by ben] lots o' fixes etc/ChangeLog: New file. Separated out all entries for etc/ into their own ChangeLog. Includes entries for the following files: etc/BABYL, etc/BETA, etc/CHARSETS, etc/DISTRIB, etc/Emacs.ad, etc/FTP, etc/GNUS-NEWS, etc/GOATS, etc/HELLO, etc/INSTALL, etc/MACHINES, etc/MAILINGLISTS, etc/MSDOS, etc/MYTHOLOGY, etc/NEWS, etc/OXYMORONS, etc/PACKAGES, etc/README, etc/TUTORIAL, etc/TUTORIAL.de, etc/TUTORIAL.ja, etc/TUTORIAL.ko, etc/TUTORIAL.se, etc/aliases.ksh, etc/altrasoft-logo.xpm, etc/check_cygwin_setup.sh, etc/custom/example-themes/europe-theme.el, etc/custom/example-themes/ex-custom-file, etc/custom/example-themes/example-theme.el, etc/e/eterm.ti, etc/edt-user.doc, etc/enriched.doc, etc/etags.1, etc/gnuserv.1, etc/gnuserv.README, etc/package-index.LATEST.gpg, etc/package-index.LATEST.pgp, etc/photos/jan.png, etc/recycle.xpm, etc/refcard.tex, etc/sample.Xdefaults, etc/sample.emacs, etc/sgml/CATALOG, etc/sgml/HTML32.dtd, etc/skk/SKK.tut.E, etc/smilies/Face_ase.xbm, etc/smilies/Face_ase2.xbm, etc/smilies/Face_ase3.xbm, etc/smilies/Face_smile.xbm, etc/smilies/Face_weep.xbm, etc/sounds, etc/toolbar, etc/toolbar/workshop-cap-up.xpm, etc/xemacs-ja.1, etc/xemacs.1, etc/yow.lines, etc\BETA, etc\NEWS, etc\README, etc\TUTORIAL, etc\TUTORIAL.de, etc\check_cygwin_setup.sh, etc\sample.init.el, etc\unicode\README, etc\unicode\mule-ucs\*, etc\unicode\other\* unicode/unicode-consortium/8859-16.TXT: New file. mule/english.el: Define this charset now, since a bug was fixed that formerly prevented it. mule/ethio-util.el: Fix compile errors involving Unicode `characters', which should be integers. Makefile.in.in: Always include gui.c, to fix compile error when TTY-only. EmacsFrame.c, abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, bytecode.h, callint.c, callproc.c, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, cmds.c, console-msw.c, console-msw.h, console-tty.c, console-x.c, console-x.h, console.c, console.h, data.c, database.c, device-gtk.c, device-msw.c, device-x.c, device.c, device.h, dialog-msw.c, doc.c, doprnt.c, dumper.c, dynarr.c, editfns.c, eldap.c, eldap.h, elhash.c, elhash.h, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.c, events.h, extents.c, extents.h, faces.c, faces.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, frame-gtk.c, frame-msw.c, frame-tty.c, frame-x.c, frame.c, frame.h, free-hook.c, general-slots.h, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gtk-xemacs.c, gui-msw.c, gui-x.c, gui-x.h, gui.c, gui.h, gutter.c, gutter.h, indent.c, input-method-xlib.c, insdel.c, keymap.c, keymap.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, marker.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-canna.c, mule-ccl.c, mule-charset.c, mule-wnnfns.c, native-gtk-toolbar.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, opaque.c, opaque.h, postgresql.c, postgresql.h, print.c, process-unix.c, process.c, process.h, rangetab.c, rangetab.h, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, search.c, select-gtk.c, select-x.c, sound.c, specifier.c, specifier.h, strftime.c, symbols.c, symeval.h, syntax.h, text.c, text.h, toolbar-common.c, toolbar-msw.c, toolbar.c, toolbar.h, tooltalk.c, tooltalk.h, ui-gtk.c, ui-gtk.h, undo.c, vm-limit.c, window.c, window.h: Eliminate XSETFOO. Replace all usages with wrap_foo(). Make symbol->name a Lisp_Object, not Lisp_String *. Eliminate nearly all uses of Lisp_String * in favor of Lisp_Object, and correct macros so most of them favor Lisp_Object. Create new error-behavior ERROR_ME_DEBUG_WARN -- output warnings, but at level `debug' (usually ignored). Use it when instantiating specifiers, so problems can be debugged. Move log-warning-minimum-level into C so that we can optimize ERROR_ME_DEBUG_WARN. Fix warning levels consistent with new definitions. Add default_ and parent fields to char table; not yet implemented. New fun Dynarr_verify(); use for further error checking on Dynarrs. Rearrange code at top of lisp.h in conjunction with dynarr changes. Fix eifree(). Use Eistrings in various places (format_event_object(), where_is_to_char(), and callers thereof) to avoid fixed-size strings buffers. New fun write_eistring(). Reindent and fix GPM code to follow standards. Set default MS Windows font to Lucida Console (same size as Courier New but less interline spacing, so more lines fit). Increase default frame size on Windows to 50 lines. (If that's too big for the workspace, the frame will be shrunk as necessary.) Fix problem with text files with no newlines (). (Change `convert-eol' coding system to use `nil' for autodetect, consistent with make-coding-system.) Correct compile warnings in vm-limit.c. Fix handling of reverse-direction charsets to avoid errors when opening (e.g.) mule-ucs/lisp/reldata/uiso8859-6.el. Recode some object printing methods to use write_fmt_string() instead of a fixed buffer and sprintf. Turn on display of png comments as warnings (level `info'), now that they're unobtrusive. Revamped the sound documentation. Fixed bug in redisplay w.r.t. hscroll/truncation/continuation glyphs causing jumping up and down of the lines, since they're bigger than the line size. (It was seen most obviously when there's a horizontal scroll bar, e.g. do C-h a glyph or something like that.) The problem was that the glyph-contrib-p setting on glyphs was ignored even if it was set properly, which it wasn't until now.
author ben
date Fri, 29 Mar 2002 04:49:13 +0000
parents 4e83fdb13eb9
children 3604075fb2a3
files ChangeLog TODO.ben-mule-21-5 etc/ChangeLog etc/DISTRIB etc/unicode/unicode-consortium/8859-16.TXT lisp/ChangeLog lisp/auto-save.el lisp/check-features.el lisp/code-files.el lisp/etags.el lisp/files.el lisp/finder.el lisp/font-lock.el lisp/help.el lisp/info.el lisp/menubar-items.el lisp/mouse.el lisp/msw-faces.el lisp/msw-font-menu.el lisp/msw-glyphs.el lisp/mule/english.el lisp/mule/ethio-util.el lisp/package-get.el lisp/packages.el lisp/simple.el lisp/sound.el lisp/startup.el lisp/subr.el src/ChangeLog src/EmacsFrame.c src/Makefile.in.in src/abbrev.c src/alloc.c src/buffer.c src/buffer.h src/bytecode.c src/bytecode.h src/callint.c src/callproc.c src/casetab.c src/casetab.h src/charset.h src/chartab.c src/chartab.h src/cmds.c src/console-msw.c src/console-msw.h src/console-tty.c src/console-x.c src/console-x.h src/console.c src/console.h src/data.c src/database.c src/device-gtk.c src/device-msw.c src/device-x.c src/device.c src/device.h src/dialog-msw.c src/doc.c src/doprnt.c src/dumper.c src/dynarr.c src/editfns.c src/eldap.c src/eldap.h src/elhash.c src/elhash.h src/emacs.c src/eval.c src/event-Xt.c src/event-gtk.c src/event-msw.c src/event-stream.c src/event-tty.c src/event-unixoid.c src/events.c src/events.h src/extents.c src/extents.h src/faces.c src/faces.h src/file-coding.c src/file-coding.h src/fileio.c src/filelock.c src/fns.c src/frame-gtk.c src/frame-msw.c src/frame-tty.c src/frame-x.c src/frame.c src/frame.h src/free-hook.c src/general-slots.h src/glyphs-eimage.c src/glyphs-gtk.c src/glyphs-msw.c src/glyphs-widget.c src/glyphs-x.c src/glyphs.c src/glyphs.h src/gpmevent.c src/gtk-xemacs.c src/gui-msw.c src/gui-x.c src/gui-x.h src/gui.c src/gui.h src/gutter.c src/gutter.h src/indent.c src/input-method-xlib.c src/insdel.c src/keymap.c src/keymap.h src/lisp-disunion.h src/lisp-union.h src/lisp.h src/lread.c src/lrecord.h src/lstream.c src/lstream.h src/marker.c src/menubar-gtk.c src/menubar-msw.c src/menubar-x.c src/menubar.c src/minibuf.c src/mule-canna.c src/mule-ccl.c src/mule-charset.c src/mule-wnnfns.c src/native-gtk-toolbar.c src/objects-msw.c src/objects-tty.c src/objects-x.c src/objects.c src/objects.h src/opaque.c src/opaque.h src/postgresql.c src/postgresql.h src/print.c src/process-unix.c src/process.c src/process.h src/rangetab.c src/rangetab.h src/redisplay-gtk.c src/redisplay-msw.c src/redisplay-output.c src/redisplay-tty.c src/redisplay-x.c src/redisplay.c src/scrollbar-gtk.c src/scrollbar-msw.c src/scrollbar-x.c src/scrollbar.c src/scrollbar.h src/search.c src/select-gtk.c src/select-x.c src/sound.c src/specifier.c src/specifier.h src/strftime.c src/symbols.c src/symeval.h src/syntax.h src/text.c src/text.h src/toolbar-common.c src/toolbar-msw.c src/toolbar.c src/toolbar.h src/tooltalk.c src/tooltalk.h src/ui-gtk.c src/ui-gtk.h src/undo.c src/unicode.c src/vm-limit.c src/window.c src/window.h
diffstat 186 files changed, 5536 insertions(+), 3295 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Mar 23 05:08:52 2002 +0000
+++ b/ChangeLog	Fri Mar 29 04:49:13 2002 +0000
@@ -1,3 +1,38 @@
+2002-03-28  Ben Wing  <ben@xemacs.org>
+
+	* etc/ChangeLog: New file.
+
+	Separated out all entries for etc/ into their own ChangeLog.
+	Includes entries for the following files:
+
+	etc/BABYL, etc/BETA, etc/CHARSETS, etc/DISTRIB, etc/Emacs.ad,
+	etc/FTP, etc/GNUS-NEWS, etc/GOATS, etc/HELLO, etc/INSTALL,
+	etc/MACHINES, etc/MAILINGLISTS, etc/MSDOS, etc/MYTHOLOGY, etc/NEWS,
+	etc/OXYMORONS, etc/PACKAGES, etc/README, etc/TUTORIAL,
+	etc/TUTORIAL.de, etc/TUTORIAL.ja, etc/TUTORIAL.ko, etc/TUTORIAL.se,
+	etc/aliases.ksh, etc/altrasoft-logo.xpm, etc/check_cygwin_setup.sh,
+	etc/custom/example-themes/europe-theme.el,
+	etc/custom/example-themes/ex-custom-file,
+	etc/custom/example-themes/example-theme.el, etc/e/eterm.ti,
+	etc/edt-user.doc, etc/enriched.doc, etc/etags.1, etc/gnuserv.1,
+	etc/gnuserv.README, etc/package-index.LATEST.gpg,
+	etc/package-index.LATEST.pgp, etc/photos/jan.png, etc/recycle.xpm,
+	etc/refcard.tex, etc/sample.Xdefaults, etc/sample.emacs,
+	etc/sgml/CATALOG, etc/sgml/HTML32.dtd, etc/skk/SKK.tut.E,
+	etc/smilies/Face_ase.xbm, etc/smilies/Face_ase2.xbm,
+	etc/smilies/Face_ase3.xbm, etc/smilies/Face_smile.xbm,
+	etc/smilies/Face_weep.xbm, etc/sounds, etc/toolbar,
+	etc/toolbar/workshop-cap-up.xpm, etc/xemacs-ja.1, etc/xemacs.1,
+	etc/yow.lines, etc\BETA, etc\NEWS, etc\README, etc\TUTORIAL,
+	etc\TUTORIAL.de, etc\check_cygwin_setup.sh, etc\sample.init.el,
+	etc\unicode\README, etc\unicode\mule-ucs\*, etc\unicode\other\*
+
+2002-03-24  Ben Wing  <ben@xemacs.org>
+
+	* TODO.ben-mule-21-5 (bugs):
+	* TODO.ben-mule-21-5 (Signaling): New.
+	Add stuff from Frank Schmitt.
+
 2002-03-20  Ben Wing  <ben@xemacs.org>
 
 	* TODO.ben-mule-21-5:
@@ -12,15 +47,6 @@
 	larger document, a "Getting Started with Developing XEmacs".  ####
 	Does such a document exist?
 
-	* etc\unicode\mule-ucs\*: New directory, containing translation
-	files for the remaining charsets that are not in
-	unicode\unicode-consortium but are in mule-ucs.
-
-	* etc\unicode\other\*: New directory, containing translation
-	files made up on an ad-hoc basis.
-
-	* etc\unicode\README: Update.
-
 2002-03-18  Ben Wing  <ben@xemacs.org>
 
 	* Some ChangeLog entries from stuff that got applied long ago
@@ -29,32 +55,11 @@
 
 2001-05-04  Ben Wing  <ben@xemacs.org>
 
-       * etc\check_cygwin_setup.sh (distdir): Update for current
-       Cygwin reality.
-
-       * etc\NEWS: Remove kill-whole-line changes.
-
-2001-05-04  Ben Wing  <ben@xemacs.org>
-
        * PROBLEMS:
        * PROBLEMS (Note):
        Correct general info about init file.
        Fix up Cygwin, Windows sections.
 
-2001-04-17  Ben Wing  <ben@xemacs.org>
-
-       * etc\NEWS: More changes.
-
-       * etc\sample.init.el (grep-all-files-in-current-directory-and-below):
-       Missing argument.
-
-2001-04-15  Ben Wing  <ben@xemacs.org>
-
-       * etc\NEWS:
-       * etc\NEWS (C):
-       * etc\NEWS (commands):
-       Many, many changes for XEmacs 21.4.
-
 2002-03-15  Ben Wing  <ben@xemacs.org>
 
 	* configure.in (XE_COMPUTE_RUNPATH):
@@ -82,19 +87,6 @@
 
 	* CHANGES-beta: Prune pre-21.5 information.
 
-2002-02-28  Stephen J. Turnbull  <stephen@xemacs.org>
-
-	* etc/TUTORIAL.se: New from Mats Lidell.
-
-2002-02-04  Stephen J. Turnbull  <stephen@xemacs.org>
-
-	* etc/BETA: General update.  Fix some broken URLs.
-
-2002-01-23  Jarl Friis  <jarl@diku.dk>
-
-	* etc/BETA (http): Informing of xemacs-patches mailing list. Added
-	note on patch etiquette.
-
 2002-01-07  Jan Vroonhof  <jan@xemacs.org>
 
 	* configure.in: Make explicit "--with-widgets" mean "=yes".
@@ -108,10 +100,6 @@
 
 	* aclocal.m4 (LTLD): Don't use "gcc", use the ld reported by gcc.
 
-2001-05-27  Kazuo Oishi  <oishi@n-pl.org>
-
-	* etc/xemacs-ja.1: Replace with new translation.
-
 2001-08-19  Charles Wilson  <cwilson@ece.gatech.edu>
 
 	* configure.in (for graphics libraries): Detect Cygwin xpm-nox.
@@ -141,20 +129,10 @@
 	* info/dir (File): Reword entry for Emodules according to
 	../man/emodules.texi.
 
-2001-12-29  Steve Youngs  <youngs@xemacs.org>
-
-	* etc/package-index.LATEST.gpg: Update.
-
-	* etc/package-index.LATEST.pgp: Update.
-
 2001-12-18  Adrian Aichner  <adrian@xemacs.org>
 
 	* info\.cvsignore: Correct pattern to match all info files.
 
-2001-12-18  Jan Vroonhof  <jan@xemacs.org>
-
-	* etc/photos/jan.png: Add mug shot.
-
 2001-12-16  Adrian Aichner  <adrian@xemacs.org>
 
 	* info\.cvsignore: Info files are generated, so let's ignore them
@@ -164,10 +142,6 @@
 
 	* info\dir (File): Update version to 21.5.
 
-2001-12-03  Didier Verna  <didier@xemacs.org>
-
-	* etc/NEWS: advertise `C-x r p' (replace-rectangle) in global map.
-
 2001-08-29  Jered Floyd  <jered@MIT.EDU>
 
 	* configure.in (moduledir,sitemoduledir,archlibdir):
@@ -215,16 +189,6 @@
 
 	* configure.in: Document that autoconf 2.5x is unsupported.
 
-2001-09-19  Ben Wing  <ben@xemacs.org>
-
-	* etc\TUTORIAL.de: Translate TERMINOLOGY section for TUTORIAL.de,
-	change menu entry separator from / to ->.  Change SPC to <Space>.
-
-2001-10-07  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc\TUTORIAL.de: Update of TUTORIAL.de according to Ben's
-	Updates and Syncing with Emacs 21.0.106.
-
 2001-09-17  Ben Wing  <ben@xemacs.org>
 
 	* configure.in (TAB):
@@ -240,10 +204,6 @@
 	* configure.in (XE_COMPUTE_RUNPATH): Fix compile problems when
 	compiling --with-msw, --with-x=no, --with-tty=no.
 
-2001-08-21  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc\BETA (writing): Advertise use of build-report.
-
 2001-09-07  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.3 "asparagus" is released.
@@ -261,17 +221,6 @@
 
 	* XEmacs 21.5.2 "artichoke" is released.
 
-2001-07-26  Stephen J. Turnbull  <stephen@xemacs.org>
-
-	* etc/MYTHOLOGY, etc/OXYMORONS: Remove.
-	etc/VEGETABLES: Copied from xemacs-builds module, file Codenames-21.5.
-	Bring codenames into synch with reality.
-
-2001-07-18  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc\TUTORIAL: Fix minor typo.
-	* etc\TUTORIAL.de: Sync with TUTORIAL.
-
 2001-06-21  Ben Wing  <ben@xemacs.org>
 
 	* README:
@@ -320,28 +269,6 @@
 
 	* configure.in: See if mkstemp is available for movemail.c
 
-2001-05-24  Yoshiki Hayashi  <yoshiki@xemacs.org>
-
-	* etc/xemacs-ja.1: Removed.
-
-2001-05-23  Ben Wing  <ben@xemacs.org>
-
-	* etc\sample.init.el:
-	* etc\sample.init.el (Init-safe-require): New.
-	* etc\sample.init.el ((fboundp 'pending-delete-mode)):
-	* etc\sample.init.el ((eq system-type 'windows-nt)):
-	* etc\sample.init.el (dired):
-	* etc\sample.init.el ((Init-safe-require 'efs-auto)):
-	* etc\sample.init.el (completer):
-	* etc\sample.init.el (crypt):
-	* etc\sample.init.el (filladapt):
-	* etc\sample.init.el ((fboundp 'turn-on-lazy-lock)):
-	* etc\sample.init.el ((fboundp 'resize-minibuffer-mode)):
-	* etc\sample.init.el ((Init-safe-require 'scroll-in-place)):
-	Rewrite to be much more careful about loading features -- now
-	it decays gracefully even in the complete absence of packages.
-	Also avoid doing obnoxious things when loading efs.
-
 2001-05-23  Ben Wing  <ben@xemacs.org>
 
 	* configure.in (AC_INIT_PARSE_ARGS):
@@ -359,16 +286,12 @@
 
 2001-05-10  Paul Stodghill  <stodghil@cs.cornell.edu>
 
-	* etc/PACKAGES: Update to reflect new package dir tree.
 	* configure.in: Reverse the order of Windows and Linux sound tests
 	so that	Cygwin will find Windows first.
 
 2001-05-14  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.in (XE_REALLOC_NULLPTR_BUG): New.
-2001-05-15  Steve Youngs  <youngs@xemacs.org>
-
-	* etc/PACKAGES: Update to reflect new package dir tree.
 
 2001-05-11  Martin Buchholz  <martin@xemacs.org>
 
@@ -391,10 +314,6 @@
 
 	* XEmacs 21.5.1 "anise" is released.
 
-2001-01-31  Jason R. Mastaler  <jason@xemacs.org>
-
-	* etc/FTP: Updated FTP mirrors list.
-
 2001-05-04  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.in (opsys):
@@ -410,55 +329,19 @@
 
 	* configure.in: Don't #define __STDC__ in confdefs.h
 
-2001-03-30  Ben Wing  <ben@xemacs.org>
-
-	* etc\sample.init.el:
-	* etc\sample.init.el (Init-kill-entire-line):
-	* etc\sample.init.el (describe-foo-at-point):
-	* etc\sample.init.el (kill-current-buffer):
-	* etc\sample.init.el (kill-current-buffer-and-window):
-	* etc\sample.init.el (grep-c-files): Removed.
-	* etc\sample.init.el (grep-all-files-history): New.
-	* etc\sample.init.el (grep-all-files-omitted-expressions): New.
-	* etc\sample.init.el (grep-all-files-omitted-directories): New.
-	* etc\sample.init.el (construct-grep-all-files-command): New.
-	* etc\sample.init.el (grep-all-files-in-current-directory): New.
-	* etc\sample.init.el (grep-lisp-files): Removed.
-	* etc\sample.init.el (grep-all-files-in-current-directory-and-below): New.
-	* etc\sample.init.el (clear-select):
-	* etc\sample.init.el ((control kp-add)):
-	* etc\sample.init.el (pause):
-	* etc\sample.init.el ((eq system-type 'windows-nt)):
-
-	Add documentation for defined functions.  Change grep functions to
-	be more generally useful.  Document more specifically what the
-	`menu-force' setting actually does -- what commands are overridden
-	and how to access them.
-
 2001-03-30  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* configure.usage:  Document --with-file-coding.
 
-	* etc/OXYMORONS: Add 2 oxymorons, clean up numbering, close RFC.
-
-	* etc/NEWS: Fix typo.
-
 	* configure.in:
 	* configure:
 	Fix typo, add -Wsign-compare if GCC, run autoconf.
 
 2001-03-23  Stephen J. Turnbull  <stephen@xemacs.org>
 
-	* etc/gnuserv.1 (UNIX_DOMAIN_SOCKETS:
 	* PROBLEMS (Problems with running XEmacs):
 	Document TMPDIR lossage in gnuserv/gnuclient.
 
-2001-03-06  Ben Wing  <ben@xemacs.org>
-
-	* etc\sample.init.el:
-	* etc\sample.init.el (Init-kill-entire-line): New.
-	Fix to take into account the removed kill-whole-line changes.
-
 2001-03-21  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.46 "Urania" is released.
@@ -477,10 +360,6 @@
 
 	* configure.usage: Untabify --with-{gtk,gnome}.
 
-2001-03-15  Stephen J. Turnbull  <stephen@xemacs.org>
-
-	* etc/OXYMORONS: New file of 21.4 codenames.
-
 2001-03-12  Andy Piper  <andy@xemacs.org>
 
 	* configure.in: only pick up mingw directory.
@@ -491,10 +370,6 @@
 	replace misnomer "Local Packages" with more correct "Other
 	Documentation".
 
-2001-03-02  Ben Wing  <ben@xemacs.org>
-
-	* etc\README: sample.emacs -> sample.init.el.
-
 2001-03-09  William M. Perry  <wmperry@aventail.com>
 
 	* CHANGES-beta:
@@ -521,10 +396,6 @@
 
 	* configure.in: No need for NON_GNU_CPP on SCO.
 
-2001-02-10  Martin Buchholz  <martin@xemacs.org>
-
-	* etc/MACHINES: Rewritten.  Bitrot discarded.
-
 2001-02-09  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.in: Prefer utime to utimes - it's more standard.
@@ -567,16 +438,12 @@
 
 2001-01-21  Steve Youngs  <youngs@xemacs.org>
 
-	* ./etc/PACKAGES: Doc fix.
-
 	* README.packages: Doc fix.
 
 2001-01-17  Steve Youngs  <youngs@xemacs.org>
 
 	* README.packages: Update.
 
-	* ./etc/PACKAGES: Update.
-
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.
@@ -679,8 +546,6 @@
 
 	* README.packages: Add "uninstalled package" FAQ.
 
-	* etc/PACKAGES: Add details on os-utils contents.
-
 2000-11-01  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.in: Handle alloca with Compaq C on Alpha Linux.
@@ -700,10 +565,6 @@
 	Add check for XRegisterIMInstantiateCallback.
 	Add check for XRegisterIMInstantiateCallback's prototype.
 
-2000-10-04  Yoshiki Hayashi  <yoshiki@xemacs.org>
-
-	* etc/NEWS: Change lprogress-display to progress-feedback.
-
 2000-10-08  Karl M. Hegbloom  <karlheg@debian.org>
 
 	* configure.in: Typo - missing paren.
@@ -722,10 +583,6 @@
 
 	* XEmacs 21.2.36 is released.
 
-2000-08-29  Robert Pluim  <rpluim@bigfoot.com>
-
-	*  etc/NEWS: fix reference to progress-feedback-use-echo-area
-
 2000-09-27  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.in: Big signal/process handling overhaul.
@@ -733,10 +590,6 @@
 	getpt _getpt grantpt unlockpt ptsname killpg tcgetpgrp
 	openpty pty.h libutil.h sys/stropts.h sys/strtio.h isastream
 
-2000-09-20  Martin Buchholz  <martin@xemacs.org>
-
-	* etc/xemacs.1: Spelling fixes.  Remove stuff that doesn't belong.
-
 2000-09-19  Martin Buchholz  <martin@xemacs.org>
 
 	* *: Spelling mega-patch
@@ -745,8 +598,6 @@
 
 	* configure.in: Remove strcasecmp.
 
-	* etc/Emacs.ad: Remove Energize from comments.
-
 2000-09-16  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.in: Add -Kalloca to $c_switch_system when using
@@ -776,10 +627,6 @@
 
 	* configure.in: Make Balloon Help conditional on finding shape.h
 
-2000-08-02  Stephen J. Turnbull <stephen@xemacs.org>
-
-	* etc/Emacs.ad: Document usage of FontSet resource for menubar.
-
 2000-08-09  Vin Shelton  <acs@xemacs.org>
 
 	* configure.in: Check for UNIX98 PTYs.  Patch from Florian Weimer
@@ -952,10 +799,6 @@
 
 	* configure.in: Remove lockdir.
 
-2000-04-15  Andy Piper  <andy@xemacs.org>
-
-	* etc/Emacs.ad: add select-start() back into text translations.
-
 2000-05-01  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.33 is released.
@@ -989,11 +832,6 @@
 
 	* configure.in: fix typo.
 
-2000-04-12  Andy Piper  <andy@xemacs.org>
-
-	* etc/Emacs.ad: give the gui-element face the same font as the
-	menubar and popups. Add translations for text widgets.
-
 2000-04-03  Yoshiki Hayashi  <yoshiki@xemacs.org>
 
 	* configure.in : Fix printing error check warning even if
@@ -1056,10 +894,6 @@
 	* aclocal.m4 (XE_SHLIB_STUFF): Define ld_shlibs to yes
 	when C compiler can produce shared libraries.
 
-2000-03-01  Didier Verna  <didier@xemacs.org>
-
-	* etc/NEWS: update the rect.el entry.
-
 2000-02-26  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.in: Unconditionally define SHELL, to allow working
@@ -1103,10 +937,6 @@
 
 	* configure.in: Test for arm simply using arm* instead of arm-*
 
-2000-01-05  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
-
-	* etc/TUTORIAL.ja: Synch with English version.
-
 2000-02-16  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.29 is released.
@@ -1201,10 +1031,6 @@
 
 	* XEmacs 21.2.27 is released.
 
-2000-01-15  Adrian Aichner  <aichner@ecf.teradyne.com>
-
-	* etc/TUTORIAL.de: Update copyright and fix typo.
-
 2000-01-14  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.in: Create a .dbxrc in the src directory, like .gdbinit.
@@ -1231,8 +1057,6 @@
 
 2000-01-03  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
-	* etc/NEWS: Document mail spool locking overhaul.
-
 	* configure.usage (--mail-locking):
 	* configure.in: Handle --mail-locking option correctly in
 	preparation for the movemail locking overhaul.
@@ -1340,10 +1164,6 @@
 	* configure.in (native_sound_lib, *-sgi-*): Check for audio.h.
 	(LIBS): Check for libCsup.
 
-	* etc/sample.Xdefaults: adds a reference to beNiceToColormap,
-	  so that the user can guess what to do if xemacs' dialogs are
-	  butt ugly.
-
 1999-10-24  Jan Vroonhof  <vroonhof@math.ethz.ch>
 
 	* config.h.in: define HAVE_ESD_SOUND
@@ -1370,16 +1190,6 @@
 	/usr/ccs/bin/ld: illegal option -- W
 
 
-1999-11-13  Jason R Mastaler  <jason@mastaler.com>
-
-	* etc/FTP: Updated FTP mirrors list.  Replaced GNU FTP document
- 	with a URL.
-
-1999-11-13  Jason R Mastaler  <jason@mastaler.com>
-
-	* etc/MAILINGLISTS: Updated mailing list subscription information.
-  	Replaced GNU MAILINGLISTS document with a URL.
-
 1999-11-10  XEmacs Build Bot <builds@cvs.xemacs.org>
 
 	* XEmacs 21.2.20 is released
@@ -1408,11 +1218,6 @@
 
 	* Makefile.in.in: use WINDOWSNT for mingw install.
 
-1999-08-01  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc/DISTRIB: Update IP address of ftp.xemacs.org.
-	* etc/NEWS: Fix typo
-
 1999-09-25  Andy Piper  <andy@xemacs.org>
 
 	* configure.in: check for Xaw3d and use in preference to Xaw
@@ -1489,17 +1294,6 @@
 
 	* configure.usage (--with-modules): Document it.
 
-1999-07-23  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-	* etc/custom/example-themes/example-theme.el:
-	* etc/custom/example-themes/europe-theme.el:
-	* etc/custom/example-themes/ex-custom-file: Some simple examples
-	illustrating the custom theme support.
-
-1999-07-17  MORIOKA Tomohiko  <tomo@etl.go.jp>
-
-	* etc/HELLO (Thai): Modify for new font.
-
 1999-07-22  SL Baur  <steve@beopen.com>
 
 	* configure.in: add sco7 support
@@ -1658,13 +1452,6 @@
 	* configure.in: add mingw32 as a target platform. add nt process
  	support options.
 
-1999-03-30  MORIOKA Tomohiko  <tomo@etl.go.jp>
-
-	* etc/HELLO (Amharic): New language.
-	(Slovak): Likewise.
-	(Thai): Likewise (by Virach Sornlertlamvanich).
-	(Greek): Fixed (by Yannis Haralambous).
-
 1998-09-04  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
 	* configure.in: Delete mule-coding.o.
@@ -1777,11 +1564,6 @@
 
 	* XEmacs 21.2.9 is released
 
-1999-02-01  Glynn Clements  <glynn@sensei.co.uk>
-
-	* etc/recycle.xpm: Fix colours so that they work on TrueColor
-	and DirectColor displays
-
 1999-01-21  Andy Piper  <andy@xemacs.org>
 
 	* configure.in: make xface detection specifc to a window system in
@@ -1909,10 +1691,6 @@
 	* configure.in: don't enable shared lib support for cygwin unless
 	explititly told to.
 
-1998-10-02  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
-
-	* etc/xemacs.1: Remove misplace "\".
-
 1998-09-29  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 21.2-beta2 is released.
@@ -1936,18 +1714,6 @@
 	* configure.in: Better detection of AIX 4.3.
 	AIX xlc can do -g and -Ox at the same time.
 
-1998-09-05  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/check_cygwin_setup.sh: grammar fix.
-
-1998-09-02  Andy Piper  <andyp@parallax.co.uk>
-
-	* etc/check_cygwin_setup.sh: fix a couple of buglets.
-
-1998-08-23  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc/sample.emacs: Enable sound support on mswindows devices.
-
 1998-08-17  P. E. Jareth Hein  <jareth@camelot.co.jp>
 
 	* configure.in: Alter configure so that it checks for mismatched PNG
@@ -1955,14 +1721,6 @@
 	conditions for both PNG and XPM, stop screaming if png is not found and
 	no window-system is selected, and fixed a bug in the XPM checking.
 
-1998-08-06  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc/TUTORIAL.de: Fixing typos and grammatical errors.  Fixing
-	inconsistent usage of RET, <Return>, and <return> (only using
-	<Return> now).  Changing TUTORIAL to TUTORIAL.de throughout
-	itself.  Adding english equivalent to german translation of all
-	concepts used in TUTORIAL.de.
-
 1998-08-07  P. E. Jareth Hein  <jareth@camelot.co.jp>
 
 	* configure.usage (--without-gif): Modify text to reflect status
@@ -2010,15 +1768,11 @@
 
 1998-07-12  SL Baur  <steve@altair.xemacs.org>
 
-	* etc/GOATS: Removed.
-
 	* README: Bump version numbers.
 	* info/dir: Ditto.
-	* etc/README: Ditto.
-	* etc/NEWS: Ditto and purge pre-21.0 stuff.
 	* version.sh: Ditto.
 
-	* XEmacs 21.0-pre5 is released.
+ 	* XEmacs 21.0-pre5 is released.
 
 1998-07-10  SL Baur  <steve@altair.xemacs.org>
 
@@ -2033,51 +1787,19 @@
 
 	* configure.in: Fix test for InfoDock sources.
 
-	* etc/BETA (writing): Update patch creation instructions.
-
-	* etc/FTP: Update FTP mirror list.
-
-	* etc/DISTRIB: Remove duplicated FTP mirror list.
-	* etc/xemacs.1 (ftp): Ditto.
-
 1998-07-09  Oliver Graf <ograf@fga.de>
 
 	* configure.usage: added warning to --with-offix
 
-1998-06-29  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/gnuserv.1 (this): Email address for Ben Wing is ben@xemacs.org.
-	* etc/gnuserv.README (README): Ditto.
-	* etc/xemacs-ja.1: Ditto.
-
 1998-06-28  SL Baur  <steve@altair.xemacs.org>
 
 	* configure.in: Berkeley DB autodetection fixes
 	From Martin Buchholz <martin@xemacs.org>
 
-	* etc/BABYL: Moved to rmail package
-
-	* etc/enriched.doc: Moved to xemacs-base package
-
-	* etc/MSDOS:
-	* etc/GNUS-NEWS: deleted
-
-1998-06-21  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-	* etc/NEWS: Added references to documentation about packages and
-	path setup.
-
-	* etc/README: Synched.
-
 1998-06-19  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 21.0-pre3 is released.
 
-1998-06-20  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-	* etc/PACKAGES:
-	* etc/BETA: Moved some package stuff into Texinfo docs.  Other nitpicks
-
 1998-06-20  Kazuyuki IENAGA <ienaga@jsys.co.jp>
 
 	* configure.in: Added check if the berkdb has db_open or not.
@@ -2095,12 +1817,6 @@
 
 	* XEmacs 21.0-pre1 is released.
 
-1998-06-14  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
-
-	* etc/NEWS: Updated information about customization of the
-	automatic info dir file generation using
-	`Info-auto-generate-directory' and `Info-save-auto-generated-dir'
-
 1998-06-11  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 21.0-beta43 is released.
@@ -2118,11 +1834,6 @@
 	* tests/Dnd/droptest.el: extra start-drag-region function
 	changed the experimental- stuff
 
-1998-06-02  Andy Piper  <andyp@parallax.co.uk>
-
-	* etc/check_cygwin_setup.sh: set more intelligent defaults for
-	windows 95.
-
 1998-06-07  SL Baur  <steve@altair.xemacs.org>
 
 	* lwlib/xlwmenu.c: Add room for the 0 byte sentinel.
@@ -2135,15 +1846,10 @@
 
 	* XEmacs 21.0-beta42 is released.
 
-	* etc/sounds: Removed, now in the sounds-au package.
-
 1998-05-29  Andy Piper  <andyp@parallax.co.uk>
 
 	* configure.in: don't use -O3 for cygwin.
 
-	* etc/check_cygwin_setup.sh: new file to check that cygwin is setup
-	correctly for XEmacs operation.
-
 1998-05-28  P. E. Jareth Hein  <jareth@camelot-soft.com>
 
 	* configure.in: Switch from giflib to gifreader for
@@ -2253,10 +1959,6 @@
 	* tests/Dnd/README: created, info about new protocol
 	* tests/Dnd/dragtest.el: comment change
 
-1998-05-07  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/altrasoft-logo.xpm: Removed.
-
 1998-05-02  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 21.0-beta38 is released.
@@ -2279,11 +1981,6 @@
 	CPPFLAGS was being set correctly in ${subdir}/Makefiles and
 	overridden by the empty one set in the toplevel Makefile.
 
-1998-04-26  Jason R Mastaler  <jason@4b.org>
-
-	* etc/BETA: Replaced SmartList references in favor of
-	Majordomo.
-
 1998-04-25  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs-21.0-beta37 is released.
@@ -2329,8 +2026,6 @@
 
 1998-04-19  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
 
-	* etc/NEWS: Documented info dir rebuilding and LDAP support.
-
 	* info/dir: Fixed the explanatory notes for
 	`Info-default-directory-list' removal and the new automatic dir
 	rebuilding facility.  Reindented the menu.  Added an entry for
@@ -2380,10 +2075,6 @@
 
 1998-04-11  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
-	* etc/xemacs.1: -no-packages -> -no-early-packages.
-
-	* etc/NEWS: Clarified site-lisp status.
-
 	* configure.in: Re-instated src/paths.h generation from
 	src/paths.h.in.
 
@@ -2396,9 +2087,6 @@
 
 1998-04-10  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
-	* etc/NEWS: Documented that Info-default-directory-list and
-	site-directory are gone.
-
 	* configure.usage: Clarified --package-path documentation.
 
 1998-04-07  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
@@ -2626,13 +2314,6 @@
 	tagbits and indexed lrecords.
 	Suggested by Andreas Jaeger <aj@arthur.rhein-neckar.de>
 
-1998-03-09  Kyle Jones  <kyle_jones@wonderworks.com>
-
-	* etc/Emacs.ad: Example using leading dot resources to
-	  initalize faces changes to use Emacs.foo since the
-	  leading dot syntax doesn't work.  Initialization of
-	  text-cursor face moved to faces.el.
-
 1998-03-07  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.5-beta30 is released.
@@ -2656,9 +2337,6 @@
 	for special required linker flags for building DLL capable
 	binaries.
 
-	* etc/Emacs.ad: Remove explicit `Emacs' application resource
-	name.
-
 1998-02-28  SL Baur  <steve@altair.xemacs.org>
 
 	* Makefile.in (top_distclean): Remove Installation.el.
@@ -2764,27 +2442,10 @@
 
 	* XEmacs 20.5-beta23 is released.
 
-1998-02-01  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/aliases.ksh: igrep from the shell command line.
-	From Karl M. Hegbloom <karlheg@bittersweet.inetarena.com>
-
-1998-01-31  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/aliases.ksh: Add `mak' function to create beta.err for
-	build-report.
-	From Adrian Aichner <adrian@xemacs.org>
-	Suggested by Karl M. Hegbloom <karlheg@bittersweet.inetarena.com>
-
 1998-01-27  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.5-beta22 is released.
 
-1998-01-26  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/aliases.ksh: New file.  Start tracking useful Maintainer
-	XEmacs commands.
-
 1998-01-25  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.5-beta21 is released.
@@ -2804,13 +2465,8 @@
 1998-01-13  Martin Buchholz  <martin@xemacs.org>
 
 	* configure.usage:
-	* etc/NEWS:
 	Remove doc for configure-time INFOPATH, no longer used.
 
-	* etc/BETA: Update ftp addresses.
-	* etc/INSTALL: Update ftp addresses.
-	* etc/MAILINGLISTS: Sync with Emacs 20.2. Update ftp addresses.
-
 	* configure.in:
 	* src/config.h.in:
 	Define HAVE_INVERSE_HYPERBOLIC using 1 configure test, not 3.
@@ -2826,8 +2482,6 @@
 	Prepend LWLIB_ to (SCROLLBARS|MENUBARS|DIALOGS)_(MOTIF|LUCID|ATHENA).
 	Maintain only one set of variables.
 
-	* etc/xemacs.1: Update author list.
-
 	* Makefile.in (install-arch-dep): Simplify.
 	Replace construct  `test -d $dir && foo'  with
 	`if test -d $dir; then foo; fi'
@@ -2853,8 +2507,6 @@
 
 	* XEmacs 20.5-beta18 is released.
 
-	* etc/FTP: Update address of what was formerly ftp.ibp.fr.
-
 1998-01-08  Didier Verna  <didier@xemacs.org>
 
 	* configure.in: Get rid of INFOPATH for configure time.
@@ -2916,11 +2568,6 @@
 
 	* XEmacs 20.5-beta13 is released.
 
-1997-12-21  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/BETA (Prerequisite): Add cookbook procedures for maintaining
-	package lisp directories.
-
 1997-12-20  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.5-beta 12 is released.
@@ -2930,26 +2577,12 @@
 	* configure.in (bitmapdir): Reenable --with-session by default for
 	testing.
 
-1997-12-18  Kyle Jones  <kyle_jones@wonderworks.com>
-
-	* etc/Emacs.ad: Don't specify a default toolbar specific
-	  background color.
-
-1997-12-18  Kyle Jones  <kyle_jones@wonderworks.com>
-
-	* etc/toolbar: Added support for foregroundToolBarColor
-	  symbol to most icons.
-
 1997-12-17  SL Baur  <steve@altair.xemacs.org>
 
 	* info/dir (File): Skk and Gnats are packaged.
 
 	* PROBLEMS (Note): Update version numbers.
 
-	* etc/BETA: Update version numbers.
-
-	* etc/NEWS: Update version number.
-
 	* info/dir (File): Update version number.
 
 1997-12-16  SL Baur  <steve@altair.xemacs.org>
@@ -3008,10 +2641,6 @@
 	  motif menubars to at least compile.  Motif menubars are still
 	  very broken.
 
-1997-12-05  Aki Vehtari  <Aki.Vehtari@hut.fi>
-
-	* etc/refcard.tex: Updated for 20.3
-
 1997-12-02  P E Jareth Hein  <jareth@camelot-soft.com>
 
 	* lwlib/xlwscrollbar.c: fixed colormap/visual handling to work
@@ -3021,10 +2650,6 @@
 	the information in the core, and fixed a potental problem with
 	parentage.
 
-1997-12-02  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/skk/SKK.tut.E (Hint): Fix typos.
-
 1997-12-01  SL Baur  <steve@altair.xemacs.org>
 
 	* configure.in (with_session): Properly display flag in configure
@@ -3090,11 +2715,6 @@
 	* PROBLEMS: Removed IRIX entry about xemacs core dumps when using
 	xemacs dumped on one machine on another. Problem was fixed by 20.3.
 
-1997-11-19  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/xemacs.1: Document -no-packages, -vanilla.
-	Document -h.
-
 1997-11-18  SL Baur  <steve@altair.xemacs.org>
 
 	* configure.usage: New file.
@@ -3187,58 +2807,10 @@
 	* lwlib/lwlib-Xm.c(update_one_menu_entry): Add missing variable.
 	From Skip Montanaro <skip@calendar.com>
 
-1997-11-04  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc/TUTORIAL.de:
-	Updated copyright information. Translated most of the COPYING
-	section. Translated the <<.*>> didactic line.
-
-1997-10-22  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc/TUTORIAL.de: Fixed two issues reported by
-	Achim Oppelt <aoppelt@theorie3.physik.uni-erlangen.de>
-
-	* etc/TUTORIAL.de:
-	Manually applied rejected patch hunks from Marc Aurel's patch.
-	Some more fixes.
-
-	* etc/TUTORIAL.de:
-	Applied patches supplied by Marc Aurel <4-tea-2@bong.saar.de>.
-	They fix yet more typos and quite a few awkward sentences.
-
-1997-10-21  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc/TUTORIAL.de: Manually merged a few more corrections by
-	Carsten Leonhardt <leo@arioch.oche.de>
-
-1997-10-20  Adrian Aichner  <adrian@xemacs.org>
-
-	* etc/TUTORIAL.de:
-	Applied patches from Andreas Jaeger <aj@arthur.rhein-neckar.de> to 1.2,
-	then merged them with 1.3 via ediff-buffers.
-	Andreas found some quite nasty typos still and added many missing commas.
-
-	* etc/TUTORIAL.de: Re-fill-ed paragraphs after patching.
-
-	* etc/TUTORIAL.de: Applied the excellent patches courtesy of
-	Carsten Leonhardt <leo@arioch.oche.de>.
-
 1997-11-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
 	* Delete etc/TUTORIAL.th because Thai is not supported yet.
 
-1997-11-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
-
-	* etc/TUTORIAL.ko: Renamed from etc/TUTORIAL.kr to fit with ISO
-	639 (two letter language code).
-
-	* etc/TUTORIAL.ja: Renamed from etc/TUTORIAL.jp to fit with ISO
-	639 (two letter language code).
-
-1997-11-02  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/CHARSETS:  New file imported from Emacs 20.1.
-
 1997-11-02  Kyle Jones  <kyle_jones@wonderworks.com>
 
 	* lwlib/lwlib-Xaw.c (xaw_pop_instance): Don't use parent
@@ -3267,9 +2839,6 @@
 
 1997-10-30  Kyle Jones  <kyle_jones@wonderworks.com>
 
-	* etc/Emacs.ad: Added *XlwMenu*highlightForeground entry.
-	  Added *XlwMenu*titleForeground entry.
-
 	* lwlib/xlwmenu.h: Added string macro declarations for
 	  titleForeground and highlightForeground properties.
 
@@ -3280,12 +2849,6 @@
 	  for the new titleForeground and highlightForeground
 	  properties.
 
-1997-10-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
-
-	* etc/HELLO: Add Czech.
-
-	* etc/HELLO: Delete Amharic, Thai and Tigrigna.
-
 1997-10-28  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.3-beta94 is released.
@@ -3344,10 +2907,6 @@
 
 	* XEmacs 20.3-beta91 is released.
 
-1997-10-16  Hrvoje Niksic <hniksic@srce.hr>
-
-	* etc/NEWS:  document changed package load semantics.
-
 1997-10-15  Olivier Galibert  <olivier.galibert@mines.u-nancy.fr>
 
 	* configure.in: Removed -Olimit=2000 from cc for IRIX.
@@ -3386,10 +2945,6 @@
 
 	* info/dir: Cosmetic changes to info/dir
 
-1997-10-13  Hrvoje Niksic  <hniksic@srce.hr>
-
-	* etc/NEWS: Updates
-
 1997-10-12  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.5-beta1 is released.
@@ -3414,8 +2969,6 @@
  	and lockdir
 	* '' added a line to the report for infopath and lockdir
 
-	* etc/NEWS: Draft entry for the info changes.
-
 1997-10-10  Karl M. Hegbloom  <karlheg@inetarena.com>
 
 	* Makefile.in.in (INFOPATH): Added variable and put it into
@@ -3431,17 +2984,6 @@
 
 	* Makefile.in: Add `make configure' target
 
-	* etc/BETA:
-	  - remove Chuck as contact name
-	  - random small improvements
-	  - remove I/me references - the message should be that XEmacs
-	    maintenance is an inclusive community effort.
-
-1997-10-10  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/BETA (Prerequisite): Add further documentation for
-	package installation.
-
 1997-10-07  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 19.16-pre7 is released.
@@ -3500,10 +3042,6 @@
 	* Makefile.in (install-arch-dep): Install the `Installation' for
 	future reference.
 
-	* etc/BETA: Document existence of `Installation' file.
-	- Document requirement of rebuilding finder-inf.el when building
-	from the full tarball.
-
 	* Makefile.in (top_distclean): Remove finder-inf.el*.
 
 	* configure.in (use_union_type): Default to "yes".
@@ -3525,11 +3063,6 @@
 
 	* Makefile.in (custom-loads): New target.
 
-1997-09-24  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/BETA (XEmacs 20.3 packages): Added explanation of package
-	hierarchy.
-
 1997-09-23  SL Baur  <steve@altair.xemacs.org>
 
 	* lwlib/xlwmenu.c: Fix compilation problem with USE_XFONTSET.
@@ -3547,11 +3080,6 @@
 
 	* XEmacs 19.16-pre3 is released.
 
-1997-09-18  Colin Rafferty  <craffert@ml.com>
-
-	* etc/NEWS: Various spelling corrections and some grammar
-		  corrections (which/that).
-
 1997-09-19  Martin Buchholz  <mrb@eng.sun.com>
 
 	* src/redisplay-tty.c: Fix crashes with non-7bit tty escape
@@ -3650,18 +3178,10 @@
 
 	* XEmacs 20.3-beta18 is released.
 
-1997-08-11  Karl M. Hegbloom  <karlheg@inetarena.com>
-
-	* etc/NEWS: add a section telling about the Info changes.
-
 1997-08-09  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.3-beta17 is released.
 
-1997-08-07  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-	* etc/gnuserv.1: Described Hrvoje's mods in manpage
-
 1997-08-09  Martin Buchholz  <mrb@eng.sun.com>
 
 	* configure.in:
@@ -3696,10 +3216,6 @@
 	* src/s/freebsd.h: Wrap #include X11/Xlocale.h inside #ifndef
 	NOT_C_CODE
 
-1997-07-27  SL Baur  <steve@altair.xemacs.org>
-
-	* etc/BETA: Update patching instructions.
-
 1997-07-26  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.3-beta15 is released.
@@ -3976,9 +3492,6 @@
 
 	* lib-src/update-autoloads.sh: Search lisp/mule/.
 
-	* etc/HELLO: final byte for ethiopic was changed to sync with
-	Emacs/mule-19.34.94-zeta.
-
 	* lisp/x11/x-menubar.el: Fix "Describe language support" and "Set
 	language environment" of Mule menu.
 
@@ -4022,10 +3535,6 @@
 
 	(quail-map-p): Use `characterp' instead of `integerp'.
 
-1997-06-23  Steven L Baur  <steve@altair.xemacs.org>
-
-	* etc/NEWS (Commands): Various updates by Hrvoje Niksic.
-
 1997-06-21  Steven L Baur  <steve@altair.xemacs.org>
 
 	* Makefile.in: Missing FRC.info.
@@ -4039,11 +3548,6 @@
 	* lwlib/lwlib-Xaw.c, lwlib/lwlib-Xlw.c, lwlib/lwlib-Xm.c,
 	lwlib/lwlib.c:  Make 64 bit clean.
 
-1997-06-20  Steven L Baur  <steve@altair.xemacs.org>
-
-	* etc/gnuserv.1: Updates and cleanup.
-	From Hrvoje Niksic <hniksic@srce.hr>
-
 1997-06-19  Martin Buchholz  <mrb@eng.sun.com>
 
 	* configure.in:
@@ -4076,11 +3580,6 @@
 
 	* XEmacs 20.3-beta7 is released.
 
-1997-06-12  Steven L Baur  <steve@altair.xemacs.org>
-
-	* etc/TUTORIAL (things): Synched by Hrvoje Niksic with previous
-	XEmacs version.
-
 1997-06-13  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
 	* lisp/gnus/smiley.el (smiley-deformed-regexp-alist): Modify
@@ -4183,12 +3682,6 @@
 	iso-8859-1, hz-gb-2312, cn-gb-2312, gb2312, cn-big5 and koi8-r
 	were defined as coding-system.
 
-1997-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
-
-	* etc/smilies/Face_smile.xbm, etc/smilies/Face_weep.xbm,
-	etc/smilies/Face_ase2.xbm, etc/smilies/Face_ase3.xbm,
-	etc/smilies/Face_ase.xbm: Add Japanese smiley faces.
-
 1997-06-07  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
 	* lisp/gnus/smiley.el (smiley-deformed-regexp-alist): Add Japanese
@@ -4220,11 +3713,6 @@
 
 	* XEmacs 20.3-b5 is released.
 
-1997-06-08  Steven L Baur  <steve@altair.xemacs.org>
-
-	* etc/NEWS: Updates for early beta20.3 stuffs.
-	From Hrvoje Niksic <hniksic@srce.hr>
-
 1997-06-05  Steven L Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.3-b4 is released.
@@ -4250,8 +3738,6 @@
 	* lib-src/Makefile.in.in: Remove unused -DCONFIG_BROKETS flag
 	- Fix up compile flags for new etags version
 
-	* etc/NEWS:
-	* etc/etags.1:
 	* man/xemacs/programs.texi:
 	* lib-src/etags.c:  Upgraded to etags 12.11
 
@@ -4441,10 +3927,6 @@
 
 	* configure.in: Delete mocklisp support.
 
-	* etc/FTP: Update mirror info.
-
-	* etc/DISTRIB: Update mirror info.
-
 1997-05-29  Martin Buchholz  <mrb@eng.sun.com>
 
 	* configure.in: Replace standard Autoconf MMAP test with Neal
@@ -4467,12 +3949,6 @@
 	Fix conditional creation of gdbinit.
 	Conditionally create .sbinit for Sunpro C.
 
-1997-05-26  Steven L Baur  <steve@altair.xemacs.org>
-
-	* etc/FTP: Correct typo in ftp.cenatls.cena.dgac.fr.
-
-	* etc/DISTRIB: Ditto.
-
 1997-05-22  Steven L Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.3-beta2 is released.
@@ -4500,10 +3976,6 @@
 	dynodump.  Remove core when cleaning.  Remove config.log.
 	make distclean now functional.
 
-Tue Jun  4 10:15:54 1996  Per Bothner  <bothner@deneb.cygnus.com>
-
-	* etc/e/eterm.ti:  Add kcub1, kcuf1, kcuu1, kcud1 capabilities.
-
 Sun May 18 13:03:20 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* lwlib/Makefile.in.in (distclean): Clean up config.h.
@@ -4519,8 +3991,6 @@
 
 	* info/dir (Packages): Update minor version number.
 
-	* etc/README: Update minor version number.
-
 	* README: Update minor version number.
 
 Tue May 13 20:35:52 1997  Steven L Baur  <steve@altair.xemacs.org>
@@ -4554,11 +4024,6 @@
 
 	* configure.in (beta): OPENWINHOME misspelled.
 
-Mon Apr 21 14:48:29 1997  Steven L Baur  <steve@altair.xemacs.org>
-
-	* etc/BETA (writing): Update with information about how to create
-	patches.
-
 Sat Apr 19 16:13:16 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.2-b1 is released.
@@ -4649,10 +4114,6 @@
 
 	* XEmacs 19.15-b104 is released.
 
-Sat Mar 22 19:56:36 1997  Steven L Baur  <steve@altair.xemacs.org>
-
-	* etc/sgml/CATALOG: Default to html-3.2final.
-
 Sat Mar 22 17:55:15 1997  Darrell Kindred  <dkindred@cmu.edu>
 
 	* configure.in (beta): Add configure support for the -rpath flag
@@ -4697,8 +4158,6 @@
 	* XEmacs-20.1-b7 is released.
 	* XEmacs-19.15-b99 is released.
 
-	* etc/sgml/CATALOG: Added IE3 DTDs and htmlpro DTD.
-
 Thu Mar 13 10:40:11 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* configure.in: Add sunos4-1-4 header files.
@@ -4746,11 +4205,6 @@
 	* Makefile.in (distclean): Create lock and site-lisp directories
 	when they don't exist (after being pruned by CVS).
 
-Tue Mar  4 00:41:38 1997  Hrvoje Niksic  <hniksic@srce.hr>
-
-	* etc/sample.Xdefaults: Added customization of foreground and
-	background colors for the `default' face.
-
 Wed Feb 26 22:12:12 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* Makefile.in (top_distclean): Reset src/PURESIZE.h for
@@ -4768,8 +4222,6 @@
 
 Fri Feb 21 22:29:51 1997  Martin Buchholz  <mrb@eng.sun.com>
 
-	* etc/toolbar/workshop-cap-up.xpm:  Moved caption up one pixel.
-
 	* lwlib/xlwscrollbar.c : Fix many scrollbar bugs:
 	- "knob" renamed to "slider"
 	- leftmost pixel wasn't sensitive to button clicks, while righmost
@@ -4858,8 +4310,6 @@
 	* configure.in (beta): Add LWLIB_USES_ATHENA for odd
 	configurations that use both Motif and Athena.
 
-	* etc/sgml/HTML32.dtd: html-3.2 final dtd added.
-
 Wed Jan 15 12:55:19 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* info/dir (Gnus): Updated spelling and info.
@@ -4875,9 +4325,6 @@
 
 Sat Jan 11 12:05:31 1997  Steven L Baur  <steve@altair.xemacs.org>
 
-	* etc/sample.emacs: Remove code snippet that wipes out the cycle
-	buffer modeline feature.
-
 	* XEmacs 20.0 beta90 (prerelease 1) is released.
 	* XEmacs 19.15 beta90 (prerelease 1) is released.
 
@@ -4956,8 +4403,6 @@
 	* Makefile.in: replace list of info files with *.info* - one less
 	  maintenance headache
 
-	* etc/sample.emacs: Add sample code to highlight continuation glyph
-
 	* man/oo-browser.texi: Fix TeXability
 
 	* man/hyperbole.texi: Fix TeXability
@@ -5018,8 +4463,6 @@
 	* lib-src/update-elc.sh: XEmacs sometimes re-byte-compiled elisp
 	  files in dirs that have their own Makefiles.
 
-
-
 Sun Dec 29 17:02:49 1996  Steven L Baur  <steve@altair.xemacs.org>
 
 	* Makefile.in (install-arch-indep): Force compression with `gzip -f'.
@@ -5034,10 +4477,6 @@
 	* XEmacs 20.0 beta 33 is released.
 	* XEmacs 19.15 beta 6 is released.
 
-Fri Dec 27 20:34:58 1996  Richard Mlynarik  <mly@adoc.xerox.com>
-
-	* etc/yow.lines: 20k of new zippy quotes.
-
 Fri Dec 27 01:02:41 1996  Martin Buchholz  <mrb@eng.sun.com>
 
 	* Makefile.in (install-arch-indep): Simplify installation of info
@@ -5085,10 +4524,6 @@
 
 	* configure.in: Configure for POSIX getcwd if available.
 
-Thu Dec  5 20:42:35 1996  Steven L Baur  <steve@altair.xemacs.org>
-
-	* etc/edt-user.doc (File): New file from Emacs 19.34.
-
 Thu Dec  5 11:56:05 1996  Joseph J Nuspl <nuspl@nvwls.cc.purdue.edu>
 
 	* configure.in (LIBS): Fix typo in dialog box test.
--- a/TODO.ben-mule-21-5	Sat Mar 23 05:08:52 2002 +0000
+++ b/TODO.ben-mule-21-5	Fri Mar 29 04:49:13 2002 +0000
@@ -9,11 +9,32 @@
    the screen won't get off the startup, key commands don't cause anything
    to happen. STATUS: In progress.
 
--- Problem loading mule-ucs/reldata/iso8859-6.el or the languages/hebrew.el
-   file from GNU 21 sources.  Probably the escape sequences specify reverse
-   direction and we can't handle that yet.
+-- Memory ballooning in some cases.  Not yet understood.
+
+-- Occasional crash when freeing display structures.  The problem seems to
+   be this: A window has a "display line dynarr"; each display line has a
+   "display block dynarr".  Sometimes this display block dynarr is getting
+   freed twice.  It appears from looking at the code that sometimes a
+   display line from somewhere in the dynarr gets added to the end -- hence
+   two pointers to the same display block dynarr.  need to review this
+   code.
+
+-- md5 doesn't work. (Lstream not open errors) Causes w3 to fail.
 
--- Memory ballooning in some cases.  Not yet understood.
+-- other test suite failures?
+
+-- need to review the handling of sounds.  seems that not everything is
+   documented, not everything is consistently used where it's supposed to,
+   some sounds are ugly, etc.  add sounds to `completer' as well.
+
+-- redo with-trapping-errors so that the backtrace is stored away and only
+   outputted when an error actually occurs (i.e. in the condition-case
+   handler).  test. (use ding of various sorts as a helpful way of checking
+   out what's going on.)
+
+-- problems with process input: |uniq (for example) leaves ^M's at end of
+   line.
+
 
 August 29, 2001.
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/ChangeLog	Fri Mar 29 04:49:13 2002 +0000
@@ -0,0 +1,1483 @@
+2002-03-25  Ben Wing  <ben@xemacs.org>
+
+	* unicode/unicode-consortium/8859-16.TXT:
+	New file.
+
+2002-03-24  Ben Wing  <ben@xemacs.org>
+
+	* DISTRIB:
+	* DISTRIB (donation): Removed.
+	Eliminate FSF distribution information; we're not FSF.
+
+2002-03-18  Ben Wing  <ben@xemacs.org>
+
+	* unicode\mule-ucs\*: New directory, containing translation
+	files for the remaining charsets that are not in
+	unicode\unicode-consortium but are in mule-ucs.
+
+	* unicode\other\*: New directory, containing translation
+	files made up on an ad-hoc basis.
+
+	* unicode\README: Update.
+
+2001-05-04  Ben Wing  <ben@xemacs.org>
+
+       * check_cygwin_setup.sh (distdir): Update for current
+       Cygwin reality.
+
+       * NEWS: Remove kill-whole-line changes.
+
+2001-04-17  Ben Wing  <ben@xemacs.org>
+
+       * NEWS: More changes.
+
+       * sample.init.el (grep-all-files-in-current-directory-and-below):
+       Missing argument.
+
+2001-04-15  Ben Wing  <ben@xemacs.org>
+
+       * NEWS:
+       * NEWS (C):
+       * NEWS (commands):
+       Many, many changes for XEmacs 21.4.
+
+2002-03-05  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* XEmacs 21.5.5 "beets" is released.
+
+2002-02-28  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* TUTORIAL.se: New from Mats Lidell.
+
+2002-02-04  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* BETA: General update.  Fix some broken URLs.
+
+2002-01-23  Jarl Friis  <jarl@diku.dk>
+
+	* BETA (http): Informing of xemacs-patches mailing list. Added
+	note on patch etiquette.
+
+2002-01-08  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* XEmacs 21.5.4 "bamboo" is released.
+
+2001-05-27  Kazuo Oishi  <oishi@n-pl.org>
+
+	* xemacs-ja.1: Replace with new translation.
+
+2001-12-29  Steve Youngs  <youngs@xemacs.org>
+
+	* package-index.LATEST.gpg: Update.
+
+	* package-index.LATEST.pgp: Update.
+
+2001-12-18  Jan Vroonhof  <jan@xemacs.org>
+
+	* photos/jan.png: Add mug shot.
+
+2001-12-03  Didier Verna  <didier@xemacs.org>
+
+	* NEWS: advertise `C-x r p' (replace-rectangle) in global map.
+
+2001-09-19  Ben Wing  <ben@xemacs.org>
+
+	* TUTORIAL.de: Translate TERMINOLOGY section for TUTORIAL.de,
+	change menu entry separator from / to ->.  Change SPC to <Space>.
+
+2001-10-07  Adrian Aichner  <adrian@xemacs.org>
+
+	* TUTORIAL.de: Update of TUTORIAL.de according to Ben's
+	Updates and Syncing with Emacs 21.0.106.
+
+2001-08-21  Adrian Aichner  <adrian@xemacs.org>
+
+	* BETA (writing): Advertise use of build-report.
+
+2001-09-07  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* XEmacs 21.5.3 "asparagus" is released.
+
+2001-07-28  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* XEmacs 21.5.2 "artichoke" is released.
+
+2001-07-26  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* MYTHOLOGY, etc/OXYMORONS: Remove.
+	etc/VEGETABLES: Copied from xemacs-builds module, file Codenames-21.5.
+	Bring codenames into synch with reality.
+
+2001-07-18  Adrian Aichner  <adrian@xemacs.org>
+
+	* TUTORIAL: Fix minor typo.
+	* TUTORIAL.de: Sync with TUTORIAL.
+
+2001-05-24  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+	* xemacs-ja.1: Removed.
+
+2001-05-23  Ben Wing  <ben@xemacs.org>
+
+	* sample.init.el:
+	* sample.init.el (Init-safe-require): New.
+	* sample.init.el ((fboundp 'pending-delete-mode)):
+	* sample.init.el ((eq system-type 'windows-nt)):
+	* sample.init.el (dired):
+	* sample.init.el ((Init-safe-require 'efs-auto)):
+	* sample.init.el (completer):
+	* sample.init.el (crypt):
+	* sample.init.el (filladapt):
+	* sample.init.el ((fboundp 'turn-on-lazy-lock)):
+	* sample.init.el ((fboundp 'resize-minibuffer-mode)):
+	* sample.init.el ((Init-safe-require 'scroll-in-place)):
+	Rewrite to be much more careful about loading features -- now
+	it decays gracefully even in the complete absence of packages.
+	Also avoid doing obnoxious things when loading efs.
+
+2001-05-10  Paul Stodghill  <stodghil@cs.cornell.edu>
+
+	* PACKAGES: Update to reflect new package dir tree.
+
+2001-05-15  Steve Youngs  <youngs@xemacs.org>
+
+	* PACKAGES: Update to reflect new package dir tree.
+
+2001-05-09  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.5.1 "anise" is released.
+
+2001-01-31  Jason R. Mastaler  <jason@xemacs.org>
+
+	* FTP: Updated FTP mirrors list.
+
+2001-04-18  Martin Buchholz  <martin@xemacs.org>
+
+	* XEmacs 21.5.0 "alfalfa" is released.
+
+2001-03-30  Ben Wing  <ben@xemacs.org>
+
+	* sample.init.el:
+	* sample.init.el (Init-kill-entire-line):
+	* sample.init.el (describe-foo-at-point):
+	* sample.init.el (kill-current-buffer):
+	* sample.init.el (kill-current-buffer-and-window):
+	* sample.init.el (grep-c-files): Removed.
+	* sample.init.el (grep-all-files-history): New.
+	* sample.init.el (grep-all-files-omitted-expressions): New.
+	* sample.init.el (grep-all-files-omitted-directories): New.
+	* sample.init.el (construct-grep-all-files-command): New.
+	* sample.init.el (grep-all-files-in-current-directory): New.
+	* sample.init.el (grep-lisp-files): Removed.
+	* sample.init.el (grep-all-files-in-current-directory-and-below): New.
+	* sample.init.el (clear-select):
+	* sample.init.el ((control kp-add)):
+	* sample.init.el (pause):
+	* sample.init.el ((eq system-type 'windows-nt)):
+
+	Add documentation for defined functions.  Change grep functions to
+	be more generally useful.  Document more specifically what the
+	`menu-force' setting actually does -- what commands are overridden
+	and how to access them.
+
+2001-03-30  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* OXYMORONS: Add 2 oxymorons, clean up numbering, close RFC.
+
+	* NEWS: Fix typo.
+
+2001-03-23  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* gnuserv.1 (UNIX_DOMAIN_SOCKETS:
+	Document TMPDIR lossage in gnuserv/gnuclient.
+
+2001-03-06  Ben Wing  <ben@xemacs.org>
+
+	* sample.init.el:
+	* sample.init.el (Init-kill-entire-line): New.
+	Fix to take into account the removed kill-whole-line changes.
+
+2001-03-21  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.46 "Urania" is released.
+
+2001-03-15  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* OXYMORONS: New file of 21.4 codenames.
+
+2001-03-02  Ben Wing  <ben@xemacs.org>
+
+	* README: sample.emacs -> sample.init.el.
+
+2001-02-23  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.45 "Thelxepeia" is released.
+
+2001-02-10  Martin Buchholz  <martin@xemacs.org>
+
+	* MACHINES: Rewritten.  Bitrot discarded.
+
+2001-02-08  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.44 "Thalia" is released.
+
+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
+2001-01-21  Steve Youngs  <youngs@xemacs.org>
+
+	* ./etc/PACKAGES: Doc fix.
+
+2001-01-17  Steve Youngs  <youngs@xemacs.org>
+
+	* ./etc/PACKAGES: Update.
+
+2001-01-20  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.42 "Poseidon" is released.
+
+2001-01-17  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.41 "Polyhymnia" is released.
+
+2001-01-08  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.40 is released.
+
+2000-12-31  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.39 is released.
+
+2000-12-05  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.38 is released.
+
+2000-11-14  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.37 is released.
+
+2000-10-19  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* PACKAGES: Add details on os-utils contents.
+
+2000-10-04  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+	* NEWS: Change lprogress-display to progress-feedback.
+
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.36 is released.
+
+2000-08-29  Robert Pluim  <rpluim@bigfoot.com>
+
+	*  etc/NEWS: fix reference to progress-feedback-use-echo-area
+
+2000-09-20  Martin Buchholz  <martin@xemacs.org>
+
+	* xemacs.1: Spelling fixes.  Remove stuff that doesn't belong.
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+	* Emacs.ad: Remove Energize from comments.
+
+2000-08-02  Stephen J. Turnbull <stephen@xemacs.org>
+
+	* Emacs.ad: Document usage of FontSet resource for menubar.
+
+2000-07-19  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.35 is released.
+
+2000-05-28  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.34 is released.
+
+2000-04-15  Andy Piper  <andy@xemacs.org>
+
+	* Emacs.ad: add select-start() back into text translations.
+
+2000-05-01  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.33 is released.
+
+2000-04-12  Andy Piper  <andy@xemacs.org>
+
+	* Emacs.ad: give the gui-element face the same font as the
+	menubar and popups. Add translations for text widgets.
+
+2000-03-20  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.32 is released.
+
+2000-03-01  Didier Verna  <didier@xemacs.org>
+
+	* NEWS: update the rect.el entry.
+
+2000-02-23  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.31 is released.
+
+2000-02-21  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.30 is released.
+
+2000-01-05  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+	* TUTORIAL.ja: Synch with English version.
+
+2000-02-16  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.29 is released.
+
+2000-02-07  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.28 is released.
+
+2000-01-18  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.27 is released.
+
+2000-01-15  Adrian Aichner  <aichner@ecf.teradyne.com>
+
+	* TUTORIAL.de: Update copyright and fix typo.
+
+2000-01-03  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* NEWS: Document mail spool locking overhaul.
+
+1999-12-31  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.26 is released.
+
+1999-12-24  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.25 is released.
+
+1999-12-14  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.24 is released.
+
+1999-12-07  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.23 is released.
+
+1999-11-28  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.21 is released.
+
+1999-10-12  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+	* sample.Xdefaults: adds a reference to beNiceToColormap,
+	  so that the user can guess what to do if xemacs' dialogs are
+	  butt ugly.
+
+1999-11-13  Jason R Mastaler  <jason@mastaler.com>
+
+	* FTP: Updated FTP mirrors list.  Replaced GNU FTP document
+ 	with a URL.
+
+1999-11-13  Jason R Mastaler  <jason@mastaler.com>
+
+	* MAILINGLISTS: Updated mailing list subscription information.
+  	Replaced GNU MAILINGLISTS document with a URL.
+
+1999-08-01  Adrian Aichner  <adrian@xemacs.org>
+
+	* DISTRIB: Update IP address of ftp.xemacs.org.
+	* NEWS: Fix typo
+
+1999-07-23  Jan Vroonhof  <vroonhof@math.ethz.ch>
+
+	* custom/example-themes/example-theme.el:
+	* custom/example-themes/europe-theme.el:
+	* custom/example-themes/ex-custom-file: Some simple examples
+	illustrating the custom theme support.
+
+1999-07-17  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* HELLO (Thai): Modify for new font.
+
+1999-03-30  MORIOKA Tomohiko  <tomo@etl.go.jp>
+
+	* HELLO (Amharic): New language.
+	(Slovak): Likewise.
+	(Thai): Likewise (by Virach Sornlertlamvanich).
+	(Greek): Fixed (by Yannis Haralambous).
+
+1999-02-01  Glynn Clements  <glynn@sensei.co.uk>
+
+	* recycle.xpm: Fix colours so that they work on TrueColor
+	and DirectColor displays
+
+1998-12-28  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.8 is released.
+
+1998-12-24  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.7 is released.
+
+1998-11-28  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.2-beta4 is released.
+
+1998-10-15  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.2-beta3 is released.
+
+1998-10-02  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* xemacs.1: Remove misplace "\".
+
+1998-09-29  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.2-beta2 is released.
+
+1998-09-05  SL Baur  <steve@altair.xemacs.org>
+
+	* check_cygwin_setup.sh: grammar fix.
+
+1998-09-02  Andy Piper  <andyp@parallax.co.uk>
+
+	* check_cygwin_setup.sh: fix a couple of buglets.
+
+1998-08-23  Adrian Aichner  <adrian@xemacs.org>
+
+	* sample.emacs: Enable sound support on mswindows devices.
+
+1998-08-06  Adrian Aichner  <adrian@xemacs.org>
+
+	* TUTORIAL.de: Fixing typos and grammatical errors.  Fixing
+	inconsistent usage of RET, <Return>, and <return> (only using
+	<Return> now).  Changing TUTORIAL to TUTORIAL.de throughout
+	itself.  Adding english equivalent to german translation of all
+	concepts used in TUTORIAL.de.
+
+1998-07-19  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.2-beta1 is released.
+
+1998-07-12  SL Baur  <steve@altair.xemacs.org>
+
+	* GOATS: Removed.
+
+1998-07-12  SL Baur  <steve@altair.xemacs.org>
+
+	* README: Bump version numbers.
+	* NEWS: Ditto and purge pre-21.0 stuff.
+
+ 	* XEmacs 21.0-pre5 is released.
+
+1998-07-09  SL Baur  <steve@altair.xemacs.org>
+
+	* configure.in: Handle multiple database libraries.
+	From Gregory Neil Shapiro <gshapiro@sendmail.org>
+
+	* XEmacs 21.0-pre4 is released.
+
+	* configure.in: Fix test for InfoDock sources.
+
+1998-07-09  SL Baur  <steve@altair.xemacs.org>
+
+	* BETA (writing): Update patch creation instructions.
+
+	* FTP: Update FTP mirror list.
+
+	* DISTRIB: Remove duplicated FTP mirror list.
+	* xemacs.1 (ftp): Ditto.
+
+	* XEmacs 21.0-pre4 is released.
+
+1998-06-29  SL Baur  <steve@altair.xemacs.org>
+
+	* gnuserv.1 (this): Email address for Ben Wing is ben@xemacs.org.
+	* gnuserv.README (README): Ditto.
+	* xemacs-ja.1: Ditto.
+
+1998-06-28  SL Baur  <steve@altair.xemacs.org>
+
+	* BABYL: Moved to rmail package
+
+	* enriched.doc: Moved to xemacs-base package
+
+	* MSDOS:
+	* GNUS-NEWS: deleted
+
+1998-06-21  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* NEWS: Added references to documentation about packages and
+	path setup.
+
+	* README: Synched.
+
+1998-06-19  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-pre3 is released.
+
+1998-06-20  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* PACKAGES:
+	* BETA: Moved some package stuff into Texinfo docs.  Other nitpicks
+
+1998-06-19  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-pre2 is released.
+
+1998-06-14  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-pre1 is released.
+
+1998-06-14  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
+
+	* NEWS: Updated information about customization of the
+	automatic info dir file generation using
+	`Info-auto-generate-directory' and `Info-save-auto-generated-dir'
+
+1998-06-11  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta43 is released.
+
+1998-06-02  Andy Piper  <andyp@parallax.co.uk>
+
+	* check_cygwin_setup.sh: set more intelligent defaults for
+	windows 95.
+
+1998-06-01  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta42 is released.
+
+1998-06-01  SL Baur  <steve@altair.xemacs.org>
+
+	* sounds: Removed, now in the sounds-au package.
+
+1998-05-29  Andy Piper  <andyp@parallax.co.uk>
+
+	* check_cygwin_setup.sh: new file to check that cygwin is setup
+	correctly for XEmacs operation.
+
+1998-05-23  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta41 is released.
+
+1998-05-15  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta40 is released.
+
+1998-05-09  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta39 is released.
+
+1998-05-07  SL Baur  <steve@altair.xemacs.org>
+
+	* altrasoft-logo.xpm: Removed.
+
+1998-05-02  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta38 is released.
+
+1998-04-26  Jason R Mastaler  <jason@4b.org>
+
+	* BETA: Replaced SmartList references in favor of
+	Majordomo.
+
+1998-04-25  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-21.0-beta37 is released.
+
+1998-04-19  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
+
+	* NEWS: Documented info dir rebuilding and LDAP support.
+
+1998-04-18  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-21.0-beta36 is released.
+
+1998-04-11  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* xemacs.1: -no-packages -> -no-early-packages.
+
+	* NEWS: Clarified site-lisp status.
+
+1998-04-10  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta35 is released.
+
+1998-04-10  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* NEWS: Documented that Info-default-directory-list and
+	site-directory are gone.
+
+1998-04-04  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta34 is released.
+
+1998-03-24  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta33 is released.
+
+1998-03-24  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta32 is released.
+
+1998-03-16  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0 beta31 is released.
+
+1998-03-09  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* Emacs.ad: Example using leading dot resources to
+	  initalize faces changes to use Emacs.foo since the
+	  leading dot syntax doesn't work.  Initialization of
+	  text-cursor face moved to faces.el.
+
+1998-03-07  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta30 is released.
+
+1998-03-01  SL Baur  <steve@altair.xemacs.org>
+
+	* Emacs.ad: Remove explicit `Emacs' application resource
+	name.
+
+1998-02-25  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta28 is released.
+
+	* configure.in (with_session): Fix reporting of the setting.
+	(with_database_gnudbm): Correctly report setting.
+
+1998-02-19  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta27 is released.
+	* XEmacs-20.4-pre4 is released.
+
+	* configure.in (doug_lea_malloc): Requires USE_MINIMAL_TAGBITS.
+	(--with-gung): Implement it.
+
+	* configure.usage (--with-gung): Document.  Turns on
+	USE_MINIMAL_TAGBITS and USE_INDEXED_LRECORD_IMPLEMENTATION.
+	(--with-term): Remove.
+
+	* XEmacs-20.5-beta26 is released.
+
+1998-02-18  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-20.4-pre3 is released.
+
+	* Makefile.in: use better feedback while rebuilding finder database.
+	Suggested by Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+
+1998-02-14  SL Baur  <steve@altair.xemacs.org>
+
+	* configure.in (OFFIX_O): Don't use OffiX if no real Xmu support.
+	Suggested by Pekka Marjola <pema@iki.fi>
+
+	* XEmacs-20.4-pre2 is released.
+	* XEmacs-20.5-beta25 is released.
+
+1998-02-09  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.4-pre1 is released.
+	* XEmacs 20.5-beta24 is released.
+
+1998-02-03  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta23 is released.
+
+1998-02-01  SL Baur  <steve@altair.xemacs.org>
+
+	* aliases.ksh: igrep from the shell command line.
+	From Karl M. Hegbloom <karlheg@bittersweet.inetarena.com>
+
+1998-01-31  SL Baur  <steve@altair.xemacs.org>
+
+	* aliases.ksh: Add `mak' function to create beta.err for
+	build-report.
+	From Adrian Aichner <adrian@xemacs.org>
+	Suggested by Karl M. Hegbloom <karlheg@bittersweet.inetarena.com>
+
+1998-01-27  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta22 is released.
+
+1998-01-26  SL Baur  <steve@altair.xemacs.org>
+
+	* aliases.ksh: New file.  Start tracking useful Maintainer
+	XEmacs commands.
+
+1998-01-25  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta21 is released.
+
+1998-01-18  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta20 is released.
+
+1998-01-13  Martin Buchholz  <martin@xemacs.org>
+
+	* NEWS:
+	Remove doc for configure-time INFOPATH, no longer used.
+
+	* BETA: Update ftp addresses.
+	* INSTALL: Update ftp addresses.
+	* MAILINGLISTS: Sync with Emacs 20.2. Update ftp addresses.
+
+	* xemacs.1: Update author list.
+
+1998-01-12  SL Baur  <steve@altair.xemacs.org>
+
+	* INSTALL: Updated for recent Mule/package changes.
+
+	* XEmacs 20.5-beta19 is released.
+
+1998-01-10  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta18 is released.
+
+1998-01-10  SL Baur  <steve@altair.xemacs.org>
+
+	* FTP: Update address of what was formerly ftp.ibp.fr.
+
+1998-01-04  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta17 is released.
+
+	* Makefile.in (finder): Use -vanilla.
+	(lisp/finder-inf.el): Ditto.
+	(check-features): New target.  Do a sanity check prior to
+	installation.
+
+1997-01-03  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta16 is released.
+
+1997-12-30  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta15 is released.
+
+1997-12-27  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta14 is released.
+
+1997-12-25  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta13 is released.
+
+1997-12-21  SL Baur  <steve@altair.xemacs.org>
+
+	* BETA (Prerequisite): Add cookbook procedures for maintaining
+	package lisp directories.
+
+1997-12-20  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta 12 is released.
+
+1997-12-18  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* Emacs.ad: Don't specify a default toolbar specific
+	  background color.
+
+1997-12-18  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* toolbar: Added support for foregroundToolBarColor
+	  symbol to most icons.
+
+1997-12-17  SL Baur  <steve@altair.xemacs.org>
+
+	* BETA: Update version numbers.
+
+	* NEWS: Update version number.
+
+1997-12-16  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta11 is released.
+
+1997-12-13  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile.in (lisp/finder-inf.el): Add dependency on src/.
+
+	* XEmacs 20.5-beta10 is released.
+
+1997-12-09  SL Baur <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta9 is released.
+
+1997-12-06  SL Baur <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta8 is released.
+
+	* info/dir: update for further packaging.
+	* configure.in: remove `tree-x' from XEmacs build.
+
+1997-12-05  Aki Vehtari  <Aki.Vehtari@hut.fi>
+
+	* refcard.tex: Updated for 20.3
+
+1997-12-02  SL Baur  <steve@altair.xemacs.org>
+
+	* skk/SKK.tut.E (Hint): Fix typos.
+
+1997-11-27  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta7 is released.
+
+	* configure.in: When testing for -ltiff, fall back on the extra
+	libraries -ljpeg, and -lz since some -ltiff's need them.
+
+1997-11-20  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta6 is released.
+
+1997-11-19  SL Baur  <steve@altair.xemacs.org>
+
+	* xemacs.1: Document -no-packages, -vanilla.
+	Document -h.
+
+1997-11-17  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-pre4 is released.
+
+1997-11-15  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-pre3 is released.
+	* XEmacs 20.5-beta5 is released.
+
+1997-11-11  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta4 is released.
+
+1997-11-08  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta3 is released.
+	* XEmacs 20.3-pre2 is released.
+
+1997-11-04  Adrian Aichner  <adrian@xemacs.org>
+
+	* TUTORIAL.de:
+	Updated copyright information. Translated most of the COPYING
+	section. Translated the <<.*>> didactic line.
+
+1997-10-22  Adrian Aichner  <adrian@xemacs.org>
+
+	* TUTORIAL.de: Fixed two issues reported by
+	Achim Oppelt <aoppelt@theorie3.physik.uni-erlangen.de>
+
+	* TUTORIAL.de:
+	Manually applied rejected patch hunks from Marc Aurel's patch.
+	Some more fixes.
+
+	* TUTORIAL.de:
+	Applied patches supplied by Marc Aurel <4-tea-2@bong.saar.de>.
+	They fix yet more typos and quite a few awkward sentences.
+
+1997-10-21  Adrian Aichner  <adrian@xemacs.org>
+
+	* TUTORIAL.de: Manually merged a few more corrections by
+	Carsten Leonhardt <leo@arioch.oche.de>
+
+1997-10-20  Adrian Aichner  <adrian@xemacs.org>
+
+	* TUTORIAL.de:
+	Applied patches from Andreas Jaeger <aj@arthur.rhein-neckar.de> to 1.2,
+	then merged them with 1.3 via ediff-buffers.
+	Andreas found some quite nasty typos still and added many missing commas.
+
+	* TUTORIAL.de: Re-fill-ed paragraphs after patching.
+
+	* TUTORIAL.de: Applied the excellent patches courtesy of
+	Carsten Leonhardt <leo@arioch.oche.de>.
+
+1997-11-02  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* TUTORIAL.ko: Renamed from etc/TUTORIAL.kr to fit with ISO
+	639 (two letter language code).
+
+	* TUTORIAL.ja: Renamed from etc/TUTORIAL.jp to fit with ISO
+	639 (two letter language code).
+
+1997-11-02  SL Baur  <steve@altair.xemacs.org>
+
+	* CHARSETS:  New file imported from Emacs 20.1.
+
+1997-11-01  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-pre1 is released.
+
+1997-10-31  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.16 is released.
+
+1997-10-31  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta2 is released.
+
+1997-10-30  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* Emacs.ad: Added *XlwMenu*highlightForeground entry.
+	  Added *XlwMenu*titleForeground entry.
+
+1997-10-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* HELLO: Add Czech.
+
+	* HELLO: Delete Amharic, Thai and Tigrigna.
+
+1997-10-28  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta94 is released.
+
+1997-10-28  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta93 is released.
+
+1997-10-24  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta92 is released.
+
+1997-10-18  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta91 is released.
+
+1997-10-16  Hrvoje Niksic <hniksic@srce.hr>
+
+	* NEWS:  document changed package load semantics.
+
+1997-10-13  SL Baur  <steve@altair.xemacs.org>
+
+	* configure.in: Remove `site-lisp' from list of directories to
+	make symbolic links for.
+
+	* XEmacs 20.3-beta90 is released.
+
+1997-10-13  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* NEWS: Updates
+
+1997-10-12  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.5-beta1 is released.
+
+	* XEmacs 19.16-pre9 is released.
+
+	* XEmacs 19.16-pre8 is released.
+
+1997-10-11  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta28 is released.
+
+	* Makefile.in (src/paths.h): Update PATH_INFOPATH
+	(infopath): New shell variable.
+	(infopath_user_defined): Ditto.
+
+	* configure.in (infodir_user_defined): Spelling fixes.
+
+1997-10-10  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+	* NEWS: Draft entry for the info changes.
+
+1997-10-10  Martin Buchholz  <mrb@eng.sun.com>
+
+	* BETA:
+	  - remove Chuck as contact name
+	  - random small improvements
+	  - remove I/me references - the message should be that XEmacs
+	    maintenance is an inclusive community effort.
+
+1997-10-10  SL Baur  <steve@altair.xemacs.org>
+
+	* BETA (Prerequisite): Add further documentation for
+	package installation.
+
+1997-10-07  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.16-pre7 is released.
+
+1997-10-04  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.16-pre6 is released.
+
+1997-10-04  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta27 is released.
+
+1997-10-02  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta26 is released.
+
+1997-09-30  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta25 is released.
+
+	* Makefile.in (install-arch-dep): Install the `Installation' for
+	future reference.
+
+	* Makefile.in (top_distclean): Remove finder-inf.el*.
+
+	* configure.in (use_union_type): Default to "yes".
+
+1997-09-30  SL Baur  <steve@altair.xemacs.org>
+
+	* BETA: Document existence of `Installation' file.
+	- Document requirement of rebuilding finder-inf.el when building
+	from the full tarball.
+
+1997-09-27  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta24 is released.
+
+1997-09-24  SL Baur  <steve@altair.xemacs.org>
+
+	* BETA (XEmacs 20.3 packages): Added explanation of package
+	hierarchy.
+
+1997-09-22  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.16-pre4 is released.
+
+1997-09-20  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta23 is released.
+
+1997-09-19  SL Baur <steve@altair.xemacs.org>
+
+	* XEmacs 19.16-pre3 is released.
+
+1997-09-18  Colin Rafferty  <craffert@ml.com>
+
+	* NEWS: Various spelling corrections and some grammar
+		  corrections (which/that).
+
+1997-09-17  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta22 is released.
+
+1997-09-16  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta21 is released.
+
+	* XEmacs 19.16-pre2 is released.
+
+1997-09-13  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta20 is released.
+
+1997-09-12  SL Baur  <steve@altair.xemacs.org>
+
+	XEmacs 19.16-pre1 "Queens" is released.
+
+1997-09-02  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta19 is released.
+
+	* Makefile.in (finder): New target.
+
+1997-08-29  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.16-beta91 is released.
+
+1997-08-20  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.16-beta90 is released.
+
+1997-08-16  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta18 is released.
+
+1997-08-11  Karl M. Hegbloom  <karlheg@inetarena.com>
+
+	* NEWS: add a section telling about the Info changes.
+
+1997-08-09  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta17 is released.
+
+1997-08-07  Jan Vroonhof  <vroonhof@math.ethz.ch>
+
+	* gnuserv.1: Described Hrvoje's mods in manpage
+
+1997-07-31  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta16 is released.
+
+1997-07-27  SL Baur  <steve@altair.xemacs.org>
+
+	* BETA: Update patching instructions.
+
+1997-07-26  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta15 is released.
+
+1997-07-19  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta14 is released.
+
+1997-07-13  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta13 is released.
+
+	* info/dir (Packages): Integrate texinfo manual for PH.
+
+1997-07-08  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta12 is released.
+
+1997-07-06  Steven L Baur  <steve@altair.xemacs.org>
+
+	* lwlib/lwlib-Xm.c (xm_update_one_value): Hand application of mrb
+	fix.  Restoration of lossage from beta10->beta11 upgrade.
+
+	* XEmacs 20.3-beta11 is released.
+
+1997-06-29  Steven L Baur  <steve@altair.xemacs.org>
+
+	* configure.in (CPP): Correct typo `print-lib-gcc-file-name'
+	should be `print-libgcc-file-name'
+	From Katsumi Yamaoka <yamaoka@ga.sony.co.jp>
+
+	* XEmacs 20.3-beta10 is released.
+
+1997-06-25  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta9 is released.
+
+	* Makefile.in (dist): Make `make dist' work for me.
+
+1997-06-24  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* HELLO: final byte for ethiopic was changed to sync with
+	Emacs/mule-19.34.94-zeta.
+
+1997-06-23  Steven L Baur  <steve@altair.xemacs.org>
+
+	* NEWS (Commands): Various updates by Hrvoje Niksic.
+
+1997-06-21  Steven L Baur  <steve@altair.xemacs.org>
+
+	* Makefile.in: Missing FRC.info.
+	(install-arch-dep): Add missing backslash.
+	From Glynn Clements <glynn@sensei.co.uk>
+
+	* XEmacs 20.3-beta8 is released.
+
+1997-06-20  Steven L Baur  <steve@altair.xemacs.org>
+
+	* gnuserv.1: Updates and cleanup.
+	From Hrvoje Niksic <hniksic@srce.hr>
+
+1997-06-14  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta7 is released.
+
+1997-06-12  Steven L Baur  <steve@altair.xemacs.org>
+
+	* TUTORIAL (things): Synched by Hrvoje Niksic with previous
+	XEmacs version.
+
+1997-06-11  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-b6 is released.
+
+	* configure.in (GNU_MALLOC): Check for (-l)PW instead of (-l)-lPW.
+	Suggested by Martin Buchholz  <mrb@eng.sun.com>
+
+1997-06-08  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* smilies/Face_smile.xbm, etc/smilies/Face_weep.xbm,
+	etc/smilies/Face_ase2.xbm, etc/smilies/Face_ase3.xbm,
+	etc/smilies/Face_ase.xbm: Add Japanese smiley faces.
+
+1997-06-09  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-b5 is released.
+
+1997-06-08  Steven L Baur  <steve@altair.xemacs.org>
+
+	* NEWS: Updates for early beta20.3 stuffs.
+	From Hrvoje Niksic <hniksic@srce.hr>
+
+1997-06-05  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-b4 is released.
+
+1997-06-04  Martin Buchholz  <mrb@eng.sun.com>
+
+	* NEWS:
+	* etags.1:
+	Upgraded to etags 12.11
+
+1997-05-29  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta3 is released.
+
+	* INSTALL: Delete documentation of mocklisp support.
+
+	* configure.in: Delete mocklisp support.
+
+1997-05-29  Steven L Baur  <steve@altair.xemacs.org>
+
+	* FTP: Update mirror info.
+
+	* DISTRIB: Update mirror info.
+
+1997-05-26  Steven L Baur  <steve@altair.xemacs.org>
+
+	* FTP: Correct typo in ftp.cenatls.cena.dgac.fr.
+
+	* DISTRIB: Ditto.
+
+1997-05-22  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta2 is released.
+
+Tue Jun  4 10:15:54 1996  Per Bothner  <bothner@deneb.cygnus.com>
+
+	* e/eterm.ti:  Add kcub1, kcuf1, kcuu1, kcud1 capabilities.
+
+Sat May 17 20:30:54 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-b1 is released.
+
+Fri May 16 20:38:19 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* README: Update minor version number.
+
+Tue May 13 20:35:52 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-20.2 is released.
+
+Sat May 10 16:14:30 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.2-b6 is released.
+
+Thu May  8 20:22:34 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.2-b5 is released.
+
+Fri May  2 16:50:02 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.2-b4 is released.
+
+Sun Apr 27 12:25:55 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.2-b3 is released.
+
+Wed Apr 23 10:33:58 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.2-b2 is released.
+
+	* configure.in (beta): OPENWINHOME misspelled.
+
+Mon Apr 21 14:48:29 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* BETA (writing): Update with information about how to create
+	patches.
+
+Sat Apr 19 16:13:16 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.2-b1 is released.
+
+Wed Apr 16 17:44:05 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1 is re-released.
+
+Tue Apr 15 21:03:22 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1 is released.
+
+Sat Apr 12 20:11:08 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b15 is released.
+
+Thu Apr 10 19:07:26 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b14 is released.  (Beta 13 was skipped).
+
+Wed Apr  9 22:52:06 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b12 is released.
+
+Sat Apr  5 09:11:36 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b11 is released.
+
+Thu Mar 27 18:24:19 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b10 is released.
+
+Sun Mar 23 17:24:38 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.15-b104 is released.
+
+Sat Mar 22 19:56:36 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* sgml/CATALOG: Default to html-3.2final.
+
+Fri Mar 21 21:26:01 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-19.15-b103 is released.
+	* XEmacs-20.0-b9 is released.
+
+	* Makefile.in (top_distclean): Add `Installation' to distclean
+	rule.
+
+Thu Mar 20 20:14:16 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-19.15-b102 is released.
+
+Tue Mar 18 21:52:36 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-19.15-b101 is released.
+
+Mon Mar 17 19:09:29 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-20.1-b8 is released.
+	* XEmacs-19.15-b100 is released.
+
+Sat Mar 15 17:15:18 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-20.1-b7 is released.
+	* XEmacs-19.15-b99 is released.
+
+Sat Mar 15 17:15:18 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* sgml/CATALOG: Added IE3 DTDs and htmlpro DTD.
+
+Sat Mar  8 15:19:33 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs-20.1-b6 is released.
+	* XEmacs-19.15-b98 is released.
+
+Mon Mar  3 23:57:56 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b5 is released.
+
+Mon Mar  3 18:09:17 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b4 is released.
+
+Sat Mar  1 15:38:30 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* Makefile.in (distclean): Correct typos.
+
+	* XEmacs 19.15-b96 is released.
+
+	* configure.in: Symlink site-lisp when using --srcdir.
+	Add special handling of lisp directory to allow for multiple
+	site-packages files.
+
+Tue Mar  4 00:41:38 1997  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* sample.Xdefaults: Added customization of foreground and
+	background colors for the `default' face.
+
+Wed Feb 26 22:12:12 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* Makefile.in (top_distclean): Reset src/PURESIZE.h for
+	distribution.
+
+	* XEmacs 20.1-b3 is released.
+
+Sun Feb 23 17:10:09 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b2 is released.
+
+Sat Feb 22 14:29:44 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19-15-b'95 is released.
+
+Fri Feb 21 22:29:51 1997  Martin Buchholz  <mrb@eng.sun.com>
+
+	* toolbar/workshop-cap-up.xpm:  Moved caption up one pixel.
+
+Sat Feb 15 14:11:03 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.1-b1 is released.
+	* XEmacs 19.15-b94 is released.
+
+Sun Feb  9 16:15:55 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.15-b93 is released.
+	XEmacs 20.0 is released to the 'net.
+
+Fri Feb  7 19:21:34 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.0try3 is released.
+
+Wed Feb  5 18:03:06 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.0try2 is released.
+
+Mon Feb  3 19:39:08 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 19.15-b92 is released.
+
+Sat Feb  1 18:17:38 1997  Steven L Baur <steve@altair.xemacs.org>
+
+	* XEmacs 20.0try1 is released.
+	* XEmacs 19.15-b91 AKA XEmacs '97 NOT! is released.
+
+Wed Jan 29 19:59:41 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* CHANGES-beta: XEmacs 20.0-b93 is released.
+
+Sat Jan 25 15:43:59 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* CHANGES-beta: XEmacs 20.0-b92 is released.
+
+Wed Jan 22 21:07:17 1997  Steven L Baur  <steve@altair.xemacs.org>
+	* XEmacs 20.0-b91 (prerelease 2) is released.
+
+	* configure.in (--with-scrollbars): Add Athena3d as a toolkit
+	type.
+
+	* lwlib/lwlib-Xaw.c (xaw_update_one_widget): Let Athena 3d have 0
+	borderwidth.
+	(xaw_scrollbar_scroll): Use SCROLLBAR_LINE_UP and
+	SCROLLBAR_LINE_DOWN since that's current the only to get to the
+	bottom of the buffer. :-(
+
+Tue Jan 21 20:01:19 1997  Steven L. Baur  <steve@altair.xemacs.org>
+
+	* sgml/HTML32.dtd: html-3.2 final dtd added.
+
+Sat Jan 11 12:05:31 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* sample.emacs: Remove code snippet that wipes out the cycle
+	buffer modeline feature.
+
+Sat Jan 11 12:05:31 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.0 beta90 (prerelease 1) is released.
+	* XEmacs 19.15 beta90 (prerelease 1) is released.
+
+Sat Jan  4 14:52:57 1997  Steven L Baur  <steve@altair.xemacs.org>
+	* XEmacs 20.0 beta 34 is released.
+	* XEmacs 19.15 beta 7 is released.
+
+Sun Dec 29 05:37:43 1996  Martin Buchholz  <mrb@eng.sun.com>
+
+	* sample.emacs: Add sample code to highlight continuation glyph
+
+Sat Dec 28 15:33:27 1996 Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.0 beta 33 is released.
+	* XEmacs 19.15 beta 6 is released.
+
+Fri Dec 27 20:34:58 1996  Richard Mlynarik  <mly@adoc.xerox.com>
+
+	* yow.lines: 20k of new zippy quotes.
+
+Sat Dec 21 15:20:20 1996  Steven L Baur  <steve@altair.xemacs.org>
+	* XEmacs 20.0-b32 released.
+
+	* XEmacs 19.15-b5 released.
+
+Tue Dec 10 19:25:25 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* CHANGES-beta: XEmacs 20.0-b31 is released.
+
+Thu Dec  5 20:42:35 1996  Steven L Baur  <steve@altair.xemacs.org>
+
+	* edt-user.doc (File): New file from Emacs 19.34.
+
--- a/etc/DISTRIB	Sat Mar 23 05:08:52 2002 +0000
+++ b/etc/DISTRIB	Fri Mar 29 04:49:13 2002 +0000
@@ -16,121 +16,3 @@
 
 There are mailing lists and newsgroups specifically for discussing and
 reporting bugs in XEmacs; see the file MAILINGLISTS in this directory.
-
-The FTP and ordering information in the remainder of this file applies
-to the versions of GNU Emacs distributed by the Free Software
-Foundation, not to XEmacs.
-
------------------------------------------------------------------------
-
-For an order form for all Emacs and FSF distributions deliverable from
-the USA, see the file `ORDERS' in this directory (etc/ in the GNU
-Emacs distribution or /pub/gnu/GNUinfo on prep.ai.mit.edu).  For a
-European order form, see `ORDERS.EUROPE'.  For a Japan order form,
-see `ORDERS.JAPAN'.
-
-	   GNU Emacs availability information, June 1995
-Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
-
-	Permission is granted to anyone to make or distribute
-	verbatim copies of this document provided that the
-	copyright notice and this permission notice are preserved.
-
-GNU Emacs is legally owned by the Free Software Foundation, but we
-regard the foundation more as its custodian on behalf of the public.
-
-In the GNU project, when we speak of "free software", this refers to
-liberty, not price.  Specifically, it refers to the users' freedom to
-study, copy, change and improve the software.  Sometimes users pay
-money for copies of GNU software, and sometimes they get copies at no
-charge.  But regardless of how they got the software, or whether it
-was modified by anyone else along the way, they have the freedom to
-copy and change it--those freedoms are what "free software" means.
-
-The precise conditions for copying and modification are stated in the
-document "GNU General Public License," a copy of which is required to
-be distributed with every copy of GNU Emacs.  It is usually in a file
-named `COPYING' in the same directory as this file.  These conditions
-are designed to make sure that everyone who has a copy of GNU Emacs
-(including modified versions) has the freedom to redistribute and
-change it.
-
-If you do not know anyone to get a copy of GNU Emacs from, you can
-order a tape, cd-rom, or floppy diskette from the Free Software
-Foundation.  We distribute Emacs version 18 and 19 in different
-formats for many machines.  We also distribute nicely typeset copies
-of the Emacs user manual, Emacs Lisp Reference Manual, the Emacs
-reference card, etc.  See file `ORDERS'.
-
-If you have Internet access, you can copy the latest Emacs
-distribution from hosts, such as prep.ai.mit.edu.  There are several
-ways to do this; see the file `FTP' for more information.  Even
-better, get the latest version of the file from `/pub/gnu/GNUinfo/FTP'
-on prep.ai.mit.edu for the most current arrangements.  It may also be
-possible to copy Emacs via uucp; the file `FTP' contains information
-on that too.
-
-Emacs has been run on both Berkeley Unix and System V Unix, on a
-variety of types of cpu.  It also works on VMS and on Apollo
-computers, though with some deficiencies that reflect problems in
-these operating systems.  See the file `MACHINES' in this directory
-(see above) for a full list of machines that GNU Emacs has been tested
-on, with machine-specific installation notes and warnings.  There is
-also Demacs that works on newer MS-DOS machines (see file `ORDERS').
-
-Note that there is significant variation between Unix systems
-supposedly running the same version of Unix; it is possible that what
-works in GNU Emacs for me does not work on your system due to such an
-incompatibility.  Since I must avoid reading Unix source code, I
-cannot even guess what such problems may exist.
-
-GNU Emacs is distributed with no warranty (see the General Public
-License for full details, in the file `COPYING' in this directory (see
-above)), and neither I nor the Free Software Foundation promises any
-kind of support or assistance to users.  The foundation keeps a list
-of people who are willing to offer support and assistance for hire.
-See the file `SERVICE'.  You can get the latest version from
-prep.ai.mit.edu in file `/pub/gnu/GNUinfo/SERVICE'.
-
-However, we plan to continue to improve GNU Emacs and keep it
-reliable, so please send me any complaints and suggestions you have.
-I will probably fix anything that I consider a malfunction.  I may
-make improvements that are suggested, but I may choose not to.
-Improving Emacs is not my highest priority now.
-
-If you are on the Internet, report bugs to
-bug-gnu-emacs@prep.ai.mit.edu; on UUCP, use the address
-...!uunet!prep.ai.mit.edu!bug-gnu-emacs.  Otherwise, phone or write the
-foundation at:
-	Free Software Foundation
-	59 Temple Place - Suite 330
-	Boston, MA  02111-1307
-	Voice:  +1-617-542-5942
-	Fax:    +1-617-542-2652
-
-General questions about the GNU Project can be asked of
-gnu@prep.ai.mit.edu.
-
-If you are a computer manufacturer, I encourage you to ship a copy of
-GNU Emacs with every computer you deliver.  The same copying
-permission terms apply to computer manufacturers as to everyone else.
-You should consider making a donation to help support the GNU project;
-if you estimate what it would cost to distribute some commercial
-product and divide it by five, that is a good amount.
-
-If you like GNU Emacs, please express your satisfaction with a
-donation: send me or the Foundation what you feel Emacs has been worth
-to you.  If you are glad that I developed GNU Emacs and distribute it
-as freeware, rather than following the obstructive and antisocial
-practices typical of software developers, reward me.  If you would
-like the Foundation to develop more free software, contribute.
-
-Your donations will help to support the development of more useful
-software to be distributed on the same basis as GNU Emacs.  Eventually
-we will have a complete imitation of the Unix operating system, called
-GNU (Gnu's Not Unix), which will run Unix user programs.  For more
-information on GNU, see the file `GNU' in this directory (see above).
-
-			Richard M Stallman
-			Chief GNUisance,
-			President of the Free Software Foundation
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/unicode/unicode-consortium/8859-16.TXT	Fri Mar 29 04:49:13 2002 +0000
@@ -0,0 +1,299 @@
+#
+#	Name:             ISO/IEC 8859-16:2001 to Unicode
+#	Unicode version:  3.0
+#	Table version:    1.0
+#	Table format:     Format A
+#	Date:             2001 July 26
+#	Authors:          Markus Kuhn <mkuhn@acm.org>
+#
+#	Copyright (c) 1999-2001 Unicode, Inc.  All Rights reserved.
+#
+#	This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
+#	No claims are made as to fitness for any particular purpose.  No
+#	warranties of any kind are expressed or implied.  The recipient
+#	agrees to determine applicability of information provided.  If this
+#	file has been provided on optical media by Unicode, Inc., the sole
+#	remedy for any claim will be exchange of defective media within 90
+#	days of receipt.
+#
+#	Unicode, Inc. hereby grants the right to freely use the information
+#	supplied in this file in the creation of products supporting the
+#	Unicode Standard, and to make copies of this file in any form for
+#	internal or external distribution as long as this notice remains
+#	attached.
+#
+#	General notes:
+#
+#	This table contains the data the Unicode Consortium has on how
+#       ISO/IEC 8859-16:2001 characters map into Unicode.
+#
+#	Format:  Three tab-separated columns
+#		 Column #1 is the ISO/IEC 8859-16 code (in hex as 0xXX)
+#		 Column #2 is the Unicode (in hex as 0xXXXX)
+#		 Column #3 the Unicode name (follows a comment sign, '#')
+#
+#	The entries are in ISO/IEC 8859-16 order.
+#
+#	Updated versions of this file may be found in:
+#		<ftp://ftp.unicode.org/Public/MAPPINGS/>
+#
+#	Any comments or problems, contact <errata@unicode.org>
+#	Please note that <errata@unicode.org> is an archival address;
+#	notices will be checked, but do not expect an immediate response.
+#
+0x00	0x0000	#	NULL
+0x01	0x0001	#	START OF HEADING
+0x02	0x0002	#	START OF TEXT
+0x03	0x0003	#	END OF TEXT
+0x04	0x0004	#	END OF TRANSMISSION
+0x05	0x0005	#	ENQUIRY
+0x06	0x0006	#	ACKNOWLEDGE
+0x07	0x0007	#	BELL
+0x08	0x0008	#	BACKSPACE
+0x09	0x0009	#	HORIZONTAL TABULATION
+0x0A	0x000A	#	LINE FEED
+0x0B	0x000B	#	VERTICAL TABULATION
+0x0C	0x000C	#	FORM FEED
+0x0D	0x000D	#	CARRIAGE RETURN
+0x0E	0x000E	#	SHIFT OUT
+0x0F	0x000F	#	SHIFT IN
+0x10	0x0010	#	DATA LINK ESCAPE
+0x11	0x0011	#	DEVICE CONTROL ONE
+0x12	0x0012	#	DEVICE CONTROL TWO
+0x13	0x0013	#	DEVICE CONTROL THREE
+0x14	0x0014	#	DEVICE CONTROL FOUR
+0x15	0x0015	#	NEGATIVE ACKNOWLEDGE
+0x16	0x0016	#	SYNCHRONOUS IDLE
+0x17	0x0017	#	END OF TRANSMISSION BLOCK
+0x18	0x0018	#	CANCEL
+0x19	0x0019	#	END OF MEDIUM
+0x1A	0x001A	#	SUBSTITUTE
+0x1B	0x001B	#	ESCAPE
+0x1C	0x001C	#	FILE SEPARATOR
+0x1D	0x001D	#	GROUP SEPARATOR
+0x1E	0x001E	#	RECORD SEPARATOR
+0x1F	0x001F	#	UNIT SEPARATOR
+0x20	0x0020	#	SPACE
+0x21	0x0021	#	EXCLAMATION MARK
+0x22	0x0022	#	QUOTATION MARK
+0x23	0x0023	#	NUMBER SIGN
+0x24	0x0024	#	DOLLAR SIGN
+0x25	0x0025	#	PERCENT SIGN
+0x26	0x0026	#	AMPERSAND
+0x27	0x0027	#	APOSTROPHE
+0x28	0x0028	#	LEFT PARENTHESIS
+0x29	0x0029	#	RIGHT PARENTHESIS
+0x2A	0x002A	#	ASTERISK
+0x2B	0x002B	#	PLUS SIGN
+0x2C	0x002C	#	COMMA
+0x2D	0x002D	#	HYPHEN-MINUS
+0x2E	0x002E	#	FULL STOP
+0x2F	0x002F	#	SOLIDUS
+0x30	0x0030	#	DIGIT ZERO
+0x31	0x0031	#	DIGIT ONE
+0x32	0x0032	#	DIGIT TWO
+0x33	0x0033	#	DIGIT THREE
+0x34	0x0034	#	DIGIT FOUR
+0x35	0x0035	#	DIGIT FIVE
+0x36	0x0036	#	DIGIT SIX
+0x37	0x0037	#	DIGIT SEVEN
+0x38	0x0038	#	DIGIT EIGHT
+0x39	0x0039	#	DIGIT NINE
+0x3A	0x003A	#	COLON
+0x3B	0x003B	#	SEMICOLON
+0x3C	0x003C	#	LESS-THAN SIGN
+0x3D	0x003D	#	EQUALS SIGN
+0x3E	0x003E	#	GREATER-THAN SIGN
+0x3F	0x003F	#	QUESTION MARK
+0x40	0x0040	#	COMMERCIAL AT
+0x41	0x0041	#	LATIN CAPITAL LETTER A
+0x42	0x0042	#	LATIN CAPITAL LETTER B
+0x43	0x0043	#	LATIN CAPITAL LETTER C
+0x44	0x0044	#	LATIN CAPITAL LETTER D
+0x45	0x0045	#	LATIN CAPITAL LETTER E
+0x46	0x0046	#	LATIN CAPITAL LETTER F
+0x47	0x0047	#	LATIN CAPITAL LETTER G
+0x48	0x0048	#	LATIN CAPITAL LETTER H
+0x49	0x0049	#	LATIN CAPITAL LETTER I
+0x4A	0x004A	#	LATIN CAPITAL LETTER J
+0x4B	0x004B	#	LATIN CAPITAL LETTER K
+0x4C	0x004C	#	LATIN CAPITAL LETTER L
+0x4D	0x004D	#	LATIN CAPITAL LETTER M
+0x4E	0x004E	#	LATIN CAPITAL LETTER N
+0x4F	0x004F	#	LATIN CAPITAL LETTER O
+0x50	0x0050	#	LATIN CAPITAL LETTER P
+0x51	0x0051	#	LATIN CAPITAL LETTER Q
+0x52	0x0052	#	LATIN CAPITAL LETTER R
+0x53	0x0053	#	LATIN CAPITAL LETTER S
+0x54	0x0054	#	LATIN CAPITAL LETTER T
+0x55	0x0055	#	LATIN CAPITAL LETTER U
+0x56	0x0056	#	LATIN CAPITAL LETTER V
+0x57	0x0057	#	LATIN CAPITAL LETTER W
+0x58	0x0058	#	LATIN CAPITAL LETTER X
+0x59	0x0059	#	LATIN CAPITAL LETTER Y
+0x5A	0x005A	#	LATIN CAPITAL LETTER Z
+0x5B	0x005B	#	LEFT SQUARE BRACKET
+0x5C	0x005C	#	REVERSE SOLIDUS
+0x5D	0x005D	#	RIGHT SQUARE BRACKET
+0x5E	0x005E	#	CIRCUMFLEX ACCENT
+0x5F	0x005F	#	LOW LINE
+0x60	0x0060	#	GRAVE ACCENT
+0x61	0x0061	#	LATIN SMALL LETTER A
+0x62	0x0062	#	LATIN SMALL LETTER B
+0x63	0x0063	#	LATIN SMALL LETTER C
+0x64	0x0064	#	LATIN SMALL LETTER D
+0x65	0x0065	#	LATIN SMALL LETTER E
+0x66	0x0066	#	LATIN SMALL LETTER F
+0x67	0x0067	#	LATIN SMALL LETTER G
+0x68	0x0068	#	LATIN SMALL LETTER H
+0x69	0x0069	#	LATIN SMALL LETTER I
+0x6A	0x006A	#	LATIN SMALL LETTER J
+0x6B	0x006B	#	LATIN SMALL LETTER K
+0x6C	0x006C	#	LATIN SMALL LETTER L
+0x6D	0x006D	#	LATIN SMALL LETTER M
+0x6E	0x006E	#	LATIN SMALL LETTER N
+0x6F	0x006F	#	LATIN SMALL LETTER O
+0x70	0x0070	#	LATIN SMALL LETTER P
+0x71	0x0071	#	LATIN SMALL LETTER Q
+0x72	0x0072	#	LATIN SMALL LETTER R
+0x73	0x0073	#	LATIN SMALL LETTER S
+0x74	0x0074	#	LATIN SMALL LETTER T
+0x75	0x0075	#	LATIN SMALL LETTER U
+0x76	0x0076	#	LATIN SMALL LETTER V
+0x77	0x0077	#	LATIN SMALL LETTER W
+0x78	0x0078	#	LATIN SMALL LETTER X
+0x79	0x0079	#	LATIN SMALL LETTER Y
+0x7A	0x007A	#	LATIN SMALL LETTER Z
+0x7B	0x007B	#	LEFT CURLY BRACKET
+0x7C	0x007C	#	VERTICAL LINE
+0x7D	0x007D	#	RIGHT CURLY BRACKET
+0x7E	0x007E	#	TILDE
+0x7F	0x007F	#	DELETE
+0x80	0x0080	#	<control>
+0x81	0x0081	#	<control>
+0x82	0x0082	#	<control>
+0x83	0x0083	#	<control>
+0x84	0x0084	#	<control>
+0x85	0x0085	#	<control>
+0x86	0x0086	#	<control>
+0x87	0x0087	#	<control>
+0x88	0x0088	#	<control>
+0x89	0x0089	#	<control>
+0x8A	0x008A	#	<control>
+0x8B	0x008B	#	<control>
+0x8C	0x008C	#	<control>
+0x8D	0x008D	#	<control>
+0x8E	0x008E	#	<control>
+0x8F	0x008F	#	<control>
+0x90	0x0090	#	<control>
+0x91	0x0091	#	<control>
+0x92	0x0092	#	<control>
+0x93	0x0093	#	<control>
+0x94	0x0094	#	<control>
+0x95	0x0095	#	<control>
+0x96	0x0096	#	<control>
+0x97	0x0097	#	<control>
+0x98	0x0098	#	<control>
+0x99	0x0099	#	<control>
+0x9A	0x009A	#	<control>
+0x9B	0x009B	#	<control>
+0x9C	0x009C	#	<control>
+0x9D	0x009D	#	<control>
+0x9E	0x009E	#	<control>
+0x9F	0x009F	#	<control>
+0xA0	0x00A0	#	NO-BREAK SPACE
+0xA1	0x0104	#	LATIN CAPITAL LETTER A WITH OGONEK
+0xA2	0x0105	#	LATIN SMALL LETTER A WITH OGONEK
+0xA3	0x0141	#	LATIN CAPITAL LETTER L WITH STROKE
+0xA4	0x20AC	#	EURO SIGN
+0xA5	0x201E	#	DOUBLE LOW-9 QUOTATION MARK
+0xA6	0x0160	#	LATIN CAPITAL LETTER S WITH CARON
+0xA7	0x00A7	#	SECTION SIGN
+0xA8	0x0161	#	LATIN SMALL LETTER S WITH CARON
+0xA9	0x00A9	#	COPYRIGHT SIGN
+0xAA	0x0218	#	LATIN CAPITAL LETTER S WITH COMMA BELOW
+0xAB	0x00AB	#	LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xAC	0x0179	#	LATIN CAPITAL LETTER Z WITH ACUTE
+0xAD	0x00AD	#	SOFT HYPHEN
+0xAE	0x017A	#	LATIN SMALL LETTER Z WITH ACUTE
+0xAF	0x017B	#	LATIN CAPITAL LETTER Z WITH DOT ABOVE
+0xB0	0x00B0	#	DEGREE SIGN
+0xB1	0x00B1	#	PLUS-MINUS SIGN
+0xB2	0x010C	#	LATIN CAPITAL LETTER C WITH CARON
+0xB3	0x0142	#	LATIN SMALL LETTER L WITH STROKE
+0xB4	0x017D	#	LATIN CAPITAL LETTER Z WITH CARON
+0xB5	0x201D	#	RIGHT DOUBLE QUOTATION MARK
+0xB6	0x00B6	#	PILCROW SIGN
+0xB7	0x00B7	#	MIDDLE DOT
+0xB8	0x017E	#	LATIN SMALL LETTER Z WITH CARON
+0xB9	0x010D	#	LATIN SMALL LETTER C WITH CARON
+0xBA	0x0219	#	LATIN SMALL LETTER S WITH COMMA BELOW
+0xBB	0x00BB	#	RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+0xBC	0x0152	#	LATIN CAPITAL LIGATURE OE
+0xBD	0x0153	#	LATIN SMALL LIGATURE OE
+0xBE	0x0178	#	LATIN CAPITAL LETTER Y WITH DIAERESIS
+0xBF	0x017C	#	LATIN SMALL LETTER Z WITH DOT ABOVE
+0xC0	0x00C0	#	LATIN CAPITAL LETTER A WITH GRAVE
+0xC1	0x00C1	#	LATIN CAPITAL LETTER A WITH ACUTE
+0xC2	0x00C2	#	LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+0xC3	0x0102	#	LATIN CAPITAL LETTER A WITH BREVE
+0xC4	0x00C4	#	LATIN CAPITAL LETTER A WITH DIAERESIS
+0xC5	0x0106	#	LATIN CAPITAL LETTER C WITH ACUTE
+0xC6	0x00C6	#	LATIN CAPITAL LETTER AE
+0xC7	0x00C7	#	LATIN CAPITAL LETTER C WITH CEDILLA
+0xC8	0x00C8	#	LATIN CAPITAL LETTER E WITH GRAVE
+0xC9	0x00C9	#	LATIN CAPITAL LETTER E WITH ACUTE
+0xCA	0x00CA	#	LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+0xCB	0x00CB	#	LATIN CAPITAL LETTER E WITH DIAERESIS
+0xCC	0x00CC	#	LATIN CAPITAL LETTER I WITH GRAVE
+0xCD	0x00CD	#	LATIN CAPITAL LETTER I WITH ACUTE
+0xCE	0x00CE	#	LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+0xCF	0x00CF	#	LATIN CAPITAL LETTER I WITH DIAERESIS
+0xD0	0x0110	#	LATIN CAPITAL LETTER D WITH STROKE
+0xD1	0x0143	#	LATIN CAPITAL LETTER N WITH ACUTE
+0xD2	0x00D2	#	LATIN CAPITAL LETTER O WITH GRAVE
+0xD3	0x00D3	#	LATIN CAPITAL LETTER O WITH ACUTE
+0xD4	0x00D4	#	LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+0xD5	0x0150	#	LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+0xD6	0x00D6	#	LATIN CAPITAL LETTER O WITH DIAERESIS
+0xD7	0x015A	#	LATIN CAPITAL LETTER S WITH ACUTE
+0xD8	0x0170	#	LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+0xD9	0x00D9	#	LATIN CAPITAL LETTER U WITH GRAVE
+0xDA	0x00DA	#	LATIN CAPITAL LETTER U WITH ACUTE
+0xDB	0x00DB	#	LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+0xDC	0x00DC	#	LATIN CAPITAL LETTER U WITH DIAERESIS
+0xDD	0x0118	#	LATIN CAPITAL LETTER E WITH OGONEK
+0xDE	0x021A	#	LATIN CAPITAL LETTER T WITH COMMA BELOW
+0xDF	0x00DF	#	LATIN SMALL LETTER SHARP S
+0xE0	0x00E0	#	LATIN SMALL LETTER A WITH GRAVE
+0xE1	0x00E1	#	LATIN SMALL LETTER A WITH ACUTE
+0xE2	0x00E2	#	LATIN SMALL LETTER A WITH CIRCUMFLEX
+0xE3	0x0103	#	LATIN SMALL LETTER A WITH BREVE
+0xE4	0x00E4	#	LATIN SMALL LETTER A WITH DIAERESIS
+0xE5	0x0107	#	LATIN SMALL LETTER C WITH ACUTE
+0xE6	0x00E6	#	LATIN SMALL LETTER AE
+0xE7	0x00E7	#	LATIN SMALL LETTER C WITH CEDILLA
+0xE8	0x00E8	#	LATIN SMALL LETTER E WITH GRAVE
+0xE9	0x00E9	#	LATIN SMALL LETTER E WITH ACUTE
+0xEA	0x00EA	#	LATIN SMALL LETTER E WITH CIRCUMFLEX
+0xEB	0x00EB	#	LATIN SMALL LETTER E WITH DIAERESIS
+0xEC	0x00EC	#	LATIN SMALL LETTER I WITH GRAVE
+0xED	0x00ED	#	LATIN SMALL LETTER I WITH ACUTE
+0xEE	0x00EE	#	LATIN SMALL LETTER I WITH CIRCUMFLEX
+0xEF	0x00EF	#	LATIN SMALL LETTER I WITH DIAERESIS
+0xF0	0x0111	#	LATIN SMALL LETTER D WITH STROKE
+0xF1	0x0144	#	LATIN SMALL LETTER N WITH ACUTE
+0xF2	0x00F2	#	LATIN SMALL LETTER O WITH GRAVE
+0xF3	0x00F3	#	LATIN SMALL LETTER O WITH ACUTE
+0xF4	0x00F4	#	LATIN SMALL LETTER O WITH CIRCUMFLEX
+0xF5	0x0151	#	LATIN SMALL LETTER O WITH DOUBLE ACUTE
+0xF6	0x00F6	#	LATIN SMALL LETTER O WITH DIAERESIS
+0xF7	0x015B	#	LATIN SMALL LETTER S WITH ACUTE
+0xF8	0x0171	#	LATIN SMALL LETTER U WITH DOUBLE ACUTE
+0xF9	0x00F9	#	LATIN SMALL LETTER U WITH GRAVE
+0xFA	0x00FA	#	LATIN SMALL LETTER U WITH ACUTE
+0xFB	0x00FB	#	LATIN SMALL LETTER U WITH CIRCUMFLEX
+0xFC	0x00FC	#	LATIN SMALL LETTER U WITH DIAERESIS
+0xFD	0x0119	#	LATIN SMALL LETTER E WITH OGONEK
+0xFE	0x021B	#	LATIN SMALL LETTER T WITH COMMA BELOW
+0xFF	0x00FF	#	LATIN SMALL LETTER Y WITH DIAERESIS
--- a/lisp/ChangeLog	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/ChangeLog	Fri Mar 29 04:49:13 2002 +0000
@@ -1,3 +1,132 @@
+2002-03-24  Ben Wing  <ben@xemacs.org>
+
+	* mule/english.el (ascii-right-to-left):
+	Define this charset now, since a bug was fixed that formerly
+	prevented it.
+	
+	* mule/ethio-util.el (ethio-fidel-to-java-buffer):
+	* mule/ethio-util.el (ethio-java-to-fidel-buffer):
+	Fix compile errors involving Unicode `characters', which should be
+	integers.
+
+2002-03-24  Ben Wing  <ben@xemacs.org>
+
+	* sound.el:
+	* sound.el (sound-default-alist):
+	Correct docs.
+
+	* msw-glyphs.el:
+
+	Set glyph-contrib-p to nil on hscroll, continuation, truncation so
+	that we don't get line jumpiness from them being larger than the
+	line height.
+
+	* mouse.el:
+	* mouse.el ((meta button1)):
+	* mouse.el (mouse-consolidated-yank):
+	* mouse.el (mouse-yank):
+	* mouse.el (mouse-track):
+	* mouse.el (variables): Removed.
+	* mouse.el (default-mouse-track-normalize-point):
+	* mouse.el (default-mouse-track-return-dragged-selection):
+	* mouse.el (mouse-track-by-lines): New.
+	* mouse.el (mouse-track-insert): Removed.
+	* mouse.el (mouse-track-adjust-by-lines): New.
+	* mouse.el (mouse-track-insert-1): New.
+	* mouse.el (mouse-track-insert-by-lines): New.
+	* mouse.el (mouse-track-delete-and-insert-by-lines): New.
+
+	New functions for line-oriented mouse selection, with meta held
+	down.  Extend mouse-track{,adjust,insert,delete-and-insert} this
+	way.  Move mouse-track-do-rectangle to meta-button2; not nearly so
+	useful (and doesn't really work correctly currently).
+	
+	* auto-save.el:
+	* auto-save.el (make-auto-save-file-name):
+	* auto-save.el (recover-all-files):
+	* check-features.el:
+	* check-features.el ((featurep 'tooltalk)):
+	* check-features.el ((featurep 'sparcworks)):
+	* code-files.el:
+	* code-files.el (insert-file-contents):
+	* etags.el (find-tag-default):
+	* files.el (normal-mode):
+	* files.el (backup-buffer):
+	* files.el (recover-session-finish):
+	* finder.el (finder-compile-keywords):
+	* font-lock.el (font-lock-pre-idle-hook):
+	* info.el (Info-suffixed-file):
+	* package-get.el:
+	* package-get.el (package-get-load-package-file):
+	* package-get.el (package-get):
+	* packages.el:
+	* packages.el (packages-load-package-lisps):
+	* simple.el:
+	* simple.el (show-message-log):
+	* simple.el (log-message):
+	* simple.el (remove-message):
+	* simple.el (log-warning-minimum-level):
+	* simple.el (display-warning-minimum-level):
+	* simple.el (warning-level-alist):
+	* simple.el (warning-level-<): New.
+	* simple.el (display-warning):
+	* simple.el (NOTE): New.
+	* simple.el (warn):
+	* simple.el (lwarn):
+	* subr.el:
+	* subr.el (backtrace-in-condition-handler-eliminating-handler): New.
+	* subr.el (with-trapping-errors): New.
+
+	New form with-trapping-errors; a consistent way to execute code,
+	catching all errors and displaying a warning, including a
+	backtrace showing where the error occurred.  Modify various files
+	to use this.
+	
+	Show all warnings in the echo area (in a format convenient for
+	this) as well as the Warnings buffer.  Change the interpretation
+	of display-warning-minimum-level so that warnings below this level
+	(now set at `warning') do not force the Warnings buffer to be
+	displayed, but still appear in the echo area.  The motivation for
+	this was `Unable to instantiate font' warnings, which should be
+	visible but are very annoying when the Warnings buffer pops up.
+
+	Change the meaning of warning level `alert' and define clearly
+	what the purpose of the various warning levels are.  Modify
+	various files consistent with the new definitions.
+
+	Mark all warnings with extents.
+ 	
+	* startup.el (load-init-file):
+	Modify so that a backtrace is seen when an error occurs.
+	
+	* help.el (view-warnings): New.
+	New function for viewing warnings buffer.
+	
+	* help.el:
+	* help.el (print-recent-messages):
+	* simple.el:
+	* simple.el (show-message-log):
+	Integrate show-message-log with view-lossage.  Add option to
+	view-lossage to view only the messages.  Clear message first so
+	latest message is seen.
+	
+	* menubar-items.el:
+	* menubar-items.el (default-menubar):
+	* menubar-items.el (bookmark-menu-filter): Removed.
+	Various rearrangements and fixes.
+	
+	* msw-faces.el:
+	* msw-faces.el (gui-element):
+	* msw-faces.el (mswindows-init-device-faces):
+	Set gui-element font globally instead of on each device.
+
+	* msw-font-menu.el (mswindows-font-menu-font-data): Fix bug.
+
+	* simple.el (debug-print-1): New.
+	* simple.el (debug-print):
+	* simple.el (debug-backtrace): New.
+	New debugging functions.
+
 2002-03-20  John Paul Wallington  <jpw@shootybangbang.com>
 
 	* menubar-items.el (list-all-buffers): New function.
--- a/lisp/auto-save.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/auto-save.el	Fri Mar 29 04:49:13 2002 +0000
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1992 by Sebastian Kremer <sk@thp.uni-koeln.de>
-;; Copyright (C) 2001 Ben Wing.
+;; Copyright (C) 2001, 2002 Ben Wing.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
 ;; Maintainer: XEmacs Development Team
@@ -11,7 +11,7 @@
 
 ;; 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 1, or (at your option)
+;; 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
@@ -254,75 +254,69 @@
 		      buffer-file-truename
 		      (and buffer-file-name
 			   (expand-file-name buffer-file-name))))
-  (condition-case error-data
-      (let (
-	    ;; So autosavename looks like #%...#, roughly as with the
-	    ;; old make-auto-save-file-name function.  The
-	    ;; make-temp-name inserts the pid of this Emacs: this
-	    ;; avoids autosaving from two Emacses into the same file.
-	    ;; It cannot be recovered automatically then because in
-	    ;; the next Emacs session (the one after the crash) the
-	    ;; pid will be different, but file-less buffers like
-	    ;; *mail* must be recovered manually anyway.
-
-	    ;; jwz: putting the emacs PID in the auto-save file name is bad
-	    ;; news, because that defeats auto-save-recovery of *mail*
-	    ;; buffers -- the (sensible) code in sendmail.el calls
-	    ;; (make-auto-save-file-name) to determine whether there is
-	    ;; unsent, auto-saved mail to recover. If that mail came from a
-	    ;; previous emacs process (far and away the most likely case)
-	    ;; then this can never succeed as the pid differs.
-	    ;;(name-prefix (if file-name nil (make-temp-name "#%")))
-	    (name-prefix (if file-name nil "#%"))
+  (with-trapping-errors
+    :operation 'make-auto-save-file-name
+    :error-form
+    (let ((fname
+	   (if file-name
+	       (concat (file-name-directory file-name)
+		       "#"
+		       (file-name-nondirectory file-name)
+		       "#")
+	     (expand-file-name
+	      (concat "#%" (auto-save-escape-name (buffer-name))
+		      "#")))))
+      (if (or (file-writable-p fname)
+	      (file-exists-p fname))
+	  fname
+	(expand-file-name (concat "~/"
+				  (file-name-nondirectory fname)))))
+    (let (
+	  ;; So autosavename looks like #%...#, roughly as with the
+	  ;; old make-auto-save-file-name function.  The
+	  ;; make-temp-name inserts the pid of this Emacs: this
+	  ;; avoids autosaving from two Emacses into the same file.
+	  ;; It cannot be recovered automatically then because in
+	  ;; the next Emacs session (the one after the crash) the
+	  ;; pid will be different, but file-less buffers like
+	  ;; *mail* must be recovered manually anyway.
 
-	    (save-name (or file-name
-			   ;; Prevent autosave errors.  Buffername
-			   ;; (to become non-dir part of filename) will
-			   ;; be escaped twice.  Don't care.
-			   (auto-save-escape-name (buffer-name))))
-	    (remote-p (and-fboundp 'efs-ftp-path
-			(stringp file-name)
-			(efs-ftp-path file-name))))
-	;; Return the appropriate auto save file name:
-	(expand-file-name;; a buffername needs this, a filename not
-	 (cond (remote-p
-		(if efs-auto-save-remotely
-		    (auto-save-name-in-same-directory save-name)
-		  ;; We have to use the `fixed-directory' now since the
-		  ;; `same-directory' would be remote.
-		  ;; It will use the fallback if needed.
-		  (auto-save-name-in-fixed-directory save-name)))
-	       ;; Else it is a local file (or a buffer without a file,
-	       ;; hence the name-prefix).
-	       ((or auto-save-directory auto-save-hash-p)
-		;; Hashed files always go into the special hash dir,
-		;; never in the same directory, to make recognizing
-		;; reliable.
-		(auto-save-name-in-fixed-directory save-name name-prefix))
-	       (t
-		(auto-save-name-in-same-directory save-name name-prefix)))))
+	  ;; jwz: putting the emacs PID in the auto-save file name is bad
+	  ;; news, because that defeats auto-save-recovery of *mail*
+	  ;; buffers -- the (sensible) code in sendmail.el calls
+	  ;; (make-auto-save-file-name) to determine whether there is
+	  ;; unsent, auto-saved mail to recover. If that mail came from a
+	  ;; previous emacs process (far and away the most likely case)
+	  ;; then this can never succeed as the pid differs.
+	  ;;(name-prefix (if file-name nil (make-temp-name "#%")))
+	  (name-prefix (if file-name nil "#%"))
 
-    ;; If any error occurs in the above code, return what the old
-    ;; version of this function would have done.  It is not ok to
-    ;; return nil, e.g., when after-find-file tests
-    ;; file-newer-than-file-p, nil would bomb.
-
-    (error (warn "Error caught in `make-auto-save-file-name':\n%s"
-		 (error-message-string error-data))
-	   (let ((fname
-		  (if file-name
-		      (concat (file-name-directory file-name)
-			      "#"
-			      (file-name-nondirectory file-name)
-			      "#")
-		    (expand-file-name
-		     (concat "#%" (auto-save-escape-name (buffer-name))
-			     "#")))))
-	     (if (or (file-writable-p fname)
-		     (file-exists-p fname))
-		 fname
-	       (expand-file-name (concat "~/"
-					 (file-name-nondirectory fname))))))))
+	  (save-name (or file-name
+			 ;; Prevent autosave errors.  Buffername
+			 ;; (to become non-dir part of filename) will
+			 ;; be escaped twice.  Don't care.
+			 (auto-save-escape-name (buffer-name))))
+	  (remote-p (and-fboundp 'efs-ftp-path
+		      (stringp file-name)
+		      (efs-ftp-path file-name))))
+      ;; Return the appropriate auto save file name:
+      (expand-file-name;; a buffername needs this, a filename not
+       (cond (remote-p
+	      (if efs-auto-save-remotely
+		  (auto-save-name-in-same-directory save-name)
+		;; We have to use the `fixed-directory' now since the
+		;; `same-directory' would be remote.
+		;; It will use the fallback if needed.
+		(auto-save-name-in-fixed-directory save-name)))
+	     ;; Else it is a local file (or a buffer without a file,
+	     ;; hence the name-prefix).
+	     ((or auto-save-directory auto-save-hash-p)
+	      ;; Hashed files always go into the special hash dir,
+	      ;; never in the same directory, to make recognizing
+	      ;; reliable.
+	      (auto-save-name-in-fixed-directory save-name name-prefix))
+	     (t
+	      (auto-save-name-in-same-directory save-name name-prefix)))))))
 
 (defun auto-save-file-name-p (filename)
   "Return non-nil if FILENAME can be yielded by `make-auto-save-file-name'.
@@ -570,7 +564,7 @@
 	    file (auto-save-original-name afile)
 	    savefiles (cdr savefiles))
       (cond ((and file (not (file-newer-than-file-p afile file)))
-	     (warn "Autosave file \"%s\" is not current." afile))
+	     (warn "Autosave file \"%s\" is not current" afile))
 	    (t
 	     (incf total)
 	     (with-output-to-temp-buffer "*Directory*"
--- a/lisp/check-features.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/check-features.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 ;;; check-features.el --- Do a sanity check on an XEmacs build
 
 ;; Copyright (C) 1998 by Free Software Foundation, Inc.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Author: SL Baur <steve@xemacs.org>
 ;; Keywords: internal
@@ -40,18 +41,20 @@
       (package-require 'tooltalk 1.0)
     (t (progn
 	 ;; (setq build-error 1)
-	 (message "Warning:  This XEmacs is built with tooltalk support but")
-	 (message "does not have a tooltalk package installed.  Without the")
-	 (message "tooltalk lisp package, Tooltalk support is broken.")))))
+	 (lwarn 'tooltalk 'alert
+	   "Warning:  This XEmacs is built with tooltalk support but
+does not have a tooltalk package installed.  Without the
+tooltalk lisp package, Tooltalk support is broken.")))))
 
 (when (featurep 'sparcworks)
   (condition-case nil
       (package-require 'Sun 1.0)
     (t (progn
 	 ;; (setq build-error 1)
-	 (message "Warning:  This XEmacs is built with sparcworks support but")
-	 (message "does not have the Sun package installed.  Without the Sun")
-	 (message "lisp package, Sparcworks support will be broken.")))))
+	 (lwarn 'sparcworks 'alert
+	   "Warning:  This XEmacs is built with sparcworks support but
+does not have the Sun package installed.  Without the Sun
+lisp package, Sparcworks support will be broken.")))))
 
 (kill-emacs build-error)
 
--- a/lisp/code-files.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/code-files.el	Fri Mar 29 04:49:13 2002 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Amdahl Corporation.
 ;; Copyright (C) 1995 Sun Microsystems.
-;; Copyright (C) 2001 Ben Wing.
+;; Copyright (C) 2001, 2002 Ben Wing.
 
 ;; This file is part of XEmacs.
 
@@ -394,7 +394,7 @@
 	      (setq return-val coding-system)
 	    (if (null (find-coding-system coding-system))
 		(progn
-		  (message
+		  (lwarn 'coding-system 'notice
 		   "Invalid coding-system (%s), using 'undecided"
 		   coding-system)
 		  (setq coding-system 'undecided)))
--- a/lisp/etags.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/etags.el	Fri Mar 29 04:49:13 2002 +0000
@@ -581,12 +581,10 @@
 ;; Return a default tag to search for, based on the text at point.
 (defun find-tag-default ()
   (or (and (not (memq find-tag-default-hook '(nil find-tag-default)))
-	   (condition-case data
-	       (funcall find-tag-default-hook)
-	     (error
-	      (warn "Error in find-tag-default-hook signalled error: %s"
-		    (error-message-string data))
-	      nil)))
+	   (with-trapping-errors 
+	     :function 'find-tag-default-hook
+	     :error-form nil
+	     (funcall find-tag-default-hook)))
       (symbol-near-point)))
 
 ;; This function depends on the following symbols being bound properly:
--- a/lisp/files.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/files.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1209,17 +1209,17 @@
 run `normal-mode' explicitly."
   (interactive)
   (or find-file (funcall (or default-major-mode 'fundamental-mode)))
-  (and (condition-case err
-           (progn (set-auto-mode)
-                  t)
-         (error (message "File mode specification error: %s"
-                         (prin1-to-string err))
-                nil))
-       (condition-case err
-           (hack-local-variables (not find-file))
-         (error (lwarn 'local-variables 'warning
-		  "File local-variables error: %s"
-		  (error-message-string err))))))
+  (and (with-trapping-errors
+	 :operation "File mode specification"
+	 :class 'file-mode-spec
+	 :error-form nil
+	 (set-auto-mode)
+	 t)
+       (with-trapping-errors
+	 :operation "File local-variables"
+	 :class 'local-variables
+	 :error-form nil
+	 (hack-local-variables (not find-file)))))
 
 ;; #### This variable sucks in the package model.  There should be a
 ;; way for new packages to add their entries to auto-mode-alist in a
@@ -2064,7 +2064,7 @@
 			     (setq backupname
 				   (expand-file-name
 				    (convert-standard-filename "~/%backup%~")))
-			     (message "Cannot write backup file; backing up in ~/%%backup%%~")
+			     (lwarn 'file 'alert "Cannot write backup file; backing up in ~/%%backup%%~")
 			     (sleep-for 1)
 			     (condition-case ()
 				 (copy-file real-file-name backupname t t)
@@ -3073,7 +3073,7 @@
 			       (condition-case nil
 				   (save-excursion (recover-file file))
 				 (error
-				  "Failed to recover `%s'" file)))
+				  (lwarn 'recover 'alert "Failed to recover `%s'" file))))
 			     files
 			     '("file" "files" "recover"))
 	    (message "No files can be recovered from this session now")))
--- a/lisp/finder.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/finder.el	Fri Mar 29 04:49:13 2002 +0000
@@ -186,10 +186,11 @@
 		  (buffer-disable-undo (current-buffer))
 		  (erase-buffer)
 		  (insert-file-contents (expand-file-name f d))
-		  (condition-case err
-		      (setq summary  (lm-synopsis)
-			    keywords (lm-keywords))
-		    (t (message "finder: error processing %s %S" f err))))
+		  (with-trapping-errors
+		    :operation (format "processing %s in finder" f)
+		    :class 'finder
+		    (setq summary  (lm-synopsis)
+			  keywords (lm-keywords))))
 		(when summary
 		  (insert (format "    (\"%s\"\n        " f))
 		  (prin1 summary (current-buffer))
--- a/lisp/font-lock.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/font-lock.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1197,11 +1197,9 @@
 (defvar font-lock-range-table (make-range-table))
 
 (defun font-lock-pre-idle-hook ()
-  (condition-case font-lock-error
-      (if (> (hash-table-count font-lock-pending-buffer-table) 0)
-	  (font-lock-fontify-pending-extents))
-    (error (warn "Error caught in `font-lock-pre-idle-hook': %s"
-		 font-lock-error))))
+  (with-trapping-errors 'font-lock-pre-idle-hook
+    (if (> (hash-table-count font-lock-pending-buffer-table) 0)
+	(font-lock-fontify-pending-extents))))
 
 ;;; called when any modification is made to buffer text.  This function
 ;;; remembers the changed ranges until the next redisplay, at which point
--- a/lisp/help.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/help.el	Fri Mar 29 04:49:13 2002 +0000
@@ -843,6 +843,7 @@
 (defun print-recent-messages (n)
   "Print N most recent messages to standard-output, most recent first.
 If N is nil, all messages will be printed."
+  (clear-message) ;; make sure current message goes into log
   (save-excursion
     (let ((buffer (get-buffer-create " *Message-Log*"))
 	  oldpoint extent)
@@ -860,25 +861,42 @@
 	  (forward-line -1 buffer))
 	(insert-buffer-substring buffer (point buffer) oldpoint)))))
 
-(defun view-lossage ()
+(defun view-warnings ()
+  "Display warnings issued."
+  (interactive)
+  (with-displaying-help-buffer
+   (lambda ()
+     (let ((buf (get-buffer "*Warnings*")))
+       (when buf
+	 (save-excursion
+	   (set-buffer standard-output)
+	   (map-extents
+	    #'(lambda (extent arg)
+		(goto-char (point-min))
+		(insert (extent-string extent)))
+	    buf)))))
+   "warnings"))
+
+(defun view-lossage (&optional no-keys)
   "Display recent input keystrokes and recent minibuffer messages.
 The number of keys shown is controlled by `view-lossage-key-count'.
 The number of messages shown is controlled by `view-lossage-message-count'."
   (interactive)
   (with-displaying-help-buffer
    (lambda ()
-     (princ (key-description (recent-keys view-lossage-key-count)))
-     (save-excursion
-       (set-buffer standard-output)
-       (goto-char (point-min))
-       (insert "Recent keystrokes:\n\n")
-       (while (progn (move-to-column 50) (not (eobp)))
-	 (search-forward " " nil t)
-	 (insert "\n")))
-     ;; XEmacs addition: copy the messages from " *Message-Log*",
-     ;; reversing their order and handling multiline messages
-     ;; correctly.
-     (princ "\n\n\nRecent minibuffer messages (most recent first):\n\n")
+     (unless no-keys
+       (princ (key-description (recent-keys view-lossage-key-count)))
+       (save-excursion
+	 (set-buffer standard-output)
+	 (goto-char (point-min))
+	 (insert "Recent keystrokes:\n\n")
+	 (while (progn (move-to-column 50) (not (eobp)))
+	   (search-forward " " nil t)
+	   (insert "\n")))
+       (princ "\n\n\n"))
+     ;; Copy the messages from " *Message-Log*", reversing their order and
+     ;; handling multiline messages correctly.
+     (princ "Recent minibuffer messages (most recent first):\n\n")
      (print-recent-messages view-lossage-message-count))
    "lossage"))
 
--- a/lisp/info.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/info.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1473,26 +1473,26 @@
 	  file files)
       (setq name (file-name-nondirectory name))
       (setq files
-	    (condition-case data ;; protect against invalid directory
-		;; First, try NAME[.<suffix>]
-		(append
+	    (with-trapping-errors ;; protect against invalid directory
+	      :operation (format "directory `%s'" dir)
+	      :class 'info
+	      :error-form nil
+	      :no-backtrace t
+	      ;; First, try NAME[.<suffix>]
+	      (append
+	       (directory-files dir 'fullname
+				(concat "^" (regexp-quote name) suff-match)
+				nil t)
+	       (if exact
+		   nil
+		 ;; Then, try to match the name independantly of the
+		 ;; characters case.
 		 (directory-files dir 'fullname
-				  (concat "^" (regexp-quote name) suff-match)
-				  nil t)
-		 (if exact
-		     nil
-		   ;; Then, try to match the name independantly of the
-		   ;; characters case.
-		   (directory-files dir 'fullname
-				    (Info-all-case-regexp
-				     (concat "^"
-					     (regexp-quote name)
-					     suff-match))
-				    nil t)))
-	      (t
-	       (display-warning 'info
-		 (format "directory `%s' error: %s" dir data))
-	       nil)))
+				  (Info-all-case-regexp
+				   (concat "^"
+					   (regexp-quote name)
+					   suff-match))
+				  nil t)))))
       (while (setq file (pop files))
 	(and (file-regular-p file)
 	     (throw 'found file)))
--- a/lisp/menubar-items.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/menubar-items.el	Fri Mar 29 04:49:13 2002 +0000
@@ -282,7 +282,7 @@
       ["%_Revert Buffer" revert-buffer
        :active (or buffer-file-name revert-buffer-function)
        :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
-      ("%_Rever%_t/Recover"
+      ("Rever%_t/Recover"
       ("Revert Buffer with Specified %_Encoding"
        :filter
        (lambda (menu)
@@ -346,6 +346,9 @@
        :active (not (one-window-p t))]
       ["Un-Split (Keep %_Others)" delete-window
        :active (not (one-window-p t))]
+      ["Balance %_Windows" balance-windows
+       :active (not (one-window-p t))]
+      ["Shrink Window to %_Fit" shrink-window-if-larger-than-buffer]
       "----"
       ("N%_arrow"
        ["%_Narrow to Region" narrow-to-region :active (region-exists-p)]
@@ -356,17 +359,58 @@
 				    (/= (point-max) (1+ (buffer-size))))]
        )
       "----"
-      ["Show Message %_Log" show-message-log]
-      "----"
       ["%_Goto Line..." goto-line]
-      ["%_What Line" what-line]
-      ("%_Bookmarks"
-       :filter bookmark-menu-filter)
+      ["Beginning of %_Defun" beginning-of-defun]
+      ["%_End of Defun" end-of-defun]
+      ["%_Count Lines in Buffer" count-lines-buffer
+       :included (not (region-active-p))]
+      ["%_Count Lines in Region" count-lines-region
+       :included (region-active-p)]
       "----"
       ["%_Jump to Previous Mark" (set-mark-command t)
        :active (mark t)]
+      ["Se%_t Bookmark" bookmark-set
+       :active (fboundp 'bookmark-set)]
+      ("%_Bookmarks"
+       :filter
+       (lambda (menu)
+	 (let ((alist (and-boundp 'bookmark-alist
+			bookmark-alist)))
+	   (if (not alist)
+	       menu
+	     (let ((items
+		    (submenu-generate-accelerator-spec
+		     (mapcar #'(lambda (bmk)
+				 `[,bmk (bookmark-jump ',bmk)])
+			     (bookmark-all-names)))))
+	       (append menu '("---") items)))))
+       "---"
+       ["Insert %_Contents" bookmark-menu-insert
+	:active (fboundp 'bookmark-menu-insert)]
+       ["Insert L%_ocation" bookmark-menu-locate
+	:active (fboundp 'bookmark-menu-locate)]
+       "---"
+       ["%_Rename Bookmark" bookmark-menu-rename
+	:active (fboundp 'bookmark-menu-rename)]
+       ("%_Delete Bookmark"
+	 :filter (lambda (menu)
+		   (submenu-generate-accelerator-spec
+		    (mapcar #'(lambda (bmk)
+				`[,bmk (bookmark-delete ',bmk)])
+			    (bookmark-all-names)))))
+       ["%_Edit Bookmark List" bookmark-bmenu-list
+	:active (and-boundp 'bookmark-alist bookmark-alist)]
+       "---"
+       ["%_Save Bookmarks"        bookmark-save
+	:active (and-boundp 'bookmark-alist bookmark-alist)]
+       ["Save Bookmarks %_As..."  bookmark-write
+	:active (and-boundp 'bookmark-alist bookmark-alist)]
+       ["%_Load a Bookmark File" bookmark-load
+	:active (fboundp 'bookmark-load)]
+       )
       )
 
+
      ("C%_mds"
       ["Repeat %_Last Complex Command..." repeat-complex-command]
       ["E%_valuate Lisp Expression..." eval-expression]
@@ -379,15 +423,11 @@
       ["E%_xecute Last Macro" call-last-kbd-macro
        :active last-kbd-macro]
       ("%_Other Macro"
+       ["Edit %_Last Macro" edit-last-kbd-macro
+	:active last-kbd-macro]
+       ["%_Edit Macro..." edit-kbd-macro]
        ["%_Append to Last Macro" (start-kbd-macro t)
 	:active (and (not defining-kbd-macro) last-kbd-macro)]
-       ["%_Query User During Macro" kbd-macro-query
-	:active defining-kbd-macro]
-       ["Enter %_Recursive Edit During Macro" (kbd-macro-query t)
-	:active defining-kbd-macro]
-       "---"
-       ["E%_xecute Last Macro on Region Lines"
-	:active (and last-kbd-macro (region-exists-p))]
        "---"
        ["%_Name Last Macro..." name-last-kbd-macro
 	:active last-kbd-macro]
@@ -395,9 +435,13 @@
 	:active (and last-kbd-macro
 		     (fboundp 'assign-last-kbd-macro-to-key))]
        "---"
-       ["%_Edit Macro..." edit-kbd-macro]
-       ["Edit %_Last Macro" edit-last-kbd-macro
-	:active last-kbd-macro]
+       ["E%_xecute Last Macro on Region Lines"
+	:active (and last-kbd-macro (region-exists-p))]
+       "---"
+       ["%_Query User During Macro" kbd-macro-query
+	:active defining-kbd-macro]
+       ["Enter %_Recursive Edit During Macro" (kbd-macro-query t)
+	:active defining-kbd-macro]
        "---"
        ["%_Insert Named Macro into Buffer..." insert-kbd-macro]
        ["Read Macro from Re%_gion" read-kbd-macro
@@ -565,7 +609,7 @@
        ["Grep %_All Files in Current Directory..."
 	grep-all-files-in-current-directory
 	:active (fboundp 'grep-all-files-in-current-directory)]
-       ["G%_rep All Files in Current Directory and Below..."
+       ["Grep All Files in Current Directory %_Recursively..."
 	grep-all-files-in-current-directory-and-below
 	:active (fboundp 'grep-all-files-in-current-directory-and-below)]
        "---"
@@ -1536,9 +1580,7 @@
       ["%_About XEmacs..." about-xemacs]
       ["%_Home Page (www.xemacs.org)" xemacs-www-page
        :active (fboundp 'browse-url)]
-      "-----"
       ["What's %_New in XEmacs" view-emacs-news]
-      ["%_Obtaining XEmacs" describe-distribution]
       "-----"
       ("%_Info (Online Docs)"
        ["Info Con%_tents" (Info-goto-node "(dir)")]
@@ -1590,7 +1632,6 @@
        ["Describe %_Key..." describe-key]
        ["Show %_Bindings" describe-bindings]
        ["Show M%_ouse Bindings" describe-pointer]
-       ["%_Recent Keys" view-lossage]
        "-----"
        ["Describe %_Function..." describe-function]
        ["Describe %_Variable..." describe-variable]
@@ -1620,7 +1661,7 @@
 	     ["Show %_Diagnosis for MULE" mule-diag :active nil]
 	     ["Show \"%_hello\" in Many Languages" view-hello-file]
 	     )))
-      ("%_Misc"
+      ("%_Other"
        ["%_Current Installation Info" describe-installation
 	:active (boundp 'Installation-string)]
        ["%_No Warranty" describe-no-warranty]
@@ -1629,7 +1670,9 @@
        ["View %_Splash Screen" xemacs-splash-buffer]
        ["%_Unix Manual..." manual-entry])
       "-----"
-      ["%_Recent Messages" view-lossage]
+      ["Recent %_Messages" (view-lossage t)]
+      ["Recent %_Keystrokes" view-lossage]
+      ["Recent %_Warnings" view-warnings]
       ["Send %_Bug Report..." report-xemacs-bug
        :active (fboundp 'report-xemacs-bug)])))
 
@@ -1656,47 +1699,6 @@
 
 (defvar put-buffer-names-in-file-menu t)
 
-
-;;; The Bookmarks menu
-
-(defun bookmark-menu-filter (&rest ignore)
-  (declare (special bookmark-alist))
-  (let ((definedp (and (boundp 'bookmark-alist)
-		       bookmark-alist
-		       t)))
-    `(,(if definedp
-	   '("%_Jump to Bookmark"
-	     :filter (lambda (&rest junk)
-		       (submenu-generate-accelerator-spec
-			(mapcar #'(lambda (bmk)
-				    `[,bmk (bookmark-jump ',bmk)])
-				(bookmark-all-names)))))
-	 ["%_Jump to Bookmark" nil nil])
-      ["Set %_Bookmark" bookmark-set
-       :active (fboundp 'bookmark-set)]
-      "---"
-      ["Insert %_Contents" bookmark-menu-insert
-       :active (fboundp 'bookmark-menu-insert)]
-      ["Insert L%_ocation" bookmark-menu-locate
-       :active (fboundp 'bookmark-menu-locate)]
-      "---"
-      ["%_Rename Bookmark" bookmark-menu-rename
-       :active (fboundp 'bookmark-menu-rename)]
-      ,(if definedp
-	   '("%_Delete Bookmark"
-	     :filter (lambda (&rest junk)
-		       (submenu-generate-accelerator-spec
-			(mapcar #'(lambda (bmk)
-				    `[,bmk (bookmark-delete ',bmk)])
-				(bookmark-all-names)))))
-	 ["%_Delete Bookmark" nil nil])
-      ["%_Edit Bookmark List" bookmark-bmenu-list	,definedp]
-      "---"
-      ["%_Save Bookmarks"        bookmark-save		,definedp]
-      ["Save Bookmarks %_As..."  bookmark-write		,definedp]
-      ["%_Load a Bookmark File" bookmark-load
-       :active (fboundp 'bookmark-load)])))
-
 ;;; The Buffers menu
 
 (defgroup buffers-menu nil
--- a/lisp/mouse.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/mouse.el	Fri Mar 29 04:49:13 2002 +0000
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1988, 1992-4, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Tinker Systems
-;; Copyright (C) 1995, 1996, 2000 Ben Wing.
+;; Copyright (C) 1995, 1996, 2000, 2002 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: mouse, dumped
@@ -45,10 +45,15 @@
 
 (global-set-key 'button1 'mouse-track)
 (global-set-key '(shift button1) 'mouse-track-adjust)
+(global-set-key '(meta button1) 'mouse-track-by-lines)
+(global-set-key '(meta shift button1) 'mouse-track-adjust-by-lines)
 (global-set-key '(control button1) 'mouse-track-insert)
 (global-set-key '(control shift button1) 'mouse-track-delete-and-insert)
-(global-set-key '(meta button1) 'mouse-track-do-rectangle)
+(global-set-key '(meta control button1) 'mouse-track-insert-by-lines)
+(global-set-key '(meta shift control button1)
+  'mouse-track-delete-and-insert-by-lines)
 (global-set-key 'button2 'mouse-track)
+(global-set-key '(meta button2) 'mouse-track-do-rectangle)
 
 (defgroup mouse nil
   "Window system-independent mouse support."
@@ -84,9 +89,11 @@
   "Function that is called upon by `mouse-yank' to actually insert text.")
 
 (defun mouse-consolidated-yank ()
-  "Insert the current selection or, if there is none under X insert
-the X cutbuffer.  A mark is pushed, so that the inserted text lies
-between point and mark."
+  "Insert the current selection at point.
+\(Under X Windows, if there is none, insert the X cutbuffer.)  A mark is
+pushed, so that the inserted text lies between point and mark.  This is the
+default value of `mouse-yank-function', and as such is called by
+`mouse-yank' to do the actual work."
   (interactive)
   (if (and (not (console-on-window-system-p))
 	   (and (featurep 'gpm)
@@ -176,7 +183,10 @@
   "Paste text with the mouse.
 If the variable `mouse-yank-at-point' is nil, then pasting occurs at the
 location of the click; otherwise, pasting occurs at the current cursor
-location."
+location.  This calls the value of the variable `mouse-yank-function'
+(normally the function `mouse-consolidated-yank') to do the actual work.
+This is normally called as a result of a click of button2 by
+`default-mouse-track-click-hook'."
   (interactive "e")
   (and (not mouse-yank-at-point)
        (mouse-set-point event))
@@ -627,9 +637,14 @@
 )
 
 (defun mouse-track (event &optional overriding-hooks)
-  "Generalized mouse-button handler.  This should be bound to a mouse button.
-The behavior of this function is customizable using various hooks and
-variables: see `mouse-track-click-hook', `mouse-track-drag-hook',
+  "Generalized mouse-button handler.
+This is the function that handles standard mouse behavior -- moving point
+when clicked, selecting text when dragged, etc. -- and should be bound to a
+mouse button (normally, button1 and button2).
+
+This allows for overloading of different mouse strokes with different
+commands.  The behavior of this function is customizable using various
+hooks and variables: see `mouse-track-click-hook', `mouse-track-drag-hook',
 `mouse-track-drag-up-hook', `mouse-track-down-hook', `mouse-track-up-hook',
 `mouse-track-cleanup-hook', `mouse-track-multi-click-time',
 `mouse-track-scroll-delay', `mouse-track-x-threshold', and
@@ -661,9 +676,12 @@
 pieces of text which are larger than the visible part of the buffer; the
 buffer will scroll as necessary.
 
-The selected text becomes the current X Selection.  The point will be left
-at the position at which you released the button, and the mark will be left
-at the initial click position."
+The point will be left at the position at which you released the button,
+and the mark will be left at the initial click position.
+
+Under X Windows, the selected text becomes the current X Selection, and can
+be immediately inserted elsewhere using button2.  Under MS Windows, this
+also works, because the behavior is emulated."
   (interactive "e")
   (let ((mouse-down t)
 	(xthresh (eval mouse-track-x-threshold))
@@ -842,7 +860,7 @@
 ;; This remembers the last position at which the user clicked, for the
 ;; benefit of mouse-track-adjust (for example, button1; scroll until the
 ;; position of the click is off the frame; then Sh-button1 to select the
-;; new region.
+;; new region).
 (defvar default-mouse-track-previous-point nil)
 
 (defun default-mouse-track-set-point (event window)
@@ -919,7 +937,16 @@
 	       (default-mouse-track-beginning-of-word
 		 (default-mouse-track-symbolp type))))))
 	((eq type 'line)
-	 (if forwardp (end-of-line) (beginning-of-line)))
+	 (if forwardp
+	     ;; Counter-kludge.  If we are adjusting a line-oriented
+	     ;; selection, default-mouse-track-return-dragged-selection
+	     ;; fixed it to include the final newline.  Unfortunately, that
+	     ;; will cause us to add another line at the end (the wrong
+	     ;; side of the selection) unless we take evasive action.
+	     (unless (and default-mouse-track-adjust
+			  (bolp))
+	       (end-of-line))
+	   (beginning-of-line)))
 	((eq type 'buffer)
 	 (if forwardp (end-of-buffer) (beginning-of-buffer)))))
 
@@ -1268,12 +1295,14 @@
 	  (extent
 	   (setq result (cons (extent-start-position extent)
 			      (extent-end-position extent)))))
-    ;; Minor kludge: if we're selecting in line-mode, include the
-    ;; final newline.  It's hard to do this in *-normalize-point.
+    ;; Minor kludge: if we're selecting in line-mode, include the final
+    ;; newline.  It's hard to do this in *-normalize-point.  Unfortunately
+    ;; this necessitates a counter-kludge in
+    ;; default-mouse-track-normalize-point.
     (if (and result (eq default-mouse-track-type 'line))
 	(let ((end-p (= (point) (cdr result))))
 	  (goto-char (cdr result))
-	  (if (not (eobp))
+	  (if (and (eolp) (not (eobp)))
 	      (setcdr result (1+ (cdr result))))
 	  (goto-char (if end-p (cdr result) (car result)))))
 ;;;	  ;; Minor kludge sub 2.  If in char mode, and we drag the
@@ -1362,6 +1391,14 @@
   (let ((mouse-track-rectangle-p t))
 	(mouse-track event)))
 
+(defun mouse-track-by-lines (event)
+  "Make a line-by-line selection with the mouse.
+This actually works the same as `mouse-track' (which handles all
+mouse-button behavior) but forces whole lines to be selected."
+  (interactive "e")
+  (let ((default-mouse-track-type-list '(line)))
+    (mouse-track event)))
+
 (defun mouse-track-adjust (event)
   "Extend the existing selection.  This should be bound to a mouse button.
 The selection will be enlarged or shrunk so that the point of the mouse
@@ -1385,13 +1422,23 @@
   (let ((default-mouse-track-adjust t))
     (mouse-track-default event)))
 
-(defun mouse-track-insert (event &optional delete)
-  "Make a selection with the mouse and insert it at point.
-This is exactly the same as the `mouse-track' command on \\[mouse-track],
-except that point is not moved; the selected text is immediately inserted
-after being selected\; and the selection is immediately disowned afterwards."
+(defun mouse-track-adjust-by-lines (event)
+  "Extend the existing selection by lines.
+This works the same as `mouse-track-adjust' (bound to \\[mouse-track-adjust])
+but forces whole lines to be selected."
+  (interactive "e")
+  (let ((default-mouse-track-type-list '(line))
+	(default-mouse-track-adjust t))
+    (mouse-track event)))
+
+(defun mouse-track-insert-1 (event &optional delete line-p)
+  "Guts of mouse-track-insert and friends.
+If DELETE, delete the selection as well as inserting it at the new place.
+If LINE-P, select by lines and insert before current line."
   (interactive "*e")
-  (let (s selreg)
+  (let ((default-mouse-track-type-list
+	  (if line-p '(line) default-mouse-track-type-list))
+	s selreg)
     (flet ((Mouse-track-insert-drag-up-hook (event count)
 	     (setq selreg
 		   (default-mouse-track-return-dragged-selection event))
@@ -1415,15 +1462,44 @@
 			    (buffer-substring (car pair) (cdr pair))
 			  (if delete
 			      (kill-region (car pair) (cdr pair))))))))))
-    (or (null s) (equal s "") (insert s))))
+    (or (null s) (equal s "")
+	(progn
+	  (if line-p (beginning-of-line))
+	  (insert s)))))
+
+(defun mouse-track-insert (event)
+  "Make a selection with the mouse and insert it at point.
+This works the same as just selecting text using the mouse (the
+`mouse-track' command), except that point is not moved; the selected text
+is immediately inserted after being selected\; and the selection is
+immediately disowned afterwards."
+  (interactive "*e")
+  (mouse-track-insert-1 event))
 
 (defun mouse-track-delete-and-insert (event)
-  "Make a selection with the mouse and insert it at point.
-This is exactly the same as the `mouse-track' command on \\[mouse-track],
-except that point is not moved; the selected text is immediately inserted
-after being selected\; and the text of the selection is deleted."
+  "Make a selection with the mouse and move it to point.
+This works the same as just selecting text using the mouse (the
+`mouse-track' command), except that point is not moved; the selected text
+is immediately inserted after being selected\; and the text of the
+selection is deleted."
   (interactive "*e")
-  (mouse-track-insert event t))
+  (mouse-track-insert-1 event t))
+
+(defun mouse-track-insert-by-lines (event)
+  "Make a line-oriented selection with the mouse and insert it at line start.
+This is similar to `mouse-track-insert' except that it always selects
+entire lines and inserts the lines before the current line rather than at
+point."
+  (interactive "*e")
+  (mouse-track-insert-1 event nil t))
+
+(defun mouse-track-delete-and-insert-by-lines (event)
+  "Make a line-oriented selection with the mouse and move it to line start.
+This is similar to `mouse-track-insert' except that it always selects
+entire lines and inserts the lines before the current line rather than at
+point."
+  (interactive "*e")
+  (mouse-track-insert-1 event nil t))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;
 
--- a/lisp/msw-faces.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/msw-faces.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 ;;; msw-faces.el --- mswindows-specific face stuff.
 
 ;;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-;;; Copyright (C) 1995, 1996 Ben Wing.
+;;; Copyright (C) 1995, 1996, 2002 Ben Wing.
 
 ;; Author: Jamie Zawinski
 ;; Modified by:  Chuck Thompson
@@ -29,6 +29,8 @@
 ;; This file does the magic to parse mswindows font names, and make sure that
 ;; the default and modeline attributes of new frames are specified enough.
 
+(set-face-font 'gui-element "MS Sans Serif:Regular:8" nil 'mswindows)
+
 (defun mswindows-init-device-faces (device)
   (let ((color-default (device-system-metric device 'color-default))
 	(color-3d-face (device-system-metric device 'color-3d-face)))
@@ -45,7 +47,7 @@
 	(set-face-foreground 'gui-element (car color-3d-face)) device)
     (if (cdr color-3d-face)
 	(set-face-background 'gui-element (cdr color-3d-face)) device)
-    (set-face-font 'gui-element "MS Sans Serif:Regular:8" device)))
+    ))
 
 (defun mswindows-init-frame-faces (frame)
   )
--- a/lisp/msw-font-menu.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/msw-font-menu.el	Fri Mar 29 04:49:13 2002 +0000
@@ -175,13 +175,13 @@
     
     (when (string-match mswindows-font-regexp name)
       (setq weight (match-string 2 name))
-      (setq size   (string-to-int (match-string 4 name))))
+      (setq size   (string-to-int (or (match-string 4 name) "0"))))
       
     (when (string-match mswindows-font-regexp truename)
       (when (not (member weight (aref entry 1)))
 	(setq weight (match-string 2 truename)))
       (when (not (member size   (aref entry 2)))
-	(setq size (string-to-int (match-string 4 truename))))
+	(setq size (string-to-int (or (match-string 4 truename) "0"))))
       (setq slant (match-string 5 truename)))
       
     (vector entry family size weight slant)))
--- a/lisp/msw-glyphs.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/msw-glyphs.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 ;;; msw-glyphs.el --- Support for glyphs in ms windows
 
 ;; Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Author: Kirill M. Katsnelson <kkm@kis.ru>
 ;; Maintainer: XEmacs Development Team
@@ -80,6 +81,9 @@
   (set-glyph-image continuation-glyph "\xC3" 'global 'msgdi)
   (set-glyph-image truncation-glyph "\xF0" 'global 'msgdi)
   (set-glyph-image hscroll-glyph "\xEF" 'global 'msgdi)
+  (set-glyph-contrib-p continuation-glyph nil)
+  (set-glyph-contrib-p truncation-glyph nil)
+  (set-glyph-contrib-p hscroll-glyph nil)
 
   (set-glyph-image octal-escape-glyph "\\")
   (set-glyph-image control-arrow-glyph "^")
--- a/lisp/mule/english.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/mule/english.el	Fri Mar 29 04:49:13 2002 +0000
@@ -32,19 +32,19 @@
 ;;; Code
 
 ;; ASCII with right-to-left direction.
-; (make-charset 'ascii-right-to-left 
-; 	      "ASCII (left half of ISO 8859-1) with right-to-left direction"
-; 	      '(dimension
-; 		1
-; 		registry "ISO8859-1"
-; 		chars 94
-; 		columns 1
-; 		direction r2l
-; 		final ?B
-; 		graphic 0
-; 		short-name "rev ASCII"
-; 		long-name "ASCII with right-to-left direction"
-; 		))
+(make-charset 'ascii-right-to-left 
+	      "ASCII (left half of ISO 8859-1) with right-to-left direction"
+	      '(dimension
+		1
+		registry "ISO8859-1"
+		chars 94
+		columns 1
+		direction r2l
+		final ?B
+		graphic 0
+		short-name "rev ASCII"
+		long-name "ASCII with right-to-left direction"
+		))
 
 (set-language-info-alist
  "English" '((tutorial . "TUTORIAL")
--- a/lisp/mule/ethio-util.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/mule/ethio-util.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1790,8 +1790,8 @@
 
     (goto-char (point-min))
     (while (re-search-forward "\\ce" nil t)
-      (setq ucode (+ ?\x1200 (ethio-char-to-ethiocode (preceding-char))))
-      (if (> ucode ?\x13bc)
+      (setq ucode (+ #x1200 (ethio-char-to-ethiocode (preceding-char))))
+      (if (> ucode #x13bc)
 	  (setq ucode (+ ucode 59952)))
       (delete-backward-char 1)
       (if ethio-java-save-lowercase
@@ -1807,13 +1807,13 @@
       (setq ucode
 	    (read
 	     (concat
-	      "?\\x"
+	      "#x"
 	      (buffer-substring (match-beginning 1) (match-end 1)))))
       (cond
-       ((and (>= ucode ?\x1200) (<= ucode ?\x13bc))
+       ((and (>= ucode #x1200) (<= ucode #x13bc))
 	(replace-match "")
-	(insert (ethio-ethiocode-to-char (- ucode ?\x1200))))
-       ((and (>= ucode ?\xfdf1) (<= ucode ?\xfdff))
+	(insert (ethio-ethiocode-to-char (- ucode #x1200))))
+       ((and (>= ucode #xfdf1) (<= ucode #xfdff))
 	(replace-match "")
 	(insert (ethio-ethiocode-to-char (- ucode 64560))))
        (t
--- a/lisp/package-get.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/package-get.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 ;;; package-get.el --- Retrieve XEmacs package
 
 ;; Copyright (C) 1998 by Pete Ware
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Author: Pete Ware <ware@cis.ohio-state.edu>
 ;; Heavy-Modifications: Greg Klanderman <greg@alphatech.com>
@@ -670,14 +671,11 @@
 (defun package-get-load-package-file (lispdir file)
   (let (pathname)
     (setq pathname (expand-file-name file lispdir))
-    (condition-case err
-	(progn
-	  (load pathname t)
-	  t)
-      (t
-       (message "Error loading package file \"%s\" %s!" pathname err)
-       nil))
-    ))
+    (with-trapping-errors
+      :operation (format "loading package file \"%s\"" pathname)
+      :error-form nil
+      (load pathname t)
+      t)))
 
 (defun package-get-init-package (lispdir)
   "Initialize the package.
@@ -766,10 +764,12 @@
                    (string-to-number latest)
                  latest))
             (if (not (null version))
-                (warn "Installing %s package version %s, you had a newer version %s"
-                      package latest installed)
-              (warn "Skipping %s package, you have a newer version %s"
-                    package installed)
+                (lwarn 'packages
+		    "Installing %s package version %s, you had a newer version %s"
+		  package latest installed)
+              (lwarn 'packages
+		  "Skipping %s package, you have a newer version %s"
+		package installed)
               (throw 'skip-update t))))
 
     ;; Contrive a list of possible package filenames.
--- a/lisp/packages.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/packages.el	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 ;;; packages.el --- Low level support for XEmacs packages
 
 ;; Copyright (C) 1997 Free Software Foundation, Inc.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Author: Steven L Baur <steve@xemacs.org>
 ;; Maintainer: Steven L Baur <steve@xemacs.org>
@@ -502,15 +503,12 @@
   "Load all Lisp files of a certain name along a load path.
 BASE is the base name of the files."
   (mapcar #'(lambda (dir)
-	    (let ((file-name (expand-file-name base dir)))
-	      (condition-case error
-		  (load file-name t t)
-		(error
-		 (warn (format "Autoload error in: %s:\n\t%s"
-			       file-name
-			       (with-output-to-string
-				 (display-error error nil))))))))
-	package-load-path))
+	      (let ((file-name (expand-file-name base dir)))
+		(with-trapping-errors
+		  :operation (format "Autoload %s" file-name)
+		  :class 'packages
+		  (load file-name t t))))
+	  package-load-path))
 
 (defun packages-load-package-auto-autoloads (package-load-path)
   "Load auto-autoload files along a load path."
--- a/lisp/simple.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/simple.el	Fri Mar 29 04:49:13 2002 +0000
@@ -4217,7 +4217,7 @@
 (defun show-message-log ()
   "Show the \" *Message-Log*\" buffer, which contains old messages and errors."
   (interactive)
-  (pop-to-buffer (get-buffer-create " *Message-Log*")))
+  (view-lossage t))
 
 (defvar log-message-filter-function 'log-message-filter
   "Value must be a function of two arguments: a symbol (label) and
@@ -4258,9 +4258,11 @@
       (let (extent)
 	;; Mark multiline message with an extent, which `view-lossage'
 	;; will recognize.
-	(when (string-match "\n" message)
-	  (setq extent (make-extent (point) (point)))
-	  (set-extent-properties extent '(end-open nil message-multiline t)))
+	(save-match-data
+	  (when (string-match "\n" message)
+	    (setq extent (make-extent (point) (point)))
+	    (set-extent-properties extent '(end-open nil message-multiline t)))
+	  )
 	(insert message "\n")
 	(when extent
 	  (set-extent-property extent 'end-open t)))
@@ -4334,16 +4336,16 @@
 	    (setq s (cdr s))))))
     ;; (possibly) log each removed message
     (while log
-      (condition-case e
-	  (run-hook-with-args 'remove-message-hook
-			      (car (car log)) (cdr (car log)))
-	(error (setq remove-message-hook nil)
-	       (lwarn 'message-log 'warning
-		 "Error caught in `remove-message-hook': %s"
-		 (error-message-string e))
-	       (let ((inhibit-read-only t))
-		 (erase-buffer " *Echo Area*"))
-	       (signal (car e) (cdr e))))
+      (with-trapping-errors
+	:operation 'remove-message-hook
+	:class 'message-log
+	:error-form (progn
+		      (setq remove-message-hook nil)
+		      (let ((inhibit-read-only t))
+			(erase-buffer " *Echo Area*")))
+	:resignal t
+	(run-hook-with-args 'remove-message-hook
+			    (car (car log)) (cdr (car log))))
       (setq log (cdr log)))))
 
 (defun append-message (label message &optional frame stdout-p)
@@ -4440,35 +4442,41 @@
 happened.
 
 The recognized warning levels, in decreasing order of priority, are
-'emergency, 'alert, 'critical, 'error, 'warning, 'notice, 'info, and
+'emergency, 'critical, 'error, 'warning, 'alert, 'notice, 'info, and
 'debug.
 
 See also `display-warning-minimum-level'.
 
 You can also control which warnings are displayed on a class-by-class
 basis.  See `display-warning-suppressed-classes' and
-`log-warning-suppressed-classes'."
-  :type '(choice (const emergency) (const alert) (const critical)
-		 (const error) (const warning) (const notice)
+`log-warning-suppressed-classes'.
+
+For a description of the meaning of the levels, see `display-warning.'"
+  :type '(choice (const emergency) (const critical)
+		 (const error) (const warning) (const alert) (const notice)
 		 (const info) (const debug))
   :group 'warnings)
 
-(defcustom display-warning-minimum-level 'info
-  "Minimum level of warnings that should be displayed.
-The warnings in levels below this will be generated, but not
-displayed.
+(defcustom display-warning-minimum-level 'warning
+  "Minimum level of warnings that cause the warnings buffer to be displayed.
+Warnings at this level or higher will force the *Warnings* buffer, in which
+the warnings are logged, to be displayed.  The warnings in levels below
+this, but at least as high as `log-warning-suppressed-classes', will be
+shown in the minibuffer.
 
 The recognized warning levels, in decreasing order of priority, are
-'emergency, 'alert, 'critical, 'error, 'warning, 'notice, 'info, and
+'emergency, 'critical, 'error, 'warning, 'alert, 'notice, 'info, and
 'debug.
 
 See also `log-warning-minimum-level'.
 
 You can also control which warnings are displayed on a class-by-class
 basis.  See `display-warning-suppressed-classes' and
-`log-warning-suppressed-classes'."
-  :type '(choice (const emergency) (const alert) (const critical)
-		 (const error) (const warning) (const notice)
+`log-warning-suppressed-classes'.
+
+For a description of the meaning of the levels, see `display-warning.'"
+  :type '(choice (const emergency) (const critical)
+		 (const error) (const warning) (const alert) (const notice)
 		 (const info) (const debug))
   :group 'warnings)
 
@@ -4500,10 +4508,10 @@
   "Count of the number of warning messages displayed so far.")
 
 (defconst warning-level-alist '((emergency . 8)
-				(alert . 7)
-				(critical . 6)
-				(error . 5)
-				(warning . 4)
+				(critical . 7)
+				(error . 6)
+				(warning . 5)
+				(alert . 4)
 				(notice . 3)
 				(info . 2)
 				(debug . 1)))
@@ -4512,6 +4520,13 @@
   "Non-nil if LEVEL specifies a warning level."
   (and (symbolp level) (assq level warning-level-alist)))
 
+(defun warning-level-< (level1 level2)
+  "Non-nil if warning level LEVEL1 is lower than LEVEL2."
+  (check-argument-type 'warning-level-p level1)
+  (check-argument-type 'warning-level-p level2)
+  (< (cdr (assq level1 warning-level-alist))
+     (cdr (assq level2 warning-level-alist))))
+
 ;; If you're interested in rewriting this function, be aware that it
 ;; could be called at arbitrary points in a Lisp program (when a
 ;; built-in function wants to issue a warning, it will call out to
@@ -4535,14 +4550,85 @@
 
 (defun display-warning (class message &optional level)
   "Display a warning message.
-CLASS should be a symbol describing what sort of warning this is, such
-as `resource' or `key-mapping'.  A list of such symbols is also
-accepted. (Individual classes can be suppressed; see
-`display-warning-suppressed-classes'.)  Optional argument LEVEL can
-be used to specify a priority for the warning, other than default priority
-`warning'. (See `display-warning-minimum-level').  The message is
-inserted into the *Warnings* buffer, which is made visible at appropriate
-times."
+
+\[This is the most basic entry point for displaying a warning.  In practice,
+`lwarn' or `warn' are probably more convenient for most usages.]
+
+CLASS should be a symbol describing what sort of warning this is, such as
+`resource' or `key-mapping' -- this refers, more or less, to the module in
+which the warning is generated and serves to group warnings together with
+similar semantics.  A list of such symbols is also accepted.
+
+Optional argument LEVEL can be used to specify a priority for the warning,
+other than default priority `warning'.  The currently defined levels are,
+from highest to lowest:
+
+Level        Meaning                                                        
+-----------------------------------------------------------------------------
+emergency    A fatal or near-fatal error.  XEmacs is likely to crash.
+
+critical     A serious, nonrecoverable problem has occurred -- e.g., the
+             loss of a major subsystem, such as the crash of the X server
+	     when XEmacs is connected to the server.
+
+error        A warning about a problematic condition that should be fixed,
+             and XEmacs cannot work around it -- it causes a failure of an
+	     operation. (In most circumstances, consider just signalling
+             an error). However, there is no permanent damage and the
+             situation is ultimately recoverable.
+
+warning      A warning about a problematic condition that should be fixed,
+             but XEmacs can work around it.
+
+\[By default, warnings above here, as well as being logged, cause the
+*Warnings* buffer to be forcibly displayed, so that the warning (and
+previous warnings, since often a whole series of warnings are issued at
+once) can be examined in detail.  Also, the annoying presence of the
+*Warnings* buffer will encourage people to go out and fix the
+problem. Warnings below here are displayed in the minibuffer as well as
+logged in the *Warnings* buffer. but the *Warnings* buffer will not be
+forcibly shown, as these represent conditions the user is not expected to
+fix.]
+
+alert        A warning about a problematic condition that can't easily be
+             fixed (often having to do with the external environment), and
+             causes a failure.  We don't force the *Warnings* buffer to be
+	     displayed because the purpose of doing that is to force the
+             user to fix the problem so that the buffer no longer appears.
+             When the problem is outside the user's control, forcing the
+             buffer is pointless and annoying.
+
+notice       A warning about a problematic condition that can't easily be
+             fixed (often having to do with the external environment),
+             but XEmacs can work around it.
+
+info         Random info about something new or unexpected that was noticed;
+             does not generally indicate a problem.
+
+\[By default, warnings below here are ignored entirely.  All warnings above
+here are logged in the *Warnings* buffer.]
+
+debug        A debugging notice; normally, not seen at all.
+
+NOTE: `specifier-instance' outputs warnings at level `debug' when errors occur
+in the process of trying to instantiate a particular instantiator.  If you
+want to see these, change `log-warning-minimum-level'.
+
+There are two sets of variables.  One controls the lower level (see the
+above diagram) -- i.e. ignored entirely.  One controls the upper level --
+whether the *Warnings* buffer is forcibly displayed.  In particular:
+
+`display-warning-minimum-level' sets the upper level (see above), and
+`log-warning-minimum-level' the lower level.
+
+Individual classes can be suppressed. `log-warning-suppressed-classes'
+specifies a list of classes where warnings on those classes will be treated
+as if their level is below `log-warning-minimum-level' (i.e. they will be
+ignored completely), regardless of their actual level.  Similarly,
+`display-warning-suppressed-classes' specifies a list of classes where
+warnings on those classes will be treated as if their level is below
+`display-warning-minimum-level', but above `log-warning-minimum-level' so
+long as they're not listed in that variable as well."
   (or level (setq level 'warning))
   (or (listp class) (setq class (list class)))
   (check-argument-type 'warning-level-p level)
@@ -4573,35 +4659,38 @@
 	  (with-current-buffer buffer
 	    (goto-char (point-max))
 	    (incf warning-count)
-	    (princ (format "(%d) (%s/%s) "
-			   warning-count
-			   (mapconcat 'symbol-name class ",")
-			   level)
-		   buffer)
-	    (princ message buffer)
-	    (terpri buffer)
-	    (terpri buffer)))))))
+	    (let ((start (point)))
+	      (princ (format "(%d) (%s/%s) "
+			     warning-count
+			     (mapconcat 'symbol-name class ",")
+			     level)
+		     buffer)
+	      (princ message buffer)
+	      (terpri buffer)
+	      (terpri buffer)
+	      (let ((ex (make-extent start (point))))
+		(set-extent-properties ex
+				       `(warning t warning-count ,warning-count
+						 warning-class ,class
+						 warning-level ,level)))))
+	  (message "%s: %s" (capitalize (symbol-name level)) message))))))
 
 (defun warn (&rest args)
-  "Display a warning message.
+  "Display a formatted warning message at default class and level.
 The message is constructed by passing all args to `format'.  The message
 is placed in the *Warnings* buffer, which will be popped up at the next
-redisplay.  The class of the warning is `warning'.  See also
-`display-warning'."
-  (display-warning 'warning (apply 'format args)))
+redisplay.  The class of the warning is `general'; the level is `warning'.
+
+See `display-warning' for more info."
+  (display-warning 'default (apply 'format args)))
 
 (defun lwarn (class level &rest args)
-  "Display a labeled warning message.
-CLASS should be a symbol describing what sort of warning this is, such
-as `resource' or `key-mapping'.  A list of such symbols is also
-accepted. (Individual classes can be suppressed; see
-`display-warning-suppressed-classes'.)  If non-nil, LEVEL can be used
-to specify a priority for the warning, other than default priority
-`warning'. (See `display-warning-minimum-level').  The message is
-inserted into the *Warnings* buffer, which is made visible at appropriate
-times.
-
-The rest of the arguments are passed to `format'."
+  "Display a formatted warning message at specified class and level.
+The message is constructed by passing all args to `format'.  The message
+is placed in the *Warnings* buffer, which will be popped up at the next
+redisplay.
+
+See `display-warning' for more info."
   (display-warning class (apply 'format args)
 		   (or level 'warning)))
 
@@ -4638,9 +4727,43 @@
 	((featurep 'xemacs) "XEmacs")
 	(t "Emacs")))
 
-(defun debug-print (format &rest args)
+(defun debug-print-1 (&rest args)
+  "Send a debugging-type string to standard output.
+If the first argument is a string, it is considered to be a format
+specifier if there are sufficient numbers of other args, and the string is
+formatted using (apply #'format args).  Otherwise, each argument is printed
+individually in a numbered list."
+  (let ((standard-output 'external-debugging-output)
+	(fmt (condition-case nil
+		 (and (stringp (first args))
+		      (apply #'format args))
+	       (error nil))))
+    (if fmt
+	(progn
+	  (prin1 (apply #'format args))
+	  (terpri))
+      (princ "--> ")
+      (let ((i 1))
+	(dolist (sgra args)
+	  (if (> i 1) (princ "  "))
+	  (princ (format "%d. " i))
+	  (prin1 sgra)
+	  (incf i))
+	(terpri)))))
+
+(defun debug-print (&rest args)
   "Send a string to the debugging output.
-The string is formatted using (apply #'format FORMAT ARGS)."
-  (princ (apply #'format format args) 'external-debugging-output))
+If the first argument is a string, it is considered to be a format
+specifier if there are sufficient numbers of other args, and the string is
+formatted using (apply #'format args).  Otherwise, each argument is printed
+individually in a numbered list."
+  (let ((standard-output 'external-debugging-output))
+    (apply #'debug-print-1 args)))
+
+(defun debug-backtrace ()
+  "Send a backtrace to the debugging output."
+  (let ((standard-output 'external-debugging-output))
+    (backtrace nil t)
+    (terpri)))
 
 ;;; simple.el ends here
--- a/lisp/sound.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/sound.el	Fri Mar 29 04:49:13 2002 +0000
@@ -2,6 +2,7 @@
 
 ;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: internal
@@ -40,7 +41,8 @@
 	(buffer-bound	:sound drum)
 	;; buffer-read-only error
 	(read-only	        :sound drum)
-	;; non-interactive function or lambda called
+	;; any error other than those handled by undefined-key,
+	;; undefined-click, buffer-bound, read-only
 	(command-error	:sound bass)
 	(y-or-n-p		:sound quiet)
 	(yes-or-no-p		:sound quiet)
--- a/lisp/startup.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/startup.el	Fri Mar 29 04:49:13 2002 +0000
@@ -945,25 +945,35 @@
 	  (progn
 	    ;; Do this without a condition-case if the user wants to debug.
 	    (load-user-init-file))
-	(condition-case error
-	    (progn
-	      (if load-user-init-file-p
-		  (load-user-init-file))
-	      (setq init-file-had-error nil))
-          (error
-	   (message "Error in init file: %s" (error-message-string error))
-	   (display-warning 'initialization
-	     (format "\
+	(condition-case nil
+	    (call-with-condition-handler
+		#'(lambda (__load_init_file_arg__)
+		    (let ((errstr (error-message-string
+				   __load_init_file_arg__)))
+		      (message "Error in init file: %s" errstr)
+		      (lwarn 'initialization 'error
+			"\
 An error has occurred while loading %s:
 
 %s
 
+Backtrace follows:
+
+%s
+
 To ensure normal operation, you should investigate the cause of the error
 in your initialization file and remove it.  Use the `-debug-init' option
-to XEmacs to view a complete error backtrace."
-		     user-init-file (error-message-string error))
-	     'error)
-	   (setq init-file-had-error t))))
+to XEmacs to enter the debugger when the error occurs and investigate the
+exact problem."
+			user-init-file errstr
+			(backtrace-in-condition-handler-eliminating-handler
+			 '__load_init_file_arg__)))
+		    (setq init-file-had-error t))
+		#'(lambda ()
+		    (if load-user-init-file-p
+			(load-user-init-file))
+		    (setq init-file-had-error nil)))
+	  (error nil)))
       ;; If we can tell that the init file altered debug-on-error,
       ;; arrange to preserve the value that it set up.
       (or (eq debug-on-error debug-on-error-initial)
--- a/lisp/subr.el	Sat Mar 23 05:08:52 2002 +0000
+++ b/lisp/subr.el	Fri Mar 29 04:49:13 2002 +0000
@@ -869,6 +869,93 @@
   "Returns non-nil if SYM names a currently-defined error."
   (and (symbolp sym) (not (null (get sym 'error-conditions)))))
 
+(defun backtrace-in-condition-handler-eliminating-handler (handler-arg-name)
+  "Return a backtrace inside of a condition handler, eliminating the handler.
+This is for use in the condition handler inside of call-with-condition-handler,
+when written like this:
+
+\(call-with-condition-handler
+    #'(lambda (__some_weird_arg__)
+	do the handling ...)
+    #'(lambda ()
+	do the stuff that might cause an error))
+
+Pass in the name (a symbol) of the argument used in the lambda function
+that specifies the handler, and make sure the argument name is unique, and
+this function generates a backtrace and strips off the part above where the
+error occurred (i.e. the handler itself)."
+  (let* ((bt (with-output-to-string (backtrace nil t)))
+	 (bt (save-match-data
+	       ;; Try to eliminate the part of the backtrace
+	       ;; above where the error occurred.
+	       (if (string-match
+		    (concat "bind (\\(?:.* \\)?" (symbol-name handler-arg-name)
+			    "\\(?:.* \\)?)[ \t\n]*\\(?:(lambda \\|#<compiled-function \\)("
+			    (symbol-name handler-arg-name)
+			    ").*\n\\(\\(?:.\\|\n\\)*\\)$")
+		    bt) (match-string 1 bt) bt))))
+    bt))
+
+(put 'with-trapping-errors 'lisp-indent-function 0)
+(defmacro with-trapping-errors (&rest keys-body)
+  "Trap errors in BODY, outputting a warning and a backtrace.
+Usage looks like
+
+\(with-trapping-errors
+    [:operation OPERATION]
+    [:error-form ERROR-FORM]
+    [:no-backtrace NO-BACKTRACE]
+    [:class CLASS]
+    [:level LEVEL]
+    [:resignal RESIGNAL]
+    BODY)
+
+Return value without error is whatever BODY returns.  With error, return
+result of ERROR-FORM (which will be evaluated only when the error actually
+occurs), which defaults to nil.  OPERATION is given in the warning message.
+CLASS and LEVEL are the warning class and level (default to class
+`general', level `warning').  If NO-BACKTRACE is given, no backtrace is
+displayed.  If RESIGNAL is given, the error is resignaled after the warning
+is displayed and the ERROR-FORM is executed."
+  (let ((operation "unknown")
+	(error-form nil)
+	(no-backtrace nil)
+	(class ''general)
+	(level ''warning)
+	(resignal nil))
+    (let* ((keys '(operation error-form no-backtrace class level resignal))
+	   (keys-with-colon
+	    (mapcar #'(lambda (sym)
+			(intern (concat ":" (symbol-name sym)))) keys)))
+      (while (memq (car keys-body) keys-with-colon)
+	(let* ((key-with-colon (pop keys-body))
+	       (key (intern (substring (symbol-name key-with-colon) 1))))
+	  (set key (pop keys-body)))))
+    `(condition-case ,(if resignal '__cte_cc_var__ nil)
+	 (call-with-condition-handler
+	     #'(lambda (__call_trapping_errors_arg__)
+		 (let ((errstr (error-message-string
+				__call_trapping_errors_arg__)))
+		   ,(if no-backtrace
+			`(lwarn ,class ,level
+			   (if (warning-level-<
+				,level
+				display-warning-minimum-level)
+			       "Error in %s: %s"
+			     "Error in %s:\n%s\n")
+			   ,operation errstr)
+		      `(lwarn ,class ,level
+			 "Error in %s: %s\n\nBacktrace follows:\n\n%s"
+			 ,operation errstr
+			 (backtrace-in-condition-handler-eliminating-handler
+			  '__call_trapping_errors_arg__)))))
+	     #'(lambda ()
+		 (progn ,@keys-body)))
+       (error
+	,error-form
+	,@(if resignal '((signal (car __cte_cc_var__) (cdr __cte_cc_var__)))))
+       )))
+
 ;;;; Miscellanea.
 
 ;; This is now in C.
--- a/src/ChangeLog	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/ChangeLog	Fri Mar 29 04:49:13 2002 +0000
@@ -1,3 +1,787 @@
+2002-03-24  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in (gui_objs):
+	* Makefile.in.in (objs):
+	Always include gui.c, to fix compile error when TTY-only.
+	
+	* EmacsFrame.c (EmacsFrameSetValues):
+	* abbrev.c:
+	* abbrev.c (abbrev_match_mapper):
+	* abbrev.c (Fexpand_abbrev):
+	* alloc.c:
+	* alloc.c (malloc_warning):
+	* alloc.c (allocate_lisp_storage):
+	* alloc.c (Fcons):
+	* alloc.c (noseeum_cons):
+	* alloc.c (make_float):
+	* alloc.c (make_vector):
+	* alloc.c (Fvector):
+	* alloc.c (make_bit_vector_internal):
+	* alloc.c (make_bit_vector):
+	* alloc.c (make_bit_vector_from_byte_vector):
+	* alloc.c (Fbit_vector):
+	* alloc.c (make_compiled_function):
+	* alloc.c (Fmake_symbol):
+	* alloc.c (allocate_event):
+	* alloc.c (Fmake_marker):
+	* alloc.c (noseeum_make_marker):
+	* alloc.c (mark_string):
+	* alloc.c (string_plist_ptr):
+	* alloc.c (allocate_string_chars_struct):
+	* alloc.c (make_uninit_string):
+	* alloc.c (resize_string):
+	* alloc.c (set_string_char):
+	* alloc.c (Fmake_string):
+	* alloc.c (init_string_ascii_begin):
+	* alloc.c (make_string_nocopy):
+	* alloc.c (make_lcrecord_list):
+	* alloc.c (allocate_managed_lcrecord):
+	* alloc.c (ADDITIONAL_FREE_marker):
+	* alloc.c (verify_string_chars_integrity):
+	* alloc.c (compact_string_chars):
+	* alloc.c (debug_string_purity_print):
+	* alloc.c (UNMARK_string):
+	* alloc.c (common_init_alloc_once_early):
+	* buffer.c (Fdecode_buffer):
+	* buffer.c (finish_init_buffer):
+	* buffer.c (Fother_buffer):
+	* buffer.c (Fcurrent_buffer):
+	* buffer.c (Fbury_buffer):
+	* buffer.c (common_init_complex_vars_of_buffer):
+	* buffer.h (wrap_buffer):
+	* buffer.h (buffer_or_string_charbpos_to_bytebpos):
+	* buffer.h (buffer_or_string_bytebpos_to_charbpos):
+	* buffer.h (buffer_or_string_charbpos_to_membpos):
+	* buffer.h (buffer_or_string_membpos_to_charbpos):
+	* bytecode.c (execute_optimized_program):
+	* bytecode.h (wrap_compiled_function):
+	* callint.c:
+	* callint.c (Fcall_interactively):
+	* callproc.c:
+	* callproc.c (call_process_cleanup):
+	* callproc.c (Fold_call_process_internal):
+	* casetab.c:
+	* casetab.c (allocate_case_table):
+	* casetab.c (set_case_table):
+	* casetab.h (wrap_case_table):
+	* charset.h (wrap_charset):
+	* chartab.c:
+	* chartab.c (mark_char_table):
+	* chartab.c (print_char_table):
+	* chartab.c (Fmake_char_table):
+	* chartab.c (make_char_table_entry):
+	* chartab.c (copy_char_table_entry):
+	* chartab.c (Fcopy_char_table):
+	* chartab.h:
+	* chartab.h (wrap_char_table_entry):
+	* chartab.h (struct Lisp_Char_Table):
+	* chartab.h (wrap_char_table):
+	* cmds.c (Fpoint_at_bol):
+	* console-msw.c:
+	* console-msw.c (DSYMNAME):
+	* console-msw.h (wrap_devmode):
+	* console-msw.h (wrap_mswindows_dialog_id):
+	* console-tty.c (tty_init_console):
+	* console-tty.c (decode_tty_console):
+	* console-x.c:
+	* console-x.c (x_semi_canonicalize_console_connection):
+	* console-x.h:
+	* console.c (allocate_console):
+	* console.c (create_console):
+	* console.c (delete_console_internal):
+	* console.c (common_init_complex_vars_of_console):
+	* console.h (wrap_console):
+	* data.c:
+	* data.c (Faref):
+	* data.c (Faset):
+	* data.c (make_weak_list):
+	* database.c:
+	* database.c (wrap_database):
+	* database.c (print_database):
+	* database.c (finalize_database):
+	* database.c (Fopen_database):
+	* device-gtk.c (decode_gtk_device):
+	* device-gtk.c (gtk_init_device):
+	* device-gtk.c (gtk_delete_device):
+	* device-msw.c (ensure_not_printing):
+	* device-msw.c (Fmsprinter_get_settings):
+	* device-msw.c (Fmsprinter_select_settings):
+	* device-msw.c (Fmsprinter_apply_settings):
+	* device-msw.c (finalize_devmode):
+	* device-msw.c (allocate_devmode):
+	* device-x.c:
+	* device-x.c (decode_x_device):
+	* device-x.c (x_init_device):
+	* device-x.c (x_delete_device):
+	* device-x.c (x_error_handler):
+	* device-x.c (x_IO_error_handler):
+	* device.c (allocate_device):
+	* device.c (Fset_device_selected_frame):
+	* device.c (Fmake_device):
+	* device.c (delete_device_internal):
+	* device.c (Fset_device_class):
+	* device.h (wrap_device):
+	* dialog-msw.c (handle_question_dialog_box):
+	* doc.c:
+	* doc.c (weird_doc):
+	* doc.c (kludgily_ignore_lost_doc_p):
+	* doc.c (verify_doc_mapper):
+	* doprnt.c:
+	* doprnt.c (NEXT_ASCII_BYTE):
+	* doprnt.c (emacs_doprnt_1):
+	* dumper.c (pdump_reloc_one):
+	* dynarr.c (Dynarr_insert_many):
+	* editfns.c (Fstring_to_char):
+	* editfns.c (user_login_name):
+	* editfns.c (Fuser_real_login_name):
+	* editfns.c (Ftranslate_region):
+	* eldap.c (make_ldap):
+	* eldap.h (wrap_ldap):
+	* elhash.c (make_general_lisp_hash_table):
+	* elhash.c (Fcopy_hash_table):
+	* elhash.h (wrap_hash_table):
+	* emacs.c (mswindows_handle_hardware_exceptions_1):
+	* eval.c:
+	* eval.c (Fuser_variable_p):
+	* eval.c (throw_or_bomb_out):
+	* eval.c (Fsignal):
+	* eval.c (restore_current_warning_level):
+	* eval.c (call_with_suspended_errors_1):
+	* eval.c (call_with_suspended_errors):
+	* eval.c (maybe_signal_error_1):
+	* eval.c (maybe_signal_continuable_error_1):
+	* eval.c (eval_in_buffer_trapping_errors):
+	* eval.c (warn_when_safe_lispobj):
+	* eval.c (warn_when_safe):
+	* eval.c (vars_of_eval):
+	* event-Xt.c (x_event_to_emacs_event):
+	* event-Xt.c (handle_focus_event_1):
+	* event-Xt.c (change_frame_visibility):
+	* event-Xt.c (handle_map_event):
+	* event-Xt.c (handle_client_message):
+	* event-Xt.c (emacs_Xt_handle_magic_event):
+	* event-Xt.c (emacs_Xt_select_process):
+	* event-Xt.c (emacs_Xt_select_console):
+	* event-Xt.c (emacs_Xt_unselect_console):
+	* event-Xt.c (emacs_Xt_next_event):
+	* event-gtk.c (handle_focus_event_1):
+	* event-gtk.c (change_frame_visibility):
+	* event-gtk.c (handle_map_event):
+	* event-gtk.c (handle_client_message):
+	* event-gtk.c (emacs_gtk_handle_magic_event):
+	* event-gtk.c (emacs_gtk_select_process):
+	* event-gtk.c (emacs_gtk_select_console):
+	* event-gtk.c (emacs_gtk_unselect_console):
+	* event-gtk.c (dragndrop_data_received):
+	* event-gtk.c (emacs_gtk_next_event):
+	* event-gtk.c (gtk_event_to_emacs_event):
+	* event-gtk.c (emacs_shell_event_handler):
+	* event-msw.c (make_ntpipe_input_stream):
+	* event-msw.c (make_ntpipe_output_stream):
+	* event-msw.c (make_winsock_stream_1):
+	* event-msw.c (mswindows_enqueue_process_event):
+	* event-msw.c (emacs_mswindows_next_event):
+	* event-msw.c (get_process_input_waitable):
+	* event-msw.c (emacs_mswindows_select_process):
+	* event-stream.c (wrap_command_builder):
+	* event-stream.c (event_stream_next_event):
+	* event-stream.c (echo_key_event):
+	* event-stream.c (munge_keymap_translate):
+	* event-stream.c (pre_command_hook):
+	* event-stream.c (dribble_out_event):
+	* event-tty.c (emacs_tty_next_event):
+	* event-unixoid.c (read_event_from_tty_or_stream_desc):
+	* events.c:
+	* events.c (print_event_1):
+	* events.c (print_event):
+	* events.c (nth_of_key_sequence_as_event):
+	* events.c (format_event_object):
+	* events.c (Fevent_window):
+	* events.h:
+	* events.h (wrap_timeout):
+	* events.h (wrap_event):
+	* extents.c:
+	* extents.c (allocate_extent_auxiliary):
+	* extents.c (mark_extent_info):
+	* extents.c (allocate_extent_info):
+	* extents.c (decode_buffer_or_string):
+	* extents.c (buffer_or_string_extent_info):
+	* extents.c (buffer_or_string_extent_info_force):
+	* extents.c (print_extent_2):
+	* extents.c (extent_fragment_update):
+	* extents.c (Fnext_extent):
+	* extents.c (Fprevious_extent):
+	* extents.c (Fnext_e_extent):
+	* extents.c (Fprevious_e_extent):
+	* extents.c (Fset_extent_parent):
+	* extents.c (set_extent_endpoints_1):
+	* extents.c (copy_extent):
+	* extents.c (destroy_extent):
+	* extents.c (Fmake_extent):
+	* extents.c (Fcopy_extent):
+	* extents.c (slow_map_extents_function):
+	* extents.c (slow_map_extent_children_function):
+	* extents.c (extent_at_mapper):
+	* extents.c (report_extent_modification_mapper):
+	* extents.c (Fextent_properties):
+	* extents.c (Fforce_highlight_extent):
+	* extents.c (run_extent_copy_paste_internal):
+	* extents.c (insert_extent):
+	* extents.c (splice_in_string_extents):
+	* extents.c (put_text_prop_mapper):
+	* extents.c (put_text_prop_openness_mapper):
+	* extents.c (put_text_prop):
+	* extents.h (wrap_extent):
+	* extents.h (wrap_extent_auxiliary):
+	* extents.h (wrap_extent_info):
+	* faces.c:
+	* faces.c (face_property_matching_instance):
+	* faces.c (Fmake_face):
+	* faces.c (init_device_faces):
+	* faces.c (init_frame_faces):
+	* faces.c (ensure_face_cachel_contains_charset):
+	* faces.c (add_face_cachel):
+	* faces.c (get_builtin_face_cache_index):
+	* faces.c (get_extent_fragment_face_cache_index):
+	* faces.c (update_frame_face_values):
+	* faces.c (complex_vars_of_faces):
+	* faces.h (wrap_face):
+	* faces.h (FACE_PROPERTY_INSTANCE):
+	* faces.h (FACE_FONT):
+	* file-coding.c:
+	* file-coding.c (setup_eol_coding_systems):
+	* file-coding.c (make_coding_system_1):
+	* file-coding.c (Fcopy_coding_system):
+	* file-coding.c (make_coding_stream_1):
+	* file-coding.c (convert_eol_print):
+	* file-coding.c (convert_eol_putprop):
+	* file-coding.c (convert_eol_getprop):
+	* file-coding.c (detected_coding_system):
+	* file-coding.c (complex_vars_of_file_coding):
+	* file-coding.h:
+	* file-coding.h (wrap_coding_system):
+	* file-coding.h (XSETCODING_SYSTEM_OF_TYPE):
+	* fileio.c (build_annotations):
+	* fileio.c (auto_save_expand_name_error):
+	* fileio.c (Fdo_auto_save):
+	* filelock.c (lock_file):
+	* fns.c (Fstring_equal):
+	* fns.c (Fstring_lessp):
+	* fns.c (Fstring_modified_tick):
+	* fns.c (bump_string_modiff):
+	* fns.c (Fsubstring):
+	* fns.c (bad_bad_bunny):
+	* fns.c (bad_bad_turtle):
+	* fns.c (Ffillarray):
+	* frame-gtk.c (decode_gtk_frame):
+	* frame-gtk.c (gtk_set_frame_properties):
+	* frame-gtk.c (resize_event_cb):
+	* frame-gtk.c (delete_event_cb):
+	* frame-gtk.c (cleanup_deleted_frame):
+	* frame-gtk.c (gtk_get_mouse_position):
+	* frame-gtk.c (gtk_update_frame_external_traits):
+	* frame-msw.c:
+	* frame-msw.c (mswindows_init_frame_1):
+	* frame-msw.c (mswindows_set_frame_properties):
+	* frame-msw.c (error_frame_unsizable):
+	* frame-tty.c (tty_schedule_frame_select):
+	* frame-x.c:
+	* frame-x.c (decode_x_frame):
+	* frame-x.c (x_wm_maybe_store_wm_command):
+	* frame-x.c (x_set_frame_properties):
+	* frame-x.c (x_get_mouse_position):
+	* frame-x.c (x_update_frame_external_traits):
+	* frame.c (allocate_frame_core):
+	* frame.c (setup_normal_frame):
+	* frame.c (setup_minibuffer_frame):
+	* frame.c (Fmake_frame):
+	* frame.c (adjust_frame_size):
+	* frame.c (device_selected_frame):
+	* frame.c (Flast_nonminibuf_frame):
+	* frame.c (Fset_frame_selected_window):
+	* frame.c (Fnext_frame):
+	* frame.c (Fprevious_frame):
+	* frame.c (other_visible_frames):
+	* frame.c (delete_frame_internal):
+	* frame.c (Fdelete_frame):
+	* frame.c (Fmouse_pixel_position):
+	* frame.c (Fmouse_position):
+	* frame.c (store_minibuf_frame_prop):
+	* frame.c (dissect_as_face_setting):
+	* frame.c (Fset_frame_properties):
+	* frame.c (Fframe_property):
+	* frame.c (Fframe_properties):
+	* frame.c (Fset_frame_height):
+	* frame.c (Fset_frame_width):
+	* frame.c (Fset_frame_size):
+	* frame.c (frame_conversion_internal):
+	* frame.c (change_frame_size_1):
+	* frame.c (update_frame_icon):
+	* frame.h (wrap_frame):
+	* free-hook.c (Freally_free):
+	* general-slots.h:
+	* glyphs-eimage.c:
+	* glyphs-eimage.c (png_instantiate):
+	* glyphs-gtk.c (extract_xpm_color_names):
+	* glyphs-gtk.c (gtk_xpm_instantiate):
+	* glyphs-gtk.c (gtk_redisplay_widget):
+	* glyphs-msw.c (init_image_instance_from_dibitmap):
+	* glyphs-msw.c (extract_xpm_color_names):
+	* glyphs-msw.c (mswindows_resource_instantiate):
+	* glyphs-msw.c (init_image_instance_from_xbm_inline):
+	* glyphs-widget.c (check_valid_item_list):
+	* glyphs-x.c (extract_xpm_color_names):
+	* glyphs-x.c (x_xpm_instantiate):
+	* glyphs-x.c (x_redisplay_widget):
+	* glyphs.c:
+	* glyphs.c (check_window_subwindow_cache):
+	* glyphs.c (allocate_image_instance):
+	* glyphs.c (decode_error_behavior_flag):
+	* glyphs.c (encode_error_behavior_flag):
+	* glyphs.c (invalidate_glyph_geometry_maybe):
+	* glyphs.c (image_going_to_add):
+	* glyphs.c (allocate_glyph):
+	* glyphs.c (glyph_image_instance_maybe):
+	* glyphs.c (Fglyph_width):
+	* glyphs.c (Fglyph_ascent):
+	* glyphs.c (Fglyph_descent):
+	* glyphs.c (Fglyph_height):
+	* glyphs.c (set_glyph_dirty_p):
+	* glyphs.c (glyph_baseline):
+	* glyphs.c (glyph_contrib_p):
+	* glyphs.c (glyph_query_geometry):
+	* glyphs.c (glyph_do_layout):
+	* glyphs.c (update_glyph_cachel_data):
+	* glyphs.c (mark_glyph_cachels_as_clean):
+	* glyphs.c (unmap_subwindow):
+	* glyphs.c (map_subwindow):
+	* glyphs.c (add_glyph_animated_timeout):
+	* glyphs.c (disable_glyph_animated_timeout):
+	* glyphs.h:
+	* glyphs.h (IMAGE_SPECIFIERP):
+	* glyphs.h (wrap_image_instance):
+	* glyphs.h (wrap_glyph):
+	* gpmevent.c:
+	* gpmevent.c (struct __gpm_state):
+	* gpmevent.c (store_gpm_state):
+	* gpmevent.c (restore_gpm_state):
+	* gpmevent.c (clear_gpm_state):
+	* gpmevent.c (Freceive_gpm_event):
+	* gpmevent.c (turn_off_gpm):
+	* gpmevent.c (tty_get_foreign_selection):
+	* gpmevent.c (tty_selection_exists_p):
+	* gpmevent.c (tty_own_selection):
+	* gpmevent.c (tty_get_mouse_position):
+	* gpmevent.c (tty_set_mouse_position):
+	* gpmevent.c (gpm_event_pending_p):
+	* gpmevent.c (gpm_next_event_cb):
+	* gpmevent.c (hook_event_callbacks_once):
+	* gpmevent.c (hook_console_methods_once):
+	* gpmevent.c (Fgpm_enabled_p):
+	* gpmevent.c (Fgpm_enable):
+	* gpmevent.c (vars_of_gpmevent):
+	* gpmevent.c (syms_of_gpmevent):
+	* gtk-xemacs.c (smash_scrollbar_specifiers):
+	* gtk-xemacs.c (smash_toolbar_specifiers):
+	* gui-msw.c (mswindows_handle_gui_wm_command):
+	* gui-x.c:
+	* gui-x.c (gcpro_popup_callbacks):
+	* gui-x.c (popup_selection_callback):
+	* gui-x.c (button_item_to_widget_value):
+	* gui-x.h (wrap_popup_data):
+	* gui.c:
+	* gui.c (FROB):
+	* gui.c (gui_item_add_keyval_pair):
+	* gui.c (allocate_gui_item):
+	* gui.c (make_gui_item_from_keywords_internal):
+	* gui.c (update_gui_item_keywords):
+	* gui.c (gui_parse_item_keywords_no_errors):
+	* gui.c (gui_item_display_flush_right):
+	* gui.c (print_gui_item):
+	* gui.c (finalize_gui_item):
+	* gui.c (gui_error):
+	* gui.c (gui_error_2):
+	* gui.h (wrap_gui_item):
+	* gutter.c (output_gutter):
+	* gutter.h (GUTTER_SPECIFIERP):
+	* indent.c:
+	* indent.c (last_visible_position):
+	* indent.c (string_column_at_point):
+	* indent.c (Findent_to):
+	* indent.c (Fcurrent_indentation):
+	* indent.c (Fmove_to_column):
+	* input-method-xlib.c:
+	* input-method-xlib.c (XIM_init_device):
+	* input-method-xlib.c (XIM_init_frame):
+	* insdel.c:
+	* insdel.c (begin_multiple_change):
+	* insdel.c (signal_first_change):
+	* insdel.c (signal_before_change):
+	* insdel.c (signal_after_change):
+	* insdel.c (prepare_to_modify_buffer):
+	* insdel.c (buffer_insert_string_1):
+	* insdel.c (barf_if_buffer_read_only):
+	* keymap.c:
+	* keymap.c (keymap_lookup_directly):
+	* keymap.c (keymap_store):
+	* keymap.c (make_keymap):
+	* keymap.c (define_key_check_and_coerce_keysym):
+	* keymap.c (key_desc_list_to_event):
+	* keymap.c (Fdefine_key):
+	* keymap.c (Flookup_key):
+	* keymap.c (get_relevant_keymaps):
+	* keymap.c (minor_mode_keymap_predicate):
+	* keymap.c (map_keymap_sort_predicate):
+	* keymap.c (Fkey_description):
+	* keymap.c (Fsingle_key_description):
+	* keymap.c (where_is_to_char):
+	* keymap.c (format_raw_keys):
+	* keymap.c (where_is_recursive_mapper):
+	* keymap.c (where_is_internal):
+	* keymap.h (wrap_keymap):
+	* lisp-disunion.h:
+	* lisp-union.h (XPNTRVAL):
+	* lisp-union.h (make_int):
+	* lisp-union.h (make_char):
+	* lisp-union.h (wrap_pointer_1):
+	* lisp.h:
+	* lisp.h (dynarr):
+	* lisp.h (error_behavior):
+	* lisp.h (wrap_cons):
+	* lisp.h (struct Lisp_String):
+	* lisp.h (wrap_string):
+	* lisp.h (set_string_char):
+	* lisp.h (wrap_vector):
+	* lisp.h (wrap_bit_vector):
+	* lisp.h (struct Lisp_Symbol):
+	* lisp.h (SYMBOL_IS_KEYWORD):
+	* lisp.h (wrap_symbol):
+	* lisp.h (XSYMBOL_NEXT):
+	* lisp.h (wrap_subr):
+	* lisp.h (wrap_marker):
+	* lisp.h (wrap_float):
+	* lisp.h (FLOATP):
+	* lisp.h (wrap_weak_list):
+	* lisp.h (wrap_lcrecord_list):
+	* lread.c (Fread_from_string):
+	* lrecord.h:
+	* lrecord.h (wrap_toolbar_button):
+	* lrecord.h (wrap_record_1):
+	* lstream.c (Lstream_delete):
+	* lstream.c (make_stdio_stream_1):
+	* lstream.c (make_filedesc_stream_1):
+	* lstream.c (make_lisp_string_input_stream):
+	* lstream.c (make_fixed_buffer_input_stream):
+	* lstream.c (make_fixed_buffer_output_stream):
+	* lstream.c (make_resizing_buffer_output_stream):
+	* lstream.c (make_dynarr_output_stream):
+	* lstream.c (make_lisp_buffer_stream_1):
+	* lstream.h (wrap_lstream):
+	* marker.c (mark_marker):
+	* marker.c (Fmarker_buffer):
+	* marker.c (init_buffer_markers):
+	* menubar-gtk.c (__generic_button_callback):
+	* menubar-gtk.c (menu_descriptor_to_widget_1):
+	* menubar-msw.c (mswindows_handle_wm_command):
+	* menubar-x.c (pre_activate_callback):
+	* menubar-x.c (set_frame_menubar):
+	* menubar-x.c (x_popup_menu):
+	* menubar.c (Fnormalize_menu_item_name):
+	* minibuf.c:
+	* minibuf.c (Ftry_completion):
+	* minibuf.c (Fall_completions):
+	* minibuf.c (clear_echo_area_internal):
+	* minibuf.c (echo_area_append):
+	* minibuf.c (echo_area_status):
+	* mule-canna.c (Fcanna_touroku_string):
+	* mule-canna.c (Fcanna_change_mode):
+	* mule-canna.c (Fcanna_do_function):
+	* mule-ccl.c (Fccl_execute):
+	* mule-charset.c:
+	* mule-charset.c (print_charset):
+	* mule-charset.c (make_charset):
+	* mule-charset.c (Fmake_charset):
+	* mule-charset.c (Fcharset_id):
+	* mule-charset.c (syms_of_mule_charset):
+	* mule-wnnfns.c (Fwnn_inspect):
+	* native-gtk-toolbar.c (gtk_output_toolbar):
+	* objects-msw.c:
+	* objects-msw.c (mswindows_print_color_instance):
+	* objects-msw.c (mswindows_color_instance_equal):
+	* objects-msw.c (mswindows_color_instance_hash):
+	* objects-msw.c (mswindows_print_font_instance):
+	* objects-msw.c (mswindows_font_instance_truename):
+	* objects-msw.c (mswindows_font_spec_matches_charset):
+	* objects-tty.c:
+	* objects-tty.c (tty_font_spec_matches_charset):
+	* objects-x.c (x_font_instance_truename):
+	* objects.c:
+	* objects.c (finalose):
+	* objects.c (Fmake_color_instance):
+	* objects.c (font_instance_equal):
+	* objects.c (font_instance_hash):
+	* objects.c (Fmake_font_instance):
+	* objects.c (Flist_fonts):
+	* objects.c (reinit_vars_of_objects):
+	* objects.h (COLOR_SPECIFIERP):
+	* objects.h (FONT_SPECIFIERP):
+	* objects.h (FACE_BOOLEAN_SPECIFIERP):
+	* objects.h (wrap_color_instance):
+	* objects.h (wrap_font_instance):
+	* opaque.c (make_opaque):
+	* opaque.h (wrap_opaque):
+	* opaque.h (wrap_opaque_ptr):
+	* postgresql.c (make_pgconn):
+	* postgresql.c (make_pgresult):
+	* postgresql.h (wrap_pgconn):
+	* postgresql.h (wrap_pgresult):
+	* print.c:
+	* print.c (output_string):
+	* print.c (write_eistring):
+	* print.c (temp_output_buffer_setup):
+	* print.c (print_string):
+	* print.c (print_internal):
+	* print.c (print_symbol):
+	* process-unix.c:
+	* process-unix.c (unix_canonicalize_host_name):
+	* process.c (make_process_internal):
+	* process.c (init_process_io_handles):
+	* process.c (Fprocess_send_region):
+	* process.c (status_message):
+	* process.c (status_notify):
+	* process.c (decode_signal):
+	* process.c (handle_signal):
+	* process.h (PROCESSP):
+	* process.h (wrap_process):
+	* rangetab.c (Fmake_range_table):
+	* rangetab.c (Fcopy_range_table):
+	* rangetab.h (wrap_range_table):
+	* redisplay-gtk.c (gtk_output_display_block):
+	* redisplay-gtk.c (gtk_output_string):
+	* redisplay-gtk.c (gtk_output_pixmap):
+	* redisplay-gtk.c (gtk_clear_to_window_end):
+	* redisplay-gtk.c (gtk_output_eol_cursor):
+	* redisplay-gtk.c (gtk_clear_frame):
+	* redisplay-gtk.c (gtk_flash):
+	* redisplay-msw.c:
+	* redisplay-msw.c (mswindows_output_string):
+	* redisplay-msw.c (mswindows_output_pixmap):
+	* redisplay-msw.c (mswindows_output_display_block):
+	* redisplay-output.c:
+	* redisplay-output.c (compare_runes):
+	* redisplay-output.c (get_cursor_size_and_location):
+	* redisplay-output.c (clear_left_border):
+	* redisplay-output.c (clear_right_border):
+	* redisplay-output.c (output_display_line):
+	* redisplay-output.c (redisplay_output_subwindow):
+	* redisplay-output.c (redisplay_output_layout):
+	* redisplay-output.c (redisplay_output_pixmap):
+	* redisplay-output.c (redisplay_clear_top_of_window):
+	* redisplay-output.c (redisplay_clear_to_window_end):
+	* redisplay-tty.c:
+	* redisplay-tty.c (tty_output_display_block):
+	* redisplay-tty.c (tty_clear_to_window_end):
+	* redisplay-tty.c (tty_turn_on_frame_face):
+	* redisplay-tty.c (tty_turn_off_frame_face):
+	* redisplay-x.c:
+	* redisplay-x.c (x_output_display_block):
+	* redisplay-x.c (x_output_string):
+	* redisplay-x.c (x_output_eol_cursor):
+	* redisplay-x.c (x_clear_frame):
+	* redisplay-x.c (x_flash):
+	* redisplay.c:
+	* redisplay.c (redisplay_text_width_emchar_string):
+	* redisplay.c (redisplay_frame_text_width_string):
+	* redisplay.c (add_emchar_rune_1):
+	* redisplay.c (add_intbyte_string_runes):
+	* redisplay.c (add_disp_table_entry_runes_1):
+	* redisplay.c (add_glyph_rune):
+	* redisplay.c (create_text_block):
+	* redisplay.c (create_overlay_glyph_block):
+	* redisplay.c (create_left_glyph_block):
+	* redisplay.c (create_right_glyph_block):
+	* redisplay.c (generate_formatted_string_db):
+	* redisplay.c (generate_fstring_runes):
+	* redisplay.c (create_string_text_block):
+	* redisplay.c (call_redisplay_end_triggers):
+	* redisplay.c (redisplay_frame):
+	* redisplay.c (start_with_point_on_display_line):
+	* redisplay.c (glyph_to_pixel_translation):
+	* redisplay.c (pixel_to_glyph_translation):
+	* scrollbar-gtk.c (gtk_scrollbar_pointer_changed_in_window):
+	* scrollbar-msw.c (mswindows_handle_mousewheel_event):
+	* scrollbar-x.c (x_scrollbar_pointer_changed_in_window):
+	* scrollbar.c (init_frame_scrollbars):
+	* scrollbar.c (init_device_scrollbars):
+	* scrollbar.h (wrap_scrollbar_instance):
+	* search.c:
+	* search.c (fixup_search_regs_for_string):
+	* search.c (looking_at_1):
+	* search.c (string_match_1):
+	* search.c (bi_find_next_emchar_in_string):
+	* search.c (search_buffer):
+	* search.c (set_search_regs):
+	* search.c (wordify):
+	* search.c (Freplace_match):
+	* search.c (Fstore_match_data):
+	* select-gtk.c (gtk_own_selection):
+	* select-x.c:
+	* sound.c:
+	* sound.c (Fding):
+	* sound.c (vars_of_sound):
+	* specifier.c:
+	* specifier.c (make_specifier_internal):
+	* specifier.c (canonicalize_tag_set):
+	* specifier.c (setup_device_initial_specifier_tags):
+	* specifier.c (NOTE): New.
+	* specifier.c (recompute_one_cached_specifier_in_window):
+	* specifier.c (recompute_one_cached_specifier_in_frame):
+	* specifier.h:
+	* specifier.h (wrap_specifier):
+	* specifier.h (GENERIC_SPECIFIERP):
+	* specifier.h (INTEGER_SPECIFIERP):
+	* specifier.h (NATNUM_SPECIFIERP):
+	* specifier.h (BOOLEAN_SPECIFIERP):
+	* specifier.h (DISPLAYTABLE_SPECIFIERP):
+	* strftime.c (add_num_time_t):
+	* symbols.c:
+	* symbols.c (mark_symbol):
+	* symbols.c (Fintern):
+	* symbols.c (Fintern_soft):
+	* symbols.c (Funintern):
+	* symbols.c (oblookup):
+	* symbols.c (map_obarray):
+	* symbols.c (Fsymbol_name):
+	* symbols.c (set_up_buffer_local_cache):
+	* symbols.c (flush_all_buffer_local_cache):
+	* symbols.c (Fset):
+	* symbols.c (Fdefvaralias):
+	* symbols.c (init_symbols_once_early):
+	* symbols.c (defsubr):
+	* symbols.c (defsubr_macro):
+	* symbols.c (defvar_magic):
+	* symeval.h:
+	* symeval.h (wrap_symbol_value_magic):
+	* syntax.h:
+	* syntax.h (SYNTAX_CACHE_BYTE_TO_CHAR):
+	* syntax.h (SYNTAX_CACHE_OBJECT_BYTE_TO_CHAR):
+	* text.c (get_buffer_pos_char):
+	* text.c (get_buffer_range_char):
+	* text.c (get_string_pos_byte):
+	* text.c (get_string_range_byte):
+	* text.h:
+	* text.h (eiinit):
+	* text.h (eiinit_malloc):
+	* toolbar-common.c:
+	* toolbar-common.c (common_output_toolbar_button):
+	* toolbar-common.c (common_output_toolbar):
+	* toolbar-common.c (common_clear_toolbar):
+	* toolbar-msw.c:
+	* toolbar-msw.c (mswindows_output_toolbar):
+	* toolbar-msw.c (mswindows_handle_toolbar_wm_command):
+	* toolbar.c (update_toolbar_button):
+	* toolbar.c (init_frame_toolbars):
+	* toolbar.c (init_device_toolbars):
+	* toolbar.h (wrap_toolbar_button):
+	* toolbar.h (TOOLBAR_SPECIFIERP):
+	* tooltalk.c (make_tooltalk_message):
+	* tooltalk.c (make_tooltalk_pattern):
+	* tooltalk.c (init_tooltalk):
+	* tooltalk.h (wrap_tooltalk_message):
+	* tooltalk.h (wrap_tooltalk_pattern):
+	* ui-gtk.c (Fgtk_import_function_internal):
+	* ui-gtk.c (emacs_gtk_object_finalizer):
+	* ui-gtk.c (build_gtk_object):
+	* ui-gtk.c (build_gtk_boxed):
+	* ui-gtk.c (lisp_to_gtk_type):
+	* ui-gtk.h (wrap_emacs_ffi):
+	* ui-gtk.h (wrap_emacs_gtk_object):
+	* ui-gtk.h (wrap_emacs_gtk_boxed):
+	* undo.c (undo_prelude):
+	* vm-limit.c:
+	* vm-limit.c (memory_warnings):
+	* window.c:
+	* window.c (allocate_window):
+	* window.c (window_is_leftmost):
+	* window.c (window_is_rightmost):
+	* window.c (window_is_highest):
+	* window.c (window_is_lowest):
+	* window.c (margin_width_internal):
+	* window.c (Fnext_window):
+	* window.c (Fprevious_window):
+	* window.c (Fnext_vertical_window):
+	* window.c (window_loop):
+	* window.c (buffer_window_count):
+	* window.c (Fdelete_other_windows):
+	* window.c (list_windows):
+	* window.c (make_dummy_parent):
+	* window.c (window_pixel_height_to_char_height):
+	* window.c (window_char_height_to_pixel_height):
+	* window.c (window_displayed_height):
+	* window.c (window_pixel_width_to_char_width):
+	* window.c (window_char_width_to_pixel_width):
+	* window.c (change_window_height):
+	* window.c (Fmove_to_window_line):
+	* window.c (wrap_window_configuration):
+	* window.c (Fcurrent_window_configuration):
+	* window.h (wrap_window):
+	* window.h (wrap_window_mirror):
+	Eliminate XSETFOO.  Replace all usages with wrap_foo().
+
+	Make symbol->name a Lisp_Object, not Lisp_String *.  Eliminate
+	nearly all uses of Lisp_String * in favor of Lisp_Object, and
+	correct macros so most of them favor Lisp_Object.
+
+	Create new error-behavior ERROR_ME_DEBUG_WARN -- output warnings,
+	but at level `debug' (usually ignored).  Use it when instantiating
+	specifiers, so problems can be debugged.  Move
+	log-warning-minimum-level into C so that we can optimize
+	ERROR_ME_DEBUG_WARN.
+
+	Fix warning levels consistent with new definitions.
+
+	Add default_ and parent fields to char table; not yet implemented.
+
+	New fun Dynarr_verify(); use for further error checking on Dynarrs.
+
+	Rearrange code at top of lisp.h in conjunction with dynarr changes.
+	
+	Fix eifree().  Use Eistrings in various places
+	(format_event_object(), where_is_to_char(), and callers thereof)
+	to avoid fixed-size strings buffers.  New fun write_eistring().
+	
+	Reindent and fix GPM code to follow standards.
+
+	Set default MS Windows font to Lucida Console (same size as
+	Courier New but less interline spacing, so more lines fit).
+	Increase default frame size on Windows to 50 lines. (If that's too
+	big for the workspace, the frame will be shrunk as necessary.)
+
+	Fix problem with text files with no newlines (). (Change
+	`convert-eol' coding system to use `nil' for autodetect,
+	consistent with make-coding-system.)
+
+	Correct compile warnings in vm-limit.c.
+
+	Fix handling of reverse-direction charsets to avoid errors when
+	opening (e.g.) mule-ucs/lisp/reldata/uiso8859-6.el.
+
+	Recode some object printing methods to use write_fmt_string()
+	instead of a fixed buffer and sprintf.
+
+	Turn on display of png comments as warnings (level `info'), now
+	that they're unobtrusive.
+
+	Revamped the sound documentation.
+
+	Fixed bug in redisplay w.r.t. hscroll/truncation/continuation
+	glyphs causing jumping up and down of the lines, since they're
+	bigger than the line size. (It was seen most obviously when
+	there's a horizontal scroll bar, e.g. do C-h a glyph or something
+	like that.) The problem was that the glyph-contrib-p setting on
+	glyphs was ignored even if it was set properly, which it wasn't
+	until now.
+	
 2002-03-14  Mike Alexander  <mta@arbortext.com>
 
 	* event-msw.c (mswindows_unwait_process): New, remove process from
--- a/src/EmacsFrame.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/EmacsFrame.c	Fri Mar 29 04:49:13 2002 +0000
@@ -398,9 +398,7 @@
   EmacsFrame cur = (EmacsFrame) cur_widget;
   EmacsFrame new = (EmacsFrame) new_widget;
   struct frame *f = new->emacs_frame.frame;
-  Lisp_Object frame;
-
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
   in_resource_setting++;
   /* This function does not need to do much.  Pretty much everything
      interesting will get done in the resize method, which will
--- a/src/Makefile.in.in	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/Makefile.in.in	Fri Mar 29 04:49:13 2002 +0000
@@ -143,7 +143,7 @@
 ## needed (e.g. native sound support) and it would be pointless to
 ## duplicate that code.
 
-gui_objs=
+gui_objs= gui.o
 #ifdef HAVE_MENUBARS
 gui_objs += menubar.o
 #endif
@@ -156,9 +156,6 @@
 #ifdef HAVE_TOOLBARS
 gui_objs += toolbar.o
 #endif
-#ifdef HAVE_GUI_OBJECTS
-gui_objs += gui.o
-#endif
 
 #ifdef HAVE_X_WINDOWS
 x_objs=console-x.o device-x.o event-Xt.o frame-x.o \
@@ -320,7 +317,8 @@
  faces.o file-coding.o fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o \
  font-lock.o frame.o\
  general.o $(gif_objs) glyphs.o glyphs-eimage.o glyphs-shared.o\
- glyphs-widget.o $(gpm_objs) $(gtk_objs) $(gtk_gui_objs) $(gui_objs) gutter.o\
+ glyphs-widget.o $(gpm_objs) $(gtk_objs) $(gtk_gui_objs) $(gui_objs) \
+ gutter.o\
  hash.o imgproc.o indent.o insdel.o intl.o\
  keymap.o $(RTC_patch_objs) line-number.o $(ldap_objs) lread.o lstream.o\
  macros.o marker.o md5.o minibuf.o $(mswindows_objs) $(mswindows_gui_objs)\
--- a/src/abbrev.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/abbrev.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,5 +1,6 @@
 /* Primitives for word-abbrev mode.
    Copyright (C) 1985, 1986, 1992, 1993 Free Software Foundation, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -92,7 +93,7 @@
     (struct abbrev_match_mapper_closure *)arg;
   Charcount abbrev_length;
   Lisp_Symbol *sym = XSYMBOL (symbol);
-  Lisp_String *abbrev;
+  Lisp_Object abbrev;
 
   /* symbol_value should be OK here, because abbrevs are not expected
      to contain any SYMBOL_MAGIC stuff.  */
@@ -102,7 +103,7 @@
       return 0;
     }
   abbrev = symbol_name (sym);
-  abbrev_length = string_char_length (abbrev);
+  abbrev_length = XSTRING_CHAR_LENGTH (abbrev);
   if (abbrev_length > closure->maxlen)
     {
       /* This abbrev is too large -- it wouldn't fit. */
@@ -112,16 +113,17 @@
      normally want to expand it.  OTOH, if the abbrev begins with
      non-word syntax (e.g. `#if'), it is OK to abbreviate it anywhere.  */
   if (abbrev_length < closure->maxlen && abbrev_length > 0
-      && (WORD_SYNTAX_P (closure->chartab, string_char (abbrev, 0)))
+      && (WORD_SYNTAX_P (closure->chartab, XSTRING_CHAR (abbrev, 0)))
       && (WORD_SYNTAX_P (closure->chartab,
 			 BUF_FETCH_CHAR (closure->buf,
-					 closure->point - (abbrev_length + 1)))))
+					 closure->point -
+					 (abbrev_length + 1)))))
     {
       return 0;
     }
   /* Match abbreviation string against buffer text.  */
   {
-    Intbyte *ptr = string_data (abbrev);
+    Intbyte *ptr = XSTRING_DATA (abbrev);
     Charcount idx;
 
     for (idx = 0; idx < abbrev_length; idx++)
@@ -285,7 +287,6 @@
   Lisp_Symbol *(*fun) (struct buffer *, Lisp_Object);
 
   Lisp_Symbol *abbrev_symbol;
-  Lisp_String *abbrev_string;
   Lisp_Object expansion, count, hook;
   Charcount abbrev_length;
   int lccount, uccount;
@@ -328,8 +329,7 @@
   /* OK, we're out of the must-be-fast part.  An abbreviation matched.
      Now find the parameters, insert the expansion, and make it all
      look pretty.  */
-  abbrev_string = symbol_name (abbrev_symbol);
-  abbrev_length = string_char_length (abbrev_string);
+  abbrev_length = XSTRING_CHAR_LENGTH (symbol_name (abbrev_symbol));
   abbrev_start = point - abbrev_length;
 
   expansion = symbol_value (abbrev_symbol);
@@ -346,7 +346,7 @@
   abbrev_count_case (buf, abbrev_start, abbrev_length, &lccount, &uccount);
 
   /* Remember the last abbrev text, location, etc. */
-  XSETSYMBOL (Vlast_abbrev, abbrev_symbol);
+  Vlast_abbrev = wrap_symbol (abbrev_symbol);
   Vlast_abbrev_text =
     make_string_from_buffer (buf, abbrev_start, abbrev_length);
   last_abbrev_location = abbrev_start;
--- a/src/alloc.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/alloc.c	Fri Mar 29 04:49:13 2002 +0000
@@ -163,7 +163,7 @@
 
 #ifdef ERROR_CHECK_TYPECHECK
 
-Error_Behavior ERROR_ME, ERROR_ME_NOT, ERROR_ME_WARN;
+Error_Behavior ERROR_ME, ERROR_ME_NOT, ERROR_ME_WARN, ERROR_ME_DEBUG_WARN;
 
 #endif
 
@@ -211,7 +211,7 @@
     return;
 
   warn_when_safe
-    (Qmemory, Qcritical,
+    (Qmemory, Qemergency,
      "%s\n"
      "Killing some buffers may delay running out of memory.\n"
      "However, certainly by the time you receive the 95%% warning,\n"
@@ -347,7 +347,22 @@
 static void *
 allocate_lisp_storage (Bytecount size)
 {
-  return xmalloc (size);
+  void *val = xmalloc (size);
+  /* We don't increment the cons counter anymore.  Calling functions do
+     that now because we have two different kinds of cons counters -- one
+     for normal objects, and one for no-see-um conses (and possibly others
+     similar) where the conses are used totally internally, never escape,
+     and are created and then freed and shouldn't logically increment the
+     cons counting. #### (Or perhaps, we should decrement it when an object
+     get freed?)  */
+
+  /* But we do now (as of 3-27-02) go and zero out the memory.  This is a
+     good thing, as it will guarantee we won't get any intermittent bugs
+     coming from an uninitiated field.  The speed loss if unnoticeable,
+     esp. as the object are not large -- large stuff like buffer text and
+     redisplay structures and allocated separately. */
+  memset (val, 0, size);
+  return val;
 }
 
 
@@ -895,7 +910,7 @@
 
   ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c);
   set_lheader_implementation (&c->lheader, &lrecord_cons);
-  XSETCONS (val, c);
+  val = wrap_cons (c);
   c->car = car;
   c->cdr = cdr;
   return val;
@@ -912,7 +927,7 @@
 
   NOSEEUM_ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c);
   set_lheader_implementation (&c->lheader, &lrecord_cons);
-  XSETCONS (val, c);
+  val = wrap_cons (c);
   XCAR (val) = car;
   XCDR (val) = cdr;
   return val;
@@ -1019,7 +1034,6 @@
 Lisp_Object
 make_float (double float_value)
 {
-  Lisp_Object val;
   Lisp_Float *f;
 
   ALLOCATE_FIXED_TYPE (float, Lisp_Float, f);
@@ -1030,8 +1044,7 @@
 
   set_lheader_implementation (&f->lheader, &lrecord_float);
   float_data (f) = float_value;
-  XSETFLOAT (val, f);
-  return val;
+  return wrap_float (f);
 }
 
 #endif /* LISP_FLOAT_TYPE */
@@ -1121,11 +1134,7 @@
   while (length--)
     *p++ = object;
 
-  {
-    Lisp_Object vector;
-    XSETVECTOR (vector, vecp);
-    return vector;
-  }
+  return wrap_vector (vecp);
 }
 
 DEFUN ("make-vector", Fmake_vector, 2, 2, 0, /*
@@ -1150,11 +1159,7 @@
   while (nargs--)
     *p++ = *args++;
 
-  {
-    Lisp_Object vector;
-    XSETVECTOR (vector, vecp);
-    return vector;
-  }
+  return wrap_vector (vecp);
 }
 
 Lisp_Object
@@ -1281,7 +1286,7 @@
   /* make sure the extra bits in the last long are 0; the calling
      functions might not set them. */
   p->bits[num_longs - 1] = 0;
-  XSETBIT_VECTOR (all_bit_vectors, p);
+  all_bit_vectors = wrap_bit_vector (p);
   return p;
 }
 
@@ -1305,11 +1310,7 @@
 	p->bits[num_longs - 1] &= (1 << bits_in_last) - 1;
     }
 
-  {
-    Lisp_Object bit_vector;
-    XSETBIT_VECTOR (bit_vector, p);
-    return bit_vector;
-  }
+  return wrap_bit_vector (p);
 }
 
 Lisp_Object
@@ -1321,11 +1322,7 @@
   for (i = 0; i < length; i++)
     set_bit_vector_bit (p, i, bytevec[i]);
 
-  {
-    Lisp_Object bit_vector;
-    XSETBIT_VECTOR (bit_vector, p);
-    return bit_vector;
-  }
+  return wrap_bit_vector (p);
 }
 
 DEFUN ("make-bit-vector", Fmake_bit_vector, 2, 2, 0, /*
@@ -1355,11 +1352,7 @@
       set_bit_vector_bit (p, i, !ZEROP (args[i]));
     }
 
-  {
-    Lisp_Object bit_vector;
-    XSETBIT_VECTOR (bit_vector, p);
-    return bit_vector;
-  }
+  return wrap_bit_vector (p);
 }
 
 
@@ -1374,7 +1367,6 @@
 make_compiled_function (void)
 {
   Lisp_Compiled_Function *f;
-  Lisp_Object fun;
 
   ALLOCATE_FIXED_TYPE (compiled_function, Lisp_Compiled_Function, f);
   set_lheader_implementation (&f->lheader, &lrecord_compiled_function);
@@ -1391,8 +1383,7 @@
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
   f->annotated = Qnil;
 #endif
-  XSETCOMPILED_FUNCTION (fun, f);
-  return fun;
+  return wrap_compiled_function (f);
 }
 
 DEFUN ("make-byte-code", Fmake_byte_code, 4, MANY, 0, /*
@@ -1517,20 +1508,18 @@
 */
        (name))
 {
-  Lisp_Object val;
   Lisp_Symbol *p;
 
   CHECK_STRING (name);
 
   ALLOCATE_FIXED_TYPE (symbol, Lisp_Symbol, p);
   set_lheader_implementation (&p->lheader, &lrecord_symbol);
-  p->name     = XSTRING (name);
+  p->name     = name;
   p->plist    = Qnil;
   p->value    = Qunbound;
   p->function = Qunbound;
   symbol_next (p) = 0;
-  XSETSYMBOL (val, p);
-  return val;
+  return wrap_symbol (p);
 }
 
 
@@ -1573,14 +1562,12 @@
 Lisp_Object
 allocate_event (void)
 {
-  Lisp_Object val;
   Lisp_Event *e;
 
   ALLOCATE_FIXED_TYPE (event, Lisp_Event, e);
   set_lheader_implementation (&e->lheader, &lrecord_event);
 
-  XSETEVENT (val, e);
-  return val;
+  return wrap_event (e);
 }
 
 
@@ -1596,7 +1583,6 @@
 */
        ())
 {
-  Lisp_Object val;
   Lisp_Marker *p;
 
   ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p);
@@ -1606,14 +1592,12 @@
   marker_next (p) = 0;
   marker_prev (p) = 0;
   p->insertion_type = 0;
-  XSETMARKER (val, p);
-  return val;
+  return wrap_marker (p);
 }
 
 Lisp_Object
 noseeum_make_marker (void)
 {
-  Lisp_Object val;
   Lisp_Marker *p;
 
   NOSEEUM_ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p);
@@ -1623,8 +1607,7 @@
   marker_next (p) = 0;
   marker_prev (p) = 0;
   p->insertion_type = 0;
-  XSETMARKER (val, p);
-  return val;
+  return wrap_marker (p);
 }
 
 
@@ -1653,11 +1636,9 @@
 static Lisp_Object
 mark_string (Lisp_Object obj)
 {
-  Lisp_String *ptr = XSTRING (obj);
-
-  if (CONSP (ptr->plist) && EXTENT_INFOP (XCAR (ptr->plist)))
-    flush_cached_extent_info (XCAR (ptr->plist));
-  return ptr->plist;
+  if (CONSP (XSTRING_PLIST (obj)) && EXTENT_INFOP (XCAR (XSTRING_PLIST (obj))))
+    flush_cached_extent_info (XCAR (XSTRING_PLIST (obj)));
+  return XSTRING_PLIST (obj);
 }
 
 static int
@@ -1669,8 +1650,8 @@
 }
 
 static const struct lrecord_description string_description[] = {
-  { XD_BYTECOUNT,       offsetof (Lisp_String, size) },
-  { XD_OPAQUE_DATA_PTR, offsetof (Lisp_String, data), XD_INDIRECT(0, 1) },
+  { XD_BYTECOUNT,       offsetof (Lisp_String, size_) },
+  { XD_OPAQUE_DATA_PTR, offsetof (Lisp_String, data_), XD_INDIRECT(0, 1) },
   { XD_LISP_OBJECT,     offsetof (Lisp_String, plist) },
   { XD_END }
 };
@@ -1688,7 +1669,7 @@
 static Lisp_Object *
 string_plist_ptr (Lisp_Object string)
 {
-  Lisp_Object *ptr = &XSTRING (string)->plist;
+  Lisp_Object *ptr = &XSTRING_PLIST (string);
 
   if (CONSP (*ptr) && EXTENT_INFOP (XCAR (*ptr)))
     ptr = &XCDR (*ptr);
@@ -1793,7 +1774,7 @@
 }
 
 static struct string_chars *
-allocate_string_chars_struct (Lisp_String *string_it_goes_with,
+allocate_string_chars_struct (Lisp_Object string_it_goes_with,
 			      EMACS_INT fullsize)
 {
   struct string_chars *s_chars;
@@ -1822,7 +1803,7 @@
 	current_string_chars_block->string_chars;
     }
 
-  s_chars->string = string_it_goes_with;
+  s_chars->string = XSTRING (string_it_goes_with);
 
   INCREMENT_CONS_COUNTER (fullsize, "string chars");
 
@@ -1849,7 +1830,7 @@
 #endif
 
 /* You do NOT want to be calling this! (And if you do, you must call
-   set_string_ascii_begin() after modifying the string.) Use alloca()
+   XSET_STRING_ASCII_BEGIN() after modifying the string.) Use alloca()
    instead and then call make_string() like the rest of the world. */
 
 Lisp_Object
@@ -1857,26 +1838,24 @@
 {
   Lisp_String *s;
   EMACS_INT fullsize = STRING_FULLSIZE (length);
-  Lisp_Object val;
 
   assert (length >= 0 && fullsize > 0);
 
   /* Allocate the string header */
   ALLOCATE_FIXED_TYPE (string, Lisp_String, s);
+  xzero (*s);
   set_lheader_implementation (&s->u.lheader, &lrecord_string);
-
+  
   set_string_data (s, BIG_STRING_FULLSIZE_P (fullsize)
 		   ? xnew_array (Intbyte, length + 1)
-		   : allocate_string_chars_struct (s, fullsize)->chars);
+		   : allocate_string_chars_struct (wrap_string (s),
+						   fullsize)->chars);
 
   set_string_length (s, length);
   s->plist = Qnil;
-  set_string_ascii_begin (s, 0);
-
-  set_string_byte (s, length, 0);
-
-  XSETSTRING (val, s);
-  return val;
+  set_string_byte (wrap_string (s), length, 0);
+
+  return wrap_string (s);
 }
 
 #ifdef VERIFY_STRING_CHARS_INTEGRITY
@@ -1890,7 +1869,7 @@
 */
 
 void
-resize_string (Lisp_String *s, Bytecount pos, Bytecount delta)
+resize_string (Lisp_Object s, Bytecount pos, Bytecount delta)
 {
   Bytecount oldfullsize, newfullsize;
 #ifdef VERIFY_STRING_CHARS_INTEGRITY
@@ -1900,14 +1879,14 @@
 #ifdef ERROR_CHECK_CHARBPOS
   if (pos >= 0)
     {
-      assert (pos <= string_length (s));
+      assert (pos <= XSTRING_LENGTH (s));
       if (delta < 0)
-	assert (pos + (-delta) <= string_length (s));
+	assert (pos + (-delta) <= XSTRING_LENGTH (s));
     }
   else
     {
       if (delta < 0)
-	assert ((-delta) <= string_length (s));
+	assert ((-delta) <= XSTRING_LENGTH (s));
     }
 #endif /* ERROR_CHECK_CHARBPOS */
 
@@ -1921,8 +1900,8 @@
        so convert this to the appropriate form. */
     pos += -delta;
 
-  oldfullsize = STRING_FULLSIZE (string_length (s));
-  newfullsize = STRING_FULLSIZE (string_length (s) + delta);
+  oldfullsize = STRING_FULLSIZE (XSTRING_LENGTH (s));
+  newfullsize = STRING_FULLSIZE (XSTRING_LENGTH (s) + delta);
 
   if (BIG_STRING_FULLSIZE_P (oldfullsize))
     {
@@ -1933,28 +1912,31 @@
 	     memmove() _before_ realloc(), and if growing, we have to
 	     memmove() _after_ realloc() - otherwise the access is
 	     illegal, and we might crash. */
-	  Bytecount len = string_length (s) + 1 - pos;
+	  Bytecount len = XSTRING_LENGTH (s) + 1 - pos;
 
 	  if (delta < 0 && pos >= 0)
-	    memmove (string_data (s) + pos + delta, string_data (s) + pos, len);
-	  set_string_data (s, (Intbyte *) xrealloc (string_data (s),
-						    string_length (s) + delta + 1));
+	    memmove (XSTRING_DATA (s) + pos + delta,
+		     XSTRING_DATA (s) + pos, len);
+	  XSET_STRING_DATA
+	    (s, (Intbyte *) xrealloc (XSTRING_DATA (s),
+				      XSTRING_LENGTH (s) + delta + 1));
 	  if (delta > 0 && pos >= 0)
-	    memmove (string_data (s) + pos + delta, string_data (s) + pos, len);
+	    memmove (XSTRING_DATA (s) + pos + delta, XSTRING_DATA (s) + pos,
+		     len);
 	}
       else /* String has been demoted from BIG_STRING. */
 	{
 	  Intbyte *new_data =
 	    allocate_string_chars_struct (s, newfullsize)->chars;
-	  Intbyte *old_data = string_data (s);
+	  Intbyte *old_data = XSTRING_DATA (s);
 
 	  if (pos >= 0)
 	    {
 	      memcpy (new_data, old_data, pos);
 	      memcpy (new_data + pos + delta, old_data + pos,
-		      string_length (s) + 1 - pos);
+		      XSTRING_LENGTH (s) + 1 - pos);
 	    }
-	  set_string_data (s, new_data);
+	  XSET_STRING_DATA (s, new_data);
 	  xfree (old_data);
 	}
     }
@@ -1969,28 +1951,28 @@
 	     constraints). */
 	  if (pos >= 0)
 	    {
-	      Intbyte *addroff = pos + string_data (s);
+	      Intbyte *addroff = pos + XSTRING_DATA (s);
 
 	      memmove (addroff + delta, addroff,
 		       /* +1 due to zero-termination. */
-		       string_length (s) + 1 - pos);
+		       XSTRING_LENGTH (s) + 1 - pos);
 	    }
 	}
       else
 	{
-	  Intbyte *old_data = string_data (s);
+	  Intbyte *old_data = XSTRING_DATA (s);
 	  Intbyte *new_data =
 	    BIG_STRING_FULLSIZE_P (newfullsize)
-	    ? xnew_array (Intbyte, string_length (s) + delta + 1)
+	    ? xnew_array (Intbyte, XSTRING_LENGTH (s) + delta + 1)
 	    : allocate_string_chars_struct (s, newfullsize)->chars;
 
 	  if (pos >= 0)
 	    {
 	      memcpy (new_data, old_data, pos);
 	      memcpy (new_data + pos + delta, old_data + pos,
-		      string_length (s) + 1 - pos);
+		      XSTRING_LENGTH (s) + 1 - pos);
 	    }
-	  set_string_data (s, new_data);
+	  XSET_STRING_DATA (s, new_data);
 
 	  {
 	    /* We need to mark this chunk of the string_chars_block
@@ -2000,7 +1982,7 @@
 	      ((char *) old_data - offsetof (struct string_chars, chars));
 	    /* Sanity check to make sure we aren't hosed by strange
 	       alignment/padding. */
-	    assert (old_s_chars->string == s);
+	    assert (old_s_chars->string == XSTRING (s));
 	    MARK_STRING_CHARS_AS_FREE (old_s_chars);
 	    ((struct unused_string_chars *) old_s_chars)->fullsize =
 	      oldfullsize;
@@ -2008,23 +1990,17 @@
 	}
     }
 
-  set_string_length (s, string_length (s) + delta);
+  XSET_STRING_LENGTH (s, XSTRING_LENGTH (s) + delta);
   /* If pos < 0, the string won't be zero-terminated.
      Terminate now just to make sure. */
-  string_data (s)[string_length (s)] = '\0';
+  XSTRING_DATA (s)[XSTRING_LENGTH (s)] = '\0';
 
   if (pos >= 0)
-    {
-      Lisp_Object string;
-
-      XSETSTRING (string, s);
-      /* We also have to adjust all of the extent indices after the
-	 place we did the change.  We say "pos - 1" because
-	 adjust_extents() is exclusive of the starting position
-	 passed to it. */
-      adjust_extents (string, pos - 1, string_length (s),
-		      delta);
-    }
+    /* We also have to adjust all of the extent indices after the
+       place we did the change.  We say "pos - 1" because
+       adjust_extents() is exclusive of the starting position
+       passed to it. */
+    adjust_extents (s, pos - 1, XSTRING_LENGTH (s), delta);
 
 #ifdef VERIFY_STRING_CHARS_INTEGRITY
   verify_string_chars_integrity ();
@@ -2036,37 +2012,37 @@
 /* WARNING: If you modify an existing string, you must call
    CHECK_LISP_WRITEABLE() before and bump_string_modiff() afterwards. */
 void
-set_string_char (Lisp_String *s, Charcount i, Emchar c)
+set_string_char (Lisp_Object s, Charcount i, Emchar c)
 {
   Intbyte newstr[MAX_EMCHAR_LEN];
   Bytecount bytoff = string_index_char_to_byte (s, i);
-  Bytecount oldlen = charcount_to_bytecount (string_data (s) + bytoff, 1);
+  Bytecount oldlen = charcount_to_bytecount (XSTRING_DATA (s) + bytoff, 1);
   Bytecount newlen = set_charptr_emchar (newstr, c);
 
-  sledgehammer_check_ascii_begin (wrap_string (s));
+  sledgehammer_check_ascii_begin (s);
   if (oldlen != newlen)
     resize_string (s, bytoff, newlen - oldlen);
-  /* Remember, string_data (s) might have changed so we can't cache it. */
-  memcpy (string_data (s) + bytoff, newstr, newlen);
+  /* Remember, XSTRING_DATA (s) might have changed so we can't cache it. */
+  memcpy (XSTRING_DATA (s) + bytoff, newstr, newlen);
   if (oldlen != newlen) 
     {
-      if (newlen > 1 && i <= (Charcount) string_ascii_begin (s))
+      if (newlen > 1 && i <= (Charcount) XSTRING_ASCII_BEGIN (s))
       /* Everything starting with the new char is no longer part of
 	 ascii_begin */
-	set_string_ascii_begin (s, i);
-      else if (newlen == 1 && i == (Charcount) string_ascii_begin (s))
+	XSET_STRING_ASCII_BEGIN (s, i);
+      else if (newlen == 1 && i == (Charcount) XSTRING_ASCII_BEGIN (s))
 	/* We've extended ascii_begin, and we have to figure out how much by */
 	{
 	  Bytecount j;
-	  for (j = i + 1; j < string_length (s); j++)
+	  for (j = i + 1; j < XSTRING_LENGTH (s); j++)
 	    {
-	      if (!BYTE_ASCII_P (string_data (s)[j]))
+	      if (!BYTE_ASCII_P (XSTRING_DATA (s)[j]))
 		break;
 	    }
-	  set_string_ascii_begin (s, min (j, MAX_STRING_ASCII_BEGIN));
+	  XSET_STRING_ASCII_BEGIN (s, min (j, MAX_STRING_ASCII_BEGIN));
 	}
     }
-  sledgehammer_check_ascii_begin (wrap_string (s));
+  sledgehammer_check_ascii_begin (s);
 }
 
 #endif /* MULE */
@@ -2088,8 +2064,8 @@
       {
 	/* Optimize the single-byte case */
 	memset (XSTRING_DATA (val), XCHAR (character), XSTRING_LENGTH (val));
-	set_string_ascii_begin (XSTRING (val), min (MAX_STRING_ASCII_BEGIN,
-						    len * XINT (length)));
+	XSET_STRING_ASCII_BEGIN (val, min (MAX_STRING_ASCII_BEGIN,
+					   len * XINT (length)));
       }
     else
       {
@@ -2145,10 +2121,10 @@
       if (!BYTE_ASCII_P (contents[i]))
 	break;
     }
-  set_string_ascii_begin (XSTRING (string), min (i, MAX_STRING_ASCII_BEGIN));
+  XSET_STRING_ASCII_BEGIN (string, min (i, MAX_STRING_ASCII_BEGIN));
 #else
-  set_string_ascii_begin (XSTRING (string), min (XSTRING_LENGTH (string),
-						 MAX_STRING_ASCII_BEGIN));
+  XSET_STRING_ASCII_BEGIN (string, min (XSTRING_LENGTH (string),
+					MAX_STRING_ASCII_BEGIN));
 #endif
   sledgehammer_check_ascii_begin (string);
 }
@@ -2237,7 +2213,7 @@
   s->plist = Qnil;
   set_string_data (s, (Intbyte *) contents);
   set_string_length (s, length);
-  XSETSTRING (val, s);
+  val = wrap_string (s);
   init_string_ascii_begin (val);
   sledgehammer_check_ascii_begin (val);
 
@@ -2325,13 +2301,11 @@
     /* Avoid infinite recursion allocating this */
     alloc_unmanaged_lcrecord_type (struct lcrecord_list,
 				   &lrecord_lcrecord_list);
-  Lisp_Object val;
 
   p->implementation = implementation;
   p->size = size;
   p->free = Qnil;
-  XSETLCRECORD_LIST (val, p);
-  return val;
+  return wrap_lcrecord_list (p);
 }
 
 Lisp_Object
@@ -2365,12 +2339,7 @@
       return val;
     }
   else
-    {
-      Lisp_Object val;
-
-      XSETOBJ (val, alloc_lcrecord (list->size, list->implementation));
-      return val;
-    }
+    return wrap_pointer_1 (alloc_lcrecord (list->size, list->implementation));
 }
 
 /* "Free" a Lisp object LCRECORD by placing it on its associated free list
@@ -3078,7 +3047,7 @@
 #define UNMARK_marker(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader))
 #define ADDITIONAL_FREE_marker(ptr)					\
   do { Lisp_Object tem;							\
-       XSETMARKER (tem, ptr);						\
+       tem = wrap_marker (ptr);						\
        unchain_marker (tem);						\
      } while (0)
 
@@ -3133,11 +3102,11 @@
 	  /* Must be 32-bit aligned. */
 	  assert ((((int) string) & 3) == 0);
 
-          size = string_length (string);
+          size = string->size_;
           fullsize = STRING_FULLSIZE (size);
 
           assert (!BIG_STRING_FULLSIZE_P (fullsize));
-	  assert (string_data (string) == s_chars->chars);
+	  assert (string->data_ == s_chars->chars);
 	  pos += fullsize;
         }
       assert (pos == sb->pos);
@@ -3188,7 +3157,7 @@
           string = from_s_chars->string;
 	  assert (!(LRECORD_FREE_P (string)));
 
-          size = string_length (string);
+          size = string->size_;
           fullsize = STRING_FULLSIZE (size);
 
           gc_checking_assert (! BIG_STRING_FULLSIZE_P (fullsize));
@@ -3249,14 +3218,14 @@
 static int debug_string_purity;
 
 static void
-debug_string_purity_print (Lisp_String *p)
+debug_string_purity_print (Lisp_Object p)
 {
   Charcount i;
-  Charcount s = string_char_length (p);
+  Charcount s = XSTRING_CHAR_LENGTH (p);
   stderr_out ("\"");
   for (i = 0; i < s; i++)
   {
-    Emchar ch = string_char (p, i);
+    Emchar ch = XSTRING_CHAR (p, i);
     if (ch < 32 || ch >= 126)
       stderr_out ("\\%03o", ch);
     else if (ch == '\\' || ch == '\"')
@@ -3276,23 +3245,23 @@
   Bytecount num_small_bytes = 0, num_bytes = 0;
   int debug = debug_string_purity;
 
-#define UNMARK_string(ptr) do {			\
-    Lisp_String *p = (ptr);			\
-    Bytecount size = string_length (p);		\
-    UNMARK_RECORD_HEADER (&(p->u.lheader));	\
-    num_bytes += size;				\
-    if (!BIG_STRING_SIZE_P (size))		\
-      {						\
-	num_small_bytes += size;		\
-        num_small_used++;			\
-      }						\
-    if (debug)					\
-      debug_string_purity_print (p);		\
+#define UNMARK_string(ptr) do {				\
+    Lisp_String *p = (ptr);				\
+    Bytecount size = p->size_;				\
+    UNMARK_RECORD_HEADER (&(p->u.lheader));		\
+    num_bytes += size;					\
+    if (!BIG_STRING_SIZE_P (size))			\
+      {							\
+	num_small_bytes += size;			\
+        num_small_used++;				\
+      }							\
+    if (debug)						\
+      debug_string_purity_print (wrap_string (p));	\
   } while (0)
 #define ADDITIONAL_FREE_string(ptr) do {	\
-    Bytecount size = string_length (ptr);	\
+    Bytecount size = ptr->size_;		\
     if (BIG_STRING_SIZE_P (size))		\
-      xfree (ptr->data);			\
+      xfree (ptr->data_);			\
   } while (0)
 
   SWEEP_FIXED_TYPE_BLOCK_1 (string, Lisp_String, u.lheader);
@@ -4101,7 +4070,7 @@
 #ifndef Qnull_pointer
   /* C guarantees that Qnull_pointer will be initialized to all 0 bits,
      so the following is actually a no-op.  */
-  XSETOBJ (Qnull_pointer, 0);
+  Qnull_pointer = wrap_pointer_1 (0);
 #endif
 
   gc_generation_number[0] = 0;
@@ -4163,6 +4132,9 @@
   ERROR_ME_WARN.
     really_unlikely_name_to_have_accidentally_in_a_non_errb_structure =
       3333632;
+  ERROR_ME_DEBUG_WARN.
+    really_unlikely_name_to_have_accidentally_in_a_non_errb_structure =
+      8675309;
 #endif /* ERROR_CHECK_TYPECHECK */
 }
 
--- a/src/buffer.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/buffer.c	Fri Mar 29 04:49:13 2002 +0000
@@ -366,8 +366,7 @@
        (buffer))
 {
   struct buffer *b = decode_buffer (buffer, 1);
-  XSETBUFFER (buffer, b);
-  return buffer;
+  return wrap_buffer (b);
 }
 
 #if 0 /* FSFmacs */
@@ -551,9 +550,7 @@
 static Lisp_Object
 finish_init_buffer (struct buffer *b, Lisp_Object name)
 {
-  Lisp_Object buf;
-
-  XSETBUFFER (buf, b);
+  Lisp_Object buf = wrap_buffer (b);
 
   name = Fcopy_sequence (name);
   /* #### This really does not need to be called.  We already
@@ -566,7 +563,7 @@
   b->last_window_start = 1;
 
   b->name = name;
-  if (string_byte (XSTRING (name), 0) != ' ')
+  if (XSTRING_BYTE (name, 0) != ' ')
     b->undo_list = Qnil;
   else
     b->undo_list = Qt;
@@ -1004,7 +1001,7 @@
     {
       struct frame *f = decode_frame (frame);
 
-      XSETFRAME (frame, f);
+      frame = wrap_frame (f);
       alist = f->buffer_alist;
     }
 
@@ -1013,7 +1010,7 @@
       buf = Fcdr (Fcar (tail));
       if (EQ (buf, buffer))
 	continue;
-      if (string_byte (XSTRING (XBUFFER (buf)->name), 0) == ' ')
+      if (XSTRING_BYTE (XBUFFER (buf)->name, 0) == ' ')
 	continue;
       /* If FRAME has a buffer_predicate,
 	 disregard buffers that don't fit the predicate.  */
@@ -1399,9 +1396,7 @@
 */
        ())
 {
-  Lisp_Object buffer;
-  XSETBUFFER (buffer, current_buffer);
-  return buffer;
+  return wrap_buffer (current_buffer);
 }
 
 /* Set the current buffer to B.  */
@@ -1568,7 +1563,7 @@
      breaks mh-e and TeX and such packages. */
   if (NILP (buffer))
     switch_to_buffer (Fother_buffer (Fcurrent_buffer (), Qnil, Qnil), Qnil);
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
 
   if (!NILP (before))
     before = get_buffer (before, 1);
@@ -2033,8 +2028,8 @@
 
   staticpro_nodump (&Vbuffer_defaults);
   staticpro_nodump (&Vbuffer_local_symbols);
-  XSETBUFFER (Vbuffer_defaults, defs);
-  XSETBUFFER (Vbuffer_local_symbols, syms);
+  Vbuffer_defaults = wrap_buffer (defs);
+  Vbuffer_local_symbols = wrap_buffer (syms);
 
   nuke_all_buffer_slots (syms, Qnil);
   nuke_all_buffer_slots (defs, Qnil);
--- a/src/buffer.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/buffer.h	Fri Mar 29 04:49:13 2002 +0000
@@ -223,7 +223,6 @@
 
 DECLARE_LRECORD (buffer, struct buffer);
 #define XBUFFER(x) XRECORD (x, buffer, struct buffer)
-#define XSETBUFFER(x, p) XSETRECORD (x, p, buffer)
 #define wrap_buffer(p) wrap_record (p, buffer)
 #define BUFFERP(x) RECORDP (x, buffer)
 #define CHECK_BUFFER(x) CHECK_RECORD (x, buffer)
@@ -391,21 +390,21 @@
 
 #define buffer_or_string_charbpos_to_bytebpos(obj, pos)		\
   (BUFFERP (obj) ? charbpos_to_bytebpos (XBUFFER (obj), pos) :	\
-   (Bytebpos) XSTRING_INDEX_CHAR_TO_BYTE (obj, pos))
+   (Bytebpos) string_index_char_to_byte (obj, pos))
 
 #define buffer_or_string_bytebpos_to_charbpos(obj, ind)		\
   (BUFFERP (obj) ? bytebpos_to_charbpos (XBUFFER (obj), ind) :	\
-   (Charbpos) XSTRING_INDEX_BYTE_TO_CHAR (obj, ind))
+   (Charbpos) string_index_byte_to_char (obj, ind))
 
 /* Similar for Charbpos's and Membposs. */
 
 #define buffer_or_string_charbpos_to_membpos(obj, pos)		\
   (BUFFERP (obj) ? charbpos_to_membpos (XBUFFER (obj), pos) :	\
-   (Membpos) XSTRING_INDEX_CHAR_TO_BYTE (obj, pos))
+   (Membpos) string_index_char_to_byte (obj, pos))
 
 #define buffer_or_string_membpos_to_charbpos(obj, ind)		\
   (BUFFERP (obj) ? membpos_to_charbpos (XBUFFER (obj), ind) :	\
-   (Charbpos) XSTRING_INDEX_BYTE_TO_CHAR (obj, ind))
+   (Charbpos) string_index_byte_to_char (obj, ind))
 
 /************************************************************************/
 /*                                                                      */
--- a/src/bytecode.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/bytecode.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1147,8 +1147,8 @@
 
 	case Bcurrent_buffer:
 	  {
-	    Lisp_Object buffer;
-	    XSETBUFFER (buffer, current_buffer);
+	    Lisp_Object buffer = wrap_buffer (current_buffer);
+
 	    PUSH (buffer);
 	    break;
 	  }
--- a/src/bytecode.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/bytecode.h	Fri Mar 29 04:49:13 2002 +0000
@@ -91,7 +91,6 @@
 DECLARE_LRECORD (compiled_function, Lisp_Compiled_Function);
 #define XCOMPILED_FUNCTION(x) XRECORD (x, compiled_function, \
 				       Lisp_Compiled_Function)
-#define XSETCOMPILED_FUNCTION(x, p) XSETRECORD (x, p, compiled_function)
 #define wrap_compiled_function(p) wrap_record (p, compiled_function)
 #define COMPILED_FUNCTIONP(x) RECORDP (x, compiled_function)
 #define CHECK_COMPILED_FUNCTION(x) CHECK_RECORD (x, compiled_function)
--- a/src/callint.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/callint.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Call a Lisp function interactively.
    Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
-   Copyright (C) 1995, 1996, 2001 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -308,8 +308,8 @@
 #ifdef IT_SEEMS_THAT_MLY_DOESNT_LIKE_THIS
   Lisp_Object enable;
 #endif
-  /* If SPECS is a string, we reset prompt_data to string_data
-   * (XSTRING (specs)) every time a GC might have occurred */
+  /* If SPECS is a string, we reset prompt_data to XSTRING_DATA (specs)
+     every time a GC might have occurred */
   const char *prompt_data = 0;
   int prompt_index = 0;
   int argcount;
@@ -891,7 +891,7 @@
 		   */
 		  tem = Fintern (tem, Qnil);
 		  args[argnum] = tem;
-		  if (string_length (XSYMBOL (tem)->name) > 0)
+		  if (XSTRING_LENGTH (XSYMBOL (tem)->name) > 0)
 		    /* Don't accept the empty-named symbol.  If the loser
 		       really wants this s/he can call completing-read
                        directly */
@@ -991,7 +991,7 @@
        temporarily, convert it to an integer now.  */
     for (argnum = 0; argnum < argcount; argnum++)
       if (!NILP (varies[argnum]))
-	XSETINT (args[argnum], marker_position (args[argnum]));
+	args[argnum] = make_int (marker_position (args[argnum]));
 
     single_console_state ();
     specbind (Qcommand_debug_status, Qnil);
--- a/src/callproc.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/callproc.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Old synchronous subprocess invocation for XEmacs.
    Copyright (C) 1985, 86, 87, 88, 93, 94, 95 Free Software Foundation, Inc.
-   Copyright (C) 2000, 2001 Ben Wing.
+   Copyright (C) 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -134,7 +134,7 @@
     {
       HANDLE pHandle = OpenProcess (PROCESS_ALL_ACCESS, 0, pid);
       if (pHandle == NULL)
-	warn_when_safe (Qprocess, Qwarning,
+	warn_when_safe (Qprocess, Qnotice,
 			"cannot open process (PID %d) for cleanup", pid);
       else
 	wait_for_termination (pHandle);
@@ -387,7 +387,7 @@
 	if (pHandle == NULL)
 	  {
 	    /* #### seems to cause crash in unbind_to_1(...) below. APA */
-	    warn_when_safe (Qprocess, Qwarning,
+	    warn_when_safe (Qprocess, Qnotice,
 			    "cannot open process to wait for");
 	  }
 #endif
@@ -463,7 +463,7 @@
     /* FSFmacs calls Fset_buffer() here.  We don't have to because
        we can insert into buffers other than the current one. */
     if (EQ (buffer, Qt))
-      XSETBUFFER (buffer, current_buffer);
+      buffer = wrap_buffer (current_buffer);
     instream = make_filedesc_input_stream (fd[0], 0, -1, LSTR_ALLOW_QUIT);
     instream =
       make_coding_input_stream
--- a/src/casetab.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/casetab.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 /* XEmacs routines to deal with case tables.
    Copyright (C) 1987, 1992, 1993, 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -96,7 +97,6 @@
 static Lisp_Object
 allocate_case_table (void)
 {
-  Lisp_Object val;
   Lisp_Case_Table *ct =
     alloc_lcrecord_type (Lisp_Case_Table, &lrecord_case_table);
 
@@ -105,8 +105,7 @@
   SET_CASE_TABLE_CANON (ct, Qnil);
   SET_CASE_TABLE_EQV (ct, Qnil);
 
-  XSETCASE_TABLE (val, ct);
-  return val;
+  return wrap_case_table (ct);
 }
 
 DEFUN ("case-table-p", Fcase_table_p, 1, 1, 0, /*
@@ -348,7 +347,7 @@
       temp = down;
       down = MAKE_TRT_TABLE ();
       for (i = 0; i < 256; i++)
-	SET_TRT_TABLE_CHAR_1 (down, i, string_char (XSTRING (temp), i));
+	SET_TRT_TABLE_CHAR_1 (down, i, XSTRING_CHAR (temp, i));
 
       if (NILP (up))
 	{
@@ -360,7 +359,7 @@
 	  temp = up;
 	  up = MAKE_TRT_TABLE ();
 	  for (i = 0; i < 256; i++)
-	    SET_TRT_TABLE_CHAR_1 (up, i, string_char (XSTRING (temp), i));
+	    SET_TRT_TABLE_CHAR_1 (up, i, XSTRING_CHAR (temp, i));
 	}
       if (NILP (canon))
 	{
@@ -382,7 +381,7 @@
 	  temp = canon;
 	  canon = MAKE_TRT_TABLE ();
 	  for (i = 0; i < 256; i++)
-	    SET_TRT_TABLE_CHAR_1 (canon, i, string_char (XSTRING (temp), i));
+	    SET_TRT_TABLE_CHAR_1 (canon, i, XSTRING_CHAR (temp, i));
 	}
 
       if (NILP (eqv))
@@ -395,7 +394,7 @@
 	  temp = eqv;
 	  eqv = MAKE_TRT_TABLE ();
 	  for (i = 0; i < 256; i++)
-	    SET_TRT_TABLE_CHAR_1 (eqv, i, string_char (XSTRING (temp), i));
+	    SET_TRT_TABLE_CHAR_1 (eqv, i, XSTRING_CHAR (temp, i));
 	}
 
       if (standard)
--- a/src/casetab.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/casetab.h	Fri Mar 29 04:49:13 2002 +0000
@@ -34,7 +34,6 @@
   
 DECLARE_LRECORD (case_table, Lisp_Case_Table);
 #define XCASE_TABLE(x) XRECORD (x, case_table, Lisp_Case_Table)
-#define XSETCASE_TABLE(x, p) XSETRECORD (x, p, case_table)
 #define wrap_case_table(p) wrap_record (p, case_table)
 #define CASE_TABLEP(x) RECORDP (x, case_table)
 #define CHECK_CASE_TABLE(x) CHECK_RECORD (x, case_table)
--- a/src/charset.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/charset.h	Fri Mar 29 04:49:13 2002 +0000
@@ -261,7 +261,6 @@
 
 DECLARE_LRECORD (charset, Lisp_Charset);
 #define XCHARSET(x) XRECORD (x, charset, Lisp_Charset)
-#define XSETCHARSET(x, p) XSETRECORD (x, p, charset)
 #define wrap_charset(p) wrap_record (p, charset)
 #define CHARSETP(x) RECORDP (x, charset)
 #define CHECK_CHARSET(x) CHECK_RECORD (x, charset)
--- a/src/chartab.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/chartab.c	Fri Mar 29 04:49:13 2002 +0000
@@ -154,6 +154,8 @@
   for (i = 0; i < NUM_LEADING_BYTES; i++)
     mark_object (ct->level1[i]);
 #endif
+  mark_object (ct->parent);
+  mark_object (ct->default_);
   return ct->mirror_table;
 }
 
@@ -320,12 +322,9 @@
 print_char_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
   Lisp_Char_Table *ct = XCHAR_TABLE (obj);
-  char buf[200];
 
-  sprintf (buf, "#s(char-table type %s data (",
-	   string_data (symbol_name (XSYMBOL
-				     (char_table_type_to_symbol (ct->type)))));
-  write_c_string (buf, printcharfun);
+  write_fmt_string_lisp (printcharfun, "#s(char-table type %s data (",
+			 1, char_table_type_to_symbol (ct->type));
 
   /* Now write out the ASCII/Control-1 stuff. */
   {
@@ -431,6 +430,8 @@
 #ifdef MULE
   { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, level1), NUM_LEADING_BYTES },
 #endif
+  { XD_LISP_OBJECT, offsetof (Lisp_Char_Table, parent) },
+  { XD_LISP_OBJECT, offsetof (Lisp_Char_Table, default_) },
   { XD_LISP_OBJECT, offsetof (Lisp_Char_Table, mirror_table) },
   { XD_LO_LINK,     offsetof (Lisp_Char_Table, next_table) },
   { XD_END }
@@ -614,7 +615,9 @@
   else
     ct->mirror_table = Qnil;
   ct->next_table = Qnil;
-  XSETCHAR_TABLE (obj, ct);
+  ct->parent = Qnil;
+  ct->default_ = Qnil;
+  obj = wrap_char_table (ct);
   if (ty == CHAR_TABLE_TYPE_SYNTAX)
     {
       ct->next_table = Vall_syntax_tables;
@@ -629,7 +632,6 @@
 static Lisp_Object
 make_char_table_entry (Lisp_Object initval)
 {
-  Lisp_Object obj;
   int i;
   Lisp_Char_Table_Entry *cte =
     alloc_lcrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
@@ -637,15 +639,13 @@
   for (i = 0; i < 96; i++)
     cte->level2[i] = initval;
 
-  XSETCHAR_TABLE_ENTRY (obj, cte);
-  return obj;
+  return wrap_char_table_entry (cte);
 }
 
 static Lisp_Object
 copy_char_table_entry (Lisp_Object entry)
 {
   Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (entry);
-  Lisp_Object obj;
   int i;
   Lisp_Char_Table_Entry *ctenew =
     alloc_lcrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
@@ -659,8 +659,7 @@
 	ctenew->level2[i] = new;
     }
 
-  XSETCHAR_TABLE_ENTRY (obj, ctenew);
-  return obj;
+  return wrap_char_table_entry (ctenew);
 }
 
 #endif /* MULE */
@@ -680,6 +679,8 @@
   ct = XCHAR_TABLE (char_table);
   ctnew = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table);
   ctnew->type = ct->type;
+  ctnew->parent = ct->parent;
+  ctnew->default_ = ct->default_;
 
   for (i = 0; i < NUM_ASCII_CHARS; i++)
     {
@@ -708,7 +709,7 @@
   else
     ctnew->mirror_table = ct->mirror_table;
   ctnew->next_table = Qnil;
-  XSETCHAR_TABLE (obj, ctnew);
+  obj = wrap_char_table (ctnew);
   if (ctnew->type == CHAR_TABLE_TYPE_SYNTAX)
     {
       ctnew->next_table = Vall_syntax_tables;
--- a/src/chartab.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/chartab.h	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 /* Declarations having to do with Mule char tables.
    Copyright (C) 1992 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -53,7 +54,6 @@
 DECLARE_LRECORD (char_table_entry, Lisp_Char_Table_Entry);
 #define XCHAR_TABLE_ENTRY(x) \
   XRECORD (x, char_table_entry, Lisp_Char_Table_Entry)
-#define XSETCHAR_TABLE_ENTRY(x, p) XSETRECORD (x, p, char_table_entry)
 #define wrap_char_table_entry(p) wrap_record (p, char_table_entry)
 #define CHAR_TABLE_ENTRYP(x) RECORDP (x, char_table_entry)
 /* #define CHECK_CHAR_TABLE_ENTRY(x) CHECK_RECORD (x, char_table_entry)
@@ -83,7 +83,9 @@
   struct lcrecord_header header;
 
   Lisp_Object ascii[NUM_ASCII_CHARS];
-
+  Lisp_Object default_; /* #### not yet implemented */
+  Lisp_Object parent; /* #### not yet implemented */
+  
 #ifdef MULE
   /* We basically duplicate the Mule vectors-of-vectors implementation.
      We can do this because we know a great deal about the sorts of
@@ -124,7 +126,6 @@
 
 DECLARE_LRECORD (char_table, Lisp_Char_Table);
 #define XCHAR_TABLE(x) XRECORD (x, char_table, Lisp_Char_Table)
-#define XSETCHAR_TABLE(x, p) XSETRECORD (x, p, char_table)
 #define wrap_char_table(p) wrap_record (p, char_table)
 #define CHAR_TABLEP(x) RECORDP (x, char_table)
 #define CHECK_CHAR_TABLE(x) CHECK_RECORD (x, char_table)
--- a/src/cmds.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/cmds.c	Fri Mar 29 04:49:13 2002 +0000
@@ -171,7 +171,7 @@
   struct buffer *b = decode_buffer (buffer, 1);
   REGISTER int orig, end;
 
-  XSETBUFFER (buffer, b);
+  buffer = wrap_buffer (b);
   if (NILP (count))
     count = make_int (0);
   else
--- a/src/console-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/console-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,5 +1,5 @@
 /* Console functions for mswindows.
-   Copyright (C) 1996, 2000, 2001 Ben Wing.
+   Copyright (C) 1996, 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -353,7 +353,7 @@
 Intbyte *
 DSYMNAME (Lisp_Object obj)
 {
-  return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL;
+  return SYMBOLP (obj) ? XSTRING_DATA (XSYMBOL (obj)->name) : NULL;
 }
 
 #endif /* DEBUG_XEMACS */
--- a/src/console-msw.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/console-msw.h	Fri Mar 29 04:49:13 2002 +0000
@@ -85,7 +85,6 @@
 
 DECLARE_LRECORD (devmode, Lisp_Devmode);
 #define XDEVMODE(x) XRECORD (x, devmode, Lisp_Devmode)
-#define XSETDEVMODE(x, p) XSETRECORD (x, p, devmode)
 #define wrap_devmode(p) wrap_record (p, devmode)
 #define DEVMODEP(x) RECORDP (x, devmode)
 #define CHECK_DEVMODE(x) CHECK_RECORD (x, devmode)
@@ -416,7 +415,6 @@
 
 DECLARE_LRECORD (mswindows_dialog_id, struct mswindows_dialog_id);
 #define XMSWINDOWS_DIALOG_ID(x) XRECORD (x, mswindows_dialog_id, struct mswindows_dialog_id)
-#define XSETMSWINDOWS_DIALOG_ID(x, p) XSETRECORD (x, p, mswindows_dialog_id)
 #define wrap_mswindows_dialog_id(p) wrap_record (p, mswindows_dialog_id)
 #define MSWINDOWS_DIALOG_IDP(x) RECORDP (x, mswindows_dialog_id)
 #define CHECK_MSWINDOWS_DIALOG_ID(x) CHECK_RECORD (x, mswindows_dialog_id)
--- a/src/console-tty.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/console-tty.c	Fri Mar 29 04:49:13 2002 +0000
@@ -148,7 +148,7 @@
     if (tty_pg == controlling_tty_pg)
       {
 	tty_con->controlling_terminal = 1;
-	XSETCONSOLE (Vcontrolling_terminal, con);
+	Vcontrolling_terminal = wrap_console (con);
 	munge_tty_process_group ();
       }
     else
@@ -208,7 +208,7 @@
 static struct console *
 decode_tty_console (Lisp_Object console)
 {
-  XSETCONSOLE (console, decode_console (console));
+  console = wrap_console (decode_console (console));
   CHECK_TTY_CONSOLE (console);
   return XCONSOLE (console);
 }
--- a/src/console-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/console-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,5 +1,5 @@
 /* Console functions for X windows.
-   Copyright (C) 1996 Ben Wing.
+   Copyright (C) 1996, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -193,7 +193,7 @@
   connection = x_device_to_console_connection (connection, errb);
 
   /* Check for a couple of standard special cases */
-  if (string_char (XSTRING (connection), 0) == ':')
+  if (XSTRING_CHAR (connection, 0) == ':')
     connection = concat2 (build_string ("localhost"), connection);
   else
     {
--- a/src/console-x.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/console-x.h	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* Define X specific console, device, and frame object for XEmacs.
    Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1996 Ben Wing.
+   Copyright (C) 1996, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -481,9 +481,6 @@
 #endif /* HAVE_XIM */
 
 extern Lisp_Object Qxintl;
-#define xintl_warn(str) warn_when_safe (Qxintl, Qwarning, str)
-#define xintl_warn1(fmt, str) warn_when_safe (Qxintl, Qwarning, fmt, str)
-#define xintl_info(str) warn_when_safe (Qxintl, Qinfo, str)
 
 extern int in_resource_setting;
 extern int in_specifier_change_function;
--- a/src/console.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/console.c	Fri Mar 29 04:49:13 2002 +0000
@@ -150,7 +150,7 @@
 
   copy_lcrecord (con, XCONSOLE (Vconsole_defaults));
 
-  XSETCONSOLE (console, con);
+  console = wrap_console (con);
   GCPRO1 (console);
 
   con->quit_char = 7; /* C-g */
@@ -473,7 +473,7 @@
     return console;
 
   con = allocate_console ();
-  XSETCONSOLE (console, con);
+  console = wrap_console (con);
 
   GCPRO1 (console);
 
@@ -605,7 +605,7 @@
   if (!CONSOLE_LIVE_P (con))
     return;
 
-  XSETCONSOLE (console, con);
+  console = wrap_console (con);
   GCPRO1 (console);
 
   if (!called_from_kill_emacs)
@@ -1273,8 +1273,8 @@
 
   staticpro_nodump (&Vconsole_defaults);
   staticpro_nodump (&Vconsole_local_symbols);
-  XSETCONSOLE (Vconsole_defaults, defs);
-  XSETCONSOLE (Vconsole_local_symbols, syms);
+  Vconsole_defaults = wrap_console (defs);
+  Vconsole_local_symbols = wrap_console (syms);
 
   nuke_all_console_slots (syms, Qnil);
   nuke_all_console_slots (defs, Qnil);
--- a/src/console.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/console.h	Fri Mar 29 04:49:13 2002 +0000
@@ -468,7 +468,6 @@
 
 DECLARE_LRECORD (console, struct console);
 #define XCONSOLE(x) XRECORD (x, console, struct console)
-#define XSETCONSOLE(x, p) XSETRECORD (x, p, console)
 #define wrap_console(p) wrap_record (p, console)
 #define CONSOLEP(x) RECORDP (x, console)
 #define CHECK_CONSOLE(x) CHECK_RECORD (x, console)
--- a/src/data.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/data.c	Fri Mar 29 04:49:13 2002 +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, 2001 Ben Wing.
+   Copyright (C) 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -722,7 +722,7 @@
   else if (STRINGP (array))
     {
       if (idx >= XSTRING_CHAR_LENGTH (array)) goto range_error;
-      return make_char (string_char (XSTRING (array), idx));
+      return make_char (XSTRING_CHAR (array, idx));
     }
 #ifdef LOSING_BYTECODE
   else if (COMPILED_FUNCTIONP (array))
@@ -780,7 +780,7 @@
     {
       CHECK_CHAR_COERCE_INT (newval);
       if (idx >= XSTRING_CHAR_LENGTH (array)) goto range_error;
-      set_string_char (XSTRING (array), idx, XCHAR (newval));
+      set_string_char (array, idx, XCHAR (newval));
       bump_string_modiff (array);
     }
   else
@@ -1625,7 +1625,7 @@
 
   wl->list = Qnil;
   wl->type = type;
-  XSETWEAK_LIST (result, wl);
+  result = wrap_weak_list (wl);
   wl->next_weak = Vall_weak_lists;
   Vall_weak_lists = result;
   return result;
--- a/src/database.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/database.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Database access routines
    Copyright (C) 1996, William M. Perry
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -106,7 +106,6 @@
 };
 
 #define XDATABASE(x) XRECORD (x, database, Lisp_Database)
-#define XSETDATABASE(x, p) XSETRECORD (x, p, database)
 #define wrap_database(p) wrap_record (p, database)
 #define DATABASEP(x) RECORDP (x, database)
 #define CHECK_DATABASE(x) CHECK_RECORD (x, database)
@@ -150,22 +149,20 @@
 static void
 print_database (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
-  char buf[64];
   Lisp_Database *db = XDATABASE (obj);
 
   if (print_readably)
     printing_unreadable_object ("#<database 0x%x>", db->header.uid);
 
-  write_c_string ("#<database \"", printcharfun);
-  print_internal (db->fname, printcharfun, 0);
-  sprintf (buf, "\" (%s/%s/%s) 0x%x>",
-	   (char *) string_data (XSYMBOL (db->funcs->get_type (db))->name),
-	   (char *) string_data (XSYMBOL (db->funcs->get_subtype (db))->name),
-	   (!DATABASE_LIVE_P (db)    ? "closed"    :
-	    (db->access_ & O_WRONLY) ? "writeonly" :
-	    (db->access_ & O_RDWR)   ? "readwrite" : "readonly"),
-	   db->header.uid);
-  write_c_string (buf, printcharfun);
+  write_fmt_string_lisp (printcharfun, "#<database \"%s\" (%s/%s/",
+			 3, db->fname, db->funcs->get_type (db),
+			 db->funcs->get_subtype (db));
+
+  write_fmt_string (printcharfun, "%s) 0x%x>",
+		    (!DATABASE_LIVE_P (db)    ? "closed"    :
+		     (db->access_ & O_WRONLY) ? "writeonly" :
+		     (db->access_ & O_RDWR)   ? "readwrite" : "readonly"),
+		    db->header.uid);
 }
 
 static void
@@ -175,11 +172,9 @@
 
   if (for_disksave)
     {
-      Lisp_Object object;
-      XSETDATABASE (object, db);
-
       invalid_operation
-	("Can't dump an emacs containing database objects", object);
+	("Can't dump an emacs containing database objects",
+	 wrap_database (db));
     }
   db->funcs->close (db);
 }
@@ -733,11 +728,7 @@
   db->mode = modemask;
   db->access_ = accessmask;
 
-  {
-    Lisp_Object retval;
-    XSETDATABASE (retval, db);
-    return retval;
-  }
+  return wrap_database (db);
 }
 
 DEFUN ("put-database", Fput_database, 3, 4, 0, /*
--- a/src/device-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/device-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -75,7 +75,7 @@
 struct device *
 decode_gtk_device (Lisp_Object device)
 {
-  XSETDEVICE (device, decode_device (device));
+  device = wrap_device (decode_device (device));
   CHECK_GTK_DEVICE (device);
   return XDEVICE (device);
 }
@@ -183,7 +183,7 @@
   GdkVisual *visual = NULL;
   GdkColormap *cmap = NULL;
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
 
   /* gtk_init() and even gtk_check_init() are so brain dead that
      getting an empty argv array causes them to abort. */
@@ -339,7 +339,7 @@
   int checking_free;
 #endif
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   if (1)
     {
 #ifdef FREE_CHECKING
--- a/src/device-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/device-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -673,8 +673,8 @@
 {
   if (!NILP (DEVICE_FRAME_LIST (d)))
   {
-    Lisp_Object device;
-    XSETDEVICE (device, d);
+    Lisp_Object device = wrap_device (d);
+
     invalid_operation ("Cannot change settings while print job is active",
 		       device);
   }
@@ -911,7 +911,7 @@
 	(device))
 {
   struct device *d = decode_device (device);
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   CHECK_MSPRINTER_DEVICE (device);
   return DEVICE_MSPRINTER_DEVMODE (d);
 }
@@ -941,7 +941,7 @@
   struct gcpro gcpro1;
   GCPRO1 (settings);
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   CHECK_MSPRINTER_DEVICE (device);
   CHECK_DEVMODE (settings);
   ldm = XDEVMODE (settings);
@@ -1013,7 +1013,7 @@
   struct gcpro gcpro1;
   GCPRO1 (settings);
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   CHECK_MSPRINTER_DEVICE (device);
   CHECK_DEVMODE (settings);
   ldm_new = XDEVMODE (settings);
@@ -1091,8 +1091,8 @@
 
   if (for_disksave)
     {
-      Lisp_Object devmode;
-      XSETDEVMODE (devmode, dm);
+      Lisp_Object devmode = wrap_devmode (dm);
+
       invalid_operation
 	("Cannot dump XEmacs containing an msprinter-settings object",
 	 devmode);
@@ -1138,12 +1138,11 @@
 		  Lisp_Object src_name, struct device *d)
 {
   Lisp_Devmode *dm;
-  Lisp_Object ob;
 
   dm = alloc_lcrecord_type (Lisp_Devmode, &lrecord_devmode);
 
   if (d)
-    XSETDEVICE (dm->device, d);
+    dm->device = wrap_device (d);
   else
     dm->device = Qnil;
 
@@ -1159,8 +1158,7 @@
       dm->devmode = src_devmode;
     }
 
-  XSETDEVMODE (ob, dm);
-  return ob;
+  return wrap_devmode (dm);
 }
 
 DEFUN ("msprinter-settings-copy", Fmsprinter_settings_copy, 1, 1, 0, /*
--- a/src/device-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/device-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* Device functions for X windows.
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1994, 1995 Free Software Foundation, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -154,7 +154,7 @@
 struct device *
 decode_x_device (Lisp_Object device)
 {
-  XSETDEVICE (device, decode_device (device));
+  device = wrap_device (decode_device (device));
   CHECK_X_DEVICE (device);
   return XDEVICE (device);
 }
@@ -540,7 +540,7 @@
 	/* If we found it, warn the user in big, nasty, unfriendly letters */
 	if (xaw_function_handle != NULL)
 	  {
-	    warn_when_safe (Qdevice, Qerror, "\n"
+	    warn_when_safe (Qdevice, Qcritical, "\n"
 "It seems that XEmacs is built dynamically linked to the flat Athena widget\n"
 "library but it finds a 3D Athena variant with the same name at runtime.\n"
 "\n"
@@ -568,7 +568,7 @@
 #endif /* HAVE_SHLIB and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */
 
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   display = DEVICE_CONNECTION (d);
 
   allocate_x_device_struct (d);
@@ -879,7 +879,7 @@
   int checking_free;
 #endif
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   display = DEVICE_X_DISPLAY (d);
 
   if (display)
@@ -1070,7 +1070,7 @@
 
 	if (f->being_deleted)
 	  return 0;
-	XSETFRAME (frame, f);
+	frame = wrap_frame (f);
 	if (!NILP (condition_case_1 (Qerror, x_error_handler_do_enqueue,
 				     frame, x_error_handler_error, Qnil)))
 	  {
@@ -1150,7 +1150,7 @@
     d = device_being_initialized;
 
   assert (d != NULL);
-  XSETDEVICE (dev, d);
+  dev = wrap_device (d);
 
   if (NILP (find_nonminibuffer_frame_not_on_device (dev)))
     {
--- a/src/device.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/device.c	Fri Mar 29 04:49:13 2002 +0000
@@ -160,7 +160,7 @@
   struct device *d = alloc_lcrecord_type (struct device, &lrecord_device);
   struct gcpro gcpro1;
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   GCPRO1 (device);
 
   nuke_all_device_slots (d, Qnil);
@@ -277,7 +277,7 @@
 */
        (device, frame))
 {
-  XSETDEVICE (device, decode_device (device));
+  device = wrap_device (decode_device (device));
   CHECK_LIVE_FRAME (frame);
 
   if (! EQ (device, FRAME_DEVICE (XFRAME (frame))))
@@ -558,7 +558,7 @@
 
   con = XCONSOLE (console);
   d = allocate_device (console);
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
 
   d->devmeths = con->conmeths;
 
@@ -691,7 +691,7 @@
   if (!DEVICE_LIVE_P (d))
     return;
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   GCPRO1 (device);
 
   c = XCONSOLE (DEVICE_CONSOLE (d));
@@ -870,7 +870,7 @@
        (device, class))
 {
   struct device *d = decode_device (device);
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   if (!DEVICE_TTY_P (d))
     gui_error ("Cannot change the class of this device", device);
   if (!EQ (class, Qcolor) && !EQ (class, Qmono) && !EQ (class, Qgrayscale))
--- a/src/device.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/device.h	Fri Mar 29 04:49:13 2002 +0000
@@ -138,7 +138,6 @@
 
 DECLARE_LRECORD (device, struct device);
 #define XDEVICE(x) XRECORD (x, device, struct device)
-#define XSETDEVICE(x, p) XSETRECORD (x, p, device)
 #define wrap_device(p) wrap_record (p, device)
 #define DEVICEP(x) RECORDP (x, device)
 #define CHECK_DEVICE(x) CHECK_RECORD (x, device)
--- a/src/dialog-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/dialog-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -749,7 +749,7 @@
       alloc_lcrecord_type (struct mswindows_dialog_id,
 			   &lrecord_mswindows_dialog_id);
     
-    XSETMSWINDOWS_DIALOG_ID (dialog_data, did);
+    dialog_data = wrap_mswindows_dialog_id (did);
     
     did->frame = wrap_frame (f);
     did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound);
--- a/src/doc.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/doc.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* Record indices of function doc strings stored in a file.
    Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995
    Free Software Foundation, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -398,7 +398,7 @@
 {
   if (!strcmp (weirdness, GETTEXT ("duplicate"))) return;
   message ("Note: Strange doc (%s) for %s %s @ %d",
-           weirdness, type, string_data (XSYMBOL (sym)->name), pos);
+           weirdness, type, XSTRING_DATA (XSYMBOL (sym)->name), pos);
 }
 
 
@@ -657,10 +657,10 @@
 kludgily_ignore_lost_doc_p (Lisp_Object sym)
 {
 # define kludge_prefix "ad-Orig-"
-  Lisp_String *name = XSYMBOL (sym)->name;
-  return (string_length (name) > (Bytecount) (sizeof (kludge_prefix)) &&
-	  !strncmp ((char *) string_data (name), kludge_prefix,
-		    sizeof (kludge_prefix) - 1));
+  Lisp_Object name = XSYMBOL (sym)->name;
+  return (XSTRING_LENGTH (name) > (Bytecount) (sizeof (kludge_prefix)) &&
+	  !qxestrncmp_c (XSTRING_DATA (name), kludge_prefix,
+			 sizeof (kludge_prefix) - 1));
 # undef kludge_prefix
 }
 #else
@@ -671,7 +671,7 @@
 static int
 verify_doc_mapper (Lisp_Object sym, void *arg)
 {
-  Lisp_Object closure = *(Lisp_Object *)arg;
+  Lisp_Object closure = * (Lisp_Object *) arg;
 
   if (!NILP (Ffboundp (sym)))
     {
@@ -715,7 +715,7 @@
       if (doc == 0 && !kludgily_ignore_lost_doc_p (sym))
 	{
 	  message ("Warning: doc lost for function %s.",
-		   string_data (XSYMBOL (sym)->name));
+		   XSTRING_DATA (XSYMBOL (sym)->name));
 	  XCDR (closure) = Qt;
 	}
     }
@@ -725,7 +725,7 @@
       if (ZEROP (doc))
 	{
 	  message ("Warning: doc lost for variable %s.",
-		   string_data (XSYMBOL (sym)->name));
+		   XSTRING_DATA (XSYMBOL (sym)->name));
 	  XCDR (closure) = Qt;
 	}
     }
--- a/src/doprnt.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/doprnt.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2,7 +2,7 @@
    Also takes args differently: pass one pointer to an array of strings
    in addition to the format string which is separate.
    Copyright (C) 1995 Free Software Foundation, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
    Rewritten by mly to use varargs.h.
    Rewritten from scratch by Ben Wing (February 1995) for Mule; expanded
    to full printf spec.
@@ -24,7 +24,7 @@
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-/* Synched up with: Rewritten.  Not in FSF. */
+/* Synched up with: Rewritten by Ben Wing.  Not in FSF. */
 
 #include <config.h>
 #include "lisp.h"
@@ -140,14 +140,15 @@
   return start;
 }
 
-#define NEXT_ASCII_BYTE(ch)					\
-  do {								\
-    if (fmt == fmt_end)						\
-      syntax_error ("Premature end of format string", Qunbound);			\
-    ch = *fmt;							\
-    if (ch >= 0200)						\
-      syntax_error ("Non-ASCII character in format converter spec", Qunbound);	\
-    fmt++;							\
+#define NEXT_ASCII_BYTE(ch)						\
+  do {									\
+    if (fmt == fmt_end)							\
+      syntax_error ("Premature end of format string", Qunbound);	\
+    ch = *fmt;								\
+    if (ch >= 0200)							\
+      syntax_error ("Non-ASCII character in format converter spec",	\
+		    Qunbound);						\
+    fmt++;								\
   } while (0)
 
 #define RESOLVE_FLAG_CONFLICTS(spec)				\
@@ -528,25 +529,25 @@
 	  else
 	    {
 	      Lisp_Object obj = largs[spec->argnum - 1];
-	      Lisp_String *ls;
+	      Lisp_Object ls;
 
 	      if (ch == 'S')
 		{
 		  /* For `S', prin1 the argument and then treat like
 		     a string.  */
-		  ls = XSTRING (Fprin1_to_string (obj, Qnil));
+		  ls = Fprin1_to_string (obj, Qnil);
 		}
 	      else if (STRINGP (obj))
-		ls = XSTRING (obj);
+		ls = obj;
 	      else if (SYMBOLP (obj))
 		ls = XSYMBOL (obj)->name;
 	      else
 		{
 		  /* convert to string using princ. */
-		  ls = XSTRING (Fprin1_to_string (obj, Qt));
+		  ls = Fprin1_to_string (obj, Qt);
 		}
-	      string = string_data (ls);
-	      string_len = string_length (ls);
+	      string = XSTRING_DATA (ls);
+	      string_len = XSTRING_LENGTH (ls);
 	    }
 
 	  doprnt_2 (stream, string, string_len, spec->minwidth,
@@ -569,8 +570,9 @@
 		obj = make_int (XCHAR (obj));
 	      if (!INT_OR_FLOATP (obj))
 		{
-		  syntax_error ("format specifier %%%c doesn't match argument type",
-			 make_char (ch));
+		  syntax_error
+		    ("format specifier %%%c doesn't match argument type",
+		     make_char (ch));
 		}
 	      else if (strchr (double_converters, ch))
 		arg.d = XFLOATINT (obj);
@@ -596,7 +598,8 @@
 	      a = (Emchar) arg.l;
 
 	      if (!valid_char_p (a))
-	 syntax_error ("invalid character value %d to %%c spec", make_char (a));
+		syntax_error ("invalid character value %d to %%c spec",
+			      make_char (a));
 
 	      charlen = set_charptr_emchar (charbuf, a);
 	      doprnt_2 (stream, charbuf, charlen, spec->minwidth,
--- a/src/dumper.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/dumper.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1057,7 +1057,7 @@
 
 	    if (POINTER_TYPE_P (XTYPE (*pobj))
 		&& ! EQ (*pobj, Qnull_pointer))
-	      XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta);
+	      *pobj = wrap_pointer_1 ((char *) XPNTR (*pobj) + delta);
 
 	    break;
 	  }
@@ -1074,7 +1074,7 @@
 
 		if (POINTER_TYPE_P (XTYPE (*pobj))
 		    && ! EQ (*pobj, Qnull_pointer))
-		  XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta);
+		  *pobj = wrap_pointer_1 ((char *) XPNTR (*pobj) + delta);
 	      }
 	    break;
 	  }
--- a/src/dynarr.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/dynarr.c	Fri Mar 29 04:49:13 2002 +0000
@@ -177,8 +177,8 @@
 void
 Dynarr_insert_many (void *d, const void *el, int len, int start)
 {
-  Dynarr *dy = (Dynarr *) d;
-
+  Dynarr *dy = (Dynarr *) Dynarr_verify (d);
+  
   Dynarr_resize (dy, dy->cur+len);
   /* Silently adjust start to be valid. */
   if (start > dy->cur)
--- a/src/editfns.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/editfns.c	Fri Mar 29 04:49:13 2002 +0000
@@ -130,12 +130,10 @@
 */
        (string))
 {
-  Lisp_String *p;
   CHECK_STRING (string);
 
-  p = XSTRING (string);
-  if (string_length (p) != 0)
-    return make_char (string_char (p, 0));
+  if (XSTRING_LENGTH (string) != 0)
+    return make_char (XSTRING_CHAR (string, 0));
   else
     /* This used to return Qzero.  That is broken, broken, broken. */
     /* It might be kinder to signal an error directly. -slb */
@@ -705,7 +703,7 @@
    for the user running XEmacs will be returned.  This
    corresponds to a nil argument to Fuser_login_name.
 
-   WARNING: The string returned comes from the data of a Lisp_String and
+   WARNING: The string returned comes from the data of a Lisp string and
    therefore will become garbage after the next GC.
 */
 Intbyte *
@@ -761,8 +759,7 @@
   struct passwd *pw = qxe_getpwuid (getuid ());
   /* #### - I believe this should return nil instead of "unknown" when pw==0 */
 
-  Lisp_Object tem = build_string (pw ? pw->pw_name : "unknown");
-  return tem;
+  return build_string (pw ? pw->pw_name : "unknown");
 }
 
 DEFUN ("user-uid", Fuser_uid, 0, 0, 0, /*
@@ -1858,16 +1855,15 @@
   mc_count = begin_multiple_change (buf, pos, stop);
   if (STRINGP (table))
     {
-      Lisp_String *stable = XSTRING (table);
-      Charcount size = string_char_length (stable);
+      Charcount size = XSTRING_CHAR_LENGTH (table);
 #ifdef MULE
-      /* Under Mule, string_char(n) is O(n), so for large tables or
+      /* Under Mule, XSTRING_CHAR(n) is O(n), so for large tables or
          large regions it makes sense to create an array of Emchars.  */
       if (size * (stop - pos) > 65536)
 	{
 	  Emchar *etable = alloca_array (Emchar, size);
 	  convert_intbyte_string_into_emchar_string
-	    (string_data (stable), string_length (stable), etable);
+	    (XSTRING_DATA (table), XSTRING_LENGTH (table), etable);
 	  for (; pos < stop && (oc = BUF_FETCH_CHAR (buf, pos), 1); pos++)
 	    {
 	      if (oc < size)
@@ -1888,7 +1884,7 @@
 	    {
 	      if (oc < size)
 		{
-		  Emchar nc = string_char (stable, oc);
+		  Emchar nc = XSTRING_CHAR (table, oc);
 		  if (nc != oc)
 		    {
 		      buffer_replace_char (buf, pos, nc, 0, 0);
--- a/src/eldap.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/eldap.c	Fri Mar 29 04:49:13 2002 +0000
@@ -94,9 +94,7 @@
 static Lisp_Object
 make_ldap (Lisp_LDAP *ldap)
 {
-  Lisp_Object lisp_ldap;
-  XSETLDAP (lisp_ldap, ldap);
-  return lisp_ldap;
+  return wrap_ldap (ldap);
 }
 
 static Lisp_Object
--- a/src/eldap.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/eldap.h	Fri Mar 29 04:49:13 2002 +0000
@@ -43,7 +43,6 @@
 
 DECLARE_LRECORD (ldap, Lisp_LDAP);
 #define XLDAP(x) XRECORD (x, ldap, Lisp_LDAP)
-#define XSETLDAP(x, p) XSETRECORD (x, p, ldap)
 #define wrap_ldap(p) wrap_record (p, ldap)
 #define LDAPP(x) RECORDP (x, ldap)
 #define CHECK_LDAP(x) CHECK_RECORD (x, ldap)
--- a/src/elhash.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/elhash.c	Fri Mar 29 04:49:13 2002 +0000
@@ -540,7 +540,7 @@
   /* We leave room for one never-occupied sentinel hentry at the end.  */
   ht->hentries = xnew_array_and_zero (hentry, ht->size + 1);
 
-  XSETHASH_TABLE (hash_table, ht);
+  hash_table = wrap_hash_table (ht);
 
   if (weakness == HASH_TABLE_NON_WEAK)
     ht->next_weak = Qunbound;
@@ -944,7 +944,7 @@
   ht->hentries = xnew_array (hentry, ht_old->size + 1);
   memcpy (ht->hentries, ht_old->hentries, (ht_old->size + 1) * sizeof (hentry));
 
-  XSETHASH_TABLE (hash_table, ht);
+  hash_table = wrap_hash_table (ht);
 
   if (! EQ (ht->next_weak, Qunbound))
     {
--- a/src/elhash.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/elhash.h	Fri Mar 29 04:49:13 2002 +0000
@@ -28,7 +28,6 @@
 DECLARE_LRECORD (hash_table, Lisp_Hash_Table);
 
 #define XHASH_TABLE(x) XRECORD (x, hash_table, Lisp_Hash_Table)
-#define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table)
 #define wrap_hash_table(p) wrap_record (p, hash_table)
 #define HASH_TABLEP(x) RECORDP (x, hash_table)
 #define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table)
--- a/src/emacs.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/emacs.c	Fri Mar 29 04:49:13 2002 +0000
@@ -3367,6 +3367,8 @@
 static DWORD
 mswindows_handle_hardware_exceptions_1 (void)
 {
+  inhibit_non_essential_printing_operations = 1;
+  preparing_for_armageddon = 1;
   pause_so_user_can_read_messages (0);
   return EXCEPTION_EXECUTE_HANDLER;
 }
--- a/src/eval.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/eval.c	Fri Mar 29 04:49:13 2002 +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, 2001 Ben Wing.
+   Copyright (C) 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -141,6 +141,15 @@
    See call_with_suspended_errors(). */
 Lisp_Object Vcurrent_warning_class;
 
+/* Current warning level when warnings occur, or nil for no warnings.
+   Only meaningful when Vcurrent_error_state is non-nil.
+   See call_with_suspended_errors(). */
+Lisp_Object Vcurrent_warning_level;
+
+/* Minimum level at which warnings are logged.  Below this, they're ignored
+   entirely -- not even generated. */
+Lisp_Object Vlog_warning_minimum_level;
+
 /* Special catch tag used in call_with_suspended_errors(). */
 Lisp_Object Qunbound_suspended_errors_tag;
 
@@ -1170,7 +1179,7 @@
     ((INTP (documentation) && XINT (documentation) < 0) ||
 
      (STRINGP (documentation) &&
-      (string_byte (XSTRING (documentation), 0) == '*')) ||
+      (XSTRING_BYTE (documentation, 0) == '*')) ||
 
      /* If (STRING . INTEGER), a negative integer means a user variable. */
      (CONSP (documentation)
@@ -1422,7 +1431,7 @@
 #ifdef DEFEND_AGAINST_THROW_RECURSION
   /* die if we recurse more than is reasonable */
   if (++throw_level > 20)
-    abort();
+    abort ();
 #endif
 
   /* If bomb_out_p is t, this is being called from Fsignal as a
@@ -2103,8 +2112,8 @@
   GCPRO1 (data);
   if (!NILP (Vcurrent_error_state))
     {
-      if (!NILP (Vcurrent_warning_class))
-	warn_when_safe_lispobj (Vcurrent_warning_class, Qwarning,
+      if (!NILP (Vcurrent_warning_class) && !NILP (Vcurrent_warning_level))
+	warn_when_safe_lispobj (Vcurrent_warning_class, Vcurrent_warning_level,
 				Fcons (error_symbol, data));
       Fthrow (Qunbound_suspended_errors_tag, Qnil);
       abort (); /* Better not get here! */
@@ -2148,6 +2157,13 @@
 }
 
 static Lisp_Object
+restore_current_warning_level (Lisp_Object warning_level)
+{
+  Vcurrent_warning_level = warning_level;
+  return Qnil;
+}
+
+static Lisp_Object
 restore_current_error_state (Lisp_Object error_state)
 {
   Vcurrent_error_state = error_state;
@@ -2159,17 +2175,16 @@
 {
   Lisp_Object val;
   Lisp_Object *kludgy_args = (Lisp_Object *) get_opaque_ptr (opaque_arg);
-  Lisp_Object no_error = kludgy_args[2];
   int speccount = specpdl_depth ();
 
-  if (!EQ (Vcurrent_error_state, no_error))
+  if (NILP (Vcurrent_error_state))
     {
       record_unwind_protect (restore_current_error_state,
 			     Vcurrent_error_state);
-      Vcurrent_error_state = no_error;
+      Vcurrent_error_state = Qt;
     }
   PRIMITIVE_FUNCALL (val, get_opaque_ptr (kludgy_args[0]),
-		     kludgy_args + 3, XINT (kludgy_args[1]));
+		     kludgy_args + 2, XINT (kludgy_args[1]));
   return unbind_to_1 (speccount, val);
 }
 
@@ -2195,38 +2210,31 @@
 {
   va_list vargs;
   int speccount;
-  Lisp_Object kludgy_args[23];
-  Lisp_Object *args = kludgy_args + 3;
+  Lisp_Object kludgy_args[22];
+  Lisp_Object *args = kludgy_args + 2;
   int i;
-  Lisp_Object no_error;
 
   assert (SYMBOLP (class)); /* sanity-check */
   assert (!NILP (class));
   assert (nargs >= 0 && nargs < 20);
 
-  /* ERROR_ME means don't trap errors. (However, if errors are
-     already trapped, we leave them trapped.)
-
-     Otherwise, we trap errors, and trap warnings if ERROR_ME_WARN.
-
-     If ERROR_ME_NOT, it causes no warnings even if warnings
-     were previously enabled.  However, we never change the
-     warning class from one to another. */
-  if (!ERRB_EQ (errb, ERROR_ME))
-    {
-      if (ERRB_EQ (errb, ERROR_ME_NOT)) /* person wants no warnings */
-	class = Qnil;
-      errb = ERROR_ME_NOT;
-      no_error = Qt;
-    }
-  else
-    no_error = Qnil;
-
   va_start (vargs, nargs);
   for (i = 0; i < nargs; i++)
     args[i] = va_arg (vargs, Lisp_Object);
   va_end (vargs);
 
+  /* ERROR_ME means don't trap errors. (However, if errors are
+     already trapped, we leave them trapped.)
+
+     Otherwise, we trap errors, and display as warnings if ERROR_ME_WARN.
+
+     If ERROR_ME_NOT, we silently fail.
+     
+     If ERROR_ME_DEBUG_WARN, we display a warning, but at warning level to
+     `debug'.  Normally these disappear, but can be seen if we changed
+     log-warning-minimum-level.
+     */
+
   /* If error-checking is not disabled, just call the function.
      It's important not to override disabled error-checking with
      enabled error-checking. */
@@ -2239,17 +2247,23 @@
     }
 
   speccount = specpdl_depth ();
-  if (NILP (class) || NILP (Vcurrent_warning_class))
+  if (NILP (Vcurrent_warning_class))
     {
-      /* If we're currently calling for no warnings, then make it so.
-	 If we're currently calling for warnings and we weren't
-	 previously, then set our warning class; otherwise, leave
-	 the existing one alone. */
+      /* Don't change the existing class.
+	 #### Should we be consing the two together? */
       record_unwind_protect (restore_current_warning_class,
 			     Vcurrent_warning_class);
       Vcurrent_warning_class = class;
     }
 
+  record_unwind_protect (restore_current_warning_level,
+			 Vcurrent_warning_level);
+  Vcurrent_warning_level =
+    (ERRB_EQ (errb, ERROR_ME_NOT) ? Qnil :
+     ERRB_EQ (errb, ERROR_ME_DEBUG_WARN) ? Qdebug :
+     Qwarning);
+  
+
   {
     int threw;
     Lisp_Object the_retval;
@@ -2260,7 +2274,6 @@
     GCPRO2 (opaque1, opaque2);
     kludgy_args[0] = opaque2;
     kludgy_args[1] = make_int (nargs);
-    kludgy_args[2] = no_error;
     the_retval = internal_catch (Qunbound_suspended_errors_tag,
 				 call_with_suspended_errors_1,
 				 opaque1, &threw);
@@ -2286,6 +2299,8 @@
 {
   if (ERRB_EQ (errb, ERROR_ME_NOT))
     return;
+  else if (ERRB_EQ (errb, ERROR_ME_DEBUG_WARN))
+    warn_when_safe_lispobj (class, Qdebug, Fcons (sig, data));
   else if (ERRB_EQ (errb, ERROR_ME_WARN))
     warn_when_safe_lispobj (class, Qwarning, Fcons (sig, data));
   else
@@ -2302,6 +2317,11 @@
 {
   if (ERRB_EQ (errb, ERROR_ME_NOT))
     return Qnil;
+  else if (ERRB_EQ (errb, ERROR_ME_DEBUG_WARN))
+    {
+      warn_when_safe_lispobj (class, Qdebug, Fcons (sig, data));
+      return Qnil;
+    }
   else if (ERRB_EQ (errb, ERROR_ME_WARN))
     {
       warn_when_safe_lispobj (class, Qwarning, Fcons (sig, data));
@@ -4502,7 +4522,7 @@
   Lisp_Object opaque;
   struct gcpro gcpro1, gcpro2;
 
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
 
   specbind (Qinhibit_quit, Qt);
   /* begin_gc_forbidden(); Currently no reason to do this; */
@@ -5267,6 +5287,12 @@
 warn_when_safe_lispobj (Lisp_Object class, Lisp_Object level,
 			Lisp_Object obj)
 {
+  /* Don't even generate debug warnings if they're going to be discarded,
+     to avoid excessive consing. */
+  if (EQ (level, Qdebug) && !NILP (Vlog_warning_minimum_level) &&
+      !EQ (Vlog_warning_minimum_level, Qdebug))
+    return;
+  
   obj = list1 (list3 (class, level, obj));
   if (NILP (Vpending_warnings))
     Vpending_warnings = Vpending_warnings_tail = obj;
@@ -5290,6 +5316,12 @@
   Lisp_Object obj;
   va_list args;
 
+  /* Don't even generate debug warnings if they're going to be discarded,
+     to avoid excessive consing. */
+  if (EQ (level, Qdebug) && !NILP (Vlog_warning_minimum_level) &&
+      !EQ (Vlog_warning_minimum_level, Qdebug))
+    return;
+  
   va_start (args, fmt);
   obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
   va_end (args);
@@ -5529,6 +5561,9 @@
   dump_add_root_object (&Vpending_warnings_tail);
   Vpending_warnings_tail = Qnil;
 
+  DEFVAR_LISP ("log-warning-minimum-level", &Vlog_warning_minimum_level);
+  Vlog_warning_minimum_level = Qinfo;
+
   staticpro (&Vautoload_queue);
   Vautoload_queue = Qnil;
 
@@ -5537,6 +5572,9 @@
   staticpro (&Vcurrent_warning_class);
   Vcurrent_warning_class = Qnil;
 
+  staticpro (&Vcurrent_warning_level);
+  Vcurrent_warning_level = Qnil;
+
   staticpro (&Vcurrent_error_state);
   Vcurrent_error_state = Qnil; /* errors as normal */
 }
--- a/src/event-Xt.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/event-Xt.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1261,7 +1261,7 @@
 
 	    if (! frame)
 	      return 0;	/* not for us */
-	    XSETFRAME (emacs_event->channel, frame);
+	    emacs_event->channel = wrap_frame (frame);
 
 	    emacs_event->event_type = (x_event->type == ButtonPress) ?
 	      button_press_event : button_release_event;
@@ -1308,7 +1308,7 @@
 
         DEVICE_X_MOUSE_TIMESTAMP (d) = ev->time;
 
-        XSETFRAME (emacs_event->channel, frame);
+        emacs_event->channel = wrap_frame (frame);
         emacs_event->event_type	    = pointer_motion_event;
         emacs_event->timestamp      = ev->time;
         emacs_event->event.motion.x = ev->x;
@@ -1353,7 +1353,7 @@
 	      return 0;	/* not for us */
 
 	    GCPRO4 (l_type, l_data, l_dndlist, l_item);
-	    XSETFRAME (emacs_event->channel, frame);
+	    emacs_event->channel = wrap_frame (frame);
 
 	    emacs_event->event_type = misc_user_event;
 	    emacs_event->timestamp  = DEVICE_X_LAST_SERVER_TIMESTAMP (d);
@@ -1517,7 +1517,7 @@
           return 0;
 
         emacs_event->event_type = magic_event;
-        XSETFRAME (emacs_event->channel, frame);
+        emacs_event->channel = wrap_frame (frame);
 
         break;
       }
@@ -1583,7 +1583,7 @@
     Lisp_Object conser;
     struct gcpro gcpro1;
 
-    XSETFRAME (frm, f);
+    frm = wrap_frame (f);
     conser = Fcons (frm, Fcons (FRAME_DEVICE (f), in_p ? Qt : Qnil));
     GCPRO1 (conser);
     emacs_handle_focus_change_preliminary (conser);
@@ -1639,9 +1639,8 @@
 static void
 change_frame_visibility (struct frame *f, int is_visible)
 {
-  Lisp_Object frame;
-
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
+
 
   if (!FRAME_VISIBLE_P (f) && is_visible)
     {
@@ -1676,9 +1675,6 @@
 static void
 handle_map_event (struct frame *f, XEvent *event)
 {
-  Lisp_Object frame;
-
-  XSETFRAME (frame, f);
 
   /* It seems that, given the multiplicity of window managers and X
      implementations, plus the fact that X was designed without
@@ -1753,7 +1749,7 @@
 	 rather than consulting some internal (and likely
 	 inaccurate) state flag.  Therefore, ignoring the MapNotify
 	 is correct. */
-      if (!FRAME_VISIBLE_P (f) && NILP (Fframe_iconified_p (frame)))
+      if (!FRAME_VISIBLE_P (f) && NILP (Fframe_iconified_p (wrap_frame (f))))
 #endif /* 0 */
 	change_frame_visibility (f, 1);
     }
@@ -1768,9 +1764,7 @@
 handle_client_message (struct frame *f, XEvent *event)
 {
   struct device *d = XDEVICE (FRAME_DEVICE (f));
-  Lisp_Object frame;
-
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
 
   if (event->xclient.message_type == DEVICE_XATOM_WM_PROTOCOLS (d) &&
       (Atom) (event->xclient.data.l[0]) == DEVICE_XATOM_WM_DELETE_WINDOW (d))
@@ -1950,9 +1944,8 @@
     case EnterNotify:
       if (event->xcrossing.detail != NotifyInferior)
 	{
-	  Lisp_Object frame;
-
-	  XSETFRAME (frame, f);
+	  Lisp_Object frame = wrap_frame (f);
+
 	  /* FRAME_X_MOUSE_P (f) = 1; */
 	  va_run_hook_with_args (Qmouse_enter_frame_hook, 1, frame);
 	}
@@ -1961,9 +1954,8 @@
     case LeaveNotify:
       if (event->xcrossing.detail != NotifyInferior)
 	{
-	  Lisp_Object frame;
-
-	  XSETFRAME (frame, f);
+	  Lisp_Object frame = wrap_frame (f);
+
 	  /* FRAME_X_MOUSE_P (f) = 0; */
 	  va_run_hook_with_args (Qmouse_leave_frame_hook, 1, frame);
 	}
@@ -2320,7 +2312,7 @@
   Lisp_Object process;
   int infd = event_stream_unixoid_select_process (p);
 
-  XSETPROCESS (process, p);
+  process = wrap_process (p);
   select_filedesc (infd, process);
 }
 
@@ -2407,7 +2399,7 @@
     return; /* X consoles are automatically selected for when we
 	       initialize them in Xt */
   infd = event_stream_unixoid_select_console (con);
-  XSETCONSOLE (console, con);
+  console = wrap_console (con);
   select_filedesc (infd, console);
 }
 
@@ -2421,7 +2413,7 @@
     return; /* X consoles are automatically selected for when we
 	       initialize them in Xt */
   infd = event_stream_unixoid_unselect_console (con);
-  XSETCONSOLE (console, con);
+  console = wrap_console (con);
   unselect_filedesc (infd);
 }
 
@@ -2774,7 +2766,7 @@
   if (!NILP (dispatch_event_queue))
     {
       Lisp_Object event, event2;
-      XSETEVENT (event2, emacs_event);
+      event2 = wrap_event (emacs_event);
       event = dequeue_Xt_dispatch_event ();
       Fcopy_event (event, event2);
       Fdeallocate_event (event);
--- a/src/event-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/event-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -126,7 +126,7 @@
 	Lisp_Object conser;
 	struct gcpro gcpro1;
 
-	XSETFRAME (frm, f);
+	frm = wrap_frame (f);
 	conser = Fcons (frm, Fcons (FRAME_DEVICE (f), in_p ? Qt : Qnil));
 	GCPRO1 (conser);
 
@@ -142,9 +142,8 @@
 static void
 change_frame_visibility (struct frame *f, int is_visible)
 {
-  Lisp_Object frame;
+  Lisp_Object frame = wrap_frame (f);
 
-  XSETFRAME (frame, f);
 
   if (!FRAME_VISIBLE_P (f) && is_visible)
     {
@@ -173,9 +172,8 @@
 static void
 handle_map_event (struct frame *f, GdkEvent *event)
 {
-  Lisp_Object frame;
+  Lisp_Object frame = wrap_frame (f);
 
-  XSETFRAME (frame, f);
   if (event->any.type == GDK_MAP)
     {
       FRAME_GTK_TOTALLY_VISIBLE_P (f) = 1;
@@ -194,9 +192,8 @@
 static void
 handle_client_message (struct frame *f, GdkEvent *event)
 {
-  Lisp_Object frame;
+  Lisp_Object frame = wrap_frame (f);
 
-  XSETFRAME (frame, f);
 
   /* The event-Xt code used to handle WM_DELETE_WINDOW here, but we
      handle that directly in frame-gtk.c */
@@ -269,9 +266,8 @@
     case GDK_ENTER_NOTIFY:
       if (event->crossing.detail != GDK_NOTIFY_INFERIOR)
 	{
-	  Lisp_Object frame;
+	  Lisp_Object frame = wrap_frame (f);
 
-	  XSETFRAME (frame, f);
 	  /* FRAME_X_MOUSE_P (f) = 1; */
 	  va_run_hook_with_args (Qmouse_enter_frame_hook, 1, frame);
 	}
@@ -280,9 +276,8 @@
     case GDK_LEAVE_NOTIFY:
       if (event->crossing.detail != GDK_NOTIFY_INFERIOR)
 	{
-	  Lisp_Object frame;
+	  Lisp_Object frame = wrap_frame (f);
 
-	  XSETFRAME (frame, f);
 	  /* FRAME_X_MOUSE_P (f) = 0; */
 	  va_run_hook_with_args (Qmouse_leave_frame_hook, 1, frame);
 	}
@@ -788,7 +783,7 @@
   Lisp_Object process;
   int infd = event_stream_unixoid_select_process (p);
 
-  XSETPROCESS (process, p);
+  process = wrap_process (p);
   select_filedesc (infd, process);
 }
 
@@ -872,7 +867,7 @@
   if (CONSOLE_GTK_P (con))
     return; /* Gtk consoles are automatically selected for when we initialize them */
   infd = event_stream_unixoid_select_console (con);
-  XSETCONSOLE (console, con);
+  console = wrap_console (con);
   select_filedesc (infd, console);
 }
 
@@ -885,7 +880,7 @@
   if (CONSOLE_GTK_P (con))
 	return; /* X consoles are automatically selected for when we initialize them */
   infd = event_stream_unixoid_unselect_console (con);
-  XSETCONSOLE (console, con);
+  console = wrap_console (con);
   unselect_filedesc (infd);
 }
 
@@ -954,7 +949,7 @@
   ev->event_type = misc_user_event;
   ev->timestamp = time;
 
-  XSETFRAME (ev->channel, f);
+  ev->channel = wrap_frame (f);
 
   ev->event.misc.x = x;
   ev->event.misc.y = y;
@@ -1159,7 +1154,7 @@
   if (!NILP (dispatch_event_queue))
     {
       Lisp_Object event, event2;
-      XSETEVENT (event2, emacs_event);
+      event2 = wrap_event (emacs_event);
       event = dequeue_gtk_dispatch_event ();
       Fcopy_event (event, event2);
       Fdeallocate_event (event);
@@ -1365,7 +1360,7 @@
 	else                    /* Mouse press/release event */
 	  {
 	    GdkEventButton *button_event = &gdk_event->button;
-	    XSETFRAME (emacs_event->channel, frame);
+	    emacs_event->channel = wrap_frame (frame);
 
 	    emacs_event->event_type = (button_event->type == GDK_BUTTON_RELEASE) ?
 	      button_release_event : button_press_event;
@@ -1400,7 +1395,7 @@
 
         DEVICE_GTK_MOUSE_TIMESTAMP (d) = ev->time;
 
-        XSETFRAME (emacs_event->channel, frame);
+        emacs_event->channel = wrap_frame (frame);
         emacs_event->event_type	    = pointer_motion_event;
         emacs_event->timestamp      = ev->time;
         emacs_event->event.motion.x = x;
@@ -1510,19 +1505,19 @@
 #undef FROB
 
     emacs_event->event_type = magic_event;
-    XSETFRAME (emacs_event->channel, frame);
+    emacs_event->channel = wrap_frame (frame);
 
     if (ignore_p)
-    {
+      {
 	stderr_out ("Ignoring event... (%s)\n", event_name (event));
 	Fdeallocate_event (lisp_event);
 	return (FALSE);
-    }
+      }
     else
-    {
+      {
 	enqueue_gtk_dispatch_event (lisp_event);
 	return (TRUE);
-    }
+      }
 }
 
 
--- a/src/event-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/event-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -306,7 +306,6 @@
 static Lisp_Object
 make_ntpipe_input_stream (HANDLE hpipe, LPARAM param)
 {
-  Lisp_Object obj;
   Lstream *lstr = Lstream_new (lstream_ntpipe_slurp, "r");
   struct ntpipe_slurp_stream *s = NTPIPE_SLURP_STREAM_DATA (lstr);
   DWORD thread_id_unused;
@@ -349,8 +348,7 @@
   CloseHandle (hthread);
 
   lstr->flags |= LSTREAM_FL_CLOSE_AT_DISKSAVE;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 static LPARAM
@@ -536,7 +534,6 @@
 static Lisp_Object
 make_ntpipe_output_stream (HANDLE hpipe, LPARAM param)
 {
-  Lisp_Object obj;
   Lstream *lstr = Lstream_new (lstream_ntpipe_shove, "w");
   struct ntpipe_shove_stream *s = NTPIPE_SHOVE_STREAM_DATA (lstr);
   DWORD thread_id_unused;
@@ -572,8 +569,7 @@
   ResumeThread (s->hthread);
 
   lstr->flags |= LSTREAM_FL_CLOSE_AT_DISKSAVE;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 static LPARAM
@@ -833,7 +829,6 @@
 static Lisp_Object
 make_winsock_stream_1 (SOCKET s, LPARAM param, const char *mode)
 {
-  Lisp_Object obj;
   Lstream *lstr = Lstream_new (lstream_winsock, mode);
   struct winsock_stream *str = WINSOCK_STREAM_DATA (lstr);
 
@@ -850,8 +845,7 @@
     }
 
   lstr->flags |= LSTREAM_FL_CLOSE_AT_DISKSAVE;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 static Lisp_Object
@@ -961,8 +955,8 @@
 {
   Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
   Lisp_Event *event = XEVENT (emacs_event);
-  Lisp_Object process;
-  XSETPROCESS (process, p);
+  Lisp_Object process = wrap_process (p);
+
 
   event->event_type = process_event;
   event->timestamp  = GetTickCount ();
@@ -3985,7 +3979,7 @@
   mswindows_need_event (1);
 
   event = mswindows_dequeue_dispatch_event ();
-  XSETEVENT (event2, emacs_event);
+  event2 = wrap_event (emacs_event);
   Fcopy_event (event, event2);
   Fdeallocate_event (event);
 }
@@ -4099,7 +4093,7 @@
 get_process_input_waitable (Lisp_Process *process)
 {
   Lisp_Object instr, outstr, p;
-  XSETPROCESS (p, process);
+  p = wrap_process (process);
   get_process_streams (process, &instr, &outstr);
   assert (!NILP (instr));
 #if defined (HAVE_SOCKETS) && !defined(HAVE_MSG_SELECT)
@@ -4121,8 +4115,8 @@
 
 #ifdef HAVE_WIN32_PROCESSES
   {
-    Lisp_Object p;
-    XSETPROCESS (p, process);
+    Lisp_Object p = wrap_process (process);
+
     if (!network_connection_p (p))
       {
 	HANDLE hprocess = get_nt_process_handle (process);
--- a/src/event-stream.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/event-stream.c	Fri Mar 29 04:49:13 2002 +0000
@@ -311,7 +311,6 @@
 
 #define XCOMMAND_BUILDER(x) \
   XRECORD (x, command_builder, struct command_builder)
-#define XSETCOMMAND_BUILDER(x, p) XSETRECORD (x, p, command_builder)
 #define wrap_command_builder(p) wrap_record (p, command_builder)
 #define COMMAND_BUILDERP(x) RECORDP (x, command_builder)
 #define CHECK_COMMAND_BUILDER(x) CHECK_RECORD (x, command_builder)
@@ -549,7 +548,7 @@
 
   check_event_stream_ok (EVENT_STREAM_READ);
 
-  XSETEVENT (event_obj, event);
+  event_obj = wrap_event (event);
   zero_event (event);
   /* If C-g was pressed, treat it as a character to be read.
      Note that if C-g was pressed while we were blocking,
@@ -706,7 +705,7 @@
 		Lisp_Object event)
 {
   /* This function can GC */
-  char buf[255];
+  DECLARE_EISTRING_MALLOC (buf);
   Bytecount buf_index = command_builder->echo_buf_index;
   Intbyte *e;
   Bytecount len;
@@ -718,13 +717,17 @@
     }
 
   format_event_object (buf, XEVENT (event), 1);
-  len = strlen (buf);
+  len = eilen (buf);
 
   if (len + buf_index + 4 > command_builder->echo_buf_length)
-    return;
+    {
+      eifree (buf);
+      return;
+    }
   e = command_builder->echo_buf + buf_index;
-  memcpy (e, buf, len);
+  memcpy (e, eidata (buf), len);
   e += len;
+  eifree (buf);
 
   e[0] = ' ';
   e[1] = '-';
@@ -3235,8 +3238,7 @@
 
 	  *did_munge = 1;
 
-	  result = command_builder_find_leaf_1 (builder);
-	  return result;
+	  return command_builder_find_leaf_1 (builder);
 	}
 
       signal_error (Qinvalid_key_binding,
@@ -4125,7 +4127,7 @@
 pre_command_hook (void)
 {
   last_point_position = BUF_PT (current_buffer);
-  XSETBUFFER (last_point_position_buffer, current_buffer);
+  last_point_position_buffer = wrap_buffer (current_buffer);
   /* This function can GC */
   safe_run_hook_trapping_errors
     ("Error in `pre-command-hook' (setting hook to nil)",
@@ -4573,7 +4575,7 @@
 	  Bytecount len = set_charptr_emchar (str, ch);
 	  Lstream_write (XLSTREAM (Vdribble_file), str, len);
 	}
-      else if (string_char_length (XSYMBOL (keysym)->name) == 1)
+      else if (XSTRING_CHAR_LENGTH (XSYMBOL (keysym)->name) == 1)
 	/* one-char key events are printed with just the key name */
 	Fprinc (keysym, Vdribble_file);
       else if (EQ (keysym, Qreturn))
--- a/src/event-tty.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/event-tty.c	Fri Mar 29 04:49:13 2002 +0000
@@ -159,7 +159,7 @@
 		  Lisp_Process *p = get_process_from_usid (FD_TO_USID(i));
 
 		  assert (p);
-		  XSETPROCESS (process, p);
+		  process = wrap_process (p);
 		  emacs_event->event_type = process_event;
 		  /* process events have nil as channel */
 		  emacs_event->timestamp  = 0; /* #### */
--- a/src/event-unixoid.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/event-unixoid.c	Fri Mar 29 04:49:13 2002 +0000
@@ -74,9 +74,8 @@
 read_event_from_tty_or_stream_desc (Lisp_Event *event, struct console *con)
 {
   Emchar ch;
-  Lisp_Object console;
+  Lisp_Object console = wrap_console (con);
 
-  XSETCONSOLE (console, con);
 
   if (CONSOLE_TTY_P (con))
     ch = Lstream_get_emchar (XLSTREAM (CONSOLE_TTY_DATA (con)->instream));
--- a/src/events.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/events.c	Fri Mar 29 04:49:13 2002 +0000
@@ -135,10 +135,11 @@
 static void
 print_event_1 (const char *str, Lisp_Object obj, Lisp_Object printcharfun)
 {
-  char buf[255];
+  DECLARE_EISTRING_MALLOC (ei);
   write_c_string (str, printcharfun);
-  format_event_object (buf, XEVENT (obj), 0);
-  write_c_string (buf, printcharfun);
+  format_event_object (ei, XEVENT (obj), 0);
+  write_eistring (ei, printcharfun);
+  eifree (ei);
 }
 
 static void
@@ -164,14 +165,13 @@
       break;
     case pointer_motion_event:
       {
-	char buf[64];
 	Lisp_Object Vx, Vy;
 	Vx = Fevent_x_pixel (obj);
 	assert (INTP (Vx));
 	Vy = Fevent_y_pixel (obj);
 	assert (INTP (Vy));
-	sprintf (buf, "#<motion-event %ld, %ld", (long) XINT (Vx), (long) XINT (Vy));
-	write_c_string (buf, printcharfun);
+	write_fmt_string (printcharfun, "#<motion-event %ld, %ld",
+			  (long) XINT (Vx), (long) XINT (Vy));
 	break;
       }
     case process_event:
@@ -1193,7 +1193,7 @@
 
   if (STRINGP (seq))
     {
-      Emchar ch = string_char (XSTRING (seq), n);
+      Emchar ch = XSTRING_CHAR (seq, n);
       Fcharacter_to_event (make_char (ch), event, Qnil, Qnil);
     }
   else
@@ -1223,8 +1223,11 @@
   return head;
 }
 
+/* Concatenate a string description of EVENT onto the end of BUF.  If
+   BRIEF, use short forms for keys, e.g. C- instead of control-. */
+
 void
-format_event_object (char *buf, Lisp_Event *event, int brief)
+format_event_object (Eistring *buf, Lisp_Event *event, int brief)
 {
   int mouse_p = 0;
   int mod = 0;
@@ -1238,7 +1241,8 @@
         key = event->event.key.keysym;
         /* Hack. */
         if (! brief && CHARP (key) &&
-            mod & (XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER))
+            mod & (XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER |
+		   XEMACS_MOD_HYPER))
 	{
 	  int k = XCHAR (key);
 	  if (k >= 'a' && k <= 'z')
@@ -1267,26 +1271,26 @@
 	stream = make_resizing_buffer_output_stream ();
 	event_stream_format_magic_event (event, stream);
 	Lstream_flush (XLSTREAM (stream));
-	strncpy (buf, resizing_buffer_stream_ptr (XLSTREAM (stream)),
-		 Lstream_byte_count (XLSTREAM (stream)));
+	eicat_raw (buf, resizing_buffer_stream_ptr (XLSTREAM (stream)),
+		   Lstream_byte_count (XLSTREAM (stream)));
 	Lstream_delete (XLSTREAM (stream));
 	UNGCPRO;
 	return;
       }
-    case magic_eval_event:	strcpy (buf, "magic-eval"); return;
-    case pointer_motion_event:	strcpy (buf, "motion");	    return;
-    case misc_user_event:	strcpy (buf, "misc-user");  return;
-    case eval_event:		strcpy (buf, "eval");	    return;
-    case process_event:		strcpy (buf, "process");    return;
-    case timeout_event:		strcpy (buf, "timeout");    return;
-    case empty_event:		strcpy (buf, "empty");	    return;
-    case dead_event:		strcpy (buf, "DEAD-EVENT"); return;
+    case magic_eval_event:	eicat_c (buf, "magic-eval"); return;
+    case pointer_motion_event:	eicat_c (buf, "motion");     return;
+    case misc_user_event:	eicat_c (buf, "misc-user");  return;
+    case eval_event:		eicat_c (buf, "eval");	     return;
+    case process_event:		eicat_c (buf, "process");    return;
+    case timeout_event:		eicat_c (buf, "timeout");    return;
+    case empty_event:		eicat_c (buf, "empty");	     return;
+    case dead_event:		eicat_c (buf, "DEAD-EVENT"); return;
     default:
       abort ();
       return;
     }
-#define modprint1(x)  do { strcpy (buf, (x)); buf += sizeof (x)-1; } while (0)
-#define modprint(x,y) do { if (brief) modprint1 (y); else modprint1 (x); } while (0)
+#define modprint(x,y) \
+  do { if (brief) eicat_c (buf, (y)); else eicat_c (buf, (x)); } while (0)
   if (mod & XEMACS_MOD_CONTROL) modprint ("control-", "C-");
   if (mod & XEMACS_MOD_META)    modprint ("meta-",    "M-");
   if (mod & XEMACS_MOD_SUPER)   modprint ("super-",   "S-");
@@ -1295,21 +1299,17 @@
   if (mod & XEMACS_MOD_SHIFT)   modprint ("shift-",   "Sh-");
   if (mouse_p)
     {
-      modprint1 ("button");
+      eicat_c (buf, "button");
       --mouse_p;
     }
 
 #undef modprint
-#undef modprint1
 
   if (CHARP (key))
-    {
-      buf += set_charptr_emchar ((Intbyte *) buf, XCHAR (key));
-      *buf = 0;
-    }
+    eicat_ch (buf, XCHAR (key));
   else if (SYMBOLP (key))
     {
-      const char *str = 0;
+      const Char_ASCII *str = 0;
       if (brief)
 	{
 	  if      (EQ (key, QKlinefeed))  str = "LFD";
@@ -1321,22 +1321,14 @@
 	  else if (EQ (key, QKbackspace)) str = "BS";
 	}
       if (str)
-	{
-	  int i = strlen (str);
-	  memcpy (buf, str, i+1);
-	  str += i;
-	}
+	eicat_c (buf, str);
       else
-	{
-	  Lisp_String *name = XSYMBOL (key)->name;
-	  memcpy (buf, string_data (name), string_length (name) + 1);
-	  str += string_length (name);
-	}
+	eicat_lstr (buf, XSYMBOL (key)->name);
     }
   else
     abort ();
   if (mouse_p)
-    strncpy (buf, "up", 4);
+    eicat_c (buf, "up");
 }
 
 DEFUN ("eventp", Feventp, 1, 1, 0, /*
@@ -1948,10 +1940,7 @@
     return Qnil;
   else
     {
-      Lisp_Object window;
-
-      XSETWINDOW (window, w);
-      return window;
+      return wrap_window (w);
     }
 }
 
--- a/src/events.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/events.h	Fri Mar 29 04:49:13 2002 +0000
@@ -451,7 +451,6 @@
 
 DECLARE_LRECORD (timeout, Lisp_Timeout);
 #define XTIMEOUT(x) XRECORD (x, timeout, Lisp_Timeout)
-#define XSETTIMEOUT(x, p) XSETRECORD (x, p, timeout)
 #define wrap_timeout(p) wrap_record (p, timeout)
 #define TIMEOUTP(x) RECORDP (x, timeout)
 #define CHECK_TIMEOUT(x) CHECK_RECORD (x, timeout)
@@ -520,7 +519,6 @@
 
 DECLARE_LRECORD (event, Lisp_Event);
 #define XEVENT(x) XRECORD (x, event, Lisp_Event)
-#define XSETEVENT(x, p) XSETRECORD (x, p, event)
 #define wrap_event(p) wrap_record (p, event)
 #define EVENTP(x) RECORDP (x, event)
 #define CHECK_EVENT(x) CHECK_RECORD (x, event)
@@ -592,7 +590,7 @@
 #define KEYSYM(x) (intern (x))
 
 /* from events.c */
-void format_event_object (char *buf, Lisp_Event *e, int brief);
+void format_event_object (Eistring *buf, Lisp_Event *event, int brief);
 void character_to_event (Emchar c, Lisp_Event *event,
                          struct console *con,
                          int use_console_meta_flag,
--- a/src/extents.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/extents.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Copyright (c) 1994, 1995 Free Software Foundation, Inc.
    Copyright (c) 1995 Sun Microsystems, Inc.
-   Copyright (c) 1995, 1996, 2000 Ben Wing.
+   Copyright (c) 1995, 1996, 2000, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -938,7 +938,7 @@
     alloc_lcrecord_type (struct extent_auxiliary, &lrecord_extent_auxiliary);
 
   copy_lcrecord (data, &extent_auxiliary_defaults);
-  XSETEXTENT_AUXILIARY (extent_aux, data);
+  extent_aux = wrap_extent_auxiliary (data);
   ext->plist = Fcons (extent_aux, ext->plist);
   ext->flags.has_aux = 1;
 }
@@ -994,9 +994,8 @@
       for (i = 0; i < extent_list_num_els (list); i++)
 	{
 	  struct extent *extent = extent_list_at (list, i, 0);
-	  Lisp_Object exobj;
-
-	  XSETEXTENT (exobj, extent);
+	  Lisp_Object exobj = wrap_extent (extent);
+
 	  mark_object (exobj);
 	}
     }
@@ -1036,7 +1035,7 @@
   struct extent_info *data =
     alloc_lcrecord_type (struct extent_info, &lrecord_extent_info);
 
-  XSETEXTENT_INFO (extent_info, data);
+  extent_info = wrap_extent_info (data);
   data->extents = allocate_extent_list ();
   data->soe = 0;
   return extent_info;
@@ -1074,7 +1073,7 @@
 decode_buffer_or_string (Lisp_Object object)
 {
   if (NILP (object))
-    XSETBUFFER (object, current_buffer);
+    object = wrap_buffer (current_buffer);
   else if (BUFFERP (object))
     CHECK_LIVE_BUFFER (object);
   else if (STRINGP (object))
@@ -1105,7 +1104,7 @@
 {
   if (STRINGP (object))
     {
-      Lisp_Object plist = XSTRING (object)->plist;
+      Lisp_Object plist = XSTRING_PLIST (object);
       if (!CONSP (plist) || !EXTENT_INFOP (XCAR (plist)))
 	return 0;
       return XEXTENT_INFO (XCAR (plist));
@@ -1147,7 +1146,7 @@
 				    destroyed buffers, or special
 				    Lisp-inaccessible buffer objects. */
       extent_info = allocate_extent_info ();
-      XSTRING (object)->plist = Fcons (extent_info, XSTRING (object)->plist);
+      XSTRING_PLIST (object) = Fcons (extent_info, XSTRING_PLIST (object));
       return XEXTENT_INFO (extent_info);
     }
 
@@ -1281,7 +1280,7 @@
   Lisp_Object extent;
   char buf[200];
 
-  XSETEXTENT (extent, e);
+  extent = wrap_extent (e);
   print_extent_1 (buf, extent);
   fputs (buf, stdout);
 }
@@ -2801,7 +2800,7 @@
 	  struct glyph_block gb;
 
 	  gb.glyph = glyph;
-	  XSETEXTENT (gb.extent, e);
+	  gb.extent = wrap_extent (e);
 	  Dynarr_add (ef->begin_glyphs, gb);
 	}
     }
@@ -2816,7 +2815,7 @@
 	  struct glyph_block gb;
 
 	  gb.glyph = glyph;
-	  XSETEXTENT (gb.extent, e);
+	  gb.extent = wrap_extent (e);
 	  Dynarr_add (ef->end_glyphs, gb);
 	}
     }
@@ -2901,12 +2900,12 @@
 
 	      /* FIXME: One should probably inhibit the displaying of
 		 this extent to reduce flicker */
-	      extent_in_red_event_p(e) = 1;
+	      extent_in_red_event_p (e) = 1;
 
 	      /* call the function */
-	      XSETEXTENT(obj,e);
-	      if(!NILP(function))
-	         Fenqueue_eval_event(function,obj);
+	      obj = wrap_extent (e);
+	      if (!NILP (function))
+	         Fenqueue_eval_event (function, obj);
 	    }
 	}
     }
@@ -3341,7 +3340,6 @@
 */
        (extent))
 {
-  Lisp_Object val;
   EXTENT next;
 
   if (EXTENTP (extent))
@@ -3351,8 +3349,7 @@
 
   if (!next)
     return Qnil;
-  XSETEXTENT (val, next);
-  return val;
+  return wrap_extent (next);
 }
 
 DEFUN ("previous-extent", Fprevious_extent, 1, 1, 0, /*
@@ -3363,7 +3360,6 @@
 */
        (extent))
 {
-  Lisp_Object val;
   EXTENT prev;
 
   if (EXTENTP (extent))
@@ -3373,8 +3369,7 @@
 
   if (!prev)
     return Qnil;
-  XSETEXTENT (val, prev);
-  return val;
+  return wrap_extent (prev);
 }
 
 #ifdef DEBUG_XEMACS
@@ -3386,7 +3381,6 @@
 */
        (extent))
 {
-  Lisp_Object val;
   EXTENT next;
 
   if (EXTENTP (extent))
@@ -3396,8 +3390,7 @@
 
   if (!next)
     return Qnil;
-  XSETEXTENT (val, next);
-  return val;
+  return wrap_extent (next);
 }
 
 DEFUN ("previous-e-extent", Fprevious_e_extent, 1, 1, 0, /*
@@ -3408,7 +3401,6 @@
 */
        (extent))
 {
-  Lisp_Object val;
   EXTENT prev;
 
   if (EXTENTP (extent))
@@ -3418,8 +3410,7 @@
 
   if (!prev)
     return Qnil;
-  XSETEXTENT (val, prev);
-  return val;
+  return wrap_extent (prev);
 }
 
 #endif
@@ -3531,7 +3522,7 @@
   Lisp_Object cur_parent = extent_parent (e);
   Lisp_Object rest;
 
-  XSETEXTENT (extent, e);
+  extent = wrap_extent (e);
   if (!NILP (parent))
     CHECK_LIVE_EXTENT (parent);
   if (EQ (parent, cur_parent))
@@ -3600,8 +3591,8 @@
     {
       if (extent_duplicable_p (extent))
 	{
-	  Lisp_Object extent_obj;
-	  XSETEXTENT (extent_obj, extent);
+	  Lisp_Object extent_obj = wrap_extent (extent);
+
 	  record_extent (extent_obj, 1);
 	}
     }
@@ -3681,7 +3672,7 @@
 			     &lrecord_extent_auxiliary);
 
       copy_lcrecord (data, XEXTENT_AUXILIARY (XCAR (original->plist)));
-      XSETEXTENT_AUXILIARY (XCAR (e->plist), data);
+      XCAR (e->plist) = wrap_extent_auxiliary (data);
     }
 
   {
@@ -3689,8 +3680,8 @@
     Lisp_Object parent = extent_parent (e);
     if (!NILP (parent))
       {
-	Lisp_Object extent;
-	XSETEXTENT (extent, e);
+	Lisp_Object extent = wrap_extent (e);
+
 	add_extent_to_children_list (XEXTENT (parent), extent);
       }
   }
@@ -3713,7 +3704,7 @@
       LIST_LOOP_DELETING (rest, nextrest, XWEAK_LIST_LIST (children))
 	Fset_extent_parent (XCAR (rest), Qnil);
     }
-  XSETEXTENT (extent_obj, extent);
+  extent_obj = wrap_extent (extent);
   Fset_extent_parent (extent_obj, Qnil);
   /* mark the extent as destroyed */
   extent_object (extent) = Qt;
@@ -3739,7 +3730,7 @@
     {
       if (NILP (buffer_or_string))
 	obj = Qnil;
-      XSETEXTENT (extent_obj, make_extent_detached (obj));
+      extent_obj = wrap_extent (make_extent_detached (obj));
     }
   else
     {
@@ -3747,7 +3738,7 @@
 
       get_buffer_or_string_range_byte (obj, from, to, &start, &end,
 				       GB_ALLOW_PAST_ACCESSIBLE);
-      XSETEXTENT (extent_obj, make_extent_internal (obj, start, end));
+      extent_obj = wrap_extent (make_extent_internal (obj, start, end));
     }
   return extent_obj;
 }
@@ -3765,8 +3756,7 @@
   else
     buffer_or_string = decode_buffer_or_string (buffer_or_string);
 
-  XSETEXTENT (extent, copy_extent (ext, -1, -1, buffer_or_string));
-  return extent;
+  return wrap_extent (copy_extent (ext, -1, -1, buffer_or_string));
 }
 
 DEFUN ("delete-extent", Fdelete_extent, 1, 1, 0, /*
@@ -3943,9 +3933,8 @@
 {
   /* This function can GC */
   struct slow_map_extents_arg *closure = (struct slow_map_extents_arg *) arg;
-  Lisp_Object extent_obj;
-
-  XSETEXTENT (extent_obj, extent);
+  Lisp_Object extent_obj = wrap_extent (extent);
+
 
   /* make sure this extent qualifies according to the PROPERTY
      and VALUE args */
@@ -4137,7 +4126,7 @@
 	return 0;
       /* corner case:  prev_end can be -1 if there is no prev */
     }
-  XSETEXTENT (extent_obj, extent);
+  extent_obj = wrap_extent (extent);
 
   /* make sure this extent qualifies according to the PROPERTY
      and VALUE args */
@@ -4284,8 +4273,8 @@
      if it has a non-nil value for that property. */
   if (!NILP (closure->prop))
     {
-      Lisp_Object extent;
-      XSETEXTENT (extent, e);
+      Lisp_Object extent = wrap_extent (e);
+
       if (NILP (Fextent_property (extent, closure->prop, Qnil)))
 	return 0;
     }
@@ -4311,15 +4300,14 @@
       else
 	return 0;
     accept:
-      XSETEXTENT (closure->best_match, e);
+      closure->best_match = wrap_extent (e);
       closure->best_start = extent_start (e);
       closure->best_end = extent_end (e);
     }
   else
     {
-      Lisp_Object extent;
-
-      XSETEXTENT (extent, e);
+      Lisp_Object extent = wrap_extent (e);
+
       closure->best_match = Fcons (extent, closure->best_match);
     }
 
@@ -4718,9 +4706,9 @@
   if (NILP (hook))
     return 0;
 
-  XSETEXTENT (exobj, extent);
-  XSETINT (startobj, closure->start);
-  XSETINT (endobj, closure->end);
+  exobj = wrap_extent (extent);
+  startobj = make_int (closure->start);
+  endobj = make_int (closure->end);
 
   /* Now that we are sure to call elisp, set up an unwind-protect so
      inside_change_hook gets restored in case we throw.  Also record
@@ -5530,7 +5518,7 @@
     return cons3 (Qdestroyed, Qt, Qnil);
 
   anc = extent_ancestor (e);
-  XSETEXTENT (anc_obj, anc);
+  anc_obj = wrap_extent (anc);
 
   /* For efficiency, use the ancestor for all properties except detached */
 
@@ -5644,7 +5632,7 @@
   if (NILP (extent))
     highlight_p = Qnil;
   else
-    XSETEXTENT (extent, decode_extent (extent, DE_MUST_BE_ATTACHED));
+    extent = wrap_extent (decode_extent (extent, DE_MUST_BE_ATTACHED));
   do_highlight (extent, !NILP (highlight_p));
   return Qnil;
 }
@@ -5679,7 +5667,7 @@
   /* This function can GC */
   Lisp_Object extent;
   Lisp_Object copy_fn;
-  XSETEXTENT (extent, e);
+  extent = wrap_extent (e);
   copy_fn = Fextent_property (extent, prop, Qnil);
   if (!NILP (copy_fn))
     {
@@ -5735,8 +5723,6 @@
 	       Lisp_Object object, int run_hooks)
 {
   /* This function can GC */
-  Lisp_Object tmp;
-
   if (!EQ (extent_object (extent), object))
     goto copy_it;
 
@@ -5765,8 +5751,7 @@
 	}
     }
 
-  XSETEXTENT (tmp, extent);
-  return tmp;
+  return wrap_extent (extent);
 
  copy_it:
   if (run_hooks &&
@@ -5774,10 +5759,7 @@
     /* The paste-function said don't attach a copy of the extent here. */
     return Qnil;
   else
-    {
-      XSETEXTENT (tmp, copy_extent (extent, new_start, new_end, object));
-      return tmp;
-    }
+    return wrap_extent (copy_extent (extent, new_start, new_end, object));
 }
 
 DEFUN ("insert-extent", Finsert_extent, 1, 5, 0, /*
@@ -5928,9 +5910,8 @@
 {
   struct splice_in_string_extents_arg closure;
   struct gcpro gcpro1, gcpro2;
-  Lisp_Object buffer;
-
-  buffer = wrap_buffer (buf);
+  Lisp_Object buffer = wrap_buffer (buf);
+
   closure.opoint = opoint;
   closure.pos = pos;
   closure.length = length;
@@ -6178,7 +6159,7 @@
   Lisp_Object extent, e_val;
   int is_eq;
 
-  XSETEXTENT (extent, e);
+  extent = wrap_extent (e);
 
   /* Note: in some cases when the property itself is 'start-open
      or 'end-closed, the checks to set the openness may do a bit
@@ -6335,8 +6316,8 @@
   Bytebpos e_start, e_end;
   Bytebpos start = closure->start;
   Bytebpos end   = closure->end;
-  Lisp_Object extent;
-  XSETEXTENT (extent, e);
+  Lisp_Object extent = wrap_extent (e);
+
   e_start = extent_endpoint_bytebpos (e, 0);
   e_end   = extent_endpoint_bytebpos (e, 1);
 
@@ -6408,9 +6389,8 @@
    */
   if (!NILP (value) && NILP (closure.the_extent))
     {
-      Lisp_Object extent;
-
-      XSETEXTENT (extent, make_extent_internal (object, start, end));
+      Lisp_Object extent = wrap_extent (make_extent_internal (object, start, end));
+
       closure.changed_p = 1;
       Fset_extent_property (extent, Qtext_prop, prop);
       Fset_extent_property (extent, prop, value);
--- a/src/extents.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/extents.h	Fri Mar 29 04:49:13 2002 +0000
@@ -25,7 +25,6 @@
 
 DECLARE_LRECORD (extent, struct extent);
 #define XEXTENT(x) XRECORD (x, extent, struct extent)
-#define XSETEXTENT(x, p) XSETRECORD (x, p, extent)
 #define wrap_extent(p) wrap_record (p, extent)
 #define EXTENTP(x) RECORDP (x, extent)
 #define CHECK_EXTENT(x) CHECK_RECORD (x, extent)
@@ -145,7 +144,6 @@
 DECLARE_LRECORD (extent_auxiliary, struct extent_auxiliary);
 #define XEXTENT_AUXILIARY(x) \
   XRECORD (x, extent_auxiliary, struct extent_auxiliary)
-#define XSETEXTENT_AUXILIARY(x, p) XSETRECORD (x, p, extent_auxiliary)
 #define wrap_extent_auxiliary(p) wrap_record (p, extent_auxiliary)
 #define EXTENT_AUXILIARYP(x) RECORDP (x, extent_auxiliary)
 #define CHECK_EXTENT_AUXILIARY(x) CHECK_RECORD (x, extent_auxiliary)
@@ -161,7 +159,6 @@
 
 DECLARE_LRECORD (extent_info, struct extent_info);
 #define XEXTENT_INFO(x) XRECORD (x, extent_info, struct extent_info)
-#define XSETEXTENT_INFO(x, p) XSETRECORD (x, p, extent_info)
 #define wrap_extent_info(p) wrap_record (p, extent_info)
 #define EXTENT_INFOP(x) RECORDP (x, extent_info)
 #define CHECK_EXTENT_INFO(x) CHECK_RECORD (x, extent_info)
--- a/src/faces.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/faces.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* "Face" primitives
    Copyright (C) 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2001 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
 
 This file is part of XEmacs.
@@ -571,19 +571,19 @@
 				  XFACE (face)->charsets_warned_about)))
 	    {
 #ifdef MULE
-	      if (! UNBOUNDP (charset))
+	      if (!UNBOUNDP (charset))
 		warn_when_safe
-		  (Qfont, Qwarning,
-		   "Unable to instantiate font for face %s, charset %s",
-		   string_data (symbol_name
-				(XSYMBOL (XFACE (face)->name))),
-		   string_data (symbol_name
-				(XSYMBOL (XCHARSET_NAME (charset)))));
+		  (Qfont, Qnotice,
+		   "Unable to instantiate font for charset %s, face %s",
+		   XSTRING_DATA (symbol_name
+				(XSYMBOL (XCHARSET_NAME (charset)))),
+		   XSTRING_DATA (symbol_name
+				(XSYMBOL (XFACE (face)->name))));
 	      else
 #endif
-		warn_when_safe (Qfont, Qwarning,
+		warn_when_safe (Qfont, Qnotice,
 				"Unable to instantiate font for face %s",
-				string_data (symbol_name
+				XSTRING_DATA (symbol_name
 					     (XSYMBOL (XFACE (face)->name))));
 	      XFACE (face)->charsets_warned_about =
 		Fcons (charset, XFACE (face)->charsets_warned_about);
@@ -783,7 +783,7 @@
     return face;
 
   f = allocate_face ();
-  XSETFACE (face, f);
+  face = wrap_face (f);
 
   f->name = name;
   f->doc_string = doc_string;
@@ -886,8 +886,8 @@
      loaded, so we can't do this. */
   if (initialized)
     {
-      Lisp_Object tdevice;
-      XSETDEVICE (tdevice, d);
+      Lisp_Object tdevice = wrap_device (d);
+
       call_critical_lisp_code (d, Qinit_device_faces, tdevice);
     }
 }
@@ -899,8 +899,8 @@
      loaded, so we can't do this. */
   if (initialized)
     {
-      Lisp_Object tframe;
-      XSETFRAME (tframe, frm);
+      Lisp_Object tframe = wrap_frame (frm);
+
 
       /* DO NOT change the selected frame here.  If the debugger goes off
          it will try and display on the frame being created, but it is not
@@ -1084,16 +1084,17 @@
     }
 
   new_val = face_property_matching_instance (face, Qfont, charset, domain,
-					     /* #### look into ERROR_ME_NOT */
-					     ERROR_ME_NOT, 1, Qzero);
+					     /* #### look into error flag */
+					     ERROR_ME_DEBUG_WARN, 1, Qzero);
   if (UNBOUNDP (new_val))
     {
       bound = 0;
       new_val = face_property_matching_instance (face, Qfont,
 						 charset, domain,
-						 /* #### look into
-						    ERROR_ME_NOT */
-						 ERROR_ME_NOT, 0, Qzero);
+						 /* #### look into error
+                                                    flag */
+						 ERROR_ME_DEBUG_WARN, 0,
+						 Qzero);
     }
   if (!UNBOUNDP (cachel->font[offs]) && !EQ (new_val, cachel->font[offs]))
     cachel->dirty = 1;
@@ -1207,7 +1208,7 @@
   Lisp_Object domain;
 
   reset_face_cachel (&new_cachel);
-  XSETWINDOW (domain, w);
+  domain = wrap_window (w);
   update_face_cachel_data (&new_cachel, domain, face);
   Dynarr_add (w->face_cachels, new_cachel);
 
@@ -1414,8 +1415,8 @@
 
       if (EQ (cachel->face, face))
 	{
-	  Lisp_Object window;
-	  XSETWINDOW (window, w);
+	  Lisp_Object window = wrap_window (w);
+
 	  if (!cachel->updated)
 	    update_face_cachel_data (cachel, window, face);
 	  return elt;
@@ -1571,8 +1572,6 @@
   struct face_cachel cachel;
   int len = Dynarr_length (ef->extents);
   face_index findex = 0;
-  Lisp_Object window;
-  XSETWINDOW (window, w);
 
   /* Optimize the default case. */
   if (len == 0)
@@ -1695,9 +1694,8 @@
 void
 update_frame_face_values (struct frame *f)
 {
-  Lisp_Object frm;
+  Lisp_Object frm = wrap_frame (f);
 
-  XSETFRAME (frm, f);
   update_EmacsFrame (frm, Qforeground);
   update_EmacsFrame (frm, Qbackground);
   update_EmacsFrame (frm, Qfont);
@@ -2041,6 +2039,12 @@
  				    build_string (*mswfontptr)),
  			     inst_list);
  	}
+       /* Use Lucida Console rather than Courier New if it exists -- the
+          line spacing is much less, so many more lines fit with the same
+          size font. (And it's specifically designed for screens.) */
+       inst_list = Fcons (Fcons (list1 (Qmswindows), 
+				 build_string ("Lucida Console:Regular:10::")),
+			  inst_list);
     }
 #endif /* HAVE_MS_WINDOWS */
 
--- a/src/faces.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/faces.h	Fri Mar 29 04:49:13 2002 +0000
@@ -224,7 +224,6 @@
 
 DECLARE_LRECORD (face, Lisp_Face);
 #define XFACE(x) XRECORD (x, face, Lisp_Face)
-#define XSETFACE(x, p) XSETRECORD (x, p, face)
 #define wrap_face(p) wrap_record (p, face)
 #define FACEP(x) RECORDP (x, face)
 #define CHECK_FACE(x) CHECK_RECORD (x, face)
@@ -328,7 +327,7 @@
 		      domain, errb, 1, no_fallback, depth)
 
 #define FACE_PROPERTY_INSTANCE(face, property, domain, no_fallback, depth)	\
-  FACE_PROPERTY_INSTANCE_1 (face, property, domain, ERROR_ME_NOT, \
+  FACE_PROPERTY_INSTANCE_1 (face, property, domain, ERROR_ME_DEBUG_WARN, \
 			    no_fallback, depth)
 
 Lisp_Object face_property_matching_instance (Lisp_Object face,
@@ -352,7 +351,7 @@
   FACE_PROPERTY_INSTANCE (face, Qbackground, domain, 0, Qzero)
 #define FACE_FONT(face, domain, charset)				\
   face_property_matching_instance (face, Qfont, charset, domain,	\
-				   ERROR_ME_NOT, 0, Qzero)
+				   ERROR_ME_DEBUG_WARN, 0, Qzero)
 #define FACE_DISPLAY_TABLE(face, domain)				\
   FACE_PROPERTY_INSTANCE (face, Qdisplay_table, domain, 0, Qzero)
 #define FACE_BACKGROUND_PIXMAP(face, domain)				\
--- a/src/file-coding.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/file-coding.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1018,7 +1018,7 @@
 static void
 setup_eol_coding_systems (Lisp_Object codesys)
 {
-  int len = string_length (XSYMBOL (XCODING_SYSTEM_NAME (codesys))->name);
+  int len = XSTRING_LENGTH (XSYMBOL (XCODING_SYSTEM_NAME (codesys))->name);
   Intbyte *codesys_name = (Intbyte *) alloca (len + 7);
   int mlen = -1;
   Intbyte *codesys_mnemonic = 0;
@@ -1026,7 +1026,7 @@
   int i;
 
   memcpy (codesys_name,
-	  string_data (XSYMBOL (XCODING_SYSTEM_NAME (codesys))->name), len);
+	  XSTRING_DATA (XSYMBOL (XCODING_SYSTEM_NAME (codesys))->name), len);
 
   if (STRINGP (XCODING_SYSTEM_MNEMONIC (codesys)))
     {
@@ -1177,7 +1177,7 @@
 
   cs = allocate_coding_system (meths, meths->extra_data_size,
 			       name_or_existing);
-  XSETCODING_SYSTEM (csobj, cs);
+  csobj = wrap_coding_system (cs);
 
   cs->internal_p = !!prefix;
 
@@ -1457,9 +1457,9 @@
 The following additional property is recognized if TYPE is 'convert-eol:
 
 'subtype
-     One of `lf', `crlf', `cr' or `autodetect'.  When decoding, the
-     corresponding sequence will be converted to LF.  When encoding, the
-     opposite happens.  This coding system converts characters to
+     One of `lf', `crlf', `cr' or nil (for autodetection).  When decoding,
+     the corresponding sequence will be converted to LF.  When encoding,
+     the opposite happens.  This coding system converts characters to
      characters.
 
 
@@ -1645,12 +1645,12 @@
     UNBOUNDP (new_name) ? Qnil : Ffind_coding_system (new_name);
   if (NILP (new_coding_system))
     {
-      XSETCODING_SYSTEM
-	(new_coding_system,
-	 allocate_coding_system
-	 (XCODING_SYSTEM (old_coding_system)->methods,
-	  XCODING_SYSTEM (old_coding_system)->methods->extra_data_size,
-	  new_name));
+      new_coding_system =
+	wrap_coding_system
+	  (allocate_coding_system
+	   (XCODING_SYSTEM (old_coding_system)->methods,
+	    XCODING_SYSTEM (old_coding_system)->methods->extra_data_size,
+	    new_name));
       if (!UNBOUNDP (new_name))
 	Fputhash (new_name, new_coding_system, Vcoding_system_hash_table);
     }
@@ -2306,7 +2306,6 @@
 {
   Lstream *lstr = Lstream_new (lstream_coding, mode);
   struct coding_stream *str = CODING_STREAM_DATA (lstr);
-  Lisp_Object obj;
 
   codesys = Fget_coding_system (codesys);
   xzero (*str);
@@ -2318,8 +2317,7 @@
   str->convert_from = Dynarr_new (unsigned_char);
   str->direction = direction;
   set_coding_stream_coding_system (lstr, codesys);
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 Lisp_Object
@@ -2961,7 +2959,7 @@
 main encoding routine is ASCII compatible (Unicode is definitely not,
 for example).
 
-There is one parameter: `subtype', either `cr', `lf', `crlf', or `autodetect'.
+There is one parameter: `subtype', either `cr', `lf', `crlf', or nil.
 */
 
 DEFINE_CODING_SYSTEM_TYPE (convert_eol);
@@ -2996,7 +2994,7 @@
 		    data->subtype == EOL_LF ? "lf" :
 		    data->subtype == EOL_CRLF ? "crlf" :
 		    data->subtype == EOL_CR ? "cr" :
-		    data->subtype == EOL_AUTODETECT ? "autodetect" :
+		    data->subtype == EOL_AUTODETECT ? "nil" :
 		    (abort(), ""));
 }
 
@@ -3022,7 +3020,7 @@
 	data->subtype = EOL_CRLF;
       else if (EQ (value, Qcr) /* || EQ (value, Qmac) */)
 	data->subtype = EOL_CR;
-      else if (EQ (value, Qautodetect) /* || EQ (value, Qmac) */)
+      else if (EQ (value, Qnil))
 	data->subtype = EOL_AUTODETECT;
       else invalid_constant ("Unrecognized eol type", value);
     }
@@ -3044,7 +3042,7 @@
 	case EOL_LF: return Qlf;
 	case EOL_CRLF: return Qcrlf;
 	case EOL_CR: return Qcr;
-	case EOL_AUTODETECT: return Qautodetect;
+	case EOL_AUTODETECT: return Qnil;
 	default: abort ();
 	}
     }
@@ -3664,7 +3662,7 @@
 		  if (likelihood < DET_AS_LIKELY_AS_UNLIKELY)
 		    warn_when_safe_lispobj
 		      (intern ("detection"),
-		       Qerror,
+		       Qwarning,
 		       emacs_sprintf_string_lisp
 		       (
 "Detected coding %s is unlikely to be correct (likelihood == `%s')",
@@ -4797,7 +4795,7 @@
 		    build_msg_string (
 "Autodetect the end-of-line type."),
 		    Qmnemonic, build_string ("Auto-EOL"),
-		    Qsubtype, Qautodetect),
+		    Qsubtype, Qnil),
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
 		subsidiaries -- it needs the coding systems we're creating
 		to do so! */
--- a/src/file-coding.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/file-coding.h	Fri Mar 29 04:49:13 2002 +0000
@@ -2,7 +2,7 @@
    #### rename me to coding-system.h
    Copyright (C) 1991, 1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2000, 2001 Ben Wing.
+   Copyright (C) 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -261,7 +261,6 @@
 
 DECLARE_LRECORD (coding_system, Lisp_Coding_System);
 #define XCODING_SYSTEM(x) XRECORD (x, coding_system, Lisp_Coding_System)
-#define XSETCODING_SYSTEM(x, p) XSETRECORD (x, p, coding_system)
 #define wrap_coding_system(p) wrap_record (p, coding_system)
 #define CODING_SYSTEMP(x) RECORDP (x, coding_system)
 #define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system)
@@ -562,12 +561,15 @@
    error_check_##type##_coding_system_type (x)
 # define XSETCODING_SYSTEM_OF_TYPE(x, p, type)	do		\
 {								\
-  XSETCODING_SYSTEM (x, p);					\
-  assert (CODING_SYSTEM_TYPEP (XCODING_SYSTEM(x), type));	\
+  x = wrap_coding_system (p);					\
+  assert (CODING_SYSTEM_TYPEP (XCODING_SYSTEM (x), type));	\
 } while (0)
 #else
 # define XCODING_SYSTEM_OF_TYPE(x, type) XCODING_SYSTEM (x)
-# define XSETCODING_SYSTEM_OF_TYPE(x, p, type) XSETCODING_SYSTEM (x, p)
+# define XSETCODING_SYSTEM_OF_TYPE(x, p, type) do	\
+{							\
+  x = wrap_coding_system (p);				\
+} while (0)
 #endif /* ERROR_CHECK_TYPE_CHECK */
 
 #define CODING_SYSTEM_TYPEP(x, type)					  \
--- a/src/fileio.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/fileio.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2739,7 +2739,7 @@
   /* #### dmoore - should probably check in various places to see if
      curbuf was killed and if so signal an error? */
 
-  XSETBUFFER (curbuf, buf);
+  curbuf = wrap_buffer (buf);
 
   GCPRO5 (filename, val, visit, handler, curbuf);
 
@@ -3193,9 +3193,8 @@
   Charbpos start1, end1;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
   struct gcpro ngcpro1, ngcpro2;
-  Lisp_Object curbuf;
-
-  XSETBUFFER (curbuf, current_buffer);
+  Lisp_Object curbuf = wrap_buffer (current_buffer);
+
 
   /* start, end, visit, and append are never modified in this fun
      so we don't protect them. */
@@ -3498,9 +3497,8 @@
   Lisp_Object annotations;
   Lisp_Object p, res;
   struct gcpro gcpro1, gcpro2;
-  Lisp_Object original_buffer;
-
-  XSETBUFFER (original_buffer, current_buffer);
+  Lisp_Object original_buffer = wrap_buffer (current_buffer);
+
 
   annotations = Qnil;
   p = Vwrite_region_annotate_functions;
@@ -3860,7 +3858,7 @@
 auto_save_expand_name_error (Lisp_Object condition_object, Lisp_Object ignored)
 {
   warn_when_safe_lispobj
-    (Qfile, Qwarning,
+    (Qfile, Qerror,
      Fcons (build_msg_string ("Invalid auto-save list-file"),
 			  Fcons (Vauto_save_list_file_name,
 				 condition_object)));
@@ -3928,7 +3926,7 @@
   int speccount = specpdl_depth ();
   struct gcpro gcpro1, gcpro2, gcpro3;
 
-  XSETBUFFER (old, current_buffer);
+  old = wrap_buffer (current_buffer);
   GCPRO3 (oquit, listfile, old);
   check_quit (); /* make Vquit_flag accurate */
   /* Ordinarily don't quit within this function,
@@ -4103,7 +4101,7 @@
 	      }
 	      /* Handler killed our saved current-buffer!  Pick any. */
 	      if (!BUFFER_LIVE_P (XBUFFER (old)))
-		XSETBUFFER (old, current_buffer);
+		old = wrap_buffer (current_buffer);
 
 	      set_buffer_internal (XBUFFER (old));
 	      auto_saved++;
--- a/src/filelock.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/filelock.c	Fri Mar 29 04:49:13 2002 +0000
@@ -318,7 +318,7 @@
   if (inhibit_clash_detection)
     return;
 
-  XSETBUFFER (old_current_buffer, current_buffer);
+  old_current_buffer = wrap_buffer (current_buffer);
   subject_buf = Qnil;
   GCPRO3 (fn, subject_buf, old_current_buffer);
   orig_fn = fn;
--- a/src/fns.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/fns.c	Fri Mar 29 04:49:13 2002 +0000
@@ -278,14 +278,14 @@
        (string1, string2))
 {
   Bytecount len;
-  Lisp_String *p1, *p2;
+  Lisp_Object p1, p2;
 
   if (SYMBOLP (string1))
     p1 = XSYMBOL (string1)->name;
   else
     {
       CHECK_STRING (string1);
-      p1 = XSTRING (string1);
+      p1 = string1;
     }
 
   if (SYMBOLP (string2))
@@ -293,11 +293,11 @@
   else
     {
       CHECK_STRING (string2);
-      p2 = XSTRING (string2);
+      p2 = string2;
     }
 
-  return (((len = string_length (p1)) == string_length (p2)) &&
-	  !memcmp (string_data (p1), string_data (p2), len)) ? Qt : Qnil;
+  return (((len = XSTRING_LENGTH (p1)) == XSTRING_LENGTH (p2)) &&
+	  !memcmp (XSTRING_DATA (p1), XSTRING_DATA (p2), len)) ? Qt : Qnil;
 }
 
 DEFUN ("string-lessp", Fstring_lessp, 2, 2, 0, /*
@@ -315,16 +315,16 @@
 */
        (string1, string2))
 {
-  Lisp_String *p1, *p2;
+  Lisp_Object p1, p2;
   Charcount end, len2;
   int i;
 
   if (SYMBOLP (string1))
     p1 = XSYMBOL (string1)->name;
-  else
-    {
+  else   
+    { 
       CHECK_STRING (string1);
-      p1 = XSTRING (string1);
+      p1 = string1;
     }
 
   if (SYMBOLP (string2))
@@ -332,17 +332,17 @@
   else
     {
       CHECK_STRING (string2);
-      p2 = XSTRING (string2);
+      p2 = string2;
     }
 
-  end  = string_char_length (p1);
-  len2 = string_char_length (p2);
+  end  = XSTRING_CHAR_LENGTH (p1);
+  len2 = XSTRING_CHAR_LENGTH (p2);
   if (end > len2)
     end = len2;
 
   {
-    Intbyte *ptr1 = string_data (p1);
-    Intbyte *ptr2 = string_data (p2);
+    Intbyte *ptr1 = XSTRING_DATA (p1);
+    Intbyte *ptr2 = XSTRING_DATA (p2);
 
     /* #### It is not really necessary to do this: We could compare
        byte-by-byte and still get a reasonable comparison, since this
@@ -371,12 +371,9 @@
 */
        (string))
 {
-  Lisp_String *s;
-
   CHECK_STRING (string);
-  s = XSTRING (string);
-  if (CONSP (s->plist) && INTP (XCAR (s->plist)))
-    return XCAR (s->plist);
+  if (CONSP (XSTRING_PLIST (string)) && INTP (XCAR (XSTRING_PLIST (string))))
+    return XCAR (XSTRING_PLIST (string));
   else
     return Qzero;
 }
@@ -384,8 +381,7 @@
 void
 bump_string_modiff (Lisp_Object str)
 {
-  Lisp_String *s = XSTRING (str);
-  Lisp_Object *ptr = &s->plist;
+  Lisp_Object *ptr = &XSTRING_PLIST (str);
 
 #ifdef I18N3
   /* #### remove the `string-translatable' property from the string,
@@ -395,7 +391,7 @@
   if (CONSP (*ptr) && EXTENT_INFOP (XCAR (*ptr)))
     ptr = &XCDR (*ptr);
   if (CONSP (*ptr) && INTP (XCAR (*ptr)))
-    XSETINT (XCAR (*ptr), 1+XINT (XCAR (*ptr)));
+    XCAR (*ptr) = make_int (1+XINT (XCAR (*ptr)));
   else
     *ptr = Fcons (make_int (1), *ptr);
 }
@@ -891,8 +887,8 @@
   CHECK_INT (start);
   get_string_range_char (string, start, end, &ccstart, &ccend,
 			 GB_HISTORICAL_STRING_BEHAVIOR);
-  bstart = XSTRING_INDEX_CHAR_TO_BYTE (string, ccstart);
-  blen = XSTRING_OFFSET_CHAR_TO_BYTE_LEN (string, bstart, ccend - ccstart);
+  bstart = string_index_char_to_byte (string, ccstart);
+  blen = string_offset_char_to_byte_len (string, bstart, ccend - ccstart);
   val = make_string (XSTRING_DATA (string) + bstart, blen);
   /* Copy any applicable extent information into the new string. */
   copy_string_extents (val, string, 0, bstart, blen);
@@ -2133,6 +2129,10 @@
 	     list2 (build_msg_string
 		    ("Malformed property list -- list has been truncated"),
 		    *plist));
+	  /* #### WARNING: This is more dangerous than it seems; perhaps
+             not a good idea.  It also violates the principle of least
+             surprise -- passing in ERROR_ME_WARN causes truncation, but
+             ERROR_ME and ERROR_ME_NOT don't. */
 	  *badplace = Qnil;
 	}
       return Qunbound;
@@ -2160,6 +2160,10 @@
 	     list2 (build_msg_string
 		    ("Circular property list -- list has been truncated"),
 		    *plist));
+	  /* #### WARNING: This is more dangerous than it seems; perhaps
+             not a good idea.  It also violates the principle of least
+             surprise -- passing in ERROR_ME_WARN causes truncation, but
+             ERROR_ME and ERROR_ME_NOT don't. */
 	  *badplace = Qnil;
 	}
       return Qunbound;
@@ -2795,8 +2799,7 @@
  retry:
   if (STRINGP (array))
     {
-      Lisp_String *s = XSTRING (array);
-      Bytecount old_bytecount = string_length (s);
+      Bytecount old_bytecount = XSTRING_LENGTH (array);
       Bytecount new_bytecount;
       Bytecount item_bytecount;
       Intbyte item_buf[MAX_EMCHAR_LEN];
@@ -2808,20 +2811,20 @@
 
       sledgehammer_check_ascii_begin (array);
       item_bytecount = set_charptr_emchar (item_buf, XCHAR (item));
-      new_bytecount = item_bytecount * string_char_length (s);
-
-      resize_string (s, -1, new_bytecount - old_bytecount);
-
-      for (p = string_data (s), end = p + new_bytecount;
+      new_bytecount = item_bytecount * XSTRING_CHAR_LENGTH (array);
+
+      resize_string (array, -1, new_bytecount - old_bytecount);
+
+      for (p = XSTRING_DATA (array), end = p + new_bytecount;
 	   p < end;
 	   p += item_bytecount)
 	memcpy (p, item_buf, item_bytecount);
       *p = '\0';
 
-      set_string_ascii_begin (s,
-			      item_bytecount == 1 ?
-			      min (new_bytecount, MAX_STRING_ASCII_BEGIN) :
-			      0);
+      XSET_STRING_ASCII_BEGIN (array,
+			       item_bytecount == 1 ?
+			       min (new_bytecount, MAX_STRING_ASCII_BEGIN) :
+			       0);
       bump_string_modiff (array);
       sledgehammer_check_ascii_begin (array);
     }
--- a/src/frame-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/frame-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -175,7 +175,7 @@
 decode_gtk_frame (Lisp_Object frame)
 {
   if (NILP (frame))
-    XSETFRAME (frame, selected_frame ());
+    frame = wrap_frame (selected_frame ());
   CHECK_LIVE_FRAME (frame);
   /* this will also catch dead frames, but putting in the above check
      results in a more useful error */
@@ -384,7 +384,7 @@
 	      {
 		  Lisp_Object frm, font_spec;
 
-		  XSETFRAME (frm, f);
+		  frm = wrap_frame (f);
 		  font_spec = Fget (Fget_face (Qdefault), Qfont, Qnil);
 
 		  Fadd_spec_to_specifier (font_spec, val, frm, Qnil, Qnil);
@@ -455,14 +455,14 @@
       {
 	if (size_specified_p)
 	  {
-	    Lisp_Object frame;
-	    XSETFRAME (frame, f);
+	    Lisp_Object frame = wrap_frame (f);
+
 	    Fset_frame_size (frame, make_int (width), make_int (height), Qnil);
 	  }
 	if (position_specified_p)
 	  {
-	    Lisp_Object frame;
-	    XSETFRAME (frame, f);
+	    Lisp_Object frame = wrap_frame (f);
+
 	    Fset_frame_position (frame, make_int (x), make_int (y));
 	  }
       }
@@ -620,8 +620,8 @@
 
   if (FRAME_GTK_TEXT_WIDGET (f)->window)
     {
-      Lisp_Object frame;
-      XSETFRAME (frame, f);
+      Lisp_Object frame = wrap_frame (f);
+
       Fredraw_frame (frame, Qt);
     }
 
@@ -632,9 +632,8 @@
 delete_event_cb (GtkWidget *w, GdkEvent *ev, gpointer user_data)
 {
     struct frame *f = (struct frame *) user_data;
-    Lisp_Object frame;
+    Lisp_Object frame = wrap_frame (f);
 
-    XSETFRAME (frame, f);
     enqueue_misc_user_event (frame, Qeval, list3 (Qdelete_frame, frame, Qt));
 
     /* See if tickling the event queue helps us with our delays when
@@ -656,9 +655,8 @@
 cleanup_deleted_frame (gpointer data)
 {
   struct frame *f = (struct frame *) data;
-  Lisp_Object frame;
+  Lisp_Object frame = wrap_frame (f);
 
-  XSETFRAME (frame, f);
   Fdelete_frame (frame, Qt);
 }
 
@@ -1169,7 +1167,7 @@
 
     if (!f) return (0);
 
-    XSETFRAME (*frame, f);
+    *frame = wrap_frame (f);
 
     gdk_window_get_pointer (GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f)),
 			    &win_x, &win_y, NULL);
@@ -1314,7 +1312,7 @@
 {
   Lisp_Object frame = Qnil;
 
-  XSETFRAME(frame, frm);
+  frame = wrap_frame (frm);
 
   if (EQ (name, Qforeground))
    {
--- a/src/frame-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/frame-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -60,9 +60,10 @@
 #define POPUP_WIDTH 30
 #define POPUP_HEIGHT 10
 
-/* Default regular frame size, in characters */
+/* Default regular frame size, in characters; if too big, it will get
+   shrunk to the workspace size */
 #define DEFAULT_FRAME_WIDTH 80
-#define DEFAULT_FRAME_HEIGHT 35
+#define DEFAULT_FRAME_HEIGHT 50
 
 #ifdef HAVE_MENUBARS
 #define ADJR_MENUFLAG TRUE
@@ -196,7 +197,7 @@
 
   AdjustWindowRectEx (&rect, style, ADJR_MENUFLAG, exstyle);
 
-  XSETFRAME (frame_obj, f);
+  frame_obj = wrap_frame (f);
 
   Vmswindows_frame_being_created = frame_obj;
   {
@@ -599,7 +600,7 @@
 		{
 		  Lisp_Object frm, font_spec;
 
-		  XSETFRAME (frm, f);
+		  frm = wrap_frame (f);
 		  font_spec = Fget (Fget_face (Qdefault), Qfont, Qnil);
 
 		  Fadd_spec_to_specifier (font_spec, val, frm, Qnil, Qnil);
@@ -796,8 +797,8 @@
 static void
 error_frame_unsizable (struct frame *f)
 {
-  Lisp_Object frame;
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
+
   invalid_change ("Cannot resize frame (margins) after print job has started.",
 		  frame);
 }
--- a/src/frame-tty.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/frame-tty.c	Fri Mar 29 04:49:13 2002 +0000
@@ -72,9 +72,8 @@
 static void
 tty_schedule_frame_select (struct frame *f)
 {
-  Lisp_Object frame;
+  Lisp_Object frame = wrap_frame (f);
 
-  XSETFRAME (frame, f);
   enqueue_magic_eval_event (tty_select_frame_if_unhidden, frame);
 }
 
--- a/src/frame-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/frame-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -188,7 +188,7 @@
 decode_x_frame (Lisp_Object frame)
 {
   if (NILP (frame))
-    XSETFRAME (frame, selected_frame ());
+    frame = wrap_frame (selected_frame ());
   CHECK_LIVE_FRAME (frame);
   /* this will also catch dead frames, but putting in the above check
      results in a more useful error */
@@ -360,7 +360,7 @@
       make_argc_argv (Vcommand_line_args, &argc, &argv);
       XSetCommand (XtDisplay (w), XtWindow (w), argv, argc);
       free_argc_argv (argv);
-      XSETFRAME (DEVICE_X_WM_COMMAND_FRAME (d), f);
+      DEVICE_X_WM_COMMAND_FRAME (d) = wrap_frame (f);
     }
 }
 
@@ -436,7 +436,7 @@
 
 /* Connect the frame-property names (symbols) to the corresponding
    X Resource Manager names.  The name of a property, as a Lisp symbol,
-   has an `x-resource-name' property which is a Lisp_String. */
+   has an `x-resource-name' property which is a Lisp string. */
 
 static void
 init_x_prop_symbols (void)
@@ -802,7 +802,7 @@
 		    {
 		      Lisp_Object frm, font_spec;
 
-		      XSETFRAME (frm, f);
+		      frm = wrap_frame (f);
 		      font_spec = Fget (Fget_face (Qdefault), Qfont, Qnil);
 
 		      Fadd_spec_to_specifier (font_spec, val, frm, Qnil, Qnil);
@@ -933,15 +933,15 @@
       {
 	if (size_specified_p || internal_border_width_specified)
 	  {
-	    Lisp_Object frame;
-	    XSETFRAME (frame, f);
+	    Lisp_Object frame = wrap_frame (f);
+
 	    Fset_frame_size (frame, make_int (width),
 			      make_int (height), Qnil);
 	  }
 	if (position_specified_p)
 	  {
-	    Lisp_Object frame;
-	    XSETFRAME (frame, f);
+	    Lisp_Object frame = wrap_frame (f);
+
 	    Fset_frame_position (frame, make_int (x), make_int (y));
 	  }
       }
@@ -2417,7 +2417,7 @@
   f = x_any_window_to_frame (d, win);
   if (!f)
     return 0;
-  XSETFRAME (*frame, f);
+  *frame = wrap_frame (f);
 
   if (XTranslateCoordinates (display, win,
 			     XtWindow (FRAME_X_TEXT_WIDGET (f)),
@@ -2716,9 +2716,8 @@
 {
   Arg al[10];
   int ac = 0;
-  Lisp_Object frame;
-
-  XSETFRAME(frame, frm);
+  Lisp_Object frame = wrap_frame (frm);
+
 
   if (EQ (name, Qforeground))
    {
--- a/src/frame.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/frame.c	Fri Mar 29 04:49:13 2002 +0000
@@ -189,7 +189,7 @@
   struct frame *f = alloc_lcrecord_type (struct frame, &lrecord_frame);
 
   nuke_all_frame_slots (f);
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   f->device = device;
   f->framemeths = XDEVICE (device)->devmeths;
@@ -229,7 +229,7 @@
     buf = Fcurrent_buffer ();
     /* If buf is a 'hidden' buffer (i.e. one whose name starts with
        a space), try to find another one.  */
-    if (string_char (XSTRING (Fbuffer_name (buf)), 0) == ' ')
+    if (XSTRING_CHAR (Fbuffer_name (buf), 0) == ' ')
       buf = Fother_buffer (buf, Qnil, Qnil);
     Fset_window_buffer (root_window, buf, Qnil);
   }
@@ -241,9 +241,8 @@
 setup_normal_frame (struct frame *f)
 {
   Lisp_Object mini_window;
-  Lisp_Object frame;
-
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
+
 
   mini_window = allocate_window ();
   XWINDOW (f->root_window)->next = mini_window;
@@ -309,9 +308,8 @@
   /* This function can GC */
   /* First make a frame containing just a root window, no minibuffer.  */
   Lisp_Object mini_window;
-  Lisp_Object frame;
-
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
+
 
   f->no_split = 1;
   f->has_minibuffer = 1;
@@ -380,7 +378,7 @@
   int frame_name_is_defaulted = 1;
 
   d = decode_device (device);
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
 
   /* PROPS and NAME may be freshly-created, so make sure to GCPRO. */
   GCPRO3 (frame, props, name);
@@ -411,7 +409,7 @@
     syntax_error (". not allowed in frame names", name);
 
   f = allocate_frame_core (device);
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   specbind (Qframe_being_created, name);
   f->name = name;
@@ -646,8 +644,8 @@
 adjust_frame_size (struct frame *f)
 {
   int keep_char_size = 0;
-  Lisp_Object frame;
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
+
 
   if (!f->size_slipped)
     return;
@@ -812,8 +810,8 @@
   Lisp_Object frame = DEVICE_SELECTED_FRAME (d);
   if (NILP (frame))
     {
-      Lisp_Object device;
-      XSETDEVICE (device, d);
+      Lisp_Object device = wrap_device (d);
+
       gui_error ("No frames exist on device", device);
     }
   return XFRAME (frame);
@@ -904,7 +902,7 @@
 {
   Lisp_Object result;
 
-  XSETCONSOLE (console, decode_console (console));
+  console = wrap_console (decode_console (console));
   /* Just in case the machinations in delete_frame_internal() resulted
      in the last-nonminibuf-frame getting out of sync, make sure and
      return the selected frame if it's acceptable. */
@@ -959,7 +957,7 @@
 */
        (frame, window))
 {
-  XSETFRAME (frame, decode_frame (frame));
+  frame = wrap_frame (decode_frame (frame));
   CHECK_LIVE_WINDOW (window);
 
   if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
@@ -1230,7 +1228,7 @@
 */
        (frame, which_frames, which_devices))
 {
-  XSETFRAME (frame, decode_frame (frame));
+  frame = wrap_frame (decode_frame (frame));
 
   return next_frame (frame, which_frames, which_devices);
 }
@@ -1248,7 +1246,7 @@
 */
        (frame, which_frames, which_devices))
 {
-  XSETFRAME (frame, decode_frame (frame));
+  frame = wrap_frame (decode_frame (frame));
 
   return previous_frame (frame, which_frames, which_devices);
 }
@@ -1285,9 +1283,8 @@
 int
 other_visible_frames (struct frame *f)
 {
-  Lisp_Object frame;
-
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
+
   if (FRAME_STREAM_P (f))
     return !EQ (frame, next_frame (frame, Qt, Qt));
   return !EQ (frame, next_frame (frame, Qvisible_iconic_nomini, Qt));
@@ -1324,7 +1321,7 @@
   if (! FRAME_LIVE_P (f))
     return;
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   GCPRO1 (frame);
 
   device = FRAME_DEVICE (f);
@@ -1700,7 +1697,7 @@
   if (NILP (frame))
     {
       f = selected_frame ();
-      XSETFRAME (frame, f);
+      frame = wrap_frame (f);
     }
   else
     {
@@ -1766,13 +1763,13 @@
 	find_window_by_pixel_pos (intx, inty, XFRAME (frame)->root_window);
       if (w)
 	{
-	  XSETWINDOW (window, w);
+	  window = wrap_window (w);
 
 	  /* Adjust the position to be relative to the window. */
 	  intx -= w->pixel_left;
 	  inty -= w->pixel_top;
-	  XSETINT (x, intx);
-	  XSETINT (y, inty);
+	  x = make_int (intx);
+	  y = make_int (inty);
 	}
     }
   else if (FRAMEP (frame))
@@ -1814,7 +1811,7 @@
 	{
 	  lisp_x = make_int (x);
 	  lisp_y = make_int (y);
-	  XSETWINDOW (window, w);
+	  window = wrap_window (w);
 	}
     }
   else if (FRAMEP (frame))
@@ -2161,8 +2158,8 @@
 static void
 store_minibuf_frame_prop (struct frame *f, Lisp_Object val)
 {
-  Lisp_Object frame;
-  XSETFRAME (frame, f);
+  Lisp_Object frame = wrap_frame (f);
+
 
   if (WINDOWP (val))
     {
@@ -2204,7 +2201,7 @@
 			 Lisp_Object *face_prop_out)
 {
   Lisp_Object list = Vbuilt_in_face_specifiers;
-  Lisp_String *s;
+  Lisp_Object s;
 
   if (!SYMBOLP (sym))
     return 0;
@@ -2214,23 +2211,23 @@
   while (!NILP (list))
     {
       Lisp_Object prop = Fcar (list);
-      Lisp_String *prop_name;
+      Lisp_Object prop_name;
 
       if (!SYMBOLP (prop))
 	continue;
       prop_name = symbol_name (XSYMBOL (prop));
-      if (string_length (s) > string_length (prop_name) + 1
-	  && !memcmp (string_data (prop_name),
-		      string_data (s) + string_length (s)
-		      - string_length (prop_name),
-		      string_length (prop_name))
-	  && string_data (s)[string_length (s) - string_length (prop_name)
+      if (XSTRING_LENGTH (s) > XSTRING_LENGTH (prop_name) + 1
+	  && !memcmp (XSTRING_DATA (prop_name),
+		      XSTRING_DATA (s) + XSTRING_LENGTH (s)
+		      - XSTRING_LENGTH (prop_name),
+		      XSTRING_LENGTH (prop_name))
+	  && XSTRING_DATA (s)[XSTRING_LENGTH (s) - XSTRING_LENGTH (prop_name)
 			     - 1] == '-')
 	{
 	  Lisp_Object face =
-	    Ffind_face (make_string (string_data (s),
-				     string_length (s)
-				     - string_length (prop_name)
+	    Ffind_face (make_string (XSTRING_DATA (s),
+				     XSTRING_LENGTH (s)
+				     - XSTRING_LENGTH (prop_name)
 				     - 1));
 	  if (!NILP (face))
 	    {
@@ -2355,7 +2352,7 @@
   Lisp_Object *tailp;
   struct gcpro gcpro1, gcpro2;
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   GCPRO2 (frame, plist);
   Fcheck_valid_plist (plist);
   plist = Fcopy_sequence (plist);
@@ -2443,7 +2440,7 @@
   struct frame *f = decode_frame (frame);
   Lisp_Object value;
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   property = get_property_alias (property);
 
@@ -2522,7 +2519,7 @@
 
   GCPRO1 (result);
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   /* #### for the moment (since old code uses `frame-parameters'),
      we call `copy-sequence' on f->plist.  That allows frame-parameters
@@ -2635,7 +2632,7 @@
 {
   struct frame *f = decode_frame (frame);
   int height, width;
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   CHECK_INT (lines);
 
   if (window_system_pixelated_geometry (frame))
@@ -2662,7 +2659,7 @@
 {
   struct frame *f = decode_frame (frame);
   int width, height;
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   CHECK_INT (cols);
 
   if (window_system_pixelated_geometry (frame))
@@ -2689,7 +2686,7 @@
 {
   struct frame *f = decode_frame (frame);
   int height, width;
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   CHECK_INT (cols);
   CHECK_INT (rows);
 
@@ -2740,7 +2737,7 @@
   int obw, obh, bdr;
   Lisp_Object frame, window;
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   if (real_face)
     default_face_height_and_width (frame, &cph, &cpw);
   else
@@ -2871,7 +2868,7 @@
   if (in_display)
     abort ();
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   default_face_height_and_width (frame, &real_font_height, 0);
   default_face_height_and_width_1 (frame, &font_height, &font_width);
@@ -3170,7 +3167,7 @@
       Lisp_Object frame;
       Lisp_Object new_icon;
 
-      XSETFRAME (frame, f);
+      frame = wrap_frame (f);
       new_icon = glyph_image_instance (Vframe_icon_glyph, frame,
 				       ERROR_ME_WARN, 0);
       if (!EQ (new_icon, f->icon))
--- a/src/frame.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/frame.h	Fri Mar 29 04:49:13 2002 +0000
@@ -236,7 +236,6 @@
 
 DECLARE_LRECORD (frame, struct frame);
 #define XFRAME(x) XRECORD (x, frame, struct frame)
-#define XSETFRAME(x, p) XSETRECORD (x, p, frame)
 #define wrap_frame(p) wrap_record (p, frame)
 #define FRAMEP(x) RECORDP (x, frame)
 #define CHECK_FRAME(x) CHECK_RECORD (x, frame)
--- a/src/free-hook.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/free-hook.c	Fri Mar 29 04:49:13 2002 +0000
@@ -376,8 +376,8 @@
       memset (free_queue, 0, sizeof (free_queue_entry) * FREE_QUEUE_LIMIT);
       current_free = 0;
       __free_hook = check_free;
-      XSETINT (lisp_count[0], count[0]);
-      XSETINT (lisp_count[1], count[1]);
+      lisp_count[0] = make_int (count[0]);
+      lisp_count[1] = make_int (count[1]);
       return Fcons (lisp_count[0], lisp_count[1]);
     }
   else
--- a/src/general-slots.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/general-slots.h	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Commonly-used symbols -- include file
    Copyright (C) 1995 Sun Microsystems.
-   Copyright (C) 1995, 1996, 2000, 2001 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -91,6 +91,7 @@
 SYMBOL (Qcursor);
 SYMBOL (Qdata);
 SYMBOL (Qdead);
+SYMBOL (Qdebug);
 SYMBOL (Qdefault);
 SYMBOL (Qdelete);
 SYMBOL (Qdelq);
@@ -106,6 +107,7 @@
 SYMBOL (Qdocumentation);
 SYMBOL (Qduplex);
 SYMBOL (Qdynarr_overhead);
+SYMBOL (Qemergency);
 SYMBOL (Qempty);
 SYMBOL (Qeq);
 SYMBOL (Qeql);
--- a/src/glyphs-eimage.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/glyphs-eimage.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2,7 +2,7 @@
    Copyright (C) 1993, 1994, 1998 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Tinker Systems
-   Copyright (C) 1995, 1996, 2001 Ben Wing
+   Copyright (C) 1995, 1996, 2001, 2002 Ben Wing
    Copyright (C) 1995 Sun Microsystems
 
 This file is part of XEmacs.
@@ -997,7 +997,7 @@
     png_read_image (png_ptr, row_pointers);
     png_read_end (png_ptr, info_ptr);
 
-#ifdef PNG_SHOW_COMMENTS
+#if 1 /* def PNG_SHOW_COMMENTS */
     /* ####
      * I turn this off by default now, because the !%^@#!% comments
      * show up every time the image is instantiated, which can get
@@ -1005,6 +1005,8 @@
      * type of data down into the glyph code, where you can get to it
      * from lisp anyway. - WMP
      */
+    /* #### I've turned this on, since these warnings are now
+       unobtrusive. */
     {
       int i;
 
--- a/src/glyphs-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/glyphs-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1202,7 +1202,7 @@
       if (STRINGP (value))
 	value =
 	  Fmake_color_instance
-	  (value, device, encode_error_behavior_flag (ERROR_ME_NOT));
+	  (value, device, encode_error_behavior_flag (ERROR_ME_DEBUG_WARN));
       else
         {
           assert (COLOR_SPECIFIERP (value));
@@ -1343,8 +1343,8 @@
 
 	/* #### Gtk does not give us access to the hotspots of a pixmap */
 	xhot = yhot = 1;
-	XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), xhot);
-	XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), yhot);
+	IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (xhot);
+	IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (yhot);
 
 	check_pointer_sizes (w, h, instantiator);
 
@@ -2126,9 +2126,8 @@
   gtk_widget_show_all (IMAGE_INSTANCE_GTK_CLIPWIDGET (p));
   if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))
     {
-      Lisp_Object image_instance;
-
-      XSETIMAGE_INSTANCE (image_instance, p);
+      Lisp_Object image_instance = wrap_image_instance (p);
+
 
       /* Need to update GtkArgs that might have changed... */
       /* #### FIXME!!! */
--- a/src/glyphs-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/glyphs-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -388,8 +388,8 @@
   IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) =
     bmp_info->bmiHeader.biHeight;
   IMAGE_INSTANCE_PIXMAP_DEPTH (ii)   = bmp_info->bmiHeader.biBitCount;
-  XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), x_hot);
-  XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), y_hot);
+  IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (x_hot);
+  IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (y_hot);
   init_image_instance_geometry (ii);
 
   if (create_mask)
@@ -752,7 +752,7 @@
       if (STRINGP (value))
 	value =
 	  Fmake_color_instance
-	  (value, device, encode_error_behavior_flag (ERROR_ME_NOT));
+	  (value, device, encode_error_behavior_flag (ERROR_ME_DEBUG_WARN));
       else
         {
           assert (COLOR_SPECIFIERP (value));
@@ -1279,8 +1279,8 @@
       GetIconInfo ((HICON)himage, &iconinfo);
       IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = iconinfo.hbmColor;
       IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = iconinfo.hbmMask;
-      XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), iconinfo.xHotspot);
-      XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), iconinfo.yHotspot);
+      IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (iconinfo.xHotspot);
+      IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (iconinfo.yHotspot);
       IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = (HICON) himage;
     }
   else
@@ -1288,8 +1288,8 @@
       IMAGE_INSTANCE_MSWINDOWS_ICON (ii) = NULL;
       IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = (HBITMAP) himage;
       IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = NULL;
-      XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), 0);
-      XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), 0);
+      IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (0);
+      IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (0);
     }
 }
 
@@ -1470,8 +1470,8 @@
   IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii) = width;
   IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii) = height;
   IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1;
-  XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), 0);
-  XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), 0);
+  IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (0);
+  IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (0);
   init_image_instance_geometry (ii);
 
   IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = mask ? mask :
--- a/src/glyphs-widget.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/glyphs-widget.c	Fri Mar 29 04:49:13 2002 +0000
@@ -167,7 +167,7 @@
 	invalid_argument (":descriptor must be a string or a vector", data);
 }
 
-void
+static void
 check_valid_item_list (Lisp_Object items)
 {
   Lisp_Object rest;
--- a/src/glyphs-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/glyphs-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1143,7 +1143,7 @@
       if (STRINGP (value))
 	value =
 	  Fmake_color_instance
-	    (value, device, encode_error_behavior_flag (ERROR_ME_NOT));
+	    (value, device, encode_error_behavior_flag (ERROR_ME_DEBUG_WARN));
       else
         {
           assert (COLOR_SPECIFIERP (value));
@@ -1404,12 +1404,12 @@
 	if (xpmattrs.valuemask & XpmHotspot)
 	  {
 	    xhot = xpmattrs.x_hotspot;
-	    XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), xpmattrs.x_hotspot);
+	    IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = make_int (xpmattrs.x_hotspot);
 	  }
 	if (xpmattrs.valuemask & XpmHotspot)
 	  {
 	    yhot = xpmattrs.y_hotspot;
-	    XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), xpmattrs.y_hotspot);
+	    IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = make_int (xpmattrs.y_hotspot);
 	  }
 	check_pointer_sizes (xs, w, h, instantiator);
 
@@ -2107,9 +2107,8 @@
      need to update most other things after the items have changed.*/
   if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))
     {
-      Lisp_Object image_instance;
-
-      XSETIMAGE_INSTANCE (image_instance, p);
+      Lisp_Object image_instance = wrap_image_instance (p);
+
       wv = gui_items_to_widget_values
 	(image_instance, IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p),
 	 /* #### this is not right; we need to keep track of which widgets
@@ -2167,8 +2166,8 @@
       if (IMAGE_INSTANCE_X_WIDGET_ID (p)->core.being_destroyed
 	  || !XtIsManaged(IMAGE_INSTANCE_X_WIDGET_ID (p)))
 	{
-	  Lisp_Object sw;
-	  XSETIMAGE_INSTANCE (sw, p);
+	  Lisp_Object sw = wrap_image_instance (p);
+
 	  signal_error (Qinternal_error,
 			     "XEmacs bug: subwindow is deleted", sw);
 	}
--- a/src/glyphs.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/glyphs.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* Generic glyph/image implementation + display tables
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Tinker Systems
-   Copyright (C) 1995, 1996, 2000, 2001 Ben Wing
+   Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing
    Copyright (C) 1995 Sun Microsystems
    Copyright (C) 1998, 1999, 2000 Andy Piper
 
@@ -655,9 +655,8 @@
 void
 check_window_subwindow_cache (struct window* w)
 {
-  Lisp_Object window;
-
-  XSETWINDOW (window, w);
+  Lisp_Object window = wrap_window (w);
+
 
   assert (!NILP (w->subwindow_instance_cache));
   elisp_maphash (check_instance_cache_mapper,
@@ -1286,7 +1285,7 @@
   lp->layout_changed = 1;
   lp->initialized = 0;
 
-  XSETIMAGE_INSTANCE (val, lp);
+  val = wrap_image_instance (lp);
   MARK_GLYPHS_CHANGED;
 
   return val;
@@ -1418,6 +1417,7 @@
 {
   if (NILP (noerror))        return ERROR_ME;
   else if (EQ (noerror, Qt)) return ERROR_ME_NOT;
+  else if (EQ (noerror, Qdebug)) return ERROR_ME_DEBUG_WARN;
   else                       return ERROR_ME_WARN;
 }
 
@@ -1428,6 +1428,8 @@
     return Qnil;
   else if (ERRB_EQ (errb, ERROR_ME_NOT))
     return Qt;
+  else if (ERRB_EQ (errb, ERROR_ME_DEBUG_WARN))
+    return Qdebug;
   else
     {
       assert (ERRB_EQ (errb, ERROR_ME_WARN));
@@ -2116,9 +2118,10 @@
 
       if (GLYPHP (glyph_or_ii))
 	{
-	  Lisp_Object window;
-	  XSETWINDOW (window, w);
-	  image = glyph_image_instance (glyph_or_ii, window, ERROR_ME_NOT, 1);
+	  Lisp_Object window = wrap_window (w);
+
+	  image = glyph_image_instance (glyph_or_ii, window,
+					ERROR_ME_DEBUG_WARN, 1);
 	}
 
       if (TEXT_IMAGE_INSTANCEP (image))
@@ -3453,7 +3456,7 @@
       Lisp_Object contype = XCAR (rest);
       Lisp_Object newinst = call_with_suspended_errors
 	((lisp_fn_t) normalize_image_instantiator,
-	 Qnil, Qimage, ERROR_ME_NOT, 3, instantiator, contype,
+	 Qnil, Qimage, ERROR_ME_DEBUG_WARN, 3, instantiator, contype,
 	 make_int (XIMAGE_SPECIFIER_ALLOWED (specifier)));
 
       if (!NILP (newinst))
@@ -3749,7 +3752,7 @@
     g->face = Qnil;
     g->plist = Qnil;
     g->after_change = after_change;
-    XSETGLYPH (obj, g);
+    obj = wrap_glyph (g);
 
     set_image_attached_to (g->image, obj, Qimage);
     UNGCPRO;
@@ -3881,7 +3884,8 @@
   Lisp_Object instance = glyph_or_image;
 
   if (GLYPHP (glyph_or_image))
-    instance = glyph_image_instance (glyph_or_image, window, ERROR_ME_NOT, 1);
+    instance = glyph_image_instance (glyph_or_image, window,
+				     ERROR_ME_DEBUG_WARN, 1);
 
   return instance;
 }
@@ -3917,7 +3921,7 @@
 */
        (glyph, window))
 {
-  XSETWINDOW (window, decode_window (window));
+  window = wrap_window (decode_window (window));
   CHECK_GLYPH (glyph);
 
   return make_int (glyph_width (glyph, window));
@@ -3989,7 +3993,7 @@
 */
        (glyph, window))
 {
-  XSETWINDOW (window, decode_window (window));
+  window = wrap_window (decode_window (window));
   CHECK_GLYPH (glyph);
 
   return make_int (glyph_ascent (glyph, window));
@@ -4002,7 +4006,7 @@
 */
        (glyph, window))
 {
-  XSETWINDOW (window, decode_window (window));
+  window = wrap_window (decode_window (window));
   CHECK_GLYPH (glyph);
 
   return make_int (glyph_descent (glyph, window));
@@ -4016,7 +4020,7 @@
 */
        (glyph, window))
 {
-  XSETWINDOW (window, decode_window (window));
+  window = wrap_window (decode_window (window));
   CHECK_GLYPH (glyph);
 
   return make_int (glyph_height (glyph, window));
@@ -4032,7 +4036,7 @@
       if (GLYPHP (glyph_or_image))
 	{
 	  instance = glyph_image_instance (glyph_or_image, window,
-					   ERROR_ME_NOT, 1);
+					   ERROR_ME_DEBUG_WARN, 1);
 	  XGLYPH_DIRTYP (glyph_or_image) = dirty;
 	}
 
@@ -4070,8 +4074,8 @@
     {
       Lisp_Object retval =
 	specifier_instance_no_quit (GLYPH_BASELINE (XGLYPH (glyph)),
-				    /* #### look into ERROR_ME_NOT */
-				    Qunbound, domain, ERROR_ME_NOT,
+				    /* #### look into error flag */
+				    Qunbound, domain, ERROR_ME_DEBUG_WARN,
 				    0, Qzero);
       if (!NILP (retval) && !INTP (retval))
 	retval = Qnil;
@@ -4101,8 +4105,8 @@
   else
     return !NILP (specifier_instance_no_quit
 		  (GLYPH_CONTRIB_P (XGLYPH (glyph)), Qunbound, domain,
-		   /* #### look into ERROR_ME_NOT */
-		   ERROR_ME_NOT, 0, Qzero));
+		   /* #### look into error flag */
+		   ERROR_ME_DEBUG_WARN, 0, Qzero));
 }
 
 static void
@@ -4120,7 +4124,8 @@
   Lisp_Object instance = glyph_or_image;
 
   if (GLYPHP (glyph_or_image))
-    instance = glyph_image_instance (glyph_or_image, domain, ERROR_ME_NOT, 1);
+    instance = glyph_image_instance (glyph_or_image, domain,
+				     ERROR_ME_DEBUG_WARN, 1);
 
   image_instance_query_geometry (instance, width, height, disp, domain);
 }
@@ -4132,7 +4137,8 @@
   Lisp_Object instance = glyph_or_image;
 
   if (GLYPHP (glyph_or_image))
-    instance = glyph_image_instance (glyph_or_image, domain, ERROR_ME_NOT, 1);
+    instance = glyph_image_instance (glyph_or_image, domain,
+				     ERROR_ME_DEBUG_WARN, 1);
 
   image_instance_layout (instance, width, height, xoffset, yoffset, domain);
 }
@@ -4178,12 +4184,12 @@
     {
       Lisp_Object window, instance;
 
-      XSETWINDOW (window, w);
+      window = wrap_window (w);
 
       cachel->glyph   = glyph;
       /* Speed things up slightly by grabbing the glyph instantiation
 	 and passing it to the size functions. */
-      instance = glyph_image_instance (glyph, window, ERROR_ME_NOT, 1);
+      instance = glyph_image_instance (glyph, window, ERROR_ME_DEBUG_WARN, 1);
 
       if (!IMAGE_INSTANCEP (instance))
 	return;
@@ -4283,8 +4289,8 @@
 mark_glyph_cachels_as_clean (struct window* w)
 {
   int elt;
-  Lisp_Object window;
-  XSETWINDOW (window, w);
+  Lisp_Object window = wrap_window (w);
+
   for (elt = 0; elt < Dynarr_length (w->glyph_cachels); elt++)
     {
       struct glyph_cachel *cachel = Dynarr_atp (w->glyph_cachels, elt);
@@ -4312,7 +4318,7 @@
 
 
 /*****************************************************************************
- *                     subwindow cachel functions                         	     *
+ *                     subwindow cachel functions                     	     *
  *****************************************************************************/
 /* Subwindows are curious in that you have to physically unmap them to
    not display them. It is problematic deciding what to do in
@@ -4641,7 +4647,8 @@
 }
 
 /* remove a subwindow from its frame */
-void unmap_subwindow (Lisp_Object subwindow)
+void
+unmap_subwindow (Lisp_Object subwindow)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow);
   struct frame* f;
@@ -4671,8 +4678,9 @@
 }
 
 /* show a subwindow in its frame */
-void map_subwindow (Lisp_Object subwindow, int x, int y,
-		    struct display_glyph_area *dga)
+void
+map_subwindow (Lisp_Object subwindow, int x, int y,
+	       struct display_glyph_area *dga)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow);
   struct frame* f;
@@ -4907,9 +4915,9 @@
     }
 }
 
-/*****************************************************************************
- *                              timeouts for animated glyphs                      *
- *****************************************************************************/
+/****************************************************************************
+ *                        timeouts for animated glyphs                      *
+ ****************************************************************************/
 static Lisp_Object Qglyph_animated_timeout_handler;
 
 DEFUN ("glyph-animated-timeout-handler", Fglyph_animated_timeout_handler, 1, 1, 0, /*
@@ -4952,7 +4960,8 @@
   return Qnil;
 }
 
-Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object image)
+Lisp_Object
+add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object image)
 {
   Lisp_Object ret = Qnil;
 
@@ -4974,12 +4983,10 @@
   return ret;
 }
 
-void disable_glyph_animated_timeout (int i)
-{
-  Lisp_Object id;
-  XSETINT (id, i);
-
-  Fdisable_timeout (id);
+void
+disable_glyph_animated_timeout (int i)
+{
+  Fdisable_timeout (make_int (i));
 }
 
 
--- a/src/glyphs.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/glyphs.h	Fri Mar 29 04:49:13 2002 +0000
@@ -355,7 +355,6 @@
 void check_valid_int (Lisp_Object data);
 void check_valid_face (Lisp_Object data);
 void check_valid_vector (Lisp_Object data);
-void check_valid_item_list (Lisp_Object items);
 
 void initialize_subwindow_image_instance (Lisp_Image_Instance*);
 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
@@ -398,7 +397,6 @@
 
 DECLARE_SPECIFIER_TYPE (image);
 #define XIMAGE_SPECIFIER(x) XSPECIFIER_TYPE (x, image)
-#define XSETIMAGE_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, image)
 #define IMAGE_SPECIFIERP(x) SPECIFIER_TYPEP (x, image)
 #define CHECK_IMAGE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, image)
 #define CONCHECK_IMAGE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, image)
@@ -428,7 +426,6 @@
 
 DECLARE_LRECORD (image_instance, Lisp_Image_Instance);
 #define XIMAGE_INSTANCE(x) XRECORD (x, image_instance, Lisp_Image_Instance)
-#define XSETIMAGE_INSTANCE(x, p) XSETRECORD (x, p, image_instance)
 #define wrap_image_instance(p) wrap_record (p, image_instance)
 #define IMAGE_INSTANCEP(x) RECORDP (x, image_instance)
 #define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance)
@@ -938,7 +935,6 @@
 
 DECLARE_LRECORD (glyph, Lisp_Glyph);
 #define XGLYPH(x) XRECORD (x, glyph, Lisp_Glyph)
-#define XSETGLYPH(x, p) XSETRECORD (x, p, glyph)
 #define wrap_glyph(p) wrap_record (p, glyph)
 #define GLYPHP(x) RECORDP (x, glyph)
 #define CHECK_GLYPH(x) CHECK_RECORD (x, glyph)
--- a/src/gpmevent.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gpmevent.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,23 +1,24 @@
 /* GPM (General purpose mouse) functions
    Copyright (C) 1997 William M. Perry <wmperry@gnu.org>
    Copyright (C) 1999 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.  */
+   Copyright (C) 2002 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. */
 
@@ -25,15 +26,17 @@
 
 #include <config.h>
 #include "lisp.h"
+
+#include "commands.h"
+#include "console-tty.h"
 #include "console.h"
-#include "console-tty.h"
 #include "device.h"
 #include "events.h"
+#include "lstream.h"
+#include "process.h"
 #include "sysdep.h"
-#include "commands.h"
-#include "lstream.h"
+
 #include "sysproc.h" /* for MAXDESC */
-#include "process.h"
 
 #ifdef HAVE_GPM
 #include "gpmevent.h"
@@ -52,10 +55,11 @@
 static Lisp_Object gpm_event_queue;
 static Lisp_Object gpm_event_queue_tail;
 
-struct __gpm_state {
-	int gpm_tried;
-	int gpm_flag;
-	void *gpm_stack;
+struct __gpm_state
+{
+  int gpm_tried;
+  int gpm_flag;
+  void *gpm_stack;
 };
 
 static struct __gpm_state gpm_state_information[MAXDESC];
@@ -63,30 +67,28 @@
 static void
 store_gpm_state (int fd)
 {
-	gpm_state_information[fd].gpm_tried = gpm_tried;
-	gpm_state_information[fd].gpm_flag = gpm_flag;
-	gpm_state_information[fd].gpm_stack = gpm_stack;
+  gpm_state_information[fd].gpm_tried = gpm_tried;
+  gpm_state_information[fd].gpm_flag = gpm_flag;
+  gpm_state_information[fd].gpm_stack = gpm_stack;
 }
 
 static void
 restore_gpm_state (int fd)
 {
-	gpm_tried = gpm_state_information[fd].gpm_tried;
-	gpm_flag = gpm_state_information[fd].gpm_flag;
-	gpm_stack = gpm_state_information[fd].gpm_stack;
-	gpm_consolefd = gpm_fd = fd;
+  gpm_tried = gpm_state_information[fd].gpm_tried;
+  gpm_flag = gpm_state_information[fd].gpm_flag;
+  gpm_stack = gpm_state_information[fd].gpm_stack;
+  gpm_consolefd = gpm_fd = fd;
 }
 
 static void
 clear_gpm_state (int fd)
 {
-	if (fd >= 0)
-	{
-		memset(&gpm_state_information[fd], '\0', sizeof(struct __gpm_state));
-	}
-	gpm_tried = gpm_flag = 1;
-	gpm_fd = gpm_consolefd = -1;
-	gpm_stack = NULL;
+  if (fd >= 0)
+    memset (&gpm_state_information[fd], '\0', sizeof (struct __gpm_state));
+  gpm_tried = gpm_flag = 1;
+  gpm_fd = gpm_consolefd = -1;
+  gpm_stack = NULL;
 }
 
 static int
@@ -104,209 +106,199 @@
 */
        (process, string))
 {
-	Gpm_Event ev;
-	int modifiers = 0;
-	int button = 1;
-	Lisp_Object fake_event = Qnil;
-	Lisp_Event *event = NULL;
-	struct gcpro gcpro1;
-	static int num_events;
+  Gpm_Event ev;
+  int modifiers = 0;
+  int button = 1;
+  Lisp_Object fake_event = Qnil;
+  Lisp_Event *event = NULL;
+  struct gcpro gcpro1;
+  static int num_events;
 
-	CHECK_PROCESS (process);
-
-	restore_gpm_state (get_process_infd (XPROCESS (process)));
+  CHECK_PROCESS (process);
 
-	if (!Gpm_GetEvent(&ev))
-	{
-		warn_when_safe (Qnil, Qcritical, "Gpm_GetEvent failed - %d", gpm_fd);
-		return(Qzero);
-	}
+  restore_gpm_state (get_process_infd (XPROCESS (process)));
 
-	GCPRO1(fake_event);
+  if (!Gpm_GetEvent (&ev))
+    {
+      warn_when_safe (Qnil, Qerror,
+		      "Gpm_GetEvent failed - %d", gpm_fd);
+      return (Qzero);
+    }
 
-	num_events++;
-
-	fake_event = Fmake_event (Qnil, Qnil);
-	event = XEVENT(fake_event);
+  GCPRO1 (fake_event);
 
-	event->timestamp = 0;
-	event->channel   = Fselected_frame (Qnil); /* CONSOLE_SELECTED_FRAME (con); */
+  num_events++;
+
+  fake_event = Fmake_event (Qnil, Qnil);
+  event = XEVENT (fake_event);
 
-	/* Whow, wouldn't named defines be NICE!?!?! */
-	modifiers = 0;
+  event->timestamp = 0;
+  event->channel = Fselected_frame (Qnil); /* CONSOLE_SELECTED_FRAME (con); */
 
-	if (ev.modifiers & 1)   modifiers |= XEMACS_MOD_SHIFT;
-	if (ev.modifiers & 2)   modifiers |= XEMACS_MOD_META;
-	if (ev.modifiers & 4)   modifiers |= XEMACS_MOD_CONTROL;
-	if (ev.modifiers & 8)   modifiers |= XEMACS_MOD_META;
+  /* Whow, wouldn't named defines be NICE!?!?! */
+  modifiers = 0;
 
-	if (ev.buttons & GPM_B_LEFT)
-	{
-		button = 1;
-	}
-	else if (ev.buttons & GPM_B_MIDDLE)
-	{
-		button = 2;
-	}
-	else if (ev.buttons & GPM_B_RIGHT)
-	{
-		button = 3;
-	}
+  if (ev.modifiers & 1)   modifiers |= XEMACS_MOD_SHIFT;
+  if (ev.modifiers & 2)   modifiers |= XEMACS_MOD_META;
+  if (ev.modifiers & 4)   modifiers |= XEMACS_MOD_CONTROL;
+  if (ev.modifiers & 8)   modifiers |= XEMACS_MOD_META;
+
+  if (ev.buttons & GPM_B_LEFT)
+    button = 1;
+  else if (ev.buttons & GPM_B_MIDDLE)
+    button = 2;
+  else if (ev.buttons & GPM_B_RIGHT)
+    button = 3;
 
-	switch (GPM_BARE_EVENTS(ev.type)) {
-	case GPM_DOWN:
-	case GPM_UP:
-		event->event_type =
-			(ev.type & GPM_DOWN) ? button_press_event : button_release_event;
-		event->event.button.x         = ev.x;
-		event->event.button.y         = ev.y;
-		event->event.button.button    = button;
-		event->event.button.modifiers = modifiers;
-		break;
-	case GPM_MOVE:
-	case GPM_DRAG:
-		event->event_type             = pointer_motion_event;
-		event->event.motion.x         = ev.x;
-		event->event.motion.y         = ev.y;
-		event->event.motion.modifiers = modifiers;
-	default:
-		/* This will never happen */
-		break;
-	}
+  switch (GPM_BARE_EVENTS (ev.type))
+    {
+    case GPM_DOWN:
+    case GPM_UP:
+      event->event_type =
+	(ev.type & GPM_DOWN) ? button_press_event : button_release_event;
+      event->event.button.x         = ev.x;
+      event->event.button.y         = ev.y;
+      event->event.button.button    = button;
+      event->event.button.modifiers = modifiers;
+      break;
+    case GPM_MOVE:
+    case GPM_DRAG:
+      event->event_type             = pointer_motion_event;
+      event->event.motion.x         = ev.x;
+      event->event.motion.y         = ev.y;
+      event->event.motion.modifiers = modifiers;
+    default:
+      /* This will never happen */
+      break;
+    }
 
-	/* Handle the event */
-	enqueue_event (fake_event, &gpm_event_queue, &gpm_event_queue_tail);
+  /* Handle the event */
+  enqueue_event (fake_event, &gpm_event_queue, &gpm_event_queue_tail);
 
-	UNGCPRO;
+  UNGCPRO;
 
-	return (Qzero);
+  return (Qzero);
 }
 
 static void turn_off_gpm (char *process_name)
 {
-	Lisp_Object process = Fget_process (build_string (process_name));
-	int fd = -1;
+  Lisp_Object process = Fget_process (build_string (process_name));
+  int fd = -1;
 
-	if (NILP (process))
-	{
-		/* Something happened to our GPM process - fail silently */
-		return;
-	}
+  if (NILP (process))
+    /* Something happened to our GPM process - fail silently */
+    return;
 
-	fd = get_process_infd (XPROCESS (process));
+  fd = get_process_infd (XPROCESS (process));
 
-	restore_gpm_state (fd);
+  restore_gpm_state (fd);
 
-	Gpm_Close();
+  Gpm_Close();
 
-	clear_gpm_state (fd);
+  clear_gpm_state (fd);
 
-	Fdelete_process (build_string (process_name));
+  Fdelete_process (build_string (process_name));
 }
 
 #ifdef TIOCLINUX
 static Lisp_Object
-tty_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type)
+tty_get_foreign_selection (Lisp_Object selection_symbol,
+			   Lisp_Object target_type)
 {
-	/* This function can GC */
-	struct device *d = decode_device (Qnil);
-	int fd = DEVICE_INFD (d);
-	char c = 3;
-	Lisp_Object output_stream = Qnil;
-	Lisp_Object terminal_stream = Qnil ;
-	Lisp_Object output_string = Qnil;
-	struct gcpro gcpro1,gcpro2,gcpro3;
+  /* This function can GC */
+  struct device *d = decode_device (Qnil);
+  int fd = DEVICE_INFD (d);
+  char c = 3;
+  Lisp_Object output_stream = Qnil;
+  Lisp_Object terminal_stream = Qnil;
+  Lisp_Object output_string = Qnil;
+  struct gcpro gcpro1,gcpro2,gcpro3;
+
+  GCPRO3(output_stream,terminal_stream,output_string);
 
-	GCPRO3(output_stream,terminal_stream,output_string);
+  /* The ioctl() to paste actually puts things in the input queue of
+   ** the virtual console, so we need to trap that data, since we are
+   ** supposed to return the actual string selection from this
+   ** function.
+   */
 
-	/* The ioctl() to paste actually puts things in the input queue of
-	** the virtual console, so we need to trap that data, since we are
-	** supposed to return the actual string selection from this
-	** function.
-	*/
+  /* I really hate doing this, but it doesn't seem to cause any
+   ** problems, and it makes the Lstream_read stuff further down
+   ** error out correctly instead of trying to indefinitely read from
+   ** the console.
+   **
+   ** There is no set_descriptor_blocking() function call, but in my
+   ** testing under linux, it has not proved fatal to leave the
+   ** descriptor in non-blocking mode.
+   **
+   ** William Perry Nov 5, 1999
+   */
+  set_descriptor_non_blocking (fd);
 
-	/* I really hate doing this, but it doesn't seem to cause any
-	** problems, and it makes the Lstream_read stuff further down
-	** error out correctly instead of trying to indefinitely read from
-	** the console.
-	**
-	** There is no set_descriptor_blocking() function call, but in my
-	** testing under linux, it has not proved fatal to leave the
-	** descriptor in non-blocking mode.
-	**
-	** William Perry Nov 5, 1999
-	*/
-	set_descriptor_non_blocking (fd);
+  /* We need two streams, one for reading from the selected device,
+   ** and one to write the data into.  There is no writable version
+   ** of the lisp-string lstream, so we make do with a resizing
+   ** buffer stream, and make a string out of it after we are
+   ** done.
+   */
+  output_stream = make_resizing_buffer_output_stream ();
+  terminal_stream = make_filedesc_input_stream (fd, 0, -1, LSTR_BLOCKED_OK);
+  output_string = Qnil;
+
+  /* #### We should arguably use a specbind() and an unwind routine here,
+   ** #### but I don't care that much right now.
+   */
+  if (NILP (output_stream) || NILP (terminal_stream))
+    /* Should we signal an error here? */
+    goto out;
 
-	/* We need two streams, one for reading from the selected device,
-	** and one to write the data into.  There is no writable version
-	** of the lisp-string lstream, so we make do with a resizing
-	** buffer stream, and make a string out of it after we are
-	** done.
-	*/
-	output_stream = make_resizing_buffer_output_stream ();
-	terminal_stream = make_filedesc_input_stream (fd, 0, -1, LSTR_BLOCKED_OK);
-	output_string = Qnil;
+  if (ioctl (fd, TIOCLINUX, &c) < 0)
+    {
+      /* Could not get the selection - eek */
+      UNGCPRO;
+      return (Qnil);
+    }
 
-	/* #### We should arguably use a specbind() and an unwind routine here,
-	** #### but I don't care that much right now.
-	*/
-	if (NILP (output_stream) || NILP (terminal_stream))
+  while (1)
+    {
+      Intbyte tempbuf[1024];	/* some random amount */
+      Bytecount i;
+      Bytecount size_in_bytes =
+	Lstream_read (XLSTREAM (terminal_stream),
+		      tempbuf, sizeof (tempbuf));
+
+      if (size_in_bytes <= 0)
+	/* end of the stream */
+	break;
+
+      /* convert CR->LF */
+      for (i = 0; i < size_in_bytes; i++)
 	{
-		/* Should we signal an error here? */
-		goto out;
+	  if (tempbuf[i] == '\r')
+	    tempbuf[i] = '\n';
 	}
 
-	if (ioctl (fd, TIOCLINUX, &c) < 0)
-	{
-		/* Could not get the selection - eek */
-		UNGCPRO;
-		return (Qnil);
-	}
+      Lstream_write (XLSTREAM (output_stream), tempbuf, size_in_bytes);
+    }
 
-	while (1)
-	{
-		Intbyte tempbuf[1024]; /* some random amount */
-		Bytecount i;
-		Bytecount size_in_bytes =
-		  Lstream_read (XLSTREAM (terminal_stream),
-				tempbuf, sizeof (tempbuf));
+  Lstream_flush (XLSTREAM (output_stream));
 
-		if (size_in_bytes <= 0)
-		{
-			/* end of the stream */
-			break;
-		}
+  output_string =
+    make_string (resizing_buffer_stream_ptr (XLSTREAM (output_stream)),
+		 Lstream_byte_count (XLSTREAM (output_stream)));
 
-		/* convert CR->LF */
-		for (i = 0; i < size_in_bytes; i++)
-		{
-			if (tempbuf[i] == '\r')
-			{
-				tempbuf[i] = '\n';
-			}
-		}
-
-		Lstream_write (XLSTREAM (output_stream), tempbuf, size_in_bytes);
-	}
-
-	Lstream_flush (XLSTREAM (output_stream));
-
-	output_string = make_string (resizing_buffer_stream_ptr (XLSTREAM (output_stream)),
-								 Lstream_byte_count (XLSTREAM (output_stream)));
-
-	Lstream_delete (XLSTREAM (output_stream));
-	Lstream_delete (XLSTREAM (terminal_stream));
+  Lstream_delete (XLSTREAM (output_stream));
+  Lstream_delete (XLSTREAM (terminal_stream));
 
  out:
-	UNGCPRO;
-	return (output_string);
+  UNGCPRO;
+  return (output_string);
 }
 
 static Lisp_Object
 tty_selection_exists_p (Lisp_Object selection, Lisp_Object selection_type)
 {
-	return (Qt);
+  return (Qt);
 }
 #endif /* TIOCLINUX */
 
@@ -315,330 +307,317 @@
 tty_own_selection (Lisp_Object selection_name, Lisp_Object selection_value,
 		   Lisp_Object how_to_add, Lisp_Object selection_type)
 {
-	/* There is no way to do this cleanly - the GPM selection
-	** 'protocol' (actually the TIOCLINUX ioctl) requires a start and
-	** end position on the _screen_, not a string to stick in there.
-	** Lame.
-	**
-	** William Perry Nov 4, 1999
-	*/
+  /* There is no way to do this cleanly - the GPM selection
+   ** 'protocol' (actually the TIOCLINUX ioctl) requires a start and
+   ** end position on the _screen_, not a string to stick in there.
+   ** Lame.
+   **
+   ** William Perry Nov 4, 1999
+   */
 }
 #endif
 
 /* This function appears to work once in a blue moon.  I'm not sure
-** exactly why either.  *sigh*
-**
-** William Perry Nov 4, 1999
-**
-** Apparently, this is the way (mouse-position) is supposed to work,
-** and I was just expecting something else.  (mouse-pixel-position)
-** works just fine.
-**
-** William Perry Nov 7, 1999
-*/
+ ** exactly why either.  *sigh*
+ **
+ ** William Perry Nov 4, 1999
+ **
+ ** Apparently, this is the way (mouse-position) is supposed to work,
+ ** and I was just expecting something else.  (mouse-pixel-position)
+ ** works just fine.
+ **
+ ** William Perry Nov 7, 1999
+ */
 static int
 tty_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y)
 {
-	Gpm_Event ev;
-	int num_buttons;
+  Gpm_Event ev;
+  int num_buttons;
 
-	memset(&ev,'\0',sizeof(ev));
+  memset(&ev,'\0',sizeof(ev));
 
-	num_buttons = Gpm_GetSnapshot(&ev);
+  num_buttons = Gpm_GetSnapshot(&ev);
 
-	if (!num_buttons)
-	{
-		/* This means there are events pending... */
+  if (!num_buttons)
+    /* This means there are events pending... */
 
-		/* #### In theory, we should drain the events pending, stick
-		** #### them in the queue, and return the mouse position
-		** #### anyway.
-		*/
-		return(-1);
-	}
-	*x = ev.x;
-	*y = ev.y;
-	*frame = DEVICE_SELECTED_FRAME (d);
-	return (1);
+    /* #### In theory, we should drain the events pending, stick
+     ** #### them in the queue, and return the mouse position
+     ** #### anyway.
+     */
+    return (-1);
+  *x = ev.x;
+  *y = ev.y;
+  *frame = DEVICE_SELECTED_FRAME (d);
+  return (1);
 }
 
 static void
 tty_set_mouse_position (struct window *w, int x, int y)
 {
-	/*
-	   #### I couldn't find any GPM functions that set the mouse position.
-	   #### Mr. Perry had left this function empty; that must be why.
-	   #### karlheg
-	*/
+  /*
+     #### I couldn't find any GPM functions that set the mouse position.
+     #### Mr. Perry had left this function empty; that must be why.
+     #### karlheg
+     */
 }
 
 static int gpm_event_pending_p (int user_p)
 {
-	Lisp_Object event;
+  Lisp_Object event;
 
-	EVENT_CHAIN_LOOP (event, gpm_event_queue)
-	{
-		if (!user_p || command_event_p (event))
-		{
-			return (1);
-		}
-	}
-	return (orig_event_pending_p (user_p));
+  EVENT_CHAIN_LOOP (event, gpm_event_queue)
+    {
+      if (!user_p || command_event_p (event))
+	return (1);
+    }
+  return (orig_event_pending_p (user_p));
 }
 
 static void gpm_next_event_cb (Lisp_Event *event)
 {
-	/* #### It would be nice to preserve some sort of ordering of the
-	** #### different types of events, but that would be quite a bit
-	** #### of work, and would more than likely break the abstraction
-	** #### between the other event loops and this one.
-	*/
+  /* #### It would be nice to preserve some sort of ordering of the
+   ** #### different types of events, but that would be quite a bit
+   ** #### of work, and would more than likely break the abstraction
+   ** #### between the other event loops and this one.
+   */
 
-	if (!NILP (gpm_event_queue))
+  if (!NILP (gpm_event_queue))
+    {
+      Lisp_Object queued_event =
+	dequeue_event (&gpm_event_queue, &gpm_event_queue_tail);
+      *event = *(XEVENT (queued_event));
+
+      if (event->event_type == pointer_motion_event)
 	{
-		Lisp_Object queued_event = dequeue_event (&gpm_event_queue, &gpm_event_queue_tail);
-		*event = *(XEVENT (queued_event));
-
-		if (event->event_type == pointer_motion_event)
-		{
-			struct device *d = decode_device (event->channel);
-			int fd = DEVICE_INFD (d);
+	  struct device *d = decode_device (event->channel);
+	  int fd = DEVICE_INFD (d);
 
-			/* Ok, now this is just freaky.  Bear with me though.
-			**
-			** If you run gnuclient and attach to a XEmacs running in
-			** X or on another TTY, the mouse cursor does not get
-			** drawn correctly.  This is because the ioctl() fails
-			** with EPERM because the TTY specified is not our
-			** controlling terminal.  If you are the superuser, it
-			** will work just spiffy.  The appropriate source file (at
-			** least in linux 2.2.x) is
-			** .../linux/drivers/char/console.c in the function
-			** tioclinux().  The following bit of code is brutal to
-			** us:
-			**
-			** if (current->tty != tty && !suser())
-			**    return -EPERM;
-			**
-			** I even tried setting us as a process leader, removing
-			** our controlling terminal, and then using the TIOCSCTTY
-			** to set up a new controlling terminal, all with no luck.
-			**
-			** What is even weirder is if you run XEmacs in a VC, and
-			** attach to it from another VC with gnuclient, go back to
-			** the original VC and hit a key, the mouse pointer
-			** displays (in BOTH VCs), until you hit a key in the
-			** second VC, after which it does not display in EITHER
-			** VC.  Bizarre, no?
-			**
-			** All I can say is thank god Linux comes with source code
-			** or I would have been completely confused.  Well, ok,
-			** I'm still completely confused.  I don't see why they
-			** don't just check the permissions on the device
-			** (actually, if you have enough access to it to get the
-			** console's file descriptor, you should be able to do
-			** with it as you wish, but maybe that is just me).
-			**
-			** William M. Perry - Nov 9, 1999
-			*/
+	  /* Ok, now this is just freaky.  Bear with me though.
+	   **
+	   ** If you run gnuclient and attach to a XEmacs running in
+	   ** X or on another TTY, the mouse cursor does not get
+	   ** drawn correctly.  This is because the ioctl() fails
+	   ** with EPERM because the TTY specified is not our
+	   ** controlling terminal.  If you are the superuser, it
+	   ** will work just spiffy.  The appropriate source file (at
+	   ** least in linux 2.2.x) is
+	   ** .../linux/drivers/char/console.c in the function
+	   ** tioclinux().  The following bit of code is brutal to
+	   ** us:
+	   **
+	   ** if (current->tty != tty && !suser())
+	   **    return -EPERM;
+	   **
+	   ** I even tried setting us as a process leader, removing
+	   ** our controlling terminal, and then using the TIOCSCTTY
+	   ** to set up a new controlling terminal, all with no luck.
+	   **
+	   ** What is even weirder is if you run XEmacs in a VC, and
+	   ** attach to it from another VC with gnuclient, go back to
+	   ** the original VC and hit a key, the mouse pointer
+	   ** displays (in BOTH VCs), until you hit a key in the
+	   ** second VC, after which it does not display in EITHER
+	   ** VC.  Bizarre, no?
+	   **
+	   ** All I can say is thank god Linux comes with source code
+	   ** or I would have been completely confused.  Well, ok,
+	   ** I'm still completely confused.  I don't see why they
+	   ** don't just check the permissions on the device
+	   ** (actually, if you have enough access to it to get the
+	   ** console's file descriptor, you should be able to do
+	   ** with it as you wish, but maybe that is just me).
+	   **
+	   ** William M. Perry - Nov 9, 1999
+	   */
 
-			Gpm_DrawPointer (event->event.motion.x,event->event.motion.y, fd);
-		}
-
-		return;
+	  Gpm_DrawPointer (event->event.motion.x,event->event.motion.y, fd);
 	}
 
-	orig_next_event_cb (event);
+      return;
+    }
+
+  orig_next_event_cb (event);
 }
 
 static void hook_event_callbacks_once (void)
 {
-	static int hooker;
+  static int hooker;
 
-	if (!hooker)
-	{
-		orig_event_pending_p = event_stream->event_pending_p;
-		orig_next_event_cb = event_stream->next_event_cb;
-		event_stream->event_pending_p = gpm_event_pending_p;
-		event_stream->next_event_cb = gpm_next_event_cb;
-		hooker = 1;
-	}
+  if (!hooker)
+    {
+      orig_event_pending_p = event_stream->event_pending_p;
+      orig_next_event_cb = event_stream->next_event_cb;
+      event_stream->event_pending_p = gpm_event_pending_p;
+      event_stream->next_event_cb = gpm_next_event_cb;
+      hooker = 1;
+    }
 }
 
 static void hook_console_methods_once (void)
 {
-	static int hooker;
+  static int hooker;
 
-	if (!hooker)
-	{
-		/* Install the mouse position methods for the TTY console type */
-		CONSOLE_HAS_METHOD (tty, get_mouse_position);
-		CONSOLE_HAS_METHOD (tty, set_mouse_position);
-		CONSOLE_HAS_METHOD (tty, get_foreign_selection);
-		CONSOLE_HAS_METHOD (tty, selection_exists_p);
+  if (!hooker)
+    {
+      /* Install the mouse position methods for the TTY console type */
+      CONSOLE_HAS_METHOD (tty, get_mouse_position);
+      CONSOLE_HAS_METHOD (tty, set_mouse_position);
+      CONSOLE_HAS_METHOD (tty, get_foreign_selection);
+      CONSOLE_HAS_METHOD (tty, selection_exists_p);
 #if 0
-		CONSOLE_HAS_METHOD (tty, own_selection);
+      CONSOLE_HAS_METHOD (tty, own_selection);
 #endif
-	}
+    }
 }
 
 DEFUN ("gpm-enabled-p", Fgpm_enabled_p, 0, 1, 0, /*
 Return non-nil if GPM mouse support is currently enabled on DEVICE.
 */
-	   (device))
+       (device))
 {
-	char *console_name = ttyname (DEVICE_INFD (decode_device (device)));
-	char process_name[1024];
-	Lisp_Object proc;
+  char *console_name = ttyname (DEVICE_INFD (decode_device (device)));
+  char process_name[1024];
+  Lisp_Object proc;
 
-	if (!console_name)
-	{
-		return (Qnil);
-	}
+  if (!console_name)
+    return (Qnil);
 
-	memset (process_name, '\0', sizeof(process_name));
-	snprintf (process_name, sizeof(process_name) - 1, "gpm for %s", console_name);
+  memset (process_name, '\0', sizeof(process_name));
+  snprintf (process_name, sizeof(process_name) - 1, "gpm for %s",
+	    console_name);
 
-	proc = Fget_process (build_string (process_name));
+  proc = Fget_process (build_string (process_name));
 
-	if (NILP (proc))
-	{
-		return (Qnil);
-	}
+  if (NILP (proc))
+    return (Qnil);
 
-	if (1) /* (PROCESS_LIVE_P (proc)) */
-	{
-		return (Qt);
-	}
-	return (Qnil);
+  if (1)			/* (PROCESS_LIVE_P (proc)) */
+    return (Qt);
+  return (Qnil);
 }
 
 DEFUN ("gpm-enable", Fgpm_enable, 0, 2, 0, /*
 Toggle accepting of GPM mouse events.
 */
-	   (device, arg))
+       (device, arg))
 {
-	Gpm_Connect conn;
-	int rval;
-	Lisp_Object gpm_process;
-	Lisp_Object gpm_filter;
-	struct device *d = decode_device (device);
-	int fd = DEVICE_INFD (d);
-	char *console_name = ttyname (fd);
-	char process_name[1024];
+  Gpm_Connect conn;
+  int rval;
+  Lisp_Object gpm_process;
+  Lisp_Object gpm_filter;
+  struct device *d = decode_device (device);
+  int fd = DEVICE_INFD (d);
+  char *console_name = ttyname (fd);
+  char process_name[1024];
 
-	hook_event_callbacks_once ();
-	hook_console_methods_once ();
+  hook_event_callbacks_once ();
+  hook_console_methods_once ();
+
+  if (noninteractive)
+    invalid_operation ("Can't connect to GPM in batch mode", Qunbound);
 
-	if (noninteractive)
-	{
-	 invalid_operation ("Can't connect to GPM in batch mode.", Qunbound);
-	}
+  if (!console_name)
+    /* Something seriously wrong here... */
+    return (Qnil);
+
+  memset (process_name, '\0', sizeof(process_name));
+  snprintf (process_name, sizeof(process_name) - 1, "gpm for %s",
+	    console_name);
 
-	if (!console_name)
-	{
-		/* Something seriously wrong here... */
-		return (Qnil);
-	}
-
-	memset (process_name, '\0', sizeof(process_name));
-	snprintf (process_name, sizeof(process_name) - 1, "gpm for %s", console_name);
+  if (NILP (arg))
+    {
+      turn_off_gpm (process_name);
+      return (Qnil);
+    }
 
-	if (NILP (arg))
-	{
-		turn_off_gpm (process_name);
-		return (Qnil);
-	}
+  /* DANGER DANGER.
+   ** Though shalt not call (gpm-enable t) after we have already
+   ** started, or stuff blows up.
+   */
+  if (!NILP (Fgpm_enabled_p (device)))
+    invalid_operation ("GPM already enabled for this console", Qunbound);
 
-	/* DANGER DANGER.
-	** Though shalt not call (gpm-enable t) after we have already
-	** started, or stuff blows up.
-	*/
-	if (!NILP (Fgpm_enabled_p (device)))
-	{
-	 invalid_operation ("GPM already enabled for this console.", Qunbound);
-	}
+  conn.eventMask = GPM_DOWN|GPM_UP|GPM_MOVE|GPM_DRAG;
+  conn.defaultMask = GPM_MOVE;
+  conn.minMod = 0;
+  conn.maxMod = ((1 << KG_SHIFT) | (1 << KG_ALT) | (1 << KG_CTRL));
 
-	conn.eventMask = GPM_DOWN|GPM_UP|GPM_MOVE|GPM_DRAG;
-	conn.defaultMask = GPM_MOVE;
-	conn.minMod = 0;
-	conn.maxMod = ((1<<KG_SHIFT)|(1<<KG_ALT)|(1<<KG_CTRL));
+  /* Reset some silly static variables so that multiple Gpm_Open()
+   ** calls have even a slight chance of working
+   */
+  gpm_tried = 0;
+  gpm_flag = 0;
+  gpm_stack = NULL;
 
-	/* Reset some silly static variables so that multiple Gpm_Open()
-	** calls have even a slight chance of working
-	*/
-	gpm_tried = 0;
-	gpm_flag = 0;
-	gpm_stack = NULL;
-
-	/* Make sure Gpm_Open() does ioctl() on the correct
-	** descriptor, or it can get the wrong terminal sizes, etc.
-	*/
-	gpm_consolefd = fd;
+  /* Make sure Gpm_Open() does ioctl() on the correct
+   ** descriptor, or it can get the wrong terminal sizes, etc.
+   */
+  gpm_consolefd = fd;
 
-	/* We have to pass the virtual console manually, otherwise if you
-	** use 'gnuclient -nw' to connect to an XEmacs that is running in
-	** X, Gpm_Open() tries to use ttyname(0 | 1 | 2) to find out which
-	** console you are using, which is of course not correct for the
-	** new tty device.
-	*/
-	if (strncmp (console_name, "/dev/tty",8) || !isdigit (console_name[8]))
-	{
-		/* Urk, something really wrong */
-		return (Qnil);
-	}
+  /* We have to pass the virtual console manually, otherwise if you
+   ** use 'gnuclient -nw' to connect to an XEmacs that is running in
+   ** X, Gpm_Open() tries to use ttyname(0 | 1 | 2) to find out which
+   ** console you are using, which is of course not correct for the
+   ** new tty device.
+   */
+  if (strncmp (console_name, "/dev/tty", 8) || !isdigit (console_name[8]))
+    /* Urk, something really wrong */
+    return (Qnil);
 
-	rval = Gpm_Open (&conn, atoi(console_name + 8));
+  rval = Gpm_Open (&conn, atoi (console_name + 8));
 
-	switch (rval) {
-	case -1: /* General failure */
-		break;
-	case -2: /* We are running under an XTerm */
-		Gpm_Close();
-		break;
-	default:
-		/* Is this really necessary? */
-		set_descriptor_non_blocking (gpm_fd);
-		store_gpm_state (gpm_fd);
-		gpm_process = connect_to_file_descriptor (build_string (process_name), Qnil,
-												  make_int (gpm_fd),
-												  make_int (gpm_fd));
+  switch (rval)
+    {
+    case -1:			/* General failure */
+      break;
+    case -2:			/* We are running under an XTerm */
+      Gpm_Close();
+      break;
+    default:
+      /* Is this really necessary? */
+      set_descriptor_non_blocking (gpm_fd);
+      store_gpm_state (gpm_fd);
+      gpm_process =
+	connect_to_file_descriptor (build_string (process_name), Qnil,
+				    make_int (gpm_fd),
+				    make_int (gpm_fd));
 
-		if (!NILP (gpm_process))
-		{
-			rval = 0;
-			Fprocess_kill_without_query (gpm_process, Qnil);
-			XSETSUBR (gpm_filter, &SFreceive_gpm_event);
-			set_process_filter (gpm_process, gpm_filter, 1);
+      if (!NILP (gpm_process))
+	{
+	  rval = 0;
+	  Fprocess_kill_without_query (gpm_process, Qnil);
+	  gpm_filter = wrap_subr (&SFreceive_gpm_event);
+	  set_process_filter (gpm_process, gpm_filter, 1);
 
-			/* Keep track of the device for later */
-			/* Fput (gpm_process, intern ("gpm-device"), device); */
-		}
-		else
-		{
-			Gpm_Close();
-			rval = -1;
-		}
+	  /* Keep track of the device for later */
+	  /* Fput (gpm_process, intern ("gpm-device"), device); */
 	}
+      else
+	{
+	  Gpm_Close ();
+	  rval = -1;
+	}
+    }
 
-	return(rval ? Qnil : Qt);
+  return (rval ? Qnil : Qt);
 }
 
 void vars_of_gpmevent (void)
 {
-	gpm_event_queue = Qnil;
-	gpm_event_queue_tail = Qnil;
-	staticpro (&gpm_event_queue);
-	staticpro (&gpm_event_queue_tail);
-	dump_add_root_object (&gpm_event_queue);
-	dump_add_root_object (&gpm_event_queue_tail);
+  gpm_event_queue = Qnil;
+  gpm_event_queue_tail = Qnil;
+  staticpro (&gpm_event_queue);
+  staticpro (&gpm_event_queue_tail);
+  dump_add_root_object (&gpm_event_queue);
+  dump_add_root_object (&gpm_event_queue_tail);
 }
 
 void syms_of_gpmevent (void)
 {
-	DEFSUBR (Freceive_gpm_event);
-	DEFSUBR (Fgpm_enable);
-	DEFSUBR (Fgpm_enabled_p);
+  DEFSUBR (Freceive_gpm_event);
+  DEFSUBR (Fgpm_enable);
+  DEFSUBR (Fgpm_enabled_p);
 }
 
 #endif /* HAVE_GPM */
--- a/src/gtk-xemacs.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gtk-xemacs.c	Fri Mar 29 04:49:13 2002 +0000
@@ -185,7 +185,7 @@
   int hsize, vsize;
   GtkRangeClass *klass;
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   klass = (GtkRangeClass *) gtk_type_class (GTK_TYPE_SCROLLBAR);
   slider_size = klass->slider_width;
@@ -209,7 +209,7 @@
   Lisp_Object frame;
   GtkStyleClass *klass = (GtkStyleClass *) style->klass;
 
-  XSETFRAME (frame,f);
+  frame = wrap_frame (f);
 
   Fadd_spec_to_specifier (Vtoolbar_shadow_thickness, make_int (klass->xthickness),
 			  Qnil, list2 (Qgtk, Qdefault), Qprepend);
--- a/src/gui-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gui-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -46,7 +46,7 @@
   /* Try to map the command id through the proper hash table */
   Lisp_Object callback, callback_ex, image_instance, frame, event;
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   /* #### make_int should assert that --kkm */
   assert (XINT (make_int (id)) == id);
--- a/src/gui-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gui-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* General GUI code -- X-specific. (menubars, scrollbars, toolbars, dialogs)
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2000, 2001 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
    Copyright (C) 1998 Free Software Foundation, Inc.
 
@@ -113,7 +113,7 @@
   pdata->id = id;
   pdata->last_menubar_buffer = Qnil;
   pdata->menubar_contents_up_to_date = 0;
-  XSETPOPUP_DATA (lpdata, pdata);
+  lpdata = wrap_popup_data (pdata);
   Vpopup_callbacks = Fcons (Fcons (lid, lpdata), Vpopup_callbacks);
 }
 
@@ -228,7 +228,7 @@
   if (((EMACS_INT) client_data) == 0)
     return;
   VOID_TO_LISP (data, client_data);
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
 #if 0
   /* #### What the hell?  I can't understand why this call is here,
@@ -476,13 +476,14 @@
     }
   else if (SYMBOLP (pgui->callback))	/* Show the binding of this command. */
     {
-      char buf[1024]; /* #### */
+      DECLARE_EISTRING_MALLOC (buf);
       /* #### Warning, dependency here on current_buffer and point */
       where_is_to_char (pgui->callback, buf);
-      if (buf [0])
-	C_STRING_TO_EXTERNAL_MALLOC (buf, wv->key, Qlwlib_encoding);
+      if (eilen (buf) > 0)
+	C_STRING_TO_EXTERNAL_MALLOC (eidata (buf), wv->key, Qlwlib_encoding);
       else
 	wv->key = 0;
+      eifree (buf);
     }
 
   CHECK_SYMBOL (pgui->style);
--- a/src/gui-x.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gui-x.h	Fri Mar 29 04:49:13 2002 +0000
@@ -60,7 +60,6 @@
 
 DECLARE_LRECORD (popup_data, struct popup_data);
 #define XPOPUP_DATA(x) XRECORD (x, popup_data, struct popup_data)
-#define XSETPOPUP_DATA(x, p) XSETRECORD (x, p, popup_data)
 #define wrap_popup_data(p) wrap_record (p, popup_data)
 #define POPUP_DATAP(x) RECORDP (x, popup_data)
 #define CHECK_POPUP_DATA(x) CHECK_RECORD (x, popup_data)
--- a/src/gui.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gui.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Generic GUI code. (menubars, scrollbars, toolbars, dialogs)
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2000, 2001 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
    Copyright (C) 1998 Free Software Foundation, Inc.
 
@@ -23,8 +23,7 @@
 
 /* Synched up with: Not in FSF. */
 
-/* This file not quite Mule-ized yet but will be when merged with my
-   Mule workspace. --ben */
+/* This file Mule-ized by Ben Wing, 3-24-02. */
 
 #include <config.h>
 #include "lisp.h"
@@ -133,13 +132,13 @@
 	  pgui_item->name   = val;
 	}
     }
-#define FROB(slot) \
+#define FROB(slot)				\
   else if (EQ (key, Q_##slot))			\
   {						\
-    if (!EQ (pgui_item->slot, val))			\
+    if (!EQ (pgui_item->slot, val))		\
       {						\
 	retval = 1;				\
-	pgui_item->slot   = val;			\
+	pgui_item->slot   = val;		\
       }						\
   }
   FROB (suffix)
@@ -168,8 +167,7 @@
 	}
     }
   else if (ERRB_EQ (errb, ERROR_ME))
-    invalid_argument_2 ("Unknown keyword in gui item", key,
-			   pgui_item->name);
+    invalid_argument_2 ("Unknown keyword in gui item", key, pgui_item->name);
   return retval;
 }
 
@@ -200,7 +198,7 @@
   Lisp_Object val;
 
   zero_lcrecord (lp);
-  XSETGUI_ITEM (val, lp);
+  val = wrap_gui_item (lp);
 
   gui_item_init (val);
 
@@ -263,7 +261,7 @@
       if ((length - start) & 1)
 	sferror (
 		"GUI item descriptor has an odd number of keywords and values",
-			     item);
+		 item);
 
       for (i = start; i < length;)
 	{
@@ -332,7 +330,7 @@
     {
       Lisp_Object key = contents [i++];
       Lisp_Object val = contents [i++];
-      if (gui_item_add_keyval_pair (gui_item, key, val, ERROR_ME_NOT))
+      if (gui_item_add_keyval_pair (gui_item, key, val, ERROR_ME_DEBUG_WARN))
 	retval = 1;
     }
   return retval;
@@ -347,7 +345,7 @@
 Lisp_Object
 gui_parse_item_keywords_no_errors (Lisp_Object item)
 {
-  return make_gui_item_from_keywords_internal (item, ERROR_ME_NOT);
+  return make_gui_item_from_keywords_internal (item, ERROR_ME_DEBUG_WARN);
 }
 
 /* convert a gui item into plist properties */
@@ -536,10 +534,13 @@
   /* See if we can derive keys out of callback symbol */
   if (SYMBOLP (pgui_item->callback))
     {
-      char buf2[1024]; /* #### */
-
-      where_is_to_char (pgui_item->callback, buf2);
-      return build_string (buf2);
+      DECLARE_EISTRING_MALLOC (buf);
+      Lisp_Object str;
+      
+      where_is_to_char (pgui_item->callback, buf);
+      str = eimake_string (buf);
+      eifree (buf);
+      return str;
     }
 
   /* No keys - no right flush display */
@@ -651,14 +652,11 @@
 print_gui_item (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
   Lisp_Gui_Item *g = XGUI_ITEM (obj);
-  char buf[20];
 
   if (print_readably)
     printing_unreadable_object ("#<gui-item 0x%x>", g->header.uid);
 
-  write_c_string ("#<gui-item ", printcharfun);
-  sprintf (buf, "0x%x>", g->header.uid);
-  write_c_string (buf, printcharfun);
+  write_fmt_string (printcharfun, "#<gui-item 0x%x>", g->header.uid);
 }
 
 Lisp_Object
@@ -767,7 +765,7 @@
 }
 
 static void
-finalize_gui_item (void* header, int for_disksave)
+finalize_gui_item (void *header, int for_disksave)
 {
 }
 
@@ -780,13 +778,13 @@
 
 
 DOESNT_RETURN
-gui_error (const char *reason, Lisp_Object frob)
+gui_error (const Char_ASCII *reason, Lisp_Object frob)
 {
   signal_error (Qgui_error, reason, frob);
 }
 
 DOESNT_RETURN
-gui_error_2 (const char *reason, Lisp_Object frob0, Lisp_Object frob1)
+gui_error_2 (const Char_ASCII *reason, Lisp_Object frob0, Lisp_Object frob1)
 {
   signal_error_2 (Qgui_error, reason, frob0, frob1);
 }
--- a/src/gui.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gui.h	Fri Mar 29 04:49:13 2002 +0000
@@ -62,7 +62,6 @@
 
 DECLARE_LRECORD (gui_item, Lisp_Gui_Item);
 #define XGUI_ITEM(x) XRECORD (x, gui_item, Lisp_Gui_Item)
-#define XSETGUI_ITEM(x, p) XSETRECORD (x, p, gui_item)
 #define wrap_gui_item(p) wrap_record (p, gui_item)
 #define GUI_ITEMP(x) RECORDP (x, gui_item)
 #define CHECK_GUI_ITEM(x) CHECK_RECORD (x, gui_item)
--- a/src/gutter.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gutter.c	Fri Mar 29 04:49:13 2002 +0000
@@ -400,7 +400,7 @@
   cdla = f->current_display_lines[pos];
   cdla_len = Dynarr_length (cdla);
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   get_gutter_coords (f, pos, &x, &y, &width, &height);
   /* generate some display lines */
--- a/src/gutter.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/gutter.h	Fri Mar 29 04:49:13 2002 +0000
@@ -29,7 +29,6 @@
 
 DECLARE_SPECIFIER_TYPE (gutter);
 #define XGUTTER_SPECIFIER(x) XSPECIFIER_TYPE (x, gutter)
-#define XSETGUTTER_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, gutter)
 #define GUTTER_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter)
 #define CHECK_GUTTER_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, gutter)
 #define CONCHECK_GUTTER_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, gutter)
--- a/src/indent.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/indent.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 /* Indentation functions.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995
+   Copyright (C) 2002 Ben Wing.
    Free Software Foundation, Inc.
 
 This file is part of XEmacs.
@@ -69,7 +70,7 @@
   Lisp_Object buffer;
   Lisp_Object value;
 
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
   value = Fprevious_single_property_change (make_int (pos), Qinvisible,
 					    buffer, Qnil);
   if (NILP (value))
@@ -195,7 +196,7 @@
 }
 
 int
-string_column_at_point (Lisp_String* s, Charbpos init_pos, int tab_width)
+string_column_at_point (Lisp_Object s, Charbpos init_pos, int tab_width)
 {
   int col;
   int tab_seen;
@@ -212,7 +213,7 @@
 	break;
 
       pos--;
-      c = string_char (s, pos);
+      c = XSTRING_CHAR (s, pos);
       if (c == '\t')
 	{
 	  if (tab_seen)
@@ -291,7 +292,7 @@
   else
     CHECK_INT (minimum);
 
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
 
   fromcol = current_column (buf);
   mincol = fromcol + XINT (minimum);
@@ -371,7 +372,7 @@
   struct buffer *buf = decode_buffer (buffer, 0);
   Charbpos pos = find_next_newline (buf, BUF_PT (buf), -1);
 
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
 
   if (!NILP (Fextent_at (make_int (pos), buffer, Qinvisible, Qnil, Qnil)))
     return Qzero;
@@ -411,7 +412,7 @@
   int prev_col = 0;
   Emchar c = 0;
 
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
   if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
   CHECK_NATNUM (column);
   goal = XINT (column);
@@ -569,10 +570,10 @@
 			XINT (XCAR (topos)),
 			XINT (width), hscroll, tab_offset, w);
 
-  XSETINT (charbpos, pos->charbpos);
-  XSETINT (hpos, pos->hpos);
-  XSETINT (vpos, pos->vpos);
-  XSETINT (prevhpos, pos->prevhpos);
+  charbpos = make_int (pos->charbpos);
+  hpos = make_int (pos->hpos);
+  vpos = make_int (pos->vpos);
+  prevhpos = make_int (pos->prevhpos);
 
   return list5 (charbpos, hpos, vpos, prevhpos,
 		pos->contin ? Qt : Qnil);
--- a/src/input-method-xlib.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/input-method-xlib.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,5 +1,6 @@
 /* Various functions for X11R5+ input methods, using the Xlib interface.
    Copyright (C) 1996 Sun Microsystems.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -219,7 +220,9 @@
   DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class);
   if (xim == NULL)
     {
-      xintl_warn ("XOpenIM() failed...no input server available\n");
+      warn_when_safe
+	(Qxintl, Qerror,
+	 "Can't initialize XIM: XOpenIM() failed, no input server available");
       return;
     }
   else
@@ -309,7 +312,9 @@
 			     NULL, 0);
   if (!xic_vars.fontset)
     {
-      xintl_warn ("Can't get fontset resource for Input Method\n");
+      warn_when_safe
+	(Qxintl, Qerror,
+	 "Can't initialize XIM: Can't get fontset resource for Input Method");
       FRAME_X_XIC (f) = NULL;
       return;
     }
@@ -347,7 +352,8 @@
 
   if (!xic)
     {
-      xintl_warn ("Warning: XCreateIC failed.\n");
+      warn_when_safe (Qxintl, Qerror,
+		      "Can't initialize XIM: XCreateIC failed");
       return;
     }
 
@@ -363,8 +369,8 @@
 
 #ifdef HAVE_XREGISTERIMINSTANTIATECALLBACK
   /* when frame is going to be destroyed (closed) */
-  XtAddCallback (FRAME_X_TEXT_WIDGET(f), XNDestroyCallback,
-		 XIM_delete_frame, (XtPointer)f);
+  XtAddCallback (FRAME_X_TEXT_WIDGET (f), XNDestroyCallback,
+		 XIM_delete_frame, (XtPointer)f );
 #endif
 }
 
--- a/src/insdel.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/insdel.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2,7 +2,7 @@
    Copyright (C) 1985, 1986, 1991, 1992, 1993, 1994, 1995
    Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -667,7 +667,7 @@
       buf->text->changes->mc_orig_end = buf->text->changes->mc_new_end = end;
       buf->text->changes->mc_begin_signaled = 0;
       count = specpdl_depth ();
-      XSETBUFFER (buffer, buf);
+      buffer = wrap_buffer (buf);
       record_unwind_protect (multiple_change_finish_up, buffer);
     }
   buf->text->changes->in_multiple_change++;
@@ -714,8 +714,8 @@
 signal_first_change (struct buffer *buf)
 {
   /* This function can GC */
-  Lisp_Object buffer;
-  XSETBUFFER (buffer, current_buffer);
+  Lisp_Object buffer = wrap_buffer (current_buffer);
+
 
   if (!in_first_change)
     {
@@ -788,7 +788,7 @@
 
       MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
 	{
-	  XSETBUFFER (buffer, mbuf);
+	  buffer = wrap_buffer (mbuf);
 	  if (!NILP (symbol_value_in_buffer (Qbefore_change_functions, buffer))
 	      /* Obsolete, for compatibility */
 	      || !NILP (symbol_value_in_buffer (Qbefore_change_function, buffer)))
@@ -811,7 +811,7 @@
 
       MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
 	{
-	  XSETBUFFER (buffer, mbuf);
+	  buffer = wrap_buffer (mbuf);
 	  report_extent_modification (buffer, start, end, 0);
 	}
       unbind_to (speccount);
@@ -869,7 +869,7 @@
       inside_change_hook = 1;
       MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
 	{
-	  XSETBUFFER (buffer, mbuf);
+	  buffer = wrap_buffer (mbuf);
 
 	  if (!NILP (symbol_value_in_buffer (Qafter_change_functions, buffer))
 	      /* Obsolete, for compatibility */
@@ -899,7 +899,7 @@
 
       MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
 	{
-	  XSETBUFFER (buffer, mbuf);
+	  buffer = wrap_buffer (mbuf);
 	  report_extent_modification (buffer, start, new_end, 1);
 	}
       unbind_to (speccount); /* sets inside_change_hook back to 0 */
@@ -930,7 +930,7 @@
 
   /* if this is the first modification, see about locking the buffer's
      file */
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
   GCPRO1 (buffer);
   if (!NILP (buf->filename) && lockit &&
       BUF_SAVE_MODIFF (buf) >= BUF_MODIFF (buf))
@@ -1085,7 +1085,7 @@
   /* string may have been relocated up to this point */
   if (STRINGP (reloc))
     {
-      cclen = XSTRING_OFFSET_BYTE_TO_CHAR_LEN (reloc, offset, length);
+      cclen = string_offset_byte_to_char_len (reloc, offset, length);
       nonreloc = XSTRING_DATA (reloc);
     }
   else
@@ -1669,7 +1669,7 @@
   Lisp_Object buffer;
   Lisp_Object iro;
 
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
  back:
   iro = (buf == current_buffer ? Vinhibit_read_only :
 	 symbol_value_in_buffer (Qinhibit_read_only, buffer));
--- a/src/keymap.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/keymap.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2,7 +2,7 @@
    Copyright (C) 1985, 1991-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
    Totally redesigned by jwz in 1991.
 
 This file is part of XEmacs.
@@ -478,10 +478,10 @@
   k = XKEYMAP (keymap);
 
   /* If the keysym is a one-character symbol, use the char code instead. */
-  if (SYMBOLP (keysym) && string_char_length (XSYMBOL (keysym)->name) == 1)
+  if (SYMBOLP (keysym) && XSTRING_CHAR_LENGTH (XSYMBOL (keysym)->name) == 1)
     {
       Lisp_Object i_fart_on_gcc =
-	make_char (string_char (XSYMBOL (keysym)->name, 0));
+	make_char (XSTRING_CHAR (XSYMBOL (keysym)->name, 0));
       keysym = i_fart_on_gcc;
     }
 
@@ -656,8 +656,8 @@
 			 | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) == 0);
 
   /* If the keysym is a one-character symbol, use the char code instead. */
-  if (SYMBOLP (keysym) && string_char_length (XSYMBOL (keysym)->name) == 1)
-    keysym = make_char (string_char (XSYMBOL (keysym)->name, 0));
+  if (SYMBOLP (keysym) && XSTRING_CHAR_LENGTH (XSYMBOL (keysym)->name) == 1)
+    keysym = make_char (XSTRING_CHAR (XSYMBOL (keysym)->name, 0));
 
   if (modifiers & XEMACS_MOD_META)     /* Utterly hateful ESC lossage */
     {
@@ -759,7 +759,7 @@
   Lisp_Object result;
   Lisp_Keymap *keymap = alloc_lcrecord_type (Lisp_Keymap, &lrecord_keymap);
 
-  XSETKEYMAP (result, keymap);
+  result = wrap_keymap (keymap);
 
   keymap->parents         = Qnil;
   keymap->prompt          = Qnil;
@@ -1264,10 +1264,10 @@
   /* Now, check and massage the trailing keysym specifier. */
   if (SYMBOLP (*keysym))
     {
-      if (string_char_length (XSYMBOL (*keysym)->name) == 1)
+      if (XSTRING_CHAR_LENGTH (XSYMBOL (*keysym)->name) == 1)
 	{
 	  Lisp_Object ream_gcc_up_the_ass =
-	    make_char (string_char (XSYMBOL (*keysym)->name, 0));
+	    make_char (XSTRING_CHAR (XSYMBOL (*keysym)->name, 0));
 	  *keysym = ream_gcc_up_the_ass;
 	  goto fixnum_keysym;
 	}
@@ -1294,7 +1294,7 @@
 
   if (SYMBOLP (*keysym))
     {
-      char *name = (char *) string_data (XSYMBOL (*keysym)->name);
+      Intbyte *name = XSTRING_DATA (XSYMBOL (*keysym)->name);
 
       /* FSFmacs uses symbols with the printed representation of keysyms in
 	 their names, like 'M-x, and we use the syntax '(meta x).  So, to avoid
@@ -1310,7 +1310,7 @@
 	 sanitize the Sun keyboards, and would make it trickier to
 	 conditionalize a .emacs file for multiple X servers.
 	 */
-      if (((int) strlen (name) >= 2 && name[1] == '-')
+      if (((int) qxestrlen (name) >= 2 && name[1] == '-')
 #if 1
           ||
 	  /* Ok, this is a bit more dubious - prevent people from doing things
@@ -1318,14 +1318,14 @@
 	     same problem as above.  (Gag!)  Maybe we should just silently
 	     accept these as aliases for the "real" names?
 	     */
-	  (string_length (XSYMBOL (*keysym)->name) <= 3 &&
-	   (!strcmp (name, "LFD") ||
-	    !strcmp (name, "TAB") ||
-	    !strcmp (name, "RET") ||
-	    !strcmp (name, "ESC") ||
-	    !strcmp (name, "DEL") ||
-	    !strcmp (name, "SPC") ||
-	    !strcmp (name, "BS")))
+	  (XSTRING_LENGTH (XSYMBOL (*keysym)->name) <= 3 &&
+	   (!qxestrcmp_c (name, "LFD") ||
+	    !qxestrcmp_c (name, "TAB") ||
+	    !qxestrcmp_c (name, "RET") ||
+	    !qxestrcmp_c (name, "ESC") ||
+	    !qxestrcmp_c (name, "DEL") ||
+	    !qxestrcmp_c (name, "SPC") ||
+	    !qxestrcmp_c (name, "BS")))
 #endif /* unused */
           )
 	invalid_argument
@@ -1337,17 +1337,15 @@
 	 otherwise have the same problem as above.  (Gag!)  We silently
 	 accept these as aliases for the "real" names.
 	 */
-      else if (!strncmp(name, "kp_", 3)) {
-	/* Likewise, the obsolete keysym binding of kp_.* should not lose. */
-	char temp[50];
-
-	strncpy(temp, name, sizeof (temp));
-	temp[sizeof (temp) - 1] = '\0';
-	temp[2] = '-';
-	*keysym = Fintern_soft(make_string((Intbyte *)temp,
-					   strlen(temp)),
-			       Qnil);
-      } else if (EQ (*keysym, QLFD))
+      else if (!qxestrncmp_c (name, "kp_", 3))
+	{
+	  /* Likewise, the obsolete keysym binding of kp_.* should not lose. */
+	  DECLARE_EISTRING (temp);
+	  eicpy_raw (temp, name, qxestrlen (name));
+	  eisetch_char (temp, 2, '-');
+	  *keysym = Fintern_soft (eimake_string (temp), Qnil);
+	}
+      else if (EQ (*keysym, QLFD))
 	*keysym = QKlinefeed;
       else if (EQ (*keysym, QTAB))
 	*keysym = QKtab;
@@ -1525,7 +1523,7 @@
 	fn = Qcall_interactively;
       else
 	fn = Qeval;
-      XSETFRAME (XEVENT (event)->channel, selected_frame ());
+      XEVENT (event)->channel = wrap_frame (selected_frame ());
       XEVENT (event)->event_type = misc_user_event;
       XEVENT (event)->event.eval.function = fn;
       XEVENT (event)->event.eval.object = arg;
@@ -1904,7 +1902,7 @@
       struct key_data raw_key2;
 
       if (STRINGP (keys))
-	c = make_char (string_char (XSTRING (keys), idx));
+	c = make_char (XSTRING_CHAR (keys, idx));
       else
 	c = XVECTOR_DATA (keys) [idx];
 
@@ -2230,7 +2228,7 @@
 
       for (i = 0; i < length; i++)
 	{
-          Emchar n = string_char (XSTRING (keys), i);
+          Emchar n = XSTRING_CHAR (keys, i);
 	  define_key_parser (make_char (n), &(raw_keys[i]));
 	}
       return raw_lookup_key (keymap, raw_keys, length, 0,
@@ -2331,8 +2329,8 @@
            || (XEVENT (terminal)->event_type != button_press_event
                && XEVENT (terminal)->event_type != button_release_event))
     {
-      Lisp_Object tem;
-      XSETBUFFER (tem, current_buffer);
+      Lisp_Object tem = wrap_buffer (current_buffer);
+
       /* It's not a mouse event; order of keymaps searched is:
 	 o  keymap of any/all extents under the mouse
 	 o  minor-mode maps
@@ -2502,8 +2500,7 @@
 	  Lisp_Object val = symbol_value_in_buffer (sym, buffer);
 	  if (!NILP (val) && !UNBOUNDP (val))
 	    {
-	      Lisp_Object map = get_keymap (XCDR (assoc), 0, 1);
-	      return map;
+	      return get_keymap (XCDR (assoc), 0, 1);
 	    }
 	}
     }
@@ -2928,9 +2925,9 @@
 
   /* otherwise, string-sort them. */
   {
-    char *s1 = (char *) string_data (XSYMBOL (obj1)->name);
-    char *s2 = (char *) string_data (XSYMBOL (obj2)->name);
-    return 0 > strcmp  (s1, s2) ? 1 : -1;
+    Intbyte *s1 = XSTRING_DATA (XSYMBOL (obj1)->name);
+    Intbyte *s2 = XSTRING_DATA (XSYMBOL (obj2)->name);
+    return 0 > qxestrcmp (s1, s2) ? 1 : -1;
   }
 }
 
@@ -3246,7 +3243,7 @@
 	{
 	  Lisp_Object s2 = Fsingle_key_description
 	    (STRINGP (keys)
-	     ? make_char (string_char (XSTRING (keys), i))
+	     ? make_char (XSTRING_CHAR (keys, i))
 	     : XVECTOR_DATA (keys)[i]);
 
 	  if (i == 0)
@@ -3275,7 +3272,9 @@
 
   if (EVENTP (key) || CHAR_OR_CHAR_INTP (key))
     {
-      char buf [255];
+      DECLARE_EISTRING_MALLOC (buf);
+      Lisp_Object str;
+      
       if (!EVENTP (key))
 	{
 	  Lisp_Event event;
@@ -3287,51 +3286,47 @@
 	}
       else
 	format_event_object (buf, XEVENT (key), 1);
-      return build_string (buf);
+      str = eimake_string (buf);
+      eifree (buf);
+      return str;
     }
 
   if (CONSP (key))
     {
-      char buf[255];
-      char *bufp = buf;
+      DECLARE_EISTRING (bufp);
+
       Lisp_Object rest;
-      buf[0] = 0;
       LIST_LOOP (rest, key)
 	{
 	  Lisp_Object keysym = XCAR (rest);
-	  if (EQ (keysym, Qcontrol))    strcpy (bufp, "C-"), bufp += 2;
-	  else if (EQ (keysym, Qctrl))  strcpy (bufp, "C-"), bufp += 2;
-	  else if (EQ (keysym, Qmeta))  strcpy (bufp, "M-"), bufp += 2;
-	  else if (EQ (keysym, Qsuper)) strcpy (bufp, "S-"), bufp += 2;
-	  else if (EQ (keysym, Qhyper)) strcpy (bufp, "H-"), bufp += 2;
-	  else if (EQ (keysym, Qalt))	strcpy (bufp, "A-"), bufp += 2;
-	  else if (EQ (keysym, Qshift)) strcpy (bufp, "Sh-"), bufp += 3;
+	  if (EQ (keysym, Qcontrol))    eicat_c (bufp, "C-");
+	  else if (EQ (keysym, Qctrl))  eicat_c (bufp, "C-");
+	  else if (EQ (keysym, Qmeta))  eicat_c (bufp, "M-");
+	  else if (EQ (keysym, Qsuper)) eicat_c (bufp, "S-");
+	  else if (EQ (keysym, Qhyper)) eicat_c (bufp, "H-");
+	  else if (EQ (keysym, Qalt))	eicat_c (bufp, "A-");
+	  else if (EQ (keysym, Qshift)) eicat_c (bufp, "Sh-");
 	  else if (CHAR_OR_CHAR_INTP (keysym))
-	    {
-	      bufp += set_charptr_emchar ((Intbyte *) bufp,
-					  XCHAR_OR_CHAR_INT (keysym));
-	      *bufp = 0;
-	    }
+	    eicat_ch (bufp, XCHAR_OR_CHAR_INT (keysym));
 	  else
 	    {
 	      CHECK_SYMBOL (keysym);
 #if 0                           /* This is bogus */
-	      if (EQ (keysym, QKlinefeed))	 strcpy (bufp, "LFD");
-	      else if (EQ (keysym, QKtab))	 strcpy (bufp, "TAB");
-	      else if (EQ (keysym, QKreturn))	 strcpy (bufp, "RET");
-	      else if (EQ (keysym, QKescape))	 strcpy (bufp, "ESC");
-	      else if (EQ (keysym, QKdelete))	 strcpy (bufp, "DEL");
-	      else if (EQ (keysym, QKspace))	 strcpy (bufp, "SPC");
-	      else if (EQ (keysym, QKbackspace)) strcpy (bufp, "BS");
+	      if (EQ (keysym, QKlinefeed))	 eicat_c (bufp, "LFD");
+	      else if (EQ (keysym, QKtab))	 eicat_c (bufp, "TAB");
+	      else if (EQ (keysym, QKreturn))	 eicat_c (bufp, "RET");
+	      else if (EQ (keysym, QKescape))	 eicat_c (bufp, "ESC");
+	      else if (EQ (keysym, QKdelete))	 eicat_c (bufp, "DEL");
+	      else if (EQ (keysym, QKspace))	 eicat_c (bufp, "SPC");
+	      else if (EQ (keysym, QKbackspace)) eicat_c (bufp, "BS");
 	      else
 #endif
-		strcpy (bufp, (char *) string_data (XSYMBOL (keysym)->name));
+		eicat_lstr (bufp, XSYMBOL (keysym)->name);
 	      if (!NILP (XCDR (rest)))
-		invalid_argument ("Invalid key description",
-				     key);
+		invalid_argument ("Invalid key description", key);
 	    }
 	}
-      return build_string (buf);
+      return eimake_string (bufp);
     }
   return Fsingle_key_description
     (wrong_type_argument (intern ("char-or-event-p"), key));
@@ -3421,7 +3416,7 @@
 
 static Lisp_Object
 where_is_internal (Lisp_Object definition, Lisp_Object *maps, int nmaps,
-                   Lisp_Object firstonly, char *target_buffer);
+                   Lisp_Object firstonly, Eistring *target_buffer);
 
 DEFUN ("where-is-internal", Fwhere_is_internal, 1, 5, 0, /*
 Return list of keys that invoke DEFINITION in KEYMAPS.
@@ -3494,7 +3489,7 @@
    very fast.  This is used by menubar.c.
  */
 void
-where_is_to_char (Lisp_Object definition, char *buffer)
+where_is_to_char (Lisp_Object definition, Eistring *buffer)
 {
   /* This function can GC */
   Lisp_Object maps[100];
@@ -3509,7 +3504,6 @@
       nmaps = get_relevant_keymaps (Qnil, nmaps, gubbish);
     }
 
-  buffer[0] = 0;
   where_is_internal (definition, maps, nmaps, Qt, buffer);
 }
 
@@ -3525,7 +3519,7 @@
 
 
 static void
-format_raw_keys (struct key_data *keys, int count, char *buf)
+format_raw_keys (struct key_data *keys, int count, Eistring *buf)
 {
   int i;
   Lisp_Event event;
@@ -3536,9 +3530,8 @@
       event.event.key.keysym    = keys[i].keysym;
       event.event.key.modifiers = keys[i].modifiers;
       format_event_object (buf, &event, 1);
-      buf += strlen (buf);
-      if (i < count-1)
-	buf[0] = ' ', buf++;
+      if (i < count - 1)
+	eicat_c (buf, " ");
     }
 }
 
@@ -3571,7 +3564,7 @@
     int firstonly;
     int keys_count;
     int modifiers_so_far;
-    char *target_buffer;
+    Eistring *target_buffer;
     struct key_data *keys_so_far;
     int keys_so_far_total_size;
     int keys_so_far_malloced;
@@ -3588,7 +3581,7 @@
   const int firstonly = c->firstonly;
   const int keys_count = c->keys_count;
   const int modifiers_so_far = c->modifiers_so_far;
-  char *target_buffer = c->target_buffer;
+  Eistring *target_buffer = c->target_buffer;
   Lisp_Object keys = Fgethash (definition,
                                XKEYMAP (map)->inverse_table,
                                Qnil);
@@ -3736,7 +3729,7 @@
 
 static Lisp_Object
 where_is_internal (Lisp_Object definition, Lisp_Object *maps, int nmaps,
-                   Lisp_Object firstonly, char *target_buffer)
+                   Lisp_Object firstonly, Eistring *target_buffer)
 {
   /* This function can GC */
   Lisp_Object result = Qnil;
--- a/src/keymap.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/keymap.h	Fri Mar 29 04:49:13 2002 +0000
@@ -28,7 +28,6 @@
 
 DECLARE_LRECORD (keymap, Lisp_Keymap);
 #define XKEYMAP(x) XRECORD (x, keymap, Lisp_Keymap)
-#define XSETKEYMAP(x, p) XSETRECORD (x, p, keymap)
 #define wrap_keymap(p) wrap_record (p, keymap)
 #define KEYMAPP(x) RECORDP (x, keymap)
 #define CHECK_KEYMAP(x) CHECK_RECORD (x, keymap)
--- a/src/lisp-disunion.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/lisp-disunion.h	Fri Mar 29 04:49:13 2002 +0000
@@ -96,9 +96,6 @@
 #define Qzero make_int (0)
 #define Qnull_pointer ((Lisp_Object) 0)
 #define EQ(x,y) ((x) == (y))
-#define XSETINT(var, value) ((void) ((var) = make_int (value)))
-#define XSETCHAR(var, value) ((void) ((var) = make_char (value)))
-#define XSETOBJ(var, value) ((void) ((var) = wrap_pointer_1 (value)))
 
 /* Convert between a (void *) and a Lisp_Object, as when the
    Lisp_Object is passed to a toolkit callback function */
--- a/src/lisp-union.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/lisp-union.h	Fri Mar 29 04:49:13 2002 +0000
@@ -81,23 +81,6 @@
 Lisp_Object;
 
 #define XCHARVAL(x) ((x).gu.val)
-
-# define XSETINT(var, value) do {	\
-  EMACS_INT xset_value = (value);	\
-  Lisp_Object *xset_var = &(var);	\
-  xset_var->s.bits = 1;			\
-  xset_var->s.val = xset_value;		\
-} while (0)
-# define XSETCHAR(var, value) do {	\
-  Emchar xset_value = (value);		\
-  Lisp_Object *xset_var = &(var);	\
-  xset_var->gu.type = Lisp_Type_Char;	\
-  xset_var->gu.val = xset_value;	\
-} while (0)
-# define XSETOBJ(var, value) do {		\
-  EMACS_UINT xset_value = (EMACS_UINT) (value);	\
-  (var).ui = xset_value;			\
-} while (0)
 # define XPNTRVAL(x) ((x).ui)
 
 INLINE_HEADER Lisp_Object make_int (EMACS_INT val);
@@ -105,7 +88,8 @@
 make_int (EMACS_INT val)
 {
   Lisp_Object obj;
-  XSETINT (obj, val);
+  obj.s.bits = 1;
+  obj.s.val = val;
   return obj;
 }
 
@@ -114,7 +98,8 @@
 make_char (Emchar val)
 {
   Lisp_Object obj;
-  XSETCHAR (obj, val);
+  obj.gu.type = Lisp_Type_Char;
+  obj.gu.val = val;
   return obj;
 }
 
@@ -123,7 +108,7 @@
 wrap_pointer_1 (void *ptr)
 {
   Lisp_Object obj;
-  XSETOBJ (obj, ptr);
+  obj.ui = (EMACS_UINT) ptr;
   return obj;
 }
 
--- a/src/lisp.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/lisp.h	Fri Mar 29 04:49:13 2002 +0000
@@ -175,74 +175,7 @@
 typedef unsigned long uintptr_t;
 #endif
 
-/* ------------------------ dynamic arrays ------------------- */
-
-#define Dynarr_declare(type)	\
-  type *base;			\
-  int elsize;			\
-  int cur;			\
-  int largest;			\
-  int max
-
-typedef struct dynarr
-{
-  Dynarr_declare (void);
-} Dynarr;
-
-void *Dynarr_newf (int elsize);
-void Dynarr_resize (void *dy, int size);
-void Dynarr_insert_many (void *d, const void *el, int len, int start);
-void Dynarr_delete_many (void *d, int start, int len);
-void Dynarr_free (void *d);
-
-#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type)))
-#define Dynarr_new2(dynarr_type, type) \
-  ((dynarr_type *) Dynarr_newf (sizeof (type)))
-#define Dynarr_at(d, pos) ((d)->base[pos])
-#define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
-#define Dynarr_begin(d) Dynarr_atp (d, 0)
-#define Dynarr_end(d) Dynarr_atp (d, Dynarr_length (d))
-#define Dynarr_sizeof(d) ((d)->cur * (d)->elsize)
-#define Dynarr_length(d) ((d)->cur)
-#define Dynarr_largest(d) ((d)->largest)
-#define Dynarr_reset(d) ((d)->cur = 0)
-#define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur)
-#define Dynarr_insert_many_at_start(d, el, len)	\
-  Dynarr_insert_many (d, el, len, 0)
-#define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1)
-#define Dynarr_add_lisp_string(d, s, codesys)		\
-do {							\
-  Lisp_Object dyna_ls_s = (s);				\
-  Lisp_Object dyna_ls_cs = (codesys);			\
-  Extbyte *dyna_ls_eb;					\
-  Bytecount dyna_ls_bc;					\
-							\
-  TO_EXTERNAL_FORMAT (LISP_STRING, dyna_ls_s,		\
-                      ALLOCA, (dyna_ls_eb, dyna_ls_bc),	\
-		      dyna_ls_cs);			\
-  Dynarr_add_many (d, dyna_ls_eb, dyna_ls_bc);		\
-} while (0)
-
-#define Dynarr_add(d, el) (						\
-  (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : (void) 0,	\
-  ((d)->base)[(d)->cur++] = (el),					\
-  (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0)
-
-/* The following defines will get you into real trouble if you aren't
-   careful.  But they can save a lot of execution time when used wisely. */
-#define Dynarr_increment(d) ((d)->cur++)
-#define Dynarr_set_size(d, n) ((d)->cur = n)
-
-#define Dynarr_pop(d) \
-  (assert ((d)->cur > 0), (d)->cur--, Dynarr_at (d, (d)->cur))
-#define Dynarr_delete(d, i) Dynarr_delete_many (d, i, len)
-#define Dynarr_delete_by_pointer(d, p) \
-  Dynarr_delete_many (d, (p) - ((d)->base), 1)
-
-#ifdef MEMORY_USAGE_STATS
-struct overhead_stats;
-Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats);
-#endif
+/* ------------------------ basic compiler defines ------------------- */
 
 /* Also define min() and max(). (Some compilers put them in strange
    places that won't be referenced by the above include files, such
@@ -255,54 +188,6 @@
 #define max(a,b) (((a) > (b)) ? (a) : (b))
 #endif
 
-/* Memory allocation */
-void malloc_warning (const char *);
-void *xmalloc (Bytecount size);
-void *xmalloc_and_zero (Bytecount size);
-void *xrealloc (void *, Bytecount size);
-char *xstrdup (const char *);
-/* generally useful */
-#define countof(x) ((int) (sizeof(x)/sizeof((x)[0])))
-#define xnew(type) ((type *) xmalloc (sizeof (type)))
-#define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type)))
-#define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type)))
-#define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue)))
-#define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type)))
-#define XREALLOC_ARRAY(ptr, type, len) ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type))))
-#define alloca_new(type) ((type *) alloca (sizeof (type)))
-#define alloca_array(type, len) ((type *) alloca ((len) * sizeof (type)))
-
-/* also generally useful if you want to avoid arbitrary size limits
-   but don't need a full dynamic array.  Assumes that BASEVAR points
-   to a malloced array of TYPE objects (or possibly a NULL pointer,
-   if SIZEVAR is 0), with the total size stored in SIZEVAR.  This
-   macro will realloc BASEVAR as necessary so that it can hold at
-   least NEEDED_SIZE objects.  The reallocing is done by doubling,
-   which ensures constant amortized time per element. */
-#define DO_REALLOC(basevar, sizevar, needed_size, type)	do {	\
-  Bytecount do_realloc_needed_size = (needed_size);		\
-  if ((sizevar) < do_realloc_needed_size)			\
-    {								\
-      if ((sizevar) < 32)					\
-	(sizevar) = 32;						\
-      while ((sizevar) < do_realloc_needed_size)		\
-	(sizevar) *= 2;						\
-      XREALLOC_ARRAY (basevar, type, (sizevar));		\
-    }								\
-} while (0)
-
-#ifdef ERROR_CHECK_MALLOC
-void xfree_1 (void *);
-#define xfree(lvalue) do			\
-{						\
-  void **xfree_ptr = (void **) &(lvalue);	\
-  xfree_1 (*xfree_ptr);				\
-  *xfree_ptr = (void *) 0xDEADBEEF;		\
-} while (0)
-#else
-void xfree (void *);
-#endif /* ERROR_CHECK_MALLOC */
-
 #ifndef PRINTF_ARGS
 # if defined (__GNUC__) && (__GNUC__ >= 2)
 #  define PRINTF_ARGS(string_index,first_to_check) \
@@ -348,6 +233,23 @@
 #define RETURN_NOT_REACHED(value) return value;
 #endif
 
+#ifndef DO_NOTHING
+#define DO_NOTHING do {} while (0)
+#endif
+
+#ifndef DECLARE_NOTHING
+#define DECLARE_NOTHING struct nosuchstruct
+#endif
+
+/*#ifdef DEBUG_XEMACS*/
+#define REGISTER
+#define register
+/*#else*/
+/*#define REGISTER register*/
+/*#endif*/
+
+/* ------------------------ alignment definitions ------------------- */
+
 /* No type has a greater alignment requirement than max_align_t.
    (except perhaps for types we don't use, like long double) */
 typedef union
@@ -404,13 +306,7 @@
 #define ALIGN_PTR(ptr, unit) \
   ((void *) ALIGN_SIZE ((size_t) (ptr), unit))
 
-#ifndef DO_NOTHING
-#define DO_NOTHING do {} while (0)
-#endif
-
-#ifndef DECLARE_NOTHING
-#define DECLARE_NOTHING struct nosuchstruct
-#endif
+/* ------------------------ assertions ------------------- */
 
 /* We define assert iff USE_ASSERTIONS or DEBUG_XEMACS is defined.
    Otherwise we define it to be empty.  Quantify has shown that the
@@ -458,13 +354,143 @@
 #endif
 #endif /* 0 */
 
-/*#ifdef DEBUG_XEMACS*/
-#define REGISTER
-#define register
-/*#else*/
-/*#define REGISTER register*/
-/*#endif*/
-
+/* ------------------------ simple memory allocation ------------------- */
+
+/* Memory allocation */
+void malloc_warning (const char *);
+void *xmalloc (Bytecount size);
+void *xmalloc_and_zero (Bytecount size);
+void *xrealloc (void *, Bytecount size);
+char *xstrdup (const char *);
+/* generally useful */
+#define countof(x) ((int) (sizeof(x)/sizeof((x)[0])))
+#define xnew(type) ((type *) xmalloc (sizeof (type)))
+#define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type)))
+#define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type)))
+#define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue)))
+#define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type)))
+#define XREALLOC_ARRAY(ptr, type, len) ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type))))
+#define alloca_new(type) ((type *) alloca (sizeof (type)))
+#define alloca_array(type, len) ((type *) alloca ((len) * sizeof (type)))
+
+/* also generally useful if you want to avoid arbitrary size limits
+   but don't need a full dynamic array.  Assumes that BASEVAR points
+   to a malloced array of TYPE objects (or possibly a NULL pointer,
+   if SIZEVAR is 0), with the total size stored in SIZEVAR.  This
+   macro will realloc BASEVAR as necessary so that it can hold at
+   least NEEDED_SIZE objects.  The reallocing is done by doubling,
+   which ensures constant amortized time per element. */
+#define DO_REALLOC(basevar, sizevar, needed_size, type)	do {	\
+  Bytecount do_realloc_needed_size = (needed_size);		\
+  if ((sizevar) < do_realloc_needed_size)			\
+    {								\
+      if ((sizevar) < 32)					\
+	(sizevar) = 32;						\
+      while ((sizevar) < do_realloc_needed_size)		\
+	(sizevar) *= 2;						\
+      XREALLOC_ARRAY (basevar, type, (sizevar));		\
+    }								\
+} while (0)
+
+#ifdef ERROR_CHECK_MALLOC
+void xfree_1 (void *);
+#define xfree(lvalue) do			\
+{						\
+  void **xfree_ptr = (void **) &(lvalue);	\
+  xfree_1 (*xfree_ptr);				\
+  *xfree_ptr = (void *) 0xDEADBEEF;		\
+} while (0)
+#else
+void xfree (void *);
+#endif /* ERROR_CHECK_MALLOC */
+
+/* ------------------------ dynamic arrays ------------------- */
+
+#define Dynarr_declare(type)	\
+  type *base;			\
+  int elsize;			\
+  int cur;			\
+  int largest;			\
+  int max
+
+typedef struct dynarr
+{
+  Dynarr_declare (void);
+} Dynarr;
+
+void *Dynarr_newf (int elsize);
+void Dynarr_resize (void *dy, int size);
+void Dynarr_insert_many (void *d, const void *el, int len, int start);
+void Dynarr_delete_many (void *d, int start, int len);
+void Dynarr_free (void *d);
+
+#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type)))
+#define Dynarr_new2(dynarr_type, type) \
+  ((dynarr_type *) Dynarr_newf (sizeof (type)))
+#define Dynarr_at(d, pos) ((d)->base[pos])
+#define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
+#define Dynarr_begin(d) Dynarr_atp (d, 0)
+#define Dynarr_end(d) Dynarr_atp (d, Dynarr_length (d))
+#define Dynarr_sizeof(d) ((d)->cur * (d)->elsize)
+
+#ifdef ERROR_CHECK_TYPECHECK
+DECLARE_INLINE_HEADER (
+Dynarr *
+Dynarr_verify_1 (void *d, const char *file, int line)
+)
+{
+  Dynarr *dy = (Dynarr *) d;
+  assert_at_line (dy->cur >= 0 && dy->cur <= dy->largest &&
+		  dy->largest <= dy->max, file, line);
+  return dy;
+}
+
+#define Dynarr_verify(d) Dynarr_verify_1 (d, __FILE__, __LINE__)
+#else
+#define Dynarr_verify(d) (d)
+#endif /* ERROR_CHECK_TYPECHECK */
+
+#define Dynarr_length(d) (Dynarr_verify (d)->cur)
+#define Dynarr_largest(d) (Dynarr_verify (d)->largest)
+#define Dynarr_reset(d) (Dynarr_verify (d)->cur = 0)
+#define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur)
+#define Dynarr_insert_many_at_start(d, el, len)	\
+  Dynarr_insert_many (d, el, len, 0)
+#define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1)
+#define Dynarr_add_lisp_string(d, s, codesys)		\
+do {							\
+  Lisp_Object dyna_ls_s = (s);				\
+  Lisp_Object dyna_ls_cs = (codesys);			\
+  Extbyte *dyna_ls_eb;					\
+  Bytecount dyna_ls_bc;					\
+							\
+  TO_EXTERNAL_FORMAT (LISP_STRING, dyna_ls_s,		\
+                      ALLOCA, (dyna_ls_eb, dyna_ls_bc),	\
+		      dyna_ls_cs);			\
+  Dynarr_add_many (d, dyna_ls_eb, dyna_ls_bc);		\
+} while (0)
+
+#define Dynarr_add(d, el) (						 \
+  Dynarr_verify (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : \
+      (void) 0,								 \
+  ((d)->base)[(d)->cur++] = (el),					 \
+  (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0)
+
+/* The following defines will get you into real trouble if you aren't
+   careful.  But they can save a lot of execution time when used wisely. */
+#define Dynarr_increment(d) ((d)->cur++)
+#define Dynarr_set_size(d, n) ((d)->cur = n)
+
+#define Dynarr_pop(d) \
+  (assert ((d)->cur > 0), (d)->cur--, Dynarr_at (d, (d)->cur))
+#define Dynarr_delete(d, i) Dynarr_delete_many (d, i, len)
+#define Dynarr_delete_by_pointer(d, p) \
+  Dynarr_delete_many (d, (p) - ((d)->base), 1)
+
+#ifdef MEMORY_USAGE_STATS
+struct overhead_stats;
+Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats);
+#endif
 
 
 /************************************************************************/
@@ -488,7 +514,8 @@
 {
   ERROR_ME,
   ERROR_ME_NOT,
-  ERROR_ME_WARN
+  ERROR_ME_WARN,
+  ERROR_ME_DEBUG_WARN
 } Error_Behavior;
 
 #define ERRB_EQ(a, b) ((a) == (b))
@@ -506,6 +533,7 @@
 extern Error_Behavior ERROR_ME;
 extern Error_Behavior ERROR_ME_NOT;
 extern Error_Behavior ERROR_ME_WARN;
+extern Error_Behavior ERROR_ME_DEBUG_WARN;
 
 #define ERRB_EQ(a, b)							   \
  ((a).really_unlikely_name_to_have_accidentally_in_a_non_errb_structure == \
@@ -828,7 +856,6 @@
 
 DECLARE_LRECORD (cons, Lisp_Cons);
 #define XCONS(x) XRECORD (x, cons, Lisp_Cons)
-#define XSETCONS(x, p) XSETRECORD (x, p, cons)
 #define wrap_cons(p) wrap_record (p, cons)
 #define CONSP(x) RECORDP (x, cons)
 #define CHECK_CONS(x) CHECK_RECORD (x, cons)
@@ -1323,8 +1350,8 @@
 	  unsigned int ascii_begin :21;
 	} v;
     } u;
-  Bytecount size;
-  Intbyte *data;
+  Bytecount size_;
+  Intbyte *data_;
   Lisp_Object plist;
 };
 typedef struct Lisp_String Lisp_String;
@@ -1333,7 +1360,6 @@
 
 DECLARE_LRECORD (string, Lisp_String);
 #define XSTRING(x) XRECORD (x, string, Lisp_String)
-#define XSETSTRING(x, p) XSETRECORD (x, p, string)
 #define wrap_string(p) wrap_record (p, string)
 #define STRINGP(x) RECORDP (x, string)
 #define CHECK_STRING(x) CHECK_RECORD (x, string)
@@ -1351,33 +1377,27 @@
 
 #endif /* not MULE */
 
-#define string_length(s) ((s)->size)
-#define XSTRING_LENGTH(s) string_length (XSTRING (s))
-#define string_data(s) ((s)->data + 0)
-#define XSTRING_DATA(s) string_data (XSTRING (s))
-#define string_ascii_begin(s) ((s)->u.v.ascii_begin + 0)
-#define XSTRING_ASCII_BEGIN(s) string_ascii_begin (XSTRING (s))
-#define string_char_length(s) string_index_byte_to_char (s, string_length (s))
-#define XSTRING_CHAR_LENGTH(s) string_char_length (XSTRING (s))
-#define string_byte(s, i) ((s)->data[i] + 0)
-#define XSTRING_BYTE(s, i) string_byte (XSTRING (s), i)
-#define string_byte_addr(s, i) (&((s)->data[i]))
-#define string_char(s, i) charptr_emchar (string_char_addr (s, i))
-#define XSTRING_CHAR(s, i) string_char (XSTRING (s), i)
-#define XSTRING_INDEX_CHAR_TO_BYTE(s, idx) \
-  string_index_char_to_byte (XSTRING (s), idx)
-#define XSTRING_INDEX_BYTE_TO_CHAR(s, idx) \
-  string_index_byte_to_char (XSTRING (s), idx)
-#define XSTRING_OFFSET_BYTE_TO_CHAR_LEN(s, off, len) \
-  string_offset_byte_to_char_len (XSTRING (s), off, len)
-#define XSTRING_OFFSET_CHAR_TO_BYTE_LEN(s, off, len) \
-  string_offset_char_to_byte_len (XSTRING (s), off, len)
-#define set_string_length(s, len) ((void) ((s)->size = (len)))
-#define set_string_data(s, ptr) ((void) ((s)->data = (ptr)))
+/* Operations on Lisp_String *'s; only ones left */
+#define set_string_length(s, len) ((void) ((s)->size_ = (len)))
+#define set_string_data(s, ptr) ((void) ((s)->data_ = (ptr)))
+
+#define XSTRING_LENGTH(s) (XSTRING (s)->size_)
+#define XSTRING_PLIST(s) (XSTRING (s)->plist)
+#define XSTRING_DATA(s) (XSTRING (s)->data_ + 0)
+#define XSTRING_ASCII_BEGIN(s) (XSTRING (s)->u.v.ascii_begin + 0)
+#define XSTRING_CHAR_LENGTH(s) \
+  string_index_byte_to_char (s, XSTRING_LENGTH (s))
+#define XSTRING_BYTE(s, i) (XSTRING (s)->data_[i] + 0)
+#define set_string_byte(s, i, c) (XSTRING (s)->data_[i] = (c))
+
+#define string_byte_addr(s, i) (&((XSTRING (s))->data_[i]))
+#define XSTRING_CHAR(s, i) charptr_emchar (string_char_addr (s, i))
+#define XSET_STRING_LENGTH(s, ptr) set_string_length (XSTRING (s), ptr)
+#define XSET_STRING_DATA(s, ptr) set_string_data (XSTRING (s), ptr)
 /* WARNING: If you modify an existing string, you must call
    bump_string_modiff() afterwards. */
-#define set_string_byte(s, i, b) ((void) ((s)->data[i] = (b)))
-#define set_string_ascii_begin(s, val) ((void) ((s)->u.v.ascii_begin = (val)))
+#define XSET_STRING_ASCII_BEGIN(s, val) \
+  ((void) (XSTRING (s)->u.v.ascii_begin = (val)))
 
 #ifdef ERROR_CHECK_CHARBPOS
 #define SLEDGEHAMMER_CHECK_ASCII_BEGIN
@@ -1411,25 +1431,26 @@
 #define alloca_intbytes(num) alloca_array (Intbyte, num)
 #define alloca_extbytes(num) alloca_array (Extbyte, num)
 
-void resize_string (Lisp_String *s, Bytecount pos, Bytecount delta);
+void resize_string (Lisp_Object s, Bytecount pos, Bytecount delta);
 
 #ifdef MULE
 
 /* Convert a byte index into a string into a char index. */
 DECLARE_INLINE_HEADER (
 Charcount
-string_index_byte_to_char (Lisp_String *s, Bytecount idx)
+string_index_byte_to_char (Lisp_Object s, Bytecount idx)
 )
 {
   Charcount retval;
-  if (idx <= (Bytecount) string_ascii_begin (s))
+  if (idx <= (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval = idx;
   else
-    retval = (string_ascii_begin (s) +
-	      bytecount_to_charcount (string_data (s) + string_ascii_begin (s),
-				      idx - string_ascii_begin (s)));
+    retval = (XSTRING_ASCII_BEGIN (s) +
+	      bytecount_to_charcount (XSTRING_DATA (s) +
+				      XSTRING_ASCII_BEGIN (s),
+				      idx - XSTRING_ASCII_BEGIN (s)));
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
-  assert (retval == bytecount_to_charcount (string_data (s), idx));
+  assert (retval == bytecount_to_charcount (XSTRING_DATA (s), idx));
 #endif
   return retval;
 }
@@ -1437,18 +1458,19 @@
 /* Convert a char index into a string into a byte index. */
 DECLARE_INLINE_HEADER (
 Bytecount
-string_index_char_to_byte (Lisp_String *s, Charcount idx)
+string_index_char_to_byte (Lisp_Object s, Charcount idx)
 )
 {
   Bytecount retval;
-  if (idx <= (Charcount) string_ascii_begin (s))
+  if (idx <= (Charcount) XSTRING_ASCII_BEGIN (s))
     retval = idx;
   else
-    retval = (string_ascii_begin (s) +
-	      charcount_to_bytecount (string_data (s) + string_ascii_begin (s),
-				      idx - string_ascii_begin (s)));
+    retval = (XSTRING_ASCII_BEGIN (s) +
+	      charcount_to_bytecount (XSTRING_DATA (s) +
+				      XSTRING_ASCII_BEGIN (s),
+				      idx - XSTRING_ASCII_BEGIN (s)));
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
-  assert (retval == charcount_to_bytecount (string_data (s), idx));
+  assert (retval == charcount_to_bytecount (XSTRING_DATA (s), idx));
 #endif
   return retval;
 }
@@ -1457,21 +1479,21 @@
    chars. */
 DECLARE_INLINE_HEADER (
 Charcount
-string_offset_byte_to_char_len (Lisp_String *s, Bytecount off, Bytecount len)
+string_offset_byte_to_char_len (Lisp_Object s, Bytecount off, Bytecount len)
 )
 {
   Charcount retval;
-  if (off + len <= (Bytecount) string_ascii_begin (s))
+  if (off + len <= (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval = len;
-  else if (off < (Bytecount) string_ascii_begin (s))
+  else if (off < (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval =
-      string_ascii_begin (s) - off +
-	bytecount_to_charcount (string_data (s) + string_ascii_begin (s),
-				len - (string_ascii_begin (s) - off));
+      XSTRING_ASCII_BEGIN (s) - off +
+	bytecount_to_charcount (XSTRING_DATA (s) + XSTRING_ASCII_BEGIN (s),
+				len - (XSTRING_ASCII_BEGIN (s) - off));
   else
-    retval = bytecount_to_charcount (string_data (s) + off, len);
+    retval = bytecount_to_charcount (XSTRING_DATA (s) + off, len);
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
-  assert (retval == bytecount_to_charcount (string_data (s) + off, len));
+  assert (retval == bytecount_to_charcount (XSTRING_DATA (s) + off, len));
 #endif
   return retval;
 }
@@ -1480,34 +1502,34 @@
    bytes. */
 DECLARE_INLINE_HEADER (
 Bytecount
-string_offset_char_to_byte_len (Lisp_String *s, Bytecount off, Charcount len)
+string_offset_char_to_byte_len (Lisp_Object s, Bytecount off, Charcount len)
 )
 {
   Bytecount retval;
-  if (off + len <= (Bytecount) string_ascii_begin (s))
+  if (off + len <= (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval = len;
-  else if (off < (Bytecount) string_ascii_begin (s))
+  else if (off < (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval =
-      string_ascii_begin (s) - off +
-	charcount_to_bytecount (string_data (s) + string_ascii_begin (s),
-				len - (string_ascii_begin (s) - off));
+      XSTRING_ASCII_BEGIN (s) - off +
+	charcount_to_bytecount (XSTRING_DATA (s) + XSTRING_ASCII_BEGIN (s),
+				len - (XSTRING_ASCII_BEGIN (s) - off));
   else
-    retval = charcount_to_bytecount (string_data (s) + off, len);
+    retval = charcount_to_bytecount (XSTRING_DATA (s) + off, len);
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
-  assert (retval == charcount_to_bytecount (string_data (s) + off, len));
+  assert (retval == charcount_to_bytecount (XSTRING_DATA (s) + off, len));
 #endif
   return retval;
 }
 
 DECLARE_INLINE_HEADER (
 Intbyte *
-string_char_addr (Lisp_String *s, Charcount idx)
+string_char_addr (Lisp_Object s, Charcount idx)
 )
 {
-  return string_data (s) + string_index_char_to_byte (s, idx);
+  return XSTRING_DATA (s) + string_index_char_to_byte (s, idx);
 }
 
-void set_string_char (Lisp_String *s, Charcount i, Emchar c);
+void set_string_char (Lisp_Object s, Charcount i, Emchar c);
 
 #else /* not MULE */
 
@@ -1518,7 +1540,7 @@
 # define string_char_addr(s, i) string_byte_addr (s, i)
 /* WARNING: If you modify an existing string, you must call
    bump_string_modiff() afterwards. */
-# define set_string_char(s, i, c) set_string_byte (s, i, (Intbyte) c)
+# define set_string_char(s, i, c) set_string_byte (s, i, c)
 
 #endif /* not MULE */
 
@@ -1560,7 +1582,6 @@
 
 DECLARE_LRECORD (vector, Lisp_Vector);
 #define XVECTOR(x) XRECORD (x, vector, Lisp_Vector)
-#define XSETVECTOR(x, p) XSETRECORD (x, p, vector)
 #define wrap_vector(p) wrap_record (p, vector)
 #define VECTORP(x) RECORDP (x, vector)
 #define CHECK_VECTOR(x) CHECK_RECORD (x, vector)
@@ -1599,7 +1620,6 @@
 
 DECLARE_LRECORD (bit_vector, Lisp_Bit_Vector);
 #define XBIT_VECTOR(x) XRECORD (x, bit_vector, Lisp_Bit_Vector)
-#define XSETBIT_VECTOR(x, p) XSETRECORD (x, p, bit_vector)
 #define wrap_bit_vector(p) wrap_record (p, bit_vector)
 #define BIT_VECTORP(x) RECORDP (x, bit_vector)
 #define CHECK_BIT_VECTOR(x) CHECK_RECORD (x, bit_vector)
@@ -1650,22 +1670,21 @@
   struct lrecord_header lheader;
   /* next symbol in this obarray bucket */
   Lisp_Symbol *next;
-  Lisp_String *name;
+  Lisp_Object name;
   Lisp_Object value;
   Lisp_Object function;
   Lisp_Object plist;
 };
 
 #define SYMBOL_IS_KEYWORD(sym)						\
-  ((string_byte (symbol_name (XSYMBOL (sym)), 0) == ':')		\
+  ((XSTRING_BYTE (symbol_name (XSYMBOL (sym)), 0) == ':')		\
    && EQ (sym, oblookup (Vobarray,					\
-			 string_data (symbol_name (XSYMBOL (sym))),	\
-			 string_length (symbol_name (XSYMBOL (sym))))))
+			 XSTRING_DATA (symbol_name (XSYMBOL (sym))),	\
+			 XSTRING_LENGTH (symbol_name (XSYMBOL (sym))))))
 #define KEYWORDP(obj) (SYMBOLP (obj) && SYMBOL_IS_KEYWORD (obj))
 
 DECLARE_LRECORD (symbol, Lisp_Symbol);
 #define XSYMBOL(x) XRECORD (x, symbol, Lisp_Symbol)
-#define XSETSYMBOL(x, p) XSETRECORD (x, p, symbol)
 #define wrap_symbol(p) wrap_record (p, symbol)
 #define SYMBOLP(x) RECORDP (x, symbol)
 #define CHECK_SYMBOL(x) CHECK_RECORD (x, symbol)
@@ -1677,6 +1696,13 @@
 #define symbol_function(s) ((s)->function)
 #define symbol_plist(s) ((s)->plist)
 
+#define XSYMBOL_NEXT(s) (XSYMBOL (s)->next)
+#define XSYMBOL_NAME(s) (XSYMBOL (s)->name)
+#define XSYMBOL_VALUE(s) (XSYMBOL (s)->value)
+#define XSYMBOL_FUNCTION(s) (XSYMBOL (s)->function)
+#define XSYMBOL_PLIST(s) (XSYMBOL (s)->plist)
+
+
 /*------------------------------- subr ---------------------------------*/
 
 typedef Lisp_Object (*lisp_fn_t) (void);
@@ -1695,7 +1721,6 @@
 
 DECLARE_LRECORD (subr, Lisp_Subr);
 #define XSUBR(x) XRECORD (x, subr, Lisp_Subr)
-#define XSETSUBR(x, p) XSETRECORD (x, p, subr)
 #define wrap_subr(p) wrap_record (p, subr)
 #define SUBRP(x) RECORDP (x, subr)
 #define CHECK_SUBR(x) CHECK_RECORD (x, subr)
@@ -1722,7 +1747,6 @@
 
 DECLARE_LRECORD (marker, Lisp_Marker);
 #define XMARKER(x) XRECORD (x, marker, Lisp_Marker)
-#define XSETMARKER(x, p) XSETRECORD (x, p, marker)
 #define wrap_marker(p) wrap_record (p, marker)
 #define MARKERP(x) RECORDP (x, marker)
 #define CHECK_MARKER(x) CHECK_RECORD (x, marker)
@@ -1778,7 +1802,6 @@
 
 DECLARE_LRECORD (float, Lisp_Float);
 #define XFLOAT(x) XRECORD (x, float, Lisp_Float)
-#define XSETFLOAT(x, p) XSETRECORD (x, p, float)
 #define wrap_float(p) wrap_record (p, float)
 #define FLOATP(x) RECORDP (x, float)
 #define CHECK_FLOAT(x) CHECK_RECORD (x, float)
@@ -1804,7 +1827,6 @@
 #else /* not LISP_FLOAT_TYPE */
 
 #define XFLOAT(x) --- error!  No float support. ---
-#define XSETFLOAT(x, p) --- error!  No float support. ---
 #define FLOATP(x) 0
 #define CHECK_FLOAT(x) --- error!  No float support. ---
 #define CONCHECK_FLOAT(x) --- error!  No float support. ---
@@ -1982,7 +2004,6 @@
 
 DECLARE_LRECORD (weak_list, struct weak_list);
 #define XWEAK_LIST(x) XRECORD (x, weak_list, struct weak_list)
-#define XSETWEAK_LIST(x, p) XSETRECORD (x, p, weak_list)
 #define wrap_weak_list(p) wrap_record (p, weak_list)
 #define WEAK_LISTP(x) RECORDP (x, weak_list)
 #define CHECK_WEAK_LIST(x) CHECK_RECORD (x, weak_list)
@@ -2008,7 +2029,6 @@
 
 DECLARE_LRECORD (lcrecord_list, struct lcrecord_list);
 #define XLCRECORD_LIST(x) XRECORD (x, lcrecord_list, struct lcrecord_list)
-#define XSETLCRECORD_LIST(x, p) XSETRECORD (x, p, lcrecord_list)
 #define wrap_lcrecord_list(p) wrap_record (p, lcrecord_list)
 #define LCRECORD_LISTP(x) RECORDP (x, lcrecord_list)
 /* #define CHECK_LCRECORD_LIST(x) CHECK_RECORD (x, lcrecord_list)
@@ -3219,7 +3239,7 @@
 /* Defined in indent.c */
 int bi_spaces_at_point (struct buffer *, Bytebpos);
 int column_at_point (struct buffer *, Charbpos, int);
-int string_column_at_point (Lisp_String *, Charbpos, int);
+int string_column_at_point (Lisp_Object, Charbpos, int);
 int current_column (struct buffer *);
 void invalidate_current_column (void);
 Charbpos vmotion (struct window *, Charbpos, int, int *);
@@ -3242,7 +3262,7 @@
 extern Lisp_Object Qmswindows_multibyte, Qmswindows_multibyte_to_unicode;
 
 /* Defined in keymap.c */
-void where_is_to_char (Lisp_Object, char *);
+void where_is_to_char (Lisp_Object, Eistring *);
 
 /* Defined in lread.c */
 void ebolify_bytecode_constants (Lisp_Object);
@@ -3326,6 +3346,7 @@
 void write_string (const Intbyte *str, Lisp_Object stream);
 /* Same goes for this function. */
 void write_string_1 (const Intbyte *str, Bytecount size, Lisp_Object stream);
+void write_eistring (const Eistring *ei, Lisp_Object stream);
 
 /* Higher-level (printf-style) ways to output data: */
 void write_fmt_string (Lisp_Object stream, const CIntbyte *fmt, ...);
@@ -3394,7 +3415,7 @@
 Charbpos find_next_newline (struct buffer *, Charbpos, int);
 Charbpos find_next_newline_no_quit (struct buffer *, Charbpos, int);
 Bytebpos bi_find_next_newline_no_quit (struct buffer *, Bytebpos, int);
-Bytebpos bi_find_next_emchar_in_string (Lisp_String*, Emchar, Bytebpos, EMACS_INT);
+Bytebpos bi_find_next_emchar_in_string (Lisp_Object, Emchar, Bytebpos, EMACS_INT);
 Charbpos find_before_next_newline (struct buffer *, Charbpos, Charbpos, int);
 struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *,
 					   Lisp_Object, int, Error_Behavior);
--- a/src/lread.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/lread.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1626,7 +1626,7 @@
      At least our reader is reentrant ... */
   tem =
     (Fcons (tem, make_int
-	    (XSTRING_INDEX_BYTE_TO_CHAR
+	    (string_index_byte_to_char
 	     (string,
 	      startval + Lstream_byte_count (XLSTREAM (lispstream))))));
   Lstream_delete (XLSTREAM (lispstream));
--- a/src/lrecord.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/lrecord.h	Fri Mar 29 04:49:13 2002 +0000
@@ -617,7 +617,7 @@
 
    struct lcrecord_header header;
 
-   2. Put the "standard junk" (DECLARE_RECORD()/XFOO/XSETFOO/etc.) below the
+   2. Put the "standard junk" (DECLARE_RECORD()/XFOO/etc.) below the
       struct definition -- see below.
 
    3. Add this header file to inline.c.
@@ -675,7 +675,6 @@
 
 DECLARE_LRECORD (toolbar_button, struct toolbar_button);
 #define XTOOLBAR_BUTTON(x) XRECORD (x, toolbar_button, struct toolbar_button)
-#define XSETTOOLBAR_BUTTON(x, p) XSETRECORD (x, p, toolbar_button)
 #define wrap_toolbar_button(p) wrap_record (p, toolbar_button)
 #define TOOLBAR_BUTTONP(x) RECORDP (x, toolbar_button)
 #define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button)
@@ -791,19 +790,13 @@
 # define XNONRECORD(x, c_name, type_enum, structtype) \
   error_check_##c_name (x, __FILE__, __LINE__)
 
-# define XSETRECORD(var, p, c_name) do				\
-{								\
-  XSETOBJ (var, p);						\
-  assert (RECORD_TYPEP (var, lrecord_type_##c_name));		\
-} while (0)
-
 INLINE_HEADER Lisp_Object wrap_record_1 (void *ptr, enum lrecord_type ty,
 					 const char *file, int line);
 INLINE_HEADER Lisp_Object
 wrap_record_1 (void *ptr, enum lrecord_type ty, const char *file, int line)
 {
-  Lisp_Object obj;
-  XSETOBJ (obj, ptr);
+  Lisp_Object obj = wrap_pointer_1 (ptr);
+
   assert_at_line (RECORD_TYPEP (obj, ty), file, line);
   return obj;
 }
@@ -825,7 +818,6 @@
 # define XRECORD(x, c_name, structtype) ((structtype *) XPNTR (x))
 # define XNONRECORD(x, c_name, type_enum, structtype)		\
   ((structtype *) XPNTR (x))
-# define XSETRECORD(var, p, c_name) XSETOBJ (var, p)
 /* wrap_pointer_1 is so named as a suggestion not to use it unless you
    know what you're doing. */
 #define wrap_record(ptr, ty) wrap_pointer_1 (ptr)
--- a/src/lstream.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/lstream.c	Fri Mar 29 04:49:13 2002 +0000
@@ -247,9 +247,8 @@
 Lstream_delete (Lstream *lstr)
 {
   int i;
-  Lisp_Object val;
+  Lisp_Object val = wrap_lstream (lstr);
 
-  XSETLSTREAM (val, lstr);
   for (i = 0; i < lstream_type_count; i++)
     {
       if (lstream_types[i] == lstr->imp)
@@ -861,14 +860,12 @@
 static Lisp_Object
 make_stdio_stream_1 (FILE *stream, int flags, const char *mode)
 {
-  Lisp_Object obj;
   Lstream *lstr = Lstream_new (lstream_stdio, mode);
   struct stdio_stream *str = STDIO_STREAM_DATA (lstr);
   str->file = stream;
   str->closing = flags & LSTR_CLOSING;
   lstr->flags |= LSTREAM_FL_CLOSE_AT_DISKSAVE;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 Lisp_Object
@@ -998,7 +995,6 @@
 make_filedesc_stream_1 (int filedesc, int offset, int count, int flags,
 			const char *mode)
 {
-  Lisp_Object obj;
   Lstream *lstr = Lstream_new (lstream_filedesc, mode);
   struct filedesc_stream *fstr = FILEDESC_STREAM_DATA (lstr);
   fstr->fd = filedesc;
@@ -1015,8 +1011,7 @@
   else
     fstr->end_pos = fstr->starting_pos + count;
   lstr->flags |= LSTREAM_FL_CLOSE_AT_DISKSAVE;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 Lisp_Object
@@ -1270,7 +1265,6 @@
 make_lisp_string_input_stream (Lisp_Object string, Bytecount offset,
 			       Bytecount len)
 {
-  Lisp_Object obj;
   Lstream *lstr;
   struct lisp_string_stream *str;
 
@@ -1287,8 +1281,7 @@
   str->end = offset + len;
   str->init_offset = offset;
   str->obj = string;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 static Bytecount
@@ -1360,25 +1353,21 @@
 Lisp_Object
 make_fixed_buffer_input_stream (const void *buf, Bytecount size)
 {
-  Lisp_Object obj;
   Lstream *lstr = Lstream_new (lstream_fixed_buffer, "r");
   struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (lstr);
   str->inbuf = (const unsigned char *) buf;
   str->size = size;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 Lisp_Object
 make_fixed_buffer_output_stream (void *buf, Bytecount size)
 {
-  Lisp_Object obj;
   Lstream *lstr = Lstream_new (lstream_fixed_buffer, "w");
   struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (lstr);
   str->outbuf = (unsigned char *) buf;
   str->size = size;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 static Bytecount
@@ -1449,9 +1438,7 @@
 Lisp_Object
 make_resizing_buffer_output_stream (void)
 {
-  Lisp_Object obj;
-  XSETLSTREAM (obj, Lstream_new (lstream_resizing_buffer, "w"));
-  return obj;
+  return wrap_lstream (Lstream_new (lstream_resizing_buffer, "w"));
 }
 
 static Bytecount
@@ -1517,8 +1504,8 @@
 Lisp_Object
 make_dynarr_output_stream (unsigned_char_dynarr *dyn)
 {
-  Lisp_Object obj;
-  XSETLSTREAM (obj, Lstream_new (lstream_dynarr, "w"));
+  Lisp_Object obj = wrap_lstream (Lstream_new (lstream_dynarr, "w"));
+
   DYNARR_STREAM_DATA (XLSTREAM (obj))->dyn = dyn;
   return obj;
 }
@@ -1569,7 +1556,6 @@
 make_lisp_buffer_stream_1 (struct buffer *buf, Charbpos start, Charbpos end,
 			   int flags, const char *mode)
 {
-  Lisp_Object obj;
   Lstream *lstr;
   struct lisp_buffer_stream *str;
   Charbpos bmin, bmax;
@@ -1607,9 +1593,8 @@
   str = LISP_BUFFER_STREAM_DATA (lstr);
   {
     Lisp_Object marker;
-    Lisp_Object buffer;
+    Lisp_Object buffer = wrap_buffer (buf);
 
-    XSETBUFFER (buffer, buf);
     marker = Fmake_marker ();
     Fset_marker (marker, make_int (start), buffer);
     str->start = marker;
@@ -1627,8 +1612,7 @@
     str->buffer = buffer;
   }
   str->flags = flags;
-  XSETLSTREAM (obj, lstr);
-  return obj;
+  return wrap_lstream (lstr);
 }
 
 Lisp_Object
--- a/src/lstream.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/lstream.h	Fri Mar 29 04:49:13 2002 +0000
@@ -32,7 +32,6 @@
 
 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_record (p, lstream)
 #define LSTREAMP(x) RECORDP (x, lstream)
 /* #define CHECK_LSTREAM(x) CHECK_RECORD (x, lstream)
--- a/src/marker.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/marker.c	Fri Mar 29 04:49:13 2002 +0000
@@ -48,7 +48,7 @@
   if (!marker->buffer)
     return (Qnil);
 
-  XSETBUFFER (buf, marker->buffer);
+  buf = wrap_buffer (marker->buffer);
   return (buf);
 }
 
@@ -120,9 +120,7 @@
   /* Return marker's buffer only if it is not dead.  */
   if ((buf = XMARKER (marker)->buffer) && BUFFER_LIVE_P (buf))
     {
-      Lisp_Object buffer;
-      XSETBUFFER (buffer, buf);
-      return buffer;
+      return wrap_buffer (buf);
     }
   return Qnil;
 }
@@ -531,9 +529,8 @@
 void
 init_buffer_markers (struct buffer *b)
 {
-  Lisp_Object buf;
+  Lisp_Object buf = wrap_buffer (b);
 
-  XSETBUFFER (buf, b);
   b->mark = Fmake_marker ();
   BUF_MARKERS (b) = 0;
   b->point_marker = Fmake_marker ();
--- a/src/menubar-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/menubar-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -563,7 +563,7 @@
 {
   Lisp_Object callback, function, data, channel;
 
-  XSETFRAME (channel, __get_channel (GTK_WIDGET (item)));
+  channel = wrap_frame (__get_channel (GTK_WIDGET (item)));
 
   VOID_TO_LISP (callback, user_data);
 
@@ -748,12 +748,13 @@
 	    }
 	  else if (SYMBOLP (callback))
 	    {
-	      char buf[1024];
+	      DECLARE_EISTRING_MALLOC (buf);
 
 	      /* #### Warning, dependency here on current_buffer and point */
 	      where_is_to_char (callback, buf);
 
-	      keys = build_string (buf);
+	      keys = eimake_string (buf);
+	      eifree (buf);
 	    }
 	}
 
--- a/src/menubar-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/menubar-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -775,7 +775,7 @@
 
   /* Ok, this is our one. Enqueue it. */
   get_gui_callback (data, &fn, &arg);
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   /* this used to call mswindows_enqueue_misc_user_event but that
      breaks customize because the misc_event gets eval'ed in some
      circumstances. Don't change it back unless you can fix the
--- a/src/menubar-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/menubar-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -435,7 +435,7 @@
     return;
 
   /* make sure f is the selected frame */
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   Fselect_frame (frame);
 
   if (client_data)
@@ -579,7 +579,7 @@
       mdata->id = new_lwlib_id ();
       mdata->last_menubar_buffer = Qnil;
       mdata->menubar_contents_up_to_date = 0;
-      XSETPOPUP_DATA (FRAME_MENUBAR_DATA (f), mdata);
+      FRAME_MENUBAR_DATA (f) = wrap_popup_data (mdata);
     }
 
   /***** now store into the menubar widget, creating it if necessary *****/
@@ -780,9 +780,8 @@
   Widget menu;
   Lisp_Event *eev = NULL;
   XEvent xev;
-  Lisp_Object frame;
+  Lisp_Object frame = wrap_frame (f);
 
-  XSETFRAME (frame, f);
   CHECK_X_FRAME (frame);
   parent = FRAME_X_SHELL_WIDGET (f);
 
--- a/src/menubar.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/menubar.c	Fri Mar 29 04:49:13 2002 +0000
@@ -328,7 +328,6 @@
        (name, buffer))
 {
   struct buffer *buf = decode_buffer (buffer, 0);
-  Lisp_String *n;
   Charcount end;
   int i;
   Intbyte *name_data;
@@ -339,9 +338,8 @@
 
   CHECK_STRING (name);
 
-  n = XSTRING (name);
-  end = string_char_length (n);
-  name_data = string_data (n);
+  end = XSTRING_CHAR_LENGTH (name);
+  name_data = XSTRING_DATA (name);
 
   string_result = (Intbyte *) alloca (end * MAX_EMCHAR_LEN);
   string_result_ptr = string_result;
--- a/src/minibuf.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/minibuf.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 /* Minibuffer input and completion.
    Copyright (C) 1985, 1986, 1992-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -400,7 +401,7 @@
 	      elt = bucket;
 	      eltstring = Fsymbol_name (elt);
               if (next)
-		XSETSYMBOL (bucket, next);
+		bucket = wrap_symbol (next);
 	      else
 		bucket = Qzero;
 	    }
@@ -601,7 +602,7 @@
 	      elt = bucket;
 	      eltstring = Fsymbol_name (elt);
               if (next)
-		XSETSYMBOL (bucket, next);
+		bucket = wrap_symbol (next);
 	      else
 		bucket = Qzero;
             }
@@ -621,8 +622,8 @@
           /* Reject alternatives that start with space
 	     unless the input starts with space.  */
 	  && ((XSTRING_CHAR_LENGTH (string) > 0 &&
-	       string_char (XSTRING (string), 0) == ' ')
-	      || string_char (XSTRING (eltstring), 0) != ' ')
+	       XSTRING_CHAR (string, 0) == ' ')
+	      || XSTRING_CHAR (eltstring, 0) != ' ')
 	  && (0 > scmp (XSTRING_DATA (eltstring),
                         XSTRING_DATA (string),
                         slength)))
@@ -680,9 +681,8 @@
   /* This function can call lisp */
   if (!NILP (Ffboundp (Qclear_message)))
     {
-      Lisp_Object frame;
+      Lisp_Object frame = wrap_frame (f);
 
-      XSETFRAME (frame, f);
       return call4 (Qclear_message, label, frame, from_print ? Qt : Qnil,
 		    no_restore ? Qt : Qnil);
     }
@@ -746,7 +746,7 @@
 	  obj = make_string (nonreloc + offset, length);
 	}
 
-      XSETFRAME (frame, f);
+      frame = wrap_frame (f);
       GCPRO1 (obj);
       call4 (Qappend_message, label, obj, frame,
 	     EQ (label, Qprint) ? Qt : Qnil);
@@ -786,9 +786,8 @@
   /* This function can call lisp */
   if (!NILP (Ffboundp (Qcurrent_message_label)))
     {
-      Lisp_Object frame;
+      Lisp_Object frame = wrap_frame (f);
 
-      XSETFRAME (frame, f);
       return call1 (Qcurrent_message_label, frame);
     }
   else
--- a/src/mule-canna.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/mule-canna.c	Fri Mar 29 04:49:13 2002 +0000
@@ -511,8 +511,7 @@
 #endif /* CANNA_MULE */
   ksv.ks = &ks;
   len = jrKanjiControl (0, KC_DEFINEKANJI, (char *)&ksv);
-  val = storeResults (key_buffer, ksv.val, ksv.ks);
-  return val;
+  return storeResults (key_buffer, ksv.val, ksv.ks);
 }
 
 DEFUN ("canna-set-width", Fcanna_set_width, 1, 1, 0, /*
@@ -543,8 +542,7 @@
   ksv.ks = &ks;
   ksv.val = XINT (num);
   jrKanjiControl (0, KC_CHANGEMODE,  (char *)&ksv);
-  val = storeResults (key_buffer, ksv.val, ksv.ks);
-  return val;
+  return storeResults (key_buffer, ksv.val, ksv.ks);
 }
 
 static Lisp_Object
@@ -639,8 +637,7 @@
   ksv.ks = &ks;
   ksv.val = XINT (num);
   jrKanjiControl (0, KC_DO, (char *) &ksv);
-  val = storeResults (key_buffer, ksv.val, ksv.ks);
-  return val;
+  return storeResults (key_buffer, ksv.val, ksv.ks);
 }
 
 DEFUN ("canna-parse", Fcanna_parse, 1, 1, 0, /*
--- a/src/mule-ccl.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/mule-ccl.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2013,7 +2013,7 @@
     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]);
+    XVECTOR (reg)->contents[i] = make_int (ccl.reg[i]);
   return Qnil;
 }
 
@@ -2063,7 +2063,7 @@
   for (i = 0; i < 8; i++)
     {
       if (NILP (XVECTOR_DATA (status)[i]))
-	XSETINT (XVECTOR_DATA (status)[i], 0);
+	XVECTOR_DATA (status)[i] = make_int (0);
       if (INTP (XVECTOR_DATA (status)[i]))
 	ccl.reg[i] = XINT (XVECTOR_DATA (status)[i]);
     }
@@ -2080,8 +2080,8 @@
 			 (int *) 0,
 			 CCL_MODE_DECODING);
   for (i = 0; i < 8; i++)
-    XSETINT (XVECTOR_DATA (status)[i], ccl.reg[i]);
-  XSETINT (XVECTOR_DATA (status)[8], ccl.ic);
+    XVECTOR_DATA (status)[i] = make_int (ccl.reg[i]);
+  XVECTOR_DATA (status)[8] = make_int (ccl.ic);
   UNGCPRO;
 
   val = make_string (Dynarr_atp (outbuf, 0), produced);
--- a/src/mule-charset.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/mule-charset.c	Fri Mar 29 04:49:13 2002 +0000
@@ -139,7 +139,7 @@
 
   if (print_readably)
     printing_unreadable_object ("#<charset %s 0x%x>",
-				string_data (XSYMBOL (CHARSET_NAME (cs))->
+				XSTRING_DATA (XSYMBOL (CHARSET_NAME (cs))->
 					     name),
 				cs->header.uid);
 
@@ -215,7 +215,7 @@
     {
       cs = alloc_lcrecord_type (Lisp_Charset, &lrecord_charset);
       zero_lcrecord (cs);
-      XSETCHARSET (obj, cs);
+      obj = wrap_charset (cs);
 
       if (final)
 	{
@@ -591,15 +591,11 @@
   else
     type = (chars == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96;
 
-  existing_charset = CHARSET_BY_ATTRIBUTES (type, final,
-					    CHARSET_LEFT_TO_RIGHT);
-  if (NILP (existing_charset))
-    existing_charset = CHARSET_BY_ATTRIBUTES (type, final,
-					      CHARSET_RIGHT_TO_LEFT);
+  existing_charset = CHARSET_BY_ATTRIBUTES (type, final, direction);
 
   if (!NILP (existing_charset) && !XCHARSET (existing_charset)->temporary)
     invalid_argument
-      ("Character set already defined for this DIMENSION/CHARS/FINAL combo",
+      ("Character set already defined for this DIMENSION/CHARS/FINAL/DIRECTION combo",
        existing_charset);
 
   if (!NILP (existing_charset))
@@ -620,7 +616,7 @@
   if (NILP (registry))
     registry = build_string ("");
   if (NILP (short_name))
-    XSETSTRING (short_name, XSYMBOL (name)->name);
+    short_name = XSYMBOL (name)->name;
   if (NILP (long_name))
     long_name = doc_string;
   if (columns == -1)
@@ -634,6 +630,18 @@
   if (!NILP (ccl_program))
     XCHARSET_CCL_PROGRAM (charset) = ccl_program;
 
+  {
+    Lisp_Object revdircs =
+      CHARSET_BY_ATTRIBUTES (type, final,
+			     direction == CHARSET_LEFT_TO_RIGHT ?
+			     CHARSET_RIGHT_TO_LEFT : CHARSET_LEFT_TO_RIGHT);
+    if (!NILP (revdircs))
+      {
+	XCHARSET_REVERSE_DIRECTION_CHARSET (revdircs) = charset;
+	XCHARSET_REVERSE_DIRECTION_CHARSET (charset) = revdircs;
+      }
+  }
+
   return charset;
 }
 
@@ -654,7 +662,7 @@
   charset = Fget_charset (charset);
   if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset)))
     invalid_operation ("Charset already has reverse-direction charset",
-			 charset);
+		       charset);
 
   CHECK_SYMBOL (new_name);
   if (!NILP (Ffind_charset (new_name)))
@@ -687,8 +695,6 @@
   return new_charset;
 }
 
-/* #### Reverse direction charsets not yet implemented.  */
-#if 0
 DEFUN ("charset-reverse-direction-charset", Fcharset_reverse_direction_charset,
        1, 1, 0, /*
 Return the reverse-direction charset parallel to CHARSET, if any.
@@ -701,7 +707,6 @@
   charset = Fget_charset (charset);
   return XCHARSET_REVERSE_DIRECTION_CHARSET (charset);
 }
-#endif
 
 DEFUN ("charset-from-attributes", Fcharset_from_attributes, 3, 4, 0, /*
 Return a charset with the given DIMENSION, CHARS, FINAL, and DIRECTION.
@@ -832,7 +837,7 @@
 */
 	(charset))
 {
-  return make_int(XCHARSET_LEADING_BYTE (Fget_charset (charset)));
+  return make_int (XCHARSET_LEADING_BYTE (Fget_charset (charset)));
 }
 
 /* #### We need to figure out which properties we really want to
@@ -963,7 +968,7 @@
   DEFSUBR (Fcharset_name);
   DEFSUBR (Fmake_charset);
   DEFSUBR (Fmake_reverse_direction_charset);
-  /*  DEFSUBR (Freverse_direction_charset); */
+  DEFSUBR (Fcharset_reverse_direction_charset);
   DEFSUBR (Fcharset_from_attributes);
   DEFSUBR (Fcharset_short_name);
   DEFSUBR (Fcharset_long_name);
--- a/src/mule-wnnfns.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/mule-wnnfns.c	Fri Mar 29 04:49:13 2002 +0000
@@ -765,8 +765,7 @@
   val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
   jl_get_kanji (wnnfns_buf[snum], bun_no, bun_no + 1, wbuf);
   w2m (wbuf, cbuf, lb);
-  val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
-  return val;
+  return Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
 }
 
 
--- a/src/native-gtk-toolbar.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/native-gtk-toolbar.c	Fri Mar 29 04:49:13 2002 +0000
@@ -152,7 +152,8 @@
 	  /* #### It is currently possible for users to trash us by directly
 	     changing the toolbar glyphs.  Avoid crashing in that case. */
 	  if (GLYPHP (glyph))
-	    instance = glyph_image_instance (glyph, window, ERROR_ME_NOT, 1);
+	    instance = glyph_image_instance (glyph, window,
+					     ERROR_ME_DEBUG_WARN, 1);
 	  else
 	    instance = Qnil;
 	  
--- a/src/objects-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/objects-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -31,8 +31,7 @@
    Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
  */
 
-/* This function mostly Mule-ized (except perhaps some Unicode splitting).
-   5-2000. */
+/* This function Mule-ized by Ben Wing, 3-24-02. */
 
 /* TODO: palette handling */
 
@@ -1268,12 +1267,11 @@
 				Lisp_Object printcharfun,
 				int escapeflag)
 {
-  Char_ASCII buf[32];
   COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c);
-  sprintf (buf, " %06ld=(%04X,%04X,%04X)", color & 0xffffff,
-	   GetRValue (color) * 257, GetGValue (color) * 257,
-	   GetBValue (color) * 257);
-  write_c_string (buf, printcharfun);
+  write_fmt_string (printcharfun,
+		    " %06ld=(%04X,%04X,%04X)", color & 0xffffff,
+		    GetRValue (color) * 257, GetGValue (color) * 257,
+		    GetBValue (color) * 257);
 }
 
 static void
@@ -1291,14 +1289,14 @@
 				Lisp_Color_Instance *c2,
 				int depth)
 {
-  return (COLOR_INSTANCE_MSWINDOWS_COLOR(c1) ==
-	  COLOR_INSTANCE_MSWINDOWS_COLOR(c2));
+  return (COLOR_INSTANCE_MSWINDOWS_COLOR (c1) ==
+	  COLOR_INSTANCE_MSWINDOWS_COLOR (c2));
 }
 
 static unsigned long
 mswindows_color_instance_hash (Lisp_Color_Instance *c, int depth)
 {
-  return (unsigned long) COLOR_INSTANCE_MSWINDOWS_COLOR(c);
+  return (unsigned long) COLOR_INSTANCE_MSWINDOWS_COLOR (c);
 }
 
 static Lisp_Object
@@ -1678,10 +1676,10 @@
 			       Lisp_Object printcharfun,
 			       int escapeflag)
 {
-  Intbyte buf[10];
-  qxesprintf (buf, " 0x%lx",
-	      (unsigned long)FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0));
-  write_string (buf, printcharfun);
+  write_fmt_string (printcharfun, " 0x%lx",
+		    (unsigned long)
+		    FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0));
+
 }
 
 static Lisp_Object
@@ -1729,12 +1727,12 @@
      with initialize_font_instance(). */
 
   int nsep = 0;
-  CIntbyte *ptr = (CIntbyte *) XSTRING_DATA (f->name);
-  CIntbyte *name = (CIntbyte *) alloca (XSTRING_LENGTH (f->name) + 19);
+  Intbyte *ptr = (Intbyte *) XSTRING_DATA (f->name);
+  Intbyte *name = (Intbyte *) alloca (XSTRING_LENGTH (f->name) + 19);
 
-  strcpy (name, ptr);
+  qxestrcpy (name, ptr);
 
-  while ((ptr = strchr (ptr, ':')) != 0)
+  while ((ptr = qxestrchr (ptr, ':')) != 0)
     {
       ptr++;
       nsep++;
@@ -1743,16 +1741,16 @@
   switch (nsep)
     {
     case 0:
-      strcat (name, ":Regular:10::Western");
+      qxestrcat (name, ":Regular:10::Western");
       break;
     case 1:
-      strcat (name, ":10::Western");
+      qxestrcat (name, ":10::Western");
       break;
     case 2:
-      strcat (name, "::Western");
+      qxestrcat (name, "::Western");
       break;
     case 3:
-      strcat (name, ":Western");
+      qxestrcat (name, ":Western");
       break;
     default:;
     }
@@ -1870,7 +1868,8 @@
 	HDC hdc = CreateCompatibleDC (NULL);
 	Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (d);
 	HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
-						   font_list, ERROR_ME_NOT);
+						   font_list,
+						   ERROR_ME_DEBUG_WARN);
 
 	if (!hfont || !(hfont = (HFONT) SelectObject (hdc, hfont)))
 	  {
--- a/src/objects-tty.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/objects-tty.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* TTY-specific Lisp objects.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2001 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -299,9 +299,8 @@
     return 0;
   the_nonreloc++;
   {
-    Lisp_String *s = symbol_name (XSYMBOL (XCHARSET_NAME (charset)));
-    return !strcmp ((const char *) the_nonreloc,
-		    (const char *) string_data (s));
+    Lisp_Object s = symbol_name (XSYMBOL (XCHARSET_NAME (charset)));
+    return !qxestrcmp (the_nonreloc, XSTRING_DATA (s));
   }
 }
 
--- a/src/objects-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/objects-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -790,8 +790,8 @@
       }
       if (NILP (FONT_INSTANCE_X_TRUENAME (f)))
 	{
-	  Lisp_Object font_instance;
-	  XSETFONT_INSTANCE (font_instance, f);
+	  Lisp_Object font_instance = wrap_font_instance (f);
+
 
 	  maybe_signal_error (Qgui_error, "Couldn't determine font truename",
 			      font_instance, Qfont, errb);
--- a/src/objects.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/objects.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* Generic Objects and Functions.
    Copyright (C) 1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -43,8 +43,8 @@
 void
 finalose (void *ptr)
 {
-  Lisp_Object obj;
-  XSETOBJ (obj, ptr);
+  Lisp_Object obj = wrap_pointer_1 (ptr);
+
 
   invalid_operation
     ("Can't dump an emacs containing window system objects", obj);
@@ -151,11 +151,10 @@
        (name, device, noerror))
 {
   Lisp_Color_Instance *c;
-  Lisp_Object val;
   int retval;
 
   CHECK_STRING (name);
-  XSETDEVICE (device, decode_device (device));
+  device = wrap_device (decode_device (device));
 
   c = alloc_lcrecord_type (Lisp_Color_Instance, &lrecord_color_instance);
   c->name = name;
@@ -168,8 +167,7 @@
   if (!retval)
     return Qnil;
 
-  XSETCOLOR_INSTANCE (val, c);
-  return val;
+  return wrap_color_instance (c);
 }
 
 DEFUN ("color-instance-p", Fcolor_instance_p, 1, 1, 0, /*
@@ -287,15 +285,18 @@
 font_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
 {
   /* #### should this be moved into a device method? */
-  return internal_equal (font_instance_truename_internal (obj1, ERROR_ME_NOT),
-			 font_instance_truename_internal (obj2, ERROR_ME_NOT),
+  return internal_equal (font_instance_truename_internal
+			 (obj1, ERROR_ME_DEBUG_WARN),
+			 font_instance_truename_internal
+			 (obj2, ERROR_ME_DEBUG_WARN),
 			 depth + 1);
 }
 
 static unsigned long
 font_instance_hash (Lisp_Object obj, int depth)
 {
-  return internal_hash (font_instance_truename_internal (obj, ERROR_ME_NOT),
+  return internal_hash (font_instance_truename_internal
+			(obj, ERROR_ME_DEBUG_WARN),
 			depth + 1);
 }
 
@@ -319,7 +320,6 @@
        (name, device, noerror))
 {
   Lisp_Font_Instance *f;
-  Lisp_Object val;
   int retval = 0;
   Error_Behavior errb = decode_error_behavior_flag (noerror);
 
@@ -328,7 +328,7 @@
   else if (!STRINGP (name))
     return Qnil;
 
-  XSETDEVICE (device, decode_device (device));
+  device = wrap_device (decode_device (device));
 
   f = alloc_lcrecord_type (Lisp_Font_Instance, &lrecord_font_instance);
   f->name = name;
@@ -348,8 +348,7 @@
   if (!retval)
     return Qnil;
 
-  XSETFONT_INSTANCE (val, f);
-  return val;
+  return wrap_font_instance (f);
 }
 
 DEFUN ("font-instance-p", Ffont_instance_p, 1, 1, 0, /*
@@ -468,7 +467,7 @@
        (pattern, device))
 {
   CHECK_STRING (pattern);
-  XSETDEVICE (device, decode_device (device));
+  device = wrap_device (decode_device (device));
 
   return MAYBE_LISP_DEVMETH (XDEVICE (device), list_fonts, (pattern, device));
 }
@@ -1094,7 +1093,7 @@
     c->device = Qnil;
     c->data = 0;
 
-    XSETCOLOR_INSTANCE (Vthe_null_color_instance, c);
+    Vthe_null_color_instance = wrap_color_instance (c);
   }
 
   staticpro_nodump (&Vthe_null_font_instance);
@@ -1110,7 +1109,7 @@
     f->width = 0;
     f->proportional_p = 0;
 
-    XSETFONT_INSTANCE (Vthe_null_font_instance, f);
+    Vthe_null_font_instance = wrap_font_instance (f);
   }
 }
 
--- a/src/objects.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/objects.h	Fri Mar 29 04:49:13 2002 +0000
@@ -45,7 +45,6 @@
 
 DECLARE_SPECIFIER_TYPE (color);
 #define XCOLOR_SPECIFIER(x) XSPECIFIER_TYPE (x, color)
-#define XSETCOLOR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, color)
 #define COLOR_SPECIFIERP(x) SPECIFIER_TYPEP (x, color)
 #define CHECK_COLOR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, color)
 #define CONCHECK_COLOR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, color)
@@ -70,7 +69,6 @@
 
 DECLARE_SPECIFIER_TYPE (font);
 #define XFONT_SPECIFIER(x) XSPECIFIER_TYPE (x, font)
-#define XSETFONT_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, font)
 #define FONT_SPECIFIERP(x) SPECIFIER_TYPEP (x, font)
 #define CHECK_FONT_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, font)
 #define CONCHECK_FONT_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, font)
@@ -96,8 +94,6 @@
 DECLARE_SPECIFIER_TYPE (face_boolean);
 extern Lisp_Object Qface_boolean;
 #define XFACE_BOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, face_boolean)
-#define XSETFACE_BOOLEAN_SPECIFIER(x, p) \
-  XSETSPECIFIER_TYPE (x, p, face_boolean)
 #define FACE_BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, face_boolean)
 #define CHECK_FACE_BOOLEAN_SPECIFIER(x) \
   CHECK_SPECIFIER_TYPE (x, face_boolean)
@@ -127,7 +123,6 @@
 
 DECLARE_LRECORD (color_instance, Lisp_Color_Instance);
 #define XCOLOR_INSTANCE(x) XRECORD (x, color_instance, Lisp_Color_Instance)
-#define XSETCOLOR_INSTANCE(x, p) XSETRECORD (x, p, color_instance)
 #define wrap_color_instance(p) wrap_record (p, color_instance)
 #define COLOR_INSTANCEP(x) RECORDP (x, color_instance)
 #define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance)
@@ -142,7 +137,6 @@
 
 DECLARE_LRECORD (font_instance, Lisp_Font_Instance);
 #define XFONT_INSTANCE(x) XRECORD (x, font_instance, Lisp_Font_Instance)
-#define XSETFONT_INSTANCE(x, p) XSETRECORD (x, p, font_instance)
 #define wrap_font_instance(p) wrap_record (p, font_instance)
 #define FONT_INSTANCEP(x) RECORDP (x, font_instance)
 #define CHECK_FONT_INSTANCE(x) CHECK_RECORD (x, font_instance)
--- a/src/opaque.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/opaque.c	Fri Mar 29 04:49:13 2002 +0000
@@ -84,9 +84,7 @@
     memcpy (p->data, data, size);
 
   {
-    Lisp_Object val;
-    XSETOPAQUE (val, p);
-    return val;
+    return wrap_opaque (p);
   }
 }
 
--- a/src/opaque.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/opaque.h	Fri Mar 29 04:49:13 2002 +0000
@@ -35,7 +35,6 @@
 
 DECLARE_LRECORD (opaque, Lisp_Opaque);
 #define XOPAQUE(x) XRECORD (x, opaque, Lisp_Opaque)
-#define XSETOPAQUE(x, p) XSETRECORD (x, p, opaque)
 #define wrap_opaque(p) wrap_record (p, opaque)
 #define OPAQUEP(x) RECORDP (x, opaque)
 /* #define CHECK_OPAQUE(x) CHECK_RECORD (x, opaque)
@@ -63,7 +62,6 @@
 
 DECLARE_LRECORD (opaque_ptr, Lisp_Opaque_Ptr);
 #define XOPAQUE_PTR(x) XRECORD (x, opaque_ptr, Lisp_Opaque_Ptr)
-#define XSETOPAQUE_PTR(x, p) XSETRECORD (x, p, opaque_ptr)
 #define wrap_opaque_ptr(p) wrap_record (p, opaque_ptr)
 #define OPAQUE_PTRP(x) RECORDP (x, opaque_ptr)
 
--- a/src/postgresql.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/postgresql.c	Fri Mar 29 04:49:13 2002 +0000
@@ -173,9 +173,7 @@
 static Lisp_Object
 make_pgconn (Lisp_PGconn *pgconn)
 {
-  Lisp_Object lisp_pgconn;
-  XSETPGCONN (lisp_pgconn, pgconn);
-  return lisp_pgconn;
+  return wrap_pgconn (pgconn);
 }
 
 static Lisp_Object
@@ -277,9 +275,7 @@
 static Lisp_Object
 make_pgresult (Lisp_PGresult *pgresult)
 {
-  Lisp_Object lisp_pgresult;
-  XSETPGRESULT (lisp_pgresult, pgresult);
-  return lisp_pgresult;
+  return wrap_pgresult (pgresult);
 }
 
 static Lisp_Object
--- a/src/postgresql.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/postgresql.h	Fri Mar 29 04:49:13 2002 +0000
@@ -36,7 +36,6 @@
 DECLARE_LRECORD (pgconn, Lisp_PGconn);
 
 #define XPGCONN(x) XRECORD (x, pgconn, Lisp_PGconn)
-#define XSETPGCONN(x, p) XSETRECORD (x, p, pgconn)
 #define wrap_pgconn(p) wrap_record (p, pgconn)
 #define PGCONNP(x) RECORDP (x, pgconn)
 #define CHECK_PGCONN(x) CHECK_RECORD (x, pgconn)
@@ -57,7 +56,6 @@
 DECLARE_LRECORD (pgresult, Lisp_PGresult);
 
 #define XPGRESULT(x) XRECORD (x, pgresult, Lisp_PGresult)
-#define XSETPGRESULT(x, p) XSETRECORD (x, p, pgresult)
 #define wrap_pgresult(p) wrap_record (p, pgresult)
 #define PGRESULTP(x) RECORDP (x, pgresult)
 #define CHECK_PGRESULT(x) CHECK_RECORD (x, pgresult)
--- a/src/print.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/print.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Lisp object printing and output streams.
    Copyright (C) 1985, 1986, 1988, 1992-1995 Free Software Foundation, Inc.
-   Copyright (C) 1995, 1996, 2000, 2001 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -324,7 +324,7 @@
 
   if (STRINGP (reloc))
     {
-      cclen = XSTRING_OFFSET_BYTE_TO_CHAR_LEN (reloc, offset, len);
+      cclen = string_offset_byte_to_char_len (reloc, offset, len);
       newnonreloc = XSTRING_DATA (reloc);
     }
   else
@@ -405,7 +405,7 @@
       Charcount iii;
 
       if (STRINGP (reloc))
-	ccoff = XSTRING_INDEX_BYTE_TO_CHAR (reloc, offset);
+	ccoff = string_index_byte_to_char (reloc, offset);
       else
 	ccoff = bytecount_to_charcount (newnonreloc, offset);
 
@@ -564,6 +564,12 @@
   write_string_1 ((const Intbyte *) str, strlen (str), stream);
 }
 
+void
+write_eistring (const Eistring *ei, Lisp_Object stream)
+{
+  write_string_1 (eidata (ei), eilen (ei), stream);
+}
+
 /* Write a printf-style string to STREAM; see output_string(). */
 
 void
@@ -662,7 +668,7 @@
   current_buffer->read_only = Qnil;
   Ferase_buffer (Qnil);
 
-  XSETBUFFER (buf, current_buffer);
+  buf = wrap_buffer (current_buffer);
   specbind (Qstandard_output, buf);
 
   set_buffer_internal (old);
@@ -1278,12 +1284,11 @@
 void
 print_string (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
-  Lisp_String *s = XSTRING (obj);
   /* We distinguish between Bytecounts and Charcounts, to make
      Vprint_string_length work correctly under Mule.  */
-  Charcount size = string_char_length (s);
+  Charcount size = XSTRING_CHAR_LENGTH (obj);
   Charcount max = size;
-  Bytecount bcmax = string_length (s);
+  Bytecount bcmax = XSTRING_LENGTH (obj);
   struct gcpro gcpro1, gcpro2;
   GCPRO2 (obj, printcharfun);
 
@@ -1291,7 +1296,7 @@
       XINT (Vprint_string_length) < max)
     {
       max = XINT (Vprint_string_length);
-      bcmax = string_index_char_to_byte (s, max);
+      bcmax = string_index_char_to_byte (obj, max);
     }
   if (max < 0)
     {
@@ -1313,7 +1318,7 @@
       write_char_internal ("\"", printcharfun);
       for (i = 0; i < bcmax; i++)
 	{
-	  Intbyte ch = string_byte (s, i);
+	  Intbyte ch = XSTRING_BYTE (obj, i);
 	  if (ch == '\"' || ch == '\\'
 	      || (ch == '\n' && print_escape_newlines))
 	    {
@@ -1331,7 +1336,7 @@
 		  write_char_internal ("\\", printcharfun);
 		  /* This is correct for Mule because the
 		     character is either \ or " */
-		  write_char_internal (string_data (s) + i, printcharfun);
+		  write_char_internal (XSTRING_DATA (obj) + i, printcharfun);
 		}
 	      last = i + 1;
 	    }
@@ -1440,12 +1445,12 @@
 		{
 		  Lisp_String *l = (Lisp_String *) lheader;
 		  if (!debug_can_access_memory
-		      (l->data, l->size))
+		      (l->data_, l->size_))
 		    {
 		      char buf[128];
 		  
 		      sprintf (buf, "#<EMACS BUG: %p (BAD STRING DATA %p)>",
-			       lheader, l->data);
+			       lheader, l->data_);
 		      write_c_string (buf, printcharfun);
 		      return;
 		    }
@@ -1635,16 +1640,14 @@
   /* This function can GC */
   /* #### Bug!! (intern "") isn't printed in some distinguished way */
   /* ####  (the reader also loses on it) */
-  Lisp_String *name = symbol_name (XSYMBOL (obj));
-  Bytecount size = string_length (name);
+  Lisp_Object name = symbol_name (XSYMBOL (obj));
+  Bytecount size = XSTRING_LENGTH (name);
   struct gcpro gcpro1, gcpro2;
 
   if (!escapeflag)
     {
       /* This deals with GC-relocation */
-      Lisp_Object nameobj;
-      XSETSTRING (nameobj, name);
-      output_string (printcharfun, 0, nameobj, 0, size);
+      output_string (printcharfun, 0, name, 0, size);
       return;
     }
   GCPRO2 (obj, printcharfun);
@@ -1656,8 +1659,8 @@
       /* #### Test whether this produces a noticeable slow-down for
          printing when print-gensym is non-nil.  */
       && !EQ (obj, oblookup (Vobarray,
-			     string_data (symbol_name (XSYMBOL (obj))),
-			     string_length (symbol_name (XSYMBOL (obj))))))
+			     XSTRING_DATA (symbol_name (XSYMBOL (obj))),
+			     XSTRING_LENGTH (symbol_name (XSYMBOL (obj))))))
     {
       if (print_depth > 1)
 	{
@@ -1678,10 +1681,10 @@
                      have to be careful.  */
 		  CHECK_CONS (XCAR (Vprint_gensym_alist));
 		  CHECK_INT (XCDR (XCAR (Vprint_gensym_alist)));
-		  XSETINT (tem, XINT (XCDR (XCAR (Vprint_gensym_alist))) + 1);
+		  tem = make_int (XINT (XCDR (XCAR (Vprint_gensym_alist))) + 1);
 		}
 	      else
-		XSETINT (tem, 1);
+		tem = make_int (1);
 	      Vprint_gensym_alist = Fcons (Fcons (obj, tem), Vprint_gensym_alist);
 
 	      write_char_internal ("#", printcharfun);
@@ -1694,7 +1697,7 @@
 
   /* Does it look like an integer or a float? */
   {
-    Intbyte *data = string_data (name);
+    Intbyte *data = XSTRING_DATA (name);
     Bytecount confusing = 0;
 
     if (size == 0)
@@ -1730,14 +1733,12 @@
   }
 
   {
-    Lisp_Object nameobj;
     Bytecount i;
     Bytecount last = 0;
 
-    XSETSTRING (nameobj, name);
     for (i = 0; i < size; i++)
       {
-	switch (string_byte (name, i))
+	switch (XSTRING_BYTE (name, i))
 	  {
 	  case  0: case  1: case  2: case  3:
 	  case  4: case  5: case  6: case  7:
@@ -1752,12 +1753,12 @@
 	  case ',': case '.' : case '`' :
 	  case '[': case ']' : case '?' :
 	    if (i > last)
-	      output_string (printcharfun, 0, nameobj, last, i - last);
+	      output_string (printcharfun, 0, name, last, i - last);
 	    write_char_internal ("\\", printcharfun);
 	    last = i;
 	  }
       }
-    output_string (printcharfun, 0, nameobj, last, size - last);
+    output_string (printcharfun, 0, name, last, size - last);
   }
   UNGCPRO;
 }
--- a/src/process-unix.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/process-unix.c	Fri Mar 29 04:49:13 2002 +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, 2001 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -1610,7 +1610,7 @@
       EXTERNAL_TO_C_STRING (gai_strerror (retval), gai_error,
 			    Qstrerror_encoding);
       maybe_signal_error (Qio_error, gai_error, host,
-			  Qprocess, ERROR_ME_NOT);
+			  Qprocess, ERROR_ME_DEBUG_WARN);
       canonname = host;
     }
   else
--- a/src/process.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/process.c	Fri Mar 29 04:49:13 2002 +0000
@@ -471,7 +471,7 @@
   p->process_data = 0;
   MAYBE_PROCMETH (alloc_process_data, (p));
 
-  XSETPROCESS (val, p);
+  val = wrap_process (p);
 
   Vprocess_list = Fcons (val, Vprocess_list);
   return val;
@@ -518,7 +518,7 @@
   if (usid != USID_DONTHASH)
     {
       Lisp_Object process = Qnil;
-      XSETPROCESS (process, p);
+      process = wrap_process (p);
       puthash ((const void *) usid, LISP_TO_VOID (process), usid_to_process);
     }
 
@@ -1156,7 +1156,7 @@
   Charbpos bstart, bend;
   struct buffer *buf = decode_buffer (buffer, 0);
 
-  XSETBUFFER (buffer, buf);
+  buffer = wrap_buffer (buf);
   process = get_process (process);
   get_buffer_range_char (buf, start, end, &bstart, &bend, 0);
 
@@ -1376,8 +1376,8 @@
 	string2 = build_msg_string (" (core dumped)\n");
       else
 	string2 = build_string ("\n");
-      set_string_char (XSTRING (string), 0,
-		       DOWNCASE (0, string_char (XSTRING (string), 0)));
+      set_string_char (string, 0,
+		       DOWNCASE (0, XSTRING_CHAR (string, 0)));
       return concat2 (string, string2);
     }
   else if (EQ (symbol, Qexit))
@@ -1508,8 +1508,8 @@
 	      else
 		BUF_SET_PT (current_buffer, BUF_ZV (current_buffer));
 	      if (BUF_PT (current_buffer) <= opoint)
-		opoint += (string_char_length (XSTRING (msg))
-                           + string_char_length (XSTRING (p->name))
+		opoint += (XSTRING_CHAR_LENGTH (msg)
+                           + XSTRING_CHAR_LENGTH (p->name)
                            + 10);
 
 	      old_read_only = current_buffer->read_only;
@@ -1601,11 +1601,11 @@
       Intbyte *name;
 
       CHECK_SYMBOL (signal_);
-      name = string_data (XSYMBOL (signal_)->name);
+      name = XSTRING_DATA (XSYMBOL (signal_)->name);
 
-#define handle_signal(sym) do {				\
-	if (!strcmp ((const char *) name, #sym))	\
-	  return sym;					\
+#define handle_signal(sym) do {			\
+	if (!qxestrcmp_c ( name, #sym))		\
+	  return sym;				\
       } while (0)
 
       handle_signal (SIGINT);  /* ANSI */
--- a/src/process.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/process.h	Fri Mar 29 04:49:13 2002 +0000
@@ -24,7 +24,6 @@
 #if defined (NO_SUBPROCESSES)
 #undef XPROCESS
 #undef CHECK_PROCESS
-#undef XSETPROCESS
 #define PROCESSP(x) 0
 #define PROCESS_LIVE_P(x) 0
 #define Fprocess_status(x) Qnil
@@ -42,7 +41,6 @@
 
 DECLARE_LRECORD (process, Lisp_Process);
 #define XPROCESS(x) XRECORD (x, process, Lisp_Process)
-#define XSETPROCESS(x, p) XSETRECORD (x, p, process)
 #define wrap_process(p) wrap_record (p, process)
 #define PROCESSP(x) RECORDP (x, process)
 #define CHECK_PROCESS(x) CHECK_RECORD (x, process)
--- a/src/rangetab.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/rangetab.c	Fri Mar 29 04:49:13 2002 +0000
@@ -232,12 +232,10 @@
 */
        ())
 {
-  Lisp_Object obj;
   Lisp_Range_Table *rt = alloc_lcrecord_type (Lisp_Range_Table,
 					      &lrecord_range_table);
   rt->entries = Dynarr_new (range_table_entry);
-  XSETRANGE_TABLE (obj, rt);
-  return obj;
+  return wrap_range_table (rt);
 }
 
 DEFUN ("copy-range-table", Fcopy_range_table, 1, 1, 0, /*
@@ -248,7 +246,6 @@
        (range_table))
 {
   Lisp_Range_Table *rt, *rtnew;
-  Lisp_Object obj;
 
   CHECK_RANGE_TABLE (range_table);
   rt = XRANGE_TABLE (range_table);
@@ -258,8 +255,7 @@
 
   Dynarr_add_many (rtnew->entries, Dynarr_atp (rt->entries, 0),
 		   Dynarr_length (rt->entries));
-  XSETRANGE_TABLE (obj, rtnew);
-  return obj;
+  return wrap_range_table (rtnew);
 }
 
 DEFUN ("get-range-table", Fget_range_table, 2, 3, 0, /*
--- a/src/rangetab.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/rangetab.h	Fri Mar 29 04:49:13 2002 +0000
@@ -48,7 +48,6 @@
 
 DECLARE_LRECORD (range_table, Lisp_Range_Table);
 #define XRANGE_TABLE(x) XRECORD (x, range_table, Lisp_Range_Table)
-#define XSETRANGE_TABLE(x, p) XSETRECORD (x, p, range_table)
 #define wrap_range_table(p) wrap_record (p, range_table)
 #define RANGE_TABLEP(x) RECORDP (x, range_table)
 #define CHECK_RANGE_TABLE(x) CHECK_RECORD (x, range_table)
--- a/src/redisplay-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/redisplay-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -307,7 +307,7 @@
   Lisp_Object charset = Qunbound; /* Qnil is a valid charset when
 				     MULE is not defined */
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
   rb = Dynarr_atp (rba, start);
 
   if (!rb)
@@ -424,9 +424,9 @@
 						 start_pixpos, rb->width,
 						 &dbox, &dga);
 
-	      XSETWINDOW (window, w);
+	      window = wrap_window (w);
 	      instance = glyph_image_instance (rb->object.dglyph.glyph,
-					       window, ERROR_ME_NOT, 1);
+					       window, ERROR_ME_DEBUG_WARN, 1);
 	      findex = rb->findex;
 
 	      if (IMAGE_INSTANCEP (instance))
@@ -688,8 +688,8 @@
   int i;
   struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
 
-  XSETDEVICE (device, d);
-  XSETWINDOW (window, w);
+  device = wrap_device (d);
+  window = wrap_window (w);
 
   if (width < 0)
     width = gtk_text_width (f, cachel, Dynarr_atp (buf, 0), Dynarr_length (buf));
@@ -1129,7 +1129,7 @@
 
   GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   /* Output the pixmap. */
   {
@@ -1439,7 +1439,7 @@
       layout_bounds bounds;
 
       bounds = calculate_display_line_boundaries (w, bflag);
-      XSETWINDOW (window, w);
+      window = wrap_window (w);
 
       if (window_is_leftmost (w))
 	redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
@@ -1657,7 +1657,7 @@
   int cursor_height, cursor_y;
   int defheight, defascent;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
   redisplay_clear_region (window, findex, x, y, width, height);
 
   if (NILP (w->text_cursor_visible_p))
@@ -1745,7 +1745,7 @@
 
   gdk_window_clear_area (x_win, x, y, width, height);
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   if (!UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vdefault_face, frame))
       || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vleft_margin_face, frame))
@@ -1765,7 +1765,7 @@
   struct frame *f = device_selected_frame (d);
   struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f));
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
   tmp_fcolor = * (COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (tmp_pixel)));
--- a/src/redisplay-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/redisplay-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2,7 +2,7 @@
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1994 Lucid, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -453,7 +453,7 @@
   RECT rect;
   struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
 #if 0	/* #### FIXME? */
   /* We can't work out the width before we've set the font in the DC */
@@ -690,9 +690,6 @@
   HDC hdc = get_frame_dc (f, 1);
 
   Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
-  Lisp_Object window;
-
-  XSETWINDOW (window, w);
 
   /* Output the pixmap. Have to do this as many times as is required
    to fill the given area */
@@ -1037,7 +1034,7 @@
   int xpos, width;
   Lisp_Object charset = Qunbound; /* Qnil is a valid charset when
 				     MULE is not defined */
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
   rb = Dynarr_atp (rba, start);
 
   if (!rb)
@@ -1150,9 +1147,9 @@
 						 start_pixpos, rb->width,
 						 &dbox, &dga);
 
-	      XSETWINDOW (window, w);
+	      window = wrap_window (w);
 	      instance = glyph_image_instance (rb->object.dglyph.glyph,
-					       window, ERROR_ME_NOT, 1);
+					       window, ERROR_ME_DEBUG_WARN, 1);
 	      findex = rb->findex;
 
 	      if (IMAGE_INSTANCEP (instance))
--- a/src/redisplay-output.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/redisplay-output.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Synchronize redisplay structures and output changes.
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2002 Ben Wing.
    Copyright (C) 1996 Chuck Thompson.
    Copyright (C) 1999 Andy Piper.
 
@@ -248,9 +248,9 @@
          then clear in redisplay_output_layout (). */
       Lisp_Object window, image;
       Lisp_Image_Instance* ii;
-      XSETWINDOW (window, w);
+      window = wrap_window (w);
       image = glyph_image_instance (crb->object.dglyph.glyph,
-				    window, ERROR_ME_NOT, 1);
+				    window, ERROR_ME_DEBUG_WARN, 1);
 
       if (!IMAGE_INSTANCEP (image))
 	return 0;
@@ -376,7 +376,7 @@
   if (Dynarr_length (db->runes) <= cursor_location)
     abort ();
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   rb = Dynarr_atp (db->runes, cursor_location);
   *cursor_start = rb->xpos;
@@ -536,9 +536,8 @@
 clear_left_border (struct window *w, int y, int height)
 {
   struct frame *f = XFRAME (w->frame);
-  Lisp_Object window;
+  Lisp_Object window = wrap_window (w);
 
-  XSETWINDOW (window, w);
   redisplay_clear_region (window, DEFAULT_INDEX,
 		FRAME_LEFT_BORDER_START (f), y,
 		FRAME_BORDER_WIDTH (f), height);
@@ -553,9 +552,8 @@
 clear_right_border (struct window *w, int y, int height)
 {
   struct frame *f = XFRAME (w->frame);
-  Lisp_Object window;
+  Lisp_Object window = wrap_window (w);
 
-  XSETWINDOW (window, w);
   redisplay_clear_region (window, DEFAULT_INDEX,
 		FRAME_RIGHT_BORDER_START (f),
 		y, FRAME_BORDER_WIDTH (f), height);
@@ -725,9 +723,8 @@
 
 		  if (findex != (face_index) -1)
 		    {
-		      Lisp_Object window;
+		      Lisp_Object window = wrap_window (w);
 
-		      XSETWINDOW (window, w);
 
 		      /* Clear the empty area. */
 		      redisplay_clear_region (window, findex, x, y, width, height);
@@ -1243,7 +1240,7 @@
   if (!redisplay_normalize_glyph_area (db, dga))
     return;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   /* Clear the area the subwindow is going into. */
   redisplay_clear_clipped_region (window, findex,
@@ -1394,7 +1391,7 @@
   LIST_LOOP (rest, IMAGE_INSTANCE_LAYOUT_CHILDREN (p))
     {
       Lisp_Object child = glyph_image_instance (XCAR (rest), image_instance,
-						ERROR_ME_NOT, 1);
+						ERROR_ME_DEBUG_WARN, 1);
 
       struct display_box cdb;
       /* For losing HP-UX */
@@ -1543,8 +1540,8 @@
   struct frame *f = XFRAME (w->frame);
   struct device *d = XDEVICE (f->device);
   Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
-  Lisp_Object window;
-  XSETWINDOW (window, w);
+  Lisp_Object window = wrap_window (w);
+
 
   dga->height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
   dga->width = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
@@ -1918,8 +1915,8 @@
 void
 redisplay_clear_top_of_window (struct window *w)
 {
-  Lisp_Object window;
-  XSETWINDOW (window, w);
+  Lisp_Object window = wrap_window (w);
+
 
   if (!NILP (Fwindow_highest_p (window)))
     {
@@ -1970,7 +1967,7 @@
 	  layout_bounds bounds;
 
 	  bounds = calculate_display_line_boundaries (w, bflag);
-	  XSETWINDOW (window, w);
+	  window = wrap_window (w);
 
 	  if (window_is_leftmost (w))
 	    redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
--- a/src/redisplay-tty.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/redisplay-tty.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* Communication module for TTY terminals.
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2002 Ben Wing.
    Copyright (C) 1996 Chuck Thompson.
 
 This file is part of XEmacs.
@@ -323,9 +323,9 @@
 	      Lisp_Object window;
 	      Lisp_Object instance;
 
-	      XSETWINDOW (window, w);
+	      window = wrap_window (w);
 	      instance = glyph_image_instance (rb->object.dglyph.glyph,
-					       window, ERROR_ME_NOT, 1);
+					       window, ERROR_ME_DEBUG_WARN, 1);
 
 	      if (IMAGE_INSTANCEP (instance))
 		{
@@ -475,9 +475,8 @@
     }
   else
     {
-      Lisp_Object window;
+      Lisp_Object window = wrap_window (w);
 
-      XSETWINDOW (window, w);
       redisplay_clear_region (window, DEFAULT_INDEX, x, ypos1, width, ypos2 - ypos1);
     }
 }
@@ -796,7 +795,7 @@
   Lisp_Object frame;
   struct console *c = XCONSOLE (FRAME_CONSOLE (f));
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   tty_turn_on_face_1 (c,
 		      FACE_HIGHLIGHT_P (face, frame),
 		      FACE_BLINKING_P (face, frame),
@@ -820,7 +819,7 @@
   Lisp_Object frame;
   struct console *c = XCONSOLE (FRAME_CONSOLE (f));
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   if (FACE_REVERSE_P (face, frame))
     {
--- a/src/redisplay-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/redisplay-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2,6 +2,7 @@
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1994 Lucid, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -331,7 +332,7 @@
   Lisp_Object charset = Qunbound; /* Qnil is a valid charset when
 				     MULE is not defined */
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
   rb = Dynarr_atp (rba, start);
 
   if (!rb)
@@ -443,9 +444,9 @@
 						 start_pixpos, rb->width,
 						 &dbox, &dga);
 
-	      XSETWINDOW (window, w);
+	      window = wrap_window (w);
 	      instance = glyph_image_instance (rb->object.dglyph.glyph,
-					       window, ERROR_ME_NOT, 1);
+					       window, ERROR_ME_DEBUG_WARN, 1);
 	      findex = rb->findex;
 
 	      if (IMAGE_INSTANCEP (instance))
@@ -796,8 +797,8 @@
   int i;
   struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
 
-  XSETDEVICE (device, d);
-  XSETWINDOW (window, w);
+  device = wrap_device (d);
+  window = wrap_window (w);
 
   if (width < 0)
     width = x_text_width (f, cachel, Dynarr_atp (buf, 0), Dynarr_length (buf));
@@ -1861,7 +1862,7 @@
   int cursor_height, cursor_y;
   int defheight, defascent;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
   redisplay_clear_region (window, findex, x, y, width, height);
 
   if (NILP (w->text_cursor_visible_p))
@@ -1956,7 +1957,7 @@
 
   XClearArea (dpy, x_win, x, y, width, height, False);
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   if (!UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vdefault_face, frame))
       || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vleft_margin_face, frame))
@@ -1985,7 +1986,7 @@
   Widget shell = FRAME_X_SHELL_WIDGET (f);
   int flash_height;
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
   tmp_fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
--- a/src/redisplay.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/redisplay.c	Fri Mar 29 04:49:13 2002 +0000
@@ -91,7 +91,7 @@
 /* The following structures are completely private to redisplay.c so
    we put them here instead of in a header file, for modularity. */
 
-/* NOTE: Bytebposs not Charbpos's in this structure. */
+/* NOTE: Bytebpos's not Charbpos's in this structure. */
 
 typedef struct position_redisplay_data_type
 {
@@ -480,7 +480,7 @@
   Lisp_Object window;
 
   find_charsets_in_emchar_string (charsets, str, len);
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
   ensure_face_cachel_complete (WINDOW_FACE_CACHEL (w, findex), window,
 			       charsets);
   return DEVMETH (XDEVICE (FRAME_DEVICE (XFRAME (WINDOW_FRAME (w)))),
@@ -528,7 +528,7 @@
   find_charsets_in_intbyte_string (charsets, nonreloc, len);
   reset_face_cachel (&cachel);
   cachel.face = face;
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   ensure_face_cachel_complete (&cachel, frame, charsets);
   return DEVMETH (XDEVICE (FRAME_DEVICE (f)),
 		  text_width, (f, &cachel, Dynarr_atp (rtw_emchar_dynarr, 0),
@@ -809,12 +809,14 @@
   return retval;
 }
 
-/* Adds a character rune to a display block.  If there is not enough
-   room to fit the rune on the display block (as determined by the
-   MAX_PIXPOS) then it adds nothing and returns ADD_FAILED. */
+/* Adds a character rune to a display block.  If there is not enough room
+   to fit the rune on the display block (as determined by the MAX_PIXPOS)
+   then it adds nothing and returns ADD_FAILED.  If
+   NO_CONTRIBUTE_TO_LINE_HEIGHT is non-zero, don't allow the char's height
+   to affect the total line height. (See add_intbyte_string_runes()). */
 
 static prop_block_dynarr *
-add_emchar_rune (pos_data *data)
+add_emchar_rune_1 (pos_data *data, int no_contribute_to_line_height)
 {
   struct rune rb, *crb;
   int width, local;
@@ -871,8 +873,11 @@
 	    }
 	  else
 	    data->last_char_width = -1;
-	  data->new_ascent  = max (data->new_ascent,  (int) fi->ascent);
-	  data->new_descent = max (data->new_descent, (int) fi->descent);
+	  if (!no_contribute_to_line_height)
+	    {
+	      data->new_ascent  = max (data->new_ascent,  (int) fi->ascent);
+	      data->new_descent = max (data->new_descent, (int) fi->descent);
+	    }
 	  data->last_charset = charset;
 	  data->last_findex = data->findex;
 	}
@@ -907,11 +912,12 @@
     {
       if (NILP (data->string))
 	crb->charbpos =
-	  bytebpos_to_charbpos (XBUFFER (WINDOW_BUFFER (XWINDOW (data->window))),
-			    data->bi_charbpos);
+	  bytebpos_to_charbpos (XBUFFER (WINDOW_BUFFER
+					 (XWINDOW (data->window))),
+				data->bi_charbpos);
       else
 	crb->charbpos =
-	  XSTRING_INDEX_BYTE_TO_CHAR (data->string, data->bi_charbpos);
+	  string_index_byte_to_char (data->string, data->bi_charbpos);
     }
   else if (data->is_modeline)
     crb->charbpos = data->modeline_charpos;
@@ -953,13 +959,24 @@
   return NULL;
 }
 
-/* Given a string C_STRING of length C_LENGTH, call add_emchar_rune
-   for each character in the string.  Propagate any left-over data
-   unless NO_PROP is non-zero. */
+static prop_block_dynarr *
+add_emchar_rune (pos_data *data)
+{
+  return add_emchar_rune_1 (data, 0);
+}
+
+/* Given a string C_STRING of length C_LENGTH, call add_emchar_rune for
+   each character in the string.  Propagate any left-over data unless
+   NO_PROP is non-zero.  If NO_CONTRIBUTE_TO_LINE_HEIGHT is non-zero, don't
+   allow this character to increase the total height of the line. (This is
+   used when the character is part of a text glyph.  In that case, the
+   glyph code itself adjusts the line height as necessary, depending on
+   whether glyph-contrib-p is true.) */
 
 static prop_block_dynarr *
 add_intbyte_string_runes (pos_data *data, Intbyte *c_string,
-			  Bytecount c_length, int no_prop)
+			  Bytecount c_length, int no_prop,
+			  int no_contribute_to_line_height)
 {
   Intbyte *pos, *end = c_string + c_length;
   prop_block_dynarr *prop;
@@ -976,7 +993,7 @@
 
       data->ch = charptr_emchar (pos);
 
-      prop = add_emchar_rune (data);
+      prop = add_emchar_rune_1 (data, no_contribute_to_line_height);
 
       if (prop)
 	{
@@ -1261,7 +1278,7 @@
       prop = add_intbyte_string_runes (data,
 				       XSTRING_DATA   (entry),
 				       XSTRING_LENGTH (entry),
-				       0);
+				       0, 0);
     }
   else if (GLYPHP (entry))
     {
@@ -1320,7 +1337,7 @@
 		    }
 		}
 	    }
-	  prop = add_intbyte_string_runes (data, result, dst - result, 0);
+	  prop = add_intbyte_string_runes (data, result, dst - result, 0, 0);
 	}
     }
 
@@ -1665,7 +1682,7 @@
 	findex = get_builtin_face_cache_index (w, face);
 
       instance = glyph_image_instance (gb->glyph, data->window,
-				       ERROR_ME_NOT, 1);
+				       ERROR_ME_DEBUG_WARN, 1);
       if (TEXT_IMAGE_INSTANCEP (instance))
 	{
 	  Lisp_Object string = XIMAGE_INSTANCE_TEXT_STRING (instance);
@@ -1678,7 +1695,7 @@
 	  if (!allow_cursor)
 	    data->bi_charbpos = 0;
 	  add_intbyte_string_runes (data, XSTRING_DATA (string),
-				    XSTRING_LENGTH (string), 0);
+				    XSTRING_LENGTH (string), 0, 1);
 	  data->findex = orig_findex;
 	  data->bi_charbpos = orig_charbpos;
 	  data->bi_start_col_enabled = orig_start_col_enabled;
@@ -1906,7 +1923,7 @@
   /* These values are used by all of the rune addition routines.  We add
      them to this structure for ease of passing. */
   data.d = d;
-  XSETWINDOW (data.window, w);
+  data.window = wrap_window (w);
   data.string = Qnil;
   data.db = db;
   data.dl = dl;
@@ -2679,7 +2696,7 @@
   xzero (data);
   data.ef = NULL;
   data.d = d;
-  XSETWINDOW (data.window, w);
+  data.window = wrap_window (w);
   data.db = get_display_block_from_line (dl, OVERWRITE);
   data.dl = dl;
   data.pixpos = dl->bounds.left_in;
@@ -2700,7 +2717,7 @@
 	(&data,
 	 XSTRING_DATA   (Voverlay_arrow_string),
 	 XSTRING_LENGTH (Voverlay_arrow_string),
-	 1);
+	 1, 0);
     }
   else if (GLYPHP (Voverlay_arrow_string))
     {
@@ -2856,7 +2873,7 @@
 
   struct display_block *odb, *idb;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   /* We have to add the glyphs to the line in the order outside,
      inside, whitespace.  However the precedence dictates that we
@@ -3177,7 +3194,7 @@
 
   struct display_block *odb, *idb;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   /* We have to add the glyphs to the line in the order outside,
      inside, whitespace.  However the precedence dictates that we
@@ -3497,7 +3514,7 @@
   data.result_str = result_str;
   data.is_modeline = 1;
   data.string = Qnil;
-  XSETWINDOW (data.window, w);
+  data.window = wrap_window (w);
 
   Dynarr_reset (formatted_string_extent_dynarr);
   Dynarr_reset (formatted_string_extent_start_dynarr);
@@ -3546,7 +3563,7 @@
 
       sledgehammer_check_ascii_begin (result_str);
       detach_all_extents (result_str);
-      resize_string (XSTRING (result_str), -1,
+      resize_string (result_str, -1,
                      data.bytepos - XSTRING_LENGTH (result_str));
 
       strdata = XSTRING_DATA (result_str);
@@ -3571,7 +3588,7 @@
           Lisp_Object extent = Qnil;
           Lisp_Object child;
 
-          XSETEXTENT (extent, Dynarr_at (formatted_string_extent_dynarr, elt));
+          extent = wrap_extent (Dynarr_at (formatted_string_extent_dynarr, elt));
           child = Fgethash (extent, buf->modeline_extent_table, Qnil);
           if (NILP (child))
             {
@@ -3961,9 +3978,9 @@
   else if (GENERIC_SPECIFIERP (elt))
     {
       Lisp_Object window, tem;
-      XSETWINDOW (window, w);
+      window = wrap_window (w);
       tem = specifier_instance_no_quit (elt, Qunbound, window,
-					ERROR_ME_NOT, 0, Qzero);
+					ERROR_ME_DEBUG_WARN, 0, Qzero);
       if (!UNBOUNDP (tem))
 	{
 	  elt = tem;
@@ -4001,7 +4018,7 @@
 	    tem = symbol_value_in_buffer (car, w->buffer);
 	  else
 	    tem = specifier_instance_no_quit (car, Qunbound, wrap_window (w),
-					      ERROR_ME_NOT, 0, Qzero);
+					      ERROR_ME_DEBUG_WARN, 0, Qzero);
 	  /* elt is now the cdr, and we know it is a cons cell.
 	     Use its car if CAR has a non-nil value.  */
 	  if (!UNBOUNDP (tem) && !NILP (tem))
@@ -4287,12 +4304,11 @@
      against this case. */
   struct buffer *b = BUFFERP (w->buffer) ? XBUFFER (w->buffer) : 0;
   struct device *d = XDEVICE (f->device);
-  Lisp_String* s = XSTRING (disp_string);
 
   /* we're working with these a lot so precalculate them */
   Bytecount slen = XSTRING_LENGTH (disp_string);
   Bytecount bi_string_zv = slen;
-  Bytebpos bi_start_pos = string_index_char_to_byte (s, start_pos);
+  Bytebpos bi_start_pos = string_index_char_to_byte (disp_string, start_pos);
 
   pos_data data;
 
@@ -4391,7 +4407,7 @@
   /* These values are used by all of the rune addition routines.  We add
      them to this structure for ease of passing. */
   data.d = d;
-  XSETWINDOW (data.window, w);
+  data.window = wrap_window (w);
   data.db = db;
   data.dl = dl;
 
@@ -4469,7 +4485,8 @@
 	{
 	  /* Now compute the face and begin/end-glyph information. */
 	  data.findex =
-	    /* Remember that the extent-fragment routines deal in Bytebpos's. */
+	    /* Remember that the extent-fragment routines deal in
+               Bytebpos's. */
 	    extent_fragment_update (w, data.ef, data.bi_charbpos);
 	  /* This is somewhat cheesy but the alternative is to
              propagate default_face into extent_fragment_update. */
@@ -4532,7 +4549,7 @@
 	  if (data.bi_charbpos == bi_string_zv)
 	    goto done;
 	  else
-	    INC_CHARBYTEBPOS (string_data (s), data.bi_charbpos);
+	    INC_CHARBYTEBPOS (XSTRING_DATA (disp_string), data.bi_charbpos);
 	}
 
       /* If there is propagation data, then it represents the current
@@ -4552,7 +4569,7 @@
 	    /* #### urk urk urk! Aborts are not very fun! Fix this please! */
 	    data.bi_charbpos = 0;
 	  else
-	    INC_CHARBYTEBPOS (string_data (s), data.bi_charbpos);
+	    INC_CHARBYTEBPOS (XSTRING_DATA (disp_string), data.bi_charbpos);
 	}
 
       /* If there are end glyphs, add them to the line.  These are
@@ -4585,7 +4602,7 @@
 	{
 	  Lisp_Object entry = Qnil;
 	  /* Get the character at the current buffer position. */
-	  data.ch = string_char (s, data.bi_charbpos);
+	  data.ch = XSTRING_CHAR (disp_string, data.bi_charbpos);
 	  if (!NILP (face_dt) || !NILP (window_dt))
 	    entry = display_table_entry (data.ch, face_dt, window_dt);
 
@@ -4700,7 +4717,7 @@
 		goto done;
 	    }
 
-	  INC_CHARBYTEBPOS (string_data (s), data.bi_charbpos);
+	  INC_CHARBYTEBPOS (XSTRING_DATA (disp_string), data.bi_charbpos);
 	}
     }
 
@@ -4723,7 +4740,7 @@
          position. */
       if (data.ch == '\n')
 	{
-	  INC_CHARBYTEBPOS (string_data (s), data.bi_charbpos);
+	  INC_CHARBYTEBPOS (XSTRING_DATA (disp_string), data.bi_charbpos);
 	}
 
       /* Otherwise we have a buffer line which cannot fit on one display
@@ -4746,7 +4763,8 @@
 	      Bytebpos bi_pos;
 
 	      /* Now find the start of the next line. */
-	      bi_pos = bi_find_next_emchar_in_string (s, '\n', data.bi_charbpos, 1);
+	      bi_pos = bi_find_next_emchar_in_string (disp_string, '\n',
+						      data.bi_charbpos, 1);
 
 	      data.cursor_type = NO_CURSOR;
 	      data.bi_charbpos = bi_pos;
@@ -4770,7 +4788,8 @@
 
 	  if (truncate_win && data.bi_charbpos == bi_string_zv)
 	    {
-	      const Intbyte* endb = charptr_n_addr (string_data (s), bi_string_zv);
+	      const Intbyte *endb = charptr_n_addr (XSTRING_DATA (disp_string),
+						    bi_string_zv);
 	      DEC_CHARPTR (endb);
 	      if (charptr_emchar (endb) != '\n')
 		{
@@ -4884,12 +4903,16 @@
   dl->cursor_elt = data.cursor_x;
   /* #### lossage lossage lossage! Fix this shit! */
   if (data.bi_charbpos > bi_string_zv)
-    dl->end_charbpos = buffer_or_string_bytebpos_to_charbpos (disp_string, bi_string_zv);
+    dl->end_charbpos = buffer_or_string_bytebpos_to_charbpos (disp_string,
+							      bi_string_zv);
   else
-    dl->end_charbpos = buffer_or_string_bytebpos_to_charbpos (disp_string, data.bi_charbpos) - 1;
+    dl->end_charbpos =
+      buffer_or_string_bytebpos_to_charbpos (disp_string,
+					     data.bi_charbpos) - 1;
   if (truncate_win)
     data.dl->num_chars =
-      string_column_at_point (s, dl->end_charbpos, b ? XINT (b->tab_width) : 8);
+      string_column_at_point (disp_string, dl->end_charbpos,
+			      b ? XINT (b->tab_width) : 8);
   else
     /* This doesn't correctly take into account tabs and control
        characters but if the window isn't being truncated then this
@@ -4918,9 +4941,10 @@
      this function if we are already at EOB. */
 
   if (data.bi_charbpos == bi_string_zv && bi_start_pos == bi_string_zv)
-    return string_index_byte_to_char (s, data.bi_charbpos) + 1; /* Yuck! */
+    return string_index_byte_to_char (disp_string,
+				      data.bi_charbpos) + 1; /* Yuck! */
   else
-    return string_index_byte_to_char (s, data.bi_charbpos);
+    return string_index_byte_to_char (disp_string, data.bi_charbpos);
 }
 
 /* Given a display line and a starting position, ensure that the
@@ -6266,8 +6290,8 @@
 
       if (lrpos >= pos)
 	{
-	  Lisp_Object window;
-	  XSETWINDOW (window, w);
+	  Lisp_Object window = wrap_window (w);
+
 	  va_run_hook_with_args_in_buffer (XBUFFER (w->buffer),
 					   Qredisplay_end_trigger_functions,
 					   2, window,
@@ -6305,7 +6329,7 @@
 
       f->old_buffer_alist = Freplace_list (f->old_buffer_alist,
 					   f->buffer_alist);
-      XSETFRAME (frame, f);
+      frame = wrap_frame (f);
       va_run_hook_with_args (Qbuffer_list_changed_hook, 1, frame);
     }
 
@@ -7773,7 +7797,7 @@
 	  Lisp_Object window;
 	  int defheight;
 
-	  XSETWINDOW (window, w);
+	  window = wrap_window (w);
 	  default_face_height_and_width (window, &defheight, 0);
 
 	  cur_elt = Dynarr_length (w->line_start_cache) - 1;
@@ -8079,7 +8103,7 @@
   Lisp_Object window;
   int defheight, defwidth;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
   default_face_height_and_width (window, &defheight, &defwidth);
 
   /* If we get a bogus value indicating somewhere above or to the left of
@@ -8752,7 +8776,7 @@
 	  Lisp_Object lwin;
 	  int defheight;
 
-	  XSETWINDOW (lwin, *w);
+	  lwin = wrap_window (*w);
 	  default_face_height_and_width (lwin, 0, &defheight);
 
 	  *row += (adj_area / defheight);
--- a/src/scrollbar-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/scrollbar-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -424,9 +424,8 @@
 static void
 gtk_scrollbar_pointer_changed_in_window (struct window *w)
 {
-  Lisp_Object window;
+  Lisp_Object window = wrap_window (w);
 
-  XSETWINDOW (window, w);
   gtk_scrollbar_loop (GTK_SET_SCROLLBAR_POINTER, window,
 		      find_window_mirror (w), 0, (GdkWindow *) NULL);
 }
--- a/src/scrollbar-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/scrollbar-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -358,7 +358,7 @@
 
   if (needle_in_haystack)
     {
-      XSETWINDOW (win, needle_in_haystack);
+      win = wrap_window (needle_in_haystack);
       /* stderr_out ("found needle\n");
 	 debug_print (win); */
     }
--- a/src/scrollbar-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/scrollbar-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -673,9 +673,8 @@
 static void
 x_scrollbar_pointer_changed_in_window (struct window *w)
 {
-  Lisp_Object window;
+  Lisp_Object window = wrap_window (w);
 
-  XSETWINDOW (window, w);
   x_scrollbar_loop (X_SET_SCROLLBAR_POINTER, window, find_window_mirror (w),
 		    0, (Window) NULL);
 }
--- a/src/scrollbar.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/scrollbar.c	Fri Mar 29 04:49:13 2002 +0000
@@ -573,8 +573,8 @@
   if (HAS_DEVMETH_P (d, create_scrollbar_instance))
     {
       int depth = unlock_ghost_specifiers_protected ();
-      Lisp_Object frame;
-      XSETFRAME (frame, f);
+      Lisp_Object frame = wrap_frame (f);
+
       call_critical_lisp_code (XDEVICE (FRAME_DEVICE (f)),
 			       Qinit_scrollbar_from_resources,
 			       frame);
@@ -588,8 +588,8 @@
   if (HAS_DEVMETH_P (d, create_scrollbar_instance))
     {
       int depth = unlock_ghost_specifiers_protected ();
-      Lisp_Object device;
-      XSETDEVICE (device, d);
+      Lisp_Object device = wrap_device (d);
+
       call_critical_lisp_code (d,
 			       Qinit_scrollbar_from_resources,
 			       device);
--- a/src/scrollbar.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/scrollbar.h	Fri Mar 29 04:49:13 2002 +0000
@@ -49,7 +49,6 @@
 
 DECLARE_LRECORD (scrollbar_instance, struct scrollbar_instance);
 #define XSCROLLBAR_INSTANCE(x) XRECORD (x, scrollbar_instance, struct scrollbar_instance)
-#define XSETSCROLLBAR_INSTANCE(x, p) XSETRECORD (x, p, scrollbar_instance)
 #define wrap_scrollbar_instance(p) wrap_record (p, scrollbar_instance)
 #define SCROLLBAR_INSTANCEP(x) RECORDP (x, scrollbar_instance)
 #define CHECK_SCROLLBAR_INSTANCE(x) CHECK_RECORD (x, scrollbar_instance)
--- a/src/search.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/search.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* String search routines for XEmacs.
    Copyright (C) 1985, 1986, 1987, 1992-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -314,12 +314,12 @@
       if (search_regs.start[i] > 0)
 	{
 	  search_regs.start[i] =
-	    XSTRING_INDEX_BYTE_TO_CHAR (string, search_regs.start[i]);
+	    string_index_byte_to_char (string, search_regs.start[i]);
 	}
       if (search_regs.end[i] > 0)
 	{
 	  search_regs.end[i] =
-	    XSTRING_INDEX_BYTE_TO_CHAR (string, search_regs.end[i]);
+	    string_index_byte_to_char (string, search_regs.end[i]);
 	}
     }
 }
@@ -377,7 +377,7 @@
 	  search_regs.end[i] += BI_BUF_BEGV (buf);
 	}
   }
-  XSETBUFFER (last_thing_searched, buf);
+  last_thing_searched = wrap_buffer (buf);
   fixup_search_regs_for_buffer (buf);
   return unbind_to_1 (count, val);
 }
@@ -446,7 +446,7 @@
 			  0, ERROR_ME);
   QUIT;
   {
-    Bytecount bis = XSTRING_INDEX_CHAR_TO_BYTE (string, s);
+    Bytecount bis = string_index_char_to_byte (string, s);
     regex_match_object = string;
     regex_emacs_buffer = buf;
     val = re_search (bufp, (char *) XSTRING_DATA (string),
@@ -461,7 +461,7 @@
   fixup_search_regs_for_string (string);
   return
     unbind_to_1 (count,
-	       make_int (XSTRING_INDEX_BYTE_TO_CHAR (string, val)));
+	       make_int (string_index_byte_to_char (string, val)));
 }
 
 DEFUN ("string-match", Fstring_match, 2, 4, 0, /*
@@ -754,12 +754,12 @@
 }
 
 Bytebpos
-bi_find_next_emchar_in_string (Lisp_String* str, Emchar target, Bytebpos st,
+bi_find_next_emchar_in_string (Lisp_Object str, Emchar target, Bytebpos st,
 			       EMACS_INT count)
 {
   /* This function has been Mule-ized. */
-  Bytebpos lim = string_length (str) -1;
-  Intbyte* s = string_data (str);
+  Bytebpos lim = XSTRING_LENGTH (str) -1;
+  Intbyte *s = XSTRING_DATA (str);
 
   assert (count >= 0);
 
@@ -773,7 +773,7 @@
     {
       while (st < lim && count > 0)
 	{
-	  if (string_char (str, st) == target)
+	  if (XSTRING_CHAR (str, st) == target)
 	    count--;
 	  INC_CHARBYTEBPOS (s, st);
 	}
@@ -1239,7 +1239,7 @@
 		    search_regs.start[i] += j;
 		    search_regs.end[i] += j;
 		  }
-	      XSETBUFFER (last_thing_searched, buf);
+	      last_thing_searched = wrap_buffer (buf);
 	      /* Set pos to the new position. */
 	      pos = search_regs.start[0];
 	      fixup_search_regs_for_buffer (buf);
@@ -1277,7 +1277,7 @@
 		    search_regs.start[i] += j;
 		    search_regs.end[i] += j;
 		  }
-	      XSETBUFFER (last_thing_searched, buf);
+	      last_thing_searched = wrap_buffer (buf);
 	      /* Set pos to the new position. */
 	      pos = search_regs.end[0];
 	      fixup_search_regs_for_buffer (buf);
@@ -1966,7 +1966,7 @@
 
   search_regs.start[0] = beg;
   search_regs.end[0] = beg + len;
-  XSETBUFFER (last_thing_searched, buf);
+  last_thing_searched = wrap_buffer (buf);
 }
 
 
@@ -1986,14 +1986,14 @@
   len = XSTRING_CHAR_LENGTH (string);
 
   for (i = 0; i < len; i++)
-    if (!WORD_SYNTAX_P (syntax_table, string_char (XSTRING (string), i)))
+    if (!WORD_SYNTAX_P (syntax_table, XSTRING_CHAR (string, i)))
       {
 	punct_count++;
 	if (i > 0 && WORD_SYNTAX_P (syntax_table,
-				    string_char (XSTRING (string), i - 1)))
+				    XSTRING_CHAR (string, i - 1)))
           word_count++;
       }
-  if (WORD_SYNTAX_P (syntax_table, string_char (XSTRING (string), len - 1)))
+  if (WORD_SYNTAX_P (syntax_table, XSTRING_CHAR (string, len - 1)))
     word_count++;
   if (!word_count) return build_string ("");
 
@@ -2010,13 +2010,13 @@
 
     for (i = 0; i < len; i++)
       {
-	Emchar ch = string_char (XSTRING (string), i);
+	Emchar ch = XSTRING_CHAR (string, i);
 
 	if (WORD_SYNTAX_P (syntax_table, ch))
 	  o += set_charptr_emchar (o, ch);
 	else if (i > 0
 		 && WORD_SYNTAX_P (syntax_table,
-				   string_char (XSTRING (string), i - 1))
+				   XSTRING_CHAR (string, i - 1))
 		 && --word_count)
 	  {
 	    *o++ = '\\';
@@ -2332,7 +2332,7 @@
 	 the last string matched and the buffer used for that
 	 matching.  But of course we can't change it as it is. */
       buf = decode_buffer (strbuffer, 0);
-      XSETBUFFER (buffer, buf);
+      buffer = wrap_buffer (buf);
     }
   else
     {
@@ -2394,7 +2394,7 @@
 	  if (NILP (string))
 	    c = BUF_FETCH_CHAR (buf, pos);
 	  else
-	    c = string_char (XSTRING (string), pos);
+	    c = XSTRING_CHAR (string, pos);
 
 	  if (LOWERCASEP (buf, c))
 	    {
@@ -2479,10 +2479,10 @@
 	      Charcount substart = -1;
 	      Charcount subend   = -1;
 
-	      c = string_char (XSTRING (replacement), strpos);
+	      c = XSTRING_CHAR (replacement, strpos);
 	      if (c == '\\' && strpos < stlen - 1)
 		{
-		  c = string_char (XSTRING (replacement), ++strpos);
+		  c = XSTRING_CHAR (replacement, ++strpos);
 		  if (c == '&')
 		    {
 		      literal_end = strpos - 1;
@@ -2572,7 +2572,7 @@
 
 	  for (strpos = 0; strpos < stlen; strpos++)
 	    {
-	      Emchar curchar = string_char (XSTRING (replacement), strpos);
+	      Emchar curchar = XSTRING_CHAR (replacement, strpos);
 	      Emchar newchar = -1;
 	      if (i < Dynarr_length (ul_pos_dynarr) &&
 		  strpos == Dynarr_at (ul_pos_dynarr, i))
@@ -2596,7 +2596,7 @@
 		    newchar = curchar;
 		}
 	      if (newchar != curchar)
-		set_string_char (XSTRING (replacement), strpos, newchar);
+		set_string_char (replacement, strpos, newchar);
 	    }
 	}
 
@@ -2633,7 +2633,7 @@
 	   */
 	  Charcount offset = BUF_PT (buf) - search_regs.start[sub];
 
-	  c = string_char (XSTRING (replacement), strpos);
+	  c = XSTRING_CHAR (replacement, strpos);
 	  if (c == '\\' && strpos < stlen - 1)
 	    {
 	      /* XXX FIXME: replacing just a substring non-literally
@@ -2642,7 +2642,7 @@
 		 <duwe@caldera.de> claims Finsert_buffer_substring already
 		 handles this correctly.
 	      */
-	      c = string_char (XSTRING (replacement), ++strpos);
+	      c = XSTRING_CHAR (replacement, ++strpos);
 	      if (c == '&')
 		Finsert_buffer_substring
                   (buffer,
@@ -2915,7 +2915,7 @@
 	      if (XMARKER (marker)->buffer == 0)
 		marker = Qzero;
 	      else
-		XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer);
+		last_thing_searched = wrap_buffer (XMARKER (marker)->buffer);
 	    }
 
 	  CHECK_INT_COERCE_MARKER (marker);
--- a/src/select-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/select-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -430,9 +430,7 @@
 
      Opaque pointers are the clean way to go here.
   */
-  selection_time = make_opaque (&thyme, sizeof (thyme));
-
-  return selection_time;
+  return make_opaque (&thyme, sizeof (thyme));
 }
 
 static void
--- a/src/select-x.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/select-x.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* X Selection processing for XEmacs
    Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -796,8 +796,11 @@
 	{
 #if 0
 	  stderr_out ("Saw expected prop-%s on %s\n",
-		   (event->state == PropertyDelete ? "delete" : "change"),
-		      (char *) string_data (XSYMBOL (x_atom_to_symbol (get_device_from_display (event->display), event->atom))->name);
+		      (event->state == PropertyDelete ? "delete" : "change"),
+		      XSTRING_DATA
+		      (XSYMBOL (x_atom_to_symbol
+				(get_device_from_display (event->display),
+				 event->atom))->name);
 #endif
 	  if (prev)
 	    prev->next = rest->next;
@@ -811,8 +814,10 @@
     }
 #if 0
   stderr_out ("Saw UNexpected prop-%s on %s\n",
-	   (event->state == PropertyDelete ? "delete" : "change"),
-	   (char *) string_data (XSYMBOL (x_atom_to_symbol (get_device_from_display (event->display), event->atom))->name));
+	      (event->state == PropertyDelete ? "delete" : "change"),
+	      XSTRING_DATA (XSYMBOL (x_atom_to_symbol
+				     (get_device_from_display (event->display),
+				      event->atom))->name));
 #endif
 }
 
--- a/src/sound.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/sound.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,7 @@
 /* Sound functions.
    Copyright (C) 1992, 1993, 1994 Lucid Inc.
    Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -278,7 +279,20 @@
 
 DEFUN ("play-sound", Fplay_sound, 1, 3, 0, /*
 Play a sound of the provided type.
-See the variable `sound-alist'.
+
+SOUND can a symbol, specifying a sound to be looked up in `sound-alist'
+\(generally, either the symbol directly maps to a sound or is an "abstract"
+symbol that maps to another symbol and is used to specify the sound that is
+played when a particular behavior occurs.  `ding' lists the built-in
+abstract sounds and their intended purpose.
+
+SOUND can also be a string, which directly encodes the sound data to be played.
+
+If SOUND is nil, the abstract sound `default' will be used.
+
+VOLUME controls the volume (max is around 150? not sure).
+
+DEVICE is the device to play the sound on (defaults to the selected device).
 
 If the sound cannot be played in any other way, the standard "bell" will sound.
 */
@@ -402,23 +416,61 @@
 
 DEFUN ("ding", Fding, 0, 3, 0, /*
 Beep, or flash the frame.
-Also, unless an argument is given,
-terminate any keyboard macro currently executing.
-When called from lisp, the second argument is what sound to make, and
-the third argument is the device to make it in (defaults to the selected
-device).
+
+\(See `visible-bell'; setting this makes the frame flash instead of
+beeping.)  Also, unless NO-TERMINATE is given, terminate any keyboard macro
+currently executing.  SOUND specifies the sound to make and DEVICE the
+device to make it on (defaults to the selected device).
+
+SOUND is either a string (raw data to be played directly), a symbol, or
+`nil' (equivalent to the symbol `default').  Sound symbols are looked up in
+`sound-alist', and resolve either to strings of data or to other symbols.
+Sound symbols that map directly to data should be considered named sounds;
+sound symbols that map to other sounds should be considered abstract
+sounds, and are used when a particular behavior or state occurs.
+
+Rremember that the sound symbol is the *second* argument to `ding', not the
+first.
+
+The following abstract sounds are used by XEmacs itself:
+
+    alarm		when a package wants to remind the user
+    auto-save-error	when an auto-save does not succeed
+    buffer-bound	when you attempt to move off the end of a buffer
+    command-error	any uncaught error (i.e. any error that the user
+                        sees) except those handled by undefined-click,
+			undefined-key, buffer-bound, or read-only
+    default		used when nothing else is appropriate.
+    isearch-failed      unable to locate search text during incremental search
+    isearch-quit        when you delete chars past the beginning of the search
+                        text in isearch
+    no-completion	during completing-read
+    quit		when C-g is typed
+    read-only           when you try to modify a read-only buffer
+    ready		when a compile or other time-consuming task is done
+    undefined-click	when you use an undefined mouse-click combination
+    undefined-key	when you type a key that is undefined
+    warp		XEmacs has changed the selected-window or frame
+			asynchronously -- e.g. a debugger breakpoint is hit
+			in an asynchronous process filter
+    y-or-n-p		when you type something other than 'y' or 'n'
+    yes-or-no-p  	when you type something other than 'yes' or 'no'
+    
+Other lisp packages may use other beep types, but these are the ones that
+the C kernel of Emacs uses.
+
 */
-       (arg, sound, device))
+       (no_terminate, sound, device))
 {
   static time_t last_bell_time;
   static struct device *last_bell_device;
   time_t now;
   struct device *d = decode_device (device);     
 
-  XSETDEVICE (device, d);
+  device = wrap_device (d);
   now = time (0);
 
-  if (NILP (arg) && !NILP (Vexecuting_macro))
+  if (NILP (no_terminate) && !NILP (Vexecuting_macro))
     /* Stop executing a keyboard macro. */
     invalid_operation ("Keyboard macro terminated by a command ringing the bell", Qunbound);
   
@@ -635,19 +687,10 @@
  - The pitch, duration, and volume options are available everywhere, but
    many X servers ignore the `pitch' option.
 
-The following beep-types are used by emacs itself:
-
-    auto-save-error	when an auto-save does not succeed
-    command-error	when the emacs command loop catches an error
-    undefined-key	when you type a key that is undefined
-    undefined-click	when you use an undefined mouse-click combination
-    no-completion	during completing-read
-    y-or-n-p		when you type something other than 'y' or 'n'
-    yes-or-no-p  	when you type something other than 'yes' or 'no'
-    default		used when nothing else is appropriate.
-
-Other lisp packages may use other beep types, but these are the ones that
-the C kernel of Emacs uses.
+Sound symbols that map directly to data should be considered named sounds;
+sound symbols that map to other sounds should be considered abstract
+sounds, and are used when a particular behavior or state occurs.  See
+`ding' for a list of the standard abstract sounds.
 */ );
   Vsound_alist = Qnil;
 
--- a/src/specifier.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/specifier.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Specifier implementation
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2002 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
 
 This file is part of XEmacs.
@@ -490,7 +490,7 @@
   sp->caching = 0;
   sp->next_specifier = Vall_specifiers;
 
-  XSETSPECIFIER (specifier, sp);
+  specifier = wrap_specifier (sp);
   Vall_specifiers = specifier;
 
   if (call_create_meth)
@@ -867,8 +867,8 @@
     {
       j = i - 1;
       while (j >= 0 &&
-	     strcmp ((char *) string_data (XSYMBOL (tags[j])->name),
-		     (char *) string_data (XSYMBOL (tags[j+1])->name)) > 0)
+	     qxestrcmp (XSTRING_DATA (XSYMBOL (tags[j])->name),
+			XSTRING_DATA (XSYMBOL (tags[j+1])->name)) > 0)
 	{
 	  Lisp_Object tmp = tags[j];
 	  tags[j] = tags[j+1];
@@ -1019,9 +1019,8 @@
 setup_device_initial_specifier_tags (struct device *d)
 {
   Lisp_Object rest, rest2;
-  Lisp_Object device;
-
-  XSETDEVICE (device, d);
+  Lisp_Object device = wrap_device (d);
+
 
   DEVICE_USER_DEFINED_TAGS (d) = Fcopy_alist (Vuser_defined_tags);
 
@@ -2692,6 +2691,12 @@
 valid for the device of the given domain (e.g. the font or color name
 does not exist for this particular X server).
 
+NOTE: When errors occur in the process of trying a particular instantiator,
+and the instantiator is thus skipped, warnings will be issued at level
+`debug'.  Normally, such warnings are ignored entirely, but you can change
+this by setting `log-warning-minimum-level'.  This is useful if you're
+trying to debug why particular instantiators are not being processed.
+
 The returned value is dependent on the type of specifier.  For example,
 for a font specifier (as returned by the `face-font' function), the returned
 value will be a font-instance object.  For glyphs, the returned value
@@ -2858,7 +2863,7 @@
 
   assert (!GHOST_SPECIFIER_P (XSPECIFIER (specifier)));
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   newval = specifier_instance (specifier, Qunbound, window, ERROR_ME_WARN,
 			       0, 0, Qzero);
@@ -2893,7 +2898,7 @@
 
   assert (!GHOST_SPECIFIER_P (XSPECIFIER (specifier)));
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   newval = specifier_instance (specifier, Qunbound, frame, ERROR_ME_WARN,
 			       0, 0, Qzero);
--- a/src/specifier.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/specifier.h	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Generic specifier list implementation
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995 Ben Wing
+   Copyright (C) 1995, 2002 Ben Wing
 
 This file is part of XEmacs.
 
@@ -256,7 +256,6 @@
 
 DECLARE_LRECORD (specifier, Lisp_Specifier);
 #define XSPECIFIER(x) XRECORD (x, specifier, Lisp_Specifier)
-#define XSETSPECIFIER(x, p) XSETRECORD (x, p, specifier)
 #define wrap_specifier(p) wrap_record (p, specifier)
 #define SPECIFIERP(x) RECORDP (x, specifier)
 #define CHECK_SPECIFIER(x) CHECK_RECORD (x, specifier)
@@ -373,14 +372,8 @@
 #ifdef ERROR_CHECK_TYPECHECK
 # define XSPECIFIER_TYPE(x, type)	\
    error_check_##type##_specifier_type (x)
-# define XSETSPECIFIER_TYPE(x, p, type)	do		\
-{							\
-  XSETSPECIFIER (x, p);					\
-  assert (SPECIFIER_TYPEP (XSPECIFIER(x), type));	\
-} while (0)
 #else
 # define XSPECIFIER_TYPE(x, type) XSPECIFIER (x)
-# define XSETSPECIFIER_TYPE(x, p, type) XSETSPECIFIER (x, p)
 #endif /* ERROR_CHECK_TYPE_CHECK */
 
 #define SPECIFIER_TYPEP(x, type)			\
@@ -522,35 +515,30 @@
 
 DECLARE_SPECIFIER_TYPE (generic);
 #define XGENERIC_SPECIFIER(x) XSPECIFIER_TYPE (x, generic)
-#define XSETGENERIC_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, generic)
 #define GENERIC_SPECIFIERP(x) SPECIFIER_TYPEP (x, generic)
 #define CHECK_GENERIC_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, generic)
 #define CONCHECK_GENERIC_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, generic)
 
 DECLARE_SPECIFIER_TYPE (integer);
 #define XINTEGER_SPECIFIER(x) XSPECIFIER_TYPE (x, integer)
-#define XSETINTEGER_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, integer)
 #define INTEGER_SPECIFIERP(x) SPECIFIER_TYPEP (x, integer)
 #define CHECK_INTEGER_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, integer)
 #define CONCHECK_INTEGER_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, integer)
 
 DECLARE_SPECIFIER_TYPE (natnum);
 #define XNATNUM_SPECIFIER(x) XSPECIFIER_TYPE (x, natnum)
-#define XSETNATNUM_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, natnum)
 #define NATNUM_SPECIFIERP(x) SPECIFIER_TYPEP (x, natnum)
 #define CHECK_NATNUM_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, natnum)
 #define CONCHECK_NATNUM_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, natnum)
 
 DECLARE_SPECIFIER_TYPE (boolean);
 #define XBOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, boolean)
-#define XSETBOOLEAN_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, boolean)
 #define BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, boolean)
 #define CHECK_BOOLEAN_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, boolean)
 #define CONCHECK_BOOLEAN_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, boolean)
 
 DECLARE_SPECIFIER_TYPE (display_table);
 #define XDISPLAYTABLE_SPECIFIER(x) XSPECIFIER_TYPE (x, display_table)
-#define XSETDISPLAYTABLE_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, display_table)
 #define DISPLAYTABLE_SPECIFIERP(x) SPECIFIER_TYPEP (x, display_table)
 #define CHECK_DISPLAYTABLE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, display_table)
 #define CONCHECK_DISPLAYTABLE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, display_table)
--- a/src/strftime.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/strftime.c	Fri Mar 29 04:49:13 2002 +0000
@@ -195,13 +195,11 @@
      (including the trailing NUL) of any unsigned decimal quantity
      whose binary representation fits in 128 bits.  */
   char buf[40];
-  int length;
 
   if (sizeof (num) > 16)
     abort ();
   sprintf (buf, "%lu", (unsigned long) num);
-  length = add_str (string, buf, max);
-  return length;
+  return add_str (string, buf, max);
 }
 
 /* Return the week in the year of the time in TM, with the weeks
--- a/src/symbols.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/symbols.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* "intern" and friends -- moved here from lread.c and data.c
    Copyright (C) 1985-1989, 1992-1994 Free Software Foundation, Inc.
-   Copyright (C) 1995, 2000, 2001 Ben Wing.
+   Copyright (C) 1995, 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -90,12 +90,10 @@
 mark_symbol (Lisp_Object obj)
 {
   Lisp_Symbol *sym = XSYMBOL (obj);
-  Lisp_Object pname;
 
   mark_object (sym->value);
   mark_object (sym->function);
-  XSETSTRING (pname, sym->name);
-  mark_object (pname);
+  mark_object (sym->name);
   if (!symbol_next (sym))
     return sym->plist;
   else
@@ -103,8 +101,7 @@
     mark_object (sym->plist);
     /* Mark the rest of the symbols in the obarray hash-chain */
     sym = symbol_next (sym);
-    XSETSYMBOL (obj, sym);
-    return obj;
+    return wrap_symbol (sym);
   }
 }
 
@@ -209,7 +206,7 @@
        (string, obarray))
 {
   Lisp_Object object, *ptr;
-  Lisp_Symbol *symbol;
+  Lisp_Object symbol;
   Bytecount len;
 
   if (NILP (obarray)) obarray = Vobarray;
@@ -226,21 +223,21 @@
   ptr = &XVECTOR_DATA (obarray)[XINT (object)];
 
   object = Fmake_symbol (string);
-  symbol = XSYMBOL (object);
+  symbol = object;
 
   if (SYMBOLP (*ptr))
-    symbol_next (symbol) = XSYMBOL (*ptr);
+    XSYMBOL_NEXT (symbol) = XSYMBOL (*ptr);
   else
-    symbol_next (symbol) = 0;
+    XSYMBOL_NEXT (symbol) = 0;
   *ptr = object;
 
-  if (string_byte (symbol_name (symbol), 0) == ':' && EQ (obarray, Vobarray))
+  if (XSTRING_BYTE (XSYMBOL_NAME (symbol), 0) == ':' && EQ (obarray, Vobarray))
     {
       /* The LISP way is to put keywords in their own package, but we
 	 don't have packages, so we do something simpler.  Someday,
 	 maybe we'll have packages and then this will be reworked.
 	 --Stig. */
-      symbol_value (symbol) = object;
+      XSYMBOL_VALUE (symbol) = object;
     }
 
   return object;
@@ -258,7 +255,7 @@
   /* #### Bug!  (intern-soft "nil") returns nil.  Perhaps we should
      add a DEFAULT-IF-NOT-FOUND arg, like in get.  */
   Lisp_Object tem;
-  Lisp_String *string;
+  Lisp_Object string;
 
   if (NILP (obarray)) obarray = Vobarray;
   obarray = check_obarray (obarray);
@@ -266,12 +263,12 @@
   if (!SYMBOLP (name))
     {
       CHECK_STRING (name);
-      string = XSTRING (name);
+      string = name;
     }
   else
     string = symbol_name (XSYMBOL (name));
 
-  tem = oblookup (obarray, string_data (string), string_length (string));
+  tem = oblookup (obarray, XSTRING_DATA (string), XSTRING_LENGTH (string));
   if (INTP (tem) || (SYMBOLP (name) && !EQ (name, tem)))
     return Qnil;
   else
@@ -288,7 +285,7 @@
        (name, obarray))
 {
   Lisp_Object tem;
-  Lisp_String *string;
+  Lisp_Object string;
   int hash;
 
   if (NILP (obarray)) obarray = Vobarray;
@@ -299,10 +296,10 @@
   else
     {
       CHECK_STRING (name);
-      string = XSTRING (name);
+      string = name;
     }
 
-  tem = oblookup (obarray, string_data (string), string_length (string));
+  tem = oblookup (obarray, XSTRING_DATA (string), XSTRING_LENGTH (string));
   if (INTP (tem))
     return Qnil;
   /* If arg was a symbol, don't delete anything but that symbol itself.  */
@@ -314,7 +311,7 @@
   if (EQ (XVECTOR_DATA (obarray)[hash], tem))
     {
       if (XSYMBOL (tem)->next)
-	XSETSYMBOL (XVECTOR_DATA (obarray)[hash], XSYMBOL (tem)->next);
+	XVECTOR_DATA (obarray)[hash] = wrap_symbol (XSYMBOL (tem)->next);
       else
 	XVECTOR_DATA (obarray)[hash] = Qzero;
     }
@@ -326,7 +323,7 @@
 	   XSYMBOL (tail)->next;
 	   tail = following)
 	{
-	  XSETSYMBOL (following, XSYMBOL (tail)->next);
+	  following = wrap_symbol (XSYMBOL (tail)->next);
 	  if (EQ (following, tem))
 	    {
 	      XSYMBOL (tail)->next = XSYMBOL (following)->next;
@@ -366,11 +363,10 @@
   else
     for (tail = XSYMBOL (bucket); ;)
       {
-	if (string_length (tail->name) == size &&
-	    !memcmp (string_data (tail->name), ptr, size))
+	if (XSTRING_LENGTH (tail->name) == size &&
+	    !memcmp (XSTRING_DATA (tail->name), ptr, size))
 	  {
-	    XSETSYMBOL (bucket, tail);
-	    return bucket;
+	    return wrap_symbol (tail);
 	  }
 	tail = symbol_next (tail);
 	if (!tail)
@@ -416,7 +412,7 @@
 	    next = symbol_next (XSYMBOL (tail));
 	    if (!next)
 	      break;
-	    XSETSYMBOL (tail, next);
+	    tail = wrap_symbol (next);
 	  }
     }
 }
@@ -667,11 +663,8 @@
 */
        (symbol))
 {
-  Lisp_Object name;
-
   CHECK_SYMBOL (symbol);
-  XSETSTRING (name, XSYMBOL (symbol)->name);
-  return name;
+  return XSYMBOL (symbol)->name;
 }
 
 DEFUN ("fset", Ffset, 2, 2, 0, /*
@@ -1373,7 +1366,7 @@
     new_val = Fcdr (new_alist_el);
 
   bfwd->current_alist_element = new_alist_el;
-  XSETBUFFER (bfwd->current_buffer, buf);
+  bfwd->current_buffer = wrap_buffer (buf);
 
   /* Now store the value into the current-value slot.
      We don't simply write it there, because the current-value
@@ -1446,7 +1439,7 @@
 	    next = symbol_next (XSYMBOL (sym));
 	    if (!next)
 	      break;
-	    XSETSYMBOL (sym, next);
+	    sym = wrap_symbol (next);
 	  }
     }
 }
@@ -1867,7 +1860,7 @@
 	    /* Cache the new buffer's assoc in CURRENT-ALIST-ELEMENT.  */
 	    bfwd->current_alist_element = aelt;
 	    /* Set BUFFER, now that CURRENT-ALIST-ELEMENT is accurate.  */
-	    XSETBUFFER (bfwd->current_buffer, current_buffer);
+	    bfwd->current_buffer = wrap_buffer (current_buffer);
 	    valcontents = bfwd->current_value;
 	  }
 	break;
@@ -2158,7 +2151,7 @@
     bfwd->current_value = valcontents;
     bfwd->current_alist_element = Qnil;
     bfwd->current_buffer = Fcurrent_buffer ();
-    XSETSYMBOL_VALUE_MAGIC (foo, bfwd);
+    foo = wrap_symbol_value_magic (bfwd);
     *value_slot_past_magic (variable) = foo;
 #if 1				/* #### Yuck!   FSFmacs bug-compatibility*/
     /* This sets the default-value of any make-variable-buffer-local to nil.
@@ -2275,7 +2268,7 @@
     bfwd->default_value = Qnil; /* Yuck! */
 #endif
 
-  XSETSYMBOL_VALUE_MAGIC (valcontents, bfwd);
+  valcontents = wrap_symbol_value_magic (bfwd);
   *value_slot_past_magic (variable) = valcontents;
 
  already_local_to_some_other_buffer:
@@ -2286,7 +2279,7 @@
   if (UNBOUNDP (bfwd->default_value))
     {
       /* If default value is unbound, set local value to nil. */
-      XSETBUFFER (bfwd->current_buffer, current_buffer);
+      bfwd->current_buffer = wrap_buffer (current_buffer);
       bfwd->current_alist_element = Fcons (variable, Qnil);
       current_buffer->local_var_alist =
 	Fcons (bfwd->current_alist_element, current_buffer->local_var_alist);
@@ -2988,7 +2981,7 @@
 	  bfwd->harg[i] = Qnil;
 	}
       bfwd->shadowed = valcontents;
-      XSETSYMBOL_VALUE_MAGIC (XSYMBOL (variable)->value, bfwd);
+      XSYMBOL (variable)->value = wrap_symbol_value_magic (bfwd);
     }
   else
     bfwd = XSYMBOL_VALUE_LISP_MAGIC (valcontents);
@@ -3122,7 +3115,7 @@
   bfwd->aliasee = alias;
   bfwd->shadowed = valcontents;
 
-  XSETSYMBOL_VALUE_MAGIC (valcontents, bfwd);
+  valcontents = wrap_symbol_value_magic (bfwd);
   XSYMBOL (variable)->value = valcontents;
   return Qnil;
 }
@@ -3224,7 +3217,7 @@
   /* Bootstrapping problem: Qnil isn't set when make_string_nocopy is
      called the first time. */
   Qnil = Fmake_symbol (make_string_nocopy ((const Intbyte *) "nil", 3));
-  XSYMBOL (Qnil)->name->plist = Qnil;
+  XSTRING_PLIST (XSYMBOL (Qnil)->name) = Qnil;
   XSYMBOL (Qnil)->value = Qnil; /* Nihil ex nihil */
   XSYMBOL (Qnil)->plist = Qnil;
 
@@ -3233,7 +3226,7 @@
   staticpro (&initial_obarray);
   /* Intern nil in the obarray */
   {
-    unsigned int hash = hash_string (string_data (XSYMBOL (Qnil)->name), 3);
+    unsigned int hash = hash_string (XSTRING_DATA (XSYMBOL (Qnil)->name), 3);
     XVECTOR_DATA (Vobarray)[hash % OBARRAY_SIZE] = Qnil;
   }
 
@@ -3242,7 +3235,7 @@
        architectures */
     const struct symbol_value_magic *tem = &guts_of_unbound_marker;
 
-    XSETSYMBOL_VALUE_MAGIC (Qunbound, tem);
+    Qunbound = wrap_symbol_value_magic (tem);
   }
 
   XSYMBOL (Qnil)->function = Qunbound;
@@ -3422,7 +3415,7 @@
   check_sane_subr (subr, sym);
   check_module_subr ();
 
-  XSETSUBR (fun, subr);
+  fun = wrap_subr (subr);
   XSYMBOL (sym)->function = fun;
 }
 
@@ -3436,7 +3429,7 @@
   check_sane_subr (subr, sym);
   check_module_subr();
 
-  XSETSUBR (fun, subr);
+  fun = wrap_subr (subr);
   XSYMBOL (sym)->function = Fcons (Qmacro, fun);
 }
 
@@ -3591,7 +3584,7 @@
     sym = Fintern (make_string_nocopy ((const Intbyte *) symbol_name,
 				       strlen (symbol_name)), Qnil);
 
-  XSETOBJ (XSYMBOL (sym)->value, magic);
+  XSYMBOL (sym)->value = wrap_pointer_1 (magic);
 }
 
 void
--- a/src/symeval.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/symeval.h	Fri Mar 29 04:49:13 2002 +0000
@@ -1,6 +1,6 @@
 /* Definitions of symbol-value forwarding for XEmacs Lisp interpreter.
    Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc.
-   Copyright (C) 2000, 2001 Ben Wing.
+   Copyright (C) 2000, 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -84,7 +84,7 @@
  XRECORD_LHEADER (x)->type <= lrecord_type_max_symbol_value_magic)
 #define XSYMBOL_VALUE_MAGIC_TYPE(v) \
 	(((struct symbol_value_magic *) XPNTR (v))->type)
-#define XSETSYMBOL_VALUE_MAGIC(s, p) XSETOBJ (s, p)
+#define wrap_symbol_value_magic(p) wrap_pointer_1 (p)
 void print_symbol_value_magic (Lisp_Object, Lisp_Object, int);
 
 /********** The various different symbol-value-magic types ***********/
--- a/src/syntax.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/syntax.h	Fri Mar 29 04:49:13 2002 +0000
@@ -1,5 +1,6 @@
 /* Declarations having to do with XEmacs syntax tables.
    Copyright (C) 1985, 1992, 1993 Free Software Foundation, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -330,7 +331,7 @@
   (! lookup_syntax_properties						\
    ? 0									\
    : STRINGP (syntax_cache.object)					\
-   ? XSTRING_INDEX_BYTE_TO_CHAR (syntax_cache.object, bytepos)		\
+   ? string_index_byte_to_char (syntax_cache.object, bytepos)		\
    : (BUFFERP (syntax_cache.object) || NILP (syntax_cache.object))	\
    ? bytebpos_to_charbpos (syntax_cache.buffer,				\
 		       bytepos + BI_BUF_BEGV (syntax_cache.buffer))	\
@@ -340,7 +341,7 @@
   (! lookup_syntax_properties					\
    ? 0								\
    : STRINGP (obj)						\
-   ? XSTRING_INDEX_BYTE_TO_CHAR (obj, bytepos)			\
+   ? string_index_byte_to_char (obj, bytepos)			\
    : (BUFFERP (obj) || NILP (obj))				\
    ? bytebpos_to_charbpos (buf, bytepos + BI_BUF_BEGV (buf))	\
    : (bytepos))
--- a/src/text.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/text.c	Fri Mar 29 04:49:13 2002 +0000
@@ -2136,8 +2136,8 @@
 	ind = -1;
       else
 	{
-	  Lisp_Object buffer;
-	  XSETBUFFER (buffer, b);
+	  Lisp_Object buffer = wrap_buffer (b);
+
 	  args_out_of_range (buffer, pos);
 	}
     }
@@ -2189,8 +2189,8 @@
 
   if ((*from_out < 0 || *to_out < 0) && !(flags & GB_NO_ERROR_IF_BAD))
     {
-      Lisp_Object buffer;
-      XSETBUFFER (buffer, b);
+      Lisp_Object buffer = wrap_buffer (b);
+
       args_out_of_range_3 (buffer, from, to);
     }
 
@@ -2265,7 +2265,7 @@
   Charcount ccpos = get_string_pos_char (string, pos, flags);
   if (ccpos < 0) /* could happen with GB_NO_ERROR_IF_BAD */
     return -1;
-  return XSTRING_INDEX_CHAR_TO_BYTE (string, ccpos);
+  return string_index_char_to_byte (string, ccpos);
 }
 
 void
@@ -2315,11 +2315,11 @@
 
   get_string_range_char (string, from, to, &s, &e, flags);
   if (s >= 0)
-    *from_out = XSTRING_INDEX_CHAR_TO_BYTE (string, s);
+    *from_out = string_index_char_to_byte (string, s);
   else /* could happen with GB_NO_ERROR_IF_BAD */
     *from_out = -1;
   if (e >= 0)
-    *to_out = XSTRING_INDEX_CHAR_TO_BYTE (string, e);
+    *to_out = string_index_char_to_byte (string, e);
   else
     *to_out = -1;
 
--- a/src/text.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/text.h	Fri Mar 29 04:49:13 2002 +0000
@@ -482,31 +482,33 @@
 
    (a) it is Mule-correct
    (b) it does dynamic allocation so you never have to worry about size
-       restrictions (and all allocation is stack-local using alloca(), so
-       there is no need to explicitly clean up)
-   (c) it knows its own length, so it does not suffer from standard null
-       byte brain-damage
-   (d) it provides a much more powerful set of operations and knows about
+       restrictions
+   (c) it comes in an alloca() variety (all allocation is stack-local,
+       so there is no need to explicitly clean up) as well as a malloc()
+       variety
+   (d) it knows its own length, so it does not suffer from standard null
+       byte brain-damage -- but it null-terminates the data anyway, so
+       it can be passed to standard routines
+   (e) it provides a much more powerful set of operations and knows about
        all the standard places where string data might reside: Lisp_Objects,
        other Eistrings, Intbyte * data with or without an explicit length,
        ASCII strings, Emchars, etc.
-   (e) it provides easy operations to convert to/from externally-formatted
-       data, and is much easier to use than the standard TO_INTERNAL_FORMAT
+   (f) it provides easy operations to convert to/from externally-formatted
+       data, and is easier to use than the standard TO_INTERNAL_FORMAT
        and TO_EXTERNAL_FORMAT macros. (An Eistring can store both the internal
        and external version of its data, but the external version is only
        initialized or changed when you call eito_external().)
 
-   The idea is to make it as easy to write Mule-correct string
-   manipulation code as it is to write normal string manipulation
-   code.  We also make the API sufficiently general that it can handle
-   multiple internal data formats (e.g. some fixed-width optimizing
-   formats and a default variable width format) and allows for *ANY*
-   data format we might choose in the future for the default format,
-   including UCS2. (In other words, we can't assume that the internal
-   format is ASCII-compatible and we can't assume it doesn't have
-   embedded null bytes.  We do assume, however, that any chosen format
-   will have the concept of null-termination.) All of this is hidden
-   from the user.
+   The idea is to make it as easy to write Mule-correct string manipulation
+   code as it is to write normal string manipulation code.  We also make
+   the API sufficiently general that it can handle multiple internal data
+   formats (e.g. some fixed-width optimizing formats and a default variable
+   width format) and allows for *ANY* data format we might choose in the
+   future for the default format, including UCS2. (In other words, we can't
+   assume that the internal format is ASCII-compatible and we can't assume
+   it doesn't have embedded null bytes.  We do assume, however, that any
+   chosen format will have the concept of null-termination.) All of this is
+   hidden from the user.
 
    #### It is really too bad that we don't have a real object-oriented
    language, or at least a language with polymorphism!
@@ -529,20 +531,23 @@
         data.  This is a standard local variable declaration and can go
         anywhere in the variable declaration section.  Once you initialize
 	the Eistring, you will have to free it using eifree() to avoid
-	memory leaks.
+	memory leaks.  You will need to use this form if you are passing
+	an Eistring to any function that modifies it (otherwise, the
+	modified data may be in stack space and get overwritten when the
+	function returns).
 
    or use
 
-   Eistring name;
-   void eiinit (Eistring name);
-   void eiinit_malloc (Eistring name);
+   Eistring ei;
+   void eiinit (Eistring *ei);
+   void eiinit_malloc (Eistring *einame);
         If you need to put an Eistring elsewhere than in a local variable
         declaration (e.g. in a structure), declare it as shown and then
         call one of the init macros.
 
    Also note:
 
-   void eifree (Eistring ei);
+   void eifree (Eistring *ei);
         If you declared an Eistring to use malloc() to hold its data,
 	or converted it to the heap using eito_malloc(), then this
 	releases any data in it and afterwards resets the Eistring
@@ -574,7 +579,7 @@
    void eicpy_lstr (Eistring *eistr, Lisp_Object lisp_string);
         ... from a Lisp_Object string.
    void eicpy_ch (Eistring *eistr, Emchar ch);
-        ... from an Emchar.
+        ... from an Emchar (this can be a conventional C character).
 
    void eicpy_lstr_off (Eistring *eistr, Lisp_Object lisp_string,
                         Bytecount off, Charcount charoff,
@@ -636,9 +641,11 @@
         Make an alloca() copy of the data in the Eistring, using the
         default internal format.  Due to the nature of alloca(), this
         must be a macro, with all lvalues passed in as parameters.
-        A pointer to the alloca()ed data is stored in PTR_OUT, and
-        the length of the data (not including the terminating zero)
-        is stored in LEN_OUT.
+	(More specifically, not all compilers correctly handle using
+	alloca() as the argument to a function call -- GCC on x86
+	didn't used to, for example.) A pointer to the alloca()ed data
+	is stored in PTR_OUT, and the length of the data (not including
+	the terminating zero) is stored in LEN_OUT.
 
    void eicpyout_alloca_fmt (Eistring *eistr, LVALUE: Intbyte *ptr_out,
                              LVALUE: Bytecount len_out,
@@ -1017,12 +1024,12 @@
 
 #define eiinit(ei)				\
 do {						\
-  (ei) = the_eistring_zero_init;		\
+  *(ei) = the_eistring_zero_init;		\
 } while (0)
 
 #define eiinit_malloc(ei)			\
 do {						\
-  (ei) = the_eistring_malloc_zero_init;		\
+  *(ei) = the_eistring_malloc_zero_init;	\
 } while (0)
 
 
@@ -1270,7 +1277,6 @@
   memcpy (*ei23ptrout, (eistr)->data_, (eistr)->bytelen_ + 1);	\
 } while (0)
 
-
 /*   ----- Moving to the heap -----   */
 
 #define eifree(ei)				\
--- a/src/toolbar-common.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/toolbar-common.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* toolbar implementation -- "Generic" (X or GTK) redisplay interface.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2002 Ben Wing.
    Copyright (C) 1996 Chuck Thompson.
 
 This file is part of XEmacs.
@@ -188,7 +188,7 @@
       height_adj = - 2 * border_width;
     }
 
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   window = FRAME_LAST_NONMINIBUF_WINDOW (f);
   w = XWINDOW (window);
 
@@ -217,7 +217,7 @@
   /* #### It is currently possible for users to trash us by directly
      changing the toolbar glyphs.  Avoid crashing in that case. */
   if (GLYPHP (glyph))
-    instance = glyph_image_instance (glyph, window, ERROR_ME_NOT, 1);
+    instance = glyph_image_instance (glyph, window, ERROR_ME_DEBUG_WARN, 1);
   else
     instance = Qnil;
 
@@ -560,9 +560,8 @@
 
   if (!vert)
     {
-      Lisp_Object frame;
+      Lisp_Object frame = wrap_frame (f);
 
-      XSETFRAME (frame, f);
       redisplay_clear_region (frame,
 			      DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1,
 			      bar_height);
@@ -579,7 +578,7 @@
   int x, y, width, height, vert;
 
   get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 1);
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
 
   /* The thickness_change parameter is used by the toolbar resize routines
      to clear any excess toolbar if the size shrinks. */
--- a/src/toolbar-msw.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/toolbar-msw.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* toolbar implementation -- mswindows interface.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2002 Ben Wing.
    Copyright (C) 1996 Chuck Thompson.
    Copyright (C) 1998 Andy Piper.
 
@@ -253,7 +253,7 @@
 	      
 	      if (GLYPHP (glyph))
 		instance = glyph_image_instance (glyph, window, 
-						 ERROR_ME_NOT, 1);
+						 ERROR_ME_DEBUG_WARN, 1);
 	      else
 		instance = Qnil;
 	      
@@ -632,7 +632,7 @@
 
   /* Ok, this is our one. Enqueue it. */
   get_gui_callback (data, &fn, &arg);
-  XSETFRAME (frame, f);
+  frame = wrap_frame (f);
   mswindows_enqueue_misc_user_event (frame, fn, arg);
 
   return Qt;
--- a/src/toolbar.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/toolbar.c	Fri Mar 29 04:49:13 2002 +0000
@@ -290,7 +290,7 @@
     {
       tb = alloc_lcrecord_type (struct toolbar_button, &lrecord_toolbar_button);
       tb->next = Qnil;
-      XSETFRAME (tb->frame, f);
+      tb->frame = wrap_frame (f);
       tb->up_glyph = Qnil;
       tb->down_glyph = Qnil;
       tb->disabled_glyph = Qnil;
@@ -308,7 +308,7 @@
       tb->x = tb->y = tb->width = tb->height = -1;
       tb->dirty = 1;
     }
-  XSETTOOLBAR_BUTTON (retval, tb);
+  retval = wrap_toolbar_button (tb);
 
   /* Let's make sure nothing gets mucked up by the potential call to
      eval farther down. */
@@ -768,7 +768,7 @@
       int pos;
 
       compute_frame_toolbars_data (f);
-      XSETFRAME (frame, f);
+      frame = wrap_frame (f);
       call_critical_lisp_code (XDEVICE (FRAME_DEVICE (f)),
 			       Qinit_toolbar_from_resources,
 			       frame);
@@ -786,9 +786,8 @@
 void
 init_device_toolbars (struct device *d)
 {
-  Lisp_Object device;
+  Lisp_Object device = wrap_device (d);
 
-  XSETDEVICE (device, d);
   if (DEVICE_SUPPORTS_TOOLBARS_P (d))
     call_critical_lisp_code (d,
 			     Qinit_toolbar_from_resources,
--- a/src/toolbar.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/toolbar.h	Fri Mar 29 04:49:13 2002 +0000
@@ -71,7 +71,6 @@
 
 DECLARE_LRECORD (toolbar_button, struct toolbar_button);
 #define XTOOLBAR_BUTTON(x) XRECORD (x, toolbar_button, struct toolbar_button)
-#define XSETTOOLBAR_BUTTON(x, p) XSETRECORD (x, p, toolbar_button)
 #define wrap_toolbar_button(p) wrap_record (p, toolbar_button)
 #define TOOLBAR_BUTTONP(x) RECORDP (x, toolbar_button)
 #define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button)
@@ -84,7 +83,6 @@
 				      int y_coord);
 DECLARE_SPECIFIER_TYPE (toolbar);
 #define XTOOLBAR_SPECIFIER(x) XSPECIFIER_TYPE (x, toolbar)
-#define XSETTOOLBAR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, toolbar)
 #define TOOLBAR_SPECIFIERP(x) SPECIFIER_TYPEP (x, toolbar)
 #define CHECK_TOOLBAR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, toolbar)
 #define CONCHECK_TOOLBAR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, toolbar)
--- a/src/tooltalk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/tooltalk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -189,8 +189,7 @@
   msg->m = m;
   msg->callback = Qnil;
   msg->plist_sym = Fmake_symbol (Tooltalk_Message_plist_str);
-  XSETTOOLTALK_MESSAGE (val, msg);
-  return val;
+  return wrap_tooltalk_message (msg);
 }
 
 Tt_message
@@ -263,8 +262,7 @@
   pat->callback = Qnil;
   pat->plist_sym = Fmake_symbol (Tooltalk_Pattern_plist_str);
 
-  XSETTOOLTALK_PATTERN (val, pat);
-  return val;
+  return wrap_tooltalk_pattern (pat);
 }
 
 static Tt_pattern
@@ -1262,7 +1260,7 @@
     {
       /* Don't ask the user for confirmation when exiting Emacs */
       Fprocess_kill_without_query (lp, Qnil);
-      XSETSUBR (fil, &SFreceive_tooltalk_message);
+      fil = wrap_subr (&SFreceive_tooltalk_message);
       set_process_filter (lp, fil, 1);
     }
   else
--- a/src/tooltalk.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/tooltalk.h	Fri Mar 29 04:49:13 2002 +0000
@@ -29,7 +29,6 @@
 typedef struct Lisp_Tooltalk_Message Lisp_Tooltalk_Message;
 DECLARE_LRECORD (tooltalk_message, Lisp_Tooltalk_Message);
 #define XTOOLTALK_MESSAGE(x) XRECORD (x, tooltalk_message, Lisp_Tooltalk_Message)
-#define XSETTOOLTALK_MESSAGE(x, p) XSETRECORD (x, p, tooltalk_message)
 #define wrap_tooltalk_message(p) wrap_record (p, tooltalk_message)
 #define TOOLTALK_MESSAGEP(x) RECORDP (x, tooltalk_message)
 #define CHECK_TOOLTALK_MESSAGE(x) CHECK_RECORD (x, tooltalk_message)
@@ -37,7 +36,6 @@
 typedef struct Lisp_Tooltalk_Pattern Lisp_Tooltalk_Pattern;
 DECLARE_LRECORD (tooltalk_pattern, Lisp_Tooltalk_Pattern);
 #define XTOOLTALK_PATTERN(x) XRECORD (x, tooltalk_pattern, Lisp_Tooltalk_Pattern)
-#define XSETTOOLTALK_PATTERN(x, p) XSETRECORD (x, p, tooltalk_pattern)
 #define wrap_tooltalk_pattern(p) wrap_record (p, tooltalk_pattern)
 #define TOOLTALK_PATTERNP(x) RECORDP (x, tooltalk_pattern)
 #define CHECK_TOOLTALK_PATTERN(x) CHECK_RECORD (x, tooltalk_pattern)
--- a/src/ui-gtk.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/ui-gtk.c	Fri Mar 29 04:49:13 2002 +0000
@@ -659,7 +659,7 @@
   data->function_ptr = name_func;
   data->marshal = marshaller_func;
 
-  XSETFFI (rval, data);
+  rval = wrap_ffi (data);
   return (rval);
 }
 
@@ -908,8 +908,8 @@
 
   if (for_disksave)
     {
-      Lisp_Object obj;
-      XSETGTK_OBJECT (obj, data);
+      Lisp_Object obj = wrap_gtk_object (data);
+
 
       invalid_operation
 	("Can't dump an emacs containing GtkObject objects", obj);
@@ -977,7 +977,7 @@
 
       data->object = obj;
       data->alive_p = TRUE;
-      XSETGTK_OBJECT (retval, data);
+      retval = wrap_gtk_object (data);
 
       id = new_gui_id ();
       gtk_object_set_data (obj, "xemacs::gui_id", (gpointer) id);
@@ -1165,7 +1165,7 @@
   data->object = obj;
   data->object_type = t;
 
-  XSETGTK_BOXED (retval, data);
+  retval = wrap_gtk_boxed (data);
 
   return (retval);
 }
@@ -1625,7 +1625,8 @@
 	  if (GLYPHP (obj))
 	    {
 	      Lisp_Object window = Fselected_window (Qnil);
-	      Lisp_Object instance = glyph_image_instance (obj, window, ERROR_ME_NOT, 1);
+	      Lisp_Object instance =
+		glyph_image_instance (obj, window, ERROR_ME_DEBUG_WARN, 1);
 	      struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (instance);
 
 	      switch (XIMAGE_INSTANCE_TYPE (instance))
--- a/src/ui-gtk.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/ui-gtk.h	Fri Mar 29 04:49:13 2002 +0000
@@ -33,7 +33,6 @@
 DECLARE_LRECORD (emacs_ffi, emacs_ffi_data);
 
 #define XFFI(x) XRECORD (x, emacs_ffi, emacs_ffi_data)
-#define XSETFFI(x,p) XSETRECORD (x, p, emacs_ffi)
 #define wrap_emacs_ffi(p) wrap_record (p, emacs_ffi)
 #define FFIP(x) RECORDP (x, emacs_ffi)
 #define CHECK_FFI(x) CHECK_RECORD (x, emacs_ffi)
@@ -49,7 +48,6 @@
 DECLARE_LRECORD (emacs_gtk_object, emacs_gtk_object_data);
 
 #define XGTK_OBJECT(x) XRECORD (x, emacs_gtk_object, emacs_gtk_object_data)
-#define XSETGTK_OBJECT(x,p) XSETRECORD (x, p, emacs_gtk_object)
 #define wrap_emacs_gtk_object(p) wrap_record (p, emacs_gtk_object)
 #define GTK_OBJECTP(x) RECORDP (x, emacs_gtk_object)
 #define CHECK_GTK_OBJECT(x) CHECK_RECORD (x, emacs_gtk_object)
@@ -66,7 +64,6 @@
 DECLARE_LRECORD (emacs_gtk_boxed, emacs_gtk_boxed_data);
 
 #define XGTK_BOXED(x) XRECORD (x, emacs_gtk_boxed, emacs_gtk_boxed_data)
-#define XSETGTK_BOXED(x,p) XSETRECORD (x, p, emacs_gtk_boxed)
 #define wrap_emacs_gtk_boxed(p) wrap_record (p, emacs_gtk_boxed)
 #define GTK_BOXEDP(x) RECORDP (x, emacs_gtk_boxed)
 #define CHECK_GTK_BOXED(x) CHECK_RECORD (x, emacs_gtk_boxed)
--- a/src/undo.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/undo.c	Fri Mar 29 04:49:13 2002 +0000
@@ -80,7 +80,7 @@
 	  != BUFFER_BASE_BUFFER (XBUFFER (last_undo_buffer))))
     {
       undo_boundary (b);
-      XSETBUFFER (last_undo_buffer, b);
+      last_undo_buffer = wrap_buffer (b);
     }
 
   /* Allocate a cons cell to be the undo boundary after this command.  */
--- a/src/unicode.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/unicode.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1300,7 +1300,7 @@
 	   sscanf (p, "%i %i %i%n", &dummy, &cp1, &cp2, &endcount) < 3)
 	  || *(p + endcount + strspn (p + endcount, " \t\n\r\f")))
 	{
-	  warn_when_safe (intern ("unicode"), Qnotice,
+	  warn_when_safe (Qunicode, Qwarning,
 			  "Unrecognized line in translation file %s:\n%s",
 			  XSTRING_DATA (filename), line);
 	  continue;
@@ -1311,8 +1311,9 @@
 	  if (cp1 < 0 || cp1 >= 65536)
 	    {
 	    out_of_range:
-	      warn_when_safe (intern ("unicode"), Qnotice,
-			      "Out of range first codepoint 0x%x in translation file %s:\n%s",
+	      warn_when_safe (Qunicode, Qwarning,
+			      "Out of range first codepoint 0x%x in "
+			      "translation file %s:\n%s",
 			      cp1, XSTRING_DATA (filename), line);
 	      continue;
 	    }
@@ -1324,8 +1325,10 @@
 	    {
 	      Emchar ch = decode_big5_char (cp1high, cp1low);
 	      if (ch == -1)
-		warn_when_safe (intern ("unicode"), Qnotice,
-				"Out of range Big5 codepoint 0x%x in translation file %s:\n%s",
+
+		warn_when_safe (Qunicode, Qwarning,
+				"Out of range Big5 codepoint 0x%x in "
+				"translation file %s:\n%s",
 				cp1, XSTRING_DATA (filename), line);
 	      else
 		set_unicode_conversion (ch, cp2);
--- a/src/vm-limit.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/vm-limit.c	Fri Mar 29 04:49:13 2002 +0000
@@ -34,6 +34,8 @@
 
 #include "mem-limits.h"
 
+#ifndef _NO_MALLOC_WARNING_
+
 /*
   Level number of warnings already issued.
   0 -- no warnings issued.
@@ -134,13 +136,17 @@
     }
 }
 
+#endif /* not _NO_MALLOC_WARNING_ */
+
 /* Cause reinitialization based on job parameters;
    also declare where the end of pure storage is. */
 
 void
 memory_warnings (void *start, void (*warnfun) (const char *))
 {
+#ifndef _NO_MALLOC_WARNING_
   extern void (* __after_morecore_hook) (void);	/* From gmalloc.c */
+#endif
 
   if (start)
     data_space_start = (char*) start;
--- a/src/window.c	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/window.c	Fri Mar 29 04:49:13 2002 +0000
@@ -1,7 +1,7 @@
 /* Window creation, deletion and examination for XEmacs.
    Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc.
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2002 Ben Wing.
    Copyright (C) 1996 Chuck Thompson.
 
 This file is part of XEmacs.
@@ -241,7 +241,7 @@
   struct window *p = alloc_lcrecord_type (struct window, &lrecord_window);
 
   zero_lcrecord (p);
-  XSETWINDOW (val, p);
+  val = wrap_window (p);
 
   p->dead = 0;
 
@@ -636,7 +636,7 @@
 {
   Lisp_Object parent, current_ancestor, window;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   parent = XWINDOW (window)->parent;
   current_ancestor = window;
@@ -659,7 +659,7 @@
 {
   Lisp_Object parent, current_ancestor, window;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   parent = XWINDOW (window)->parent;
   current_ancestor = window;
@@ -688,7 +688,7 @@
 {
   Lisp_Object parent, current_ancestor, window;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   parent = XWINDOW (window)->parent;
   current_ancestor = window;
@@ -716,7 +716,7 @@
 {
   Lisp_Object parent, current_ancestor, window;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   parent = XWINDOW (window)->parent;
   current_ancestor = window;
@@ -994,7 +994,7 @@
   if (MINI_WINDOW_P (w))
     return 0;
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
   b = XBUFFER (w->buffer);
   margin_cwidth = (left_margin ? XINT (w->left_margin_width) :
 		   XINT (w->right_margin_width));
@@ -2285,7 +2285,7 @@
 		   If that happens, go back to the selected frame
 		   so we can complete the cycle.  */
 		if (EQ (tem, tem1))
-		  XSETFRAME (tem, selected_frame ());
+		  tem = wrap_frame (selected_frame ());
 	      }
 
 	    tem = FRAME_ROOT_WINDOW (XFRAME (tem));
@@ -2440,7 +2440,7 @@
 		   If that happens, go back to the selected frame
 		   so we can complete the cycle.  */
 		if (EQ (tem, tem1))
-		  XSETFRAME (tem, selected_frame ());
+		  tem = wrap_frame (selected_frame ());
 	      }
 
 	    /* If this frame has a minibuffer, find that window first,
@@ -2489,7 +2489,7 @@
 {
   Lisp_Object root;
   struct window *w = decode_window (window);
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   if (MINI_WINDOW_P (XWINDOW (window)))
     return Qnil;
@@ -2647,7 +2647,7 @@
       Lisp_Object the_frame;
 
       if (frame)
-	XSETFRAME (the_frame, frame);
+	the_frame = wrap_frame (frame);
       else
 	the_frame = DEVICE_SELECTED_FRAME (XDEVICE (device));
 
@@ -2859,8 +2859,8 @@
 {
   Lisp_Object buffer, frame;
 
-  XSETFRAME (frame, f);
-  XSETBUFFER (buffer, b);
+  frame = wrap_frame (f);
+  buffer = wrap_buffer (b);
 
   return XINT (window_loop (GET_BUFFER_WINDOW_COUNT, buffer, 0, frame, 1,
 			    Qnil));
@@ -3040,7 +3040,7 @@
   Charbpos start_pos;
   int old_top = WINDOW_TOP (w);
 
-  XSETWINDOW (window, w);
+  window = wrap_window (w);
 
   if (MINI_WINDOW_P (w) && old_top > 0)
     invalid_operation ("Can't expand minibuffer to full frame", Qunbound);
@@ -3126,8 +3126,8 @@
 	value = list_windows (XWINDOW (w->vchild), value);
       else
 	{
-	  Lisp_Object window;
-	  XSETWINDOW (window, w);
+	  Lisp_Object window = wrap_window (w);
+
 	  value = Fcons (window, value);
 	}
       if (NILP (w->next))
@@ -3663,7 +3663,7 @@
   struct window *o = XWINDOW (window);
   struct window *p = alloc_lcrecord_type (struct window, &lrecord_window);
 
-  XSETWINDOW (new, p);
+  new = wrap_window (p);
   copy_lcrecord (p, o);
 
   /* Don't copy the pointers to the line start cache or the face
@@ -3899,9 +3899,8 @@
   int avail_height;
   int defheight, defwidth;
   int char_height;
-  Lisp_Object window;
-
-  XSETWINDOW (window, w);
+  Lisp_Object window = wrap_window (w);
+
 
   avail_height = (pixel_height -
 		  (include_gutters_p ? 0 :
@@ -3928,9 +3927,8 @@
   int defheight, defwidth;
   int pixel_height;
 
-  Lisp_Object window;
-
-  XSETWINDOW (window, w);
+  Lisp_Object window = wrap_window (w);
+
 
   default_face_height_and_width (window, &defheight, &defwidth);
 
@@ -3991,7 +3989,7 @@
       Lisp_Object window;
       int defheight, defwidth;
 
-      XSETWINDOW (window, w);
+      window = wrap_window (w);
 
       if (dl->modeline)
 	{
@@ -4045,9 +4043,8 @@
   int avail_width;
   int char_width;
   int defheight, defwidth;
-  Lisp_Object window;
-
-  XSETWINDOW (window, w);
+  Lisp_Object window = wrap_window (w);
+
 
   avail_width = (pixel_width -
 		 window_left_gutter_width (w, 0) -
@@ -4074,9 +4071,8 @@
   int avail_width;
   int pixel_width;
   int defheight, defwidth;
-  Lisp_Object window;
-
-  XSETWINDOW (window, w);
+  Lisp_Object window = wrap_window (w);
+
 
   default_face_height_and_width (window, &defheight, &defwidth);
 
@@ -4156,7 +4152,7 @@
 
   check_min_window_sizes ();
 
-  XSETWINDOW (window, win);
+  window = wrap_window (win);
   f = XFRAME (win->frame);
   if (EQ (window, FRAME_ROOT_WINDOW (f)))
     invalid_operation ("Won't change only window", Qunbound);
@@ -4819,7 +4815,7 @@
       /* #### Is this going to work right when at eob? */
       arg = Fprefix_numeric_value (arg);
       if (XINT (arg) < 0)
-	XSETINT (arg, XINT (arg) + height);
+	arg = make_int (XINT (arg) + height);
     }
 
   start = marker_position (w->start[CURRENT_DISP]);
@@ -5104,7 +5100,6 @@
 
 #define SAVED_WINDOW_N(conf, n) (&((conf)->saved_windows[(n)]))
 #define XWINDOW_CONFIGURATION(x) XRECORD (x, window_configuration, struct window_config)
-#define XSETWINDOW_CONFIGURATION(x, p) XSETRECORD (x, p, window_configuration)
 #define wrap_window_configuration(p) wrap_record (p, window_configuration)
 #define WINDOW_CONFIGURATIONP(x) RECORDP (x, window_configuration)
 #define CHECK_WINDOW_CONFIGURATION(x) CHECK_RECORD (x, window_configuration)
@@ -5948,7 +5943,7 @@
     config = (struct window_config *)
       alloc_lcrecord (sizeof_window_config_for_n_windows (n_windows),
 		      &lrecord_window_configuration);
-  XSETWINDOW_CONFIGURATION (result, config);
+  result = wrap_window_configuration (config);
   /*
   config->frame_width = FRAME_WIDTH (f);
   config->frame_height = FRAME_HEIGHT (f); */
@@ -5966,7 +5961,7 @@
     config->current_window = FRAME_LAST_NONMINIBUF_WINDOW (f);
 #endif
   config->current_window = FRAME_SELECTED_WINDOW (f);
-  XSETBUFFER (config->current_buffer, current_buffer);
+  config->current_buffer = wrap_buffer (current_buffer);
   config->minibuffer_scroll_window = Vminibuffer_scroll_window;
   config->root_window = FRAME_ROOT_WINDOW (f);
   config->min_height = window_min_height;
@@ -5977,7 +5972,7 @@
   /* save the minibuffer height using the heuristics from
      change_frame_size_1 */
 
-  XSETFRAME (frame, f); /* frame could have been nil ! */
+  frame = wrap_frame (f); /* frame could have been nil ! */
   default_face_height_and_width (frame, &real_font_height, 0);
   assert(real_font_height > 0);
 
--- a/src/window.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/window.h	Fri Mar 29 04:49:13 2002 +0000
@@ -167,7 +167,6 @@
 
 DECLARE_LRECORD (window, struct window);
 #define XWINDOW(x) XRECORD (x, window, struct window)
-#define XSETWINDOW(x, p) XSETRECORD (x, p, window)
 #define wrap_window(p) wrap_record (p, window)
 #define WINDOWP(x) RECORDP (x, window)
 #define CHECK_WINDOW(x) CHECK_RECORD (x, window)
@@ -219,7 +218,6 @@
 
 DECLARE_LRECORD (window_mirror, struct window_mirror);
 #define XWINDOW_MIRROR(x) XRECORD (x, window_mirror, struct window_mirror)
-#define XSETWINDOW_MIRROR(x, p) XSETRECORD (x, p, window_mirror)
 #define wrap_window_mirror(p) wrap_record (p, window_mirror)
 #define WINDOW_MIRRORP(x) RECORDP (x, window_mirror)
 #define CHECK_WINDOW_MIRROR(x) CHECK_RECORD (x, window_mirror)