This commit was generated by cvs2svn to compensate for changes in r50, which
authortomo <tomo>
Mon, 17 May 1999 09:41:47 +0000 (09:41 +0000)
committertomo <tomo>
Mon, 17 May 1999 09:41:47 +0000 (09:41 +0000)
included commits to RCS files with non-trunk default branches.

141 files changed:
CHANGES-beta
ChangeLog
Makefile.in [new file with mode: 0644]
Makefile.in.in
configure
configure.in
etc/package-index.LATEST.pgp
etc/sample.emacs [new file with mode: 0644]
lib-src/install-sid [new file with mode: 0755]
lib-src/pstogif [new file with mode: 0755]
lib-src/run.c [new file with mode: 0644]
lib-src/send-pr [new file with mode: 0755]
lib-src/tm-au [new file with mode: 0755]
lib-src/tm-file [new file with mode: 0755]
lib-src/tm-html [new file with mode: 0755]
lib-src/tm-image [new file with mode: 0755]
lib-src/tm-mpeg [new file with mode: 0755]
lib-src/tm-plain [new file with mode: 0755]
lib-src/tm-ps [new file with mode: 0755]
lib-src/tmdecode [new file with mode: 0755]
lib-src/update-elc.sh [new file with mode: 0644]
lisp/ChangeLog
lisp/auto-autoloads.el
lisp/bytecomp.el
lisp/custom-load.el
lisp/dump-paths.el
lisp/files.el
lisp/finder-inf.el [new file with mode: 0644]
lisp/mule/mule-files.el [new file with mode: 0644]
lisp/obsolete.el
lisp/package-get-base.el [new file with mode: 0644]
lisp/setup-paths.el
lisp/startup.el
lisp/update-elc.el
lisp/version.el
lisp/winnt.el [new file with mode: 0644]
lock/.precious [new file with mode: 0644]
lwlib/config.h [new file with mode: 0644]
man/info-stnd.texi [new file with mode: 0644]
man/internals/Makefile [new file with mode: 0644]
man/internals/index.perm [new file with mode: 0644]
man/internals/index.unperm [new file with mode: 0644]
man/lispref/Makefile [new file with mode: 0644]
man/lispref/index.perm [new file with mode: 0644]
man/lispref/index.unperm [new file with mode: 0644]
man/lispref/permute-index [new file with mode: 0755]
man/new-users-guide/Makefile [new file with mode: 0644]
man/xemacs/Makefile [new file with mode: 0644]
modules/Makefile.in [new file with mode: 0644]
modules/aclocal.m4 [new file with mode: 0644]
modules/base64/Makefile.in [new file with mode: 0644]
modules/configure.in [new file with mode: 0644]
modules/example/Makefile.in [new file with mode: 0644]
modules/example/purified.c [new file with mode: 0644]
modules/ldap/Makefile.in [new file with mode: 0644]
modules/ldap/configure.in [new file with mode: 0644]
modules/zlib/Makefile.in [new file with mode: 0644]
nt/Makefile.cygwin [new file with mode: 0644]
nt/Todo [new file with mode: 0644]
nt/inc/arpa/inet.h [new file with mode: 0644]
nt/inc/netdb.h [new file with mode: 0644]
nt/inc/netinet/in.h [new file with mode: 0644]
nt/inc/pwd.h [new file with mode: 0644]
nt/inc/sys/dir.h [new file with mode: 0644]
nt/inc/sys/file.h [new file with mode: 0644]
nt/inc/sys/ioctl.h [new file with mode: 0644]
nt/inc/sys/param.h [new file with mode: 0644]
nt/inc/sys/socket.h [new file with mode: 0644]
nt/inc/sys/time.h [new file with mode: 0644]
nt/inc/unistd.h [new file with mode: 0644]
nt/puresize-adjust.h [new file with mode: 0644]
nt/runemacs.c [new file with mode: 0644]
src/ChangeLog
src/abbrev.c
src/acldef.h [new file with mode: 0644]
src/alloc.c
src/buffer.c
src/buffer.h
src/bufslots.h
src/casefiddle.c
src/chartab.c
src/chartab.h
src/chpdef.h [new file with mode: 0644]
src/cmds.c
src/config.h.in
src/console-stream.c
src/console-x.h
src/console.h
src/data.c
src/database.c
src/dbxrc [new file with mode: 0644]
src/depend
src/dll.c [new file with mode: 0644]
src/doprnt.c
src/emacs.c
src/faces.c
src/faces.h
src/file-coding.c
src/file-coding.h
src/fns.c
src/frame.c
src/gdbinit [new file with mode: 0644]
src/glyphs-eimage.c
src/glyphs.c
src/input-method-xfs.c [new file with mode: 0644]
src/insdel.c
src/lisp-disunion.h
src/lisp.h
src/lread.c
src/lrecord.h
src/mule-canna.c
src/mule-ccl.c
src/mule-charset.c
src/mule-coding.c [new file with mode: 0644]
src/mule-coding.h [new file with mode: 0644]
src/mule-mcpath.c [new file with mode: 0644]
src/mule-mcpath.h [new file with mode: 0644]
src/mule-wnnfns.c
src/objects-msw.c
src/objects-tty.c
src/pure.c [new file with mode: 0644]
src/puresize.h [new file with mode: 0644]
src/redisplay-msw.c
src/redisplay-output.c
src/redisplay-tty.c
src/redisplay-x.c
src/redisplay.c
src/redisplay.h
src/regex.c
src/s/msdos.h [new file with mode: 0644]
src/s/windows95.h [new file with mode: 0644]
src/search.c
src/symbols.c
src/symsinit.h
src/syntax.c
src/syntax.h
src/toolbar-x.c
src/xselect.c [new file with mode: 0644]
tests/basic-lisp.el [new file with mode: 0644]
tests/database.el [new file with mode: 0644]
tests/test-emacs.el [new file with mode: 0644]

index 2143e05..530bc55 100644 (file)
@@ -1,101 +1,4 @@
                                                        -*- indented-text -*-
-to 21.2 beta10 "Boreas"
--- package UI fix from Jan Vroonhof
--- MS Windows NT process fix from Gleb Arshinov
-
-to 21.2 beta9 "Athena"
--- parameterize replace-match function from Didier Verna
--- X-Face support under mswindows from Andy Piper
--- doc fixes from Adrian Aichner
--- about patchlet from Marcus Thiessel
--- isearch doc fixes from Didier Verna
--- interlaced gif fix from Gunnar Evermann
--- isearch improvements from Didier Verna
--- eldap connection fix from William Perry
--- package-get site fix from Robert Pluim
--- loadable modules fix from Damon Lipparelli
--- ldap fixes from Oscar Figueiredo
--- loadable modules from J. Kean Johnston
--- runwhatever from Charles Wilson
--- redisplay fixes for glyphs from Andy Piper
--- progress gauge widgets implentation from Andy Piper
--- W3 works again due to font.el being fixed
--- Another mule xemacs crash fixed
--- Images in widgets, warning fixes and gui_item cleanup from Andy Piper
--- package admin fixes under mswindows from Charles Waldman
--- miscellaneous mswindows build fixes from Jonathan Harris
--- help-echo fix from Hrvoje Niksic
--- x font path support from Jim Radford
--- MSVC compile fixes from Damon Lipparelli
-
-to 21.2 beta8 "Artemis"
--- A bunch of Mule fixes from Martin Buchholz
-
-to 21.2 beta7 "Ares"
--- mswindows modeline crash fix from Jonathan Harris
--- picon glyph fix from Gunnar Evermann
--- widgets-in-buffers and subwindow support from Andy Piper
--- movemail pop support under mswindows from Fabrice Popineau
--- ldap fixes from Oscar Figueiredo
--- fns cleanup from Hrvoje Niksic
--- menubar fixes from Didier Verna
--- mswindows accelerator fix from Jonathan Harris
--- dired mule fix from Didier Verna
--- sound doc cleanup from Charles Waldman
--- new display table functionality from Hrvoje Niksic
--- minor cleanups
--- package fixes from Jan Vroonhof
--- subwindow support fixes from Martin Buchholz
-
-to 21.2 beta6 "Apollo"
--- mswindows compile fixes from Martin Buchholz, Andy Piper, Greg
-   Klanderman and Adrian Aichner
--- Synch with XEmacs 21.0.60
--- mega-patch fixes from Martin Buchholz
--- md5 fixes and testsuite from Hrvoje Niksic
--- database fix from Hrvoje Niksic
-
-to 21.2 beta5 "Aphrodite"
--- synch with XEmacs 21.0.58
--- bytecode interpreter rewritten
--- byte compiler fixes
--- hash table implementation rewritten
--- basic lisp functions rewritten
--- spelling fixes
--- garbage collector tuned a little
--- various global code changes for consistency
--- automated test suite
--- major internals manual updates
--- lisp reference updates
-
-to 21.2 beta4 "Aglaophonos"
--- isearch keymap fix from Katsumi Yamaoka
--- directory_files cleanup from Hrvoje Niksic
--- C implementation of base64 from Hrvoje Niksic
--- C implementation of `buffer-substring-no-properties' from Hrvoje Niksic
--- Experimental fix for spurious `file has changed on disk' message from
-   Charles Waldman
--- Fix for etags.el hook calling from Malcolm Box
--- User-name-completion fix for MS Windows NT from Greg Klanderman
-
-to 21.2 beta3 "Aglaia"
--- case sensitiveness improvements from Didier Verna
--- Bug fixes from 21.0
--- Word selection on mouse click on quotes from Hrvoje Niksic
--- WAVE support for NAS from Raymond Toy
-
-to 21.2 beta2 "Aether"
--- Synched with 21.0-pre14 "Poitou"
--- isearch improvements from Hrvoje Niksic
--- bytecompiler fix from Martin Buccholz
--- shadow.el speedup from Martin Buchholz
--- clash detection update from Jan Vroonhof
--- Indirect buffers from Hrvoje Niksic
--- ~user completion cleanup from Greg Klanderman
--- New face property from Didier Verna
--- ~user completion and fixes from Greg Klanderman
--- casefiddle.c speedup from Martin Buchholz
-
 to 21.2 beta1 "Aeolus"
 -- Synch with 21.0-pre6
 -- Removal of ancient obsolete symbols courtesy of Altrasoft
index e469aa2..2671250 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,230 +1,3 @@
-1999-02-05  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * XEmacs 21.2.10 is released
-
-1999-02-02  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * 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
-       general rather than just X.
-
-1999-18-10  Andy Piper <andy@xemacs.org>
-
-       * configure.in: remove -O3 prevention on cygwin - current versions
-       cope ok now.  remove dll prevention on cygwin - the new module
-       code checks correctly.
-       
-1999-01-10  J. Kean Johnston  <jkj@sco.com>
-
-       * configure.in: Added moduledir as the path where loadable modules 
-       are stored. Added --with-site-modules and --moduledir options.
-       - Ensure the SCO OpenServer compiles with --dynamic by default
-       - Check for dlfcn.h for dynamic loader
-       - Renamed dll.o to emodules.o and changed dynamic loader tests
-       - Renabled code that deals with site-lisp so that it is handled
-       correctly when a user specifies --with-site-lisp.
-
-       * aclocal.m4: Replaced entire file with more complete DLL tests
-       by way of libtool.
-
-       * config.usage: Removed TAB characters which caused it to be
-       displayed incorrectly on terminals where TAB != 8.
-       - Added help text to describe --with-site-modules and --moduledir.
-
-       * INSTALL: Updated documentation to describe module directories
-
-       * Makefile.in.in: Added moduledir, sitemoduledir macros.
-       - Make those directories at install time.
-
-1998-12-28  Martin Buchholz <martin@xemacs.org>
-
-       * XEmacs 21.2.8 is released.
-
-1998-12-28  Martin Buchholz  <martin@xemacs.org>
-
-       * PROBLEMS: Document Linux GNU Libc 2.0 I18N crashes.
-
-1998-12-24  Martin Buchholz <martin@xemacs.org>
-
-       * XEmacs 21.2.7 is released.
-
-1998-12-20  Martin Buchholz  <martin@xemacs.org>
-
-       * configure.in: Redo DBM support
-       - die if dbm support requested, but not provided.
-       - properly check for libgdbm, then libc, then libdbm
-       - properly check for ndbm.h
-       - comments improved
-       - XE_DIE should always prefix messages with Error: for clarity
-
-1998-12-07  Martin Buchholz  <martin@xemacs.org>
-
-       * xemacs.mak (TEMACS_OBJS):
-       (DOC_SRC4):
-       - Remove pure.c, pure.obj
-
-1998-12-06  Martin Buchholz  <martin@xemacs.org>
-
-       * Makefile.in.in (distclean):
-       * dynodump/Makefile.in.in (distclean):
-       * src/Makefile.in.in (distclean):
-       * lib-src/Makefile.in.in (distclean):
-       * lwlib/Makefile.in.in (distclean):
-       - Make sure GNUmakefile is deleted.
-
-1998-12-17  Andy Piper  <andy@xemacs.org>
-
-       * configure.in (all_widgets): remove gui.o addition - its always
-       in the makefile now.
-
-       * configure.in: add gui-msw.o to msw objects.
-
-1998-12-16  Andy Piper  <andy@xemacs.org>
-
-       * XEmacs 21.2.6 is released
-
-1998-12-05  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * XEmacs 21.2.5 is released
-
-1998-11-28  SL Baur  <steve@altair.xemacs.org>
-
-       * XEmacs 21.2-beta4 is released.
-
-1998-11-27  SL Baur  <steve@altair.xemacs.org>
-
-       * configure.in: Linux/Arm Support.
-       From James LewisMoss <dres@ioa.com>
-
-1998-11-27  Takeshi Hagiwara  <hagiwara@ie.niigata-u.ac.jp>
-
-       * configure.in:
-       Fix the realpath() problem of UnixWare2.1.3.
-       Patches for NEC's sysv4.2 machine.
-
-1998-11-09  Kazuyuki IENAGA  <ienaga@jsys.co.jp>
-
-       * configure.in: Check if there's wnn4.2 or wnn6 specific library
-       installed. The Wnn library will be checked if the --with-wnn
-       and/or --with-wnn6 was specified compulsory.
-
-1998-07-28  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * configure.in (CPP): Too many spaces im run-patch flag detection.
-
-1998-10-15  SL Baur  <steve@altair.xemacs.org>
-
-       * XEmacs 21.2-beta3 is released.
-
-1998-10-13  Andy Piper  <andyp@parallax.co.uk>
-
-       * configure.in: enable drag and drop support by default if mswindows is
-       detected.
-
-1998-10-09  Kevin Oberman  <oberman@es.net>
-
-       * config.sub: Fix for Alpha architecture
-
-1998-10-05  Andy Piper  <andyp@parallax.co.uk>
-
-       * 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.
-
-1998-09-09  Gunnar Evermann  <Gunnar.Evermann@nats.informatik.uni-hamburg.de>
-
-       * lwlib/xlwmenu.c:
-       * lwlib/xlwscrollbar: fix for Motif >=2.0
-       Patch provided by Glenn Barry <gtb@eng.sun.com>
-
-       * PROBLEMS: XEmacs 21.0 now works on HP-UX 11.0
-
-1998-09-02  Andy Piper  <andyp@parallax.co.uk>
-
-       * configure.in: check for cygwin32/version.h.
-
-1998-08-31  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-       * PROBLEMS: Added AIX 4.3 note.
-
-       * 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  <aichner@ecf.teradyne.com>
-
-       * 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
-       header/libs, screams a little louder on old/mismatched library
-       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  <aichner@ecf.teradyne.com>
-
-       * 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
-       of GIF support
-
-1998-08-04  P. E. Jareth Hein  <jareth@camelot.co.jp>
-
-       * configure.in: add back in the support for the in-core GIF
-       code, change the required PNG library version to 1.0.2, and add
-       a warning if PNG not found, since PNG images are now distributed
-       as part of the core.  Also minor wording changes in things reported
-       to the user.
-
-1998-07-28  Kai Haberzettl  <khaberz@synnet.de>
-
-       * BETA: Update mailing-list address for build-reports
-
-1998-08-01  SL Baur  <steve@altair.xemacs.org>
-
-       * Makefile.in (TAGS tags): Add variable `tagslisp' so a TAGS file
-       can built that includes package lisp.
-
-1998-07-23  Martin Buchholz  <martin@xemacs.org>
-
-       * configure.in:
-       - support multiple flavors of alpha, (XEmacs treats them identically)
-       - Fix AC_TRY_RUN so that actions have access to $?
-       - Identify DEC C compilers. Add default optimization CFLAGS and
-         always use -std.
-       - Use an extensible method for adding support for future compilers.
-       - Have SunPro C use that same extensible method.
-       - Make sol2 always use `-R', Linux and DEC OSF always use `-rpath'
-
 1998-07-19  SL Baur  <steve@altair.xemacs.org>
 
        * XEmacs 21.2-beta1 is released.
@@ -235,7 +8,7 @@
 
 1998-07-12  Björn Torkelsson  <torkel@hpc2n.umu.se>
 
-       * Makefile.in: added LDFLAGS.
+       * Makefile.in: added LDFLAGS. 
 
 1998-07-12  SL Baur  <steve@altair.xemacs.org>
 
 
 1998-06-20  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
-       * etc/PACKAGES:
+       * etc/PACKAGES: 
        * etc/BETA: Moved some package stuff into Texinfo docs.  Other nitpicks
 
 1998-06-20  Kazuyuki IENAGA <ienaga@jsys.co.jp>
        * PROBLEMS:
        Document problems with Solaris 2.6 + XSUNTRANSPORT
 
-       * Makefile.in:
+       * Makefile.in: 
        * lwlib/Makefile.in.in:
        * modules/Makefile.in:
        - Adjust for luser's CDPATH being set to something weird.
 
 1998-04-27  SL Baur  <steve@altair.xemacs.org>
 
-       * configure.in (progname): Parameterize program name on `progname'
+       * configure.in (progname): Parameterize program name on `progname' 
        and add --with-infodock.
 
 1998-04-26  SL Baur  <steve@altair.xemacs.org>
@@ -563,7 +336,7 @@ Wed Apr 22 12:59:35 1998  Andy Piper  <andyp@parallax.co.uk>
        * 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
-       term.info
+       term.info 
 
 1998-04-20  SL Baur  <steve@altair.xemacs.org>
 
@@ -583,14 +356,14 @@ Fri Apr 17 12:59:35 1998  Andy Piper  <andyp@parallax.co.uk>
        * configure.in: enable install pre-processing for mswindows
 
 Fri Apr 17 12:59:35 1998  Andy Piper  <andyp@parallax.co.uk>
-
+       
        * Makefile.in.in: add install_pp to install incantation.
 
        * installexe.sh: new file. Add .exe to install targets if the
        result is executable.
 
 Fri Apr 17 12:59:35 1998  Andy Piper  <andyp@parallax.co.uk>
-
+       
        * Makefile.in: add install_pp to install incantation.
 
 1998-04-14  Itay Ben-Yaacov <pezz@www-mail.huji.ac.il>
@@ -604,7 +377,7 @@ Thu Apr 16 12:59:35 1998  Andy Piper  <andyp@parallax.co.uk>
 
 1998-04-06  Martin Buchholz  <martin@xemacs.org>
 
-       * config.h.in: Add _SVID_SOURCE to list of xmkmf #defines.
+       * config.h.in: Add _SVID_SOURCE to list of xmkmf #defines.  
        Used (at least) by RedHat 4.2.
 
 1998-04-11  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
@@ -687,7 +460,7 @@ Thu Apr 16 12:59:35 1998  Andy Piper  <andyp@parallax.co.uk>
        * configure.in: Check for -lz, -lgz unconditionally.  Too many
        system linkers don't properly die when there are cascaded link
        dependencies, so we can't rely on the linker for that.  The only
-       downside is that we might link with an extra unneeded library.  If
+       downside is that we might link with an extra unneeded library.  If 
        you really really care about this, you can go fix it.
 
        * configure.in: Enhance PANIC msg to make it clear that
@@ -696,13 +469,13 @@ Thu Apr 16 12:59:35 1998  Andy Piper  <andyp@parallax.co.uk>
 1998-03-27  Martin Buchholz  <martin@xemacs.org>
 
        * configure.in: $debug was not properly dependent on $beta
-
-       * configure.in: Move offix configuration out of src/Makefile.in.in
+       
+       * configure.in: Move offix configuration out of src/Makefile.in.in 
        into configure.in.
 
        * configure.in: Reorganize xpm detection code.
 
-       * configure.in: XIM default to ON if Motif which is not Lesstif is
+       * configure.in: XIM default to ON if Motif which is not Lesstif is 
        found.
 
        * configure.in: Keep auto-generated makefile dependencies out of
@@ -791,7 +564,7 @@ Thu Apr 16 12:59:35 1998  Andy Piper  <andyp@parallax.co.uk>
        * configure.in (quoted_arguments): Fix unquoted variable in
        error-checking test.
        - fix bogus substitution.
-
+       
 1998-03-17  SL Baur  <steve@altair.xemacs.org>
 
        * configure.in: In -lpng test, look for png_set_strip_alpha.
@@ -930,7 +703,7 @@ Wed Mar 04 08:55:12 1998  Andy Piper  <andyp@parallax.co.uk>
 
 1998-02-21  SL Baur  <steve@altair.xemacs.org>
 
-       * configure.in (after_morecore_hook_exists): Modify dlmalloc tests
+       * configure.in (after_morecore_hook_exists): Modify dlmalloc tests 
        to also test for Linux libc5.
 
 1998-02-19  SL Baur  <steve@altair.xemacs.org>
@@ -944,7 +717,7 @@ Wed Mar 04 08:55:12 1998  Andy Piper  <andyp@parallax.co.uk>
        * 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>
@@ -1032,8 +805,8 @@ Wed Jan 21 10:49:47 1998  Andy Piper  <andyp@parallax.co.uk>
 
 1998-01-13  Martin Buchholz  <martin@xemacs.org>
 
-       * configure.usage:
-       * etc/NEWS:
+       * configure.usage:  
+       * etc/NEWS:  
        Remove doc for configure-time INFOPATH, no longer used.
 
        * etc/BETA: Update ftp addresses.
@@ -1044,13 +817,13 @@ Wed Jan 21 10:49:47 1998  Andy Piper  <andyp@parallax.co.uk>
        * src/config.h.in:
        Define HAVE_INVERSE_HYPERBOLIC using 1 configure test, not 3.
 
-       * lwlib/lwlib.h:
-       * lwlib/lwlib.c:
-       * lwlib/lwlib-config.c:
-       * lwlib/lwlib-Xm.c:
-       * lwlib/lwlib-Xaw.c:
-       * lwlib/lwlib-Xlw.c:
-       * lwlib/config.h.in:
+       * lwlib/lwlib.h: 
+       * lwlib/lwlib.c: 
+       * lwlib/lwlib-config.c: 
+       * lwlib/lwlib-Xm.c: 
+       * lwlib/lwlib-Xaw.c: 
+       * lwlib/lwlib-Xlw.c: 
+       * lwlib/config.h.in: 
        * src/menubar-x.c:
        Prepend LWLIB_ to (SCROLLBARS|MENUBARS|DIALOGS)_(MOTIF|LUCID|ATHENA).
        Maintain only one set of variables.
@@ -1058,13 +831,13 @@ Wed Jan 21 10:49:47 1998  Andy Piper  <andyp@parallax.co.uk>
        * etc/xemacs.1: Update author list.
 
        * Makefile.in (install-arch-dep): Simplify.
-       Replace construct  `test -d $dir && foo'  with
+       Replace construct  `test -d $dir && foo'  with  
        `if test -d $dir; then foo; fi'
 
-       * lwlib/xlwmenu.c:
-       * lwlib/xlwscrollbar.c:
-       * lwlib/lwlib-Xlw.c:
-       * lwlib/lwlib-Xm.c:
+       * lwlib/xlwmenu.c: 
+       * lwlib/xlwscrollbar.c: 
+       * lwlib/lwlib-Xlw.c: 
+       * lwlib/lwlib-Xm.c: 
        Always assume presence of limits.h (ANSI).
 
 1998-01-12  SL Baur  <steve@altair.xemacs.org>
@@ -1147,7 +920,7 @@ Thu Jan 08 09:42:36 1998    <andyp@parallax.co.uk>
 
 1997-12-21  SL Baur  <steve@altair.xemacs.org>
 
-       * etc/BETA (Prerequisite): Add cookbook procedures for maintaining
+       * etc/BETA (Prerequisite): Add cookbook procedures for maintaining 
        package lisp directories.
 
 1997-12-20  SL Baur  <steve@altair.xemacs.org>
@@ -1156,7 +929,7 @@ Thu Jan 08 09:42:36 1998    <andyp@parallax.co.uk>
 
 1997-12-19  SL Baur  <steve@altair.xemacs.org>
 
-       * configure.in (bitmapdir): Reenable --with-session by default for
+       * configure.in (bitmapdir): Reenable --with-session by default for 
        testing.
 
 1997-12-18  Kyle Jones  <kyle_jones@wonderworks.com>
@@ -1167,7 +940,7 @@ Thu Jan 08 09:42:36 1998    <andyp@parallax.co.uk>
 1997-12-18  Kyle Jones  <kyle_jones@wonderworks.com>
 
        * etc/toolbar: Added support for foregroundToolBarColor
-         symbol to most icons.
+         symbol to most icons. 
 
 1997-12-17  SL Baur  <steve@altair.xemacs.org>
 
@@ -1367,7 +1140,7 @@ Thu Jan 08 09:42:36 1998    <andyp@parallax.co.uk>
          device-msw.c, emacs.c, event-msw.c, event-msw.h, event-stream.c,
          events.c, events.h, faces.c, frame-msw.c, frame.c, general.c,
          msw-proc.c, objects-msw.c, objects-msw.h, redisplay-msw.c,
-         redisplay.c, symsinit.h,
+         redisplay.c, symsinit.h, 
 
        * Didn't change 'win32' in nt.c, nt.h, ntproc.c
 
@@ -1403,7 +1176,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 1997-11-05  Didier Verna  <verna@inf.enst.fr>
 
        * configure.in: Added the --site-prefixes options for the configure
-       script. You give a colon or space separated list of prefixes, and
+       script. You give a colon or space separated list of prefixes, and 
        subdirectories include/ and lib/ will be added with -I and -L.
 
 1997-11-05  Martin Buchholz  <Martin Buchholz <martin@xemacs.org>>
@@ -1495,7 +1268,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
        TIFF(broken) and replace with test for ImageMagick.
 
 1997-10-30  Kyle Jones  <kyle_jones@wonderworks.com>
-
+       
        * etc/Emacs.ad: Added *XlwMenu*highlightForeground entry.
          Added *XlwMenu*titleForeground entry.
 
@@ -1534,7 +1307,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
        * lib-src/gnuslib.c: Always include config.h before system headers
        * configure.in: Improve AIX configure support
          - NON_GNU_CC defaults to `xlc'
-         - CFLAGS defaults to "-O3 -qstrict  -qlibansi -qinfo -qro
+         - CFLAGS defaults to "-O3 -qstrict  -qlibansi -qinfo -qro 
            -qmaxmem=20000"
          - check for sin instead of sqrt in -lm to avoid xlc internal error
          - Detect -li18n for use with Motif
@@ -1571,7 +1344,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 
 1997-10-18  SL Baur  <steve@altair.xemacs.org>
 
-        * XEmacs 20.3-beta91 is released.
+        * XEmacs 20.3-beta91 is released. 
 
 1997-10-16  Hrvoje Niksic <hniksic@srce.hr>
 
@@ -1660,7 +1433,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 
        * Makefile.in: Add `make configure' target
 
-       * etc/BETA:
+       * etc/BETA: 
          - remove Chuck as contact name
          - random small improvements
          - remove I/me references - the message should be that XEmacs
@@ -1711,8 +1484,8 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 1997-10-03  Martin Buchholz  <mrb@eng.sun.com>
 
        * lib-src/etags.c:  etags 12.28 + prototypization
-       * INSTALL:  Better document --site-runtime-libraries
-       * src/scrollbar-x.c (x_update_scrollbar_instance_status):
+       * INSTALL:  Better document --site-runtime-libraries 
+       * src/scrollbar-x.c (x_update_scrollbar_instance_status): 
          FIX: M-x scroll-left; horizontal scrollbar appears; drag it
          left; scrollbar disappears; keyboard inoperative.
        * configure.in:  Remove left-over references to *_switch_x_*
@@ -1732,7 +1505,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
        * 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".
@@ -1785,11 +1558,11 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 
        * src/redisplay-tty.c: Fix crashes with non-7bit tty escape
        sequences (needs more testing).
-       * */Makefile*:
+       * */Makefile*: 
        - Cleanup man/*/Makefile for consistency.
        - use $(MAKEFINFO), $(TEXI2DVI), etc...
        - Make combination --with-srcdir + Sun make work properly.
-       - Change construct: test -d $${dir} || mkdir $${dir}
+       - Change construct: test -d $${dir} || mkdir $${dir} 
           --> if test ! -d $${dir}; then mkdir $${dir}; fi
        * lisp/x11/x-win-sun.el: Fix remaining glitches with
        re-mappings of Sun function keys.
@@ -1832,9 +1605,9 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
        - x-keysym-on-keyboard-sans-modifiers-p introduced.
        - x-keysym-hashtable introduced.
        - allow X11R4 libs to guess keysyms on X11R5 servers.
-       - A better workaround for the bug that some Xlibs generate
+       - A better workaround for the bug that some Xlibs generate 
          Multi_key a adiaeresis when pressing Multi_key a "
-
+       
        * src/dgif_lib.c: Make sure size_t is defined before using it.
 
 1997-09-12  SL Baur  <steve@altair.xemacs.org>
@@ -1899,7 +1672,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
        - new variable `blddir' introduced for informational purposes.
        * lib-src/config.values.in: new config.el implementation
        * lib-src/config.values.sh: new config.el implementation
-       * lisp/modes/pascal.el: Sync with GNU Emacs, fix infloop problem
+       * lisp/modes/pascal.el: Sync with GNU Emacs, fix infloop problem 
        (thanks to Espen Skoglund, pascal.el maintainer)
        * src/chartab.c: maintainability improvements.
        * src/mule-coding.c: FIX for: editing DOS files with ISO2022*
@@ -1958,10 +1731,10 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 
        * src/fns.c (require): Print messages when loading a file as a
        result of require.
-
+       
        * configure.in:
        * lisp/utils/config.el:
-       * lib-src/config.values:
+       * lib-src/config.values: 
        - new file created and installed by building.
        - Allow configuration time values to be queried by the lisp code.
 
@@ -1991,7 +1764,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 1997-07-10  Hrvoje Niksic  <hniksic@srce.hr>
 
        * extents.c (print_extent): Print correctly.
-
+       
 1997-07-13  Steven L Baur  <steve@altair.xemacs.org>
 
        * configure.in (CPP): Add -Wall to default gcc CFLAGS.
@@ -2016,12 +1789,12 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 
        * lisp/x11/x-select.el:
        * src/xselect.c: Try STRING if selection owner couldn't convert
-       COMPOUND_TEXT.
+       COMPOUND_TEXT. 
 
        * src/*.c: Change defalt to default_, and in general allow
        doc-snarfing functions to recognize and ignore trailing `_'
 
-       * src/*.[ch]: Introduce XVECTOR_DATA and XVECTOR_LENGTH macros and
+       * src/*.[ch]: Introduce XVECTOR_DATA and XVECTOR_LENGTH macros and 
        convert source code to use them consistently.
 
 1997-07-08  Steven L Baur  <steve@altair.xemacs.org>
@@ -2030,7 +1803,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 
 1997-07-08  Martin Buchholz  <mrb@eng.sun.com>
 
-       * configure.in: Set options differently, depending on beta-ness of
+       * configure.in: Set options differently, depending on beta-ness of 
        build tree.
        * *Makefile*: Clean up *clean: targets, esp. Steven's beloved
        distclean.
@@ -2069,7 +1842,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
        - Autodetect usleep
 
        * src/s/sol2.h: Support gcc on various Solaris releases.
-
+       
        * lib-src/*.c: Ansify prototypes.
 
        * lisp/prim/files.el: Optimize auto-mode-alist.
@@ -2101,7 +1874,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
        * 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-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
@@ -2267,7 +2040,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 
        * 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.
@@ -2285,7 +2058,7 @@ Sun November 01 12:00:00 1997 <jhar@tardis.ed.ac.uk>
 
        * */Makefile.in.in: Another rewrite
        Make makefiles immune from being mangled by various cpp
-       implementations by quoting non-preprocessor directive lines.
+       implementations by quoting non-preprocessor directive lines. 
        - random cleanup
        - Use $(RM) and $(pwd) macros consistently
        - Add dependencies for balloon-help source files
@@ -2325,11 +2098,11 @@ Wed Jun 18 16:41:43 1997  Steven L Baur  <steve@altair.xemacs.org>
          previously commented out and normalized everything vis a vis
          'backspace and 'delete keysyms.
        * lisp/packages/*.el: Normalized all the "\177" bindings
-       * lisp/modes/cperl-mode.el: Created cperl-electric-delete function
+       * lisp/modes/cperl-mode.el: Created cperl-electric-delete function 
          which is a "smart" version of the cperl-electric-backspace
          function (it honors the desired delete direction).  Bound it to
          'delete and the electric-backspace to 'backspace.
-       * lisp/packages/pending-del.el: Added cperl-electric-backspace and
+       * lisp/packages/pending-del.el: Added cperl-electric-backspace and 
          cperl-electric-delete to the 'supersede list.
 
 1997-06-11  Steven L Baur  <steve@altair.xemacs.org>
@@ -2341,16 +2114,16 @@ Wed Jun 18 16:41:43 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 1997-06-11  Martin Buchholz  <mrb@eng.sun.com>
 
-       * src/Makefile.in:
-       * lwlib/Makefile.in:
-       * lib-src/Makefile.in:
+       * src/Makefile.in: 
+       * lwlib/Makefile.in: 
+       * lib-src/Makefile.in: 
        * Makefile.in: More Makefile cleanup
        - add .PHONY targets where necessary
        - remove most builtin rules using .SUFFIXES
        - -lXau only gets used for linking gnuserv binaries
        - No VPATH for root Makefile
        - remove gcc v1 support
-       * configure.in:
+       * configure.in: 
        - A new test to autodetect need to define NARROWPROTO,
          needed by XFree86
        - Consistently use idiom foo=`echo '' $foo | sed -s 's:^ ::' -e ...`
@@ -2358,7 +2131,7 @@ Wed Jun 18 16:41:43 1997  Steven L Baur  <steve@altair.xemacs.org>
        - Check for libPW
        - Use more sophisticated Xpm test that confirms xpm.h and libXpm
          are in sync.
-       * src/s/linux.h:
+       * src/s/linux.h: 
        * src/m/intel386.h: Yet another attempt to clean up linux defines.
 
 1997-06-10  Steven L Baur  <steve@altair.xemacs.org>
@@ -2424,7 +2197,7 @@ Tue Jun 10 15:11:16 1997  Steven L Baur  <steve@altair.xemacs.org>
        smiley faces.
 
 1997-06-10  Gary D. Foster  <Gary.Foster@corp.sun.com>
-
+       
        * lisp/modes/view-less.el: Changed \177 bindings to 'delete
        * lisp/modes/help.el: Changed \177 bindings to 'delete
 
@@ -2444,7 +2217,7 @@ Tue Jun 10 15:11:16 1997  Steven L Baur  <steve@altair.xemacs.org>
        * lisp/modes/cc-mode.el:
        * lisp/modes/cperl-mode.el: Fixed references to delete functions
          to use the new names.
-
+       
 1997-06-09  Steven L Baur  <steve@altair.xemacs.org>
 
        * XEmacs 20.3-b5 is released.
@@ -2469,24 +2242,24 @@ Tue Jun 10 15:11:16 1997  Steven L Baur  <steve@altair.xemacs.org>
        * src/s/netbsd.h: complete rewrite, use ORDINARY_LINK, #ifdef out
        old cruft that can be obtained from system header files.
        * lib-src/getopt*: Synch with FSF, remove compiler warnings.
-
-       * lib-src/b2m.c:
-       * src/gifalloc.c:
-       * lib-src/gnuslib.c:
-       * lib-src/profile.c:
+       
+       * lib-src/b2m.c: 
+       * src/gifalloc.c: 
+       * lib-src/gnuslib.c: 
+       * lib-src/profile.c: 
        * lib-src/movemail.c: Fix compiler warnings
-
+       
        * 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:
+       * etc/NEWS: 
+       * etc/etags.1: 
+       * man/xemacs/programs.texi: 
        * lib-src/etags.c:  Upgraded to etags 12.11
 
        * src/config.h.in: Fix inline keyword support
-
-       * configure.in: Use a different mechanism for removing extra white
+       
+       * configure.in: Use a different mechanism for removing extra white 
        space.  Avoid using foo=`echo $bar`, which loses with various echos.
        - new M4 macro XE_SPACE(var, words...)
        - Use autoconf 2's AC_HEADER_SYS_WAIT
@@ -2502,11 +2275,11 @@ Tue Jun 10 15:11:16 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 1997-06-04  Gary D. Foster  <Gary.Foster@corp.sun.com>
 
-       * lisp/modes/cc-mode.el: Modified `c-electric-delete' to honor the
+       * lisp/modes/cc-mode.el: Modified `c-electric-delete' to honor the 
          desired delete direction in both normal and "hungry" modes.
-       * lisp/modes/cperl-mode.el: Modified `cperl-electric-backspace' to
+       * lisp/modes/cperl-mode.el: Modified `cperl-electric-backspace' to 
          honor the desired delete direction.
-
+       
 1997-05-30  Martin Buchholz  <mrb@eng.sun.com>
 
        * configure.in: Automagically compute -R path for gcc
@@ -2515,7 +2288,7 @@ Tue Jun 10 15:11:16 1997  Steven L Baur  <steve@altair.xemacs.org>
 
        * lisp/vm/vm-vars.el: Fixed delete key binding to call
          `vm-scroll-down'
-
+       
 Thu May 29 15:35:07 1997  Martin Buchholz  <mrb@eng.sun.com>
 
        * configure.in: Add support for Solaris2.6 -z ignore linker flags
@@ -2534,9 +2307,9 @@ Thu May 29 15:35:07 1997  Martin Buchholz  <mrb@eng.sun.com>
        * lisp/modes/*.el: Removed conflicting \177 bindings.
        * lisp/modes/cc-mode.el: Modified `c-electric-delete' to use new
          delete bindings.
-       * lisp/modes/cperl-mode.el: Modified `cperl-electric-backspace' to
+       * lisp/modes/cperl-mode.el: Modified `cperl-electric-backspace' to 
          use new delete bindings.
-
+       
 1997-06-03  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
        * lisp/x11/x-menubar.el (default-menubar): Add menu for Mule.
@@ -2718,14 +2491,14 @@ Thu May 22 04:19:09 1997  Martin Buchholz  <mrb@eng.sun.com>
        depend on it.
        with-xim=motif only default on Solaris.
        realpath moved from s&m to configure.in.
-       xemacs-version.h removed.  main_1 now contains $canonical as well,
+       xemacs-version.h removed.  main_1 now contains $canonical as well, 
        for even more useful backtraces.
        termcap handling rewritten.
        Create .sbinit for Sun's source browser.
        Warn user if no XPM support present.
        Warn user if compiling in error checking.
 
-       * Makefile.in: use MAKE_SUBDIR consistently.  Remove references to
+       * Makefile.in: use MAKE_SUBDIR consistently.  Remove references to 
        dynodump.  Remove core when cleaning.  Remove config.log.
        make distclean now functional.
 
@@ -2819,7 +2592,7 @@ Sat Apr 12 09:01:32 1997  Hrvoje Niksic <hniksic@srce.hr>
 
        3) Rearranging the entries by relevance.  I have tried to put the most
           relevant entries in front.
-
+       
 Thu Apr 10 19:07:26 1997  Steven L Baur  <steve@altair.xemacs.org>
 
        * XEmacs 20.1-b14 is released.  (Beta 13 was skipped).
@@ -2839,7 +2612,7 @@ Sat Apr  5 09:11:36 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 Wed Apr  2 15:27:35 1997  Steven L Baur  <steve@altair.xemacs.org>
 
-       * Makefile.in (install-only): New target.  Functionality suggested
+       * Makefile.in (install-only): New target.  Functionality suggested 
        by Larry Schwimmer, correct way of doing it suggested by Chuck
        Thompson.
 
@@ -2863,7 +2636,7 @@ Thu Mar 27 18:24:19 1997  Steven L Baur  <steve@altair.xemacs.org>
 Wed Mar 26 22:31:10 1997  Steven L Baur  <steve@altair.xemacs.org>
 
        * Remove vms top-level directory.
-
+       
        * XEmacs 19.15 final released to beta testers.
 
 Tue Mar 25 19:13:27 1997  Steven L Baur  <steve@altair.xemacs.org>
@@ -3109,7 +2882,7 @@ 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.
-
+       
 Tue Jan  7 08:45:16 1997  Steven L Baur  <steve@altair.xemacs.org>
 
        * configure.in (LIBS): Revise test for XFree86 (look for XF86Config).
@@ -3124,8 +2897,8 @@ Fri Jan  3 15:18:59 1997  Jeff Miller  <jmiller@smart.net>
 
 Wed Jan  1 08:30:48 1997  Martin Buchholz  <mrb@eng.sun.com>
 
-       * src/emacs.c: Make sure
-       `./temacs -batch -l loadup.el run-temacs <emacs-args>'
+       * src/emacs.c: Make sure 
+       `./temacs -batch -l loadup.el run-temacs <emacs-args>' 
        works properly
 
        * src/Makefile.in.in (rtcmacs): Add support for RTC, Sun's
@@ -3144,20 +2917,20 @@ Tue Dec 31 09:46:13 1996  Martin Buchholz  <mrb@eng.sun.com>
        * lib-src/update-autoloads.sh: Rewritten to use auto-autoloads.el.
        * lisp/utils/autoload.el: Reorganization of autoload mechanism:
        Errors during autoload generation are just that - errors.
-
+       
        Generated autoloads are now in a separate file of their own.
-
+       
        Reliability of autoload generation greatly increased.
-
+       
        Distribution smaller by about 100k.
-
+       
        `make autoloads' is still the preferred mechanism for update.
-
+       
        Autoloads are always regenerated completely from scratch.  This
        avoids errors with obsolete or corrupted autoload entries.
 
        Caching of autoload entries using timestamps has been eliminated.
-
+       
        Files that have no autoloads no longer have a comment placed into
        the generated autoloads file.
 
@@ -3215,7 +2988,7 @@ Sun Dec 29 05:37:43 1996  Martin Buchholz  <mrb@eng.sun.com>
          that various tools can recognize the filename as such.
 
        * src/event-Xt.c (x_to_emacs_keysym): Fix crash when
-         --with-xim=xlib and key event on window frame.
+         --with-xim=xlib and key event on window frame.  
          Change return foo to return (foo) when return is a macro.
 
        * src/editfns.c (Ffollowing_char): docstring fixes.
diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..3a59498
--- /dev/null
@@ -0,0 +1,631 @@
+## DIST: This is the distribution Makefile for XEmacs.  configure can
+## DIST: make most of the changes to this file you might want, so try
+## DIST: that first.
+
+## 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.
+
+## make all    to compile and build XEmacs.
+## make install        to build and install it.
+## make install-only   to install after a previous complete build
+## make TAGS   to update tags tables.
+
+## make clean  or  make mostlyclean
+##      Delete all files from the current directory that are normally
+##      created by building the program.        Don't delete the files that
+##      record the configuration.  Also preserve files that could be made
+##      by building, but normally aren't because the distribution comes
+##      with them.
+
+##      Delete `.dvi' files here if they are not part of the distribution.
+
+## make distclean
+##      Delete all files from the current directory that are created by
+##      configuring or building the program.  If you have unpacked the
+##      source and built the program without creating any other files,
+##      `make distclean' should leave only the files that were in the
+##      distribution.
+
+## make realclean
+##      Delete everything from the current directory that can be
+##      reconstructed with this Makefile.  This typically includes
+##      everything deleted by distclean, plus more: C source files
+##      produced by Bison, tags tables, info files, and so on.
+
+## make extraclean
+##      Still more severe - delete backup and autosave files, too.
+
+@SET_MAKE@
+RECURSIVE_MAKE=@RECURSIVE_MAKE@
+SHELL = /bin/sh
+LANG = C
+RM = rm -f
+pwd = /bin/pwd
+
+## ==================== Things `configure' Might Edit ====================
+
+CC=@CC@
+CPP=@CPP@
+LN_S=@LN_S@
+CFLAGS=@CFLAGS@
+CPPFLAGS=@CPPFLAGS@
+LDFLAGS=@LDFLAGS@
+
+## These help us choose version- and architecture-specific directories
+## to install files in.
+
+## This should be the number of the XEmacs version we're building,
+## like `19.12' or `19.13'.
+version=@version@
+
+## This should be the name of the configuration we're building XEmacs
+## for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
+configuration=@configuration@
+
+## This will be the name of the generated binary and is set automatically
+## by configure.
+PROGNAME=@PROGNAME@
+
+## ==================== Where To Install Things ====================
+
+## The default location for installation.  Everything is placed in
+## subdirectories of this directory.  The default values for many of
+## the variables below are expressed in terms of this one, so you may
+## not need to change them.  This defaults to /usr/local.
+prefix=@prefix@
+
+## Like `prefix', but used for architecture-specific files.
+exec_prefix=@exec_prefix@
+
+## Where to install XEmacs and other binaries that people will want to
+## run directly (like etags).
+bindir=@bindir@
+
+## Where to install architecture-independent data files.
+## ${lispdir} and ${etcdir} are subdirectories of this.
+datadir=@datadir@
+
+## Where to find XEmacs packages.
+pkgdir=@pkgdir@
+
+## Where to install and expect the files that XEmacs modifies as it runs.
+## These files are all architecture-independent. Right now, the
+## only such data is the locking directory;
+## ${lockdir} is a subdirectory of this.
+statedir=@statedir@
+
+## Where to install and expect executable files to be run by XEmacs
+## rather than directly by users, and other architecture-dependent data
+## ${archlibdir} is a subdirectory of this.
+libdir=@libdir@
+
+## Where to install XEmacs's man pages, and what extension they should have.
+mandir=@mandir@
+manext=.1
+
+## Where to install and expect the info files describing XEmacs.  In the
+## past, this defaulted to a subdirectory of ${prefix}/lib/xemacs, but
+## since there are now many packages documented with the texinfo
+## system, it is inappropriate to imply that it is part of XEmacs.
+infodir=@infodir@
+
+## Document me.
+## See callproc.c for code which references this.
+infopath=@infopath@
+
+## Where to find the source code.  The source code for XEmacs's C kernel is
+## expected to be in ${srcdir}/src, and the source code for XEmacs's
+## utility programs is expected to be in ${srcdir}/lib-src.  This is
+## set by the configure script's `--srcdir' option.
+srcdir=@srcdir@
+
+## Where the build is done.
+blddir=@blddir@
+
+## ==================== XEmacs-specific directories ====================
+
+## These variables hold the values XEmacs will actually use.  They are
+## based on the values of the standard Make variables above.
+
+## Where to install the lisp files distributed with
+## XEmacs.  This includes the XEmacs version, so that the
+## lisp files for different versions of XEmacs will install
+## themselves in separate directories.
+lispdir=@lispdir@
+
+## Directory XEmacs should search for lisp files specific
+## to this site (i.e. customizations), before consulting
+## ${lispdir}.
+sitelispdir=@sitelispdir@
+
+## Where XEmacs will search for its lisp files while
+## building.  This is only used during the process of
+## compiling XEmacs, to help XEmacs find its lisp files
+## before they've been installed in their final location.
+## It's usually identical to lispdir, except that the
+## entry for the directory containing the installed lisp
+## files has been replaced with ../lisp.  This should be a
+## colon-separated list of directories.
+buildlispdir=${srcdir}/lisp
+
+## Where to install the other architecture-independent
+## data files distributed with XEmacs (like the tutorial,
+## the cookie recipes and the Zippy database). This path
+## usually contains the XEmacs version number, so the data
+## files for multiple versions of XEmacs may be installed
+## at once.
+etcdir=@etcdir@
+
+## Where to create and expect the locking directory, where
+## the XEmacs locking code keeps track of which files are
+## currently being edited.
+lockdir=@lockdir@
+
+## Where to put executables to be run by XEmacs rather than
+## the user.  This path usually includes the XEmacs version
+## and configuration name, so that multiple configurations
+## for multiple versions of XEmacs may be installed at
+## once.
+archlibdir=@archlibdir@
+
+## ==================== Utility Programs for the Build ====================
+
+## Allow the user to specify the install program.
+INSTALL = @install_pp@ @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+## ============================= Targets ==============================
+
+## Subdirectories to make recursively.  `lisp' is not included
+## because the compiled lisp files are part of the distribution
+## and you cannot remake them without installing XEmacs first.
+MAKE_SUBDIR = @MAKE_SUBDIR@
+
+## Subdirectories that can be made recursively.
+SUBDIR = ${MAKE_SUBDIR} man
+
+## The makefiles of the directories in ${MAKE_SUBDIR}.
+SUBDIR_MAKEFILES = @SUBDIR_MAKEFILES@
+
+## Subdirectories to `make install-arch-dep' recursively
+INSTALL_ARCH_DEP_SUBDIR = @INSTALL_ARCH_DEP_SUBDIR@
+
+## Subdirectories to install, and where they'll go.
+## lib-src's makefile knows how to install it, so we don't do that here.
+## When installing the info files, we need to do special things to
+## avoid nuking an existing dir file, so we don't do that here;
+## instead, we have written out explicit code in the `install' targets.
+COPYDIR = ${srcdir}/etc ${srcdir}/lisp
+COPYDESTS = ${etcdir} ${lispdir}
+GENERATED_HEADERS = src/paths.h src/Emacs.ad.h src/puresize-adjust.h src/config.h lwlib/config.h src/sheap-adjust.h
+GENERATED_LISP = lisp/finder-inf.el
+
+all: ${PROGNAME} all-elc info
+
+${PROGNAME}:   ${GENERATED_HEADERS} ${MAKE_SUBDIR} ${GENERATED_LISP}
+
+## For performance and consistency, no built-in rules
+.SUFFIXES:
+
+.NO_PARALLEL:  ${GENERATED_HEADERS} ${MAKE_SUBDIR} dump-elcs
+.PHONY: ${SUBDIR} all beta all-elc all-elcs dump-elc dump-elcs autoloads finder
+
+## Convenience target for XEmacs beta testers
+beta: clean all-elc finder
+
+## Convenience target for XEmacs maintainers
+## This would run `make-xemacsdist' if I were really confident that everything
+## was turnkey.
+dist: all-elc info
+
+## Convenience target for XEmacs maintainers
+## Updates some rarely generated files:
+## - configure from configure.in
+## - config.values.in from configure
+## - src/depend from src/*.[ch]
+.PHONY: config configure depend
+config: configure depend
+configure: ${srcdir}/configure
+${srcdir}/configure: ${srcdir}/configure.in
+       cd ${srcdir} && autoconf
+       cd ${srcdir} && /bin/sh lib-src/config.values.sh
+
+depend ${srcdir}/src/depend:
+       cd ${srcdir}/src && \
+               perl ./make-src-depend > depend.tmp && \
+               $(RM) depend && mv depend.tmp depend
+
+## Build XEmacs and recompile out-of-date and missing .elc files along
+## the way.
+all-elc all-elcs: lib-src lwlib dump-elcs src
+       MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-elc.sh
+
+## Sub-target for all-elc.
+dump-elc dump-elcs: ${GENERATED_HEADERS} FRC.dump-elcs
+       cd ./src && $(RECURSIVE_MAKE) dump-elcs
+
+autoloads: src
+       MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-autoloads.sh
+
+custom-loads:
+       MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-custom.sh
+
+finder: src
+       @echo "Building finder database ..."
+       @(cd ./lisp; \
+               ${blddir}/src/${PROGNAME} -batch -vanilla \
+               -eval '(setq finder-compile-keywords-quiet t)' \
+               -l finder -f finder-compile-keywords )
+       @echo "Building finder database ...(done)"
+
+lisp/finder-inf.el:
+       @echo "Building finder database ..."
+       @(cd ./lisp; \
+               ${blddir}/src/${PROGNAME} -batch -vanilla \
+               -eval '(setq finder-compile-keywords-quiet t)' \
+               -l finder -f finder-compile-keywords )
+       @echo "Building finder database ...(done)"
+
+## We have to force the building of Emacs.ad.h as well in order to get it
+## updated correctly when VPATH is being used.  Since we use move-if-change,
+## it will only actually change if the user modified ${etcdir}/Emacs.ad.
+src/Emacs.ad.h: ${srcdir}/etc/Emacs.ad
+       @echo "Producing \`src/Emacs.ad.h' from \`etc/Emacs.ad'."
+       @$(RM) src/Emacs.ad.h
+       @(echo "/*      Do not edit this file!" ; \
+         echo "        Automatically generated from ${srcdir}/etc/Emacs.ad" ; \
+         echo " */" ; \
+         /bin/sh ${srcdir}/lib-src/ad2c ${srcdir}/etc/Emacs.ad ) > \
+         src/Emacs.ad.h
+
+src/puresize-adjust.h: ${srcdir}/src/puresize.h
+       @echo "Resetting \`src/puresize-adjust.h'."; \
+       (echo "/*       Do not edit this file!" ; \
+        echo "         Automatically generated by XEmacs */" ; \
+        echo "#define PURESIZE_ADJUSTMENT 0") > $@
+
+src/sheap-adjust.h:
+       @echo "Resetting \`src/sheap-adjust.h'."; \
+       (echo "/*       Do not edit this file!" ; \
+        echo "         Automatically generated by XEmacs */" ; \
+        echo "#define SHEAP_ADJUSTMENT 0") > $@
+
+src: @SRC_SUBDIR_DEPS@ FRC.src
+pkg-src/tree-x: pkg-src/FRC.tree-x
+lib-src: FRC.lib-src
+lwlib: FRC.lwlib
+dynodump: FRC.dynodump
+FRC.src FRC.lib-src FRC.lwlib FRC.dynodump pkg-src/FRC.tree-x:
+FRC.lisp.finder-inf.el:
+
+${SUBDIR}: ${SUBDIR_MAKEFILES} ${GENERATED_HEADERS} FRC
+       cd ./$@ && $(RECURSIVE_MAKE) all
+
+Makefile: ${srcdir}/Makefile.in config.status
+       ./config.status
+
+src/Makefile: ${srcdir}/src/Makefile.in.in ${srcdir}/src/depend config.status
+       ./config.status
+
+lib-src/Makefile: ${srcdir}/lib-src/Makefile.in.in config.status
+       ./config.status
+
+lwlib/Makefile: ${srcdir}/lwlib/Makefile.in.in config.status
+       ./config.status
+
+pkg-src/tree-x/Makefile: ${srcdir}/pkg-src/tree-x/Makefile.in.in config.status
+       ./config.status
+
+src/config.h: ${srcdir}/src/config.h.in
+       ./config.status && touch $@
+
+src/paths.h: ${srcdir}/src/paths.h.in
+       ./config.status && touch $@
+
+lwlib/config.h: ${srcdir}/lwlib/config.h.in
+       ./config.status && touch $@
+
+## ==================== Installation ====================
+
+## If we let lib-src do its own installation, that means we
+## don't have to duplicate the list of utilities to install in
+## this Makefile as well.
+
+## On AIX, use tar xBf.
+## On Xenix, use tar xpf.
+
+.PHONY: install-only install install-arch-dep install-arch-indep gzip.el mkdir
+.PHONY: check-features
+
+## We delete each directory in ${COPYDESTS} before we copy into it;
+## that way, we can reinstall over directories that have been put in
+## place with their files read-only (perhaps because they are checked
+## into RCS).  In order to make this safe, we make sure that the
+## source exists and is distinct from the destination.
+
+## FSF doesn't depend on `all', but rather on ${MAKE_SUBDIR}, so that
+## they "won't ever modify src/paths.h".  But that means you can't do
+## 'make install' right off the bat because src/paths.h won't exist.
+## And, in XEmacs case, src/Emacs.ad.h won't exist either.  I also
+## don't see the point in avoiding modifying paths.h.  It creates an
+## inconsistency in the build process.  So we go ahead and depend on
+## all.  --cet
+
+check-features: all
+       ${blddir}/src/${PROGNAME} -batch -l check-features.el
+
+install-only: ${MAKE_SUBDIR} check-features install-arch-dep install-arch-indep
+
+install: all check-features install-arch-dep install-arch-indep
+
+install-arch-dep: mkdir
+       for subdir in ${INSTALL_ARCH_DEP_SUBDIR}; do \
+       (cd ./$${subdir} && $(RECURSIVE_MAKE) install prefix=${prefix} \
+           exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
+           archlibdir=${archlibdir}) ; done
+       if test "`(cd ${archlibdir} && $(pwd))`" != \
+               "`(cd ./lib-src && $(pwd))`"; then \
+          if test -f ../Installation; then \
+               ${INSTALL_DATA} ../Installation ${archlibdir}/Installation; \
+          fi; \
+          for f in DOC config.values; do \
+               ${INSTALL_DATA} lib-src/$${f} ${archlibdir}/$${f}; \
+          done ; \
+          for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; \
+            do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \
+       else true; fi
+       ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}
+       -chmod 0755 ${bindir}/${PROGNAME}-${version}
+       cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME}
+       if test "${prefix}" != "${exec_prefix}"; then \
+         for dir in \
+               lib/${PROGNAME} \
+               lib/${PROGNAME}-${version}/etc \
+               lib/${PROGNAME}-${version}/info \
+               lib/${PROGNAME}-${version}/lisp; do \
+           if test ! -d ${exec_prefix}/$${dir}; then \
+             $(LN_S) ${prefix}/$${dir} ${exec_prefix}/$${dir}; fi; \
+         done; \
+       fi
+
+install-arch-indep: mkdir info
+       -@set ${COPYDESTS} ; \
+        for dir in ${COPYDIR} ; do \
+          if test "`(cd $$1 && $(pwd))`" != \
+                  "`(cd $${dir} && $(pwd))`"; then \
+            : do nothing - echo "rm -rf $$1" ; \
+          fi ; \
+          shift ; \
+        done
+       -set ${COPYDESTS} ; \
+        for dir in ${COPYDESTS} ; do \
+          if test ! -d $${dir} ; then mkdir $${dir} ; fi ; \
+        done ; \
+        for dir in ${COPYDIR} ; do \
+          dest=$$1 ; shift ; \
+          test -d $${dir} \
+            -a "`(cd $${dir} && $(pwd))`" != \
+               "`(cd $${dest} && $(pwd))`" \
+          && (echo "Copying $${dir}..." ; \
+              (cd $${dir} && tar -cf - . ) | \
+               (cd $${dest} && umask 022 && tar -xf - );\
+              chmod 0755 $${dest}; \
+              for subdir in `find $${dest} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; do \
+                (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; \
+              done) ; \
+        done
+       if test "`(cd ${srcdir}/info && $(pwd))`" != \
+               "`(cd ${infodir} && $(pwd))`" && cd ${srcdir}/info; then \
+         if test ! -f ${infodir}/dir -a -f dir ; then \
+           ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir ; \
+         fi ; \
+         for file in *.info* ; do \
+           ${INSTALL_DATA} $${file} ${infodir}/$${file} ; \
+           chmod 0644 ${infodir}/$${file}; \
+         done ; \
+       fi
+       ## Note it's `xemacs' not ${PROGNAME}
+       cd ${srcdir}/etc && \
+         for page in xemacs etags ctags gnuserv gnuclient gnuattach gnudoit; do \
+           ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext} ; \
+           chmod 0644 ${mandir}/$${page}${manext} ; \
+         done
+       @echo "If you would like to save approximately 2M of disk space, do"
+       @echo "make gzip-el"
+       @echo "or you may run "
+       @echo ${srcdir}/lib-src/gzip-el.sh lispdir " from the command line."
+       @echo "Where lispdir is where the lisp files were installed, i.e.,"
+       @echo "${lispdir}"
+
+gzip-el:
+       ${srcdir}/lib-src/gzip-el.sh ${lispdir}
+
+MAKEPATH=./lib-src/make-path
+## Build all the directories to install XEmacs in.
+## Since we may be creating several layers of directories,
+## (e.g. /usr/local/lib/${PROGNAME}-20.5/sparc-sun-solaris2.6), we use
+## make-path instead of mkdir.  Not all mkdirs have the `-p' flag.
+mkdir: FRC.mkdir
+       ${MAKEPATH} ${COPYDESTS} ${lockdir} ${infodir} ${archlibdir} \
+         ${mandir} ${bindir} ${datadir} ${libdir} ${pkgdir}
+       -chmod 0777 ${lockdir}
+
+## Delete all the installed files that the `install' target would
+## create (but not the noninstalled files such as `make all' would
+## create).
+
+#### Don't delete the lisp and etc directories if they're in the source tree.
+#### This target has not been updated in sometime and until it is it
+#### would be extremely dangerous for anyone to use it.
+#uninstall:
+#      (cd ./lib-src;                                  \
+#       $(RECURSIVE_MAKE) uninstall                    \
+#          prefix=${prefix} exec_prefix=${exec_prefix} \
+#          bindir=${bindir} libdir=${libdir} archlibdir=${archlibdir})
+#      for dir in ${lispdir} ${etcdir} ; do            \
+#        case `(cd $${dir} ; $(pwd))` in                       \
+#          `(cd ${srcdir} ; $(pwd))`* ) ;;             \
+#          * ) $(RM) $${dir} ;;                        \
+#        esac ;                                        \
+#        case $${dir} in                               \
+#          ${datadir}/${PROGNAME}/${version}/* )               \
+#            $(RM) -r ${datadir}/${PROGNAME}/${version}        \
+#          ;;                                          \
+#        esac ;                                        \
+#      done
+#      cd ${infodir} && $(RM) cl* ${PROGNAME}* forms* info* vip*
+#      cd ${mandir} && $(RM) xemacs.1 etags.1 ctags.1 gnuserv.1
+#      cd ${bindir} && $(RM) ${PROGNAME}-${version} ${PROGNAME}
+
+
+## Some makes seem to remember that they've built something called FRC,
+## so you can only use a given FRC once per makefile.
+FRC FRC.src.paths.h FRC.mkdir FRC.dump-elcs FRC.info:
+FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean FRC.tags:
+
+## ==================== Cleaning up and miscellanea ====================
+
+.PHONY: mostlyclean clean distclean realclean extraclean
+
+## `mostlyclean'
+##      Like `clean', but may refrain from deleting a few files that people
+##      normally don't want to recompile.  For example, the `mostlyclean'
+##      target for GCC does not delete `libgcc.a', because recompiling it
+##      is rarely necessary and takes a lot of time.
+mostlyclean: FRC.mostlyclean
+       for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done
+
+## `clean'
+##      Delete all files from the current directory that are normally
+##      created by building the program.  Don't delete the files that
+##      record the configuration.  Also preserve files that could be made
+##      by building, but normally aren't because the distribution comes
+##      with them.
+
+##      Delete `.dvi' files here if they are not part of the distribution.
+clean: FRC.clean
+       for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done
+       $(RM) core
+
+## `distclean'
+##      Delete all files from the current directory that are created by
+##      configuring or building the program.  If you have unpacked the
+##      source and built the program without creating any other files,
+##      `make distclean' should leave only the files that were in the
+##      distribution.
+top_distclean=\
+       $(RM) config.status config.log config-tmp-* build-install Installation ; \
+       for d in src lib-src lwlib dynodump ; do \
+         $(RM) $$d/Makefile $$d/Makefile.in ; \
+       done ; \
+       $(RM) core .sbinit Makefile lock/*; \
+       $(RM) lisp/finder-inf.el* Installation.el Installation.elc; \
+       $(RM) packages mule-packages site-lisp
+
+distclean: FRC.distclean
+       for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done
+       -${top_distclean}
+
+## `realclean'
+##      Delete everything from the current directory that can be
+##      reconstructed with this Makefile.  This typically includes
+##      everything deleted by distclean, plus more: C source files
+##      produced by Bison, tags tables, info files, and so on.
+
+##      One exception, however: `make realclean' should not delete
+##      `configure' even if `configure' can be remade using a rule in the
+##      Makefile.  More generally, `make realclean' should not delete
+##      anything that needs to exist in order to run `configure' and then
+##      begin to build the program.
+realclean: FRC.realclean
+       for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done
+       -${top_distclean}
+       $(RM) TAGS
+
+## This doesn't actually appear in the coding standards, but Karl
+## says GCC supports it, and that's where the configuration part of
+## the coding standards seem to come from.  It's like distclean, but
+## it deletes backup and autosave files too.
+extraclean:
+       for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done
+       $(RM) *~ \#*
+       -${top_distclean}
+
+## Unlocking and relocking.  The idea of these productions is to reduce
+## hassles when installing an incremental tar of XEmacs.  Do `make unlock'
+## before unlocking the file to take the write locks off all sources so
+## that tar xvof will overwrite them without fuss.  Then do `make relock'
+## afterward so that VC mode will know which files should be checked in
+## if you want to mung them.
+
+## Note: it's no disaster if these productions miss a file or two; tar
+## and VC will swiftly let you know if this happens, and it is easily
+## corrected.
+SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \
+       README build-install.in configure make-dist move-if-change
+
+.PHONY: unlock relock TAGS tags check dist info dvi mcs
+
+unlock:
+       chmod u+w $(SOURCES) cpp/*
+       -cd ./elisp && chmod u+w Makefile README *.texi
+       for d in src etc lib-src lisp; do (cd ./$$d && $(RECURSIVE_MAKE) $@); done
+       cd ./lisp/term && chmod u+w README *.el
+       cd ./man && chmod u+w *texi* ChangeLog split-man
+       cd ./lwlib && chmod u+w *.[ch] Makefile.in.in
+
+relock:
+       chmod u-w $(SOURCES) cpp/*
+       -cd ./elisp && chmod u-w Makefile README *.texi
+       for d in src etc lib-src lisp; do (cd ./$$d && $(RECURSIVE_MAKE) $@); done
+       cd ./lisp/term && chmod u+w README *.el
+       cd ./man && chmod u+w *texi* ChangeLog split-man
+       cd ./lwlib && chmod u+w *.[ch] Makefile.in.in
+
+PRUNE_VC = -name SCCS -prune -o -name RCS -prune -o -name CVS -prune -o
+TAGS tags: FRC.tags
+       @echo "If you don't have a copy of etags around, then do 'make lib-src' first."
+       $(RM) ${srcdir}/TAGS
+       @PATH=`$(pwd)`/lib-src:$$PATH HOME=/-=-; export PATH HOME; \
+         echo "Using etags from `which etags`."
+       PATH=`$(pwd)`/lib-src:$$PATH ; export PATH; cd ${srcdir} && \
+       find src lwlib lib-src ${PRUNE_VC} -name '*.[ch]' -print | \
+         xargs etags -a -r '/[         ]*DEF\(VAR\|INE\)_[A-Z_]+[      ]*([    ]*"\([^"]+\)"/\2/'; \
+       find lisp ${PRUNE_VC} -name '*.el' -print | \
+         xargs etags -a -l none -r "/^(def\\(var\\|un\\|alias\\|const\\|macro\\)[      ]+'?\\([^       ]+\\)/\\2/"
+
+## We have automated tests!
+testdir = ${srcdir}/tests
+tests   = ${testdir}/basic-lisp.el ${testdir}/database.el
+
+check:
+       src/${PROGNAME} -batch -l ${testdir}/test-emacs.el -f batch-test-emacs ${tests}
+
+info: FRC.info
+       cd ${srcdir}/man && $(RECURSIVE_MAKE) $@
+
+dvi:
+       cd ${srcdir}/man && $(RECURSIVE_MAKE) $@
+
+## Fix up version information in executables (Solaris-only)
+mcs:
+       date=`LANG=C LC_ALL=C date -u '+%e %b %Y'`; \
+       ident="@(#)RELEASE VERSION XEmacs ${version} $${date}"; \
+       for f in `file lib-src/* src/${PROGNAME} | grep ELF | sed -e 's/:.*//'`; do \
+         mcs -da "$${ident} `echo $${f} | sed 's/.*\///'`" $${f}; \
+       done
index 4daf94e..5d6f4f2 100644 (file)
@@ -151,22 +151,11 @@ blddir=@blddir@
 ## themselves in separate directories.
 lispdir=@lispdir@
 
-## Where to install the module files distributed with
-## XEmacs.  This includes the XEmacs version, so that the
-## module files for different versions of XEmacs will install
-## themselves in separate directories.
-moduledir=@moduledir@
-
 ## Directory XEmacs should search for lisp files specific
 ## to this site (i.e. customizations), before consulting
 ## ${lispdir}.
 sitelispdir=@sitelispdir@
 
-## Directory XEmacs should search for module files specific
-## to this site (i.e. customizations), before consulting
-## ${moduledir}.
-sitemoduledir=@sitemoduledir@
-
 ## Where XEmacs will search for its lisp files while
 ## building.  This is only used during the process of
 ## compiling XEmacs, to help XEmacs find its lisp files
@@ -477,8 +466,7 @@ MAKEPATH=./lib-src/make-path
 ## make-path instead of mkdir.  Not all mkdirs have the `-p' flag.
 mkdir: FRC.mkdir
        ${MAKEPATH} ${COPYDESTS} ${lockdir} ${infodir} ${archlibdir} \
-         ${mandir} ${bindir} ${datadir} ${libdir} ${pkgdir} \
-         ${sitelispdir} ${moduledir} ${sitemoduledir}
+         ${mandir} ${bindir} ${datadir} ${libdir} ${pkgdir}
        -chmod 0777 ${lockdir}
 
 ## Delete all the installed files that the `install' target would
@@ -546,8 +534,11 @@ clean: FRC.clean
 ##      distribution.
 top_distclean=\
        $(RM) config.status config.log config-tmp-* build-install Installation ; \
-       $(RM) core .sbinit lock/* GNUmakefile Makefile Makefile.in ; \
-       $(RM) lisp/finder-inf.el* Installation.el Installation.elc ; \
+       for d in src lib-src lwlib dynodump ; do \
+         $(RM) $$d/Makefile $$d/Makefile.in ; \
+       done ; \
+       $(RM) core .sbinit Makefile Makefile.in lock/*; \
+       $(RM) lisp/finder-inf.el* Installation.el Installation.elc; \
        $(RM) packages mule-packages site-lisp
 
 distclean: FRC.distclean
index 23394a2..0beba52 100755 (executable)
--- a/configure
+++ b/configure
@@ -7,7 +7,6 @@
 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
 #### Copyright (C) 1995, 1996 Ben Wing.
-#### Copyright (C) 1998, 1999 J. Kean Johnston.
 
 ### Don't edit this script!
 ### This script was automatically generated by the `autoconf' program
@@ -229,16 +228,12 @@ infodir='${datadir}/${PROGNAME}-${version}/info'
 infopath=''
 install_pp=''
 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
-moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules'
-sitelispdir='${datadir}/xemacs/site-lisp'
-sitemoduledir='${datadir}/xemacs/site-modules'
 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
 package_path=''
 etcdir='${datadir}/${PROGNAME}-${version}/etc'
 lockdir='${statedir}/${PROGNAME}/lock'
-archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}'
+archlibdir='${libdir}/${PROGNAME}-${version}/${configuration}'
 with_site_lisp='no'
-with_site_modules='yes'
 with_menubars=''
 with_scrollbars=''
 with_dialogs=''
@@ -304,12 +299,13 @@ while test $# != 0; do
 
             case "$opt" in
 
-       with_site_lisp  | \
-    with_site_modules | \
+       run_in_place    | \
+        with_site_lisp  | \
        with_x          | \
        with_x11        | \
        with_msw        | \
        with_gcc        | \
+       with_gnu_make   | \
        dynamic         | \
        with_ncurses    | \
        with_dnet       | \
@@ -326,20 +322,19 @@ while test $# != 0; do
        with_tiff       | \
        with_session    | \
        with_xmu        | \
-       with_purify     | \
        with_quantify   | \
        with_toolbars   | \
        with_tty        | \
        with_xfs        | \
        with_i18n3      | \
        with_mule       | \
-       with_file_coding| \
+       with_file_coding        | \
        with_canna      | \
        with_wnn        | \
        with_wnn6       | \
        with_workshop   | \
        with_sparcworks | \
-       with_tooltalk   | \
+       with_tooltalk   | \
        with_ldap       | \
        with_pop        | \
        with_kerberos   | \
@@ -350,25 +345,26 @@ while test $# != 0; do
        verbose         | \
        extra_verbose   | \
        const_is_losing | \
-       usage_tracking  | \
-       use_union_type  | \
+       usage_tracking  | \
+       use_union_type  | \
        debug           | \
        use_assertions  | \
-       gung_ho         | \
        use_minimal_tagbits                     | \
        use_indexed_lrecord_implementation      | \
+       gung_ho         | \
+       use_assertions  | \
        memory_usage_stats | \
        with_clash_detection | \
        with_shlib | \
        no_doc_file )
                  case "$val" in
            y | ye | yes )      val=yes ;;
-           n | no )            val=no  ;;
+           n | no )            val=no  ;;
            * ) (echo "$progname: Usage error:"
 echo " " "The \`--$optname' option requires a boolean value: \`yes' or \`no'."
 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
          esac
-         eval "$opt=\"$val\"" ;;
+          eval "$opt=\"$val\"" ;;
 
 
                        srcdir          | \
@@ -380,7 +376,7 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
        ldflags         | \
        puresize        | \
        cache_file      | \
-       native_sound_lib| \
+       native_sound_lib | \
        site_lisp       | \
        x_includes      | \
        x_libraries     | \
@@ -429,7 +425,7 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
                * ) (echo "$progname: Usage error:"
 echo " " "The \`--$optname' option value
   must be either \`no' or a comma-separated list
-  of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."
+  of one or more of \`berkdb', \`dbm', or \`gnudbm'."
 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
             esac
          done
@@ -471,6 +467,18 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
           eval "$opt=\"$val\""
         ;;
 
+               "with_xfs" )
+         case "$val" in
+         y | ye | yes )                val=yes ;;
+         n | no | non | none )         val=no  ;;
+         * ) (echo "$progname: Usage error:"
+echo " " "The \`--$optname' option must have one of these values:
+ \`yes', or \`no'."
+echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
+         esac
+         eval "$opt=\"$val\""
+       ;;
+
                "mail_locking" )
          case "$val" in
            lockf )     val=lockf ;;
@@ -534,7 +542,7 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
                                
                prefix | exec_prefix | bindir | datadir | statedir | libdir | \
        mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
-       archlibdir | docdir | package_path )
+       archlibdir | docdir | package_path )    
                   if test "$valomitted" = "yes"; then
             if test "$#" = 0; then
                 (echo "$progname: Usage error:"
@@ -554,22 +562,6 @@ cat >> confdefs.h <<\EOF
 EOF
 }
  ;;
-             sitelispdir ) { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining SITELISPDIR_USER_DEFINED
-EOF
-cat >> confdefs.h <<\EOF
-#define SITELISPDIR_USER_DEFINED 1
-EOF
-}
- ;;
-             moduledir ) { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining MODULEDIR_USER_DEFINED
-EOF
-cat >> confdefs.h <<\EOF
-#define MODULEDIR_USER_DEFINED 1
-EOF
-}
- ;;
              etcdir  )  { test "$extra_verbose" = "yes" && cat << \EOF
     Defining ETCDIR_USER_DEFINED
 EOF
@@ -619,14 +611,6 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-            { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining MODULEDIR_USER_DEFINED
-EOF
-cat >> confdefs.h <<\EOF
-#define MODULEDIR_USER_DEFINED 1
-EOF
-}
-
                { test "$extra_verbose" = "yes" && cat << \EOF
     Defining ETCDIR_USER_DEFINED
 EOF
@@ -658,9 +642,7 @@ EOF
 
                "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
 
-               "with_menubars"   | \
-       "with_scrollbars" | \
-       "with_dialogs" )
+                       "with_menubars" | "with_scrollbars" | "with_dialogs" )
          case "$val" in
            l | lu | luc | luci | lucid )               val=lucid  ;;
            m | mo | mot | moti | motif )               val=motif  ;;
@@ -675,11 +657,6 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
          eval "$opt=\"$val\""
        ;;
 
-               "run_in_place"  | \
-       "with_gnu_make" )
-         echo "configure: warning: Obsolete option \`--$optname' ignored." 1>&2
-       ;;
-
                * ) (echo "$progname: Usage error:"
 echo " " "Unrecognized option: $arg"
 echo "  Use \`$progname --help' to show usage.") >&2 && exit 1 ;;
@@ -706,11 +683,13 @@ eval set x "$quoted_arguments"; shift
 
 test "$extra_verbose" = "yes" && verbose=yes
 
+case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
+case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
+case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
+case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
+
 test -n "$with_x" && with_x11="$with_x"
 
-if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
-  test "$with_system_malloc" = "default" && with_system_malloc=yes
-fi
 
 if test -n "$gung_ho"; then
   test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho"
@@ -736,6 +715,10 @@ elif test "$with_cde" = "yes"; then with_tooltalk=yes
 fi
 
 
+if test "$run_in_place" = "yes"; then
+  echo "configure: warning: "The --run-in-place option is ignored because it is unnecessary."" 1>&2
+fi
+
 case "$srcdir" in
 
     "" )
@@ -771,8 +754,13 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
 esac
 
 if test -z "$configuration"; then
-    configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
-  if test -z "$configuration"; then
+  echo $ac_n "checking "host system type"""... $ac_c" 1>&6
+echo "configure:759: checking "host system type"" >&5
+    if configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess | \
+    sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` ; then
+    echo "$ac_t""$configuration" 1>&6
+  else
+    echo "$ac_t""unknown" 1>&6
     (echo "$progname: Usage error:"
 echo " " "XEmacs has not been ported to this host type.
 Try explicitly specifying the CONFIGURATION when rerunning configure."
@@ -781,7 +769,7 @@ echo "  Use \`$progname --help' to show usage.") >&2 && exit 1
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:785: checking whether ln -s works" >&5
+echo "configure:773: checking whether ln -s works" >&5
 
 rm -f conftestdata
 if ln -s X conftestdata 2>/dev/null
@@ -996,13 +984,12 @@ EOF
 
 
 
-echo $ac_n "checking "host system type"""... $ac_c" 1>&6
-echo "configure:1001: checking "host system type"" >&5
+echo "checking "the configuration name"" 1>&6
+echo "configure:989: checking "the configuration name"" >&5
 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
-canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
-configuration=`echo "$configuration" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
-canonical=`echo "$canonical" | sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'`
-echo "$ac_t""$configuration" 1>&6
+if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else
+  exit $?
+fi
 
 
 
@@ -1012,7 +999,7 @@ machine='' opsys=''
 
 case "$canonical" in
   sparc-*-*        ) machine=sparc ;;
-  alpha*-*-*       ) machine=alpha ;;
+  alpha-*-*        ) machine=alpha ;;
   vax-*-*          ) machine=vax ;;
   mips-dec-*       ) machine=pmax ;;
   mips-sgi-*       ) machine=iris4d ;;
@@ -1025,8 +1012,6 @@ case "$canonical" in
   m68*-sony-*      ) machine=news ;;
   mips-sony-*      ) machine=news-risc ;;
   clipper-*        ) machine=clipper ;;
-  arm-*            ) machine=arm ;;
-  ns32k-*          ) machine=ns32000 ;;
 esac
 
 case "$canonical" in
@@ -1049,9 +1034,9 @@ case "$canonical" in
     *-*-aix3.1*  ) opsys=aix3-1        ;;
   *-*-aix3.2.5 ) opsys=aix3-2-5        ;;
   *-*-aix3*    ) opsys=aix3-2  ;;
-  *-*-aix4.0*  ) opsys=aix4    ;;
+  *-*-aix4.2*  ) opsys=aix4-2  ;;
   *-*-aix4.1*  ) opsys=aix4-1  ;;
-  *-*-aix4*    ) opsys=aix4-2  ;;
+  *-*-aix4*    ) opsys=aix4    ;;
 
     *-gnu* )                   opsys=gnu    ;;
   *-*-bsd4.[01] )              opsys=bsd4-1 ;;
@@ -1089,9 +1074,13 @@ case "$canonical" in
 
     *-*-openbsd* )
     case "${canonical}" in
+      alpha*-*-openbsd*)       machine=alpha ;;
       i386-*-openbsd*)         machine=intel386 ;;
       m68k-*-openbsd*)         machine=hp9000s300 ;;
       mipsel-*-openbsd*)       machine=pmax ;;
+      ns32k-*-openbsd*)                machine=ns32000 ;;
+      sparc-*-openbsd*)                machine=sparc ;;
+      vax-*-openbsd*)          machine=vax ;;
      esac
    ;;
 
@@ -1253,12 +1242,6 @@ case "$canonical" in
     NON_GNU_CPP=/usr/ccs/lib/cpp
   ;;
 
-    mips-nec-sysv*)
-    machine=mips-nec
-    NON_GNU_CC=/usr/ccs/bin/cc
-    NON_GNU_CPP=/usr/ccs/lib/cpp
-  ;;
-
       m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
   m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;;
     mips-sgi-irix3.*    ) opsys=irix3-3 ;;
@@ -1399,7 +1382,7 @@ fi
 
 if test -z "$dynamic"; then
   case "$opsys" in
-    hpux* | sunos4* ) dynamic=no ;;
+    hpux* | sunos4* | sco5 ) dynamic=no ;;
     *) dynamic=yes ;;
   esac
 fi
@@ -1486,7 +1469,7 @@ xe_save_CFLAGS="$CFLAGS"
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1490: checking for $ac_word" >&5
+echo "configure:1473: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1512,7 +1495,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1516: checking for $ac_word" >&5
+echo "configure:1499: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1557,7 +1540,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1561: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1544: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1569,11 +1552,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1573 "configure"
+#line 1556 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1593,19 +1576,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1597: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1580: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1602: checking whether we are using GNU C" >&5
+echo "configure:1585: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1619,7 +1602,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1623: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1606: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1648,7 +1631,7 @@ if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1652: checking for $ac_word" >&5
+echo "configure:1635: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1674,7 +1657,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1678: checking for $ac_word" >&5
+echo "configure:1661: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1719,7 +1702,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1723: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1731,11 +1714,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1735 "configure"
+#line 1718 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1755,19 +1738,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1742: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1764: checking whether we are using GNU C" >&5
+echo "configure:1747: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1781,7 +1764,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1785: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1768: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1810,7 +1793,7 @@ elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1814: checking for $ac_word" >&5
+echo "configure:1797: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1836,7 +1819,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1840: checking for $ac_word" >&5
+echo "configure:1823: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1881,7 +1864,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1885: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1868: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1893,11 +1876,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1897 "configure"
+#line 1880 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1917,19 +1900,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1921: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1904: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1926: checking whether we are using GNU C" >&5
+echo "configure:1909: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1943,7 +1926,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1947: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1930: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1976,7 +1959,7 @@ test -n "$CPP" -a -d "$CPP" && CPP=
 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1980: checking how to run the C preprocessor" >&5
+echo "configure:1963: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1989,13 +1972,13 @@ if test -z "$CPP"; then
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1993 "configure"
+#line 1976 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -2006,13 +1989,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2010 "configure"
+#line 1993 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -2035,9 +2018,9 @@ echo "$ac_t""$CPP" 1>&6
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2039: checking for AIX" >&5
+echo "configure:2022: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2041 "configure"
+#line 2024 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -2064,9 +2047,9 @@ rm -f conftest*
 
 
 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
-echo "configure:2068: checking for GNU libc" >&5
+echo "configure:2051: checking for GNU libc" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2070 "configure"
+#line 2053 "configure"
 #include "confdefs.h"
 #include <features.h>
 int main() {
@@ -2078,7 +2061,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   have_glibc=yes
 else
@@ -2098,35 +2081,31 @@ EOF
 }
 
 
-
+echo $ac_n "checking whether we are using SunPro C""... $ac_c" 1>&6
+echo "configure:2086: checking whether we are using SunPro C" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2104 "configure"
+#line 2088 "configure"
 #include "confdefs.h"
-int main () {
-#if defined __SUNPRO_C
-return 11;
-#elif defined __DECC
-return 12;
-#else
-return 0;
+
+int main() {
+#ifndef __SUNPRO_C
+#error Not a  SunPro compiler :-(
+******* ======= ******** &&&&&&&&
 #endif
-}
+
+; return 0; }
 EOF
-if { (eval echo configure:2116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
-then
-  :
+if { (eval echo configure:2099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  __sunpro_c=yes
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  case "$conftest_rc" in
-  11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
-  12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
-esac
+  rm -rf conftest*
+  __sunpro_c=no
 fi
-rm -fr conftest*
-
+rm -f conftest*
+echo "$ac_t""$__sunpro_c" 1>&6
 
 
 
@@ -2287,7 +2266,7 @@ configure___ mail_use_lockf=no
 
 EOF
 
-CPP=`eval "echo $CPP $CPPFLAGS"`
+CPP=`eval "echo $CPP"`
 eval `$CPP -Isrc $tempcname \
        | sed -n -e "s/[        ]*=[    \"]*/='/" -e "s/[       \"]*\$/'/" -e "s/^configure___//p"`
 
@@ -2298,22 +2277,20 @@ test "$extra_verbose" = "yes" && \
 
 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
 
-test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std\" to \$c_switch_site"; fi
-
 if test "$cflags_specified" = "no"; then
       if   test "$GCC" = "yes"; then
     CFLAGS="-g -O3 -Wall -Wno-switch"
-                          elif test "$__SUNPRO_C" = "yes"; then
+                    test "$opsys $machine" = "cygwin32 intel386" && \
+      CFLAGS="-g -O2 -Wall -Wno-switch"
+  elif test "$__sunpro_c" = "yes"; then
     case "$opsys" in
       sol2    ) CFLAGS="-v -xO4" ;;
       sunos4* ) CFLAGS="-xO2";;
     esac
-  elif test "$__DECC" = "yes"; then
-    CFLAGS="-O3"
   elif test "$CC" = "xlc"; then
-    CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
-    else
-    CFLAGS="-O" ;  fi
+    CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
+  else
+        CFLAGS="-O" ;  fi
 fi
 
 
@@ -2321,8 +2298,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_system; shift; ld_switch_system=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u               ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_system="$ld_switch_system $1" ;;
+      -L  | -l  | -u         ) ld_switch_system="$ld_switch_system $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) ld_switch_system="$ld_switch_system $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_system="$ld_switch_system -Xlinker $1" ;;
     esac
@@ -2334,8 +2311,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_machine; shift; ld_switch_machine=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" ;;
+      -L  | -l  | -u         ) ld_switch_machine="$ld_switch_machine $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) ld_switch_machine="$ld_switch_machine $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
     esac
@@ -2347,8 +2324,8 @@ if test "$GCC" = "yes"; then
   set x $LDFLAGS; shift; LDFLAGS=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u               ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) LDFLAGS="$LDFLAGS $1" ;;
+      -L  | -l  | -u         ) LDFLAGS="$LDFLAGS $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) LDFLAGS="$LDFLAGS $1" ;;
       -Xlinker* ) ;;
       * ) LDFLAGS="$LDFLAGS -Xlinker $1" ;;
     esac
@@ -2360,8 +2337,8 @@ if test "$GCC" = "yes"; then
   set x $ld_call_shared; shift; ld_call_shared=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u               ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) ld_call_shared="$ld_call_shared $1" ;;
+      -L  | -l  | -u         ) ld_call_shared="$ld_call_shared $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) ld_call_shared="$ld_call_shared $1" ;;
       -Xlinker* ) ;;
       * ) ld_call_shared="$ld_call_shared -Xlinker $1" ;;
     esac
@@ -2380,7 +2357,7 @@ test -n "$unexec"          && extra_objs="$extra_objs $unexec" &&  if test "$ext
  fi
 
 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
-echo "configure:2384: checking for dynodump" >&5
+echo "configure:2361: checking for dynodump" >&5
 if test "$unexec" != "unexsol2.o"; then
   echo "$ac_t""no" 1>&6
 else
@@ -2418,12 +2395,12 @@ if test "$unexec" = "unexaix.o"; then
   done
   
 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
-echo "configure:2422: checking for terminateAndUnload in -lC" >&5
+echo "configure:2399: checking for terminateAndUnload in -lC" >&5
 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lC "
 cat > conftest.$ac_ext <<EOF
-#line 2427 "configure"
+#line 2404 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2434,7 +2411,7 @@ int main() {
 terminateAndUnload()
 ; return 0; }
 EOF
-if { (eval echo configure:2438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2472,56 +2449,36 @@ test "$GCC" != "yes" && lib_gcc=
 
 
 
-case "$site_libraries" in *:* ) site_libraries="`echo '' $site_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
-if test -n "$site_libraries"; then
-  for arg in $site_libraries; do
+if test -n "$site_prefixes"; then
+  for arg in $site_prefixes; do
     case "$arg" in
-     -* ) ;;
-     * ) test -d "$arg" || \
-           { echo "Error:" "Invalid site library \`$arg': no such directory" >&2; exit 1; }
-       arg="-L${arg}" ;;
+       -* ) ;;
+       * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;;
     esac
+    c_switch_site="$c_switch_site $argi" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$argi\" to \$c_switch_site"; fi
+    ld_switch_site="$ld_switch_site $argl" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$argl\" to \$ld_switch_site"; fi
+  done
+fi
+
+if test -n "$site_libraries"; then
+  for arg in $site_libraries; do
+    case "$arg" in -* ) ;; * ) arg="-L${arg}" ;; esac
     ld_switch_site="$ld_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$ld_switch_site"; fi
   done
 fi
 
-case "$site_includes" in *:* ) site_includes="`echo '' $site_includes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
 if test -n "$site_includes"; then
   for arg in $site_includes; do
-    case "$arg" in
-      -* ) ;;
-      * ) test -d "$arg" || \
-           { echo "Error:" "Invalid site include \`$arg': no such directory" >&2; exit 1; }
-      arg="-I${arg}" ;;
-    esac
+    case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac
     c_switch_site="$c_switch_site $arg" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"$arg\" to \$c_switch_site"; fi
   done
 fi
 
-case "$site_prefixes" in *:* ) site_prefixes="`echo '' $site_prefixes | sed -e 's/^ //' -e 's/:/ /g'`";; esac
-if test -n "$site_prefixes"; then
-  for dir in $site_prefixes; do
-    inc_dir="${dir}/include"
-    lib_dir="${dir}/lib"
-    if test ! -d "$dir"; then
-      { echo "Error:" "Invalid site prefix \`$dir': no such directory" >&2; exit 1; }
-    elif test ! -d "$inc_dir"; then
-      { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$inc_dir'" >&2; exit 1; }
-    elif test ! -d "$lib_dir"; then
-      { echo "Error:" "Invalid site prefix \`$dir': no such directory \`$lib_dir'" >&2; exit 1; }
-    else
-      c_switch_site="$c_switch_site "-I$inc_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-I$inc_dir"\" to \$c_switch_site"; fi
-      ld_switch_site="$ld_switch_site "-L$lib_dir"" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \""-L$lib_dir"\" to \$ld_switch_site"; fi
-    fi
-  done
-fi
-
 
 for dir in "/usr/ccs/lib"; do
   test -d "$dir" && ld_switch_site="$ld_switch_site -L${dir}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L${dir}\" to \$ld_switch_site"; fi
 done
 
-case "$site_runtime_libraries" in *:* ) site_runtime_libraries="`echo '' $site_runtime_libraries | sed -e 's/^ //' -e 's/:/ /g'`";; esac
 if test -n "$site_runtime_libraries"; then
   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
   export LD_RUN_PATH
@@ -2531,43 +2488,39 @@ fi
 if   test "$dynamic" = "no"; then add_runtime_path=no
 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
 else case "$opsys" in
-       sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
+       sol2 | irix* | *bsd* ) add_runtime_path=yes ;;
        * ) add_runtime_path=no ;;
      esac
 fi
 
 if test "$add_runtime_path" = "yes"; then
       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
-echo "configure:2542: checking "for runtime libraries flag"" >&5
-  case "$opsys" in
-    sol2 ) dash_r="-R" ;;
-    decosf* | linux* ) dash_r="-rpath " ;;
-    *)
-      dash_r=""
-      for try_dash_r in "-R" "-R " "-rpath "; do
-        xe_check_libs="${try_dash_r}/no/such/file-or-directory"
-        
+echo "configure:2499: checking "for runtime libraries flag"" >&5
+  dash_r=""
+  for try_dash_r in "-R" "-R " "-rpath "; do
+    xe_check_libs="${try_dash_r}/no/such/file-or-directory"
+    
 if test "$GCC" = "yes"; then
   set x $xe_check_libs; shift; xe_check_libs=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u               ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) xe_check_libs="$xe_check_libs $1" ;;
+      -L  | -l  | -u         ) xe_check_libs="$xe_check_libs $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) xe_check_libs="$xe_check_libs $1" ;;
       -Xlinker* ) ;;
       * ) xe_check_libs="$xe_check_libs -Xlinker $1" ;;
     esac
     shift
   done
 fi
-        cat > conftest.$ac_ext <<EOF
-#line 2564 "configure"
+    cat > conftest.$ac_ext <<EOF
+#line 2517 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   dash_r="$try_dash_r"
 else
@@ -2575,10 +2528,9 @@ else
   cat conftest.$ac_ext >&5
 fi
 rm -f conftest*
-        xe_check_libs=""
-        test -n "$dash_r" && break
-      done ;;
-  esac
+    xe_check_libs=""
+    test -n "$dash_r" && break
+  done
   if test -n "$dash_r";
     then echo "$ac_t"""\"${dash_r}\""" 1>&6
     else echo "$ac_t""NONE" 1>&6
@@ -2646,8 +2598,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_run; shift; ld_switch_run=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
+      -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
     esac
@@ -2660,7 +2612,6 @@ fi
 
 
 
-
 GNU_MALLOC=yes
 if test "$with_dlmalloc" != "no"; then
        doug_lea_malloc=yes
@@ -2669,10 +2620,10 @@ else
 fi
 after_morecore_hook_exists=yes
 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
-echo "configure:2673: checking for malloc_get_state" >&5
+echo "configure:2624: checking for malloc_get_state" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 2676 "configure"
+#line 2627 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_get_state(); below.  */
@@ -2695,7 +2646,7 @@ malloc_get_state();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_get_state=yes"
 else
@@ -2715,10 +2666,10 @@ doug_lea_malloc=no
 fi
 
 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
-echo "configure:2719: checking for malloc_set_state" >&5
+echo "configure:2670: checking for malloc_set_state" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 2722 "configure"
+#line 2673 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_set_state(); below.  */
@@ -2741,7 +2692,7 @@ malloc_set_state();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_set_state=yes"
 else
@@ -2761,16 +2712,16 @@ doug_lea_malloc=no
 fi
 
 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
-echo "configure:2765: checking whether __after_morecore_hook exists" >&5
+echo "configure:2716: checking whether __after_morecore_hook exists" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2767 "configure"
+#line 2718 "configure"
 #include "confdefs.h"
 extern void (* __after_morecore_hook)();
 int main() {
 __after_morecore_hook = 0
 ; return 0; }
 EOF
-if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2829,7 +2780,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2833: checking for $ac_word" >&5
+echo "configure:2784: checking for $ac_word" >&5
 
 if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -2882,7 +2833,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2886: checking for a BSD compatible install" >&5
+echo "configure:2837: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 
   IFS="${IFS=  }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
@@ -2933,7 +2884,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2937: checking for $ac_word" >&5
+echo "configure:2888: checking for $ac_word" >&5
 
 if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -2964,15 +2915,15 @@ for ac_hdr in mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2968: checking for $ac_hdr" >&5
+echo "configure:2919: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 2971 "configure"
+#line 2922 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3001,19 +2952,19 @@ else
 fi
 done
 
-for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h
+for ac_hdr in utime.h locale.h libgen.h fcntl.h ulimit.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3009: checking for $ac_hdr" >&5
+echo "configure:2960: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3012 "configure"
+#line 2963 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3042,19 +2993,19 @@ else
 fi
 done
 
-for ac_hdr in kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
+for ac_hdr in linux/version.h kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3050: checking for $ac_hdr" >&5
+echo "configure:3001: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3053 "configure"
+#line 3004 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3084,10 +3035,10 @@ fi
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:3088: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:3039: checking for sys/wait.h that is POSIX.1 compatible" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3091 "configure"
+#line 3042 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -3103,7 +3054,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:3107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -3127,10 +3078,10 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3131: checking for ANSI C header files" >&5
+echo "configure:3082: checking for ANSI C header files" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3134 "configure"
+#line 3085 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3138,7 +3089,7 @@ cat > conftest.$ac_ext <<EOF
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3155,7 +3106,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3159 "configure"
+#line 3110 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -3173,7 +3124,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3177 "configure"
+#line 3128 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -3191,7 +3142,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 cat > conftest.$ac_ext <<EOF
-#line 3195 "configure"
+#line 3146 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3202,11 +3153,10 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:3157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   :
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3228,10 +3178,10 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3232: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3182: checking whether time.h and sys/time.h may both be included" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3235 "configure"
+#line 3185 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3240,7 +3190,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3264,10 +3214,10 @@ EOF
 fi
 
 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:3268: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo "configure:3218: checking for sys_siglist declaration in signal.h or unistd.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3271 "configure"
+#line 3221 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3279,7 +3229,7 @@ int main() {
 char *msg = *(sys_siglist + 1);
 ; return 0; }
 EOF
-if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_siglist=yes
 else
@@ -3304,9 +3254,9 @@ fi
 
 
 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
-echo "configure:3308: checking for struct utimbuf" >&5
+echo "configure:3258: checking for struct utimbuf" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3310 "configure"
+#line 3260 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3325,7 +3275,7 @@ int main() {
 static struct utimbuf x; x.actime = x.modtime;
 ; return 0; }
 EOF
-if { (eval echo configure:3329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -3345,10 +3295,10 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3349: checking return type of signal handlers" >&5
+echo "configure:3299: checking return type of signal handlers" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3352 "configure"
+#line 3302 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3365,7 +3315,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3387,10 +3337,10 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3391: checking for size_t" >&5
+echo "configure:3341: checking for size_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3394 "configure"
+#line 3344 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3421,10 +3371,10 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3425: checking for pid_t" >&5
+echo "configure:3375: checking for pid_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3428 "configure"
+#line 3378 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3455,10 +3405,10 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3459: checking for uid_t in sys/types.h" >&5
+echo "configure:3409: checking for uid_t in sys/types.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3462 "configure"
+#line 3412 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3494,10 +3444,10 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3498: checking for mode_t" >&5
+echo "configure:3448: checking for mode_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3501 "configure"
+#line 3451 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3528,10 +3478,10 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3532: checking for off_t" >&5
+echo "configure:3482: checking for off_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3535 "configure"
+#line 3485 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3563,9 +3513,9 @@ fi
 
 
 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
-echo "configure:3567: checking for struct timeval" >&5
+echo "configure:3517: checking for struct timeval" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3569 "configure"
+#line 3519 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3581,7 +3531,7 @@ int main() {
 static struct timeval x; x.tv_sec = x.tv_usec;
 ; return 0; }
 EOF
-if { (eval echo configure:3585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
   HAVE_TIMEVAL=yes
@@ -3603,10 +3553,10 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3607: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3557: checking whether struct tm is in sys/time.h or time.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3610 "configure"
+#line 3560 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3614,7 +3564,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3638,10 +3588,10 @@ EOF
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3642: checking for tm_zone in struct tm" >&5
+echo "configure:3592: checking for tm_zone in struct tm" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3645 "configure"
+#line 3595 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3649,7 +3599,7 @@ int main() {
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3672,10 +3622,10 @@ EOF
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3676: checking for tzname" >&5
+echo "configure:3626: checking for tzname" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3679 "configure"
+#line 3629 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3685,7 +3635,7 @@ int main() {
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3711,10 +3661,10 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3715: checking for working const" >&5
+echo "configure:3665: checking for working const" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3718 "configure"
+#line 3668 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3763,7 +3713,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3788,7 +3738,7 @@ fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:3792: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:3742: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 
 cat > conftestmake <<\EOF
@@ -3813,12 +3763,12 @@ fi
 
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3817: checking whether byte ordering is bigendian" >&5
+echo "configure:3767: checking whether byte ordering is bigendian" >&5
 
 ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3822 "configure"
+#line 3772 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3829,11 +3779,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3837 "configure"
+#line 3787 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3844,7 +3794,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3861,7 +3811,7 @@ fi
 rm -f conftest*
 if test $ac_cv_c_bigendian = unknown; then
 cat > conftest.$ac_ext <<EOF
-#line 3865 "configure"
+#line 3815 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3874,11 +3824,10 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:3828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_bigendian=no
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3901,10 +3850,10 @@ fi
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:3905: checking size of short" >&5
+echo "configure:3854: checking size of short" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3908 "configure"
+#line 3857 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3915,11 +3864,10 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:3868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3943,10 +3891,10 @@ if test "$ac_cv_sizeof_short" = 0; then
   exit 1
 fi
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3947: checking size of int" >&5
+echo "configure:3895: checking size of int" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3950 "configure"
+#line 3898 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3957,11 +3905,10 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:3909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -3979,10 +3926,10 @@ EOF
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3983: checking size of long" >&5
+echo "configure:3930: checking size of long" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3986 "configure"
+#line 3933 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3993,11 +3940,10 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:3997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:3944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -4015,10 +3961,10 @@ EOF
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:4019: checking size of long long" >&5
+echo "configure:3965: checking size of long long" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4022 "configure"
+#line 3968 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4029,11 +3975,10 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:3979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -4051,10 +3996,10 @@ EOF
 
 
 echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:4055: checking size of void *" >&5
+echo "configure:4000: checking size of void *" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4058 "configure"
+#line 4003 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4065,11 +4010,10 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_void_p=`cat conftestval`
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -4088,7 +4032,7 @@ EOF
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:4092: checking for long file names" >&5
+echo "configure:4036: checking for long file names" >&5
 
 ac_cv_sys_long_file_names=yes
 # Test for long file names in all the places we know might matter:
@@ -4135,12 +4079,12 @@ fi
 
 
 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:4139: checking for sin in -lm" >&5
+echo "configure:4083: checking for sin in -lm" >&5
 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lm "
 cat > conftest.$ac_ext <<EOF
-#line 4144 "configure"
+#line 4088 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4151,7 +4095,7 @@ int main() {
 sin()
 ; return 0; }
 EOF
-if { (eval echo configure:4155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4193,14 +4137,14 @@ EOF
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4197 "configure"
+#line 4141 "configure"
 #include "confdefs.h"
 #include <math.h>
 int main() {
 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
 ; return 0; }
 EOF
-if { (eval echo configure:4204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_INVERSE_HYPERBOLIC
@@ -4217,7 +4161,7 @@ fi
 rm -f conftest*
 
 echo "checking type of mail spool file locking" 1>&6
-echo "configure:4221: checking type of mail spool file locking" >&5
+echo "configure:4165: checking type of mail spool file locking" >&5
 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
@@ -4241,12 +4185,12 @@ fi
 
 
 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
-echo "configure:4245: checking for kstat_open in -lkstat" >&5
+echo "configure:4189: checking for kstat_open in -lkstat" >&5
 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lkstat "
 cat > conftest.$ac_ext <<EOF
-#line 4250 "configure"
+#line 4194 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4257,7 +4201,7 @@ int main() {
 kstat_open()
 ; return 0; }
 EOF
-if { (eval echo configure:4261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4291,12 +4235,12 @@ fi
 
 
 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
-echo "configure:4295: checking for kvm_read in -lkvm" >&5
+echo "configure:4239: checking for kvm_read in -lkvm" >&5
 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lkvm "
 cat > conftest.$ac_ext <<EOF
-#line 4300 "configure"
+#line 4244 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4307,7 +4251,7 @@ int main() {
 kvm_read()
 ; return 0; }
 EOF
-if { (eval echo configure:4311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4342,12 +4286,12 @@ fi
 case "$opsys" in decosf*)
   
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:4346: checking for cma_open in -lpthreads" >&5
+echo "configure:4290: checking for cma_open in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpthreads "
 cat > conftest.$ac_ext <<EOF
-#line 4351 "configure"
+#line 4295 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4358,7 +4302,7 @@ int main() {
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:4362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4394,7 +4338,7 @@ fi
 esac
 
 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
-echo "configure:4398: checking whether the -xildoff compiler flag is required" >&5
+echo "configure:4342: checking whether the -xildoff compiler flag is required" >&5
 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
     then echo "$ac_t""no" 1>&6;
@@ -4405,7 +4349,7 @@ fi
 
 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
-echo "configure:4409: checking for \"-z ignore\" linker flag" >&5
+echo "configure:4353: checking for \"-z ignore\" linker flag" >&5
   case "`ld -h 2>&1`" in
     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
@@ -4415,7 +4359,7 @@ fi
 
 
 echo "checking "for specified window system"" 1>&6
-echo "configure:4419: checking "for specified window system"" >&5
+echo "configure:4363: checking "for specified window system"" >&5
 
 if test "$with_x11" != "no"; then
     test "$x_includes $x_libraries" != "NONE NONE" && \
@@ -4448,7 +4392,7 @@ if test "$with_x11" != "no"; then
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:4452: checking for X" >&5
+echo "configure:4396: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4508,12 +4452,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4512 "configure"
+#line 4456 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4582,14 +4526,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4586 "configure"
+#line 4530 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -4698,17 +4642,17 @@ else
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:4702: checking whether -R must be followed by a space" >&5
+echo "configure:4646: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 4705 "configure"
+#line 4649 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4724,14 +4668,14 @@ rm -f conftest*
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 4728 "configure"
+#line 4672 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4767,12 +4711,12 @@ ac_cv_lib_dnet_dnet_ntoa=no
 else
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:4771: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:4715: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet "
 cat > conftest.$ac_ext <<EOF
-#line 4776 "configure"
+#line 4720 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4783,7 +4727,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4807,12 +4751,12 @@ fi
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       
 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:4811: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:4755: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet_stub "
 cat > conftest.$ac_ext <<EOF
-#line 4816 "configure"
+#line 4760 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4823,7 +4767,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4852,10 +4796,10 @@ fi
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:4856: checking for gethostbyname" >&5
+echo "configure:4800: checking for gethostbyname" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4859 "configure"
+#line 4803 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4878,7 +4822,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -4899,12 +4843,12 @@ fi
     if test $ac_cv_func_gethostbyname = no; then
       
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4903: checking for gethostbyname in -lnsl" >&5
+echo "configure:4847: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lnsl "
 cat > conftest.$ac_ext <<EOF
-#line 4908 "configure"
+#line 4852 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4915,7 +4859,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4945,10 +4889,10 @@ fi
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:4949: checking for connect" >&5
+echo "configure:4893: checking for connect" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4952 "configure"
+#line 4896 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4971,7 +4915,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -4994,12 +4938,12 @@ fi
 xe_msg_checking="for connect in -lsocket"
 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:4998: checking "$xe_msg_checking"" >&5
+echo "configure:4942: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5003 "configure"
+#line 4947 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5010,7 +4954,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5034,10 +4978,10 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:5038: checking for remove" >&5
+echo "configure:4982: checking for remove" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5041 "configure"
+#line 4985 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -5060,7 +5004,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -5081,12 +5025,12 @@ fi
     if test $ac_cv_func_remove = no; then
       
 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:5085: checking for remove in -lposix" >&5
+echo "configure:5029: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lposix "
 cat > conftest.$ac_ext <<EOF
-#line 5090 "configure"
+#line 5034 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5097,7 +5041,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:5101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5121,10 +5065,10 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:5125: checking for shmat" >&5
+echo "configure:5069: checking for shmat" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5128 "configure"
+#line 5072 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -5147,7 +5091,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -5168,12 +5112,12 @@ fi
     if test $ac_cv_func_shmat = no; then
       
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:5172: checking for shmat in -lipc" >&5
+echo "configure:5116: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lipc "
 cat > conftest.$ac_ext <<EOF
-#line 5177 "configure"
+#line 5121 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5184,7 +5128,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:5188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5218,12 +5162,12 @@ fi
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   
 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:5222: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:5166: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lICE "
 cat > conftest.$ac_ext <<EOF
-#line 5227 "configure"
+#line 5171 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5234,7 +5178,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5309,8 +5253,6 @@ EOF
       break;     fi
   done
 
-    if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi
-
   ld_switch_x_site="$X_LIBS"
 
   
@@ -5362,8 +5304,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_run; shift; ld_switch_run=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
+      -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
     esac
@@ -5403,7 +5345,7 @@ EOF
 
 
     echo "checking for X defines extracted by xmkmf" 1>&6
-echo "configure:5407: checking for X defines extracted by xmkmf" >&5
+echo "configure:5349: checking for X defines extracted by xmkmf" >&5
   rm -fr conftestdir
   if mkdir conftestdir; then
     cd conftestdir
@@ -5435,15 +5377,15 @@ EOF
 
     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
-echo "configure:5439: checking for X11/Intrinsic.h" >&5
+echo "configure:5381: checking for X11/Intrinsic.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5442 "configure"
+#line 5384 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5467,12 +5409,12 @@ fi
 
       
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:5471: checking for XOpenDisplay in -lX11" >&5
+echo "configure:5413: checking for XOpenDisplay in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 5476 "configure"
+#line 5418 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5483,7 +5425,7 @@ int main() {
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5508,12 +5450,12 @@ fi
 xe_msg_checking="for XGetFontProperty in -lX11"
 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:5512: checking "$xe_msg_checking"" >&5
+echo "configure:5454: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 -b i486-linuxaout"
 cat > conftest.$ac_ext <<EOF
-#line 5517 "configure"
+#line 5459 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5524,7 +5466,7 @@ int main() {
 XGetFontProperty()
 ; return 0; }
 EOF
-if { (eval echo configure:5528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5551,12 +5493,12 @@ fi
 
     
 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
-echo "configure:5555: checking for XShapeSelectInput in -lXext" >&5
+echo "configure:5497: checking for XShapeSelectInput in -lXext" >&5
 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXext "
 cat > conftest.$ac_ext <<EOF
-#line 5560 "configure"
+#line 5502 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5567,7 +5509,7 @@ int main() {
 XShapeSelectInput()
 ; return 0; }
 EOF
-if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5590,12 +5532,12 @@ fi
 
     
 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
-echo "configure:5594: checking for XtOpenDisplay in -lXt" >&5
+echo "configure:5536: checking for XtOpenDisplay in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXt "
 cat > conftest.$ac_ext <<EOF
-#line 5599 "configure"
+#line 5541 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5606,7 +5548,7 @@ int main() {
 XtOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5629,18 +5571,17 @@ fi
 
 
   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
-echo "configure:5633: checking the version of X11 being used" >&5
+echo "configure:5575: checking the version of X11 being used" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5635 "configure"
+#line 5577 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
 EOF
-if { (eval echo configure:5640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:5582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest foobar; x11_release=$?
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -5661,15 +5602,15 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5665: checking for $ac_hdr" >&5
+echo "configure:5606: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5668 "configure"
+#line 5609 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5700,7 +5641,7 @@ done
 
 
     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
-echo "configure:5704: checking for XFree86" >&5
+echo "configure:5645: checking for XFree86" >&5
   if test -d "/usr/X386/include" -o \
           -f "/etc/XF86Config"    -o \
          -f "/etc/X11/XF86Config" -o \
@@ -5720,12 +5661,12 @@ EOF
 
     test -z "$with_xmu" && { 
 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
-echo "configure:5724: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
+echo "configure:5665: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXmu "
 cat > conftest.$ac_ext <<EOF
-#line 5729 "configure"
+#line 5670 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5736,7 +5677,7 @@ int main() {
 XmuReadBitmapDataFromFile()
 ; return 0; }
 EOF
-if { (eval echo configure:5740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5775,19 +5716,19 @@ EOF
 
       
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:5779: checking for main in -lXbsd" >&5
+echo "configure:5720: checking for main in -lXbsd" >&5
 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXbsd "
 cat > conftest.$ac_ext <<EOF
-#line 5784 "configure"
+#line 5725 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5824,22 +5765,22 @@ fi
 fi 
 if test "$with_msw" != "no"; then
   echo "checking for MS-Windows" 1>&6
-echo "configure:5828: checking for MS-Windows" >&5
+echo "configure:5769: checking for MS-Windows" >&5
   
 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
-echo "configure:5831: checking for main in -lgdi32" >&5
+echo "configure:5772: checking for main in -lgdi32" >&5
 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgdi32 "
 cat > conftest.$ac_ext <<EOF
-#line 5836 "configure"
+#line 5777 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5870,7 +5811,6 @@ EOF
 
     install_pp="$blddir/lib-src/installexe.sh"
     libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomctl32" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lshell32 -lgdi32 -luser32 -lcomctl32\" to \$libs_system"; fi
-    test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"msw\" to \$dragndrop_proto"; fi
     if test "$window_system" != x11; then
        window_system=msw
        test "$with_scrollbars" != "no" && with_scrollbars=msw \
@@ -5890,7 +5830,7 @@ EOF
    echo "    xemacs will be linked with \"dialog-msw.o\""
  fi
     else
-       test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
+       test "$with_scrollbars"   != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"scrollbar-msw.o\""
  fi
        test "$with_menubars"   != "no" && extra_objs="$extra_objs menubar-msw.o" &&  if test "$extra_verbose" = "yes"; then
@@ -5899,17 +5839,17 @@ EOF
        test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"toolbar-msw.o\""
  fi
-       test "$with_dialogs"    != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
+       test "$with_dialogs"   != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"dialog-msw.o\""
  fi
     fi
         cat > conftest.$ac_ext <<EOF
-#line 5908 "configure"
+#line 5848 "configure"
 #include "confdefs.h"
 #include <fcntl.h>
     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
 EOF
-if { (eval echo configure:5913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:5853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MSG_SELECT
@@ -5920,7 +5860,6 @@ EOF
 }
 
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
 fi
@@ -5929,8 +5868,8 @@ rm -fr conftest*
     with_file_coding=yes
     use_minimal_tagbits=yes
     use_indexed_lrecord_implementation=yes
-    extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o\""
+    extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o\""
  fi
   fi
 fi
@@ -5940,7 +5879,7 @@ fi
 test -z "$window_system" && window_system="none"
 
 if test "$window_system" = "none"; then
-  for feature in menubars scrollbars toolbars dialogs dragndrop xface
+  for feature in menubars scrollbars toolbars dialogs dragndrop
   do
     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
        echo "configure: warning: --with-$feature ignored:  Not valid without window system support" 1>&2
@@ -5964,7 +5903,8 @@ else
 fi
 
 if test "$with_x11" != "yes"; then
-            for feature in tooltalk cde offix session xim xmu 
+            for feature in tooltalk cde offix session xim xmu \
+                 xface
   do
     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
        echo "configure: warning: --with-$feature ignored:  Not valid without X support" 1>&2
@@ -5987,7 +5927,7 @@ case "$x_libraries" in *X11R4* )
 esac
 
 echo "checking for session-management option" 1>&6
-echo "configure:5991: checking for session-management option" >&5;
+echo "configure:5931: checking for session-management option" >&5;
 if test "$with_session" != "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SESSION
@@ -6002,15 +5942,15 @@ fi
 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
-echo "configure:6006: checking for X11/Xauth.h" >&5
+echo "configure:5946: checking for X11/Xauth.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6009 "configure"
+#line 5949 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6033,12 +5973,12 @@ fi
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:6037: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:5977: checking for XauGetAuthByAddr in -lXau" >&5
 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXau "
 cat > conftest.$ac_ext <<EOF
-#line 6042 "configure"
+#line 5982 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6049,7 +5989,7 @@ int main() {
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:6053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6094,15 +6034,15 @@ if test "$with_tooltalk" != "no" ; then
       for dir in "" "Tt/" "desktop/" ; do
     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
-echo "configure:6098: checking for ${dir}tt_c.h" >&5
+echo "configure:6038: checking for ${dir}tt_c.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6101 "configure"
+#line 6041 "configure"
 #include "confdefs.h"
 #include <${dir}tt_c.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6138,12 +6078,12 @@ if test "$with_tooltalk" != "no" ; then
 xe_msg_checking="for tt_message_create in -ltt"
 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:6142: checking "$xe_msg_checking"" >&5
+echo "configure:6082: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltt $extra_libs"
 cat > conftest.$ac_ext <<EOF
-#line 6147 "configure"
+#line 6087 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6154,7 +6094,7 @@ int main() {
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:6158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6211,15 +6151,15 @@ fi
 
 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
-echo "configure:6215: checking for Dt/Dt.h" >&5
+echo "configure:6155: checking for Dt/Dt.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6218 "configure"
+#line 6158 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6242,12 +6182,12 @@ fi
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:6246: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:6186: checking for DtDndDragStart in -lDtSvc" >&5
 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lDtSvc "
 cat > conftest.$ac_ext <<EOF
-#line 6251 "configure"
+#line 6191 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6258,7 +6198,7 @@ int main() {
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:6262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6327,7 +6267,7 @@ EOF
 fi
 
 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
-echo "configure:6331: checking if drag and drop API is needed" >&5
+echo "configure:6271: checking if drag and drop API is needed" >&5
 if test "$with_dragndrop" != "no" ; then
   if test -n "$dragndrop_proto" ; then
     with_dragndrop=yes
@@ -6348,18 +6288,18 @@ EOF
 fi
 
 echo "checking for LDAP" 1>&6
-echo "configure:6352: checking for LDAP" >&5
+echo "configure:6292: checking for LDAP" >&5
 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
-echo "configure:6355: checking for ldap.h" >&5
+echo "configure:6295: checking for ldap.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6358 "configure"
+#line 6298 "configure"
 #include "confdefs.h"
 #include <ldap.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6382,15 +6322,15 @@ fi
  }
 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
-echo "configure:6386: checking for lber.h" >&5
+echo "configure:6326: checking for lber.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6389 "configure"
+#line 6329 "configure"
 #include "confdefs.h"
 #include <lber.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6416,12 +6356,12 @@ if test "$with_ldap" != "no"; then
 xe_msg_checking="for ldap_open in -lldap"
 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:6420: checking "$xe_msg_checking"" >&5
+echo "configure:6360: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap -llber"
 cat > conftest.$ac_ext <<EOF
-#line 6425 "configure"
+#line 6365 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6432,7 +6372,7 @@ int main() {
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:6436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6455,12 +6395,12 @@ fi
  }
   test "$with_umich_ldap" = "no" && { 
 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
-echo "configure:6459: checking for ldap_set_option in -lldap10" >&5
+echo "configure:6399: checking for ldap_set_option in -lldap10" >&5
 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap10 "
 cat > conftest.$ac_ext <<EOF
-#line 6464 "configure"
+#line 6404 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6471,7 +6411,7 @@ int main() {
 ldap_set_option()
 ; return 0; }
 EOF
-if { (eval echo configure:6475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6535,15 +6475,14 @@ fi
 
 if test "$window_system" != "none"; then
   echo "checking for graphics libraries" 1>&6
-echo "configure:6539: checking for graphics libraries" >&5
+echo "configure:6479: checking for graphics libraries" >&5
 
-    xpm_problem=""
-  if test -z "$with_xpm"; then
+    if test -z "$with_xpm"; then
     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:6544: checking for Xpm - no older than 3.4f" >&5
+echo "configure:6483: checking for Xpm - no older than 3.4f" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 6547 "configure"
+#line 6486 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
     int main(int c, char **v) {
@@ -6551,28 +6490,27 @@ echo "configure:6544: checking for Xpm - no older than 3.4f" >&5
       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
       XpmIncludeVersion < 30406 ? 2 : 0 ;}
 EOF
-if { (eval echo configure:6555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest dummy_arg; xpm_status=$?;
-      if test "$xpm_status" = "0"; then
+      if test "$?" = "0"; then
         with_xpm=yes;
       else
         with_xpm=no;
-        if test "$xpm_status" = "1"; then
+        if test "$?" = "1"; then
           xpm_problem="Xpm library version and header file version don't match!"
-        elif test "$xpm_status" = "2"; then
+        elif test "$?" = "2"; then
           xpm_problem="Xpm library version is too old!"
         else
           xpm_problem="Internal xpm detection logic error!"
         fi
         echo "
-*** WARNING *** $xpm_problem
+*** WARNING *** $problem
   I'm not touching that with a 10-foot pole!
   If you really want to use the installed version of Xpm, rerun
-  configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
+  configure --with-xpm=yes, but don't blame me if XEmacs crashes!"
     fi
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -6593,17 +6531,17 @@ EOF
 
     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
-echo "configure:6597: checking for \"FOR_MSW\" xpm" >&5
+echo "configure:6535: checking for \"FOR_MSW\" xpm" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 6600 "configure"
+#line 6538 "configure"
 #include "confdefs.h"
 
 int main() {
 XpmCreatePixmapFromData()
 ; return 0; }
 EOF
-if { (eval echo configure:6607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   xpm_for_msw=no
 else
@@ -6627,56 +6565,61 @@ EOF
     fi
   fi
 
-    test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for compface.h""... $ac_c" 1>&6
-echo "configure:6633: checking for compface.h" >&5
+      if test "$with_png $with_tiff" != "no no"; then
+    
+echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
+echo "configure:6572: checking for inflate in -lc" >&5
+ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
 
+xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 6636 "configure"
+#line 6577 "configure"
 #include "confdefs.h"
-#include <compface.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char inflate();
+
+int main() {
+inflate()
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
+if { (eval echo configure:6588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
-with_xface=no
-fi
- }
-  test -z "$with_xface" && { 
-echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:6664: checking for UnGenFace in -lcompface" >&5
-ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
 
-xe_check_libs=" -lcompface "
+echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
+echo "configure:6607: checking for inflate in -lz" >&5
+ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lz "
 cat > conftest.$ac_ext <<EOF
-#line 6669 "configure"
+#line 6612 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char UnGenFace();
+char inflate();
 
 int main() {
-UnGenFace()
+inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6690,50 +6633,17 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  : 
+  libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
 else
   echo "$ac_t""no" 1>&6
-with_xface=no
-fi
-
- }
-  test -z "$with_xface" && with_xface=yes
-  if test "$with_xface" = "yes"; then
-    { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_XFACE
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_XFACE 1
-EOF
-}
-
-    libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
-  fi
-
-        if test "$with_gif" != "no"; then
-    with_gif="yes"
-    { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_GIF
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_GIF 1
-EOF
-}
-
-    extra_objs="$extra_objs dgif_lib.o gif_io.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"dgif_lib.o gif_io.o\""
- fi
-  fi
 
-      if test "$with_png $with_tiff" != "no no"; then
-    
-echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
-echo "configure:6732: checking for inflate in -lc" >&5
-ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
+echo "configure:6642: checking for inflate in -lgz" >&5
+ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
 
-xe_check_libs=" -lc "
+xe_check_libs=" -lgz "
 cat > conftest.$ac_ext <<EOF
-#line 6737 "configure"
+#line 6647 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6744,7 +6654,7 @@ int main() {
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:6748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6758,63 +6668,72 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  :
+  libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
 else
   echo "$ac_t""no" 1>&6
+fi
 
-echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
-echo "configure:6767: checking for inflate in -lz" >&5
-ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
 
-xe_check_libs=" -lz "
+fi
+
+
+fi
+
+
+  fi
+
+    echo $ac_n "checking for gifreader""... $ac_c" 1>&6
+echo "configure:6687: checking for gifreader" >&5
+  test -z "$with_gif" && { ac_safe=`echo "gifrlib.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for gifrlib.h""... $ac_c" 1>&6
+echo "configure:6690: checking for gifrlib.h" >&5
+
 cat > conftest.$ac_ext <<EOF
-#line 6772 "configure"
+#line 6693 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char inflate();
-
-int main() {
-inflate()
-; return 0; }
+#include <gifrlib.h>
 EOF
-if { (eval echo configure:6783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_header_$ac_safe=yes"
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  libs_x="-lz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lz\" to \$libs_x"; fi
+  :
 else
   echo "$ac_t""no" 1>&6
+with_gif=no
+fi
+ }
+  test -z "$with_gif" && { 
+echo $ac_n "checking for GetGifError in -lgifreader""... $ac_c" 1>&6
+echo "configure:6721: checking for GetGifError in -lgifreader" >&5
+ac_lib_var=`echo gifreader'_'GetGifError | sed 'y%./+-%__p_%'`
 
-echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
-echo "configure:6802: checking for inflate in -lgz" >&5
-ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
-
-xe_check_libs=" -lgz "
+xe_check_libs=" -lgifreader "
 cat > conftest.$ac_ext <<EOF
-#line 6807 "configure"
+#line 6726 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char inflate();
+char GetGifError();
 
 int main() {
-inflate()
+GetGifError()
 ; return 0; }
 EOF
-if { (eval echo configure:6818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6828,31 +6747,37 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  libs_x="-lgz $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgz\" to \$libs_x"; fi
+  : 
 else
   echo "$ac_t""no" 1>&6
+with_gif=no
 fi
 
+ }
+  test -z "$with_gif" && with_gif=yes
+  if test "$with_gif" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_GIF
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_GIF 1
+EOF
+}
 
-fi
-
-
-fi
-
-
+    libs_x="-lgifreader $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgifreader\" to \$libs_x"; fi
   fi
 
     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
-echo "configure:6848: checking for jpeglib.h" >&5
+echo "configure:6773: checking for jpeglib.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6851 "configure"
+#line 6776 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6875,12 +6800,12 @@ fi
  }
   test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:6879: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:6804: checking for jpeg_destroy_decompress in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ljpeg "
 cat > conftest.$ac_ext <<EOF
-#line 6884 "configure"
+#line 6809 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6891,7 +6816,7 @@ int main() {
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:6895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6925,12 +6850,34 @@ EOF
     libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
   fi
 
-    png_problem=""
+    if test -z "$with_png"; then
+    echo $ac_n "checking for png.h - no older than 0.96""... $ac_c" 1>&6
+echo "configure:6856: checking for png.h - no older than 0.96" >&5
+    cat > conftest.$ac_ext <<EOF
+#line 6858 "configure"
+#include "confdefs.h"
+#include <png.h>
+#if PNG_LIBPNG_VER >= 96
+yes
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+else
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6; with_png=no
+fi
+rm -f conftest*
+
+  fi
   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:6931: checking for pow" >&5
+echo "configure:6878: checking for pow" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6934 "configure"
+#line 6881 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -6953,7 +6900,7 @@ pow();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -6972,45 +6919,14 @@ else
 with_png=no
 fi
  }
-  test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for png.h""... $ac_c" 1>&6
-echo "configure:6978: checking for png.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6981 "configure"
-#include "confdefs.h"
-#include <png.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-with_png=no
-fi
- }
   test -z "$with_png" && { 
 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
-echo "configure:7009: checking for png_read_image in -lpng" >&5
+echo "configure:6925: checking for png_read_image in -lpng" >&5
 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpng "
 cat > conftest.$ac_ext <<EOF
-#line 7014 "configure"
+#line 6930 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7021,7 +6937,7 @@ int main() {
 png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:7025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7042,48 +6958,7 @@ with_png=no
 fi
 
  }
-  if test -z "$with_png"; then
-    echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
-echo "configure:7048: checking for workable png version information" >&5
-    xe_check_libs="-lpng -lz"
-    cat > conftest.$ac_ext <<EOF
-#line 7051 "configure"
-#include "confdefs.h"
-#include <png.h>
-    int main(int c, char **v) {
-    if (c == 1) return 0;
-    if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
-    return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
-EOF
-if { (eval echo configure:7059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
-then
-  ./conftest dummy_arg; png_status=$?;
-      if test "$png_status" = "0"; then
-       with_png=yes;
-      else
-       with_png=no;
-       if test "$png_status" = "1"; then
-         png_problem="PNG library version and header file don't match!"
-        elif test "$png_status" = "2"; then
-         png_problem="PNG library version too old (pre 1.0.2)!"
-       fi
-       echo "
-*** WARNING *** $png_problem
-  I'm not touching that with a 10-foot pole!
-  If you really want to use the installed version of libPNG, rerun
-  configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
-    fi
-else
-  conftest_rc="$?"
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  with_png=no
-fi
-rm -fr conftest*
-    xe_check_libs=
-    echo "$ac_t""$with_png" 1>&6
-  fi
+  test -z "$with_png" && with_png=yes
   if test "$with_png" = "yes"; then
     { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_PNG
@@ -7098,15 +6973,15 @@ EOF
 
     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
-echo "configure:7102: checking for tiffio.h" >&5
+echo "configure:6977: checking for tiffio.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7105 "configure"
+#line 6980 "configure"
 #include "confdefs.h"
 #include <tiffio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7129,12 +7004,12 @@ fi
  }
   test -z "$with_tiff" && { 
 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
-echo "configure:7133: checking for TIFFClientOpen in -ltiff" >&5
+echo "configure:7008: checking for TIFFClientOpen in -ltiff" >&5
 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltiff "
 cat > conftest.$ac_ext <<EOF
-#line 7138 "configure"
+#line 7013 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7145,7 +7020,7 @@ int main() {
 TIFFClientOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:7149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7184,16 +7059,99 @@ fi
 if test "$with_x11" = "yes"; then
 
   echo "checking for X11 graphics libraries" 1>&6
-echo "configure:7188: checking for X11 graphics libraries" >&5
+echo "configure:7063: checking for X11 graphics libraries" >&5
+
+    test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for compface.h""... $ac_c" 1>&6
+echo "configure:7067: checking for compface.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7070 "configure"
+#include "confdefs.h"
+#include <compface.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+with_xface=no
+fi
+ }
+  test -z "$with_xface" && { 
+echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
+echo "configure:7098: checking for UnGenFace in -lcompface" >&5
+ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lcompface "
+cat > conftest.$ac_ext <<EOF
+#line 7103 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char UnGenFace();
+
+int main() {
+UnGenFace()
+; return 0; }
+EOF
+if { (eval echo configure:7114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+  : 
+else
+  echo "$ac_t""no" 1>&6
+with_xface=no
+fi
+
+ }
+  test -z "$with_xface" && with_xface=yes
+  if test "$with_xface" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_XFACE
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_XFACE 1
+EOF
+}
+
+    libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
+  fi
 
     
 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
-echo "configure:7192: checking for XawScrollbarSetThumb in -lXaw" >&5
+echo "configure:7150: checking for XawScrollbarSetThumb in -lXaw" >&5
 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXaw "
 cat > conftest.$ac_ext <<EOF
-#line 7197 "configure"
+#line 7155 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7204,7 +7162,7 @@ int main() {
 XawScrollbarSetThumb()
 ; return 0; }
 EOF
-if { (eval echo configure:7208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7228,15 +7186,15 @@ fi
                     
     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:7232: checking for Xm/Xm.h" >&5
+echo "configure:7190: checking for Xm/Xm.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7235 "configure"
+#line 7193 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7253,12 +7211,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:7257: checking for XmStringFree in -lXm" >&5
+echo "configure:7215: checking for XmStringFree in -lXm" >&5
 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXm "
 cat > conftest.$ac_ext <<EOF
-#line 7262 "configure"
+#line 7220 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7269,7 +7227,7 @@ int main() {
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:7273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7298,9 +7256,9 @@ fi
 
   if test "$have_motif" = "yes"; then
         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
-echo "configure:7302: checking for Lesstif" >&5
+echo "configure:7260: checking for Lesstif" >&5
     cat > conftest.$ac_ext <<EOF
-#line 7304 "configure"
+#line 7262 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 #ifdef LESSTIF_VERSION
@@ -7517,6 +7475,9 @@ test "$with_dialogs"    != "no"      && extra_objs="$extra_objs dialog.o" &&  if
 test "$with_toolbars"   != "no"      && extra_objs="$extra_objs toolbar.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"toolbar.o\""
  fi
+test "$all_widgets" != "no no no no" && extra_objs="$extra_objs gui.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"gui.o\""
+ fi
 
 if test "$with_x11" = "yes"; then
   test "$with_menubars"   != "no"      && extra_objs="$extra_objs menubar-x.o" &&  if test "$extra_verbose" = "yes"; then
@@ -7581,7 +7542,7 @@ fi
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:7585: checking for Mule-related features" >&5
+echo "configure:7546: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -7606,15 +7567,15 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7610: checking for $ac_hdr" >&5
+echo "configure:7571: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7613 "configure"
+#line 7574 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7645,12 +7606,12 @@ done
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:7649: checking for strerror in -lintl" >&5
+echo "configure:7610: checking for strerror in -lintl" >&5
 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lintl "
 cat > conftest.$ac_ext <<EOF
-#line 7654 "configure"
+#line 7615 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7661,7 +7622,7 @@ int main() {
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:7665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7694,19 +7655,19 @@ fi
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:7698: checking for Mule input methods" >&5
+echo "configure:7659: checking for Mule input methods" >&5
         case "$with_xim" in "" | "yes" )
     echo "checking for XIM" 1>&6
-echo "configure:7701: checking for XIM" >&5
+echo "configure:7662: checking for XIM" >&5
         if test "$have_lesstif" = "yes"; then with_xim=xlib
     else 
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:7705: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:7666: checking for XmImMbLookupString in -lXm" >&5
 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXm "
 cat > conftest.$ac_ext <<EOF
-#line 7710 "configure"
+#line 7671 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7717,7 +7678,7 @@ int main() {
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:7721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7783,15 +7744,15 @@ EOF
 
     if test "$with_xfs" = "yes" ; then
     echo "checking for XFontSet" 1>&6
-echo "configure:7787: checking for XFontSet" >&5
+echo "configure:7748: checking for XFontSet" >&5
     
 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
-echo "configure:7790: checking for XmbDrawString in -lX11" >&5
+echo "configure:7751: checking for XmbDrawString in -lX11" >&5
 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 7795 "configure"
+#line 7756 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7802,7 +7763,7 @@ int main() {
 XmbDrawString()
 ; return 0; }
 EOF
-if { (eval echo configure:7806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7842,15 +7803,15 @@ EOF
     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
-echo "configure:7846: checking for wnn/jllib.h" >&5
+echo "configure:7807: checking for wnn/jllib.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7849 "configure"
+#line 7810 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7875,10 +7836,10 @@ fi
     for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7879: checking for $ac_func" >&5
+echo "configure:7840: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7882 "configure"
+#line 7843 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7901,7 +7862,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7930,12 +7891,12 @@ done
 
     test "$ac_cv_func_crypt" != "yes" && { 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:7934: checking for crypt in -lcrypt" >&5
+echo "configure:7895: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcrypt "
 cat > conftest.$ac_ext <<EOF
-#line 7939 "configure"
+#line 7900 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7946,7 +7907,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:7950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7978,83 +7939,14 @@ fi
 
  }
   fi
-    if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
-    
+    test -z "$with_wnn" && { 
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:7985: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:7945: checking for jl_dic_list_e in -lwnn" >&5
 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn "
 cat > conftest.$ac_ext <<EOF
-#line 7990 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char jl_dic_list_e();
-
-int main() {
-jl_dic_list_e()
-; return 0; }
-EOF
-if { (eval echo configure:8001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
-  echo "$ac_t""yes" 1>&6
-  libwnn=wnn
-else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
-echo "configure:8019: checking for jl_dic_list_e in -lwnn4" >&5
-ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
-
-xe_check_libs=" -lwnn4 "
-cat > conftest.$ac_ext <<EOF
-#line 8024 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char jl_dic_list_e();
-
-int main() {
-jl_dic_list_e()
-; return 0; }
-EOF
-if { (eval echo configure:8035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
-  echo "$ac_t""yes" 1>&6
-  libwnn=wnn4
-else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
-echo "configure:8053: checking for jl_dic_list_e in -lwnn6" >&5
-ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
-
-xe_check_libs=" -lwnn6 "
-cat > conftest.$ac_ext <<EOF
-#line 8058 "configure"
+#line 7950 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8065,41 +7957,7 @@ int main() {
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:8069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-xe_check_libs=""
-
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
-  echo "$ac_t""yes" 1>&6
-  libwnn=wnn6
-else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
-echo "configure:8087: checking for dic_list_e in -lwnn6_fromsrc" >&5
-ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
-
-xe_check_libs=" -lwnn6_fromsrc "
-cat > conftest.$ac_ext <<EOF
-#line 8092 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dic_list_e();
-
-int main() {
-dic_list_e()
-; return 0; }
-EOF
-if { (eval echo configure:8103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8113,23 +7971,13 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  libwnn=wnn6_fromsrc
+  :
 else
   echo "$ac_t""no" 1>&6
 with_wnn=no
 fi
 
-
-fi
-
-
-fi
-
-
-fi
-
-
-  fi
+ }
   test -z "$with_wnn" && with_wnn=yes
   if test "$with_wnn" = "yes"; then
     { test "$extra_verbose" = "yes" && cat << \EOF
@@ -8140,19 +7988,19 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-    libs_x="-l$libwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l$libwnn\" to \$libs_x"; fi
+    libs_x="-lwnn $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lwnn\" to \$libs_x"; fi
     extra_objs="$extra_objs mule-wnnfns.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"mule-wnnfns.o\""
  fi
     if test "$with_wnn6" != "no"; then
       
-echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
-echo "configure:8151: checking for jl_fi_dic_list in -l$libwnn" >&5
-ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6
+echo "configure:7999: checking for jl_fi_dic_list in -lwnn" >&5
+ac_lib_var=`echo wnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
 
-xe_check_libs=" -l$libwnn "
+xe_check_libs=" -lwnn "
 cat > conftest.$ac_ext <<EOF
-#line 8156 "configure"
+#line 8004 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8163,7 +8011,7 @@ int main() {
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:8167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8198,15 +8046,15 @@ EOF
   if test "$with_canna" != "no"; then
     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
-echo "configure:8202: checking for canna/jrkanji.h" >&5
+echo "configure:8050: checking for canna/jrkanji.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8205 "configure"
+#line 8053 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8233,15 +8081,15 @@ fi
     c_switch_site="$c_switch_site -I/usr/local/canna/include"
     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
-echo "configure:8237: checking for canna/jrkanji.h" >&5
+echo "configure:8085: checking for canna/jrkanji.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8240 "configure"
+#line 8088 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8269,15 +8117,15 @@ fi
 
   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
-echo "configure:8273: checking for canna/RK.h" >&5
+echo "configure:8121: checking for canna/RK.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8276 "configure"
+#line 8124 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8300,12 +8148,12 @@ fi
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:8304: checking for RkBgnBun in -lRKC" >&5
+echo "configure:8152: checking for RkBgnBun in -lRKC" >&5
 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lRKC "
 cat > conftest.$ac_ext <<EOF
-#line 8309 "configure"
+#line 8157 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8316,7 +8164,7 @@ int main() {
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:8320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8339,12 +8187,12 @@ fi
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:8343: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:8191: checking for jrKanjiControl in -lcanna" >&5
 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcanna "
 cat > conftest.$ac_ext <<EOF
-#line 8348 "configure"
+#line 8196 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8355,7 +8203,7 @@ int main() {
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:8359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8404,12 +8252,12 @@ if test "$need_motif" = "yes" ; then
   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
     
 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
-echo "configure:8408: checking for layout_object_getvalue in -li18n" >&5
+echo "configure:8256: checking for layout_object_getvalue in -li18n" >&5
 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -li18n "
 cat > conftest.$ac_ext <<EOF
-#line 8413 "configure"
+#line 8261 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8420,7 +8268,7 @@ int main() {
 layout_object_getvalue()
 ; return 0; }
 EOF
-if { (eval echo configure:8424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8489,8 +8337,8 @@ if test "$GCC" = "yes"; then
   set x $ld_switch_run; shift; ld_switch_run=""
   while test -n "$1"; do
     case $1 in
-      -L  | -l  | -u               ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;;
+      -L  | -l  | -u         ) ld_switch_run="$ld_switch_run $1 $2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) ld_switch_run="$ld_switch_run $1" ;;
       -Xlinker* ) ;;
       * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;;
     esac
@@ -8506,10 +8354,10 @@ fi
 for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8510: checking for $ac_func" >&5
+echo "configure:8358: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8513 "configure"
+#line 8361 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8532,7 +8380,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8566,17 +8414,13 @@ case "$opsys" in
    echo "    xemacs will be linked with \"realpath.o\""
  fi ;;
   * )
-    case "$canonical" in
-      *-*-sysv4.2uw2* ) extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"realpath.o\""
- fi ;;
-      * ) for ac_func in realpath
+    for ac_func in realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8577: checking for $ac_func" >&5
+echo "configure:8421: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8580 "configure"
+#line 8424 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8599,7 +8443,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8626,23 +8470,22 @@ else
 fi
 done
 
-         test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
+    test "$ac_cv_func_realpath" != "yes" && extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"realpath.o\""
  fi ;;
-    esac ;;
 esac
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:8637: checking whether netdb declares h_errno" >&5
+echo "configure:8480: checking whether netdb declares h_errno" >&5
 cat > conftest.$ac_ext <<EOF
-#line 8639 "configure"
+#line 8482 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:8646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -8662,16 +8505,16 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:8666: checking for sigsetjmp" >&5
+echo "configure:8509: checking for sigsetjmp" >&5
 cat > conftest.$ac_ext <<EOF
-#line 8668 "configure"
+#line 8511 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:8675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -8691,11 +8534,11 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:8695: checking whether localtime caches TZ" >&5
+echo "configure:8538: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 8699 "configure"
+#line 8542 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -8730,11 +8573,10 @@ main()
   exit (0);
 }
 EOF
-if { (eval echo configure:8734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:8577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -8760,9 +8602,9 @@ fi
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
-echo "configure:8764: checking whether gettimeofday accepts one or two arguments" >&5
+echo "configure:8606: checking whether gettimeofday accepts one or two arguments" >&5
 cat > conftest.$ac_ext <<EOF
-#line 8766 "configure"
+#line 8608 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -8784,7 +8626,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""two" 1>&6
 else
@@ -8806,19 +8648,19 @@ fi
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:8810: checking for inline" >&5
+echo "configure:8652: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 8815 "configure"
+#line 8657 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:8822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -8868,17 +8710,17 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:8872: checking for working alloca.h" >&5
+echo "configure:8714: checking for working alloca.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8875 "configure"
+#line 8717 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:8882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -8902,10 +8744,10 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8906: checking for alloca" >&5
+echo "configure:8748: checking for alloca" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8909 "configure"
+#line 8751 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -8928,7 +8770,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:8932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -8967,10 +8809,10 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8971: checking whether alloca needs Cray hooks" >&5
+echo "configure:8813: checking whether alloca needs Cray hooks" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8974 "configure"
+#line 8816 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -8994,10 +8836,10 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8998: checking for $ac_func" >&5
+echo "configure:8840: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9001 "configure"
+#line 8843 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9020,7 +8862,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9050,10 +8892,10 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:9054: checking stack direction for C alloca" >&5
+echo "configure:8896: checking stack direction for C alloca" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9057 "configure"
+#line 8899 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -9072,11 +8914,10 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:9076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:8918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -9101,15 +8942,15 @@ test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbos
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:9105: checking for vfork.h" >&5
+echo "configure:8946: checking for vfork.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9108 "configure"
+#line 8949 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9137,10 +8978,10 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:9141: checking for working vfork" >&5
+echo "configure:8982: checking for working vfork" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9144 "configure"
+#line 8985 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -9235,11 +9076,10 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:9239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:9080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_vfork_works=yes
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -9261,10 +9101,10 @@ fi
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:9265: checking for working strcoll" >&5
+echo "configure:9105: checking for working strcoll" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9268 "configure"
+#line 9108 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -9274,11 +9114,10 @@ main ()
        strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:9278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:9118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -9302,10 +9141,10 @@ fi
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9306: checking for $ac_func" >&5
+echo "configure:9145: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9309 "configure"
+#line 9148 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9328,7 +9167,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9356,10 +9195,10 @@ fi
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:9360: checking whether getpgrp takes no argument" >&5
+echo "configure:9199: checking whether getpgrp takes no argument" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9363 "configure"
+#line 9202 "configure"
 #include "confdefs.h"
 
 /*
@@ -9414,11 +9253,10 @@ main()
 }
 
 EOF
-if { (eval echo configure:9418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:9257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -9441,10 +9279,10 @@ fi
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:9445: checking for working mmap" >&5
+echo "configure:9283: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 9448 "configure"
+#line 9286 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -9477,11 +9315,10 @@ int main (int argc, char *argv[])
   return 1;
 }
 EOF
-if { (eval echo configure:9481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:9319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   have_mmap=yes
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -9498,19 +9335,29 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-for ac_hdr in unistd.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9506: checking for $ac_hdr" >&5
+
+test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
+test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
+test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining REL_ALLOC
+EOF
+cat >> confdefs.h <<\EOF
+#define REL_ALLOC 1
+EOF
+}
+
+
+ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for termios.h""... $ac_c" 1>&6
+echo "configure:9353: checking for termios.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9509 "configure"
+#line 9356 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+#include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 rm -f conftest*
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  { test "$extra_verbose" = "yes" && cat << EOF
-    Defining $ac_tr_hdr
+  { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_TERMIOS
 EOF
-cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-}
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-for ac_func in getpagesize
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9546: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9549 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:9572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  { test "$extra_verbose" = "yes" && cat << EOF
-    Defining $ac_tr_func
-EOF
-cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-}
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:9600: checking for working mmap" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9603 "configure"
-#include "confdefs.h"
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
-   Here is a matrix of mmap possibilities:
-       mmap private not fixed
-       mmap private fixed at somewhere currently unmapped
-       mmap private fixed at somewhere already mapped
-       mmap shared not fixed
-       mmap shared fixed at somewhere currently unmapped
-       mmap shared fixed at somewhere already mapped
-   For private mappings, we should verify that changes cannot be read()
-   back from the file, nor mmap's back from the file at a different
-   address.  (There have been systems where private was not correctly
-   implemented like the infamous i386 svr4.0, and systems where the
-   VM page cache was not coherent with the filesystem buffer cache
-   like early versions of FreeBSD and possibly contemporary NetBSD.)
-   For shared mappings, we should conversely verify that changes get
-   propogated back to all the places they're supposed to be.
-
-   Grep wants private fixed already mapped.
-   The main things grep needs to know about mmap are:
-   * does it exist and is it safe to write into the mmap'd area
-   * how to use it (BSD variants)  */
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-
-/* This mess was copied from the GNU getpagesize.h.  */
-#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
-
-/* Assume that all systems that can run configure have sys/param.h.  */
-# ifndef HAVE_SYS_PARAM_H
-#  define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-#  define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-#  ifdef HAVE_SYS_PARAM_H
-#   include <sys/param.h>
-#   ifdef EXEC_PAGESIZE
-#    define getpagesize() EXEC_PAGESIZE
-#   else /* no EXEC_PAGESIZE */
-#    ifdef NBPG
-#     define getpagesize() NBPG * CLSIZE
-#     ifndef CLSIZE
-#      define CLSIZE 1
-#     endif /* no CLSIZE */
-#    else /* no NBPG */
-#     ifdef NBPC
-#      define getpagesize() NBPC
-#     else /* no NBPC */
-#      ifdef PAGESIZE
-#       define getpagesize() PAGESIZE
-#      endif /* PAGESIZE */
-#     endif /* no NBPC */
-#    endif /* no NBPG */
-#   endif /* no EXEC_PAGESIZE */
-#  else /* no HAVE_SYS_PARAM_H */
-#   define getpagesize() 8192  /* punt totally */
-#  endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
-int
-main()
-{
-       char *data, *data2, *data3;
-       int i, pagesize;
-       int fd;
-
-       pagesize = getpagesize();
-
-       /*
-        * First, make a file with some known garbage in it.
-        */
-       data = malloc(pagesize);
-       if (!data)
-               exit(1);
-       for (i = 0; i < pagesize; ++i)
-               *(data + i) = rand();
-       umask(0);
-       fd = creat("conftestmmap", 0600);
-       if (fd < 0)
-               exit(1);
-       if (write(fd, data, pagesize) != pagesize)
-               exit(1);
-       close(fd);
-
-       /*
-        * Next, try to mmap the file at a fixed address which
-        * already has something else allocated at it.  If we can,
-        * also make sure that we see the same garbage.
-        */
-       fd = open("conftestmmap", O_RDWR);
-       if (fd < 0)
-               exit(1);
-       data2 = malloc(2 * pagesize);
-       if (!data2)
-               exit(1);
-       data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
-       if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
-           MAP_PRIVATE | MAP_FIXED, fd, 0L))
-               exit(1);
-       for (i = 0; i < pagesize; ++i)
-               if (*(data + i) != *(data2 + i))
-                       exit(1);
-
-       /*
-        * Finally, make sure that changes to the mapped area
-        * do not percolate back to the file as seen by read().
-        * (This is a bug on some variants of i386 svr4.0.)
-        */
-       for (i = 0; i < pagesize; ++i)
-               *(data2 + i) = *(data2 + i) + 1;
-       data3 = malloc(pagesize);
-       if (!data3)
-               exit(1);
-       if (read(fd, data3, pagesize) != pagesize)
-               exit(1);
-       for (i = 0; i < pagesize; ++i)
-               if (*(data + i) != *(data3 + i))
-                       exit(1);
-       close(fd);
-       unlink("conftestmmap");
-       exit(0);
-}
-
-EOF
-if { (eval echo configure:9743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
-then
-  ac_cv_func_mmap_fixed_mapped=yes
-else
-  conftest_rc="$?"
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -fr conftest*
-
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_MMAP
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_MMAP 1
-EOF
-}
-
-fi
-
-
-test "$GNU_MALLOC" != "yes"   -a "$have_mmap" != "yes" && rel_alloc=no
-test "$rel_alloc" = "default" -a "$have_mmap"  = "yes" && rel_alloc=yes
-test "$rel_alloc" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining REL_ALLOC
-EOF
-cat >> confdefs.h <<\EOF
-#define REL_ALLOC 1
-EOF
-}
-
-
-ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:9781: checking for termios.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9784 "configure"
-#include "confdefs.h"
-#include <termios.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_TERMIOS
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_TERMIOS 1
+cat >> confdefs.h <<\EOF
+#define HAVE_TERMIOS 1
 EOF
 }
 
@@ -9828,15 +9400,15 @@ else
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
-echo "configure:9832: checking for termio.h" >&5
+echo "configure:9404: checking for termio.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9835 "configure"
+#line 9407 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9868,10 +9440,10 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:9872: checking for socket" >&5
+echo "configure:9444: checking for socket" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9875 "configure"
+#line 9447 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -9894,7 +9466,7 @@ socket();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -9909,15 +9481,15 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
-echo "configure:9913: checking for netinet/in.h" >&5
+echo "configure:9485: checking for netinet/in.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9916 "configure"
+#line 9488 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9934,15 +9506,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
-echo "configure:9938: checking for arpa/inet.h" >&5
+echo "configure:9510: checking for arpa/inet.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9941 "configure"
+#line 9513 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9967,9 +9539,9 @@ EOF
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:9971: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:9543: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 9973 "configure"
+#line 9545 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9980,7 +9552,7 @@ int main() {
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:9984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SOCKADDR_SUN_LEN
@@ -9998,9 +9570,9 @@ else
 fi
 rm -f conftest*
       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
-echo "configure:10002: checking "for ip_mreq struct in netinet/in.h"" >&5
+echo "configure:9574: checking "for ip_mreq struct in netinet/in.h"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 10004 "configure"
+#line 9576 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10010,7 +9582,7 @@ int main() {
 static struct ip_mreq x;
 ; return 0; }
 EOF
-if { (eval echo configure:10014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MULTICAST
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:10045: checking for msgget" >&5
+echo "configure:9617: checking for msgget" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10048 "configure"
+#line 9620 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -10067,7 +9639,7 @@ msgget();
 
 ; return 0; }
 EOF
-if { (eval echo configure:10071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -10082,15 +9654,15 @@ if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
-echo "configure:10086: checking for sys/ipc.h" >&5
+echo "configure:9658: checking for sys/ipc.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10089 "configure"
+#line 9661 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10107,15 +9679,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
-echo "configure:10111: checking for sys/msg.h" >&5
+echo "configure:9683: checking for sys/msg.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10114 "configure"
+#line 9686 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:10157: checking for dirent.h" >&5
+echo "configure:9729: checking for dirent.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10160 "configure"
+#line 9732 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10188,15 +9760,15 @@ else
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
-echo "configure:10192: checking for sys/dir.h" >&5
+echo "configure:9764: checking for sys/dir.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10195 "configure"
+#line 9767 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:10233: checking for nlist.h" >&5
+echo "configure:9805: checking for nlist.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10236 "configure"
+#line 9808 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10267,7 +9839,7 @@ fi
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:10271: checking "for sound support"" >&5
+echo "configure:9843: checking "for sound support"" >&5
 case "$with_sound" in
   native | both ) with_native_sound=yes;;
   nas    | no   ) with_native_sound=no;;
@@ -10278,15 +9850,15 @@ if test "$with_native_sound" != "no"; then
     if test -n "$native_sound_lib"; then
     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
-echo "configure:10282: checking for multimedia/audio_device.h" >&5
+echo "configure:9854: checking for multimedia/audio_device.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10285 "configure"
+#line 9857 "configure"
 #include "confdefs.h"
 #include <multimedia/audio_device.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:10338: checking for ALopenport in -laudio" >&5
+echo "configure:9910: checking for ALopenport in -laudio" >&5
 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -laudio "
 cat > conftest.$ac_ext <<EOF
-#line 10343 "configure"
+#line 9915 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10350,7 +9922,7 @@ int main() {
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:10354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
       if test -z "$native_sound_lib"; then
        
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:10385: checking for AOpenAudio in -lAlib" >&5
+echo "configure:9957: checking for AOpenAudio in -lAlib" >&5
 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lAlib "
 cat > conftest.$ac_ext <<EOF
-#line 10390 "configure"
+#line 9962 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10397,7 +9969,7 @@ int main() {
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:10401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
     for dir in "machine" "sys" "linux"; do
       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
-echo "configure:10439: checking for ${dir}/soundcard.h" >&5
+echo "configure:10011: checking for ${dir}/soundcard.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10442 "configure"
+#line 10014 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10513,7 +10085,7 @@ EOF
  fi
   libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
       cat > conftest.$ac_ext <<EOF
-#line 10517 "configure"
+#line 10089 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -10540,7 +10112,7 @@ test -z "$with_tty" && with_tty=yes
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:10544: checking for TTY-related features" >&5
+echo "configure:10116: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -10556,12 +10128,12 @@ EOF
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:10560: checking for tgetent in -lncurses" >&5
+echo "configure:10132: checking for tgetent in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lncurses "
 cat > conftest.$ac_ext <<EOF
-#line 10565 "configure"
+#line 10137 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10572,7 +10144,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10605,15 +10177,15 @@ EOF
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:10609: checking for ncurses/curses.h" >&5
+echo "configure:10181: checking for ncurses/curses.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10612 "configure"
+#line 10184 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:10639: checking for ncurses/term.h" >&5
+echo "configure:10211: checking for ncurses/term.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10642 "configure"
+#line 10214 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
       c_switch_site="$c_switch_site -I/usr/include/ncurses"
       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:10677: checking for ncurses/curses.h" >&5
+echo "configure:10249: checking for ncurses/curses.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10680 "configure"
+#line 10252 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
        for lib in curses termlib termcap; do
          
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:10720: checking for tgetent in -l$lib" >&5
+echo "configure:10292: checking for tgetent in -l$lib" >&5
 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$lib "
 cat > conftest.$ac_ext <<EOF
-#line 10725 "configure"
+#line 10297 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10732,7 +10304,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
       else
        
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:10767: checking for tgetent in -lcurses" >&5
+echo "configure:10339: checking for tgetent in -lcurses" >&5
 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcurses "
 cat > conftest.$ac_ext <<EOF
-#line 10772 "configure"
+#line 10344 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10779,7 +10351,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10797,12 +10369,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:10801: checking for tgetent in -ltermcap" >&5
+echo "configure:10373: checking for tgetent in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltermcap "
 cat > conftest.$ac_ext <<EOF
-#line 10806 "configure"
+#line 10378 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10813,7 +10385,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10861,15 +10433,15 @@ EOF
 
     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
-echo "configure:10865: checking for gpm.h" >&5
+echo "configure:10437: checking for gpm.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10868 "configure"
+#line 10440 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:10896: checking for Gpm_Open in -lgpm" >&5
+echo "configure:10468: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgpm "
 cat > conftest.$ac_ext <<EOF
-#line 10901 "configure"
+#line 10473 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10908,7 +10480,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:10912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10956,22 +10528,23 @@ test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event
  fi
 
 
-test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
-  != "no no no" && echo "checking for database support" 1>&6
-echo "configure:10962: checking for database support" >&5
+echo "checking for database support" 1>&6
+echo "configure:10533: checking for database support" >&5
 
-if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
-  ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
-echo "configure:10967: checking for ndbm.h" >&5
+if test "$with_database_gnudbm" != "no"; then
+  for ac_hdr in ndbm.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:10540: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10970 "configure"
+#line 10543 "configure"
 #include "confdefs.h"
-#include <ndbm.h>
+#include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 rm -f conftest*
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  :
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_hdr
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+}
+ have_ndbm_h=yes
 else
   echo "$ac_t""no" 1>&6
-
-    test "$with_database_gnudbm" = "yes" -o \
-         "$with_database_dbm"    = "yes" && \
-      { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
-    with_database_gnudbm=no with_database_dbm=no
-fi
-
 fi
+done
 
-if test "$with_database_gnudbm" != "no"; then
-  
+  if test "$have_ndbm_h" = "yes"; then
+    
 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:11005: checking for dbm_open in -lgdbm" >&5
+echo "configure:10580: checking for dbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgdbm "
 cat > conftest.$ac_ext <<EOF
-#line 11010 "configure"
+#line 10585 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11017,7 +10592,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:11021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11031,24 +10606,81 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm
+  with_database_gnudbm=yes have_libgdbm=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+  fi
+  if test "$with_database_gnudbm" != "yes"; then
+    echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
+echo "configure:10619: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10622 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dbm_open(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dbm_open();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dbm_open) || defined (__stub___dbm_open)
+choke me
+#else
+dbm_open();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:10645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_dbm_open=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_dbm_open=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  with_database_gnudbm=yes
 else
   echo "$ac_t""no" 1>&6
-if test "$with_database_gnudbm" = "yes"; then
-     { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
-   fi
-   with_database_gnudbm=no
 fi
 
+      fi
+  if test "$with_database_gnudbm" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_DBM
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_DBM 1
+EOF
+}
 
+    test "$have_libgdbm" = "yes" && LIBS="-lgdbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgdbm\" to \$LIBS"; fi
+    with_database_dbm=no
+  else with_database_gnudbm=no
+  fi
 fi
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:11049: checking for dbm_open" >&5
+echo "configure:10681: checking for dbm_open" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11052 "configure"
+#line 10684 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -11071,7 +10703,7 @@ dbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:11075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -11084,18 +10716,20 @@ rm -f conftest*
 
 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  with_database_dbm=yes libdbm=
+  with_database_dbm=yes need_libdbm=no
 else
   echo "$ac_t""no" 1>&6
+fi
 
+  if test "$need_libdbm" != "no"; then
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:11094: checking for dbm_open in -ldbm" >&5
+echo "configure:10728: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldbm "
 cat > conftest.$ac_ext <<EOF
-#line 11099 "configure"
+#line 10733 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11106,7 +10740,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:11110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11120,23 +10754,15 @@ xe_check_libs=""
 
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
-  with_database_dbm=yes libdbm=-ldbm
+  with_database_dbm=yes need_libdbm=yes
 else
   echo "$ac_t""no" 1>&6
-test "$with_database_dbm" = "yes" && \
-        { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
-      with_database_dbm=no
-fi
-
-
 fi
 
-fi
 
-test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
-test "$with_database_gnudbm" = "yes" -o \
-     "$with_database_dbm"    = "yes" && \
-  { test "$extra_verbose" = "yes" && cat << \EOF
+  fi
+  if test "$with_database_dbm" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_DBM
 EOF
 cat >> confdefs.h <<\EOF
@@ -11144,13 +10770,17 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
+    test "$need_libdbm" = "yes" && LIBS="-ldbm $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ldbm\" to \$LIBS"; fi
+  else with_database_dbm=no
+  fi
+fi
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
-echo "configure:11151: checking for Berkeley db.h" >&5
+echo "configure:10781: checking for Berkeley db.h" >&5
   for path in "db/db.h" "db.h"; do
     cat > conftest.$ac_ext <<EOF
-#line 11154 "configure"
+#line 10784 "configure"
 #include "confdefs.h"
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
@@ -11168,7 +10798,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_path="$path"; break
 else
@@ -11177,16 +10807,16 @@ else
 fi
 rm -f conftest*
   done
-  if test -z "$db_h_path"
+  if test -z "$db_h_path" 
   then echo "$ac_t""no" 1>&6; with_database_berkdb=no
   else echo "$ac_t""$db_h_path" 1>&6
   fi
 
   if test "$with_database_berkdb" != "no"; then
     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
-echo "configure:11188: checking for Berkeley DB version" >&5
+echo "configure:10818: checking for Berkeley DB version" >&5
     cat > conftest.$ac_ext <<EOF
-#line 11190 "configure"
+#line 10820 "configure"
 #include "confdefs.h"
 #include <$db_h_path>
 #if DB_VERSION_MAJOR > 1
 rm -f conftest*
 
     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
-echo "configure:11209: checking for $dbfunc" >&5
+echo "configure:10839: checking for $dbfunc" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11212 "configure"
+#line 10842 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $dbfunc(); below.  */
@@ -11231,7 +10861,7 @@ $dbfunc();
 
 ; return 0; }
 EOF
-if { (eval echo configure:11235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$dbfunc=yes"
 else
@@ -11250,12 +10880,12 @@ else
 
     
 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
-echo "configure:11254: checking for $dbfunc in -ldb" >&5
+echo "configure:10884: checking for $dbfunc in -ldb" >&5
 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldb "
 cat > conftest.$ac_ext <<EOF
-#line 11259 "configure"
+#line 10889 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11266,7 +10896,7 @@ int main() {
 $dbfunc()
 ; return 0; }
 EOF
-if { (eval echo configure:11270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:11334: checking for SOCKSinit in -lsocks" >&5
+echo "configure:10964: checking for SOCKSinit in -lsocks" >&5
 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocks "
 cat > conftest.$ac_ext <<EOF
-#line 11339 "configure"
+#line 10969 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11346,7 +10976,7 @@ int main() {
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:11350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11403,15 +11033,15 @@ for ac_hdr in dlfcn.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11407: checking for $ac_hdr" >&5
+echo "configure:11037: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11410 "configure"
+#line 11040 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11435,14 +11065,6 @@ cat >> confdefs.h <<EOF
 EOF
 }
  have_dlfcn=yes
-  { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_DLFCN_H
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_DLFCN_H 1
-EOF
-}
-
 else
   echo "$ac_t""no" 1>&6
 fi
@@ -11450,12 +11072,12 @@ done
 
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:11454: checking for dlopen in -ldl" >&5
+echo "configure:11076: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldl "
 cat > conftest.$ac_ext <<EOF
-#line 11459 "configure"
+#line 11081 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11466,7 +11088,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
  }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
-echo "configure:11499: checking for _dlopen in -lc" >&5
+echo "configure:11121: checking for _dlopen in -lc" >&5
 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 11504 "configure"
+#line 11126 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11511,7 +11133,7 @@ int main() {
 _dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
  }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
-echo "configure:11544: checking for dlopen in -lc" >&5
+echo "configure:11166: checking for dlopen in -lc" >&5
 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 11549 "configure"
+#line 11171 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11556,7 +11178,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
  }
 test -z "$with_shlib" && { 
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:11589: checking for shl_load in -ldld" >&5
+echo "configure:11211: checking for shl_load in -ldld" >&5
 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldld "
 cat > conftest.$ac_ext <<EOF
-#line 11594 "configure"
+#line 11216 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11601,7 +11223,7 @@ int main() {
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:11605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
  }
 test -z "$with_shlib" && { 
 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
-echo "configure:11634: checking for dld_init in -ldld" >&5
+echo "configure:11256: checking for dld_init in -ldld" >&5
 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldld "
 cat > conftest.$ac_ext <<EOF
-#line 11639 "configure"
+#line 11261 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11646,7 +11268,7 @@ int main() {
 dld_init()
 ; return 0; }
 EOF
-if { (eval echo configure:11650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
  }
 if test "$with_shlib" = "yes"; then
-  
-dll_ld=
-dll_ldflags=
-dll_cflags=
-dll_post=
-dll_ldo="-o"
-ld_dynamic_link_flags=
-xehost=$canonical
-xealias=$internal_configuration
-
-echo "checking how to build dynamic libraries for ${xehost}" 1>&6
-echo "configure:11689: checking how to build dynamic libraries for ${xehost}" >&5
-# Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
-case "$xehost" in
-*-*-linux-gnu*) ;;
-*-*-linux*) xehost=`echo $xehost | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
-esac
-
-xehost_cpu=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-xehost_vendor=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-xehost_os=`echo $xehost | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-case "$xehost_os" in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "${COLLECT_NAMES+set}" != set; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
+  { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_SHLIB
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_SHLIB 1
+EOF
+}
 
-# Now see if the compiler is really GCC.
-if test "$GCC" = "yes"; then
-  XEGCC=yes
-else
-  echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:11717: checking checking whether we are using GNU C" >&5
-  cat > conftest.$ac_ext <<EOF
-#line 11719 "configure"
-#include "confdefs.h"
+  extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"sysdll.o\""
+ fi
+  extra_objs="$extra_objs dll.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"dll.o\""
+ fi
+  test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
+  
+dll_ld="ld"
+dll_lflags="-shared"
+dll_cflags="-r"
+dll_oflags="-o "
+
+echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6
+echo "configure:11322: checking how to build a shared library" >&5
+case `uname -rs` in
+       UNIX_SV*|UNIX_System_V*)
+               dll_lflags="-G"
+               dll_cflags=-Kpic
+               dll_ld="ld"
+               ;;
+       BSD/OS*)
+               dll_cflags=
+               dll_lflags="-r"
+               dll_ld="shlicc2"
+               ;;
+       FreeBSD*2*)
+               dll_lflags="-Bshareable"
+               dll_cflags="-fPIC -DPIC"
+               dll_ld=ld
+               ;;
+       SunOS*4.*)
+               dll_cflags="-P"
+               dll_lflags="-dp -assert pure-text -assert nodefinitions"
+               ;;
+       SunOS*5.*)
+               dll_ld="cc"
+               dll_cflags="-KPIC"
+               dll_lflags="-G"
+               dll_oflags="-W0,-y-o -W0,-y"
+               ;;      
+       IRIX*5.*|IRIX*6.*)
+               dll_cflags="-KPIC"
+               ;;
+       OSF1*)
+               ;;
+       HP-UX*)
+               dll_ld="ld"
+               dll_lflags="-b"
+               dll_cflags="+z"
+               ;;
+       SCO_SV*)
+               dll_ld="ld"
+               dll_lflags="-G"
+               dll_cflags="-Kpic"
+               ;;
+       AIX*)
+               dll_lflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:\${@:.ell=.exp} -b noentry -lc"
+               dll_ld="ld"
+               ;;
+       *)
+               ;;
+       esac
+
+       if test "$GCC" = "yes" ; then
+               dll_cflags="-fPIC"
+               case `uname -rs` in
+               SunOS*5.*)
+                       dll_ld="ld"
+                       dll_oflags="-o "
+                       dll_lflags="-G"
+                       ;;
+               SCO_SV*)
+                       dll_ld="ld"
+                       dll_lflags="-G"
+                       dll_cflags="-b elf"
+                       ;;
+               FreeBSD*)
+                       dll_cflags="-DDLSYM_NEEDS_UNDERSCORE -DPIC -fPIC"
+                       dll_lflags="-Bshareable"
+                       dll_ld=ld
+                       ;;
+               BSD/OS*)
+                       dll_cflags=
+                       dll_lflags="-r"
+                       dll_ld="shlicc2"
+                       ;;
+               UNIX_SV*)
+                       dll_cflags="-fPIC"
+                       ;;
+               *)
+                       dll_ld="$CC"
+                       dll_lflags="-shared"
+               esac
+       fi
 
-#ifdef __GNUC__
-  yes;
-#endif
+       echo "$ac_t"""lflags: $dll_lflags cflags: $dll_cflags"" 1>&6
 
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "yes" >/dev/null 2>&1; then
-  rm -rf conftest*
-  XEGCC=yes
-else
-  rm -rf conftest*
-  XEGCC=no
-fi
-rm -f conftest*
 
-  echo "$ac_t""${XEGCC}" 1>&6
-fi
 
-echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
-echo "configure:11741: checking how to produce PIC code" >&5
-wl=
 
-can_build_shared=yes
-if test "$XEGCC" = yes; then
-  wl='-Wl,'
 
-  case "$xehost_os" in
-  aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
-    # PIC is the default for these OSes.
-    ;;
-
-  os2*)
-    # We can build DLLs from non-PIC.
-    ;;
-  amigaos*)
-    # FIXME: we need at least 68020 code to build shared libraries, but
-    # adding the `-m68020' flag to GCC prevents building anything better,
-    # like `-m68040'.
-    dll_cflags='-m68020 -resident32 -malways-restore-a4'
-    ;;
-  *)
-    dll_cflags='-fPIC'
-    ;;
-  esac
-else
-  # PORTME Check for PIC flags for the system compiler.
-  case "$xehost_os" in
-  hpux9* | hpux10*)
-    # Is there a better link_static_flag that works with the bundled CC?
-    wl='-Wl,'
-    dll_cflags='+Z'
-    ;;
-
-  irix5* | irix6*)
-    wl='-Wl,'
-    # PIC (with -KPIC) is the default.
-    ;;
-
-  os2*)
-    # We can build DLLs from non-PIC.
-    ;;
-
-  osf3* | osf4*)
-    # All OSF/1 code is PIC.
-    wl='-Wl,'
-    ;;
-
-  sco3.2v5*)
-    dll_cflags='-belf -Kpic'
-    wl='-Wl,'
-    ;;
-
-  unixware*)
-    dll_cflags="-KPIC"
-    wl="-Wl,"
-    ;;
-
-  sysv4*)
-    dll_cflags="-KPIC"
-    wl="-Wl,"
-    ;;
-
-  sysv5*)
-    dll_cflags="-KPIC"
-    wl="-Wl,"
-    ;;
-
-  solaris2*)
-    dll_cflags='-KPIC'
-    wl='-Wl,'
-    ;;
-
-  sunos4*)
-    dll_cflags='-PIC'
-    wl='-Qoption ld '
-    ;;
-
-  uts4*)
-    dll_cflags='-pic'
-    ;;
-
-  *)
-    can_build_shared=no
-    ;;
-  esac
-fi
-
-if test -n "$dll_cflags"; then
-  echo "$ac_t""${dll_cflags}" 1>&6
-  
-  # Check to make sure the dll_cflags actually works.
-  echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
-echo "configure:11834: checking if PIC flag ${dll_cflags} really works" >&5
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $dll_cflags -DPIC"
-  cat > conftest.$ac_ext <<EOF
-#line 11838 "configure"
-#include "confdefs.h"
-
-int main() {
-int x=0;
-; return 0; }
-EOF
-if { (eval echo configure:11845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  
-    # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
-    # reports no error.  So, we need to grep stderr for (Bundled).
-    if grep '(Bundled)' config.log >/dev/null; then
-      echo "$ac_t""no" 1>&6
-      can_build_shared=no
-      dll_cflags=
-    else
-      echo "$ac_t""yes" 1>&6
-    fi
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
-    can_build_shared=no
-    dll_cflags=
-fi
-rm -f conftest*
-  CFLAGS="$save_CFLAGS"
-else
-  echo "$ac_t""none" 1>&6
-fi
-
-if test "$can_build_shared" = "yes"; then
-cc_produces_so=no
-xldf=
-xcldf=
-echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
-echo "configure:11876: checking if C compiler can produce shared libraries" >&5
-if test "$XEGCC" = yes; then
-  xcldf="-shared"
-  xldf="-shared"
-else # Not using GCC
-  case "$xehost_os" in
-    aix3* | aix4*)
-      xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc"
-      xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc"
-      ;;
-
-    freebsd2* | netbsd* | openbsd*)
-      xldf="-Bshareable"
-      xcldf="${wl}-Bshareable"
-      ;;
-
-    freebsd3*)
-      xcldf="-shared"
-      ;;
-
-    hpux*)
-      xldf="-b +s"
-      xcldf="${wl}-b ${wl}+s"
-      ;;
-
-    irix5* | irix6* | osf3* | osf4*)
-      xcldf="${wl}-shared"
-      xldf="-shared"
-      ;;
-
-    sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7* | uts4*)
-      xcldf="-G"
-      xldf="-G"
-      ;;
-
-    sunos4*)
-      xcldf="${wl}-assert ${wl}pure-text ${wl}-Bstatic"
-      xldf="-assert pure-text -Bstatic"
-      ;;
-  esac
-fi # End if if we are using gcc
-
-if test -n "$xcldf"; then
-  save_LDFLAGS=$LDFLAGS
-  save_LIBS=$LIBS
-  save_xe_libs=$xe_libs
-  LDFLAGS="$xcldf $LDFLAGS"
-  LIBS=
-  xe_libs=
-  ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
-  cat > conftest.$ac_ext <<EOF
-#line 11927 "configure"
-#include "confdefs.h"
-
-int main() {
-int x=0;
-; return 0; }
-EOF
-if { (eval echo configure:11934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  cc_produces_so=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cc_produces_so=no
-fi
-rm -f conftest*
-  LDFLAGS=$save_LDFLAGS
-  LIBS=$save_LIBS
-  xe_libs=$save_xe_libs
-  ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
-else
-  cc_produces_so=no
-fi
-echo "$ac_t""${cc_produces_so}" 1>&6
-
-LTLD=$LD
-if test -z "$LTLD"; then
-  ac_prog=ld
-  if test "$XEGCC" = yes; then
-    # Check if gcc -print-prog-name=ld gives a path.
-    echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:11959: checking for ld used by GCC" >&5
-    ac_prog=`($CC -print-prog-name=ld) 2>&5`
-    case "$ac_prog" in
-    # Accept absolute paths.
-    /*)
-      if test -z "$LTLD"; then
-        case "$ac_prog" in
-          *gcc-lib*) LTLD="$CC"
-                     ;;
-          *)         LTLD="$ac_prog"
-                     ;;
-        esac
-      fi
-      ;;
-    "")
-      # If it fails, then pretend we aren't using GCC.
-      ac_prog=ld
-      ;;
-    *)
-      # If it is relative, then search for the first ld in PATH.
-      with_gnu_ld=unknown
-      ;;
-    esac
-  else
-    echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:11984: checking for GNU ld" >&5
-  fi
-
-  if test -z "$LTLD"; then
-    IFS="${IFS=        }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-    for ac_dir in $PATH; do
-      test -z "$ac_dir" && ac_dir=.
-      if test -f "$ac_dir/$ac_prog"; then
-        LTLD="$ac_dir/$ac_prog"
-        # Check to see if the program is GNU ld.  I'd rather use --version,
-        # but apparently some GNU ld's only accept -v.
-        # Break only if it was the GNU/non-GNU ld that we prefer.
-        if "$LTLD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
-          xe_gnu_ld=yes
-        else
-          xe_gnu_ld=no
-        fi
-      fi
-    done
-    IFS="$ac_save_ifs"
-  fi
-
-  if test -n "$LTLD"; then
-    echo "$ac_t""${LTLD}" 1>&6
-  else
-    echo "$ac_t""no" 1>&6
-  fi
-
-  if test -z "$LTLD" -a "$cc_produces_so" = no; then
-    { echo "configure: error: no acceptable linker found in \$PATH" 1>&2; exit 1; }
-    exit 1
-  fi
-fi
-
-ld_dynamic_link_flags=
-
-# Check to see if it really is or isn't GNU ld.
-echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
-echo "configure:12022: checking if the linker is GNU ld" >&5
-# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-  xe_gnu_ld=yes
-else
-  xe_gnu_ld=no
-fi
-echo "$ac_t""${xe_gnu_ld}" 1>&6
-
-case "$xehost_os" in
-  amigaos* | sunos4*)
-    # On these operating systems, we should treat GNU ld like the system ld.
-    gnu_ld_acts_native=yes
-    ;;
-  *)
-    gnu_ld_acts_native=no
-    ;;
-esac
-
-if test "$cc_produces_so" = "yes"; then
-  dll_ld=$CC
-  dll_ldflags=$xcldf
-  can_build_shared=yes
-else
-  # OK - only NOW do we futz about with ld.
-  # See if the linker supports building shared libraries.
-  echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
-echo "configure:12049: checking whether the linker supports shared libraries" >&5
-  dll_ld=$CC
-  dll_ldflags=$LDFLAGS
-  ld_shlibs=yes
-  can_build_shared=yes
-  if test "$xe_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
-    # See if GNU ld supports shared libraries.
-    if $LTLD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      dll_ld=$CC
-      dll_ldflags="-shared"
-      ld_shlibs=yes
-    else
-      ld_shlibs=no
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case "$xehost_os" in
-    aix3*)
-      dll_ld=$LTLD
-      dll_ldflags=$xldf
-      ;;
-
-    aix4*)
-      dll_ldflags=$xcldf
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # doesn't break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      dll_ld=$LTLD
-      dll_ldflags=$xldf
-      dll_post="/usr/lib/c++rt0.o"
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 don't have this feature.
-    freebsd2*)
-      dll_ld=$LTLD
-      dll_ldflags="-Bshareable"
-      ;;
-
-    # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
-    freebsd3*)
-      dll_ldflags="-shared"
-      ;;
-
-    hpux*)
-      dll_ld=$LTLD
-      dll_ldflags=$xldf
-      ;;
-
-    irix5* | irix6*)
-      dll_ld=$LTLD
-      dll_ldflags=$xldf
-      ;;
-
-    netbsd*)
-      # Tested with NetBSD 1.2 ld
-      dll_ld=$LTLD
-      dll_ldflags=$xldf
-      ;;
-
-    openbsd*)
-      dll_ld=$LTLD
-      dll_ldflags=$xldf
-      ;;
-
-    osf3* | osf4*)
-      dll_ld=$LTLD
-      dll_ldflags=$xldf
-      ;;
-
-    # For both SCO and Solaris we MAY want to have LDFLAGS include -z text
-    sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
-      dll_ld=$LTLD
-      case "$dll_ld" in
-        *gcc*) dll_ldflags="-shared"
-               dll_ld=$CC
-               ;;
-        *)     dll_ldflags="-G"
-               ;;
-      esac
-      ;;
-
-    sunos4*)
-      if test "$XEGCC" = yes; then
-        dll_ld=$CC
-      else
-        dll_ld=$LTLD
-      fi
-      dll_ldflags=$xldf
-      ;;
-
-    uts4*)
-      dll_ld=$LTLD
-      dll_ldflags="-G"
-      ;;
-
-    bsdi*)
-      dll_ldflags="-r"
-      dll_ld="shlicc2"
-      ;;
-
-    *)
-      ld_shlibs=no
-      can_build_shared=no
-      ;;
-    esac
-  fi
-  echo "$ac_t""${ld_shlibs}" 1>&6
-  if test "$ld_shlibs" = "no"; then
-    can_build_shared=no
-  fi
-fi # End of if cc_produces_so = no
-
-
-if test "$xe_gnu_ld" = yes; then
-  if test "$ld_shlibs" = yes; then
-    ld_dynamic_link_flags="${wl}-export-dynamic"
-  fi
-fi
-
-if test -z "$ld_dynamic_link_flags"; then
-  case "$xehost_os" in
-  aix3*)
-    ld_dynamic_link_flags=
-    ;;
-
-  aix4*)
-    ld_dynamic_link_flags=
-    ;;
-
-  freebsd2.2*)
-    ld_dynamic_link_flags=
-    ;;
-
-  freebsd2*)
-    ld_dynamic_link_flags=
-    ;;
-
-  freebsd3*)
-    ld_dynamic_link_flags=
-    ;;
-
-  hpux*)
-    ld_dynamic_link_flags="${wl}-E"
-    ;;
-
-  irix5* | irix6*)
-    ld_dynamic_link_flags=
-    ;;
-
-  netbsd*)
-    ld_dynamic_link_flags=
-    ;;
-
-  openbsd*)
-    ld_dynamic_link_flags=
-    ;;
-
-  osf3* | osf4*)
-    ld_dynamic_link_flags=
-    ;;
-
-  sco3.2v5* | unixware* | sysv5* | sysv4* | solaris2* | solaris7*)
-    ld_dynamic_link_flags="${wl}-Bexport"
-    ;;
-
-  sunos4*)
-    ld_dynamic_link_flags=
-    ;;
-
-  uts4*)
-    ld_dynamic_link_flags=
-    ;;
-
-  bsdi*)
-    ld_dynamic_link_flags=
-    ;;
-
-  esac
-fi # End of if -z ld_dynamic_link_flags
-fi # End of if test "$can_build_shared" = "yes"
-
-
-
-
-
-
-
-
-  if test "$can_build_shared" = "yes"; then
-    { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_SHLIB
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_SHLIB 1
-EOF
-}
-
-    extra_objs="$extra_objs sysdll.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"sysdll.o\""
- fi
-    extra_objs="$extra_objs emodules.o" &&  if test "$extra_verbose" = "yes"; then
-   echo "    xemacs will be linked with \"emodules.o\""
- fi
-    INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
-    test ! -z "$DLL_LIB" && LIBS="-l${DLL_LIB} $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-l${DLL_LIB}\" to \$LIBS"; fi
-    for ac_func in dlerror _dlerror
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12261: checking for $ac_func" >&5
+  for ac_func in dlerror
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:11413: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12264 "configure"
+#line 11416 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -12283,7 +11435,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:12287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -12310,22 +11462,23 @@ else
 fi
 done
 
-  else
-    echo "configure: warning: disabling shared library support" 1>&2
-    with_shlib=no
-  fi
+  ld_dynamic_link_flags=
+    case "$opsys" in
+  hpux*)  ld_dynamic_link_flags="-Wl,-E" ;;
+  linux*) ld_dynamic_link_flags="-rdynamic" ;;
+  *) ;;
+  esac
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 12321 "configure"
+#line 11475 "configure"
 #include "confdefs.h"
 int main(int c,char *v[]){return 0;}
 EOF
-if { (eval echo configure:12325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:11479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   :
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
@@ -12420,7 +11573,7 @@ ld_libs_all="$T"
 
 
 MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
-internal_makefile_list="Makefile.in"
+internal_makefile_list="Makefile"
 SUBDIR_MAKEFILES=''
 test -d lock || mkdir lock
 for dir in $MAKE_SUBDIR; do
@@ -12431,7 +11584,7 @@ for dir in $MAKE_SUBDIR; do
   esac
   
 T=""
-for W in $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
+for W in $SUBDIR_MAKEFILES $dir/Makefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
 SUBDIR_MAKEFILES="$T"
 
   
@@ -12462,7 +11615,7 @@ if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
   echo "source $srcdir/src/gdbinit" > src/gdbinit
 fi
 
-if test "$__SUNPRO_C" = "yes"; then
+if test "$__sunpro_c" = "yes"; then
   echo "creating .sbinit"; echo ""
   ( echo "# For use with Sun WorkShop's Source browser."
     echo "# See sbquery(1) and sbinit(4) for more information"
@@ -12552,38 +11705,6 @@ done
 
 
 
-MODULEDIR=$moduledir
-while true; do
-  case "$MODULEDIR" in
-    *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
-    *) break ;;
-  esac
-done
-
-
-
-
-SITELISPDIR=$sitelispdir
-while true; do
-  case "$SITELISPDIR" in
-    *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
-    *) break ;;
-  esac
-done
-
-
-
-
-SITEMODULEDIR=$sitemoduledir
-while true; do
-  case "$SITEMODULEDIR" in
-    *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
-    *) break ;;
-  esac
-done
-
-
-
 
 ETCDIR=$etcdir
 while true; do
@@ -12634,18 +11755,16 @@ done
 
 
 
-RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
-
-
 
+RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
 
 
 
 
-: ${XEMACS_CC:=$CC}
 
 
 
+# The default is yes
 if test "$with_site_lisp" = "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining INHIBIT_SITE_LISP
@@ -12656,16 +11775,6 @@ EOF
 }
 
 fi
-if test "$with_site_modules" = "no"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining INHIBIT_SITE_MODULES
-EOF
-cat >> confdefs.h <<\EOF
-#define INHIBIT_SITE_MODULES 1
-EOF
-}
-
-fi
 
 
 T=""
@@ -12815,19 +11924,19 @@ cat >> confdefs.h <<\EOF
 EOF
 }
 
-test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining NO_DOC_FILE
+test "$with_gnu_make"      = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining USE_GNU_MAKE
 EOF
 cat >> confdefs.h <<\EOF
-#define NO_DOC_FILE 1
+#define USE_GNU_MAKE 1
 EOF
 }
 
-test "$with_purify"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining PURIFY
+test "$no_doc_file"        = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining NO_DOC_FILE
 EOF
 cat >> confdefs.h <<\EOF
-#define PURIFY 1
+#define NO_DOC_FILE 1
 EOF
 }
 
@@ -12926,37 +12035,21 @@ if test "$with_xpm" = yes; then
 elif test "$with_x11" = yes; then
   echo "  --------------------------------------------------------------------"
   echo "  WARNING: Compiling without XPM support."
-  if test "$xpm_problem" != ""; then
-    echo "  Reason: $xpm_problem"
-  fi
-  echo "  WARNING: You should strongly consider installing XPM."
+  echo "  WARNING: You should strongly considering installing XPM."
   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
-  echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
   echo "  --------------------------------------------------------------------"
 fi
-if test "$with_png" = yes; then
-  echo "  Compiling in support for PNG image handling."
-elif test "$window_system" != "none"; then
-  echo "  --------------------------------------------------------------------"
-  echo "  WARNING: Compiling without PNG image support."
-  if test "$png_problem" != ""; then
-    echo "  Reason: $png_problem"
-  fi
-  echo "  WARNING: You should strongly consider installing the PNG libraries."
-  echo "  WARNING: Otherwise certain images and glyphs may not display."
-  echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
-  echo "  --------------------------------------------------------------------"
-fi
-test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
-test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
-test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
+test "$with_gif"   = yes && echo "  Compiling in support for GIF image conversion."
+test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image conversion."
+test "$with_png"   = yes && echo "  Compiling in support for PNG image conversion."
+test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image conversion."
 case "$with_sound" in
   nas    ) echo "  Compiling in network sound (NAS) support." ;;
   native ) echo "  Compiling in native sound support." ;;
   both   ) echo "  Compiling in both network and native sound support." ;;
 esac
-test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
+test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously"
 
 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
@@ -13010,9 +12103,9 @@ test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
 test "$with_clash_detection" = yes && \
   echo "  Clash detection will use \"$lockdir\" for locking files."
 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
-test "$with_pop"       = yes && echo "  Using POP for mail access."
-test "$with_kerberos"  = yes && echo "  Using Kerberos for POP authentication."
-test "$with_hesiod"    = yes && echo "  Using Hesiod to get POP server host."
+test "$with_pop"       = yes && echo "  Using POP for mail access"
+test "$with_kerberos"  = yes && echo "  Using Kerberos for POP authentication"
+test "$with_hesiod"    = yes && echo "  Using Hesiod to get POP server host"
 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
 test "$use_minimal_tagbits" = yes && echo "  Using Lisp_Objects with minimal tagbits."
 test "$use_indexed_lrecord_implementation" = yes && echo "  Using indexed lrecord implementation."
@@ -13036,6 +12129,7 @@ sed 's/"/\\"/g' Installation >> Installation.el
 echo '")' >> Installation.el
 
 
+
 # Remove any trailing slashes in these variables.
 test -n "$prefix" &&
   prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([^/]\)/*$,\1,'`
@@ -13049,9 +12143,6 @@ for file in $internal_makefile_list; do
   ac_output_files="${ac_output_files+$ac_output_files }$file"
 done
 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
-if test "$with_shlib" = "yes"; then
-  ac_output_files="$ac_output_files lib-src/ellcc.h"
-fi
 
 trap '' 1 2 15
 
@@ -13163,10 +12254,8 @@ s%@lwlib_objs@%$lwlib_objs%g
 s%@ALLOCA@%$ALLOCA%g
 s%@dll_ld@%$dll_ld%g
 s%@dll_cflags@%$dll_cflags%g
-s%@dll_ldflags@%$dll_ldflags%g
-s%@dll_post@%$dll_post%g
-s%@dll_ldo@%$dll_ldo%g
-s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
+s%@dll_oflags@%$dll_oflags%g
+s%@dll_lflags@%$dll_lflags%g
 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
 s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
@@ -13191,15 +12280,6 @@ s%@PACKAGE_PATH@%$PACKAGE_PATH%g
 s%@lispdir@%$lispdir%g
 s%@LISPDIR_USER_DEFINED@%$LISPDIR_USER_DEFINED%g
 s%@LISPDIR@%$LISPDIR%g
-s%@moduledir@%$moduledir%g
-s%@MODULEDIR_USER_DEFINED@%$MODULEDIR_USER_DEFINED%g
-s%@MODULEDIR@%$MODULEDIR%g
-s%@sitelispdir@%$sitelispdir%g
-s%@SITELISPDIR_USER_DEFINED@%$SITELISPDIR_USER_DEFINED%g
-s%@SITELISPDIR@%$SITELISPDIR%g
-s%@sitemoduledir@%$sitemoduledir%g
-s%@SITEMODULEDIR_USER_DEFINED@%$SITEMODULEDIR_USER_DEFINED%g
-s%@SITEMODULEDIR@%$SITEMODULEDIR%g
 s%@etcdir@%$etcdir%g
 s%@ETCDIR_USER_DEFINED@%$ETCDIR_USER_DEFINED%g
 s%@ETCDIR@%$ETCDIR%g
@@ -13212,6 +12292,7 @@ s%@ARCHLIBDIR@%$ARCHLIBDIR%g
 s%@docdir@%$docdir%g
 s%@bitmapdir@%$bitmapdir%g
 s%@extra_objs@%$extra_objs%g
+s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g
 s%@machfile@%$machfile%g
 s%@opsysfile@%$opsysfile%g
 s%@c_switch_general@%$c_switch_general%g
@@ -13227,7 +12308,6 @@ s%@RECURSIVE_MAKE@%$RECURSIVE_MAKE%g
 s%@native_sound_lib@%$native_sound_lib%g
 s%@sound_cflags@%$sound_cflags%g
 s%@dynodump_arch@%$dynodump_arch%g
-s%@XEMACS_CC@%$XEMACS_CC%g
 s%@internal_makefile_list@%$internal_makefile_list%g
 
 CEOF
@@ -13439,12 +12519,14 @@ fi; done
 EOF
 cat >> $CONFIG_STATUS <<EOF
 CPP="$CPP"
+ CPPFLAGS="$CPPFLAGS"
  top_srcdir="$srcdir"
  MAKE_SUBDIR="$MAKE_SUBDIR"
 
 EOF
 cat >> $CONFIG_STATUS <<\EOF
-for dir in . $MAKE_SUBDIR; do
+for dir in $MAKE_SUBDIR; do
+  echo creating $dir/Makefile
   (
     cd $dir
     rm -f junk.c
@@ -13456,45 +12538,26 @@ for dir in . $MAKE_SUBDIR; do
           -e '/^#/ {
 p
 d
-}'        \
-         -e '/./ {
+}'        -e '/./ {
 s/\([\"]\)/\\\1/g
 s/^/"/
 s/$/"/
 }'  > junk.c;
-
-
-
-    echo creating $dir/Makefile
-$CPP -I. -I${top_srcdir}/src  junk.c \
-  | sed -e 's/^\#.*//'         \
-       -e 's/^[        ][      ]*$//'\
-       -e 's/^ /       /'              \
-  | sed -n -e '/^..*$/p'       \
-  | sed '/^\"/ {
-       s/\\\([\"]\)/\1/g
-       s/^[    ]*\"//
-       s/\"[   ]*$//
-}' > Makefile.new
+    $CPP -I. -I${top_srcdir}/src $CPPFLAGS junk.c > junk.cpp;
+    < junk.cpp                         \
+      sed -e 's/^#.*//'                        \
+       -e 's/^[        ][      ]*$//'  \
+       -e 's/^ /       /'                      \
+       | sed -n -e '/^..*$/p'          \
+       | sed '/^"/ {
+s/\\\([\"]\)/\1/g
+s/^[   ]*"//
+s/"[   ]*$//
+}'     > Makefile.new
     chmod 444 Makefile.new
     mv -f Makefile.new Makefile
-
-    echo creating $dir/GNUmakefile
-$CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
-  | sed -e 's/^\#.*//'         \
-       -e 's/^[        ][      ]*$//'\
-       -e 's/^ /       /'              \
-  | sed -n -e '/^..*$/p'       \
-  | sed '/^\"/ {
-       s/\\\([\"]\)/\1/g
-       s/^[    ]*\"//
-       s/\"[   ]*$//
-}' > Makefile.new
-    chmod 444 Makefile.new
-    mv -f Makefile.new GNUmakefile
-
-    rm -f junk.c
-  )
+    rm -f junk.c junk.cpp
+)
 done
 
 sed < config.status >> lib-src/config.values \
@@ -13509,3 +12572,4 @@ EOF
 chmod +x $CONFIG_STATUS
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
index 5243fb0..3044365 100644 (file)
@@ -7,7 +7,6 @@ define([AC_INIT_NOTICE],
 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
 #### Copyright (C) 1995, 1996 Ben Wing.
-#### Copyright (C) 1998, 1999 J. Kean Johnston.
 
 ### Don't edit this script!
 ### This script was automatically generated by the `autoconf' program
@@ -80,12 +79,11 @@ define([AC_TRY_RUN_NATIVE],
 #include "confdefs.h"
 [$1]
 EOF
-if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit $?) 2>&AC_FD_CC
+if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit) 2>&AC_FD_CC
 then
 dnl Do not remove the temporary files here, so they can be examined.
   ifelse([$2], , :, [$2])
 else
-  conftest_rc="$?"
   echo "configure: failed program was:" >&AC_FD_CC
   cat conftest.$ac_ext >&AC_FD_CC
 ifelse([$3], , , [  rm -fr conftest*
@@ -230,13 +228,6 @@ define([XE_PREPEND],
 [[$2]="[$1] $[$2]" && dnl
  if test "$extra_verbose" = "yes"; then echo "    Prepending \"[$1]\" to \$[$2]"; fi])
 
-dnl XE_DIE(message)
-define([XE_DIE], [{ echo "Error:" $1 >&2; exit 1; }])
-
-dnl XE_STRIP_4TH_COMPONENT(var)
-dnl Changes i986-pc-linux-gnu to i986-pc-linux, as God (not RMS) intended.
-define([XE_STRIP_4TH_COMPONENT],
-[$1=`echo "$$1" | sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'`])
 
 dnl Initialize some variables set by options.
 dnl The variables have the same names as the options, with
@@ -334,6 +325,7 @@ dnl -----------------------------
 XE_APPEND(lib-src, MAKE_SUBDIR)
 XE_APPEND(lib-src, INSTALL_ARCH_DEP_SUBDIR)
 
+dnl run_in_place='no'
 prefix='/usr/local'
 exec_prefix='${prefix}'
 bindir='${exec_prefix}/bin'
@@ -349,16 +341,13 @@ infodir='${datadir}/${PROGNAME}-${version}/info'
 infopath=''
 install_pp=''
 lispdir='${datadir}/${PROGNAME}-${version}/lisp'
-moduledir='${datadir}/${PROGNAME}-${version}/${configuration}/modules'
-sitelispdir='${datadir}/xemacs/site-lisp'
-sitemoduledir='${datadir}/xemacs/site-modules'
+dnl sitelispdir='${datadir}/xemacs/site-lisp'
 pkgdir='${datadir}/${PROGNAME}-${version}/lisp'
 package_path=''
 etcdir='${datadir}/${PROGNAME}-${version}/etc'
 lockdir='${statedir}/${PROGNAME}/lock'
-archlibdir='${datadir}/${PROGNAME}-${version}/${configuration}'
+archlibdir='${libdir}/${PROGNAME}-${version}/${configuration}'
 with_site_lisp='no'
-with_site_modules='yes'
 with_menubars=''
 with_scrollbars=''
 with_dialogs=''
@@ -463,12 +452,13 @@ while test $# != 0; do
       case "$opt" in
 
       dnl Process (many) boolean options
-       with_site_lisp  | \
-    with_site_modules | \
+       run_in_place    | \
+        with_site_lisp  | \
        with_x          | \
        with_x11        | \
        with_msw        | \
        with_gcc        | \
+       with_gnu_make   | \
        dynamic         | \
        with_ncurses    | \
        with_dnet       | \
@@ -485,20 +475,19 @@ while test $# != 0; do
        with_tiff       | \
        with_session    | \
        with_xmu        | \
-       with_purify     | \
        with_quantify   | \
        with_toolbars   | \
        with_tty        | \
        with_xfs        | \
        with_i18n3      | \
        with_mule       | \
-       with_file_coding| \
+       with_file_coding        | \
        with_canna      | \
        with_wnn        | \
        with_wnn6       | \
        with_workshop   | \
        with_sparcworks | \
-       with_tooltalk   | \
+       with_tooltalk   | \
        with_ldap       | \
        with_pop        | \
        with_kerberos   | \
@@ -509,13 +498,14 @@ while test $# != 0; do
        verbose         | \
        extra_verbose   | \
        const_is_losing | \
-       usage_tracking  | \
-       use_union_type  | \
+       usage_tracking  | \
+       use_union_type  | \
        debug           | \
        use_assertions  | \
-       gung_ho         | \
        use_minimal_tagbits                     | \
        use_indexed_lrecord_implementation      | \
+       gung_ho         | \
+       use_assertions  | \
        memory_usage_stats | \
        with_clash_detection | \
        with_shlib | \
@@ -523,10 +513,10 @@ while test $# != 0; do
          dnl Make sure the value given was either "yes" or "no".
          case "$val" in
            y | ye | yes )      val=yes ;;
-           n | no )            val=no  ;;
+           n | no )            val=no  ;;
            * ) USAGE_ERROR("The \`--$optname' option requires a boolean value: \`yes' or \`no'.") ;;
          esac
-         eval "$opt=\"$val\"" ;;
+          eval "$opt=\"$val\"" ;;
 
 
        dnl Options that take a user-supplied value, as in --puresize=8000000
@@ -540,7 +530,7 @@ while test $# != 0; do
        ldflags         | \
        puresize        | \
        cache_file      | \
-       native_sound_lib| \
+       native_sound_lib | \
        site_lisp       | \
        x_includes      | \
        x_libraries     | \
@@ -588,7 +578,7 @@ while test $# != 0; do
                g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
                * ) USAGE_ERROR(["The \`--$optname' option value
   must be either \`no' or a comma-separated list
-  of one or more of \`berkdb' and either \`dbm' or \`gnudbm'."]) ;;
+  of one or more of \`berkdb', \`dbm', or \`gnudbm'."]) ;;
             esac
          done
          if test "$with_database_dbm"    = "yes" -a \
@@ -627,6 +617,17 @@ while test $# != 0; do
           eval "$opt=\"$val\""
         ;;
 
+        dnl XFontSet support?
+       "with_xfs" )
+         case "$val" in
+         y | ye | yes )                val=yes ;;
+         n | no | non | none )         val=no  ;;
+         * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
+ \`yes', or \`no'."]) ;;
+         esac
+         eval "$opt=\"$val\""
+       ;;
+
         dnl Mail locking specification
        "mail_locking" )
          case "$val" in
@@ -697,7 +698,7 @@ while test $# != 0; do
        dnl Has the user specified one of the path options?
        prefix | exec_prefix | bindir | datadir | statedir | libdir | \
        mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
-       archlibdir | docdir | package_path )
+       archlibdir | docdir | package_path )    
           dnl If the value was omitted, get it from the next argument.
           if test "$valomitted" = "yes"; then
             if test "$#" = 0; then
@@ -711,8 +712,7 @@ while test $# != 0; do
            dnl default values are built.
           case "$opt" in
              lispdir ) AC_DEFINE(LISPDIR_USER_DEFINED) ;;
-             sitelispdir ) AC_DEFINE(SITELISPDIR_USER_DEFINED) ;;
-             moduledir ) AC_DEFINE(MODULEDIR_USER_DEFINED) ;;
+dnl             sitelispdir ) AC_DEFINE(SITELISPDIR_USER_DEFINED) ;;
              etcdir  )  AC_DEFINE(ETCDIR_USER_DEFINED) ;;
              infodir ) AC_DEFINE(INFODIR_USER_DEFINED) ;;
              infopath ) AC_DEFINE(INFOPATH_USER_DEFINED) ;;
@@ -720,7 +720,6 @@ while test $# != 0; do
              datadir )
                AC_DEFINE(INFODIR_USER_DEFINED)
                AC_DEFINE(LISPDIR_USER_DEFINED)
-            AC_DEFINE(MODULEDIR_USER_DEFINED)
                AC_DEFINE(ETCDIR_USER_DEFINED) ;;
              statedir | lockdir ) AC_DEFINE(LOCKDIR_USER_DEFINED) ;;
              exec_prefix | libdir | archlibdir ) AC_DEFINE(ARCHLIBDIR_USER_DEFINED) ;;
@@ -733,10 +732,9 @@ while test $# != 0; do
        dnl Has the user asked for some help?
        "usage" | "help" ) ${PAGER-more} ${srcdir}/configure.usage; exit 0 ;;
 
-       dnl Has the user specified the toolkit(s) to use for GUI elements?
-       "with_menubars"   | \
-       "with_scrollbars" | \
-       "with_dialogs" )
+       dnl Has the user specified what toolkit to use for the menubars,
+       dnl scrollbar or dialogs?
+       "with_menubars" | "with_scrollbars" | "with_dialogs" )
          case "$val" in
            l | lu | luc | luci | lucid )               val=lucid  ;;
            m | mo | mot | moti | motif )               val=motif  ;;
@@ -749,13 +747,7 @@ while test $# != 0; do
          eval "$opt=\"$val\""
        ;;
 
-       dnl Obsolete legacy argument?  Warn, but otherwise ignore.
-       "run_in_place"  | \
-       "with_gnu_make" )
-         AC_MSG_WARN([Obsolete option \`--$optname' ignored.])
-       ;;
-
-        dnl Unrecognized option?  No mercy for user errors.
+        dnl Fail on unrecognized arguments.
        * ) USAGE_ERROR("Unrecognized option: $arg") ;;
 
       esac
@@ -764,7 +756,7 @@ while test $# != 0; do
     dnl Assume anything with multiple hyphens is a configuration name.
     *-*-*) configuration="$arg" ;;
 
-    dnl Unrecognized argument?  No mercy for user errors.
+    dnl Anything else is an error
     *) USAGE_ERROR("Unrecognized argument: $arg") ;;
 
   esac
@@ -786,16 +778,20 @@ eval set x "$quoted_arguments"; shift
 dnl --extra-verbose implies --verbose
 test "$extra_verbose" = "yes" && verbose=yes
 
+dnl Allow use of either ":" or spaces for lists of directories
+define(COLON_TO_SPACE,
+  [case "$[$1]" in *:* [)] [$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
+COLON_TO_SPACE(site_includes)
+COLON_TO_SPACE(site_libraries)
+COLON_TO_SPACE(site_prefixes)
+COLON_TO_SPACE(site_runtime_libraries)
+
 dnl with_x is an obsolete synonym for with_x11
 test -n "$with_x" && with_x11="$with_x"
 
-dnl --with-quantify or --with-purify imply --use-system-malloc
-if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
-  test "$with_system_malloc" = "default" && with_system_malloc=yes
-fi
-
 dnl --gung-ho=val is a synonym for
 dnl --use-minimal-tagbits=val --use-indexed-lrecord-implementation=val
+
 if test -n "$gung_ho"; then
   test -z "$use_minimal_tagbits" && use_minimal_tagbits="$gung_ho"
   test -z "$use_indexed_lrecord_implementation" && \
@@ -819,6 +815,11 @@ fi
 dnl CDE requires tooltalk
 XE_CHECK_FEATURE_DEPENDENCY(cde, tooltalk)
 
+dnl Ignore useless run-in-place flag
+if test "$run_in_place" = "yes"; then
+  AC_MSG_WARN("The --run-in-place option is ignored because it is unnecessary.")
+fi
+
 dnl Find the source directory.
 case "$srcdir" in
 
@@ -854,9 +855,13 @@ esac
 
 dnl ###########################################################################
 if test -z "$configuration"; then
-  dnl Guess the configuration
-  configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
-  if test -z "$configuration"; then
+  AC_MSG_CHECKING("host system type")
+  dnl Guess the configuration and remove 4th name component, if present.
+  if configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess | \
+    sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'` ; then
+    AC_MSG_RESULT($configuration)
+  else
+    AC_MSG_RESULT(unknown)
     USAGE_ERROR(["XEmacs has not been ported to this host type.
 Try explicitly specifying the CONFIGURATION when rerunning configure."])
   fi
@@ -979,13 +984,12 @@ dnl Given the configuration name, set machfile and opsysfile to the
 dnl names of the m/*.h and s/*.h files we should use.
 
 dnl Canonicalize the configuration name.
-AC_MSG_CHECKING("host system type")
+AC_CHECKING("the configuration name")
 dnl allow -workshop suffix on configuration name
 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
-canonical=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub "$internal_configuration"`
-XE_STRIP_4TH_COMPONENT(configuration)
-XE_STRIP_4TH_COMPONENT(canonical)
-AC_MSG_RESULT($configuration)
+if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else
+  exit $?
+fi
 
 dnl If you add support for a new configuration, add code to this
 dnl switch statement to recognize your configuration name and select
@@ -1015,7 +1019,7 @@ machine='' opsys=''
 dnl Straightforward machine determination
 case "$canonical" in
   sparc-*-*        ) machine=sparc ;;
-  alpha*-*-*       ) machine=alpha ;;
+  alpha-*-*        ) machine=alpha ;;
   vax-*-*          ) machine=vax ;;
   mips-dec-*       ) machine=pmax ;;
   mips-sgi-*       ) machine=iris4d ;;
@@ -1028,8 +1032,6 @@ case "$canonical" in
   m68*-sony-*      ) machine=news ;;
   mips-sony-*      ) machine=news-risc ;;
   clipper-*        ) machine=clipper ;;
-  arm-*            ) machine=arm ;;
-  ns32k-*          ) machine=ns32000 ;;
 esac
 
 dnl Straightforward OS determination
@@ -1056,9 +1058,9 @@ case "$canonical" in
   *-*-aix3.1*  ) opsys=aix3-1  ;;
   *-*-aix3.2.5 ) opsys=aix3-2-5        ;;
   *-*-aix3*    ) opsys=aix3-2  ;;
-  *-*-aix4.0*  ) opsys=aix4    ;;
+  *-*-aix4.2*  ) opsys=aix4-2  ;;
   *-*-aix4.1*  ) opsys=aix4-1  ;;
-  *-*-aix4*    ) opsys=aix4-2  ;;
+  *-*-aix4*    ) opsys=aix4    ;;
 
   dnl Other generic OSes
   *-gnu* )                     opsys=gnu    ;;
@@ -1100,9 +1102,13 @@ case "$canonical" in
   dnl OpenBSD ports
   *-*-openbsd* )
     case "${canonical}" in
+      alpha*-*-openbsd*)       machine=alpha ;;
       i386-*-openbsd*)         machine=intel386 ;;
       m68k-*-openbsd*)         machine=hp9000s300 ;;
       mipsel-*-openbsd*)       machine=pmax ;;
+      ns32k-*-openbsd*)                machine=ns32000 ;;
+      sparc-*-openbsd*)                machine=sparc ;;
+      vax-*-openbsd*)          machine=vax ;;
      esac
    ;;
 
@@ -1318,13 +1324,6 @@ case "$canonical" in
     NON_GNU_CPP=/usr/ccs/lib/cpp
   ;;
 
-  dnl NEC
-  mips-nec-sysv*)
-    machine=mips-nec
-    NON_GNU_CC=/usr/ccs/bin/cc
-    NON_GNU_CPP=/usr/ccs/lib/cpp
-  ;;
-
   dnl Silicon Graphics machines
   dnl Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
   m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;;
@@ -1493,7 +1492,7 @@ fi
 
 if test -z "$dynamic"; then
   case "$opsys" in
-    hpux* | sunos4* ) dynamic=no ;;
+    hpux* | sunos4* | sco5 ) dynamic=no ;;
     *) dynamic=yes ;;
   esac
 fi
@@ -1595,24 +1594,13 @@ dnl I'm tired of pop being broken with GLIBC -slb
 dnl Well. then why not fix fucking pop?
 test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE)
 
-
-dnl Identify compilers to enable compiler-specific hacks.
-dnl Add support for other compilers HERE!
-dnl GCC is already identified elsewhere.
-AC_TRY_RUN([int main () {
-#if defined __SUNPRO_C
-return 11;
-#elif defined __DECC
-return 12;
-#else
-return 0;
+AC_MSG_CHECKING(whether we are using SunPro C)
+AC_TRY_COMPILE([],[#ifndef __SUNPRO_C
+#error Not a  SunPro compiler :-(
+******* ======= ******** &&&&&&&&
 #endif
-}], [],
-[case "$conftest_rc" in
-  11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
-  12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
-esac])
-
+], __sunpro_c=yes, __sunpro_c=no)
+AC_MSG_RESULT($__sunpro_c)
 
 dnl case "$canonical" in
 dnl   *-sun-sunos* ) test "$CPP" = "acc -E" && CPP="acc -E -Xs" ;;
@@ -1718,7 +1706,7 @@ EOF
 
 dnl The value of CPP is a quoted variable reference, so we need to do this
 dnl to get its actual value...
-CPP=`eval "echo $CPP $CPPFLAGS"`
+CPP=`eval "echo $CPP"`
 define(TAB, [  ])dnl
 changequote(, )dnl
 eval `$CPP -Isrc $tempcname \
@@ -1738,10 +1726,6 @@ test "$extra_verbose" = "yes" && \
 dnl Non-ordinary link usually requires -lc
 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
 
-dnl Compiler-specific hacks
-dnl DEC C requires -std
-test "$__DECC" = "yes" && XE_APPEND(-std, c_switch_site)
-
 dnl Calculalate value of CFLAGS:
 dnl Use either command line flag, environment var, or autodetection
 if test "$cflags_specified" = "no"; then
@@ -1752,20 +1736,18 @@ if test "$cflags_specified" = "no"; then
     dnl I'm not convinced this is a good idea any more. -sb
     dnl test "$opsys $machine" = "linux intel386" && \
     dnl CFLAGS="$CFLAGS -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2"
-    dnl cygwin b19 can't cope with -O3, but most people use 20.1 or egcs now.
-    dnl    test "$opsys $machine" = "cygwin32 intel386" && \
-    dnl      CFLAGS="-g -O2 -Wall -Wno-switch"
-  elif test "$__SUNPRO_C" = "yes"; then
+    dnl cygwin can't cope with -O3
+    test "$opsys $machine" = "cygwin32 intel386" && \
+      CFLAGS="-g -O2 -Wall -Wno-switch"
+  elif test "$__sunpro_c" = "yes"; then
     case "$opsys" in
       sol2    ) CFLAGS="-v -xO4" ;;
       sunos4* ) CFLAGS="-xO2";;
     esac
-  elif test "$__DECC" = "yes"; then
-    CFLAGS="-O3"
   elif test "$CC" = "xlc"; then
-    CFLAGS="-g -O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
-  dnl ### Add optimal CFLAGS support for other compilers HERE!
+    CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
   else
+    dnl ### Add tests for other compilers here...
     CFLAGS="-O" ;dnl The only POSIX-approved flag
   fi
 fi
@@ -1777,8 +1759,8 @@ if test "$GCC" = "yes"; then
   set x $[$1]; shift; [$1]=""
   while test -n "[$]1"; do
     case [$]1 in
-      -L  | -l  | -u               ) [$1]="$[$1] [$]1 [$]2"; shift ;;
-      -L* | -l* | -u* | -Wl* | -pg ) [$1]="$[$1] [$]1" ;;
+      -L  | -l  | -u         ) [$1]="$[$1] [$]1 [$]2"; shift ;;
+      -L* | -l* | -u* | -Wl* ) [$1]="$[$1] [$]1" ;;
       -Xlinker* ) ;;
       * ) [$1]="$[$1] -Xlinker [$]1" ;;
     esac
@@ -1850,61 +1832,39 @@ dnl ---------------------------------------------------------------
 dnl Add site and system specific flags to compile and link commands
 dnl ---------------------------------------------------------------
 
-dnl Allow use of either ":" or spaces for lists of directories
-define(COLON_TO_SPACE,
-  [case "$[$1]" in *:* [)] [$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl
+dnl All dirs present in site-prefixes will be searched for include/ and lib/
+dnl subdirs. This can avoid specifying both site-includes and site-libraries.
+dnl Those dirs will take precedence over the standard places, but not over
+dnl site-includes and site-libraries.
+
+dnl --site-prefixes (multiple dirs)
+if test -n "$site_prefixes"; then
+  for arg in $site_prefixes; do
+    case "$arg" in
+       -* ) ;;
+       * ) argi="-I${arg}/include" ; argl="-L${arg}/lib" ;;
+    esac
+    XE_APPEND($argi, c_switch_site)
+    XE_APPEND($argl, ld_switch_site)
+  done
+fi
 
 dnl --site-libraries (multiple dirs)
-COLON_TO_SPACE(site_libraries)
 if test -n "$site_libraries"; then
   for arg in $site_libraries; do
-    case "$arg" in
-     -* ) ;;
-     * ) test -d "$arg" || \
-           XE_DIE("Invalid site library \`$arg': no such directory")
-       arg="-L${arg}" ;;
-    esac
+    case "$arg" in -* ) ;; * ) arg="-L${arg}" ;; esac
     XE_APPEND($arg, ld_switch_site)
   done
 fi
 
 dnl --site-includes (multiple dirs)
-COLON_TO_SPACE(site_includes)
 if test -n "$site_includes"; then
   for arg in $site_includes; do
-    case "$arg" in
-      -* ) ;;
-      * ) test -d "$arg" || \
-           XE_DIE("Invalid site include \`$arg': no such directory")
-      arg="-I${arg}" ;;
-    esac
+    case "$arg" in -* ) ;; * ) arg="-I${arg}" ;; esac
     XE_APPEND($arg, c_switch_site)
   done
 fi
 
-dnl --site-prefixes (multiple dirs)
-dnl --site-prefixes=dir1:dir2 is a convenient shorthand for
-dnl --site-libraries=dir1/lib:dir2/lib --site-includes=dir1/include:dir2/include
-dnl Site prefixes take precedence over the standard places, but not over
-dnl site-includes and site-libraries.
-COLON_TO_SPACE(site_prefixes)
-if test -n "$site_prefixes"; then
-  for dir in $site_prefixes; do
-    inc_dir="${dir}/include"
-    lib_dir="${dir}/lib"
-    if test ! -d "$dir"; then
-      XE_DIE("Invalid site prefix \`$dir': no such directory")
-    elif test ! -d "$inc_dir"; then
-      XE_DIE("Invalid site prefix \`$dir': no such directory \`$inc_dir'")
-    elif test ! -d "$lib_dir"; then
-      XE_DIE("Invalid site prefix \`$dir': no such directory \`$lib_dir'")
-    else
-      XE_APPEND("-I$inc_dir", c_switch_site)
-      XE_APPEND("-L$lib_dir", ld_switch_site)
-    fi
-  done
-fi
-
 dnl GNU software installs by default into /usr/local/{include,lib}
 dnl if test -d "/usr/local/include" -a -d "/usr/local/lib"; then
 dnl   XE_APPEND("-L/usr/local/lib",    ld_switch_site)
@@ -1917,7 +1877,6 @@ for dir in "/usr/ccs/lib"; do
 done
 
 dnl --site-runtime-libraries (multiple dirs)
-COLON_TO_SPACE(site_runtime_libraries)
 if test -n "$site_runtime_libraries"; then
   LD_RUN_PATH="`echo $site_runtime_libraries | sed -e 's/  */:/g'`"
   export LD_RUN_PATH
@@ -1930,7 +1889,7 @@ dnl -------------------------------------
 if   test "$dynamic" = "no"; then add_runtime_path=no
 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
 else case "$opsys" in
-       sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
+       sol2 | irix* | *bsd* ) add_runtime_path=yes ;;
        * ) add_runtime_path=no ;;
      esac
 fi
@@ -1939,19 +1898,14 @@ if test "$add_runtime_path" = "yes"; then
   dnl Try to autodetect runtime library flag (usually -R),
   dnl and whether it works (or at least does no harm)
   AC_MSG_CHECKING("for runtime libraries flag")
-  case "$opsys" in
-    sol2 ) dash_r="-R" ;;
-    decosf* | linux* ) dash_r="-rpath " ;;
-    *)
-      dash_r=""
-      for try_dash_r in "-R" "-R " "-rpath "; do
-        xe_check_libs="${try_dash_r}/no/such/file-or-directory"
-        XE_PROTECT_LINKER_FLAGS(xe_check_libs)
-        AC_TRY_LINK(, , dash_r="$try_dash_r")
-        xe_check_libs=""
-        test -n "$dash_r" && break
-      done ;;
-  esac
+  dash_r=""
+  for try_dash_r in "-R" "-R " "-rpath "; do
+    xe_check_libs="${try_dash_r}/no/such/file-or-directory"
+    XE_PROTECT_LINKER_FLAGS(xe_check_libs)
+    AC_TRY_LINK(, , dash_r="$try_dash_r")
+    xe_check_libs=""
+    test -n "$dash_r" && break
+  done
   if test -n "$dash_r";
     then AC_MSG_RESULT("\"${dash_r}\"")
     else AC_MSG_RESULT(NONE)
@@ -2029,9 +1983,6 @@ fi
 ])dnl
 XE_COMPUTE_RUNPATH()
 
-dnl JKJ REMOVEME
-dnl XE_SHLIB_STUFF
-
 dnl -----------------------------------
 dnl Do some misc autoconf-special tests
 dnl -----------------------------------
@@ -2107,8 +2058,8 @@ AC_PROG_YACC
 
 dnl checks for header files
 AC_CHECK_HEADERS(mach/mach.h sys/stropts.h sys/timeb.h sys/time.h unistd.h)
-AC_CHECK_HEADERS(utime.h locale.h libgen.h fcntl.h ulimit.h cygwin/version.h)
-AC_CHECK_HEADERS(kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h)
+AC_CHECK_HEADERS(utime.h locale.h libgen.h fcntl.h ulimit.h)
+AC_CHECK_HEADERS(linux/version.h kstat.h sys/pstat.h inttypes.h sys/un.h a.out.h)
 AC_HEADER_SYS_WAIT
 AC_HEADER_STDC
 AC_HEADER_TIME
@@ -2330,9 +2281,6 @@ if test "$with_x11" = "yes"; then
     fi
   done
 
-  dnl Avoid version mismatch for shared library libXm.so on osf4
-  if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi
-
   ld_switch_x_site="$X_LIBS"
 
   XE_COMPUTE_RUNPATH()
@@ -2468,7 +2416,6 @@ if test "$with_msw" != "no"; then
     AC_DEFINE(HAVE_MS_WINDOWS)
     install_pp="$blddir/lib-src/installexe.sh"
     XE_APPEND(-lshell32 -lgdi32 -luser32 -lcomctl32, libs_system)
-    test "$with_dragndrop" != no && XE_APPEND(msw, dragndrop_proto)
     if test "$window_system" != x11; then
        window_system=msw
        test "$with_scrollbars" != "no" && with_scrollbars=msw \
@@ -2480,12 +2427,12 @@ if test "$with_msw" != "no"; then
        test "$with_dialogs"   != "no" && with_dialogs=msw \
            && XE_ADD_OBJS(dialog-msw.o)
     else
-       test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-msw.o)
+       test "$with_scrollbars"   != "no" && XE_ADD_OBJS(scrollbar-msw.o)
        test "$with_menubars"   != "no" && XE_ADD_OBJS(menubar-msw.o)
        test "$with_toolbars"   != "no" && XE_ADD_OBJS(toolbar-msw.o)
-       test "$with_dialogs"    != "no" && XE_ADD_OBJS(dialog-msw.o)
+       test "$with_dialogs"   != "no" && XE_ADD_OBJS(dialog-msw.o)
     fi
-    dnl check for our special version of select
+    dnl check for our special version of select        
     AC_TRY_RUN([#include <fcntl.h>
     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }],
     [AC_DEFINE(HAVE_MSG_SELECT)])
@@ -2493,7 +2440,7 @@ if test "$with_msw" != "no"; then
     with_file_coding=yes
     use_minimal_tagbits=yes
     use_indexed_lrecord_implementation=yes
-    XE_ADD_OBJS(console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o gui-msw.o)
+    XE_ADD_OBJS(console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o)
   fi
 fi
 
@@ -2503,7 +2450,7 @@ test -z "$window_system" && window_system="none"
 
 dnl Test for features that require a window system - ANY window system
 if test "$window_system" = "none"; then
-  for feature in menubars scrollbars toolbars dialogs dragndrop xface
+  for feature in menubars scrollbars toolbars dialogs dragndrop
   do
     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
        AC_MSG_WARN([--with-$feature ignored:  Not valid without window system support])
@@ -2535,7 +2482,8 @@ if test "$with_x11" != "yes"; then
   dnl if test "$with_tty" = "no" ; then
   dnl   AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.])
   dnl fi
-  for feature in tooltalk cde offix session xim xmu 
+  for feature in tooltalk cde offix session xim xmu \
+                 xface
   do
     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
        AC_MSG_WARN([--with-$feature ignored:  Not valid without X support])
@@ -2632,7 +2580,7 @@ if test "$with_cde" = "yes" ; then
 fi
 
 dnl Always compile OffiX unless --without-offix is given, no
-dnl X11 support is compiled in, no standard Xmu is available,
+dnl X11 support is compiled in, no standard Xmu is avaiable,
 dnl or dragndrop support is disabled
 dnl Because OffiX support currently loses when more than one display
 dnl is in use, we now disable it by default -slb 07/10/1998.
@@ -2703,7 +2651,6 @@ if test "$window_system" != "none"; then
   AC_CHECKING(for graphics libraries)
 
   dnl Autodetect Xpm
-  xpm_problem=""
   if test -z "$with_xpm"; then
     AC_MSG_CHECKING(for Xpm - no older than 3.4f)
     xe_check_libs=-lXpm
@@ -2713,22 +2660,22 @@ if test "$window_system" != "none"; then
       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
       XpmIncludeVersion < 30406 ? 2 : 0 ;}],
     [./conftest dummy_arg; xpm_status=$?;
-      if test "$xpm_status" = "0"; then
+      if test "$?" = "0"; then
         with_xpm=yes;
       else
         with_xpm=no;
-        if test "$xpm_status" = "1"; then
+        if test "$?" = "1"; then
           xpm_problem="Xpm library version and header file version don't match!"
-        elif test "$xpm_status" = "2"; then
+        elif test "$?" = "2"; then
           xpm_problem="Xpm library version is too old!"
         else
           xpm_problem="Internal xpm detection logic error!"
         fi
         echo "
-*** WARNING *** $xpm_problem
+*** WARNING *** $problem
   I'm not touching that with a 10-foot pole!
   If you really want to use the installed version of Xpm, rerun
-  configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!"
+  configure --with-xpm=yes, but don't blame me if XEmacs crashes!"
     fi],
     [with_xpm=no])
     xe_check_libs=
@@ -2749,24 +2696,6 @@ if test "$window_system" != "none"; then
     fi
   fi
 
-  dnl Autodetect XFACE
-  test -z "$with_xface" && { AC_CHECK_HEADER(compface.h,          ,with_xface=no) }
-  test -z "$with_xface" && { AC_CHECK_LIB(compface, UnGenFace,[:] ,with_xface=no) }
-  test -z "$with_xface" && with_xface=yes
-  if test "$with_xface" = "yes"; then
-    AC_DEFINE(HAVE_XFACE)
-    XE_PREPEND(-lcompface, libs_x)
-  fi
-
-  dnl For a brief period we had the GIF code split out into a separate library,
-  dnl but patent problems, etc. sort of squashed that idea.
-  dnl We default to building with builtin GIF decoding
-  if test "$with_gif" != "no"; then
-    with_gif="yes"
-    AC_DEFINE(HAVE_GIF)
-    XE_ADD_OBJS(dgif_lib.o gif_io.o)
-  fi
-
   dnl Too many stupid linkers can't detect cascaded lib dependencies until runtime
   dnl So we always search for libz compression support.
   if test "$with_png $with_tiff" != "no no"; then
@@ -2775,6 +2704,16 @@ if test "$window_system" != "none"; then
     AC_CHECK_LIB(gz, inflate, [XE_PREPEND(-lgz, libs_x)])])])
   fi
 
+  dnl Autodetect GIFlib
+  AC_MSG_CHECKING(for gifreader)
+  test -z "$with_gif" && { AC_CHECK_HEADER(gifrlib.h,        ,with_gif=no) }
+  test -z "$with_gif" && { AC_CHECK_LIB(gifreader, GetGifError,[:] ,with_gif=no) }
+  test -z "$with_gif" && with_gif=yes
+  if test "$with_gif" = "yes"; then
+    AC_DEFINE(HAVE_GIF)
+    XE_PREPEND(-lgifreader, libs_x)
+  fi
+
   dnl autodetect JPEG
   test -z "$with_jpeg" && { AC_CHECK_HEADER(jpeglib.h,                    ,with_jpeg=no) }
   test -z "$with_jpeg" && { AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,[:],with_jpeg=no) }
@@ -2785,38 +2724,18 @@ if test "$window_system" != "none"; then
   fi
 
   dnl autodetect PNG
-  png_problem=""
-  test -z "$with_png" && { AC_CHECK_FUNC(pow,                  ,with_png=no) }
-  test -z "$with_png" && { AC_CHECK_HEADER(png.h,              ,with_png=no) }
-  test -z "$with_png" && { AC_CHECK_LIB(png, png_read_image,[:],with_png=no) }
   if test -z "$with_png"; then
-    AC_MSG_CHECKING(for workable png version information)
-    xe_check_libs="-lpng -lz"
-    AC_TRY_RUN([#include <png.h>
-    int main(int c, char **v) {
-    if (c == 1) return 0;
-    if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
-    return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}],
-    [./conftest dummy_arg; png_status=$?;
-      if test "$png_status" = "0"; then
-       with_png=yes;
-      else
-       with_png=no;
-       if test "$png_status" = "1"; then
-         png_problem="PNG library version and header file don't match!"
-        elif test "$png_status" = "2"; then
-         png_problem="PNG library version too old (pre 1.0.2)!"
-       fi
-       echo "
-*** WARNING *** $png_problem
-  I'm not touching that with a 10-foot pole!
-  If you really want to use the installed version of libPNG, rerun
-  configure and add '--with-png=yes', but don't blame me if XEmacs crashes!"
-    fi],
-    [with_png=no])
-    xe_check_libs=
-    AC_MSG_RESULT($with_png)
+    AC_MSG_CHECKING(for png.h - no older than 0.96)
+    AC_EGREP_CPP(yes,
+[#include <png.h>
+#if PNG_LIBPNG_VER >= 96
+yes
+#endif
+], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); with_png=no])
   fi
+  test -z "$with_png" && { AC_CHECK_FUNC(pow,                  ,with_png=no) }
+  test -z "$with_png" && { AC_CHECK_LIB(png, png_read_image,[:],with_png=no) }
+  test -z "$with_png" && with_png=yes
   if test "$with_png" = "yes"; then
     AC_DEFINE(HAVE_PNG)
     XE_PREPEND(-lpng, libs_x)
@@ -2833,13 +2752,22 @@ if test "$window_system" != "none"; then
 fi
 
 dnl ----------------------
-dnl X-Specific Graphics libraries
+dnl Graphics libraries
 dnl ----------------------
 
 if test "$with_x11" = "yes"; then
 
   AC_CHECKING(for X11 graphics libraries)
 
+  dnl Autodetect XFACE
+  test -z "$with_xface" && { AC_CHECK_HEADER(compface.h,          ,with_xface=no) }
+  test -z "$with_xface" && { AC_CHECK_LIB(compface, UnGenFace,[:] ,with_xface=no) }
+  test -z "$with_xface" && with_xface=yes
+  if test "$with_xface" = "yes"; then
+    AC_DEFINE(HAVE_XFACE)
+    XE_PREPEND(-lcompface, libs_x)
+  fi
+
   dnl Autodetect -lXaw
   AC_CHECK_LIB(Xaw, XawScrollbarSetThumb, have_xaw=yes, have_xaw=no)
   dnl if test "$have_xaw" = "yes"; then
@@ -2931,6 +2859,7 @@ test "$with_menubars"   != "no"      && XE_ADD_OBJS(menubar.o)
 test "$with_scrollbars" != "no"      && XE_ADD_OBJS(scrollbar.o)
 test "$with_dialogs"    != "no"      && XE_ADD_OBJS(dialog.o)
 test "$with_toolbars"   != "no"      && XE_ADD_OBJS(toolbar.o)
+test "$all_widgets" != "no no no no" && XE_ADD_OBJS(gui.o)
 
 if test "$with_x11" = "yes"; then
   test "$with_menubars"   != "no"      && XE_ADD_OBJS(menubar-x.o)
@@ -3027,19 +2956,14 @@ if test "$with_mule" = "yes" ; then
     test "$ac_cv_func_crypt" != "yes" && { AC_CHECK_LIB(crypt, crypt) }
   fi
   dnl Back to our regularly scheduled wnn hunting
-  if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
-    AC_CHECK_LIB(wnn,jl_dic_list_e,libwnn=wnn,
-      AC_CHECK_LIB(wnn4,jl_dic_list_e,libwnn=wnn4,
-       AC_CHECK_LIB(wnn6,jl_dic_list_e,libwnn=wnn6,
-         AC_CHECK_LIB(wnn6_fromsrc,dic_list_e,libwnn=wnn6_fromsrc,with_wnn=no))))
-  fi
+  test -z "$with_wnn" && { AC_CHECK_LIB(wnn,jl_dic_list_e,[:],with_wnn=no) }
   test -z "$with_wnn" && with_wnn=yes
   if test "$with_wnn" = "yes"; then
     AC_DEFINE(HAVE_WNN)
-    XE_PREPEND(-l$libwnn, libs_x)
+    XE_PREPEND(-lwnn, libs_x)
     XE_ADD_OBJS(mule-wnnfns.o)
     if test "$with_wnn6" != "no"; then
-      AC_CHECK_LIB($libwnn, jl_fi_dic_list, with_wnn6=yes)
+      AC_CHECK_LIB(wnn, jl_fi_dic_list, with_wnn6=yes)
       test "$with_wnn6" = "yes" && AC_DEFINE(WNN6)
     fi
   fi
@@ -3097,15 +3021,11 @@ dnl The realpath in ELF linux libc's is O.K.
 dnl For example, call realpath on a file thirty-five or so directories deep
 dnl and you get ELOOP even if no symlinks at all are involved.
 dnl Reports as of 11/1997 indicate BSDi has problems too.
-dnl The realpath() in UnixWare2.1.3 could not get any pathname fragment in error condition.
 case "$opsys" in
   linuxaout* | bsdos3* | freebsd* | decosf4-0* | aix4* ) XE_ADD_OBJS(realpath.o) ;;
   * )
-    case "$canonical" in
-      *-*-sysv4.2uw2* ) XE_ADD_OBJS(realpath.o) ;;
-      * ) AC_CHECK_FUNCS(realpath)
-         test "$ac_cv_func_realpath" != "yes" && XE_ADD_OBJS(realpath.o) ;;
-    esac ;;
+    AC_CHECK_FUNCS(realpath)
+    test "$ac_cv_func_realpath" != "yes" && XE_ADD_OBJS(realpath.o) ;;
 esac
 
 dnl If netdb.h does not declare h_errno, we must declare it by hand.
@@ -3261,7 +3181,6 @@ int main (int argc, char *argv[])
 esac
 AC_MSG_RESULT($have_mmap)
 test "$have_mmap" = "yes" && AC_DEFINE(HAVE_MMAP)
-AC_FUNC_MMAP
 
 dnl rel_alloc requires either GNU malloc or system malloc with mmap
 dnl We only turn rel_alloc on by default if mmap is available.
@@ -3404,7 +3323,7 @@ case "$with_sound" in both | nas )
   XE_ADD_OBJS(nas.o)
   XE_PREPEND(-laudio, libs_x)
   dnl If the nas library does not contain the error jump point,
-  dnl then we force safer behavior.
+  dnl then we force safer behaviour.
   AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[AC_DEFINE(NAS_NO_ERROR_JUMP)])
 esac
 
@@ -3493,48 +3412,45 @@ dnl Do we need event-unixoid.o ?
 test "$with_x11" = "yes" -o "$with_tty" = "yes" && XE_ADD_OBJS(event-unixoid.o)
 
 dnl Database support
+dnl <mdiers@logware.de>
 dnl We do not necessarily have to have libdb/lib(g)dbm for DB/(G)DBM support.
 dnl On FreeBSD, both DB and DBM are part of libc.
-dnl By default, we check for DBM support in libgdbm, then libc, then libdbm.
-
-test "$with_database_gnudbm $with_database_dbm $with_database_berkdb" \
-  != "no no no" && AC_CHECKING(for database support)
-
-dnl Check for ndbm.h, required for either kind of DBM support.
-if test "$with_database_gnudbm $with_database_dbm" != "no no"; then
-  AC_CHECK_HEADER(ndbm.h, [:], [
-    test "$with_database_gnudbm" = "yes" -o \
-         "$with_database_dbm"    = "yes" && \
-      XE_DIE("Required DBM support cannot be provided.")
-    with_database_gnudbm=no with_database_dbm=no])
-fi
+dnl Note that unless support for DB/(G)DBM is explicitly disabled, we always
+dnl want to check for libdb/lib(g)dbm. Also note that libc will not be
+dnl checked if we have the libraries.
+dnl If support for DB/(G)DBM is requested, but we neither have libdb/lib(g)dbm,
+dnl nor does libc implement it, we are a bit lost :)
+
+AC_CHECKING(for database support)
 
-dnl Check for DBM support in libgdbm.
 if test "$with_database_gnudbm" != "no"; then
-  AC_CHECK_LIB(gdbm, dbm_open, [
-   with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm], [
-   if test "$with_database_gnudbm" = "yes"; then
-     XE_DIE("Required GNU DBM support cannot be provided.")
-   fi
-   with_database_gnudbm=no])
+  AC_CHECK_HEADERS(ndbm.h, have_ndbm_h=yes)
+  if test "$have_ndbm_h" = "yes"; then
+    AC_CHECK_LIB(gdbm, dbm_open, with_database_gnudbm=yes have_libgdbm=yes)
+  fi
+  if test "$with_database_gnudbm" != "yes"; then
+    AC_CHECK_FUNC(dbm_open, with_database_gnudbm=yes)
+      fi
+  if test "$with_database_gnudbm" = "yes"; then
+    AC_DEFINE(HAVE_DBM)
+    test "$have_libgdbm" = "yes" && XE_PREPEND(-lgdbm, LIBS)
+    with_database_dbm=no
+  else with_database_gnudbm=no
+  fi
 fi
 
-dnl Check for DBM support in libc and libdbm.
 if test "$with_database_dbm" != "no"; then
-  AC_CHECK_FUNC(dbm_open, [with_database_dbm=yes libdbm=], [
-    AC_CHECK_LIB(dbm, dbm_open, [with_database_dbm=yes libdbm=-ldbm], [
-      test "$with_database_dbm" = "yes" && \
-        XE_DIE("Required DBM support cannot be provided.")
-      with_database_dbm=no])])
+  AC_CHECK_FUNC(dbm_open, with_database_dbm=yes need_libdbm=no)
+  if test "$need_libdbm" != "no"; then
+    AC_CHECK_LIB(dbm, dbm_open, with_database_dbm=yes need_libdbm=yes)
+  fi
+  if test "$with_database_dbm" = "yes"; then
+    AC_DEFINE(HAVE_DBM)
+    test "$need_libdbm" = "yes" && XE_PREPEND(-ldbm, LIBS)
+  else with_database_dbm=no
+  fi
 fi
 
-dnl Tell make about the DBM support we detected.
-test -n "$libdbm" && XE_PREPEND("$libdbm", LIBS)
-test "$with_database_gnudbm" = "yes" -o \
-     "$with_database_dbm"    = "yes" && \
-  AC_DEFINE(HAVE_DBM)
-
-dnl Check for Berkeley DB.
 if test "$with_database_berkdb" != "no"; then
   AC_MSG_CHECKING(for Berkeley db.h)
   for path in "db/db.h" "db.h"; do
@@ -3551,7 +3467,7 @@ typedef uint64_t u_int64_t;
 #include <$path>
 ],[], db_h_path="$path"; break)
   done
-  if test -z "$db_h_path"
+  if test -z "$db_h_path" 
   then AC_MSG_RESULT(no); with_database_berkdb=no
   else AC_MSG_RESULT($db_h_path)
   fi
@@ -3595,26 +3511,26 @@ if test "$usage_tracking" = "yes"; then
 fi
 
 dnl autodetect dll support
-AC_CHECK_HEADERS(dlfcn.h, [have_dlfcn=yes
-  AC_DEFINE(HAVE_DLFCN_H)])
+AC_CHECK_HEADERS(dlfcn.h, have_dlfcn=yes)
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { AC_CHECK_LIB(dl,  dlopen,   [ AC_DEFINE(HAVE_DLOPEN) DLL_LIB=dl;  with_shlib=yes]) }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { AC_CHECK_LIB(c,   _dlopen,  [ AC_DEFINE(HAVE_DLOPEN) DLL_LIB=;   with_shlib=yes]) }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { AC_CHECK_LIB(c,   dlopen,   [ AC_DEFINE(HAVE_DLOPEN) DLL_LIB=;   with_shlib=yes]) }
 test -z "$with_shlib" && { AC_CHECK_LIB(dld, shl_load, [ AC_DEFINE(HAVE_SHL_LOAD) DLL_LIB=dld; with_shlib=yes]) }
 test -z "$with_shlib" && { AC_CHECK_LIB(dld, dld_init, [ AC_DEFINE(HAVE_DLD_INIT) DLL_LIB=dld; with_shlib=yes]) }
 if test "$with_shlib" = "yes"; then
-  XE_SHLIB_STUFF
-  if test "$can_build_shared" = "yes"; then
-    AC_DEFINE(HAVE_SHLIB)
-    XE_ADD_OBJS(sysdll.o)
-    XE_ADD_OBJS(emodules.o)
-    XE_APPEND(src, INSTALL_ARCH_DEP_SUBDIR)
-    test ! -z "$DLL_LIB" && XE_PREPEND(-l${DLL_LIB}, LIBS)
-    AC_CHECK_FUNCS(dlerror _dlerror)
-  else
-    AC_MSG_WARN(disabling shared library support)
-    with_shlib=no
-  fi
+  AC_DEFINE(HAVE_SHLIB)
+  XE_ADD_OBJS(sysdll.o)
+  XE_ADD_OBJS(dll.o)
+  test ! -z "$DLL_LIB" && XE_PREPEND(-l${DLL_LIB}, LIBS)
+  XE_MAKE_SHAREDLIB
+  AC_CHECK_FUNCS(dlerror)
+  ld_dynamic_link_flags=
+  dnl Fill this in with other values as this gets more testing
+  case "$opsys" in
+  hpux*)  ld_dynamic_link_flags="-Wl,-E" ;;
+  linux*) ld_dynamic_link_flags="-rdynamic" ;;
+  *) ;;
+  esac
 fi
 
 dnl Unfortunately, just because we can link doesn't mean we can run.
@@ -3666,7 +3582,7 @@ XE_SPACE(ld_libs_all, $ld_libs_window_system $ld_libs_general)
 dnl Compute lists of Makefiles and subdirs
 AC_SUBST(SRC_SUBDIR_DEPS)
 XE_APPEND(src, MAKE_SUBDIR)
-internal_makefile_list="Makefile.in"
+internal_makefile_list="Makefile"
 SUBDIR_MAKEFILES=''
 test -d lock || mkdir lock
 for dir in $MAKE_SUBDIR; do
@@ -3676,7 +3592,7 @@ for dir in $MAKE_SUBDIR; do
       done ) ;;
    * ) test -d "$dir" || mkdir "$dir" ;;
   esac
-  XE_SPACE(SUBDIR_MAKEFILES, $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile)
+  XE_SPACE(SUBDIR_MAKEFILES, $SUBDIR_MAKEFILES $dir/Makefile)
   XE_SPACE(internal_makefile_list, $internal_makefile_list $dir/Makefile.in)
 done
 AC_SUBST(INSTALL_ARCH_DEP_SUBDIR)
@@ -3707,7 +3623,7 @@ if test -f $srcdir/src/gdbinit -a ! -f src/gdbinit ; then
 fi
 
 dnl Create top level .sbinit for Sun compilers
-if test "$__SUNPRO_C" = "yes"; then
+if test "$__sunpro_c" = "yes"; then
   echo "creating .sbinit"; echo ""
   ( echo "# For use with Sun WorkShop's Source browser."
     echo "# See sbquery(1) and sbinit(4) for more information"
@@ -3802,38 +3718,16 @@ while true; do
 done
 AC_SUBST(LISPDIR)
 
-AC_SUBST(moduledir)
-AC_SUBST(MODULEDIR_USER_DEFINED)
-MODULEDIR=$moduledir
-while true; do
-  case "$MODULEDIR" in
-    *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
-    *) break ;;
-  esac
-done
-AC_SUBST(MODULEDIR)
-
-AC_SUBST(sitelispdir)
-AC_SUBST(SITELISPDIR_USER_DEFINED)
-SITELISPDIR=$sitelispdir
-while true; do
-  case "$SITELISPDIR" in
-    *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
-    *) break ;;
-  esac
-done
-AC_SUBST(SITELISPDIR)
-
-AC_SUBST(sitemoduledir)
-AC_SUBST(SITEMODULEDIR_USER_DEFINED)
-SITEMODULEDIR=$sitemoduledir
-while true; do
-  case "$SITEMODULEDIR" in
-    *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
-    *) break ;;
-  esac
-done
-AC_SUBST(SITEMODULEDIR)
+dnl AC_SUBST(sitelispdir)
+dnl AC_SUBST(SITELISPDIR_USER_DEFINED)
+dnl SITELISPDIR=$sitelispdir
+dnl while true; do
+dnl   case "$SITELISPDIR" in
+dnl     *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
+dnl     *) break ;;
+dnl   esac
+dnl done
+dnl AC_SUBST(SITELISPDIR)
 
 AC_SUBST(etcdir)
 AC_SUBST(ETCDIR_USER_DEFINED)
@@ -3871,12 +3765,13 @@ AC_SUBST(ARCHLIBDIR)
 AC_SUBST(docdir)
 AC_SUBST(bitmapdir)
 AC_SUBST(extra_objs)
+AC_SUBST(ld_dynamic_link_flags)
 
 dnl The following flags combine all the information from:
 dnl - command line options (user always gets priority)
 dnl - user environment variables
 dnl - determined by configure
-dnl - the s&m header files (required for ellcc)
+dnl - the s&m header files (deprecated)
 AC_SUBST(machfile)
 AC_SUBST(opsysfile)
 AC_SUBST(c_switch_general)
@@ -3899,20 +3794,10 @@ AC_SUBST(sound_cflags)
 AC_SUBST(RANLIB)
 AC_SUBST(dynodump_arch)
 
-dnl Preliminary support for using a different compiler for xemacs itself.
-dnl Useful for building XEmacs with a C++ or 64-bit compiler.
-: ${XEMACS_CC:=$CC}
-AC_SUBST(XEMACS_CC)
-
-
-dnl The default is no
+# The default is yes
 if test "$with_site_lisp" = "no"; then
   AC_DEFINE(INHIBIT_SITE_LISP)
 fi
-dnl The default is yes
-if test "$with_site_modules" = "no"; then
-  AC_DEFINE(INHIBIT_SITE_MODULES)
-fi
 
 XE_SPACE(ac_configure_args, $ac_configure_args)
 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "$canonical")
@@ -3945,9 +3830,9 @@ fi
 test "$with_i18n3"         = "yes" && AC_DEFINE(I18N3)
 test "$GCC"                = "yes" && AC_DEFINE(USE_GCC)
 test "$external_widget"    = "yes" && AC_DEFINE(EXTERNAL_WIDGET)
+test "$with_gnu_make"      = "yes" && AC_DEFINE(USE_GNU_MAKE)
 test "$no_doc_file"        = "yes" && AC_DEFINE(NO_DOC_FILE)
 dnl test "$const_is_losing"    = "yes" && AC_DEFINE(CONST_IS_LOSING)
-test "$with_purify"        = "yes" && AC_DEFINE(PURIFY)
 test "$with_quantify"      = "yes" && AC_DEFINE(QUANTIFY)
 test "$with_pop"           = "yes" && AC_DEFINE(MAIL_USE_POP)
 test "$with_kerberos"      = "yes" && AC_DEFINE(KERBEROS)
@@ -4014,37 +3899,21 @@ if test "$with_xpm" = yes; then
 elif test "$with_x11" = yes; then
   echo "  --------------------------------------------------------------------"
   echo "  WARNING: Compiling without XPM support."
-  if test "$xpm_problem" != ""; then
-    echo "  Reason: $xpm_problem"
-  fi
-  echo "  WARNING: You should strongly consider installing XPM."
+  echo "  WARNING: You should strongly considering installing XPM."
   echo "  WARNING: Otherwise toolbars and other graphics will look suboptimal."
-  echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
-  echo "  --------------------------------------------------------------------"
-fi
-if test "$with_png" = yes; then
-  echo "  Compiling in support for PNG image handling."
-elif test "$window_system" != "none"; then
-  echo "  --------------------------------------------------------------------"
-  echo "  WARNING: Compiling without PNG image support."
-  if test "$png_problem" != ""; then
-    echo "  Reason: $png_problem"
-  fi
-  echo "  WARNING: You should strongly consider installing the PNG libraries."
-  echo "  WARNING: Otherwise certain images and glyphs may not display."
-  echo "  WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)"
   echo "  --------------------------------------------------------------------"
 fi
-test "$with_gif"   = yes && echo "  Compiling in support for (builtin) GIF image handling."
-test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image handling."
-test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image handling."
 test "$with_xface" = yes && echo "  Compiling in support for X-Face message headers."
+test "$with_gif"   = yes && echo "  Compiling in support for GIF image conversion."
+test "$with_jpeg"  = yes && echo "  Compiling in support for JPEG image conversion."
+test "$with_png"   = yes && echo "  Compiling in support for PNG image conversion."
+test "$with_tiff"  = yes && echo "  Compiling in support for TIFF image conversion."
 case "$with_sound" in
   nas    ) echo "  Compiling in network sound (NAS) support." ;;
   native ) echo "  Compiling in native sound support." ;;
   both   ) echo "  Compiling in both network and native sound support." ;;
 esac
-test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously."
+test "$old_nas" = yes && echo "        nas library lacks error trapping, will play synchronously"
 
 test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley DB."
 test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
@@ -4098,9 +3967,9 @@ test "$with_shlib" = "yes" && echo "  Compiling in DLL support."
 test "$with_clash_detection" = yes && \
   echo "  Clash detection will use \"$lockdir\" for locking files."
 echo "  movemail will use \"$mail_locking\" for locking mail spool files."
-test "$with_pop"       = yes && echo "  Using POP for mail access."
-test "$with_kerberos"  = yes && echo "  Using Kerberos for POP authentication."
-test "$with_hesiod"    = yes && echo "  Using Hesiod to get POP server host."
+test "$with_pop"       = yes && echo "  Using POP for mail access"
+test "$with_kerberos"  = yes && echo "  Using Kerberos for POP authentication"
+test "$with_hesiod"    = yes && echo "  Using Hesiod to get POP server host"
 test "$use_union_type"  = yes && echo "  Using the union type for Lisp_Objects."
 test "$use_minimal_tagbits" = yes && echo "  Using Lisp_Objects with minimal tagbits."
 test "$use_indexed_lrecord_implementation" = yes && echo "  Using indexed lrecord implementation."
@@ -4128,6 +3997,7 @@ echo '")' >> Installation.el
 dnl -----------------------------------
 dnl Now generate config.h and Makefiles
 dnl -----------------------------------
+
 dnl This has to be called in order for this variable to get into config.status
 AC_SUBST(internal_makefile_list)
 # Remove any trailing slashes in these variables.
@@ -4145,62 +4015,43 @@ for file in $internal_makefile_list; do
   ac_output_files="${ac_output_files+$ac_output_files }$file"
 done
 ac_output_files="$ac_output_files src/paths.h lib-src/config.values"
-if test "$with_shlib" = "yes"; then
-  ac_output_files="$ac_output_files lib-src/ellcc.h"
-fi
 
 AC_OUTPUT($ac_output_files,
-[for dir in . $MAKE_SUBDIR; do
+[for dir in $MAKE_SUBDIR; do
+  echo creating $dir/Makefile
   (
+changequote(<<, >>)dnl
     cd $dir
     rm -f junk.c
     < Makefile.in \
       sed -e '/^# Generated/d' \
           -e 's%/\*\*/#.*%%' \
           -e 's/^ *# */#/' \
-dnl Delete Makefile.in.in comment lines
           -e '/^##/d' \
-dnl Pass through CPP directives unchanged
           -e '/^#/ {
 p
 d
-}'        \
-dnl Quote other lines to protect from CPP substitution
-         -e '/./ {
-s/\([[\"]]\)/\\\1/g
+}'        -e '/./ {
+s/\([\"]\)/\\\1/g
 s/^/"/
 s/$/"/
 }'  > junk.c;
-
-dnl Create a GNUmakefile and Makefile from Makefile.in.
-
-changequote(<<,>>)dnl
-dnl CPP_MAKEFILE(CPPFLAGS,filename)
-define(<<CPP_MAKEFILE>>,
-echo creating $dir/<<$2>>
-$CPP -I. -I${top_srcdir}/src <<$1>> junk.c \
-dnl Delete line directives inserted by $CPP
-  | sed -e 's/^\#.*//'         \
-dnl Delete spurious blanks inserted by $CPP
-       -e 's/^[ TAB][ TAB]*$//'\
-       -e 's/^ /TAB/'          \
-dnl Delete blank lines
-  | sed -n -e '/^..*$/p'       \
-dnl Restore lines quoted above to original contents.
-  | sed '/^\"/ {
-       s/\\\([\"]\)/\1/g
-       s/^[ TAB]*\"//
-       s/\"[ TAB]*$//
-}' > Makefile.new
+    $CPP -I. -I${top_srcdir}/src $CPPFLAGS junk.c > junk.cpp;
+    < junk.cpp                         \
+      sed -e 's/^#.*//'                        \
+       -e 's/^[ TAB][ TAB]*$//'        \
+       -e 's/^ /TAB/'                  \
+       | sed -n -e '/^..*$/p'          \
+       | sed '/^"/ {
+s/\\\([\"]\)/\1/g
+s/^[ TAB]*"//
+s/"[ TAB]*$//
+}'     > Makefile.new
     chmod 444 Makefile.new
-    mv -f Makefile.new <<$2>>
-)dnl CPP_MAKEFILE
-
-    CPP_MAKEFILE(,Makefile)
-    CPP_MAKEFILE(-DUSE_GNU_MAKE,GNUmakefile)
-changequote([,])dnl
-    rm -f junk.c
-  )
+    mv -f Makefile.new Makefile
+    rm -f junk.c junk.cpp
+changequote([, ])dnl
+)
 done
 
 dnl Append AC_DEFINE information to lib-src/config.values
@@ -4213,6 +4064,7 @@ sed < config.status >> lib-src/config.values \
 
 ],
 [CPP="$CPP"
+ CPPFLAGS="$CPPFLAGS"
  top_srcdir="$srcdir"
  MAKE_SUBDIR="$MAKE_SUBDIR"
-])dnl
+])
index d059441..d516331 100644 (file)
+-----BEGIN PGP SIGNED MESSAGE-----
+
 ;; Package Index file -- Do not edit manually.
 ;;;@@@
 (package-get-update-base-entry (quote
-(hm--html-menus
+(zenirc
   (standards-version 1.0
-   version "1.12"
-   author-version "5.9"
-   date "1999-02-05"
-   build-date "1999-02-05"
+   version "1.04"
+   author-version "2.112"
+   date "1998-08-15"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority low
-   category "oa"
+   priority medium
+   category "comm"
    dump nil
-   description "HTML editing."
-   filename "hm--html-menus-1.12-pkg.tar.gz"
-   md5sum "fc80ef260cc0682bde6e706cdc8ddae4"
-   size 177442
-   provides (adapt hm--date hm--html-configuration hm--html-drag-and-drop hm--html-indentation hm--html-keys hm--html-menu hm--html-mode hm--html-not-standard hm--html html-view tmpl-minor-mode)
-   requires (dired xemacs-base)
+   description "ZENIRC IRC Client."
+   filename "zenirc-1.04-pkg.tar.gz"
+   md5sum "96d9e09c41de5c19d8aa092ad544ad6d"
+   size 276116
+   provides (zenirc)
+   requires (zenirc)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(jde
+(w3
+  (standards-version 1.0
+   version "1.10"
+   author-version "4.0pre23"
+   date "1998-07-18"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution experimental
+   priority high
+   category "comm"
+   dump nil
+   description "A Web browser."
+   filename "w3-1.10-pkg.tar.gz"
+   md5sum "6113b455f82c5903b8bd6f4ca48afb00"
+   size 612442
+   provides (w3 url)
+   requires (w3 mail-lib xemacs-base)
+   type regular
+))
+))
+;;;@@@
+(package-get-update-base-entry (quote
+(vm
   (standards-version 1.0
    version "1.14"
-   author-version "2.14"
-   date "1999-02-05"
-   build-date "1999-02-05"
-   maintainer "Andy Piper <andy@xemacs.org>"
+   author-version "6.62"
+   date "1998-09-22"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
-   category "prog"
+   category "comm"
    dump nil
-   description "Java language and development support."
-   filename "jde-1.14-pkg.tar.gz"
-   md5sum "1028c54ef317d8dd4d4c78e5b9c004e6"
-   size 320702
-   provides (jde)
-   requires (cc-mode debug speedbar edit-utils mail-lib xemacs-base)
+   description "An Emacs mailer."
+   filename "vm-1.14-pkg.tar.gz"
+   md5sum "e59383b955243ca90581fd6854bb5eff"
+   size 548815
+   provides (vm)
+   requires (mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(skk
+(tm
   (standards-version 1.0
-   version "1.12"
-   author-version "10.38"
-   date "1998-10-01"
-   build-date "1999-02-02"
-   maintainer "SL Baur <steve@altair.xemacs.org>"
-   distribution mule
-   priority medium
-   category "mule"
-   dump t
-   description "Japanese Language Input Method."
-   filename "skk-1.12-pkg.tar.gz"
-   md5sum "f690c518a0da65c4dc9fe2a867026c26"
-   size 1514106
-   provides (skk skk-tut)
-   requires (viper mule-base elib xemacs-base)
+   version "1.15"
+   author-version "21.0"
+   date "1998-08-27"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "Emacs MIME support."
+   filename "tm-1.15-pkg.tar.gz"
+   md5sum "7769db3ab1473811a0622742c3e9bf69"
+   size 329539
+   provides (tm tm-edit tm-view mime-setup)
+   requires (gnus mh-e rmail vm mailcrypt mail-lib apel xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(egg-its
+(supercite
   (standards-version 1.0
-   version "1.15"
-   author-version "21.0b62"
-   date "1999-01-04"
-   build-date "1999-02-02"
+   version "1.10"
+   author-version "3.55x2"
+   date "1998-08-9"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution mule
-   priority high
-   category "mule"
-   dump t
-   description "Wnn (4.2 and 6) support.  SJ3 support."
-   filename "egg-its-1.15-pkg.tar.gz"
-   md5sum "9c3f18c0c7eb0e77bc23af5aed0e3bcd"
-   size 257327
-   provides (egg-cnpinyin egg-cnzhuyin egg-cwnn-leim egg-jisx0201 egg-jsymbol egg-kwnn-leim egg-leim egg-sj3-client egg-sj3-leim egg-sj3 egg-wnn egg)
-   requires (leim mule-base fsf-compat xemacs-base)
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "An Emacs citation tool for News & Mail messages."
+   filename "supercite-1.10-pkg.tar.gz"
+   md5sum "09dee2a7f1400bc8680ea067a2399dcb"
+   size 99403
+   provides (supercite)
+   requires (mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(edict
+(rmail
   (standards-version 1.0
    version "1.07"
-   author-version "0.9.8"
-   date "1998-07-23"
-   build-date "1999-02-02"
-   maintainer "Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>"
-   distribution mule
-   priority high
-   category "mule"
+   author-version "21.0"
+   date "1998-06-28"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "comm"
    dump nil
-   description "Lisp Interface to EDICT, Kanji Dictionary"
-   filename "edict-1.07-pkg.tar.gz"
-   md5sum "493ef0ec6f2760e5c94423c23c9d124e"
-   size 71661
-   provides (dui-registry dui edict-edit edict-english edict-japanese edict-morphology edict-test edict ts-mode)
-   requires (mule-base xemacs-base)
+   description "An obsolete Emacs mailer."
+   filename "rmail-1.07-pkg.tar.gz"
+   md5sum "0b256dc4b02e832d939850f86951217a"
+   size 96475
+   provides (rmail rmailsum)
+   requires (tm apel mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(leim
+(mew
   (standards-version 1.0
-   version "1.12"
-   author-version "21.0b62"
-   date "1998-07-23"
-   build-date "1999-02-02"
+   version "1.04"
+   author-version "1.93b38"
+   date "1998-06-21"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution mule
-   priority medium
-   category "mule"
+   distribution contrib
+   priority low
+   category "comm"
    dump nil
-   description "Quail.  All non-English and non-Japanese language support."
-   filename "leim-1.12-pkg.tar.gz"
-   md5sum "07cc5be34a0d9d312b883b430349a882"
-   size 1671757
-   provides ()
-   requires (mule-base fsf-compat xemacs-base)
+   description "Messaging in an Emacs World."
+   filename "mew-1.04-pkg.tar.gz"
+   md5sum "896793a5d91c0ecfe4af5a7351f82fb7"
+   size 517164
+   provides (mew)
+   requires (mew)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(locale
+(net-utils
   (standards-version 1.0
-   version "1.11"
-   author-version "21.0b62"
-   date "1998-07-24"
-   build-date "1999-02-02"
+   version "1.10"
+   author-version "21.0"
+   date "1998-07-01"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution mule
-   priority high
-   category "mule"
+   distribution stable
+   priority low
+   category "comm"
    dump nil
-   description "Localized menubars and localized splash screens."
-   filename "locale-1.11-pkg.tar.gz"
-   md5sum "245f5110c2adb4411e3f4e2db014c4bc"
-   size 32690
-   provides ()
-   requires (mule-base)
+   description "Miscellaneous Networking Utilities."
+   filename "net-utils-1.10-pkg.tar.gz"
+   md5sum "89f6d1830b90e701ab57fcadd7337bb8"
+   size 107129
+   provides (ilisp-browse-cltl2 emacsbug feedmail metamail net-utils rcompile shadowfile webjump webster-www)
+   requires (w3 efs mail-lib xemacs-base)
+   type single
+))
+))
+;;;@@@
+(package-get-update-base-entry (quote
+(mh-e
+  (standards-version 1.0
+   version "1.08"
+   author-version "21.0"
+   date "1998-07-12"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "comm"
+   dump nil
+   description "Front end support for MH."
+   filename "mh-e-1.08-pkg.tar.gz"
+   md5sum "f1995b0f516668922a5f4331d0c13187"
+   size 176392
+   provides (mh-e)
+   requires (mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(mule-base
+(mailcryptng
   (standards-version 1.0
-   version "1.27"
-   author-version "21.0b62"
-   date "1998-12-05"
-   build-date "1999-02-02"
-   maintainer "SL Baur <steve@altair.xemacs.org>"
-   distribution mule
-   priority high
-   category "mule"
-   dump t
-   description "Basic Mule support, required for building with Mule."
-   filename "mule-base-1.27-pkg.tar.gz"
-   md5sum "7a9732261af6d612e3800c23b3491e41"
-   size 508690
-   provides (canna-leim canna char-table china-util cyril-util isearch-ext japan-util ccl can-n-egg mule-help)
-   requires (fsf-compat xemacs-base)
+   version "1.01"
+   author-version "3.5b7"
+   date "1998-10-10"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "Support for messaging encryption with PGP."
+   filename "mailcryptng-1.01-pkg.tar.gz"
+   md5sum "70bbfabaa083dc3a6178aa2be979705e"
+   size 120414
+   provides (mailcrypt)
+   requires (gnus vm mail-lib fsf-compat xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(strokes
+(mailcrypt
   (standards-version 1.0
-   version "1.04"
-   author-version "21.0b62"
-   date "1998-01-25"
-   build-date "1999-02-02"
+   version "1.06"
+   author-version "3.4"
+   date "1998-01-24"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority medium
-   category "oa"
+   priority low
+   category "comm"
    dump nil
-   description "Mouse enhancement utility."
-   filename "strokes-1.04-pkg.tar.gz"
-   md5sum "9a83020e888d140da2360dcac83c7c86"
-   size 43481
-   provides (strokes)
-   requires (text-modes edit-utils mail-lib xemacs-base)
+   description "Support for messaging encryption with PGP."
+   filename "mailcrypt-1.06-pkg.tar.gz"
+   md5sum "e601fc5c1f43c5b7f577c7262c7877a9"
+   size 106355
+   provides (mailcrypt)
+   requires (gnus vm mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(time
+(irchat
   (standards-version 1.0
-   version "1.07"
-   author-version "1.17"
-   date "1998-04-24"
-   build-date "1999-02-02"
+   version "1.03"
+   author-version "980625-2"
+   date "1998-09-08"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
-   category "oa"
+   category "comm"
    dump nil
-   description "Display time & date on the modeline."
-   filename "time-1.07-pkg.tar.gz"
-   md5sum "4cc97d84357412fb7d737a88b6f05cbe"
-   size 20006
-   provides (time)
-   requires (xemacs-base)
+   description "ZENIRC IRC Client."
+   filename "irchat-1.03-pkg.tar.gz"
+   md5sum "9d066b2d79ab2dd5e01e1b8733289aa4"
+   size 219214
+   provides (irchat)
+   requires ()
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(text-modes
+(gnats
   (standards-version 1.0
-   version "1.17"
-   author-version "21.0b62"
-   date "1998-12-30"
-   build-date "1999-02-02"
+   version "1.07"
+   author-version "3.101"
+   date "1998-08-01"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority high
-   category "oa"
+   category "comm"
    dump nil
-   description "Miscellaneous support for editing text files."
-   filename "text-modes-1.17-pkg.tar.gz"
-   md5sum "3004046c35c63dd6df85094c2796d020"
-   size 195328
-   provides (autoinsert crontab-edit filladapt fold-isearch folding image-mode iso-acc iso-ascii iso-cvt iso-insert iso-swed swedish tabify whitespace-mode winmgr-mode xpm-mode xrdb-mode)
-   requires (ispell fsf-compat xemacs-base)
+   description "XEmacs bug reports."
+   filename "gnats-1.07-pkg.tar.gz"
+   md5sum "40d23fbac2ea05d55be0d0822259b023"
+   size 189213
+   provides (gnats gnats-admin send-pr)
+   requires (mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(slider
+(footnote
   (standards-version 1.0
-   version "1.09"
-   author-version "0.3x1"
-   date "1998-08-13"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution experimental
+   version "1.07"
+   author-version "0.18x"
+   date "1998-08-27"
+   build-date "1998-10-12"
+   maintainer "SL Baur <steve@xemacs.org>"
+   distribution stable
    priority low
-   category "oa"
+   category "comm"
    dump nil
-   description "User interface tool."
-   filename "slider-1.09-pkg.tar.gz"
-   md5sum "b211a950179fee88712fc5c38e395069"
-   size 12004
-   provides (slider color-selector)
-   requires ()
+   description "Footnoting in mail message editing modes."
+   filename "footnote-1.07-pkg.tar.gz"
+   md5sum "1064b49b7e13a467458af2bafd9e62fb"
+   size 13362
+   provides (footnote)
+   requires (mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(sgml
+(eudc
   (standards-version 1.0
-   version "1.04"
-   author-version "21.0b62"
-   date "1998-01-25"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
+   version "1.24"
+   author-version "1.24"
+   date "1998-10-15"
+   build-date "1998-10-15"
+   maintainer "Oscar Figueiredo <Oscar.Figueiredo@epfl.ch>"
+   distribution stable
    priority low
-   category "oa"
+   category "comm"
    dump nil
-   description "SGML/Linuxdoc-SGML editing."
-   filename "sgml-1.04-pkg.tar.gz"
-   md5sum "2b762a0fbdda616916624dc2fa53e647"
-   size 26938
-   provides (sgml linuxdoc-sgml)
-   requires (xemacs-base)
+   description "Emacs Unified Directory Client (LDAP, PH)."
+   filename "eudc-1.24-pkg.tar.gz"
+   md5sum "43c173e7e052c81b196c617fb22b6e00"
+   size 50837
+   provides (eudc eudc-ldap eudc-ph)
+   requires (fsf-compat xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(psgml
+(bbdb
   (standards-version 1.0
-   version "1.11"
-   author-version "1.01"
-   date "1998-07-06"
-   build-date "1999-02-02"
+   version "1.06"
+   author-version "2.00.02"
+   date "1998-10-08"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
-   category "oa"
+   category "comm"
    dump nil
-   description "Validated HTML/SGML editing."
-   filename "psgml-1.11-pkg.tar.gz"
-   md5sum "e6d5a593138aa8861a5a178097c05594"
-   size 425005
-   provides (psgml sgml)
-   requires (edit-utils)
+   description "The Big Brother Data Base"
+   filename "bbdb-1.06-pkg.tar.gz"
+   md5sum "4889d21fded3ae5cddee558e0d136a20"
+   size 281992
+   provides (bbdb)
+   requires (bbdb edit-utils gnus mh-e rmail supercite vm tm apel mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(pc
+(gnus
   (standards-version 1.0
-   version "1.14"
-   author-version "21.0b62"
-   date "1998-07-25"
-   build-date "1999-02-02"
+   version "1.33"
+   author-version "5.6.44"
+   date "1998-09-25"
+   build-date "1998-10-15"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority low
-   category "oa"
+   priority medium
+   category "comm"
    dump nil
-   description "PC style interface emulation."
-   filename "pc-1.14-pkg.tar.gz"
-   md5sum "e300f9e0ee56640e110bee972fca8333"
-   size 16243
-   provides (delbs fusion pc-select pending-del s-region)
-   requires (xemacs-base)
+   description "The Gnus Newsreader and Mailreader."
+   filename "gnus-1.33-pkg.tar.gz"
+   md5sum "46a0466ec203cd7b0d78bfeb215a65f5"
+   size 1874633
+   provides (gnus message)
+   requires (gnus w3 mh-e mailcrypt rmail mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(ispell
+(skk
   (standards-version 1.0
-   version "1.14"
-   author-version "3.1"
-   date "1998-12-09"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
-   priority low
-   category "oa"
-   dump nil
-   description "Spell-checking with GNU ispell."
-   filename "ispell-1.14-pkg.tar.gz"
-   md5sum "2b382122698c2c46aeaa4847e7ab3825"
-   size 67525
-   provides (ispell)
-   requires ()
+   version "1.11"
+   author-version "10.38"
+   date "1998-10-01"
+   build-date "1998-10-12"
+   maintainer "SL Baur <steve@altair.xemacs.org>"
+   distribution mule
+   priority medium
+   category "mule"
+   dump t
+   description "Japanese Language Input Method."
+   filename "skk-1.11-pkg.tar.gz"
+   md5sum "c158751b558299be9b5f8f9d10216a79"
+   size 1513975
+   provides (skk skk-tut)
+   requires (viper mule-base elib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(frame-icon
+(mule-base
   (standards-version 1.0
-   version "1.06"
-   author-version "21.0b62"
-   date "1998-07-14"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
-   priority low
-   category "oa"
-   dump nil
-   description "Set up mode-specific icons for each frame under XEmacs"
-   filename "frame-icon-1.06-pkg.tar.gz"
-   md5sum "bc4f6e838a4fa12d7f3b8b1996b3a9ac"
-   size 33483
-   provides (forms forms-mode)
-   requires ()
+   version "1.24"
+   author-version "21.0"
+   date "1998-08-12"
+   build-date "1998-10-12"
+   maintainer "SL Baur <steve@altair.xemacs.org>"
+   distribution mule
+   priority high
+   category "mule"
+   dump t
+   description "Basic Mule support, required for building with Mule."
+   filename "mule-base-1.24-pkg.tar.gz"
+   md5sum "9842af89469856fa1c7f3ed60c8c25cf"
+   size 508959
+   provides (canna-leim canna char-table china-util cyril-util isearch-ext japan-util ccl can-n-egg mule-help)
+   requires (fsf-compat xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(forms
+(egg-its
   (standards-version 1.0
-   version "1.09"
-   author-version "2.10"
-   date "1998-01-25"
-   build-date "1999-02-02"
+   version "1.13"
+   author-version "21.0"
+   date "1998-08-11"
+   build-date "1998-10-15"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
-   priority low
-   category "oa"
+   distribution mule
+   priority high
+   category "mule"
+   dump t
+   description "Wnn (4.2 and 6) support.  SJ3 support."
+   filename "egg-its-1.13-pkg.tar.gz"
+   md5sum "e7a5d51eb734310b9bb151c4fba05868"
+   size 259686
+   provides (egg-cnpinyin egg-cnzhuyin egg-cwnn-leim egg-jisx0201 egg-jsymbol egg-kwnn-leim egg-leim egg-sj3-client egg-sj3-leim egg-sj3 egg-wnn egg)
+   requires (leim mule-base fsf-compat xemacs-base)
+   type regular
+))
+))
+;;;@@@
+(package-get-update-base-entry (quote
+(edict
+  (standards-version 1.0
+   version "1.06"
+   author-version "0.9.8"
+   date "1998-07-23"
+   build-date "1998-10-12"
+   maintainer "Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>"
+   distribution mule
+   priority high
+   category "mule"
    dump nil
-   description "Forms editing support (obsolete, use Widget instead)."
-   filename "forms-1.09-pkg.tar.gz"
-   md5sum "7023bf24836c00572fc3b014d9c9b3c9"
-   size 47673
-   provides (forms forms-mode)
-   requires ()
+   description "Lisp Interface to EDICT, Kanji Dictionary"
+   filename "edict-1.06-pkg.tar.gz"
+   md5sum "d9ba0f5372b2b83fe1499d1462dad3ca"
+   size 68008
+   provides (dui-registry dui edict-edit edict-english edict-japanese edict-morphology edict-test edict ts-mode)
+   requires (mule-base xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(calendar
+(leim
   (standards-version 1.0
-   version "1.09"
-   author-version "21.0b62"
-   date "1998-09-01"
-   build-date "1999-02-02"
+   version "1.11"
+   author-version "21.0"
+   date "1998-07-23"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
-   priority low
-   category "oa"
+   distribution mule
+   priority medium
+   category "mule"
    dump nil
-   description "Calendar and diary support."
-   filename "calendar-1.09-pkg.tar.gz"
-   md5sum "92e267eb29597430b85834cc57271e86"
-   size 248518
-   provides (appt cal-dst cal-french cal-mayan cal-x cal-xemacs calendar diary-ins diary-lib holidays lunar solar)
-   requires (xemacs-base)
+   description "Quail.  All non-English and non-Japanese language support."
+   filename "leim-1.11-pkg.tar.gz"
+   md5sum "19f4745d0364b46c7526a34777c653e5"
+   size 1670560
+   provides ()
+   requires (mule-base fsf-compat xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(calc
+(locale
   (standards-version 1.0
    version "1.10"
-   author-version "2.02fX3"
-   date "1998-07-25"
-   build-date "1999-02-02"
+   author-version "21.0"
+   date "1998-07-24"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
-   priority low
-   category "oa"
+   distribution mule
+   priority high
+   category "mule"
    dump nil
-   description "Emacs calculator"
-   filename "calc-1.10-pkg.tar.gz"
-   md5sum "148c82bf6f213d6e2fb234e1f21e4699"
-   size 1616821
-   provides (calc)
-   requires ()
+   description "Localized menubars and localized splash screens."
+   filename "locale-1.10-pkg.tar.gz"
+   md5sum "8439f2d7e266f3e4c2f18a19aa967202"
+   size 32709
+   provides ()
+   requires (mule-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(speedbar
+(time
   (standards-version 1.0
-   version "1.11"
-   author-version "0.6.2x"
-   date "1998-10-02"
-   build-date "1999-02-02"
+   version "1.06"
+   author-version "1.17"
+   date "1998-04-24"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority low
+   priority medium
    category "oa"
    dump nil
-   description "Provides a seperate frame with convenient references."
-   filename "speedbar-1.11-pkg.tar.gz"
-   md5sum "896acffc88848f175ada5ae637b67738"
-   size 64858
-   provides (speedbar)
+   description "Display time & date on the modeline."
+   filename "time-1.06-pkg.tar.gz"
+   md5sum "f55965f3ef08e038bd58ca8f4fb83fe6"
+   size 20018
+   provides (time)
    requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(edit-utils
+(text-modes
   (standards-version 1.0
-   version "1.36"
-   author-version "21.0b62"
-   date "1998-12-30"
-   build-date "1999-02-02"
+   version "1.13"
+   author-version "21.0"
+   date "1998-09-24"
+   build-date "1998-10-15"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority high
    category "oa"
    dump nil
-   description "Miscellaneous editor extensions, you probably need this."
-   filename "edit-utils-1.36-pkg.tar.gz"
-   md5sum "c8465a98c57d1c91ccfd2ce1aee3b508"
-   size 574967
-   provides (abbrevlist atomic-extents avoid backup-dir balloon-help big-menubar blink-cursor blink-paren bookmark compare-w completion dabbrev desktop detached-minibuf edit-toolbar fast-lock file-part floating-toolbar flow-ctrl foldout func-menu hippie-exp icomplete id-select info-look iswitchb lazy-lock lazy-shot live-icon man mic-paren paren popper mode-motion+ outl-mouse page-ext blink-paren paren permanent-buffers recent-files redo reportmail rsz-minibuf saveconfsavehist saveplace scroll-in-place tempo toolbar-utils tree-menu uniquify where-was-i-db)
-   requires (xemacs-base)
-   type single
+   description "Miscellaneous support for editing text files."
+   filename "text-modes-1.13-pkg.tar.gz"
+   md5sum "3209269c42e32e39f70259cb68855e4f"
+   size 195165
+   provides (autoinsert crontab-edit filladapt fold-isearch folding image-mode iso-acc iso-ascii iso-cvt iso-insert iso-swed swedish tabify whitespace-mode winmgr-mode xpm-mode xrdb-mode)
+   requires (ispell fsf-compat xemacs-base)
+   type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(view-process
+(strokes
   (standards-version 1.0
-   version "1.06"
-   author-version "2.4"
-   date "1998-01-24"
-   build-date "1999-02-02"
+   version "1.03"
+   author-version "21.0"
+   date "1998-01-25"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority low
-   category "os"
+   priority medium
+   category "oa"
    dump nil
-   description "A Unix process browsing tool."
-   filename "view-process-1.06-pkg.tar.gz"
-   md5sum "61c4c7175f23cb4cfd314e10303b238c"
-   size 59958
-   provides (view-process-mode)
-   requires (xemacs-base)
+   description "Mouse enhancement utility."
+   filename "strokes-1.03-pkg.tar.gz"
+   md5sum "170257302196f106a54eb6dcf32fcc7a"
+   size 43480
+   provides (strokes)
+   requires (text-modes edit-utils mail-lib xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(os-utils
+(speedbar
   (standards-version 1.0
-   version "1.14"
-   author-version "21.0b62"
-   date "1998-12-30"
-   build-date "1999-02-02"
+   version "1.10"
+   author-version "0.6.2x"
+   date "1998-10-02"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority medium
-   category "os"
+   priority low
+   category "oa"
    dump nil
-   description "Miscellaneous O/S utilities."
-   filename "os-utils-1.14-pkg.tar.gz"
-   md5sum "2ff61cea716a53af1846d1699b5194a7"
-   size 227298
-   provides (archive-mode background crypt crypt++ inf-lisp jka-compr lpr mchat ps-print tar-mode telnet terminal uncompress)
+   description "Provides a seperate frame with convenient references."
+   filename "speedbar-1.10-pkg.tar.gz"
+   md5sum "eab230ae2aa7d6ed5739f46ec4099dcf"
+   size 64861
+   provides (speedbar)
    requires (xemacs-base)
-   type single
+   type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(ilisp
+(slider
   (standards-version 1.0
-   version "1.07"
-   author-version "5.8"
-   date "1998-01-24"
-   build-date "1999-02-02"
+   version "1.08"
+   author-version "0.3x1"
+   date "1998-08-13"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
+   distribution experimental
    priority low
-   category "os"
+   category "oa"
    dump nil
-   description "Front-end for Inferior Lisp."
-   filename "ilisp-1.07-pkg.tar.gz"
-   md5sum "38cb2d94926e310a6e71ec1be854d636"
-   size 262173
-   provides (ilisp completer)
-   requires (xemacs-base)
+   description "User interface tool."
+   filename "slider-1.08-pkg.tar.gz"
+   md5sum "8d2fe53d7d58fa0af58ac0359caccaca"
+   size 12018
+   provides (slider color-selector)
+   requires ()
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(igrep
+(sgml
   (standards-version 1.0
-   version "1.05"
-   author-version "2.83"
-   date "1998-08-11"
-   build-date "1999-02-02"
+   version "1.03"
+   author-version "21.0"
+   date "1998-01-25"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
+   distribution contrib
    priority low
-   category "os"
+   category "oa"
    dump nil
-   description "Enhanced front-end for Grep."
-   filename "igrep-1.05-pkg.tar.gz"
-   md5sum "e70d4973a2af4dbd6222f5943bfa1a50"
-   size 14935
-   provides (igrep)
-   requires (dired xemacs-base)
+   description "SGML/Linuxdoc-SGML editing."
+   filename "sgml-1.03-pkg.tar.gz"
+   md5sum "317c7f52a3215f53e964ad90f9c40909"
+   size 26928
+   provides (sgml linuxdoc-sgml)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(eterm
+(psgml
   (standards-version 1.0
-   version "1.08"
-   author-version "21.0b62"
-   date "1998-06-28"
-   build-date "1999-02-02"
+   version "1.10"
+   author-version "1.01"
+   date "1998-07-06"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
-   category "os"
+   category "oa"
    dump nil
-   description "Terminal emulation."
-   filename "eterm-1.08-pkg.tar.gz"
-   md5sum "77e56529b5de6a0a0dd46c5d1634eebf"
-   size 108905
-   provides (eterm)
-   requires (xemacs-base)
+   description "Validated HTML/SGML editing."
+   filename "psgml-1.10-pkg.tar.gz"
+   md5sum "15e584b90a2d2310a2be15ea2aa0717a"
+   size 424930
+   provides (psgml sgml)
+   requires (edit-utils)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(viper
+(pc
   (standards-version 1.0
-   version "1.12"
-   author-version "3.05"
-   date " to viper-"
-   build-date "1999-02-02"
+   version "1.13"
+   author-version "21.0"
+   date "1998-07-25"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
-   category "wp"
+   category "oa"
    dump nil
-   description "VI emulation support."
-   filename "viper-1.12-pkg.tar.gz"
-   md5sum "ded88cfaad39a6001389918808549efa"
-   size 317341
-   provides (viper)
+   description "PC style interface emulation."
+   filename "pc-1.13-pkg.tar.gz"
+   md5sum "e5355fb82d1dbd77ad522bffb334168d"
+   size 16306
+   provides (delbs fusion pc-select pending-del s-region)
    requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(tpu
+(ispell
   (standards-version 1.0
-   version "1.08"
-   author-version "4.2X"
-   date "1998-07-23"
-   build-date "1999-02-02"
-   maintainer "Kevin Oberman <oberman@es.net>"
-   distribution normal
-   priority medium
-   category "wp"
+   version "1.12"
+   author-version "3.0x2"
+   date "1998-09-15"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "oa"
    dump nil
-   description "DEC EDIT/TPU support."
-   filename "tpu-1.08-pkg.tar.gz"
-   md5sum "2306ac55a0a1ed23da02a85c91f881bb"
-   size 58804
-   provides (tpu)
+   description "Spell-checking with GNU ispell."
+   filename "ispell-1.12-pkg.tar.gz"
+   md5sum "5786e4688024aae78fe75a5cbf92c446"
+   size 67168
+   provides (ispell)
    requires ()
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(textools
+(hm--html-menus
   (standards-version 1.0
    version "1.08"
-   author-version "21.0b62"
-   date "1998-04-29"
-   build-date "1999-02-02"
+   author-version "5.9"
+   date "1998-01-25"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stabl
-   priority medium
-   category "wp"
+   distribution stable
+   priority low
+   category "oa"
    dump nil
-   description "Miscellaneous TeX support."
-   filename "textools-1.08-pkg.tar.gz"
-   md5sum "22dd0e16433a96547fde5757c6793388"
-   size 79176
-   provides (bib-mode bibtex refer-to-bibtex)
+   description "HTML editing."
+   filename "hm--html-menus-1.08-pkg.tar.gz"
+   md5sum "1f0fda934b84c5eed96fcfd02a046398"
+   size 168017
+   provides (adapt hm--date hm--html-configuration hm--html-drag-and-drop hm--html-indentation hm--html-keys hm--html-menu hm--html-mode hm--html-not-standard hm--html html-view tmpl-minor-mode)
    requires (xemacs-base)
-   type single
+   type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(texinfo
+(frame-icon
   (standards-version 1.0
-   version "1.14"
-   author-version "21.0b62"
-   date "1998-07-20"
-   build-date "1999-02-02"
+   version "1.05"
+   author-version "21.0"
+   date "1998-07-14"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
-   priority high
-   category "wp"
+   distribution contrib
+   priority low
+   category "oa"
    dump nil
-   description "XEmacs TeXinfo support."
-   filename "texinfo-1.14-pkg.tar.gz"
-   md5sum "b1b6a7f4c1ff10be38d3e27d1213f1c8"
-   size 127830
-   provides (makeinfo tex-mode texinfmt texinfo texnfo-tex texnfo-upd)
-   requires (xemacs-base)
+   description "Set up mode-specific icons for each frame under XEmacs"
+   filename "frame-icon-1.05-pkg.tar.gz"
+   md5sum "3d1a67ba8a51f74746ecb14385a025ef"
+   size 33490
+   provides (forms forms-mode)
+   requires ()
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(reftex
+(forms
   (standards-version 1.0
-   version "1.11"
-   author-version "3.42"
-   date "1998-08-11"
-   build-date "1999-02-02"
-   maintainer "Carsten Dominik <dominik@strw.LeidenUniv.nl>"
-   distribution stable
-   priority medium
-   category "wp"
+   version "1.08"
+   author-version "2.10"
+   date "1998-01-25"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "oa"
    dump nil
-   description "Emacs support for LaTeX cross-references, citations.."
-   filename "reftex-1.11-pkg.tar.gz"
-   md5sum "efe43ac8ef52b9f8cf949783e30bb4a9"
-   size 209331
-   provides (reftex)
-   requires (fsf-compat xemacs-base)
+   description "Forms editing support (obsolete, use Widget instead)."
+   filename "forms-1.08-pkg.tar.gz"
+   md5sum "8af074cfc164331838bc83eb79eed3b5"
+   size 47670
+   provides (forms forms-mode)
+   requires ()
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(edt
+(edit-utils
   (standards-version 1.0
-   version "1.07"
-   author-version "21.0b62"
-   date "1998-04-07"
-   build-date "1999-02-02"
+   version "1.33"
+   author-version "21.0"
+   date "1998-09-29"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
-   priority low
-   category "wp"
+   distribution stable
+   priority high
+   category "oa"
    dump nil
-   description "DEC EDIT/EDT emulation."
-   filename "edt-1.07-pkg.tar.gz"
-   md5sum "6c48ceb9686c50058be3938288940bc5"
-   size 46131
-   provides (edt)
+   description "Miscellaneous editor extensions, you probably need this."
+   filename "edit-utils-1.33-pkg.tar.gz"
+   md5sum "0aa0b5d2864dc02a62fb6e87880c4733"
+   size 564543
+   provides (abbrevlist atomic-extents avoid backup-dir balloon-help big-menubar blink-cursor blink-paren bookmark compare-w completion dabbrev desktop detached-minibuf edit-toolbar fast-lock file-part floating-toolbar flow-ctrl foldout func-menu hippie-exp icomplete id-select info-look iswitchb lazy-lock lazy-shot live-icon man mic-paren paren popper mode-motion+ outl-mouse page-ext blink-paren paren permanent-buffers recent-files redo reportmail rsz-minibuf saveconfsavehist saveplace scroll-in-place tempo toolbar-utils tree-menu uniquify where-was-i-db)
    requires (xemacs-base)
-   type regular
+   type single
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(crisp
+(calendar
   (standards-version 1.0
-   version "1.09"
-   author-version "1.34"
-   date "1998-08-18"
-   build-date "1999-02-02"
+   version "1.08"
+   author-version "21.0"
+   date "1998-09-01"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
-   category "wp"
+   category "oa"
    dump nil
-   description "Crisp/Brief emulation."
-   filename "crisp-1.09-pkg.tar.gz"
-   md5sum "faa9b6f2868a7e5b212d1094039cf526"
-   size 10067
-   provides (crisp scroll-lock)
-   requires ()
+   description "Calendar and diary support."
+   filename "calendar-1.08-pkg.tar.gz"
+   md5sum "afe4b31eb98b130960046bb3c2385ed3"
+   size 248313
+   provides (appt cal-dst cal-french cal-mayan cal-x cal-xemacs calendar diary-ins diary-lib holidays lunar solar)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(auctex
+(calc
   (standards-version 1.0
-   version "1.16"
-   author-version "9.7p"
-   date "1998-09-30"
-   build-date "1999-02-02"
+   version "1.09"
+   author-version "2.02fX3"
+   date "1998-07-25"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority medium
-   category "wp"
+   priority low
+   category "oa"
    dump nil
-   description "Basic TeX/LaTeX support."
-   filename "auctex-1.16-pkg.tar.gz"
-   md5sum "56e3454a1162c25db93fc84bdab61d0f"
-   size 365136
-   provides (auc-old bib-cite font-latex latex multi-prompt tex-buf tex-info tex-jp tex-site tex)
-   requires (xemacs-base)
+   description "Emacs calculator"
+   filename "calc-1.09-pkg.tar.gz"
+   md5sum "f0eb907a308a96da7ac5c3fc8c7d8bea"
+   size 1616564
+   provides (calc)
+   requires ()
    type regular
 ))
 ))
 (package-get-update-base-entry (quote
 (vhdl
   (standards-version 1.0
-   version "1.07"
+   version "1.06"
    author-version "2.74"
    date "1998-01-24"
-   build-date "1999-02-02"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "prog"
    dump nil
    description "Support for VHDL."
-   filename "vhdl-1.07-pkg.tar.gz"
-   md5sum "0eae8d15cff7d7b6dd7e1d00029c0e3a"
-   size 65961
+   filename "vhdl-1.06-pkg.tar.gz"
+   md5sum "b6f786b7f682f76d57eeb94d3c917e56"
+   size 65943
    provides (vhdl-mode)
    requires ()
    type regular
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(vc
+(vc-cc
   (standards-version 1.0
-   version "1.16"
-   author-version "21.0b62"
-   date "1998-10-16"
-   build-date "1999-02-02"
+   version "1.09"
+   author-version "21.0"
+   date "1998-07-24"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
+   distribution contrib
    priority low
    category "prog"
    dump nil
-   description "Version Control for Free systems."
-   filename "vc-1.16-pkg.tar.gz"
-   md5sum "59229957e35e7109cb92407cf9c9dcaf"
-   size 84381
+   description "Version Control for ClearCase (UnFree) systems."
+   filename "vc-cc-1.09-pkg.tar.gz"
+   md5sum "43f4947aeb368164aada9dc2df827ce7"
+   size 96473
    provides (vc)
    requires (dired xemacs-base)
    type regular
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(vc-cc
+(vc
   (standards-version 1.0
-   version "1.11"
-   author-version "21.0b62"
-   date "1998-12-09"
-   build-date "1999-02-02"
+   version "1.14"
+   author-version "21.0"
+   date "1998-10-07"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
+   distribution stable
    priority low
    category "prog"
    dump nil
-   description "Version Control for ClearCase (UnFree) systems."
-   filename "vc-cc-1.11-pkg.tar.gz"
-   md5sum "561ab60400e3fa6bfef8ad8567a3702d"
-   size 96544
+   description "Version Control for Free systems."
+   filename "vc-1.14-pkg.tar.gz"
+   md5sum "64c350d9c5280e7545e3dc3936992a8a"
+   size 83885
    provides (vc)
    requires (dired xemacs-base)
    type regular
 (package-get-update-base-entry (quote
 (sh-script
   (standards-version 1.0
-   version "1.08"
+   version "1.07"
    author-version "2.0e"
    date "1998-05-12"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "prog"
    dump nil
    description "Support for editing shell scripts."
-   filename "sh-script-1.08-pkg.tar.gz"
-   md5sum "f2f584ab19761b1db14160d9d3cbc6f3"
-   size 33900
+   filename "sh-script-1.07-pkg.tar.gz"
+   md5sum "c5dd114d8e925fc7c8ec6d9130489421"
+   size 33895
    provides (sh-script executable)
    requires (xemacs-base)
    type regular
 (package-get-update-base-entry (quote
 (scheme
   (standards-version 1.0
-   version "1.07"
-   author-version "21.0b62"
+   version "1.06"
+   author-version "21.0"
    date "1998-09-08"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "Karl M. Hegbloom <karlheg@bittersweet.inetarena.com>"
    distribution contrib
    priority low
    category "prog"
    dump nil
    description "Front-end support for Inferior Scheme."
-   filename "scheme-1.07-pkg.tar.gz"
-   md5sum "998d46aee749b32493cae61cac3888d2"
-   size 36292
+   filename "scheme-1.06-pkg.tar.gz"
+   md5sum "86edb18517b7ed62929041c55ea68927"
+   size 36321
    provides (scheme xscheme cmuscheme cmuscheme48)
    requires (xemacs-base)
    type regular
 (package-get-update-base-entry (quote
 (prog-modes
   (standards-version 1.0
-   version "1.17"
-   author-version "21.0b62"
-   date "1998-12-30"
-   build-date "1999-02-02"
+   version "1.13"
+   author-version "21.0"
+   date "1998-10-15"
+   build-date "1998-10-15"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
    category "prog"
    dump nil
    description "Support for various programming languages."
-   filename "prog-modes-1.17-pkg.tar.gz"
-   md5sum "23daac543cf9622f12fab0aff788ba26"
-   size 594744
+   filename "prog-modes-1.13-pkg.tar.gz"
+   md5sum "6e78de455277b0fe757931532ca56a88"
+   size 574269
    provides (autoconf-mode cperl-mode eiffel3 f90 fortran ksh-mode m4-mode makefile perl-mode postscript python-mode rexx-mode simula-mode tcl teco verilog-mod)
-   requires (mail-lib xemacs-devel xemacs-base)
+   requires (mail-lib xemacs-base)
+   type regular
+))
+))
+;;;@@@
+(package-get-update-base-entry (quote
+(pcl-cvs
+  (standards-version 1.0
+   version "1.34"
+   author-version "R-2_0-Beta_2"
+   date "1998-10-12"
+   build-date "1998-10-12"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "prog"
+   dump nil
+   description "CVS frontend."
+   filename "pcl-cvs-1.34-pkg.tar.gz"
+   md5sum "6a3f944402c486679e7cb33f60b8689b"
+   size 161529
+   provides (pcl-cvs generic-sc)
+   requires (xemacs-base elib dired)
+   type regular
+))
+))
+;;;@@@
+(package-get-update-base-entry (quote
+(jde
+  (standards-version 1.0
+   version "1.06"
+   author-version "2.05"
+   date "1998-07-09"
+   build-date "1998-10-11"
+   maintainer "Andy Piper <andyp@parallax.co.uk>"
+   distribution stable
+   priority medium
+   category "prog"
+   dump nil
+   description "Java language and development support."
+   filename "jde-1.06-pkg.tar.gz"
+   md5sum "402a03ac6482ee28a586ee41164cf4f5"
+   size 126911
+   provides (jde)
+   requires (cc-mode debug speedbar edit-utils mail-lib xemacs-base)
    type regular
 ))
 ))
 (package-get-update-base-entry (quote
 (emerge
   (standards-version 1.0
-   version "1.05"
-   author-version "21.0b62"
+   version "1.04"
+   author-version "21.0"
    date "1998-04-07"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "prog"
    dump nil
-   description "Another interface over GNU patch."
-   filename "emerge-1.05-pkg.tar.gz"
-   md5sum "1f4d70d7f4e73290837b2dbd2189be99"
-   size 61009
-   provides (emerge)
-   requires ()
+   description "Another interface over GNU patch."
+   filename "emerge-1.04-pkg.tar.gz"
+   md5sum "681e35d3a0c167782db2e93f37ee3147"
+   size 60972
+   provides (emerge)
+   requires ()
+   type regular
+))
+))
+;;;@@@
+(package-get-update-base-entry (quote
+(ediff
+  (standards-version 1.0
+   version "1.13"
+   author-version "2.71"
+   date "up-mess): "
+   build-date "1998-10-15"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "prog"
+   dump nil
+   description "Interface over GNU patch."
+   filename "ediff-1.13-pkg.tar.gz"
+   md5sum "6435e57ce61d0b0262196866d62b63be"
+   size 281534
+   provides (ediff)
+   requires (pcl-cvs elib dired xemacs-base)
    type regular
 ))
 ))
 (package-get-update-base-entry (quote
 (debug
   (standards-version 1.0
-   version "1.08"
-   author-version "21.0b62"
-   date "1998-11-18"
-   build-date "1999-02-02"
+   version "1.06"
+   author-version "21.0"
+   date "1998-07-09"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution contrib
    priority low
    category "prog"
    dump nil
    description "GUD, gdb, dbx debugging support."
-   filename "debug-1.08-pkg.tar.gz"
-   md5sum "e2c9ff97146272670632311a9267765a"
-   size 89552
+   filename "debug-1.06-pkg.tar.gz"
+   md5sum "807421911694a3c5853568efb71b88b0"
+   size 88964
    provides (dbx gdb-highlight gdb gdbsrc gud history)
    requires (xemacs-base)
    type regular
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
+(cc-mode
+  (standards-version 1.0
+   version "1.13"
+   author-version "5.22"
+   date "1998-03-05"
+   build-date "1998-10-11"
+   maintainer "Barry Warsaw <cc-mode-help@python.org>"
+   distribution stable
+   priority medium
+   category "prog"
+   dump nil
+   description "C, C++ and Java language support."
+   filename "cc-mode-1.13-pkg.tar.gz"
+   md5sum "1ea7ffaa586063356ae65f4777cfb431"
+   size 186436
+   provides (cc-mode)
+   requires (xemacs-base)
+   type regular
+))
+))
+;;;@@@
+(package-get-update-base-entry (quote
 (c-support
   (standards-version 1.0
-   version "1.10"
-   author-version "21.0b62"
+   version "1.09"
+   author-version "21.0"
    date "1998-03-25"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution contrib
    priority low
    category "prog"
    dump nil
    description "Basic single-file add-ons for editing C code."
-   filename "c-support-1.10-pkg.tar.gz"
-   md5sum "40abc17d38e4a4a206cfc6b1eb0f6a8e"
-   size 69812
+   filename "c-support-1.09-pkg.tar.gz"
+   md5sum "f9dc7f8884203038f750d1e96087dc9c"
+   size 68730
    provides (c-comment-edit cmacexp ctypes hideif hideshow)
    requires (cc-mode xemacs-base)
    type regular
 (package-get-update-base-entry (quote
 (ada
   (standards-version 1.0
-   version "1.06"
+   version "1.05"
    author-version "2.27"
    date "1998-01-24"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "prog"
    dump nil
    description "Ada language support."
-   filename "ada-1.06-pkg.tar.gz"
-   md5sum "0f3d2dc2ff33d40092b324a7a5a363d6"
-   size 54364
+   filename "ada-1.05-pkg.tar.gz"
+   md5sum "374870f02139d0d80b56dab23f93b06d"
+   size 54388
    provides (ada-mode ada-stmt)
    requires ()
    type regular
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(pcl-cvs
+(viper
   (standards-version 1.0
-   version "1.38"
-   author-version "R-2_0-Beta_2"
-   date "1998-11-17"
-   build-date "1999-02-02"
+   version "1.10"
+   author-version "3.03"
+   date "1998-02-25"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
-   category "prog"
+   category "wp"
    dump nil
-   description "CVS frontend."
-   filename "pcl-cvs-1.38-pkg.tar.gz"
-   md5sum "a5ff4e61dffe3985c20385eb741d4783"
-   size 163524
-   provides (pcl-cvs generic-sc)
-   requires (xemacs-base elib dired)
+   description "VI emulation support."
+   filename "viper-1.10-pkg.tar.gz"
+   md5sum "f34ad536e27aa564849fcfb2fcf22a29"
+   size 315794
+   provides (viper)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(cc-mode
+(tpu
   (standards-version 1.0
-   version "1.15"
-   author-version "5.25"
-   date "1998-12-30"
-   build-date "1999-02-02"
-   maintainer "Barry Warsaw <bug-cc-mode@gnu.org>"
-   distribution stable
+   version "1.07"
+   author-version "4.2X"
+   date "1998-07-23"
+   build-date "1998-10-11"
+   maintainer "Kevin Oberman <oberman@es.net>"
+   distribution normal
    priority medium
-   category "prog"
+   category "wp"
    dump nil
-   description "C, C++ and Java language support."
-   filename "cc-mode-1.15-pkg.tar.gz"
-   md5sum "ca73b190e79f96ab928eecd12af94222"
-   size 212611
-   provides (cc-mode)
-   requires (xemacs-base)
+   description "DEC EDIT/TPU support."
+   filename "tpu-1.07-pkg.tar.gz"
+   md5sum "be15173be8a57fcb7b7244a143026f8c"
+   size 58801
+   provides (tpu)
+   requires ()
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(misc-games
+(textools
   (standards-version 1.0
-   version "1.09"
-   author-version "21.0b62"
-   date "1998-03-22"
-   build-date "1999-02-02"
+   version "1.07"
+   author-version "21.0"
+   date "1998-04-29"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
-   priority low
-   category "games"
+   distribution stabl
+   priority medium
+   category "wp"
    dump nil
-   description "Other amusements and diversions."
-   filename "misc-games-1.09-pkg.tar.gz"
-   md5sum "a4e7e18e7cf3ce771ad65dae24967603"
-   size 165698
-   provides (decipher gomoku hanoi life morse rot13)
+   description "Miscellaneous TeX support."
+   filename "textools-1.07-pkg.tar.gz"
+   md5sum "a7dff92bcb92c3401f7e6085216f72d7"
+   size 79178
+   provides (bib-mode bibtex refer-to-bibtex)
    requires (xemacs-base)
    type single
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(mine
+(texinfo
   (standards-version 1.0
-   version "1.10"
-   author-version "1.9"
-   date "1998-05-09"
-   build-date "1999-02-02"
+   version "1.13"
+   author-version "21.0"
+   date "1998-07-20"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority low
-   category "games"
+   priority high
+   category "wp"
    dump nil
-   description "Minehunt Game."
-   filename "mine-1.10-pkg.tar.gz"
-   md5sum "a2d4f93830fe86e4d4e2f081ec0517fb"
-   size 66679
-   provides (xmine)
+   description "XEmacs TeXinfo support."
+   filename "texinfo-1.13-pkg.tar.gz"
+   md5sum "460efede51ea17cd85872959fcf6474f"
+   size 127794
+   provides (makeinfo tex-mode texinfmt texinfo texnfo-tex texnfo-upd)
    requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(games
+(reftex
   (standards-version 1.0
    version "1.09"
-   author-version "1.04"
-   date "1998-06-04"
-   build-date "1999-02-02"
-   maintainer "Glynn Clements <glynn@sensei.co.uk>"
+   author-version "3.41"
+   date "1998-08-11"
+   build-date "1998-10-11"
+   maintainer "Carsten Dominik <dominik@strw.LeidenUniv.nl>"
    distribution stable
-   priority low
-   category "games"
+   priority medium
+   category "wp"
    dump nil
-   description "Tetris, Sokoban, and Snake."
-   filename "games-1.09-pkg.tar.gz"
-   md5sum "76a327a228745576538711180a9e444e"
-   size 32146
-   provides (gamegrid snake tetris sokoban)
-   requires (xemacs-base)
+   description "Emacs support for LaTeX cross-references, citations.."
+   filename "reftex-1.09-pkg.tar.gz"
+   md5sum "c7c12198809741e20431cf14a6b965c4"
+   size 204664
+   provides (reftex)
+   requires (fsf-compat xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(cookie
+(edt
   (standards-version 1.0
-   version "1.10"
-   author-version "21.0b62"
+   version "1.06"
+   author-version "21.0"
    date "1998-04-07"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
+   distribution contrib
    priority low
-   category "games"
+   category "wp"
    dump nil
-   description "Spook and Yow (Zippy quotes)."
-   filename "cookie-1.10-pkg.tar.gz"
-   md5sum "1c5599fa30e346af452c126d872121be"
-   size 34198
-   provides (cookie1 yow)
+   description "DEC EDIT/EDT emulation."
+   filename "edt-1.06-pkg.tar.gz"
+   md5sum "bb559e2a5c87b7b3f466b83a2ed7ef3b"
+   size 46138
+   provides (edt)
    requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(bbdb
+(crisp
   (standards-version 1.0
-   version "1.07"
-   author-version "2.00.02"
-   date "1998-10-08"
-   build-date "1999-02-02"
+   version "1.08"
+   author-version "1.34"
+   date "1998-08-18"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority medium
-   category "comm"
+   priority low
+   category "wp"
    dump nil
-   description "The Big Brother Data Base"
-   filename "bbdb-1.07-pkg.tar.gz"
-   md5sum "e28c4aed70df000812d34cb3795c2f72"
-   size 282200
-   provides (bbdb)
-   requires (bbdb edit-utils gnus mh-e rmail supercite vm tm apel mail-lib xemacs-base)
+   description "Crisp/Brief emulation."
+   filename "crisp-1.08-pkg.tar.gz"
+   md5sum "2c18df3dd1eb14e01768832b2b208af4"
+   size 10077
+   provides (crisp scroll-lock)
+   requires ()
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(zenirc
+(auctex
   (standards-version 1.0
-   version "1.05"
-   author-version "2.112"
-   date "1998-08-15"
-   build-date "1999-02-02"
+   version "1.15"
+   author-version "9.7p"
+   date "1998-09-30"
+   build-date "1998-10-15"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
-   category "comm"
-   dump nil
-   description "ZENIRC IRC Client."
-   filename "zenirc-1.05-pkg.tar.gz"
-   md5sum "df432e4987ddd0dd65e0124d7d910967"
-   size 276054
-   provides (zenirc)
-   requires (zenirc)
-   type regular
-))
-))
-;;;@@@
-(package-get-update-base-entry (quote
-(mew
-  (standards-version 1.0
-   version "1.07"
-   author-version "1.93b38x1"
-   date "1998-12-09"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
-   priority low
-   category "comm"
+   category "wp"
    dump nil
-   description "Messaging in an Emacs World."
-   filename "mew-1.07-pkg.tar.gz"
-   md5sum "04ed302d5a3735169835e52dadc9e84d"
-   size 518432
-   provides (mew)
-   requires (mew)
+   description "Basic TeX/LaTeX support."
+   filename "auctex-1.15-pkg.tar.gz"
+   md5sum "491d156e8e1f91b6b1604eccdfddace3"
+   size 365003
+   provides (auc-old bib-cite font-latex latex multi-prompt tex-buf tex-info tex-jp tex-site tex)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(tm
+(view-process
   (standards-version 1.0
-   version "1.16"
-   author-version "21.0b62"
-   date "1998-08-27"
-   build-date "1999-02-02"
+   version "1.05"
+   author-version "2.4"
+   date "1998-01-24"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
-   category "comm"
+   category "os"
    dump nil
-   description "Emacs MIME support."
-   filename "tm-1.16-pkg.tar.gz"
-   md5sum "e8a3e6856d5fcfc674f95bc5b82a343e"
-   size 329571
-   provides (tm tm-edit tm-view mime-setup)
-   requires (gnus mh-e rmail vm mailcrypt mail-lib apel xemacs-base)
+   description "A Unix process browsing tool."
+   filename "view-process-1.05-pkg.tar.gz"
+   md5sum "ec1ba005feb4ea54a832c9d07414de11"
+   size 59881
+   provides (view-process-mode)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(gnus
+(os-utils
   (standards-version 1.0
-   version "1.37"
-   author-version "5.6.45"
-   date "1998-09-25"
-   build-date "1999-02-02"
+   version "1.12"
+   author-version "21.0"
+   date "1998-10-01"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
-   category "comm"
-   dump nil
-   description "The Gnus Newsreader and Mailreader."
-   filename "gnus-1.37-pkg.tar.gz"
-   md5sum "8af2b47c6ebbe850d7e8c9906aa1611a"
-   size 1875259
-   provides (gnus message)
-   requires (gnus tm apel w3 mh-e mailcrypt rmail mail-lib xemacs-base)
-   type regular
-))
-))
-;;;@@@
-(package-get-update-base-entry (quote
-(rmail
-  (standards-version 1.0
-   version "1.08"
-   author-version "21.0b62"
-   date "1998-06-28"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
-   priority low
-   category "comm"
+   category "os"
    dump nil
-   description "An obsolete Emacs mailer."
-   filename "rmail-1.08-pkg.tar.gz"
-   md5sum "90f98f9043e0c6f2180ffec9c6904eca"
-   size 96450
-   provides (rmail rmailsum)
-   requires (tm apel mail-lib xemacs-base)
-   type regular
+   description "Miscellaneous O/S utilities."
+   filename "os-utils-1.12-pkg.tar.gz"
+   md5sum "603eb56b2af67de1663c9a3fa700b2ae"
+   size 227137
+   provides (archive-mode background crypt crypt++ inf-lisp jka-compr lpr mchat ps-print tar-mode telnet terminal uncompress)
+   requires (xemacs-base)
+   type single
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(mailcrypt
+(ilisp
   (standards-version 1.0
-   version "1.07"
-   author-version "3.4"
+   version "1.06"
+   author-version "5.8"
    date "1998-01-24"
-   build-date "1999-02-02"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
-   category "comm"
+   category "os"
    dump nil
-   description "Support for messaging encryption with PGP."
-   filename "mailcrypt-1.07-pkg.tar.gz"
-   md5sum "350dccab50ef0800b95d44ef62cca359"
-   size 86362
-   provides (mailcrypt)
-   requires (gnus vm mail-lib xemacs-base)
+   description "Front-end for Inferior Lisp."
+   filename "ilisp-1.06-pkg.tar.gz"
+   md5sum "89c81fd6dac09a58d09e46ee10db4484"
+   size 262258
+   provides (ilisp completer)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(supercite
+(igrep
   (standards-version 1.0
-   version "1.11"
-   author-version "3.55x2"
-   date "1998-08-9"
-   build-date "1999-02-02"
+   version "1.04"
+   author-version "2.83"
+   date "1998-08-11"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
-   category "comm"
-   dump nil
-   description "An Emacs citation tool for News & Mail messages."
-   filename "supercite-1.11-pkg.tar.gz"
-   md5sum "816ba6aa0d984b06a0d8749fd85c4434"
-   size 99417
-   provides (supercite)
-   requires (mail-lib xemacs-base)
-   type regular
-))
-))
-;;;@@@
-(package-get-update-base-entry (quote
-(mh-e
-  (standards-version 1.0
-   version "1.09"
-   author-version "21.0b62"
-   date "1998-07-12"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
-   priority low
-   category "comm"
+   category "os"
    dump nil
-   description "Front end support for MH."
-   filename "mh-e-1.09-pkg.tar.gz"
-   md5sum "89e6f44e8dca03f6be10068391831262"
-   size 176469
-   provides (mh-e)
-   requires (mail-lib xemacs-base)
+   description "Enhanced front-end for Grep."
+   filename "igrep-1.04-pkg.tar.gz"
+   md5sum "8621b52d6316c14821334191477a8ba7"
+   size 14904
+   provides (igrep)
+   requires (dired xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(gnats
+(eterm
   (standards-version 1.0
-   version "1.08"
-   author-version "3.101"
-   date "1998-08-01"
-   build-date "1999-02-02"
+   version "1.07"
+   author-version "21.0"
+   date "1998-06-28"
+   build-date "1998-10-12"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
-   priority high
-   category "comm"
+   priority medium
+   category "os"
    dump nil
-   description "XEmacs bug reports."
-   filename "gnats-1.08-pkg.tar.gz"
-   md5sum "8c1e3100399aac86c63683b1836d4a61"
-   size 189265
-   provides (gnats gnats-admin send-pr)
-   requires (mail-lib xemacs-base)
+   description "Terminal emulation."
+   filename "eterm-1.07-pkg.tar.gz"
+   md5sum "f25bfd3c591f9ca5be6f3705ea2681a3"
+   size 108929
+   provides (eterm)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(footnote
+(misc-games
   (standards-version 1.0
    version "1.08"
-   author-version "0.18x"
-   date "1998-08-27"
-   build-date "1999-02-02"
-   maintainer "SL Baur <steve@xemacs.org>"
+   author-version "21.0"
+   date "1998-03-22"
+   build-date "1998-10-11"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
-   category "comm"
+   category "games"
    dump nil
-   description "Footnoting in mail message editing modes."
-   filename "footnote-1.08-pkg.tar.gz"
-   md5sum "2c2377f0e702b8ba437cc8e245c08cfd"
-   size 13352
-   provides (footnote)
-   requires (mail-lib xemacs-base)
-   type regular
+   description "Other amusements and diversions."
+   filename "misc-games-1.08-pkg.tar.gz"
+   md5sum "ca010a30375137a14b3c37989ad61c48"
+   size 165701
+   provides (decipher gomoku hanoi life morse rot13)
+   requires (xemacs-base)
+   type single
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(eudc
+(mine
   (standards-version 1.0
-   version "1.27"
-   author-version "1.26"
-   date "1998-12-14"
-   build-date "1999-02-02"
-   maintainer "Oscar Figueiredo <Oscar.Figueiredo@epfl.ch>"
+   version "1.09"
+   author-version "1.9"
+   date "1998-05-09"
+   build-date "1998-10-11"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
-   category "comm"
+   category "games"
    dump nil
-   description "Emacs Unified Directory Client (LDAP, PH)."
-   filename "eudc-1.27-pkg.tar.gz"
-   md5sum "60dfa739f2949117e7d7a5e382383419"
-   size 60248
-   provides (eudc eudc-ldap eudc-ph)
-   requires (fsf-compat xemacs-base bbdb)
+   description "Minehunt Game."
+   filename "mine-1.09-pkg.tar.gz"
+   md5sum "044c1e48ffca88adf46e0df91d456a49"
+   size 66794
+   provides (xmine)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(net-utils
+(games
   (standards-version 1.0
-   version "1.11"
-   author-version "21.0b62"
-   date "1998-07-01"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   version "1.07"
+   author-version "1.04"
+   date "1998-06-04"
+   build-date "1998-10-11"
+   maintainer "Glynn Clements <glynn@sensei.co.uk>"
    distribution stable
    priority low
-   category "comm"
+   category "games"
    dump nil
-   description "Miscellaneous Networking Utilities."
-   filename "net-utils-1.11-pkg.tar.gz"
-   md5sum "f9d52e6e6b4f53ccf5cdd3521403e276"
-   size 107193
-   provides (ilisp-browse-cltl2 emacsbug feedmail metamail net-utils rcompile shadowfile webjump webster-www)
-   requires (w3 efs mail-lib xemacs-base)
-   type single
+   description "Tetris, Sokoban, and Snake."
+   filename "games-1.07-pkg.tar.gz"
+   md5sum "ac3fa3b5de00f0daa50c1f372e5b86e0"
+   size 32101
+   provides (gamegrid snake tetris sokoban)
+   requires (xemacs-base)
+   type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(w3
+(cookie
   (standards-version 1.0
-   version "1.11"
-   author-version "4.0pre23"
-   date "1998-07-18"
-   build-date "1999-02-02"
+   version "1.09"
+   author-version "21.0"
+   date "1998-04-07"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution experimental
-   priority high
-   category "comm"
+   distribution stable
+   priority low
+   category "games"
    dump nil
-   description "A Web browser."
-   filename "w3-1.11-pkg.tar.gz"
-   md5sum "98237890a9a0ba5b76b2daf1129b2384"
-   size 612581
-   provides (w3 url)
-   requires (w3 mail-lib xemacs-base)
+   description "Spook and Yow (Zippy quotes)."
+   filename "cookie-1.09-pkg.tar.gz"
+   md5sum "c0618f8a6db3951c081f053233fb75b5"
+   size 34228
+   provides (cookie1 yow)
+   requires (xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(vm
+(xemacs-devel
   (standards-version 1.0
-   version "1.15"
-   author-version "6.62"
-   date "1998-09-22"
-   build-date "1999-02-02"
+   version "1.19"
+   author-version "21.0"
+   date "1998-09-18"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
-   category "comm"
+   category "libs"
    dump nil
-   description "An Emacs mailer."
-   filename "vm-1.15-pkg.tar.gz"
-   md5sum "732ed51ac098cf14a7a164db9cd88f2d"
-   size 548653
-   provides (vm)
-   requires (mail-lib xemacs-base)
-   type regular
+   description "Emacs Lisp developer support."
+   filename "xemacs-devel-1.19-pkg.tar.gz"
+   md5sum "1a9a1d467ae39ce1e93f5fd238112b3e"
+   size 83669
+   provides (docref eldoc elp find-func hide-copyleft ielm regexp-opt trace)
+   requires (xemacs-base)
+   type single
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(sounds-wav
+(xemacs-base
   (standards-version 1.0
-   version "1.06"
-   author-version "21.0b62"
-   date "1998-06-30"
-   build-date "1999-02-02"
+   version "1.27"
+   author-version "21.0"
+   date "1998-10-08"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
+   distribution mule
    priority high
    category "libs"
    dump nil
-   description "XEmacs Microsoft sound files."
-   filename "sounds-wav-1.06-pkg.tar.gz"
-   md5sum "7f3dfd84e88b418ea58233bde7d859fc"
-   size 148545
-   provides ()
+   description "Fundamental XEmacs support, you almost certainly need this."
+   filename "xemacs-base-1.27-pkg.tar.gz"
+   md5sum "bbede4998cdf5af078c0e41d7b9af7c8"
+   size 429962
+   provides (add-log advice annotations assoc case-table chistory comint-xemacs comint compile debug ebuff-menu echistory edmacro ehelp electric enriched env facemenu ffap helper imenu iso-syntax macros novice outline overlay passwd pp regi ring shell skeleton sort thing time-stamp timezone xbm-button xpm-button)
    requires ()
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(sounds-au
+(tooltalk
   (standards-version 1.0
-   version "1.06"
-   author-version "21.0b62"
-   date "1998-06-30"
-   build-date "1999-02-02"
+   version "1.08"
+   author-version "21.0"
+   date "1998-07-25"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
-   priority high
+   distribution contrib
+   priority low
    category "libs"
    dump nil
-   description "XEmacs Sun sound files."
-   filename "sounds-au-1.06-pkg.tar.gz"
-   md5sum "aa4a6080061e802b72156f4ce59e9561"
-   size 125744
+   description "Support for building with Tooltalk."
+   filename "tooltalk-1.08-pkg.tar.gz"
+   md5sum "9b4d7a73f9bd50273a011b1ed6522535"
+   size 9293
    provides ()
    requires ()
    type regular
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(xemacs-devel
+(mail-lib
   (standards-version 1.0
-   version "1.21"
-   author-version "21.0b62"
-   date "1998-10-20"
-   build-date "1999-02-02"
+   version "1.18"
+   author-version "21.0"
+   date "1998-06-08"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
    category "libs"
    dump nil
-   description "Emacs Lisp developer support."
-   filename "xemacs-devel-1.21-pkg.tar.gz"
-   md5sum "aa472f2d412382c2fdd3150105ca7d1c"
-   size 83543
-   provides (docref eldoc elp find-func hide-copyleft ielm regexp-opt trace)
+   description "Fundamental lisp files for providing email support."
+   filename "mail-lib-1.18-pkg.tar.gz"
+   md5sum "25896164b50a8c09a45fdf74342c48ea"
+   size 120245
+   provides (browse-url highlight-headers mail-abbrevs mail-extr mail-utils reporter rfc822 rmail-mini rmailout sendmail smtpmail)
    requires (xemacs-base)
-   type single
+   type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(tooltalk
+(fsf-compat
   (standards-version 1.0
-   version "1.09"
-   author-version "21.0b62"
-   date "1998-07-25"
-   build-date "1999-02-02"
+   version "1.04"
+   author-version "21.0"
+   date "1998-09-12"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution contrib
-   priority low
+   distribution mule
+   priority high
    category "libs"
    dump nil
-   description "Support for building with Tooltalk."
-   filename "tooltalk-1.09-pkg.tar.gz"
-   md5sum "368d6407bf82711bee9a01fa6908b576"
-   size 9271
-   provides ()
+   description "FSF Emacs compatibility files."
+   filename "fsf-compat-1.04-pkg.tar.gz"
+   md5sum "629a4f399a410e88841db23014d00300"
+   size 17419
+   provides (overlay thingatpt timer x-popup-menu)
    requires ()
-   type regular
+   type single
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
 (elib
   (standards-version 1.0
-   version "1.04"
+   version "1.03"
    author-version "1.0"
    date "1998-10-01"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution mule
    priority high
    category "libs"
    dump nil
    description "Portable Emacs Lisp utilities library."
-   filename "elib-1.04-pkg.tar.gz"
-   md5sum "d17596beb9b03292e322f8460c36eb81"
-   size 72834
+   filename "elib-1.03-pkg.tar.gz"
+   md5sum "f65ecef3ac286ee59e102f5fc5ad62cc"
+   size 72830
    provides (avltree bintree cookie dll elib-node queue-f queue-m read stack-f stack-m string)
    requires ()
    type single
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
+(efs
+  (standards-version 1.0
+   version "1.11"
+   author-version "1.17"
+   date "1998-08-23"
+   build-date "1998-10-11"
+   maintainer "Mike Sperber <sperber@informatik.uni-tuebingen.de>"
+   distribution stable
+   priority medium
+   category "libs"
+   dump nil
+   description "Treat files on remote systems the same as local files."
+   filename "efs-1.11-pkg.tar.gz"
+   md5sum "88a538a5016ae53380dba011db80887a"
+   size 368997
+   provides (efs)
+   requires (xemacs-base vm dired)
+   type regular
+))
+))
+;;;@@@
+(package-get-update-base-entry (quote
 (edebug
   (standards-version 1.0
-   version "1.07"
-   author-version "21.0b62"
+   version "1.06"
+   author-version "21.0"
    date "1998-03-12"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "libs"
    dump nil
    description "An Emacs Lisp debugger."
-   filename "edebug-1.07-pkg.tar.gz"
-   md5sum "62d3e581feac2c3a73917ad0d81151b0"
-   size 112408
+   filename "edebug-1.06-pkg.tar.gz"
+   md5sum "a897be415a8b68c1f79a3632374c9174"
+   size 112385
    provides (edebug cl-read cust-print eval-reg cl-specs)
    requires (xemacs-base)
    type regular
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(Sun
+(dired
   (standards-version 1.0
-   version "1.10"
-   author-version "21.0b62"
-   date "1998-07-25"
-   build-date "1999-02-02"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution sun
-   priority low
+   version "1.03"
+   author-version "7.9"
+   date "1998-05-05"
+   build-date "1998-10-11"
+   maintainer "Mike Sperber <sperber@informatik.uni-tuebingen.de>"
+   distribution stable
+   priority medium
    category "libs"
    dump nil
-   description "Support for Sparcworks."
-   filename "Sun-1.10-pkg.tar.gz"
-   md5sum "54cce5cbb182d99de5562a586714e50c"
-   size 63693
-   provides (sccs eos-browser eos-common eos-debugger eos-debugger eos-editor eos-init eos-load eos-menubar eos-toolbar sunpro)
-   requires (cc-mode xemacs-base)
+   description "Manage file systems."
+   filename "dired-1.03-pkg.tar.gz"
+   md5sum "30e621efdf8b83e72ad3b68f4e795069"
+   size 187593
+   provides (diff dired)
+   requires (xemacs-base)
    type regular
 ))
 ))
 (package-get-update-base-entry (quote
 (apel
   (standards-version 1.0
-   version "1.08"
+   version "1.07"
    author-version "3.3"
    date "1998-07-23"
-   build-date "1999-02-02"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution mule
    priority high
    category "libs"
    dump nil
    description "A Portable Emacs Library.  Used by XEmacs MIME support."
-   filename "apel-1.08-pkg.tar.gz"
-   md5sum "125d8a29874f82ba1b1900848869e3c3"
-   size 34725
+   filename "apel-1.07-pkg.tar.gz"
+   md5sum "a650a5235403b0a1b46b3269634498e3"
+   size 34784
    provides (atype emu-20 emu-e19 emu-x20 emu-xemacs emu file-detect filename install mule-caesar path-util richtext std11-parse std11 tinyrich)
    requires (fsf-compat xemacs-base)
    type regular
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(efs
-  (standards-version 1.0
-   version "1.14"
-   author-version "1.18"
-   date "1999-01-03"
-   build-date "1999-02-02"
-   maintainer "Mike Sperber <sperber@informatik.uni-tuebingen.de>"
-   distribution stable
-   priority medium
-   category "libs"
-   dump nil
-   description "Treat files on remote systems the same as local files."
-   filename "efs-1.14-pkg.tar.gz"
-   md5sum "2b4128fec0dcb31834f404ef962f10ab"
-   size 369742
-   provides (efs)
-   requires (xemacs-base vm dired)
-   type regular
-))
-))
-;;;@@@
-(package-get-update-base-entry (quote
-(dired
-  (standards-version 1.0
-   version "1.05"
-   author-version "7.9"
-   date "1998-12-09"
-   build-date "1999-02-02"
-   maintainer "Mike Sperber <sperber@informatik.uni-tuebingen.de>"
-   distribution stable
-   priority medium
-   category "libs"
-   dump nil
-   description "Manage file systems."
-   filename "dired-1.05-pkg.tar.gz"
-   md5sum "392440b1472a2415b0b9b6779df93619"
-   size 187654
-   provides (diff dired)
-   requires (xemacs-base)
-   type regular
-))
-))
-;;;@@@
-(package-get-update-base-entry (quote
-(mail-lib
+(Sun
   (standards-version 1.0
-   version "1.21"
-   author-version "21.0b62"
-   date "1999-01-20"
-   build-date "1999-02-02"
+   version "1.09"
+   author-version "21.0"
+   date "1998-07-25"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
-   priority medium
+   distribution sun
+   priority low
    category "libs"
    dump nil
-   description "Fundamental lisp files for providing email support."
-   filename "mail-lib-1.21-pkg.tar.gz"
-   md5sum "4011698f9a440406af74ee1694e5539b"
-   size 131218
-   provides (browse-url highlight-headers mail-abbrevs mail-extr mail-utils reporter rfc822 rmail-mini rmailout sendmail smtpmail)
-   requires (xemacs-base)
+   description "Support for Sparcworks."
+   filename "Sun-1.09-pkg.tar.gz"
+   md5sum "dc41d791f7c66dc13e8d0d206689188b"
+   size 63916
+   provides (sccs eos-browser eos-common eos-debugger eos-debugger eos-editor eos-init eos-load eos-menubar eos-toolbar sunpro)
+   requires (cc-mode xemacs-base)
    type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(fsf-compat
+(sounds-au
   (standards-version 1.0
    version "1.05"
-   author-version "21.0b62"
-   date "1998-09-12"
-   build-date "1999-02-02"
+   author-version "21.0"
+   date "1998-06-30"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution mule
+   distribution stable
    priority high
    category "libs"
    dump nil
-   description "FSF Emacs compatibility files."
-   filename "fsf-compat-1.05-pkg.tar.gz"
-   md5sum "64cb1984a71974f3f40c0be1a971f441"
-   size 17347
-   provides (overlay thingatpt timer x-popup-menu)
+   description "XEmacs Sun sound files."
+   filename "sounds-au-1.05-pkg.tar.gz"
+   md5sum "5e44ddd6754771e35303bf4e71c17a17"
+   size 125753
+   provides ()
    requires ()
-   type single
+   type regular
 ))
 ))
 ;;;@@@
 (package-get-update-base-entry (quote
-(xemacs-base
+(sounds-wav
   (standards-version 1.0
-   version "1.29"
-   author-version "21.0b62"
-   date "1998-12-05"
-   build-date "1999-02-02"
+   version "1.05"
+   author-version "21.0"
+   date "1998-06-30"
+   build-date "1998-10-11"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution mule
+   distribution stable
    priority high
    category "libs"
    dump nil
-   description "Fundamental XEmacs support, you almost certainly need this."
-   filename "xemacs-base-1.29-pkg.tar.gz"
-   md5sum "da907ff396bc3d1143a7d2f5142f5dd2"
-   size 430466
-   provides (add-log advice annotations assoc case-table chistory comint-xemacs comint compile debug ebuff-menu echistory edmacro ehelp electric enriched env facemenu ffap helper imenu iso-syntax macros novice outline overlay passwd pp regi ring shell skeleton sort thing time-stamp timezone xbm-button xpm-button)
+   description "XEmacs Microsoft sound files."
+   filename "sounds-wav-1.05-pkg.tar.gz"
+   md5sum "e110bc6096bcd24181b45c1b7f83eb59"
+   size 148564
+   provides ()
    requires ()
    type regular
 ))
 ))
 ;;;@@@
 ;; Package Index file ends here
+
+-----BEGIN PGP SIGNATURE-----
+Version: 2.6.2
+
+iQCVAwUBNibr5aLJZEUiepcNAQHmWQP+PDjjOvmsdhu6RGXIFCUPV4ado8IWD8i8
+/aEwLHJRdoQWEg0ZuiNgmtF2iNPrNIOkSs9hF+sOF4xoszhxaytfFG7DEA5Q8Alb
+jKooHKEUEF7W0wAxihyGojz3VuH5i7GKAtOcVqFtgWS3eAkNaN4QWlmhxavh0Cdv
+p7wnfYTZYSs=
+=65go
+-----END PGP SIGNATURE-----
diff --git a/etc/sample.emacs b/etc/sample.emacs
new file mode 100644 (file)
index 0000000..9e14814
--- /dev/null
@@ -0,0 +1,656 @@
+;; -*- Mode: Emacs-Lisp -*-
+
+;;; This is a sample .emacs file.
+;;;
+;;; The .emacs file, which should reside in your home directory, allows you to
+;;; customize the behavior of Emacs.  In general, changes to your .emacs file
+;;; will not take effect until the next time you start up Emacs.  You can load
+;;; it explicitly with `M-x load-file RET ~/.emacs RET'.
+;;;
+;;; There is a great deal of documentation on customization in the Emacs
+;;; manual.  You can read this manual with the online Info browser: type
+;;; `C-h i' or select "Emacs Info" from the "Help" menu.
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;                     Basic Customization                         ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Enable the command `narrow-to-region' ("C-x n n"), a useful
+;; command, but possibly confusing to a new user, so it's disabled by
+;; default.
+(put 'narrow-to-region 'disabled nil)
+
+;;; Define a variable to indicate whether we're running XEmacs/Lucid Emacs.
+;;; (You do not have to defvar a global variable before using it --
+;;; you can just call `setq' directly like we do for `emacs-major-version'
+;;; below.  It's clearer this way, though.)
+
+(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
+
+;; Make the sequence "C-x w" execute the `what-line' command, 
+;; which prints the current line number in the echo area.
+(global-set-key "\C-xw" 'what-line)
+
+;; set up the function keys to do common tasks to reduce Emacs pinky
+;; and such.
+
+;; Make F1 invoke help
+(global-set-key [f1] 'help-command)
+;; Make F2 be `undo'
+(global-set-key [f2] 'undo)
+;; Make F3 be `find-file'
+;; Note: it does not currently work to say
+;;   (global-set-key 'f3 "\C-x\C-f")
+;; The reason is that macros can't do interactive things properly.
+;; This is an extremely longstanding bug in Emacs.  Eventually,
+;; it will be fixed. (Hopefully ..)
+(global-set-key [f3] 'find-file)
+
+;; Make F4 be "mark", F5 be "copy", F6 be "paste"
+;; Note that you can set a key sequence either to a command or to another
+;; key sequence.
+(global-set-key [f4] 'set-mark-command)
+(global-set-key [f5] "\M-w")
+(global-set-key [f6] "\C-y")
+
+;; Shift-F4 is "pop mark off of stack"
+(global-set-key [(shift f4)] (lambda () (interactive) (set-mark-command t)))
+
+;; Make F7 be `save-buffer'
+(global-set-key [f7] 'save-buffer)
+
+;; Make F8 be "start macro", F9 be "end macro", F10 be "execute macro"
+(global-set-key [f8] 'start-kbd-macro)
+(global-set-key [f9] 'end-kbd-macro)
+(global-set-key [f10] 'call-last-kbd-macro)
+
+;; Here's an alternative binding if you don't use keyboard macros:
+;; Make F8 be `save-buffer' followed by `delete-window'.
+;;(global-set-key 'f8 "\C-x\C-s\C-x0")
+
+;; If you prefer delete to actually delete forward then you want to
+;; uncomment the next line (or use `Customize' to customize this).
+;; (setq delete-key-deletes-forward t)
+
+
+(cond (running-xemacs
+       ;;
+       ;; Code for any version of XEmacs/Lucid Emacs goes here
+       ;;
+
+       ;; Change the values of some variables.
+       ;; (t means true; nil means false.)
+       ;;
+       ;; Use the "Describe Variable..." option on the "Help" menu
+       ;; to find out what these variables mean.
+       (setq find-file-use-truenames nil
+            find-file-compare-truenames t
+            minibuffer-confirm-incomplete t
+            complex-buffers-menu-p t
+            next-line-add-newlines nil
+            mail-yank-prefix "> "
+            kill-whole-line t
+            )
+
+       ;; When running ispell, consider all 1-3 character words as correct.
+       (setq ispell-extra-args '("-W" "3"))
+
+       (cond ((or (not (fboundp 'device-type))
+                 (equal (device-type) 'x))
+             ;; Code which applies only when running emacs under X goes here.
+             ;; (We check whether the function `device-type' exists
+             ;; before using it.  In versions before 19.12, there
+             ;; was no such function.  If it doesn't exist, we
+             ;; simply assume we're running under X -- versions before
+             ;; 19.12 only supported X.)
+
+             ;; Remove the binding of C-x C-c, which normally exits emacs.
+             ;; It's easy to hit this by mistake, and that can be annoying.
+             ;; Under X, you can always quit with the "Exit Emacs" option on
+             ;; the File menu.
+             (global-set-key "\C-x\C-c" nil)
+
+             ;; Uncomment this to enable "sticky modifier keys" in 19.13
+             ;; and up.  With sticky modifier keys enabled, you can
+             ;; press and release a modifier key before pressing the
+             ;; key to be modified, like how the ESC key works always.
+             ;; If you hold the modifier key down, however, you still
+             ;; get the standard behavior.  I personally think this
+             ;; is the best thing since sliced bread (and a *major*
+             ;; win when it comes to reducing Emacs pinky), but it's
+             ;; disorienting at first so I'm not enabling it here by
+             ;; default.
+
+             ;;(setq modifier-keys-are-sticky t)
+
+             ;; This changes the variable which controls the text that goes
+             ;; in the top window title bar.  (However, it is not changed
+             ;; unless it currently has the default value, to avoid
+             ;; interfering with a -wn command line argument I may have
+             ;; started emacs with.)
+             (if (equal frame-title-format "%S: %b")
+                 (setq frame-title-format
+                       (concat "%S: " invocation-directory invocation-name
+                               " [" emacs-version "]"
+                               (if nil ; (getenv "NCD")
+                                   ""
+                                 "   %b"))))
+
+             ;; If we're running on display 0, load some nifty sounds that
+             ;; will replace the default beep.  But if we're running on a
+             ;; display other than 0, which probably means my NCD X terminal,
+             ;; which can't play digitized sounds, do two things: reduce the
+             ;; beep volume a bit, and change the pitch of the sound that is
+             ;; made for "no completions."
+             ;;
+             ;; (Note that sampled sounds only work if XEmacs was compiled
+             ;; with sound support, and we're running on the console of a
+             ;; Sparc, HP, or SGI machine, or on a machine which has a
+             ;; NetAudio server; otherwise, you just get the standard beep.)
+             ;;
+             ;; (Note further that changing the pitch and duration of the
+             ;; standard beep only works with some X servers; many servers
+             ;; completely ignore those parameters.)
+             ;;
+             (cond ((string-match ":0" (getenv "DISPLAY"))
+                    (load-default-sounds))
+                   (t
+                    (setq bell-volume 40)
+                    (setq sound-alist
+                          (append sound-alist '((no-completion :pitch 500))))
+                    ))
+
+             ;; Make `C-x C-m' and `C-x RET' be different (since I tend
+             ;; to type the latter by accident sometimes.)
+             (define-key global-map [(control x) return] nil)
+
+             ;; Change the pointer used when the mouse is over a modeline
+             (set-glyph-image modeline-pointer-glyph "leftbutton")
+
+             ;; Change the continuation glyph face so it stands out more
+             (and (fboundp 'set-glyph-property)
+                  (boundp 'continuation-glyph)
+                  (set-glyph-property continuation-glyph 'face 'bold))
+
+             ;; Change the pointer used during garbage collection.
+             ;;
+             ;; Note that this pointer image is rather large as pointers go,
+             ;; and so it won't work on some X servers (such as the MIT
+             ;; R5 Sun server) because servers may have lamentably small
+             ;; upper limits on pointer size.
+             ;;(if (featurep 'xpm)
+             ;;   (set-glyph-image gc-pointer-glyph
+             ;;         (expand-file-name "trash.xpm" data-directory)))
+
+             ;; Here's another way to do that: it first tries to load the
+             ;; pointer once and traps the error, just to see if it's
+             ;; possible to load that pointer on this system; if it is,
+             ;; then it sets gc-pointer-glyph, because we know that
+             ;; will work.  Otherwise, it doesn't change that variable
+             ;; because we know it will just cause some error messages.
+             (if (featurep 'xpm)
+                 (let ((file (expand-file-name "recycle.xpm" data-directory)))
+                   (if (condition-case error
+                           ;; check to make sure we can use the pointer.
+                           (make-image-instance file nil
+                                                '(pointer))
+                         (error nil))      ; returns nil if an error occurred.
+                       (set-glyph-image gc-pointer-glyph file))))
+
+             (when (featurep 'menubar)
+               ;; Add `dired' to the File menu
+               (add-menu-button '("File") ["Edit Directory" dired t])
+
+               ;; Here's a way to add scrollbar-like buttons to the menubar
+               (add-menu-button nil ["Top" beginning-of-buffer t])
+               (add-menu-button nil ["<<<" scroll-down         t])
+               (add-menu-button nil [" . " recenter            t])
+               (add-menu-button nil [">>>" scroll-up           t])
+               (add-menu-button nil ["Bot" end-of-buffer       t]))
+
+             ;; Change the behavior of mouse button 2 (which is normally
+             ;; bound to `mouse-yank'), so that it inserts the selected text
+             ;; at point (where the text cursor is), instead of at the
+             ;; position clicked.
+             ;;
+             ;; Note that you can find out what a particular key sequence or
+             ;; mouse button does by using the "Describe Key..." option on
+             ;; the Help menu.
+             (setq mouse-yank-at-point t)
+
+             ;; When editing C code (and Lisp code and the like), I often
+             ;; like to insert tabs into comments and such.  It gets to be
+             ;; a pain to always have to use `C-q TAB', so I set up a more
+             ;; convenient binding.  Note that this does not work in
+             ;; TTY frames, where tab and shift-tab are indistinguishable.
+             (define-key global-map '(shift tab) 'self-insert-command)
+
+             ;; LISPM bindings of Control-Shift-C and Control-Shift-E.
+             ;; Note that "\C-C" means Control-C, not Control-Shift-C.
+             ;; To specify shifted control characters, you must use the
+             ;; more verbose syntax used here.
+             (define-key emacs-lisp-mode-map '(control C) 'compile-defun)
+             (define-key emacs-lisp-mode-map '(control E) 'eval-defun)
+
+             ;; If you like the FSF Emacs binding of button3 (single-click
+             ;; extends the selection, double-click kills the selection),
+             ;; uncomment the following:
+
+             ;; Under 19.13, the following is enough:
+              ;(define-key global-map 'button3 'mouse-track-adjust)
+
+             ;; But under 19.12, you need this:
+              ;(define-key global-map 'button3
+              ;    (lambda (event)
+              ;      (interactive "e")
+              ;      (let ((default-mouse-track-adjust t))
+              ;        (mouse-track event))))
+
+             ;; Under both 19.12 and 19.13, you also need this:
+              ;(add-hook 'mouse-track-click-hook
+              ;          (lambda (event count)
+              ;            (if (or (/= (event-button event) 3)
+              ;                    (/= count 2))
+              ;                nil ;; do the normal operation
+              ;              (kill-region (point) (mark))
+              ;              t ;; don't do the normal operations.
+              ;              )))
+
+             ))
+
+       ))
+
+;; Oh, and here's a cute hack you might want to put in the sample .emacs
+;; file: it changes the color of the window if it's not on the local
+;; machine, or if it's running as root:
+
+;; local emacs background:  whitesmoke
+;; remote emacs background: palegreen1
+;; root emacs background:   coral2
+(cond
+ ((and (string-match "XEmacs" emacs-version)
+       (eq window-system 'x)
+       (boundp 'emacs-major-version)
+       (= emacs-major-version 19)
+       (>= emacs-minor-version 12))
+  (let* ((root-p (eq 0 (user-uid)))
+        (dpy (or (getenv "DISPLAY") ""))
+        (remote-p (not
+                   (or (string-match "^\\(\\|unix\\|localhost\\):" dpy)
+                       (let ((s (system-name)))
+                         (if (string-match "\\.\\(netscape\\|mcom\\)\\.com" s)
+                             (setq s (substring s 0 (match-beginning 0))))
+                         (string-match (concat "^" (regexp-quote s)) dpy)))))
+        (bg (cond (root-p "coral2")
+                  (remote-p "palegreen1")
+                  (t nil))))
+    (cond (bg
+          (let ((def (color-name (face-background 'default)))
+                (faces (face-list)))
+            (while faces
+              (let ((obg (face-background (car faces))))
+                (if (and obg (equal def (color-name obg)))
+                    (set-face-background (car faces) bg)))
+              (setq faces (cdr faces)))))))))
+
+
+;;; Older versions of emacs did not have these variables
+;;; (emacs-major-version and emacs-minor-version.)
+;;; Let's define them if they're not around, since they make
+;;; it much easier to conditionalize on the emacs version.
+
+(if (and (not (boundp 'emacs-major-version))
+        (string-match "^[0-9]+" emacs-version))
+    (setq emacs-major-version
+         (string-to-int (substring emacs-version
+                                   (match-beginning 0) (match-end 0)))))
+(if (and (not (boundp 'emacs-minor-version))
+        (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version))
+    (setq emacs-minor-version
+         (string-to-int (substring emacs-version
+                                   (match-beginning 1) (match-end 1)))))
+
+;;; Define a function to make it easier to check which version we're
+;;; running.
+
+(defun running-emacs-version-or-newer (major minor)
+  (or (> emacs-major-version major)
+      (and (= emacs-major-version major)
+          (>= emacs-minor-version minor))))
+
+(cond ((and running-xemacs
+           (running-emacs-version-or-newer 19 6))
+       ;;
+       ;; Code requiring XEmacs/Lucid Emacs version 19.6 or newer goes here
+       ;;
+       ))
+
+(cond ((>= emacs-major-version 19)
+       ;;
+       ;; Code for any vintage-19 emacs goes here
+       ;;
+       ))
+
+(cond ((and (not running-xemacs)
+           (>= emacs-major-version 19))
+       ;;
+       ;; Code specific to FSF Emacs 19 (not XEmacs/Lucid Emacs) goes here
+       ;;
+       ))
+
+(cond ((< emacs-major-version 19)
+       ;;
+       ;; Code specific to emacs 18 goes here
+       ;;
+       ))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;             Customization of Specific Packages                  ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; Load gnuserv, which will allow you to connect to XEmacs sessions
+;;; using `gnuclient'.
+
+;; If you never run more than one XEmacs at a time, you might want to
+;; always start gnuserv.  Otherwise it is preferable to specify
+;; `-f gnuserv-start' on the command line to one of the XEmacsen.
+; (gnuserv-start)
+
+
+;;; ********************
+;;; Load efs, which uses the FTP protocol as a pseudo-filesystem.
+;;; When this is loaded, the pathname syntax /user@host:/remote/path
+;;; refers to files accessible through ftp.
+;;;
+(require 'dired)
+;; compatible ange-ftp/efs initialization derived from code
+;; from John Turner <turner@lanl.gov>
+;; As of 19.15, efs is bundled instead of ange-ftp.
+;; NB: doesn't handle 20.0 properly, efs didn't appear until 20.1.
+;;
+;; The environment variable EMAIL_ADDRESS is used as the password
+;; for access to anonymous ftp sites, if it is set.  If not, one is
+;; constructed using the environment variables USER and DOMAINNAME
+;; (e.g. turner@lanl.gov), if set.
+
+(if (and running-xemacs
+        (or (> emacs-major-version 20)
+            (and (= emacs-major-version 20) (>= emacs-minor-version 1))
+            (and (= emacs-major-version 19) (>= emacs-minor-version 15))))
+    (progn
+      (message "Loading and configuring bundled packages... efs")
+      (require 'efs-auto)
+      (if (getenv "USER")
+         (setq efs-default-user (getenv "USER")))
+      (if (getenv "EMAIL_ADDRESS")
+         (setq efs-generate-anonymous-password (getenv "EMAIL_ADDRESS"))
+       (if (and (getenv "USER")
+                (getenv "DOMAINNAME"))
+           (setq efs-generate-anonymous-password
+                 (concat (getenv "USER")"@"(getenv "DOMAINNAME")))))
+      (setq efs-auto-save 1))
+  (progn
+    (message "Loading and configuring bundled packages... ange-ftp")
+    (require 'ange-ftp)
+    (if (getenv "USER")
+       (setq ange-ftp-default-user (getenv "USER")))
+    (if (getenv "EMAIL_ADDRESS")
+       (setq ange-ftp-generate-anonymous-password (getenv "EMAIL_ADDRESS"))
+      (if (and (getenv "USER")
+              (getenv "DOMAINNAME"))
+         (setq ange-ftp-generate-anonymous-password
+               (concat (getenv "USER")"@"(getenv "DOMAINNAME")))))
+    (setq ange-ftp-auto-save 1)
+    )
+  )
+
+;;; ********************
+;;; Load the default-dir.el package which installs fancy handling
+;;;  of the initial contents in the minibuffer when reading
+;;; file names.
+
+(if (and running-xemacs
+        (or (and (= emacs-major-version 20) (>= emacs-minor-version 1))
+            (and (= emacs-major-version 19) (>= emacs-minor-version 15))))
+    (require 'default-dir))
+
+;;; ********************
+;;; Load the auto-save.el package, which lets you put all of your autosave
+;;; files in one place, instead of scattering them around the file system.
+;;;
+(setq auto-save-directory (expand-file-name "~/autosave/")
+      auto-save-directory-fallback auto-save-directory
+      auto-save-hash-p nil
+      efs-auto-save t
+      efs-auto-save-remotely nil
+      ;; now that we have auto-save-timeout, let's crank this up
+      ;; for better interactive response.
+      auto-save-interval 2000
+      )
+;; We load this afterwards because it checks to make sure the
+;; auto-save-directory exists (creating it if not) when it's loaded.
+(require 'auto-save)
+
+;; This adds additional extensions which indicate files normally
+;; handled by cc-mode.
+(setq auto-mode-alist
+      (append '(("\\.C$"  . c++-mode)
+               ("\\.cc$" . c++-mode)
+               ("\\.hh$" . c++-mode)
+               ("\\.c$"  . c-mode)
+               ("\\.h$"  . c-mode))
+             auto-mode-alist))
+
+
+;;; ********************
+;;; cc-mode (the mode you're in when editing C, C++, and Objective C files)
+
+;; Tell cc-mode not to check for old-style (K&R) function declarations.
+;; This speeds up indenting a lot.
+(setq c-recognize-knr-p nil)
+
+;; Change the indentation amount to 4 spaces instead of 2.
+;; You have to do it in this complicated way because of the
+;; strange way the cc-mode initializes the value of `c-basic-offset'.
+(add-hook 'c-mode-hook (lambda () (setq c-basic-offset 4)))
+
+
+;;; ********************
+;;; Load a partial-completion mechanism, which makes minibuffer completion
+;;; search multiple words instead of just prefixes; for example, the command
+;;; `M-x byte-compile-and-load-file RET' can be abbreviated as `M-x b-c-a RET'
+;;; because there are no other commands whose first three words begin with
+;;; the letters `b', `c', and `a' respectively.
+;;;
+(load-library "completer")
+
+
+;;; ********************
+;;; Load crypt, which is a package for automatically decoding and reencoding
+;;; files by various methods - for example, you can visit a .Z or .gz file,
+;;; edit it, and have it automatically re-compressed when you save it again.
+;;; 
+(setq crypt-encryption-type 'pgp   ; default encryption mechanism
+      crypt-confirm-password t    ; make sure new passwords are correct
+      ;crypt-never-ever-decrypt t  ; if you don't encrypt anything, set this to
+                                  ; tell it not to assume that "binary" files
+                                  ; are encrypted and require a password.
+      )
+(require 'crypt)
+
+
+;;; ********************
+;;; Edebug is a source-level debugger for emacs-lisp programs.
+;;;
+(define-key emacs-lisp-mode-map "\C-xx" 'edebug-defun)
+
+
+;;; ********************
+;;; Font-Lock is a syntax-highlighting package.  When it is enabled and you
+;;; are editing a program, different parts of your program will appear in
+;;; different fonts or colors.  For example, with the code below, comments
+;;; appear in red italics, function names in function definitions appear in
+;;; blue bold, etc.  The code below will cause font-lock to automatically be
+;;; enabled when you edit C, C++, Emacs-Lisp, and many other kinds of
+;;; programs.
+;;;
+;;; The "Options" menu has some commands for controlling this as well.
+;;;
+(cond (running-xemacs
+
+       ;; If you want the default colors, you could do this:
+       ;; (setq font-lock-use-default-fonts nil)
+       ;; (setq font-lock-use-default-colors t)
+       ;; but I want to specify my own colors, so I turn off all
+       ;; default values.
+       (setq font-lock-use-default-fonts nil)
+       (setq font-lock-use-default-colors nil)
+
+       (require 'font-lock)
+
+       ;; Mess around with the faces a bit.  Note that you have
+       ;; to change the font-lock-use-default-* variables *before*
+       ;; loading font-lock, and wait till *after* loading font-lock
+       ;; to customize the faces.
+
+       ;; string face is green
+       (set-face-foreground 'font-lock-string-face "forest green")
+
+       ;; comments are italic and red; doc strings are italic
+       ;;
+       ;; (I use copy-face instead of make-face-italic/make-face-bold
+       ;; because the startup code does intelligent things to the
+       ;; 'italic and 'bold faces to ensure that they are different
+       ;; from the default face.  For example, if the default face
+       ;; is bold, then the 'bold face will be unbold.)
+       (copy-face 'italic 'font-lock-comment-face)
+       ;; Underlining comments looks terrible on tty's
+       (set-face-underline-p 'font-lock-comment-face nil 'global 'tty)
+       (set-face-highlight-p 'font-lock-comment-face t 'global 'tty)
+       (copy-face 'font-lock-comment-face 'font-lock-doc-string-face)
+       (set-face-foreground 'font-lock-comment-face "red")
+
+       ;; function names are bold and blue
+       (copy-face 'bold 'font-lock-function-name-face)
+       (set-face-foreground 'font-lock-function-name-face "blue")
+
+       ;; misc. faces
+       (and (find-face 'font-lock-preprocessor-face) ; 19.13 and above
+            (copy-face 'bold 'font-lock-preprocessor-face))
+       (copy-face 'italic 'font-lock-type-face)
+       (copy-face 'bold 'font-lock-keyword-face)
+       ))
+
+
+;;; ********************
+;;; fast-lock is a package which speeds up the highlighting of files
+;;; by saving information about a font-locked buffer to a file and
+;;; loading that information when the file is loaded again.  This
+;;; requires a little extra disk space be used.
+;;;
+;;; Normally fast-lock puts the cache file (the filename appended with
+;;; .flc) in the same directory as the file it caches.  You can
+;;; specify an alternate directory to use by setting the variable
+;;; fast-lock-cache-directories.
+
+;; Let's use lazy-lock instead.
+;;(add-hook 'font-lock-mode-hook 'turn-on-fast-lock)
+;;(setq fast-lock-cache-directories '("/foo/bar/baz"))
+
+
+;;; ********************
+;;; lazy-lock is a package which speeds up the highlighting of files
+;;; by doing it "on-the-fly" -- only the visible portion of the
+;;; buffer is fontified.  The results may not always be quite as
+;;; accurate as using full font-lock or fast-lock, but it's *much*
+;;; faster.  No more annoying pauses when you load files.
+
+(add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
+;; I personally don't like "stealth mode" (where lazy-lock starts
+;; fontifying in the background if you're idle for 30 seconds)
+;; because it takes too long to wake up again on my piddly Sparc 1+.
+(setq lazy-lock-stealth-time nil)
+
+
+;;; ********************
+;;; func-menu is a package that scans your source file for function
+;;; definitions and makes a menubar entry that lets you jump to any
+;;; particular function definition by selecting it from the menu.  The
+;;; following code turns this on for all of the recognized languages.
+;;; Scanning the buffer takes some time, but not much.
+;;;
+;;; Send bug reports, enhancements etc to:
+;;; David Hughes <ukchugd@ukpmr.cs.philips.nl>
+;;;
+(cond (running-xemacs
+       (require 'func-menu)
+       (define-key global-map 'f8 'function-menu)
+       (add-hook 'find-file-hooks 'fume-add-menubar-entry)
+       (define-key global-map "\C-cl" 'fume-list-functions)
+       (define-key global-map "\C-cg" 'fume-prompt-function-goto)
+
+       ;; The Hyperbole information manager package uses (shift button2) and
+       ;; (shift button3) to provide context-sensitive mouse keys.  If you
+       ;; use this next binding, it will conflict with Hyperbole's setup.
+       ;; Choose another mouse key if you use Hyperbole.
+       (define-key global-map '(shift button3) 'mouse-function-menu)
+
+       ;; For descriptions of the following user-customizable variables,
+       ;; type C-h v <variable>
+       (setq fume-max-items 25
+             fume-fn-window-position 3
+             fume-auto-position-popup t
+             fume-display-in-modeline-p t
+             fume-menubar-menu-location "File"
+             fume-buffer-name "*Function List*"
+             fume-no-prompt-on-valid-default nil)
+       ))
+
+
+;;; ********************
+;;; MH is a mail-reading system from the Rand Corporation that relies on a
+;;; number of external filter programs (which do not come with emacs.)
+;;; Emacs provides a nice front-end onto MH, called "mh-e".
+;;;
+;; Bindings that let you send or read mail using MH
+;(global-set-key "\C-xm"  'mh-smail)
+;(global-set-key "\C-x4m" 'mh-smail-other-window)
+;(global-set-key "\C-cr"  'mh-rmail)
+
+;; Customization of MH behavior.
+(setq mh-delete-yanked-msg-window t)
+(setq mh-yank-from-start-of-msg 'body)
+(setq mh-summary-height 11)
+
+;; Use lines like the following if your version of MH
+;; is in a special place.
+;(setq mh-progs "/usr/dist/pkgs/mh/bin.svr4/")
+;(setq mh-lib "/usr/dist/pkgs/mh/lib.svr4/")
+
+
+;;; ********************
+;;; resize-minibuffer-mode makes the minibuffer automatically
+;;; resize as necessary when it's too big to hold its contents.
+
+(autoload 'resize-minibuffer-mode "rsz-minibuf" nil t)
+(resize-minibuffer-mode)
+(setq resize-minibuffer-window-exactly nil)
+
+;;; ********************
+;;; W3 is a browser for the World Wide Web, and takes advantage of the very
+;;; latest redisplay features in XEmacs.  You can access it simply by typing 
+;;; 'M-x w3'; however, if you're unlucky enough to be on a machine that is 
+;;; behind a firewall, you will have to do something like this first:
+
+;(setq w3-use-telnet t
+;      ;;
+;      ;; If the Telnet program you use to access the outside world is
+;      ;; not called "telnet", specify its name like this.
+;      w3-telnet-prog "itelnet"
+;      ;;
+;      ;; If your Telnet program adds lines of junk at the beginning
+;      ;; of the session, specify the number of lines here.
+;      w3-telnet-header-length 4
+;      )
diff --git a/lib-src/install-sid b/lib-src/install-sid
new file mode 100755 (executable)
index 0000000..60083f5
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/sh
+# Drop in the SUBMITTER id into a site's installed send-pr script.
+# Copyright (C) 1993 Free Software Foundation, Inc.
+# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
+# version written by Heinz G. Seidl (hgs@ide.com).
+#
+# This file is part of GNU GNATS.
+#
+# GNU GNATS 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.
+#
+# GNU GNATS 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 GNU GNATS; see the file COPYING.  If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+COMMAND=`echo $0 | sed -e 's,.*/,,g'`
+USAGE="Usage: $COMMAND [--install-dir=prefix] [--help] [--version] submitter-id"
+
+VERSION=3.101
+
+BINDIR=/usr/bin
+
+SUBMITTER=
+TEMP=/tmp/sp$$
+
+if [ $# -eq 0 ]; then
+  echo "$USAGE"
+  exit 1
+fi
+
+while [ $# -gt 0 ]; do
+  case "$1" in
+    -install-dir=*|--install-dir=*|--install-di=*|--install-d=*|--install-=*|--install=*|--instal=*|--insta=*|--inst=*|--ins=*|--in=*|--i=*)
+    I=`echo "$1" | sed 's/-*i[a-z\-]*=//'`
+    BINDIR=$I/bin ;;
+    --version) echo $COMMAND version $VERSION ; exit 1 ;;
+    -*) echo "$USAGE" ; exit 1 ;;
+    *) SUBMITTER=$1 ;;
+  esac
+  shift
+done
+
+path=`echo $0 | sed -e "s;${COMMAND};;"`
+
+[ -z "$path" ] && path=.
+
+examinebindir=yes
+
+if [ "$examinebindir" = yes ] && [ -f $BINDIR/send-pr ]; then
+  SPPATHLIST=$BINDIR/send-pr
+else
+      if [ -f $path/send-pr ]; then
+        SPPATHLIST=$path/send-pr
+      else
+        echo "$COMMAND: cannot find \`$BINDIR/send-pr' or \`$path/send-pr'" >&2
+        exit 1
+      fi
+fi
+
+trap 'rm -f $TEMP ; exit 0' 0
+trap 'echo "$COM: Aborting ..."; rm -f $TEMP ; exit 1' 1 2 3 13 15
+
+for SPPATH in $SPPATHLIST; do
+   sed -e "s/^SUBMITTER=.*/SUBMITTER=${SUBMITTER}/" $SPPATH > $TEMP
+
+   if grep $SUBMITTER $TEMP > /dev/null; then
+      cp $SPPATH $SPPATH.orig &&
+      rm -f $SPPATH &&
+      cp $TEMP $SPPATH &&
+      chmod a+rx $SPPATH &&
+      rm -f $TEMP $SPPATH.orig ||
+      { echo "$COMMAND: unable to replace send-pr" >&2 ; exit 1; }  
+   else
+      echo "$COMMAND: something went wrong when sed-ing the submitter into send-pr" >&2
+      exit 1
+   fi
+done
+
+echo "$COMMAND: \`$SUBMITTER' is now the default submitter ID for send-pr"
+
+exit 0
diff --git a/lib-src/pstogif b/lib-src/pstogif
new file mode 100755 (executable)
index 0000000..9ff1cbf
--- /dev/null
@@ -0,0 +1,189 @@
+: # -*-Perl-*-
+eval 'exec perl -w -S $0 ${1+"$@"}' # Portability kludge
+    if 0;
+# 
+# pstogif.pl v1.0, July 1994, by Nikos Drakos <nikos@cbl.leeds.ac.uk>
+# Computer Based Learning Unit, University of Leeds.
+#
+# Accompanies LaTeX2HTML Version 96.1
+#
+# Script to convert an arbitrary PostScript image to a cropped GIF image
+# suitable for incorporation into HTML documents as inlined images to be
+# viewed with WWW browsers.
+#
+# This is based on the pstoepsi script 
+# by Doug Crabill dgc@cs.purdue.edu
+#
+# Please note the following:
+# - The source PostScript file must end
+#   in a .ps extention.  This is a GhostScript requirement, not mine...
+# - The -density argument has no effect unless the 
+#   color depth (set with the -depth argument) is equal to 1.
+# - Valid arguments for -depth are 1,8, or 24.
+#  
+# This software is provided as is without any guarantee.
+#
+# Nikos Drakos (ND), nikos@cbl.leeds.ac.uk
+# Computer Based Learning Unit, University of Leeds.
+#
+# 15 Jan 96 HS Call ppmquant only if needed.  Fixed bug relative to
+#    V 95.3 .
+#
+# 15 Dec 95 HS (Herbert Swan <dprhws.edp.Arco.com> Added support for
+#    the flip=option.  This allows images to be oriented differently
+#    in the paper versus the electronic media
+#
+# 1 Nov 95 jmn - modified for use with gs ppm driver - from jhrg's patches
+#    note that ppmtops.ps and ppmtops3.ps are no longer needed
+#
+# 20 JUL 94 ND Converted to Perl and made several changes eg it now accepts 
+#    parameters from environment variables or from command line or will use 
+#    default ones. 
+#      
+# 1  APR 94 ND Changed the suffixes of multi-page files from xbm to gif (oops!)
+#
+# 
+
+#####################################################################
+$| =1;
+&read_args;
+
+### You may need to specify some pathnames here if you want to
+### run the script without LaTeX2HTML
+
+# Ghostscript
+$GS= $ENV{'GS'} || 'gs';
+
+# Comes with LaTeX2HTML (For ghostscript versions greater than 3.0 
+# you need the newer pstoppm.ps)
+#$PSTOPPM= $ENV{'PSTOPPM'} ||
+#    'pstoppm.ps';
+
+# Available in the PBMPLUS libary         
+$PNMCROP=$ENV{'PNMCROP'} || 'pnmcrop' ;
+
+# Also in PBMPLUS
+$PNMFLIP=$ENV{'PNMFLIP'} || 'pnmflip' ;
+
+# Also in PBMPPLUS       
+$PPMTOGIF=$ENV{'PPMTOGIF'} || 'ppmtogif' ;
+
+# Also in PBMPPLUS       
+$REDUCE_COLOR=$ENV{'PPMQUANT'} || 'ppmquant 256' ;
+$OUTFILE = $ENV{'OUTFILE'} || $out;
+                       
+# Valid choices for $COLOR_DEPTH are 1, 8 or 24. 
+$DEPTH = $ENV{'DEPTH'} || $depth || 24;
+
+#Default density is 72
+$DENSITY = $ENV{'DENSITY'} || $density || 72;
+    
+# Valid choices are any numbers greater than zero
+# Useful choices are numbers between 0.1 - 5
+# Large numbers may generate very large intermediate files
+# and will take longer to process
+$SCALE = $ENV{'SCALE'} || $scale; # No default value
+
+$PAPERSIZE = $ENV{'PAPERSIZE'} || $papersize; # No default value;
+
+$DEBUG = $ENV{'DEBUG'} || $DEBUG || 0;
+
+######################################################################
+
+&main;
+
+sub read_args {
+    local($_);
+    local($color);
+    while ($ARGV[0] =~ /^-/) {
+       $_ = shift @ARGV;
+       if (/^-h(elp)?$/) {
+           &usage; exit}
+        elsif (/^-out$/) {
+            $out = shift @ARGV;
+       }
+       elsif (/^-(.*)$/) {
+           eval "\$$1 = shift \@ARGV"; # Create and set a flag $<name>
+           }
+    }
+}               
+
+sub main {
+    local($base, $outfile, $i, $j);
+    $base = &test_args;
+    $outfile = $OUTFILE || "$base.gif";
+    open(STDERR, ">/dev/null") unless $DEBUG;
+    &convert($base);
+    if (-f "$base.ppm") {
+       &crop_scale_etc("$base.ppm", $outfile);
+    }
+    else {
+       foreach $i (<$base.[1-9]*ppm>) {
+       $j = $i; 
+       $j =~ s/\.(.*)ppm/$1.gif/;
+       &crop_scale_etc($i, $j)}
+    }                          
+    &cleanup($base);
+}
+
+sub crop_scale_etc {
+    local($in, $out) = @_;
+    local($tmp) = $in . ".tmp";
+    open(STDERR, ">/dev/null") unless $DEBUG;
+
+    if ($flip) {
+       rename($tmp, $in) unless system("$PNMFLIP -$flip $in > $tmp");
+       }
+    system("$PNMCROP $in > $tmp");
+
+    if (system("$PPMTOGIF $tmp > $out")) {
+       print "Running ppmquant for $out\n";
+       system("$REDUCE_COLOR < $tmp|$PPMTOGIF - > $out");
+       }
+    unlink $tmp;
+    print "Writing $out\n";
+}
+
+sub test_args {
+    local($file) = $ARGV[0];
+    if (! ($file =~ s/\.ps$//)) {
+       print "The name of the input file must end in '.ps'\n";
+       exit}
+    elsif (! ( -f "$file.ps")) {
+       print "Cannot find file $file.ps\n.";
+       exit}
+    elsif (! ($DEPTH =~ /^(1|8|24)$/)) {
+       print "The color depth must be 1 or 8 or 24. You specified $DEPTH\n";
+       exit                    
+       }
+    if (defined $SCALE) {
+       if ($SCALE > 0) {
+           $DENSITY = int($SCALE * $DENSITY)}
+       else {
+           print "Error: The scale must be greater than 0.\n" .
+               "You specified $SCALE\n";
+           exit}
+    }
+    $file;
+}
+   
+sub convert {
+    local($base) = @_;
+    local($paperopt) = "-sPAPERSIZE=$PAPERSIZE" if $PAPERSIZE;
+    local($ppmtype) = join('', "ppm",$DEPTH,"run");
+    local($density) = "-r$DENSITY" if ($DENSITY != 72);
+    open (GS, "|$GS -q -dNOPAUSE -dNO_PAUSE -sDEVICE=ppmraw $density -sOutputFile=$base.ppm $paperopt $base.ps");
+    close GS;
+}
+
+sub cleanup {
+    local($base) = @_;
+    unlink <$base[0-9.]*ppm>;
+}
+
+sub usage {
+    print "Usage: pstogif [-h(elp)] [-out <output file>] [-depth <color depth 1, 8 or 24>]  [-flip <Flip_code>] [-density <pixel density>] <file>.ps\n\n";
+}
+
+
diff --git a/lib-src/run.c b/lib-src/run.c
new file mode 100644 (file)
index 0000000..f3830ed
--- /dev/null
@@ -0,0 +1,712 @@
+/* run -- Wrapper program for console mode programs under Windows(TM)
+ * Copyright (C) 1998  Charles S. Wilson
+ *
+ * This program 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
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+/*
+ * This program is based on the runemacs.c distributed with XEmacs 21.0
+ *
+ * Simple program to start gnu-win32 X11 programs (and native XEmacs) 
+ * with its console window hidden.
+ *
+ * This program is provided purely for convenience, since most users will
+ * use XEmacs in windowing (GUI) mode, and will not want to have an extra
+ * console window lying around. Ditto for desktop shortcuts to gnu-win32 
+ * X11 executables.
+ */
+
+
+#define WIN32
+
+#include <windows.h>
+#include <string.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "run.h"
+
+#if defined(__CYGWIN__)
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/cygwin.h>
+ #include <sys/unistd.h>
+WinMainCRTStartup() { mainCRTStartup(); }
+#else
+ #include <direct.h>
+#endif
+
+
+char buffer[1024];
+
+int WINAPI
+WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow)
+{
+   int wait_for_child = FALSE;
+   int compact_invocation = FALSE;
+   DWORD ret_code = 0;
+
+
+   char execname[FILENAME_MAX];
+   char execpath[MAX_PATH];
+   char* argv[MAX_ARGS+1]; /* leave extra slot for compact_invocation argv[0] */
+   int argc;
+   int i,j;
+   char exec[MAX_PATH + FILENAME_MAX + 100];
+   char cmdline2[MAX_ARGS * MAX_PATH];
+
+   compact_invocation = get_exec_name_and_path(execname,execpath);
+
+   if (compact_invocation)
+   {
+      argv[0] = execname;
+      argc = parse_cmdline_to_arg_array(&(argv[1]),cmdline);
+      argc++;
+   }
+   else
+   {
+      argc = parse_cmdline_to_arg_array(argv,cmdline);
+      if (argc >= 1)
+         strcpy(execname,argv[0]);
+   }
+   /* at this point, execpath is defined, as are argv[] and execname */   
+#ifdef DEBUG
+   j = sprintf(buffer,"\nexecname : %s\nexecpath : %s\n",execname,execpath);
+   for (i = 0; i < argc; i++)
+      j += sprintf(buffer+j,"argv[%d]\t: %s\n",i,argv[i]);
+   Trace((buffer));
+#endif
+
+   if (execname == NULL)
+      error("you must supply a program name to run");
+
+#if defined(__CYGWIN__)
+   /* this insures that we search for symlinks before .exe's */
+   if (compact_invocation)
+      strip_exe(execname);
+#endif
+
+   process_execname(exec,execname,execpath);
+   Trace(("exec\t%s\nexecname\t%s\nexecpath\t%s\n",
+         exec,execname,execpath));
+
+   wait_for_child = build_cmdline(cmdline2,exec,argc,argv);
+   Trace((cmdline2));
+
+   xemacs_special(exec);
+   ret_code = start_child(cmdline2,wait_for_child);
+   if (compact_invocation)
+      for (i = 1; i < argc; i++) // argv[0] was not malloc'ed
+         free(argv[i]);
+   else
+      for (i = 0; i < argc; i++)
+         free(argv[i]);
+   return (int) ret_code;
+}
+int start_child(char* cmdline, int wait_for_child)
+{
+   STARTUPINFO start;
+   SECURITY_ATTRIBUTES sec_attrs;
+   SECURITY_DESCRIPTOR sec_desc;
+   PROCESS_INFORMATION child;
+   int retval;
+
+   memset (&start, 0, sizeof (start));
+   start.cb = sizeof (start);
+   start.dwFlags = STARTF_USESHOWWINDOW;
+   start.wShowWindow = SW_HIDE;
+      
+   sec_attrs.nLength = sizeof (sec_attrs);
+   sec_attrs.lpSecurityDescriptor = NULL;
+   sec_attrs.bInheritHandle = FALSE;
+
+   if (CreateProcess (NULL, cmdline, &sec_attrs, NULL, TRUE, 0,
+                      NULL, NULL, &start, &child))
+   {
+      if (wait_for_child)
+      {
+         WaitForSingleObject (child.hProcess, INFINITE);
+         GetExitCodeProcess (child.hProcess, &retval);
+      }
+      CloseHandle (child.hThread);
+      CloseHandle (child.hProcess);
+   }
+   else
+      error("could not start %s",cmdline);
+   return retval;
+}
+void xemacs_special(char* exec)
+{
+  /*
+   * if we're trying to run xemacs, AND this file was in %emacs_dir%\bin,
+   * then set emacs_dir environment variable 
+   */
+   char* p;
+   char* p2;
+   char exec2[MAX_PATH + FILENAME_MAX + 100];
+   char tmp[MAX_PATH + FILENAME_MAX + 100];
+   strcpy(exec2,exec);
+   /* this depends on short-circuit evaluation */
+   if ( ((p = strrchr(exec2,'\\')) && stricmp(p,"\\xemacs") == 0) ||
+        ((p = strrchr(exec2,'/')) && stricmp(p,"/xemacs") == 0) ||
+        ((p = strrchr(exec2,'\\')) && stricmp(p,"\\xemacs.exe") == 0) ||
+        ((p = strrchr(exec2,'/')) && stricmp(p,"/xemacs.exe") == 0) )
+   {
+      if ( ((p2 = strrchr(p, '\\')) && stricmp(p2, "\\bin") == 0) ||
+           ((p2 = strrchr(p, '/')) && stricmp(p2, "/bin") == 0) )
+      {
+         *p2 = '\0';   
+#if defined(__CYGWIN__)
+         CYGWIN_CONV_TO_POSIX_PATH((exec2,tmp));
+         strcpy(exec2,tmp);
+#else /* NATIVE xemacs DOS-style paths with forward slashes */
+         for (p = exec2; *p; p++)
+            if (*p == '\\') *p = '/';
+#endif
+         SetEnvironmentVariable ("emacs_dir", exec2);
+      }
+   }
+}
+int build_cmdline(char* new_cmdline, char* exec, int argc, char* argv[])
+{
+   int retval = FALSE;
+   int first_arg = 1;
+   int i;
+   int char_cnt = 0;
+   /*
+    * look for "-wait" as first true argument; we'll apply that ourselves
+    */
+   if ((argc >= 2) && (stricmp(argv[1],"-wait") == 0))
+   {
+      retval = TRUE;
+      first_arg++;
+   }
+
+   char_cnt = strlen(exec);
+   for (i = first_arg; i < argc; i++)
+      char_cnt += strlen(argv[i]);
+   if (char_cnt > MAX_ARGS*MAX_PATH) /* then we ran out of room */
+      error("command line too long -\n%s",new_cmdline);
+   
+   strcpy(new_cmdline,exec);
+   for (i = first_arg; i < argc; i++)
+   {
+      strcat(new_cmdline," ");
+      strcat(new_cmdline,argv[i]);
+   }
+   return retval;
+}
+/* process exec_arg : if it
+ * NATIVE:
+ *  1) starts with '\\' or '/', it's a root-path and leave it alone
+ *  2) starts with 'x:\\' or 'x:/', it's a root-path and leave it alone
+ *  3) starts with '.\\' or './', two possible meanings:
+ *       1) exec is in the current directory
+ *       2) exec in same directory as this program
+ *  4) otherwise, search path (and _prepend_ "." to the path!!!)
+ *  5) convert all '/' to '\\'
+ * CYGWIN
+ *  1) starts with '\\' or '/', it's a root-path and leave it alone
+ *  2) starts with 'x:\\' or 'x:/', it's a root-path and leave it alone
+ *  3) starts with '.\\' or './', two possible meanings:
+ *       1) exec is in the current directory
+ *       2) exec in same directory as this program
+ *  4) otherwise, search path (and _prepend_ "." to the path!!!)
+ *  5) convert to cygwin-style path to resolve symlinks within the pathspec
+ *  6) check filename: if it's a symlink, resolve it by peeking inside
+ *  7) convert to win32-style path+filename since we're using Windows 
+ *       createProcess() to launch
+ */
+void process_execname(char *exec, const char* execname,const char* execpath )
+{
+   char* orig_pathlist;
+   char* pathlist;
+   char exec_tmp[MAX_PATH + FILENAME_MAX + 100];
+   char exec_tmp2[MAX_PATH + FILENAME_MAX + 100];
+   char buf[MAX_PATH + FILENAME_MAX + 100];
+   int i,j;
+
+   int len = 0;
+   /* 
+    * STARTS WITH / or \ 
+    * execpath NOT used
+    */
+   if ((execname[0] == '\\') || (execname[0] == '/'))
+   {
+#if defined(__CYGWIN__)
+      strcpy(exec_tmp,execname);
+#else    
+      exec_tmp[0] = ((char) (_getdrive() + ((int) 'A') - 1));
+      exec_tmp[1] = ':';
+      exec_tmp[2] = '\0';
+      strcat(exec_tmp,execname);
+#endif
+      Trace(("/ -\nexec_tmp\t%s\nexecname\t%s\nexecpath\t%s\n",
+             exec_tmp,execname,execpath));
+      if (! fileExistsMulti(exec_tmp2,NULL,exec_tmp,exts,NUM_EXTENSIONS) )
+      {
+          j = 0;
+          for (i = 0; i < NUM_EXTENSIONS; i++)
+              j += sprintf(buf + j," [%d]: %s\n",i+1,exts[i]);
+          error("Couldn't locate %s\nI tried appending the following "
+                "extensions: \n%s",exec_tmp,buf);
+      }
+      Trace((exec_tmp2));
+   }
+   /* 
+    * STARTS WITH x:\ or x:/
+    * execpath NOT used
+    */
+    else if ((strlen(execname) > 3) && // avoid boundary errors
+       (execname[1] == ':') &&
+       ((execname[2] == '\\') || (execname[2] == '/')))
+   {
+      strcpy(exec_tmp,execname);       
+      Trace(("x: -\nexec_tmp\t%s\nexecname\t%s\nexecpath\t%s\n",
+             exec_tmp,execname,execpath));
+      if (! fileExistsMulti(exec_tmp2,NULL,exec_tmp,exts,NUM_EXTENSIONS) )
+      {
+          j = 0;
+          for (i = 0; i < NUM_EXTENSIONS; i++)
+              j += sprintf(buf + j," [%d]: %s\n",i+1,exts[i]);
+          error("Couldn't locate %s\nI tried appending the following "
+                "extensions: \n%s",exec_tmp,buf);
+      }
+      Trace((exec_tmp2));
+   }
+   /* 
+    * STARTS WITH ./ or .\
+    */
+   else if ((execname[0] == '.') &&
+            ((execname[1] == '\\') || (execname[1] == '/')))
+   {
+      if (((char*) getcwd(exec_tmp,MAX_PATH))==NULL)
+         error("can't find current working directory");
+      if (! fileExistsMulti(exec_tmp2,exec_tmp,&(execname[2]),
+                            exts,NUM_EXTENSIONS) )
+          if (! fileExistsMulti(exec_tmp2,execpath,&(execname[2]),
+                                exts,NUM_EXTENSIONS) )
+          {
+              j = 0;
+              for (i = 0; i < NUM_EXTENSIONS; i++)
+                  j += sprintf(buf + j," [%d]: %s\n",i+1,exts[i]);
+              error("Couldn't locate %s\n"
+                    "I looked in the following directories:\n [1]: %s\n [2]: %s\n"
+                    "I also tried appending the following "
+                    "extensions: \n%s",execname,exec_tmp,execpath,buf);
+          }
+      Trace((exec_tmp2));
+   }
+   /*
+    * OTHERWISE, SEARCH PATH (prepend '.' and run.exe's directory)
+    * can't use fileExistsMulti because we want to search entire path
+    * for exts[0], then for exts[1], etc.
+    */
+   else
+   {
+      orig_pathlist = getenv("PATH");
+      if ((pathlist = malloc (strlen(orig_pathlist)
+                              + strlen(".") 
+                              + strlen(execpath)+ 3)) == NULL)
+         error("internal error - out of memory");
+      strcpy(pathlist,".");
+      strcat(pathlist,SEP_CHARS);
+      strcat(pathlist,execpath);
+      strcat(pathlist,SEP_CHARS);
+      strcat(pathlist,orig_pathlist);
+
+      Trace((pathlist));
+      for (i = 0; i < NUM_EXTENSIONS; i++)
+      {
+          strcpy(exec_tmp,execname);
+          strcat(exec_tmp,exts[i]);
+          pfopen(exec_tmp2,exec_tmp,pathlist);
+          if (fileExists(NULL,NULL,exec_tmp2))
+              break;
+          exec_tmp2[0] = '\0';
+      }
+      Trace(("exec_tmp\t%s\npathlist\t%s\n",exec_tmp2,pathlist));
+
+      free(pathlist);
+      if (exec_tmp2[0] == '\0')
+      {
+          j = 0;
+          for (i = 0; i < NUM_EXTENSIONS; i++)
+              j += sprintf(buf + j," [%d]: %s\n",i+1,exts[i]);
+          error("Couldn't find %s anywhere.\n"
+                "I even looked in the PATH \n"
+                "I also tried appending the following "
+                "extensions: \n%s",execname,buf);
+      }
+   }
+/*
+ * At this point, we know that exec_tmp2 contains a filename
+ * and we know that exec_tmp2 exists.
+ */
+#if defined(__CYGWIN__)
+   {
+      struct stat stbuf;
+      char sym_link_name[MAX_PATH+1];
+      char real_name[MAX_PATH+1];
+      char dummy[MAX_PATH+1];
+
+      strcpy(exec_tmp,exec_tmp2);
+
+      CYGWIN_CONV_TO_POSIX_PATH((exec_tmp,sym_link_name));
+      Trace((sym_link_name));
+      
+      if (lstat(sym_link_name, &stbuf) == 0)
+      {
+         if ((stbuf.st_mode & S_IFLNK) == S_IFLNK)
+         {
+           if (readlink(sym_link_name, real_name, sizeof(real_name)) == -1)
+               error("problem reading symbolic link for %s",exec_tmp);
+            else
+            {
+                // if realname starts with '/' it's a rootpath 
+                if (real_name[0] == '/')
+                    strcpy(exec_tmp2,real_name);
+                else // otherwise, it's relative to the symlink's location
+                {
+                   CYGWIN_SPLIT_PATH((sym_link_name,exec_tmp2,dummy));
+                   if (!endsWith(exec_tmp2,PATH_SEP_CHAR_STR))
+                      strcat(exec_tmp2,PATH_SEP_CHAR_STR);
+                   strcat(exec_tmp2,real_name);
+                }
+            }
+         }
+         else /* NOT a symlink */
+            strcpy(exec_tmp2, sym_link_name);
+      }
+      else
+         error("can't locate executable - %s",sym_link_name);
+   }
+   CYGWIN_CONV_TO_FULL_WIN32_PATH((exec_tmp2,exec));
+#else                                  
+   strcpy (exec, exec_tmp2);
+#endif  
+}
+int endsWith(const char* s1, const char* s2)
+{
+    int len1;
+    int len2;
+    int retval = FALSE;
+    len1 = strlen(s1);
+    len2 = strlen(s2);
+    if (len1 - len2 >= 0)
+        if (stricmp(&(s1[len1-len2]),s2) == 0)
+            retval = TRUE;
+    return retval;
+}void strip_exe(char* s)
+{
+   if ((strlen(s) > 4) && // long enough to have .exe extension
+       // second part not evaluated (short circuit) if exec_arg too short
+       (stricmp(&(s[strlen(s)-4]),".exe") == 0))
+      s[strlen(s)-4] = '\0';
+}
+void error(char* fmt, ...)
+{
+   char buf[4096];
+   int j;
+   va_list args;
+   va_start(args, fmt);
+   j =   sprintf(buf,    "Error: ");
+   j += vsprintf(buf + j,fmt,args);
+   j +=  sprintf(buf + j,"\n");
+   va_end(args);
+   MessageBox(NULL, buf, "Run.exe", MB_ICONSTOP);
+   exit(1);
+}
+void message(char* fmt, ...)
+{
+   char buf[10000];
+   int j;
+   va_list args;
+   va_start(args, fmt);
+   j = vsprintf(buf,fmt,args);
+   j +=  sprintf(buf + j,"\n");
+   va_end(args);
+   MessageBox(NULL, buf, "Run.exe Message", MB_ICONSTOP);
+}
+void Trace_(char* fmt, ...)
+{
+   char buf[10000];
+   int j;
+   va_list args;
+   va_start(args, fmt);
+   j = vsprintf(buf,fmt,args);
+   j +=  sprintf(buf + j,"\n");
+   va_end(args);
+   MessageBox(NULL, buf, "Run.exe DEBUG", MB_ICONSTOP);
+}
+/*
+ * Uses system info to determine the path used to invoke run
+ * Also attempts to deduce the target execname if "compact_invocation"
+ * method was used.
+ *
+ * returns TRUE if compact_invocation method was used
+ *   (and target execname was deduced successfully)
+ * otherwise returns FALSE, and execname == run or run.exe
+ */
+int get_exec_name_and_path(char* execname, char* execpath)
+{
+   char modname[MAX_PATH];
+   char* tmp_execname;
+   char* p;
+   int retval = FALSE;
+
+   if (!GetModuleFileName (NULL, modname, MAX_PATH))
+      error("internal error - can't find my own name");
+   if ((p = strrchr (modname, '\\')) == NULL)
+      error("internal error - my own name has no path\n%s",modname);
+   tmp_execname = p + 1;
+   p[0] = '\0';
+   // if invoked by a name like "runxemacs" then strip off
+   // the "run" and let "xemacs" be execname.
+   // To check for this, make that:
+   //   1) first three chars are "run"
+   //   2) but the string doesn't end there, or start ".exe"
+   // Also, set "compact_invocation" TRUE
+   if ( ((tmp_execname[0] == 'r') || (tmp_execname[0] == 'R')) &&
+        ((tmp_execname[1] == 'u') || (tmp_execname[1] == 'U')) &&
+        ((tmp_execname[2] == 'n') || (tmp_execname[2] == 'N')) &&
+        ((tmp_execname[3] != '.') && (tmp_execname[3] != '\0')) )
+   {
+      tmp_execname += 3;
+      retval = TRUE;
+   }
+   else
+      tmp_execname = NULL;
+
+   if (tmp_execname == NULL)
+      strcpy(execname,"");
+   else
+      strcpy(execname,tmp_execname);
+#if defined(__CYGWIN__)
+   CYGWIN_CONV_TO_POSIX_PATH((modname,execpath));
+#else
+   strcpy(execpath,modname);
+#endif
+   return retval;
+}
+/*
+ * works like strtok, but:
+ * double quotes (") suspends tokenizing until closing " reached
+ * CYGWIN ONLY:
+ *   additionally, backslash escapes next character, even if that
+ *   next character is a delimiter. Or a double quote.
+ *   WARNING: this means that backslash may NOT be a delimiter 
+ */
+char* my_strtok(char* s, const char* delim, char** lasts)
+{
+   char *spanp;
+   int c, sc;
+   char *tok;
+   
+   if ((s == NULL) && ((s = *lasts) == NULL))
+      return NULL;
+   /* Skip leading delimiters */
+cont:
+   c = *s++;
+   for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
+      if (c == sc)
+         goto cont;
+   }
+   if (c == 0) {               /* no non-delimiter characters */
+      *lasts = NULL;
+      return (NULL);
+   }
+   tok = s - 1;
+   /*
+    * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
+    * Note that delim must have one NUL; we stop if we see that, too.
+    * If we see a double quote, continue until next double quote, then
+    *   start scanning for delimiters again.
+    * CYGWIN ONLY: if we see a backslash, just copy next character -
+    *   don't consider it as a delimiter even if it is in delim string.
+    */
+   for (;;) {
+      /* if this c is ", then scan until we find next " */
+      if (c == '\"')
+         while ((c = *s++) != '\"')
+            if (c == 0) /* oops, forgot to close the ", clean up & return */
+            {
+               s = NULL;
+               *lasts = s;
+               return (tok);
+            }
+#if defined(__CYGWIN__)
+      if (c == '\\')
+      {
+         c = *s++; /* skip the backslash */
+         if (c == 0) /* if escaped character is end-of-string, clean up & return */
+         {
+            s = NULL;
+            *lasts = s;
+            return (tok);
+         }
+         c = *s++; /* otherwise, skip the escaped character */
+      }
+#endif   
+      spanp = (char *)delim;
+      do {
+         if ((sc = *spanp++) == c) {
+            if (c == 0)
+               s = NULL;
+            else
+               s[-1] = 0;
+            *lasts = s;
+            return (tok);
+         }
+      } while (sc != 0);
+      c = *s++;
+   }
+   /* NOTREACHED */
+}
+int parse_cmdline_to_arg_array(char* argv[MAX_ARGS], char* cmdline)
+{
+   char seps[] = " \t\n";
+   char* token;
+   int argc = 0;
+   char* lasts;
+
+   token = my_strtok(cmdline, seps, &lasts);
+   while ((token != NULL) && (argc < MAX_ARGS))
+   {
+      if ((argv[argc] = malloc(strlen(token)+1)) == NULL)
+      {
+         error("internal error - out of memory");
+      }
+      strcpy(argv[argc++],token);
+      token = my_strtok(NULL,seps,&lasts);
+   }
+   if (argc >= MAX_ARGS)
+      error("too many arguments on commandline\n%s",cmdline);
+   return argc;
+}
+/* Taken from pfopen.c by David Engel (5-Jul-97).
+ * Original comments appear below. Superseded by next comment block.
+ *
+ *  Written and released to the public domain by David Engel.
+ *
+ *  This function attempts to open a file which may be in any of
+ *  several directories.  It is particularly useful for opening
+ *  configuration files.  For example, PROG.EXE can easily open
+ *  PROG.CFG (which is kept in the same directory) by executing:
+ *
+ *      cfg_file = pfopen("PROG.CFG", "r", getenv("PATH"));
+ *
+ *  NULL is returned if the file can't be opened.
+ */
+
+/*
+ * This function attempts to locate a file which may be in any of
+ * several directories. Unlike the original pfopen, it does not
+ * return a FILE pointer to the opened file, but rather returns
+ * the fully-qualified filename of the first match found. Returns
+ * empty string if not found.
+ */
+char *pfopen(char *retval, const char *name, const char *dirs)
+{
+    char *ptr;
+    char *tdirs;
+    char returnval[MAX_PATH + FILENAME_MAX + 100];
+    char *recursive_name;
+    int foundit = FALSE;
+    
+    returnval[0] = '\0';
+
+    if (dirs == NULL || dirs[0] == '\0')
+        return NULL;
+
+    if ((tdirs = malloc(strlen(dirs)+1)) == NULL)
+        return NULL;
+
+    strcpy(tdirs, dirs);
+
+    for (ptr = strtok(tdirs, SEP_CHARS); (foundit == FALSE) && ptr != NULL;
+         ptr = strtok(NULL, SEP_CHARS))
+    {
+       foundit = fileExists(returnval,ptr,name);
+    }
+
+    free(tdirs);
+    if (!foundit)
+        retval[0] = '\0';
+    else
+        strcpy(retval,returnval);
+    return retval;
+}
+int fileExistsMulti(char* fullname, const char* path, 
+                    const char* name_noext, const char* exts[],
+                    const int extcnt)
+{
+    char tryName[MAX_PATH + FILENAME_MAX];
+    int i = 0;
+    int retval = FALSE;
+    fullname[0] = '\0';
+    for (i = 0; i < extcnt; i++)
+    {
+        strcpy(tryName,name_noext);
+        strcat(tryName,exts[i]);
+        if (fileExists(fullname, path, tryName) == TRUE)
+        {
+            retval = TRUE;
+            break;
+        }
+        fullname[0] = '\0';
+    }
+    return retval;
+}
+int fileExists(char* fullname, const char* path, const char* name)
+{
+   int retval = FALSE;
+   FILE* file;
+   size_t len;
+   char work[FILENAME_MAX];
+   char work2[MAX_PATH + FILENAME_MAX + 100];
+   if (path != NULL)
+   {
+      strcpy(work, path);
+      len = strlen(work);
+      if (len && work[len-1] != '/' && work[len-1] != '\\')
+         strcat(work, PATH_SEP_CHAR_STR);
+   }
+   else
+      work[0]='\0';
+   
+   strcat(work, name);
+#if defined(__CYGWIN__)
+   CYGWIN_CONV_TO_POSIX_PATH((work, work2)); 
+#else
+   strcpy(work2,work);
+#endif
+
+#ifdef DEBUGALL
+   Trace(("looking for...\t%s\n",work2));
+#endif
+
+   file = fopen(work2, "rb");
+   if (file != NULL)
+   {
+      if (fullname != NULL)
+         strcpy(fullname,work2);
+      retval = TRUE;
+      fclose(file);
+   }
+   return retval;
+}
diff --git a/lib-src/send-pr b/lib-src/send-pr
new file mode 100755 (executable)
index 0000000..3c97e40
--- /dev/null
@@ -0,0 +1,530 @@
+#!/bin/sh
+# Submit a problem report to a GNATS site.
+# Copyright (C) 1993 Free Software Foundation, Inc.
+# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
+# version written by Heinz G. Seidl (hgs@cygnus.com).
+#
+# This file is part of GNU GNATS.
+#
+# GNU GNATS 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.
+#
+# GNU GNATS 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 GNU GNATS; see the file COPYING.  If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# The version of this send-pr.
+VERSION=3.101
+
+# The submitter-id for your site.
+SUBMITTER=net
+
+# Where the GNATS directory lives, if at all.
+[ -z "$GNATS_ROOT" ] && 
+GNATS_ROOT=/usr/lib/gnats/gnats-db
+
+# The default mail address for PR submissions. 
+GNATS_ADDR=bugs@xemacs.org
+
+# Where the gnats category tree lives.
+[ -z "$DATADIR" ] &&
+DATADIR=/usr/share
+
+# If we've been moved around, try using GCC_EXEC_PREFIX.
+[ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] && 
+  DATADIR=${GCC_EXEC_PREFIX}../../../lib
+
+
+# The default release for this host.
+DEFAULT_RELEASE="gnats-3.101"
+
+# The default organization.
+DEFAULT_ORGANIZATION="XEmacs Users"
+
+# The default site to look for.
+GNATS_SITE=xemacs.org
+
+# Newer config information?
+[ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
+
+# What mailer to use.  This must come after the config file, since it is
+# host-dependent.
+MAIL_AGENT="/usr/lib/sendmail -oi -t"
+
+# How to read the passwd database.
+PASSWD="cat /etc/passwd"
+
+ECHON=bsd
+
+if [ $ECHON = bsd ] ; then
+  ECHON1="echo -n"
+  ECHON2=
+elif [ $ECHON = sysv ] ; then
+  ECHON1=echo
+  ECHON2='\c'
+else
+  ECHON1=echo
+  ECHON2=
+fi
+
+#\f
+
+if [ -z "$TMPDIR" ]; then
+  TMPDIR=/tmp
+else
+  if [ "`echo $TMPDIR | grep '/$'`" != "" ]; then
+    TMPDIR="`echo $TMPDIR | sed -e 's,/$,,'`"
+  fi
+fi
+
+TEMP=$TMPDIR/p$$
+BAD=$TMPDIR/pbad$$
+REF=$TMPDIR/pf$$
+
+# find a user name
+if [ "$LOGNAME" = "" ]; then
+       if [ "$USER" != "" ]; then
+               LOGNAME="$USER"
+       else
+               LOGNAME="UNKNOWN"
+       fi
+fi
+
+FROM="$LOGNAME"
+if [ -z "$REPLYTO" ]; then
+  REPLYTO="$LOGNAME"
+fi
+
+# Find out the name of the originator of this PR.
+if [ -n "$NAME" ]; then
+  ORIGINATOR="$NAME"
+elif [ -f $HOME/.fullname ]; then
+  ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
+else
+  # Must use temp file due to incompatibilities in quoting behavior
+  # and to protect shell metacharacters in the expansion of $LOGNAME
+  $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP
+  ORIGINATOR="`cat $TEMP`"
+  rm -f $TEMP
+fi
+
+if [ -n "$ORGANIZATION" ]; then
+  if [ -f "$ORGANIZATION" ]; then
+    ORGANIZATION="`cat $ORGANIZATION`"
+  fi
+else
+  if [ -n "$DEFAULT_ORGANIZATION" ]; then
+    ORGANIZATION="$DEFAULT_ORGANIZATION"
+  elif [ -f $HOME/.organization ]; then
+    ORGANIZATION="`cat $HOME/.organization`"
+  elif [ -f $HOME/.signature ]; then
+    ORGANIZATION="`cat $HOME/.signature`"
+  fi
+fi
+
+# If they don't have a preferred editor set, then use
+if [ -z "$VISUAL" ]; then
+  if [ -z "$EDITOR" ]; then
+    EDIT=vi
+  else
+    EDIT="$EDITOR"
+  fi
+else
+  EDIT="$VISUAL"
+fi
+
+# Find out some information.
+SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
+        ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
+ARCH=`[ -f /bin/arch ] && /bin/arch`
+MACHINE=`[ -f /bin/machine ] && /bin/machine`
+
+COMMAND=`echo $0 | sed -e 's,.*/,,'`
+USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity]
+       [-c address] [--request-id] [--version]"
+REMOVE=
+BATCH=
+CC=
+SEVERITY_C=
+
+while [ $# -gt 0 ]; do
+  case "$1" in
+    -r) ;;             # Ignore for backward compat.
+    -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+       shift ; GNATS_ADDR="$1"
+       EXPLICIT_GNATS_ADDR=true
+        ;;
+    -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+       shift ; IN_FILE="$1"
+       if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
+         echo "$COMMAND: cannot read $IN_FILE"
+         exit 1
+       fi
+       ;;
+    -b | --batch) BATCH=true ;;
+    -c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+       shift ; CC="$1"
+       ;;
+    -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+       shift ; SEVERITY_C="$1"
+       ;;
+    -p | -P | --print) PRINT=true ;;
+    -L | --list) FORMAT=norm ;;
+    -l | -CL | --lisp) FORMAT=lisp ;;
+    --request-id) REQUEST_ID=true ;;
+    -h | --help) echo "$USAGE"; exit 0 ;;
+    -V | --version) echo "$VERSION"; exit 0 ;;
+    -*) echo "$USAGE" ; exit 1 ;;
+    *) if [ -z "$USER_GNATS_SITE" ]; then
+        if [ ! -r "$DATADIR/gnats/$1" ]; then
+          echo "$COMMAND: the GNATS site $1 does not have a categories list."
+          exit 1
+        else
+          # The site name is the alias they'll have to have created.
+          USER_GNATS_SITE=$1
+        fi
+       else
+        echo "$USAGE" ; exit 1
+       fi
+       ;;
+ esac
+ shift
+done
+
+if [ -n "$USER_GNATS_SITE" ] && [ "$USER_GNATS_SITE" != "$GNATS_SITE" ]; then
+  GNATS_SITE=$USER_GNATS_SITE
+  GNATS_ADDR=$USER_GNATS_SITE-gnats
+fi
+
+if [ "$SUBMITTER" = "unknown" -a -z "$REQUEST_ID" -a -z "$IN_FILE" ]; then
+  cat << '__EOF__'
+It seems that send-pr is not installed with your unique submitter-id.
+You need to run
+
+          install-sid YOUR-SID
+
+where YOUR-SID is the identification code you received with `send-pr'.
+`send-pr' will automatically insert this value into the template field
+`>Submitter-Id'.  If you've downloaded `send-pr' from the Net, use `net'
+for this value.  If you do not know your id, run `send-pr --request-id' to 
+get one from your support site.
+__EOF__
+  exit 1
+fi
+
+if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then
+  CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort`
+else
+  echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list."
+  exit 1
+fi
+
+if [ -z "$CATEGORIES" ]; then
+  echo "$COMMAND: the categories list for $GNATS_SITE was empty!"
+  exit 1
+fi
+
+case "$FORMAT" in
+  lisp) echo "$CATEGORIES" | \
+        awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}'
+        exit 0
+        ;;
+  norm) l=`echo "$CATEGORIES" | \
+       awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+            END {print max + 1;}'`
+       c=`expr 70 / $l`
+       if [ $c -eq 0 ]; then c=1; fi
+       echo "$CATEGORIES" | \
+        awk 'BEGIN {print "Known categories:"; i = 0 }
+          { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
+            END { print ""; }'
+        exit 0
+        ;;
+esac
+
+ORIGINATOR_C='<name of the PR author (one line)>'
+ORGANIZATION_C='<organization of PR author (multiple lines)>'
+CONFIDENTIAL_C='<[ yes | no ] (one line)>'
+SYNOPSIS_C='<synopsis of the problem (one line)>'
+if [ -z "$SEVERITY_C" ]; then
+  SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
+fi
+PRIORITY_C='<[ low | medium | high ] (one line)>'
+CATEGORY_C='<name of the product (one line)>'
+CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>'
+RELEASE_C='<release number or tag (one line)>'
+ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
+DESCRIPTION_C='<precise description of the problem (multiple lines)>'
+HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
+FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
+
+# Catch some signals. ($xs kludge needed by Sun /bin/sh)
+xs=0
+trap 'rm -f $REF $TEMP; exit $xs' 0
+trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15
+
+# If they told us to use a specific file, then do so.
+if [ -n "$IN_FILE" ]; then
+  if [ "$IN_FILE" = "-" ]; then
+    # The PR is coming from the standard input.
+    if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
+      sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
+    else
+      cat > $TEMP
+    fi
+  else
+    # Use the file they named.
+    if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
+      sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
+    else
+      cat $IN_FILE > $TEMP
+    fi
+  fi
+else
+
+  if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+    # If their PR_FORM points to a bogus entry, then bail.
+    if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
+      echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
+      sleep 1
+      PRINT_INTERN=bad_prform
+    fi
+  fi
+
+  if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+    cp $PR_FORM $TEMP || 
+      ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
+  else
+    for file in $TEMP $REF ; do
+      cat  > $file << '__EOF__'
+SEND-PR: -*- send-pr -*-
+SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
+SEND-PR: will all comments (text enclosed in `<' and `>').
+SEND-PR: 
+SEND-PR: Please consult the send-pr man page `send-pr(1)' or the Texinfo
+SEND-PR: manual if you are not sure how to fill out a problem report.
+SEND-PR:
+SEND-PR: Choose from the following categories:
+SEND-PR:
+__EOF__
+
+      # Format the categories so they fit onto lines.
+       l=`echo "$CATEGORIES" | \
+       awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+            END {print max + 1;}'`
+       c=`expr 61 / $l`
+       if [ $c -eq 0 ]; then c=1; fi
+       echo "$CATEGORIES" | \
+        awk 'BEGIN {printf "SEND-PR: "; i = 0 }
+          { printf ("%-'$l'.'$l's", $0);
+           if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
+            END { printf "\nSEND-PR:\n"; }' >> $file
+
+      cat >> $file << __EOF__
+To: $GNATS_ADDR
+Subject: 
+From: $FROM
+Reply-To: $REPLYTO
+Cc: $CC
+X-send-pr-version: $VERSION
+
+
+>Submitter-Id: $SUBMITTER
+>Originator:   $ORIGINATOR
+>Organization:
+${ORGANIZATION-        $ORGANIZATION_C}
+>Confidential: $CONFIDENTIAL_C
+>Synopsis:     $SYNOPSIS_C
+>Severity:     $SEVERITY_C
+>Priority:     $PRIORITY_C
+>Category:     $CATEGORY_C
+>Class:                $CLASS_C
+>Release:      ${DEFAULT_RELEASE-$RELEASE_C}
+>Environment:
+       $ENVIRONMENT_C
+`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
+`[ -n "$ARCH" ] && echo Architecture: $ARCH`
+`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
+>Description:
+       $DESCRIPTION_C
+>How-To-Repeat:
+       $HOW_TO_REPEAT_C
+>Fix:
+       $FIX_C
+__EOF__
+    done
+  fi
+
+  if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
+    cat $TEMP
+    xs=0; exit
+  fi
+
+  chmod u+w $TEMP
+  if [ -z "$REQUEST_ID" ]; then
+    eval $EDIT $TEMP
+  else
+    ed -s $TEMP << '__EOF__'
+/^Subject/s/^Subject:.*/Subject: request for a customer id/
+/^>Category/s/^>Category:.*/>Category: send-pr/
+w
+q
+__EOF__
+  fi
+
+  if cmp -s $REF $TEMP ; then
+    echo "$COMMAND: problem report not filled out, therefore not sent"
+    xs=1; exit
+  fi
+fi
+
+#\f
+#      Check the enumeration fields
+
+# This is a "sed-subroutine" with one keyword parameter 
+# (with workaround for Sun sed bug)
+#
+SED_CMD='
+/$PATTERN/{
+s|||
+s|<.*>||
+s|^[   ]*||
+s|[    ]*$||
+p
+q
+}'
+
+
+while [ -z "$REQUEST_ID" ]; do
+  CNT=0
+
+  # 1) Confidential
+  #
+  PATTERN=">Confidential:"
+  CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+  case "$CONFIDENTIAL" in
+    ""|yes|no) CNT=`expr $CNT + 1` ;;
+    *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
+  esac
+  #
+  # 2) Severity
+  #
+  PATTERN=">Severity:"
+  SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+  case "$SEVERITY" in
+    ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
+    *)  echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
+  esac
+  #
+  # 3) Priority
+  #
+  PATTERN=">Priority:"
+  PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+  case "$PRIORITY" in
+    ""|low|medium|high) CNT=`expr $CNT + 1` ;;
+    *)  echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
+  esac
+  #
+  # 4) Category
+  #
+  PATTERN=">Category:"
+  CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+  FOUND=
+  for C in $CATEGORIES
+  do
+    if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
+  done
+  if [ -n "$FOUND" ]; then
+    CNT=`expr $CNT + 1`        
+  else
+    if [ -z "$CATEGORY" ]; then
+      echo "$COMMAND: you must include a Category: field in your report."
+    else
+      echo "$COMMAND: \`$CATEGORY' is not a known category."
+    fi
+  fi
+  #
+  # 5) Class
+  #
+  PATTERN=">Class:"
+  CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
+  case "$CLASS" in
+    ""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;;
+    *)  echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
+  esac
+
+  [ $CNT -lt 5 -a -z "$BATCH" ] && 
+    echo "Errors were found with the problem report."
+
+  while true; do
+    if [ -z "$BATCH" ]; then
+      $ECHON1 "a)bort, e)dit or s)end? $ECHON2"
+      read input
+    else
+      if [ $CNT -eq 5 ]; then
+        input=s
+      else
+        input=a
+      fi
+    fi
+    case "$input" in
+      a*)
+       if [ -z "$BATCH" ]; then
+         echo "$COMMAND: the problem report remains in $BAD and is not sent."
+         mv $TEMP $BAD
+        else
+         echo "$COMMAND: the problem report is not sent."
+       fi
+       xs=1; exit
+       ;;
+      e*)
+        eval $EDIT $TEMP
+       continue 2
+       ;;
+      s*)
+       break 2
+       ;;
+    esac
+  done
+done
+#
+#      Remove comments and send the problem report
+#      (we have to use patterns, where the comment contains regex chars)
+#
+# /^>Originator:/s;$ORIGINATOR;;
+sed  -e "
+/^SEND-PR:/d
+/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
+/^>Confidential:/s;<.*>;;
+/^>Synopsis:/s;$SYNOPSIS_C;;
+/^>Severity:/s;<.*>;;
+/^>Priority:/s;<.*>;;
+/^>Category:/s;$CATEGORY_C;;
+/^>Class:/s;<.*>;;
+/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
+/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
+/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
+/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
+/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
+" $TEMP > $REF
+
+if $MAIL_AGENT < $REF; then
+  echo "$COMMAND: problem report sent"
+  xs=0; exit
+else
+  echo "$COMMAND: mysterious mail failure."
+  if [ -z "$BATCH" ]; then
+    echo "$COMMAND: the problem report remains in $BAD and is not sent."
+    mv $REF $BAD
+  else
+    echo "$COMMAND: the problem report is not sent."
+  fi
+  xs=1; exit
+fi
diff --git a/lib-src/tm-au b/lib-src/tm-au
new file mode 100755 (executable)
index 0000000..4309ebe
--- /dev/null
@@ -0,0 +1,57 @@
+#!/bin/sh -
+#
+# $Id: tm-au,v 1.6 1997/02/15 22:20:26 steve Exp $
+#
+# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc.
+
+# This program 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.
+# 
+# This program 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 GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
+
+if [ "$TM_TMP_DIR" = "" ]; then
+       TM_TMP_DIR=/tmp
+       export TM_TMP_DIR
+fi
+
+if [ "$5" = "" ]; then
+       filename="$TM_TMP_DIR/mime$$.au"
+else
+       filename="$TM_TMP_DIR/$5"
+fi
+
+
+case "$4" in
+"play")
+       echo "$2; $3 ->"
+       tmdecode $3 $1 $filename
+       if [ "$AUDIOSERVER" = "" ]; then
+          case "`uname`" in
+            IRIX )  sfplay $filename           ;;
+            OSF1 )  decsound -play $filename   ;;
+            *    )  cat $filename > /dev/audio ;;
+          esac
+       else
+          autool -v 40 $filename
+       fi
+        
+       trap 'rm -f $filename' 0 1 2 3 13 15
+       ;;
+"extract")
+       echo "$2; $3 -> $filename"
+       echo "extract to $filename"
+       tmdecode $3 $1 $filename
+       ;;
+esac
diff --git a/lib-src/tm-file b/lib-src/tm-file
new file mode 100755 (executable)
index 0000000..359b357
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh -
+#
+# $Id: tm-file,v 1.4 1997/01/30 02:22:30 steve Exp $
+#
+# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc.
+
+# This program 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.
+# 
+# This program 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 GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
+
+if [ "$TM_TMP_DIR" = "" ]; then
+       TM_TMP_DIR=/tmp
+       export TM_TMP_DIR
+fi
+
+if [ "$5" = "" ]; then
+       filename="$TM_TMP_DIR/mime$$"
+else
+       filename="$TM_TMP_DIR/$5"
+fi
+
+
+echo "$2; $3 -> $filename"
+
+tmdecode $3 $1 $filename
diff --git a/lib-src/tm-html b/lib-src/tm-html
new file mode 100755 (executable)
index 0000000..aa4d27d
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# $Id: tm-html,v 1.4 1997/01/30 02:22:30 steve Exp $
+#
+# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc.
+
+# This program 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.
+# 
+# This program 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 GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
+
+if [ "$TM_TMP_DIR" = "" ]; then
+    TM_TMP_DIR=/tmp
+    export TM_TMP_DIR
+fi
+
+if [ "$TM_WWW_BROWSER" = "" ]; then
+    TM_WWW_BROWSER=netscape
+    export TM_WWW_BROWSER
+fi
+
+if [ "$5" = "" ]; then
+    filename="$TM_TMP_DIR/mime$$.html"
+else
+    filename="$TM_TMP_DIR/$5"
+fi
+
+echo "$2; $3 -> $filename"
+
+tmdecode "$3" $1 $filename
+
+case "$4" in
+"play")
+    if [ `echo $TM_WWW_BROWSER | grep netscape` ]; then
+       echo netscape
+       if [ -h $HOME/.netscape/lock ]; then
+           netscape -remote "openURL(file:$filename,new-window)"
+        else
+           netscape $filename
+        fi
+    else
+       echo not netscape
+       $TM_WWW_BROWSER $filename
+    fi
+    trap 'rm -f $filename' 0 1 2 3 13 15
+    ;;
+"extract")
+    echo "extract to $filename"
+    ;;
+esac
diff --git a/lib-src/tm-image b/lib-src/tm-image
new file mode 100755 (executable)
index 0000000..78646e1
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh -
+#
+# $Id: tm-image,v 1.4 1997/01/30 02:22:30 steve Exp $
+#
+# Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
+
+# This program 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.
+# 
+# This program 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 GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
+
+if [ "$TM_TMP_DIR" = "" ]; then
+       TM_TMP_DIR=/tmp
+       export TM_TMP_DIR
+fi
+if [ "$5" = "" ]; then
+       case "$2" in
+       "image/gif")
+               filename="$TM_TMP_DIR/mime$$.gif"
+               ;;
+       "image/jpeg")
+               filename="$TM_TMP_DIR/mime$$.jpg"
+               ;;
+       "image/tiff"|"image/x-tiff")
+               filename="$TM_TMP_DIR/mime$$.tif"
+               ;;
+       "image/x-xwd")
+               filename="$TM_TMP_DIR/mime$$.xwd"
+               ;;
+       "image/x-xbm")
+               filename="$TM_TMP_DIR/mime$$.xbm"
+               ;;
+       "image/x-pic")
+               filename="$TM_TMP_DIR/mime$$.pic"
+               ;;
+       "image/x-mag")
+               filename="$TM_TMP_DIR/mime$$.mag"
+               ;;
+       *)
+               filename="$TM_TMP_DIR/mime$$.img"
+               ;;
+       esac
+else
+       filename="$TM_TMP_DIR/$5"
+fi
+
+echo "$2; $3 -> $filename"
+
+tmdecode $3 $1 $filename
+
+case "$4" in
+"play")
+       xv -geometry +1+1 $filename
+       trap 'rm -f $filename' 0 1 2 3 13 15
+       ;;
+"extract")
+       echo "extract to $filename"
+       ;;
+esac
diff --git a/lib-src/tm-mpeg b/lib-src/tm-mpeg
new file mode 100755 (executable)
index 0000000..88c5c1c
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh -
+#
+# $Id: tm-mpeg,v 1.4 1997/01/30 02:22:30 steve Exp $
+#
+# Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
+
+# This program 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.
+# 
+# This program 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 GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
+
+if [ "$TM_TMP_DIR" = "" ]; then
+       TM_TMP_DIR=/tmp
+       export TM_TMP_DIR
+fi
+if [ "$5" = "" ]; then
+       filename="$TM_TMP_DIR/mime$$.mpg"
+else
+       filename="$TM_TMP_DIR/$5"
+fi
+
+echo "$2; $3 -> $filename"
+
+tmdecode $3 $1 $filename
+
+case "$4" in
+"play")
+       if [ "$VIDEO_DITHER" = "" ]; then
+               VIDEO_DITHER=gray
+               export VIDEO_DITHER
+       fi
+       mpeg_play -dither $VIDEO_DITHER $filename
+       trap 'rm -f $filename' 0 1 2 3 13 15
+       ;;
+"extract")
+       echo "extract to $filename"
+       ;;
+esac
diff --git a/lib-src/tm-plain b/lib-src/tm-plain
new file mode 100755 (executable)
index 0000000..7035779
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh -
+#
+# $Id: tm-plain,v 1.4 1997/01/30 02:22:30 steve Exp $
+#
+# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc.
+
+# This program 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.
+# 
+# This program 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 GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
+
+if [ "$TM_TMP_DIR" = "" ]; then
+       TM_TMP_DIR=/tmp
+       export TM_TMP_DIR
+fi
+if [ "$5" = "" ]; then
+       filename="$TM_TMP_DIR/mime$$.pln"
+else
+       filename="$TM_TMP_DIR/$5"
+fi
+
+case "$4" in
+"play")
+       echo "$2; $3 ->"
+       tmdecode "$3" "$1" /dev/stdout
+       ;;
+"extract")
+       echo "$2; $3 -> $filename"
+       echo "extract to $filename"
+       tmdecode "$3" "$1" $filename
+       ;;
+"print")
+       echo "$2; $3 ->"
+       tmdecode "$3" "$1" /dev/stdout | lpr
+       ;;
+esac
diff --git a/lib-src/tm-ps b/lib-src/tm-ps
new file mode 100755 (executable)
index 0000000..d816945
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh -
+#
+# $Id: tm-ps,v 1.4 1997/01/30 02:22:30 steve Exp $
+#
+# Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
+
+# This program 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.
+# 
+# This program 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 GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
+
+if [ "$TM_TMP_DIR" = "" ]; then
+       TM_TMP_DIR=/tmp
+       export TM_TMP_DIR
+fi
+if [ "$5" = "" ]; then
+       filename="$TM_TMP_DIR/mime$$.pln"
+else
+       filename="$TM_TMP_DIR/$5"
+fi
+
+case "$4" in
+"play")
+       echo "$2; $3 -> $filename"
+       tmdecode $3 $1 $filename
+       ghostview $filename
+       trap 'rm -f $filename' 0 1 2 3 13 15
+       ;;
+"extract")
+       echo "$2; $3 -> $filename"
+       echo "extract to $filename"
+       tmdecode "$3" "$1" $filename
+       ;;
+"print")
+       echo "$2; $3 ->"
+       tmdecode "$3" "$1" /dev/stdout | lpr
+       ;;
+esac
diff --git a/lib-src/tmdecode b/lib-src/tmdecode
new file mode 100755 (executable)
index 0000000..ebb02fc
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh -
+#
+# $Id: tmdecode,v 1.4 1997/01/30 02:22:30 steve Exp $
+#
+# Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
+
+# This program 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.
+# 
+# This program 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 GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
+
+trap 'rm -f $2' 0 1 2 3 13 15
+
+case "$3" in
+/dev/stdout)
+       OUTPUT=
+       ;;
+*)
+       OUTPUT='> $3'
+       ;;
+esac
+
+case "$1" in
+""|"7bit"|"8bit"|"binary")
+       eval "cat $2 $OUTPUT"
+       ;;
+"base64")
+       #eval "decode-b < $2 $OUTPUT"
+       eval "mmencode -u $2 $OUTPUT"
+       ;;
+"quoted-printable")
+       eval "mmencode -q -u $2 $OUTPUT"
+       ;;
+"x-uue"|"x-uuencode")
+       (cd $TM_TMP_DIR ; uudecode $2)
+       ;;
+"x-gzip64")
+       #eval "decode-b < $2 | gzip -cd $OUTPUT"
+       eval "mmencode -u $2 | gzip -cd $OUTPUT"
+       ;;
+*)
+       echo "unknown encoding"
+       exit -1
+       ;;
+esac
+
+# echo "$2 was removed."
diff --git a/lib-src/update-elc.sh b/lib-src/update-elc.sh
new file mode 100644 (file)
index 0000000..f0cfc45
--- /dev/null
@@ -0,0 +1,183 @@
+#!/bin/sh
+# update-elc.sh --- recompile all missing or out-of-date .elc files
+
+# Author:      Jamie Zawinski, Ben Wing, Martin Buchholz
+# Maintainer:  Martin Buchholz
+# Keywords:    recompile byte-compile .el .elc
+
+# 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.
+
+### Commentary:
+##  Recompile all .elc files that need recompilation.  Requires a
+##  working version of "xemacs".  Correctly handles the case where the
+##  .elc files are missing; thus you can execute "rm lisp/*/*.elc"
+##  before running this script.  Run this from the parent of the
+##  "lisp" directory, or another nearby directory.
+
+set -e
+
+# Try to find the lisp directory in several places.
+# (Sun workspaces have an "editor" directory)
+for dir in  .  ..  ../..  editor  ../editor  ; do
+  if test -d $dir/lisp/. ; then cd $dir ; break ; fi
+done
+
+if test ! -d lisp/. ; then
+  echo "$0: Cannot find the \"lisp\" directory."
+  exit 1
+fi
+
+if test -z "$EMACS"; then EMACS="./src/xemacs"; fi
+export EMACS
+
+echo " (using $EMACS)"
+
+# fuckin' sysv, man...
+if [ "`uname -r | sed 's/[^0-9]*\([0-9]*\).*/\1/'`" -gt 4 ]; then
+  echon()
+  {    
+    /bin/echo $* '\c'
+  }
+else
+  echon()
+  {
+    echo -n $*
+  }
+fi
+
+REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
+BYTECOMP="$REAL -batch -vanilla "
+echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
+echo "          with $REAL..."
+
+$EMACS -batch -vanilla -l `pwd`/lisp/cleantree -f batch-remove-old-elc lisp
+
+prune_vc="( -name '.*' -o -name SCCS -o -name RCS -o -name CVS ) -prune -o"
+
+# $els  is a list of all .el  files
+# $elcs is a list of all .elc files
+els=/tmp/update-elc-1.$$ elcs=/tmp/update-elc-2.$$
+rm -f $els $elcs
+trap "rm -f $els $elcs" 0 1 2 3 15
+find lisp/. $prune_vc -name '*.el'  -print                    | sort > $els
+find lisp/. $prune_vc -name '*.elc' -print | sed 's/elc$/el/' | sort > $elcs
+
+
+echon "Deleting .elc files without .el files..."
+comm -13 $els $elcs | sed -e '\!/vm.el!d' -e 's/el$/elc/' | \
+ while read file ; do echo rm "$file" ; rm "$file" ; done
+echo done.
+
+
+# Compute patterns to ignore when searching for files
+ignore_dirs=""
+ignore_pattern=''
+
+# Only use Mule XEmacs to compile Mule-specific elisp dirs
+echon "Checking for Mule support..."
+lisp_prog='(princ (featurep (quote mule)))'
+mule_p="`$EMACS -batch -vanilla -eval \"$lisp_prog\"`"
+if test "$mule_p" = nil ; then
+       echo No
+       ignore_dirs="$ignore_dirs its egg mule language leim skk"
+       ignore_pattern='\!/tl/char-table.el$!d
+\!/tl/chartblxmas.el$!d
+\!/mu/latex-math-symbol.el$!d
+'
+else
+  echo Yes
+fi
+
+# first recompile the byte-compiler, so that the other compiles take place
+# with the latest version (assuming we're compiling the lisp dir of the emacs
+# we're running, which might not be the case, but often is.)
+#echo "Checking the byte compiler..."
+#$BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp
+
+# Prepare for byte-compiling directories with directory-specific instructions
+# Not necessary any more, but I want to keep the text current to cut & paste
+# into the package lisp maintenance tree.
+#make_special_commands=''
+#make_special () {
+#  dir="$1"; shift;
+#  ignore_dirs="$ignore_dirs $dir"
+#  make_special_commands="$make_special_commands \
+#echo \"Compiling in lisp/$dir\"; \
+#(cd \"lisp/$dir\" && ${MAKE:-make} EMACS=$REAL ${1+$*}); \
+#echo \"lisp/$dir done.\";"
+#}
+
+#if test "$mule_p" != nil; then
+#      make_special skk all
+#fi
+
+## AUCTeX is a package now
+# if test "$mule_p" = nil ; then
+#      make_special auctex some
+# else
+#      make_special auctex some MULE_ELC=tex-jp.elc
+# fi
+#make_special cc-mode all
+# EFS is now packaged
+# make_special efs x20
+#make_special eos -k           # not strictly necessary...
+## make_special gnus  some     # Now this is a package.
+# hyperbole is now packaged
+# make_special hyperbole elc
+# We're not ready for the following, yet.
+#make_special ilisp XEmacsELC=custom-load.elc elc
+# ilisp is now packaged
+# make_special ilisp elc
+# oobr is now packaged
+# make_special oobr HYPB_ELC='' elc
+## W3 is a package now.
+#make_special w3 xemacs-w3
+
+for dir in $ignore_dirs ; do
+  ignore_pattern="${ignore_pattern}/\\/$dir\\//d
+/\\/$dir\$/d
+"
+done
+
+# Other special-case filenames that don't get byte-compiled
+ignore_pattern="$ignore_pattern"'
+\!/,!d
+\!/paths.el$!d
+\!/loadup.el$!d
+\!/loadup-el.el$!d
+\!/update-elc.el$!d
+\!/dumped-lisp.el$!d
+\!/make-docfile.el$!d
+\!/site-start.el$!d
+\!/site-load.el$!d
+\!/site-init.el$!d
+\!/version.el$!d
+\!/very-early-lisp.el$!d
+\!/Installation.el$!d
+'
+
+echo "Compiling files without .elc..."
+NUMTOCOMPILE=20                        # compile this many files with each invocation
+comm -23 $els $elcs | \
+ sed "$ignore_pattern" | \
+ xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile
+echo "Compiling files without .elc... Done"
+
+#if test "$mule_p" != nil; then
+#      eval "$make_special_commands"
+#fi
index 94ae391..c2f1b30 100644 (file)
@@ -1,995 +1,3 @@
-1999-02-05  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * XEmacs 21.2.10 is released
-
-1999-02-02  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * package-get.el (package-get-remote-filename): Don't bug out for
-       a local file name in the search entry.
-
-1999-02-02  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * XEmacs 21.2.9 is released
-
-1999-01-19  Didier Verna  <verna@inf.enst.fr>
-
-       * replace.el (replace-search-function): new variable containing a
-       function to perform a search-forward.
-       (replace-re-search-function): new variable containing a function
-       to perform a re-search-forward.
-       (perform-replace): use them.
-
-1999-01-25  Didier Verna  <verna@inf.enst.fr>
-
-       * select.el (selection-owner-p): use the name `XEmacs'.
-       (cut-copy-clear-internal): ditto.
-
-1999-01-18  Andy Piper  <andy@xemacs.org>
-
-       * about.el (about-url-alist): Update my entry.
-       (xemacs-hackers): Ditto.
-
-1999-01-14  Adrian Aichner  <aichner@ecf.teradyne.com>
-
-       * buffer.el (switch-to-buffer): Fixing documentation.
-       * minibuf.el (minibuffer-completion-table): ditto.
-       * cl-macs.el (return-from): ditto.
-
-1999-01-04  Didier Verna  <verna@inf.enst.fr>
-
-       * replace.el (delete-non-matching-lines): temporarily disable
-       case-folding when called interactively with a regexp containing
-       uppercase characters.
-       (delete-matching-lines): ditto.
-       (count-matches): ditto.
-       (list-matching-lines): ditto.
-
-1999-01-07  Colin Rafferty  <colin@xemacs.org>
-
-       * window.el (shrink-window-if-larger-than-buffer): Clean up.  Only
-       abort if current window is split horizontally, not if others are
-       split.  Got rid of unnecessary minibuffer checking.  Also, add
-       some comments (it's still complex).
-
-1999-01-12  Robert Pluim  <rpluim@BayNetworks.com>
-
-       * package-get.el: changed address for doc.ic.ac.uk to
-       sunsite.doc.ic.ac.uk
-
-1999-01-09  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
-
-       * ldap.el (toplevel): Remove requires so that the file compiles
-       with a non LDAP-enabled XEmacs binary.  Provide `ldap'.
-
-1999-01-10  J. Kean Johnston  <jkj@sco.com>
-
-       * dump-paths.el: Calculate module-directory and set
-       module-load-path to the load path for modules.
-
-       * loadup.el: Get bootstrap value of module-load-path from the
-       environment variable EMACSBOOTSTRAPMODULEPATH.
-       - Display the module load path if we're debugging paths.
-
-       * setup-paths.el: Added function paths-find-site-module-directory.
-       - Added function paths-find-module-directory.
-       - Added function paths-construct-module-load-path.  Uses new
-       environment variable EMACSMODULEPATH.
-
-1998-12-30  Martin Buchholz  <martin@xemacs.org>
-
-       * font.el (font-default-object-for-device): 
-       Oops! This `or' can't be replaced by `unless'.
-       Fixed inability to run w3, among other things.
-
-1998-12-17  Charles G. Waldman <cgw@pgt.com>
-
-       * package-admin.el: Change initialization of
-         package-admin-install-function dependent on system type.
-         Change package-admin-install-function-mswindows to use
-         "minitar".
-
-1998-12-23  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * mouse.el (default-mouse-motion-handler): Disable help echo while 
-       in the minibuffer.
-
-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-12-07  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * package-ui.el (pui-list-packages): Set truncate-lines.
-
-       * package-get.el (package-get-download-menu): Use
-       `package-ui-add-site'. Add a a toggle to indicate it is in the list.
-
-       * package-ui.el (pui-help): Ditch in favor of `describe-mode'
-       (pui-help-string): idem.
-       (list-packages-mode): New major mode.
-       (pui-list-packages): Use 'list-packages-mode' in the package buffer.
-       (pui-install-selected-packages): Add suport for removing packages.
-       (pui-toggle-package-delete-key): New function.
-       (pui-popup-context-sensitive): New kludge.
-       (pui-list-packages): Add warning when `package-get-remote' is nil.
-       (package-ui-add-site): New function.
-
-1998-12-01  Didier Verna  <verna@inf.enst.fr>
-
-       * hyper-apropos.el (hyper-where-is): added the missing autoload.
-
-1998-11-29  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
-
-       * ldap.el: Custom-ized
-       (toplevel): Do not provide `ldap' which is provided by C level
-       LDAP code
-       (ldap-search): Docstring and stylistic fixes as suggested by Hrvoje
-
-1998-12-05  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * isearch-mode.el (isearch-mode): Really fix keymap lossage.
-
-1998-12-17  Andy Piper  <andy@xemacs.org>
-
-       * sound.el (sound-load-list): name changed from sound-load-alist.
-       (sound-extension-list): name changed from sound-ext-list.
-       (load-default-sounds): use new names.
-       (load-sound-file): use new names.
-
-1998-12-16  Andy Piper  <andy@xemacs.org>
-
-       * XEmacs 21.2.6 is released
-
-1998-11-30  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * cus-dep.el (Custom-make-dependencies): Be smarter about trapping 
-       errors.
-
-1998-12-04  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * wid-edit.el (widget-echo-this-extent): Set
-       help-echo-owns-message to t.
-
-1998-11-30  Greg Klanderman  <greg@alphatech.com>
-
-       * package-get.el (package-get-download-menu): use toggles for
-         each site in the download site menu.
-
-1998-12-01  Jan Vroonhof <vroonhof@math.ethz.ch>
-
-       * package-get.el (package-get): If we cannot find a package
-         because package-get-remote is not set, give a more helpful
-         error message.
-
-1998-11-30  Greg Klanderman  <greg@alphatech.com>
-
-       * package-get.el (package-get-remote-filename): use an EFS path
-       with user anonymous if no user is specified.
-
-1998-12-10  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * faces.el (face-spec-set): Re-init fallfacks for default after
-       calling reset-face on the default face.
-
-1998-12-10  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * package-admin.el (package-admin-default-install-function):
-       Behave as advertised.  Make sure the pkg-dir is proper for
-       default-directory.
-       (package-admin-add-binary-package): Make sure the pkg-dir is
-       proper for default-directory.
-       (package-admin-install-function-mswindows): Make sure the pkg-dir
-       is proper for default-directory.
-
-1998-12-05  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * XEmacs 21.2.5 is released
-
-1998-12-05  SL Baur  <steve@altair.xemacs.org>
-
-       * files.el (binary-file-regexps): regexp-opt is not available at
-       bytecompile time.
-
-1998-11-30  Martin Buchholz  <martin@xemacs.org>
-       
-       * x-win-xfree86.el:
-       * x-win-sun.el (x-win-init-sun):
-       * x-win-sun.el:
-       * x-mouse.el (mouse-track-and-copy-to-cutbuffer):
-       * x-iso8859-1.el:
-       * x-init.el (init-post-x-win):
-       * x-init.el (init-pre-x-win):
-       * x-init.el (x-initialize-compose):
-       * x-init.el:
-       * x-compose.el:
-       * winnt.el:
-       * widget.el:
-       * wid-edit.el (widget-glyph-click):
-       * wid-edit.el (widget-glyph-find):
-       * wid-edit.el (widget-type):
-       * view-less.el (view-buffer-other-window):
-       * very-early-lisp.el:
-       * version.el:
-       * toolbar.el:
-       * toolbar-items.el:
-       * term/sun.el (suntool-map):
-       * term/sun-mouse.el:
-       * term/internal.el:
-       * syntax.el (modify-syntax-entry):
-       * symbol-syntax.el:
-       * subr.el:
-       * startup.el (lock-directory):
-       * simple.el (set-comment-column):
-       * simple.el (backward-delete-char-untabify):
-       * shadow.el (find-emacs-lisp-shadows):
-       * shadow.el:
-       * setup-paths.el (paths-construct-info-path):
-       * select.el (cut-copy-clear-internal):
-       * process.el (call-process-region):
-       * process.el (start-process-shell-command):
-       * process.el:
-       * paths.el (rmail-spool-directory):
-       * paragraphs.el (use-hard-newlines):
-       * package-get.el (package-get-dependencies):
-       * package-admin.el (package-admin-delete-binary-package):
-       * obsolete.el (truncate-string):
-       * obsolete.el (store-substring):
-       * mouse.el (default-mouse-track-maybe-own-selection):
-       * mouse.el (mouse-yank-at-point):
-       * modeline.el:
-       * modeline.el (mouse-drag-modeline):
-       * minibuf.el (read-directory-name-internal):
-       * minibuf.el (read-file-name-internal):
-       * minibuf.el (read-file-name-internal-1):
-       * minibuf.el (read-file-name-2):
-       * minibuf.el (exact-minibuffer-completion-p):
-       * minibuf.el (read-from-minibuffer):
-       * minibuf.el:
-       * menubar.el (check-menu-syntax):
-       * map-ynp.el (map-y-or-n-p):
-       * make-docfile.el (docfile-out-of-date):
-       * loadup.el ((member "run-temacs" command-line-args)):
-       * loadup.el ((member "no-site-file" command-line-args)):
-       * loadup.el (really-early-error-handler):
-       * loadup.el:
-       * loadhist.el:
-       * loaddefs.el:
-       * lisp-mnt.el (lm-verify):
-       * lib-complete.el (lib-complete:cache-completions):
-       * lib-complete.el (library-all-completions):
-       * itimer.el (itimer-run-expired-timers):
-       * info.el (Info-mode):
-       * info.el (Info-insert-file-contents):
-       * info.el (Info-rebuild-dir):
-       * info.el (Info-build-dir-anew):
-       * info.el (Info-parse-dir-entries):
-       * info.el (Info-dir-outdated-p):
-       * info.el (Info-insert-dir):
-       * info.el (info-xref):
-       * info.el:
-       * hyper-apropos.el (hyper-apropos-get-doc):
-       * hyper-apropos.el (hyper-describe-face):
-       * hyper-apropos.el (hyper-apropos-mode):
-       * hyper-apropos.el:
-       * help.el (list-processes):
-       * help.el:
-       * gnuserv.el:
-       * font.el (mswindows-font-create-name):
-       * font.el (font-default-font-for-device):
-       * font.el (x-font-create-object):
-       * font.el (font-registry):
-       * font.el:
-       * font-lock.el (font-lock-keywords):
-       * font-lock.el:
-       * finder.el (finder-compile-keywords):
-       * find-paths.el (paths-find-recursive-path):
-       * fill.el (set-justification-center):
-       * fill.el (fill-region-as-paragraph):
-       * files.el (insert-directory):
-       * files.el (wildcard-to-regexp):
-       * files.el (recover-file):
-       * files.el (basic-save-buffer):
-       * files.el (delete-auto-save-file-if-necessary):
-       * files.el (file-relative-name):
-       * files.el (backup-extract-version):
-       * files.el (backup-buffer):
-       * files.el (set-visited-file-name):
-       * files.el (set-auto-mode):
-       * files.el (interpreter-mode-alist):
-       * files.el:
-       * files.el (find-file-noselect):
-       * files.el (abbreviate-file-name):
-       * files.el (parse-colon-path):
-       * files.el (directory-abbrev-alist):
-       * etags.el (visit-tags-table-buffer):
-       * easymenu.el (easy-menu-define):
-       * dragdrop.el (experimental-dragdrop-drag):
-       * dragdrop.el (dragdrop-drop-do-functions):
-       * dragdrop.el (dragdrop-drop-at-point):
-       * disass.el (disassemble-1):
-       * disass.el (disassemble-internal):
-       * disass.el (disassemble):
-       * disass.el:
-       * derived.el (derived-mode-init-mode-variables):
-       * derived.el (define-derived-mode):
-       * custom.el (defgroup):
-       * cus-edit.el (custom-quote):
-       * config.el:
-       * code-process.el (open-network-stream):
-       * code-process.el (start-process):
-       * code-process.el (call-process-region):
-       * code-process.el (call-process):
-       * code-process.el:
-       * code-files.el (insert-file-contents):
-       * code-files.el:
-       * code-files.el (buffer-file-coding-system-for-read):
-       * cmdloop.el (yes-or-no-p-minibuf):
-       * cl.el:
-       * cl-macs.el:
-       * cl-extra.el:
-       * callers-of-rpt.el (make-caller-report):
-       * callers-of-rpt.el:
-       * bytecomp.el (batch-byte-recompile-directory):
-       * bytecomp.el (batch-byte-compile-1):
-       * bytecomp.el (batch-byte-compile):
-       * bytecomp.el (display-call-tree):
-       * bytecomp.el (byte-compile-insert):
-       * bytecomp.el (byte-compile-two-args-19->20):
-       * bytecomp.el (byte-compile-variable-ref):
-       * bytecomp.el (byte-compile-form):
-       * bytecomp.el (byte-compile-top-level-body):
-       * bytecomp.el (byte-compile-out-toplevel):
-       * bytecomp.el (byte-compile-byte-code-maker):
-       * bytecomp.el (byte-compile-file-form-defmumble):
-       * bytecomp.el (byte-compile-file-form):
-       * bytecomp.el (byte-compile-keep-pending):
-       * bytecomp.el (byte-compile-insert-header):
-       * bytecomp.el (byte-compile-from-buffer):
-       * bytecomp.el (byte-compile-file):
-       * bytecomp.el (byte-recompile-file):
-       * bytecomp.el (byte-compile-close-variables):
-       * bytecomp.el (byte-compile-warn-about-unused-variables):
-       * bytecomp.el (byte-compile-warn-about-unresolved-functions):
-       * bytecomp.el (byte-compiler-legal-options):
-       * bytecomp.el (byte-compile-lapcode):
-       * bytecomp.el (byte-optimize-log):
-       * bytecomp.el ((fboundp 'defsubst)):
-       * bytecomp.el:
-       * bytecomp-runtime.el:
-       * byte-optimize.el (byte-optimize-apply):
-       * byte-optimize.el (car):
-       * byte-optimize.el (byte-optimize-form):
-       * byte-optimize.el (byte-optimize-form-code-walker):
-       * byte-optimize.el:
-       * build-report.el (build-report-insert-installation-file):
-       * build-report.el (build-report):
-       * auto-show.el:
-       * apropos.el (apropos-documentation):
-       - mega patch
-       - clean up byte-compile warnings
-       - remove unused variables
-       - Use common lisp style hashtable functions
-       - byte compiler cleanup
-       - use #'(lambda ...) instead of '(lambda ...) or (function (lambda ...))
-       - remove old backquote syntax usage
-       - move some cl functionality into C for speed.
-       - remove last remaining VMS support
-       - spelling fixes
-       - implement last, butlast, nbutlast, copy-list in C.
-       - new macro ignore-file-errors, similar to ignore-errors
-         (ignore-file-errors (delete-file "foo"))
-       - get frequent garbage collection during loadup.el by tweaking
-         gc-cons-threshold, rather than explicitly calling garbage-collect
-       - default delete-key-deletes-forward to `t'.
-
-1998-11-28  SL Baur  <steve@altair.xemacs.org>
-
-       * XEmacs 21.2-beta4 is released.
-
-1998-11-27  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * easymenu.el (easy-menu-add-item): Wraper around add-menu-btton.
-       (easy-menu-item-present-p): Wrapper around find-menu-item.
-       (easy-menu-remove-item): Wrapper around delete-menu-item.
-
-       * menubar.el (delete-menu-item): Add 'from-menu' argument.
-       (add-menu-button): Add 'in-menu' argument.
-       (add-menu-item-1): Add in-menu support to helper function.
-
-1998-11-27  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * isearch-mode.el (isearch-mode): Fix keymap lossage.
-
-1998-11-26  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * faces.el (get-custom-frame-properties): Revert Hrvoje Niksic change 
-       of Dec 4, 1997.
-
-1998-11-25  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * process.el (shell-command-on-region): Report if the command
-       succeeded or failed.
-
-1998-11-24  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * subr.el (buffer-substring-no-properties): Comment out.
-
-1998-11-07  Adrian Aichner  <aichner@ecf.teradyne.com>
-
-       * msw-faces.el (mswindows-find-smaller-font): Turning font names
-         into font instances first, like `x-frob-font-size' does.
-         (mswindows-find-larger-font): ditto
-
-1998-11-04  Greg Klanderman  <greg@alphatech.com>
-
-       * package-ui.el (pui-install-selected-packages): fix args in call
-       to `package-get'.
-
-1998-10-29  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * package-get.el (host-name): New widget type.
-       (package-get-remote): Better customization using new type.
-       (package-get-download-sites): idem dito.
-
-       (package-get-custom): Do not use package-get-all untill we have
-       runtime dependencies.
-
-       (package-get-remove-copy): Default to 't' we no longer need this
-       kludge as we do not currently use depenencies.
-       
-       (package-get-was-current): New variable.
-       (package-get-require-base): New 'force-current' argument.
-       (package-get-update-base): idem
-       (package-get-package-provider):  idem
-       (package-get-locate-index-file): New 'no-remote' argument.
-       (package-get-locate-file): idem.
-       
-       (package-get-maybe-save-index): New function.
-       (package-get-update-base): Use it.
-
-1998-10-28 Greg Klanderman <greg@alphatech.com>
-
-       * package-get.el (package-get-remote): default to nil; by default, 
-       don't go out to the net via EFS.  They must select a download site.
-       (package-get-download-sites): new variable.
-       (package-get-download-menu): new function.
-       (package-get-locate-index-file): new function.
-       (package-get-update-base): use it.
-
-       * menubar-items.el (default-menubar): add "Update Package Index"
-       and "Add Download Site" menus under Options | Manage Packages.
-
-1998-10-19  Greg Klanderman  <greg@alphatech.com>
-
-       * package-get.el (package-get): bugfix code checking installed version
-       for case where package is not currently installed.
-       (package-get-require-signed-base-updates): new variable.
-       (package-get-update-base-from-buffer): remove REMOTE-SOURCE arg, it was 
-       deemed not a goot thing.  Use the variable
-       package-get-allow-unsigned-base-updates instead.
-
-1998-10-16 Greg Klanderman <greg@alphatech.com>
-
-       * package-get.el (package-get): Don't install an older version than 
-       we already have unless explicitly told to.  Issue a warning.
-
-       * package-ui.el (pui-add-required-packages): when adding
-       dependencies, don't add packages that are up to date.
-       (pui-package-symbol-char):  Don't consider a package out of date 
-       if you have a newer version installed than the latest version in
-       package-get-base.
-
-       * package-get.el (package-get-base-filename): document that it may 
-       be a path relative to package-get-remote;  new default value.
-       (package-get-locate-file): new function.
-       (package-get-update-base): use it to expand package-get-base-filename.
-       (package-get-save-base): new function to save the package-get database
-       to file.
-       (package-get-update-base-from-buffer): add REMOTE-SOURCE argument.
-       (package-get-update-base): pass the REMOTE-SOURCE arg.
-       (package-get-update-base-entry): call package-get-custom-add-entry.
-       (package-get-file-installed-p): removed; no longer needed.
-       (package-get-create-custom): ditto.
-       (toplevel): remove code to build and load package-get-custom.el
-       (package-get-custom-add-entry): new function.
-
-1998-10-12  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * wid-edit.el (widget-button-click): Don't switch window.
-
-1998-10-22  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * cus-face.el (custom-set-face-update-spec): Add autoload cookie
-
-1998-10-20  Malcolm Box  <malcolm@brownale.demon.co.uk>
-        
-       * etags.el (find-tag-default): Run find-tag-hook using
-       run-hooks rather than funcall
-
-1998-10-19  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * isearch-mode.el (isearch-mode): Set the current minor mode maps
-       and the current local map as the parents to isearch-mode-map.
-
-1998-10-15  SL Baur  <steve@altair.xemacs.org>
-
-       * XEmacs 21.2-beta3 is released.
-
-1998-10-15  Greg Klanderman  <greg@alphatech.com>
-
-       * package-get.el (package-get-update-base): use
-       insert-file-contents-internal, not insert-file-contents-literally.
-
-1998-10-14  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * auto-save.el: expand-file 'auto-save-*-dir' at runtime not at
-       dump time. 
-
-1998-10-15  Greg Klanderman  <greg@alphatech.com>
-
-       * package-get.el (package-get-update-base-entry): new function.
-       (package-get-update-base): renamed; was `package-get-load-base'.
-       cleanup, and use package-get-update-base-from-buffer.
-       (package-get-update-base-from-buffer): new function.
-       (package-get-update-base-entries): new; helper for above.
-       Do not eval lisp grabbed over ftp; parse it from new format.
-
-1998-10-15  Greg Klanderman  <greg@alphatech.com>
-
-       * files.el (set-auto-mode): Don't play games loading package-get
-       database; package-get-package-provider will handle it all.
-
-1998-10-14  Greg Klanderman  <greg@alphatech.com>
-
-       * package-get.el (package-get-base-filename): new variable.
-       (package-get-require-base): new function.
-       (package-get-pgp-signed-begin-line): new variable.
-       (package-get-pgp-signature-begin-line): ditto.
-       (package-get-pgp-signature-end-line):  ditto.
-       (package-get-load-base): new function.
-       (package-get-interactive-package-query):
-       (package-get-update-all):
-       (package-get-dependencies):
-       (package-get-package-provider):
-       (package-get-custom): use package-get-require-base.
-       [package-get-custom loading]: disable for now.
-
-       * package-ui.el (pui-list-packages): use (package-get-require-base)
-
-1998-10-14  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * package-ui.el: Correct obvious thinko in choosing extent face.
-
-1998-10-12  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * menubar-items.el (default-menubar): pui-list-package has nothing 
-       to with Customize. Move all the package stuff to a new Item in Options.
-
-       * package-ui.el (pui-menu): Add menu and Popup menu.
-
-       * package-get.el (package-get): Use new
-       package-admin-get-install-dir.
-
-       * package-admin.el (package-admin-get-install-dir): New syntax.
-       Conserve package location and put mule packages where mule-base is.
-
-       * package-get.el : Customized
-
-       * package-ui.el (pui): Customized
-       (pui-package-install-dest-dir): New variable.
-       (pui-install-selected-packages): Use it
-
-1998-10-12  SL Baur  <steve@altair.xemacs.org>
-
-       * package-get.el (package-get-interactive-package-query): Move
-       dependency on package-get-base to run-time.
-       (package-get-update-all): Ditto.
-       (package-get-dependencies): Ditto.
-       (package-get-package-provider): Ditto.
-       (package-get-custom): Ditto.
-
-1998-10-11  Glynn Clements  <glynn@sensei.co.uk>
-
-       * events.el: Remove 'ascii-character property from 'backspace
-       and 'delete symbols
-
-1998-10-11  SL Baur  <steve@altair.xemacs.org>
-
-       * package-get-base.el: removed.
-
-1998-09-23  Didier Verna  <verna@inf.enst.fr>
-
-       * simple.el (search-caps-disable-folding): moved from isearch-mode.el
-       (no-upper-case-p): new function.
-       (with-search-caps-disable-folding): new macro.
-       (with-interactive-search-caps-disable-folding): new macro.
-       (zap-to-char): In interactive mode, do a case-sensitive search if
-       the character is uppercase.
-       (zap-up-to-char): ditto.
-
-       * replace.el (perform-replace): use the function no-upper-case-p.
-
-       * isearch-mode.el (isearch-fix-case): ditto.
-       make obsolete `with-caps-disable-folding' and
-       `isearch-no-upper-case-p'.
-
-       * etags.el (find-tag-internal): use `with-search-caps-disable-folding'.
-       (tags-search): ditto.
-       (tags-query-replace): ditto.
-
-       * info.el (Info-search): ditto.
-
-1998-10-07  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * x-font-menu.el (font-menu-set-font): Respect font-menu-frame-local
-
-1998-10-07  Greg Klanderman  <greg@alphatech.com>
-
-       * package-admin.el (package-admin-rmtree): rewritten.  need to
-       check for "." and ".." before symlink check.  expand files and
-       directories with respect to DIRECTORY, not default-directory.
-
-1998-10-04  Greg Klanderman  <greg@alphatech.com>
-
-       * package-get.el (package-get-all): add INSTALL-DIR argument.
-
-1998-10-06  Greg Klanderman  <greg@alphatech.com>
-
-       * package-ui.el (pui-add-required-packages): new function, select
-       dependent packages.
-       (pui-display-keymap): bind it.
-       (pui-help-string): document it.
-       (pui-install-selected-packages): package-get-all -> package-get.
-
-       * package-get.el (package-get-dependencies): new function.
-
-1998-10-04  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * isearch-mode.el (isearch-done): Use regexp-search-ring-max for
-       regexps.
-
-1998-10-05  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * mouse.el (default-mouse-track-point-at-opening-quote-p): New
-       function.
-       (default-mouse-track-normalize-point): Use it.
-
-1998-09-30  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * package-admin.el (package-admin-delete-binary-package):
-               General cleanup. Remove unnessary use of progn and
-       save-excursion. 
-       (package-admin-delete-binary-package): Do NOT mess with file
-       modes. That is evil. 
-       (package-admin-delete-binary-package): Wrap all deleting in
-       condition-case. The data in MANIFEST is untrustworthy.
-       (package-admin-delete-binary-package): Let the OS worry about non
-       empty directories.
-
-1998-10-09  SL Baur  <steve@altair.xemacs.org>
-
-       * lisp-mnt.el (lm-commentary): Fix InfoDock-style comment
-       processing.
-       (lm-report-bug): Fix mail address to send bug reports to.
-
-1998-09-29  SL Baur  <steve@altair.xemacs.org>
-
-       * XEmacs 21.2-beta2 is released.
-
-1998-08-14  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * files.el (auto-mode-alist): Enhanced regexp for perl-mode
-
-1998-09-22  Karl M. Hegbloom  <karlheg@bittersweet.inetarena.com>
-
-       * info.el (Info-mode): Document page turning by double clicks in
-       docstring so `M-x describe-mode' will display it.
-
-1998-09-20  Karl M. Hegbloom  <karlheg@bittersweet.inetarena.com>
-
-       * info.el (Info-mouse-track-double-click-hook): Use character
-       widths to calculate a border region where double clicking does
-       page turning, and return `nil' by default so other hooks, such as
-       region highlighting, will be run.
-
-1998-09-29  Colin Rafferty   <colin@xemacs.org>
-
-       * sound.el (default-sound-directory-list): Initialize with all the 
-       "sounds" directories in `data-directory-list'.  It used to just be 
-       the first one.
-
-       * packages.el (locate-data-directory-list): Created.  This gives
-       the list of matching directories, unlike `locate-data-directory',
-       which just gives the first one.
-
-1998-09-26  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * minibuf.el (read-from-minibuffer): No longer bind help-form but
-       make a binding in the local keymap until help-char handling is
-       improved. 
-
-       * help.el (help-keymap-with-help-key): Provide keymap with help
-       binding.
-       (help-print-help-form): New helper function.
-
-1998-09-23  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * isearch-mode.el (isearch-highlight): set-extent-endpoints can
-       move extent to another buffer; no need to create a new extent.
-       (isearch-fix-case): New function.
-       (isearch-search-and-update): Use it.
-
-1998-09-22  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * isearch-mode.el (isearch-mode): Use overriding-local-map to set
-       the keymap, not minor-mode-map-alist.
-       (isearch-done): Restore overriding-local-map.
-
-1998-09-21  Martin Buchholz  <martin@xemacs.org>
-
-       * bytecomp.el (byte-compile-buffer-substring): 
-       Fix for: (byte-compile (defun f () (buffer-substring)))
-       ==>   ** buffer-substring called with 3 args, but requires 0-3
-       - new code not only works, but is more readable, too.
-
-1998-09-20  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * msw-faces.el (mswindows-init-device-faces): Don't try to
-         specify a default font at this late stage. Do try to force
-         creation of the default face font so that if it fails we get
-         an error now instead of a crash at frame creation.
-
-         mswindows-font-canonicalize-name, mswindows-make-font-unbold,
-         mswindows-make-font-unitalic: Canonical default weight
-         changed from "Normal" to "Regular".
-
-         mswindows-make-font-bold / -bold-italic: Supplied device was
-         not being passed into call to mswindows-find-smaller-font.
-
-1998-09-10  Bjrn Torkelsson  <torkel@hpc2n.umu.se>
-
-       * package-get.el (package-get-remote): Fix the path where to find
-         the packages on xemacs.org.
-
-1998-09-08  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * about.el (about-maintainer-info): Update Ben's entry.
-
-1998-09-24  Martin Buchholz  <martin@xemacs.org>
-
-       * lisp/shadow.el (find-emacs-lisp-shadows):
-       - `member' was being called on lists of length 2000!
-       - Replace with hashtables.
-       - Replace hand-coded loops with (dolist)
-       - Fix comment typo
-
-1998-09-20  Darryl Okahata  <darrylo@sr.hp.com>
-
-       * packages.el: Added new function, `package-delete-name', to
-         delete existing packages from the installed package database
-         (`packages-package-list').  Also added the "pkginfo" directory
-         to `packages-special-base-regexp', so that the pkginfo directory
-         would not get added to `late-packages'.
-
-       * package-admin.el: Added ability to delete an installed package
-         (added low-level function, `package-admin-delete-package').
-         Understands how to use the pkginfo/MANIFEST.<package> file to
-         delete the package.  When installing a package, will also
-         create a MANIFEST.* file if one is not provided by the
-         package.  If the MANIFEST.* doesn't exist when deleting a
-         package, the functions will fall back to attempting to delete
-         any package-specific lisp directory.
-
-       * package-get.el: Moved some functions to package-admin.el.
-         Added interactive function `package-get-delete-package', for
-         use by users for deleting a package.
-
-         Also modified to not require the prescence of efs.
-
-1998-09-22  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * files.el (find-file-noselect): Handle all signals, kill the
-       buffer and resignal.
-
-1998-09-23  SL Baur  <steve@altair.xemacs.org>
-
-       * cl-macs.el (glyph-image): Add setf method.
-
-1998-09-06  Darryl Okahata  <darrylo@sr.hp.com>
-
-       * package-get.el: Fixed broken EFS downloading.  Also, look for
-         .tar.gz files first, in preference over .tgz files.
-
-       * package-ui.el: Fix display of package version numbers.
-
-1998-08-27  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * x-font-menu.el (font-menu-set-font):  Add "pt" units to size
-       argument.       
-
-1998-09-03  Darryl Okahata  <darrylo@sr.hp.com>
-
-       * list-mode.el: `display-completion-list': added new/optional
-         keyword `:completion-string', which allows the programmer to
-         change the "Possible completions are:" prompt.
-
-       * menubar-items.el: Added new pulldown menu-pick to start up the 
-         visual package browser/installer:
-
-               Options->Customize->List Packages
-
-       * package-admin.el: Added hooks for installing under both Unix
-         and MS Windows.  Does additional error checking.  No longer
-         calls "add-big-package.sh" to install packages under Unix; now 
-         calls gunzip & tar directly.
-
-       * package-get.el: Added ability to install packages from files
-         on a local disk/CDROM.  Now deletes any existing package lisp
-         directory.  Does completion on available packages when
-         querying for package names.  Will also search for .tgz files
-         in addition for .tar.gz files.  Tries to reload
-         auto-autoloads, as a convenience when loading new packages,
-         and also tries to add any new package paths to `load-path'.
-         Changed all occurences of `concat' to use `expand-file-name'.
-
-       * package-ui.el: New file which implements the main visual
-         package browser/installer, which is started via a menu pick or 
-         M-x pui-list packages.
-
-1998-09-03  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * startup.el (load-init-file): spelling fix.
-
-1998-09-02  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-       * startup.el (normal-top-level): Load auto-autoload files
-       covariantly with their precedence.
-
-1998-08-26  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * menubar-items.el (default-menubar): Remove "Font Weight"
-       option, there is currently no custom equivalent.. Customize-faces
-       is "Edit faces".
-
-       * x-font-menu.el (font-menu-set-font): Use customize to set
-       default face.
-
-       * faces.el (face-spec-update-all-matching): New function.
-
-       * cus-face.el (custom-set-face-update-spec): New function.
-       Interface to customize faces from elisp.
-
-       (custom-face-value-create): Show the customized settings if set
-       but not saved.
-
-1998-08-26  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       (custom-face-value-create): Show the customized settings if set
-       but not saved.
-
-1998-08-31  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * keydefs.el (global-map): Add FSF 20.3 binding of
-       query-replace-regexp.
-
-1998-08-21  Greg Klanderman  <greg@alphatech.com>
-
-       * minibuf.el (read-file-name-internal-1): use
-       user-name-completion-1 instead of user-name-completion.
-
-1998-08-19  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-       * loadup.el: 
-       * make-docfile.el: 
-       * update-elc.el: Don't set `source-directory' (now defunct as a
-       global variable) no more.
-
-       * packages.el (packages-list-autoloads): Made `source-directory'
-       (now defunct as a global variable) a parameter.
-
-1998-08-13  Carsten Leonhardt  <leo@arioch.oche.de>
-
-       * about.el (about-hackers): new email
-
-1998-08-16  SL Baur  <steve@altair.xemacs.org>
-
-       * lisp-mode.el (with-string-as-buffer-contents): Set indentation.
-
-1998-07-17  Didier Verna  <verna@inf.enst.fr>
-
-       * faces.el (set-face-property):
-       (set-face-dim-p):
-       (face-dim-p): updated the doc strings now that the dim property isn't
-       tty-specific. 
-       (face-equal): the dim property is now a common one.
-
-       * cus-face.el (custom-face-attributes): New face attribute: `dim'
-       Renamed the `stipple' attribute to `background-pixmap'.
-       (custom-face-background-pixmap): make custom-face-stipple an
-       obsolete alias for this.
-
-1998-08-11  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-       * find-paths.el (paths-file-readable-directory-p): Created and
-       used.
-
-       * loadup.el: Don't set inhibit-... flags from run-temacs.
-
-1998-08-06  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-       * packages.el (packages-data-path-depth): Added and used.
-
-1998-08-05  Charles G. Waldman <cgw@pgt.com>
-
-       * about.el:
-       - Change .xpm to .png, delete "zcat" section.
-       - cosmetic fix in the 'marcpa' entry.
-
-       * etc/photos
-       - convert all .xpm.Z to .png
-       - rename mrb to martin
-       - rename mcook-m to mcookm
-
-1998-07-31  Martin Buchholz  <martin@xemacs.org>
-
-       * x-init.el (x-initialize-compose): Add support for
-       dead-circumflex as YET ANOTHER NAME for that dead key.
-
-1998-08-05  Colin Rafferty <colin@xemacs.org>
-
-       * setup-paths.el (paths-construct-exec-path): Made the
-       last-packages really be last.
-       (paths-construct-data-directory-list): Ditto.
-
-1998-08-01  Kai Haberzettl  <khaberz@synnet.de>
-
-       * startup.el(startup-splash-frame-body): 
-       Update Copyright notice in splash screen 
-
-1998-07-20  Greg Klanderman  <greg@alphatech.com>
-
-       * minibuf.el (read-file-name-internal-1): do ~user completion.
-
-1998-07-22  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * font-lock.el (font-lock-fontify-glumped-region): Add guard
-       aginst destroyed extents
-
-1998-07-24  Greg Klanderman  <greg@alphatech.com>
-
-       * package-get.el (package-get): add `install-dir' argument.
-
-1998-07-20  John Jones  <jj@asu.edu>
-
-       * package-get.el: calls to package-get-update-all will only
-         update packages which are already installed.
-
-1998-07-23  SL Baur  <steve@altair.xemacs.org>
-
-       * autoload.el (update-file-autoloads): Ensure autoloads buffer is
-       writable.
-
-1998-07-20  Colin Rafferty   <colin@xemacs.org>
-
-       * about.el (about-hackers): Correct my email.
-
-1998-07-20  Kai Haberzettl  <khaberz@synnet.de>
-
-       * about.el (about-hackers): new email-address.
-
-1998-07-25  SL Baur  <steve@altair.xemacs.org>
-
-       * minibuf.el (read-number): Don't let `input-error' condition
-       escape.
-
-1998-07-20  Greg Klanderman  <greg@alphatech.com>
-
-       * about.el (about-hackers): use my `email-for-life' address.
-
 1998-07-19  SL Baur  <steve@altair.xemacs.org>
 
        * XEmacs 21.2-beta1 is released.
index fb49fe1..55a4534 100644 (file)
@@ -175,7 +175,7 @@ For example, invoke `xemacs -batch -f batch-byte-recompile-directory .'." nil ni
 
 ;;;***
 \f
-;;;### (autoloads (compiler-macroexpand define-compiler-macro ignore-file-errors ignore-errors assert check-type typep deftype cl-struct-setf-expander defstruct define-modify-macro callf2 callf letf* letf rotatef shiftf remf cl-do-pop psetf setf get-setf-method defsetf define-setf-method declare the locally multiple-value-setq multiple-value-bind lexical-let* lexical-let symbol-macrolet macrolet labels flet progv psetq do-all-symbols do-symbols dotimes dolist do* do loop return-from return block etypecase typecase ecase case load-time-value eval-when destructuring-bind function* defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs" "lisp/cl-macs.el")
+;;;### (autoloads (compiler-macroexpand define-compiler-macro ignore-errors assert check-type typep deftype cl-struct-setf-expander defstruct define-modify-macro callf2 callf letf* letf rotatef shiftf remf cl-do-pop psetf setf get-setf-method defsetf define-setf-method declare the locally multiple-value-setq multiple-value-bind lexical-let* lexical-let symbol-macrolet macrolet labels flet progv psetq do-all-symbols do-symbols dotimes dolist do* do loop return-from return block etypecase typecase ecase case load-time-value eval-when destructuring-bind function* defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs" "lisp/cl-macs.el")
 
 (autoload 'cl-compile-time-init "cl-macs" nil nil nil)
 
@@ -322,7 +322,7 @@ go back to their previous definitions, or lack thereof)." nil 'macro)
 (autoload 'labels "cl-macs" "\
 (labels ((FUNC ARGLIST BODY...) ...) FORM...): make temporary func bindings.
 This is like `flet', except the bindings are lexical instead of dynamic.
-Unlike `flet', this macro is fully compliant with the Common Lisp standard." nil 'macro)
+Unlike `flet', this macro is fully complaint with the Common Lisp standard." nil 'macro)
 
 (autoload 'macrolet "cl-macs" "\
 (macrolet ((NAME ARGLIST BODY...) ...) FORM...): make temporary macro defns.
@@ -486,10 +486,6 @@ omitted, a default message listing FORM itself is used." nil 'macro)
 Execute FORMS; if an error occurs, return nil.
 Otherwise, return result of last FORM." nil 'macro)
 
-(autoload 'ignore-file-errors "cl-macs" "\
-Execute FORMS; if an error of type `file-error' occurs, return nil.
-Otherwise, return result of last FORM." nil 'macro)
-
 (autoload 'define-compiler-macro "cl-macs" "\
 (define-compiler-macro FUNC ARGLIST BODY...): Define a compiler-only macro.
 This is like `defmacro', but macro expansion occurs only if the call to
@@ -515,7 +511,7 @@ and then returning foo." nil 'macro)
 ;;;### (autoloads (config-value config-value-hash-table) "config" "lisp/config.el")
 
 (autoload 'config-value-hash-table "config" "\
-Return hash table of configuration parameters and their values." nil nil)
+Return hashtable of configuration parameters and their values." nil nil)
 
 (autoload 'config-value "config" "\
 Return the value of the configuration parameter CONFIG_SYMBOL." nil nil)
@@ -669,15 +665,11 @@ The format is suitable for use with `easy-menu-define'." nil nil)
 
 ;;;***
 \f
-;;;### (autoloads (custom-set-faces custom-set-face-update-spec custom-declare-face) "cus-face" "lisp/cus-face.el")
+;;;### (autoloads (custom-set-faces custom-declare-face) "cus-face" "lisp/cus-face.el")
 
 (autoload 'custom-declare-face "cus-face" "\
 Like `defface', but FACE is evaluated as a normal argument." nil nil)
 
-(autoload 'custom-set-face-update-spec "cus-face" "\
-Customize the FACE for display types matching DISPLAY, merging
-  in the new items from PLIST" nil nil)
-
 (autoload 'custom-set-faces "cus-face" "\
 Initialize faces according to user preferences.
 The arguments should be a list where each entry has the form:
@@ -929,7 +921,7 @@ MATCH-ANCHORED should be of the form:
 Where MATCHER is as for MATCH-HIGHLIGHT with one exception; see below.
 PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after
 the last, instance MATCH-ANCHORED's MATCHER is used.  Therefore they can be
-used to initialize before, and cleanup after, MATCHER is used.  Typically,
+used to initialise before, and cleanup after, MATCHER is used.  Typically,
 PRE-MATCH-FORM is used to move to some position relative to the original
 MATCHER, before starting with MATCH-ANCHORED's MATCHER.  POST-MATCH-FORM might
 be used to move, before resuming with MATCH-ANCHORED's parent's MATCHER.
@@ -964,7 +956,7 @@ the wrong pattern can dramatically slow things down!")
 
 (make-variable-buffer-local 'font-lock-keywords)
 
-(defcustom font-lock-mode nil "Non nil means `font-lock-mode' is on" :group 'font-lock :type 'boolean :initialize 'custom-initialize-default :require 'font-lock :set (function (lambda (var val) (font-lock-mode (or val 0)))))
+(defcustom font-lock-mode nil "Non nil means `font-lock-mode' is on" :group 'font-lock :type 'boolean :initialize 'custom-initialize-default :require 'font-lock :set '(lambda (var val) (font-lock-mode (or val 0))))
 
 (defvar font-lock-mode-hook nil "\
 Function or functions to run on entry to font-lock-mode.")
@@ -1066,7 +1058,7 @@ Prefix arg means just kill any existing server communications subprocess." t nil
 
 ;;;***
 \f
-;;;### (autoloads (hyper-apropos-popup-menu hyper-apropos-set-variable hyper-set-variable hyper-apropos-read-variable-symbol hyper-describe-function hyper-where-is hyper-describe-variable hyper-describe-face hyper-describe-key-briefly hyper-describe-key hyper-apropos) "hyper-apropos" "lisp/hyper-apropos.el")
+;;;### (autoloads (hyper-apropos-popup-menu hyper-apropos-set-variable hyper-set-variable hyper-apropos-read-variable-symbol hyper-describe-function hyper-describe-variable hyper-describe-face hyper-describe-key-briefly hyper-describe-key hyper-apropos) "hyper-apropos" "lisp/hyper-apropos.el")
 
 (autoload 'hyper-apropos "hyper-apropos" "\
 Display lists of functions and variables matching REGEXP
@@ -1086,9 +1078,6 @@ See also `hyper-apropos' and `hyper-describe-function'." t nil)
 Hypertext drop-in replacement for `describe-variable'.
 See also `hyper-apropos' and `hyper-describe-function'." t nil)
 
-(autoload 'hyper-where-is "hyper-apropos" "\
-Print message listing key sequences that invoke specified command." t nil)
-
 (autoload 'hyper-describe-function "hyper-apropos" "\
 Hypertext replacement for `describe-function'.  Unlike `describe-function'
 in that the symbol under the cursor is the default if it is a function.
@@ -1215,42 +1204,7 @@ Install a pre-bytecompiled XEmacs package into package hierarchy." t nil)
 
 ;;;***
 \f
-;;;### (autoloads (package-get-custom package-get-package-provider package-get package-get-dependencies package-get-all package-get-update-all package-get-delete-package package-get-save-base package-get-update-base-from-buffer package-get-update-base package-get-update-base-entry package-get-require-base package-get-download-menu) "package-get" "lisp/package-get.el")
-
-(autoload 'package-get-download-menu "package-get" "\
-Build the `Add Download Site' menu." nil nil)
-
-(autoload 'package-get-require-base "package-get" "\
-Require that a package-get database has been loaded.
-If the optional FORCE-CURRENT argument or the value of
-`package-get-always-update' is Non-nil, try to update the database
-from a location in `package-get-remote'. Otherwise a local copy is used
-if available and remote access is never done.
-
-Please use FORCE-CURRENT only when the user is explictly dealing with packages
-and remote access is likely in the near future." nil nil)
-
-(autoload 'package-get-update-base-entry "package-get" "\
-Update an entry in `package-get-base'." nil nil)
-
-(autoload 'package-get-update-base "package-get" "\
-Update the package-get database file with entries from DB-FILE.
-Unless FORCE-CURRENT is non-nil never try to update the database." t nil)
-
-(autoload 'package-get-update-base-from-buffer "package-get" "\
-Update the package-get database with entries from BUFFER.
-BUFFER defaults to the current buffer.  This command can be
-used interactively, for example from a mail or news buffer." t nil)
-
-(autoload 'package-get-save-base "package-get" "\
-Write the package-get database to FILE.
-
-Note: This database will be unsigned of course." t nil)
-
-(autoload 'package-get-delete-package "package-get" "\
-Delete an installation of PACKAGE below directory PKG-TOPDIR.
-PACKAGE is a symbol, not a string.
-This is just an interactive wrapper for `package-admin-delete-binary-package'." t nil)
+;;;### (autoloads (package-get-custom package-get-package-provider package-get package-get-all package-get-update-all) "package-get" "lisp/package-get.el")
 
 (autoload 'package-get-update-all "package-get" "\
 Fetch and install the latest versions of all currently installed packages." t nil)
@@ -1260,17 +1214,7 @@ Fetch PACKAGE with VERSION and all other required packages.
 Uses `package-get-base' to determine just what is required and what
 package provides that functionality.  If VERSION is nil, retrieves
 latest version.  Optional argument FETCHED-PACKAGES is used to keep
-track of packages already fetched.  Optional argument INSTALL-DIR,
-if non-nil, specifies the package directory where fetched packages
-should be installed.
-
-Returns nil upon error." t nil)
-
-(autoload 'package-get-dependencies "package-get" "\
-Compute dependencies for PACKAGES.
-Uses `package-get-base' to determine just what is required and what
-package provides that functionality.  Returns the list of packages
-required by PACKAGES." nil nil)
+track of packages already fetched." t nil)
 
 (autoload 'package-get "package-get" "\
 Fetch PACKAGE from remote site.
@@ -1279,8 +1223,6 @@ means most recent version.  CONFLICT indicates what happens if the
 package is already installed.  Valid values for CONFLICT are:
 'always        always retrieve the package even if it is already installed
 'never do not retrieve the package if it is installed.
-INSTALL-DIR, if non-nil, specifies the package directory where
-fetched packages should be installed.
 
 The value of `package-get-base' is used to determine what files should 
 be retrieved.  The value of `package-get-remote' is used to determine
@@ -1289,48 +1231,19 @@ order so one is better off listing easily reached sites first.
 
 Once the package is retrieved, its md5 checksum is computed.  If that
 sum does not match that stored in `package-get-base' for this version
-of the package, an error is signalled.
-
-Returns `t' upon success, the symbol `error' if the package was
-successfully installed but errors occurred during initialization, or
-`nil' upon error." t nil)
+of the package, an error is signalled." t nil)
 
 (autoload 'package-get-package-provider "package-get" "\
 Search for a package that provides SYM and return the name and
   version.  Searches in `package-get-base' for SYM.   If SYM is a
   consp, then it must match a corresponding (provide (SYM VERSION)) from 
-  the package.
-
-If FORCE-CURRENT is non-nil make sure the database is up to date. This might
-lead to Emacs accessing remote sites." t nil)
+  the package." t nil)
 
 (autoload 'package-get-custom "package-get" "\
 Fetch and install the latest versions of all customized packages." t nil)
 
 ;;;***
 \f
-;;;### (autoloads (pui-list-packages pui-add-install-directory package-ui-add-site) "package-ui" "lisp/package-ui.el")
-
-(autoload 'package-ui-add-site "package-ui" "\
-Add site to package-get-remote and possibly offer to update package list." nil nil)
-
-(autoload 'pui-add-install-directory "package-ui" "\
-Add a new package binary directory to the head of `package-get-remote'.
-Note that no provision is made for saving any changes made by this function.
-It exists mainly as a convenience for one-time package installations from
-disk." t nil)
-
-(autoload 'pui-list-packages "package-ui" "\
-List all packages and package information.
-The package name, version, and description are displayed.  From the displayed
-buffer, the user can see which packages are installed, which are not, and
-which are out-of-date (a newer version is available).  The user can then
-select packages for installation via the keyboard or mouse." t nil)
-
-(defalias 'list-packages 'pui-list-packages)
-
-;;;***
-\f
 ;;;### (autoloads (picture-mode) "picture" "lisp/picture.el")
 
 (autoload 'picture-mode "picture" "\
@@ -1658,17 +1571,5 @@ or if you change your font path, you can call this to re-initialize the menus."
 (autoload 'font-menu-weight-constructor "x-font-menu" nil nil nil)
 
 ;;;***
-\f
-;;;### (autoloads (x-win-init-sun) "x-win-sun" "lisp/x-win-sun.el")
-
-(autoload 'x-win-init-sun "x-win-sun" nil nil nil)
-
-;;;***
-\f
-;;;### (autoloads (x-win-init-xfree86) "x-win-xfree86" "lisp/x-win-xfree86.el")
-
-(autoload 'x-win-init-xfree86 "x-win-xfree86" nil nil nil)
-
-;;;***
 
 (provide 'Standard-autoloads)
index 5340162..95bce46 100644 (file)
@@ -9,7 +9,7 @@
 
 ;; Subsequently modified by RMS and others.
 
-(defconst byte-compile-version (purecopy  "2.26 XEmacs; 1998-10-07."))
+(defconst byte-compile-version (purecopy  "2.25 XEmacs; 22-Mar-96."))
 
 ;; This file is part of XEmacs.
 
 ;;;                            'unresolved (calls to unknown functions)
 ;;;                            'callargs  (lambda calls with args that don't
 ;;;                                        match the lambda's definition)
-;;;                            'subr-callargs (calls to subrs with args that
-;;;                                        don't match the subr's definition)
 ;;;                            'redefine  (function cell redefined from
 ;;;                                        a macro to a lambda or vice versa,
 ;;;                                        or redefined to take other args)
 ;;;     buffer, and that buffer is modified, you are asked whether you want
 ;;;     to save the buffer before compiling.
 ;;;
-;;;  o  You can add this to /etc/magic to make file(1) recognize the files
+;;;  o  You can add this to /etc/magic to make file(1) recognise the files
 ;;;     generated by this compiler:
 ;;;
 ;;;      0     string          ;ELC            GNU Emacs Lisp compiled file,
 be hard-coded into bytecomp when it compiles itself.  If the compiler itself
 is compiled with optimization, this causes a speedup.")
 
-  (cond
-   (byte-compile-single-version
-    (defmacro byte-compile-single-version () t)
-    (defmacro byte-compile-version-cond (cond) (list 'quote (eval cond))))
-   (t
-    (defmacro byte-compile-single-version () nil)
-    (defmacro byte-compile-version-cond (cond) cond)))
+  (cond (byte-compile-single-version
+        (defmacro byte-compile-single-version () t)
+        (defmacro byte-compile-version-cond (cond) (list 'quote (eval cond))))
+       (t
+        (defmacro byte-compile-single-version () nil)
+        (defmacro byte-compile-version-cond (cond) cond)))
   )
 
-(defvar emacs-lisp-file-regexp (purecopy "\\.el$")
+(defvar emacs-lisp-file-regexp (if (eq system-type 'vax-vms)
+                                  (purecopy "\\.EL\\(;[0-9]+\\)?$")
+                                (purecopy "\\.el$"))
   "*Regexp which matches Emacs Lisp source files.
 You may want to redefine `byte-compile-dest-file' if you change this.")
 
@@ -235,16 +234,18 @@ You may want to redefine `byte-compile-dest-file' if you change this.")
        (funcall handler 'byte-compiler-base-file-name filename)
       filename)))
 
-(unless (fboundp 'byte-compile-dest-file)
-  ;; The user may want to redefine this along with emacs-lisp-file-regexp,
-  ;; so only define it if it is undefined.
-  (defun byte-compile-dest-file (filename)
-    "Convert an Emacs Lisp source file name to a compiled file name."
-    (setq filename (byte-compiler-base-file-name filename))
-    (setq filename (file-name-sans-versions filename))
-    (if (string-match emacs-lisp-file-regexp filename)
-       (concat (substring filename 0 (match-beginning 0)) ".elc")
-      (concat filename ".elc"))))
+(or (fboundp 'byte-compile-dest-file)
+    ;; The user may want to redefine this along with emacs-lisp-file-regexp,
+    ;; so only define it if it is undefined.
+    (defun byte-compile-dest-file (filename)
+      "Convert an Emacs Lisp source file name to a compiled file name."
+      (setq filename (byte-compiler-base-file-name filename))
+      (setq filename (file-name-sans-versions filename))
+      (cond ((eq system-type 'vax-vms)
+                (concat (substring filename 0 (string-match ";" filename)) "c"))
+               ((string-match emacs-lisp-file-regexp filename)
+                (concat (substring filename 0 (match-beginning 0)) ".elc"))
+               (t (concat filename ".elc")))))
 
 ;; This can be the 'byte-compile property of any symbol.
 (autoload 'byte-compile-inline-expand "byte-optimize")
@@ -259,7 +260,7 @@ You may want to redefine `byte-compile-dest-file' if you change this.")
 ;; disassembler.  The disassembler just requires 'byte-compile, but
 ;; that doesn't define this function, so this seems to be a reasonable
 ;; thing to do.
-(autoload 'byte-decompile-bytecode "byte-optimize")
+(autoload 'byte-decompile-bytecode "byte-opt")
 
 (defvar byte-compile-verbose
   (and (not noninteractive) (> (device-baud-rate) search-slow-speed))
@@ -349,7 +350,7 @@ If it is 'byte, then only byte-level optimizations will be logged.")
 
 ;; byte-compile-warning-types in FSF.
 (defvar byte-compile-default-warnings
-  '(redefine callargs subr-callargs free-vars unresolved unused-vars obsolete)
+  '(redefine callargs free-vars unresolved unused-vars obsolete)
   "*The warnings used when byte-compile-warnings is t.")
 
 (defvar byte-compile-warnings t
@@ -360,7 +361,6 @@ Elements of the list may be:
   unused-vars  references to non-global variables bound but not referenced.
   unresolved   calls to unknown functions.
   callargs     lambda calls with args that don't match the definition.
-  subr-callargs        calls to subrs with args that don't match the definition.
   redefine     function cell redefined from a macro to a lambda or vice
                versa, or redefined to take a different number of arguments.
   obsolete     use of an obsolete function or variable.
@@ -373,7 +373,7 @@ See also the macro `byte-compiler-options'.")
 
 (defvar byte-compile-generate-call-tree nil
   "*Non-nil means collect call-graph information when compiling.
-This records functions that were called and from where.
+This records functions were called and from where.
 If the value is t, compilation displays the call graph when it finishes.
 If the value is neither t nor nil, compilation asks you whether to display
 the graph.
@@ -432,7 +432,6 @@ on the specbind stack.  The cdr of each cell is an integer bitmask.")
 
 (defvar byte-compile-free-references)
 (defvar byte-compile-free-assignments)
-(defvar debug-issue-ebola-notices)
 
 (defvar byte-compiler-error-flag)
 
@@ -621,7 +620,7 @@ Each element is (INDEX . VALUE)")
   "to examine top-of-stack, jump and don't pop it if it's nil,
 otherwise pop it")
 (byte-defop 134 -1 byte-goto-if-not-nil-else-pop
-  "to examine top-of-stack, jump and don't pop it if it's non-nil,
+  "to examine top-of-stack, jump and don't pop it if it's non nil,
 otherwise pop it")
 
 (byte-defop 135 -1 byte-return "to pop a value and return it from `byte-code'")
@@ -771,13 +770,13 @@ otherwise pop it")
             (error "Non-symbolic opcode `%s'" op))
            ((eq op 'TAG)
             (setcar off pc)
-            (push off patchlist))
+            (setq patchlist (cons off patchlist)))
            ((memq op byte-goto-ops)
             (setq pc (+ pc 3))
             (setq bytes (cons (cons pc (cdr off))
                               (cons nil
                                     (cons (symbol-value op) bytes))))
-            (push bytes patchlist))
+            (setq patchlist (cons bytes patchlist)))
            (t
             (setq bytes
                   (cond ((cond ((consp off)
@@ -860,64 +859,81 @@ otherwise pop it")
 (defvar byte-compile-dest-file nil)
 
 (defmacro byte-compile-log (format-string &rest args)
-  `(when (and byte-optimize (memq byte-optimize-log '(t source)))
-      (let ((print-escape-newlines t)
-           (print-level 4)
-           (print-length 4))
-       (byte-compile-log-1 (format ,format-string ,@args)))))
-
-(defconst byte-compile-last-warned-form 'nothing)
+  (list 'and
+       'byte-optimize
+       '(memq byte-optimize-log '(t source))
+       (list 'let '((print-escape-newlines t)
+                    (print-level 4)
+                    (print-length 4))
+             (list 'byte-compile-log-1
+                   (cons 'format
+                     (cons format-string
+                       (mapcar
+                        '(lambda (x)
+                           (if (symbolp x) (list 'prin1-to-string x) x))
+                        args)))))))
+
+(defconst byte-compile-last-warned-form nil)
 
 ;; Log a message STRING in *Compile-Log*.
 ;; Also log the current function and file if not already done.
 (defun byte-compile-log-1 (string &optional fill)
-  (let* ((this-form (or byte-compile-current-form "toplevel forms"))
-        (while-compiling-msg
-         (when (or byte-compile-current-file
-                   (not (eq this-form byte-compile-last-warned-form)))
-           (format
-            "While compiling %s%s:"
-            this-form
-            (cond
-             ((stringp byte-compile-current-file)
-              (concat " in file " byte-compile-current-file))
-             ((bufferp byte-compile-current-file)
-              (concat " in buffer "
-                      (buffer-name byte-compile-current-file)))
-             (""))))))
-    (if noninteractive
-       (progn
-         (when while-compiling-msg (message "%s" while-compiling-msg))
-         (message "  %s" string))
-      (with-current-buffer (get-buffer-create "*Compile-Log*")
+  (let ((this-form (or byte-compile-current-form "toplevel forms")))
+    (cond
+     (noninteractive
+      (if (or byte-compile-current-file
+             (and byte-compile-last-warned-form
+                  (not (eq this-form byte-compile-last-warned-form))))
+         (message
+          (format "While compiling %s%s:"
+                  this-form
+                  (if byte-compile-current-file
+                      (if (stringp byte-compile-current-file)
+                          (concat " in file " byte-compile-current-file)
+                        (concat " in buffer "
+                                (buffer-name byte-compile-current-file)))
+                    ""))))
+      (message "  %s" string))
+     (t
+      (save-excursion
+       (set-buffer (get-buffer-create "*Compile-Log*"))
        (goto-char (point-max))
-       (when byte-compile-current-file
-         (when (> (point-max) (point-min))
-           (insert "\n\^L\n"))
-         (insert (current-time-string) "\n"))
-       (when while-compiling-msg (insert while-compiling-msg "\n"))
+       (cond ((or byte-compile-current-file
+                  (and byte-compile-last-warned-form
+                       (not (eq this-form byte-compile-last-warned-form))))
+              (if byte-compile-current-file
+                  (insert "\n\^L\n" (current-time-string) "\n"))
+              (insert "While compiling "
+                      (if (stringp this-form) this-form
+                        (format "%s" this-form)))
+              (if byte-compile-current-file
+                  (if (stringp byte-compile-current-file)
+                      (insert " in file " byte-compile-current-file)
+                    (insert " in buffer "
+                            (buffer-name byte-compile-current-file))))
+              (insert ":\n")))
        (insert "  " string "\n")
-       (when (and fill (not (string-match "\n" string)))
-         (let ((fill-prefix "     ")
-               (fill-column 78))
-           (fill-paragraph nil)))))
-    (setq byte-compile-current-file nil)
-    (setq byte-compile-last-warned-form this-form)))
+       (if (and fill (not (string-match "\n" string)))
+           (let ((fill-prefix "     ")
+                 (fill-column 78))
+             (fill-paragraph nil)))
+       )))
+    (setq byte-compile-current-file nil
+         byte-compile-last-warned-form this-form)))
 
 ;; Log the start of a file in *Compile-Log*, and mark it as done.
 ;; But do nothing in batch mode.
 (defun byte-compile-log-file ()
-  (when (and byte-compile-current-file (not noninteractive))
-    (with-current-buffer (get-buffer-create "*Compile-Log*")
-      (when (> (point-max) (point-min))
-       (goto-char (point-max))
-       (insert "\n\^L\n"))
-      (insert "Compiling "
-             (if (stringp byte-compile-current-file)
-                 (concat "file " byte-compile-current-file)
-               (concat "buffer " (buffer-name byte-compile-current-file)))
-             " at " (current-time-string) "\n")
-      (setq byte-compile-current-file nil))))
+  (and byte-compile-current-file (not noninteractive)
+       (save-excursion
+        (set-buffer (get-buffer-create "*Compile-Log*"))
+        (goto-char (point-max))
+        (insert "\n\^L\nCompiling "
+                (if (stringp byte-compile-current-file)
+                    (concat "file " byte-compile-current-file)
+                  (concat "buffer " (buffer-name byte-compile-current-file)))
+                " at " (current-time-string) "\n")
+        (setq byte-compile-current-file nil))))
 
 (defun byte-compile-warn (format &rest args)
   (setq format (apply 'format format args))
@@ -971,7 +987,7 @@ otherwise pop it")
     (verbose byte-compile-verbose (t nil) val)
     (new-bytecodes byte-compile-new-bytecodes (t nil) val)
     (warnings byte-compile-warnings
-             ((callargs subr-callargs redefine free-vars unused-vars unresolved))
+             ((callargs redefine free-vars unused-vars unresolved))
              val)))
 
 ;; XEmacs addition
@@ -1209,7 +1225,7 @@ otherwise pop it")
   nil)
 
 (defun byte-compile-defvar-p (var)
-  ;; Whether the byte compiler thinks that non-lexical references to this
+  ;; Whether the byte compiler thinks that nonexical references to this
   ;; variable are ok.
   (or (globally-boundp var)
       (let ((rest byte-compile-bound-variables))
@@ -1241,7 +1257,7 @@ otherwise pop it")
               ;; have (declare (ignore x)) yet; and second, inline
               ;; expansion produces forms like
               ;;   ((lambda (arg) (byte-code "..." [arg])) x)
-              ;; which we can't (ok, well, don't) recognize as
+              ;; which we can't (ok, well, don't) recognise as
               ;; containing a reference to arg, so every inline
               ;; expansion would generate a warning.  (If we had
               ;; `ignore' then inline expansion could emit an
@@ -1259,14 +1275,12 @@ otherwise pop it")
       (setq unreferenced (cdr unreferenced)))))
 
 \f
-(defmacro byte-compile-constant-symbol-p (symbol)
-  `(or (keywordp ,symbol) (memq ,symbol '(nil t))))
-
 (defmacro byte-compile-constp (form)
   ;; Returns non-nil if FORM is a constant.
-  `(cond ((consp ,form) (eq (car ,form) 'quote))
-        ((symbolp ,form) (byte-compile-constant-symbol-p ,form))
-        (t)))
+  (` (cond ((consp (, form)) (eq (car (, form)) 'quote))
+          ((not (symbolp (, form))))
+          ((keywordp (, form)))
+          ((memq (, form) '(nil t))))))
 
 (defmacro byte-compile-close-variables (&rest body)
   `(let
@@ -1299,9 +1313,6 @@ otherwise pop it")
                                   byte-compile-default-warnings
                                 byte-compile-warnings))
        (byte-compile-file-domain nil)
-
-       ;; We reserve the right to compare ANY objects for equality.
-       (debug-issue-ebola-notices -42)
        )
      (prog1
         (progn ,@body)
@@ -1310,49 +1321,46 @@ otherwise pop it")
           (byte-compile-warn-about-unused-variables)))))
 
 
+(defvar byte-compile-warnings-point-max nil)
 (defmacro displaying-byte-compile-warnings (&rest body)
-  `(let* ((byte-compile-log-buffer (get-buffer-create "*Compile-Log*"))
-         (byte-compile-point-max-prev (point-max byte-compile-log-buffer)))
-     ;; Log the file name or buffer name.
+  `(let ((byte-compile-warnings-point-max byte-compile-warnings-point-max))
+     ;; Log the file name.
      (byte-compile-log-file)
      ;; Record how much is logged now.
      ;; We will display the log buffer if anything more is logged
      ;; before the end of BODY.
-     (defvar byte-compile-warnings-beginning)
-     (let ((byte-compile-warnings-beginning
-           (if (boundp 'byte-compile-warnings-beginning)
-               byte-compile-warnings-beginning
-             (point-max byte-compile-log-buffer))))
-
-       (unwind-protect
-          (condition-case error-info
-              (progn ,@body)
-            (error
-             (byte-compile-report-error error-info)))
-
-        ;; Always set point in log to start of interesting output.
-        (with-current-buffer byte-compile-log-buffer
-          (let ((show-begin
-                 (progn (goto-char byte-compile-point-max-prev)
-                        (skip-chars-forward "\^L\n")
-                        (point))))
-            ;; If there were compilation warnings, display them.
-            (if temp-buffer-show-function
-                (let ((show-buffer (get-buffer-create "*Compile-Log-Show*")))
-                  ;; Always clean show-buffer, even when not displaying it,
-                  ;; so that misleading previous messages aren't left around.
-                  (with-current-buffer show-buffer
-                    (setq buffer-read-only nil)
-                    (erase-buffer))
-                  (copy-to-buffer show-buffer show-begin (point-max))
-                  (when (< byte-compile-warnings-beginning (point-max))
-                    (funcall temp-buffer-show-function show-buffer)))
-              (when (< byte-compile-warnings-beginning (point-max))
-                (select-window
-                 (prog1 (selected-window)
-                   (select-window (display-buffer (current-buffer)))
-                   (goto-char show-begin)
-                   (recenter 1)))))))))))
+     (or byte-compile-warnings-point-max
+        (save-excursion
+          (set-buffer (get-buffer-create "*Compile-Log*"))
+          (setq byte-compile-warnings-point-max (point-max))))
+     (unwind-protect
+        (condition-case error-info
+            (progn ,@body)
+          (error
+           (byte-compile-report-error error-info)))
+       (save-excursion
+        ;; If there were compilation warnings, display them.
+        (set-buffer "*Compile-Log*")
+        (if (= byte-compile-warnings-point-max (point-max))
+            nil
+          (if temp-buffer-show-function
+              (let ((show-buffer (get-buffer-create "*Compile-Log-Show*")))
+                (save-excursion
+                  (set-buffer show-buffer)
+                  (setq buffer-read-only nil)
+                  (erase-buffer))
+                (copy-to-buffer show-buffer
+                                (save-excursion
+                                  (goto-char byte-compile-warnings-point-max)
+                                  (forward-line -1)
+                                  (point))
+                                (point-max))
+                (funcall temp-buffer-show-function show-buffer))
+              (select-window
+               (prog1 (selected-window)
+                 (select-window (display-buffer (current-buffer)))
+                 (goto-char byte-compile-warnings-point-max)
+                 (recenter 1)))))))))
 
 \f
 ;;;###autoload
@@ -1458,6 +1466,8 @@ whether to compile it.  Prefix argument 0 don't ask and recompile anyway."
                        (y-or-n-p (concat "Compile " filename "? "))))))
        (byte-compile-file filename))))
 
+(defvar kanji-flag nil)
+
 ;;;###autoload
 (defun byte-compile-file (filename &optional load)
   "Compile a file of Lisp code named FILENAME into a file of byte code.
@@ -1493,6 +1503,7 @@ With prefix arg (noninteractively: 2nd arg), load the file after compiling."
       (message "Compiling %s..." filename))
   (let (;;(byte-compile-current-file (file-name-nondirectory filename))
        (byte-compile-current-file filename)
+       (debug-issue-ebola-notices 0) ; Hack -slb
        target-file input-buffer output-buffer
        byte-compile-dest-file)
     (setq target-file (byte-compile-dest-file filename))
@@ -1523,26 +1534,28 @@ With prefix arg (noninteractively: 2nd arg), load the file after compiling."
        (set-buffer output-buffer)
        (goto-char (point-max))
        (insert "\n")                   ; aaah, unix.
-       (setq target-file (byte-compile-dest-file filename))
-       (unless byte-compile-overwrite-file
-         (ignore-file-errors (delete-file target-file)))
-       (if (file-writable-p target-file)
-           (progn
-             (when (memq system-type '(ms-dos windows-nt))
-               (defvar buffer-file-type)
-               (setq buffer-file-type t))
-             (write-region 1 (point-max) target-file))
-         ;; This is just to give a better error message than write-region
-         (signal 'file-error
-                 (list "Opening output file"
-                       (if (file-exists-p target-file)
-                           "cannot overwrite file"
-                         "directory not writable or nonexistent")
-                       target-file)))
-       (or byte-compile-overwrite-file
-           (condition-case ()
-               (set-file-modes target-file (file-modes filename))
-             (error nil)))
+       (let ((vms-stmlf-recfm t))
+         (setq target-file (byte-compile-dest-file filename))
+         (or byte-compile-overwrite-file
+             (condition-case ()
+                 (delete-file target-file)
+               (error nil)))
+         (if (file-writable-p target-file)
+             (let ((kanji-flag nil))   ; for nemacs, from Nakagawa Takayuki
+               (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
+                   (setq buffer-file-type t))
+               (write-region 1 (point-max) target-file))
+           ;; This is just to give a better error message than write-region
+           (signal 'file-error
+                   (list "Opening output file"
+                         (if (file-exists-p target-file)
+                             "cannot overwrite file"
+                           "directory not writable or nonexistent")
+                         target-file)))
+         (or byte-compile-overwrite-file
+             (condition-case ()
+                 (set-file-modes target-file (file-modes filename))
+               (error nil))))
        (kill-buffer (current-buffer)))
       (if (and byte-compile-generate-call-tree
               (or (eq t byte-compile-generate-call-tree)
@@ -1651,7 +1664,7 @@ With argument, insert value in current buffer after the form."
 
        ;; Compile the forms from the input buffer.
        (while (progn
-                (while (progn (skip-chars-forward " \t\n\^L")
+                (while (progn (skip-chars-forward " \t\n\^l")
                               (looking-at ";"))
                   (forward-line 1))
                 (not (eobp)))
@@ -1754,26 +1767,25 @@ With argument, insert value in current buffer after the form."
   ;; extended characters are output properly and distinguished properly.
   ;; Otherwise, use `no-conversion' for maximum portability with non-Mule
   ;; Emacsen.
-  (when (featurep 'mule)
-    (defvar buffer-file-coding-system)
-    (if (save-excursion
+  (if (featurep 'mule)
+      (if (save-excursion
+           (set-buffer byte-compile-inbuffer)
+           (goto-char (point-min))
+           ;; mrb- There must be a better way than skip-chars-forward
+           (skip-chars-forward (concat (char-to-string 0) "-"
+                                       (char-to-string 255)))
+           (eq (point) (point-max)))
+         (setq buffer-file-coding-system 'no-conversion)
+       (insert "(require 'mule)\n;;;###coding system: escape-quoted\n")
+       (setq buffer-file-coding-system 'escape-quoted)
+       ;; Lazy loading not yet implemented for MULE files
+       ;; mrb - Fix this someday.
+       (save-excursion
          (set-buffer byte-compile-inbuffer)
-         (goto-char (point-min))
-         ;; mrb- There must be a better way than skip-chars-forward
-         (skip-chars-forward (concat (char-to-string 0) "-"
-                                     (char-to-string 255)))
-         (eq (point) (point-max)))
-       (setq buffer-file-coding-system 'no-conversion)
-      (insert "(require 'mule)\n;;;###coding system: escape-quoted\n")
-      (setq buffer-file-coding-system 'escape-quoted)
-      ;; #### Lazy loading not yet implemented for MULE files
-      ;; mrb - Fix this someday.
-      (save-excursion
-       (set-buffer byte-compile-inbuffer)
-       (setq byte-compile-dynamic nil
-             byte-compile-dynamic-docstrings nil))
-      ;;(external-debugging-output (prin1-to-string (buffer-local-variables))))
-      ))
+         (setq byte-compile-dynamic nil
+               byte-compile-dynamic-docstrings nil))
+       ;;(external-debugging-output (prin1-to-string (buffer-local-variables))))
+       ))
   )
 
 
@@ -1892,8 +1904,8 @@ list that represents a doc string reference.
             (nthcdr 300 byte-compile-output)
             (byte-compile-flush-pending))
        (funcall handler form)
-       (when for-effect
-         (byte-compile-discard)))
+       (if for-effect
+           (byte-compile-discard)))
     (byte-compile-form form t))
   nil)
 
@@ -1927,7 +1939,7 @@ list that represents a doc string reference.
       (byte-compile-file-form form)))))
 
 ;; Functions and variables with doc strings must be output separately,
-;; so make-docfile can recognize them.  Most other things can be output
+;; so make-docfile can recognise them.  Most other things can be output
 ;; as byte-code.
 
 (put 'defsubst 'byte-hunk-handler 'byte-compile-file-form-defsubst)
@@ -2094,32 +2106,32 @@ list that represents a doc string reference.
                  (cons (list name nil nil) byte-compile-call-tree))))
 
     (setq byte-compile-current-form name) ; for warnings
-    (when (memq 'redefine byte-compile-warnings)
-      (byte-compile-arglist-warn form macrop))
-    (defvar filename) ; #### filename used free
-    (when byte-compile-verbose
-      (message "Compiling %s... (%s)"
-              (if filename (file-name-nondirectory filename) "")
-              (nth 1 form)))
+    (if (memq 'redefine byte-compile-warnings)
+       (byte-compile-arglist-warn form macrop))
+    (if byte-compile-verbose
+       (message "Compiling %s... (%s)"
+                ;; #### filename used free
+                (if filename (file-name-nondirectory filename) "")
+                (nth 1 form)))
     (cond (that-one
-          (when (and (memq 'redefine byte-compile-warnings)
-                     ;; hack hack: don't warn when compiling the stubs in
-                     ;; bytecomp-runtime...
-                     (not (assq (nth 1 form)
-                                byte-compile-initial-macro-environment)))
-            (byte-compile-warn
-             "%s defined multiple times, as both function and macro"
-             (nth 1 form)))
+          (if (and (memq 'redefine byte-compile-warnings)
+                   ;; hack hack: don't warn when compiling the stubs in
+                   ;; bytecomp-runtime...
+                   (not (assq (nth 1 form)
+                              byte-compile-initial-macro-environment)))
+              (byte-compile-warn
+                "%s defined multiple times, as both function and macro"
+                (nth 1 form)))
           (setcdr that-one nil))
          (this-one
-          (when (and (memq 'redefine byte-compile-warnings)
-                     ;; hack: don't warn when compiling the magic internal
-                     ;; byte-compiler macros in bytecomp-runtime.el...
-                     (not (assq (nth 1 form)
-                                byte-compile-initial-macro-environment)))
-            (byte-compile-warn "%s %s defined multiple times in this file"
-                               (if macrop "macro" "function")
-                               (nth 1 form))))
+          (if (and (memq 'redefine byte-compile-warnings)
+                   ;; hack: don't warn when compiling the magic internal
+                   ;; byte-compiler macros in bytecomp-runtime.el...
+                   (not (assq (nth 1 form)
+                              byte-compile-initial-macro-environment)))
+              (byte-compile-warn "%s %s defined multiple times in this file"
+                                 (if macrop "macro" "function")
+                                 (nth 1 form))))
          ((and (fboundp name)
                (or (subrp (symbol-function name))
                    (eq (car-safe (symbol-function name))
@@ -2133,7 +2145,8 @@ list that represents a doc string reference.
                                  (if macrop "macro" "function")))
           ;; shadow existing definition
           (set this-kind
-               (cons (cons name nil) (symbol-value this-kind)))))
+               (cons (cons name nil) (symbol-value this-kind))))
+         )
     (let ((body (nthcdr 3 form)))
       (if (and (stringp (car body))
               (symbolp (car-safe (cdr-safe body)))
@@ -2332,11 +2345,11 @@ If FORM is a lambda or a macro, byte-compile it as a function."
          (let* ((interactive (assq 'interactive (cdr (cdr fun)))))
            (nconc (list 'make-byte-code
                         (list 'quote (nth 1 fun)) ;arglist
-                        (nth 1 tmp)    ;instructions
-                        (nth 2 tmp)    ;constants
-                        (nth 3 tmp))   ;stack-depth
+                        (nth 1 tmp)    ;bytes
+                        (nth 2 tmp)    ;consts
+                        (nth 3 tmp))   ;depth
                   (cond ((stringp (nth 2 fun))
-                         (list (nth 2 fun))) ;docstring
+                         (list (nth 2 fun))) ;doc
                         (interactive
                          (list nil)))
                   (cond (interactive
@@ -2358,7 +2371,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
   (let* ((arglist (nth 1 fun))
         (byte-compile-bound-variables
          (let ((new-bindings
-                (mapcar #'(lambda (x) (cons x byte-compile-arglist-bit))
+                (mapcar (function (lambda (x)
+                                    (cons x byte-compile-arglist-bit)))
                         (and (memq 'free-vars byte-compile-warnings)
                              (delq '&rest (delq '&optional
                                                 (copy-sequence arglist)))))))
@@ -2369,16 +2383,18 @@ If FORM is a lambda or a macro, byte-compile it as a function."
                  (prog1 (car body)
                    (setq body (cdr body)))))
         (int (assq 'interactive body)))
-    (dolist (arg arglist)
-      (cond ((not (symbolp arg))
-            (byte-compile-warn "non-symbol in arglist: %S" arg))
-           ((byte-compile-constant-symbol-p arg)
-            (byte-compile-warn "constant symbol in arglist: %s" arg))
-           ((and (char= ?\& (aref (symbol-name arg) 0))
-                 (not (eq arg '&optional))
-                 (not (eq arg '&rest)))
-            (byte-compile-warn "unrecognized `&' keyword in arglist: %s"
-                               arg))))
+    (let ((rest arglist))
+      (while rest
+       (cond ((not (symbolp (car rest)))
+              (byte-compile-warn "non-symbol in arglist: %s"
+                                 (prin1-to-string (car rest))))
+             ((memq (car rest) '(t nil))
+              (byte-compile-warn "constant in arglist: %s" (car rest)))
+             ((and (char= ?\& (aref (symbol-name (car rest)) 0))
+                   (not (memq (car rest) '(&optional &rest))))
+              (byte-compile-warn "unrecognised `&' keyword in arglist: %s"
+                                 (car rest))))
+       (setq rest (cdr rest))))
     (cond (int
           ;; Skip (interactive) if it is in front (the most usual location).
           (if (eq int (car body))
@@ -2539,7 +2555,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
                     (if (if (eq (car (car rest)) 'byte-constant)
                             (or (consp tmp)
                                 (and (symbolp tmp)
-                                     (not (byte-compile-constant-symbol-p tmp)))))
+                                     (not (keywordp tmp))
+                                     (not (memq tmp '(nil t))))))
                         (if maycall
                             (setq body (cons (list 'quote tmp) body)))
                       (setq body (cons tmp body))))
@@ -2589,7 +2606,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 ;; This is the recursive entry point for compiling each subform of an
 ;; expression.
 ;; If for-effect is non-nil, byte-compile-form will output a byte-discard
-;; before terminating (ie. no value will be left on the stack).
+;; before terminating (ie no value will be left on the stack).
 ;; A byte-compile handler may, when for-effect is non-nil, choose output code
 ;; which does not leave a value on the stack, and then set for-effect to nil
 ;; (to prevent byte-compile-form from outputting the byte-discard).
@@ -2600,8 +2617,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 (defun byte-compile-form (form &optional for-effect)
   (setq form (macroexpand form byte-compile-macro-environment))
   (cond ((not (consp form))
-        (cond ((or (not (symbolp form))
-                   (byte-compile-constant-symbol-p form))
+        ;; XEmacs addition: keywordp
+        (cond ((or (not (symbolp form)) (keywordp form) (memq form '(nil t)))
                (byte-compile-constant form))
               ((and for-effect byte-compile-delete-errors)
                (setq for-effect nil))
@@ -2627,8 +2644,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
         (byte-compile-form form for-effect)
         (setq for-effect nil))
        ((byte-compile-normal-call form)))
-  (when for-effect
-    (byte-compile-discard)))
+  (if for-effect
+      (byte-compile-discard)))
 
 (defun byte-compile-normal-call (form)
   (if byte-compile-generate-call-tree
@@ -2641,14 +2658,12 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 (or (fboundp 'globally-boundp) (fset 'globally-boundp 'boundp))
 
 (defun byte-compile-variable-ref (base-op var &optional varbind-flags)
-  (if (or (not (symbolp var)) (byte-compile-constant-symbol-p var))
-      (byte-compile-warn
-       (case base-op
-        (byte-varref "Variable reference to %s %s")
-        (byte-varset "Attempt to set %s %s")
-        (byte-varbind "Attempt to let-bind %s %s"))
-       (if (symbolp var) "constant symbol" "non-symbol")
-       var)
+  (if (or (not (symbolp var)) (keywordp var) (memq var '(nil t)))
+      (byte-compile-warn (if (eq base-op 'byte-varbind)
+                            "Attempt to let-bind %s %s"
+                          "Variable reference to %s %s")
+                        (if (symbolp var) "constant" "nonvariable")
+                        (prin1-to-string var))
     (if (and (get var 'byte-obsolete-variable)
             (memq 'obsolete byte-compile-warnings))
        (let ((ob (get var 'byte-obsolete-variable)))
@@ -2694,11 +2709,11 @@ If FORM is a lambda or a macro, byte-compile it as a function."
     (byte-compile-out base-op tmp)))
 
 (defmacro byte-compile-get-constant (const)
-  `(or (if (stringp ,const)
-          (assoc ,const byte-compile-constants)
-        (assq ,const byte-compile-constants))
-       (car (setq byte-compile-constants
-                 (cons (list ,const) byte-compile-constants)))))
+  (` (or (if (stringp (, const))
+            (assoc (, const) byte-compile-constants)
+          (assq (, const) byte-compile-constants))
+        (car (setq byte-compile-constants
+                   (cons (list (, const)) byte-compile-constants))))))
 
 ;; Use this when the value of a form is a constant.  This obeys for-effect.
 (defun byte-compile-constant (const)
@@ -2879,6 +2894,12 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 (byte-defop-compiler20 old-memq                2)
 (byte-defop-compiler cons              2)
 (byte-defop-compiler aref              2)
+(byte-defop-compiler (= byte-eqlsign)  byte-compile-one-or-more-args)
+(byte-defop-compiler (< byte-lss)      byte-compile-one-or-more-args)
+(byte-defop-compiler (> byte-gtr)      byte-compile-one-or-more-args)
+(byte-defop-compiler (<= byte-leq)     byte-compile-one-or-more-args)
+(byte-defop-compiler (>= byte-geq)     byte-compile-one-or-more-args)
+(byte-defop-compiler /=                        byte-compile-/=)
 (byte-defop-compiler get               2+1)
 (byte-defop-compiler nth               2)
 (byte-defop-compiler substring         2-3)
@@ -2901,6 +2922,9 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 (byte-defop-compiler (rplacd byte-setcdr) 2)
 (byte-defop-compiler setcar            2)
 (byte-defop-compiler setcdr            2)
+;; buffer-substring now has its own function.  This used to be
+;; 2+1, but now all args are optional.
+(byte-defop-compiler buffer-substring)
 (byte-defop-compiler delete-region     2+1)
 (byte-defop-compiler narrow-to-region  2+1)
 (byte-defop-compiler (% byte-rem)      2)
@@ -2930,56 +2954,55 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 
 \f
 (defun byte-compile-subr-wrong-args (form n)
-  (when (memq 'subr-callargs byte-compile-warnings)
-    (byte-compile-warn "%s called with %d arg%s, but requires %s"
-                      (car form) (length (cdr form))
-                      (if (= 1 (length (cdr form))) "" "s") n))
+  (byte-compile-warn "%s called with %d arg%s, but requires %s"
+                    (car form) (length (cdr form))
+                    (if (= 1 (length (cdr form))) "" "s") n)
   ;; get run-time wrong-number-of-args error.
   (byte-compile-normal-call form))
 
 (defun byte-compile-no-args (form)
-  (case (length (cdr form))
-    (0 (byte-compile-out (get (car form) 'byte-opcode) 0))
-    (t (byte-compile-subr-wrong-args form "none"))))
+  (if (not (= (length form) 1))
+      (byte-compile-subr-wrong-args form "none")
+    (byte-compile-out (get (car form) 'byte-opcode) 0)))
 
 (defun byte-compile-one-arg (form)
-  (case (length (cdr form))
-    (1 (byte-compile-form (car (cdr form)))  ;; Push the argument
-       (byte-compile-out (get (car form) 'byte-opcode) 0))
-    (t (byte-compile-subr-wrong-args form 1))))
+  (if (not (= (length form) 2))
+      (byte-compile-subr-wrong-args form 1)
+    (byte-compile-form (car (cdr form)))  ;; Push the argument
+    (byte-compile-out (get (car form) 'byte-opcode) 0)))
 
 (defun byte-compile-two-args (form)
-  (case (length (cdr form))
-    (2 (byte-compile-form (nth 1 form))  ;; Push the arguments
-       (byte-compile-form (nth 2 form))
-       (byte-compile-out (get (car form) 'byte-opcode) 0))
-    (t (byte-compile-subr-wrong-args form 2))))
+  (if (not (= (length form) 3))
+      (byte-compile-subr-wrong-args form 2)
+    (byte-compile-form (car (cdr form)))  ;; Push the arguments
+    (byte-compile-form (nth 2 form))
+    (byte-compile-out (get (car form) 'byte-opcode) 0)))
 
 (defun byte-compile-three-args (form)
-  (case (length (cdr form))
-    (3 (byte-compile-form (nth 1 form))  ;; Push the arguments
-       (byte-compile-form (nth 2 form))
-       (byte-compile-form (nth 3 form))
-       (byte-compile-out (get (car form) 'byte-opcode) 0))
-    (t (byte-compile-subr-wrong-args form 3))))
+  (if (not (= (length form) 4))
+      (byte-compile-subr-wrong-args form 3)
+    (byte-compile-form (car (cdr form)))  ;; Push the arguments
+    (byte-compile-form (nth 2 form))
+    (byte-compile-form (nth 3 form))
+    (byte-compile-out (get (car form) 'byte-opcode) 0)))
 
 (defun byte-compile-zero-or-one-arg (form)
-  (case (length (cdr form))
-    (0 (byte-compile-one-arg (append form '(nil))))
-    (1 (byte-compile-one-arg form))
-    (t (byte-compile-subr-wrong-args form "0-1"))))
+  (let ((len (length form)))
+    (cond ((= len 1) (byte-compile-one-arg (append form '(nil))))
+         ((= len 2) (byte-compile-one-arg form))
+         (t (byte-compile-subr-wrong-args form "0-1")))))
 
 (defun byte-compile-one-or-two-args (form)
-  (case (length (cdr form))
-    (1 (byte-compile-two-args (append form '(nil))))
-    (2 (byte-compile-two-args form))
-    (t (byte-compile-subr-wrong-args form "1-2"))))
+  (let ((len (length form)))
+    (cond ((= len 2) (byte-compile-two-args (append form '(nil))))
+         ((= len 3) (byte-compile-two-args form))
+         (t (byte-compile-subr-wrong-args form "1-2")))))
 
 (defun byte-compile-two-or-three-args (form)
-  (case (length (cdr form))
-    (2 (byte-compile-three-args (append form '(nil))))
-    (3 (byte-compile-three-args form))
-    (t (byte-compile-subr-wrong-args form "2-3"))))
+  (let ((len (length form)))
+    (cond ((= len 3) (byte-compile-three-args (append form '(nil))))
+         ((= len 4) (byte-compile-three-args form))
+         (t (byte-compile-subr-wrong-args form "2-3")))))
 
 ;; from Ben Wing <ben@xemacs.org>: some inlined functions have extra
 ;; optional args added to them in XEmacs 19.12.  Changing the byte
@@ -2990,55 +3013,55 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 ;; `byte-compile-subr-wrong-args' also converts the call to non-inlined.
 
 (defun byte-compile-no-args-with-one-extra (form)
-  (case (length (cdr form))
-    (0 (byte-compile-no-args form))
-    (1 (byte-compile-normal-call form))
-    (t (byte-compile-subr-wrong-args form "0-1"))))
+  (let ((len (length form)))
+    (cond ((= len 1) (byte-compile-no-args form))
+         ((= len 2) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "0-1")))))
 
 (defun byte-compile-one-arg-with-one-extra (form)
-  (case (length (cdr form))
-    (1 (byte-compile-one-arg form))
-    (2 (byte-compile-normal-call form))
-    (t (byte-compile-subr-wrong-args form "1-2"))))
+  (let ((len (length form)))
+    (cond ((= len 2) (byte-compile-one-arg form))
+         ((= len 3) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "1-2")))))
 
 (defun byte-compile-two-args-with-one-extra (form)
-  (case (length (cdr form))
-    (2 (byte-compile-two-args form))
-    (3 (byte-compile-normal-call form))
-    (t (byte-compile-subr-wrong-args form "2-3"))))
+  (let ((len (length form)))
+    (cond ((= len 3) (byte-compile-two-args form))
+         ((= len 4) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "2-3")))))
 
 (defun byte-compile-zero-or-one-arg-with-one-extra (form)
-  (case (length (cdr form))
-    (0 (byte-compile-one-arg (append form '(nil))))
-    (1 (byte-compile-one-arg form))
-    (2 (byte-compile-normal-call form))
-    (t (byte-compile-subr-wrong-args form "0-2"))))
+  (let ((len (length form)))
+    (cond ((= len 1) (byte-compile-one-arg (append form '(nil))))
+         ((= len 2) (byte-compile-one-arg form))
+         ((= len 3) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "0-2")))))
 
 (defun byte-compile-one-or-two-args-with-one-extra (form)
-  (case (length (cdr form))
-    (1 (byte-compile-two-args (append form '(nil))))
-    (2 (byte-compile-two-args form))
-    (3 (byte-compile-normal-call form))
-    (t (byte-compile-subr-wrong-args form "1-3"))))
+  (let ((len (length form)))
+    (cond ((= len 2) (byte-compile-two-args (append form '(nil))))
+         ((= len 3) (byte-compile-two-args form))
+         ((= len 4) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "1-3")))))
 
 (defun byte-compile-two-or-three-args-with-one-extra (form)
-  (case (length (cdr form))
-    (2 (byte-compile-three-args (append form '(nil))))
-    (3 (byte-compile-three-args form))
-    (4 (byte-compile-normal-call form))
-    (t (byte-compile-subr-wrong-args form "2-4"))))
+  (let ((len (length form)))
+    (cond ((= len 3) (byte-compile-three-args (append form '(nil))))
+         ((= len 4) (byte-compile-three-args form))
+         ((= len 5) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "2-4")))))
 
 (defun byte-compile-no-args-with-two-extra (form)
-  (case (length (cdr form))
-    (0     (byte-compile-no-args form))
-    ((1 2) (byte-compile-normal-call form))
-    (t     (byte-compile-subr-wrong-args form "0-2"))))
+  (let ((len (length form)))
+    (cond ((= len 1) (byte-compile-no-args form))
+         ((or (= len 2) (= len 3)) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "0-2")))))
 
 (defun byte-compile-one-arg-with-two-extra (form)
-  (case (length (cdr form))
-    (1     (byte-compile-one-arg form))
-    ((2 3) (byte-compile-normal-call form))
-    (t     (byte-compile-subr-wrong-args form "1-3"))))
+  (let ((len (length form)))
+    (cond ((= len 2) (byte-compile-one-arg form))
+         ((or (= len 3) (= len 4)) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "1-3")))))
 
 ;; XEmacs: used for functions that have a different opcode in v19 than v20.
 ;; this includes `eq', `equal', and other old-ified functions.
@@ -3057,33 +3080,21 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 (defun byte-compile-discard ()
   (byte-compile-out 'byte-discard 0))
 
-;; Compile a function that accepts one or more args and is right-associative.
-;; We do it by left-associativity so that the operations
-;; are done in the same order as in interpreted code.
-;(defun byte-compile-associative (form)
-;  (if (cdr form)
-;      (let ((opcode (get (car form) 'byte-opcode))
-;          (args (copy-sequence (cdr form))))
-;      (byte-compile-form (car args))
-;      (setq args (cdr args))
-;      (while args
-;        (byte-compile-form (car args))
-;        (byte-compile-out opcode 0)
-;        (setq args (cdr args))))
-;    (byte-compile-constant (eval form))))
 
 ;; Compile a function that accepts one or more args and is right-associative.
 ;; We do it by left-associativity so that the operations
 ;; are done in the same order as in interpreted code.
 (defun byte-compile-associative (form)
-  (let ((args (cdr form))
-       (opcode (get (car form) 'byte-opcode)))
-    (case (length args)
-      (0 (byte-compile-constant (eval form)))
-      (t (byte-compile-form (car args))
-        (dolist (arg (cdr args))
-          (byte-compile-form arg)
-          (byte-compile-out opcode 0))))))
+  (if (cdr form)
+      (let ((opcode (get (car form) 'byte-opcode))
+           (args (copy-sequence (cdr form))))
+       (byte-compile-form (car args))
+       (setq args (cdr args))
+       (while args
+         (byte-compile-form (car args))
+         (byte-compile-out opcode 0)
+         (setq args (cdr args))))
+    (byte-compile-constant (eval form))))
 
 \f
 ;; more complicated compiler macros
@@ -3098,110 +3109,92 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 (byte-defop-compiler nconc)
 (byte-defop-compiler-1 beginning-of-line)
 
-(byte-defop-compiler (=  byte-eqlsign) byte-compile-arithcompare)
-(byte-defop-compiler (<  byte-lss)     byte-compile-arithcompare)
-(byte-defop-compiler (>  byte-gtr)     byte-compile-arithcompare)
-(byte-defop-compiler (<= byte-leq)     byte-compile-arithcompare)
-(byte-defop-compiler (>= byte-geq)     byte-compile-arithcompare)
-
-(defun byte-compile-arithcompare (form)
-  (case (length (cdr form))
-    (0 (byte-compile-subr-wrong-args form "1 or more"))
-    (1 (byte-compile-constant t))
-    (2 (byte-compile-two-args form))
-    (t (byte-compile-normal-call form))))
-
-(byte-defop-compiler /= byte-compile-/=)
+(defun byte-compile-one-or-more-args (form)
+  (let ((len (length form)))
+    (cond ((= len 1) (byte-compile-subr-wrong-args form "1 or more"))
+         ((= len 2) (byte-compile-constant t))
+         ((= len 3) (byte-compile-two-args form))
+         (t (byte-compile-normal-call form)))))
 
 (defun byte-compile-/= (form)
-  (case (length (cdr form))
-    (0 (byte-compile-subr-wrong-args form "1 or more"))
-    (1 (byte-compile-constant t))
-    ;; optimize (/= X Y) to (not (= X Y))
-    (2 (byte-compile-form-do-effect `(not (= ,@(cdr form)))))
-    (t (byte-compile-normal-call form))))
-
-;; buffer-substring now has its own function.  This used to be
-;; 2+1, but now all args are optional.
-(byte-defop-compiler buffer-substring)
+  (let ((len (length form)))
+    (cond ((= len 1) (byte-compile-subr-wrong-args form "1 or more"))
+         ((= len 2) (byte-compile-constant t))
+         ;; optimize (/= X Y) to (not (= X Y))
+         ((= len 3) (byte-compile-form-do-effect `(not (= ,@(cdr form)))))
+         (t (byte-compile-normal-call form)))))
 
 (defun byte-compile-buffer-substring (form)
-  ;; buffer-substring used to take exactly two args, but now takes 0-3.
-  ;; convert 0-2 to two args and use special bytecode operand.
-  ;; convert 3 args to a normal call.
-  (case (length (cdr form))
-    (0 (byte-compile-two-args (append form '(nil nil))))
-    (1 (byte-compile-two-args (append form '(nil))))
-    (2 (byte-compile-two-args form))
-    (3 (byte-compile-normal-call form))
-    (t (byte-compile-subr-wrong-args form "0-3"))))
+  (let ((len (length form)))
+    ;; buffer-substring used to take exactly two args, but now takes 0-3.
+    ;; convert 0-2 to two args and use special bytecode operand.
+    ;; convert 3 args to a normal call.
+    (cond ((= len 1) (setq form (append form '(nil nil)))
+          (= len 2) (setq form (append form '(nil)))))
+    (cond ((= len 3) (byte-compile-two-args form))
+         ((= len 4) (byte-compile-normal-call form))
+         (t (byte-compile-subr-wrong-args form "0-3")))))
 
 (defun byte-compile-list (form)
-  (let* ((args (cdr form))
-        (nargs (length args)))
-    (cond
-     ((= nargs 0)
-      (byte-compile-constant nil))
-     ((< nargs 5)
-      (mapcar 'byte-compile-form args)
-      (byte-compile-out
-       (aref [byte-list1 byte-list2 byte-list3 byte-list4] (1- nargs))
-       0))
-     ((< nargs 256)
-      (mapcar 'byte-compile-form args)
-      (byte-compile-out 'byte-listN nargs))
-     (t (byte-compile-normal-call form)))))
+  (let ((count (length (cdr form))))
+    (cond ((= count 0)
+          (byte-compile-constant nil))
+         ((< count 5)
+          (mapcar 'byte-compile-form (cdr form))
+          (byte-compile-out
+           (aref [byte-list1 byte-list2 byte-list3 byte-list4] (1- count)) 0))
+         ((< count 256)
+          (mapcar 'byte-compile-form (cdr form))
+          (byte-compile-out 'byte-listN count))
+         (t (byte-compile-normal-call form)))))
 
 (defun byte-compile-concat (form)
-  (let* ((args (cdr form))
-        (nargs (length args)))
-    ;; Concat of one arg is not a no-op if arg is not a string.
-    (cond
-     ((memq nargs '(2 3 4))
-      (mapcar 'byte-compile-form args)
-      (byte-compile-out
-       (aref [byte-concat2 byte-concat3 byte-concat4] (- nargs 2))
-       0))
-     ((eq nargs 0)
-      (byte-compile-form ""))
-     ((< nargs 256)
-      (mapcar 'byte-compile-form args)
-      (byte-compile-out 'byte-concatN nargs))
-     ((byte-compile-normal-call form)))))
+  (let ((count (length (cdr form))))
+    (cond ((and (< 1 count) (< count 5))
+          (mapcar 'byte-compile-form (cdr form))
+          (byte-compile-out
+           (aref [byte-concat2 byte-concat3 byte-concat4] (- count 2))
+           0))
+         ;; Concat of one arg is not a no-op if arg is not a string.
+         ((= count 0)
+          (byte-compile-form ""))
+         ((< count 256)
+          (mapcar 'byte-compile-form (cdr form))
+          (byte-compile-out 'byte-concatN count))
+         ((byte-compile-normal-call form)))))
 
 (defun byte-compile-minus (form)
-  (let ((args (cdr form)))
-    (case (length args)
-      (0 (byte-compile-subr-wrong-args form "1 or more"))
-      (1 (byte-compile-form (car args))
-        (byte-compile-out 'byte-negate 0))
-      (t (byte-compile-form (car args))
-        (dolist (elt (cdr args))
-          (byte-compile-form elt)
-          (byte-compile-out 'byte-diff 0))))))
+  (if (null (setq form (cdr form)))
+      (byte-compile-constant 0)
+    (byte-compile-form (car form))
+    (if (cdr form)
+       (while (setq form (cdr form))
+         (byte-compile-form (car form))
+         (byte-compile-out 'byte-diff 0))
+      (byte-compile-out 'byte-negate 0))))
 
 (defun byte-compile-quo (form)
-  (let ((args (cdr form)))
-    (case (length args)
-      (0 (byte-compile-subr-wrong-args form "1 or more"))
-      (1 (byte-compile-constant 1)
-        (byte-compile-form (car args))
-        (byte-compile-out 'byte-quo 0))
-      (t (byte-compile-form (car args))
-        (dolist (elt (cdr args))
-          (byte-compile-form elt)
-          (byte-compile-out 'byte-quo 0))))))
+  (let ((len (length form)))
+    (cond ((<= len 2)
+          (byte-compile-subr-wrong-args form "2 or more"))
+         (t
+          (byte-compile-form (car (setq form (cdr form))))
+          (while (setq form (cdr form))
+            (byte-compile-form (car form))
+            (byte-compile-out 'byte-quo 0))))))
 
 (defun byte-compile-nconc (form)
-  (let ((args (cdr form)))
-    (case (length args)
-      (0 (byte-compile-constant nil))
-      ;; nconc of one arg is a noop, even if that arg isn't a list.
-      (1 (byte-compile-form (car args)))
-      (t (byte-compile-form (car args))
-        (dolist (elt (cdr args))
-          (byte-compile-form elt)
-          (byte-compile-out 'byte-nconc 0))))))
+  (let ((len (length form)))
+    (cond ((= len 1)
+          (byte-compile-constant nil))
+         ((= len 2)
+          ;; nconc of one arg is a noop, even if that arg isn't a list.
+          (byte-compile-form (nth 1 form)))
+         (t
+          (byte-compile-form (car (setq form (cdr form))))
+          (while (setq form (cdr form))
+            (byte-compile-form (car form))
+            (byte-compile-out 'byte-nconc 0))))))
 
 (defun byte-compile-fset (form)
   ;; warn about forms like (fset 'foo '(lambda () ...))
@@ -3210,18 +3203,19 @@ If FORM is a lambda or a macro, byte-compile it as a function."
   ;; I'm sick of getting mail asking me whether that warning is a problem.
   (let ((fn (nth 2 form))
        body)
-    (when (and (eq (car-safe fn) 'quote)
-              (eq (car-safe (setq fn (nth 1 fn))) 'lambda)
-              (not (eq (car-safe (cdr-safe (nth 1 form))) 'make-byte-code)))
-      (setq body (cdr (cdr fn)))
-      (if (stringp (car body)) (setq body (cdr body)))
-      (if (eq 'interactive (car-safe (car body))) (setq body (cdr body)))
-      (if (and (consp (car body))
-              (not (eq 'byte-code (car (car body)))))
-         (byte-compile-warn
-    "A quoted lambda form is the second argument of fset.  This is probably
+    (if (and (eq (car-safe fn) 'quote)
+            (eq (car-safe (setq fn (nth 1 fn))) 'lambda)
+            (not (eq (car-safe (cdr-safe (nth 1 form))) 'make-byte-code)))
+       (progn
+         (setq body (cdr (cdr fn)))
+         (if (stringp (car body)) (setq body (cdr body)))
+         (if (eq 'interactive (car-safe (car body))) (setq body (cdr body)))
+         (if (and (consp (car body))
+                  (not (eq 'byte-code (car (car body)))))
+             (byte-compile-warn
+      "A quoted lambda form is the second argument of fset.  This is probably
      not what you want, as that lambda cannot be compiled.  Consider using
-     the syntax (function (lambda (...) ...)) instead."))))
+     the syntax (function (lambda (...) ...)) instead.")))))
   (byte-compile-two-args form))
 
 (defun byte-compile-funarg (form)
@@ -3261,8 +3255,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
         (while (setq form (cdr form))
           (byte-compile-form (car form))
           (byte-compile-out 'byte-insert 0)
-          (when (cdr form)
-            (byte-compile-discard))))))
+          (if (cdr form)
+              (byte-compile-discard))))))
 
 ;; alas, the old (pre-19.12, and all existing versions of FSFmacs 19)
 ;; byte compiler will generate incorrect code for
@@ -3296,82 +3290,76 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 (byte-defop-compiler-1 quote-form)
 
 (defun byte-compile-setq (form)
-  (let ((args (cdr form)) var val)
-    (if (null args)
-       ;; (setq), with no arguments.
-       (byte-compile-form nil for-effect)
-      (while args
-       (setq var (pop args))
-       (if (null args)
-           ;; Odd number of args?  Let `set' get the error.
-           (byte-compile-form `(set ',var) for-effect)
-         (setq val (pop args))
-         (if (keywordp var)
-             ;; (setq :foo ':foo) compatibility kludge
-             (byte-compile-form `(set ',var ,val) (if args t for-effect))
-           (byte-compile-form val)
-           (unless (or args for-effect)
+  (let ((args (cdr form)))
+    (if args
+       (while args
+         (byte-compile-form (car (cdr args)))
+         (or for-effect (cdr (cdr args))
              (byte-compile-out 'byte-dup 0))
-           (byte-compile-variable-ref 'byte-varset var))))))
-  (setq for-effect nil))
+         (byte-compile-variable-ref 'byte-varset (car args))
+         (setq args (cdr (cdr args))))
+      ;; (setq), with no arguments.
+      (byte-compile-form nil for-effect))
+    (setq for-effect nil)))
 
 (defun byte-compile-set (form)
   ;; Compile (set 'foo x) as (setq foo x) for trivially better code and so
   ;; that we get applicable warnings.  Compile everything else (including
   ;; malformed calls) like a normal 2-arg byte-coded function.
-  (let ((symform (nth 1 form))
-       (valform (nth 2 form))
-       sym)
-    (if (and (= (length form) 3)
-            (= (safe-length symform) 2)
-            (eq (car symform) 'quote)
-            (symbolp (setq sym (car (cdr symform))))
-            (not (byte-compile-constant-symbol-p sym)))
-       (byte-compile-setq `(setq ,sym ,valform))
-      (byte-compile-two-args form))))
+  (if (or (not (eq (car-safe (nth 1 form)) 'quote))
+         (not (= (length form) 3))
+         (not (= (length (nth 1 form)) 2)))
+      (byte-compile-two-args form)
+    (byte-compile-setq (list 'setq (nth 1 (nth 1 form)) (nth 2 form)))))
 
 (defun byte-compile-setq-default (form)
-  (let ((args (cdr form)))
-    (if (null args)
-       ;; (setq-default), with no arguments.
-       (byte-compile-form nil for-effect)
-      ;; emit multiple calls to `set-default' if necessary
-      (while args
-       (byte-compile-form
-        ;; Odd number of args?  Let `set-default' get the error.
-        `(set-default ',(pop args) ,@(if args (list (pop args)) nil))
-        (if args t for-effect)))))
-  (setq for-effect nil))
-
+  (let ((rest (cdr form)))
+    ;; emit multiple calls to set-default if necessary
+    (while rest
+      (byte-compile-form
+       (list 'set-default (list 'quote (car rest)) (car (cdr rest)))
+       (not (null (cdr (cdr rest)))))
+      (setq rest (cdr (cdr rest))))))
 
 (defun byte-compile-set-default (form)
-  (let* ((args (cdr form))
-        (nargs (length args))
-        (var (car args)))
-    (when (and (= (safe-length var) 2)
-              (eq (car var) 'quote))
-      (let ((sym (nth 1 var)))
-       (cond
-        ((not (symbolp sym))
-         (byte-compile-warn "Attempt to set-globally non-symbol %s" sym))
-        ((byte-compile-constant-symbol-p sym)
-         (byte-compile-warn "Attempt to set-globally constant symbol %s" sym))
-        ((let ((cell (assq sym byte-compile-bound-variables)))
-           (and cell
-                (setcdr cell (logior (cdr cell) byte-compile-assigned-bit))
-                t)))
-        ;; notice calls to set-default/setq-default for variables which
-        ;; have not been declared with defvar/defconst.
-        ((globally-boundp sym))        ; OK
-        ((not (memq 'free-vars byte-compile-warnings))) ; warnings suppressed?
-        ((memq sym byte-compile-free-assignments)) ; already warned about sym
-        (t
-         (byte-compile-warn "assignment to free variable %s" sym)
-         (push sym byte-compile-free-assignments)))))
-    (if (= nargs 2)
-       ;; now emit a normal call to set-default
-       (byte-compile-normal-call form)
-      (byte-compile-subr-wrong-args form 2))))
+  (let ((rest (cdr form)))
+    (if (cdr (cdr (cdr form)))
+       ;; emit multiple calls to set-default if necessary; all but last
+       ;; for-effect (this recurses.)
+       (while rest
+         (byte-compile-form
+          (list 'set-default (car rest) (car (cdr rest)))
+          (not (null (cdr rest))))
+         (setq rest (cdr (cdr rest))))
+      ;; else, this is the one-armed version
+      (let ((var (nth 1 form))
+           ;;(val (nth 2 form))
+           )
+       ;; notice calls to set-default/setq-default for variables which
+       ;; have not been declared with defvar/defconst.
+       (if (and (memq 'free-vars byte-compile-warnings)
+                (or (null var)
+                    (and (eq (car-safe var) 'quote)
+                         (= 2 (length var)))))
+           (let ((sym (nth 1 var))
+                 cell)
+             (or (and sym (symbolp sym) (globally-boundp sym))
+                 (and (setq cell (assq sym byte-compile-bound-variables))
+                      (setcdr cell (logior (cdr cell)
+                                           byte-compile-assigned-bit)))
+                 (memq sym byte-compile-free-assignments)
+                 (if (or (not (symbolp sym)) (memq sym '(t nil)))
+                     (progn
+                       (byte-compile-warn
+                        "Attempt to set-globally %s %s"
+                        (if (symbolp sym) "constant" "nonvariable")
+                        (prin1-to-string sym)))
+                   (progn
+                     (byte-compile-warn "assignment to free variable %s" sym)
+                     (setq byte-compile-free-assignments
+                           (cons sym byte-compile-free-assignments)))))))
+       ;; now emit a normal call to set-default (or possibly multiple calls)
+       (byte-compile-normal-call form)))))
 
 
 (defun byte-compile-quote (form)
@@ -3420,22 +3408,20 @@ If FORM is a lambda or a macro, byte-compile it as a function."
   (byte-compile-body-do-effect (cdr form)))
 
 (defun byte-compile-prog1 (form)
-  (setq form (cdr form))
-  (byte-compile-form-do-effect (pop form))
-  (byte-compile-body form t))
+  (byte-compile-form-do-effect (car (cdr form)))
+  (byte-compile-body (cdr (cdr form)) t))
 
 (defun byte-compile-prog2 (form)
-  (setq form (cdr form))
-  (byte-compile-form (pop form) t)
-  (byte-compile-form-do-effect (pop form))
-  (byte-compile-body form t))
+  (byte-compile-form (nth 1 form) t)
+  (byte-compile-form-do-effect (nth 2 form))
+  (byte-compile-body (cdr (cdr (cdr form))) t))
 
 (defmacro byte-compile-goto-if (cond discard tag)
-  `(byte-compile-goto
-    (if ,cond
-       (if ,discard 'byte-goto-if-not-nil 'byte-goto-if-not-nil-else-pop)
-      (if ,discard 'byte-goto-if-nil 'byte-goto-if-nil-else-pop))
-    ,tag))
+  (` (byte-compile-goto
+      (if (, cond)
+         (if (, discard) 'byte-goto-if-not-nil 'byte-goto-if-not-nil-else-pop)
+       (if (, discard) 'byte-goto-if-nil 'byte-goto-if-nil-else-pop))
+      (, tag))))
 
 (defun byte-compile-if (form)
   (byte-compile-form (car (cdr form)))
@@ -3841,7 +3827,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 
 
 (defun byte-compile-out-tag (tag)
-  (push tag byte-compile-output)
+  (setq byte-compile-output (cons tag byte-compile-output))
   (if (cdr (cdr tag))
       (progn
        ;; ## remove this someday
@@ -3852,7 +3838,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
     (setcdr (cdr tag) byte-compile-depth)))
 
 (defun byte-compile-goto (opcode tag)
-  (push (cons opcode tag) byte-compile-output)
+  (setq byte-compile-output (cons (cons opcode tag) byte-compile-output))
   (setcdr (cdr tag) (if (memq opcode byte-goto-always-pop-ops)
                        (1- byte-compile-depth)
                      byte-compile-depth))
@@ -3860,21 +3846,20 @@ If FORM is a lambda or a macro, byte-compile it as a function."
                                (1- byte-compile-depth))))
 
 (defun byte-compile-out (opcode offset)
-  (push (cons opcode offset) byte-compile-output)
-  (case opcode
-    (byte-call
-     (setq byte-compile-depth (- byte-compile-depth offset)))
-    (byte-return
-     ;; This is actually an unnecessary case, because there should be
-     ;; no more opcodes behind byte-return.
-     (setq byte-compile-depth nil))
-    (t
-     (setq byte-compile-depth (+ byte-compile-depth
-                                (or (aref byte-stack+-info
-                                          (symbol-value opcode))
-                                    (- (1- offset))))
-          byte-compile-maxdepth (max byte-compile-depth
-                                     byte-compile-maxdepth))))
+  (setq byte-compile-output (cons (cons opcode offset) byte-compile-output))
+  (cond ((eq opcode 'byte-call)
+        (setq byte-compile-depth (- byte-compile-depth offset)))
+       ((eq opcode 'byte-return)
+        ;; This is actually an unnecessary case, because there should be
+        ;; no more opcodes behind byte-return.
+        (setq byte-compile-depth nil))
+       (t
+        (setq byte-compile-depth (+ byte-compile-depth
+                                    (or (aref byte-stack+-info
+                                              (symbol-value opcode))
+                                        (- (1- offset))))
+              byte-compile-maxdepth (max byte-compile-depth
+                                         byte-compile-maxdepth))))
   ;;(if (< byte-compile-depth 0) (error "Compiler error: stack underflow"))
   )
 
@@ -3888,15 +3873,18 @@ If FORM is a lambda or a macro, byte-compile it as a function."
        (or (memq byte-compile-current-form (nth 1 entry)) ;callers
            (setcar (cdr entry)
                    (cons byte-compile-current-form (nth 1 entry))))
-      (push (list (car form) (list byte-compile-current-form) nil)
-           byte-compile-call-tree))
+      (setq byte-compile-call-tree
+           (cons (list (car form) (list byte-compile-current-form) nil)
+                 byte-compile-call-tree)))
     ;; annotate the current function
     (if (setq entry (assq byte-compile-current-form byte-compile-call-tree))
        (or (memq (car form) (nth 2 entry)) ;called
            (setcar (cdr (cdr entry))
                    (cons (car form) (nth 2 entry))))
-      (push (list byte-compile-current-form nil (list (car form)))
-           byte-compile-call-tree))))
+      (setq byte-compile-call-tree
+           (cons (list byte-compile-current-form nil (list (car form)))
+                 byte-compile-call-tree)))
+    ))
 
 ;; Renamed from byte-compile-report-call-tree
 ;; to avoid interfering with completion of byte-compile-file.
@@ -3935,19 +3923,19 @@ invoked interactively."
              (sort byte-compile-call-tree
                    (cond
                     ((eq byte-compile-call-tree-sort 'callers)
-                     #'(lambda (x y) (< (length (nth 1 x))
-                                        (length (nth 1 y)))))
+                     (function (lambda (x y) (< (length (nth 1 x))
+                                                (length (nth 1 y))))))
                     ((eq byte-compile-call-tree-sort 'calls)
-                     #'(lambda (x y) (< (length (nth 2 x))
-                                        (length (nth 2 y)))))
+                     (function (lambda (x y) (< (length (nth 2 x))
+                                                (length (nth 2 y))))))
                     ((eq byte-compile-call-tree-sort 'calls+callers)
-                     #'(lambda (x y) (< (+ (length (nth 1 x))
-                                           (length (nth 2 x)))
-                                        (+ (length (nth 1 y))
-                                           (length (nth 2 y))))))
+                     (function (lambda (x y) (< (+ (length (nth 1 x))
+                                                   (length (nth 2 x)))
+                                                (+ (length (nth 1 y))
+                                                   (length (nth 2 y)))))))
                     ((eq byte-compile-call-tree-sort 'name)
-                     #'(lambda (x y) (string< (car x)
-                                              (car y))))
+                     (function (lambda (x y) (string< (car x)
+                                                      (car y)))))
                     (t (error
                      "`byte-compile-call-tree-sort': `%s' - unknown sort mode"
                               byte-compile-call-tree-sort))))))
@@ -4043,7 +4031,8 @@ For example, invoke \"xemacs -batch -f batch-byte-compile $emacs/ ~/*.el\""
   (defvar command-line-args-left)      ;Avoid 'free variable' warning
   (if (not noninteractive)
       (error "`batch-byte-compile' is to be used only with -batch"))
-  (let ((error nil))
+  (let ((error nil)
+       (debug-issue-ebola-notices 0)) ; Hack -slb
     (while command-line-args-left
       (if (file-directory-p (expand-file-name (car command-line-args-left)))
          (let ((files (directory-files (car command-line-args-left)))
@@ -4076,7 +4065,7 @@ For example, invoke \"xemacs -batch -f batch-byte-compile $emacs/ ~/*.el\""
      (if (fboundp 'display-error) ; XEmacs 19.8+
         (display-error err nil)
        (princ (or (get (car err) 'error-message) (car err)))
-       (mapcar #'(lambda (x) (princ " ") (prin1 x)) (cdr err)))
+       (mapcar '(lambda (x) (princ " ") (prin1 x)) (cdr err)))
      (princ "\n")
      nil)))
 
@@ -4097,7 +4086,8 @@ For example, invoke `xemacs -batch -f batch-byte-recompile-directory .'."
       (error "batch-byte-recompile-directory is to be used only with -batch"))
   (or command-line-args-left
       (setq command-line-args-left '(".")))
-  (let ((byte-recompile-directory-ignore-errors-p t))
+  (let ((byte-recompile-directory-ignore-errors-p t)
+       (debug-issue-ebola-notices 0))
     (while command-line-args-left
       (byte-recompile-directory (car command-line-args-left))
       (setq command-line-args-left (cdr command-line-args-left))))
@@ -4150,10 +4140,10 @@ For example, invoke `xemacs -batch -f batch-byte-recompile-directory .'."
      (assq 'byte-code (symbol-function 'byte-compile-form))
      (let ((byte-optimize nil) ; do it fast
           (byte-compile-warnings nil))
-       (mapcar #'(lambda (x)
-                  (or noninteractive (message "compiling %s..." x))
-                  (byte-compile x)
-                  (or noninteractive (message "compiling %s...done" x)))
+       (mapcar '(lambda (x)
+                 (or noninteractive (message "compiling %s..." x))
+                 (byte-compile x)
+                 (or noninteractive (message "compiling %s...done" x)))
               '(byte-compile-normal-call
                 byte-compile-form
                 byte-compile-body
index 44c3135..d4da910 100644 (file)
 (custom-add-loads 'drag-n-drop '("dragdrop"))
 (custom-add-loads 'mouse '("mouse" "mwheel"))
 (custom-add-loads 'etags '("etags"))
-(custom-add-loads 'package-tools '("package-get" "package-ui"))
 (custom-add-loads 'widgets '("wid-browse" "wid-edit"))
 (custom-add-loads 'menu '("menubar-items"))
 (custom-add-loads 'minibuffer '("simple" "minibuf"))
 (custom-add-loads 'log-message '("simple"))
 (custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "x-init" "toolbar-items" "cus-edit" "gnuserv" "sound"))
 (custom-add-loads 'sound '("sound"))
-(custom-add-loads 'pui '("package-ui"))
 (custom-add-loads 'terminals '("gnuserv"))
 (custom-add-loads 'auto-save '("files" "auto-save"))
 (custom-add-loads 'mail '("simple"))
@@ -48,7 +46,6 @@
 (custom-add-loads 'toolbar '("toolbar-items"))
 (custom-add-loads 'dired '("files"))
 (custom-add-loads 'dnd-debug '("dragdrop"))
-(custom-add-loads 'package-get '("package-get"))
 (custom-add-loads 'killing '("simple"))
 (custom-add-loads 'widget-button '("wid-edit"))
 (custom-add-loads 'paren-blinking '("simple"))
@@ -75,7 +72,7 @@
 (custom-add-loads 'isearch '("isearch-mode"))
 (custom-add-loads 'font-lock-faces '("font-lock"))
 (custom-add-loads 'modeline '("modeline"))
-(custom-add-loads 'editing '("simple" "abbrev" "fill" "mouse" "cus-edit" "dragdrop"))
+(custom-add-loads 'editing '("simple" "abbrev" "fill" "mouse" "dragdrop" "cus-edit"))
 (custom-add-loads 'matching '("simple" "isearch-mode" "hyper-apropos"))
 (custom-add-loads 'i18n '("cus-edit"))
 (custom-add-loads 'info '("toolbar-items" "info"))
index 10117d5..81e4de3 100644 (file)
                                             late-package-load-path
                                             '()
                                             lisp-directory
-                                            site-directory))
-
-  (setq module-directory (paths-find-module-directory roots))
-  (if debug-paths
-      (princ (format "module-directory:\n%S\n" module-directory)
-            'external-debugging-output))
-  (setq site-module-directory (and (null inhibit-site-modules)
-                           (paths-find-site-module-directory roots)))
-  (if (and debug-paths (null inhibit-site-modules))
-      (princ (format "site-module-directory:\n%S\n" site-module-directory)
-            'external-debugging-output))
-
-  (setq module-load-path (paths-construct-module-load-path roots
-                                                        module-directory
-                                                        site-module-directory)))
+                                            site-directory)))
 
 ;;; dump-paths.el ends here
index fd4585a..591648d 100644 (file)
@@ -76,7 +76,8 @@ and FROM the name it is linked to."
                       (regexp :tag "To")))
   :group 'find-file)
 
-(defcustom make-backup-files t
+;;; Turn off backup files on VMS since it has version numbers.
+(defcustom make-backup-files (not (eq system-type 'vax-vms))
   "*Non-nil means make a backup of a file the first time it is saved.
 This can be done by renaming the file or by copying.
 
@@ -413,7 +414,8 @@ of the same functionality is available as `split-path', which see."
   "Change current directory to given absolute file name DIR."
   ;; Put the name into directory syntax now,
   ;; because otherwise expand-file-name may give some bad results.
-  (setq dir (file-name-as-directory dir))
+  (if (not (eq system-type 'vax-vms))
+      (setq dir (file-name-as-directory dir)))
   ;; XEmacs change: stig@hackvan.com
   (if find-file-use-truenames
       (setq dir (file-truename dir)))
@@ -811,7 +813,8 @@ If optional argument HACK-HOMEDIR is non-nil, then this also substitutes
                     ;; If the home dir is just /, don't change it.
                     (not (and (= (match-end 0) 1) ;#### unix-specific
                               (= (aref filename 0) ?/)))
-                    (not (and (memq system-type '(ms-dos windows-nt))
+                    (not (and (or (eq system-type 'ms-dos)
+                                  (eq system-type 'windows-nt))
                               (save-match-data
                                 (string-match "^[a-zA-Z]:/$" filename)))))
                (setq filename
@@ -822,7 +825,11 @@ If optional argument HACK-HOMEDIR is non-nil, then this also substitutes
       filename)))
 
 (defcustom find-file-not-true-dirname-list nil
-  "*List of logical names for which visiting shouldn't save the true dirname."
+  "*List of logical names for which visiting shouldn't save the true dirname.
+On VMS, when you visit a file using a logical name that searches a path,
+you may or may not want the visited file name to record the specific
+directory where the file was found.  If you *do not* want that, add the logical
+name to this list as a string."
   :type '(repeat (string :tag "Name"))
   :group 'find-file)
 
@@ -969,60 +976,65 @@ If RAWFILE is non-nil, the file is read literally."
 ;;;            (message "Symbolic link to file in buffer %s"
 ;;;                     (buffer-name linked-buf))))
          (setq buf (create-file-buffer filename))
-         ;; Catch various signals, such as QUIT, and kill the buffer
-         ;; in that case.
-         (condition-case data
-             (progn
-               (set-buffer-major-mode buf)
-               (set-buffer buf)
-               (erase-buffer)
-               (condition-case ()
-                   (if rawfile
-                       (insert-file-contents-literally filename t)
-                     (insert-file-contents filename t))
-                 (file-error
-                  (when (and (file-exists-p filename)
-                             (not (file-readable-p filename)))
-                    (signal 'file-error (list "File is not readable" filename)))
-                  (if rawfile
-                      ;; Unconditionally set error
-                      (setq error t)
-                    (or
-                     ;; Run find-file-not-found-hooks until one returns non-nil.
-                     (run-hook-with-args-until-success 'find-file-not-found-hooks)
-                     ;; If they fail too, set error.
-                     (setq error t)))))
-               ;; Find the file's truename, and maybe use that as visited name.
-               ;; automatically computed in XEmacs, unless jka-compr was used!
-               (unless buffer-file-truename
-                 (setq buffer-file-truename truename))
-               (setq buffer-file-number number)
-               (and find-file-use-truenames
-                    ;; This should be in C.  Put pathname
-                    ;; abbreviations that have been explicitly
-                    ;; requested back into the pathname.  Most
-                    ;; importantly, strip out automounter /tmp_mnt
-                    ;; directories so that auto-save will work
-                    (setq buffer-file-name (abbreviate-file-name buffer-file-name)))
-               ;; Set buffer's default directory to that of the file.
-               (setq default-directory (file-name-directory buffer-file-name))
-               ;; Turn off backup files for certain file names.  Since
-               ;; this is a permanent local, the major mode won't eliminate it.
-               (and (not (funcall backup-enable-predicate buffer-file-name))
-                    (progn
-                      (make-local-variable 'backup-inhibited)
-                      (setq backup-inhibited t)))
-               (if rawfile
-                   ;; #### FSF 20.3 sets buffer-file-coding-system to
-                   ;; `no-conversion' here.  Should we copy?  It also
-                   ;; makes `find-file-literally' a local variable
-                   ;; and sets it to t.
-                   nil
-                 (after-find-file error (not nowarn))
-                 (setq buf (current-buffer))))
-           (t
-            (kill-buffer buf)
-            (signal (car data) (cdr data))))))
+         (set-buffer-major-mode buf)
+         (set-buffer buf)
+         (erase-buffer)
+         (if rawfile
+             (condition-case ()
+                 (insert-file-contents-literally filename t)
+               (file-error
+                (when (and (file-exists-p filename)
+                           (not (file-readable-p filename)))
+                  (kill-buffer buf)
+                  (signal 'file-error (list "File is not readable" filename)))
+                ;; Unconditionally set error
+                (setq error t)))
+           (condition-case ()
+               (insert-file-contents filename t)
+             (file-error
+              (when (and (file-exists-p filename)
+                         (not (file-readable-p filename)))
+                (kill-buffer buf)
+                (signal 'file-error (list "File is not readable" filename)))
+              ;; Run find-file-not-found-hooks until one returns non-nil.
+              (or (run-hook-with-args-until-success 'find-file-not-found-hooks)
+                  ;; If they fail too, set error.
+                  (setq error t)))))
+         ;; Find the file's truename, and maybe use that as visited name.
+         ;; automatically computed in XEmacs, unless jka-compr was used!
+         (unless buffer-file-truename
+           (setq buffer-file-truename truename))
+         (setq buffer-file-number number)
+         ;; On VMS, we may want to remember which directory in a search list
+         ;; the file was found in.
+         (and (eq system-type 'vax-vms)
+              (let (logical)
+                (if (string-match ":" (file-name-directory filename))
+                    (setq logical (substring (file-name-directory filename)
+                                             0 (match-beginning 0))))
+                (not (member logical find-file-not-true-dirname-list)))
+              (setq buffer-file-name buffer-file-truename))
+         (and find-file-use-truenames
+              ;; This should be in C.  Put pathname abbreviations that have
+              ;; been explicitly requested back into the pathname.  Most
+              ;; importantly, strip out automounter /tmp_mnt directories so
+              ;; that auto-save will work
+              (setq buffer-file-name (abbreviate-file-name buffer-file-name)))
+         ;; Set buffer's default directory to that of the file.
+         (setq default-directory (file-name-directory buffer-file-name))
+         ;; Turn off backup files for certain file names.  Since
+         ;; this is a permanent local, the major mode won't eliminate it.
+         (and (not (funcall backup-enable-predicate buffer-file-name))
+              (progn
+                (make-local-variable 'backup-inhibited)
+                (setq backup-inhibited t)))
+         (if rawfile
+             ;; #### FSF 20.3 sets buffer-file-coding-system to
+             ;; `no-conversion' here.  Should we copy?  It also makes
+             ;; `find-file-literally' a local variable and sets it to t.
+             nil
+           (after-find-file error (not nowarn))
+           (setq buf (current-buffer)))))
       buf)))
 \f
 ;; FSF has `insert-file-literally' and `find-file-literally' here.
@@ -1133,48 +1145,49 @@ run `normal-mode' explicitly."
   '(("\\.te?xt\\'" . text-mode)
     ("\\.[ch]\\'" . c-mode)
     ("\\.el\\'" . emacs-lisp-mode)
-    ("\\.\\(?:[CH]\\|cc\\|hh\\)\\'" . c++-mode)
+    ("\\.\\([CH]\\|cc\\|hh\\)\\'" . c++-mode)
     ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode)
     ("\\.java\\'" . java-mode)
     ("\\.idl\\'" . idl-mode)
-    ("\\.f\\(?:or\\)?\\'" . fortran-mode)
-    ("\\.F\\(?:OR\\)?\\'" . fortran-mode)
+    ("\\.f\\(or\\)?\\'" . fortran-mode)
+    ("\\.F\\(OR\\)?\\'" . fortran-mode)
     ("\\.[fF]90\\'" . f90-mode)
 ;;; Less common extensions come here
 ;;; so more common ones above are found faster.
-    ("\\.\\([pP][Llm]\\|al\\)\\'" . perl-mode)
+    ("\\.p[lm]\\'" . perl-mode)
     ("\\.py\\'" . python-mode)
-    ("\\.texi\\(?:nfo\\)?\\'" . texinfo-mode)
+    ("\\.texi\\(nfo\\)?\\'" . texinfo-mode)
     ("\\.ad[abs]\\'" . ada-mode)
-    ("\\.c?l\\(?:i?sp\\)?\\'" . lisp-mode)
-    ("\\.p\\(?:as\\)?\\'" . pascal-mode)
+    ("\\.c?l\\(i?sp\\)?\\'" . lisp-mode)
+    ("\\.p\\(as\\)?\\'" . pascal-mode)
     ("\\.ltx\\'" . latex-mode)
     ("\\.[sS]\\'" . asm-mode)
-    ("[Cc]hange.?[Ll]og?\\(?:.[0-9]+\\)?\\'" . change-log-mode)
+    ("[Cc]hange.?[Ll]og?\\(.[0-9]+\\)?\\'" . change-log-mode)
     ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode)
     ("\\.scm?\\(?:\\.[0-9]*\\)?\\'" . scheme-mode)
     ("\\.e\\'" . eiffel-mode)
     ("\\.mss\\'" . scribe-mode)
-    ("\\.m\\(?:[mes]\\|an\\)\\'" . nroff-mode)
+    ("\\.m\\([mes]\\|an\\)\\'" . nroff-mode)
     ("\\.icn\\'" . icon-mode)
-    ("\\.\\(?:[ckz]?sh\\|shar\\)\\'" . sh-mode)
+    ("\\.\\([ckz]?sh\\|shar\\)\\'" . sh-mode)
     ;; #### Unix-specific!
-    ("/\\.\\(?:bash_\\|z\\)?\\(profile\\|login\||logout\\)\\'" . sh-mode)
-    ("/\\.\\(?:[ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode)
-    ("/\\.\\(?:[kz]shenv\\|xsession\\)\\'" . sh-mode)
+    ("/\\.\\(bash_\\|z\\)?\\(profile\\|login\||logout\\)\\'" . sh-mode)
+    ("/\\.\\([ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode)
+    ("/\\.\\([kz]shenv\\|xsession\\)\\'" . sh-mode)
     ;; The following come after the ChangeLog pattern for the sake of
     ;; ChangeLog.1, etc. and after the .scm.[0-9] pattern too.
     ("\\.[12345678]\\'" . nroff-mode)
     ("\\.[tT]e[xX]\\'" . tex-mode)
-    ("\\.\\(?:sty\\|cls\\|bbl\\)\\'" . latex-mode)
+    ("\\.\\(sty\\|cls\\|bbl\\)\\'" . latex-mode)
     ("\\.bib\\'" . bibtex-mode)
     ("\\.article\\'" . text-mode)
     ("\\.letter\\'" . text-mode)
-    ("\\.\\(?:tcl\\|exp\\)\\'" . tcl-mode)
+    ("\\.\\(tcl\\|exp\\)\\'" . tcl-mode)
     ("\\.wrl\\'" . vrml-mode)
     ("\\.awk\\'" . awk-mode)
     ("\\.prolog\\'" . prolog-mode)
-    ("\\.\\(?:arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode)
+    ("\\.tar\\'" . tar-mode)
+    ("\\.\\(arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode)
     ;; Mailer puts message to be edited in /tmp/Re.... or Message
     ;; #### Unix-specific!
     ("\\`/tmp/Re" . text-mode)
@@ -1188,7 +1201,7 @@ run `normal-mode' explicitly."
     ("\\.oak\\'" . scheme-mode)
     ("\\.s?html?\\'" . html-mode)
     ("\\.htm?l?3\\'" . html3-mode)
-    ("\\.\\(?:sgml?\\|dtd\\)\\'" . sgml-mode)
+    ("\\.\\(sgml?\\|dtd\\)\\'" . sgml-mode)
     ("\\.c?ps\\'" . postscript-mode)
     ;; .emacs following a directory delimiter in either Unix or
     ;; Windows syntax.
@@ -1201,8 +1214,11 @@ run `normal-mode' explicitly."
     ("\\.X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-mode)
     ;; #### The following three are Unix-specific (but do we care?)
     ("/app-defaults/" . xrdb-mode)
-    ("\\.[^/]*wm2?\\(?:rc\\)?\\'" . winmgr-mode)
-    ("\\.\\(?:jpe?g\\|JPE?G\\|png\\|PNG\\|gif\\|GIF\\|tiff?\\|TIFF?\\)\\'" . image-mode)
+    ("\\.[^/]*wm\\'" . winmgr-mode)
+    ("\\.[^/]*wm2?rc" . winmgr-mode)
+    ("\\.[Jj][Pp][Ee]?[Gg]\\'" . image-mode)
+    ("\\.[Pp][Nn][Gg]\\'" . image-mode)
+    ("\\.[Gg][Ii][Ff]\\'" . image-mode)
     )
 "Alist of filename patterns vs. corresponding major mode functions.
 Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).
@@ -1238,31 +1254,8 @@ The car of each element is a regular expression which is compared
 with the name of the interpreter specified in the first line.
 If it matches, mode MODE is selected.")
 
-(defvar binary-file-regexps
-  (purecopy
-   '("\\.\\(?:bz2\\|elc\\|g\\(if\\|z\\)\\|jp\\(eg\\|g\\)\\|png\\|t\\(ar\\|gz\\|iff\\)\\|[Zo]\\)\\'"))
-  "List of regexps of filenames containing binary (non-text) data.")
-
-;   (eval-when-compile
-;     (require 'regexp-opt)
-;     (list
-;      (format "\\.\\(?:%s\\)\\'"
-;            (regexp-opt
-;             '("tar"
-;               "tgz"
-;               "gz"
-;               "bz2"
-;               "Z"
-;               "o"
-;               "elc"
-;               "png"
-;               "gif"
-;               "tiff"
-;               "jpg"
-;               "jpeg"))))))
-  
-(defvar inhibit-first-line-modes-regexps
-  (purecopy binary-file-regexps)
+(defvar inhibit-first-line-modes-regexps (purecopy '("\\.tar\\'" "\\.tgz\\'"
+                                                    "\\.tar\\.gz\\'"))
   "List of regexps; if one matches a file name, don't look for `-*-'.")
 
 (defvar inhibit-first-line-modes-suffixes nil
@@ -1312,7 +1305,7 @@ and we don't even do that unless it would come from the file name."
                   (mode nil))
               ;; Find first matching alist entry.
              (let ((case-fold-search
-                    (memq system-type '(windows-nt))))
+                    (memq system-type '(vax-vms windows-nt))))
                (while (and (not mode) alist)
                  (if (string-match (car (car alist)) name)
                      (if (and (consp (cdr (car alist)))
@@ -1345,12 +1338,17 @@ and we don't even do that unless it would come from the file name."
                          (setq alist (cdr alist)))))))
               (if mode
                  (if (not (fboundp mode))
-                      (let ((name (package-get-package-provider mode)))
-                        (if name
-                            (message "Mode %s is not installed.  Download package %s" mode name)
-                          (message "Mode %s either doesn't exist or is not a known package" mode))
-                        (sit-for 2)
-                        (error "%s" mode))
+                     (progn
+                       (if (or (not (boundp 'package-get-base))
+                               (not package-get-base))
+                           (load "package-get-base"))
+                       (require 'package-get)
+                       (let ((name (package-get-package-provider mode)))
+                         (if name
+                             (message "Mode %s is not installed.  Download package %s" mode name)
+                           (message "Mode %s either doesn't exist or is not a known package" mode))
+                         (sit-for 2)
+                         (error "%s" mode)))
                    (unless (and just-from-file-name
                                 (or
                                  ;; Don't reinvoke major mode.
@@ -1725,6 +1723,8 @@ the old visited file has been renamed to the new name FILENAME."
        (let ((new-name (file-name-nondirectory buffer-file-name)))
          (if (string= new-name "")
              (error "Empty file name"))
+         (if (eq system-type 'vax-vms)
+             (setq new-name (downcase new-name)))
          (setq default-directory (file-name-directory buffer-file-name))
          (or (string= new-name (buffer-name))
              (rename-buffer new-name t))))
@@ -1918,7 +1918,9 @@ of the new file to agree with the old modes."
                          ;; Now delete the old versions, if desired.
                          (if delete-old-versions
                              (while targets
-                               (ignore-file-errors (delete-file (car targets)))
+                               (condition-case ()
+                                   (delete-file (car targets))
+                                 (file-error nil))
                                (setq targets (cdr targets))))
                          setmodes)
                      (file-error nil)))))))))
@@ -1933,17 +1935,28 @@ we do not remove backup version numbers, only true file version numbers."
     (if handler
        (funcall handler 'file-name-sans-versions name keep-backup-version)
       (substring name 0
-                (if keep-backup-version
-                    (length name)
-                  (or (string-match "\\.~[0-9.]+~\\'" name)
-                      ;; XEmacs - VC uses extensions like ".~tagname~" or ".~1.1.5.2~"
-                      (let ((pos (string-match "\\.~\\([^.~ \t]+\\|[0-9.]+\\)~\\'" name)))
-                        (and pos
-                             ;; #### - is this filesystem check too paranoid?
-                             (file-exists-p (substring name 0 pos))
-                             pos))
-                      (string-match "~\\'" name)
-                      (length name)))))))
+                (if (eq system-type 'vax-vms)
+                    ;; VMS version number is (a) semicolon, optional
+                    ;; sign, zero or more digits or (b) period, option
+                    ;; sign, zero or more digits, provided this is the
+                    ;; second period encountered outside of the
+                    ;; device/directory part of the file name.
+                    (or (string-match ";[-+]?[0-9]*\\'" name)
+                        (if (string-match "\\.[^]>:]*\\(\\.[-+]?[0-9]*\\)\\'"
+                                          name)
+                            (match-beginning 1))
+                        (length name))
+                  (if keep-backup-version
+                      (length name)
+                    (or (string-match "\\.~[0-9.]+~\\'" name)
+                        ;; XEmacs - VC uses extensions like ".~tagname~" or ".~1.1.5.2~"
+                        (let ((pos (string-match "\\.~\\([^.~ \t]+\\|[0-9.]+\\)~\\'" name)))
+                          (and pos
+                               ;; #### - is this filesystem check too paranoid?
+                               (file-exists-p (substring name 0 pos))
+                               pos))
+                        (string-match "~\\'" name)
+                        (length name))))))))
 
 (defun file-ownership-preserved-p (file)
   "Return t if deleting FILE and rewriting it would preserve the owner."
@@ -2018,6 +2031,8 @@ the index in the name where the version number begins."
       (string-to-int (substring fn bv-length -1))
       0))
 
+;; I believe there is no need to alter this behavior for VMS;
+;; since backup files are not made on VMS, it should not get called.
 (defun find-backup-file-name (fn)
   "Find a file name for a backup file, and suggestions for deletions.
 Value is a list whose car is the name for the backup file
@@ -2082,7 +2097,8 @@ then it returns FILENAME."
                       (expand-file-name (or directory default-directory))))
       ;; On Microsoft OSes, if FILENAME and DIRECTORY have different
       ;; drive names, they can't be relative, so return the absolute name.
-      (if (and (memq system-type '(ms-dos windows-nt))
+      (if (and (or (eq system-type 'ms-dos)
+                  (eq system-type 'windows-nt))
               (not (string-equal (substring fname  0 2)
                                  (substring directory 0 2))))
          filename
@@ -2152,7 +2168,9 @@ since the last real save, but optional arg FORCE non-nil means delete anyway."
        (not (string= buffer-file-name buffer-auto-save-file-name))
        (or force (recent-auto-save-p))
        (progn
-        (ignore-file-errors (delete-file buffer-auto-save-file-name))
+        (condition-case ()
+            (delete-file buffer-auto-save-file-name)
+          (file-error nil))
         (set-buffer-auto-saved))))
 
 ;; XEmacs change (from Sun)
@@ -2194,6 +2212,19 @@ After saving the buffer, run `after-save-hook'."
        (set-buffer (buffer-base-buffer)))
     (if (buffer-modified-p)
        (let ((recent-save (recent-auto-save-p)))
+         ;; On VMS, rename file and buffer to get rid of version number.
+         (if (and (eq system-type 'vax-vms)
+                  (not (string= buffer-file-name
+                                (file-name-sans-versions buffer-file-name))))
+             (let (buffer-new-name)
+               ;; Strip VMS version number before save.
+               (setq buffer-file-name
+                     (file-name-sans-versions buffer-file-name))
+               ;; Construct a (unique) buffer name to correspond.
+               (let ((buf (create-file-buffer (downcase buffer-file-name))))
+                 (setq buffer-new-name (buffer-name buf))
+                 (kill-buffer buf))
+               (rename-buffer buffer-new-name)))
          ;; If buffer has no file name, ask user for one.
          (or buffer-file-name
              (let ((filename
@@ -2752,11 +2783,12 @@ non-nil, it is called instead of rereading visited file contents."
                 (not (file-exists-p file-name)))
               (error "Auto-save file %s not current" file-name))
              ((save-window-excursion
-                (with-output-to-temp-buffer "*Directory*"
-                  (buffer-disable-undo standard-output)
-                  (call-process "ls" nil standard-output nil
-                                (if (file-symlink-p file) "-lL" "-l")
-                                file file-name))
+                (if (not (eq system-type 'vax-vms))
+                    (with-output-to-temp-buffer "*Directory*"
+                      (buffer-disable-undo standard-output)
+                      (call-process "ls" nil standard-output nil
+                                    (if (file-symlink-p file) "-lL" "-l")
+                                    file file-name)))
                 (yes-or-no-p (format "Recover auto save file %s? " file-name)))
               (switch-to-buffer (find-file-noselect file t))
               (let ((buffer-read-only nil))
@@ -3056,12 +3088,16 @@ by `sh' are supported."
     ;; not its part.  Make the regexp say so.
     (concat "\\`" result "\\'")))
 \f
-(defcustom list-directory-brief-switches "-CF"
+(defcustom list-directory-brief-switches
+  (if (eq system-type 'vax-vms) "" "-CF")
   "*Switches for list-directory to pass to `ls' for brief listing."
   :type 'string
   :group 'dired)
 
-(defcustom list-directory-verbose-switches "-l"
+(defcustom list-directory-verbose-switches
+  (if (eq system-type 'vax-vms)
+      "/PROTECTION/SIZE/DATE/OWNER/WIDTH=(OWNER:10)"
+    "-l")
   "*Switches for list-directory to pass to `ls' for verbose listing,"
   :type 'string
   :group 'dired)
@@ -3131,6 +3167,8 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'."
        (funcall handler 'insert-directory file switches
                 wildcard full-directory-p)
       (cond
+       ((eq system-type 'vax-vms)
+       (vms-read-directory file switches (current-buffer)))
        ((and (fboundp 'mswindows-insert-directory)
             (eq system-type 'windows-nt))
        (mswindows-insert-directory file switches wildcard full-directory-p))
diff --git a/lisp/finder-inf.el b/lisp/finder-inf.el
new file mode 100644 (file)
index 0000000..6c5365a
--- /dev/null
@@ -0,0 +1,3677 @@
+;;; finder-inf.el --- keyword-to-package mapping
+;; Keywords: help
+;;; Commentary:
+;; Don't edit this file.  It's generated by finder.el
+
+;;; Code:
+
+(defconst finder-package-info '(
+    ("eos.el"
+        "Intereactively loads the XEmacs/SPARCworks interface"
+        (sparcworks eos era on sparcworks load)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sccs.el"
+        "easy-to-use SCCS control from within Emacs"
+        nil
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos-browser.el"
+        "Implements the XEmacs/SPARCworks SourceBrowser interface"
+        (sparcworks eos era on sparcworks sbrowser source browser)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos-debugger-extra.el"
+        "Implements the XEmacs/SPARCworks Debugger interface"
+        (sparcworks eos era on sparcworks debugger dbx)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos-debugger.el"
+        "Implements the XEmacs/SPARCworks interface"
+        (sparcworks eos era on sparcworks debugger dbx)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos-editor.el"
+        "Implements the XEmacs/SPARCworks editor protocol"
+        (sparcworks eos era on sparcworks editor)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos-init.el"
+        "Initializes the XEmacs/SPARCworks interface"
+        (sparcworks eos era on sparcworks initialize)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos-load.el"
+        "Loads the XEmacs/SPARCworks interface code"
+        (sparcworks eos era on sparcworks debugger dbx)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos-menubar.el"
+        "Implements the XEmacs/SPARCworks menubar"
+        (sparcworks eos era on sparcworks menubar)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos-toolbar.el"
+        "Implements the EOS toolbar interface"
+        (sparcworks eos era on sparcworks toolbar)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sun-eos.el"
+        "Intereactively loads the XEmacs/SPARCworks interface"
+        (sparcworks eos era on sparcworks load)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sunpro-keys.el"
+        "SunPro-specific key bindings"
+        nil
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sunpro-menubar.el"
+        "Initialize the SunPro menubar"
+        (sunpro menubar initialization)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("sunpro-sparcworks.el"
+        "support SPARCworks manager ToolTalk messages"
+        (sparcworks  tooltalk  messages)
+        "/home/martin/x/packages/lisp/Sun/")
+    ("ada-mode.el"
+        "An Emacs major-mode for editing Ada source."
+        (languages oop ada)
+        "/home/martin/x/packages/lisp/ada/")
+    ("custom-load.el"
+        "automatically extracted custom dependencies"
+        nil
+        "/home/martin/x/packages/lisp/ada/")
+    ("atype.el"
+        "atype functions"
+        (atype)
+        "/home/martin/x/packages/lisp/apel/")
+    ("emu-20.el"
+        "emu API implementation for Emacs 20 and XEmacs/mule"
+        (emulation  compatibility  mule)
+        "/home/martin/x/packages/lisp/apel/")
+    ("emu-e19.el"
+        "emu module for Emacs 19 and XEmacs 19"
+        (emulation  compatibility  mule  latin-1)
+        "/home/martin/x/packages/lisp/apel/")
+    ("emu-x20.el"
+        "emu API implementation for XEmacs with mule"
+        (emulation  compatibility  mule  xemacs)
+        "/home/martin/x/packages/lisp/apel/")
+    ("emu-xemacs.el"
+        "emu API implementation for XEmacs"
+        (emulation  compatibility  xemacs)
+        "/home/martin/x/packages/lisp/apel/")
+    ("emu.el"
+        "Emulation module for each Emacs variants"
+        (emulation  compatibility  nemacs  mule  emacs/mule  xemacs)
+        "/home/martin/x/packages/lisp/apel/")
+    ("file-detect.el"
+        "Path management or file detection utility"
+        (file detection  install  module)
+        "/home/martin/x/packages/lisp/apel/")
+    ("filename.el"
+        "file name filter"
+        (file name  string)
+        "/home/martin/x/packages/lisp/apel/")
+    ("install.el"
+        "Emacs Lisp package install utility"
+        (install  byte-compile  directory detection)
+        "/home/martin/x/packages/lisp/apel/")
+    ("mule-caesar.el"
+        "ROT 13-47 Caesar rotation utility"
+        (rot 13-47  caesar  mail  news  text/x-rot13-47)
+        "/home/martin/x/packages/lisp/apel/")
+    ("path-util.el"
+        "Emacs Lisp file detection utility"
+        (file detection  install  module)
+        "/home/martin/x/packages/lisp/apel/")
+    ("richtext.el"
+        "read and save files in text/richtext format"
+        (wp  faces  mime  multimedia)
+        "/home/martin/x/packages/lisp/apel/")
+    ("std11-parse.el"
+        "STD 11 parser for GNU Emacs"
+        (mail  news  rfc 822  std 11)
+        "/home/martin/x/packages/lisp/apel/")
+    ("std11.el"
+        "STD 11 functions for GNU Emacs"
+        (mail  news  rfc 822  std 11)
+        "/home/martin/x/packages/lisp/apel/")
+    ("font-latex.el"
+        "LaTeX fontification for Font Lock mode."
+        (latex faces)
+        "/home/martin/x/packages/lisp/auctex/")
+    ("latex.el"
+        "Support for LaTeX documents."
+        (wp)
+        "/home/martin/x/packages/lisp/auctex/")
+    ("multi-prompt.el"
+        "completing read of multiple strings."
+        (extensions)
+        "/home/martin/x/packages/lisp/auctex/")
+    ("tex.el"
+        "Support for TeX documents."
+        (wp)
+        "/home/martin/x/packages/lisp/auctex/")
+    ("bbdb-print.el"
+        "for printing BBDB databases using TeX."
+        nil
+        "/home/martin/x/packages/lisp/bbdb/")
+    ("bbdb-reportmail.el"
+        "Hooks the Insidious Big Brother Database"
+        nil
+        "/home/martin/x/packages/lisp/bbdb/")
+    ("bbdb-snarf.el"
+        "convert free-form text to BBDB records"
+        nil
+        "/home/martin/x/packages/lisp/bbdb/")
+    ("bbdb-whois.el"
+        "Big Brother gets a little help from Big Brother"
+        nil
+        "/home/martin/x/packages/lisp/bbdb/")
+    ("c-comment-edit.el"
+        "edit C comments"
+        (languages)
+        "/home/martin/x/packages/lisp/c-support/")
+    ("c-comment.el"
+        "edit C comments"
+        (languages)
+        "/home/martin/x/packages/lisp/c-support/")
+    ("c-style.el"
+        "sets c-style control variables."
+        nil
+        "/home/martin/x/packages/lisp/c-support/")
+    ("cmacexp.el"
+        "expand C macros in a region"
+        (c)
+        "/home/martin/x/packages/lisp/c-support/")
+    ("ctypes.el"
+        "Enhanced Font lock support for custom defined types."
+        nil
+        "/home/martin/x/packages/lisp/c-support/")
+    ("hideif.el"
+        "hides selected code within ifdef."
+        (c  outlines)
+        "/home/martin/x/packages/lisp/c-support/")
+    ("hideshow.el"
+        "minor mode cmds to selectively display blocks of code"
+        (c c++ lisp tools editing)
+        "/home/martin/x/packages/lisp/c-support/")
+    ("appt.el"
+        "appointment notification functions."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-china.el"
+        "calendar functions for the Chinese calendar."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-coptic.el"
+        "calendar functions for the Coptic/Ethiopic calendars."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-dst.el"
+        "calendar functions for daylight savings rules."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-french.el"
+        "calendar functions for the French Revolutionary calendar."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-hebrew.el"
+        "calendar functions for the Hebrew calendar."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-islam.el"
+        "calendar functions for the Islamic calendar."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-iso.el"
+        "calendar functions for the ISO calendar."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-julian.el"
+        "calendar functions for the Julian calendar."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-mayan.el"
+        "calendar functions for the Mayan calendars."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-move.el"
+        "calendar functions for movement in the calendar"
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-persia.el"
+        "calendar functions for the Persian calendar."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-tex.el"
+        "calendar functions for printing calendars with LaTeX."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-x.el"
+        "calendar windows in dedicated frames in x-windows"
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cal-xemacs.el"
+        "calendar functions for menu bar and popup menu support"
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("calendar.el"
+        "Calendar functions.  -*-byte-compile-dynamic: t;-*-"
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("diary-lib.el"
+        "diary functions."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("holidays.el"
+        "holiday functions for the calendar package"
+        (holidays  calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("lunar.el"
+        "calendar functions for phases of the moon."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("solar.el"
+        "calendar functions for solar events."
+        (calendar)
+        "/home/martin/x/packages/lisp/calendar/")
+    ("cc-align.el"
+        "custom indentation functions for CC Mode"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-cmds.el"
+        "user level commands for CC Mode "
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-compat.el"
+        "cc-mode compatibility with c-mode.el confusion"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-defs.el"
+        "compile time definitions for CC Mode"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-engine.el"
+        "core syntax guessing engine for CC mode"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-langs.el"
+        "specific language support for CC Mode"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-menus.el"
+        "imenu support for CC Mode"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-mode.el"
+        "major mode for editing C, C++, Objective-C, and Java code"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-styles.el"
+        "support for styles in CC Mode"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cc-vars.el"
+        "user customization variables for CC Mode"
+        (c languages oop)
+        "/home/martin/x/packages/lisp/cc-mode/")
+    ("cookie1.el"
+        "retrieve random phrases from fortune cookie files"
+        (games)
+        "/home/martin/x/packages/lisp/cookie/")
+    ("spook.el"
+        "spook phrase utility for overloading the NSA line eater"
+        (games)
+        "/home/martin/x/packages/lisp/cookie/")
+    ("yow.el"
+        "quote random zippyisms"
+        (games)
+        "/home/martin/x/packages/lisp/cookie/")
+    ("crisp.el"
+        "CRiSP/Brief Emacs emulator"
+        (emulations brief crisp)
+        "/home/martin/x/packages/lisp/crisp/")
+    ("scroll-lock.el"
+        "scroll-locking minor mode"
+        (scroll crisp brief lock)
+        "/home/martin/x/packages/lisp/crisp/")
+    ("dbx.el"
+        "run dbx under Emacs"
+        (c  unix  tools  debugging)
+        "/home/martin/x/packages/lisp/debug/")
+    ("gdb-highlight.el"
+        "make gdb buffers be mouse-sensitive."
+        (extensions  c  unix  tools  debugging)
+        "/home/martin/x/packages/lisp/debug/")
+    ("gdb.el"
+        "run gdb under Emacs"
+        (c  unix  tools  debugging)
+        "/home/martin/x/packages/lisp/debug/")
+    ("gdbsrc.el"
+        "Source-based (as opposed to comint-based) debugger"
+        (c  unix  tools  debugging)
+        "/home/martin/x/packages/lisp/debug/")
+    ("gud.el"
+        "Grand Unified Debugger mode for gdb, sdb, dbx, or xdb"
+        (c  unix  tools  debugging)
+        "/home/martin/x/packages/lisp/debug/")
+    ("history.el"
+        "Generic history stuff"
+        nil
+        "/home/martin/x/packages/lisp/debug/")
+    ("advise-eval-region.el"
+        "Wrap advice around eval-region"
+        (extensions lisp)
+        "/home/martin/x/packages/lisp/edebug/")
+    ("cust-print.el"
+        "handles print-level and print-circle."
+        (extensions)
+        "/home/martin/x/packages/lisp/edebug/")
+    ("edebug-cl-read.el"
+        "Edebug reader macros for use with cl-read."
+        (lisp  tools  maint)
+        "/home/martin/x/packages/lisp/edebug/")
+    ("edebug.el"
+        "a source-level debugger for Emacs Lisp"
+        (lisp  tools  maint)
+        "/home/martin/x/packages/lisp/edebug/")
+    ("eval-reg.el"
+        "Redefine eval-region, and subrs that use it, in Lisp"
+        (lisp)
+        "/home/martin/x/packages/lisp/edebug/")
+    ("ediff-diff.el"
+        "diff-related utilities"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-help.el"
+        "Code related to the contents of Ediff help buffers"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-hook.el"
+        "setup for Ediff's menus and autoloads"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-init.el"
+        "Macros, variables, and defsubsts used by Ediff"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-merg.el"
+        "merging utilities"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-mult.el"
+        "support for multi-file/multi-buffer processing in Ediff"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-ptch.el"
+        "Ediff's  patch support"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-tbar.el"
+        "A toolbar for Ediff control buffer"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-util.el"
+        "the core commands and utilities of ediff"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-vers.el"
+        "version control interface to Ediff"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff-wind.el"
+        "window manipulation utilities"
+        nil
+        "/home/martin/x/packages/lisp/ediff/")
+    ("ediff.el"
+        "a comprehensive visual interface to diff & patch"
+        (comparing  merging  patching  version control.)
+        "/home/martin/x/packages/lisp/ediff/")
+    ("abbrevlist.el"
+        "list one abbrev table alphabetically ordered."
+        (abbrev)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("after-save-commands.el"
+        "Run a shell command after saving a file"
+        (processes unix)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("array.el"
+        "array editing commands for XEmacs"
+        (extensions)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("atomic-extents.el"
+        "treat regions of text as a single object"
+        (extensions)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("avoid.el"
+        "make mouse pointer stay out of the way of editing"
+        (mouse)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("backup-dir.el"
+        "allow backup files to live in some other directory(s)."
+        (backup file)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("big-menubar.el"
+        "an alternate menubar"
+        (mouse menubar)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("blink-cursor.el"
+        "Blink the cursor on or off"
+        (display)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("blink-paren.el"
+        "blink the matching paren, just like Zmacs"
+        (faces)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("bookmark.el"
+        "set bookmarks, maybe annotate them, jump to them later."
+        (bookmarks  placeholders  annotations)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("compare-w.el"
+        "compare text between windows for Emacs."
+        nil
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("completion.el"
+        "dynamic word-completion code"
+        (abbrev)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("dabbrev.el"
+        "dynamic abbreviation package"
+        (abbrev expand completion)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("desktop.el"
+        "save partial status of Emacs when killed"
+        (customization)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("detached-minibuf.el"
+        "Support a detached minibuffer for XEmacs."
+        (extensions)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("edit-faces.el"
+        "interactive face editing mode"
+        (faces)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("edit-toolbar.el"
+        "Interactive toolbar editing mode for XEmacs"
+        (tools)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("fast-lock.el"
+        "Automagic text properties caching for fast Font Lock mode."
+        (faces files)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("file-part.el"
+        "treat a section of a buffer as a separate file"
+        (extensions  tools)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("floating-toolbar.el"
+        "popup toolbar support for XEmacs."
+        (lisp)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("flow-ctrl.el"
+        "help for lusers on cu(1) or ttys with wired-in ^S/^Q flow control"
+        (hardware)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("foldout.el"
+        "Folding extensions for outline-mode and outline-minor-mode."
+        (folding  outline)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("func-menu.el"
+        "Jump to a function within a buffer."
+        (tools  c  lisp)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("hippie-exp.el"
+        "expand text trying various ways to find its expansion."
+        (abbrev)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("id-select.el"
+        "Select larger and larger syntax-driven regions in a buffer"
+        (matching  mouse)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("info-look.el"
+        "major-mode-sensitive Info index lookup facility."
+        (help languages)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("iswitchb.el"
+        "switch between buffers using substrings"
+        (extensions)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("lazy-lock.el"
+        "Lazy demand-driven fontification for fast Font Lock mode."
+        (faces files)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("lazy-shot.el"
+        "Lazy font locking for XEmacs"
+        (languages  faces)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("lispm-fonts.el"
+        "quick hack to parse LISPM-style font-shift codes"
+        (faces)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("live-icon.el"
+        "make frame icons represent the current frame contents"
+        nil
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("makesum.el"
+        "generate key binding summary for Emacs"
+        (help)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("man.el"
+        "browse UNIX manual pages"
+        (help)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("mic-paren.el"
+        "highlight matching parenthesises."
+        (languages  faces)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("outl-mouse.el"
+        "outline mode mouse commands for Emacs"
+        (outlines  mouse)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("page-ext.el"
+        "extended page handling commands"
+        nil
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("paren.el"
+        "highlight (un)matching parens and whole expressions"
+        (languages  faces)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("permanent-buffers.el"
+        "Permanent buffers management package."
+        (extensions)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("popper.el"
+        "shrink-wrapped temporary windows for Emacs"
+        (temporary window  popup window)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("recent-files.el"
+        "Maintain menu of recently opened files."
+        (menu  file)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("redo.el"
+        "Redo/undo system for XEmacs"
+        (lisp  extensions)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("resume.el"
+        "process command line args from within a suspended Emacs job"
+        (processes)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("rsz-minibuf.el"
+        "dynamically resize minibuffer to display entire contents"
+        (minibuffer  window  frames  display)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("savehist.el"
+        "Save minibuffer history"
+        (minibuffer)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("saveplace.el"
+        "automatically save place in files."
+        (bookmarks  placeholders)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("tempo.el"
+        "Flexible template insertion"
+        (extensions  languages  tools)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("toolbar-utils.el"
+        "Toolbar utility functions for XEmacs"
+        (extensions)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("uniquify.el"
+        "unique buffer names dependent on file name"
+        nil
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("where-was-i-db.el"
+        "Keep persistent state in visited files."
+        (tools  data  wp)
+        "/home/martin/x/packages/lisp/edit-utils/")
+    ("edt-lk201.el"
+        "Enhanced EDT Keypad Mode Emulation for LK-201 Keyboards"
+        (emulations)
+        "/home/martin/x/packages/lisp/edt/")
+    ("edt-mapper.el"
+        "Create an EDT LK-201 Map File for X-Windows Emacs"
+        (emulations)
+        "/home/martin/x/packages/lisp/edt/")
+    ("edt-pc.el"
+        "Enhanced EDT Keypad Mode Emulation for PC 101 Keyboards"
+        (emulations)
+        "/home/martin/x/packages/lisp/edt/")
+    ("edt-vt100.el"
+        "Enhanced EDT Keypad Mode Emulation for VT Series Terminals"
+        (emulations)
+        "/home/martin/x/packages/lisp/edt/")
+    ("edt.el"
+        "Enhanced EDT Keypad Mode Emulation for GNU Emacs 19"
+        (emulations)
+        "/home/martin/x/packages/lisp/edt/")
+    ("dll-debug.el"
+        "A slow implementation of dll for debugging."
+        (extensions  lisp)
+        "/home/martin/x/packages/lisp/elib/")
+    ("emerge.el"
+        "merge diffs under Emacs control"
+        (unix  tools)
+        "/home/martin/x/packages/lisp/emerge/")
+    ("term.el"
+        "general command interpreter in a window stuff"
+        nil
+        "/home/martin/x/packages/lisp/eterm/")
+    ("tshell.el"
+        "specialized term.el for running the shell."
+        (processes)
+        "/home/martin/x/packages/lisp/eterm/")
+    ("eudc-bbdb.el"
+        "Emacs Unified Directory Client - BBDB Backend"
+        (help)
+        "/home/martin/x/packages/lisp/eudc/")
+    ("eudc-custom-vars.el"
+        "Emacs Unified Directory Client"
+        (help)
+        "/home/martin/x/packages/lisp/eudc/")
+    ("eudc-ldap.el"
+        "Emacs Unified Directory Client - LDAP Backend"
+        (help)
+        "/home/martin/x/packages/lisp/eudc/")
+    ("eudc-ph.el"
+        "Emacs Unified Directory Client - CCSO PH/QI Backend"
+        (help)
+        "/home/martin/x/packages/lisp/eudc/")
+    ("eudc.el"
+        "Emacs Unified Directory Client"
+        (help)
+        "/home/martin/x/packages/lisp/eudc/")
+    ("footnote-cyrillic.el"
+        "Cyrillic lettering for footnote mode"
+        (mule  news  mail)
+        "/home/martin/x/packages/lisp/footnote/")
+    ("footnote-greek.el"
+        "Greek lettering for footnote mode"
+        (mule  news  mail)
+        "/home/martin/x/packages/lisp/footnote/")
+    ("footnote-han.el"
+        "Han Japanese footnote support"
+        (mail  news  mule)
+        "/home/martin/x/packages/lisp/footnote/")
+    ("footnote-hebrew.el"
+        "Hebrew lettering for footnote mode"
+        (mule  news  mail)
+        "/home/martin/x/packages/lisp/footnote/")
+    ("footnote-kana.el"
+        "more Japanese footnote support"
+        (mail  news  mule)
+        "/home/martin/x/packages/lisp/footnote/")
+    ("footnote.el"
+        "Footnote support for message mode"
+        (mail  news)
+        "/home/martin/x/packages/lisp/footnote/")
+    ("forms-d2.el"
+        "demo forms-mode"
+        nil
+        "/home/martin/x/packages/lisp/forms/")
+    ("forms-pass.el"
+        "passwd file demo for forms-mode"
+        nil
+        "/home/martin/x/packages/lisp/forms/")
+    ("forms.el"
+        "Forms mode: edit a file as a form to fill in"
+        (extensions)
+        "/home/martin/x/packages/lisp/forms/")
+    ("frame-icon.el"
+        "set up mode-specific icons for each frame under XEmacs"
+        (frames  lisp  extensions)
+        "/home/martin/x/packages/lisp/frame-icon/")
+    ("overlay.el"
+        "overlay support."
+        (internal)
+        "/home/martin/x/packages/lisp/fsf-compat/")
+    ("thingatpt.el"
+        "Get the `thing' at point"
+        (extensions  matching  mouse)
+        "/home/martin/x/packages/lisp/fsf-compat/")
+    ("timer.el"
+        "run a function with args at some time in future."
+        nil
+        "/home/martin/x/packages/lisp/fsf-compat/")
+    ("x-popup-menu.el"
+        "Mimic x-popup-menu in FSF Emacs"
+        (frames)
+        "/home/martin/x/packages/lisp/fsf-compat/")
+    ("gamegrid.el"
+        "Library for implementing grid-based games on Emacs."
+        (games)
+        "/home/martin/x/packages/lisp/games/")
+    ("snake.el"
+        "Implementation of Snake for Emacs."
+        (games)
+        "/home/martin/x/packages/lisp/games/")
+    ("sokoban.el"
+        "Implementation of Sokoban for Emacs."
+        (games)
+        "/home/martin/x/packages/lisp/games/")
+    ("tetris.el"
+        "Implementation of Tetris for Emacs."
+        (games)
+        "/home/martin/x/packages/lisp/games/")
+    ("dgnushack.el"
+        "a hack to set the load path for byte-compiling"
+        (news  path)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("earcon.el"
+        "Sound effects for messages"
+        nil
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-agent.el"
+        "unplugged support for Gnus"
+        nil
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-art.el"
+        "article mode commands for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-async.el"
+        "asynchronous support for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-audio.el"
+        "Sound effects for Gnus"
+        nil
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-bcklg.el"
+        "backlog functions for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-cache.el"
+        "cache interface for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-cite.el"
+        "parse citations in articles for Gnus"
+        nil
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-cus.el"
+        "customization commands for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-demon.el"
+        "daemonic Gnus behaviour"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-draft.el"
+        "draft message support for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-dup.el"
+        "suppression of duplicate articles in Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-eform.el"
+        "a mode for editing forms for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-ems.el"
+        "functions for making Gnus work under different Emacsen"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-gl.el"
+        "an interface to GroupLens for Gnus"
+        (news  score)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-group.el"
+        "group mode commands for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-int.el"
+        "backend interface functions for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-kill.el"
+        "kill commands for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-load.el"
+        "automatically extracted custom dependencies"
+        nil
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-logic.el"
+        "advanced scoring code for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-mh.el"
+        "mh-e interface for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-move.el"
+        "commands for moving Gnus from one server to another"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-msg.el"
+        "mail and post interface for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-nocem.el"
+        "NoCeM pseudo-cancellation treatment"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-picon.el"
+        "displaying pretty icons in Gnus"
+        (news xpm annotation glyph faces)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-range.el"
+        "range and sequence functions for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-salt.el"
+        "alternate summary mode interfaces for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-score.el"
+        "scoring code for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-setup.el"
+        "Initialization & Setup for Gnus 5"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-soup.el"
+        "SOUP packet writing support for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-spec.el"
+        "format spec functions for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-srvr.el"
+        "virtual server support for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-start.el"
+        "startup functions for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-sum.el"
+        "summary mode commands for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-topic.el"
+        "a folding minor mode for Gnus group buffers"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-undo.el"
+        "minor mode for undoing in Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-util.el"
+        "utility functions for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-uu.el"
+        "extract (uu)encoded files in Gnus"
+        nil
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-vm.el"
+        "vm interface for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-win.el"
+        "window configuration functions for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus-xmas.el"
+        "Gnus functions for XEmacs"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("gnus.el"
+        "a newsreader for GNU Emacs"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("mailheader.el"
+        "Mail header parsing, merging, formatting"
+        (tools  mail  news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("md5.el"
+        "MD5 Message Digest Algorithm"
+        nil
+        "/home/martin/x/packages/lisp/gnus/")
+    ("message.el"
+        "composing mail and news messages"
+        (mail  news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("messagexmas.el"
+        "XEmacs extensions to message"
+        (mail  news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("messcompat.el"
+        "making message mode compatible with mail mode"
+        (mail  news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnagent.el"
+        "offline backend for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnbabyl.el"
+        "rmail mbox access for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nndb.el"
+        "nndb access for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nndir.el"
+        "single directory newsgroup access for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nndoc.el"
+        "single file access for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nndraft.el"
+        "draft article access for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nneething.el"
+        "arbitrary file access for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnfolder.el"
+        "mail folder access for Gnus"
+        (mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nngateway.el"
+        "posting news via mail gateways"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnheader.el"
+        "header access macros for Gnus and its backends"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnheaderxm.el"
+        "making Gnus backends work under XEmacs"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnkiboze.el"
+        "select virtual news access for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnlistserv.el"
+        "retrieving articles via web mailing list archives"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnmail.el"
+        "mail support functions for the Gnus mail backends"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnmbox.el"
+        "mail mbox access for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnmh.el"
+        "mhspool access for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnml.el"
+        "mail spool access for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnoo.el"
+        "OO Gnus Backends"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnsoup.el"
+        "SOUP access for Gnus"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnspool.el"
+        "spool access for GNU Emacs"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nntp.el"
+        "nntp access for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnvirtual.el"
+        "virtual newsgroups access for Gnus"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("nnweb.el"
+        "retrieving articles via web search engines"
+        (news)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("parse-time.el"
+        "Parsing time strings"
+        (util)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("pop3.el"
+        "Post Office Protocol (RFC 1460) interface"
+        (mail  pop3)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("score-mode.el"
+        "mode for editing Gnus score files"
+        (news  mail)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("smiley.el"
+        "displaying smiley faces"
+        (fun)
+        "/home/martin/x/packages/lisp/gnus/")
+    ("hm--html-menu.el"
+        "A menu for the hm--html-mode."
+        nil
+        "/home/martin/x/packages/lisp/hm--html-menus/")
+    ("hm--html-mode.el"
+        "Major mode for editing HTML documents for the WWW"
+        (hypermedia languages help docs wp)
+        "/home/martin/x/packages/lisp/hm--html-menus/")
+    ("html-view.el"
+        "routines for communicating with a NCSA Mosaic process"
+        (comm unix wp help)
+        "/home/martin/x/packages/lisp/hm--html-menus/")
+    ("internal-drag-and-drop.el"
+        "Internal drag and drop interface"
+        (mouse)
+        "/home/martin/x/packages/lisp/hm--html-menus/")
+    ("tmpl-minor-mode.el"
+        "Template Minor Mode"
+        (data tools)
+        "/home/martin/x/packages/lisp/hm--html-menus/")
+    ("igrep.el"
+        "An improved interface to `grep` and `find`."
+        nil
+        "/home/martin/x/packages/lisp/igrep/")
+    ("jde-db.el"
+        "Debugger mode for jdb."
+        (java  tools)
+        "/home/martin/x/packages/lisp/jde/")
+    ("jde-gen.el"
+        "Integrated Development Environment for Java."
+        (java  tools)
+        "/home/martin/x/packages/lisp/jde/")
+    ("jde-make.el"
+        "Integrated Development Environment for Java."
+        (java  tools)
+        "/home/martin/x/packages/lisp/jde/")
+    ("jde-run.el"
+        "runs the Java app in the current buffer."
+        (tools  processes)
+        "/home/martin/x/packages/lisp/jde/")
+    ("jde.el"
+        "Integrated Development Environment for Java."
+        (java  tools)
+        "/home/martin/x/packages/lisp/jde/")
+    ("browse-url.el"
+        "ask a WWW browser to load a URL"
+        (hypertext)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("highlight-headers.el"
+        "highlighting message headers."
+        (mail  news)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("mail-abbrevs.el"
+        "Abbrev-expansion of mail aliases."
+        nil
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("mail-extr.el"
+        "extract full name and address from RFC 822 mail header."
+        (mail)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("mail-utils.el"
+        "utility functions used both by rmail and rnews"
+        (mail  news)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("reporter.el"
+        "customizable bug reporting of lisp programs"
+        (maint mail tools)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("rfc822.el"
+        "hairy rfc822 parser for mail and news and suchlike"
+        (mail)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("rmail-mini.el"
+        "minimal core of \"RMAIL\" mail reader for Emacs."
+        (mail)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("rmailout.el"
+        "\"RMAIL\" mail reader for Emacs: output message to a file."
+        (mail)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("sendmail.el"
+        "mail sending commands for Emacs."
+        (mail)
+        "/home/martin/x/packages/lisp/mail-lib/")
+    ("mc-remail.el"
+        "Remailer support for Mailcrypt"
+        nil
+        "/home/martin/x/packages/lisp/mailcrypt/")
+    ("mew-attach.el"
+        "attachments for Mew Draft mode"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-bq.el"
+        "Base64 and Quoted-Printable encoding for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-cache.el"
+        "Cache management for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-complete.el"
+        "Completion magic for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-decode.el"
+        "MIME syntax decoder for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-demo.el"
+        "Startup demo for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-draft.el"
+        "Draft mode for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-encode.el"
+        "MIME syntax encoder for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-env.el"
+        "Environment setup for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-ext.el"
+        "Message/External-Body support for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-fib.el"
+        "Filling blanks for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-func.el"
+        "Basic functions for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-header.el"
+        "Mail header stuff for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-highlight.el"
+        "Highlight for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-lang-jp.el"
+        "Japanese specific stuff for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-mark.el"
+        "Marking for Mew Summary and Virtual mode"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-message.el"
+        "Message mode for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-mime.el"
+        "MIME launcher for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-minibuf.el"
+        "Minibuffer input methods for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-mule0.el"
+        "Environment of non-Mule for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-mule2.el"
+        "Environment of Mule version 2 for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-mule3.el"
+        "Environment of Mule version 3 for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-pgp.el"
+        "PGP/MIME for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-pick.el"
+        "Picking up messages for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-refile.el"
+        "Refile for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-scan.el"
+        "Scanning messages for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-sort.el"
+        "Sorting messages for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-summary.el"
+        "Summary mode for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-syntax.el"
+        "Internal syntax for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-temacs.el"
+        "Environment of Text Emacs for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-unix.el"
+        "MIME content type for UNIX"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-vars.el"
+        "Variables and Constants for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-virtual.el"
+        "Virtual mode for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-win32.el"
+        "Settings for Mew on Win32"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew-xemacs.el"
+        "Environment of XEmacs for Mew"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mew.el"
+        "Messaging in the Emacs World"
+        nil
+        "/home/martin/x/packages/lisp/mew/")
+    ("mh-comp.el"
+        "mh-e functions for composing messages"
+        nil
+        "/home/martin/x/packages/lisp/mh-e/")
+    ("mh-e.el"
+        "GNU Emacs interface to the MH mail system"
+        (mail)
+        "/home/martin/x/packages/lisp/mh-e/")
+    ("mh-funcs.el"
+        "mh-e functions not everyone will use right away"
+        nil
+        "/home/martin/x/packages/lisp/mh-e/")
+    ("mh-mime.el"
+        "mh-e support for composing MIME messages"
+        nil
+        "/home/martin/x/packages/lisp/mh-e/")
+    ("mh-pick.el"
+        "make a search pattern and search for a message in mh-e"
+        nil
+        "/home/martin/x/packages/lisp/mh-e/")
+    ("mh-seq.el"
+        "mh-e sequences support"
+        nil
+        "/home/martin/x/packages/lisp/mh-e/")
+    ("mh-utils.el"
+        "mh-e code needed for both sending and reading"
+        nil
+        "/home/martin/x/packages/lisp/mh-e/")
+    ("xmine.el"
+        "Mine game for XEmacs"
+        (games)
+        "/home/martin/x/packages/lisp/mine/")
+    ("NeXTify.el"
+        "Character insertion variation"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("advocacy.el"
+        "blatant XEmacs self promotion"
+        nil
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("blackbox.el"
+        "blackbox game in Emacs Lisp"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("conx.el"
+        "Yet another dissociater"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("decipher.el"
+        "Cryptanalyze monoalphabetic substitution ciphers"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("dissociate.el"
+        "scramble text amusingly for Emacs."
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("doctor.el"
+        "psychological help for frustrated users."
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("dunnet.el"
+        "Text adventure for Emacs"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("flame.el"
+        "Automated insults"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("gomoku.el"
+        "Gomoku game between you and Emacs"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("hanoi.el"
+        "towers of hanoi in GNUmacs"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("life.el"
+        "John Horton Conway's `Life' game for GNU Emacs"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("morse.el"
+        "Convert text to morse code and back."
+        nil
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("mpuz.el"
+        "multiplication puzzle for XEmacs"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("rot13.el"
+        "display a buffer in rot13."
+        nil
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("studly.el"
+        "StudlyCaps (tm)(r)(c)(xxx)"
+        (games)
+        "/home/martin/x/packages/lisp/misc-games/")
+    ("emacsbug.el"
+        "command to report Emacs bugs to appropriate mailing list."
+        (maint mail)
+        "/home/martin/x/packages/lisp/net-utils/")
+    ("feedmail.el"
+        "assist other email packages to massage outgoing messages "
+        (email  queue  mail  sendmail  message  spray  smtp  draft)
+        "/home/martin/x/packages/lisp/net-utils/")
+    ("metamail.el"
+        "Metamail interface for GNU Emacs"
+        (mail  news  mime  multimedia)
+        "/home/martin/x/packages/lisp/net-utils/")
+    ("net-utils.el"
+        "Network functions"
+        nil
+        "/home/martin/x/packages/lisp/net-utils/")
+    ("rcompile.el"
+        "run a compilation on a remote machine"
+        (tools  processes)
+        "/home/martin/x/packages/lisp/net-utils/")
+    ("shadowfile.el"
+        "automatic file copying for Emacs 19"
+        (comm)
+        "/home/martin/x/packages/lisp/net-utils/")
+    ("webjump.el"
+        "programmable Web hotlist"
+        (comm www)
+        "/home/martin/x/packages/lisp/net-utils/")
+    ("webster-www.el"
+        "Look up a word in WWW Merriam-Webster dictionaries"
+        (comm  hypermedia)
+        "/home/martin/x/packages/lisp/net-utils/")
+    ("arc-mode.el"
+        "simple editing of archives"
+        (data  unix)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("background.el"
+        "fun with background jobs"
+        (processes)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("crypt.el"
+        "code for handling all sorts of compressed and encrypted files"
+        (extensions)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("ftelnet.el"
+        "remote login interface"
+        (unix  comm)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("inf-lisp.el"
+        "an inferior-lisp mode"
+        (processes  lisp)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("jka-compr.el"
+        "reading/writing/loading compressed files"
+        (data)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("kermit.el"
+        "additions to shell mode for use with kermit, etc."
+        (comm)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("ledit.el"
+        "Emacs side of ledit interface"
+        nil
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("lpr.el"
+        "print Emacs buffer on line printer."
+        (unix)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("mchat.el"
+        "Multicast Chatting package for XEmacs."
+        (comm processes)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("ps-print.el"
+        "Jim's Pretty-Good PostScript Generator for Emacs 19."
+        (print  postscript)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("rlogin.el"
+        "remote login interface"
+        (unix  comm)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("spell.el"
+        "spelling correction interface for Emacs."
+        (wp  unix)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("ssh.el"
+        "remote login interface"
+        (unix  comm)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("tar-mode.el"
+        "simple editing of tar files from GNU emacs"
+        (unix)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("telnet.el"
+        "run a telnet session from within an Emacs buffer"
+        (comm  unix)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("terminal.el"
+        "terminal emulator for GNU Emacs."
+        (comm  terminals)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("uncompress.el"
+        "auto-decompression hook for visiting .Z files"
+        (unix extensions)
+        "/home/martin/x/packages/lisp/os-utils/")
+    ("delbs.el"
+        "a small lisp package to allow you to swap around DEL/BS keys"
+        (lisp  terminals)
+        "/home/martin/x/packages/lisp/pc/")
+    ("fusion.el"
+        "CodeWright Fusion-style motion and text selection"
+        (keyboard selection region)
+        "/home/martin/x/packages/lisp/pc/")
+    ("pc-select.el"
+        "PC shift selection minor mode for XEmacs"
+        (hardware  mouse)
+        "/home/martin/x/packages/lisp/pc/")
+    ("pending-del.el"
+        "Making insertions replace any selected text."
+        nil
+        "/home/martin/x/packages/lisp/pc/")
+    ("s-region.el"
+        "set region using shift key."
+        (terminals)
+        "/home/martin/x/packages/lisp/pc/")
+    ("dired-cvs.el"
+        "Extensions to dired."
+        nil
+        "/home/martin/x/packages/lisp/pcl-cvs/")
+    ("generic-sc.el"
+        "generic interface to source control systems"
+        (tools  unix)
+        "/home/martin/x/packages/lisp/pcl-cvs/")
+    ("pcl-cvs.el"
+        "A Front-end to CVS.  Release R-2_0-Beta_2."
+        (cvs  version control  release management)
+        "/home/martin/x/packages/lisp/pcl-cvs/")
+    ("ph.el"
+        "Client for the CCSO directory system (aka PH/QI)"
+        (help)
+        "/home/martin/x/packages/lisp/ph/")
+    ("asm-mode.el"
+        "mode for editing assembler code"
+        (tools  languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("autoconf-mode.el"
+        "autoconf code editing commands for Emacs"
+        (languages  faces  m4  configure)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("awk-mode.el"
+        "AWK code editing commands for Emacs"
+        (unix  languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("cl-indent.el"
+        "enhanced lisp-indent mode"
+        (lisp  tools)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("cperl-mode.el"
+        "Perl code editing commands for XEmacs"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("cvs.el"
+        "Light cvs support for emacs (ediff + msb + dired + mode line)"
+        (cvs ediff mode-line)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("f90.el"
+        "Fortran-90 mode (free format)"
+        (fortran  f90  languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("fortran-misc.el"
+        "Routines than can be used with fortran mode."
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("fortran.el"
+        "Fortran mode for GNU Emacs"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("icon.el"
+        "mode for editing Icon code"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("ksh-mode.el"
+        "sh (ksh, bash) script editing mode for GNU Emacs."
+        (shell  korn  bourne  sh  ksh  bash)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("m4-mode.el"
+        "m4 code editing commands for Emacs"
+        (languages  faces)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("make-mode.el"
+        "makefile editing commands for Emacs"
+        (unix  tools)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("modula2.el"
+        "Modula-2 editing support package"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("pascal.el"
+        "major mode for editing pascal source in Emacs"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("perl-mode.el"
+        "Perl code editing commands for GNU Emacs"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("postscript.el"
+        "major mode for editing PostScript programs"
+        (langauges)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("prolog.el"
+        "major mode for editing and running Prolog under Emacs"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("python-mode.el"
+        "Major mode for editing Python programs"
+        (python languages oop)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("rexx-mode.el"
+        "major mode for editing REXX program files"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("simula.el"
+        "SIMULA 87 code editing commands for Emacs"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("sql.el"
+        "specialized comint.el for SQL interpreters"
+        (processes sql)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("tcl.el"
+        "Tcl code editing commands for Emacs"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("teco.el"
+        "Teco interpreter for Gnu Emacs, version 1."
+        (emulators)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("verilog-mode.el"
+        "major mode for editing verilog source in Emacs"
+        (languages)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("vrml-mode.el"
+        "major mode for editing VRML (.wrl) files"
+        (languages vrml modes)
+        "/home/martin/x/packages/lisp/prog-modes/")
+    ("iso-sgml.el"
+        "display SGML entity references as ISO 8859-1 characters"
+        (sgml  html  iso  latin  i18n)
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml-api.el"
+        "Extra API functions for PSGML"
+        nil
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml-dtd.el"
+        "DTD parser for SGML-editing mode with parsing support"
+        nil
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml-edit.el"
+        "Editing commands for SGML-mode with parsing support"
+        nil
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml-fs.el"
+        "Format a SGML-file according to a style file"
+        nil
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml-html.el"
+        "HTML mode in conjunction with PSGML"
+        nil
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml-other.el"
+        "Part of SGML-editing mode with parsing support"
+        nil
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml-parse.el"
+        "Parser for SGML-editing mode with parsing support"
+        nil
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml-xemacs.el"
+        "Part of SGML-editing mode with parsing support"
+        nil
+        "/home/martin/x/packages/lisp/psgml/")
+    ("psgml.el"
+        "SGML-editing mode with parsing support"
+        (languages)
+        "/home/martin/x/packages/lisp/psgml/")
+    ("reftex.el"
+        "Minor mode for doing \\label, \\ref and \\cite in LaTeX"
+        (tex)
+        "/home/martin/x/packages/lisp/reftex/")
+    ("rmail-kill.el"
+        "Mail filtering for rmail"
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("rmail-xemacs.el"
+        "Mouse and font support for RMAIL running on XEmacs"
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("rmail.el"
+        "main code of \"RMAIL\" mail reader for Emacs."
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("rmailedit.el"
+        "\"RMAIL edit mode\"  Edit the current message."
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("rmailkwd.el"
+        "part of the \"RMAIL\" mail reader for Emacs."
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("rmailmsc.el"
+        "miscellaneous support functions for the RMAIL mail reader"
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("rmailsort.el"
+        "Rmail: sort messages."
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("rmailsum.el"
+        "make summary buffers for the mail reader"
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("undigest.el"
+        "digest-cracking support for the RMAIL mail reader"
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("unrmail.el"
+        "convert Rmail files to mailbox files."
+        (mail)
+        "/home/martin/x/packages/lisp/rmail/")
+    ("cmuscheme.el"
+        "Scheme process in a buffer. Adapted from tea.el."
+        (processes  lisp)
+        "/home/martin/x/packages/lisp/scheme/")
+    ("cmuscheme48.el"
+        "Scheme process in a buffer.  Adapted from cmuscheme.el."
+        nil
+        "/home/martin/x/packages/lisp/scheme/")
+    ("scheme.el"
+        "Scheme (and DSSSL) editing mode."
+        (languages  lisp)
+        "/home/martin/x/packages/lisp/scheme/")
+    ("xscheme.el"
+        "Run MIT-Scheme under XEmacs"
+        (languages  lisp)
+        "/home/martin/x/packages/lisp/scheme/")
+    ("linuxdoc-sgml.el"
+        "sgml-mode enhancements for linuxdoc"
+        (docs  languages)
+        "/home/martin/x/packages/lisp/sgml/")
+    ("sgml-mode.el"
+        "SGML- and HTML-editing modes"
+        (wp  hypermedia  comm  languages)
+        "/home/martin/x/packages/lisp/sgml/")
+    ("executable.el"
+        "base functionality for executable interpreter scripts"
+        (languages  unix)
+        "/home/martin/x/packages/lisp/sh-script/")
+    ("sh-script.el"
+        "shell-script editing commands for Emacs"
+        (languages  unix)
+        "/home/martin/x/packages/lisp/sh-script/")
+    ("color-selector.el"
+        "a graphical widget of three sliders to change faces. "
+        (extensions  faces)
+        "/home/martin/x/packages/lisp/slider/")
+    ("slider.el"
+        "graphical sliders for XEmacs. (c) 1997"
+        (utilities)
+        "/home/martin/x/packages/lisp/slider/")
+    ("sb-gud.el"
+        "Speedbar support for the Grand Unified Debugger"
+        (tools  gud)
+        "/home/martin/x/packages/lisp/speedbar/")
+    ("sb-info.el"
+        "Speedbar support for Info"
+        (file  tags  tools)
+        "/home/martin/x/packages/lisp/speedbar/")
+    ("sb-rmail.el"
+        "Speedbar support for rmail"
+        (file  tags  tools)
+        "/home/martin/x/packages/lisp/speedbar/")
+    ("sb-w3.el"
+        "Speedbar support for w3."
+        (file  tags  tools)
+        "/home/martin/x/packages/lisp/speedbar/")
+    ("speedbar.el"
+        "quick access to files and tags"
+        (file  tags  tools)
+        "/home/martin/x/packages/lisp/speedbar/")
+    ("speedbspec.el"
+        "Buffer specialized configurations for speedbar"
+        (file  tags  tools)
+        "/home/martin/x/packages/lisp/speedbar/")
+    ("strokes.el"
+        "Control XEmacs through mouse strokes --"
+        (lisp  mouse  extensions)
+        "/home/martin/x/packages/lisp/strokes/")
+    ("supercite.el"
+        "minor mode for citing mail and news replies"
+        (citation attribution mail news article reply followup)
+        "/home/martin/x/packages/lisp/supercite/")
+    ("detexinfo.el"
+        "remove Texinfo commands from a Texinfo source file"
+        (tex  docs)
+        "/home/martin/x/packages/lisp/texinfo/")
+    ("informat.el"
+        "info support functions package for Emacs"
+        (help)
+        "/home/martin/x/packages/lisp/texinfo/")
+    ("makeinfo.el"
+        "run makeinfo conveniently"
+        nil
+        "/home/martin/x/packages/lisp/texinfo/")
+    ("tex-mode.el"
+        "TeX, LaTeX, and SliTeX mode commands."
+        nil
+        "/home/martin/x/packages/lisp/texinfo/")
+    ("texinfmt.el"
+        "format Texinfo files into Info files."
+        nil
+        "/home/martin/x/packages/lisp/texinfo/")
+    ("texinfo.el"
+        "major mode for editing Texinfo files"
+        (maint  tex  docs)
+        "/home/martin/x/packages/lisp/texinfo/")
+    ("texnfo-upd.el"
+        "utilities for updating nodes and menus in Texinfo files"
+        (maint  tex  docs)
+        "/home/martin/x/packages/lisp/texinfo/")
+    ("autoinsert.el"
+        "automatic mode-dependent insertion of text into new files"
+        nil
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("flyspell.el"
+        "On-the-fly spell checker"
+        (convenience)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("folding.el"
+        "A folding-editor-like minor mode."
+        (tools)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("hexl.el"
+        "edit a file in a hex dump format using the hexl filter."
+        (data)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("image-mode.el"
+        "Major mode for navigate images"
+        (image  graphics)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("iso-acc.el"
+        "minor mode providing electric accent keys"
+        (i18n)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("iso-ascii.el"
+        "set up char tables for ISO 8859/1 on ASCII terminals."
+        (i18n)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("iso-cvt.el"
+        "translate to ISO 8859-1 from/to net/TeX conventions"
+        (tex  iso  latin  i18n)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("iso-insert.el"
+        "insert functions for ISO 8859/1."
+        (i18n)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("iso-swed.el"
+        "set up char tables for ISO 8859/1 for Swedish/Finnish ttys"
+        (i18n)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("nroff-mode.el"
+        "GNU Emacs major mode for editing nroff source"
+        (wp)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("scribe.el"
+        "scribe mode, and its idiosyncratic commands."
+        (wp)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("swedish.el"
+        "miscellaneous functions for dealing with Swedish."
+        (i18n)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("tabify.el"
+        "tab conversion commands for XEmacs"
+        nil
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("underline.el"
+        "insert/remove underlining (done by overstriking) in Emacs."
+        (wp)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("whitespace-mode.el"
+        "minor mode for making whitespace visible"
+        (modes  extensions)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("winmgr-mode.el"
+        "generic window manager mode"
+        (languages)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("ws-mode.el"
+        "WordStar emulation mode for GNU Emacs"
+        (emulations)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("xpm-mode.el"
+        "minor mode for editing XPM files"
+        (data tools)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("xrdb-mode.el"
+        "mode for editing X resource database files"
+        (data languages)
+        "/home/martin/x/packages/lisp/text-modes/")
+    ("bib-mode.el"
+        "bib-mode, major mode for editing bib files."
+        (bib)
+        "/home/martin/x/packages/lisp/textools/")
+    ("bibtex.el"
+        "BibTeX mode for GNU Emacs"
+        (bibtex  latex  tex)
+        "/home/martin/x/packages/lisp/textools/")
+    ("doctex.el"
+        "grind GNU Emacs DOC file into LaTeX input"
+        (tex  docs)
+        "/home/martin/x/packages/lisp/textools/")
+    ("refbib.el"
+        "convert refer-style references to ones usable by Latex bib"
+        (bib  tex)
+        "/home/martin/x/packages/lisp/textools/")
+    ("time.el"
+        "display time and load in mode line of Emacs."
+        nil
+        "/home/martin/x/packages/lisp/time/")
+    ("char-util.el"
+        "character utility"
+        (character  emacs/mule)
+        "/home/martin/x/packages/lisp/tm/")
+    ("cless.el"
+        "Common lisp and Emacs Lisp source sharing"
+        (common lisp)
+        "/home/martin/x/packages/lisp/tm/")
+    ("gnus-art-mime.el"
+        "MIME extension for article mode of Gnus"
+        (news  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("gnus-charset.el"
+        "MIME charset extension for Gnus"
+        (news  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("gnus-mime.el"
+        "MIME extensions for Gnus"
+        (news  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("gnus-sum-mime.el"
+        "MIME extension for summary mode of Gnus"
+        (news  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("latex-math-symbol.el"
+        "LaTeX math symbol decoder"
+        (latex  math  mule)
+        "/home/martin/x/packages/lisp/tm/")
+    ("message-mime.el"
+        "MIME extensions for message.el"
+        (news  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("mime-setup.el"
+        "setup file for tm viewer and composer."
+        (mail  news  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("mu-bbdb.el"
+        "`attribution' function for mu-cite with BBDB."
+        nil
+        "/home/martin/x/packages/lisp/tm/")
+    ("mu-cite.el"
+        "yet another citation tool for GNU Emacs"
+        (mail  news  citation)
+        "/home/martin/x/packages/lisp/tm/")
+    ("range.el"
+        "range functions"
+        (range)
+        "/home/martin/x/packages/lisp/tm/")
+    ("signature.el"
+        "a signature utility for GNU Emacs"
+        (mail  news  signature)
+        "/home/martin/x/packages/lisp/tm/")
+    ("texi-util.el"
+        "Texinfo utility"
+        (texinfo)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tl-atype.el"
+        "atype functions"
+        (atype)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tl-list.el"
+        "utility functions about list"
+        (list)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tl-misc.el"
+        "miscellaneous utility of tl."
+        (load-path  module  structure)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tl-seq.el"
+        "sequence functions"
+        (sequence)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tl-str.el"
+        "Emacs Lisp Library module about string"
+        (string)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-bbdb.el"
+        "tm shared module for BBDB"
+        (mail  news  mime  multimedia  multilingual  bbdb)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-def.el"
+        "definition module for tm"
+        (mail  news  mime  multimedia  definition)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-edit-mc.el"
+        "Mailcrypt interface for tm-edit"
+        (mail  news  mime  multimedia  multilingual  security  pgp)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-edit.el"
+        "Simple MIME Composer for GNU Emacs"
+        (mail  news  mime  multimedia  multilingual)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-ew-d.el"
+        "RFC 2047 based encoded-word decoder for GNU Emacs"
+        (encoded-word  mime  multilingual  header  mail  news)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-ew-e.el"
+        "RFC 2047 based encoded-word encoder for GNU Emacs"
+        (encoded-word  mime  multilingual  header  mail  news)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-file.el"
+        "tm-view internal method for file extraction"
+        (mail  news  mime  multimedia  file  extract)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-ftp.el"
+        "tm-view internal method for anonymous ftp"
+        (anonymous ftp  mime  multimedia  mail  news)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-image.el"
+        "tm-view filter to display images in XEmacs or MULE buffers"
+        (image  picture  x-face  mime  multimedia  mail  news)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-mail.el"
+        "mail-mode extension."
+        (mail  mime  multimedia)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-mh-e.el"
+        "MIME extension for mh-e"
+        (mail  mh  mime  multimedia  encoded-word  multilingual)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-parse.el"
+        "MIME message parser"
+        (mail  news  mime  multimedia)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-partial.el"
+        "Grabbing all MIME \"message/partial\"s."
+        (mail  news  mime  multimedia  message/partial)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-pgp.el"
+        "tm-view internal methods for PGP."
+        (mail  news  mime  multimedia  pgp  security)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-play.el"
+        "decoder for tm-view.el"
+        (mail  news  mime  multimedia)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-rmail.el"
+        "MIME extension for RMAIL"
+        (mail  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-setup.el"
+        "setup file for tm viewer."
+        (mail  news  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-view.el"
+        "interactive MIME viewer for GNU Emacs"
+        (mail  news  mime  multimedia)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tm-vm.el"
+        "tm-MUA (MIME Extension module) for VM"
+        (mail  mime  multimedia  multilingual  encoded-word)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tmh-comp.el"
+        "tm-mh-e functions for composing messages"
+        (mail  mh  mime  multimedia  encoded-word  multilingual)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tu-comment.el"
+        "a comment out utility for Lisp programs."
+        (comment  lisp)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tu-replace.el"
+        "a replacing utility for GNU Emacs"
+        (replace)
+        "/home/martin/x/packages/lisp/tm/")
+    ("tpu-doc.el"
+        "Documentation for TPU-edt"
+        (emulations)
+        "/home/martin/x/packages/lisp/tpu/")
+    ("tpu-edt.el"
+        "Emacs emulating TPU emulating EDT"
+        (emulations)
+        "/home/martin/x/packages/lisp/tpu/")
+    ("tpu-extras.el"
+        "Scroll margins and free cursor mode for TPU-edt"
+        (emulations)
+        "/home/martin/x/packages/lisp/tpu/")
+    ("tpu-mapper.el"
+        "Create a TPU-edt X-windows keymap file"
+        (emulations)
+        "/home/martin/x/packages/lisp/tpu/")
+    ("vc-hooks.el"
+        "resident support for version-control"
+        nil
+        "/home/martin/x/packages/lisp/vc/")
+    ("vc.el"
+        "drive a version-control system from within Emacs"
+        nil
+        "/home/martin/x/packages/lisp/vc/")
+    ("vhdl-mode.el"
+        "major mode for editing VHDL code"
+        (languages vhdl)
+        "/home/martin/x/packages/lisp/vhdl/")
+    ("view-process-mode.el"
+        "Display current running processes"
+        (processes)
+        "/home/martin/x/packages/lisp/view-process/")
+    ("view-process-system-specific.el"
+        "System specific stuff for view-process"
+        (processes)
+        "/home/martin/x/packages/lisp/view-process/")
+    ("view-process-xemacs.el"
+        "XEmacs specific code for view-process"
+        (processes)
+        "/home/martin/x/packages/lisp/view-process/")
+    ("viper-cmd.el"
+        "Vi command support for Viper"
+        nil
+        "/home/martin/x/packages/lisp/viper/")
+    ("viper-ex.el"
+        "functions implementing the Ex commands for Viper"
+        nil
+        "/home/martin/x/packages/lisp/viper/")
+    ("viper-init.el"
+        "some common definitions for Viper"
+        nil
+        "/home/martin/x/packages/lisp/viper/")
+    ("viper-keym.el"
+        "Viper keymaps"
+        nil
+        "/home/martin/x/packages/lisp/viper/")
+    ("viper-macs.el"
+        "functions implementing keyboard macros for Viper"
+        nil
+        "/home/martin/x/packages/lisp/viper/")
+    ("viper-mous.el"
+        "mouse support for Viper"
+        nil
+        "/home/martin/x/packages/lisp/viper/")
+    ("viper-util.el"
+        "Utilities used by viper.el"
+        nil
+        "/home/martin/x/packages/lisp/viper/")
+    ("viper.el"
+        "A full-featured Vi emulator for GNU Emacs and XEmacs,"
+        (emulations)
+        "/home/martin/x/packages/lisp/viper/")
+    ("vm-easymenu.el"
+        "support the easymenu interface for defining a menu."
+        (emulations)
+        "/home/martin/x/packages/lisp/vm/")
+    ("vm-loaddefs.el"
+        "autoloads for VM formerly in loaddefs.el"
+        (mail  dumped)
+        "/home/martin/x/packages/lisp/vm/")
+    ("base64.el"
+        "Base64 encoding functions"
+        (extensions)
+        "/home/martin/x/packages/lisp/w3/")
+    ("css.el"
+        "Cascading Style Sheet parser"
+        nil
+        "/home/martin/x/packages/lisp/w3/")
+    ("dsssl-flow.el"
+        "DSSSL flow objects"
+        nil
+        "/home/martin/x/packages/lisp/w3/")
+    ("dsssl.el"
+        "DSSSL parser"
+        nil
+        "/home/martin/x/packages/lisp/w3/")
+    ("images.el"
+        "Automatic image converters"
+        (images)
+        "/home/martin/x/packages/lisp/w3/")
+    ("mm.el"
+        "Mailcap parsing routines, and MIME handling"
+        (mail  news  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("mule-sysdp.el"
+        "consolidate MULE-version dependencies in one file."
+        (lisp  tools)
+        "/home/martin/x/packages/lisp/w3/")
+    ("socks.el"
+        "A Socks v5 Client for Emacs"
+        (comm  firewalls)
+        "/home/martin/x/packages/lisp/w3/")
+    ("ssl.el"
+        "ssl functions for emacsen without them builtin"
+        (comm)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-auth.el"
+        "Uniform Resource Locator authorization modules"
+        (comm  data  processes  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-cache.el"
+        "Uniform Resource Locator retrieval tool"
+        (comm  data  processes  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-cookie.el"
+        "Netscape Cookie support"
+        (comm  data  processes  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-file.el"
+        "File retrieval code"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-gopher.el"
+        "Gopher Uniform Resource Locator retrieval code"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-gw.el"
+        "Gateway munging for URL loading"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-http.el"
+        "HTTP Uniform Resource Locator retrieval code"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-irc.el"
+        "IRC URL interface"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-mail.el"
+        "Mail Uniform Resource Locator retrieval code"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-misc.el"
+        "Misc Uniform Resource Locator retrieval code"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-news.el"
+        "News Uniform Resource Locator retrieval code"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-nfs.el"
+        "NFS URL interface"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-ns.el"
+        "Various netscape-ish functions for proxy definitions"
+        (comm  data  processes  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-parse.el"
+        "Uniform Resource Locator parser"
+        (comm  data  processes)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url-vars.el"
+        "Variables for Uniform Resource Locator tool"
+        (comm  data  processes  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("url.el"
+        "Uniform Resource Locator retrieval tool"
+        (comm  data  processes  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-about.el"
+        "About pages for emacs-w3"
+        (hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-cfg.el"
+        "Configuration info from Emacs/W3"
+        (hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-cus.el"
+        "Customization support for Emacs-W3"
+        (comm  help  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-display.el"
+        "display engine"
+        (faces  help  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-e19.el"
+        "Emacs 19.xx specific functions for emacs-w3"
+        (faces  help  mouse  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-e20.el"
+        "Emacs 20.xx specific functions for emacs-w3"
+        (faces  help  mouse  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-elisp.el"
+        "Scripting support for emacs-lisp"
+        (hypermedia  scripting)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-emulate.el"
+        "All variable definitions for emacs-w3"
+        (comm  help  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-forms.el"
+        "Emacs-w3 forms parsing code for new display engine"
+        (faces  help  comm  data  languages)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-hot.el"
+        "Main functions for emacs-w3 on all platforms/versions"
+        (faces  help  comm  news  mail  processes  mouse  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-imap.el"
+        "Imagemap functions"
+        (hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-jscript.el"
+        "Scripting support for javascript"
+        (hypermedia  scripting)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-keyword.el"
+        "Emacs-W3 binding style sheet mechanism"
+        (hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-latex.el"
+        "Emacs-W3 printing via LaTeX"
+        (hypermedia  printing  typesetting)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-menu.el"
+        "Menu functions for emacs-w3"
+        (menu  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-mouse.el"
+        "Mouse specific functions for emacs-w3"
+        (mouse  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-prefs.el"
+        "Preferences panels for Emacs-W3"
+        (hypermedia  preferences)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-print.el"
+        "Printing support for emacs-w3"
+        (faces  help  printing  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-props.el"
+        "Additional text property stuff"
+        (faces)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-script.el"
+        "Scripting support"
+        (hypermedia  scripting)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-speak.el"
+        "Emacs-W3 speech interface"
+        (hypermedia  speech)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-style.el"
+        "Emacs/W3 binding style sheet mechanism"
+        (faces  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-sysdp.el"
+        "consolidate Emacs-version dependencies in one file."
+        (lisp  tools)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-toolbar.el"
+        "Toolbar functions for emacs-w3"
+        (mouse  toolbar)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-vars.el"
+        "All variable definitions for emacs-w3"
+        (comm  help  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-widget.el"
+        "An image widget"
+        (faces  images)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3-xemac.el"
+        "XEmacs specific functions for emacs-w3"
+        (faces  help  mouse  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("w3.el"
+        "Main functions for emacs-w3 on all platforms/versions"
+        (faces  help  comm  news  mail  processes  mouse  hypermedia)
+        "/home/martin/x/packages/lisp/w3/")
+    ("add-log.el"
+        "change log maintenance commands for Emacs"
+        (maint)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("advice.el"
+        "an overloading mechanism for Emacs Lisp functions"
+        (extensions  lisp  tools)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("annotations.el"
+        "interface to marginal annotations"
+        (extensions  hypermedia  outlines)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("assoc.el"
+        "insert/delete/sort functions on association lists"
+        (extensions)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("case-table.el"
+        "code to extend the character set and support case tables."
+        (i18n)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("chistory.el"
+        "list command history"
+        nil
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("comint-xemacs.el"
+        "Face customizations for comint"
+        (help  faces)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("comint.el"
+        "general command interpreter in a window stuff"
+        (processes)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("compile.el"
+        "run compiler as inferior of Emacs, parse error messages."
+        (tools  processes)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("debug.el"
+        "debuggers and related commands for XEmacs"
+        nil
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("ebuff-menu.el"
+        "electric-buffer-list mode"
+        (frames)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("echistory.el"
+        "Electric Command History Mode"
+        (extensions)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("edmacro.el"
+        "keyboard macro editor"
+        (abbrev  internal)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("ehelp.el"
+        "bindings for electric-help mode"
+        (help  extensions)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("electric.el"
+        "window maker and Command loop for `electric' modes."
+        (extensions)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("enriched.el"
+        "read and save files in text/enriched format"
+        (wp  faces)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("env.el"
+        "functions to manipulate environment variables."
+        (processes  unix)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("facemenu.el"
+        "create a face menu for interactively adding fonts to text"
+        (faces)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("ffap.el"
+        "find file (or url) at point"
+        (files  hypermedia  matching  mouse)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("helper.el"
+        "utility help package supporting help in electric modes"
+        (help)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("imenu.el"
+        "Framework for mode-specific buffer indexes."
+        (tools)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("iso-syntax.el"
+        "set up case-conversion and syntax tables for ISO 8859/1"
+        (i18n)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("macros.el"
+        "non-primitive commands for keyboard macros."
+        (abbrev)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("novice.el"
+        "handling of disabled commands (\"novice mode\") for XEmacs."
+        (internal  help)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("outline.el"
+        "outline mode commands for Emacs"
+        (outlines)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("passwd.el"
+        "Prompting for passwords semi-securely"
+        (comm  extensions)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("pp.el"
+        "pretty printer for Emacs Lisp"
+        (lisp  tools  language  extensions)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("regi.el"
+        "REGular expression Interpreting engine"
+        (extensions  matching)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("ring.el"
+        "handle rings of items"
+        (extensions)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("shell.el"
+        "specialized comint.el for running the shell."
+        (processes shell terminal csh tcsh bash sh)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("skeleton.el"
+        "Lisp language extension for writing statement skeletons"
+        (extensions  abbrev  languages  tools)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("sort.el"
+        "commands to sort text in an XEmacs buffer."
+        (unix)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("thing.el"
+        "find language-specific contiguous pieces of text"
+        (extensions  languages)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("time-stamp.el"
+        "Maintain last change time stamps in files edited by Emacs"
+        (tools)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("timezone.el"
+        "time zone package for XEmacs"
+        (news)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("xbm-button.el"
+        "Create XBM text buttons under XEmacs"
+        (frames  internal)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("xpm-button.el"
+        "create XPM buttons"
+        (frames  internal)
+        "/home/martin/x/packages/lisp/xemacs-base/")
+    ("bench.el"
+        "benchmarking utility for emacsen"
+        (internal  maint)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("docref.el"
+        "Simple cross references for Elisp documentation strings"
+        (docs  help  lisp)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("eldoc.el"
+        "show function arglist or variable docstring in echo area"
+        (extensions)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("elp.el"
+        "Emacs Lisp Profiler"
+        (debugging lisp tools)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("eval-expr.el"
+        "enhanced eval-expression command"
+        (extensions)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("find-func.el"
+        "find the definition of the Emacs Lisp function near point"
+        (emacs-lisp  functions  variables)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("find-gc.el"
+        "detect functions that call the garbage collector"
+        (maint)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("hide-copyleft.el"
+        "hide obnoxious copyright prologs"
+        nil
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("ielm.el"
+        "interaction mode for Emacs Lisp"
+        (lisp)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("pretty-print.el"
+        "Emacs Lisp pretty printer and macro expander"
+        (lisp  internal)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("profile.el"
+        "basic profiling commands for XEmacs"
+        (internal)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("regexp-opt.el"
+        "generate efficient regexps to match strings."
+        (strings  regexps)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("reposition.el"
+        "center a Lisp function or comment on the screen"
+        nil
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("trace.el"
+        "tracing facility for Emacs Lisp functions"
+        (tools  lisp)
+        "/home/martin/x/packages/lisp/xemacs-devel/")
+    ("zenirc-18.el"
+        "compatibility functions for Emacs 18"
+        (extensions  zenirc)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-8ball.el"
+        "magic 8 ball for ZenIRC"
+        (zenirc  extensions  magic  8ball)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-away.el"
+        "fancy away processing for ZenIRC"
+        (zenirc  extensions  oink)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-bork.el"
+        "Swedish Chef message catalog for ZenIRC"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-color.el"
+        "color messages in zenirc"
+        (zenirc extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-complete.el"
+        "complete commands, nicknames, etc. in ZenIRC"
+        (zenirc  completion  extensions  oink)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-dcc.el"
+        "CTCP DCC module for ZenIRC"
+        (zenirc  extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-doto.el"
+        "do things to who, list, links replies"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-eval.el"
+        "join the \"mi emacs es tu emacs\" club"
+        (zenirc  extensions  eval  oink)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-fill.el"
+        "fill messages in zenirc"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-finnish.el"
+        "Finnish message catalog for ZenIRC"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-format.el"
+        "format nick!user@host for zenirc"
+        (zenirc  extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-fortran.el"
+        "emulate F-BOT FORTRAN bot program with ZenIRC"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-french.el"
+        "French message catalog for ZenIRC"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-history.el"
+        "keep a history of commands in ZenIRC"
+        (zenirc  history)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-ignore.el"
+        "ignore module for zenirc."
+        (zenirc  ignorance)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-iwantop.el"
+        "IWANTOP ctcp for granting channel operator bits"
+        (zenirc  extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-latin.el"
+        "Latin message catalog for ZenIRC"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-make.el"
+        "a hack to set the load path for byte-compiling"
+        (zenirc  make)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-meditate.el"
+        "admonish others for disturbing your meditation"
+        (zenirc  extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-netsplit.el"
+        "hide excessive spew from netsplits"
+        (zenirc  extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-notify.el"
+        "Notifies you when people signon/off"
+        (zenirc  notify  extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-oink.el"
+        "auto-oink"
+        (zenirc  extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-ojnk.el"
+        "Send ojnks - example of adding commands to zenirc"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-popup.el"
+        "pop up zenirc buffer window on signal"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-prime-p.el"
+        "flag prime numbers"
+        (zenirc  extensions  oink  "mmmm  primes")
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-signal.el"
+        "Fancy signal formatting for ZenIRC"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-stamp.el"
+        "timestamping for ZenIRC"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-swedish.el"
+        "Swedish message catalog for ZenIRC"
+        (extensions)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-yow-filter.el"
+        "neutralize yowage"
+        (zenirc  extensions  oink  yow)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc-yow.el"
+        "important pinheadery for ZenIRC"
+        (zenirc  extensions  oink  yow)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("zenirc.el"
+        "Waste time on Internet Relay Chat (ZenIRC client)"
+        (extensions  zenirc)
+        "/home/martin/x/packages/lisp/zenirc/")
+    ("dui-registry.el"
+        "Registry of dui dictionary methods"
+        (mule  dictionary)
+        "/home/martin/x/mule-packages/lisp/edict/")
+    ("dui.el"
+        "Dictionary user interface"
+        (mule  dictionary)
+        "/home/martin/x/mule-packages/lisp/edict/")
+    ("edict-edit.el"
+        "Edit an EDICT dictionary."
+        (mule  edict  dictionary)
+        "/home/martin/x/mule-packages/lisp/edict/")
+    ("edict-english.el"
+        "English morphology rules for edict.el"
+        (mule  edict  dictionary)
+        "/home/martin/x/mule-packages/lisp/edict/")
+    ("edict-japanese.el"
+        "Japanese morphology rules for edict.el"
+        (mule  edict  dictionary)
+        "/home/martin/x/mule-packages/lisp/edict/")
+    ("edict-morphology.el"
+        "morphology rewrite engine for edict.el"
+        (mule  edict  dictionary)
+        "/home/martin/x/mule-packages/lisp/edict/")
+    ("edict.el"
+        "Word lookup (with deinflection) in EDICT"
+        (mule  edict  dictionary)
+        "/home/martin/x/mule-packages/lisp/edict/")
+    ("ts-mode.el"
+        "Insert time-stamps in buffers"
+        (minor mode)
+        "/home/martin/x/mule-packages/lisp/edict/")
+    ("egg-cwnn-leim.el"
+        "Egg/CWnn-related code for LEIM"
+        (japanese  input method  leim)
+        "/home/martin/x/mule-packages/lisp/egg-its/")
+    ("egg-kwnn-leim.el"
+        "Egg/CWnn-related code for LEIM"
+        (japanese  input method  leim)
+        "/home/martin/x/mule-packages/lisp/egg-its/")
+    ("egg-leim.el"
+        "Egg/Wnn-related code for LEIM"
+        (japanese  input method  leim)
+        "/home/martin/x/mule-packages/lisp/egg-its/")
+    ("egg-sj3-leim.el"
+        "Egg/SJ3-related code for LEIM"
+        (japanese  input method  leim)
+        "/home/martin/x/mule-packages/lisp/egg-its/")
+    ("egg-wnn.el"
+        "a inputting method communicating with [jck]server"
+        (inputting method)
+        "/home/martin/x/mule-packages/lisp/egg-its/")
+    ("cyril-jis.el"
+        "Quail package for inputting JISX0208 Cyrillic letters"
+        (multilingual  input method  cyrillic)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("cyrillic.el"
+        "Quail package for inputting Cyrillic characters"
+        (multilingual  input method  cyrillic)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("greek.el"
+        "Quail package for inputting Greek"
+        (multilingual  input method  greek)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("hangul.el"
+        "Quail package for inputting Korean Hangul characters"
+        (multilingual  input method  korean  hangul)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("hangul3.el"
+        "Quail package for inputting Korean Hangul characters"
+        (multilingual  input method  korean  hangul)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("hanja-jis.el"
+        "Quail package for inputting Korean Hanja (JISX0208)"
+        (multilingual  input method  korean  hangul)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("hanja.el"
+        "Quail-package for Korean Hanja (KSC5601)"
+        (multilingual  input method  korean  hanja)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("ipa.el"
+        "Quail package for inputting IPA characters"
+        (multilingual  input method  ipa)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("latin-pre.el"
+        "Quail packages for inputting various European characters."
+        (mule  multilingual  latin  input method)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("leim-list.el"
+        "list of LEIM (Library of Emacs Input Method)"
+        nil
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("py-punct.el"
+        "Quail packages for Chinese (pinyin + extra symbols)"
+        (multilingual  input method  chienese)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("pypunct-b5.el"
+        "Quail packages for Chinese (pinyin + extra symbols)"
+        (multilingual  input method  chienese)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("quail.el"
+        "Provides simple input method for multilingual text"
+        (mule  multilingual  input method)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("symbol-ksc.el"
+        "Quail-package for Korean Symbol (KSC5601)"
+        (multilingual  input method  korean  hangul)
+        "/home/martin/x/mule-packages/lisp/leim/")
+    ("arabic.el"
+        "pre-loaded support for Arabic."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("canna-leim.el"
+        "Canna-related code for LEIM"
+        (japanese  input method  leim)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("canna.el"
+        "Interface to the Canna input method."
+        (canna  japanese  input method  mule  multilingual)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("char-table.el"
+        "display table of charset"
+        (character  mule)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("chartblxmas.el"
+        "display table of charset by pop-up menu"
+        (character  xemacs/mule)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("china-util.el"
+        "utilities for Chinese"
+        (mule  multilingual  chinese)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("chinese.el"
+        "Support for Chinese"
+        (multilingual  chinese)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("cyril-util.el"
+        "utilities for Cyrillic scripts"
+        (mule  multilingual  cyrillic)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("english.el"
+        "English support"
+        (multibyte character  character set  syntax  category)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("european.el"
+        "Support for European languages"
+        (multilingual  european)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("hebrew.el"
+        "Support for Hebrew"
+        (multilingual  hebrew)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("isearch-mule.el"
+        "incremental search with front-end inputting method"
+        (search)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("japan-util.el"
+        "utilities for Japanese"
+        (mule  multilingual  japanese)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("japanese.el"
+        "Japanese support"
+        (multilingual  japanese)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("kinsoku.el"
+        "Kinsoku (line wrap) processing for XEmacs/Mule"
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("korean.el"
+        "Support for Korean"
+        (multilingual  korean)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("misc-lang.el"
+        "support for miscellaneous languages (characters)"
+        (multilingual  character set  coding system)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-category.el"
+        "category functions for XEmacs/Mule."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-ccl.el"
+        "CCL (Code Conversion Language) compiler"
+        (ccl  mule  multilingual  character set  coding-system)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-charset.el"
+        "Charset functions for Mule."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-cmds.el"
+        "Commands for multilingual environment"
+        (mule  multilingual)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-cne.el"
+        "interface between input methods Canna and EGG."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-coding.el"
+        "Coding-system functions for Mule."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-debug.el"
+        "debugging functions for Mule."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-diag.el"
+        "Show diagnosis of multilingual environment (MULE)"
+        (multilingual  charset  coding system  fontset  diagnosis)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-files.el"
+        "File I/O functions for XEmacs/Mule."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-help.el"
+        "Mule-ized Help functions "
+        (help  internal)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-keyboard.el"
+        "Direct input of multilingual chars from keyboard."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-misc.el"
+        "Miscellaneous Mule functions."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-tty-init.el"
+        "Initialization code for console tty under MULE"
+        (mule  tty  console  dumped)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-util.el"
+        "Utility functions for multilingual environment (mule)"
+        (mule  multilingual)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("mule-x-init.el"
+        "initialization code for X Windows under MULE"
+        (mule x11)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("thai-util.el"
+        "utilities for Thai"
+        (mule  multilingual  thai)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("thai.el"
+        "Support for Thai"
+        (multilingual  thai)
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("viet-chars.el"
+        "pre-loaded support for Vietnamese, part 1."
+        nil
+        "/home/martin/x/mule-packages/lisp/mule-base/")
+    ("skk-auto.el"
+        "\e$BAw$j2>L>$N<+F0=hM}$N$?$a$N%W%m%0%i%`\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-comp.el"
+        "\e$BJd40$N$?$a$N%W%m%0%i%`\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-foreword.el"
+        "\e$BA0=q$-\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-gadget.el"
+        "\e$B<B9TJQ49$N$?$a$N%W%m%0%i%`\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-kakasi.el"
+        "KAKASI \e$B4XO"%W%m%0%i%`\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-kcode.el"
+        "\e$B4A;z%3!<%I$r;H$C$?JQ49$N$?$a$N%W%m%0%i%`\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-leim.el"
+        "SKK related code for LEIM"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-menu.el"
+        "SKK Menul related functions."
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-num.el"
+        "\e$B?tCMJQ49$N$?$a$N%W%m%0%i%`\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-server.el"
+        "SKK \e$B%5!<%P!<$N$?$a$N%W%m%0%i%`\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-tree.el"
+        "\e$BLZ7A<0%G!<%?!<$r;H$C$?JQ49$N$?$a$N%W%m%0%i%`\e(B"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-vip.el"
+        "vip related functions for skk.el"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("skk-viper.el"
+        "SKK related code for Viper"
+        (japanese)
+        "/home/martin/x/mule-packages/lisp/skk/")
+    ("abbrev.el"
+        "abbrev mode commands for Emacs"
+        (abbrev  dumped)
+        "lisp/")
+    ("about.el"
+        "the About The Authors page (shameless self promotion)."
+        (extensions)
+        "lisp/")
+    ("alist.el"
+        "utility functions about assoc-list"
+        (alist)
+        "lisp/")
+    ("apropos.el"
+        "apropos commands for users and programmers."
+        (help)
+        "lisp/")
+    ("auto-save.el"
+        "Safer autosaving for EFS and tmp."
+        (extensions  dumped)
+        "lisp/")
+    ("auto-show.el"
+        "perform automatic horizontal scrolling as point moves"
+        (extensions  internal  dumped)
+        "lisp/")
+    ("autoload.el"
+        "maintain autoloads in loaddefs.el."
+        (maint)
+        "lisp/")
+    ("backquote.el"
+        "Full backquote support for elisp.  Reverse compatible too."
+        (extensions  dumped)
+        "lisp/")
+    ("blessmail.el"
+        "Decide whether movemail needs special privileges."
+        (internal)
+        "lisp/")
+    ("buff-menu.el"
+        "buffer menu main function and support functions."
+        (extensions  dumped)
+        "lisp/")
+    ("buffer.el"
+        "buffer routines taken from C"
+        (internal  dumped)
+        "lisp/")
+    ("build-report.el"
+        "Automatically formatted build reports for XEmacs"
+        (internal)
+        "lisp/")
+    ("byte-optimize.el"
+        "the optimization passes of the emacs-lisp byte compiler."
+        (internal)
+        "lisp/")
+    ("bytecomp-runtime.el"
+        "byte-compiler support for inlining"
+        (internal  dumped)
+        "lisp/")
+    ("bytecomp.el"
+        "compilation of Lisp code into byte code."
+        (internal)
+        "lisp/")
+    ("callers-of-rpt.el"
+        "generate call graph of lisp in XEmacs"
+        (internal)
+        "lisp/")
+    ("check-features.el"
+        "Do a sanity check on an XEmacs build"
+        (internal)
+        "lisp/")
+    ("cl-compat.el"
+        "Common Lisp extensions for GNU Emacs Lisp (compatibility)"
+        (extensions)
+        "lisp/")
+    ("cl-extra.el"
+        "Common Lisp extensions for GNU Emacs Lisp (part two)"
+        (extensions  dumped)
+        "lisp/")
+    ("cl-macs.el"
+        "Common Lisp extensions for GNU Emacs Lisp (part four)"
+        (extensions)
+        "lisp/")
+    ("cl-seq.el"
+        "Common Lisp extensions for GNU Emacs Lisp (part three)"
+        (extensions  dumped)
+        "lisp/")
+    ("cl.el"
+        "Common Lisp extensions for GNU Emacs Lisp"
+        (extensions  dumped  lisp)
+        "lisp/")
+    ("cleantree.el"
+        "Remove out of date .elcs in lisp directories"
+        (internal)
+        "lisp/")
+    ("cmdloop.el"
+        "support functions for the top-level command loop."
+        (internal  dumped)
+        "lisp/")
+    ("code-files.el"
+        "File I/O functions for XEmacs."
+        nil
+        "lisp/")
+    ("code-process.el"
+        "Process coding functions for XEmacs."
+        (mule  multilingual  coding system  process)
+        "lisp/")
+    ("coding.el"
+        "Coding-system functions for XEmacs."
+        nil
+        "lisp/")
+    ("config.el"
+        "access configuration parameters"
+        (configure)
+        "lisp/")
+    ("console.el"
+        "miscellaneous console functions not written in C"
+        (internal  dumped)
+        "lisp/")
+    ("cus-dep.el"
+        "Find customization dependencies."
+        (internal)
+        "lisp/")
+    ("cus-edit.el"
+        "Tools for customizating Emacs and Lisp packages."
+        (help  faces)
+        "lisp/")
+    ("cus-face.el"
+        "Support for Custom faces."
+        (help  faces)
+        "lisp/")
+    ("cus-load.el"
+        "Batch load all available cus-load files"
+        (internal  help  faces)
+        "lisp/")
+    ("cus-start.el"
+        "define customization properties of builtins."
+        (internal  dumped)
+        "lisp/")
+    ("custom.el"
+        "Tools for declaring and initializing options."
+        (help  faces  dumped)
+        "lisp/")
+    ("derived.el"
+        "allow inheritance of major modes."
+        (extensions  dumped)
+        "lisp/")
+    ("device.el"
+        "miscellaneous device functions not written in C"
+        (internal  dumped)
+        "lisp/")
+    ("dialog.el"
+        "Dialog-box support for XEmacs"
+        (extensions  internal  dumped)
+        "lisp/")
+    ("disass.el"
+        "disassembler for compiled Emacs Lisp code"
+        (internal)
+        "lisp/")
+    ("disp-table.el"
+        "functions for dealing with char tables."
+        (i18n  internal)
+        "lisp/")
+    ("dragdrop.el"
+        "window system-independent Drag'n'Drop support."
+        (drag  drop  dumped)
+        "lisp/")
+    ("dump-paths.el"
+        "set up XEmacs paths for dumping"
+        (internal  dumped)
+        "lisp/")
+    ("etags.el"
+        "etags facility for Emacs"
+        (tools)
+        "lisp/")
+    ("events.el"
+        "event functions for XEmacs."
+        (internal  event  dumped)
+        "lisp/")
+    ("extents.el"
+        "miscellaneous extent functions not written in C"
+        (internal  dumped)
+        "lisp/")
+    ("faces.el"
+        "Lisp interface to the C \"face\" structure"
+        (faces  internal  dumped)
+        "lisp/")
+    ("files-nomule.el"
+        "file I/O stubs when not under Mule."
+        (extensions  dumped)
+        "lisp/")
+    ("files.el"
+        "file input and output commands for XEmacs."
+        (extensions  dumped)
+        "lisp/")
+    ("fill.el"
+        "fill commands for XEmacs."
+        (wp  dumped)
+        "lisp/")
+    ("find-paths.el"
+        "setup various XEmacs paths"
+        (internal  dumped)
+        "lisp/")
+    ("finder.el"
+        "topic & keyword-based code finder"
+        (help)
+        "lisp/")
+    ("float-sup.el"
+        "detect absence of floating-point support in XEmacs runtime"
+        (internal  dumped)
+        "lisp/")
+    ("font-lock.el"
+        "decorating source files with fonts/colors based on syntax"
+        (languages  faces)
+        "lisp/")
+    ("font.el"
+        "New font model"
+        (faces)
+        "lisp/")
+    ("fontl-hooks.el"
+        "pre-loaded stuff for font-lock."
+        nil
+        "lisp/")
+    ("format.el"
+        "read and save files in multiple formats"
+        (extensions  dumped)
+        "lisp/")
+    ("frame.el"
+        "multi-frame management independent of window systems."
+        (internal  dumped)
+        "lisp/")
+    ("glyphs.el"
+        "Lisp interface to C glyphs"
+        (extensions  internal  dumped)
+        "lisp/")
+    ("gnuserv.el"
+        "Lisp interface code between Emacs and gnuserv"
+        (environment  processes  terminals)
+        "lisp/")
+    ("gui.el"
+        "Basic GUI functions for XEmacs."
+        (internal  dumped)
+        "lisp/")
+    ("help-macro.el"
+        "Makes command line help such as help-for-help"
+        nil
+        "lisp/")
+    ("help-nomule.el"
+        "Help functions when not in Mule"
+        (help  internal  dumped)
+        "lisp/")
+    ("help.el"
+        "help commands for XEmacs."
+        (help  internal  dumped)
+        "lisp/")
+    ("hyper-apropos.el"
+        "Hypertext emacs lisp documentation interface."
+        (lisp  tools  help  docs  matching)
+        "lisp/")
+    ("indent.el"
+        "indentation commands for XEmacs"
+        (lisp  languages  tools  dumped)
+        "lisp/")
+    ("info.el"
+        "info package for Emacs."
+        (help)
+        "lisp/")
+    ("isearch-mode.el"
+        "Incremental search minor mode."
+        (extensions  dumped)
+        "lisp/")
+    ("iso8859-1.el"
+        "Set case and syntax tables for Latin 1"
+        (internal  dumped)
+        "lisp/")
+    ("itimer-autosave.el"
+        "Autosave functions with itimers"
+        (internal  dumped)
+        "lisp/")
+    ("keydefs.el"
+        "Define standard keybindings."
+        (internal  dumped)
+        "lisp/")
+    ("keymap.el"
+        "Keymap functions for XEmacs."
+        (internals  dumped)
+        "lisp/")
+    ("ldap.el"
+        "LDAP support for Emacs"
+        (help comm)
+        "lisp/")
+    ("lib-complete.el"
+        "Completion on the lisp search path"
+        (lisp  extensions  dumped)
+        "lisp/")
+    ("lisp-mnt.el"
+        "minor mode for Emacs Lisp maintainers"
+        (docs  maint)
+        "lisp/")
+    ("lisp-mode.el"
+        "Lisp mode, and its idiosyncratic commands."
+        (lisp  languages  dumped)
+        "lisp/")
+    ("lisp.el"
+        "Lisp editing commands for XEmacs"
+        (lisp  languages  dumped)
+        "lisp/")
+    ("list-mode.el"
+        "Major mode for buffers containing lists of items"
+        (extensions  dumped)
+        "lisp/")
+    ("loaddefs.el"
+        "define standard autoloads of other files"
+        (internal)
+        "lisp/")
+    ("loadhist.el"
+        "lisp functions for working with feature groups"
+        (internal  dumped)
+        "lisp/")
+    ("loadup.el"
+        "load up standardly loaded Lisp files for XEmacs."
+        (internal  dumped)
+        "lisp/")
+    ("make-docfile.el"
+        "Cache docstrings in external file"
+        (internal)
+        "lisp/")
+    ("map-ynp.el"
+        "General-purpose boolean question-asker."
+        (lisp  extensions  dumped)
+        "lisp/")
+    ("menubar-items.el"
+        "Menubar and popup-menu content for XEmacs."
+        (frames  extensions  internal  dumped)
+        "lisp/")
+    ("menubar.el"
+        "Menubar support for XEmacs"
+        (internal  extensions  dumped)
+        "lisp/")
+    ("minibuf.el"
+        "Minibuffer functions for XEmacs"
+        (internal  dumped)
+        "lisp/")
+    ("misc.el"
+        "miscellaneous functions for XEmacs"
+        (extensions  dumped)
+        "lisp/")
+    ("mode-motion.el"
+        "Mode-specific mouse-highlighting of text."
+        (internal  mouse  dumped)
+        "lisp/")
+    ("modeline.el"
+        "modeline hackery."
+        (extensions  dumped)
+        "lisp/")
+    ("mouse.el"
+        "window system-independent mouse support."
+        (mouse  dumped)
+        "lisp/")
+    ("msw-faces.el"
+        "mswindows-specific face stuff."
+        nil
+        "lisp/")
+    ("msw-glyphs.el"
+        "Support for glyphs in ms windows"
+        (extensions  internal  dumped)
+        "lisp/")
+    ("msw-init.el"
+        "initialization code for mswindows"
+        nil
+        "lisp/")
+    ("msw-mouse.el"
+        "Mouse support for MS Windows."
+        (mouse  dumped)
+        "lisp/")
+    ("msw-select.el"
+        "Lisp interface to mswindows selections."
+        (extensions  dumped)
+        "lisp/")
+    ("multicast.el"
+        "lisp frontend for multicast connections in XEmacs"
+        (dumped comm processes)
+        "lisp/")
+    ("mwheel.el"
+        "Mouse support for MS intelli-mouse type mice"
+        (mouse)
+        "lisp/")
+    ("objects.el"
+        "Lisp interface to C window-system objects"
+        (faces  internal  dumped)
+        "lisp/")
+    ("obsolete.el"
+        "obsoleteness support"
+        (internal  dumped)
+        "lisp/")
+    ("package-admin.el"
+        "Installation and Maintenance of XEmacs packages"
+        (internal)
+        "lisp/")
+    ("package-get.el"
+        "Retrieve XEmacs package"
+        (internal)
+        "lisp/")
+    ("package-info.el"
+        "Generate information about an XEmacs package"
+        (internal)
+        "lisp/")
+    ("packages.el"
+        "Low level support for XEmacs packages"
+        (internal  lisp  dumped)
+        "lisp/")
+    ("page.el"
+        "page motion commands for emacs."
+        (extensions  dumped)
+        "lisp/")
+    ("paragraphs.el"
+        "paragraph and sentence parsing."
+        (wp  dumped)
+        "lisp/")
+    ("paths.el"
+        "define pathnames for use by various Emacs commands."
+        (internal  dumped)
+        "lisp/")
+    ("picture.el"
+        "\"Picture mode\" -- editing using quarter-plane screen model."
+        nil
+        "lisp/")
+    ("process.el"
+        "commands for subprocesses; split out of simple.el"
+        (internal  processes  dumped)
+        "lisp/")
+    ("rect.el"
+        "rectangle functions for XEmacs."
+        (internal)
+        "lisp/")
+    ("register.el"
+        "register commands for Emacs."
+        (internal  dumped)
+        "lisp/")
+    ("replace.el"
+        "search and replace commands for XEmacs."
+        (dumped  matching)
+        "lisp/")
+    ("scrollbar.el"
+        "Scrollbar support for XEmacs"
+        (internal  extensions  dumped)
+        "lisp/")
+    ("select.el"
+        "Lisp interface to windows selections."
+        (extensions  dumped)
+        "lisp/")
+    ("setup-paths.el"
+        "setup various XEmacs paths"
+        (internal  dumped)
+        "lisp/")
+    ("shadow.el"
+        "Locate Emacs Lisp file shadowings."
+        (lisp)
+        "lisp/")
+    ("simple.el"
+        "basic editing commands for XEmacs"
+        (lisp  extensions  internal  dumped)
+        "lisp/")
+    ("site-load.el"
+        "Template file for site-wide XEmacs customization"
+        (internal)
+        "lisp/")
+    ("sound.el"
+        "Loading sound files in XEmacs"
+        (internal)
+        "lisp/")
+    ("specifier.el"
+        "Lisp interface to specifiers"
+        (internal  dumped)
+        "lisp/")
+    ("startup.el"
+        "process XEmacs shell arguments"
+        (internal  dumped)
+        "lisp/")
+    ("subr.el"
+        "basic lisp subroutines for XEmacs"
+        (extensions  dumped)
+        "lisp/")
+    ("symbol-syntax.el"
+        "find chars with symbol syntax"
+        (matching)
+        "lisp/")
+    ("symbols.el"
+        "functions for working with symbols and symbol values"
+        (internal)
+        "lisp/")
+    ("syntax.el"
+        "Syntax-table hacking stuff, moved from syntax.c"
+        nil
+        "lisp/")
+    ("text-mode.el"
+        "text mode, and its idiosyncratic commands."
+        (wp  dumped)
+        "lisp/")
+    ("text-props.el"
+        "implements properties of characters"
+        (extensions  wp  faces  dumped)
+        "lisp/")
+    ("toolbar-items.el"
+        "Static initialization of XEmacs toolbar"
+        (frames  dumped)
+        "lisp/")
+    ("toolbar.el"
+        "Toolbar support for XEmacs"
+        (extensions  internal  dumped)
+        "lisp/")
+    ("tty-init.el"
+        "initialization code for tty's"
+        (terminals  dumped)
+        "lisp/")
+    ("undo-stack.el"
+        "An \"undoable stack\" object."
+        (extensions  dumped)
+        "lisp/")
+    ("update-elc.el"
+        "Bytecompile out-of-date dumped files"
+        (internal)
+        "lisp/")
+    ("userlock.el"
+        "handle file access contention between multiple users"
+        (internal)
+        "lisp/")
+    ("version.el"
+        "Record version number of Emacs."
+        (internal  dumped)
+        "lisp/")
+    ("very-early-lisp.el"
+        "Lisp support always needed by temacs"
+        (internal  dumped)
+        "lisp/")
+    ("view-less.el"
+        "Minor mode for browsing files with keybindings like `less'"
+        (wp  unix)
+        "lisp/")
+    ("wid-browse.el"
+        "Functions for browsing widgets."
+        (extensions)
+        "lisp/")
+    ("wid-edit.el"
+        "Functions for creating and using widgets."
+        (extensions)
+        "lisp/")
+    ("widget.el"
+        "a library of user interface components."
+        (help  extensions  faces  hypermedia  dumped)
+        "lisp/")
+    ("window-xemacs.el"
+        "XEmacs window commands aside from those written in C."
+        (frames  extensions  dumped)
+        "lisp/")
+    ("window.el"
+        "XEmacs window commands aside from those written in C."
+        (frames  extensions  dumped)
+        "lisp/")
+    ("winnt.el"
+        "Lisp routines for Windows NT."
+        (mouse  dumped)
+        "lisp/")
+    ("x-compose.el"
+        "Compose-key processing in XEmacs"
+        (i18n)
+        "lisp/")
+    ("x-faces.el"
+        "X-specific face frobnication, aka black magic."
+        (extensions  internal  dumped)
+        "lisp/")
+    ("x-font-menu.el"
+        "Managing menus of X fonts."
+        nil
+        "lisp/")
+    ("x-init.el"
+        "initialization code for X windows"
+        (terminals  dumped)
+        "lisp/")
+    ("x-iso8859-1.el"
+        "Mapping between X keysym names and ISO 8859-1"
+        (extensions  internal  dumped)
+        "lisp/")
+    ("x-misc.el"
+        "miscellaneous X functions."
+        (extensions  dumped)
+        "lisp/")
+    ("x-mouse.el"
+        "Mouse support for X window system."
+        (mouse  dumped)
+        "lisp/")
+    ("x-scrollbar.el"
+        "scrollbar resourcing and such."
+        (extensions  dumped)
+        "lisp/")
+    ("x-select.el"
+        "Lisp interface to X Selections."
+        (extensions  dumped)
+        "lisp/")
+    ("x-win-sun.el"
+        "runtime initialization for Sun X servers and keyboards"
+        (terminals)
+        "lisp/")
+    ("x-win-xfree86.el"
+        "runtime initialization for XFree86 servers"
+        (terminals)
+        "lisp/")
+    ("AT386.el"
+        "terminal support package for IBM AT keyboards"
+        (terminals)
+        "lisp/term/")
+    ("apollo.el"
+        "Apollo Graphics Primitive Support Functions"
+        (hardware)
+        "lisp/term/")
+    ("bg-mouse.el"
+        "GNU Emacs code for BBN Bitgraph mouse."
+        (hardware)
+        "lisp/term/")
+    ("internal.el"
+        "setup support for PC keyboards and screens, internal terminal"
+        nil
+        "lisp/term/")
+    ("keyswap.el"
+        "swap BS and DEL keys"
+        (terminals)
+        "lisp/term/")
+    ("linux.el"
+        "define function key sequences for the Linux console"
+        (terminals)
+        "lisp/term/")
+    ("lk201.el"
+        "basic editing commands for XEmacs"
+        nil
+        "lisp/term/")
+    ("news.el"
+        "keypad and function key bindings for the Sony NEWS keyboard"
+        (terminals)
+        "lisp/term/")
+    ("pc-win.el"
+        "setup support for `PC windows' (whatever that is)."
+        nil
+        "lisp/term/")
+    ("scoansi.el"
+        "set up key names for SCO ansi console"
+        nil
+        "lisp/term/")
+    ("sun-mouse.el"
+        "mouse handling for Sun windows"
+        (hardware)
+        "lisp/term/")
+    ("sun.el"
+        "keybinding for standard default sunterm keys"
+        (terminals)
+        "lisp/term/")
+    ("sup-mouse.el"
+        "supdup mouse support for lisp machines"
+        (hardware)
+        "lisp/term/")
+    ("tvi970.el"
+        "terminal support for the Televideo 970"
+        (terminals)
+        "lisp/term/")
+    ("vt-control.el"
+        "Common VTxxx control functions"
+        (terminals)
+        "lisp/term/")
+    ("vt100-led.el"
+        "functions for LED control on VT-100 terminals & clones."
+        (hardware)
+        "lisp/term/")
+    ("vt100.el"
+        "define VT100 function key sequences in function-key-map"
+        (terminals)
+        "lisp/term/")
+    ("win32-win.el"
+        "parse switches controlling interface with win32"
+        (terminals)
+        "lisp/term/")
+    ("wyse50.el"
+        "terminal support code for Wyse 50"
+        (terminals)
+        "lisp/term/")
+    ("xterm.el"
+        "define function key sequences for xterm"
+        (terminals)
+        "lisp/term/")
+))
+
+(provide 'finder-inf)
+
+;;; finder-inf.el ends here
diff --git a/lisp/mule/mule-files.el b/lisp/mule/mule-files.el
new file mode 100644 (file)
index 0000000..e228426
--- /dev/null
@@ -0,0 +1,35 @@
+;;; mule-files.el --- File I/O functions for XEmacs/Mule.
+
+;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc.
+;; Copyright (C) 1995 Amdahl Corporation.
+;; Copyright (C) 1995 Sun Microsystems.
+
+;; 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.
+
+;;; Commentary:
+
+;;; Derived from mule.el in the original Mule but heavily modified
+;;; by Ben Wing. Mostly moved to code-files.el
+
+;; 1997/3/11 modified by MORIOKA Tomohiko to sync with Emacs 20 API.
+
+;;; Code:
+
+(setq-default buffer-file-coding-system 'iso-2022-8)
+
+;;; mule-files.el ends here
index e71fa7a..a205c6b 100644 (file)
@@ -346,7 +346,7 @@ Multibyte characters are concerned."
 
 ;; ### This function is not compatible with FSF in some cases.  Hard
 ;; to fix, because it is hard to trace the logic of the FSF function.
-;; In case we need the exact behavior, we can always copy the FSF
+;; In case we need the exact behaviour, we can always copy the FSF
 ;; version, which is very long and does lots of unnecessary stuff.
 (defun truncate-string-to-width (str end-column &optional start-column padding)
   "Truncate string STR to end at column END-COLUMN.
@@ -377,5 +377,4 @@ the resulting string may be narrower than END-COLUMN."
 
 (make-obsolete 'function-called-at-point 'function-at-point)
 
-(provide 'obsolete)
 ;;; obsolete.el ends here
diff --git a/lisp/package-get-base.el b/lisp/package-get-base.el
new file mode 100644 (file)
index 0000000..7eeebbd
--- /dev/null
@@ -0,0 +1,1466 @@
+(setq package-get-base
+'((eudc
+  (standards-version 1.0
+   version "1.09"
+   author-version "1.09"
+   date "1998-06-30"
+   build-date "1998-06-30"
+   maintainer "Oscar Figueiredo <Oscar.Figueiredo@epfl.ch>"
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "Emacs Unified Directory Client (LDAP, PH)."
+   filename "eudc-1.09-pkg.tar.gz"
+   md5sum "517bfd3112700fd3dcfc59e02bbb0b12"
+   size 40867
+   provides (eudc eudc-ldap eudc-ph)
+   requires (fsf-compat xemacs-base)
+   type regular
+))
+(footnote
+  (standards-version 1.0
+   version "1.03"
+   author-version "0.18x"
+   date "1998-06-01"
+   build-date "1998-06-01"
+   maintainer "SL Baur <steve@xemacs.org>"
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "Footnoting in mail message editing modes."
+   filename "footnote-1.03-pkg.tar.gz"
+   md5sum "bea3aa23b37988f690fa56ba8cc11e92"
+   size 18199
+   provides (footnote)
+   requires (mail-lib xemacs-base)
+   type regular
+))
+(gnats
+  (standards-version 1.0
+   version "1.03"
+   author-version "3.101"
+   date "1998-04-06"
+   build-date "1998-04-17"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority high
+   category "comm"
+   dump nil
+   description "XEmacs bug reports."
+   filename "gnats-1.03-pkg.tar.gz"
+   md5sum "2b8f3a25baa78ffd23927ac5bb5777b5"
+   size 126412
+   provides (gnats gnats-admin send-pr)
+   requires (mail-lib xemacs-base)
+   type regular
+))
+(gnus
+  (standards-version 1.0
+   version "1.21"
+   author-version "5.6.23"
+   date "1998-07-06"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "comm"
+   dump nil
+   description "The Gnus Newsreader and Mailreader."
+   filename "gnus-1.21-pkg.tar.gz"
+   md5sum "6d58f34293ec00bbd297a6abb98fe2e9"
+   size 1693384
+   provides (gnus message)
+   requires (gnus w3 mh-e mailcrypt rmail mail-lib xemacs-base)
+   type regular
+))
+(mailcrypt
+  (standards-version 1.0
+   version "1.04"
+   author-version "3.4"
+   date "1998-01-24"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "Support for messaging encryption with PGP."
+   filename "mailcrypt-1.04-pkg.tar.gz"
+   md5sum "66601a110f1499d3c6f815f806e43a71"
+   size 66937
+   provides (mailcrypt)
+   requires (gnus vm mail-lib xemacs-base)
+   type regular
+))
+(mew
+  (standards-version 1.0
+   version "1.0"
+   author-version "1.93b38"
+   date "1998-06-21"
+   build-date "1998-06-21"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "comm"
+   dump nil
+   description "Messaging in an Emacs World."
+   filename "mew-1.0-pkg.tar.gz"
+   md5sum "be366b8dd9495ecb7b3b6a7a46563faa"
+   size 441775
+   provides (mew)
+   requires (mew)
+   type regular
+))
+(mh-e
+  (standards-version 1.0
+   version "1.05"
+   author-version "21.0"
+   date "1998-01-24"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "comm"
+   dump nil
+   description "Front end support for MH."
+   filename "mh-e-1.05-pkg.tar.gz"
+   md5sum "62b8598c55698c74ddfe71e874f0fe5e"
+   size 129257
+   provides (mh-e)
+   requires (mail-lib xemacs-base)
+   type regular
+))
+(net-utils
+  (standards-version 1.0
+   version "1.08"
+   author-version "21.0"
+   date "1998-07-01"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "Miscellaneous Networking Utilities."
+   filename "net-utils-1.08-pkg.tar.gz"
+   md5sum "2591eca88f5ea04272012e479ea8665c"
+   size 107983
+   provides (ilisp-browse-cltl2 emacsbug feedmail metamail net-utils rcompile shadowfile webjump webster-www)
+   requires (w3 efs mail-lib xemacs-base)
+   type single
+))
+(rmail
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0"
+   date "1998-06-28"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "comm"
+   dump nil
+   description "An obsolete Emacs mailer."
+   filename "rmail-1.04-pkg.tar.gz"
+   md5sum "5a4fc73565cb0e9ea62d6b0665ccb013"
+   size 85711
+   provides (rmail rmailsum)
+   requires (tm apel mail-lib xemacs-base)
+   type regular
+))
+(supercite
+  (standards-version 1.0
+   version "1.07"
+   author-version "3.55x"
+   date "1998-05-07"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "An Emacs citation tool for News & Mail messages."
+   filename "supercite-1.07-pkg.tar.gz"
+   md5sum "c1ef998b1819e6b19efd10bf0e48534c"
+   size 71084
+   provides (supercite)
+   requires (mail-lib xemacs-base)
+   type regular
+))
+(tm
+  (standards-version 1.0
+   version "1.09"
+   author-version "21.0"
+   date "1998-06-09"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "comm"
+   dump nil
+   description "Emacs MIME support."
+   filename "tm-1.09-pkg.tar.gz"
+   md5sum "a5697117fc719a9c5a74a62f6b812101"
+   size 253269
+   provides (tm tm-edit tm-view mime-setup)
+   requires (gnus mh-e rmail vm mailcrypt mail-lib apel xemacs-base)
+   type regular
+))
+(vm
+  (standards-version 1.0
+   version "1.09"
+   author-version "6.53"
+   date "1998-06-26"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "comm"
+   dump t
+   description "An Emacs mailer."
+   filename "vm-1.09-pkg.tar.gz"
+   md5sum "a3dd4a14155abf835275120c62ca82fd"
+   size 514307
+   provides (vm)
+   requires (mail-lib xemacs-base)
+   type regular
+))
+(w3
+  (standards-version 1.0
+   version "1.06"
+   author-version "4.0pre18"
+   date "1998-05-01"
+   build-date "1998-05-02"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution experimental
+   priority high
+   category "comm"
+   dump nil
+   description "A Web browser."
+   filename "w3-1.06-pkg.tar.gz"
+   md5sum "fea5098f9e8dd5b3b82e3ebe7d447b9c"
+   size 581731
+   provides (w3 url)
+   requires (w3 mail-lib xemacs-base)
+   type regular
+))
+(cookie
+  (standards-version 1.0
+   version "1.07"
+   author-version "21.0b36"
+   date "1998-04-07"
+   build-date "1998-04-17"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "games"
+   dump nil
+   description "Spook and Yow (Zippy quotes)."
+   filename "cookie-1.07-pkg.tar.gz"
+   md5sum "df97f80082395667a0e23eda8f68b8dd"
+   size 34184
+   provides (cookie1 yow)
+   requires (xemacs-base)
+   type regular
+))
+(games
+  (standards-version 1.0
+   version "1.05"
+   author-version "1.04"
+   date "1998-06-04"
+   build-date "1998-07-09"
+   maintainer "Glynn Clements <glynn@sensei.co.uk>"
+   distribution stable
+   priority low
+   category "games"
+   dump nil
+   description "Tetris, Sokoban, and Snake."
+   filename "games-1.05-pkg.tar.gz"
+   md5sum "2b856bc25a05ad32400bdd947fec6231"
+   size 32000
+   provides (gamegrid snake tetris sokoban)
+   requires (xemacs-base)
+   type regular
+))
+(mine
+  (standards-version 1.0
+   version "1.05"
+   author-version "1.8x1"
+   date "1998-03-31"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "games"
+   dump nil
+   description "Minehunt Game."
+   filename "mine-1.05-pkg.tar.gz"
+   md5sum "330cd395304f600487b748d466993e06"
+   size 67568
+   provides (xmine)
+   requires (xemacs-base)
+   type regular
+))
+(misc-games
+  (standards-version 1.0
+   version "1.06"
+   author-version "21.0b35"
+   date "1998-03-22"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "games"
+   dump nil
+   description "Other amusements and diversions."
+   filename "misc-games-1.06-pkg.tar.gz"
+   md5sum "48d883e7e6092c227b476386ece41672"
+   size 165586
+   provides (decipher gomoku hanoi life morse rot13)
+   requires (xemacs-base)
+   type single
+))
+(Sun
+  (standards-version 1.0
+   version "1.05"
+   author-version "21.0b35"
+   date "1998-03-06"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution sun
+   priority low
+   category "libs"
+   dump t
+   description "Support for Sparcworks."
+   filename "Sun-1.05-pkg.tar.gz"
+   md5sum "70a776046ea5b12d08ca7276484f6139"
+   size 63826
+   provides (sccs eos-browser eos-common eos-debugger eos-debugger eos-editor eos-init eos-load eos-menubar eos-toolbar sunpro)
+   requires (cc-mode xemacs-base)
+   type regular
+))
+(apel
+  (standards-version 1.0
+   version "1.04"
+   author-version "3.3"
+   date "1998-01-24"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution mule
+   priority high
+   category "libs"
+   dump nil
+   description "A Portable Emacs Library.  Used by XEmacs MIME support."
+   filename "apel-1.04-pkg.tar.gz"
+   md5sum "7082f6eaa80bfef9e655e1c603ff68d3"
+   size 34597
+   provides (atype emu-20 emu-e19 emu-x20 emu-xemacs emu file-detect filename install mule-caesar path-util richtext std11-parse std11 tinyrich)
+   requires (fsf-compat xemacs-base)
+   type regular
+))
+(dired
+  (standards-version 1.0
+   version "1.01"
+   author-version "7.9"
+   date "1998-05-05"
+   build-date "1998-05-05"
+   maintainer "Mike Sperber <sperber@informatik.uni-tuebingen.de>"
+   distribution stable
+   priority medium
+   category "libs"
+   dump nil
+   description "Manage file systems."
+   filename "dired-1.01-pkg.tar.gz"
+   md5sum "d9748d8e8af8a63095aaaab9924987ef"
+   size 187526
+   provides (diff dired)
+   requires (xemacs-base)
+   type regular
+))
+(edebug
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0b35"
+   date "1998-03-12"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "libs"
+   dump nil
+   description "An Emacs Lisp debugger."
+   filename "edebug-1.04-pkg.tar.gz"
+   md5sum "d4a46e9bee361d60cb079731e5b152e9"
+   size 118141
+   provides (edebug cl-read cust-print eval-reg cl-specs)
+   requires (xemacs-base)
+   type regular
+))
+(efs
+  (standards-version 1.0
+   version "1.08"
+   author-version "1.16x1"
+   date "1998-03-21"
+   build-date "1998-04-04"
+   maintainer "Mike Sperber <sperber@informatik.uni-tuebingen.de>"
+   distribution stable
+   priority medium
+   category "libs"
+   dump nil
+   description "Treat files on remote systems the same as local files."
+   filename "efs-1.08-pkg.tar.gz"
+   md5sum "1ec45851fe72d06d32a6f941877ae544"
+   size 347544
+   provides (efs)
+   requires (xemacs-base vm dired)
+   type regular
+))
+(fsf-compat
+  (standards-version 1.0
+   version "1.0"
+   author-version "21.0b39"
+   date "1998-03-25"
+   build-date "1998-05-06"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution mule
+   priority high
+   category "libs"
+   dump nil
+   description "FSF Emacs compatibility files."
+   filename "fsf-compat-1.0-pkg.tar.gz"
+   md5sum "71351ff26a69b341015612d9b88dfc55"
+   size 16083
+   provides (overlay thingatpt timer)
+   requires ()
+   type single
+))
+(mail-lib
+  (standards-version 1.0
+   version "1.16"
+   author-version "21.0"
+   date "1998-06-08"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "libs"
+   dump nil
+   description "Fundamental lisp files for providing email support."
+   filename "mail-lib-1.16-pkg.tar.gz"
+   md5sum "8466339df937c3e7dc4176df85987cf3"
+   size 120230
+   provides (browse-url highlight-headers mail-abbrevs mail-extr mail-utils reporter rfc822 rmail-mini rmailout sendmail smtpmail)
+   requires (xemacs-base)
+   type regular
+))
+(sounds-au
+  (standards-version 1.0
+   version "1.02"
+   author-version "21.0"
+   date "1998-06-30"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority high
+   category "libs"
+   dump nil
+   description "XEmacs Sun sound files."
+   filename "sounds-au-1.02-pkg.tar.gz"
+   md5sum "061ab67267c7cdfe37472141130d19ff"
+   size 125736
+   provides ()
+   requires ()
+   type regular
+))
+(sounds-wav
+  (standards-version 1.0
+   version "1.02"
+   author-version "21.0"
+   date "1998-06-30"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority high
+   category "libs"
+   dump nil
+   description "XEmacs Microsoft sound files."
+   filename "sounds-wav-1.02-pkg.tar.gz"
+   md5sum "c970808088c408bfd780dc8466a848b3"
+   size 148621
+   provides ()
+   requires ()
+   type regular
+))
+(tooltalk
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0b35"
+   date "1998-01-24"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "libs"
+   dump t
+   description "Support for building with Tooltalk."
+   filename "tooltalk-1.04-pkg.tar.gz"
+   md5sum "60ea390c4aa203ea26d66ddb2f3ad99f"
+   size 9245
+   provides ()
+   requires ()
+   type regular
+))
+(xemacs-base
+  (standards-version 1.0
+   version "1.21"
+   author-version "21.0"
+   date "1998-07-02"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution mule
+   priority high
+   category "libs"
+   dump nil
+   description "Fundamental XEmacs support, you almost certainly need this."
+   filename "xemacs-base-1.21-pkg.tar.gz"
+   md5sum "1807f3591bc644c52d41bf472cd30bfc"
+   size 458268
+   provides (add-log advice annotations assoc case-table chistory comint-xemacs comint compile debug ebuff-menu echistory edmacro ehelp electric enriched env facemenu ffap helper imenu iso-syntax macros novice outline overlay passwd pp regi ring shell skeleton sort thing time-stamp timezone xbm-button xpm-button)
+   requires ()
+   type regular
+))
+(xemacs-devel
+  (standards-version 1.0
+   version "1.13"
+   author-version "21.0"
+   date "1998-06-15"
+   build-date "1998-06-19"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "libs"
+   dump nil
+   description "Emacs Lisp developer support."
+   filename "xemacs-devel-1.13-pkg.tar.gz"
+   md5sum "3bec2cd2b955fa86617335ad14480e1a"
+   size 78840
+   provides (docref eldoc elp find-func hide-copyleft ielm regexp-opt trace)
+   requires (xemacs-base)
+   type single
+))
+(edict
+  (standards-version 1.0
+   version "1.03"
+   author-version "0.9.8"
+   date "1998-06-29"
+   build-date "1998-07-09"
+   maintainer "Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>"
+   distribution mule
+   priority high
+   category "mule"
+   dump nil
+   description "Lisp Interface to EDICT, Kanji Dictionary"
+   filename "edict-1.03-pkg.tar.gz"
+   md5sum "0f317174ab3e163780f26c6fcfe0eccb"
+   size 94823
+   provides (dui-registry dui edict-edit edict-english edict-japanese edict-morphology edict-test edict ts-mode)
+   requires (mule-base xemacs-base)
+   type regular
+))
+(egg-its
+  (standards-version 1.0
+   version "1.05"
+   author-version "21.0"
+   date "1998-06-20"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution mule
+   priority high
+   category "mule"
+   dump t
+   description "Wnn (4.2 and 6) support.  SJ3 support."
+   filename "egg-its-1.05-pkg.tar.gz"
+   md5sum "ef131233410ea57fad940b40cb3c786c"
+   size 259670
+   provides (egg-cnpinyin egg-cnzhuyin egg-cwnn-leim egg-jisx0201 egg-jsymbol egg-kwnn-leim egg-leim egg-sj3-client egg-sj3-leim egg-sj3 egg-wnn egg)
+   requires (leim mule-base xemacs-base)
+   type regular
+))
+(leim
+  (standards-version 1.0
+   version "1.07"
+   author-version "21.0b36"
+   date "1998-04-09"
+   build-date "1998-04-17"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution mule
+   priority medium
+   category "mule"
+   dump nil
+   description "Quail.  All non-English and non-Japanese language support."
+   filename "leim-1.07-pkg.tar.gz"
+   md5sum "91ef40389a36d7236ce3e9536c5097e1"
+   size 1744016
+   provides ()
+   requires (mule-base fsf-compat xemacs-base)
+   type regular
+))
+(locale
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0b35"
+   date "1998-03-01"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution mule
+   priority high
+   category "mule"
+   dump nil
+   description "Localized menubars and localized splash screens."
+   filename "locale-1.04-pkg.tar.gz"
+   md5sum "5d6dd1391ac017f4f210a810db2541cb"
+   size 34651
+   provides ()
+   requires (mule-base)
+   type regular
+))
+(mule-base
+  (standards-version 1.0
+   version "1.19"
+   author-version "21.0"
+   date "1998-07-09"
+   build-date "1998-07-09"
+   maintainer "SL Baur <steve@altair.xemacs.org>"
+   distribution mule
+   priority high
+   category "mule"
+   dump t
+   description "Basic Mule support, required for building with Mule."
+   filename "mule-base-1.19-pkg.tar.gz"
+   md5sum "ac5ed26ee38de23d3591c37a283bc7b5"
+   size 488988
+   provides (canna-leim canna char-table china-util cyril-util isearch-ext japan-util ccl can-n-egg mule-help)
+   requires (fsf-compat xemacs-base)
+   type regular
+))
+(skk
+  (standards-version 1.0
+   version "1.06"
+   author-version "10.38"
+   date "1998-04-28"
+   build-date "1998-05-01"
+   maintainer "SL Baur <steve@altair.xemacs.org>"
+   distribution mule
+   priority medium
+   category "mule"
+   dump t
+   description "Japanese Language Input Method."
+   filename "skk-1.06-pkg.tar.gz"
+   md5sum "ccc92c60519be92efef3c40696897ef7"
+   size 1467006
+   provides (skk skk-tut)
+   requires (viper mule-base xemacs-base)
+   type regular
+))
+(calc
+  (standards-version 1.0
+   version "1.05"
+   author-version "2.02fX1"
+   date "1998-02-27"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "oa"
+   dump nil
+   description "Emacs calculator"
+   filename "calc-1.05-pkg.tar.gz"
+   md5sum "cc170d1a19718a152144dfd0a66f6865"
+   size 1165091
+   provides (calc)
+   requires ()
+   type regular
+))
+(calendar
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0"
+   date "1998-06-19"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "oa"
+   dump nil
+   description "Calendar and diary support."
+   filename "calendar-1.04-pkg.tar.gz"
+   md5sum "c0955508d51af1524ca8ef6687b362f1"
+   size 239851
+   provides (appt cal-dst cal-french cal-mayan cal-x cal-xemacs calendar diary-ins diary-lib holidays lunar solar)
+   requires (xemacs-base)
+   type regular
+))
+(edit-utils
+  (standards-version 1.0
+   version "1.24"
+   author-version "21.0"
+   date "1998-06-13"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority high
+   category "oa"
+   dump nil
+   description "Miscellaneous editor extensions, you probably need this."
+   filename "edit-utils-1.24-pkg.tar.gz"
+   md5sum "0b7136586f8b47e9b000bcf08f9b75a0"
+   size 584396
+   provides (abbrevlist atomic-extents avoid backup-dir balloon-help big-menubar blink-cursor blink-paren bookmark compare-w completion dabbrev desktop detached-minibuf edit-toolbar fast-lock file-part floating-toolbar flow-ctrl foldout func-menu hippie-exp icomplete id-select info-look iswitchb lazy-lock lazy-shot live-icon man mic-paren paren popper mode-motion+ outl-mouse page-ext blink-paren paren permanent-buffers recent-files redo reportmail rsz-minibuf saveconfsavehist saveplace scroll-in-place tempo toolbar-utils tree-menu uniquify where-was-i-db)
+   requires (xemacs-base)
+   type single
+))
+(forms
+  (standards-version 1.0
+   version "1.06"
+   author-version "2.10"
+   date "1998-01-25"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "oa"
+   dump nil
+   description "Forms editing support (obsolete, use Widget instead)."
+   filename "forms-1.06-pkg.tar.gz"
+   md5sum "ebee64ebf564f934e15fed3503e3b15e"
+   size 39948
+   provides (forms forms-mode)
+   requires ()
+   type regular
+))
+(frame-icon
+  (standards-version 1.0
+   version "1.02"
+   author-version "21.0b35"
+   date "1998-02-26"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "oa"
+   dump nil
+   description "Set up mode-specific icons for each frame under XEmacs"
+   filename "frame-icon-1.02-pkg.tar.gz"
+   md5sum "82d098425df2fd7e3a7e7d16c9a9e12b"
+   size 33568
+   provides (forms forms-mode)
+   requires ()
+   type regular
+))
+(hm--html-menus
+  (standards-version 1.0
+   version "1.06"
+   author-version "5.9"
+   date "1998-01-25"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "oa"
+   dump nil
+   description "HTML editing."
+   filename "hm--html-menus-1.06-pkg.tar.gz"
+   md5sum "2570d8211b63c2edcc114ec3560a075f"
+   size 147168
+   provides (adapt hm--date hm--html-configuration hm--html-drag-and-drop hm--html-indentation hm--html-keys hm--html-menu hm--html-mode hm--html-not-standard hm--html html-view tmpl-minor-mode)
+   requires (xemacs-base)
+   type regular
+))
+(ispell
+  (standards-version 1.0
+   version "1.08"
+   author-version "3.0x1"
+   date "1998-04-01"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "oa"
+   dump nil
+   description "Spell-checking with GNU ispell."
+   filename "ispell-1.08-pkg.tar.gz"
+   md5sum "54cd76987a472eca72c24592a10756d6"
+   size 64990
+   provides (ispell)
+   requires ()
+   type regular
+))
+(pc
+  (standards-version 1.0
+   version "1.10"
+   author-version "21.0b38"
+   date "1998-04-22"
+   build-date "1998-04-26"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "oa"
+   dump nil
+   description "PC style interface emulation."
+   filename "pc-1.10-pkg.tar.gz"
+   md5sum "e750bebcb0d2b7632796b1c6c4fc4c16"
+   size 16004
+   provides (delbs fusion pc-select pending-del s-region)
+   requires (xemacs-base)
+   type regular
+))
+(psgml
+  (standards-version 1.0
+   version "1.08"
+   author-version "1.01"
+   date "1998-07-06"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "oa"
+   dump nil
+   description "Validated HTML/SGML editing."
+   filename "psgml-1.08-pkg.tar.gz"
+   md5sum "757842225e4d3e9841bf6de1d3fdbbc4"
+   size 419252
+   provides (psgml sgml)
+   requires (edit-utils)
+   type regular
+))
+(sgml
+  (standards-version 1.0
+   version "1.01"
+   author-version "21.0b35"
+   date "1998-01-25"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "oa"
+   dump nil
+   description "SGML/Linuxdoc-SGML editing."
+   filename "sgml-1.01-pkg.tar.gz"
+   md5sum "4e7039730eb4399c09b1a85d1758381c"
+   size 26874
+   provides (sgml linuxdoc-sgml)
+   requires (xemacs-base)
+   type regular
+))
+(slider
+  (standards-version 1.0
+   version "1.05"
+   author-version "0.3"
+   date "1998-01-25"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution experimental
+   priority low
+   category "oa"
+   dump nil
+   description "User interface tool."
+   filename "slider-1.05-pkg.tar.gz"
+   md5sum "67b376e5b886a78f5094eb13c61ff8ec"
+   size 12116
+   provides (slider color-selector)
+   requires ()
+   type regular
+))
+(speedbar
+  (standards-version 1.0
+   version "1.05"
+   author-version "0.6.2"
+   date "1998-02-07"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "oa"
+   dump nil
+   description "??? Document me."
+   filename "speedbar-1.05-pkg.tar.gz"
+   md5sum "8a988bada9d09dac0e934f0859f88613"
+   size 95018
+   provides (speedbar)
+   requires (xemacs-base)
+   type regular
+))
+(strokes
+  (standards-version 1.0
+   version "1.01"
+   author-version "21.0b35"
+   date "1998-01-25"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "oa"
+   dump nil
+   description "Mouse enhancement utility."
+   filename "strokes-1.01-pkg.tar.gz"
+   md5sum "a160a62e0570fc69f3c03b6ee1693fcd"
+   size 43743
+   provides (strokes)
+   requires (text-modes edit-utils mail-lib xemacs-base)
+   type regular
+))
+(text-modes
+  (standards-version 1.0
+   version "1.08"
+   author-version "21.0"
+   date "1998-07-03"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority high
+   category "oa"
+   dump nil
+   description "Miscellaneous support for editing text files."
+   filename "text-modes-1.08-pkg.tar.gz"
+   md5sum "7334a90ddbcedec459caecf8e0314bad"
+   size 171811
+   provides (autoinsert crontab-edit filladapt fold-isearch folding image-mode iso-acc iso-ascii iso-cvt iso-insert iso-swed swedish tabify whitespace-mode winmgr-mode xpm-mode xrdb-mode)
+   requires (fsf-compat xemacs-base)
+   type regular
+))
+(time
+  (standards-version 1.0
+   version "1.04"
+   author-version "1.17"
+   date "1998-04-24"
+   build-date "1998-04-26"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "oa"
+   dump nil
+   description "Display time & date on the modeline."
+   filename "time-1.04-pkg.tar.gz"
+   md5sum "e25caf29cf9684887460d9cd124639d4"
+   size 19905
+   provides (time)
+   requires (xemacs-base)
+   type regular
+))
+(eterm
+  (standards-version 1.0
+   version "1.05"
+   author-version "21.0"
+   date "1998-06-28"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "os"
+   dump nil
+   description "Terminal emulation."
+   filename "eterm-1.05-pkg.tar.gz"
+   md5sum "0c1660a9a8426077534caf84762e7ec1"
+   size 144233
+   provides (eterm)
+   requires (xemacs-base)
+   type regular
+))
+(igrep
+  (standards-version 1.0
+   version "1.01"
+   author-version "21.0b35"
+   date "1998-01-24"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "os"
+   dump nil
+   description "Enhanced front-end for Grep."
+   filename "igrep-1.01-pkg.tar.gz"
+   md5sum "e50e3a5ac2d6ca5eea67d7f664dee406"
+   size 13971
+   provides (igrep)
+   requires (dired xemacs-base)
+   type regular
+))
+(ilisp
+  (standards-version 1.0
+   version "1.04"
+   author-version "5.8"
+   date "1998-01-24"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "os"
+   dump nil
+   description "Front-end for Inferior Lisp."
+   filename "ilisp-1.04-pkg.tar.gz"
+   md5sum "1fa1b08bd6b7cc3c71f512ad412e1b24"
+   size 223559
+   provides (ilisp completer)
+   requires (xemacs-base)
+   type regular
+))
+(os-utils
+  (standards-version 1.0
+   version "1.08"
+   author-version "21.0"
+   date "1998-06-07"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "os"
+   dump nil
+   description "Miscellaneous O/S utilities."
+   filename "os-utils-1.08-pkg.tar.gz"
+   md5sum "9fdcc24ee2d83c6d214f4afa1f41c617"
+   size 229921
+   provides (archive-mode background crypt crypt++ inf-lisp jka-compr lpr mchat ps-print tar-mode telnet terminal uncompress)
+   requires (xemacs-base)
+   type single
+))
+(view-process
+  (standards-version 1.0
+   version "1.03"
+   author-version "2.4"
+   date "1998-01-24"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "os"
+   dump nil
+   description "A Unix process browsing tool."
+   filename "view-process-1.03-pkg.tar.gz"
+   md5sum "96bcf35e325034ee3c37563fecfe623d"
+   size 59886
+   provides (view-process-mode)
+   requires (xemacs-base)
+   type regular
+))
+(ada
+  (standards-version 1.0
+   version "1.03"
+   author-version "2.27"
+   date "1998-01-24"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "prog"
+   dump nil
+   description "Ada language support."
+   filename "ada-1.03-pkg.tar.gz"
+   md5sum "661f8c0ac17fe447f8cc0e54f753704d"
+   size 54323
+   provides (ada-mode ada-stmt)
+   requires ()
+   type regular
+))
+(c-support
+  (standards-version 1.0
+   version "1.07"
+   author-version "21.0b35"
+   date "1998-03-25"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "prog"
+   dump nil
+   description "Basic single-file add-ons for editing C code."
+   filename "c-support-1.07-pkg.tar.gz"
+   md5sum "771e606d76e18922efb6559e101c7ecf"
+   size 68651
+   provides (c-comment-edit cmacexp ctypes hideif hideshow)
+   requires (cc-mode xemacs-base)
+   type regular
+))
+(cc-mode
+  (standards-version 1.0
+   version "1.11"
+   author-version "5.22"
+   date "1998-03-05"
+   build-date "1998-06-14"
+   maintainer "Barry Warsaw <cc-mode-help@python.org>"
+   distribution stable
+   priority medium
+   category "prog"
+   dump nil
+   description "C, C++ and Java language support."
+   filename "cc-mode-1.11-pkg.tar.gz"
+   md5sum "dadf89d5a4dfbee90d0168831a33150f"
+   size 151138
+   provides (cc-mode)
+   requires (xemacs-base)
+   type regular
+))
+(debug
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0"
+   date "1998-07-09"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "prog"
+   dump nil
+   description "GUD, gdb, dbx debugging support."
+   filename "debug-1.04-pkg.tar.gz"
+   md5sum "f881ca1a0593d218ca6a0e19dd10d8a0"
+   size 90350
+   provides (dbx gdb-highlight gdb gdbsrc gud history)
+   requires (xemacs-base)
+   type regular
+))
+(ediff
+  (standards-version 1.0
+   version "1.08"
+   author-version "2.70.1"
+   date "1998-04-27"
+   build-date "1998-05-15"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "prog"
+   dump nil
+   description "Interface over GNU patch."
+   filename "ediff-1.08-pkg.tar.gz"
+   md5sum "d73e47087119a6cb7d5b4f71fdba8b72"
+   size 243042
+   provides (ediff)
+   requires (pcl-cvs dired xemacs-base)
+   type regular
+))
+(emerge
+  (standards-version 1.0
+   version "1.02"
+   author-version "21.0b36"
+   date "1998-04-07"
+   build-date "1998-04-17"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "prog"
+   dump nil
+   description "Another interface over GNU patch."
+   filename "emerge-1.02-pkg.tar.gz"
+   md5sum "6f7687196172109d6014346d5ead6d3a"
+   size 60940
+   provides (emerge)
+   requires ()
+   type regular
+))
+(jde
+  (standards-version 1.0
+   version "1.04"
+   author-version "2.05"
+   date "1998-07-09"
+   build-date "1998-07-09"
+   maintainer "Andy Piper <andyp@parallax.co.uk>"
+   distribution stable
+   priority medium
+   category "prog"
+   dump nil
+   description "Java language and development support."
+   filename "jde-1.04-pkg.tar.gz"
+   md5sum "97b90e88928033f405005a9441b7e141"
+   size 126784
+   provides (jde)
+   requires (cc-mode debug speedbar edit-utils mail-lib xemacs-base)
+   type regular
+))
+(pcl-cvs
+  (standards-version 1.0
+   version "1.11"
+   author-version "21.0"
+   date "1998-06-18"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "prog"
+   dump nil
+   description "CVS frontend."
+   filename "pcl-cvs-1.11-pkg.tar.gz"
+   md5sum "7592786d2734d87778915e50561c472d"
+   size 141698
+   provides (pcl-cvs dll elib-node generic-sc)
+   requires (xemacs-base)
+   type regular
+))
+(prog-modes
+  (standards-version 1.0
+   version "1.06"
+   author-version "21.0"
+   date "1998-05-04"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "prog"
+   dump nil
+   description "Support for various programming languages."
+   filename "prog-modes-1.06-pkg.tar.gz"
+   md5sum "38d494e334b846fe735f45d573759ed9"
+   size 539915
+   provides (autoconf-mode cperl-mode eiffel3 f90 fortran ksh-mode m4-mode makefile perl-mode postscript python-mode rexx-mode simula-mode tcl teco verilog-mod)
+   requires (mail-lib xemacs-base)
+   type regular
+))
+(scheme
+  (standards-version 1.0
+   version "1.03"
+   author-version "21.0b36"
+   date "1998-04-11"
+   build-date "1998-04-17"
+   maintainer "Karl M. Hegbloom <karlheg@bittersweet.inetarena.com>"
+   distribution contrib
+   priority low
+   category "prog"
+   dump nil
+   description "Front-end support for Inferior Scheme."
+   filename "scheme-1.03-pkg.tar.gz"
+   md5sum "f22026713da1be70eba93f8d59700499"
+   size 36833
+   provides (scheme xscheme cmuscheme cmuscheme48)
+   requires (xemacs-base)
+   type regular
+))
+(sh-script
+  (standards-version 1.0
+   version "1.05"
+   author-version "2.0e"
+   date "1998-05-12"
+   build-date "1998-05-15"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "prog"
+   dump nil
+   description "Support for editing shell scripts."
+   filename "sh-script-1.05-pkg.tar.gz"
+   md5sum "8462bd33b9edc71da72ebd134b8a77c6"
+   size 33785
+   provides (sh-script executable)
+   requires (xemacs-base)
+   type regular
+))
+(vc-cc
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0"
+   date "1998-06-30"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "prog"
+   dump t
+   description "Version Control for ClearCase (UnFree) systems."
+   filename "vc-cc-1.04-pkg.tar.gz"
+   md5sum "07557cc75c0b2aafc5966cca1c0a22e2"
+   size 96262
+   provides (vc)
+   requires (dired xemacs-base)
+   type regular
+))
+(vc
+  (standards-version 1.0
+   version "1.09"
+   author-version "21.0b42"
+   date "1998-05-30"
+   build-date "1998-06-01"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "prog"
+   dump t
+   description "Version Control for Free systems."
+   filename "vc-1.09-pkg.tar.gz"
+   md5sum "233d46c01ab9e5052395cf730420f41d"
+   size 83688
+   provides (vc)
+   requires (dired xemacs-base)
+   type regular
+))
+(vhdl
+  (standards-version 1.0
+   version "1.04"
+   author-version "2.74"
+   date "1998-01-24"
+   build-date "1998-06-14"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "prog"
+   dump nil
+   description "Support for VHDL."
+   filename "vhdl-1.04-pkg.tar.gz"
+   md5sum "8de144972dd6f33bcdd43314e6e6564d"
+   size 54169
+   provides (vhdl-mode)
+   requires ()
+   type regular
+))
+(auctex
+  (standards-version 1.0
+   version "1.08"
+   author-version "9.7p"
+   date "1998-04-10"
+   build-date "1998-04-17"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority medium
+   category "wp"
+   dump nil
+   description "Basic TeX/LaTeX support."
+   filename "auctex-1.08-pkg.tar.gz"
+   md5sum "e79c956bd2a7cfc086d91c399667c2ef"
+   size 305607
+   provides (auc-old bib-cite font-latex latex multi-prompt tex-buf tex-info tex-jp tex-site tex)
+   requires (xemacs-base)
+   type regular
+))
+(crisp
+  (standards-version 1.0
+   version "1.04"
+   author-version "1.33"
+   date "1998-01-24"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "wp"
+   dump nil
+   description "Crisp/Brief emulation."
+   filename "crisp-1.04-pkg.tar.gz"
+   md5sum "2a51917984d7556019b1b20ff85a9feb"
+   size 10189
+   provides (crisp scroll-lock)
+   requires ()
+   type regular
+))
+(edt
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0b36"
+   date "1998-04-07"
+   build-date "1998-04-17"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution contrib
+   priority low
+   category "wp"
+   dump nil
+   description "DEC EDIT/EDT emulation."
+   filename "edt-1.04-pkg.tar.gz"
+   md5sum "fabfedc63988de7296eae068d8b78ae0"
+   size 46095
+   provides (edt)
+   requires (xemacs-base)
+   type regular
+))
+(reftex
+  (standards-version 1.0
+   version "1.04"
+   author-version "3.22"
+   date "1998-03-21"
+   build-date "1998-04-04"
+   maintainer "Carsten Dominik <dominik@strw.LeidenUniv.nl>"
+   distribution stable
+   priority medium
+   category "wp"
+   dump nil
+   description "Emacs support for LaTeX cross-references, citations.."
+   filename "reftex-1.04-pkg.tar.gz"
+   md5sum "817a50763a3e909449a93780f662723c"
+   size 141810
+   provides (reftex)
+   requires (fsf-compat xemacs-base)
+   type regular
+))
+(texinfo
+  (standards-version 1.0
+   version "1.09"
+   author-version "21.0"
+   date "1998-07-01"
+   build-date "1998-07-09"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority high
+   category "wp"
+   dump nil
+   description "XEmacs TeXinfo support."
+   filename "texinfo-1.09-pkg.tar.gz"
+   md5sum "7ab1fa9774456869027cfc0846d8f3fc"
+   size 127683
+   provides (makeinfo tex-mode texinfmt texinfo texnfo-tex texnfo-upd)
+   requires (xemacs-base)
+   type regular
+))
+(textools
+  (standards-version 1.0
+   version "1.05"
+   author-version "21.0b38"
+   date "1998-04-29"
+   build-date "1998-05-01"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stabl
+   priority medium
+   category "wp"
+   dump nil
+   description "Miscellaneous TeX support."
+   filename "textools-1.05-pkg.tar.gz"
+   md5sum "4b0a417849ca270ed498c1e9c9aaa07b"
+   size 79125
+   provides (bib-mode bibtex refer-to-bibtex)
+   requires (xemacs-base)
+   type single
+))
+(tpu
+  (standards-version 1.0
+   version "1.04"
+   author-version "21.0b35"
+   date "1998-01-24"
+   build-date "1998-04-04"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution mule
+   priority high
+   category "wp"
+   dump nil
+   description "DEC EDIT/TPU support."
+   filename "tpu-1.04-pkg.tar.gz"
+   md5sum "f45c9f761d6a88b2d3bdb4a4af2abf25"
+   size 57425
+   provides (tpu)
+   requires ()
+   type regular
+))
+(viper
+  (standards-version 1.0
+   version "1.08"
+   author-version "3.03"
+   date "1998-02-25"
+   build-date "1998-06-01"
+   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
+   distribution stable
+   priority low
+   category "wp"
+   dump nil
+   description "VI emulation support."
+   filename "viper-1.08-pkg.tar.gz"
+   md5sum "f36b7e49bda79a19d7beeeeb6092bedd"
+   size 261090
+   provides (viper)
+   requires (xemacs-base)
+   type regular
+))
+))
+(provide 'package-get-base)
index b275db2..3d07560 100644 (file)
                             nil
                             configure-site-directory))
 
-(defun paths-find-site-module-directory (roots)
-  "Find the site modules directory of the XEmacs hierarchy."
-  (paths-find-site-directory roots "site-modules"
-                            nil
-                            configure-site-module-directory))
-
 (defun paths-find-lisp-directory (roots)
   "Find the main Lisp directory of the XEmacs hierarchy."
   (paths-find-version-directory roots "lisp"
                                nil
                                configure-lisp-directory))
 
-(defun paths-find-module-directory (roots)
-  "Find the main modules directory of the XEmacs hierarchy."
-  (paths-find-architecture-directory roots "modules"
-                               configure-module-directory))
-
 (defun paths-construct-load-path
   (roots early-package-load-path late-package-load-path last-package-load-path
         lisp-directory
            lisp-load-path
            last-package-load-path)))
 
-(defun paths-construct-module-load-path
-  (root module-directory &optional site-module-directory)
-  "Construct the modules load path."
-  (let* ((envvar-value (getenv "EMACSMODULEPATH"))
-        (env-module-path
-         (and envvar-value
-              (paths-decode-directory-path envvar-value 'drop-empties)))
-        (site-module-load-path
-         (and site-module-directory
-              (paths-find-recursive-load-path (list site-module-directory)
-                                              paths-load-path-depth)))
-        (module-load-path
-         (and module-directory
-              (paths-find-recursive-load-path (list module-directory)
-                                              paths-load-path-depth))))
-     (append env-module-path
-           site-module-load-path
-           module-load-path)))
-
 (defun paths-construct-info-path (roots early-packages late-packages last-packages)
   "Construct the info path."
   (let ((info-path-envval (getenv "INFOPATH")))
 
 (defun paths-find-lock-directory (roots)
   "Find the lock directory."
-  (defvar configure-lock-directory)
   (paths-find-site-directory roots "lock" "EMACSLOCKDIR" configure-lock-directory))
 
 (defun paths-find-superlock-file (lock-directory)
   "Find the superlock file."
-  ;; #### There is no such variable configure-superlock-file!
   (cond
    ((null lock-directory)
     nil)
         (paths-decode-directory-path path-envval 'drop-empties)))
    (packages-find-package-exec-path early-packages)
    (packages-find-package-exec-path late-packages)
+   (packages-find-package-exec-path last-packages)
    (let ((emacspath-envval (getenv "EMACSPATH")))
      (and emacspath-envval
          (split-path emacspath-envval)))
    (and exec-directory
-       (list exec-directory))
-   (packages-find-package-exec-path last-packages)))
+       (list exec-directory))))
 
 (defun paths-find-data-directory (roots)
   "Find the data directory."
   (append
    (packages-find-package-data-path early-packages)
    (packages-find-package-data-path late-packages)
-   (list data-directory)
-   (packages-find-package-data-path last-packages)))
+   (packages-find-package-data-path last-packages)
+   (list data-directory)))
 
 ;;; setup-paths.el ends here
index f36d12c..19cbcc3 100644 (file)
@@ -364,12 +364,13 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n")
       (message "Back to top level.")
     (setq command-line-processed t)
     ;; Canonicalize HOME (PWD is canonicalized by init_buffer in buffer.c)
-    (let ((value (user-home-directory)))
-      (if (and value
-              (< (length value) (length default-directory))
-              (equal (file-attributes default-directory)
-                     (file-attributes value)))
-         (setq default-directory (file-name-as-directory value))))
+    (unless (eq system-type 'vax-vms)
+      (let ((value (user-home-directory)))
+       (if (and value
+                (< (length value) (length default-directory))
+                (equal (file-attributes default-directory)
+                       (file-attributes value)))
+           (setq default-directory (file-name-as-directory value)))))
     (setq default-directory (abbreviate-file-name default-directory))
     (initialize-xemacs-paths)
 
@@ -401,10 +402,10 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n")
     
     (if (not inhibit-autoloads)
        (progn
-         (if (not inhibit-early-packages)
-             (packages-load-package-auto-autoloads early-package-load-path))
+         (packages-load-package-auto-autoloads last-package-load-path)
          (packages-load-package-auto-autoloads late-package-load-path)
-         (packages-load-package-auto-autoloads last-package-load-path)))
+         (if (not inhibit-early-packages)
+             (packages-load-package-auto-autoloads early-package-load-path))))
 
     (unwind-protect
        (command-line)
@@ -679,7 +680,7 @@ If this is nil, no message will be displayed.")
           (message "Error in init file: %s" (error-message-string error))
           (display-warning 'initialization
             (format "\
-An error has occurred while loading %s:
+An error has occured while loading %s:
 
 %s
 
@@ -934,7 +935,7 @@ a new format, when variables have changed, etc."
                                 " to see what this means.\n")))
        `( "\n"))
     (face bold-italic "\
-Copyright (C) 1985-1998 Free Software Foundation, Inc.
+Copyright (C) 1985-1997 Free Software Foundation, Inc.
 Copyright (C) 1990-1994 Lucid, Inc.
 Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved.
 Copyright (C) 1994-1996 Board of Trustees, University of Illinois
index bddaf12..45b5e1d 100644 (file)
@@ -71,7 +71,7 @@
 (load "setup-paths.el")
 (load "dump-paths.el")
 
-(let ((autol (packages-list-autoloads (concat default-directory "../lisp"))))
+(let ((autol (packages-list-autoloads)))
   ;; (print (prin1-to-string autol))
   (while autol
     (let ((src (car autol)))
index d0ba84c..87c1d79 100644 (file)
@@ -125,7 +125,7 @@ symbol `nil') then only the major version numbers are considered in the test."
 ;; `what(1)' can extract from the executable or a core file.  We don't
 ;; actually need this to be pointed to from lisp; pure objects can't
 ;; be GCed.
-(or (memq system-type '(windows-nt ms-dos))
+(or (memq system-type '(vax-vms windows-nt ms-dos))
     (purecopy (concat "\n@" "(#)" (emacs-version)
                      "\n@" "(#)" "Configuration: "
                      system-configuration "\n")))
diff --git a/lisp/winnt.el b/lisp/winnt.el
new file mode 100644 (file)
index 0000000..b0898a9
--- /dev/null
@@ -0,0 +1,137 @@
+;;; winnt.el --- Lisp routines for Windows NT.
+
+;; Copyright (C) 1994 Free Software Foundation, Inc.
+
+;; Maintainer: XEmacs Development Team
+;; Keywords: mouse, dumped
+
+;; 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, 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Synched up with: Not synched with FSF.  Almost completely divergent.
+
+;;; Commentary:
+
+;; This file is dumped with XEmacs for MS Windows (without cygwin).
+
+;; Based on NT Emacs version by Geoff Voelker (voelker@cs.washington.edu)
+;; Ported to XEmacs by Marc Paquette <marcpa@cam.org>
+;; Largely modified by Kirill M. Katsnelson <kkm@kis.ru>
+
+;;; Code:
+
+;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch
+;; for executing its command line argument (from simple.el).
+;; #### Oh if we had an alist of shells and their command switches.
+(setq shell-command-switch "/c")
+
+;; For appending suffixes to directories and files in shell completions.
+(defun nt-shell-mode-hook ()
+  (setq comint-completion-addsuffix '("\\" . " ")
+       comint-process-echoes t))
+(add-hook 'shell-mode-hook 'nt-shell-mode-hook)
+
+;; Use ";" instead of ":" as a path separator (from files.el).
+(setq path-separator ";")
+
+;; Set the null device (for compile.el).
+;; #### There should be such a global thingy as null-device - kkm
+(setq grep-null-device "NUL")
+
+;; Set the grep regexp to match entries with drive letters.
+(setq grep-regexp-alist
+  '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3)))
+
+;;----------------------------------------------------------------------
+;; Autosave hack
+;;--------------------
+
+;; Avoid creating auto-save file names containing invalid characters
+;; (primarily "*", eg. for the *mail* buffer).
+;; Avoid "doc lost for function" warning
+(defun original-make-auto-save-file-name (&optional junk)
+  "You do not want to call this."
+  )
+(fset 'original-make-auto-save-file-name
+      (symbol-function 'make-auto-save-file-name))
+
+(defun make-auto-save-file-name ()
+  "Return file name to use for auto-saves of current buffer.
+Does not consider `auto-save-visited-file-name' as that variable is checked
+before calling this function.  You can redefine this for customization.
+See also `auto-save-file-name-p'."
+  (let ((name (original-make-auto-save-file-name))
+       (start 0))
+    ;; destructively replace occurences of * or ? with $
+    (while (string-match "[?*]" name start)
+      (aset name (match-beginning 0) ?$)
+      (setq start (1+ (match-end 0))))
+    name))
+
+;;----------------------------------------------------------------------
+;; Quoting process args
+;;--------------------
+
+(defun nt-quote-args-verbatim (args)
+  "Copy ARG list verbatim, separating each arg with space."
+  (mapconcat 'identity args " "))
+
+(defun nt-quote-args-prefix-quote (prefix args)
+  (mapconcat (lambda (str)
+              (concat "\""
+                      (mapconcat (lambda (ch)
+                                   (concat (if (eq ch ?\") prefix)
+                                           (char-to-string ch)))
+                                 str nil)
+                      "\""))
+              args " "))
+
+(defun nt-quote-args-backslash-quote (args)
+  "Place ARG list in quotes, prefixing quotes in args with backslashes."
+  (nt-quote-args-prefix-quote "\\" args))
+
+(defun nt-quote-args-double-quote (args)
+  "Place ARG list in quotes, doubling quotes in args."
+  (nt-quote-args-prefix-quote "\"" args))
+
+(defvar nt-quote-args-functions-alist
+  '(("^.?.?sh\\." . nt-quote-args-double-quote))
+  "An alist for determining proper argument quoting given executable file name.
+Car of each cons must be a string, a regexp against which a file name sans 
+directory is matched.  Cdr is a function symbol.  The list is mathced in
+forward order, and mathcing entry cdr's funcrion is called with a list of
+strings, process arguments.  It must return a string which is passed to
+the newly created process.
+
+If not found, then `nt-quote-args-verbatim' is called on the argument list.")
+
+(defun nt-quote-process-args (args)
+  ;;Properly quote process ARGS for executing (car ARGS).
+  (let ((fname (file-name-nondirectory (car args)))
+       (alist nt-quote-args-functions-alist)
+       (case-fold-search nil)
+       (return-me nil)
+       (assoc nil))
+    (while (and alist
+               (null return-me))
+      (setq assoc (pop alist))
+      (if (string-match (car assoc) fname)
+         (setq return-me (funcall (cdr assoc) (cdr args)))))
+    (or return-me
+       (nt-quote-args-verbatim (cdr args)))))
+
+;;; winnt.el ends here
diff --git a/lock/.precious b/lock/.precious
new file mode 100644 (file)
index 0000000..1650a2e
--- /dev/null
@@ -0,0 +1 @@
+Dummy file to keep CVS happy.
diff --git a/lwlib/config.h b/lwlib/config.h
new file mode 100644 (file)
index 0000000..34aab2c
--- /dev/null
@@ -0,0 +1,33 @@
+/* lwlib/config.h.  Generated automatically by configure.  */
+/* Lwlib site configuration template file.  -*- C -*-
+   Copyright (C) 1997 Sun Microsystems, 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.  */
+
+/* Not in FSF. */
+
+#ifndef _LWLIB_CONFIG_H_
+#define _LWLIB_CONFIG_H_
+
+#include <../src/config.h>
+
+/* #undef NEED_MOTIF */
+/* #undef NEED_ATHENA */
+/* #undef NEED_LUCID */
+
+#endif /* _LWLIB_CONFIG_H_ */
diff --git a/man/info-stnd.texi b/man/info-stnd.texi
new file mode 100644 (file)
index 0000000..abb7ff8
--- /dev/null
@@ -0,0 +1,1373 @@
+\input texinfo    @c -*-texinfo-*-
+@comment %**start of header
+@setfilename ../info/info-stnd.info
+@settitle GNU Info
+@set InfoProgVer 2.11
+@paragraphindent none
+@footnotestyle end
+@synindex vr cp
+@synindex fn cp
+@synindex ky cp
+@comment %**end of header
+@comment $Id: info-stnd.texi,v 1.3 1998/06/30 06:35:28 steve Exp $
+
+@dircategory Texinfo documentation system
+@direntry
+* info program: (info-stnd).    Standalone Info-reading program.
+@end direntry
+
+@ifinfo
+This file documents GNU Info, a program for viewing the on-line formatted
+versions of Texinfo files.  This documentation is different from the
+documentation for the Info reader that is part of GNU Emacs.  If you do
+not know how to use Info, but have a working Info reader, you should
+read that documentation first.
+
+Copyright @copyright{} 1992, 93, 96, 97 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries a copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+@end ignore
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+sections entitled ``Copying'' and ``GNU General Public License'' are
+included exactly as in the original, and provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation
+approved by the Free Software Foundation.
+@end ifinfo
+
+@titlepage
+@title GNU Info User's Guide
+@subtitle For GNU Info version @value{InfoProgVer}
+@author Brian J. Fox (bfox@@ai.mit.edu)
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1992, 1993, 1997 Free Software Foundation
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+sections entitled ``Copying'' and ``GNU General Public License'' are
+included exactly as in the original, and provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation
+approved by the Free Software Foundation.
+@end titlepage
+
+@ifinfo
+@node Top, What is Info, , (dir)
+@top The GNU Info Program
+
+This file documents GNU Info, a program for viewing the on-line
+formatted versions of Texinfo files, version @value{InfoProgVer}.  This
+documentation is different from the documentation for the Info reader
+that is part of GNU Emacs.
+@end ifinfo
+
+@menu
+* What is Info::                
+* Options::                     Options you can pass on the command line.
+* Cursor Commands::             Commands which move the cursor within a node.
+* Scrolling Commands::          Commands for moving the node around 
+                                  in a window.
+* Node Commands::               Commands for selecting a new node.
+* Searching Commands::          Commands for searching an Info file.
+* Xref Commands::               Commands for selecting cross references.
+* Window Commands::             Commands which manipulate multiple windows.
+* Printing Nodes::              How to print out the contents of a node.
+* Miscellaneous Commands::      A few commands that defy categories.
+* Variables::                   How to change the default behavior of Info.
+* GNU Info Global Index::       Global index containing keystrokes, 
+                                  command names, variable names, 
+                                  and general concepts.
+@end menu
+
+@node What is Info, Options, Top, Top
+@chapter What is Info?
+
+@iftex
+This file documents GNU Info, a program for viewing the on-line formatted
+versions of Texinfo files, version @value{InfoProgVer}.
+@end iftex
+
+@dfn{Info} is a program which is used to view Info files on an ASCII
+terminal.  @dfn{Info files} are the result of processing Texinfo files
+with the program @code{makeinfo} or with one of the Emacs commands, such
+as @code{M-x texinfo-format-buffer}.  Texinfo itself is a documentation
+system that uses a single source file to produce both on-line
+information and printed output.  You can typeset and print the
+files that you read in Info.@refill
+
+@node Options, Cursor Commands, What is Info, Top
+@chapter Command Line Options
+@cindex command line options
+@cindex arguments, command line
+
+GNU Info accepts several options to control the initial node being
+viewed, and to specify which directories to search for Info files.  Here
+is a template showing an invocation of GNU Info from the shell:
+
+@example
+info [--@var{option-name} @var{option-value}] @var{menu-item}@dots{}
+@end example
+
+The following @var{option-names} are available when invoking Info from
+the shell:
+
+@table @code
+@cindex directory path
+@item --directory @var{directory-path}
+@itemx -d @var{directory-path}
+Add @var{directory-path} to the list of directory paths searched when
+Info needs to find a file.  You may issue @code{--directory} multiple
+times; once for each directory which contains Info files.
+Alternatively, you may specify a value for the environment variable
+@code{INFOPATH}; if @code{--directory} is not given, the value of
+@code{INFOPATH} is used.  The value of @code{INFOPATH} is a colon
+separated list of directory names.  If you do not supply @code{INFOPATH}
+or @code{--directory-path}, Info uses a default path.
+
+@item --file @var{filename}
+@itemx -f @var{filename}
+@cindex Info file, selecting
+Specify a particular Info file to visit.  By default, Info visits
+the file @code{dir}; if you use this option, Info will start with
+@code{(@var{filename})Top} as the first file and node.
+
+@item --index-search @var{string}
+@cindex index search, selecting
+@cindex online help, using Info as
+Go to the index entry @var{string} in the Info file specified with
+@samp{--file}.  If no such entry, print @samp{no entries found} and exit
+with nonzero status.  This can used from another program as a way to
+provide online help.
+
+@item --node @var{nodename}
+@itemx -n @var{nodename}
+@cindex node, selecting
+Specify a particular node to visit in the initial file that Info
+loads.  This is especially useful in conjunction with
+@code{--file}@footnote{Of course, you can specify both the file and node
+in a @code{--node} command; but don't forget to escape the open and
+close parentheses from the shell as in: @code{info --node
+"(emacs)Buffers"}}.  You may specify @code{--node} multiple times; for
+an interactive Info, each @var{nodename} is visited in its own window,
+for a non-interactive Info (such as when @code{--output} is given) each
+@var{nodename} is processed sequentially.
+
+@item --output @var{filename}
+@itemx -o @var{filename}
+@cindex file, outputting to
+@cindex outputting to a file
+Specify @var{filename} as the name of a file to which to direct output.
+Each node that Info visits will be output to @var{filename} instead of
+interactively viewed.  A value of @code{-} for @var{filename} specifies
+the standard output.
+
+@item --subnodes
+@cindex @code{--subnodes}, command line option
+This option only has meaning when given in conjunction with
+@code{--output}.  It means to recursively output the nodes appearing in
+the menus of each node being output.  Menu items which resolve to
+external Info files are not output, and neither are menu items which are
+members of an index.  Each node is only output once.
+
+@item --help
+@itemx -h
+Produces a relatively brief description of the available Info options.
+
+@item --version
+@cindex version information
+Prints the version information of Info and exits.
+
+@item @var{menu-item}
+@cindex menu, following
+Info treats its remaining arguments as the names of menu items.  The
+first argument is a menu item in the initial node visited, while
+the second argument is a menu item in the first argument's node.
+You can easily move to the node of your choice by specifying the menu
+names which describe the path to that node.  For example,
+
+@example
+info emacs buffers
+@end example
+
+@noindent
+first selects the menu item @samp{Emacs} in the node @samp{(dir)Top},
+and then selects the menu item @samp{Buffers} in the node
+@samp{(emacs)Top}.
+@end table
+
+@node Cursor Commands, Scrolling Commands, Options, Top
+@chapter Moving the Cursor
+@cindex cursor, moving
+
+Many people find that reading screens of text page by page is made
+easier when one is able to indicate particular pieces of text with some
+kind of pointing device.  Since this is the case, GNU Info (both the
+Emacs and standalone versions) have several commands which allow you to
+move the cursor about the screen.  The notation used in this manual to
+describe keystrokes is identical to the notation used within the Emacs
+manual, and the GNU Readline manual.  @xref{Characters, , Character
+Conventions, emacs, the GNU Emacs Manual}, if you are unfamiliar with the
+notation.
+
+The following table lists the basic cursor movement commands in Info.
+Each entry consists of the key sequence you should type to execute the
+cursor movement, the @code{M-x}@footnote{@code{M-x} is also a command; it
+invokes @code{execute-extended-command}.  @xref{M-x, , Executing an
+extended command, emacs, the GNU Emacs Manual}, for more detailed
+information.} command name (displayed in parentheses), and a short
+description of what the command does.  All of the cursor motion commands
+can take an @dfn{numeric} argument (@pxref{Miscellaneous Commands,
+@code{universal-argument}}), to find out how to supply them.  With a
+numeric argument, the motion commands are simply executed that
+many times; for example, a numeric argument of 4 given to
+@code{next-line} causes the cursor to move down 4 lines.  With a
+negative numeric argument, the motion is reversed; an argument of -4
+given to the @code{next-line} command would cause the cursor to move
+@emph{up} 4 lines.
+
+@table @asis
+@item @code{C-n} (@code{next-line})
+@kindex C-n
+@findex next-line
+Move the cursor down to the next line.
+
+@item @code{C-p} (@code{prev-line})
+@kindex C-p
+@findex prev-line
+Move the cursor up to the previous line.
+
+@item @code{C-a} (@code{beginning-of-line})
+@kindex C-a, in Info windows
+@findex beginning-of-line
+Move the cursor to the start of the current line.
+
+@item @code{C-e} (@code{end-of-line})
+@kindex C-e, in Info windows
+@findex end-of-line
+Move the cursor to the end of the current line.
+
+@item @code{C-f} (@code{forward-char})
+@kindex C-f, in Info windows
+@findex forward-char
+Move the cursor forward a character.
+
+@item @code{C-b} (@code{backward-char})
+@kindex C-b, in Info windows
+@findex backward-char
+Move the cursor backward a character.
+
+@item @code{M-f} (@code{forward-word})
+@kindex M-f, in Info windows
+@findex forward-word
+Move the cursor forward a word.
+
+@item @code{M-b} (@code{backward-word})
+@kindex M-b, in Info windows
+@findex backward-word
+Move the cursor backward a word.
+
+@item @code{M-<} (@code{beginning-of-node})
+@itemx @code{b}
+@kindex b, in Info windows
+@kindex M-<
+@findex beginning-of-node
+Move the cursor to the start of the current node.
+
+@item @code{M->} (@code{end-of-node})
+@kindex M->
+@findex end-of-node
+Move the cursor to the end of the current node.
+
+@item @code{M-r} (@code{move-to-window-line})
+@kindex M-r
+@findex move-to-window-line
+Move the cursor to a specific line of the window.  Without a numeric
+argument, @code{M-r} moves the cursor to the start of the line in the
+center of the window.  With a numeric argument of @var{n}, @code{M-r}
+moves the cursor to the start of the @var{n}th line in the window.
+@end table
+
+@node Scrolling Commands, Node Commands, Cursor Commands, Top
+@chapter Moving Text Within a Window
+@cindex scrolling
+
+Sometimes you are looking at a screenful of text, and only part of the
+current paragraph you are reading is visible on the screen.  The
+commands detailed in this section are used to shift which part of the
+current node is visible on the screen.
+
+@table @asis
+@item @code{SPC} (@code{scroll-forward})
+@itemx @code{C-v}
+@kindex SPC, in Info windows
+@kindex C-v
+@findex scroll-forward
+Shift the text in this window up.  That is, show more of the node which
+is currently below the bottom of the window.  With a numeric argument,
+show that many more lines at the bottom of the window; a numeric
+argument of 4 would shift all of the text in the window up 4 lines
+(discarding the top 4 lines), and show you four new lines at the bottom
+of the window.  Without a numeric argument, @key{SPC} takes the bottom
+two lines of the window and places them at the top of the window,
+redisplaying almost a completely new screenful of lines.
+
+@item @code{DEL} (@code{scroll-backward})
+@itemx @code{M-v}
+@kindex DEL, in Info windows
+@kindex M-v
+@findex scroll-backward
+Shift the text in this window down.  The inverse of
+@code{scroll-forward}.
+@end table
+
+@cindex scrolling through node structure
+The @code{scroll-forward} and @code{scroll-backward} commands can also
+move forward and backward through the node structure of the file.  If
+you press @key{SPC} while viewing the end of a node, or @key{DEL} while
+viewing the beginning of a node, what happens is controlled by the
+variable @code{scroll-behavior}.  @xref{Variables,
+@code{scroll-behavior}}, for more information.
+
+@table @asis
+@item @code{C-l} (@code{redraw-display})
+@kindex C-l
+@findex redraw-display
+Redraw the display from scratch, or shift the line containing the cursor
+to a specified location.  With no numeric argument, @samp{C-l} clears
+the screen, and then redraws its entire contents.  Given a numeric
+argument of @var{n}, the line containing the cursor is shifted so that
+it is on the @var{n}th line of the window.
+
+@item @code{C-x w} (@code{toggle-wrap})
+@kindex C-w
+@findex toggle-wrap
+Toggles the state of line wrapping in the current window.  Normally,
+lines which are longer than the screen width @dfn{wrap}, i.e., they are
+continued on the next line.  Lines which wrap have a @samp{\} appearing
+in the rightmost column of the screen.  You can cause such lines to be
+terminated at the rightmost column by changing the state of line
+wrapping in the window with @code{C-x w}.  When a line which needs more
+space than one screen width to display is displayed, a @samp{$} appears
+in the rightmost column of the screen, and the remainder of the line is
+invisible.
+@end table
+
+@node Node Commands, Searching Commands, Scrolling Commands, Top
+@chapter Selecting a New Node
+@cindex nodes, selection of
+
+This section details the numerous Info commands which select a new node
+to view in the current window.
+
+The most basic node commands are @samp{n}, @samp{p}, @samp{u}, and
+@samp{l}.
+
+When you are viewing a node, the top line of the node contains some Info
+@dfn{pointers} which describe where the next, previous, and up nodes
+are.  Info uses this line to move about the node structure of the file
+when you use the following commands:
+
+@table @asis
+@item @code{n} (@code{next-node})
+@kindex n
+@findex next-node
+Select the `Next' node.  
+
+@item @code{p} (@code{prev-node})
+@kindex p
+@findex prev-node
+Select the `Prev' node.
+
+@item @code{u} (@code{up-node})
+@kindex u
+@findex up-node
+Select the `Up' node.
+@end table
+
+You can easily select a node that you have already viewed in this window
+by using the @samp{l} command -- this name stands for "last", and
+actually moves through the list of already visited nodes for this
+window.  @samp{l} with a negative numeric argument moves forward through
+the history of nodes for this window, so you can quickly step between
+two adjacent (in viewing history) nodes.
+
+@table @asis
+@item @code{l} (@code{history-node})
+@kindex l
+@findex history-node
+Select the most recently selected node in this window.
+@end table
+
+Two additional commands make it easy to select the most commonly
+selected nodes; they are @samp{t} and @samp{d}.
+
+@table @asis
+@item @code{t} (@code{top-node})
+@kindex t
+@findex top-node
+Select the node @samp{Top} in the current Info file.
+
+@item @code{d} (@code{dir-node})
+@kindex d
+@findex dir-node
+Select the directory node (i.e., the node @samp{(dir)}).
+@end table
+
+Here are some other commands which immediately result in the selection
+of a different node in the current window:
+
+@table @asis
+@item @code{<} (@code{first-node})
+@kindex <
+@findex first-node
+Selects the first node which appears in this file.  This node is most
+often @samp{Top}, but it does not have to be.
+
+@item @code{>} (@code{last-node})
+@kindex >
+@findex last-node
+Select the last node which appears in this file.
+
+@item @code{]} (@code{global-next-node})
+@kindex ]
+@findex global-next-node
+Move forward or down through node structure.  If the node that you are
+currently viewing has a @samp{Next} pointer, that node is selected.
+Otherwise, if this node has a menu, the first menu item is selected.  If
+there is no @samp{Next} and no menu, the same process is tried with the
+@samp{Up} node of this node.
+
+@item @code{[} (@code{global-prev-node})
+@kindex [
+@findex global-prev-node
+Move backward or up through node structure.  If the node that you are
+currently viewing has a @samp{Prev} pointer, that node is selected.
+Otherwise, if the node has an @samp{Up} pointer, that node is selected,
+and if it has a menu, the last item in the menu is selected.
+@end table
+
+You can get the same behavior as @code{global-next-node} and
+@code{global-prev-node} while simply scrolling through the file with
+@key{SPC} and @key{DEL}; @xref{Variables, @code{scroll-behavior}}, for
+more information.
+
+@table @asis
+@item @code{g} (@code{goto-node})
+@kindex g
+@findex goto-node
+Read the name of a node and select it.  No completion is done while
+reading the node name, since the desired node may reside in a separate
+file.  The node must be typed exactly as it appears in the Info file.  A
+file name may be included as with any node specification, for example
+
+@example
+@code{g(emacs)Buffers}
+@end example
+
+finds the node @samp{Buffers} in the Info file @file{emacs}.
+
+@item @code{C-x k} (@code{kill-node})
+@kindex C-x k
+@findex kill-node
+Kill a node.  The node name is prompted for in the echo area, with a
+default of the current node.  @dfn{Killing} a node means that Info tries
+hard to forget about it, removing it from the list of history nodes kept
+for the window where that node is found.  Another node is selected in
+the window which contained the killed node.
+
+@item @code{C-x C-f} (@code{view-file})
+@kindex C-x C-f
+@findex view-file
+Read the name of a file and selects the entire file.  The command
+@example
+@code{C-x C-f @var{filename}}
+@end example
+is equivalent to typing
+@example
+@code{g(@var{filename})*}
+@end example
+
+@item @code{C-x C-b} (@code{list-visited-nodes})
+@kindex C-x C-b
+@findex list-visited-nodes
+Make a window containing a menu of all of the currently visited nodes.
+This window becomes the selected window, and you may use the standard
+Info commands within it.
+
+@item @code{C-x b} (@code{select-visited-node})
+@kindex C-x b
+@findex select-visited-node
+Select a node which has been previously visited in a visible window.
+This is similar to @samp{C-x C-b} followed by @samp{m}, but no window is
+created.
+@end table
+
+@node Searching Commands, Xref Commands, Node Commands, Top
+@chapter Searching an Info File
+@cindex searching
+
+GNU Info allows you to search for a sequence of characters throughout an
+entire Info file, search through the indices of an Info file, or find
+areas within an Info file which discuss a particular topic.
+
+@table @asis
+@item @code{s} (@code{search})
+@kindex s
+@findex search
+Read a string in the echo area and search for it.
+
+@item @code{C-s} (@code{isearch-forward})
+@kindex C-s
+@findex isearch-forward
+Interactively search forward through the Info file for a string as you
+type it.
+
+@item @code{C-r} (@code{isearch-backward})
+@kindex C-r
+@findex isearch-backward
+Interactively search backward through the Info file for a string as
+you type it.
+
+@item @code{i} (@code{index-search})
+@kindex i
+@findex index-search
+Look up a string in the indices for this Info file, and select a node
+where the found index entry points to.
+
+@item @code{,} (@code{next-index-match})
+@kindex ,
+@findex next-index-match
+Move to the node containing the next matching index item from the last
+@samp{i} command.
+@end table
+
+The most basic searching command is @samp{s} (@code{search}).  The
+@samp{s} command prompts you for a string in the echo area, and then
+searches the remainder of the Info file for an occurrence of that string.
+If the string is found, the node containing it is selected, and the
+cursor is left positioned at the start of the found string.  Subsequent
+@samp{s} commands show you the default search string within @samp{[} and
+@samp{]}; pressing @key{RET} instead of typing a new string will use the
+default search string.
+
+@dfn{Incremental searching} is similar to basic searching, but the
+string is looked up while you are typing it, instead of waiting until
+the entire search string has been specified.
+
+@node Xref Commands, Window Commands, Searching Commands, Top
+@chapter Selecting Cross References
+
+We have already discussed the @samp{Next}, @samp{Prev}, and @samp{Up}
+pointers which appear at the top of a node.  In addition to these
+pointers, a node may contain other pointers which refer you to a
+different node, perhaps in another Info file.  Such pointers are called
+@dfn{cross references}, or @dfn{xrefs} for short.
+
+@menu
+* Parts of an Xref::            What a cross reference is made of.
+* Selecting Xrefs::             Commands for selecting menu or note items.
+@end menu
+
+@node Parts of an Xref, Selecting Xrefs,  , Xref Commands
+@section Parts of an Xref
+
+Cross references have two major parts: the first part is called the
+@dfn{label}; it is the name that you can use to refer to the cross
+reference, and the second is the @dfn{target}; it is the full name of
+the node that the cross reference points to.
+
+The target is separated from the label by a colon @samp{:}; first the
+label appears, and then the target.  For example, in the sample menu
+cross reference below, the single colon separates the label from the
+target.
+
+@example
+* Foo Label: Foo Target.        More information about Foo.
+@end example
+
+Note the @samp{.} which ends the name of the target.  The @samp{.} is
+not part of the target; it serves only to let Info know where the target
+name ends.
+
+A shorthand way of specifying references allows two adjacent colons to
+stand for a target name which is the same as the label name:
+
+@example
+* Foo Commands::                Commands pertaining to Foo.
+@end example
+
+In the above example, the name of the target is the same as the name of
+the label, in this case @code{Foo Commands}.
+
+You will normally see two types of cross reference while viewing nodes:
+@dfn{menu} references, and @dfn{note} references.  Menu references
+appear within a node's menu; they begin with a @samp{*} at the beginning
+of a line, and continue with a label, a target, and a comment which
+describes what the contents of the node pointed to contains.
+
+Note references appear within the body of the node text; they begin with
+@code{*Note}, and continue with a label and a target.
+
+Like @samp{Next}, @samp{Prev}, and @samp{Up} pointers, cross references
+can point to any valid node.  They are used to refer you to a place
+where more detailed information can be found on a particular subject.
+Here is a cross reference which points to a node within the Texinfo
+documentation:  @xref{xref, , Writing an Xref, texinfo, the Texinfo
+Manual}, for more information on creating your own texinfo cross
+references.
+
+@node Selecting Xrefs,  , Parts of an Xref, Xref Commands
+@section Selecting Xrefs
+
+The following table lists the Info commands which operate on menu items.
+
+@table @asis
+@item @code{1} (@code{menu-digit})
+@itemx @code{2} @dots{} @code{9}
+@cindex 1 @dots{} 9, in Info windows
+@kindex 1 @dots{} 9, in Info windows
+@findex menu-digit
+Within an Info window, pressing a single digit, (such as @samp{1}),
+selects that menu item, and places its node in the current window.
+For convenience, there is one exception; pressing @samp{0} selects the
+@emph{last} item in the node's menu.
+
+@item @code{0} (@code{last-menu-item})
+@kindex 0, in Info windows
+@findex last-menu-item
+Select the last item in the current node's menu.
+
+@item @code{m} (@code{menu-item})
+@kindex m
+@findex menu-item
+Reads the name of a menu item in the echo area and selects its node.
+Completion is available while reading the menu label.
+
+@item @code{M-x find-menu}
+@findex find-menu
+Move the cursor to the start of this node's menu.
+@end table
+
+This table lists the Info commands which operate on note cross references.
+
+@table @asis
+@item @code{f} (@code{xref-item})
+@itemx @code{r}
+@kindex f
+@kindex r
+@findex xref-item
+Reads the name of a note cross reference in the echo area and selects
+its node.  Completion is available while reading the cross reference
+label.
+@end table
+
+Finally, the next few commands operate on menu or note references alike:
+
+@table @asis
+@item @code{TAB} (@code{move-to-next-xref})
+@kindex TAB, in Info windows
+@findex move-to-next-xref
+Move the cursor to the start of the next nearest menu item or note
+reference in this node.  You can then use @key{RET}
+(@code{select-reference-this-line}) to select the menu or note reference.
+
+@item @code{M-TAB} (@code{move-to-prev-xref})
+@kindex M-TAB, in Info windows
+@findex move-to-prev-xref
+Move the cursor the start of the nearest previous menu item or note
+reference in this node.
+
+@item @code{RET} (@code{select-reference-this-line})
+@kindex RET, in Info windows
+@findex select-reference-this-line
+Select the menu item or note reference appearing on this line.
+@end table
+
+@node Window Commands, Printing Nodes, Xref Commands, Top
+@chapter Manipulating Multiple Windows
+@cindex windows, manipulating
+
+A @dfn{window} is a place to show the text of a node.  Windows have a
+view area where the text of the node is displayed, and an associated
+@dfn{mode line}, which briefly describes the node being viewed.
+
+GNU Info supports multiple windows appearing in a single screen; each
+window is separated from the next by its modeline.  At any time, there
+is only one @dfn{active} window, that is, the window in which the cursor
+appears.  There are commands available for creating windows, changing
+the size of windows, selecting which window is active, and for deleting
+windows.
+
+@menu
+* The Mode Line::               What appears in the mode line?
+* Basic Windows::               Manipulating windows in Info.
+* The Echo Area::               Used for displaying errors and reading input.
+@end menu
+
+@node The Mode Line, Basic Windows,  , Window Commands
+@section The Mode Line
+
+A @dfn{mode line} is a line of inverse video which appears at the bottom
+of an Info window.  It describes the contents of the window just above
+it; this information includes the name of the file and node appearing in
+that window, the number of screen lines it takes to display the node,
+and the percentage of text that is above the top of the window.  It can
+also tell you if the indirect tags table for this Info file needs to be
+updated, and whether or not the Info file was compressed when stored on
+disk.
+
+Here is a sample mode line for a window containing an uncompressed file
+named @file{dir}, showing the node @samp{Top}.
+
+@example
+@group
+-----Info: (dir)Top, 40 lines --Top---------------------------------------
+            ^^   ^   ^^^        ^^
+          (file)Node #lines    where
+@end group
+@end example
+
+When a node comes from a file which is compressed on disk, this is
+indicated in the mode line with two small @samp{z}'s.  In addition, if
+the Info file containing the node has been split into subfiles, the name
+of the subfile containing the node appears in the modeline as well:
+
+@example
+--zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z---------------
+@end example 
+
+When Info makes a node internally, such that there is no corresponding
+info file on disk, the name of the node is surrounded by asterisks
+(@samp{*}).  The name itself tells you what the contents of the window
+are; the sample mode line below shows an internally constructed node
+showing possible completions:
+
+@example
+-----Info: *Completions*, 7 lines --All-----------------------------------
+@end example
+
+@node Basic Windows, The Echo Area, The Mode Line, Window Commands
+@section Window Commands
+
+It can be convenient to view more than one node at a time.  To allow
+this, Info can display more than one @dfn{window}.  Each window has its
+own mode line (@pxref{The Mode Line}) and history of nodes viewed in that
+window (@pxref{Node Commands, , @code{history-node}}).
+
+@table @asis
+@item @code{C-x o} (@code{next-window})
+@cindex windows, selecting
+@kindex C-x o
+@findex next-window
+Select the next window on the screen.  Note that the echo area can only be
+selected if it is already in use, and you have left it temporarily.
+Normally, @samp{C-x o} simply moves the cursor into the next window on
+the screen, or if you are already within the last window, into the first
+window on the screen.  Given a numeric argument, @samp{C-x o} moves over
+that many windows.  A negative argument causes @samp{C-x o} to select
+the previous window on the screen.
+
+@item @code{M-x prev-window}
+@findex prev-window
+Select the previous window on the screen.  This is identical to
+@samp{C-x o} with a negative argument.
+
+@item @code{C-x 2} (@code{split-window})
+@cindex windows, creating
+@kindex C-x 2
+@findex split-window
+Split the current window into two windows, both showing the same node.
+Each window is one half the size of the original window, and the cursor
+remains in the original window.  The variable @code{automatic-tiling}
+can cause all of the windows on the screen to be resized for you
+automatically, please @pxref{Variables, , automatic-tiling} for more
+information.
+
+@item @code{C-x 0} (@code{delete-window})
+@cindex windows, deleting
+@kindex C-x 0
+@findex delete-window
+Delete the current window from the screen.  If you have made too many
+windows and your screen appears cluttered, this is the way to get rid of
+some of them.
+
+@item @code{C-x 1} (@code{keep-one-window})
+@kindex C-x 1
+@findex keep-one-window
+Delete all of the windows excepting the current one.
+
+@item @code{ESC C-v} (@code{scroll-other-window})
+@kindex ESC C-v, in Info windows
+@findex scroll-other-window
+Scroll the other window, in the same fashion that @samp{C-v} might
+scroll the current window.  Given a negative argument, scroll the
+"other" window backward.
+
+@item @code{C-x ^} (@code{grow-window})
+@kindex C-x ^
+@findex grow-window
+Grow (or shrink) the current window.  Given a numeric argument, grow
+the current window that many lines; with a negative numeric argument,
+shrink the window instead.
+
+@item @code{C-x t} (@code{tile-windows})
+@cindex tiling
+@kindex C-x t
+@findex tile-windows
+Divide the available screen space among all of the visible windows.
+Each window is given an equal portion of the screen in which to display
+its contents.  The variable @code{automatic-tiling} can cause
+@code{tile-windows} to be called when a window is created or deleted.
+@xref{Variables, , @code{automatic-tiling}}.
+@end table
+
+@node The Echo Area,  , Basic Windows, Window Commands
+@section The Echo Area
+@cindex echo area
+
+The @dfn{echo area} is a one line window which appears at the bottom of
+the screen.  It is used to display informative or error messages, and to
+read lines of input from you when that is necessary.  Almost all of the
+commands available in the echo area are identical to their Emacs
+counterparts, so please refer to that documentation for greater depth of
+discussion on the concepts of editing a line of text.  The following
+table briefly lists the commands that are available while input is being
+read in the echo area:
+
+@table @asis
+@item @code{C-f} (@code{echo-area-forward})
+@kindex C-f, in the echo area
+@findex echo-area-forward
+Move forward a character.
+
+@item @code{C-b} (@code{echo-area-backward})
+@kindex C-b, in the echo area
+@findex echo-area-backward
+Move backward a character.
+
+@item @code{C-a} (@code{echo-area-beg-of-line})
+@kindex C-a, in the echo area
+@findex echo-area-beg-of-line
+Move to the start of the input line.
+
+@item @code{C-e} (@code{echo-area-end-of-line})
+@kindex C-e, in the echo area
+@findex echo-area-end-of-line
+Move to the end of the input line.
+
+@item @code{M-f} (@code{echo-area-forward-word})
+@kindex M-f, in the echo area
+@findex echo-area-forward-word
+Move forward a word.
+
+@item @code{M-b} (@code{echo-area-backward-word})
+@kindex M-b, in the echo area
+@findex echo-area-backward-word
+Move backward a word.
+
+@item @code{C-d} (@code{echo-area-delete})
+@kindex C-d, in the echo area
+@findex echo-area-delete
+Delete the character under the cursor.
+
+@item @code{DEL} (@code{echo-area-rubout})
+@kindex DEL, in the echo area
+@findex echo-area-rubout
+Delete the character behind the cursor.
+
+@item @code{C-g} (@code{echo-area-abort})
+@kindex C-g, in the echo area
+@findex echo-area-abort
+Cancel or quit the current operation.  If completion is being read,
+@samp{C-g} discards the text of the input line which does not match any
+completion.  If the input line is empty, @samp{C-g} aborts the calling
+function.
+
+@item @code{RET} (@code{echo-area-newline})
+@kindex RET, in the echo area
+@findex echo-area-newline
+Accept (or forces completion of) the current input line.
+
+@item @code{C-q} (@code{echo-area-quoted-insert})
+@kindex C-q, in the echo area
+@findex echo-area-quoted-insert
+Insert the next character verbatim.  This is how you can insert control
+characters into a search string, for example.
+
+@item @var{printing character} (@code{echo-area-insert})
+@kindex printing characters, in the echo area
+@findex echo-area-insert
+Insert the character.
+
+@item @code{M-TAB} (@code{echo-area-tab-insert})
+@kindex M-TAB, in the echo area
+@findex echo-area-tab-insert
+Insert a TAB character.
+
+@item @code{C-t} (@code{echo-area-transpose-chars})
+@kindex C-t, in the echo area
+@findex echo-area-transpose-chars
+Transpose the characters at the cursor.
+@end table
+
+The next group of commands deal with @dfn{killing}, and @dfn{yanking}
+text.  For an in depth discussion of killing and yanking,
+@pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs Manual}
+
+@table @asis
+@item @code{M-d} (@code{echo-area-kill-word})
+@kindex M-d, in the echo area
+@findex echo-area-kill-word
+Kill the word following the cursor.
+
+@item @code{M-DEL} (@code{echo-area-backward-kill-word})
+@kindex M-DEL, in the echo area
+@findex echo-area-backward-kill-word
+Kill the word preceding the cursor.
+
+@item @code{C-k} (@code{echo-area-kill-line})
+@kindex C-k, in the echo area
+@findex echo-area-kill-line
+Kill the text from the cursor to the end of the line.
+
+@item @code{C-x DEL} (@code{echo-area-backward-kill-line})
+@kindex C-x DEL, in the echo area
+@findex echo-area-backward-kill-line
+Kill the text from the cursor to the beginning of the line.
+
+@item @code{C-y} (@code{echo-area-yank})
+@kindex C-y, in the echo area
+@findex echo-area-yank
+Yank back the contents of the last kill.
+
+@item @code{M-y} (@code{echo-area-yank-pop})
+@kindex M-y, in the echo area
+@findex echo-area-yank-pop
+Yank back a previous kill, removing the last yanked text first.
+@end table
+
+Sometimes when reading input in the echo area, the command that needed
+input will only accept one of a list of several choices.  The choices
+represent the @dfn{possible completions}, and you must respond with one
+of them.  Since there are a limited number of responses you can make,
+Info allows you to abbreviate what you type, only typing as much of the
+response as is necessary to uniquely identify it.  In addition, you can
+request Info to fill in as much of the response as is possible; this
+is called @dfn{completion}.
+
+The following commands are available when completing in the echo area:
+
+@table @asis
+@item @code{TAB} (@code{echo-area-complete})
+@itemx @code{SPC}
+@kindex TAB, in the echo area
+@kindex SPC, in the echo area
+@findex echo-area-complete
+Insert as much of a completion as is possible.
+
+@item @code{?} (@code{echo-area-possible-completions})
+@kindex ?, in the echo area
+@findex echo-area-possible-completions
+Display a window containing a list of the possible completions of what
+you have typed so far.  For example, if the available choices are:
+
+@example
+@group
+bar
+foliate
+food
+forget
+@end group
+@end example
+
+@noindent
+and you have typed an @samp{f}, followed by @samp{?}, the possible
+completions would contain:
+
+@example
+@group
+foliate
+food
+forget
+@end group
+@end example
+
+@noindent
+i.e., all of the choices which begin with @samp{f}.  Pressing @key{SPC}
+or @key{TAB} would result in @samp{fo} appearing in the echo area, since
+all of the choices which begin with @samp{f} continue with @samp{o}.
+Now, typing @samp{l} followed by @samp{TAB} results in @samp{foliate}
+appearing in the echo area, since that is the only choice which begins
+with @samp{fol}.
+
+@item @code{ESC C-v} (@code{echo-area-scroll-completions-window})
+@kindex ESC C-v, in the echo area
+@findex echo-area-scroll-completions-window
+Scroll the completions window, if that is visible, or the "other"
+window if not.
+@end table
+
+@node Printing Nodes, Miscellaneous Commands, Window Commands, Top
+@chapter Printing Out Nodes
+@cindex printing
+
+You may wish to print out the contents of a node as  a quick reference
+document for later use.  Info provides you with a command for doing
+this.  In general, we recommend that you use @TeX{} to format the
+document and print sections of it, by running @code{tex} on the Texinfo
+source file.
+
+@table @asis
+@item @code{M-x print-node}
+@findex print-node
+@cindex INFO_PRINT_COMMAND, environment variable
+Pipe the contents of the current node through the command in the
+environment variable @code{INFO_PRINT_COMMAND}.  If the variable does not
+exist, the node is simply piped to @code{lpr}.
+@end table
+
+@node Miscellaneous Commands, Variables, Printing Nodes, Top
+@chapter Miscellaneous Commands
+
+GNU Info contains several commands which self-document GNU Info:
+
+@table @asis
+@item @code{M-x describe-command}
+@cindex functions, describing
+@cindex commands, describing
+@findex describe-command
+Read the name of an Info command in the echo area and then display a
+brief description of what that command does.
+
+@item @code{M-x describe-key}
+@cindex keys, describing
+@findex describe-key
+Read a key sequence in the echo area, and then display the name and
+documentation of the Info command that the key sequence invokes.
+
+@item @code{M-x describe-variable}
+Read the name of a variable in the echo area and then display a brief
+description of what the variable affects.
+
+@item @code{M-x where-is}
+@findex where-is
+Read the name of an Info command in the echo area, and then display
+a key sequence which can be typed in order to invoke that command.
+
+@item @code{C-h} (@code{get-help-window})
+@itemx @code{?}
+@kindex C-h
+@kindex ?, in Info windows
+@findex get-help-window
+Create (or Move into) the window displaying @code{*Help*}, and place
+a node containing a quick reference card into it.  This window displays
+the most concise information about GNU Info available.
+
+@item @code{h} (@code{get-info-help-node})
+@kindex h
+@findex get-info-help-node
+Try hard to visit the node @code{(info)Help}.  The Info file
+@file{info.texi} distributed with GNU Info contains this node.  Of
+course, the file must first be processed with @code{makeinfo}, and then
+placed into the location of your Info directory.
+@end table
+
+Here are the commands for creating a numeric argument:
+
+@table @asis
+@item @code{C-u} (@code{universal-argument})
+@cindex numeric arguments
+@kindex C-u
+@findex universal-argument
+Start (or multiply by 4) the current numeric argument.  @samp{C-u} is
+a good way to give a small numeric argument to cursor movement or
+scrolling commands; @samp{C-u C-v} scrolls the screen 4 lines, while
+@samp{C-u C-u C-n} moves the cursor down 16 lines.
+
+@item @code{M-1} (@code{add-digit-to-numeric-arg})
+@itemx @code{M-2} @dots{} @code{M-9}
+@kindex M-1 @dots{} M-9
+@findex add-digit-to-numeric-arg
+Add the digit value of the invoking key to the current numeric
+argument.  Once Info is reading a numeric argument, you may just type
+the digits of the argument, without the Meta prefix.  For example, you
+might give @samp{C-l} a numeric argument of 32 by typing:
+
+@example
+@kbd{C-u 3 2 C-l}
+@end example
+
+@noindent
+or
+
+@example
+@kbd{M-3 2 C-l}
+@end example
+@end table
+
+@samp{C-g} is used to abort the reading of a multi-character key
+sequence, to cancel lengthy operations (such as multi-file searches) and
+to cancel reading input in the echo area.
+
+@table @asis
+@item @code{C-g} (@code{abort-key})
+@cindex cancelling typeahead
+@cindex cancelling the current operation
+@kindex C-g, in Info windows
+@findex abort-key
+Cancel current operation.
+@end table
+
+The @samp{q} command of Info simply quits running Info.
+
+@table @asis
+@item @code{q} (@code{quit})
+@cindex quitting
+@kindex q
+@findex quit
+Exit GNU Info.
+@end table
+
+If the operating system tells GNU Info that the screen is 60 lines tall,
+and it is actually only 40 lines tall, here is a way to tell Info that
+the operating system is correct.
+
+@table @asis
+@item @code{M-x set-screen-height}
+@findex set-screen-height
+@cindex screen, changing the height of
+Read a height value in the echo area and set the height of the
+displayed screen to that value.
+@end table
+
+Finally, Info provides a convenient way to display footnotes which might
+be associated with the current node that you are viewing:
+
+@table @asis
+@item @code{ESC C-f} (@code{show-footnotes})
+@kindex ESC C-f
+@findex show-footnotes
+@cindex footnotes, displaying
+Show the footnotes (if any) associated with the current node in another
+window.  You can have Info automatically display the footnotes
+associated with a node when the node is selected by setting the variable
+@code{automatic-footnotes}.  @xref{Variables, , @code{automatic-footnotes}}.
+@end table
+
+@node Variables, GNU Info Global Index, Miscellaneous Commands, Top
+@chapter Manipulating Variables
+
+GNU Info contains several @dfn{variables} whose values are looked at by
+various Info commands.  You can change the values of these variables,
+and thus change the behavior of Info to more closely match your
+environment and Info file reading manner.
+
+@table @asis
+@item @code{M-x set-variable}
+@cindex variables, setting
+@findex set-variable
+Read the name of a variable, and the value for it, in the echo area and
+then set the variable to that value.  Completion is available when
+reading the variable name; often, completion is available when reading
+the value to give to the variable, but that depends on the variable
+itself.  If a variable does @emph{not} supply multiple choices to
+complete over, it expects a numeric value.
+
+@item @code{M-x describe-variable}
+@cindex variables, describing
+@findex describe-variable
+Read the name of a variable in the echo area and then display a brief
+description of what the variable affects.
+@end table
+
+Here is a list of the variables that you can set in Info.
+
+@table @code
+@item automatic-footnotes
+@vindex automatic-footnotes
+When set to @code{On}, footnotes appear and disappear automatically.
+This variable is @code{On} by default.  When a node is selected, a
+window containing the footnotes which appear in that node is created,
+and the footnotes are displayed within the new window.  The window that
+Info creates to contain the footnotes is called @samp{*Footnotes*}.  If
+a node is selected which contains no footnotes, and a @samp{*Footnotes*}
+window is on the screen, the @samp{*Footnotes*} window is deleted.
+Footnote windows created in this fashion are not automatically tiled so
+that they can use as little of the display as is possible.
+
+@item automatic-tiling
+@vindex automatic-tiling
+When set to @code{On}, creating or deleting a window resizes other
+windows.  This variable is @code{Off} by default.  Normally, typing
+@samp{C-x 2} divides the current window into two equal parts.  When
+@code{automatic-tiling} is set to @code{On}, all of the windows are
+resized automatically, keeping an equal number of lines visible in each
+window.  There are exceptions to the automatic tiling; specifically, the
+windows @samp{*Completions*} and @samp{*Footnotes*} are @emph{not}
+resized through automatic tiling; they remain their original size.
+
+@item visible-bell
+@vindex visible-bell
+When set to @code{On}, GNU Info attempts to flash the screen instead of
+ringing the bell.  This variable is @code{Off} by default.  Of course,
+Info can only flash the screen if the terminal allows it; in the case
+that the terminal does not allow it, the setting of this variable has no
+effect.  However, you can make Info perform quietly by setting the
+@code{errors-ring-bell} variable to @code{Off}.
+
+@item errors-ring-bell
+@vindex errors-ring-bell
+When set to @code{On}, errors cause the bell to ring.  The default
+setting of this variable is @code{On}.
+
+@item gc-compressed-files
+@vindex gc-compressed-files
+When set to @code{On}, Info garbage collects files which had to be
+uncompressed.  The default value of this variable is @code{Off}.
+Whenever a node is visited in Info, the Info file containing that node
+is read into core, and Info reads information about the tags and nodes
+contained in that file.  Once the tags information is read by Info, it
+is never forgotten.  However, the actual text of the nodes does not need
+to remain in core unless a particular Info window needs it.  For
+non-compressed files, the text of the nodes does not remain in core when
+it is no longer in use.  But de-compressing a file can be a time
+consuming operation, and so Info tries hard not to do it twice.
+@code{gc-compressed-files} tells Info it is okay to garbage collect the
+text of the nodes of a file which was compressed on disk.
+
+@item show-index-match
+@vindex show-index-match
+When set to @code{On}, the portion of the matched search string is
+highlighted in the message which explains where the matched search
+string was found.  The default value of this variable is @code{On}.
+When Info displays the location where an index match was found,
+(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the
+string that you had typed is highlighted by displaying it in the inverse
+case from its surrounding characters.
+
+@item scroll-behavior
+@vindex scroll-behavior
+Control what happens when forward scrolling is requested at the end of
+a node, or when backward scrolling is requested at the beginning of a
+node.  The default value for this variable is @code{Continuous}.  There
+are three possible values for this variable:
+
+@table @code
+@item Continuous
+Try to get the first item in this node's menu, or failing that, the
+@samp{Next} node, or failing that, the @samp{Next} of the @samp{Up}.
+This behavior is identical to using the @samp{]}
+(@code{global-next-node}) and @samp{[} (@code{global-prev-node})
+commands.
+
+@item Next Only
+Only try to get the @samp{Next} node.
+
+@item Page Only
+Simply give up, changing nothing.  If @code{scroll-behavior} is
+@code{Page Only}, no scrolling command can change the node that is being
+viewed.
+@end table
+
+@item scroll-step
+@vindex scroll-step
+The number of lines to scroll when the cursor moves out of the window.
+Scrolling happens automatically if the cursor has moved out of the
+visible portion of the node text when it is time to display.  Usually
+the scrolling is done so as to put the cursor on the center line of the
+current window.  However, if the variable @code{scroll-step} has a
+nonzero value, Info attempts to scroll the node text by that many lines;
+if that is enough to bring the cursor back into the window, that is what
+is done.  The default value of this variable is 0, thus placing the
+cursor (and the text it is attached to) in the center of the window.
+Setting this variable to 1 causes a kind of "smooth scrolling" which
+some people prefer.
+
+@item ISO-Latin
+@cindex ISO Latin characters
+@vindex ISO-Latin
+When set to @code{On}, Info accepts and displays ISO Latin characters.
+By default, Info assumes an ASCII character set.  @code{ISO-Latin} tells
+Info that it is running in an environment where the European standard
+character set is in use, and allows you to input such characters to
+Info, as well as display them.
+@end table
+
+
+
+@c the following is incomplete
+@ignore
+@c node Info for Sys Admins
+@c chapter Info for System Administrators
+
+This text describes some common ways of setting up an Info hierarchy
+from scratch, and details the various options that are available when
+installing Info.  This text is designed for the person who is installing
+GNU Info on the system; although users may find the information present
+in this section interesting, none of it is vital to understanding how to
+use GNU Info.
+
+@menu
+* Setting the INFOPATH::        Where are my Info files kept?
+* Editing the DIR node::        What goes in `DIR', and why?
+* Storing Info files::          Alternate formats allow flexibility in setups.
+* Using `localdir'::            Building DIR on the fly.
+* Example setups::              Some common ways to organize Info files.
+@end menu
+
+@c node Setting the INFOPATH
+@c section Setting the INFOPATH
+
+Where are my Info files kept?
+
+@c node Editing the DIR node
+@c section Editing the DIR node
+
+What goes in `DIR', and why?
+
+@c node Storing Info files
+@c section Storing Info files
+
+Alternate formats allow flexibility in setups.
+
+@c node Using `localdir'
+@c section Using `localdir'
+
+Building DIR on the fly.
+
+@c node Example setups
+@c section Example setups
+
+Some common ways to organize Info files.
+@end ignore
+
+@node GNU Info Global Index,  , Variables, Top
+@appendix Global Index
+
+@printindex cp
+
+@contents
+@bye
diff --git a/man/internals/Makefile b/man/internals/Makefile
new file mode 100644 (file)
index 0000000..9229d29
--- /dev/null
@@ -0,0 +1,70 @@
+# Makefile for the XEmacs Internals Manual.
+
+# 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.
+
+VERSION=1.0
+NAME=internals
+manual = xemacs-internals-manual-19-$(VERSION)
+
+TEXI2DVI = texi2dvi
+MAKEINFO = makeinfo
+
+# Uncomment this line for permuted index.
+# permuted_index = 1 
+
+# List of all the texinfo files in the manual:
+
+srcs = internals.texi index.unperm index.perm
+
+all : info
+info : ../../info/$(NAME).info
+
+../../info/$(NAME).info: $(srcs) index.texi
+       @echo "Expect a coredump if you are not using makeinfo 1.68 (or later)"
+       $(MAKEINFO) $(NAME).texi
+       @rm -f core
+
+dvi : $(NAME).dvi
+
+$(NAME).dvi: $(srcs) index.texi
+       # Avoid losing old contents of aux file entirely.
+       -mv $(NAME).aux $(NAME).oaux
+       # First shot to define xrefs:
+       $(TEX) $(NAME).texi
+       if [ a${permuted_index} != a ]; \
+       then ./permute-index && mv permuted.fns $(NAME).fns; \
+       else texindex $(NAME).??; \
+       fi
+       $(TEX) $(NAME).texi
+
+index.texi:
+       if [ a${permuted_index} != a ]; \
+       then ln -s index.perm   index.texi; \
+       else ln -s index.unperm index.texi; \
+       fi
+
+.PHONY: mostlyclean clean distclean realclean extraclean
+mostlyclean:
+       rm -f *.toc *.aux *.log *.cp *.cps *.fn *.fns *.tp *.tps \
+              *.vr *.vrs *.pg *.pgs *.ky *.kys
+clean: mostlyclean
+       rm -f *.dvi *.ps make.out core index.texi
+distclean:  clean
+realclean:  clean
+extraclean: clean
+       -rm -f *~ \#*
diff --git a/man/internals/index.perm b/man/internals/index.perm
new file mode 100644 (file)
index 0000000..0624e15
--- /dev/null
@@ -0,0 +1,37 @@
+@c -*-texinfo-*-
+@setfilename ../../info/index.info
+
+@c Indexing guidelines
+
+@c I assume that all indexes will be combined.
+@c Therefore, if a generated findex and permutations
+@c cover the ways an index user would look up the entry,
+@c then no cindex is added.
+@c Concept index (cindex) entries will also be permuted.  Therefore, they
+@c have no commas and few irrelevant connectives in them.
+
+@c I tried to include words in a cindex that give the context of the entry,
+@c particularly if there is more than one entry for the same concept.
+@c For example, "nil in keymap"
+@c Similarly for explicit findex and vindex entries, e.g. "print example".
+
+@c Error codes are given cindex entries, e.g. "end-of-file error".
+
+@c pindex is used for .el files and Unix programs
+
+@node Index,  , Interface to X Windows, Top
+@unnumbered Index
+
+
+All variables, functions, keys, programs, files, and concepts are
+in this one index.  
+
+All names and concepts are permuted, so they appear several times, one
+for each permutation of the parts of the name.  For example,
+@code{function-name} would appear as @b{function-name} and @b{name,
+function-}.  Key entries are not permuted, however.
+
+
+@c Print the indices
+
+@printindex fn
diff --git a/man/internals/index.unperm b/man/internals/index.unperm
new file mode 100644 (file)
index 0000000..4a27571
--- /dev/null
@@ -0,0 +1,37 @@
+@c -*-texinfo-*-
+@setfilename ../../info/index.info
+
+@c Indexing guidelines
+
+@c I assume that all indexes will be combined.
+@c Therefore, if a generated findex and permutations
+@c cover the ways an index user would look up the entry,
+@c then no cindex is added.
+@c Concept index (cindex) entries will also be permuted.  Therefore, they
+@c have no commas and few irrelevant connectives in them.
+
+@c I tried to include words in a cindex that give the context of the entry,
+@c particularly if there is more than one entry for the same concept.
+@c For example, "nil in keymap"
+@c Similarly for explicit findex and vindex entries, e.g. "print example".
+
+@c Error codes are given cindex entries, e.g. "end-of-file error".
+
+@c pindex is used for .el files and Unix programs
+
+@node Index,  , Interface to X Windows, Top
+@unnumbered Index
+
+@ignore
+All variables, functions, keys, programs, files, and concepts are
+in this one index.  
+
+All names and concepts are permuted, so they appear several times, one
+for each permutation of the parts of the name.  For example,
+@code{function-name} would appear as @b{function-name} and @b{name,
+function-}.  Key entries are not permuted, however.
+@end ignore
+
+@c Print the indices
+
+@printindex fn
diff --git a/man/lispref/Makefile b/man/lispref/Makefile
new file mode 100644 (file)
index 0000000..5ab9c87
--- /dev/null
@@ -0,0 +1,80 @@
+# Makefile for the  XEmacs Lisp Programmer's Manual.
+
+# 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.
+
+VERSION=2.4
+NAME=lispref
+manual = elisp-manual-19-$(VERSION)
+
+TEXI2DVI = texi2dvi
+MAKEINFO = makeinfo
+
+# Uncomment this line for permuted index.
+# permuted_index = 1 
+
+# List of all the texinfo files in the manual:
+
+srcs = abbrevs.texi annotations.texi back.texi backups.texi buffers.texi \
+  building.texi commands.texi compile.texi consoles-devices.texi control.texi \
+  databases.texi debugging.texi dialog.texi display.texi edebug-inc.texi \
+  edebug.texi errors.texi eval.texi extents.texi faces.texi files.texi \
+  frames.texi functions.texi glyphs.texi hash-tables.texi help.texi \
+  hooks.texi index.texi internationalization.texi intro.texi \
+  keymaps.texi ldap.texi lispref.texi lists.texi loading.texi locals.texi \
+  macros.texi maps.texi markers.texi menus.texi minibuf.texi modes.texi \
+  mouse.texi mule.texi numbers.texi objects.texi os.texi positions.texi \
+  processes.texi range-tables.texi scrollbars.texi searching.texi \
+  sequences.texi specifiers.texi streams.texi strings.texi symbols.texi \
+  syntax.texi text.texi tips.texi toolbar.texi tooltalk.texi variables.texi \
+  windows.texi x-windows.texi index.unperm index.perm
+
+all : info
+info : ../../info/$(NAME).info
+
+../../info/$(NAME).info: $(srcs) index.texi
+       $(MAKEINFO) -o $@ $(NAME).texi
+
+dvi: $(NAME).dvi
+
+$(NAME).dvi: $(srcs) index.texi
+       # Avoid losing old contents of aux file entirely.
+       -mv $(NAME).aux $(NAME).oaux
+       # First shot to define xrefs:
+       $(TEX) $(NAME).texi
+       if [ a${permuted_index} != a ]; \
+       then ./permute-index && mv permuted.fns $(NAME).fns; \
+       else texindex $(NAME).??; \
+       fi
+       $(TEX) $(NAME).texi
+
+index.texi:
+       if [ a${permuted_index} != a ]; \
+       then ln -s index.perm   index.texi; \
+       else ln -s index.unperm index.texi; \
+       fi
+
+.PHONY: mostlyclean clean distclean realclean extraclean
+mostlyclean:
+       rm -f *.toc *.aux *.log *.cp *.cps *.fn *.fns *.tp *.tps \
+              *.vr *.vrs *.pg *.pgs *.ky *.kys
+clean: mostlyclean
+       rm -f *.dvi *.ps make.out core index.texi
+distclean: clean
+realclean: distclean
+extraclean: distclean
+       -rm -f *~ \#*
diff --git a/man/lispref/index.perm b/man/lispref/index.perm
new file mode 100644 (file)
index 0000000..163d218
--- /dev/null
@@ -0,0 +1,37 @@
+@c -*-texinfo-*-
+@setfilename ../../info/index.info
+
+@c Indexing guidelines
+
+@c I assume that all indexes will be combined.
+@c Therefore, if a generated findex and permutations
+@c cover the ways an index user would look up the entry,
+@c then no cindex is added.
+@c Concept index (cindex) entries will also be permuted.  Therefore, they
+@c have no commas and few irrelevant connectives in them.
+
+@c I tried to include words in a cindex that give the context of the entry,
+@c particularly if there is more than one entry for the same concept.
+@c For example, "nil in keymap"
+@c Similarly for explicit findex and vindex entries, e.g. "print example".
+
+@c Error codes are given cindex entries, e.g. "end-of-file error".
+
+@c pindex is used for .el files and Unix programs
+
+@node Index,  , Standard Hooks, Top
+@unnumbered Index
+
+
+All variables, functions, keys, programs, files, and concepts are
+in this one index.  
+
+All names and concepts are permuted, so they appear several times, one
+for each permutation of the parts of the name.  For example,
+@code{function-name} would appear as @b{function-name} and @b{name,
+function-}.  Key entries are not permuted, however.
+
+
+@c Print the indices
+
+@printindex fn
diff --git a/man/lispref/index.unperm b/man/lispref/index.unperm
new file mode 100644 (file)
index 0000000..31ed313
--- /dev/null
@@ -0,0 +1,37 @@
+@c -*-texinfo-*-
+@setfilename ../../info/index.info
+
+@c Indexing guidelines
+
+@c I assume that all indexes will be combined.
+@c Therefore, if a generated findex and permutations
+@c cover the ways an index user would look up the entry,
+@c then no cindex is added.
+@c Concept index (cindex) entries will also be permuted.  Therefore, they
+@c have no commas and few irrelevant connectives in them.
+
+@c I tried to include words in a cindex that give the context of the entry,
+@c particularly if there is more than one entry for the same concept.
+@c For example, "nil in keymap"
+@c Similarly for explicit findex and vindex entries, e.g. "print example".
+
+@c Error codes are given cindex entries, e.g. "end-of-file error".
+
+@c pindex is used for .el files and Unix programs
+
+@node Index,  , Standard Hooks, Top
+@unnumbered Index
+
+@ignore
+All variables, functions, keys, programs, files, and concepts are
+in this one index.  
+
+All names and concepts are permuted, so they appear several times, one
+for each permutation of the parts of the name.  For example,
+@code{function-name} would appear as @b{function-name} and @b{name,
+function-}.  Key entries are not permuted, however.
+@end ignore
+
+@c Print the indices
+
+@printindex fn
diff --git a/man/lispref/permute-index b/man/lispref/permute-index
new file mode 100755 (executable)
index 0000000..600b066
--- /dev/null
@@ -0,0 +1,102 @@
+#!/bin/csh -f
+# Generate a permuted index of all names.
+# The result is a file called index.fns.
+
+# You will need to modify this for your needs.
+
+
+set TEXINDEX=texindex  # path to texindex command
+#set EMACS=xemacs     # your emacs command
+#set TEX=tex             # your tex command
+
+set MANUAL=lispref  # the base name of the manual
+
+# goto 3
+
+1:
+echo "Extract raw index from texinfo fn index."
+# Let texindex combine duplicate entries, later.
+# But it wants to protect non-alphanumerics thus confusing ptx.
+# Also change `\ ' to just a ` ', since texindex will fail. This is produced 
+# by `@findex two words' in an example environment (no doubt among others).
+# delete wrapper parens
+# change dots {} to dots{}
+# change {-} to char form, so ptx wont ignore it.
+# delete leading \entry {
+# change '\ ' to ' '
+# change lines with = < > since they mess up field extraction.
+# separate into fields delimited by "
+cat ${MANUAL}.fn | \
+       sed \
+       -e 's/(\([^)]*\))/\1/' \
+       -e 's/\\dots {}/(\\dots{})/' \
+       -e "s/{-}/{{\\tt\\char'055}}/" \
+       -e 's,^[^ ]* {,,' \
+       -e 's, },},' \
+       -e 's,\\ , ,g' \
+       -e 's/{\\tt\\char61}/=/' \
+       -e 's/{\\tt\\gtr}/>/' \
+       -e 's/{\\tt\\less}/</' \
+       -e 's/}{/"/g' \
+       | awk -F\" '{print $2, $1}' >! permuted.raw
+
+2:
+# Build break file for ptx.
+cat <<EOF > permuted.break
+-
+:
+EOF
+# Build the ignore file for ptx.
+# We would like to ignore "and", "or", and "for", 
+# but ptx ignores ignore words even if they stand alone.
+cat <<EOF > permuted.ignore
+the
+in
+to
+as
+a
+an
+of
+on
+them
+how
+from
+by
+EOF
+
+echo "Make troff permuted index."
+ptx -i permuted.ignore -b permuted.break -f -r -w 144 \
+        < permuted.raw >! permuted.t
+
+3:
+echo "Extract the desired fields."
+awk -F\" '{printf "%s\"%s\"%s\n", $4,$6,$9}' permuted.t >! permuted.fields 
+
+4:
+echo "Format for texindex."
+# delete lines that start with "and ", "for "
+sed    < permuted.fields \
+       -e 's/=/{\\tt\\char61}/' \
+       -e 's/>/{\\tt\\gtr}/' \
+       -e 's/</{\\tt\\less}/' \
+       -e '/"and /d' \
+       -e '/"for /d' \
+  | awk -F\" 'NF>0 {if ($1=="") {\
+         print "\entry {" $2 "}{" 0+$3 "}{" $2 "}" }\
+       else {\
+         print "\entry {" $2 ", " $1 "}{" 0+$3 "}{" $2 ", " $1 "}"} }'\
+             > permuted.fn
+
+5:
+echo "Sort with texindex."
+${TEXINDEX} permuted.fn
+#mv permuted.fns ${MANUAL}.fns
+
+# The resulting permuted.fns will be read when we run TeX 
+# on the manual the second time.  Or you can use permuted.texinfo here.
+#${TEX} permuted.texinfo
+
+6:
+echo "Clean up."
+rm -f permuted.fields permuted.t permuted.raw
+rm -f permuted.break permuted.ignore permuted.fn
diff --git a/man/new-users-guide/Makefile b/man/new-users-guide/Makefile
new file mode 100644 (file)
index 0000000..3e24296
--- /dev/null
@@ -0,0 +1,51 @@
+# Makefile for the XEmacs New Users Guide
+
+# 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.
+
+NAME=new-users-guide
+
+SHELL = /bin/sh
+TEXI2DVI = texi2dvi
+MAKEINFO = makeinfo
+
+# List of all the texinfo files in the manual:
+
+srcs = new-users-guide.texi custom1.texi files.texi region.texi \
+  custom2.texi help.texi search.texi edit.texi modes.texi \
+  xmenu.texi enter.texi
+
+all : info
+info : ../../info/$(NAME).info
+
+../../info/$(NAME).info: $(srcs)
+       $(MAKEINFO) -o $@ $(NAME).texi
+
+dvi : $(NAME).dvi
+.texi.dvi :
+       $(TEXI2DVI) $<
+
+.PHONY: mostlyclean clean distclean realclean extraclean
+mostlyclean:
+       rm -f *.toc *.aux *.oaux *.log *.cp *.cps *.fn *.fns *.tp *.tps \
+              *.vr *.vrs *.pg *.pgs *.ky *.kys
+clean: mostlyclean
+       rm -f *.dvi *.ps make.out core
+distclean:  clean
+realclean:  clean
+extraclean: clean
+       -rm -f *~ \#*
diff --git a/man/xemacs/Makefile b/man/xemacs/Makefile
new file mode 100644 (file)
index 0000000..24e9bd2
--- /dev/null
@@ -0,0 +1,56 @@
+# Makefile for the XEmacs Reference Manual.
+
+# 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.
+
+# Modified by Ben Wing, February 1994
+
+NAME=xemacs
+
+MAKEINFO = makeinfo
+TEXI2DVI = texi2dvi
+
+# List of all the texinfo files in the manual:
+
+srcs = xemacs.texi abbrevs.texi basic.texi buffers.texi building.texi \
+  calendar.texi cmdargs.texi custom.texi display.texi entering.texi \
+  files.texi fixit.texi glossary.texi gnu.texi help.texi indent.texi \
+  keystrokes.texi killing.texi xemacs.texi m-x.texi major.texi mark.texi \
+  menus.texi mini.texi misc.texi mouse.texi new.texi picture.texi \
+  programs.texi reading.texi regs.texi frame.texi search.texi sending.texi \
+  text.texi trouble.texi undo.texi windows.texi
+
+all : info
+info : ../../info/$(NAME).info
+
+dvi: $(NAME).dvi
+.texi.dvi :
+       $(TEXI2DVI) $<
+
+../../info/$(NAME).info: $(srcs)
+       $(MAKEINFO) -o $@ $(NAME).texi
+
+.PHONY: mostlyclean clean distclean realclean extraclean
+mostlyclean:
+       rm -f *.toc *.aux *.oaux *.log *.cp *.cps *.fn *.fns *.tp *.tps \
+              *.vr *.vrs *.pg *.pgs *.ky *.kys
+clean: mostlyclean
+       rm -f *.dvi *.ps make.out core
+distclean: clean
+realclean: distclean
+extraclean: distclean
+       -rm -f *~ \#*
diff --git a/modules/Makefile.in b/modules/Makefile.in
new file mode 100644 (file)
index 0000000..07405d2
--- /dev/null
@@ -0,0 +1,19 @@
+@SET_MAKE@
+SUBDIR=ldap base64 zlib example
+RECURSIVE_MAKE=@RECURSIVE_MAKE@
+SHELL = /bin/sh
+RM = rm -f
+
+all:
+       -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done
+
+install clean mostlyclean:
+       -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done
+
+distclean:
+       $(RM) Makefile config.*
+       -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done
+
+realclean extraclean:
+       $(RM) *~ \#*
+       -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done
diff --git a/modules/aclocal.m4 b/modules/aclocal.m4
new file mode 100644 (file)
index 0000000..1b1808d
--- /dev/null
@@ -0,0 +1,36 @@
+AC_DEFUN(XE_EMACS, [
+       dnl
+       dnl Apparently, if you run a shell window in Emacs, it sets the EMACS
+       dnl environment variable to 't'.  Lets undo the damage.
+       dnl
+       if test "${EMACS}" = "t"; then
+               EMACS=""
+       fi
+
+       AC_ARG_WITH(xemacs,           --with-xemacs             Use XEmacs to build, [ if test "${withval}" = "yes"; then EMACS=xemacs; else EMACS=${withval}; fi ])
+       AC_ARG_WITH(emacs,            --with-emacs              Use Emacs to build, [ if test "${withval}" = "yes"; then EMACS=emacs; else EMACS=${withval}; fi ])
+       AC_CHECK_PROG(EMACS, xemacs, xemacs, emacs)
+       AC_SUBST(EMACS)
+])
+
+AC_DEFUN(XE_CONFIG_VALUE, [
+       OUTPUT=./conftest-$$
+       rm -f ${OUTPUT}
+       ${EMACS} -batch -eval "
+(let ((hash (config-value-hash-table))
+      (desired (split-string \"$1\")))
+  (mapcar
+     (lambda (key)
+       (message \"Checking for %S\" (intern key))
+       (if (config-value (intern key))
+          (progn
+           (write-region (format \"%s=\\\"%s\\\"\n\" key (config-value (intern key)))
+                         nil \"${OUTPUT}\" t))))
+       desired))
+" 2> /dev/null > /dev/null
+       test -f ${OUTPUT} && . ${OUTPUT}
+       rm -f ${OUTPUT}
+       for ac_func in $1; do
+                :
+       done
+])
diff --git a/modules/base64/Makefile.in b/modules/base64/Makefile.in
new file mode 100644 (file)
index 0000000..4170df4
--- /dev/null
@@ -0,0 +1,37 @@
+# NOTE!!
+# The use of BLDDIR here is _BOGUS_.
+# What really needs to happen is that we should install config.h into
+# the architecture dependent directory when we really hash all this
+# out.
+
+blddir=@blddir@
+dll_cflags=@dll_cflags@
+dll_oflags=@dll_oflags@
+dll_lflags=@dll_lflags@
+dll_ld=@dll_ld@
+
+INCLUDES=-I$(blddir)/src
+CFLAGS=@CFLAGS@ $(INCLUDES)
+CC=@CC@
+RM=@RM@
+
+TARGET=base64
+
+.PHONY: clean mostlyclean distclean realclean install
+
+all: $(TARGET).ell
+
+$(TARGET).ell: $(TARGET).o
+       $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^
+
+install:
+       echo "Don't know how to install yet"
+
+clean mostlyclean:
+       $(RM) *.o $(TARGET).ell
+
+distclean: clean
+       $(RM) Makefile
+
+realclean extraclean: distclean
+       $(RM) *~ \#*
diff --git a/modules/configure.in b/modules/configure.in
new file mode 100644 (file)
index 0000000..123fb37
--- /dev/null
@@ -0,0 +1,23 @@
+AC_PREREQ(2.12)
+AC_INIT(configure.in)
+
+XE_EMACS
+XE_CONFIG_VALUE(dll_cflags dll_ld dll_lflags dll_oflags CFLAGS CC DEFS INSTALL top_srcdir blddir)
+
+RM='rm -f'
+
+AC_SUBST(INSTALL)
+AC_SUBST(RM)
+AC_SUBST(CC)
+AC_SUBST(dll_cflags)
+AC_SUBST(dll_oflags)
+AC_SUBST(dll_lflags)
+AC_SUBST(dll_ld)
+AC_SUBST(top_srcdir)
+AC_SUBST(blddir)
+
+AC_OUTPUT(Makefile
+          ldap/Makefile
+          base64/Makefile
+         example/Makefile
+         zlib/Makefile)
diff --git a/modules/example/Makefile.in b/modules/example/Makefile.in
new file mode 100644 (file)
index 0000000..4cb432f
--- /dev/null
@@ -0,0 +1,35 @@
+# NOTE!!
+# The use of BLDDIR here is _BOGUS_.
+# What really needs to happen is that we should install config.h into
+# the architecture dependent directory when we really hash all this
+# out.
+
+blddir=@blddir@
+dll_cflags=@dll_cflags@
+dll_oflags=@dll_oflags@
+dll_lflags=@dll_lflags@
+dll_ld=@dll_ld@
+INCLUDES=-I$(blddir)/src
+CFLAGS=@CFLAGS@ $(INCLUDES)
+CC=@CC@
+RM=@RM@
+
+TARGET=purified
+all: $(TARGET).ell
+
+.PHONY: clean mostlyclean distclean realclean install
+
+$(TARGET).ell: $(TARGET).o
+       $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^
+
+install:
+       echo "Don't know how to install yet"
+
+clean mostlyclean:
+       $(RM) *.o $(TARGET).ell
+
+distclean: clean
+       $(RM) Makefile
+
+realclean extraclean: distclean
+       $(RM) *~ \#*
diff --git a/modules/example/purified.c b/modules/example/purified.c
new file mode 100644 (file)
index 0000000..d66ad6c
--- /dev/null
@@ -0,0 +1,16 @@
+#include <config.h>
+#include "lisp.h"
+#include "emacsfns.h"
+
+DEFUN ("purifiedp", Fpurifiedp, 1, 1, 0, /*
+*/
+ (obj))
+{
+       return purified(obj) ? Qt : Qnil;
+}
+
+void
+syms_of()
+{
+       DEFSUBR(Fpurifiedp);
+}
diff --git a/modules/ldap/Makefile.in b/modules/ldap/Makefile.in
new file mode 100644 (file)
index 0000000..c35f80b
--- /dev/null
@@ -0,0 +1,37 @@
+# NOTE!!
+# The use of BLDDIR here is _BOGUS_.
+# What really needs to happen is that we should install config.h into
+# the architecture dependent directory when we really hash all this
+# out.
+
+blddir=@blddir@
+dll_cflags=@dll_cflags@
+dll_oflags=@dll_oflags@
+dll_lflags=@dll_lflags@
+dll_ld=@dll_ld@
+
+INCLUDES=-I$(blddir)/src
+CFLAGS=@CFLAGS@ $(INCLUDES)
+CC=@CC@
+RM=@RM@
+
+TARGET=eldap
+
+.PHONY: clean mostlyclean distclean realclean install
+
+all: $(TARGET).ell
+
+$(TARGET).ell: $(TARGET).o
+       $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^
+
+install:
+       echo "Don't know how to install yet"
+
+clean mostlyclean:
+       $(RM) *.o $(TARGET).ell
+
+distclean: clean
+       $(RM) Makefile
+
+realclean extraclean: distclean
+       $(RM) *~ \#*
diff --git a/modules/ldap/configure.in b/modules/ldap/configure.in
new file mode 100644 (file)
index 0000000..123fb37
--- /dev/null
@@ -0,0 +1,23 @@
+AC_PREREQ(2.12)
+AC_INIT(configure.in)
+
+XE_EMACS
+XE_CONFIG_VALUE(dll_cflags dll_ld dll_lflags dll_oflags CFLAGS CC DEFS INSTALL top_srcdir blddir)
+
+RM='rm -f'
+
+AC_SUBST(INSTALL)
+AC_SUBST(RM)
+AC_SUBST(CC)
+AC_SUBST(dll_cflags)
+AC_SUBST(dll_oflags)
+AC_SUBST(dll_lflags)
+AC_SUBST(dll_ld)
+AC_SUBST(top_srcdir)
+AC_SUBST(blddir)
+
+AC_OUTPUT(Makefile
+          ldap/Makefile
+          base64/Makefile
+         example/Makefile
+         zlib/Makefile)
diff --git a/modules/zlib/Makefile.in b/modules/zlib/Makefile.in
new file mode 100644 (file)
index 0000000..5b86a45
--- /dev/null
@@ -0,0 +1,37 @@
+# NOTE!!
+# The use of BLDDIR here is _BOGUS_.
+# What really needs to happen is that we should install config.h into
+# the architecture dependent directory when we really hash all this
+# out.
+
+blddir=@blddir@
+dll_cflags=@dll_cflags@
+dll_oflags=@dll_oflags@
+dll_lflags=@dll_lflags@
+dll_ld=@dll_ld@
+
+INCLUDES=-I$(blddir)/src
+CFLAGS=@CFLAGS@ $(INCLUDES)
+CC=@CC@
+RM=@RM@
+
+TARGET=zlib
+
+.PHONY: clean mostlyclean distclean realclean install
+
+all: $(TARGET).ell
+
+$(TARGET).ell: $(TARGET).o
+       $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^
+
+install:
+       echo "Don't know how to install yet"
+
+clean mostlyclean:
+       $(RM) *.o $(TARGET).ell
+
+distclean: clean
+       $(RM) Makefile
+
+realclean extraclean: distclean
+       $(RM) *~ \#*
diff --git a/nt/Makefile.cygwin b/nt/Makefile.cygwin
new file mode 100644 (file)
index 0000000..fdbd61e
--- /dev/null
@@ -0,0 +1,15 @@
+MSW_LIBS       =-luser32 -lgdi32 -lcomdlg32
+LDFLAGS                =-Wl,--subsystem,windows
+CFLAGS         =-g
+
+bindir         =/usr/local/bin
+
+INSTALL = /usr/local/src/xemacs-21.0-b42/lib-src/installexe.sh /d/cygnus/h-i386-cygwin32/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+
+runemacs.exe:  runemacs.o
+               $(CC) $(LDFLAGS) runemacs.o $(MSW_LIBS) -o $@
+
+install:       runemacs.exe
+               $(INSTALL_PROGRAM) runemacs.exe $(bindir)
diff --git a/nt/Todo b/nt/Todo
new file mode 100644 (file)
index 0000000..ac91718
--- /dev/null
+++ b/nt/Todo
@@ -0,0 +1,42 @@
+# List of problems with XEmacs. If anyone wants to work on these, please
+# mail me and I'll update the table below.
+
+# Core NT issues
+    1. Subprocess support is completely broken. 
+    2. Networking support is completely broken. This is due to the fact that
+       the model relies on the subprocess support also working. 
+    4. No binary release. We know a binary release would be A Good Thing.
+       However we want to make things stable before producing one so we don't
+       have to field too many problems. Sorry. 
+    5. Support for dired is perhaps not quite there. We need to port ls-lisp.el
+       from FSF Emacs. 
+    6. Currently the backup files do not get the same permissions as the file
+       being edited. August Hill is looking at this one. 
+    7. Verify that CRLF issues are dealt with correctly. Marc Paquette is
+       looking at this. 
+    8. Use the registry to store the root directory(ies) of lisp packages; that
+       is the path name, not the elisp files.
+
+# X issues
+    1. Redrawing on my (davidh) system seems fairly broken - I don't know if
+       this is the XEmacs redraw functionality, my X server or just something
+       strange with X under NT. Has anyone else experiences with this ?
+
+# Native GUI issues
+    0. The entire event model.
+    1. Calling mouse_[enter|leave]_frame_hook
+    2. Can't change bold, italic or bold-italic face fonts
+    3. Bogus delay when setting default- or initial-frame-plist
+    4. Short timeouts don't seem to be very accurate
+    5. Scrollbar dragging.  Redisplay isn't called while dragging.
+       Also can't retrieve 32 bit tracking position with GetScrollInfo()
+    6. Menubar
+    7. Palette handling
+    8. Middle mouse button emulation
+    9. Drag'n'drop
+   10. Images
+
+Old Issues. 
+
+    1. For some reason, HOME is a required environment variable. 
+
diff --git a/nt/inc/arpa/inet.h b/nt/inc/arpa/inet.h
new file mode 100644 (file)
index 0000000..f5d197c
--- /dev/null
@@ -0,0 +1 @@
+/* null version of <arpa/inet.h> - <sys/socket.h> has everything */
diff --git a/nt/inc/netdb.h b/nt/inc/netdb.h
new file mode 100644 (file)
index 0000000..5bf232e
--- /dev/null
@@ -0,0 +1 @@
+/* null version of <netdb.h> - <sys/socket.h> has everything */
diff --git a/nt/inc/netinet/in.h b/nt/inc/netinet/in.h
new file mode 100644 (file)
index 0000000..46fb0fa
--- /dev/null
@@ -0,0 +1 @@
+/* null version of <netinet/in.h> - <sys/socket.h> has everything */
diff --git a/nt/inc/pwd.h b/nt/inc/pwd.h
new file mode 100644 (file)
index 0000000..6202ccd
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _PWD_H_
+#define _PWD_H_
+/*
+ * pwd.h doesn't exist on NT, so we put together our own.
+ */
+
+struct passwd {
+    char *pw_name;
+    char *pw_passwd;
+    int   pw_uid;
+    int   pw_gid;
+    int   pw_quota;
+    char *pw_gecos;
+    char *pw_dir;
+    char *pw_shell;
+};
+
+#endif /* _PWD_H_ */
diff --git a/nt/inc/sys/dir.h b/nt/inc/sys/dir.h
new file mode 100644 (file)
index 0000000..df729d2
--- /dev/null
@@ -0,0 +1,75 @@
+/* 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: FSF 19.30. */
+
+/*
+       <dir.h> -- definitions for 4.2BSD-compatible directory access
+
+       last edit:      09-Jul-1983     D A Gwyn
+*/
+
+#ifdef VMS
+#ifndef FAB$C_BID
+#include <fab.h>
+#endif
+#ifndef NAM$C_BID
+#include <nam.h>
+#endif
+#ifndef RMS$_SUC
+#include <rmsdef.h>
+#endif
+#include "vms-dir.h"
+#endif /* VMS */
+
+#define DIRBLKSIZ      512             /* size of directory block */
+#ifdef VMS
+#define MAXNAMLEN      (DIR$S_NAME + 7) /* 80 plus room for version #.  */
+#define MAXFULLSPEC    NAM$C_MAXRSS /* Maximum full spec */
+#else
+#ifdef WINDOWSNT
+#define MAXNAMLEN      255
+#else  /* not WINDOWSNT */
+#define MAXNAMLEN      15              /* maximum filename length */
+#endif /* not WINDOWSNT */
+#endif /* VMS */
+       /* NOTE:  MAXNAMLEN must be one less than a multiple of 4 */
+
+struct direct                          /* data from readdir() */
+       {
+       long            d_ino;          /* inode number of entry */
+       unsigned short  d_reclen;       /* length of this record */
+       unsigned short  d_namlen;       /* length of string in d_name */
+       char            d_name[MAXNAMLEN+1];    /* name of file */
+       };
+
+typedef struct
+       {
+       int     dd_fd;                  /* file descriptor */
+       int     dd_loc;                 /* offset in block */
+       int     dd_size;                /* amount of valid data */
+       char    dd_buf[DIRBLKSIZ];      /* directory block */
+       }       DIR;                    /* stream data from opendir() */
+
+DIR *opendir (CONST char *filename);
+void closedir (DIR *dirp);
+struct direct *readdir (DIR *dirp);
+struct direct *readdirver (DIR *dirp);
+long telldir (DIR *dirp);
+void seekdir (DIR *dirp, long loc);
+
+#define rewinddir( dirp )      seekdir( dirp, 0L )
diff --git a/nt/inc/sys/file.h b/nt/inc/sys/file.h
new file mode 100644 (file)
index 0000000..8536d03
--- /dev/null
@@ -0,0 +1,8 @@
+/*
+ * sys\file.h doesn't exist on NT - only needed for these constants
+ */
+
+#define F_OK 0
+#define X_OK 1
+#define W_OK 2
+#define R_OK 4
diff --git a/nt/inc/sys/ioctl.h b/nt/inc/sys/ioctl.h
new file mode 100644 (file)
index 0000000..dc09578
--- /dev/null
@@ -0,0 +1,5 @@
+/*
+ * sys\ioctl.h doesn't exist on NT...rather than including it conditionally
+ * in many of the source files, we just extend the include path so that the
+ * compiler will pick this up empty header instead.
+ */
diff --git a/nt/inc/sys/param.h b/nt/inc/sys/param.h
new file mode 100644 (file)
index 0000000..397c5ff
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _PARAM_H_
+#define _PARAM_H_
+
+/*
+ * sys\param.h doesn't exist on NT, so we'll make one.
+ */
+
+#define NBPG 4096
+
+#endif /* _PARAM_H_ */
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h
new file mode 100644 (file)
index 0000000..03c6077
--- /dev/null
@@ -0,0 +1,86 @@
+/* Workable version of <sys/socket.h> based on winsock.h */
+
+#ifndef _SOCKET_H_
+#define _SOCKET_H_
+
+/* defeat the multiple include protection */
+#ifdef _WINSOCKAPI_
+#undef _WINSOCKAPI_
+#endif
+
+#if 0 /* What's wrong with winsock.h version ? - kkm */
+/* avoid clashing with our version of FD_SET if already defined */
+#ifdef FD_SET
+#undef FD_SET
+#undef FD_CLR
+#undef FD_ISSET
+#undef FD_ZERO
+#endif
+
+/* allow us to provide our own version of fd_set */
+#define fd_set ws_fd_set
+#endif /* 0 */
+
+/* avoid duplicate definition of timeval */
+#ifdef HAVE_TIMEVAL
+#define timeval ws_timeval
+#endif
+
+#include <winsock.h>
+
+#if 0 /* What's wrong with winsock.h version ? - kkm */
+/* revert to our version of FD_SET */
+#undef FD_SET
+#undef FD_CLR
+#undef FD_ISSET
+#undef FD_ZERO
+#undef fd_set
+#include "nt.h"
+#endif /* 0 */
+
+#ifdef HAVE_TIMEVAL
+#undef timeval
+#endif
+
+/* map winsock error codes to standard names */
+#define EWOULDBLOCK             WSAEWOULDBLOCK
+#define EINPROGRESS             WSAEINPROGRESS
+#define EALREADY                WSAEALREADY
+#define ENOTSOCK                WSAENOTSOCK
+#define EDESTADDRREQ            WSAEDESTADDRREQ
+#define EMSGSIZE                WSAEMSGSIZE
+#define EPROTOTYPE              WSAEPROTOTYPE
+#define ENOPROTOOPT             WSAENOPROTOOPT
+#define EPROTONOSUPPORT         WSAEPROTONOSUPPORT
+#define ESOCKTNOSUPPORT         WSAESOCKTNOSUPPORT
+#define EOPNOTSUPP              WSAEOPNOTSUPP
+#define EPFNOSUPPORT            WSAEPFNOSUPPORT
+#define EAFNOSUPPORT            WSAEAFNOSUPPORT
+#define EADDRINUSE              WSAEADDRINUSE
+#define EADDRNOTAVAIL           WSAEADDRNOTAVAIL
+#define ENETDOWN                WSAENETDOWN
+#define ENETUNREACH             WSAENETUNREACH
+#define ENETRESET               WSAENETRESET
+#define ECONNABORTED            WSAECONNABORTED
+#define ECONNRESET              WSAECONNRESET
+#define ENOBUFS                 WSAENOBUFS
+#define EISCONN                 WSAEISCONN
+#define ENOTCONN                WSAENOTCONN
+#define ESHUTDOWN               WSAESHUTDOWN
+#define ETOOMANYREFS            WSAETOOMANYREFS
+#define ETIMEDOUT               WSAETIMEDOUT
+#define ECONNREFUSED            WSAECONNREFUSED
+#define ELOOP                   WSAELOOP
+/* #define ENAMETOOLONG            WSAENAMETOOLONG */
+#define EHOSTDOWN               WSAEHOSTDOWN
+#define EHOSTUNREACH            WSAEHOSTUNREACH
+/* #define ENOTEMPTY               WSAENOTEMPTY */
+#define EPROCLIM                WSAEPROCLIM
+#define EUSERS                  WSAEUSERS
+#define EDQUOT                  WSAEDQUOT
+#define ESTALE                  WSAESTALE
+#define EREMOTE                 WSAEREMOTE
+
+#endif /* _SOCKET_H_ */
+
+/* end of socket.h */
diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h
new file mode 100644 (file)
index 0000000..3bbdbe7
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * sys/time.h doesn't exist on NT
+ */
+
+#include <time.h>
+
+struct timeval 
+  {
+    long tv_sec;       /* seconds */
+    long tv_usec;      /* microseconds */
+  };
+
+struct timezone 
+  {
+    int        tz_minuteswest; /* minutes west of Greenwich */
+    int        tz_dsttime;     /* type of dst correction */
+  };
+
+#ifndef HAVE_X_WINDOWS
+/* X11R6 on NT provides the single parameter version of this command */
+void gettimeofday (struct timeval *, struct timezone *);
+#endif
+
+/* end of sys/time.h */
diff --git a/nt/inc/unistd.h b/nt/inc/unistd.h
new file mode 100644 (file)
index 0000000..c1caa77
--- /dev/null
@@ -0,0 +1 @@
+/* Fake unistd.h: config.h already provides most of the relevant things. */
diff --git a/nt/puresize-adjust.h b/nt/puresize-adjust.h
new file mode 100644 (file)
index 0000000..b10cdc8
--- /dev/null
@@ -0,0 +1,3 @@
+/*     Do not edit this file!
+       Automatically generated by XEmacs */
+# define PURESIZE_ADJUSTMENT (0)
diff --git a/nt/runemacs.c b/nt/runemacs.c
new file mode 100644 (file)
index 0000000..a516eec
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+  Simple program to start Emacs with its console window hidden.
+
+  This program is provided purely for convenience, since most users will
+  use Emacs in windowing (GUI) mode, and will not want to have an extra
+  console window lying around.  */
+
+/*
+   You may want to define this if you want to be able to install updated
+   emacs binaries even when other users are using the current version.
+   The problem with some file servers (notably Novell) is that an open
+   file cannot be overwritten, deleted, or even renamed.  So if someone
+   is running emacs.exe already, you cannot install a newer version.
+   By defining CHOOSE_NEWEST_EXE, you can name your new emacs.exe
+   something else which matches "emacs*.exe", and runemacs will
+   automatically select the newest emacs executeable in the bin directory.
+   (So you'll probably be able to delete the old version some hours/days
+   later).
+*/
+
+/* #define CHOOSE_NEWEST_EXE */
+
+#define WIN32
+
+#include <windows.h>
+#include <string.h>
+#include <malloc.h>
+
+#if defined(__CYGWIN32__)
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+
+int WINAPI
+WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow)
+{
+  STARTUPINFO start;
+  SECURITY_ATTRIBUTES sec_attrs;
+  SECURITY_DESCRIPTOR sec_desc;
+  PROCESS_INFORMATION child;
+  int wait_for_child = FALSE;
+  DWORD ret_code = 0;
+  char *new_cmdline;
+  char *p;
+  char modname[MAX_PATH];
+
+  if (!GetModuleFileName (NULL, modname, MAX_PATH))
+    goto error;
+  if ((p = strrchr (modname, '\\')) == NULL)
+    goto error;
+  *p = 0;
+
+  new_cmdline = alloca (MAX_PATH + strlen (cmdline) + 1);
+  strcpy (new_cmdline, modname);
+
+#ifdef CHOOSE_NEWEST_EXE
+  {
+    /* Silly hack to allow new versions to be installed on
+       server even when current version is in use. */
+
+    char * best_name = alloca (MAX_PATH + 1);
+    FILETIME best_time = {0,0};
+    WIN32_FIND_DATA wfd;
+    HANDLE fh;
+    p = new_cmdline + strlen (new_cmdline);
+    strcpy (p, "\\xemacs*.exe ");
+    fh = FindFirstFile (new_cmdline, &wfd);
+    if (fh == INVALID_HANDLE_VALUE)
+      goto error;
+    do
+      {
+        if (wfd.ftLastWriteTime.dwHighDateTime > best_time.dwHighDateTime
+            || (wfd.ftLastWriteTime.dwHighDateTime == best_time.dwHighDateTime
+                && wfd.ftLastWriteTime.dwLowDateTime > best_time.dwLowDateTime))
+          {
+            best_time = wfd.ftLastWriteTime;
+            strcpy (best_name, wfd.cFileName);
+          }
+      }
+    while (FindNextFile (fh, &wfd));
+    FindClose (fh);
+    *p++ = '\\';
+    strcpy (p, best_name);
+    strcat (p, " ");
+  }
+#else
+#if defined(__CYGWIN32__)
+  {
+    struct stat stbuf;
+    char sym_link_name[MAX_PATH+1], real_name[MAX_PATH+1];
+    
+    strcpy(sym_link_name, new_cmdline);
+    strcat(sym_link_name, "\\xemacs");
+    if (lstat(sym_link_name, &stbuf) == 0)
+      {
+        if ((stbuf.st_mode & S_IFLNK) == S_IFLNK)
+          {
+           if (readlink(sym_link_name, real_name, sizeof(real_name)) == -1)
+              {
+                MessageBox (NULL, "Error reading symbolic link for xemacs",
+                            "Error", MB_ICONSTOP);
+                return 1;
+              }
+            else
+              {
+               strcat(new_cmdline, "\\");
+                strcat(new_cmdline, real_name);
+               strcat(new_cmdline, " ");
+             }
+          }
+        else
+          strcat(new_cmdline, "\\xemacs ");
+      }
+    else
+      {
+        MessageBox (NULL, "can't locate XEmacs executable",
+                    "Error", MB_ICONSTOP);
+       return 1;
+      }
+  }
+#else                                  
+  strcat (new_cmdline, "\\xemacs.exe ");
+#endif
+#endif
+
+  /* Append original arguments if any; first look for -wait as first
+     argument, and apply that ourselves.  */
+  if (strncmp (cmdline, "-wait", 5) == 0)
+    {
+      wait_for_child = TRUE;
+      cmdline += 5;
+    }
+  strcat (new_cmdline, cmdline);
+
+  /* Set emacs_dir variable if runemacs was in "%emacs_dir%\bin".  */
+  if ((p = strrchr (modname, '\\')) && stricmp (p, "\\bin") == 0)
+    {
+      *p = 0;
+      for (p = modname; *p; p++)
+       if (*p == '\\') *p = '/';
+      SetEnvironmentVariable ("emacs_dir", modname);
+    }
+
+  memset (&start, 0, sizeof (start));
+  start.cb = sizeof (start);
+  start.dwFlags = STARTF_USESHOWWINDOW;
+  start.wShowWindow = SW_HIDE;
+
+  sec_attrs.nLength = sizeof (sec_attrs);
+  sec_attrs.lpSecurityDescriptor = NULL;
+  sec_attrs.bInheritHandle = FALSE;
+
+  if (CreateProcess (NULL, new_cmdline, &sec_attrs, NULL, TRUE, 0,
+                    NULL, NULL, &start, &child))
+    {
+      if (wait_for_child)
+       {
+         WaitForSingleObject (child.hProcess, INFINITE);
+         GetExitCodeProcess (child.hProcess, &ret_code);
+       }
+      CloseHandle (child.hThread);
+      CloseHandle (child.hProcess);
+    }
+  else
+    goto error;
+  return (int) ret_code;
+
+error:
+  MessageBox (NULL, "Could not start XEmacs.", "Error", MB_ICONSTOP);
+  return 1;
+}
index 081fbc5..72e9ef4 100644 (file)
-1999-02-05  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * XEmacs 21.2.10 is released
-
-1999-02-02  Gleb Arshinov  <gleb@cs.stanford.edu>
-
-       * process-nt.c (nt_send_process): 
-       Fix for process-send-region/process-send-string breaking when size
-       of the input > 128 chars: change maximum chunk size for process
-       stream from 512 to 128, thus guaranteeing that ntpipe_shove_writer
-       succeeds.
-
-1999-02-02  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * XEmacs 21.2.9 is released
-
-1999-01-30  Martin Buchholz  <martin@xemacs.org>
-
-       * bytecode.c (funcall_compiled_function): Call
-       UNBIND_TO_GCPRO instead of UNBIND_TO_GCPRO_VARIABLES_ONLY.
-
-       * backtrace.h (UNBIND_TO_GCPRO_VARIABLES_ONLY): 
-       #ifdef 0 out unused macro.
-
-1999-01-27  Martin Buchholz  <martin@xemacs.org>
-
-       * gui.c (gui_parse_item_keywords_internal): Make static.
-
-1999-01-21  Andy Piper  <andy@xemacs.org>
-
-       * glyphs-msw.c: add xface support.
-       (mswindows_xface_instantiate): new function copied from glyphs-x.c
-       (image_instantiator_format_create_glyphs_mswindows): do device
-       specific initialisation for xfaces.
-       (xbm_create_bitmap_from_data): line data must be padded to a word
-       boundary.
-
-       * glyphs-x.c (xface_validate): moved to glyphs.c
-       (xface_normalize): ditto.
-       (xface_possible_dest_types): ditto.
-       (image_instantiator_format_create_glyphs_x): do device specific
-       initialisation for xfaces.
-
-       * glyphs.h: declare xface symbol.
-
-       * glyphs.c: move generic xface support here.
-       (xface_validate): moved from glyphs-x.c
-       (xface_normalize): ditto.
-       (xface_possible_dest_types): ditto.
-       (image_instantiator_format_create): xface declarations moved from
-       glyphs-x.c.
-
-1999-01-14  Adrian Aichner  <aichner@ecf.teradyne.com>
-
-       * event-stream.c (vars_of_event_stream): Fixing documentation.
-
-1999-01-17  Gunnar Evermann  <ge204@eng.cam.ac.uk>
-
-       * glyphs-eimage.c (gif_instantiate): Correct handling of
-       interlaced gifs to avoid writing past the end of the eimage
-       buffer. 
-
-1999-01-13  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * search.c (Freplace_match): Handle single backslash at end of
-       NEWTEXT correctly.
-
-1999-01-12  William M. Perry  <wmperry@aventail.com>
-
-       * eldap.c (Fldap_open): slow down interrupts around ldap_open to
-         avoid connection errors.
-
-1999-01-12  Andy Piper  <andy@xemacs.org>
-
-       * redisplay-output.c (redisplay_update_line): backout change that
-       shouldn't have gone ine.
-
-1999-01-09  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
-
-       * eldap.c (vars_of_ldap): Do no provide `ldap' here since it may
-       collide with ldap.el
-
-1999-01-11  Andy Piper  <andy@xemacs.org>
-
-       * redisplay.h (DISPLAY_LINE_HEIGHT): new macro.
-       (DISPLAY_LINE_YPOS): new macro.
-
-       * redisplay-msw.c (mswindows_output_string): use it.
-       (mswindows_output_pixmap): ditto.
-       (mswindows_output_display_block): ditto.
-
-       * redisplay-output.c (redisplay_output_display_block): new
-       function. just call the devmeth, maybe insert some generic code
-       here later.
-       (compare_display_blocks): use it.
-       (output_display_line): ditto.
-       (redisplay_unmap_subwindows_maybe): new function. potentially
-       unmap subwindows in the given area.
-
-       * glyphs.c (reset_subwindow_cachels): unmap subwindows that we are
-       resetting.
-
-1999-01-10  J. Kean Johnston  <jkj@sco.com>
-
-       * Makefile.in.in: Set value of moduledir
-       - Changed DUMPENV to include $(MODULEPATH)
-       - Added install rule to install header files for use by ellcc.
-
-       * config.h.in: Added INHIBIT_SITE_MODULES
-       - Added HAVE__DLERROR
-       - Added HAVE_DLFCN_H
-       - Added DLSYM_NEEDS_UNDERSCORE
-
-       * dll.c: Removed.
-
-       * emodules.c: New file containing dynamic loading code.
-
-       * emodules.h: New file.
-
-       * emacs.c: Added variables Vmodule_directory,
-       Vsite_module_directory, Vconfigure_module_directory and
-       Vconfigure_site_module_directory.
-       - (main_1): Added new variable inhibit_site_modules and command
-       line options `-no-site-modules' and `--no-site-modules'.
-       - (main_1): Call syms_of_module() instead of syms_of_dll().
-       - (main_1): Call vars_of_module().
-       - (vars_of_emacs): Introduce inhibit-site-modules,
-       module-directory, configure-module-directory,
-       site-module-directory, and configure-site-module-directory to the
-       Lisp reader.
-
-       * lisp.h: Declare load_module and list_modules, as well as
-       Vmodule_directory, Vsite_module_directory,
-       Vconfigure_module_directory and Vconfigure_site_module_directory.
-
-       * paths.h.in: Added PATH_MODULESEARCH and PATH_SITE_MODULES.
-       - Added correct support for site-lisp directory.
-
-       * symbols.c (defsubr): Modified to allow modules to add new subrs
-       after dump time.
-       - (defsubr_macro): Same.
-       - (defvar_magick): Only use purespace when not initialized, so
-       that loaded modules can still add symbols.
-
-       * symsinit.h: Add definitions for syms_of_module(),
-       vars_of_module().  Removed syms_of_dll().
-
-       * sysdll.c: Include dlfcn.h if HAVE_DLFCN_H is defined.
-       - (dll_variable): Take DLSYM_NEEDS_UNDERSCORE into account.
-       - (dll_error): use _dlerror() if HAVE__DLERROR is defined.
-
-       * s/sco5-shr.h (C_SWITCH_SYSTEM): Correct for modern gcc and
-       explicitly pass -belf for native cc.
-
-       * s/sco5.h (LIB_GCC): Use -print-libgcc-file-name instead of
-       hard-coding the library name.
-
-1999-01-01    <martin@xemacs.org>
-
-       * device-x.c (Fx_set_font_path): 
-       Add proper cast to permit compilation under C++.
-
-       * buffer.c (directory_is_current_directory): 
-       Add proper casts to permit compilation under C++.
-
-1998-12-30  Damon Lipparelli  <lipp@primus.com>
-
-       * event-msw.c (mswindows_wnd_proc):
-         Fixed failure when building with MSVC 5.
-
-1998-12-29  Martin Buchholz  <martin@xemacs.org>
-
-       * file-coding.c (decode_coding_iso2022): 
-       - Prevent crash when decoding ISO7/Lock detected files
-       - the usual martin fiddling
-
-1998-12-29  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * event-msw.c:
-         glyphs-msw.c:
-         Fixed failures when building with MSVC.
-       * unexnt.c (dump_bss_and_heap):
-         Removed compiler warning by removing bss_data variable.
-
-1998-12-18  Jim Radford  <radford@robby.caltech.edu>
-       * device-x.c (Fx_set_font_path, Fx_get_font_path): New functions
-       so that packages that distribute their own fonts can access them.
-
-1998-12-28  Andy Piper  <andy@xemacs.org>
-
-       * glyphs-msw.c (mswindows_button_instantiate): cope with buttons
-       that have an image provided.
-
-       * glyphs.h: add Q_image decl.
-
-       * glyphs-widget.c new functionality allowing images in
-       widgets.
-       (check_valid_glyph_or_image): new function to validate
-       glyphs passed in through :image.
-       (widget_normalize): new function. convert :image parameters into
-       real glyphs if not already so.
-       (widget_instantiate_1): mess with size parameters to be similar to
-       :image if provided.
-       (syms_of_glyphs_widget): new keyword :image.
-       (image_instantiator_format_create_glyphs_widget): normalize
-       buttons and allow :image.
-
-1998-12-27  Andy Piper  <andy@xemacs.org>
-
-       * frame-msw.c (mswindows_init_frame_1): warning elimination.
-
-       * glyphs-widget.c (check_valid_anything): no-op function.
-       (check_valid_callback): check callbacks in gui_items.
-       (check_valid_symbol): as it sounds.
-       (check_valid_string_or_vector): ditto.
-       (widget_validate): modified for descriptors that are vectors or
-       sequences of keyword/val pairs.
-       (widget_instantiate_1): ditto.
-       (image_instantiator_format_create_glyphs_widget): allow gui_item
-       keywords in the instantiator.
-
-       * gui.c (gui_parse_item_keywords_internal): renamed from
-       gui_parse_item_keywords but taking error behaviour.
-       (gui_parse_item_keywords): use it.
-       (gui_parse_item_keywords_no_errors): ditto.
-       (gui_item_add_keyval_pair): add Error_behavior flag and only
-       signal invalid keywords if required.
-
-       * gui.h: new gui signatures.
-
-       * menubar.c (menu_parse_submenu_keywords): use new
-       gui_item_add_keyval_pair signature.
-
-       * s/cygwin32.h: modify PTY_ITERATION to eliminate warnings.
-
-1998-12-28  Martin Buchholz <martin@xemacs.org>
-
-       * XEmacs 21.2.8 is released.
-
-1998-12-28  Martin Buchholz  <martin@xemacs.org>
-
-       * editfns.c (get_home_directory): 
-       (user-home-directory): Simplify.
-       
-
-       * callproc.c (child_setup): 
-       - Environment variables were being passed to inferior processes
-         using internal encoding.
-       - Convert to external encoding.
-       - Rename local var `tem' to better name `tail'.
-       - Use Flength instead of `manual' calculation.
-
-       * buffer.c (kill-buffer):
-       (record-buffer):
-       (set-buffer-major-mode):
-       (current-buffer):
-       - Fix up parameter names to correspond to docstrings.
-       - Don't use `bufname' when a buffer will do as well.
-       - Remove one unneeded GCPRO.
-
-       * buffer.h (initial_directory):
-       * buffer.c (init_initial_directory): 
-       - use correct conversions between internal and external format.
-       (directory_is_current_directory): new function
-       (init_buffer): convert initial_directory to internal format.
-       - solve crashes when current working directory is non-ASCII.
-
-       * alloc.c (xmalloc):
-       (xcalloc):
-       (xrealloc):
-       - remove stupid casts, since XEmacs requires an ANSI C system.
-       (lrecord_type_index): replace abort() with more readable assert().
-
-       (reset_lcrecord_stats): remove.
-       (sweep_lcrecords_1): 
-       - replace call to reset_lcrecord_stats() with call to xzero().
-
-1998-12-27  Martin Buchholz  <martin@xemacs.org>
-
-       * process-unix.c (unix_create_process):
-       - Fix crash invoking program with non-ASCII name.
-         Try invoking xemacs with SHELL=/bin/sh, then M-x shell.
-       - Remove unused variable `env'.
-       - Rename `temp' to better name `save_errno'.
-       - Reorganize code for clarity.  But still too chicken to nuke the
-         BSD 4.2 support.
-
-1998-12-24  Martin Buchholz <martin@xemacs.org>
-
-       * XEmacs 21.2.7 is released.
-
-1998-12-23  Martin Buchholz  <martin@xemacs.org>
-
-       * glyphs.c (decode_device_ii_format):
-       - Fix indentation.
-       - Use GET_C_STRING_FILENAME_DATA_ALLOCA with char *, not Extbyte *.
-
-       * glyphs-x.c (x_subwindow_instantiate):
-       - A image instance mask was being assigned to a image instance type!
-       - X_SUBWINDOW_INSTANCE_DATA (ii) is not an lvalue in C++.
-
-       * glyphs-msw.c (mswindows_initialize_dibitmap_image_instance):
-       Fix indentation.
-       * glyphs-x.h: Make indentation consistent.
-
-       * emacs.c (Fdump_emacs): Remove Steve Martin merge artifacts.
-
-       * glyphs-widget.c (check_valid_glyph): Warning suppression.
-       - Make it static
-       - #ifdef it out, since it's not actually used yet (FIX THIS!)
-
-       * glyphs-widget.c:
-       * glyphs.h:
-       Move declarations of decode_device_ii_format and
-       decode_image_instantiator_format into glyphs.h where they belong.
-
-1998-12-22  Martin Buchholz  <martin@xemacs.org>
-
-       * frame-x.c (x_delete_frame): Revert part of my changes at the
-       suggestion of Gunnar Evermann - unfortunately no one really
-       understands this code.
-
-       * callproc.c (init_callproc): code cleanup.
-
-       * free-hook.c (malloc):
-       (check_malloc):
-       (__free_hook):
-       (__malloc_hook):
-       (__realloc_hook):
-       (block_input_malloc):
-       (block_input_realloc):
-       * device-x.c (x_delete_device):
-       * emacs.c (voodoo_free_hook):
-       * events.c (print_event):
-       (CHECK_EVENT_TYPE):
-       (CHECK_EVENT_TYPE2):
-       (CHECK_EVENT_TYPE3):
-       Use proper prototypes.
-       Make C_E_T macros a little faster.
-       Pedantic fiddly little changes.  You really don't care.
-
-1998-12-22  Andy Piper  <andy@xemacs.org>
-
-       * redisplay-output.c (redisplay_clear_region): make sure that
-       fg/bg colors get set even when we are in the border area.
-
-1998-12-13  Martin Buchholz  <martin@xemacs.org>
-
-       * console-msw.c: Function definitions follow coding standards
-       - This prevents e.g. find-tag on Lisp_Event finding DEVENT
-
-1998-12-11  Martin Buchholz  <martin@xemacs.org>
-
-       * events.h (struct timeout_data):
-       * event-tty.c (tty_timeout_to_emacs_event):
-       * event-msw.c (mswindows_wm_timer_callback):
-       * event-Xt.c (Xt_timeout_to_emacs_event):
-       * event-msw.c (mswindows_cancel_dispatch_event):
-       Make sure Lisp_Objects inside events are initialized to Qnil, not
-       Qnull_pointer, which is now illegal.
-
-1998-12-10  Martin Buchholz  <martin@xemacs.org>
-
-       * lisp.h: Fix up prototypes to match alloc.c
-
-1998-12-08  Martin Buchholz  <martin@xemacs.org>
-
-       * windowsnt.h: Remove `support' for using index and rindex
-
-       * filelock.c (current_lock_owner):
-       - Change uses of index -> strchr, rindex -> strrchr
-
-1998-12-07  Martin Buchholz  <martin@xemacs.org>
-
-       * sysdep.c (set_descriptor_non_blocking):
-       Since O_NONBLOCK is now always #defined, make use of fcntl
-       conditional on F_SETFL being defined.
-
-       * console-msw.c (DHEADgER):
-       (DOPAQUE_DATA):
-       (DEVENT):
-       (DCONS):
-       (DCONSCDR):
-       (DSTRING):
-       (DVECTOR):
-       (DSYMBOL):
-       (DSYMNAME):
-       - max_align_t should not be visible to the user of the
-         XOPAQUE_DATA macro.
-       - use Bufbyte instead of char
-       - parens around (FOOP (obj)) are always redundant.
-         If they were necessary, we should fix the macro instead.
-       - Always use string_data(foo) instead of foo->data.
-
-
-1998-12-06  Martin Buchholz  <martin@xemacs.org>
-
-       * frame-msw.c (mswindows_init_frame_1):
-       - use make_lisp_hash_table, not Fmake_hash_table
-       - include elhash.h
-
-       * lisp.h:
-       * alloc.c (make_vector): remove travesty
-       (Fmake_vector):
-       (make_pure_vector):
-       (pure_cons):
-       (make_bit_vector_internal):
-       (make_bit_vector):
-       (make_bit_vector_from_byte_vector):
-       (Fmake_bit_vector):
-       - make vector_equal a little faster.
-       - Don't use variable name `new'.
-       - Use size_t instead of EMACS_INT.
-       - usual Martin-style pointless bit-twiddling.
-
-       * fns.c (mapcar1):
-       (Fmapconcat):
-       (Fmapcar):
-       (Fmapvector):
-       Make mapcar faster.  In particular, make
-         (mapc #'identity long-string)
-       MUCH faster under Mule.
-       * tests/automated/lisp-tests.el: Test 'em!
-
-       * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded
-       bytecode.
-
-1998-12-01  Martin Buchholz  <martin@xemacs.org>
-
-       * menubar-x.c (menu_item_descriptor_to_widget_value_1): Always use
-       Qnil, not NULL, to initialize `null' Lisp_Objects.
-
-1998-11-29  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * specifier.c (display_table_validate): Update.
-
-       * redisplay.c (create_text_block): Use them.
-
-       * glyphs.c (display_table_entry): New function.
-       (get_display_tables): Ditto.
-
-1998-12-15  Oscar Figueiredo  <Oscar.Figueiredo@di.epfl.ch>
-
-       * eldap.c (toplevel): Mention that eldap.c compiles with
-       OpenLDAP libs
-       (Fldap_open): Use `GET_C_STRING_OS_DATA_ALLOCA'
-       (Fldap_search_internal): Ditto
-
-1998-12-11  Martin Buchholz  <martin@xemacs.org>
-
-        * event-msw.c (mswindows_cancel_dispatch_event):
-        Gratuitous code prettification
-
-
-1998-12-07  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * fns.c (Fnconc): Fix use of wrong_type_argument().
-
-       * floatfns.c (Ffloat): Fix docstring.
-       (Ffloat): Fix use of wrong_type_argument().
-       (Fabs): Ditto.
-       (extract_float): Ditto.
-       (Fceiling): Ditto.
-       (Fround): Ditto.
-       (Ftruncate): Ditto.
-
-1998-12-06  Martin Buchholz  <martin@xemacs.org>
-
-       * frame-msw.c (mswindows_init_frame_1):
-       - use make_lisp_hash_table, not Fmake_hash_table
-       - include elhash.h
-
-       * lisp.h:
-       * alloc.c (make_vector): remove travesty
-       (Fmake_vector):
-       (make_pure_vector):
-       (pure_cons):
-       (make_bit_vector_internal):
-       (make_bit_vector):
-       (make_bit_vector_from_byte_vector):
-       (Fmake_bit_vector):
-       - make vector_equal a little faster.
-       - Don't use variable name `new'.
-       - Use size_t instead of EMACS_INT.
-       - usual Martin-style pointless bit-twiddling.
-
-       * fns.c (mapcar1):
-       (Fmapconcat):
-       (Fmapcar):
-       (Fmapvector):
-       Make mapcar faster.  In particular, make
-         (mapc #'identity long-string)
-       MUCH faster under Mule.
-       * tests/automated/lisp-tests.el: Test 'em!
-
-       * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded
-       bytecode.
-
-1998-12-02  Didier Verna  <verna@inf.enst.fr>
-
-       * menubar-x.c (menu_item_descriptor_to_widget_value_1): set the
-       accelerator field to nil for labels.
-
-1998-12-16  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * menubar-msw.c (displayable_menu_item):
-         Escape occurrences of '&' and support occurrences of the
-        '%_' accelerator indicator in menus.
-
-1998-11-26  Didier Verna  <verna@inf.enst.fr>
-
-       * dired.c (Fdirectory_files): use make_string instead of
-       make_ext_string on the filename. The conversion external->internal
-       format is already done in sys_readdir.
-
-1998-12-15  Gunnar Evermann  <ge204@eng.cam.ac.uk>
-
-       * glyphs.c (normalize_image_instantiator): GCPRO instantiator
-
-1998-12-16  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * event-msw.c
-         (Belatedly) added Kirill to list of file's authors.
-         emacs_mswindows_quit_p: Don't process WM_PAINT messages in
-         quit checking. WM_PAINT messages cause redisplay, but
-         windows' states are not necessarily stable when this function
-         gets called.
-
-1998-12-17  Andy Piper  <andy@xemacs.org>
-
-       * strftime.c (zone_name): CONSTify.
-
-1998-12-15  Andy Piper  <andy@xemacs.org>
-
-       * glyphs-msw.c (mswindows_combo_instantiate): ditto.
-       (mswindows_widget_property): return Qunbound when no property available.
-       (mswindows_button_property): ditto.
-       (mswindows_combo_property): ditto.
-       (mswindows_widget_set_property): ditto.
-
-       * glyphs-widget.c (check_valid_item_list): use properties.
-
-       * glyphs.h (struct Lisp_Image_Instance): we have properties now.
-
-       * glyphs.c (Fset_image_instance_property): allow setting of arbitrary properties.
-       (Fimage_instance_property): ditto.
-       * glyphs-widget.c (widget_property): ditto.
-       (widget_set_property): ditto.
-
-       * frame-msw.c (mswindows_set_frame_pointer): SetCursor() as well
-       as setting the class cursor so that GC actually changes the
-       cursor.
-
-       * config.h: don't undef MAIL_USE_POP.
-
-1998-12-13  Andy Piper  <andy@xemacs.org>
-
-       * glyphs-msw.c
-       (image_instantiator_format_create_glyphs_mswindows): line ->
-       label.
-       (mswindows_label_instantiate): ditto. Play with window flags.
-       (image_instantiator_format_create_glyphs_mswindows): ditto.
-       (vars_of_glyphs_mswindows): provide Qlabel as we support it now.
-
-       * glyphs-widget.c (widget_instantiate_1): re-jig autosizing to
-       cope with lines and labels.
-       (static_instantiate): use widget_instantiate_1.
-       line -> label.
-       (image_instantiator_format_create_glyphs_widget): ditto.
-
-1998-12-10  Andy Piper  <andy@xemacs.org>
-
-       * Makefile.in.in (objs): add gui.o
-
-1998-12-10  Andy Piper  <andy@xemacs.org>
-
-       * gui.c: adjust defines of HAVE_POPUPS so that we can build with
-       no window system.
-
-1998-12-09  Andy Piper  <andy@xemacs.org>
-
-       * glyphs.c (finalize_image_instance): mark glyphs changed when an
-       image instance is removed so that the subwindow cache gets reset
-       and thus destroyed images get GC'd.
-
-1998-12-08  Andy Piper  <andy@xemacs.org>
-
-       * gui-msw.c (mswindows_handle_gui_wm_command): call
-       MARK_SUBWINDOWS_CHANGED.
-
-       * glyphs-msw.c (mswindows_finalize_image_instance): make sure
-       subwindows really get deleted.
-
-       * redisplay.c: new variable subwindows_changed[_set].
-       (redisplay_window): use it.
-       (redisplay_frame): ditto.
-       (redisplay_device): ditto.
-       (redisplay_without_hooks): ditto.
-
-       * device.h (MARK_DEVICE_SUBWINDOWS_CHANGED): new macro for
-       subwindows redisplay as per glyphs equivalent.
-       * redisplay.h: ditto.
-       (MARK_SUBWINDOWS_CHANGED): ditto.
-       (RESET_CHANGED_SET_FLAGS): ditto.
-       * frame.h (MARK_FRAME_SUBWINDOWS_CHANGED): ditto.
-
-1998-12-07  Andy Piper  <andy@xemacs.org>
-
-       * frame.c (Fmake_frame): reset subwindow cachels on non-stream
-       frames.
-
-       * redisplay.c (redisplay_frame): invalidate subwindow cachels.
-
-       * event-msw.c (mswindows_wnd_proc): catch the various WM_CTLCOLOR*
-       messages and paint widget glyphs as appropriate with their face fg
-       & bg.
-
-1998-12-06  Andy Piper  <andy@xemacs.org>
-
-       * glyphs-msw.c (vars_of_glyphs_mswindows): provide widget types
-       here rather than in glyphs-widget - do this because we only want
-       to provide what is really available.
-
-       * glyphs.c (Fimage_instance_property): new function to get the
-       properties of image instances. wires through to console specific
-       methods and then to widget specific methods.
-       (Fset_image_instance_property): ditto but for setting widget properties.
-       (check_valid_face): make extern so that it can be used elsewhere.
-
-       * glyphs-widget.c (widget_property): new function. gets the
-       properties of widgets in general and wires the function through to
-       widget specific ones.
-       (widget_set_property): ditto but for setting widget properties.
-
-       * glyphs-msw.c (mswindows_combo_instantiate): Add functionality to
-       add items to the list. Play with window styles a bit to get the
-       desired effect.
-       (mswindows_widget_property): break out specific widget properties.
-       (mswindows_button_property): new function. gets the checked state
-       of a button.
-       (mswindows_combo_property): new function. gets the current
-       selection in the combo box.
-       (mswindows_widget_set_property): new function. sets specific
-       properties of specific widgets.
-
-       * glyphs-widget.c (check_valid_item_list): new function. check
-       that items for a combo-box are just a list of strings.
-       (combo_validate): new function. check there is an item list.
-       (widget_instantiate_1): new function. renamed from
-       widget_instantiate so that we can do slightly different things for
-       other widgets.
-       (widget_instantiate): call widget_instantiate_1.
-       (combo_instantiate): new function to instantiate combo boxes,
-       defaults height to the pixel height of the number of items in the
-       box.
-       (syms_of_glyphs_widget): move widget keywords here.
-       (image_instantiator_format_create_glyphs_widget): use new combo
-       functions.
-
-1998-12-04  Andy Piper  <andy@xemacs.org>
-
-       * event-msw.c (mswindows_wnd_proc): mule-ize.
-
-       * glyphs.c (pixmap_to_lisp_data): mule-ize.
-
-       * glyphs-msw.c (extract_xpm_color_names): mule-ize.
-       (resource_name_to_resource): ditto.
-       (mswindows_resource_instantiate): ditto.
-       (mswindows_widget_instantiate): ditto.
-       (mswindows_widget_set_property): ditto.
-
-       * redisplay-output.c (redisplay_output_subwindow): don't show
-       subwindows if they are obscured at the edge of the frame, emacs
-       gets into some sort of redisplay loop otherwise.
-
-       * gui.h: prototype gui_item_selected_p.
-
-       * gui.c (gui_item_selected_p): new function to determine the
-       selected state of a gui_item.
-
-       * frame.h (struct frame): add subwindows_changed flag.
-
-       * redisplay.c (redisplay_frame): call update_frame_subwindows ().
-
-       * glyphs.c (update_subwindow): new function to update a
-       subwindow's state.
-       (update_frame_subwindows): new function to update all the
-       subwindows on a frame.
-
-       * console.h (struct console_methods): add update_subwindow.
-
-       * glyphs-msw.c (mswindows_widget_property): return selected state
-       for selected property.
-       (mswindows_update_subwindow): new function. updates widget glyphs
-       in redisplay as per menubars or toolbars e.g. selected state.
-       (console_type_create_glyphs_mswindows): add update_subwindow.
-
-1998-12-03  Andy Piper  <andy@xemacs.org>
-
-       * console-tty.c (syms_of_console_tty): MULE -> FILE_CODING since
-       tty coding system things are such.
-
-       * glyphs-widget.c (widget_face_font_info): new function for
-       pulling out height and width metrics for a widget's face.
-       (widget_text_to_pixel_conversion): calculate pixel sizes of text
-       for widgets.
-
-       * event-msw.c (mswindows_drain_windows_queue): translate messages
-       that are destined for subwindows. This makes edit fields interact
-       with the keyboard correctly.
-       nuke warnings by #ifndef'ing out stuff not required by msg select().
-
-       * glyphs.h (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM): new
-       macro defining the iiforma without the symbol required by widget.
-       (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT): use it.
-
-       * general.c (syms_of_general): add Qwidget, Qselected.
-
-       * faces.c (complex_vars_of_faces): add widget face inheriting from
-       gui-element face.
-
-1998-11-09  Andy Piper  <andy@xemacs.org>
-
-       * window.h (struct window): add a cache of subwindows on a
-       per-window basis.
-
-       * window.c (mark_window): mark the subwindow_instance_cache.
-       (allocate_window): initialise the subwindow instance_cache.
-
-       * toolbar-x.c (x_output_toolbar): call redisplay_clear_region
-       instead of the devmeth.
-       (x_clear_toolbar): ditto.
-
-       * redisplay-x.c (x_output_display_block): call
-       redisplay_output_subwindow for subwindows and widgets.
-
-       * redisplay-tty.c (tty_output_display_block): add IMAGE_WIDGET to
-       types to do nothing for.
-
-       * lisp.h: declare new widget/subwindow symbols.
-
-       * glyphs.c (image_instantiate): cache subwindows on a per-window
-       basis.
-       (subwindow_possible_dest_types): new function for subwindow dest
-       types.
-       (subwindow_instantiate): generic instantiation of a
-       subwindow. specialised by device multi-methods.
-       (Fsubwindowp): moved from glyphs-x.c. adapted for glyph-based
-       subwindows.
-       (Fimage_instance_subwindow_id): ditto.
-       (Fresize_subwindow): ditto.
-       (Fforce_subwindow_map): ditto.
-
-       * glyphs-x.c (x_print_image_instance): remove subwindow
-       stuff. Handled genrically in glyphs.c.
-       (x_image_instance_equal): ditto.
-       (x_image_instance_hash): ditto.
-       (x_finalize_image_instance): delete subwindows when required.
-       (mark_subwindow) (print_subwindow) (finalize_subwindow)
-       (subwindow_hash) (Fmake_subwindow): deleted because of new,
-       glyph-based, subwindow implementation.
-       (Fsubwindow_height) (Fsubwindow_width) (Fsubwindow_xid): aliased
-       in glyphs.el
-       (Fsubwindowp) (Fresize_subwindow) (Fforce_subwindow_map): moved to
-       glyphs.c.
-       (x_unmap_subwindow): new function to unmap X subwindows.
-       (x_map_subwindow): new function to map X subwindows.
-       (x_subwindow_instantiate): new function to instantiate X
-       subwindows.
-       (x_resize_subwindow): new function to resize X subwindows.
-       (console_type_create_glyphs_x): add subwindow functions.
-       (image_instantiator_format_create_glyphs_x): add device
-       multi-methods for xpm, xbm and subwindow.
-
-       * glyphs.el (subwindow-xid): old alias for new subwindow functions.
-       (subwindow-width): ditto.
-       (subwindow-height): ditto.
-
-       * glyphs-msw.c (mswindows_widget_instantiate): new function for
-       generally instantiating ms subwindows. Used by
-       mswindows_*_instantiate.
-       (mswindows_edit_instantiate): instantiate an edit field on a
-       mswindows frame.
-
-1998-11-04  Andy Piper  <andy@xemacs.org>
-
-       * symsinit.h: declare new functions.
-
-       * redisplay.h: declare new functions.
-
-       * redisplay-x.c (x_output_display_block): call
-       redisplay_clear_region rather than x_clear_region.
-       (x_output_string): ditto.
-       (x_output_pixmap): ditto.
-       (x_clear_to_window_end): ditto.
-       (x_output_eol_cursor): ditto.
-       (x_clear_region): only do X specific things. other duties handled
-       in redisplay_clear_region.
-
-       * redisplay-tty.c (tty_clear_region): do tty specific things - some
-       duties moved to redisplay_clear_region.
-
-       * redisplay-output.c (clear_left_border): use
-       redisplay_clear_region instead of device method.
-       (clear_right_border): ditto.
-       (output_display_line): ditto.
-       (redisplay_output_subwindow): ditto.
-       (redisplay_clear_top_of_window): ditto.
-       (redisplay_clear_region): perform duties previously handled by
-       device methods. call the appropriate device method at the
-       end. unmap subwindows if necessary.
-
-       * redisplay-msw.c (mswindows_output_string): use
-       redisplay_clear_region instead of mswindows_clear_region.
-       (mswindows_clear_to_window_end): ditto.
-       (mswindows_output_display_block): output subwindows when required.
-       (mswindows_clear_region): only do mswindows specific things,
-       everything else is now handled in redisplay_clear_region.
-
-       * gui.h: add item id hash defines and declare function prototypes.
-
-       * gui.c (mark_gui_item): new function for marking gui_items.
-       (gui_item_hash): generic hash function for generating command ids
-       for gui_items.
-
-       * gui-msw.c: new file.
-       (mswindows_handle_gui_wm_command): new function to handle widget
-       callbacks.
-
-       * glyphs.h (MAYBE_IIFORMAT_DEVMETH): new function for device
-       multi-methods.
-       (IIFORMAT_HAS_SHARED_METHOD): ditto.
-       (DEFINE_DEVICE_IIFORMAT): ditto.
-       (INITIALIZE_DEVICE_IIFORMAT): ditto.
-       (struct Lisp_Image_Instance): add widget and subwindow data plus
-       appropriate access functions.
-
-       * glyphs.c (decode_device_ii_format): new function for decoding
-       image instantiator functions based on a device type as well as an
-       image format.
-       (decode_image_instantiator_format): just call
-       decode_device_ii_format with nil device.
-       (add_entry_to_device_ii_format_list): new function for per device
-       method instances.
-       (add_entry_to_image_instantiator_format_list): just call
-       add_entry_to_device_ii_format_list with nil device.
-       (check_valid_vector): new function.
-       (instantiate_image_instantiator): instantiate using per-format
-       method and then per-format-per-device method (device
-       multi-methods). signal an error if neither is possible.
-       (mark_image_instance): cope with subwindows and widgets.
-       (print_image_instance): ditto.
-       (image_instance_equal): ditto.
-       (image_instance_hash): ditto.
-       (allocate_glyph): ditto.
-       (glyph_width): ditto.
-       (glyph_height_internal): ditto.
-       (xpm_instantiate): removed because of device multi-methods.
-       (mark_subwindow_cachels): new cachel functions for caching
-       instantiated subwindows on a per-frame basis. mostly copied from
-       glyph cachel functions.
-       (update_subwindow_cachel_data): ditto.
-       (add_subwindow_cachel): ditto.
-       (get_subwindow_cachel_index): ditto.
-       (reset_subwindow_cachels): ditto.
-       (mark_subwindow_cachels_as_not_updated): ditto.
-       (unmap_subwindow): generic unmapping of subwindows based on cachel
-       data.
-       (map_subwindow): ditto.
-       (initialize_subwindow_image_instance): generic initialisation of
-       subwindow data.
-       (syms_of_glyphs): add widget keywords.
-
-       * glyphs-x.h (struct x_subwindow_data): convert Lisp_Subwindow to
-       x_subwindow_data.
-
-1998-11-04  Andy Piper  <andy@xemacs.org>
-
-       * glyphs-widget.c: new file for instantiating widget type glyphs.
-       (widget_possible_dest_types): new general dest type function for
-       widgets.
-       (widget_validate): ditto.
-       (initialize_widget_image_instance): ditto
-       (widget_instantiate): ditto. Sets up fg/bg, gui_item parsing
-       before handing on control to device multi-methods.
-       (syms_of_glyphs_widget): new function.
-       (image_instantiator_format_create_glyphs_widget): new function,
-       added placeholders for button, edit, combo, scrollbar
-       (vars_of_glyphs_widget): new function.
-
-       * glyphs-msw.h (WIDGET_INSTANCE_MSWINDOWS_HANDLE): new define for
-       storing window ids of widgets.
-
-       * glyphs-msw.c (mswindows_finalize_image_instance): cope with
-       deletion of widget and subwindow glyphs.
-       (mswindows_unmap_subwindow): new device function for unmapping
-       subwindows on a msw frame.
-       (mswindows_map_subwindow): ditto.
-       (mswindows_register_image_instance): register instantiated widgets
-       with the widget hastable.
-       (mswindows_button_instantiate): instantiate a button type widget
-       on an msw frame.
-       (mswindows_subwindow_instantiate): instanttiate a subwindow on a
-       mswindows frame.
-       (image_instantiator_format_create_glyphs_mswindows): add device
-       multi-methods for xbm, xpm, subwindow, edit and button.
-
-       * frame.h (struct frame): add subwindow_cachels dynarr for caching
-       information about subwindows visible on the current frame. used by
-       redisplay_clear_region to unmap subwindows as required.
-
-       * frame.c (mark_frame): mark subwindow_cachels.
-       (allocate_frame_core): instantiate subwindow_cachels.
-
-       * frame-msw.c (mswindows_init_frame_1): instntiate and mark the
-       widget hashtable.
-
-       * event-msw.c (mswindows_wnd_proc): add call to
-       mswindows_handle_gui_wm_command to handle widget callbacks.
-
-       * emacs.c (main_1): add calls to glyphs-widget initialisation
-       routines.
-
-       * console.h (struct console_methods): add
-       unmap/map_subwindow_method for use be redisplay_clear_region to
-       map and unmap subwindows. Remove xpm and xbm stuff - now dealt
-       with by image instantiator multi-methods. Add
-       resize_subwindow_method.
-
-       * console-stream.c (stream_clear_region): change signature to
-       match new generic clear region function.
-
-       * Makefile.in.in: add glyphs-widget.o to list of objects.
-
-       * console-msw.h (struct mswindows_frame): add widget hashtable for
-       wiring command ids to callbacks.
-
-1998-12-16  Andy Piper  <andy@xemacs.org>
-
-       * XEmacs 21.2.6 is released
-
-1998-12-08  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * md5.c (Fmd5): Correctly initiate string input stream.
-
-       * Makefile.in.in (tests): Add md5-tests.el.
-
-1998-12-06  Martin Buchholz  <martin@xemacs.org>
-
-       * lisp.h:
-       * alloc.c (make_vector): remove travesty
-       (Fmake_vector):
-       (make_pure_vector):
-       (pure_cons):
-       (make_bit_vector_internal):
-       (make_bit_vector):
-       (make_bit_vector_from_byte_vector):
-       (Fmake_bit_vector):
-       - make vector_equal a little faster.
-       - Don't use variable name `new'.
-       - Use size_t instead of EMACS_INT.
-       - usual Martin-style pointless bit-twiddling.
-
-       * fns.c (mapcar1):
-       (Fmapconcat):
-       (Fmapcar):
-       (Fmapvector):
-       Make mapcar faster.  In particular, make
-         (mapc #'identity long-string)
-       MUCH faster under Mule.
-       * tests/automated/lisp-tests.el: Test 'em!
-
-1998-12-06  Martin Buchholz  <martin@xemacs.org>
-
-       * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded
-       bytecode.
-
-1998-12-13  Martin Buchholz  <martin@xemacs.org>
-
-       * console-msw.c: Function definitions follow coding standards
-       - This prevents e.g. find-tag on Lisp_Event finding DEVENT
-
-1998-12-11  Martin Buchholz  <martin@xemacs.org>
-
-       * events.h (struct timeout_data):
-       * event-tty.c (tty_timeout_to_emacs_event):
-       * event-msw.c (mswindows_wm_timer_callback):
-       * event-Xt.c (Xt_timeout_to_emacs_event):
-       * event-msw.c (mswindows_cancel_dispatch_event):
-       Make sure Lisp_Objects inside events are initialized to Qnil, not
-       Qnull_pointer, which is now illegal.
-
-1998-12-10  Martin Buchholz  <martin@xemacs.org>
-
-       * lisp.h: Fix up prototypes to match alloc.c
-
-1998-12-09  Andy Piper  <andy@xemacs.org>
-
-       * glyphs-msw.c (init_image_instance_from_xbm_inline): don't use
-       XSETINT for assigning lisp objects.
-
-1998-12-07  Martin Buchholz  <martin@xemacs.org>
-
-       * opaque.h:
-       * console-msw.c (DHEADER):
-       (DOPAQUE_DATA):
-       (DEVENT):
-       (DCONS):
-       (DCONSCDR):
-       (DSTRING):
-       (DVECTOR):
-       (DSYMBOL):
-       (DSYMNAME):
-       - max_align_t should not be visible to the user of the
-         XOPAQUE_DATA macro.
-       - use Bufbyte instead of char
-       - parens around (FOOP (obj)) are always redundant.
-         If they were necessary, we should fix the macro instead.
-       - Always use string_data(foo) instead of foo->data.
-
-1998-12-07  Martin Buchholz  <martin@xemacs.org>
-
-       * sysdep.c (set_descriptor_non_blocking):
-       Since O_NONBLOCK is now always #defined, make use of fcntl
-       conditional on F_SETFL being defined.
-
-1998-12-09  Andy Piper  <andy@xemacs.org>
-
-       * menubar-msw.c (mswindows_handle_wm_command): add back in checks
-       that got removed in the merge
-
-1998-11-30  Greg Klanderman  <greg@alphatech.com>
-
-       * dired.c (vars_of_dired): bugfix for previous conditionalization
-       of user-name-completion on non- Windows NT.
-
-1998-12-08  Martin Buchholz  <martin@xemacs.org>
-
-       * windowsnt.h: Remove `support' for using index and rindex
-
-       * filelock.c (current_lock_owner):
-       - Change uses of index -> strchr, rindex -> strrchr
-
-1998-12-06  Martin Buchholz  <martin@xemacs.org>
-
-       * frame-msw.c (mswindows_init_frame_1):
-       - use make_lisp_hash_table, not Fmake_hash_table
-       - include elhash.h
-
-1998-12-05  XEmacs Build Bot <builds@cvs.xemacs.org>
-
-       * XEmacs 21.2.5 is released
-
-1998-11-30  Martin Buchholz  <martin@xemacs.org>
-
-       * xselect.c (receive_incremental_selection):
-       * xselect.c (x_get_window_property):
-       * xmu.c (XmuReadBitmapDataFromFile):
-       * xmu.c (XmuCursorNameToIndex):
-       * xgccache.c (describe_gc_cache):
-       * xgccache.c (gc_cache_lookup):
-       * xgccache.c (free_gc_cache):
-       * xgccache.c (make_gc_cache):
-       * window.h:
-       * window.c (map_windows_1):
-       * window.c (Fother_window_for_scrolling):
-       * window.c (window_scroll):
-       * window.c (change_window_height):
-       * window.c (Fsplit_window):
-       * window.c (window_left_gutter_width):
-       * window.c (window_modeline_height):
-       * window.c (invalidate_vertical_divider_cache_in_window):
-       * window.c (window_needs_vertical_divider_1):
-       * window.c (update_mirror_internal):
-       * window.c (SET_LAST_FACECHANGE):
-       * widget.c (Fwidget_plist_member):
-       * unexec.c (copy_text_and_data):
-       * unexcw.c (copy_executable_and_dump_data_section):
-       * tooltalk.doc:
-       * tooltalk.c (struct Lisp_Tooltalk_Pattern):
-       * tooltalk.c (struct Lisp_Tooltalk_Message):
-       * toolbar.h (struct toolbar_button):
-       * toolbar.c (default_toolbar_visible_p_changed_in_window):
-       * toolbar.c (recompute_overlaying_specifier):
-       * toolbar.c (toolbar_validate):
-       * toolbar.c (toolbar_button_at_pixpos):
-       * toolbar.c (get_toolbar_coords):
-       * toolbar.c (update_frame_toolbars):
-       * toolbar-x.c:
-       * toolbar-msw.c (mswindows_handle_toolbar_wm_command):
-       * toolbar-msw.c (mswindows_find_toolbar_pos):
-       * toolbar-msw.c (mswindows_output_toolbar):
-       * toolbar-msw.c (mswindows_clear_toolbar):
-       * toolbar-msw.c:
-       * systty.h:
-       * syssignal.h:
-       * sysproc.h:
-       * sysfile.h:
-       * sysdll.c:
-       * sysdep.h:
-       * sysdep.c (rmdir):
-       * sysdep.c (sys_fopen):
-       * sysdep.c (sys_open):
-       * sysdep.c (tty_init_sys_modes_on_device):
-       * sysdep.c (get_eof_char):
-       * sysdep.c (child_setup_tty):
-       * sysdep.c (set_descriptor_non_blocking):
-       * syntax.h:
-       * syntax.c (scan_words):
-       * syntax.c:
-       * symsinit.h:
-       * symeval.h (struct symbol_value_varalias):
-       * symeval.h (struct symbol_value_forward):
-       * symbols.c (syms_of_symbols):
-       * symbols.c (init_symbols_once_early):
-       * symbols.c (Fbuilt_in_variable_type):
-       * symbols.c (Fsymbol_value_in_buffer):
-       * symbols.c (default_value):
-       * symbols.c (Fset):
-       * symbols.c (find_symbol_value_quickly):
-       * symbols.c (store_symval_forwarding):
-       * symbols.c (set_default_console_slot_variable):
-       * symbols.c (set_default_buffer_slot_variable):
-       * symbols.c (verify_ok_for_buffer_local):
-       * symbols.c (symbol_is_constant):
-       * symbols.c (oblookup):
-       * symbols.c (Funintern):
-       * symbols.c (Fintern):
-       * symbols.c (check_obarray):
-       * sunplay.c:
-       * specifier.h (struct specifier_methods):
-       * specifier.h:
-       * specifier.c (specifier_instance):
-       * specifier.c (specifier_instance_from_inst_list):
-       * specifier.c (decode_locale_type):
-       * specifier.c (specifier_equal):
-       * specifier.c (finalize_specifier):
-       * specifier.c (prune_specifiers):
-       * specifier.c (kill_specifier_buffer_locals):
-       * sound.c (init_native_sound):
-       * sound.c:
-       * signal.c (alarm):
-       * search.c (Fmatch_data):
-       * search.c (match_limit):
-       * search.c (Freplace_match):
-       * search.c (skip_chars):
-       * search.c (scan_buffer):
-       * search.c:
-       * scrollbar.c (specifier_vars_of_scrollbar):
-       * scrollbar.c (Fscrollbar_set_hscroll):
-       * scrollbar.c (vertical_scrollbar_changed_in_window):
-       * scrollbar.c (release_window_mirror_scrollbars):
-       * scrollbar.c (free_scrollbar_instance):
-       * scrollbar-x.c:
-       * scrollbar-msw.c:
-       * s/msdos.h (O_BINARY):
-       * s/linux.h:
-       * s/freebsd.h (LIBS_TERMCAP):
-       * regex.c (re_match_2_internal):
-       * regex.c (compile_extended_range):
-       * regex.c (POP_FAILURE_POINT):
-       * regex.c (PUSH_FAILURE_POINT):
-       * redisplay.h (RESET_CHANGED_SET_FLAGS):
-       * redisplay.h:
-       * redisplay.h (struct display_line):
-       * redisplay.h (struct rune):
-       * redisplay.c (vars_of_redisplay):
-       * redisplay.c (redisplay_variable_changed):
-       * redisplay.c (UPDATE_CACHE_RETURN):
-       * redisplay.c (validate_line_start_cache):
-       * redisplay.c (mark_redisplay_structs):
-       * redisplay.c (mark_glyph_block_dynarr):
-       * redisplay.c (window_line_number):
-       * redisplay.c (redisplay_frame):
-       * redisplay.c (redisplay_window):
-       * redisplay.c (generate_modeline):
-       * redisplay.c (create_right_glyph_block):
-       * redisplay.c (create_left_glyph_block):
-       * redisplay.c (create_text_block):
-       * redisplay.c:
-       * redisplay-x.c (x_output_hline):
-       * redisplay-x.c (x_output_vertical_divider):
-       * redisplay-tty.c (tty_output_display_block):
-       * redisplay-output.c (output_display_line):
-       * redisplay-output.c:
-       * redisplay-msw.c (mswindows_output_vertical_divider):
-       * redisplay-msw.c (mswindows_ring_bell):
-       * redisplay-msw.c (mswindows_output_cursor):
-       * redisplay-msw.c:
-       * rangetab.c:
-       * ralloc.c:
-       * puresize.h (RAW_PURESIZE):
-       * profile.c (syms_of_profile):
-       * profile.c (Fstart_profiling):
-       * profile.c (sigprof_handler):
-       * profile.c:
-       * procimpl.h:
-       * process.c (vars_of_process):
-       * process.c (read_process_output):
-       * process.c (get_process):
-       * process.c:
-       * process-unix.c (unix_open_multicast_group):
-       * process-unix.c (unix_get_tty_name):
-       * process-unix.c (unix_send_process):
-       * process-unix.c (unix_reap_exited_processes):
-       * process-unix.c (unix_create_process):
-       * process-unix.c (unix_init_process_io_handles):
-       * process-unix.c (allocate_pty):
-       * process-unix.c:
-       * process-nt.c (nt_open_network_stream):
-       * process-nt.c (nt_update_status_if_terminated):
-       * process-nt.c (nt_finalize_process_data):
-       * process-nt.c:
-       * print.c (debug_short_backtrace):
-       * print.c (debug_backtrace):
-       * print.c (print_symbol):
-       * print.c (print_internal):
-       * print.c (print_cons):
-       * print.c (Fwrite_char):
-       * print.c (print_prepare):
-       * print.c (canonicalize_printcharfun):
-       * print.c (output_string):
-       * print.c:
-       * opaque.h:
-       * opaque.c (allocate_managed_opaque):
-       * opaque.c:
-       * offix.c (DndSetData):
-       * objects.c (face_boolean_create):
-       * objects.c (font_instantiate):
-       * objects.c (font_create):
-       * objects.c (color_create):
-       * objects.c (finalize_font_instance):
-       * objects.c (finalize_color_instance):
-       * objects.c:
-       * objects-x.c (x_font_instance_truename):
-       * objects-x.c:
-       * objects-x.c (x_initialize_font_instance):
-       * objects-x.c (allocate_nearest_color):
-       * objects-tty.c (tty_initialize_font_instance):
-       * objects-tty.c (tty_initialize_color_instance):
-       * objects-msw.c (mswindows_initialize_color_instance):
-       * ntproc.c (syms_of_ntproc):
-       * ntproc.c (Fwin32_set_process_priority):
-       * ntproc.c (sys_spawnve):
-       * ntproc.c:
-       * ntheap.c (get_data_end):
-       * nt.c (period):
-       * nt.c:
-       * nt.c (stat):
-       * nt.c (generate_inode_val):
-       * nt.c (sys_rename):
-       * nas.c:
-       * mule-wnnfns.c (Fwnn_hinsi_number):
-       * mule-wnnfns.c (Fwnn_yuragi):
-       * mule-wnnfns.c (Fwnn_common_learn):
-       * mule-wnnfns.c (Fwnn_suffix_learn):
-       * mule-wnnfns.c (Fwnn_prefix_learn):
-       * mule-wnnfns.c (Fwnn_okuri_learn):
-       * mule-wnnfns.c (Fwnn_complex_conv):
-       * mule-wnnfns.c (Fwnn_last_is_first):
-       * mule-wnnfns.c (Fwnn_bmodify_dict_add):
-       * mule-wnnfns.c (Fwnn_notrans_dict_add):
-       * mule-wnnfns.c (Fwnn_fiusr_dict_add):
-       * mule-wnnfns.c (Fwnn_fisys_dict_add):
-       * mule-wnnfns.c (Fwnn_hinsi_list):
-       * mule-wnnfns.c (Fwnn_fuzokugo_set):
-       * mule-wnnfns.c (Fwnn_dict_search):
-       * mule-wnnfns.c (Fwnn_word_toroku):
-       * mule-wnnfns.c (Fwnn_hindo_update):
-       * mule-wnnfns.c (Fwnn_bunsetu_henkou):
-       * mule-wnnfns.c (Fwnn_kakutei):
-       * mule-wnnfns.c (Fwnn_begin_henkan):
-       * mule-wnnfns.c (Fwnn_dict_comment):
-       * mule-wnnfns.c (Fwnn_dict_add):
-       * mule-wnnfns.c (Fwnn_open):
-       * mule-mcpath.c (mc_getcwd):
-       * mule-coding.c (vars_of_mule_coding):
-       * mule-coding.c (convert_to_external_format):
-       * mule-coding.c (encoding_marker):
-       * mule-coding.c (decoding_marker):
-       * mule-coding.c (Fcopy_coding_system):
-       * mule-coding.c (Fmake_coding_system):
-       * mule-coding.c (Fcoding_system_list):
-       * mule-coding.c (Ffind_coding_system):
-       * mule-coding.c (symbol_to_eol_type):
-       * mule-coding.c:
-       * mule-charset.c (complex_vars_of_mule_charset):
-       * mule-charset.c (vars_of_mule_charset):
-       * mule-charset.c (Fset_charset_ccl_program):
-       * mule-charset.c (struct charset_list_closure):
-       * mule-charset.c (Ffind_charset):
-       * mule-charset.c (make_charset):
-       * mule-charset.c (non_ascii_valid_char_p):
-       * mule-charset.c:
-       * mule-ccl.c (ccl_driver):
-       * mule-canna.c (c2mu):
-       * mule-canna.c (Fcanna_henkan_begin):
-       * mule-canna.c (Fcanna_parse):
-       * mule-canna.c (Fcanna_store_yomi):
-       * mule-canna.c (Fcanna_touroku_string):
-       * mule-canna.c (Fcanna_initialize):
-       * minibuf.c:
-       * menubar.c (menu_parse_submenu_keywords):
-       * menubar-x.c (make_dummy_xbutton_event):
-       * menubar-x.c (set_frame_menubar):
-       * menubar-x.c (menu_item_descriptor_to_widget_value_1):
-       * menubar-x.c:
-       * menubar-msw.h:
-       * menubar-msw.c (mswindows_popup_menu):
-       * menubar-msw.c (mswindows_update_frame_menubars):
-       * menubar-msw.c (mswindows_handle_wm_command):
-       * menubar-msw.c (unsafe_handle_wm_initmenu_1):
-       * menubar-msw.c (unsafe_handle_wm_initmenupopup_1):
-       * menubar-msw.c (update_frame_menubar_maybe):
-       * menubar-msw.c (populate_or_checksum_helper):
-       * menubar-msw.c (empty_menu):
-       * menubar-msw.c:
-       * md5.c:
-       * marker.c (set_marker_internal):
-       * marker.c (print_marker):
-       * malloc.c:
-       * make-src-depend:
-       * lstream.c (lisp_buffer_rewinder):
-       * lstream.c (mark_lstream):
-       * lrecord.h:
-       * lrecord.h (struct lrecord_header):
-       * lread.c (readevalloop):
-       * lread.c (locate_file):
-       * lread.c (locate_file_in_directory):
-       * lread.c (Flocate_file):
-       * lread.c (load_force_doc_string_unwind):
-       * lread.c (ebolify_bytecode_constants):
-       * lread.c:
-       * lisp.h:
-       * lisp-union.h:
-       * lisp-disunion.h:
-       * linuxplay.c (linux_play_data_or_file):
-       * linuxplay.c (audio_init):
-       * line-number.c:
-       * keymap.h:
-       * keymap.c (describe_map):
-       * keymap.c (describe_map_mapper):
-       * keymap.c (Fdescribe_bindings_internal):
-       * keymap.c (Fsingle_key_description):
-       * keymap.c (map_keymap_sorted):
-       * keymap.c (get_relevant_keymaps):
-       * keymap.c (Flookup_key):
-       * keymap.c (raw_lookup_key_mapper):
-       * keymap.c (Fdefine_key):
-       * keymap.c (Fevent_matches_key_specifier_p):
-       * keymap.c (key_desc_list_to_event):
-       * keymap.c (define_key_parser):
-       * keymap.c (define_key_check_and_coerce_keysym):
-       * keymap.c (keymap_submaps):
-       * keymap.c (keymap_store_internal):
-       * keymap.c (keymap_delete_inverse_internal):
-       * keymap.c (keymap_store_inverse_internal):
-       * keymap.c (print_keymap):
-       * keymap.c (Lisp_Keymap):
-       * keymap.c:
-       * intl.c:
-       * insdel.c (convert_bufbyte_string_into_emchar_dynarr):
-       * insdel.c (make_gap):
-       * input-method-xlib.c (get_XIM_input):
-       * input-method-xlib.c (XIM_init_frame):
-       * imgproc.c:
-       * hash.h:
-       * hash.c:
-       * gui.c:
-       * gui-x.c (button_item_to_widget_value):
-       * gui-x.c (popup_selection_callback):
-       * glyphs.h (struct image_instantiator_methods):
-       * glyphs.c (mark_glyph_cachels):
-       * glyphs.c (Fglyph_type):
-       * glyphs.c (image_instantiate):
-       * glyphs.c (image_create):
-       * glyphs.c (make_image_instance_1):
-       * glyphs.c (finalize_image_instance):
-       * glyphs.c:
-       * glyphs-x.c (finalize_subwindow):
-       * glyphs-x.c (xface_validate):
-       * glyphs-x.c (x_locate_pixmap_file):
-       * glyphs-x.c (convert_EImage_to_XImage):
-       * glyphs-msw.c:
-       * glyphs-msw.c (mswindows_resource_instantiate):
-       * glyphs-msw.c (xpm_to_eimage):
-       * glyphs-msw.c (convert_EImage_to_DIBitmap):
-       * glyphs-eimage.c (tiff_instantiate):
-       * glyphs-eimage.c (png_instantiate):
-       * glyphs-eimage.c (struct png_error_struct):
-       * glyphs-eimage.c (gif_memory_storage):
-       * glyphs-eimage.c:
-       * gifrlib.h:
-       * getloadavg.c (getloadavg):
-       * getloadavg.c:
-       * gdbinit:
-       * free-hook.c (log_gcpro):
-       * free-hook.c (check_malloc):
-       * free-hook.c (check_free):
-       * free-hook.c (ROUND_UP_TO_PAGE):
-       * free-hook.c:
-       * frame.h (struct frame):
-       * frame.h:
-       * frame.c (change_frame_size_1):
-       * frame.c (allocate_frame_core):
-       * frame.c:
-       * frame-x.c (x_focus_on_frame):
-       * frame-x.c (x_init_frame_2):
-       * frame-x.c (x_popup_frame):
-       * frame-x.c (xemacs_XtPopup):
-       * frame-x.c:
-       * frame-x.c (Foffix_start_drag_internal):
-       * frame-x.c (x_cde_destroy_callback):
-       * frame-x.c (x_wm_hack_wm_protocols):
-       * frame-tty.c (tty_frame_visible_p):
-       * frame-msw.c (mswindows_make_frame_invisible):
-       * frame-msw.c (mswindows_after_init_frame):
-       * frame-msw.c (mswindows_init_frame_1):
-       * fns.c (syms_of_fns):
-       * fns.c (Fbase64_decode_string):
-       * fns.c (Fnconc):
-       * fns.c (Ffillarray):
-       * fns.c (Fobject_plist):
-       * fns.c (Fget):
-       * fns.c (Fcanonicalize_lax_plist):
-       * fns.c (Fcanonicalize_plist):
-       * fns.c (Fplist_remprop):
-       * fns.c (Fplist_get):
-       * fns.c (advance_plist_pointers):
-       * fns.c (internal_plist_put):
-       * fns.c (Fnreverse):
-       * fns.c (Fremassq):
-       * fns.c (Felt):
-       * fns.c (Fsubstring):
-       * fns.c (Fbvconcat):
-       * fns.c (Flength):
-       * fns.c (length_with_bytecode_hack):
-       * fns.c (print_bit_vector):
-       * fns.c:
-       * floatfns.c (Ffloor):
-       * floatfns.c:
-       * floatfns.c (in_float_error):
-       * fileio.c (Ffile_modes):
-       * fileio.c (Fexpand_file_name):
-       * fileio.c (Fmake_temp_name):
-       * fileio.c (Ffile_name_nondirectory):
-       * fileio.c (Ffile_name_directory):
-       * file-coding.h:
-       * file-coding.c (vars_of_mule_coding):
-       * file-coding.c (convert_to_external_format):
-       * file-coding.c (encoding_marker):
-       * file-coding.c (decoding_marker):
-       * file-coding.c (Fcopy_coding_system):
-       * file-coding.c (Fmake_coding_system):
-       * file-coding.c (struct coding_system_list_closure):
-       * file-coding.c (Ffind_coding_system):
-       * file-coding.c (symbol_to_eol_type):
-       * file-coding.c:
-       * faces.h (struct face_cachel):
-       * faces.c (vars_of_faces):
-       * faces.c (face_property_was_changed):
-       * faces.c (mark_face_cachels):
-       * faces.c (temporary_faces_list):
-       * faces.c (struct face_list_closure):
-       * faces.c:
-       * extents.h (struct extent):
-       * extents.c (vars_of_extents):
-       * extents.c (struct copy_string_extents_1_arg):
-       * extents.c (add_string_extents_mapper):
-       * extents.c (Fextent_property):
-       * extents.c (Fset_extent_property):
-       * extents.c (symbol_to_glyph_layout):
-       * extents.c (properties_equal):
-       * extents.c (print_extent):
-       * extents.c (print_extent_1):
-       * extents.c (extent_in_region_p):
-       * extents.c (gap_array_make_gap):
-       * extents.c:
-       * events.h (struct Lisp_Event):
-       * events.h:
-       * events.c (Fevent_properties):
-       * events.c (format_event_object):
-       * events.c (Fmake_event):
-       * events.c (event_equal):
-       * events.c (print_event):
-       * events.c (mark_event):
-       * event-stream.c ((read-char)
-       * event-stream.c (vars_of_event_stream):
-       * event-stream.c (syms_of_event_stream):
-       * event-stream.c (Fset_recent_keys_ring_size):
-       * event-stream.c (Fsit_for):
-       * event-stream.c (Fnext_event):
-       * event-stream.c (execute_help_form):
-       * event-stream.c (maybe_kbd_translate):
-       * event-stream.c:
-       * event-msw.c (vars_of_event_mswindows):
-       * event-msw.c (mswindows_wnd_proc):
-       * event-msw.c (mswindows_need_event):
-       * event-msw.c (mswindows_drain_windows_queue):
-       * event-msw.c (mswindows_pump_outstanding_events):
-       * event-msw.c:
-       * event-msw.c (slurp_thread):
-       * event-msw.c (struct ntpipe_slurp_stream):
-       * event-msw.c (HANDLE_TO_USID):
-       * event-Xt.c (emacs_Xt_handle_magic_event):
-       * event-Xt.c (x_event_to_emacs_event):
-       * event-Xt.c (x_reset_modifier_mapping):
-       * event-Xt.c (x_reset_key_mapping):
-       * event-Xt.c:
-       * eval.c (syms_of_eval):
-       * eval.c (warn_when_safe):
-       * eval.c (warn_when_safe_lispobj):
-       * eval.c (Fbacktrace_frame):
-       * eval.c (Fbacktrace):
-       * eval.c (top_level_set):
-       * eval.c (unbind_to_hairy):
-       * eval.c (specbind_magic):
-       * eval.c (specbind_unwind_wasnt_local):
-       * eval.c (call2_trapping_errors):
-       * eval.c (call1_trapping_errors):
-       * eval.c (catch_them_squirmers_call2):
-       * eval.c (call0_trapping_errors):
-       * eval.c (run_hook_trapping_errors):
-       * eval.c (catch_them_squirmers_eval_in_buffer):
-       * eval.c (call4_in_buffer):
-       * eval.c (call3_in_buffer):
-       * eval.c (call2_in_buffer):
-       * eval.c (call1_in_buffer):
-       * eval.c (call0_in_buffer):
-       * eval.c (run_hook):
-       * eval.c (run_hook_with_args_in_buffer):
-       * eval.c (Fapply):
-       * eval.c (Feval):
-       * eval.c (do_autoload):
-       * eval.c (un_autoload):
-       * eval.c (Fautoload):
-       * eval.c (Finteractive_p):
-       * eval.c (Fcommand_execute):
-       * eval.c (signal_quit):
-       * eval.c (call_with_suspended_errors):
-       * eval.c (signal_error):
-       * eval.c (return_from_signal):
-       * eval.c (Fcall_with_condition_handler):
-       * eval.c (run_condition_case_handlers):
-       * eval.c (condition_case_1):
-       * eval.c (Funwind_protect):
-       * eval.c (unwind_to_catch):
-       * eval.c (internal_catch):
-       * eval.c (Fmacroexpand_internal):
-       * eval.c (Fuser_variable_p):
-       * eval.c (Fdefconst):
-       * eval.c (Fdefvar):
-       * eval.c (Ffunction):
-       * eval.c (signal_call_debugger):
-       * eval.c (call_debugger):
-       * eval.c:
-       * emacs.c (main):
-       * emacs.c (sort_args):
-       * emacs.c (main_1):
-       * elhash.h:
-       * elhash.c:
-       * editfns.c (Fencode_time):
-       * editfns.c (Fdecode_time):
-       * editfns.c (Fuser_full_name):
-       * editfns.c:
-       * editfns.c (save_excursion_restore):
-       * ecrt0.c:
-       * dynarr.c:
-       * doprnt.c (emacs_doprnt_1):
-       * doc.c (verify_doc_mapper):
-       * doc.c (Fsnarf_documentation):
-       * doc.c (Fdocumentation):
-       * dll.c:
-       * dired.c (user_name_completion):
-       * dired.c (Fdirectory_files):
-       * dialog-x.c:
-       * dialog-msw.c:
-       * dgif_lib.c (FreeSavedImages):
-       * dgif_lib.c (DGifGetImageDesc):
-       * device.h:
-       * device.h (struct device):
-       * device.c (Fselect_device):
-       * device.c (allocate_device):
-       * device.c:
-       * device-x.c (Fx_keysym_on_keyboard_p):
-       * device-x.c (Fx_valid_keysym_name_p):
-       * device-x.c (x_IO_error_handler):
-       * device-x.c (x_delete_device):
-       * device-x.c (x_finish_init_device):
-       * device-x.c (x_init_device):
-       * device-x.c:
-       * device-msw.c (mswindows_init_device):
-       * dbxrc:
-       * database.c (vars_of_database):
-       * database.c (Fput_database):
-       * database.c (Fopen_database):
-       * database.c (berkdb_remove):
-       * database.c (berkdb_put):
-       * database.c (Fdatabasep):
-       * database.c (print_database):
-       * database.c:
-       * data.c (vars_of_data):
-       * data.c (syms_of_data):
-       * data.c (init_errors_once_early):
-       * data.c (prune_weak_lists):
-       * data.c (finish_marking_weak_lists):
-       * data.c (print_weak_list):
-       * data.c (Fmod):
-       * data.c (Fstring_to_number):
-       * data.c (Fnumber_to_string):
-       * data.c (Findirect_function):
-       * data.c (Fsetcdr):
-       * data.c (Ffloatp):
-       * data.c (Fsubr_interactive):
-       * data.c (Farrayp):
-       * data.c (Fkeywordp):
-       * data.c (Fnull):
-       * data.c:
-       * console.h (CONSOLE_NAME):
-       * console.h:
-       * console.c (vars_of_console):
-       * console.c (Fselect_console):
-       * console.c:
-       * console-x.h (DEVICE_X_COLORMAP):
-       * console-x.h (struct x_device):
-       * console-x.c (x_device_to_console_connection):
-       * console-tty.h (CONSOLE_TTY_FINAL_CURSOR_Y):
-       * console-tty.c (tty_init_console):
-       * console-tty.c:
-       * console-msw.h (struct mswindows_frame):
-       * conslots.h:
-       * config.h.in:
-       * cmds.c (internal_self_insert):
-       * cmds.c (Fforward_line):
-       * cmds.c (Fforward_char):
-       * cmds.c:
-       * cmdloop.c:
-       * chartab.c (mark_char_table_entry):
-       * chartab.c:
-       * casefiddle.c (casify_word):
-       * callproc.c (child_setup):
-       * callproc.c (Fcall_process_internal):
-       * callproc.c:
-       * callint.c (Fcall_interactively):
-       * bytecode.h:
-       * bytecode.c (execute_rare_opcode):
-       * bytecode.c (execute_optimized_program):
-       * bytecode.c:
-       * bufslots.h:
-       * buffer.h (BUFFER_REALLOC):
-       * buffer.h (GET_CHARPTR_INT_DATA_ALLOCA):
-       * buffer.h (GET_CHARPTR_EXT_DATA_ALLOCA):
-       * buffer.h:
-       * buffer.h (MAP_INDIRECT_BUFFERS):
-       * buffer.h (CHECK_LIVE_BUFFER):
-       * buffer.c (init_initial_directory):
-       * buffer.c (complex_vars_of_buffer):
-       * buffer.c (vars_of_buffer):
-       * buffer.c (finish_init_buffer):
-       * buffer.c (Fget_file_buffer):
-       * buffer.c (Fbuffer_list):
-       * buffer.c (mark_buffer):
-       * balloon_help.c (balloon_help_move_to_pointer):
-       * balloon_help.c (show_help):
-       * balloon_help.c:
-       * backtrace.h:
-       * alloc.c (garbage_collect_1):
-       * alloc.c (sweep_strings):
-       * alloc.c (sweep_compiled_functions):
-       * alloc.c (sweep_bit_vectors_1):
-       * alloc.c (sweep_vectors_1):
-       * alloc.c (sweep_lcrecords_1):
-       * alloc.c (tick_lcrecord_stats):
-       * alloc.c (pure_string_sizeof):
-       * alloc.c (mark_conses_in_list):
-       * alloc.c (mark_object):
-       * alloc.c (report_pure_usage):
-       * alloc.c (make_pure_float):
-       * alloc.c (make_pure_string):
-       * alloc.c (free_managed_lcrecord):
-       * alloc.c (mark_string):
-       * alloc.c (noseeum_make_marker):
-       * alloc.c (allocate_event):
-       * alloc.c (Fbit_vector):
-       * alloc.c (Fvector):
-       * alloc.c (make_float):
-       * alloc.c (Fmake_list):
-       * alloc.c (Flist):
-       * alloc.c (FREE_FIXED_TYPE_WHEN_NOT_IN_GC):
-       * alloc.c (PUT_FIXED_TYPE_ON_FREE_LIST):
-       * alloc.c (DECLARE_FIXED_TYPE_ALLOC):
-       * alloc.c (dbg_constants):
-       * alloc.c (gc_record_type_p):
-       * alloc.c (free_lcrecord):
-       * alloc.c (xmalloc):
-       * alloc.c (NOSEEUM_INCREMENT_CONS_COUNTER):
-       * abbrev.c:
-       * Makefile.in.in (mostlyclean):
-       * Makefile.in.in (external_client_xlib_objs_nonshared):
-       * Makefile.in.in (temacs_link_args):
-       * Makefile.in.in (release):
-       * Makefile.in.in (dnd_objs):
-       * Makefile.in.in (objs):
-       * Makefile.in.in (PROGNAME):
-       * EmacsShell.c: cast strings to (XtPointer)
-       * EmacsFrame.c: cast strings to (XtPointer)
-       - mega patch
-       - rewrite basic lisp functions for speed
-       - rewrite bytecode interpreter for speed
-       - rewrite list looping constructs for speed and safety using
-         tortoise/hare.
-       - use size_t where appropriate.
-       - new hashtable implementation
-       - cleanup implementation of opaques
-       - opaques can now be purecopy'ed
-       - move some cl functionality into C for speed.
-       - remove last remaining VMS support
-       - spelling fixes
-       - improve gdb/dbx debugger support
-       - move pure.c back into alloc.c for performance
-       - enable report_pure_usage() if --memory-usage-stats
-       - remove remnants of Energize support (EMACS_BTL, cadillac...)
-       - don't use symbols with leading `_' or embedded `__'
-       - globally cleanup duplicated semicolons `;;'
-       - I give in on %p vs %lx - we use printf("%lx",(long) p)
-         globally.
-       - globally replace O_NDELAY with O_NONBLOCK.
-       - globally replace CDISABLE with _POSIX_VDISABLE.
-       - use O_RDONLY and O_RDWR instead of magic `0' and `2'.
-       - define (and maybe use!) STDERR_FILENO and friends.
-       - add support for macros defined in C
-       - `when', `unless', `not' and `defalias' now defined in C,
-         so that they are universally available.
-       - rename defvar_mumble to defvar_magic
-       - rename RETURN__ to RETURN_SANS_WARNINGS
-       - use consistent style of initial caps in error messages
-       - implement last, butlast, nbutlast, copy-list in C.
-       - provide typedefs for all struct Lisp_foo types
-       - Lisp_Objects must be initialized to Qnil rather than 0.
-       - make sure XEmacs runs (slowly) with always_gc == 1;
-       - fast and safe LOOP_* macros
-       - change calls to XSETOBJ to XSETFOO
-       - replace calls to XSETINT by make_int()
-       - plug up memory leaks
-       - use style markobj (foo), not silly ((markobj) (foo))
-       - use XFLOAT_DATA (obj) instead of float_data (XFLOAT (obj))
-
-1998-12-02  P. E. Jareth Hein  <jareth@camelot.co.jp>
-
-       * unexec.c: Changed a #ifndef statement to fix XEmacs on BSDI 3.0
-
-1998-11-28  SL Baur  <steve@altair.xemacs.org>
-
-       * XEmacs 21.2-beta4 is released.
-
-1998-11-27  SL Baur  <steve@altair.xemacs.org>
-
-       * mule-charset.c (complex_vars_of_mule_charset): Fix graphic
-       property in control-1 charset.
-       From Julian Bradfield <jcb@daimi.au.dk>
-
-1998-11-26  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * gui-x.c (button_item_to_widget_value): Ignore :key-sequence
-       keyword.
-       Add stub for :label.
-
-       * gui.c (gui_item_add_keyval_pair): ditto.
-
-       * menubar-x.c (menu_item_descriptor_to_widget_value_1): Ignore
-       :key-sequence keyword.
-       Add stub for:label.
-       Support :active for submenus like the Windows code and FSF Emacs.
-
-1998-11-27  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * dired.c (make_directory_hash_table): make_string() is OK because
-       readdir() Mule-encapsulates.
-
-1998-11-26  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * fns.c (Fbase64_encode_string): Fix docstring.
-       (Fbase64_decode_string): Ditto.
-
-1998-11-26  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * editfns.c (Ftranslate_region): Use
-       convert_bufbyte_string_into_emchar_string().
-
-1998-11-25  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * editfns.c (Ftranslate_region): Accept vectors and char-tables as
-       well as strings.
-       (Ftranslate_region): Turn table into an array of Emchars for
-       larger regions.
-
-1998-11-25  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * chartab.c (Freset_char_table): Fix wrong placement of #endif.
-
-1998-11-24  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * chartab.c (Freset_char_table): Don't blindly fill chartables of
-       type `char' with nils.
-
-       * chartab.c (canonicalize_char_table_value): Coerce ints to chars
-       for tables of type `char'.
-
-1998-11-26  Didier Verna  <verna@inf.enst.fr>
-
-       * input-method-xlib.c (Initialize_Locale): don't call
-       XtSetLanguageProc. We've done the whole work here.
-       * input-method-xfs.c (Initialize_Locale): ditto.
-       * input-method-motif.c (Initialize_Locale): ditto.
-
-1998-11-26  Didier Verna  <verna@inf.enst.fr>
-
-       * process-unix.c (unix_create_process): handle properly
-       Vfile_name_coding_system for converting the program and directory
-       names.
-
-1998-11-27  SL Baur  <steve@altair.xemacs.org>
-
-       * m/arm.h: New file.
-       From James LewisMoss <dres@ioa.com>
-
-1998-11-27  Takeshi Hagiwara  <hagiwara@ie.niigata-u.ac.jp>
-
-       * m/mips-nec.h:
-       Fix the realpath() problem of UnixWare2.1.3.
-       Patches for NEC's sysv4.2 machine.
-
-1998-11-25  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * dired.c (Fdirectory_files): Remove redundant code.
-
-1998-11-25  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * fns.c (free_malloced_ptr): New function.
-       (XMALLOC_OR_ALLOCA): New macro.
-       (XMALLOC_UNBIND): Ditto.
-       (Fbase64_encode_region): Use malloc() for large blocks; arrange it
-       to be freed in case of non-local exit.
-       (Fbase64_encode_string): Ditto.
-       (Fbase64_decode_region): Ditto.
-       (Fbase64_decode_string): Ditto.
-       (STORE_BYTE): New macro.
-       (base64_decode_1): Use it.
-
-1998-11-25  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * fns.c (base64_value_to_char): Base64 stuff.
-
-1998-11-24  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * editfns.c (Fbuffer_substring): New function.
-
-       * lisp.h: Declare make_string_from_buffer_no_extents().
-
-       * insdel.c (make_string_from_buffer_1): New function.
-       (make_string_from_buffer_no_extents): Ditto.
-
-1998-11-15  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-       * linuxplay.c: Including <fcntl.h> instead of <sys/fcntl.h> makes
-       sound work on AIX with OSS installed.  Linux should still work.
-
-1998-11-03  Andy Piper  <andyp@parallax.co.uk>
-
-       * config.h.in: name change for cygwin/version.h
-
-       * configure.in: check for cygwin/version.h now.
-
-       * cygwin32.h: track CYGWIN_DLL_VERSION_MAJOR ->
-       CYGWIN_VERSION_DLL_MAJOR name change in cygwin b20.
-       move cygwin32/version.h to cygwin/version.h
-
-1998-11-03  Olivier Galibert  <galibert@pobox.com>
-
-       * lisp.h  (struct  Lisp_Bit_Vector): Fix declaration of  bits from
-       int to long.
-
-1998-10-22  Andy Piper  <andyp@parallax.co.uk>
-
-       * cygwin32.h: track CYGWIN_DLL_VERSION_MAJOR ->
-       CYGWIN_VERSION_DLL_MAJOR name change in cygwin b20.
-       enable BROKEN_SIGIO under b20 to make QUIT work.
-
-1998-10-22  Andy Piper  <andyp@parallax.co.uk>
-
-       * frame-msw.c (mswindows_size_frame_internal): force frame sizing
-       to fit within the constraints of the screen size. I.e. make the
-       frame small enough to fit and move it if some of it will be
-       off-screen.
-
-1998-10-19  Greg Klanderman  <greg@alphatech.com>
-
-       * dired.c: conditionalize inclusion of user-name-completion
-       primitives on non-Windows NT.  The needed functions don't exist on NT.
-
-1998-11-24  SL Baur  <steve@altair.xemacs.org>
-
-       * gifrlib.h: Clean up types for 64 bit compile.
-       * dgif_lib.c (DGifInitRead): Ditto.
-       (MakeSavedImage): Ditto.
-       * emacs.c (decode_path): Ditto.
-       From Steve Carney <carney@pa.dec.com>
-
-1998-10-16  William M. Perry  <wmperry@aventail.com>
-
-       * glyphs-msw.c (bitmap_table): Fixed typo in builtin bitmaps
-         (cehckboxes instead of checkboxes).
-
-1998-10-15  SL Baur  <steve@altair.xemacs.org>
-
-       * XEmacs 21.2-beta3 is released.
-
-1998-10-13  Raymond Toy  <toy@rtp.ericsson.se>
-
-       * runemacs.c (WinMain): If the basename is "rungnuclient.exe", run
-       gnuclient.  Otherwise, we run xemacs as we always did.  This gets
-       rid of the annoying DOS window when running gnuclient.
-
-1998-10-13  Andy Piper  <andyp@parallax.co.uk>
-
-       * dragdrop.c (vars_of_dragdrop): rename HAVE_MSWINDOWS ->
-       HAVE_MS_WINDOWS typo.
-
-1998-10-13  SL Baur  <steve@altair.xemacs.org>
-
-       * process-unix.c (unix_send_process): Set closed flag on writable
-       pipe after SIGPIPE is received and before we call deactivate_process.
-
-1998-10-03  Gunnar Evermann  <ge204@eng.cam.ac.uk>
-
-       * window.c (Fset_window_start): respect narrowing when
-       checking wheter start is at the beginning of a line.
-       (Fset_window_buffer): Ditto
-       Fixes repeatable crash in VM.
-
-1998-10-09  SL Baur  <steve@altair.xemacs.org>
-
-       * window.c (specifier_vars_of_window): Set default vertical
-       divider width to 1 on ttys.
-
-1998-10-08  Martin Buchholz  <martin@xemacs.org>
-
-       * alloc.c:
-       * unexec.c:
-       * malloc.c:
-       Add <stddef.h> to get ptrdiff_t declaration
-
-1998-10-07  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * scrollbar-msw.c: Use the same vertical scrollbar drag hack as
-         is used for Motif or Lucid scrollbars under X.
-
-1998-10-08  Pierre Wendling  <pw@ebc.vbe.dec.com>
-
-       * m/alpha.h (UNEXEC): quoted to avoid bad expansion when running
-       `configure'
-
-1998-10-06  Takeshi Hagiwara  <hagiwara@ie.niigata-u.ac.jp>
-
-       * frame-x.c (x_delete_frame): Fix an argument of XtDestroyWidget.
-
-1998-10-05  Andy Piper  <andyp@parallax.co.uk>
-
-       * s/cygwin32.h: more cygwin b20 reorganisation.
-
-1998-10-03  Gunnar Evermann  <ge204@eng.cam.ac.uk>
-
-       * window.c (Fset_window_start): Document me.
-       (Fset_window_buffer): Document me.
-       Fixes some sort of repeatable crash.
-
-1998-10-01  Raymond Toy  <toy@rtp.ericsson.se>
-
-       * nas.c: Added necessary support functions to be able to handle
-       WAVE files in memory, just like the support for SND files in
-       memory.
-
-1998-09-30  SL Baur  <steve@altair.xemacs.org>
-
-       * callproc.c (child_setup): Fix spelling typo.
-
-1998-09-29  SL Baur  <steve@altair.xemacs.org>
-
-       * XEmacs 21.2-beta2 is released.
-
-1998-09-27  P. E. Jareth Hein  <jareth@camelot.co.jp>
-
-       * regex.c (re_match_2_internal): Add in code to reset lowest_active_reg
-       to prevent memory corruption in the case of jumping out of a series of
-       nested match patterns. This is a rather brute force approach, though.
-
-1998-09-02  Andy Piper  <andyp@parallax.co.uk>
-
-       * config.h.in: ditto.
-
-       * s/cygwin32.h: rearrange declarations to cope with cygwin
-       b20. Include cygwin32/version.h if it exists.
-
-1998-09-20  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * device-msw.c (mswindows_init_device): Call new
-         mswindows_enumerate_fonts() function in objects-msw.c instead
-         of font_enum_callback_1() to enumerate fonts.
-
-         font_enum_callback_1() and _2() moved to objects-msw.c.
-
-       * faces.c (complex_vars_of_faces): Make the mswindows default
-         face font fully specified and provide some fallbacks.
-
-       * objects-msw.c: font_enum_callback_1() and _2() moved here
-         from objects-msw.c. Obtain the enumerated font's character
-         sets by table lookup instead of using the locale-specific
-         string provided by Windows.
-
-         New public non-method mswindows_enumerate_fonts() that fills
-         in the supplied mswindows device's font list.
-
-         mswindows_initialize_font_instance: Use the supplied name
-         variable instead of f->name when signalling errors. Match font
-         weights and character sets using lookup tables which handle
-         spaces instead of by frobbing.
-
-1998-09-20  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * process-nt.c: Define an arbitrary limit, FRAGMENT_CODE_SIZE,
-         on the size of code fragments passed to run_in_other_process.
-
-         run_in_other_process(): Use FRAGMENT_CODE_SIZE to determine
-         the amount of memory to allocate in the other process.
-
-         Removed sigkill_code_end(), sigint_code_end() and
-         sig_enable_code_end() since they are now redundant.
-
-         send_signal() and enable_child_signals(): Don't try to work
-         out the end of the code fragments passed to
-         run_in_other_process()
-
-1998-09-10  Kazuyuki IENAGA  <ienaga@jsys.co.jp>
-
-       * src/s/freebsd.h: Added __ELF__ and compiler/liker flags for
-       FreeBSD-current.
-
-       * src/unexelf.c: Partially synched with FSF's 20.3.
-
-1998-09-10  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * insdel.c (signal_after_change): Map across indirect buffers
-       here, and not in the upper-level functions.
-       (signal_first_change): Don't check for Armageddon.
-       (signal_before_change): Map across indirect buffers here.
-       (prepare_to_modify_buffer): ...and here.
-
-1998-09-09  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * insdel.c (signal_after_change): Add return value.
-       (buffer_insert_string_1): Use it.
-       (buffer_delete_range): Ditto.
-       (buffer_replace_char): Ditto.
-       (cancel_multiple_change): Map the indirect buffers.
-
-1998-09-06  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * insdel.c (init_buffer_text): Remove INDIRECT_P parameter.
-       (uninit_buffer_text): Ditto.
-
-       * buffer.c (Fmake_indirect_buffer): Implement stricter
-       error-checking.
-
-1998-09-04  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * insdel.c (change_function_restore): Reverse order of
-       function-call and assignment.
-       (first_change_hook_restore): Ditto.
-
-       * extents.c (mark_extent_auxiliary): Mark them.
-       (Fset_extent_property): Set them.
-       (Fextent_property): Get them.
-       (Fextent_properties): Ditto.
-       (vars_of_extents): Set their default.
-
-       * extents.h (struct extent_auxiliary): Add before_change_functions
-       and after_change_functions.
-
-       * insdel.c (signal_before_change): Use it.
-       (signal_after_change): Ditto.
-
-       * extents.c (report_extent_modification): New function.
-
-       * insdel.c (signal_before_change): Don't check for Armageddon.
-       (signal_after_change): Ditto.
-
-1998-09-11  Gunnar Evermann  <Gunnar.Evermann@nats.informatik.uni-hamburg.de>
-
-       * redisplay.c (redisplay_window): make sure a new starting point
-       is chosen if it somehow got moved from the beginning of the line
-       -- this can happen because Fwiden was called recently.
-
-       * window.c (Fset_window_start): set start_at_line_beg correctly
-       (Fset_window_buffer): Ditto
-
-1998-09-06  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * insdel.c (init_buffer_text): Remove INDIRECT_P parameter.
-       (uninit_buffer_text): Ditto.
-
-       * buffer.c (Fmake_indirect_buffer): Implement stricter
-       error-checking.
-
-1998-05-14  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * emacs.c (main_1): Removed references to *vars_of_filelock.
-
-       * lisp.h: Added Fsystem_name.
-
-       * filelock.c: Replaced by version from FSF 20.2. Now implements
-       locking by using symlinks which is NFS safe. However keep the
-       GCPRO's in lock_file and the calls to callx_in_buffer like our old
-       version (and of course use ansi C, acessor macros, etc).
-
-1998-09-06  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * process-unix.c (unix_create_process): Reset SIGHUP handler to
-       SIG_DFL. We now try to conserve any inherted SIG_IGN settings
-       in init_signals_very_early. However these should not be passed
-       on to children attached to the new pty.
-
-1998-08-28  Andy Piper  <andyp@parallax.co.uk>
-
-       * glyphs-eimage.c (png_instantiate_unwind): clean up eimage after use.
-
-1998-09-07  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * fileio.c (file-name-directory, file_name_as_directory):
-         Don't call CORRECT_DIR_SEPS, even when #defined WINDOWSNT.
-
-1998-09-02  Andy Piper  <andyp@parallax.co.uk>
-
-       * emacs.c (main_1): init_ralloc() if initialised and we have REL_ALLOC
-
-       * ralloc.c: uncomment __morecore.
-
-1998-09-92  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * event-msw.c(winsock_writer): Supply a dummy 4th argument to
-         WriteFile() to fix a winsock 1.x bug on Win95.
-
-1998-08-28  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * event-Xt.c (emacs_Xt_mapping_action): Check for device being
-       deleted.
-       (x_event_to_emacs_event): Ditto.
-       (emacs_Xt_handle_focus_event): Ditto.
-       (emacs_Xt_handle_magic_event): Ditto.
-
-       * console-x.h (struct x_device): New flag being_deleted.
-       (DEVICE_X_BEING_DELETED): New macro.
-
-       * device-x.c (x_IO_error_handler): Throw to top-level instead of
-       returning.  Before doing that, set the being_deleted flag on the
-       device.
-
-1998-08-27  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * device-x.c (x-seppuku-on-epipe): Removed.
-
-1998-08-26  Gunnar Evermann  <Gunnar.Evermann@nats.informatik.uni-hamburg.de>
-
-       * frame-x.c (x_delete_frame): Flush the X output buffer after
-       calling XtDestroyWidget to ensure that the windows are really
-       killed right now.
-
-1998-08-26  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * menubar-x.c (my_run_hook): New unused function.
-       (pre_activate_callback): Use run_hook for Qactivate_menubar_hook,
-       since we ignore the results of the contained functions anyway.
-
-1998-08-26  P. E. Jareth Hein  <jareth@camelot.co.jp>
-
-       * glyphs-eimage.c (gif_instantiate): Fix a crash in handling
-       interlaced GIF files that are smaller than 4 lines high...
-
-1998-08-31  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * buffer.c (map_over_sharing_buffers): Deleted.
-
-       * insdel.c (MAP_INDIRECT_BUFFERS): Move to buffer.h.
-
-       * buffer.c (Fkill_buffer): Keep indirect_children updated while
-       killing them.
-
-1998-08-31  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * insdel.c (buffer_insert_string_1): Advance the point bytind in
-       all the buffers.
-       (buffer_delete_range): Ditto.
-
-       * marker.c (init_buffer_markers): Set point-marker to the value of
-       point in an indirect buffer.
-
-1998-08-30  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * undo.c (undo_prelude): Test last-undo-buffer against base
-       buffer.
-
-       * insdel.c (MAP_INDIRECT_BUFFERS): Use it.
-
-       * buffer.h (BUFFER_BASE_BUFFER): New macro.
-
-1998-08-30  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * insdel.c (init_buffer_text): Initialize it here.
-
-       * line-number.c: Address line_number_cache through buffer->text.
-
-       * buffer.c (mark_buffer): Mark line number cache.
-
-       * bufslots.h (line_number_cache): Move to struct buffer_text.
-
-       * insdel.c (buffer_insert_string_1): Propagate signals and changes
-       across the children buffers.
-       (buffer_delete_range): Ditto.
-       (buffer_replace_char): Ditto.
-       (gap_left): Ditto.
-       (gap_right): Ditto.
-
-       * insdel.c (MAP_INDIRECT_BUFFERS): New macro.
-
-       * buffer.c (Fmake_indirect_buffer): Uncomment.
-
-1998-08-31  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * macros.c (Fend_kbd_macro): Remove trailing period from error
-       message.
-       (Fexecute_kbd_macro): Ditto.
-
-1998-08-21  Greg Klanderman  <greg@alphatech.com>
-
-       * dired.c (Fuser_name_completion): remove optional 2nd argument.
-       (Fuser_name_completion_1): new function to return uniqueness
-       indication in addition to the user name completion.
-       (user_name_completion): change type of `uniq' argument.
-
-1998-08-19  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
-
-       * lread.c (vars_of_lread): Removed `source-directory' variable.
-
-1998-08-22  Hrvoje Niksic  <hniksic@srce.hr>
-
-       * fileio.c (Ffile_readable_p): Apply the DOS/Windows logic to
-       Cygwin.
-
-1998-08-19  SL Baur  <steve@altair.xemacs.org>
-
-       * dired.c (vars_of_dired): Fix misapplied patch.
-
-1998-08-16  Martin Buchholz  <martin@xemacs.org>
-
-       * fns.c (Fremrassq, remrassq_no_quit):
-       A XCAR that should have been an XCDR turned Fremrassq into Fremassq
-
-1998-07-17  Didier Verna  <verna@inf.enst.fr>
-
-       * redisplay-x.c (x_get_gc): returns a GC with a FillStipple fill
-       style as foreground GC for faces that have the `dim' property.
-       (x_output_string): when the `dim' face property is set,
-       ensure the gray pixmap has been created, and get a proper
-       foreground GC to draw the text.
-
-1998-08-09  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * event-msw.c (mswindows_wnd_proc): Workaround for a Win95 bug:
-         Manually track the state of the left and right Ctrl and Alt
-         modifiers.
-
-1998-08-07 Matt Stupple <matts@tibco.com>
-
-        * ntproc.c: don't wait on char_consumed at thread entry.
-       Additionally, to get the 'process' marked as finished, ensure
-       that the CHILD_ACTIVE macro returns false, so before exiting
-       close char_avail and set it to NULL, and close other handles
-       to reduce handle leak problems.
-
-1998-08-09  Jonathan Harris  <jhar@tardis.ed.ac.uk>
-
-       * menubar-msw.c (displayable_menu_item): take account of menu
-         depth when deciding whether to try to display accelerators.
-
-1998-08-04  Andy Piper  <andyp@parallax.co.uk>
-
-       * event-msw.c: use MsgWaitForMultipleObjects if there are no
-       subprocesses.
-
-       * glyphs-msw.c: fix a couple of potential handle leaks.
-
-1998-08-04  P. E. Jareth Hein  <jareth@camelot.co.jp>
-
-       * dgif_lib.c gif_io.c gifrlib.h: New files to put GIF
-         *decoding ONLY* back into the core.
-       * glyphs-eimage.c: Change referenced header file for GIF
-         reading to point to the incore version.
-
-1998-07-20  Martin Buchholz  <martin@xemacs.org>
-
-       * casefiddle.c (casify_object):
-       Change algorithm from O(N**2) to O(N).
-       Code cleanup.
-       Doc string cleanup.
-
-1998-07-22  Greg Klanderman  <greg@alphatech.com>
-
-       * dired.c (file_name_completion_unwind): don't leak the cons.
-
-1998-07-20  Greg Klanderman  <greg@alphatech.com>
-
-       * dired.c (Fuser_name_completion): new function.
-       (Fuser_name_all_completions): new function.
-       (user_name_completion): new function.
-       (syms_of_dired): 2 new DEFSUBRs.
-       (vars_of_dired): initialize user name cache vars.
-
-1998-07-29  P. E. Jareth Hein  <jareth@camelot.co.jp>
-
-       * glyphs-eimage.c (png_instantiate): Add proper handling for background
-       colors taken from the default face.  Also correct a thinko in
-       transparency (not alpha) handling.
-
-1998-07-23  Martin Buchholz  <martin@xemacs.org>
-
-       * s/decosf4-0.h:  Use a perfectly ordinary link.  Nuke BSD crap.
-       * unexalpha.c: ANSI C-ize.  Clean compiler warnings.
-       * lread.c (Fload_internal):  Be very careful with printfs of
-       size_t's
-       * gui-x.c (menu_name_to_accelerator): tolower wants an `int'
-       argument.
-
-1998-07-27  Gunnar Evermann  <Gunnar.Evermann@nats.informatik.uni-hamburg.de>
-
-       * callint.c (Fcall_interactively): GCPRO prompt string before
-       passing it to Fread_key_sequence
-
-1998-07-27  SL Baur  <steve@altair.xemacs.org>
-
-       * keymap.c (vars_of_keymap): Initialize Vkey_translation_map and
-       Vvertical_divider_map.
-
-       * mule-canna.c (vars_of_mule_canna): Initialize every symbol to
-       Qnil or 0, none were initialized prior to this change.
-
-       Rename misnamed `V' prefixed integer variables:
-       Vcanna_empty_info, Vcanna_through_info, Vcanna_underline,
-       Vcanna_inhibit_hankakukana, Vcanna_henkan_length, Vcanna_henkan_revPos,
-       Vcanna_henkan_revLen, Vcanna_ichiran_length, Vcanna_ichiran_revPos,
-       Vcanna_ichiran_revLen.
-
-       Rename misnamed `V' prefixed integer variables and initialize
-       properly in the vars_of routine.
-       Vcanna_mode_AlphaMode, Vcanna_mode_EmptyMode, Vcanna_mode_KigoMode,
-       Vcanna_mode_YomiMode, Vcanna_mode_JishuMode, Vcanna_mode_TankouhoMode,
-       Vcanna_mode_IchiranMode, Vcanna_mode_YesNoMode, Vcanna_mode_OnOffMode,
-       Vcanna_mode_AdjustBunsetsuMode, Vcanna_mode_ChikujiYomiMode,
-       Vcanna_mode_ChikujiTanMode, Vcanna_mode_HenkanMode,
-       Vcanna_mode_HenkanNyuryokuMode, Vcanna_mode_ZenHiraHenkanMode,
-       Vcanna_mode_HanHiraHenkanMode, Vcanna_mode_ZenKataHenkanMode,
-       Vcanna_mode_HanKataHenkanMode, Vcanna_mode_HanKataHenkanMode,
-       Vcanna_mode_ZenAlphaHenkanMode, Vcanna_mode_HanAlphaHenkanMode,
-       Vcanna_mode_ZenHiraKakuteiMode, Vcanna_mode_HanHiraKakuteiMode,
-       Vcanna_mode_ZenKataKakuteiMode, Vcanna_mode_HanKataKakuteiMode,
-       Vcanna_mode_ZenAlphaKakuteiMode, Vcanna_mode_HanAlphaKakuteiMode,
-       Vcanna_mode_HexMode, Vcanna_mode_BushuMode, Vcanna_mode_ExtendMode,
-       Vcanna_mode_RussianMode, Vcanna_mode_GreekMode, Vcanna_mode_LineMode,
-       Vcanna_mode_ChangingServerMode, Vcanna_mode_HenkanMethodMode,
-       Vcanna_mode_DeleteDicMode, Vcanna_mode_TourokuMode,
-       Vcanna_mode_TourokuEmptyMode, Vcanna_mode_TourokuHinshiMode,
-       Vcanna_mode_TourokuDicMode, Vcanna_mode_QuotedInsertMode,
-       Vcanna_mode_BubunMuhenkanMode, Vcanna_mode_MountDicMode,
-       Vcanna_fn_SelfInsert, Vcanna_fn_FunctionalInsert,
-       Vcanna_fn_QuotedInsert, Vcanna_fn_JapaneseMode, Vcanna_fn_AlphaMode,
-       Vcanna_fn_HenkanNyuryokuMode, Vcanna_fn_Forward, Vcanna_fn_Backward,
-       Vcanna_fn_Next, Vcanna_fn_Prev, Vcanna_fn_BeginningOfLine,
-       Vcanna_fn_EndOfLine, Vcanna_fn_DeleteNext, Vcanna_fn_DeletePrevious,
-       Vcanna_fn_KillToEndOfLine, Vcanna_fn_Henkan, Vcanna_fn_Kakutei,
-       Vcanna_fn_Extend, Vcanna_fn_Shrink, Vcanna_fn_AdjustBunsetsu,
-       Vcanna_fn_Quit, Vcanna_fn_ConvertAsHex, Vcanna_fn_ConvertAsBushu,
-       Vcanna_fn_KouhoIchiran, Vcanna_fn_BubunMuhenkan, Vcanna_fn_Zenkaku,
-       Vcanna_fn_Hankaku, Vcanna_fn_ExtendMode, Vcanna_fn_ToUpper,
-       Vcanna_fn_Capitalize, Vcanna_fn_ToLower, Vcanna_fn_Hiragana,
-       Vcanna_fn_Katakana, Vcanna_fn_Romaji, Vcanna_fn_BaseHiragana,
-       Vcanna_fn_BaseKatakana, Vcanna_fn_BaseEisu, Vcanna_fn_BaseZenkaku,
-       Vcanna_fn_BaseHankaku, Vcanna_fn_BaseKana, Vcanna_fn_BaseKakutei,
-       Vcanna_fn_BaseHenkan, Vcanna_fn_BaseHiraKataToggle,
-       Vcanna_fn_BaseZenHanToggle, Vcanna_fn_BaseKanaEisuToggle,
-       Vcanna_fn_BaseKakuteiHenkanToggle, Vcanna_fn_BaseRotateForward,
-       Vcanna_fn_BaseRotateBackward, Vcanna_fn_Touroku, Vcanna_fn_HexMode,
-       Vcanna_fn_BushuMode, Vcanna_fn_KigouMode, Vcanna_fn_Mark,
-       Vcanna_fn_TemporalMode, Vcanna_key_Nfer, Vcanna_key_Xfer,
-       Vcanna_key_Up, Vcanna_key_Left, Vcanna_key_Right, Vcanna_key_Down,
-       Vcanna_key_Insert, Vcanna_key_Rollup, Vcanna_key_Rolldown,
-       Vcanna_key_Home, Vcanna_key_Help, Vcanna_key_KP_Key,
-       Vcanna_key_Shift_Nfer, Vcanna_key_Shift_Xfer, Vcanna_key_Shift_Up,
-       Vcanna_key_Shift_Left, Vcanna_key_Shift_Right, Vcanna_key_Shift_Down,
-       Vcanna_key_Cntrl_Nfer, Vcanna_key_Cntrl_Xfer, Vcanna_key_Cntrl_Up,
-       Vcanna_key_Cntrl_Left, Vcanna_key_Cntrl_Right, Vcanna_key_Cntrl_Down
-
-1998-07-16  Jan Vroonhof  <vroonhof@math.ethz.ch>
-
-       * event-Xt.c (x_to_emacs_keysym): Return nil for modifier keysyms.
-       (x_event_to_emacs_event): Let x_to_emacs_keysym check for modifier
-       keys thus no longer considering all keysyms on a key.
-
 1998-07-19  SL Baur  <steve@altair.xemacs.org>
 
        * XEmacs 21.2-beta1 is released.
 
        * eval.c (run_hook_with_args_in_buffer): Check
          default (non-buffer-local) value of hook for
-         nil before treating it as a function.  Don't initialize
+         nil before treating it as a function.  Don't initialize 
          the `globals' variable twice.
 
 1998-06-24  Jonathan Harris  <jhar@tardis.ed.ac.uk>
 
        * eval.c (run_hook_with_args_in_buffer): Don't treat
          the default value of a buffer local hook as a list of
-         hooks unless it is both a cons and the car of that cons
+         hooks unless it is both a cons and the car of that cons 
          is not Qlambda.
 
 1998-06-29  SL Baur  <steve@altair.xemacs.org>
        * winslots.h: Rename.
 
        * window.c (specifier_vars_of_window): Renamed
-       vertical-divider-draggable-p to vertical-divider-always-visible-p,
+       vertical-divider-draggable-p to vertical-divider-always-visible-p, 
        as suggested by Ben Wing.
        (specifier_vars_of_window): Fix docstrings.
 
        Set last_known_column_point to the buffer position for
        which the column was requested, not buffer's point.
 
-       * redisplay.c (decode_mode_spec): for current-column, show
+       * redisplay.c (decode_mode_spec): for current-column, show 
        window's point's column, not buffer's point's column.
 
 1998-06-23  Andy Piper  <andyp@parallax.co.uk>
        mswindows_size_frame_internal function and size frame if frame
        parameters not just if init is finished - WM_SIZE happens too
        early for some specs. (mswindows_size_frame_internal): new
-       function abstracted from mswindows_set_frame_properties.
+       function abstracted from mswindows_set_frame_properties. 
        (Vmswindows_use_system_frame_size_defaults):
        new variable controls whether to allow the system to pick frame
        size defaults, defaults to nil.
 
 1998-06-05  Hrvoje Niksic  <hniksic@srce.hr>
 
-       * eldap.c (Fldap_search_internal): Use build_ext_string instead of
+       * eldap.c (Fldap_search_internal): Use build_ext_string instead of 
        build_string to avoid crashes under Mule.
 
 1998-06-13  Andy Piper  <andyp@parallax.co.uk>
 
        * glyphs-msw.c (read_bitmap_data) (NextInt)
        (read_bitmap_data_from_file): new functions copied from Xmu
-       sources.
+       sources. 
        (xbm_create_bitmap_from_data) from Ben <ben@666.com> convert
        inline data to an mswindows bitmap.
        (init_image_instance_from_xbm_inline) (xbm_instantiate_1)
        Added prototype for mswindows_enqueue_misc_user_event().
 
        * menubar-msw.c (mswindows_handle_wm_command): Use
-       mswindows_enqueue_misc_user_event().
+       mswindows_enqueue_misc_user_event(). 
 
        * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto.
 
 1998-05-29  Greg Klanderman  <greg@alphatech.com>
 
        * window.c (Fwindow_displayed_text_pixel_height): was relying on
-       incorrect semantics of vmotion_pixels which has been fixed.  don't
+       incorrect semantics of vmotion_pixels which has been fixed.  don't 
        use it anymore as it can't easily be used.
 
        * indent.c (vmotion_pixels): fix off by one bug moving up.  also
-       the motion was reported incorrectly if you tried to go past end of
+       the motion was reported incorrectly if you tried to go past end of 
        buffer.
 
 1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
 
 1998-05-28  Martin Buchholz  <martin@xemacs.org>
 
-       * alloc.c (dbg_constants):
+       * alloc.c (dbg_constants): 
        * dbxrc:
        * gdbinit:
        Remove toolbar_data debugging code, since that lrecord has
-       also been removed.
+       also been removed. 
 
 Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
@@ -3079,7 +663,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        * fileio.c: replaced egetenv("HOME") with calls to the new
          get_home_directory().
 
-       * lisp.h: Added function prototypes for uncache_home_directory()
+       * lisp.h: Added function prototypes for uncache_home_directory() 
          and get_home_directory(), along with lisp prototypes for
          Fuser_home_directory() and friends.
 
@@ -3096,7 +680,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
        * event-msw.c (mswindows_wnd_proc, WM_KEYDOWN): Unconditionally
        remove MOD_SHIFT from ASCII characters.
-       (mswindows_wnd_proc, WM_KEYDOWN): Do not activate the menubar when
+       (mswindows_wnd_proc, WM_KEYDOWN): Do not activate the menubar when 
        F10 is pressed.
 
 1998-05-24  Oliver Graf <ograf@fga.de>
@@ -3133,10 +717,10 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (syms_of_indent): DEFSUBR.
        * lisp.h: declaration for vmotion_pixels().
 
-       * indent.c (Fvertical_motion): Add optional third argument PIXELS,
+       * indent.c (Fvertical_motion): Add optional third argument PIXELS, 
        to request returning motion in pixels.
        (Fvertical_motion_pixels): Remove, functionality merged into
-       Fvertical_motion.
+       Fvertical_motion. 
        * window.c (window_scroll): call Fvertical_motion with 3 arguments.
        (Fmove_to_window_line): ditto.
        * lisp.h: Change declaration for Fvertical_motion.
@@ -3150,7 +734,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        Tooltalk_Message_plist_str and Tooltalk_Pattern_plist_str
 
 1998-05-27  Andy Piper  <andyp@parallax.co.uk>
-
+               
        * faces.c: create a new 3d_object_face, make modeline and
        vertical_divider faces fallback to this rather than the default.
 
@@ -3198,9 +782,9 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        * This patch is to fix compilation warnings under Windows.
 
        * s/windowsnt.h: Encapsulate getpid with sys_getpid.
-       Added prototypes for FSF inherited functions, with which XEmacs is
+       Added prototypes for FSF inherited functions, with which XEmacs is 
        sprinkled thoroughly.
-       Removed some #if 0 code. Bracketed some more definitions, probably
+       Removed some #if 0 code. Bracketed some more definitions, probably 
        related to Visual C versions prior to 4 (we do not support them).
 
        * sysfloat.h (logb): Finally, get logb() prototyped.
@@ -3216,10 +800,10 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        vars_of_dired_mswindows and init_ntproc (Grrr).
 
        * realpath.c: Added Windows specific include files.
-       (xrealpath): Conditionalized declaration of some auto variables on
+       (xrealpath): Conditionalized declaration of some auto variables on 
        S_IFLNK, to avoid warnings.
 
-       * ntproc.c: Disabled some compiler warnings. This file is going to
+       * ntproc.c: Disabled some compiler warnings. This file is going to 
        die, so I have not cleaned it up much.
        (set_process_dir): Const parameter.
        (Fwin32_short_file_name): Down CHECK_* macros to one argument.
@@ -3295,7 +879,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
        * symsinit.h: Prototyped the above functions.
 
-       * dialog-x.c (x_popup_dialog_box): Moved dialog descriptor consistency
+       * dialog-x.c (x_popup_dialog_box): Moved dialog descriptor consistency 
        checks to dialog.c...
 
        * dialog.c (Fpopup_dialog_box): ...right here. Added more checks: a
@@ -3348,7 +932,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
        * EmacsFrame.c (Xt_StringToScrollBarPlacement):  Added support for
        {top,bottom}-{left,right} values in addition to
-       {top,bottom}_{left,right}.
+       {top,bottom}_{left,right}. 
 
 1998-05-18  Hrvoje Niksic  <hniksic@srce.hr>
 
@@ -3359,10 +943,10 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
 1998-05-19  Martin Buchholz  <martin@xemacs.org>
 
-       * unexhp9k800.c:
-       * sound.c (vars_of_sound):
-       * sysdep.c (reset_sigio_on_device):
-       * window.c (window_bottom_gutter_height):
+       * unexhp9k800.c: 
+       * sound.c (vars_of_sound): 
+       * sysdep.c (reset_sigio_on_device): 
+       * window.c (window_bottom_gutter_height): 
        unexhp9k800.c:258: warning: implicit declaration of function
        `calculate_checksum'
        sound.c:604: warning: implicit declaration of function `vars_of_hpplay'
@@ -3392,7 +976,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        * frame-x.c (x_update_frame_external_traits): Start preprocessor
        directives in column 1.
 
-       * search.c (skip_chars): Avoid using xzero with arrays, since some
+       * search.c (skip_chars): Avoid using xzero with arrays, since some 
        compilers get confused by the construct &array.
 
 1998-05-18  Kirill M. Katsnelson  <kkm@kis.ru>
@@ -3416,7 +1000,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 1998-05-18  Kirill M. Katsnelson  <kkm@kis.ru>
 
        * objects-msw.c (mswindows_initialize_font_instance): Use ANSI
-       charset when creating font.
+       charset when creating font. 
        (mswindows_initialize_color_instance): Do not create brush along
        with a color.
        (mswindows_finalize_color_instance): Do not delete it then.
@@ -3440,7 +1024,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (compute_frame_toolbars_data): Removed unused second parameter;
        Adjusted callers of this static function throughout the file.
        (init_frame_toolbars): Initialize current_toolbar_size.
-       (update_frame_toolbars): Use DEVICE_SUPPORTS_TOOLBARS_P instead of
+       (update_frame_toolbars): Use DEVICE_SUPPORTS_TOOLBARS_P instead of 
        what is its current expansion, for clarity.
        (init_frame_toolbars): Ditto.
        (init_device_toolbars): Ditto.
@@ -3485,7 +1069,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
        * emacs.c (main_1): Call syms_of_process_nt()
 
-       * process-nt.c: Quote process arguments by a call to Lisp function
+       * process-nt.c: Quote process arguments by a call to Lisp function 
        `nt-quote-process-args'.
        (syms_of_process_nt): New function.
        (nt_send_process): Flush data stream after each write, to avoid
@@ -3510,7 +1094,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
 1998-05-17  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
-       * s/aix4-2.h (ALIGN_DATA_RELOC): Undefined to support new unexaix.c.
+       * s/aix4-2.h (ALIGN_DATA_RELOC): Undefined to support new unexaix.c. 
 
        * s/aix3-1.h (ALIGN_DATA_RELOC): Defined to support new unexaix.c.
 
@@ -3582,7 +1166,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
        * bufslots.h: Removed buffer_file_type slot.
 
-       * buffer.c (complex_vars_of_buffer): Removed buffer_file_type from
+       * buffer.c (complex_vars_of_buffer): Removed buffer_file_type from 
        buffer local flags.
        (complex_vars_of_buffer): Removed buffer-file-type variable and
        its default reference.
@@ -3611,9 +1195,9 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (x_divider_width): ditto.
 
        * window.c (specifier_vars_of_window): new specifiers:
-       vertical-divier -line-width and -spacing.
+       vertical-divier -line-width and -spacing. 
        (vertical_divider_global_width_changed): formerly known as
-       vertical_divider_shadow_thickness_changed.
+       vertical_divider_shadow_thickness_changed. 
 
        * winslots.h: new slots: vertical_specifier _line_width and
        _spacing. Plus corrected a comment typo.
@@ -3626,7 +1210,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (console_type_create_stream): And declaration for it.
 
        * redisplay.c (pixel_to_glyph_translation): Use
-       window_divider_width() instead of divider_width redisplay method.
+       window_divider_width() instead of divider_width redisplay method. 
        (pixel_to_glyph_translation): Fix top divider edge calculation
        when scrollbar is on top.
 
@@ -3636,7 +1220,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (specifier_vars_of_window): For vertical-divider-{spacing,line-width}
        specifiers, set fallback values differently on TTYs, and document
        the behavior of these on TTYs in the docstrings.
-
+       
        * scrollbar.c (update_scrollbar_instance): Use
        window_divider_width() instead of divider_width redisplay method.
 
@@ -3691,7 +1275,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
        * emacs.c (main_1): Call console_type_create_dialog_x().
 
-       * dialog-x.c (x_popup_dialog_box): Old Fpopup_dialog_box converted
+       * dialog-x.c (x_popup_dialog_box): Old Fpopup_dialog_box converted 
        into this device method.
        (console_type_create_dialog_x): New function.
 
@@ -3699,7 +1283,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (syms_of_dialog): Defsubr it.
 
        * console.h (struct console_methods): Declared
-       popup_dialog_box_method().
+       popup_dialog_box_method(). 
 
        * symsinit.h: Defined console_type_create_dialog_{x,mswindows}
 
@@ -3737,10 +1321,10 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        ** Renamed window-divider-map => vertical-divider-map
        and event-over-divider-p => event-over-vertical-divider-p,
        in the following files/functions:
-       * events.h:
-       * events.c (Fevent_over_divider_p):
-       * keymap.c (get_relevant_keymaps):
-       (vars_of_keymap):
+       * events.h: 
+       * events.c (Fevent_over_divider_p): 
+       * keymap.c (get_relevant_keymaps): 
+       (vars_of_keymap): 
 
        * redisplay.h (OVER_V_DIVIDER): Renamed so from OVER_DIVIDER.
 
@@ -3763,7 +1347,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
        * window.h: Prototype invalidate_vertical_divider_cache_in_window.
        (struct window): Added need_vertical_divider_p and
-       need_vertical_divider_valid_p.
+       need_vertical_divider_valid_p. 
 
        * winslots.h: Added vertical_divider_draggable_p slot.
 
@@ -3819,7 +1403,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        thickness is negative.
 
        * console-stream.c (stream_divider_width): pass a struct window *
-       argument.
+       argument. 
 
        * redisplay-tty.c (tty_divider_width): ditto.
 
@@ -3828,12 +1412,12 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        * redisplay.c (generate_modeline): ittod.
 
        * scrollbar.c (update_scrollbar_instance): ttido.
-
-       * redisplay-msw.c (mswindows_divider_width): ottid.
+       
+       * redisplay-msw.c (mswindows_divider_width): ottid. 
        WARNING: this enables to compile, but the feature is not functional.
 
        * window.h (struct window): new field
-       vertical_divider_shadow_thickness.
+       vertical_divider_shadow_thickness. 
 
        * window.c (specifier_vars_of_window): new specifier
        vertical-divider-shadow-thickness.
@@ -3884,7 +1468,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 1998-05-10  Andy Piper  <andyp@parallax.co.uk>
 
        * redisplay-msw.c (mswindows_output_dibitmap_region): make sure
-       multiple bitmaps are output vertically as well as horizontally.
+       multiple bitmaps are output vertically as well as horizontally.  
        * (mswindows_output_dibitmap): don't cope with bitmap boundaries
        crossing lines this is handled by
        mswindows_output_dibitmap_region.
@@ -3893,7 +1477,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 
        * inline.c: Include eldap.h
 
-       * menubar-x.c (x_update_frame_menubar_internal):
+       * menubar-x.c (x_update_frame_menubar_internal): 
        Remove: unused variable `container'
 
 1998-05-11  Martin Buchholz  <martin@xemacs.org>
@@ -3901,8 +1485,8 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        * s/aix4.h: Allow AIX 4.3 XEmacs to compile cleanly.
        Unfortunately, the resulting temacs still cannot dump.
 
-       * symbols.c (symbol_is_constant):
-       (verify_ok_for_buffer_local):
+       * symbols.c (symbol_is_constant): 
+       (verify_ok_for_buffer_local): 
        -Wswitch Warning suppression - add default case to switches.
 
        * redisplay.c (decode_mode_spec): Remove unused variables,
@@ -3949,7 +1533,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
 1998-05-12  Didier Verna  <verna@inf.enst.fr>
 
        * redisplay.c: removed the scrolling modeline code that didn't
-       make it for 21.0. To be continued ...
+       make it for 21.0. To be continued ... 
 
 1998-05-13  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
@@ -4006,7 +1590,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (mswindows_output_vertical_divider): Always output the divider on
        the right side of a window, down to bottom.
 
-       * keymap.c (get_relevant_keymaps): Route mouse button events which
+       * keymap.c (get_relevant_keymaps): Route mouse button events which 
        happened over a window divider through window-divider-map.
        (Fkey_binding): Documented that in the docstring.
        Defined the variable Vwindow_divider_map.
@@ -4055,7 +1639,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (metrics); Changed parameters order and added DEFAULT parameter;
        Unabbreviated some metric constants; Fixed and untabified doc string.
        (Fdevice_system_metrics): Added. Returns a plist of all provided
-       metrics.
+       metrics. 
 
        * device-msw.c (mswindows_device_system_metrics): Renamed
        device_metrics enum constants.
index 2add8a9..e18efdd 100644 (file)
@@ -172,7 +172,7 @@ abbrev_match (struct buffer *buf, Lisp_Object obarray)
    It is an order of magnitude faster than the proper abbrev_match(),
    but then again, vi is an order of magnitude faster than Emacs.
 
-   This speed difference should be unnoticeable, though.  I have tested
+   This speed difference should be unnoticable, though.  I have tested
    the degenerated cases of thousands of abbrevs being defined, and
    abbrev_match() was still fast enough for normal operation.  */
 static struct Lisp_Symbol *
diff --git a/src/acldef.h b/src/acldef.h
new file mode 100644 (file)
index 0000000..eba2c59
--- /dev/null
@@ -0,0 +1,65 @@
+/* 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: FSF 19.30. */
+
+/* Authorship:
+
+   FSF: Original version; a long time ago.
+   No changes for XEmacs.
+ */
+
+#define        ACL$K_LENGTH    12
+#define        ACL$C_LENGTH    12
+#define        ACL$C_FILE      1
+#define        ACL$C_DEVICE    2
+#define        ACL$C_JOBCTL_QUEUE      3
+#define        ACL$C_COMMON_EF_CLUSTER 4
+#define        ACL$C_LOGICAL_NAME_TABLE        5
+#define        ACL$C_PROCESS   6
+#define        ACL$C_GROUP_GLOBAL_SECTION      7
+#define        ACL$C_SYSTEM_GLOBAL_SECTION     8
+#define        ACL$C_ADDACLENT 1
+#define        ACL$C_DELACLENT 2
+#define        ACL$C_MODACLENT 3
+#define        ACL$C_FNDACLENT 4
+#define        ACL$C_FNDACETYP 5
+#define        ACL$C_DELETEACL 6
+#define        ACL$C_READACL   7
+#define        ACL$C_ACLLENGTH 8
+#define        ACL$C_READACE   9
+#define        ACL$C_RLOCK_ACL 10
+#define        ACL$C_WLOCK_ACL 11
+#define        ACL$C_UNLOCK_ACL        12
+#define        ACL$S_ADDACLENT 255
+#define        ACL$S_DELACLENT 255
+#define        ACL$S_MODACLENT 255
+#define        ACL$S_FNDACLENT 255
+#define        ACL$S_FNDACETYP 255
+#define        ACL$S_DELETEACL 255
+#define        ACL$S_READACL   512
+#define        ACL$S_ACLLENGTH 4
+#define        ACL$S_READACE   255
+#define        ACL$S_RLOCK_ACL 4
+#define        ACL$S_WLOCK_ACL 4
+#define        ACL$S_UNLOCK_ACL        4
+#define        ACL$S_ACLDEF    16
+#define        ACL$L_FLINK     0
+#define        ACL$L_BLINK     4
+#define        ACL$W_SIZE      8
+#define        ACL$B_TYPE      10
+#define        ACL$L_LIST      12
index 86a75e0..8765c62 100644 (file)
@@ -51,28 +51,18 @@ Boston, MA 02111-1307, USA.  */
 #include "extents.h"
 #include "frame.h"
 #include "glyphs.h"
-#include "opaque.h"
 #include "redisplay.h"
 #include "specifier.h"
 #include "sysfile.h"
 #include "window.h"
 
-#include <stddef.h>
-
 #ifdef DOUG_LEA_MALLOC
 #include <malloc.h>
 #endif
 
 EXFUN (Fgarbage_collect, 0);
 
-/* Return the true size of a struct with a variable-length array field.  */
-#define STRETCHY_STRUCT_SIZEOF(stretchy_struct_type,           \
-                              stretchy_array_field,            \
-                              stretchy_array_length)           \
-  (offsetof (stretchy_struct_type, stretchy_array_field) +     \
-   (offsetof (stretchy_struct_type, stretchy_array_field[1]) - \
-    offsetof (stretchy_struct_type, stretchy_array_field[0])) *        \
-   (stretchy_array_length))
+/* #define GDB_SUCKS */
 
 #if 0 /* this is _way_ too slow to be part of the standard debug options */
 #if defined(DEBUG_XEMACS) && defined(MULE)
@@ -82,9 +72,11 @@ EXFUN (Fgarbage_collect, 0);
 
 /* Define this to see where all that space is going... */
 /* But the length of the printout is obnoxious, so limit it to testers */
-#ifdef MEMORY_USAGE_STATS
+/* If somebody wants to see this they can ask for it.
+#ifdef DEBUG_XEMACS
 #define PURESTAT
 #endif
+*/
 
 /* Define this to use malloc/free with no freelist for all datatypes,
    the hope being that some debugging tools may help detect
@@ -97,13 +89,24 @@ EXFUN (Fgarbage_collect, 0);
 #include "puresize.h"
 
 #ifdef DEBUG_XEMACS
-static int debug_allocation;
-static int debug_allocation_backtrace_length;
+int debug_allocation;
+
+int debug_allocation_backtrace_length;
 #endif
 
 /* Number of bytes of consing done since the last gc */
 EMACS_INT consing_since_gc;
+#ifdef EMACS_BTL
+extern void cadillac_record_backtrace ();
+#define INCREMENT_CONS_COUNTER_1(size)         \
+  do {                                         \
+    EMACS_INT __sz__ = ((EMACS_INT) (size));   \
+    consing_since_gc += __sz__;                        \
+    cadillac_record_backtrace (2, __sz__);     \
+  } while (0)
+#else
 #define INCREMENT_CONS_COUNTER_1(size) (consing_since_gc += (size))
+#endif /* EMACS_BTL */
 
 #define debug_allocation_backtrace()                           \
 do {                                                           \
@@ -136,11 +139,14 @@ do {                                                              \
   INCREMENT_CONS_COUNTER_1 (size)
 #endif
 
-#define DECREMENT_CONS_COUNTER(size) do {      \
-  consing_since_gc -= (size);                  \
-  if (consing_since_gc < 0)                    \
-    consing_since_gc = 0;                      \
-} while (0)
+#define DECREMENT_CONS_COUNTER(size)           \
+  do {                                         \
+    EMACS_INT __sz__ = ((EMACS_INT) (size));   \
+    if (consing_since_gc >= __sz__)            \
+      consing_since_gc -= __sz__;              \
+    else                                       \
+      consing_since_gc = 0;                    \
+  } while (0)
 
 /* Number of bytes of consing since gc before another gc should be done. */
 EMACS_INT gc_cons_threshold;
@@ -187,9 +193,6 @@ int purify_flag;
 extern void sheap_adjust_h();
 #endif
 
-/* Force linker to put it into data space! */
-EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = { (EMACS_INT) 0};
-
 #define PUREBEG ((char *) pure)
 
 #if 0 /* This is breathing_space in XEmacs */
@@ -208,8 +211,7 @@ static size_t pure_bytes_used;
 ((char *) (ptr) >= PUREBEG &&                  \
  (char *) (ptr) <  PUREBEG + get_PURESIZE())
 
-/* Non-zero if pure_bytes_used > get_PURESIZE();
-   accounts for excess purespace needs. */
+/* Non-zero if pure_bytes_used > get_PURESIZE(); accounts for excess purespace needs. */
 static size_t pure_lossage;
 
 #ifdef ERROR_CHECK_TYPECHECK
@@ -258,9 +260,9 @@ check_purespace (size_t size)
 
 #else /* PURESTAT */
 
-static int purecopying_function_constants;
+static int purecopying_for_bytecode;
 
-static size_t pure_sizeof (Lisp_Object);
+static size_t pure_sizeof (Lisp_Object /*, int recurse */);
 
 /* Keep statistics on how much of what is in purespace */
 static struct purestat
@@ -272,9 +274,9 @@ static struct purestat
   purestat_cons = {0, 0, "cons cells"},
   purestat_float = {0, 0, "float objects"},
   purestat_string_pname = {0, 0, "symbol-name strings"},
-  purestat_function = {0, 0, "compiled-function objects"},
-  purestat_opaque_instructions = {0, 0, "compiled-function instructions"},
-  purestat_vector_constants = {0, 0, "compiled-function constants vectors"},
+  purestat_bytecode = {0, 0, "compiled-function objects"},
+  purestat_string_bytecodes = {0, 0, "byte-code strings"},
+  purestat_vector_bytecode_constants = {0, 0, "byte-constant vectors"},
   purestat_string_interactive = {0, 0, "interactive strings"},
 #ifdef I18N3
   purestat_string_domain = {0, 0, "domain strings"},
@@ -286,6 +288,27 @@ static struct purestat
   purestat_string_all = {0, 0, "all strings"},
   purestat_vector_all = {0, 0, "all vectors"};
 
+static struct purestat *purestats[] =
+{
+  &purestat_cons,
+  &purestat_float,
+  &purestat_string_pname,
+  &purestat_bytecode,
+  &purestat_string_bytecodes,
+  &purestat_vector_bytecode_constants,
+  &purestat_string_interactive,
+#ifdef I18N3
+  &purestat_string_domain,
+#endif
+  &purestat_string_documentation,
+  &purestat_string_other_function,
+  &purestat_vector_other,
+  &purestat_string_other,
+  0,
+  &purestat_string_all,
+  &purestat_vector_all
+};
+
 static void
 bump_purestat (struct purestat *purestat, size_t nbytes)
 {
@@ -293,25 +316,13 @@ bump_purestat (struct purestat *purestat, size_t nbytes)
   purestat->nobjects += 1;
   purestat->nbytes += nbytes;
 }
-
-static void
-print_purestat (struct purestat *purestat)
-{
-  char buf [100];
-  sprintf(buf, "%s:", purestat->name);
-  message ("   %-36s %5d  %7d  %2d%%",
-          buf,
-          purestat->nobjects,
-          purestat->nbytes,
-          (int) (purestat->nbytes / (pure_bytes_used / 100.0) + 0.5));
-}
 #endif /* PURESTAT */
 
 \f
 /* Maximum amount of C stack to save when a GC happens.  */
 
 #ifndef MAX_SAVE_STACK
-#define MAX_SAVE_STACK 0 /* 16000 */
+#define MAX_SAVE_STACK 16000
 #endif
 
 /* Non-zero means ignore malloc warnings.  Set during initialization.  */
@@ -376,25 +387,18 @@ memory_full (void)
 void *
 xmalloc (size_t size)
 {
-  void *val = malloc (size);
+  void *val = (void *) malloc (size);
 
   if (!val && (size != 0)) memory_full ();
   return val;
 }
 
-static void *
-xcalloc (size_t nelem, size_t elsize)
-{
-  void *val = calloc (nelem, elsize);
-
-  if (!val && (nelem != 0)) memory_full ();
-  return val;
-}
-
 void *
 xmalloc_and_zero (size_t size)
 {
-  return xcalloc (size, sizeof (char));
+  void *val = xmalloc (size);
+  memset (val, 0, size);
+  return val;
 }
 
 #ifdef xrealloc
@@ -406,7 +410,7 @@ xrealloc (void *block, size_t size)
 {
   /* We must call malloc explicitly when BLOCK is 0, since some
      reallocs don't do this.  */
-  void *val = block ? realloc (block, size) : malloc (size);
+  void *val = (void *) (block ? realloc (block, size) : malloc (size));
 
   if (!val && (size != 0)) memory_full ();
   return val;
@@ -513,15 +517,17 @@ alloc_lcrecord (size_t size, CONST struct lrecord_implementation *implementation
 {
   struct lcrecord_header *lcheader;
 
-#ifdef ERROR_CHECK_GC
+  if (size <= 0) abort ();
   if (implementation->static_size == 0)
-    assert (implementation->size_in_bytes_method);
-  else
-    assert (implementation->static_size == size);
-#endif
+    {
+      if (!implementation->size_in_bytes_method)
+       abort ();
+    }
+  else if (implementation->static_size != size)
+    abort ();
 
   lcheader = (struct lcrecord_header *) allocate_lisp_storage (size);
-  set_lheader_implementation (&(lcheader->lheader), implementation);
+  set_lheader_implementation(&(lcheader->lheader), implementation);
   lcheader->next = all_lcrecords;
 #if 1                           /* mly prefers to see small ID numbers */
   lcheader->uid = lrecord_uid_counter++;
@@ -566,7 +572,7 @@ free_lcrecord (struct lcrecord_header *lcrecord)
        }
     }
   if (lrecord->implementation->finalizer)
-    lrecord->implementation->finalizer (lrecord, 0);
+    ((lrecord->implementation->finalizer) (lrecord, 0));
   xfree (lrecord);
   return;
 }
@@ -628,9 +634,9 @@ gc_record_type_p (Lisp_Object frob, CONST struct lrecord_implementation *type)
 }
 
 \f
-/************************************************************************/
-/*                       Debugger support                              */
-/************************************************************************/
+/**********************************************************************/
+/*                       Debugger support                            */
+/**********************************************************************/
 /* Give gdb/dbx enough information to decode Lisp Objects.
    We make sure certain symbols are defined, so gdb doesn't complain
    about expressions in src/gdbinit.  Values are randomly chosen.
@@ -649,19 +655,11 @@ enum dbg_constants
   dbg_USE_MINIMAL_TAGBITS = 0,
   dbg_Lisp_Type_Int = Lisp_Type_Int,
 #endif /* ! USE_MIMIMAL_TAGBITS */
-
-#ifdef USE_UNION_TYPE
-  dbg_USE_UNION_TYPE = 1,
-#else
-  dbg_USE_UNION_TYPE = 0,
-#endif
-
 #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
   dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1,
 #else
   dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 0,
 #endif
-
   dbg_Lisp_Type_Char = Lisp_Type_Char,
   dbg_Lisp_Type_Record = Lisp_Type_Record,
 #ifdef LRECORD_CONS
@@ -709,19 +707,10 @@ enum dbg_constants
      other compilers) might optimize away the entire type declaration :-( */
 } dbg_dummy;
 
-/* A few macros turned into functions for ease of debugging.
-   Debuggers don't know about macros! */
-int dbg_eq (Lisp_Object obj1, Lisp_Object obj2);
-int
-dbg_eq (Lisp_Object obj1, Lisp_Object obj2)
-{
-  return EQ (obj1, obj2);
-}
-
 \f
-/************************************************************************/
-/*                       Fixed-size type macros                        */
-/************************************************************************/
+/**********************************************************************/
+/*                        Fixed-size type macros                      */
+/**********************************************************************/
 
 /* For fixed-size types that are commonly used, we malloc() large blocks
    of memory at a time and subdivide them into chunks of the correct
@@ -903,46 +892,45 @@ refill_memory_reserve ()
      / sizeof (structtype))
 #endif /* ALLOC_NO_POOLS */
 
-#define DECLARE_FIXED_TYPE_ALLOC(type, structtype)     \
-                                                       \
-struct type##_block                                    \
-{                                                      \
-  struct type##_block *prev;                           \
-  structtype block[TYPE_ALLOC_SIZE (type, structtype)];        \
-};                                                     \
-                                                       \
-static struct type##_block *current_##type##_block;    \
-static int current_##type##_block_index;               \
-                                                       \
-static structtype *type##_free_list;                   \
-static structtype *type##_free_list_tail;              \
-                                                       \
-static void                                            \
-init_##type##_alloc (void)                             \
-{                                                      \
-  current_##type##_block = 0;                          \
-  current_##type##_block_index =                       \
-    countof (current_##type##_block->block);           \
-  type##_free_list = 0;                                        \
-  type##_free_list_tail = 0;                           \
-}                                                      \
-                                                       \
-static int gc_count_num_##type##_in_use;               \
-static int gc_count_num_##type##_freelist
-
-#define ALLOCATE_FIXED_TYPE_FROM_BLOCK(type, result) do {              \
-  if (current_##type##_block_index                                     \
-      == countof (current_##type##_block->block))                      \
+#define DECLARE_FIXED_TYPE_ALLOC(type, structtype)                       \
+                                                                         \
+struct type##_block                                                      \
+{                                                                        \
+  struct type##_block *prev;                                             \
+  structtype block[TYPE_ALLOC_SIZE (type, structtype)];                          \
+};                                                                       \
+                                                                         \
+static struct type##_block *current_##type##_block;                      \
+static int current_##type##_block_index;                                 \
+                                                                         \
+static structtype *type##_free_list;                                     \
+static structtype *type##_free_list_tail;                                \
+                                                                         \
+static void                                                              \
+init_##type##_alloc (void)                                               \
+{                                                                        \
+  current_##type##_block = 0;                                            \
+  current_##type##_block_index = countof (current_##type##_block->block); \
+  type##_free_list = 0;                                                          \
+  type##_free_list_tail = 0;                                             \
+}                                                                        \
+                                                                         \
+static int gc_count_num_##type##_in_use, gc_count_num_##type##_freelist
+
+#define ALLOCATE_FIXED_TYPE_FROM_BLOCK(type, result)                   \
+  do {                                                                 \
+    if (current_##type##_block_index                                   \
+       == countof (current_##type##_block->block))                     \
     {                                                                  \
-      struct type##_block *AFTFB_new = (struct type##_block *)         \
-       allocate_lisp_storage (sizeof (struct type##_block));           \
-      AFTFB_new->prev = current_##type##_block;                                \
-      current_##type##_block = AFTFB_new;                              \
+      struct type##_block *__new__ = (struct type##_block *)           \
+         allocate_lisp_storage (sizeof (struct type##_block));         \
+      __new__->prev = current_##type##_block;                          \
+      current_##type##_block = __new__;                                        \
       current_##type##_block_index = 0;                                        \
     }                                                                  \
-  (result) =                                                           \
-    &(current_##type##_block->block[current_##type##_block_index++]);  \
-} while (0)
+    (result) =                                                         \
+      &(current_##type##_block->block[current_##type##_block_index++]);        \
+  } while (0)
 
 /* Allocate an instance of a type that is stored in blocks.
    TYPE is the "name" of the type, STRUCTTYPE is the corresponding
@@ -1058,22 +1046,22 @@ do { if (type##_free_list_tail)                                         \
 #else /* !ERROR_CHECK_GC */
 
 #define PUT_FIXED_TYPE_ON_FREE_LIST(type, structtype, ptr)     \
-do { * (structtype **) ((char *) (ptr) + sizeof (void *)) =    \
+do { * (structtype **) ((char *) ptr + sizeof (void *)) =      \
        type##_free_list;                                       \
-     type##_free_list = (ptr);                                 \
+     type##_free_list = ptr;                                   \
    } while (0)
 
 #endif /* !ERROR_CHECK_GC */
 
 /* TYPE and STRUCTTYPE are the same as in ALLOCATE_FIXED_TYPE(). */
 
-#define FREE_FIXED_TYPE(type, structtype, ptr) do {            \
-  structtype *FFT_ptr = (ptr);                                 \
-  ADDITIONAL_FREE_##type (FFT_ptr);                            \
-  deadbeef_memory (FFT_ptr, sizeof (structtype));              \
-  PUT_FIXED_TYPE_ON_FREE_LIST (type, structtype, FFT_ptr);     \
-  MARK_STRUCT_AS_FREE (FFT_ptr);                               \
-} while (0)
+#define FREE_FIXED_TYPE(type, structtype, ptr)                 \
+do { structtype *_weird_ = (ptr);                              \
+     ADDITIONAL_FREE_##type (_weird_);                         \
+     deadbeef_memory (ptr, sizeof (structtype));               \
+     PUT_FIXED_TYPE_ON_FREE_LIST (type, structtype, ptr);      \
+     MARK_STRUCT_AS_FREE (_weird_);                            \
+   } while (0)
 
 /* Like FREE_FIXED_TYPE() but used when we are explicitly
    freeing a structure through free_cons(), free_marker(), etc.
@@ -1093,9 +1081,9 @@ do { FREE_FIXED_TYPE (type, structtype, ptr);                     \
 
 
 \f
-/************************************************************************/
-/*                        Cons allocation                              */
-/************************************************************************/
+/**********************************************************************/
+/*                         Cons allocation                            */
+/**********************************************************************/
 
 DECLARE_FIXED_TYPE_ALLOC (cons, struct Lisp_Cons);
 /* conses are used and freed so often that we set this really high */
@@ -1106,10 +1094,10 @@ DECLARE_FIXED_TYPE_ALLOC (cons, struct Lisp_Cons);
 static Lisp_Object
 mark_cons (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
-  if (GC_NILP (XCDR (obj)))
+  if (NILP (XCDR (obj)))
     return XCAR (obj);
 
-  markobj (XCAR (obj));
+  (markobj) (XCAR (obj));
   return XCDR (obj);
 }
 
@@ -1185,7 +1173,7 @@ Any number of arguments, even zero arguments, are allowed.
   Lisp_Object val = Qnil;
   Lisp_Object *argp = args + nargs;
 
-  while (argp > args)
+  while (nargs-- > 0)
     val = Fcons (*--argp, val);
   return val;
 }
@@ -1265,9 +1253,9 @@ Return a new list of length LENGTH, with each element being INIT.
 }
 
 \f
-/************************************************************************/
-/*                       Float allocation                              */
-/************************************************************************/
+/**********************************************************************/
+/*                        Float allocation                            */
+/**********************************************************************/
 
 #ifdef LISP_FLOAT_TYPE
 
@@ -1290,44 +1278,45 @@ make_float (double float_value)
 #endif /* LISP_FLOAT_TYPE */
 
 \f
-/************************************************************************/
-/*                        Vector allocation                            */
-/************************************************************************/
+/**********************************************************************/
+/*                         Vector allocation                          */
+/**********************************************************************/
 
 #ifdef LRECORD_VECTOR
 static Lisp_Object
 mark_vector (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
-  Lisp_Vector *ptr = XVECTOR (obj);
+  struct Lisp_Vector *ptr = XVECTOR (obj);
   int len = vector_length (ptr);
   int i;
 
   for (i = 0; i < len - 1; i++)
-    markobj (ptr->contents[i]);
+    (markobj) (ptr->contents[i]);
   return (len > 0) ? ptr->contents[len - 1] : Qnil;
 }
 
 static size_t
 size_vector (CONST void *lheader)
 {
-  return STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents,
-                                ((Lisp_Vector *) lheader)->size);
+  /* * -1 because struct Lisp_Vector includes 1 slot */
+  return sizeof (struct Lisp_Vector) +
+    ((((struct Lisp_Vector *) lheader)->size - 1) * sizeof (Lisp_Object));
 }
 
 static int
-vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+vector_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
-  int len = XVECTOR_LENGTH (obj1);
-  if (len != XVECTOR_LENGTH (obj2))
+  int indice;
+  int len = XVECTOR_LENGTH (o1);
+  if (len != XVECTOR_LENGTH (o2))
     return 0;
-
-  {
-    Lisp_Object *ptr1 = XVECTOR_DATA (obj1);
-    Lisp_Object *ptr2 = XVECTOR_DATA (obj2);
-    while (len--)
-      if (!internal_equal (*ptr1++, *ptr2++, depth + 1))
+  for (indice = 0; indice < len; indice++)
+    {
+      if (!internal_equal (XVECTOR_DATA (o1) [indice],
+                          XVECTOR_DATA (o2) [indice],
+                          depth + 1))
        return 0;
-  }
+    }
   return 1;
 }
 
@@ -1340,15 +1329,17 @@ DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION("vector", vector,
                                        * knows how to handle vectors.
                                        */
                                       0,
-                                      size_vector, Lisp_Vector);
+                                      size_vector, struct Lisp_Vector);
 
 /* #### should allocate `small' vectors from a frob-block */
-static Lisp_Vector *
+static struct Lisp_Vector *
 make_vector_internal (size_t sizei)
 {
-  /* no vector_next */
-  size_t sizem = STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, sizei);
-  Lisp_Vector *p = (Lisp_Vector *) alloc_lcrecord (sizem, lrecord_vector);
+  size_t sizem = (sizeof (struct Lisp_Vector)
+                 /* -1 because struct Lisp_Vector includes 1 slot */
+                 + (sizei - 1) * sizeof (Lisp_Object));
+  struct Lisp_Vector *p =
+    (struct Lisp_Vector *) alloc_lcrecord (sizem, lrecord_vector);
 
   p->size = sizei;
   return p;
@@ -1359,12 +1350,14 @@ make_vector_internal (size_t sizei)
 static Lisp_Object all_vectors;
 
 /* #### should allocate `small' vectors from a frob-block */
-static Lisp_Vector *
+static struct Lisp_Vector *
 make_vector_internal (size_t sizei)
 {
-  /* + 1 to account for vector_next */
-  size_t sizem = STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, sizei+1);
-  Lisp_Vector *p = (Lisp_Vector *) allocate_lisp_storage (sizem);
+  size_t sizem = (sizeof (struct Lisp_Vector)
+                 /* -1 because struct Lisp_Vector includes 1 slot,
+                  * +1 to account for vector_next */
+                 + (sizei - 1 + 1) * sizeof (Lisp_Object));
+  struct Lisp_Vector *p = (struct Lisp_Vector *) allocate_lisp_storage (sizem);
 
   INCREMENT_CONS_COUNTER (sizem, "vector");
 
@@ -1377,19 +1370,36 @@ make_vector_internal (size_t sizei)
 #endif /* ! LRECORD_VECTOR */
 
 Lisp_Object
-make_vector (size_t length, Lisp_Object init)
+make_vector (EMACS_INT length, Lisp_Object init)
 {
-  Lisp_Vector *vecp = make_vector_internal (length);
-  Lisp_Object *p = vector_data (vecp);
+  int elt;
+  Lisp_Object vector;
+  struct Lisp_Vector *p;
 
-  while (length--)
-    *p++ = init;
+  if (length < 0)
+    length = XINT (wrong_type_argument (Qnatnump, make_int (length)));
 
+  p = make_vector_internal (length);
+  XSETVECTOR (vector, p);
+
+#if 0
+  /* Initialize big arrays full of 0's quickly, for what that's worth */
   {
-    Lisp_Object vector;
-    XSETVECTOR (vector, vecp);
+    char *travesty = (char *) &init;
+    for (i = 1; i < sizeof (Lisp_Object); i++)
+    {
+      if (travesty[i] != travesty[0])
+        goto fill;
+    }
+    memset (vector_data (p), travesty[0], length * sizeof (Lisp_Object));
     return vector;
   }
+ fill:
+#endif
+  for (elt = 0; elt < length; elt++)
+    vector_data(p)[elt] = init;
+
+  return vector;
 }
 
 DEFUN ("make-vector", Fmake_vector, 2, 2, 0, /*
@@ -1398,7 +1408,7 @@ See also the function `vector'.
 */
        (length, init))
 {
-  CONCHECK_NATNUM (length);
+  CHECK_NATNUM (length);
   return make_vector (XINT (length), init);
 }
 
@@ -1408,17 +1418,15 @@ Any number of arguments, even zero arguments, are allowed.
 */
        (int nargs, Lisp_Object *args))
 {
-  Lisp_Vector *vecp = make_vector_internal (nargs);
-  Lisp_Object *p = vector_data (vecp);
+  Lisp_Object vector;
+  int elt;
+  struct Lisp_Vector *p = make_vector_internal (nargs);
 
-  while (nargs--)
-    *p++ = *args++;
+  for (elt = 0; elt < nargs; elt++)
+    vector_data(p)[elt] = args[elt];
 
-  {
-    Lisp_Object vector;
-    XSETVECTOR (vector, vecp);
-    return vector;
-  }
+  XSETVECTOR (vector, p);
+  return vector;
 }
 
 Lisp_Object
@@ -1521,9 +1529,9 @@ vector8 (Lisp_Object obj0, Lisp_Object obj1, Lisp_Object obj2,
 }
 #endif /* unused */
 
-/************************************************************************/
-/*                      Bit Vector allocation                          */
-/************************************************************************/
+/**********************************************************************/
+/*                       Bit Vector allocation                        */
+/**********************************************************************/
 
 static Lisp_Object all_bit_vectors;
 
@@ -1531,63 +1539,69 @@ static Lisp_Object all_bit_vectors;
 static struct Lisp_Bit_Vector *
 make_bit_vector_internal (size_t sizei)
 {
-  size_t num_longs = BIT_VECTOR_LONG_STORAGE (sizei);
-  size_t sizem = STRETCHY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, num_longs);
-  Lisp_Bit_Vector *p = (Lisp_Bit_Vector *) allocate_lisp_storage (sizem);
+  size_t sizem = sizeof (struct Lisp_Bit_Vector) +
+    /* -1 because struct Lisp_Bit_Vector includes 1 slot */
+    sizeof (long) * (BIT_VECTOR_LONG_STORAGE (sizei) - 1);
+  struct Lisp_Bit_Vector *p =
+    (struct Lisp_Bit_Vector *) allocate_lisp_storage (sizem);
   set_lheader_implementation (&(p->lheader), lrecord_bit_vector);
 
   INCREMENT_CONS_COUNTER (sizem, "bit-vector");
 
   bit_vector_length (p) = sizei;
-  bit_vector_next   (p) = all_bit_vectors;
+  bit_vector_next (p) = all_bit_vectors;
   /* make sure the extra bits in the last long are 0; the calling
      functions might not set them. */
-  p->bits[num_longs - 1] = 0;
+  p->bits[BIT_VECTOR_LONG_STORAGE (sizei) - 1] = 0;
   XSETBIT_VECTOR (all_bit_vectors, p);
   return p;
 }
 
 Lisp_Object
-make_bit_vector (size_t length, Lisp_Object init)
+make_bit_vector (EMACS_INT length, Lisp_Object init)
 {
-  struct Lisp_Bit_Vector *p = make_bit_vector_internal (length);
-  size_t num_longs = BIT_VECTOR_LONG_STORAGE (length);
+  Lisp_Object bit_vector;
+  struct Lisp_Bit_Vector *p;
+  EMACS_INT num_longs;
 
   CHECK_BIT (init);
 
+  num_longs = BIT_VECTOR_LONG_STORAGE (length);
+  p = make_bit_vector_internal (length);
+  XSETBIT_VECTOR (bit_vector, p);
+
   if (ZEROP (init))
     memset (p->bits, 0, num_longs * sizeof (long));
   else
     {
-      size_t bits_in_last = length & (LONGBITS_POWER_OF_2 - 1);
+      EMACS_INT bits_in_last = length & (LONGBITS_POWER_OF_2 - 1);
       memset (p->bits, ~0, num_longs * sizeof (long));
       /* But we have to make sure that the unused bits in the
-        last long are 0, so that equal/hash is easy. */
+        last integer are 0, so that equal/hash is easy. */
       if (bits_in_last)
        p->bits[num_longs - 1] &= (1 << bits_in_last) - 1;
     }
 
-  {
-    Lisp_Object bit_vector;
-    XSETBIT_VECTOR (bit_vector, p);
-    return bit_vector;
-  }
+  return bit_vector;
 }
 
 Lisp_Object
-make_bit_vector_from_byte_vector (unsigned char *bytevec, size_t length)
+make_bit_vector_from_byte_vector (unsigned char *bytevec, EMACS_INT length)
 {
+  Lisp_Object bit_vector;
+  struct Lisp_Bit_Vector *p;
   int i;
-  Lisp_Bit_Vector *p = make_bit_vector_internal (length);
+
+  if (length < 0)
+    length = XINT (wrong_type_argument (Qnatnump, make_int (length)));
+
+  p = make_bit_vector_internal (length);
+  XSETBIT_VECTOR (bit_vector, p);
 
   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 bit_vector;
 }
 
 DEFUN ("make-bit-vector", Fmake_bit_vector, 2, 2, 0, /*
@@ -1607,95 +1621,93 @@ Any number of arguments, even zero arguments, are allowed.
 */
        (int nargs, Lisp_Object *args))
 {
-  int i;
-  Lisp_Bit_Vector *p = make_bit_vector_internal (nargs);
+  Lisp_Object bit_vector;
+  int elt;
+  struct Lisp_Bit_Vector *p;
 
-  for (i = 0; i < nargs; i++)
-    {
-      CHECK_BIT (args[i]);
-      set_bit_vector_bit (p, i, !ZEROP (args[i]));
-    }
+  for (elt = 0; elt < nargs; elt++)
+    CHECK_BIT (args[elt]);
 
-  {
-    Lisp_Object bit_vector;
-    XSETBIT_VECTOR (bit_vector, p);
-    return bit_vector;
-  }
+  p = make_bit_vector_internal (nargs);
+
+  for (elt = 0; elt < nargs; elt++)
+    set_bit_vector_bit (p, elt, !ZEROP (args[elt]));
+
+  XSETBIT_VECTOR (bit_vector, p);
+  return bit_vector;
 }
 
 \f
-/************************************************************************/
-/*                  Compiled-function allocation                       */
-/************************************************************************/
+/**********************************************************************/
+/*                   Compiled-function allocation                     */
+/**********************************************************************/
 
-DECLARE_FIXED_TYPE_ALLOC (compiled_function, Lisp_Compiled_Function);
+DECLARE_FIXED_TYPE_ALLOC (compiled_function, struct Lisp_Compiled_Function);
 #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_compiled_function 1000
 
 static Lisp_Object
 make_compiled_function (int make_pure)
 {
-  Lisp_Compiled_Function *f;
-  Lisp_Object fun;
-  size_t size = sizeof (Lisp_Compiled_Function);
+  struct Lisp_Compiled_Function *b;
+  Lisp_Object new;
+  size_t size = sizeof (struct Lisp_Compiled_Function);
 
   if (make_pure && check_purespace (size))
     {
-      f = (Lisp_Compiled_Function *) (PUREBEG + pure_bytes_used);
-      set_lheader_implementation (&(f->lheader), lrecord_compiled_function);
+      b = (struct Lisp_Compiled_Function *) (PUREBEG + pure_bytes_used);
+      set_lheader_implementation (&(b->lheader), lrecord_compiled_function);
 #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
-      f->lheader.pure = 1;
+      b->lheader.pure = 1;
 #endif
       pure_bytes_used += size;
-      bump_purestat (&purestat_function, size);
+      bump_purestat (&purestat_bytecode, size);
     }
   else
     {
-      ALLOCATE_FIXED_TYPE (compiled_function, Lisp_Compiled_Function, f);
-      set_lheader_implementation (&(f->lheader), lrecord_compiled_function);
+      ALLOCATE_FIXED_TYPE (compiled_function, struct Lisp_Compiled_Function,
+                          b);
+      set_lheader_implementation (&(b->lheader), lrecord_compiled_function);
     }
-  f->stack_depth = 0;
-  f->specpdl_depth = 0;
-  f->flags.documentationp = 0;
-  f->flags.interactivep = 0;
-  f->flags.domainp = 0; /* I18N3 */
-  f->instructions = Qzero;
-  f->constants = Qzero;
-  f->arglist = Qnil;
-  f->doc_and_interactive = Qnil;
+  b->maxdepth = 0;
+  b->flags.documentationp = 0;
+  b->flags.interactivep = 0;
+  b->flags.domainp = 0; /* I18N3 */
+  b->bytecodes = Qzero;
+  b->constants = Qzero;
+  b->arglist = Qnil;
+  b->doc_and_interactive = Qnil;
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  f->annotated = Qnil;
+  b->annotated = Qnil;
 #endif
-  XSETCOMPILED_FUNCTION (fun, f);
-  return fun;
+  XSETCOMPILED_FUNCTION (new, b);
+  return new;
 }
 
 DEFUN ("make-byte-code", Fmake_byte_code, 4, MANY, 0, /*
 Return a new compiled-function object.
-Usage: (arglist instructions constants stack-depth
-       &optional doc-string interactive)
+Usage: (arglist instructions constants stack-size
+       &optional doc-string interactive-spec)
 Note that, unlike all other emacs-lisp functions, calling this with five
 arguments is NOT the same as calling it with six arguments, the last of
 which is nil.  If the INTERACTIVE arg is specified as nil, then that means
 that this function was defined with `(interactive)'.  If the arg is not
 specified, then that means the function is not interactive.
 This is terrible behavior which is retained for compatibility with old
-`.elc' files which expect these semantics.
+`.elc' files which expected these semantics.
 */
        (int nargs, Lisp_Object *args))
 {
-/* In a non-insane world this function would have this arglist...
-   (arglist instructions constants stack_depth &optional doc_string interactive)
+/*   In a non-insane world this function would have this arglist...
+     (arglist, instructions, constants, stack_size, doc_string, interactive)
+     Lisp_Object arglist, instructions, constants, stack_size, doc_string,
+       interactive;
  */
-  Lisp_Object fun = make_compiled_function (purify_flag);
-  Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
-
   Lisp_Object arglist      = args[0];
   Lisp_Object instructions = args[1];
   Lisp_Object constants    = args[2];
-  Lisp_Object stack_depth  = args[3];
+  Lisp_Object stack_size   = args[3];
   Lisp_Object doc_string   = (nargs > 4) ? args[4] : Qnil;
   Lisp_Object interactive  = (nargs > 5) ? args[5] : Qunbound;
-
   /* Don't purecopy the doc references in instructions because it's
      wasteful; they will get fixed up later.
 
@@ -1706,140 +1718,143 @@ This is terrible behavior which is retained for compatibility with old
      Note: there will be a window after the byte code is created and
      before the doc references are fixed up in which there will be
      impure objects inside a pure object, which apparently won't
-     get marked, leading to trouble.  But during that entire window,
+     get marked, leading the trouble.  But during that entire window,
      the objects are sitting on Vload_force_doc_string_list, which
      is staticpro'd, so we're OK. */
-  Lisp_Object (*cons) (Lisp_Object, Lisp_Object)
-    = purify_flag ? pure_cons : Fcons;
+  int purecopy_instructions = 1;
 
-  if (nargs < 4 || nargs > 6)
+  if (nargs > 6)
     return Fsignal (Qwrong_number_of_arguments,
                    list2 (intern ("make-byte-code"), make_int (nargs)));
 
-  /* Check for valid formal parameter list now, to allow us to use
-     SPECBIND_FAST_UNSAFE() later in funcall_compiled_function(). */
-  {
-    Lisp_Object symbol, tail;
-    EXTERNAL_LIST_LOOP_3 (symbol, arglist, tail)
-      {
-       CHECK_SYMBOL (symbol);
-       if (EQ (symbol, Qt)   ||
-           EQ (symbol, Qnil) ||
-           SYMBOL_IS_KEYWORD (symbol))
-         signal_simple_error_2
-           ("Invalid constant symbol in formal parameter list",
-            symbol, arglist);
-      }
-  }
-  f->arglist = arglist;
-
-  /* `instructions' is a string or a cons (string . int) for a
+  CHECK_LIST (arglist);
+  /* instructions is a string or a cons (string . int) for a
      lazy-loaded function. */
   if (CONSP (instructions))
     {
       CHECK_STRING (XCAR (instructions));
       CHECK_INT (XCDR (instructions));
+      if (!NILP (constants))
+       CHECK_VECTOR (constants);
+      purecopy_instructions = 0;
     }
   else
     {
       CHECK_STRING (instructions);
+      CHECK_VECTOR (constants);
     }
-  f->instructions = instructions;
-
-  if (!NILP (constants))
-    CHECK_VECTOR (constants);
-  f->constants = constants;
+  CHECK_NATNUM (stack_size);
+  /* doc_string may be nil, string, int, or a cons (string . int). */
 
-  CHECK_NATNUM (stack_depth);
-  f->stack_depth  = XINT (stack_depth);
-
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  if (!NILP (Vcurrent_compiled_function_annotation))
-    f->annotated = Fpurecopy (Vcurrent_compiled_function_annotation);
-  else if (!NILP (Vload_file_name_internal_the_purecopy))
-    f->annotated = Vload_file_name_internal_the_purecopy;
-  else if (!NILP (Vload_file_name_internal))
-    {
-      struct gcpro gcpro1;
-      GCPRO1 (fun);            /* don't let fun get reaped */
-      Vload_file_name_internal_the_purecopy =
-       Fpurecopy (Ffile_name_nondirectory (Vload_file_name_internal));
-      f->annotated = Vload_file_name_internal_the_purecopy;
-      UNGCPRO;
-    }
-#endif /* COMPILED_FUNCTION_ANNOTATION_HACK */
-
-  /* doc_string may be nil, string, int, or a cons (string . int).
-     interactive may be list or string (or unbound). */
-  f->doc_and_interactive = Qunbound;
-#ifdef I18N3
-  if ((f->flags.domainp = !NILP (Vfile_domain)) != 0)
-    f->doc_and_interactive = Vfile_domain;
-#endif
-  if ((f->flags.interactivep = !UNBOUNDP (interactive)) != 0)
-    {
-      if (purify_flag)
-       {
-         interactive = Fpurecopy (interactive);
-         if (STRINGP (interactive))
-           bump_purestat (&purestat_string_interactive,
-                          pure_sizeof (interactive));
-       }
-      f->doc_and_interactive
-       = (UNBOUNDP (f->doc_and_interactive) ? interactive :
-          cons (interactive, f->doc_and_interactive));
-    }
-  if ((f->flags.documentationp = !NILP (doc_string)) != 0)
-    {
-      if (purify_flag)
-       {
-         doc_string = Fpurecopy (doc_string);
-         if (STRINGP (doc_string))
-           /* These should have been snagged by make-docfile... */
-           bump_purestat (&purestat_string_documentation,
-                          pure_sizeof (doc_string));
-       }
-      f->doc_and_interactive
-       = (UNBOUNDP (f->doc_and_interactive) ? doc_string :
-          cons (doc_string, f->doc_and_interactive));
-    }
-  if (UNBOUNDP (f->doc_and_interactive))
-    f->doc_and_interactive = Qnil;
+  /* interactive may be list or string (or unbound). */
 
   if (purify_flag)
     {
-
-      if (!purified (f->arglist))
-       f->arglist = Fpurecopy (f->arglist);
+      if (!purified (arglist))
+       arglist = Fpurecopy (arglist);
+      if (purecopy_instructions && !purified (instructions))
+       instructions = Fpurecopy (instructions);
+      if (!purified (doc_string))
+       doc_string = Fpurecopy (doc_string);
+      if (!purified (interactive) && !UNBOUNDP (interactive))
+       interactive = Fpurecopy (interactive);
 
       /* Statistics are kept differently for the constants */
-      if (!purified (f->constants))
-       {
+      if (!purified (constants))
 #ifdef PURESTAT
-         int old = purecopying_function_constants;
-         purecopying_function_constants = 1;
-         f->constants = Fpurecopy (f->constants);
-         bump_purestat (&purestat_vector_constants,
-                        pure_sizeof (f->constants));
-         purecopying_function_constants = old;
+       {
+         int old = purecopying_for_bytecode;
+         purecopying_for_bytecode = 1;
+         constants = Fpurecopy (constants);
+         purecopying_for_bytecode = old;
+       }
 #else
-         f->constants = Fpurecopy (f->constants);
+        constants = Fpurecopy (constants);
 #endif /* PURESTAT */
-       }
 
-      optimize_compiled_function (fun);
-
-      bump_purestat (&purestat_opaque_instructions,
-                    pure_sizeof (f->instructions));
+#ifdef PURESTAT
+      if (STRINGP (instructions))
+       bump_purestat (&purestat_string_bytecodes, pure_sizeof (instructions));
+      if (VECTORP (constants))
+       bump_purestat (&purestat_vector_bytecode_constants,
+                      pure_sizeof (constants));
+      if (STRINGP (doc_string))
+       /* These should be have been snagged by make-docfile... */
+       bump_purestat (&purestat_string_documentation,
+                      pure_sizeof (doc_string));
+      if (STRINGP (interactive))
+       bump_purestat (&purestat_string_interactive,
+                      pure_sizeof (interactive));
+#endif /* PURESTAT */
     }
 
-  return fun;
+  {
+    int docp = !NILP (doc_string);
+    int intp = !UNBOUNDP (interactive);
+#ifdef I18N3
+    int domp = !NILP (Vfile_domain);
+#endif
+    Lisp_Object val = make_compiled_function (purify_flag);
+    struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (val);
+    b->flags.documentationp = docp;
+    b->flags.interactivep   = intp;
+#ifdef I18N3
+    b->flags.domainp        = domp;
+#endif
+    b->maxdepth  = XINT (stack_size);
+    b->bytecodes = instructions;
+    b->constants = constants;
+    b->arglist   = arglist;
+#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
+    if (!NILP (Vcurrent_compiled_function_annotation))
+      b->annotated = Fpurecopy (Vcurrent_compiled_function_annotation);
+    else if (!NILP (Vload_file_name_internal_the_purecopy))
+      b->annotated = Vload_file_name_internal_the_purecopy;
+    else if (!NILP (Vload_file_name_internal))
+      {
+       struct gcpro gcpro1;
+       GCPRO1(val);            /* don't let val or b get reaped */
+       Vload_file_name_internal_the_purecopy =
+         Fpurecopy (Ffile_name_nondirectory (Vload_file_name_internal));
+       b->annotated = Vload_file_name_internal_the_purecopy;
+       UNGCPRO;
+      }
+#endif /* COMPILED_FUNCTION_ANNOTATION_HACK */
+
+#ifdef I18N3
+    if (docp && intp && domp)
+      b->doc_and_interactive = (((purify_flag) ? pure_cons : Fcons)
+                               (doc_string,
+                                (((purify_flag) ? pure_cons : Fcons)
+                                 (interactive, Vfile_domain))));
+    else if (docp && domp)
+      b->doc_and_interactive = (((purify_flag) ? pure_cons : Fcons)
+                               (doc_string, Vfile_domain));
+    else if (intp && domp)
+      b->doc_and_interactive = (((purify_flag) ? pure_cons : Fcons)
+                               (interactive, Vfile_domain));
+    else
+#endif
+    if (docp && intp)
+      b->doc_and_interactive = (((purify_flag) ? pure_cons : Fcons)
+                               (doc_string, interactive));
+    else if (intp)
+      b->doc_and_interactive = interactive;
+#ifdef I18N3
+    else if (domp)
+      b->doc_and_interactive = Vfile_domain;
+#endif
+    else
+      b->doc_and_interactive = doc_string;
+
+    return val;
+  }
 }
 
 \f
-/************************************************************************/
-/*                         Symbol allocation                           */
-/************************************************************************/
+/**********************************************************************/
+/*                          Symbol allocation                         */
+/**********************************************************************/
 
 DECLARE_FIXED_TYPE_ALLOC (symbol, struct Lisp_Symbol);
 #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_symbol 1000
@@ -1848,31 +1863,31 @@ DEFUN ("make-symbol", Fmake_symbol, 1, 1, 0, /*
 Return a newly allocated uninterned symbol whose name is NAME.
 Its value and function definition are void, and its property list is nil.
 */
-       (name))
+       (str))
 {
   Lisp_Object val;
   struct Lisp_Symbol *p;
 
-  CHECK_STRING (name);
+  CHECK_STRING (str);
 
   ALLOCATE_FIXED_TYPE (symbol, struct Lisp_Symbol, p);
 #ifdef LRECORD_SYMBOL
   set_lheader_implementation (&(p->lheader), lrecord_symbol);
 #endif
-  p->name     = XSTRING (name);
-  p->plist    = Qnil;
-  p->value    = Qunbound;
+  p->name = XSTRING (str);
+  p->plist = Qnil;
+  p->value = Qunbound;
   p->function = Qunbound;
-  p->obarray  = Qnil;
+  p->obarray = Qnil;
   symbol_next (p) = 0;
   XSETSYMBOL (val, p);
   return val;
 }
 
 \f
-/************************************************************************/
-/*                        Extent allocation                            */
-/************************************************************************/
+/**********************************************************************/
+/*                         Extent allocation                          */
+/**********************************************************************/
 
 DECLARE_FIXED_TYPE_ALLOC (extent, struct extent);
 #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_extent 1000
@@ -1883,6 +1898,7 @@ allocate_extent (void)
   struct extent *e;
 
   ALLOCATE_FIXED_TYPE (extent, struct extent, e);
+  /* xzero (*e); */
   set_lheader_implementation (&(e->lheader), lrecord_extent);
   extent_object (e) = Qnil;
   set_extent_start (e, -1);
@@ -1899,9 +1915,9 @@ allocate_extent (void)
 }
 
 \f
-/************************************************************************/
-/*                        Event allocation                             */
-/************************************************************************/
+/**********************************************************************/
+/*                         Event allocation                           */
+/**********************************************************************/
 
 DECLARE_FIXED_TYPE_ALLOC (event, struct Lisp_Event);
 #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_event 1000
@@ -1920,9 +1936,9 @@ allocate_event (void)
 }
 
 \f
-/************************************************************************/
-/*                      Marker allocation                              */
-/************************************************************************/
+/**********************************************************************/
+/*                       Marker allocation                            */
+/**********************************************************************/
 
 DECLARE_FIXED_TYPE_ALLOC (marker, struct Lisp_Marker);
 #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_marker 1000
@@ -1964,9 +1980,9 @@ noseeum_make_marker (void)
 }
 
 \f
-/************************************************************************/
-/*                       String allocation                             */
-/************************************************************************/
+/**********************************************************************/
+/*                        String allocation                           */
+/**********************************************************************/
 
 /* The data for "short" strings generally resides inside of structs of type
    string_chars_block. The Lisp_String structure is allocated just like any
@@ -1998,11 +2014,11 @@ mark_string (Lisp_Object obj, void (*markobj) (Lisp_Object))
 }
 
 static int
-string_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+string_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
   Bytecount len;
-  return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) &&
-         !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len));
+  return (((len = XSTRING_LENGTH (o1)) == XSTRING_LENGTH (o2)) &&
+         !memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len));
 }
 
 DEFINE_BASIC_LRECORD_IMPLEMENTATION ("string", string,
@@ -2102,13 +2118,13 @@ allocate_string_chars_struct (struct Lisp_String *string_it_goes_with,
   else
     {
       /* Make a new current string chars block */
-      struct string_chars_block *new_scb = xnew (struct string_chars_block);
+      struct string_chars_block *new = xnew (struct string_chars_block);
 
-      current_string_chars_block->next = new_scb;
-      new_scb->prev = current_string_chars_block;
-      new_scb->next = 0;
-      current_string_chars_block = new_scb;
-      new_scb->pos = fullsize;
+      current_string_chars_block->next = new;
+      new->prev = current_string_chars_block;
+      new->next = 0;
+      current_string_chars_block = new;
+      new->pos = fullsize;
       s_chars = (struct string_chars *)
        current_string_chars_block->string_chars;
     }
@@ -2296,10 +2312,12 @@ resize_string (struct Lisp_String *s, Bytecount pos, Bytecount delta)
 void
 set_string_char (struct Lisp_String *s, Charcount i, Emchar c)
 {
+  Bytecount oldlen, newlen;
   Bufbyte newstr[MAX_EMCHAR_LEN];
   Bytecount bytoff = charcount_to_bytecount (string_data (s), i);
-  Bytecount oldlen = charcount_to_bytecount (string_data (s) + bytoff, 1);
-  Bytecount newlen = set_charptr_emchar (newstr, c);
+
+  oldlen = charcount_to_bytecount (string_data (s) + bytoff, 1);
+  newlen = set_charptr_emchar (newstr, c);
 
   if (oldlen != newlen)
     resize_string (s, bytoff, newlen - oldlen);
@@ -2315,35 +2333,30 @@ LENGTH must be an integer and INIT must be a character.
 */
        (length, init))
 {
+  Lisp_Object val;
+
   CHECK_NATNUM (length);
   CHECK_CHAR_COERCE_INT (init);
   {
-    Bufbyte init_str[MAX_EMCHAR_LEN];
-    int len = set_charptr_emchar (init_str, XCHAR (init));
-    Lisp_Object val = make_uninit_string (len * XINT (length));
+    Bufbyte str[MAX_EMCHAR_LEN];
+    int len = set_charptr_emchar (str, XCHAR (init));
 
+    val = make_uninit_string (len * XINT (length));
     if (len == 1)
       /* Optimize the single-byte case */
       memset (XSTRING_DATA (val), XCHAR (init), XSTRING_LENGTH (val));
     else
       {
-       int i;
+       int i, j, k;
        Bufbyte *ptr = XSTRING_DATA (val);
 
-       for (i = XINT (length); i; i--)
-         {
-           Bufbyte *init_ptr = init_str;
-           switch (len)
-             {
-             case 4: *ptr++ = *init_ptr++;
-             case 3: *ptr++ = *init_ptr++;
-             case 2: *ptr++ = *init_ptr++;
-             case 1: *ptr++ = *init_ptr++;
-             }
-         }
+       k = 0;
+       for (i = 0; i < XINT (length); i++)
+         for (j = 0; j < len; j++)
+           ptr[k++] = str[j];
       }
-    return val;
   }
+  return val;
 }
 
 DEFUN ("string", Fstring, 0, MANY, 0, /*
@@ -2557,22 +2570,23 @@ free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord)
   /* Make sure the size is correct.  This will catch, for example,
      putting a window configuration on the wrong free list. */
   if (implementation->size_in_bytes_method)
-    assert (implementation->size_in_bytes_method (lheader) == list->size);
+    assert (((implementation->size_in_bytes_method) (lheader))
+           == list->size);
   else
     assert (implementation->static_size == list->size);
 #endif /* ERROR_CHECK_GC */
 
   if (implementation->finalizer)
-    implementation->finalizer (lheader, 0);
+    ((implementation->finalizer) (lheader, 0));
   free_header->chain = list->free;
   free_header->lcheader.free = 1;
   list->free = lcrecord;
 }
 
 \f
-/************************************************************************/
-/*                Purity of essence, peace on earth                    */
-/************************************************************************/
+/**********************************************************************/
+/*                 Purity of essence, peace on earth                  */
+/**********************************************************************/
 
 static int symbols_initialized;
 
@@ -2580,8 +2594,9 @@ Lisp_Object
 make_pure_string (CONST Bufbyte *data, Bytecount length,
                  Lisp_Object plist, int no_need_to_copy_data)
 {
-  Lisp_String *s;
-  size_t size = sizeof (Lisp_String) +
+  Lisp_Object new;
+  struct Lisp_String *s;
+  size_t size = sizeof (struct Lisp_String) +
     (no_need_to_copy_data ? 0 : (length + 1)); /* + 1 for terminating 0 */
   size = ALIGN_SIZE (size, ALIGNOF (Lisp_Object));
 
@@ -2593,19 +2608,15 @@ make_pure_string (CONST Bufbyte *data, Bytecount length,
        {
          s = XSYMBOL (tem)->name;
          if (!PURIFIED (s)) abort ();
-
-         {
-           Lisp_Object string;
-           XSETSTRING (string, s);
-           return string;
-         }
+         XSETSTRING (new, s);
+         return new;
        }
     }
 
   if (!check_purespace (size))
     return make_string (data, length);
 
-  s = (Lisp_String *) (PUREBEG + pure_bytes_used);
+  s = (struct Lisp_String *) (PUREBEG + pure_bytes_used);
 #ifdef LRECORD_STRING
   set_lheader_implementation (&(s->lheader), lrecord_string);
 #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
@@ -2619,7 +2630,7 @@ make_pure_string (CONST Bufbyte *data, Bytecount length,
     }
   else
     {
-      set_string_data (s, (Bufbyte *) s + sizeof (Lisp_String));
+      set_string_data (s, (Bufbyte *) s + sizeof (struct Lisp_String));
       memcpy (string_data (s), data, length);
       set_string_byte (s, length, 0);
     }
@@ -2628,18 +2639,15 @@ make_pure_string (CONST Bufbyte *data, Bytecount length,
 
 #ifdef PURESTAT
   bump_purestat (&purestat_string_all, size);
-  if (purecopying_function_constants)
+  if (purecopying_for_bytecode)
     bump_purestat (&purestat_string_other_function, size);
 #endif /* PURESTAT */
 
   /* Do this after the official "completion" of the purecopying. */
   s->plist = Fpurecopy (plist);
 
-  {
-    Lisp_Object string;
-    XSETSTRING (string, s);
-    return string;
-  }
+  XSETSTRING (new, s);
+  return new;
 }
 
 
@@ -2661,29 +2669,26 @@ make_pure_pname (CONST Bufbyte *data, Bytecount length,
 Lisp_Object
 pure_cons (Lisp_Object car, Lisp_Object cdr)
 {
-  Lisp_Cons *c;
+  Lisp_Object new;
+  struct Lisp_Cons *c;
 
-  if (!check_purespace (sizeof (Lisp_Cons)))
+  if (!check_purespace (sizeof (struct Lisp_Cons)))
     return Fcons (Fpurecopy (car), Fpurecopy (cdr));
 
-  c = (Lisp_Cons *) (PUREBEG + pure_bytes_used);
+  c = (struct Lisp_Cons *) (PUREBEG + pure_bytes_used);
 #ifdef LRECORD_CONS
   set_lheader_implementation (&(c->lheader), lrecord_cons);
 #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
   c->lheader.pure = 1;
 #endif
 #endif
-  pure_bytes_used += sizeof (Lisp_Cons);
-  bump_purestat (&purestat_cons, sizeof (Lisp_Cons));
+  pure_bytes_used += sizeof (struct Lisp_Cons);
+  bump_purestat (&purestat_cons, sizeof (struct Lisp_Cons));
 
   c->car = Fpurecopy (car);
   c->cdr = Fpurecopy (cdr);
-
-  {
-    Lisp_Object cons;
-    XSETCONS (cons, c);
-    return cons;
-  }
+  XSETCONS (new, c);
+  return new;
 }
 
 Lisp_Object
@@ -2752,15 +2757,17 @@ make_pure_float (double num)
 Lisp_Object
 make_pure_vector (size_t len, Lisp_Object init)
 {
-  Lisp_Vector *v;
-  size_t size = STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, len);
+  Lisp_Object new;
+  struct Lisp_Vector *v;
+  size_t size = (sizeof (struct Lisp_Vector)
+                + (len - 1) * sizeof (Lisp_Object));
 
   init = Fpurecopy (init);
 
   if (!check_purespace (size))
     return make_vector (len, init);
 
-  v = (Lisp_Vector *) (PUREBEG + pure_bytes_used);
+  v = (struct Lisp_Vector *) (PUREBEG + pure_bytes_used);
 #ifdef LRECORD_VECTOR
   set_lheader_implementation (&(v->header.lheader), lrecord_vector);
 #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
@@ -2775,11 +2782,8 @@ make_pure_vector (size_t len, Lisp_Object init)
   for (size = 0; size < len; size++)
     v->contents[size] = init;
 
-  {
-    Lisp_Object vector;
-    XSETVECTOR (vector, v);
-    return vector;
-  }
+  XSETVECTOR (new, v);
+  return new;
 }
 
 #if 0
@@ -2807,107 +2811,115 @@ Does not copy symbols.
 */
        (obj))
 {
+  int i;
   if (!purify_flag)
+    return obj;
+
+  if (!POINTER_TYPE_P (XTYPE (obj))
+      || PURIFIED (XPNTR (obj))
+      /* happens when bootstrapping Qnil */
+      || EQ (obj, Qnull_pointer))
+    return obj;
+
+  switch (XTYPE (obj))
     {
-      return obj;
-    }
-  else if (!POINTER_TYPE_P (XTYPE (obj))
-          || PURIFIED (XPNTR (obj))
-          /* happens when bootstrapping Qnil */
-          || EQ (obj, Qnull_pointer))
-    {
-      return obj;
-    }
-  /* Order of subsequent tests determined via profiling. */
-  else if (SYMBOLP (obj))
-    {
-      /* Symbols can't be made pure (and thus read-only), because
-        assigning to their function, value or plist slots would
-        produced a SEGV in the dumped XEmacs.  So we previously would
-        just return the symbol unchanged.
-
-        But purified aggregate objects like lists and vectors can
-        contain uninterned symbols.  If there are no other non-pure
-        references to the symbol, then the symbol is not protected
-        from garbage collection because the collector does not mark
-        the contents of purified objects.  So to protect the symbols,
-        an impure reference has to be kept for each uninterned symbol
-        that is referenced by a pure object.  All such symbols are
-        stored in the hash table pointed to by
-        Vpure_uninterned_symbol_table, which is itself
-        staticpro'd. */
-      if (NILP (XSYMBOL (obj)->obarray))
-       Fputhash (obj, Qnil, Vpure_uninterned_symbol_table);
-      return obj;
-    }
-  else if (CONSP (obj))
-    {
+#ifndef LRECORD_CONS
+    case Lisp_Type_Cons:
       return pure_cons (XCAR (obj), XCDR (obj));
-    }
-  else if (STRINGP (obj))
-    {
+#endif
+
+#ifndef LRECORD_STRING
+    case Lisp_Type_String:
       return make_pure_string (XSTRING_DATA (obj),
                               XSTRING_LENGTH (obj),
                               XSTRING (obj)->plist,
-                              0);
-    }
-  else if (VECTORP (obj))
-    {
-      int i;
-      Lisp_Vector *o = XVECTOR (obj);
-      Lisp_Object pure_obj = make_pure_vector (vector_length (o), Qnil);
-      for (i = 0; i < vector_length (o); i++)
-       XVECTOR_DATA (pure_obj)[i] = Fpurecopy (o->contents[i]);
-      return pure_obj;
-    }
-#ifdef LISP_FLOAT_TYPE
-  else if (FLOATP (obj))
-    {
-      return make_pure_float (XFLOAT_DATA (obj));
-    }
-#endif
-  else if (COMPILED_FUNCTIONP (obj))
-    {
-      Lisp_Object pure_obj = make_compiled_function (1);
-      Lisp_Compiled_Function *o = XCOMPILED_FUNCTION (obj);
-      Lisp_Compiled_Function *n = XCOMPILED_FUNCTION (pure_obj);
-      n->flags                = o->flags;
-      n->instructions         = o->instructions;
-      n->constants            = Fpurecopy (o->constants);
-      n->arglist              = Fpurecopy (o->arglist);
-      n->doc_and_interactive   = Fpurecopy (o->doc_and_interactive);
-      n->stack_depth          = o->stack_depth;
-      optimize_compiled_function (pure_obj);
-      return pure_obj;
-    }
-  else if (OPAQUEP (obj))
-    {
-      Lisp_Object pure_obj;
-      Lisp_Opaque *old_opaque = XOPAQUE (obj);
-      Lisp_Opaque *new_opaque = (Lisp_Opaque *) (PUREBEG + pure_bytes_used);
-      struct lrecord_header *lheader = XRECORD_LHEADER (obj);
-      CONST struct lrecord_implementation *implementation
-       = LHEADER_IMPLEMENTATION (lheader);
-      size_t size = implementation->size_in_bytes_method (lheader);
-      size_t pure_size = ALIGN_SIZE (size, ALIGNOF (Lisp_Object));
-      if (!check_purespace (pure_size))
-       return obj;
-      pure_bytes_used += pure_size;
+                               0);
+#endif /* ! LRECORD_STRING */
 
-      memcpy (new_opaque, old_opaque, size);
-#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
-      lheader->pure = 1;
-#endif
-      new_opaque->header.next = 0;
+#ifndef LRECORD_VECTOR
+    case Lisp_Type_Vector:
+      {
+        struct Lisp_Vector *o = XVECTOR (obj);
+        Lisp_Object new = make_pure_vector (vector_length (o), Qnil);
+        for (i = 0; i < vector_length (o); i++)
+         XVECTOR_DATA (new)[i] = Fpurecopy (o->contents[i]);
+        return new;
+      }
+#endif /* !LRECORD_VECTOR */
 
-      XSETOPAQUE (pure_obj, new_opaque);
-      return pure_obj;
-    }
-  else
-    {
-      signal_simple_error ("Can't purecopy %S", obj);
+    default:
+      {
+        if (COMPILED_FUNCTIONP (obj))
+          {
+            struct Lisp_Compiled_Function *o = XCOMPILED_FUNCTION (obj);
+            Lisp_Object new = make_compiled_function (1);
+           /* How on earth could this code have worked before?  -sb */
+            struct Lisp_Compiled_Function *n = XCOMPILED_FUNCTION (new);
+            n->flags = o->flags;
+            n->bytecodes = Fpurecopy (o->bytecodes);
+            n->constants = Fpurecopy (o->constants);
+            n->arglist = Fpurecopy (o->arglist);
+            n->doc_and_interactive = Fpurecopy (o->doc_and_interactive);
+           n->maxdepth = o->maxdepth;
+            return new;
+          }
+#ifdef LRECORD_CONS
+      else if (CONSP (obj))
+       return pure_cons (XCAR (obj), XCDR (obj));
+#endif /* LRECORD_CONS */
+#ifdef LRECORD_VECTOR
+      else if (VECTORP (obj))
+       {
+         struct Lisp_Vector *o = XVECTOR (obj);
+         Lisp_Object new = make_pure_vector (vector_length (o), Qnil);
+         for (i = 0; i < vector_length (o); i++)
+           XVECTOR_DATA (new)[i] = Fpurecopy (o->contents[i]);
+         return new;
+       }
+#endif /* LRECORD_VECTOR */
+#ifdef LRECORD_STRING
+      else if (STRINGP (obj))
+       {
+         return make_pure_string (XSTRING_DATA (obj),
+                                  XSTRING_LENGTH (obj),
+                                  XSTRING (obj)->plist,
+                                  0);
+       }
+#endif /* LRECORD_STRING */
+#ifdef LISP_FLOAT_TYPE
+        else if (FLOATP (obj))
+          return make_pure_float (float_data (XFLOAT (obj)));
+#endif /* LISP_FLOAT_TYPE */
+       else if (SYMBOLP (obj))
+         {
+           /*
+            * Symbols can't be made pure (and thus read-only),
+            * because assigning to their function, value or plist
+            * slots would produced a SEGV in the dumped XEmacs.  So
+            * we previously would just return the symbol unchanged.
+            *
+            * But purified aggregate objects like lists and vectors
+            * can contain uninterned symbols.  If there are no
+            * other non-pure references to the symbol, then the
+            * symbol is not protected from garbage collection
+            * because the collector does not mark the contents of
+            * purified objects.  So to protect the symbols, an impure
+            * reference has to be kept for each uninterned symbol
+            * that is referenced by a pure object.  All such
+            * symbols are stored in the hashtable pointed to by
+            * Vpure_uninterned_symbol_table, which is itself
+            * staticpro'd.
+            */
+           if (!NILP (XSYMBOL (obj)->obarray))
+             return obj;
+           Fputhash (obj, Qnil, Vpure_uninterned_symbol_table);
+           return obj;
+         }
+       else
+          signal_simple_error ("Can't purecopy %S", obj);
+      }
     }
-  return obj; /* Unreached */
+  return obj;
 }
 
 
@@ -2985,14 +2997,15 @@ report_pure_usage (int report_impurities,
 
   purestat_vector_other.nbytes =
     purestat_vector_all.nbytes -
-    purestat_vector_constants.nbytes;
+    purestat_vector_bytecode_constants.nbytes;
   purestat_vector_other.nobjects =
     purestat_vector_all.nobjects -
-    purestat_vector_constants.nobjects;
+    purestat_vector_bytecode_constants.nobjects;
 
   purestat_string_other.nbytes =
     purestat_string_all.nbytes -
     (purestat_string_pname.nbytes +
+     purestat_string_bytecodes.nbytes +
      purestat_string_interactive.nbytes +
      purestat_string_documentation.nbytes +
 #ifdef I18N3
@@ -3003,6 +3016,7 @@ report_pure_usage (int report_impurities,
   purestat_string_other.nobjects =
     purestat_string_all.nobjects -
     (purestat_string_pname.nobjects +
+     purestat_string_bytecodes.nobjects +
      purestat_string_interactive.nobjects +
      purestat_string_documentation.nobjects +
 #ifdef I18N3
@@ -3010,53 +3024,59 @@ report_pure_usage (int report_impurities,
 #endif
      purestat_string_other_function.nobjects);
 
-  message ("   %-34s Objects    Bytes", "");
+  message ("   %-26s Total    Bytes", "");
 
-  print_purestat (&purestat_cons);
-  print_purestat (&purestat_float);
-  print_purestat (&purestat_string_pname);
-  print_purestat (&purestat_function);
-  print_purestat (&purestat_opaque_instructions);
-  print_purestat (&purestat_vector_constants);
-  print_purestat (&purestat_string_interactive);
-#ifdef I18N3
-  print_purestat (&purestat_string_domain);
-#endif
-  print_purestat (&purestat_string_documentation);
-  print_purestat (&purestat_string_other_function);
-  print_purestat (&purestat_vector_other);
-  print_purestat (&purestat_string_other);
-  print_purestat (&purestat_string_all);
-  print_purestat (&purestat_vector_all);
+  {
+    int j;
 
+    for (j = 0; j < countof (purestats); j++)
+      if (!purestats[j])
+        clear_message ();
+      else
+       {
+         char buf [100];
+         sprintf(buf, "%s:", purestats[j]->name);
+         message ("   %-26s %5d  %7d  %2d%%",
+                  buf,
+                  purestats[j]->nobjects,
+                  purestats[j]->nbytes,
+                  (int) (purestats[j]->nbytes / (pure_bytes_used / 100.0) + 0.5));
+       }
+  }
 #endif /* PURESTAT */
 
 
   if (report_impurities)
     {
-      Lisp_Object plist;
+      Lisp_Object tem = Felt (Fgarbage_collect (), make_int (5));
       struct gcpro gcpro1;
-      plist = XCAR (XCDR (XCDR (XCDR (XCDR (XCDR (Fgarbage_collect()))))));
-      GCPRO1 (plist);
+      GCPRO1 (tem);
       message ("\nImpurities:");
-      for (; CONSP (plist); plist = XCDR (XCDR (plist)))
+      while (!NILP (tem))
        {
-         Lisp_Object symbol = XCAR (plist);
-         int size = XINT (XCAR (XCDR (plist)));
-         if (size > 0)
+         if (CONSP (tem) && SYMBOLP (Fcar (tem)) && CONSP (Fcdr (tem)))
            {
-             char buf [100];
-             char *s = buf;
-             memcpy (buf,
-                     string_data   (XSYMBOL (symbol)->name),
-                     string_length (XSYMBOL (symbol)->name) + 1);
-             while (*s++) if (*s == '-') *s = ' ';
-             *(s-1) = ':'; *s = 0;
-             message ("   %-34s %6d", buf, size);
+             int total = XINT (Fcar (Fcdr (tem)));
+             if (total > 0)
+               {
+                 char buf [100];
+                 char *s = buf;
+                 memcpy (buf, string_data (XSYMBOL (Fcar (tem))->name),
+                         string_length (XSYMBOL (Fcar (tem))->name) + 1);
+                 while (*s++) if (*s == '-') *s = ' ';
+                 s--; *s++ = ':'; *s = 0;
+                 message ("   %-33s %6d", buf, total);
+               }
+             tem = Fcdr (Fcdr (tem));
+           }
+         else                  /* WTF?! */
+           {
+             Fprin1 (tem, Qexternal_debugging_output);
+             tem = Qnil;
            }
        }
       UNGCPRO;
-      garbage_collect_1 ();    /* collect Fgarbage_collect()'s garbage */
+      garbage_collect_1 ();         /* GC garbage_collect's garbage */
     }
   clear_message ();
 
@@ -3069,15 +3089,9 @@ report_pure_usage (int report_impurities,
 }
 
 \f
-/************************************************************************/
-/*                        Garbage Collection                           */
-/************************************************************************/
-
-/* This will be used more extensively In The Future */
-static int last_lrecord_type_index_assigned;
-
-CONST struct lrecord_implementation *lrecord_implementations_table[128];
-#define max_lrecord_type (countof (lrecord_implementations_table) - 1)
+/**********************************************************************/
+/*                            staticpro                               */
+/**********************************************************************/
 
 struct gcpro *gcprolist;
 
@@ -3115,27 +3129,23 @@ mark_object (Lisp_Object obj)
 {
  tail_recurse:
 
-#ifdef ERROR_CHECK_GC
-  assert (! (GC_EQ (obj, Qnull_pointer)));
-#endif
-  /* Checks we used to perform */
-  /* if (EQ (obj, Qnull_pointer)) return; */
-  /* if (!POINTER_TYPE_P (XGCTYPE (obj))) return; */
-  /* if (PURIFIED (XPNTR (obj))) return; */
-
+  if (EQ (obj, Qnull_pointer))
+    return;
+  if (!POINTER_TYPE_P (XGCTYPE (obj)))
+    return;
+  if (PURIFIED (XPNTR (obj)))
+    return;
   switch (XGCTYPE (obj))
     {
 #ifndef LRECORD_CONS
     case Lisp_Type_Cons:
       {
        struct Lisp_Cons *ptr = XCONS (obj);
-       if (PURIFIED (ptr))
-         break;
        if (CONS_MARKED_P (ptr))
          break;
        MARK_CONS (ptr);
        /* If the cdr is nil, tail-recurse on the car.  */
-       if (GC_NILP (ptr->cdr))
+       if (NILP (ptr->cdr))
          {
            obj = ptr->car;
          }
@@ -3149,28 +3159,24 @@ mark_object (Lisp_Object obj)
 #endif
 
     case Lisp_Type_Record:
+    /* case Lisp_Symbol_Value_Magic: */
       {
        struct lrecord_header *lheader = XRECORD_LHEADER (obj);
-#if defined (ERROR_CHECK_GC) && defined (USE_INDEXED_LRECORD_IMPLEMENTATION)
-       assert (lheader->type <= last_lrecord_type_index_assigned);
-#endif
-       if (PURIFIED (lheader))
-         return;
+       CONST struct lrecord_implementation *implementation
+         = LHEADER_IMPLEMENTATION (lheader);
 
        if (! MARKED_RECORD_HEADER_P (lheader) &&
            ! UNMARKABLE_RECORD_HEADER_P (lheader))
          {
-           CONST struct lrecord_implementation *implementation =
-             LHEADER_IMPLEMENTATION (lheader);
            MARK_RECORD_HEADER (lheader);
 #ifdef ERROR_CHECK_GC
            if (!implementation->basic_p)
              assert (! ((struct lcrecord_header *) lheader)->free);
 #endif
-           if (implementation->marker)
+           if (implementation->marker != 0)
              {
-               obj = implementation->marker (obj, mark_object);
-               if (!GC_NILP (obj)) goto tail_recurse;
+               obj = ((implementation->marker) (obj, mark_object));
+               if (!NILP (obj)) goto tail_recurse;
              }
          }
       }
@@ -3180,8 +3186,6 @@ mark_object (Lisp_Object obj)
     case Lisp_Type_String:
       {
        struct Lisp_String *ptr = XSTRING (obj);
-       if (PURIFIED (ptr))
-         return;
 
        if (!XMARKBIT (ptr->plist))
          {
@@ -3200,12 +3204,8 @@ mark_object (Lisp_Object obj)
     case Lisp_Type_Vector:
       {
        struct Lisp_Vector *ptr = XVECTOR (obj);
-       int len, i;
-
-       if (PURIFIED (ptr))
-         return;
-
-       len = vector_length (ptr);
+       int len = vector_length (ptr);
+       int i;
 
        if (len < 0)
          break;                /* Already marked */
@@ -3226,9 +3226,6 @@ mark_object (Lisp_Object obj)
       {
        struct Lisp_Symbol *sym = XSYMBOL (obj);
 
-       if (PURIFIED (sym))
-         return;
-
        while (!XMARKBIT (sym->plist))
          {
            XMARK (sym->plist);
@@ -3240,8 +3237,8 @@ mark_object (Lisp_Object obj)
               * Lisp_Object.  Fix it up and pass to mark_object.
               */
              Lisp_Object symname;
-             XSETSTRING (symname, sym->name);
-             mark_object (symname);
+             XSETSTRING(symname, sym->name);
+             mark_object(symname);
            }
            if (!symbol_next (sym))
              {
@@ -3256,15 +3253,8 @@ mark_object (Lisp_Object obj)
       break;
 #endif /* !LRECORD_SYMBOL */
 
-      /* Check for invalid Lisp_Object types */
-#if defined (ERROR_CHECK_GC) && ! defined (USE_MINIMAL_TAGBITS)
-    case Lisp_Type_Int:
-    case Lisp_Type_Char:
-      break;
     default:
-      abort();
-      break;
-#endif /* ERROR_CHECK_GC && ! USE_MINIMAL_TAGBITS */
+      abort ();
     }
 }
 
@@ -3294,6 +3284,15 @@ mark_conses_in_list (Lisp_Object obj)
 /* Simpler than mark-object, because pure structure can't
    have any circularities */
 
+#if 0 /* unused */
+static int idiot_c_doesnt_have_closures;
+static void
+idiot_c (Lisp_Object obj)
+{
+  idiot_c_doesnt_have_closures += pure_sizeof (obj, 1);
+}
+#endif /* unused */
+
 static size_t
 pure_string_sizeof (Lisp_Object obj)
 {
@@ -3313,40 +3312,120 @@ pure_string_sizeof (Lisp_Object obj)
     }
 }
 
+/* recurse arg isn't actually used */
 static size_t
-pure_sizeof (Lisp_Object obj)
+pure_sizeof (Lisp_Object obj /*, int recurse */)
 {
+  size_t total = 0;
+
+  /*tail_recurse: */
   if (!POINTER_TYPE_P (XTYPE (obj))
       || !PURIFIED (XPNTR (obj)))
-    return 0;
-  /* symbol sizes are accounted for separately */
-  else if (SYMBOLP (obj))
-    return 0;
-  else if (STRINGP (obj))
-    return pure_string_sizeof (obj);
-  else if (LRECORDP (obj))
+    return total;
+
+  /* symbol's sizes are accounted for separately */
+  if (SYMBOLP (obj))
+    return total;
+
+  switch (XTYPE (obj))
     {
-      struct lrecord_header *lheader = XRECORD_LHEADER (obj);
-      CONST struct lrecord_implementation *implementation
-       = LHEADER_IMPLEMENTATION (lheader);
 
-        return implementation->size_in_bytes_method
-         ? implementation->size_in_bytes_method (lheader)
-         : implementation->static_size;
-    }
+#ifndef LRECORD_STRING
+    case Lisp_Type_String:
+      total += pure_string_sizeof (obj);
+      break;
+#endif /* ! LRECORD_STRING */
+
 #ifndef LRECORD_VECTOR
-  else if (VECTORP (obj))
-    return STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, XVECTOR_LENGTH (obj));
+    case Lisp_Type_Vector:
+      {
+        struct Lisp_Vector *ptr = XVECTOR (obj);
+        int len = vector_length (ptr);
+
+        total += (sizeof (struct Lisp_Vector)
+                  + (len - 1) * sizeof (Lisp_Object));
+#if 0 /* unused */
+        if (!recurse)
+          break;
+        {
+          int i;
+         for (i = 0; i < len - 1; i++)
+           total += pure_sizeof (ptr->contents[i], 1);
+       }
+        if (len > 0)
+         {
+           obj = ptr->contents[len - 1];
+           goto tail_recurse;
+         }
+#endif /* unused */
+      }
+      break;
 #endif /* !LRECORD_VECTOR */
 
+    case Lisp_Type_Record:
+      {
+       struct lrecord_header *lheader = XRECORD_LHEADER (obj);
+       CONST struct lrecord_implementation *implementation
+         = LHEADER_IMPLEMENTATION (lheader);
+
+#ifdef LRECORD_STRING
+       if (STRINGP (obj))
+         total += pure_string_sizeof (obj);
+       else
+#endif
+        if (implementation->size_in_bytes_method)
+          total += ((implementation->size_in_bytes_method) (lheader));
+       else
+          total += implementation->static_size;
+
+#if 0 /* unused */
+        if (!recurse)
+          break;
+
+       if (implementation->marker != 0)
+         {
+           int old = idiot_c_doesnt_have_closures;
+
+           idiot_c_doesnt_have_closures = 0;
+           obj = ((implementation->marker) (obj, idiot_c));
+           total += idiot_c_doesnt_have_closures;
+           idiot_c_doesnt_have_closures = old;
+
+           if (!NILP (obj)) goto tail_recurse;
+         }
+#endif /* unused */
+      }
+      break;
+
 #ifndef LRECORD_CONS
-  else if (CONSP (obj))
-    return sizeof (struct Lisp_Cons);
-#endif /* !LRECORD_CONS */
-  else
-    /* Others can't be purified */
-    abort ();
-  return 0; /* unreached */
+    case Lisp_Type_Cons:
+      {
+        struct Lisp_Cons *ptr = XCONS (obj);
+        total += sizeof (*ptr);
+#if 0 /* unused */
+        if (!recurse)
+          break;
+       /* If the cdr is nil, tail-recurse on the car.  */
+       if (NILP (ptr->cdr))
+         {
+           obj = ptr->car;
+         }
+       else
+         {
+           total += pure_sizeof (ptr->car, 1);
+           obj = ptr->cdr;
+         }
+       goto tail_recurse;
+#endif /* unused */
+      }
+      break;
+#endif
+
+      /* Others can't be purified */
+    default:
+      abort ();
+    }
+  return total;
 }
 #endif /* PURESTAT */
 
@@ -3368,6 +3447,12 @@ static int gc_count_short_string_total_size;
 /* static int gc_count_total_records_used, gc_count_records_total_size; */
 
 \f
+/* This will be used more extensively In The Future */
+static int last_lrecord_type_index_assigned;
+
+CONST struct lrecord_implementation *lrecord_implementations_table[128];
+#define max_lrecord_type (countof (lrecord_implementations_table) - 1)
+
 int
 lrecord_type_index (CONST struct lrecord_implementation *implementation)
 {
@@ -3378,7 +3463,8 @@ lrecord_type_index (CONST struct lrecord_implementation *implementation)
   if (type_index < 0 || type_index > max_lrecord_type
       || lrecord_implementations_table[type_index] != implementation)
     {
-      assert (last_lrecord_type_index_assigned < max_lrecord_type);
+      if (last_lrecord_type_index_assigned == max_lrecord_type)
+        abort ();
       type_index = ++last_lrecord_type_index_assigned;
       lrecord_implementations_table[type_index] = implementation;
       *(implementation->lrecord_type_index) = type_index;
@@ -3397,6 +3483,21 @@ static struct
   int instances_on_free_list;
 } lcrecord_stats [countof (lrecord_implementations_table)];
 
+
+static void
+reset_lcrecord_stats (void)
+{
+  int i;
+  for (i = 0; i < countof (lcrecord_stats); i++)
+    {
+      lcrecord_stats[i].instances_in_use = 0;
+      lcrecord_stats[i].bytes_in_use = 0;
+      lcrecord_stats[i].instances_freed = 0;
+      lcrecord_stats[i].bytes_freed = 0;
+      lcrecord_stats[i].instances_on_free_list = 0;
+    }
+}
+
 static void
 tick_lcrecord_stats (CONST struct lrecord_header *h, int free_p)
 {
@@ -3412,7 +3513,7 @@ tick_lcrecord_stats (CONST struct lrecord_header *h, int free_p)
   else
     {
       size_t sz = (implementation->size_in_bytes_method
-                  ? implementation->size_in_bytes_method (h)
+                  ? ((implementation->size_in_bytes_method) (h))
                   : implementation->static_size);
 
       if (free_p)
@@ -3436,8 +3537,7 @@ sweep_lcrecords_1 (struct lcrecord_header **prev, int *used)
   struct lcrecord_header *header;
   int num_used = 0;
   /* int total_size = 0; */
-
-  xzero (lcrecord_stats); /* Reset all statistics to 0. */
+  reset_lcrecord_stats ();
 
   /* First go through and call all the finalize methods.
      Then go through and free the objects.  There used to
@@ -3455,7 +3555,7 @@ sweep_lcrecords_1 (struct lcrecord_header **prev, int *used)
       if (!MARKED_RECORD_HEADER_P (h) && ! (header->free))
        {
          if (LHEADER_IMPLEMENTATION (h)->finalizer)
-           LHEADER_IMPLEMENTATION (h)->finalizer (h, 0);
+           ((LHEADER_IMPLEMENTATION (h)->finalizer) (h, 0));
        }
     }
 
@@ -3466,7 +3566,7 @@ sweep_lcrecords_1 (struct lcrecord_header **prev, int *used)
        {
          UNMARK_RECORD_HEADER (h);
          num_used++;
-         /* total_size += n->implementation->size_in_bytes (h);*/
+         /* total_size += ((n->implementation->size_in_bytes) (h));*/
          prev = &(header->next);
          header = *prev;
          tick_lcrecord_stats (h, 0);
@@ -3498,16 +3598,16 @@ sweep_vectors_1 (Lisp_Object *prev,
 
   for (vector = *prev; VECTORP (vector); )
     {
-      Lisp_Vector *v = XVECTOR (vector);
+      struct Lisp_Vector *v = XVECTOR (vector);
       int len = v->size;
       if (len < 0)     /* marked */
        {
           len = - (len + 1);
          v->size = len;
          total_size += len;
-          total_storage +=
-           MALLOC_OVERHEAD +
-           STRETCHY_STRUCT_SIZEOF (Lisp_Vector, contents, len + 1);
+          total_storage += (MALLOC_OVERHEAD
+                            + sizeof (struct Lisp_Vector)
+                            + (len - 1 + 1) * sizeof (Lisp_Object));
          num_used++;
          prev = &(vector_next (v));
          vector = *prev;
@@ -3540,16 +3640,16 @@ sweep_bit_vectors_1 (Lisp_Object *prev,
      their implementation */
   for (bit_vector = *prev; !EQ (bit_vector, Qzero); )
     {
-      Lisp_Bit_Vector *v = XBIT_VECTOR (bit_vector);
+      struct Lisp_Bit_Vector *v = XBIT_VECTOR (bit_vector);
       int len = v->size;
       if (MARKED_RECORD_P (bit_vector))
        {
          UNMARK_RECORD_HEADER (&(v->lheader));
          total_size += len;
-          total_storage +=
-           MALLOC_OVERHEAD +
-           STRETCHY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits,
-                                   BIT_VECTOR_LONG_STORAGE (len));
+          total_storage += (MALLOC_OVERHEAD
+                            + sizeof (struct Lisp_Bit_Vector)
+                            + (BIT_VECTOR_LONG_STORAGE (len) - 1)
+                           * sizeof (long));
          num_used++;
          prev = &(bit_vector_next (v));
          bit_vector = *prev;
@@ -3574,41 +3674,41 @@ sweep_bit_vectors_1 (Lisp_Object *prev,
 
 #define SWEEP_FIXED_TYPE_BLOCK(typename, obj_type)                     \
 do {                                                                   \
-  struct typename##_block *SFTB_current;                               \
-  struct typename##_block **SFTB_prev;                                 \
-  int SFTB_limit;                                                      \
+  struct typename##_block *_frob_current;                              \
+  struct typename##_block **_frob_prev;                                        \
+  int _frob_limit;                                                     \
   int num_free = 0, num_used = 0;                                      \
                                                                        \
-  for (SFTB_prev = &current_##typename##_block,                                \
-       SFTB_current = current_##typename##_block,                      \
-       SFTB_limit = current_##typename##_block_index;                  \
-       SFTB_current;                                                   \
+  for (_frob_prev = &current_##typename##_block,                       \
+       _frob_current = current_##typename##_block,                     \
+       _frob_limit = current_##typename##_block_index;                 \
+       _frob_current;                                                  \
        )                                                               \
     {                                                                  \
-      int SFTB_iii;                                                    \
+      int _frob_iii;                                                   \
                                                                        \
-      for (SFTB_iii = 0; SFTB_iii < SFTB_limit; SFTB_iii++)            \
+      for (_frob_iii = 0; _frob_iii < _frob_limit; _frob_iii++)                \
        {                                                               \
-         obj_type *SFTB_victim = &(SFTB_current->block[SFTB_iii]);     \
+         obj_type *_frob_victim = &(_frob_current->block[_frob_iii]);  \
                                                                        \
-         if (FREE_STRUCT_P (SFTB_victim))                              \
+         if (FREE_STRUCT_P (_frob_victim))                             \
            {                                                           \
              num_free++;                                               \
            }                                                           \
-         else if (!MARKED_##typename##_P (SFTB_victim))                \
+         else if (!MARKED_##typename##_P (_frob_victim))               \
            {                                                           \
              num_free++;                                               \
-             FREE_FIXED_TYPE (typename, obj_type, SFTB_victim);        \
+             FREE_FIXED_TYPE (typename, obj_type, _frob_victim);       \
            }                                                           \
          else                                                          \
            {                                                           \
              num_used++;                                               \
-             UNMARK_##typename (SFTB_victim);                          \
+             UNMARK_##typename (_frob_victim);                         \
            }                                                           \
        }                                                               \
-      SFTB_prev = &(SFTB_current->prev);                               \
-      SFTB_current = SFTB_current->prev;                               \
-      SFTB_limit = countof (current_##typename##_block->block);                \
+      _frob_prev = &(_frob_current->prev);                             \
+      _frob_current = _frob_current->prev;                             \
+      _frob_limit = countof (current_##typename##_block->block);       \
     }                                                                  \
                                                                        \
   gc_count_num_##typename##_in_use = num_used;                         \
@@ -3617,77 +3717,77 @@ do {                                                                    \
 
 #else /* !ERROR_CHECK_GC */
 
-#define SWEEP_FIXED_TYPE_BLOCK(typename, obj_type)                             \
-do {                                                                           \
-  struct typename##_block *SFTB_current;                                       \
-  struct typename##_block **SFTB_prev;                                         \
-  int SFTB_limit;                                                              \
-  int num_free = 0, num_used = 0;                                              \
-                                                                               \
-  typename##_free_list = 0;                                                    \
-                                                                               \
-  for (SFTB_prev = &current_##typename##_block,                                        \
-       SFTB_current = current_##typename##_block,                              \
-       SFTB_limit = current_##typename##_block_index;                          \
-       SFTB_current;                                                           \
-       )                                                                       \
-    {                                                                          \
-      int SFTB_iii;                                                            \
-      int SFTB_empty = 1;                                                      \
-      obj_type *SFTB_old_free_list = typename##_free_list;                     \
-                                                                               \
-      for (SFTB_iii = 0; SFTB_iii < SFTB_limit; SFTB_iii++)                    \
-       {                                                                       \
-         obj_type *SFTB_victim = &(SFTB_current->block[SFTB_iii]);             \
-                                                                               \
-         if (FREE_STRUCT_P (SFTB_victim))                                      \
-           {                                                                   \
-             num_free++;                                                       \
-             PUT_FIXED_TYPE_ON_FREE_LIST (typename, obj_type, SFTB_victim);    \
-           }                                                                   \
-         else if (!MARKED_##typename##_P (SFTB_victim))                        \
-           {                                                                   \
-             num_free++;                                                       \
-             FREE_FIXED_TYPE (typename, obj_type, SFTB_victim);                \
-           }                                                                   \
-         else                                                                  \
-           {                                                                   \
-             SFTB_empty = 0;                                                   \
-             num_used++;                                                       \
-             UNMARK_##typename (SFTB_victim);                                  \
-           }                                                                   \
-       }                                                                       \
-      if (!SFTB_empty)                                                         \
-       {                                                                       \
-         SFTB_prev = &(SFTB_current->prev);                                    \
-         SFTB_current = SFTB_current->prev;                                    \
-       }                                                                       \
-      else if (SFTB_current == current_##typename##_block                      \
-              && !SFTB_current->prev)                                          \
-       {                                                                       \
-         /* No real point in freeing sole allocation block */                  \
-         break;                                                                \
-       }                                                                       \
-      else                                                                     \
-       {                                                                       \
-         struct typename##_block *SFTB_victim_block = SFTB_current;            \
-         if (SFTB_victim_block == current_##typename##_block)                  \
-           current_##typename##_block_index                                    \
-             = countof (current_##typename##_block->block);                    \
-         SFTB_current = SFTB_current->prev;                                    \
-         {                                                                     \
-           *SFTB_prev = SFTB_current;                                          \
-           xfree (SFTB_victim_block);                                          \
-           /* Restore free list to what it was before victim was swept */      \
-           typename##_free_list = SFTB_old_free_list;                          \
-           num_free -= SFTB_limit;                                             \
-         }                                                                     \
-       }                                                                       \
-      SFTB_limit = countof (current_##typename##_block->block);                        \
-    }                                                                          \
-                                                                               \
-  gc_count_num_##typename##_in_use = num_used;                                 \
-  gc_count_num_##typename##_freelist = num_free;                               \
+#define SWEEP_FIXED_TYPE_BLOCK(typename, obj_type)                           \
+do {                                                                         \
+  struct typename##_block *_frob_current;                                    \
+  struct typename##_block **_frob_prev;                                              \
+  int _frob_limit;                                                           \
+  int num_free = 0, num_used = 0;                                            \
+                                                                             \
+  typename##_free_list = 0;                                                  \
+                                                                             \
+  for (_frob_prev = &current_##typename##_block,                             \
+       _frob_current = current_##typename##_block,                           \
+       _frob_limit = current_##typename##_block_index;                       \
+       _frob_current;                                                        \
+       )                                                                     \
+    {                                                                        \
+      int _frob_iii;                                                         \
+      int _frob_empty = 1;                                                   \
+      obj_type *_frob_old_free_list = typename##_free_list;                  \
+                                                                             \
+      for (_frob_iii = 0; _frob_iii < _frob_limit; _frob_iii++)                      \
+       {                                                                     \
+         obj_type *_frob_victim = &(_frob_current->block[_frob_iii]);        \
+                                                                             \
+         if (FREE_STRUCT_P (_frob_victim))                                   \
+           {                                                                 \
+             num_free++;                                                     \
+             PUT_FIXED_TYPE_ON_FREE_LIST (typename, obj_type, _frob_victim); \
+           }                                                                 \
+         else if (!MARKED_##typename##_P (_frob_victim))                     \
+           {                                                                 \
+             num_free++;                                                     \
+             FREE_FIXED_TYPE (typename, obj_type, _frob_victim);             \
+           }                                                                 \
+         else                                                                \
+           {                                                                 \
+             _frob_empty = 0;                                                \
+             num_used++;                                                     \
+             UNMARK_##typename (_frob_victim);                               \
+           }                                                                 \
+       }                                                                     \
+      if (!_frob_empty)                                                              \
+       {                                                                     \
+         _frob_prev = &(_frob_current->prev);                                \
+         _frob_current = _frob_current->prev;                                \
+       }                                                                     \
+      else if (_frob_current == current_##typename##_block                   \
+              && !_frob_current->prev)                                       \
+       {                                                                     \
+         /* No real point in freeing sole allocation block */                \
+         break;                                                              \
+       }                                                                     \
+      else                                                                   \
+       {                                                                     \
+         struct typename##_block *_frob_victim_block = _frob_current;        \
+         if (_frob_victim_block == current_##typename##_block)               \
+           current_##typename##_block_index                                  \
+             = countof (current_##typename##_block->block);                  \
+         _frob_current = _frob_current->prev;                                \
+         {                                                                   \
+           *_frob_prev = _frob_current;                                      \
+           xfree (_frob_victim_block);                                       \
+           /* Restore free list to what it was before victim was swept */    \
+           typename##_free_list = _frob_old_free_list;                       \
+           num_free -= _frob_limit;                                          \
+         }                                                                   \
+       }                                                                     \
+      _frob_limit = countof (current_##typename##_block->block);             \
+    }                                                                        \
+                                                                             \
+  gc_count_num_##typename##_in_use = num_used;                               \
+  gc_count_num_##typename##_freelist = num_free;                             \
 } while (0)
 
 #endif /* !ERROR_CHECK_GC */
@@ -3773,7 +3873,7 @@ sweep_compiled_functions (void)
 #define UNMARK_compiled_function(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader))
 #define ADDITIONAL_FREE_compiled_function(ptr)
 
-  SWEEP_FIXED_TYPE_BLOCK (compiled_function, Lisp_Compiled_Function);
+  SWEEP_FIXED_TYPE_BLOCK (compiled_function, struct Lisp_Compiled_Function);
 }
 
 
@@ -4091,65 +4191,33 @@ sweep_strings (void)
 static int
 marked_p (Lisp_Object obj)
 {
-#ifdef ERROR_CHECK_GC
-  assert (! (GC_EQ (obj, Qnull_pointer)));
-#endif
-  /* Checks we used to perform. */
-  /* if (EQ (obj, Qnull_pointer)) return 1; */
-  /* if (!POINTER_TYPE_P (XGCTYPE (obj))) return 1; */
-  /* if (PURIFIED (XPNTR (obj))) return 1; */
-
+  if (EQ (obj, Qnull_pointer)) return 1;
+  if (!POINTER_TYPE_P (XGCTYPE (obj))) return 1;
+  if (PURIFIED (XPNTR (obj))) return 1;
   switch (XGCTYPE (obj))
     {
 #ifndef LRECORD_CONS
     case Lisp_Type_Cons:
-      {
-       struct Lisp_Cons *ptr = XCONS (obj);
-       return PURIFIED (ptr) || XMARKBIT (ptr->car);
-      }
+      return XMARKBIT (XCAR (obj));
 #endif
     case Lisp_Type_Record:
-      {
-       struct lrecord_header *lheader = XRECORD_LHEADER (obj);
-#if defined (ERROR_CHECK_GC) && defined (USE_INDEXED_LRECORD_IMPLEMENTATION)
-       assert (lheader->type <= last_lrecord_type_index_assigned);
-#endif
-       return PURIFIED (lheader) || MARKED_RECORD_HEADER_P (lheader);
-      }
+      return MARKED_RECORD_HEADER_P (XRECORD_LHEADER (obj));
 #ifndef LRECORD_STRING
     case Lisp_Type_String:
-      {
-       struct Lisp_String *ptr = XSTRING (obj);
-       return PURIFIED (ptr) || XMARKBIT (ptr->plist);
-      }
+      return XMARKBIT (XSTRING (obj)->plist);
 #endif /* ! LRECORD_STRING */
 #ifndef LRECORD_VECTOR
     case Lisp_Type_Vector:
-      {
-       struct Lisp_Vector *ptr = XVECTOR (obj);
-       return PURIFIED (ptr) || vector_length (ptr) < 0;
-      }
+      return XVECTOR_LENGTH (obj) < 0;
 #endif /* !LRECORD_VECTOR */
 #ifndef LRECORD_SYMBOL
     case Lisp_Type_Symbol:
-      {
-       struct Lisp_Symbol *ptr = XSYMBOL (obj);
-       return PURIFIED (ptr) || XMARKBIT (ptr->plist);
-      }
+      return XMARKBIT (XSYMBOL (obj)->plist);
 #endif
-
-      /* Ints and Chars don't need GC */
-#if defined (USE_MINIMAL_TAGBITS) || ! defined (ERROR_CHECK_GC)
     default:
-      return 1;
-#else
-    default:
-      abort();
-    case Lisp_Type_Int:
-    case Lisp_Type_Char:
-      return 1;
-#endif
+      abort ();
     }
+  return 0;    /* suppress compiler warning */
 }
 
 static void
@@ -4227,7 +4295,7 @@ disksave_object_finalization (void)
 {
   /* It's important that certain information from the environment not get
      dumped with the executable (pathnames, environment variables, etc.).
-     To make it easier to tell when this has happened with strings(1) we
+     To make it easier to tell when this has happend with strings(1) we
      clear some known-to-be-garbage blocks of memory, so that leftover
      results of old evaluation don't look like potential problems.
      But first we set some notable variables to nil and do one more GC,
@@ -4300,10 +4368,8 @@ static int gc_hooks_inhibited;
 void
 garbage_collect_1 (void)
 {
-#if MAX_SAVE_STACK > 0
   char stack_top_variable;
   extern char *stack_bottom;
-#endif
   int i;
   struct frame *f;
   int speccount;
@@ -4317,24 +4383,13 @@ garbage_collect_1 (void)
       || preparing_for_armageddon)
     return;
 
-  /* We used to call selected_frame() here.
-
-     The following functions cannot be called inside GC
-     so we move to after the above tests. */
-  {
-    Lisp_Object frame;
-    Lisp_Object device = Fselected_device (Qnil);
-    if (NILP (device)) /* Could happen during startup, eg. if always_gc */
-      return;
-    frame = DEVICE_SELECTED_FRAME (XDEVICE (device));
-    if (NILP (frame))
-      signal_simple_error ("No frames exist on device", device);
-    f = XFRAME (frame);
-  }
-
   pre_gc_cursor = Qnil;
   cursor_changed = 0;
 
+  /* This function cannot be called inside GC so we move to after the */
+  /* above tests */
+  f = selected_frame ();
+
   GCPRO1 (pre_gc_cursor);
 
   /* Very important to prevent GC during any of the following
@@ -4429,6 +4484,10 @@ garbage_collect_1 (void)
 
     for (i = 0; i < staticidx; i++)
       {
+#ifdef GDB_SUCKS
+       printf ("%d\n", i);
+       debug_print (*staticvec[i]);
+#endif
         mark_object (*(staticvec[i]));
       }
 
@@ -4467,21 +4526,29 @@ garbage_collect_1 (void)
   }
 
   /* OK, now do the after-mark stuff.  This is for things that
-     are only marked when something else is marked (e.g. weak hash tables).
+     are only marked when something else is marked (e.g. weak hashtables).
      There may be complex dependencies between such objects -- e.g.
-     a weak hash table might be unmarked, but after processing a later
-     weak hash table, the former one might get marked.  So we have to
+     a weak hashtable might be unmarked, but after processing a later
+     weak hashtable, the former one might get marked.  So we have to
      iterate until nothing more gets marked. */
-
-  while (finish_marking_weak_hash_tables (marked_p, mark_object) > 0 ||
-        finish_marking_weak_lists       (marked_p, mark_object) > 0)
-    ;
+  {
+    int did_mark;
+    /* Need to iterate until there's nothing more to mark, in case
+       of chains of mark dependencies. */
+    do
+      {
+        did_mark = 0;
+       did_mark += !!finish_marking_weak_hashtables (marked_p, mark_object);
+       did_mark += !!finish_marking_weak_lists (marked_p, mark_object);
+      }
+    while (did_mark);
+  }
 
   /* And prune (this needs to be called after everything else has been
      marked and before we do any sweeping). */
   /* #### this is somewhat ad-hoc and should probably be an object
      method */
-  prune_weak_hash_tables (marked_p);
+  prune_weak_hashtables (marked_p);
   prune_weak_lists (marked_p);
   prune_specifiers (marked_p);
   prune_syntax_tables (marked_p);
@@ -4541,6 +4608,15 @@ garbage_collect_1 (void)
   return;
 }
 
+#ifdef EMACS_BTL
+ /* This isn't actually called.  BTL recognizes the stack frame of the top
+    of the garbage collector by noting that PC is between &garbage_collect_1
+    and &BTL_after_garbage_collect_1_stub.  So this fn must be right here.
+    There's not any other way to know the address of the end of a function.
+  */
+void BTL_after_garbage_collect_1_stub () { abort (); }
+#endif /* EMACS_BTL */
+
 /* Debugging aids.  */
 
 static Lisp_Object
@@ -4552,12 +4628,13 @@ gc_plist_hack (CONST char *name, int value, Lisp_Object tail)
   return cons3 (intern (name), make_int (value), tail);
 }
 
-#define HACK_O_MATIC(type, name, pl) do {                              \
-  int s = 0;                                                           \
-  struct type##_block *x = current_##type##_block;                     \
-  while (x) { s += sizeof (*x) + MALLOC_OVERHEAD; x = x->prev; }       \
-  (pl) = gc_plist_hack ((name), s, (pl));                              \
-} while (0)
+#define HACK_O_MATIC(type, name, pl)                                   \
+  {                                                                    \
+    int s = 0;                                                         \
+    struct type##_block *x = current_##type##_block;                   \
+    while (x) { s += sizeof (*x) + MALLOC_OVERHEAD; x = x->prev; }     \
+    (pl) = gc_plist_hack ((name), s, (pl));                            \
+  }
 
 DEFUN ("garbage-collect", Fgarbage_collect, 0, 0, "", /*
 Reclaim storage for Lisp objects no longer needed.
@@ -4869,6 +4946,16 @@ init_alloc_once_early (void)
 {
   int iii;
 
+#ifdef PURESTAT
+  for (iii = 0; iii < countof (purestats); iii++)
+    {
+      if (! purestats[iii]) continue;
+      purestats[iii]->nobjects = 0;
+      purestats[iii]->nbytes = 0;
+    }
+  purecopying_for_bytecode = 0;
+#endif /* PURESTAT */
+
   last_lrecord_type_index_assigned = -1;
   for (iii = 0; iii < countof (lrecord_implementations_table); iii++)
     {
index d5d69c9..81acfbc 100644 (file)
@@ -80,7 +80,6 @@ Boston, MA 02111-1307, USA.  */
 #ifdef REGION_CACHE_NEEDS_WORK
 #include "region-cache.h"
 #endif
-#include "specifier.h"
 #include "syntax.h"
 #include "sysdep.h"    /* for getwd */
 #include "window.h"
@@ -126,7 +125,6 @@ struct buffer buffer_local_flags;
 
 /* This is the initial (startup) directory, as used for the *scratch* buffer.
    We're making this a global to make others aware of the startup directory.
-   `initial_directory' is stored in external format.
  */
 char initial_directory[MAXPATHLEN+1];
 
@@ -229,13 +227,11 @@ mark_buffer (Lisp_Object obj, void (*markobj) (Lisp_Object))
                                        undo_threshold,
                                        undo_high_threshold);
 
-#define MARKED_SLOT(x) ((void) (markobj (buf->x)));
+#define MARKED_SLOT(x) ((markobj) (buf->x));
 #include "bufslots.h"
 #undef MARKED_SLOT
 
-  markobj (buf->extent_info);
-  if (buf->text)
-    markobj (buf->text->line_number_cache);
+  ((markobj) (buf->extent_info));
 
   /* Don't mark normally through the children slot.
      (Actually, in this case, it doesn't matter.)  */
@@ -312,9 +308,12 @@ returned instead.
 */
        (frame))
 {
-  return Fmapcar (Qcdr,
-                 EQ (frame, Qt) ? Vbuffer_alist :
-                 decode_frame (frame)->buffer_alist);
+  Lisp_Object list;
+  if (EQ (frame, Qt))
+    list = Vbuffer_alist;
+  else
+    list = decode_frame (frame)->buffer_alist;
+  return Fmapcar (Qcdr, list);
 }
 
 Lisp_Object
@@ -434,7 +433,7 @@ the search will still be done on `buffer-file-name'.
        (filename))
 {
   /* This function can GC.  GC checked 1997.04.06. */
-  REGISTER Lisp_Object buf;
+  REGISTER Lisp_Object tail, buf, tem;
   struct gcpro gcpro1;
 
 #ifdef I18N3
@@ -475,20 +474,18 @@ the search will still be done on `buffer-file-name'.
       NUNGCPRO;
     }
 
-  {
-    Lisp_Object elt;
-    LIST_LOOP_2 (elt, Vbuffer_alist)
-      {
-       buf = Fcdr (elt);
-       if (!BUFFERP (buf)) continue;
-       if (!STRINGP (XBUFFER (buf)->filename)) continue;
-       if (!NILP (Fstring_equal (filename,
-                                 (find_file_compare_truenames
-                                  ? XBUFFER (buf)->file_truename
-                                  : XBUFFER (buf)->filename))))
-         return buf;
-      }
-  }
+  LIST_LOOP (tail, Vbuffer_alist)
+    {
+      buf = Fcdr (XCAR (tail));
+      if (!BUFFERP (buf)) continue;
+      if (!STRINGP (XBUFFER (buf)->filename)) continue;
+      tem = Fstring_equal (filename,
+                          (find_file_compare_truenames
+                           ? XBUFFER (buf)->file_truename
+                           : XBUFFER (buf)->filename));
+      if (!NILP (tem))
+       return buf;
+    }
   return Qnil;
 }
 
@@ -580,8 +577,8 @@ finish_init_buffer (struct buffer *b, Lisp_Object name)
   init_buffer_markers (b);
 
   b->generated_modeline_string = Fmake_string (make_int (84), make_int (' '));
-  b->modeline_extent_table = make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK,
-                                                  HASH_TABLE_EQ);
+  b->modeline_extent_table = make_lisp_hashtable (20, HASHTABLE_KEY_WEAK,
+                                                 HASHTABLE_EQ);
 
   return buf;
 }
@@ -617,11 +614,12 @@ The value is never nil.
   b->text = &b->own_text;
   b->base_buffer = 0;
   b->indirect_children = Qnil;
-  init_buffer_text (b);
+  init_buffer_text (b, 0);
 
   return finish_init_buffer (b, name);
 }
 
+#if 0 /* #### implement this!  Need various changes in insdel.c */
 DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, 2, 2,
        "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", /*
 Create and return an indirect buffer for buffer BASE, named NAME.
@@ -633,40 +631,44 @@ If BASE is an indirect buffer itself, the base buffer for that buffer
 */
        (base_buffer, name))
 {
-  /* This function can GC */
-
-  /* #### The above interactive specification is totally bogus,
-     because it offers an existing buffer as default answer to the
-     second question.  However, the second argument may not BE an
-     existing buffer!  */
-  struct buffer *b;
-
-  base_buffer = get_buffer (base_buffer, 1);
+  Lisp_Object buf;
+  REGISTER struct buffer *b;
 
 #ifdef I18N3
   /* #### Doc string should indicate that the buffer name will get
      translated. */
 #endif
-  CHECK_STRING (name);
+
   name = LISP_GETTEXT (name);
-  if (!NILP (Fget_buffer (name)))
-    signal_simple_error ("Buffer name already in use", name);
+  buf = Fget_buffer (name);
+  if (!NILP (buf))
+    error ("Buffer name `%s' is in use", XSTRING_DATA (name));
+
+  base_buffer = Fget_buffer (base_buffer);
+  if (NILP (base_buffer))
+    error ("No such buffer: `%s'", XSTRING_DATA (XBUFFER (base_buffer)->name));
+
   if (XSTRING_LENGTH (name) == 0)
     error ("Empty string for buffer name is not allowed");
 
   b = allocate_buffer ();
 
-  b->base_buffer = BUFFER_BASE_BUFFER (XBUFFER (base_buffer));
+  if (XBUFFER (base_buffer)->base_buffer)
+    b->base_buffer = XBUFFER (base_buffer)->base_buffer;
+  else
+    b->base_buffer = XBUFFER (base_buffer);
 
   /* Use the base buffer's text object.  */
   b->text = b->base_buffer->text;
   b->indirect_children = Qnil;
+  XSETBUFFER (buf, b);
   b->base_buffer->indirect_children =
-    Fcons (make_buffer (b), b->base_buffer->indirect_children);
-  init_buffer_text (b);
+    Fcons (buf, b->base_buffer->indirect_children);
+  init_buffer_text (b, 1);
 
   return finish_init_buffer (b, name);
 }
+#endif /* 0 */
 
 
 \f
@@ -812,6 +814,41 @@ If BUFFER is indirect, the return value will always be nil; see
   return Fcopy_sequence (buf->indirect_children);
 }
 
+/* Map MAPFUN over all buffers that share the same text as BUF
+   (this includes BUF).  Pass two arguments to MAPFUN: a buffer,
+   and CLOSURE.  If any invocation of MAPFUN returns non-zero,
+   halt immediately and return that value.  Otherwise, continue
+   the mapping to the end and return 0. */
+
+int
+map_over_sharing_buffers (struct buffer *buf,
+                         int (*mapfun) (struct buffer *buf, void *closure),
+                         void *closure)
+{
+  int result;
+  Lisp_Object tail;
+
+  if (buf->base_buffer)
+    {
+      buf = buf->base_buffer;
+      assert (!buf->base_buffer);
+    }
+
+  result = (mapfun) (buf, closure);
+  if (result)
+    return result;
+
+  LIST_LOOP (tail, buf->indirect_children)
+    {
+      Lisp_Object buffer = XCAR (tail);
+      result = (mapfun) (XBUFFER (buffer), closure);
+      if (result)
+       return result;
+    }
+
+  return 0;
+}
+
 DEFUN ("buffer-local-variables", Fbuffer_local_variables, 0, 1, 0, /*
 Return an alist of variables that are buffer-local in BUFFER.
 Most elements look like (SYMBOL . VALUE), describing one variable.
@@ -1126,7 +1163,7 @@ No argument or nil as argument means do this for the current buffer.
 }
 
 DEFUN ("kill-buffer", Fkill_buffer, 1, 1, "bKill buffer: ", /*
-Kill the buffer BUFFER.
+Kill the buffer BUFNAME.
 The argument may be a buffer or may be the name of a buffer.
 An argument of nil means kill the current buffer.
 
@@ -1140,21 +1177,21 @@ when the hook functions are called.
 Any processes that have this buffer as the `process-buffer' are killed
 with `delete-process'.
 */
-       (buffer))
+       (bufname))
 {
   /* This function can call lisp */
   Lisp_Object buf;
   REGISTER struct buffer *b;
   struct gcpro gcpro1, gcpro2;
 
-  if (NILP (buffer))
+  if (NILP (bufname))
     buf = Fcurrent_buffer ();
-  else if (BUFFERP (buffer))
-    buf = buffer;
+  else if (BUFFERP (bufname))
+    buf = bufname;
   else
     {
-      buf = get_buffer (buffer, 0);
-      if (NILP (buf)) nsberror (buffer);
+      buf = get_buffer (bufname, 0);
+      if (NILP (buf)) nsberror (bufname);
     }
 
   b = XBUFFER (buf);
@@ -1176,7 +1213,7 @@ with `delete-process'.
       && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
     {
       Lisp_Object killp;
-      GCPRO1 (buf);
+      GCPRO2 (buf, bufname);
       killp = call1
        (Qyes_or_no_p,
         (emacs_doprnt_string_c
@@ -1250,12 +1287,7 @@ with `delete-process'.
       GCPRO1 (buf);
 
       LIST_LOOP (rest, b->indirect_children)
-       {
-         Fkill_buffer (XCAR (rest));
-         /* Keep indirect_children updated in case a
-             query-function/hook throws.  */
-         b->indirect_children = XCDR (rest);
-       }
+       Fkill_buffer (XCAR (rest));
 
       UNGCPRO;
     }
@@ -1340,7 +1372,7 @@ with `delete-process'.
     kill_buffer_local_variables (b);
 
     b->name = Qnil;
-    uninit_buffer_text (b);
+    uninit_buffer_text (b, !!b->base_buffer);
     b->undo_list = Qnil;
     uninit_buffer_extents (b);
     if (b->base_buffer)
@@ -1362,7 +1394,7 @@ with `delete-process'.
 }
 \f
 DEFUN ("record-buffer", Frecord_buffer, 1, 1, 0, /*
-Place buffer BUFFER first in the buffer order.
+Place buffer BUF first in the buffer order.
 Call this function when a buffer is selected "visibly".
 
 This function changes the global buffer order and the per-frame buffer
@@ -1370,7 +1402,7 @@ order for the selected frame.  The buffer order keeps track of recency
 of selection so that `other-buffer' will return a recently selected
 buffer.  See `other-buffer' for more information.
 */
-       (buffer))
+       (buf))
 {
   REGISTER Lisp_Object lynk, prev;
   struct frame *f = selected_frame ();
@@ -1378,7 +1410,7 @@ buffer.  See `other-buffer' for more information.
   prev = Qnil;
   for (lynk = Vbuffer_alist; CONSP (lynk); lynk = XCDR (lynk))
     {
-      if (EQ (XCDR (XCAR (lynk)), buffer))
+      if (EQ (XCDR (XCAR (lynk)), buf))
        break;
       prev = lynk;
     }
@@ -1395,7 +1427,7 @@ buffer.  See `other-buffer' for more information.
   prev = Qnil;
   for (lynk = f->buffer_alist; CONSP (lynk); lynk = XCDR (lynk))
     {
-      if (EQ (XCDR (XCAR (lynk)), buffer))
+      if (EQ (XCDR (XCAR (lynk)), buf))
        break;
       prev = lynk;
     }
@@ -1414,14 +1446,15 @@ Set an appropriate major mode for BUFFER, according to `default-major-mode'.
 Use this function before selecting the buffer, since it may need to inspect
 the current buffer's major mode.
 */
-       (buffer))
+       (buf))
 {
   int speccount = specpdl_depth ();
-  Lisp_Object function = XBUFFER (Vbuffer_defaults)->major_mode;
+  REGISTER Lisp_Object function, tem;
 
+  function = XBUFFER (Vbuffer_defaults)->major_mode;
   if (NILP (function))
     {
-      Lisp_Object tem = Fget (current_buffer->major_mode, Qmode_class, Qnil);
+      tem = Fget (current_buffer->major_mode, Qmode_class, Qnil);
       if (NILP (tem))
        function = current_buffer->major_mode;
     }
@@ -1434,7 +1467,7 @@ the current buffer's major mode.
 
   record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
 
-  Fset_buffer (buffer);
+  Fset_buffer (buf);
   call0 (function);
 
   return unbind_to (speccount, Qnil);
@@ -1452,9 +1485,9 @@ Return the current buffer as a Lisp object.
 */
        ())
 {
-  Lisp_Object buffer;
-  XSETBUFFER (buffer, current_buffer);
-  return buffer;
+  Lisp_Object buf;
+  XSETBUFFER (buf, current_buffer);
+  return buf;
 }
 \f
 /* Set the current buffer to B.  */
@@ -1836,7 +1869,9 @@ syms_of_buffer (void)
   DEFSUBR (Fget_buffer);
   DEFSUBR (Fget_file_buffer);
   DEFSUBR (Fget_buffer_create);
+#if 0
   DEFSUBR (Fmake_indirect_buffer);
+#endif
 
   DEFSUBR (Fgenerate_new_buffer_name);
   DEFSUBR (Fbuffer_name);
@@ -2014,55 +2049,81 @@ List of functions called with no args to query before killing a buffer.
   delete_auto_save_files = 1;
 }
 
-/* The docstrings for DEFVAR_* are recorded externally by make-docfile.  */
-
+/* DOC is ignored because it is snagged and recorded externally
+ *  by make-docfile */
 /* Renamed from DEFVAR_PER_BUFFER because FSFmacs D_P_B takes
-   a bogus extra arg, which confuses an otherwise identical make-docfile.c */
-
+ *  a bogus extra arg, which confuses an otherwise identical make-docfile.c */
 /* Declaring this stuff as const produces 'Cannot reinitialize' messages
    from SunPro C's fix-and-continue feature (a way neato feature that
    makes debugging unbelievably more bearable) */
-#define DEFVAR_BUFFER_LOCAL_1(lname, field_name, forward_type, magicfun) do {  \
-  static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C               \
-    = { { { symbol_value_forward_lheader_initializer,                          \
-           (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 },  \
-         forward_type }, magicfun };                                           \
-  {                                                                            \
-    int offset = ((char *)symbol_value_forward_forward (&I_hate_C) -           \
-                 (char *)&buffer_local_flags);                                 \
-    defvar_magic (lname, &I_hate_C);                                           \
-                                                                               \
-    *((Lisp_Object *)(offset + (char *)XBUFFER (Vbuffer_local_symbols)))       \
-      = intern (lname);                                                                \
-  }                                                                            \
-} while (0)
-
-#define DEFVAR_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun)         \
-       DEFVAR_BUFFER_LOCAL_1 (lname, field_name,                       \
-                              SYMVAL_CURRENT_BUFFER_FORWARD, magicfun)
-#define DEFVAR_BUFFER_LOCAL(lname, field_name)                         \
-       DEFVAR_BUFFER_LOCAL_MAGIC (lname, field_name, 0)
-#define DEFVAR_CONST_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun)   \
-       DEFVAR_BUFFER_LOCAL_1 (lname, field_name,                       \
-                              SYMVAL_CONST_CURRENT_BUFFER_FORWARD, magicfun)
-#define DEFVAR_CONST_BUFFER_LOCAL(lname, field_name)                   \
-       DEFVAR_CONST_BUFFER_LOCAL_MAGIC (lname, field_name, 0)
-
-#define DEFVAR_BUFFER_DEFAULTS_MAGIC(lname, field_name, magicfun)      \
-       DEFVAR_SYMVAL_FWD (lname, &(buffer_local_flags.field_name),     \
-                          SYMVAL_DEFAULT_BUFFER_FORWARD, magicfun)
-#define DEFVAR_BUFFER_DEFAULTS(lname, field_name)                      \
-       DEFVAR_BUFFER_DEFAULTS_MAGIC (lname, field_name, 0)
+#define DEFVAR_BUFFER_LOCAL(lname, field_name) do {                    \
+static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C         \
+  = { { { symbol_value_forward_lheader_initializer,                    \
+     (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 },        \
+      SYMVAL_CURRENT_BUFFER_FORWARD }, 0 };                            \
+      defvar_buffer_local ((lname), &I_hate_C);                                \
+ } while (0)
+
+#define DEFVAR_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun) do {    \
+static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C         \
+  = { { { symbol_value_forward_lheader_initializer,                    \
+     (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 },        \
+      SYMVAL_CURRENT_BUFFER_FORWARD }, magicfun };                     \
+      defvar_buffer_local ((lname), &I_hate_C);                                \
+ } while (0)
+
+#define DEFVAR_CONST_BUFFER_LOCAL(lname, field_name) do {              \
+static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C         \
+  = { { { symbol_value_forward_lheader_initializer,                    \
+     (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 },        \
+      SYMVAL_CONST_CURRENT_BUFFER_FORWARD }, 0 };                      \
+      defvar_buffer_local ((lname), &I_hate_C);                                \
+ } while (0)
+
+#define DEFVAR_CONST_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun) do{\
+static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C         \
+  = { { { symbol_value_forward_lheader_initializer,                    \
+     (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 },        \
+      SYMVAL_CONST_CURRENT_BUFFER_FORWARD }, magicfun };               \
+      defvar_buffer_local ((lname), &I_hate_C);                                \
+ } while (0)
+
+static void
+defvar_buffer_local (CONST char *namestring,
+                     CONST struct symbol_value_forward *m)
+{
+  int offset = ((char *)symbol_value_forward_forward (m)
+                - (char *)&buffer_local_flags);
+
+  defvar_mumble (namestring, m, sizeof (*m));
+
+  *((Lisp_Object *)(offset + (char *)XBUFFER (Vbuffer_local_symbols)))
+    = intern (namestring);
+}
+
+/* DOC is ignored because it is snagged and recorded externally
+ *  by make-docfile */
+#define DEFVAR_BUFFER_DEFAULTS(lname, field_name) do {                 \
+static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C         \
+  = { { { symbol_value_forward_lheader_initializer,                    \
+     (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 },        \
+      SYMVAL_DEFAULT_BUFFER_FORWARD }, 0 };                            \
+      defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C));           \
+ } while (0)
+
+#define DEFVAR_BUFFER_DEFAULTS_MAGIC(lname, field_name, magicfun) do { \
+static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C         \
+  = { { { symbol_value_forward_lheader_initializer,                    \
+     (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 },        \
+      SYMVAL_DEFAULT_BUFFER_FORWARD }, magicfun };                     \
+      defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C));           \
+ } while (0)
 
 static void
 nuke_all_buffer_slots (struct buffer *b, Lisp_Object zap)
 {
   zero_lcrecord (b);
 
-  b->extent_info = Qnil;
-  b->indirect_children = Qnil;
-  b->own_text.line_number_cache = Qnil;
-
 #define MARKED_SLOT(x) b->x = (zap);
 #include "bufslots.h"
 #undef MARKED_SLOT
@@ -2091,17 +2152,15 @@ complex_vars_of_buffer (void)
   defs->major_mode = Qfundamental_mode;
   defs->mode_name = QSFundamental;
   defs->abbrev_table = Qnil;    /* real default setup by Lisp code */
-
-  defs->downcase_table  = Vascii_downcase_table;
-  defs->upcase_table    = Vascii_upcase_table;
+  defs->downcase_table = Vascii_downcase_table;
+  defs->upcase_table = Vascii_upcase_table;
   defs->case_canon_table = Vascii_canon_table;
-  defs->case_eqv_table  = Vascii_eqv_table;
+  defs->case_eqv_table = Vascii_eqv_table;
 #ifdef MULE
-  defs->mirror_downcase_table  = Vmirror_ascii_downcase_table;
-  defs->mirror_upcase_table    = Vmirror_ascii_upcase_table;
+  defs->mirror_downcase_table = Vmirror_ascii_downcase_table;
+  defs->mirror_upcase_table = Vmirror_ascii_upcase_table;
   defs->mirror_case_canon_table = Vmirror_ascii_canon_table;
-  defs->mirror_case_eqv_table  = Vmirror_ascii_eqv_table;
-
+  defs->mirror_case_eqv_table = Vmirror_ascii_eqv_table;
   defs->category_table = Vstandard_category_table;
 #endif /* MULE */
   defs->syntax_table = Vstandard_syntax_table;
@@ -2135,7 +2194,7 @@ complex_vars_of_buffer (void)
      */
     Lisp_Object always_local_no_default = make_int (0);
     Lisp_Object always_local_resettable = make_int (-1);
-    Lisp_Object resettable             = make_int (-3);
+    Lisp_Object resettable = make_int (-3);
 
     /* Assign the local-flags to the slots that have default values.
        The local flag is a bit that is used in the buffer
@@ -2144,58 +2203,58 @@ complex_vars_of_buffer (void)
        buffer.  */
 
     nuke_all_buffer_slots (&buffer_local_flags, make_int (-2));
-    buffer_local_flags.filename                   = always_local_no_default;
-    buffer_local_flags.directory          = always_local_no_default;
-    buffer_local_flags.backed_up          = always_local_no_default;
-    buffer_local_flags.saved_size         = always_local_no_default;
+    buffer_local_flags.filename = always_local_no_default;
+    buffer_local_flags.directory = always_local_no_default;
+    buffer_local_flags.backed_up = always_local_no_default;
+    buffer_local_flags.saved_size = always_local_no_default;
     buffer_local_flags.auto_save_file_name = always_local_no_default;
-    buffer_local_flags.read_only          = always_local_no_default;
+    buffer_local_flags.read_only = always_local_no_default;
 
-    buffer_local_flags.major_mode         = always_local_resettable;
-    buffer_local_flags.mode_name          = always_local_resettable;
-    buffer_local_flags.undo_list          = always_local_no_default;
+    buffer_local_flags.major_mode = always_local_resettable;
+    buffer_local_flags.mode_name = always_local_resettable;
+    buffer_local_flags.undo_list = always_local_no_default;
 #if 0 /* FSFmacs */
-    buffer_local_flags.mark_active        = always_local_resettable;
+    buffer_local_flags.mark_active = always_local_resettable;
 #endif
     buffer_local_flags.point_before_scroll = always_local_resettable;
-    buffer_local_flags.file_truename      = always_local_no_default;
-    buffer_local_flags.invisibility_spec   = always_local_resettable;
-    buffer_local_flags.file_format        = always_local_resettable;
+    buffer_local_flags.file_truename = always_local_no_default;
+    buffer_local_flags.invisibility_spec = always_local_resettable;
+    buffer_local_flags.file_format = always_local_resettable;
     buffer_local_flags.generated_modeline_string = always_local_no_default;
 
-    buffer_local_flags.keymap          = resettable;
-    buffer_local_flags.downcase_table  = resettable;
-    buffer_local_flags.upcase_table    = resettable;
+    buffer_local_flags.keymap = resettable;
+    buffer_local_flags.downcase_table = resettable;
+    buffer_local_flags.upcase_table = resettable;
     buffer_local_flags.case_canon_table = resettable;
-    buffer_local_flags.case_eqv_table  = resettable;
-    buffer_local_flags.syntax_table    = resettable;
+    buffer_local_flags.case_eqv_table = resettable;
+    buffer_local_flags.syntax_table = resettable;
 #ifdef MULE
-    buffer_local_flags.category_table  = resettable;
+    buffer_local_flags.category_table = resettable;
 #endif
 
-    buffer_local_flags.modeline_format           = make_int (1<<0);
-    buffer_local_flags.abbrev_mode               = make_int (1<<1);
-    buffer_local_flags.overwrite_mode            = make_int (1<<2);
-    buffer_local_flags.case_fold_search                  = make_int (1<<3);
-    buffer_local_flags.auto_fill_function        = make_int (1<<4);
-    buffer_local_flags.selective_display         = make_int (1<<5);
-    buffer_local_flags.selective_display_ellipses = make_int (1<<6);
-    buffer_local_flags.tab_width                 = make_int (1<<7);
-    buffer_local_flags.truncate_lines            = make_int (1<<8);
-    buffer_local_flags.ctl_arrow                 = make_int (1<<9);
-    buffer_local_flags.fill_column               = make_int (1<<10);
-    buffer_local_flags.left_margin               = make_int (1<<11);
-    buffer_local_flags.abbrev_table              = make_int (1<<12);
+    buffer_local_flags.modeline_format = make_int (1);
+    buffer_local_flags.abbrev_mode = make_int (2);
+    buffer_local_flags.overwrite_mode = make_int (4);
+    buffer_local_flags.case_fold_search = make_int (8);
+    buffer_local_flags.auto_fill_function = make_int (0x10);
+    buffer_local_flags.selective_display = make_int (0x20);
+    buffer_local_flags.selective_display_ellipses = make_int (0x40);
+    buffer_local_flags.tab_width = make_int (0x80);
+    buffer_local_flags.truncate_lines = make_int (0x100);
+    buffer_local_flags.ctl_arrow = make_int (0x200);
+    buffer_local_flags.fill_column = make_int (0x400);
+    buffer_local_flags.left_margin = make_int (0x800);
+    buffer_local_flags.abbrev_table = make_int (0x1000);
 #ifdef REGION_CACHE_NEEDS_WORK
-    buffer_local_flags.cache_long_line_scans     = make_int (1<<13);
+    buffer_local_flags.cache_long_line_scans = make_int (0x2000);
 #endif
 #ifdef FILE_CODING
-    buffer_local_flags.buffer_file_coding_system  = make_int (1<<14);
+    buffer_local_flags.buffer_file_coding_system = make_int (0x4000);
 #endif
 
-    /* #### Warning: 1<<28 is the largest number currently allowable
-       due to the XINT() handling of this value.  With some
-       rearrangement you can get 3 more bits. */
+    /* #### Warning, 0x4000000 (that's six zeroes) is the largest number
+       currently allowable due to the XINT() handling of this value.
+       With some rearrangement you can get 4 more bits. */
   }
 
   DEFVAR_BUFFER_DEFAULTS ("default-modeline-format", modeline_format /*
@@ -2405,7 +2464,7 @@ its mnemonic abbreviation.
 The default value for this variable (which is normally used for
 buffers without associated files) is also used when automatic
 detection of a file's encoding is called for and there was no
-discernible encoding in the file (i.e. it was entirely or almost
+discernable encoding in the file (i.e. it was entirely or almost
 entirely ASCII).  The default value should generally *not* be set to
 nil (equivalent to `no-conversion'), because if extended characters
 are ever inserted into the buffer, they will be lost when the file is
@@ -2433,7 +2492,7 @@ particular operation, you should bind the variable
 variables just mentioned, which are intended to be used for
 global environment specification.
 */ );
-#endif /* FILE_CODING */
+#endif
 
   DEFVAR_BUFFER_LOCAL ("auto-fill-function", auto_fill_function /*
 Function called (if non-nil) to perform auto-fill.
@@ -2688,55 +2747,39 @@ handled:
   }
 }
 
-/* Is PWD another name for `.' ? */
-static int
-directory_is_current_directory (char *pwd)
-{
-  Bufbyte *pwd_internal;
-  struct stat dotstat, pwdstat;
-
-  GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA (pwd, pwd_internal);
-
-  return (IS_DIRECTORY_SEP (*pwd_internal)
-         && stat ((char *) pwd_internal, &pwdstat) == 0
-         && stat (".", &dotstat) == 0
-         && dotstat.st_ino == pwdstat.st_ino
-         && dotstat.st_dev == pwdstat.st_dev
-         && (int) strlen ((char *) pwd_internal) < MAXPATHLEN);
-}
-
 void
 init_initial_directory (void)
 {
   /* This function can GC */
 
   char *pwd;
+  struct stat dotstat, pwdstat;
+  int rc;
 
   initial_directory[0] = 0;
 
   /* If PWD is accurate, use it instead of calling getcwd.  This is faster
      when PWD is right, and may avoid a fatal error.  */
-  if ((pwd = getenv ("PWD")) != NULL
-      && directory_is_current_directory (pwd))
+  if ((pwd = getenv ("PWD")) != 0 && IS_DIRECTORY_SEP (*pwd)
+      && stat (pwd, &pwdstat) == 0
+      && stat (".", &dotstat) == 0
+      && dotstat.st_ino == pwdstat.st_ino
+      && dotstat.st_dev == pwdstat.st_dev
+      && (int) strlen (pwd) < MAXPATHLEN)
     strcpy (initial_directory, pwd);
   else if (getcwd (initial_directory, MAXPATHLEN) == NULL)
     fatal ("`getcwd' failed: %s\n", strerror (errno));
 
-  /* Make sure pwd is DIRECTORY_SEP-terminated.
-     Maybe this should really use some standard subroutine
+  /* Maybe this should really use some standard subroutine
      whose definition is filename syntax dependent.  */
-  {
-    int len = strlen (initial_directory);
-
-    if (! IS_DIRECTORY_SEP (initial_directory[len - 1]))
-      {
-       initial_directory[len] = DIRECTORY_SEP;
-       initial_directory[len + 1] = '\0';
-      }
-  }
-
+  rc = strlen (initial_directory);
+  if (!(IS_DIRECTORY_SEP (initial_directory[rc - 1])))
+    {
+      initial_directory[rc] = DIRECTORY_SEP;
+      initial_directory[rc + 1] = '\0';
+    }
   /* XEmacs change: store buffer's default directory
-     using preferred (i.e. as defined at compile-time)
+     using prefered (i.e. as defined at compile-time)
      directory separator. --marcpa */
 #ifdef DOS_NT
 #define CORRECT_DIR_SEPS(s) \
@@ -2755,8 +2798,7 @@ init_buffer (void)
 
   Fset_buffer (Fget_buffer_create (QSscratch));
 
-  current_buffer->directory =
-    build_ext_string (initial_directory, FORMAT_FILENAME);
+  current_buffer->directory = build_string (initial_directory);
 
 #if 0 /* FSFmacs */
   /* #### is this correct? */
index 9347064..7e0ce23 100644 (file)
@@ -102,10 +102,6 @@ struct buffer_text
   Bytind mule_bytind_cache[16];
 #endif
 
-  /* Similar to the above, we keep track of positions for which line
-     number has last been calculated.  See line-number.c. */
-  Lisp_Object line_number_cache;
-
   /* Change data that goes with the text. */
   struct buffer_text_change_data *changes;
 
@@ -238,31 +234,6 @@ DECLARE_LRECORD (buffer, struct buffer);
 } while (0)
 
 \f
-#define BUFFER_BASE_BUFFER(b) ((b)->base_buffer ? (b)->base_buffer : (b))
-
-/* Map over buffers sharing the same text as MPS_BUF.  MPS_BUFVAR is a
-   variable that gets the buffer values (beginning with the base
-   buffer, then the children), and MPS_BUFCONS should be a temporary
-   Lisp_Object variable.  */
-#define MAP_INDIRECT_BUFFERS(mps_buf, mps_bufvar, mps_bufcons)                 \
-for (mps_bufcons = Qunbound,                                                   \
-     mps_bufvar = BUFFER_BASE_BUFFER (mps_buf);                                        \
-     UNBOUNDP (mps_bufcons) ?                                                  \
-       (mps_bufcons = mps_bufvar->indirect_children,                           \
-       1)                                                                      \
-       : (!NILP (mps_bufcons)                                                  \
-         && (mps_bufvar = XBUFFER (XCAR (mps_bufcons)), 1)                     \
-         && (mps_bufcons = XCDR (mps_bufcons), 1));                            \
-     )
-
-\f
-
-/************************************************************************/
-/*                                                                     */
-/*                working with raw internal-format data                */
-/*                                                                     */
-/************************************************************************/
-
 /* NOTE: In all the following macros, we follow these rules concerning
    multiple evaluation of the arguments:
 
@@ -278,44 +249,52 @@ for (mps_bufcons = Qunbound,                                                      \
       denoted with the word "unsafe" in their name and are generally
       meant to be called only by other macros that have already
       stored the calling values in temporary variables.
+ */
+
+/************************************************************************/
+/*                                                                     */
+/*                working with raw internal-format data                */
+/*                                                                     */
+/************************************************************************/
 
+/* Use these on contiguous strings of data.  If the text you're
+   operating on is known to come from a buffer, use the buffer-level
+   functions below -- they know about the gap and may be more
+   efficient. */
 
-   Use the following functions/macros on contiguous strings of data.
-   If the text you're operating on is known to come from a buffer, use
-   the buffer-level functions below -- they know about the gap and may
-   be more efficient.
+/* Functions are as follows:
 
 
-  (A) For working with charptr's (pointers to internally-formatted text):
-  -----------------------------------------------------------------------
+   (A) For working with charptr's (pointers to internally-formatted text):
+   -----------------------------------------------------------------------
 
-   VALID_CHARPTR_P (ptr):
+   VALID_CHARPTR_P(ptr):
        Given a charptr, does it point to the beginning of a character?
 
-   ASSERT_VALID_CHARPTR (ptr):
+   ASSERT_VALID_CHARPTR(ptr):
        If error-checking is enabled, assert that the given charptr
-       points to the beginning of a character.  Otherwise, do nothing.
+       points to the beginning of a character.  Otherwise, do nothing.
 
-   INC_CHARPTR (ptr):
+   INC_CHARPTR(ptr):
        Given a charptr (assumed to point at the beginning of a character),
        modify that pointer so it points to the beginning of the next
        character.
 
-   DEC_CHARPTR (ptr):
+   DEC_CHARPTR(ptr):
        Given a charptr (assumed to point at the beginning of a
        character or at the very end of the text), modify that pointer
        so it points to the beginning of the previous character.
 
-   VALIDATE_CHARPTR_BACKWARD (ptr):
+   VALIDATE_CHARPTR_BACKWARD(ptr):
        Make sure that PTR is pointing to the beginning of a character.
-       If not, back up until this is the case.   Note that there are not
+       If not, back up until this is the case.   Note that there are not
        too many places where it is legitimate to do this sort of thing.
        It's an error if you're passed an "invalid" char * pointer.
        NOTE: PTR *must* be pointing to a valid part of the string (i.e.
        not the very end, unless the string is zero-terminated or
        something) in order for this function to not cause crashes.
 
-   VALIDATE_CHARPTR_FORWARD (ptr):
+   VALIDATE_CHARPTR_FORWARD(ptr):
        Make sure that PTR is pointing to the beginning of a character.
        If not, move forward until this is the case.  Note that there
        are not too many places where it is legitimate to do this sort
@@ -327,34 +306,38 @@ for (mps_bufcons = Qunbound,                                                      \
        section of internally-formatted text:
    --------------------------------------------------------------
 
-   bytecount_to_charcount (ptr, nbi):
+   bytecount_to_charcount(ptr, nbi):
        Given a pointer to a text string and a length in bytes,
        return the equivalent length in characters.
 
-   charcount_to_bytecount (ptr, nch):
+   charcount_to_bytecount(ptr, nch):
        Given a pointer to a text string and a length in characters,
        return the equivalent length in bytes.
 
-   charptr_n_addr (ptr, n):
+   charptr_n_addr(ptr, n):
        Return a pointer to the beginning of the character offset N
        (in characters) from PTR.
 
+   charptr_length(ptr):
+       Given a zero-terminated pointer to Emacs characters,
+       return the number of Emacs characters contained within.
+
 
    (C) For retrieving or changing the character pointed to by a charptr:
    ---------------------------------------------------------------------
 
-   charptr_emchar (ptr):
+   charptr_emchar(ptr):
        Retrieve the character pointed to by PTR as an Emchar.
 
-   charptr_emchar_n (ptr, n):
+   charptr_emchar_n(ptr, n):
        Retrieve the character at offset N (in characters) from PTR,
        as an Emchar.
 
-   set_charptr_emchar (ptr, ch):
+   set_charptr_emchar(ptr, ch):
        Store the character CH (an Emchar) as internally-formatted
        text starting at PTR.  Return the number of bytes stored.
 
-   charptr_copy_char (ptr, ptr2):
+   charptr_copy_char(ptr, ptr2):
        Retrieve the character pointed to by PTR and store it as
        internally-formatted text in PTR2.
 
@@ -366,16 +349,25 @@ for (mps_bufcons = Qunbound,                                                      \
     in mule-charset.h, for retrieving the charset of an Emchar
     and such.  These are only valid when MULE is defined.]
 
-   valid_char_p (ch):
+   valid_char_p(ch):
        Return whether the given Emchar is valid.
 
-   CHARP (ch):
-       Return whether the given Lisp_Object is a character.
+   CHARP(ch):
+        Return whether the given Lisp_Object is a valid character.
+       This is approximately the same as saying the Lisp_Object is
+       an int whose value is a valid Emchar. (But not exactly
+       because when MULE is not defined, we allow arbitrary values
+       in all but the lowest 8 bits and mask them off, for backward
+       compatibility.)
 
-   CHECK_CHAR_COERCE_INT (ch):
-       Signal an error if CH is not a valid character or integer Lisp_Object.
-       If CH is an integer Lisp_Object, convert it to a character Lisp_Object,
-       but merely by repackaging, without performing tests for char validity.
+   CHECK_CHAR_COERCE_INT(ch):
+       Signal an error if CH is not a valid character as per CHARP().
+       Also canonicalize the value into a valid Emchar, as necessary.
+       (This only means anything when MULE is not defined.)
+
+   COERCE_CHAR(ch):
+       Coerce an object that is known to satisfy CHARP() into a
+       valid Emchar.
 
    MAX_EMCHAR_LEN:
        Maximum number of buffer bytes per Emacs character.
@@ -406,32 +398,38 @@ for (mps_bufcons = Qunbound,                                                      \
    method because it doesn't have easy access to the first byte of
    the character it's moving over. */
 
-#define REAL_INC_CHARPTR(ptr) \
-  ((void) ((ptr) += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr))))
+#define real_inc_charptr_fun(ptr) \
+  ((ptr) += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr)))
+#ifdef ERROR_CHECK_BUFPOS
+#define inc_charptr_fun(ptr) (ASSERT_VALID_CHARPTR (ptr), \
+                             real_inc_charptr_fun (ptr))
+#else
+#define inc_charptr_fun(ptr) real_inc_charptr_fun (ptr)
+#endif
 
-#define REAL_DEC_CHARPTR(ptr) do {     \
-  (ptr)--;                             \
-} while (!VALID_CHARPTR_P (ptr))
+#define REAL_INC_CHARPTR(ptr) ((void) (real_inc_charptr_fun (ptr)))
 
-#ifdef ERROR_CHECK_BUFPOS
 #define INC_CHARPTR(ptr) do {          \
   ASSERT_VALID_CHARPTR (ptr);          \
   REAL_INC_CHARPTR (ptr);              \
 } while (0)
 
-#define DEC_CHARPTR(ptr) do {                  \
-  CONST Bufbyte *dc_ptr1 = (ptr);              \
-  CONST Bufbyte *dc_ptr2 = dc_ptr1;            \
-  REAL_DEC_CHARPTR (dc_ptr2);                  \
-  assert (dc_ptr1 - dc_ptr2 ==                 \
-         REP_BYTES_BY_FIRST_BYTE (*dc_ptr2));  \
-  (ptr) = dc_ptr2;                             \
-} while (0)
+#define REAL_DEC_CHARPTR(ptr) do {     \
+  (ptr)--;                             \
+} while (!VALID_CHARPTR_P (ptr))
 
-#else /* ! ERROR_CHECK_BUFPOS */
-#define INC_CHARPTR(ptr) REAL_INC_CHARPTR (ptr)
+#ifdef ERROR_CHECK_BUFPOS
+#define DEC_CHARPTR(ptr) do {                    \
+  CONST Bufbyte *__dcptr__ = (ptr);              \
+  CONST Bufbyte *__dcptr2__ = __dcptr__;         \
+  REAL_DEC_CHARPTR (__dcptr2__);                 \
+  assert (__dcptr__ - __dcptr2__ ==              \
+         REP_BYTES_BY_FIRST_BYTE (*__dcptr2__)); \
+  (ptr) = __dcptr2__;                            \
+} while (0)
+#else
 #define DEC_CHARPTR(ptr) REAL_DEC_CHARPTR (ptr)
-#endif /* ! ERROR_CHECK_BUFPOS */
+#endif
 
 #ifdef MULE
 
@@ -443,11 +441,11 @@ for (mps_bufcons = Qunbound,                                                      \
    the end of the string. */
 
 #define VALIDATE_CHARPTR_FORWARD(ptr) do {     \
-  Bufbyte *vcf_ptr = (ptr);                    \
-  VALIDATE_CHARPTR_BACKWARD (vcf_ptr);         \
-  if (vcf_ptr != (ptr))                                \
+  Bufbyte *__vcfptr__ = (ptr);                 \
+  VALIDATE_CHARPTR_BACKWARD (__vcfptr__);      \
+  if (__vcfptr__ != (ptr))                     \
     {                                          \
-      (ptr) = vcf_ptr;                         \
+      (ptr) = __vcfptr__;                      \
       INC_CHARPTR (ptr);                       \
     }                                          \
 } while (0)
@@ -469,6 +467,14 @@ charptr_n_addr (CONST Bufbyte *ptr, Charcount offset)
   return ptr + charcount_to_bytecount (ptr, offset);
 }
 
+INLINE Charcount charptr_length (CONST Bufbyte *ptr);
+INLINE Charcount
+charptr_length (CONST Bufbyte *ptr)
+{
+  return bytecount_to_charcount (ptr, strlen ((CONST char *) ptr));
+}
+
+
 /* -------------------------------------------------------------------- */
 /* (C) For retrieving or changing the character pointed to by a charptr */
 /* -------------------------------------------------------------------- */
@@ -534,12 +540,12 @@ INLINE int valid_char_p (Emchar ch);
 INLINE int
 valid_char_p (Emchar ch)
 {
-  return ((unsigned int) (ch) <= 0xff) || non_ascii_valid_char_p (ch);
+  return (ch >= 0 && ch <= 255) || non_ascii_valid_char_p (ch);
 }
 
 #else /* not MULE */
 
-#define valid_char_p(ch) ((unsigned int) (ch) <= 0xff)
+#define valid_char_p(ch) ((unsigned int) (ch) <= 255)
 
 #endif /* not MULE */
 
@@ -842,10 +848,11 @@ memind_to_bytind (struct buffer *buf, Memind x)
    results with stupid compilers. */
 
 #ifdef MULE
-# define VALIDATE_BYTIND_BACKWARD(buf, x) do {         \
-  Bufbyte *VBB_ptr = BI_BUF_BYTE_ADDRESS (buf, x);     \
-  while (!BUFBYTE_FIRST_BYTE_P (*VBB_ptr))             \
-    VBB_ptr--, (x)--;                                  \
+# define VALIDATE_BYTIND_BACKWARD(buf, x) do           \
+{                                                      \
+  Bufbyte *__ibptr = BI_BUF_BYTE_ADDRESS (buf, x);     \
+  while (!BUFBYTE_FIRST_BYTE_P (*__ibptr))             \
+    __ibptr--, (x)--;                                  \
 } while (0)
 #else
 # define VALIDATE_BYTIND_BACKWARD(buf, x)
@@ -857,10 +864,11 @@ memind_to_bytind (struct buffer *buf, Memind x)
    results with stupid compilers. */
 
 #ifdef MULE
-# define VALIDATE_BYTIND_FORWARD(buf, x) do {          \
-  Bufbyte *VBF_ptr = BI_BUF_BYTE_ADDRESS (buf, x);     \
-  while (!BUFBYTE_FIRST_BYTE_P (*VBF_ptr))             \
-    VBF_ptr++, (x)++;                                  \
+# define VALIDATE_BYTIND_FORWARD(buf, x) do            \
+{                                                      \
+  Bufbyte *__ibptr = BI_BUF_BYTE_ADDRESS (buf, x);     \
+  while (!BUFBYTE_FIRST_BYTE_P (*__ibptr))             \
+    __ibptr++, (x)++;                                  \
 } while (0)
 #else
 # define VALIDATE_BYTIND_FORWARD(buf, x)
@@ -1133,7 +1141,7 @@ Bufbyte *convert_from_external_format (CONST Extbyte *ptr,
   Extcount  gceda_len_out;                                             \
   CONST Bufbyte *gceda_ptr_in = (ptr);                                 \
   Extbyte *gceda_ptr_out =                                             \
-    convert_to_external_format (gceda_ptr_in, gceda_len_in,            \
+     convert_to_external_format (gceda_ptr_in, gceda_len_in,           \
                                &gceda_len_out, fmt);                   \
   /* If the new string is identical to the old (will be the case most  \
      of the time), just return the same string back.  This saves       \
@@ -1144,13 +1152,14 @@ Bufbyte *convert_from_external_format (CONST Extbyte *ptr,
       !memcmp (gceda_ptr_in, gceda_ptr_out, gceda_len_out))            \
     {                                                                  \
       (ptr_out) = (Extbyte *) gceda_ptr_in;                            \
+      (len_out) = (Extcount) gceda_len_in;                             \
     }                                                                  \
   else                                                                 \
     {                                                                  \
       (ptr_out) = (Extbyte *) alloca (1 + gceda_len_out);              \
       memcpy ((void *) ptr_out, gceda_ptr_out, 1 + gceda_len_out);     \
+      (len_out) = (Extcount) gceda_len_out;                            \
     }                                                                  \
-  (len_out) = gceda_len_out;                                           \
 } while (0)
 
 #else /* ! MULE */
@@ -1210,9 +1219,9 @@ Bufbyte *convert_from_external_format (CONST Extbyte *ptr,
 {                                                                      \
   Extcount gcida_len_in = (Extcount) (len);                            \
   Bytecount gcida_len_out;                                             \
-  CONST Extbyte *gcida_ptr_in = (ptr);                                 \
+  CONST Extbyte *gcida_ptr_in  = (ptr);                                        \
   Bufbyte *gcida_ptr_out =                                             \
-    convert_from_external_format (gcida_ptr_in, gcida_len_in,          \
+     convert_from_external_format (gcida_ptr_in, gcida_len_in,         \
                                  &gcida_len_out, fmt);                 \
   /* If the new string is identical to the old (will be the case most  \
      of the time), just return the same string back.  This saves       \
@@ -1223,13 +1232,14 @@ Bufbyte *convert_from_external_format (CONST Extbyte *ptr,
       !memcmp (gcida_ptr_in, gcida_ptr_out, gcida_len_out))            \
     {                                                                  \
       (ptr_out) = (Bufbyte *) gcida_ptr_in;                            \
+      (len_out) = (Bytecount) gcida_len_in;                            \
     }                                                                  \
   else                                                                 \
     {                                                                  \
       (ptr_out) = (Extbyte *) alloca (1 + gcida_len_out);              \
       memcpy ((void *) ptr_out, gcida_ptr_out, 1 + gcida_len_out);     \
+      (len_out) = gcida_len_out;                                       \
     }                                                                  \
-  (len_out) = gcida_len_out;                                           \
 } while (0)
 
 #else /* ! MULE */
@@ -1513,7 +1523,6 @@ extern struct buffer *current_buffer;
 
 /* This is the initial (startup) directory, as used for the *scratch* buffer.
    We're making this a global to make others aware of the startup directory.
-   `initial_directory' is stored in external format.
  */
 extern char initial_directory[];
 extern void init_initial_directory (void);   /* initialize initial_directory */
@@ -1574,7 +1583,7 @@ void r_alloc_free (unsigned char **);
 #else /* !REL_ALLOC */
 
 #define BUFFER_ALLOC(data,size)\
-       (data = xnew_array (Bufbyte, size))
+       ((void) (data = xnew_array (Bufbyte, size)))
 #define BUFFER_REALLOC(data,size)\
        ((Bufbyte *) xrealloc (data, (size) * sizeof(Bufbyte)))
 /* Avoid excess parentheses, or syntax errors may rear their heads. */
@@ -1604,9 +1613,9 @@ int emchar_string_displayed_columns (CONST Emchar *str, Charcount len);
 void convert_bufbyte_string_into_emchar_dynarr (CONST Bufbyte *str,
                                                Bytecount len,
                                                Emchar_dynarr *dyn);
-Charcount convert_bufbyte_string_into_emchar_string (CONST Bufbyte *str,
-                                                    Bytecount len,
-                                                    Emchar *arr);
+int convert_bufbyte_string_into_emchar_string (CONST Bufbyte *str,
+                                              Bytecount len,
+                                              Emchar *arr);
 void convert_emchar_string_into_bufbyte_dynarr (Emchar *arr, int nels,
                                                Bufbyte_dynarr *dyn);
 Bufbyte *convert_emchar_string_into_malloced_string (Emchar *arr, int nels,
@@ -1683,9 +1692,9 @@ int map_over_sharing_buffers (struct buffer *buf,
    typically used to convert between uppercase and lowercase.  For
    compatibility reasons, trt tables are currently in the form of
    a Lisp string of 256 characters, specifying the conversion for each
-   of the first 256 Emacs characters (i.e. the 256 Latin-1 characters).
-   This should be generalized at some point to support conversions for
-   all of the allowable Mule characters.
+   of the first 256 Emacs characters (i.e. the 256 extended-ASCII
+   characters).  This should be generalized at some point to support
+   conversions for all of the allowable Mule characters.
    */
 
 /* The _1 macros are named as such because they assume that you have
@@ -1778,7 +1787,7 @@ UPCASE (struct buffer *buf, Emchar ch)
   return (DOWNCASE_TABLE_OF (buf, ch) == ch) ? UPCASE_TABLE_OF (buf, ch) : ch;
 }
 
-/* Upcase a character known to be not upper case.  Unused. */
+/* Upcase a character known to be not upper case.  */
 
 #define UPCASE1(buf, ch) UPCASE_TABLE_OF (buf, ch)
 
index 88f5daf..000a943 100644 (file)
@@ -69,7 +69,7 @@ Boston, MA 02111-1307, USA.  */
        Specifically, this lists those variables that have
        a buffer-local value in this buffer: i.e. those
        whose value does not shadow the default value.
-       (Remember that for any particular variable created
+       (Remember that for any particlar variable created
        with `make-local-variable' or `make-variable-buffer-local',
        it will have a per-buffer value in some buffers and a
        default value in others.)
@@ -241,3 +241,7 @@ Boston, MA 02111-1307, USA.  */
        the next few times we add a new slot.  */
     MARKED_SLOT (extra1, extra2, extra3);
 #endif
+  /* The cache of positions for whilch line number has last been
+     calculated.  See line-number.c. */
+    MARKED_SLOT (line_number_cache);
+
index b8a9d1c..cb21d57 100644 (file)
@@ -1,5 +1,5 @@
 /* XEmacs case conversion functions.
-   Copyright (C) 1985, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1992, 1993, 1994 Free Software Foundation, Inc.
 
 This file is part of XEmacs.
 
@@ -18,12 +18,13 @@ 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: FSF 19.34, but substantially rewritten by Martin. */
+/* Synched up with: FSF 19.34. */
 
 #include <config.h>
 #include "lisp.h"
 
 #include "buffer.h"
+#include "commands.h"
 #include "insdel.h"
 #include "syntax.h"
 
@@ -33,117 +34,100 @@ static Lisp_Object
 casify_object (enum case_action flag, Lisp_Object obj, Lisp_Object buffer)
 {
   struct buffer *buf = decode_buffer (buffer, 0);
+  REGISTER int inword = (flag == CASE_DOWN);
+  struct Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table);
 
- retry:
-
-  if (CHAR_OR_CHAR_INTP (obj))
-    {
-      Emchar c;
-      CHECK_CHAR_COERCE_INT (obj);
-      c = XCHAR (obj);
-      c = (flag == CASE_DOWN) ? DOWNCASE (buf, c) : UPCASE (buf, c);
-      return make_char (c);
-    }
-
-  if (STRINGP (obj))
+  while (1)
     {
-      struct Lisp_Char_Table *syntax_table =
-       XCHAR_TABLE (buf->mirror_syntax_table);
-      Bufbyte *storage =
-       alloca_array (Bufbyte, XSTRING_LENGTH (obj) * MAX_EMCHAR_LEN);
-      Bufbyte *newp = storage;
-      Bufbyte *oldp = XSTRING_DATA (obj);
-      int wordp = 0, wordp_prev;
-
-      while (*oldp)
+      if (CHAR_OR_CHAR_INTP (obj))
        {
-         Emchar c = charptr_emchar (oldp);
-         switch (flag)
+         Emchar c;
+         CHECK_CHAR_COERCE_INT (obj);
+         c = XCHAR (obj);
+         if (IN_TRT_TABLE_DOMAIN (c))
            {
-           case CASE_UP:
-             c = UPCASE (buf, c);
-             break;
-           case CASE_DOWN:
-             c = DOWNCASE (buf, c);
-             break;
-           case CASE_CAPITALIZE:
-           case CASE_CAPITALIZE_UP:
-             wordp_prev = wordp;
-             wordp = WORD_SYNTAX_P (syntax_table, c);
-             if (!wordp) break;
-             if (wordp_prev)
-               {
-                 if (flag == CASE_CAPITALIZE)
-                   c = DOWNCASE (buf, c);
-               }
-             else
-               c = UPCASE (buf, c);
-             break;
+             if (inword)
+               obj = make_char (DOWNCASE (buf, c));
+             else if (!UPPERCASEP (buf, c))
+               obj = make_char (UPCASE1 (buf, c));
            }
-
-         newp += set_charptr_emchar (newp, c);
-         INC_CHARPTR (oldp);
+         return obj;
        }
-
-      return make_string (storage, newp - storage);
+      if (STRINGP (obj))
+       {
+         Charcount i;
+         Charcount len = XSTRING_CHAR_LENGTH (obj);
+         obj = Fcopy_sequence (obj);
+         for (i = 0; i < len; i++)
+           {
+             Emchar c = string_char (XSTRING (obj), i);
+             if (inword && flag != CASE_CAPITALIZE_UP)
+               c = DOWNCASE (buf, c);
+             else if (!UPPERCASEP (buf, c)
+                      && (!inword || flag != CASE_CAPITALIZE_UP))
+               c = UPCASE1 (buf, c);
+             set_string_char (XSTRING (obj), i, c);
+             if ((int) flag >= (int) CASE_CAPITALIZE)
+               inword = WORD_SYNTAX_P (syntax_table, c);
+           }
+         return obj;
+       }
+      obj = wrong_type_argument (Qchar_or_string_p, obj);
     }
-
-  obj = wrong_type_argument (Qchar_or_string_p, obj);
-  goto retry;
 }
 
 DEFUN ("upcase", Fupcase, 1, 2, 0, /*
-Convert OBJECT to upper case and return that.
-OBJECT may be a character or string.  The result has the same type.
-OBJECT is not altered--the value is a copy.
+Convert argument to upper case and return that.
+The argument may be a character or string.  The result has the same type.
+The argument object is not altered--the value is a copy.
 See also `capitalize', `downcase' and `upcase-initials'.
 Optional second arg BUFFER specifies which buffer's case tables to use,
  and defaults to the current buffer.
 */
-       (object, buffer))
+       (obj, buffer))
 {
-  return casify_object (CASE_UP, object, buffer);
+  return casify_object (CASE_UP, obj, buffer);
 }
 
 DEFUN ("downcase", Fdowncase, 1, 2, 0, /*
-Convert OBJECT to lower case and return that.
-OBJECT may be a character or string.  The result has the same type.
-OBJECT is not altered--the value is a copy.
+Convert argument to lower case and return that.
+The argument may be a character or string.  The result has the same type.
+The argument object is not altered--the value is a copy.
 Optional second arg BUFFER specifies which buffer's case tables to use,
  and defaults to the current buffer.
 */
-       (object, buffer))
+       (obj, buffer))
 {
-  return casify_object (CASE_DOWN, object, buffer);
+  return casify_object (CASE_DOWN, obj, buffer);
 }
 
 DEFUN ("capitalize", Fcapitalize, 1, 2, 0, /*
-Convert OBJECT to capitalized form and return that.
+Convert argument to capitalized form and return that.
 This means that each word's first character is upper case
 and the rest is lower case.
-OBJECT may be a character or string.  The result has the same type.
-OBJECT is not altered--the value is a copy.
+The argument may be a character or string.  The result has the same type.
+The argument object is not altered--the value is a copy.
 Optional second arg BUFFER specifies which buffer's case tables to use,
  and defaults to the current buffer.
 */
-       (object, buffer))
+       (obj, buffer))
 {
-  return casify_object (CASE_CAPITALIZE, object, buffer);
+  return casify_object (CASE_CAPITALIZE, obj, buffer);
 }
 
-/* Like Fcapitalize but change only the initial characters.  */
+/* Like Fcapitalize but change only the initials.  */
 
 DEFUN ("upcase-initials", Fupcase_initials, 1, 2, 0, /*
-Convert the initial of each word in OBJECT to upper case.
+Convert the initial of each word in the argument to upper case.
 Do not change the other letters of each word.
-OBJECT may be a character or string.  The result has the same type.
-OBJECT is not altered--the value is a copy.
+The argument may be a character or string.  The result has the same type.
+The argument object is not altered--the value is a copy.
 Optional second arg BUFFER specifies which buffer's case tables to use,
  and defaults to the current buffer.
 */
-       (object, buffer))
+       (obj, buffer))
 {
-  return casify_object (CASE_CAPITALIZE_UP, object, buffer);
+  return casify_object (CASE_CAPITALIZE_UP, obj, buffer);
 }
 \f
 /* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP.
@@ -156,10 +140,9 @@ casify_region_internal (enum case_action flag, Lisp_Object b, Lisp_Object e,
   /* This function can GC */
   REGISTER Bufpos i;
   Bufpos start, end;
+  REGISTER int inword = (flag == CASE_DOWN);
   struct Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table);
   int mccount;
-  Emchar oldc, c;
-  int wordp = 0, wordp_prev;
 
   if (EQ (b, e))
     /* Not modifying because nothing marked */
@@ -172,38 +155,25 @@ casify_region_internal (enum case_action flag, Lisp_Object b, Lisp_Object e,
 
   for (i = start; i < end; i++)
     {
-      c = oldc = BUF_FETCH_CHAR (buf, i);
+      Emchar c = BUF_FETCH_CHAR (buf, i);
+      Emchar oldc = c;
 
-      switch (flag)
+      if (inword && flag != CASE_CAPITALIZE_UP)
+       c = DOWNCASE (buf, c);
+      else if (!UPPERCASEP (buf, c)
+              && (!inword || flag != CASE_CAPITALIZE_UP))
+       c = UPCASE1 (buf, c);
+
+      if (oldc != c)
        {
-       case CASE_UP:
-         c = UPCASE (buf, oldc);
-         break;
-       case CASE_DOWN:
-         c = DOWNCASE (buf, oldc);
-         break;
-       case CASE_CAPITALIZE:
-       case CASE_CAPITALIZE_UP:
-         /* !!#### need to revalidate the start and end pointers in case
-            the buffer was changed */
-         wordp_prev = wordp;
-         wordp = WORD_SYNTAX_P (syntax_table, c);
-         if (!wordp) continue;
-         if (wordp_prev)
-           {
-             if (flag == CASE_CAPITALIZE)
-               c = DOWNCASE (buf, c);
-           }
-         else
-           c = UPCASE (buf, c);
-         break;
+         buffer_replace_char (buf, i, c, 1, (i == start));
+         BUF_MODIFF (buf)++;
        }
-
-      if (oldc == c) continue;
-      buffer_replace_char (buf, i, c, 1, (i == start));
-      BUF_MODIFF (buf)++;
+      /* !!#### need to revalidate the start and end pointers in case
+        the buffer was changed */
+      if ((int) flag >= (int) CASE_CAPITALIZE)
+       inword = WORD_SYNTAX_P (syntax_table, c);
     }
-
   end_multiple_change (buf, mccount);
 }
 
@@ -289,39 +259,39 @@ casify_word (enum case_action flag, Lisp_Object arg, Lisp_Object buffer)
 }
 
 DEFUN ("upcase-word", Fupcase_word, 1, 2, "p", /*
-Convert following word (or N words) to upper case, moving over.
+Convert following word (or ARG words) to upper case, moving over.
 With negative argument, convert previous words but do not move.
 See also `capitalize-word'.
 Optional second arg BUFFER defaults to the current buffer.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   /* This function can GC */
-  return casify_word (CASE_UP, n, buffer);
+  return casify_word (CASE_UP, arg, buffer);
 }
 
 DEFUN ("downcase-word", Fdowncase_word, 1, 2, "p", /*
-Convert following word (or N words) to lower case, moving over.
+Convert following word (or ARG words) to lower case, moving over.
 With negative argument, convert previous words but do not move.
 Optional second arg BUFFER defaults to the current buffer.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   /* This function can GC */
-  return casify_word (CASE_DOWN, n, buffer);
+  return casify_word (CASE_DOWN, arg, buffer);
 }
 
 DEFUN ("capitalize-word", Fcapitalize_word, 1, 2, "p", /*
-Capitalize the following word (or N words), moving over.
+Capitalize the following word (or ARG words), moving over.
 This gives the word(s) a first character in upper case
  and the rest lower case.
 With negative argument, capitalize previous words but do not move.
 Optional second arg BUFFER defaults to the current buffer.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   /* This function can GC */
-  return casify_word (CASE_CAPITALIZE, n, buffer);
+  return casify_word (CASE_CAPITALIZE, arg, buffer);
 }
 \f
 
index 996027d..470993b 100644 (file)
@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA.  */
 
 #include "buffer.h"
 #include "chartab.h"
+#include "commands.h"
 #include "syntax.h"
 
 Lisp_Object Qchar_tablep, Qchar_table;
@@ -97,7 +98,7 @@ mark_char_table_entry (Lisp_Object obj, void (*markobj) (Lisp_Object))
 
   for (i = 0; i < 96; i++)
     {
-      markobj (cte->level2[i]);
+      (markobj) (cte->level2[i]);
     }
   return Qnil;
 }
@@ -138,17 +139,17 @@ mark_char_table (Lisp_Object obj, void (*markobj) (Lisp_Object))
   int i;
 
   for (i = 0; i < NUM_ASCII_CHARS; i++)
-    markobj (ct->ascii[i]);
+    (markobj) (ct->ascii[i]);
 #ifdef MULE
   for (i = 0; i < NUM_LEADING_BYTES; i++)
-    markobj (ct->level1[i]);
+    (markobj) (ct->level1[i]);
 #endif
   return ct->mirror_table;
 }
 
 /* WARNING: All functions of this nature need to be written extremely
    carefully to avoid crashes during GC.  Cf. prune_specifiers()
-   and prune_weak_hash_tables(). */
+   and prune_weak_hashtables(). */
 
 void
 prune_syntax_tables (int (*obj_marked_p) (Lisp_Object))
@@ -159,7 +160,7 @@ prune_syntax_tables (int (*obj_marked_p) (Lisp_Object))
        !GC_NILP (rest);
        rest = XCHAR_TABLE (rest)->next_table)
     {
-      if (! obj_marked_p (rest))
+      if (! ((*obj_marked_p) (rest)))
        {
          /* This table is garbage.  Remove it from the list. */
          if (GC_NILP (prev))
@@ -176,7 +177,6 @@ char_table_type_to_symbol (enum char_table_type type)
 {
   switch (type)
   {
-  default: abort();
   case CHAR_TABLE_TYPE_GENERIC:  return Qgeneric;
   case CHAR_TABLE_TYPE_SYNTAX:   return Qsyntax;
   case CHAR_TABLE_TYPE_DISPLAY:  return Qdisplay;
@@ -185,6 +185,9 @@ char_table_type_to_symbol (enum char_table_type type)
   case CHAR_TABLE_TYPE_CATEGORY: return Qcategory;
 #endif
   }
+
+  abort ();
+  return Qnil; /* not reached */
 }
 
 static enum char_table_type
@@ -549,15 +552,13 @@ Reset a char table to its default state.
   switch (ct->type)
     {
     case CHAR_TABLE_TYPE_CHAR:
-      fill_char_table (ct, make_char (0));
-      break;
     case CHAR_TABLE_TYPE_DISPLAY:
     case CHAR_TABLE_TYPE_GENERIC:
 #ifdef MULE
     case CHAR_TABLE_TYPE_CATEGORY:
-#endif /* MULE */
       fill_char_table (ct, Qnil);
       break;
+#endif /* MULE */
 
     case CHAR_TABLE_TYPE_SYNTAX:
       fill_char_table (ct, make_int (Sinherit));
@@ -774,7 +775,7 @@ get_non_ascii_char_table_value (struct Lisp_Char_Table *ct, int leading_byte,
 
 #endif /* MULE */
 
-Lisp_Object
+static Lisp_Object
 get_char_table (Emchar ch, struct Lisp_Char_Table *ct)
 {
 #ifdef MULE
@@ -986,10 +987,6 @@ canonicalize_char_table_value (Lisp_Object value, enum char_table_type type)
          CHECK_CHAR_COERCE_INT (cdr);
          return Fcons (car, cdr);
        }
-      break;
-    case CHAR_TABLE_TYPE_CHAR:
-      CHECK_CHAR_COERCE_INT (value);
-      break;
     default:
       break;
     }
index 2aa4931..ac23e00 100644 (file)
@@ -180,7 +180,6 @@ struct chartab_range
 void fill_char_table (struct Lisp_Char_Table *ct, Lisp_Object value);
 void put_char_table (struct Lisp_Char_Table *ct, struct chartab_range *range,
                     Lisp_Object val);
-Lisp_Object get_char_table (Emchar, struct Lisp_Char_Table *);
 int map_char_table (struct Lisp_Char_Table *ct,
                    struct chartab_range *range,
                    int (*fn) (struct chartab_range *range,
diff --git a/src/chpdef.h b/src/chpdef.h
new file mode 100644 (file)
index 0000000..196196c
--- /dev/null
@@ -0,0 +1,57 @@
+/* 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: FSF 19.30. */
+
+#define        CHP$_END        0
+#define        CHP$_ACCESS     1
+#define        CHP$_FLAGS      2
+#define        CHP$_PRIV       3
+#define        CHP$_ACMODE     4
+#define        CHP$_ACCLASS    5
+#define        CHP$_RIGHTS     6
+#define        CHP$_ADDRIGHTS  7
+#define        CHP$_MODE       8
+#define        CHP$_MODES      9
+#define        CHP$_MINCLASS   10
+#define        CHP$_MAXCLASS   11
+#define        CHP$_OWNER      12
+#define        CHP$_PROT       13
+#define        CHP$_ACL        14
+#define        CHP$_AUDITNAME  15
+#define        CHP$_ALARMNAME  16
+#define        CHP$_MATCHEDACE 17
+#define        CHP$_PRIVUSED   18
+#define        CHP$_MAX_CODE   19
+#define        CHP$M_SYSPRV    1
+#define        CHP$M_BYPASS    2
+#define        CHP$M_UPGRADE   4
+#define        CHP$M_DOWNGRADE 8
+#define        CHP$M_GRPPRV    16
+#define        CHP$M_READALL   32
+#define        CHP$V_SYSPRV    0
+#define        CHP$V_BYPASS    1
+#define        CHP$V_UPGRADE   2
+#define        CHP$V_DOWNGRADE 3
+#define        CHP$V_GRPPRV    4
+#define        CHP$V_READALL   5
+#define        CHP$M_READ      1
+#define        CHP$M_WRITE     2
+#define        CHP$M_USEREADALL        4
+#define        CHP$V_READ      0
+#define        CHP$V_WRITE     1
+#define        CHP$V_USEREADALL        2
index 8e68640..ad38db4 100644 (file)
@@ -43,31 +43,27 @@ Lisp_Object Vself_insert_face;
 Lisp_Object Vself_insert_face_command;
 \f
 DEFUN ("forward-char", Fforward_char, 0, 2, "_p", /*
-Move point right N characters (left if N negative).
+Move point right ARG characters (left if ARG negative).
 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
 On reaching end of buffer, stop and signal error.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   struct buffer *buf = decode_buffer (buffer, 1);
-  EMACS_INT count;
 
-  if (NILP (n))
-    count = 1;
+  if (NILP (arg))
+    arg = make_int (1);
   else
-    {
-      CHECK_INT (n);
-      count = XINT (n);
-    }
+    CHECK_INT (arg);
 
-  /* This used to just set point to point + XINT (n), and then check
+  /* This used to just set point to point + XINT (arg), and then check
      to see if it was within boundaries.  But now that SET_PT can
      potentially do a lot of stuff (calling entering and exiting
      hooks, etcetera), that's not a good approach.  So we validate the
      proposed position, then set point.  */
   {
-    Bufpos new_point = BUF_PT (buf) + count;
+    Bufpos new_point = BUF_PT (buf) + XINT (arg);
 
     if (new_point < BUF_BEGV (buf))
       {
@@ -89,45 +85,44 @@ On reaching end of buffer, stop and signal error.
 }
 
 DEFUN ("backward-char", Fbackward_char, 0, 2, "_p", /*
-Move point left N characters (right if N negative).
+Move point left ARG characters (right if ARG negative).
 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
 */
-       (n, buffer))
+       (arg, buffer))
 {
-  if (NILP (n))
-    n = make_int (-1);
+  if (NILP (arg))
+    arg = make_int (1);
   else
-    {
-      CHECK_INT (n);
-      XSETINT (n, - XINT (n));
-    }
-  return Fforward_char (n, buffer);
+    CHECK_INT (arg);
+
+  XSETINT (arg, - XINT (arg));
+  return Fforward_char (arg, buffer);
 }
 
 DEFUN ("forward-line", Fforward_line, 0, 2, "_p", /*
-Move N lines forward (backward if N is negative).
-Precisely, if point is on line I, move to the start of line I + N.
+Move ARG lines forward (backward if ARG is negative).
+Precisely, if point is on line I, move to the start of line I + ARG.
 If there isn't room, go as far as possible (no error).
 Returns the count of lines left to move.  If moving forward,
-that is N - number of lines moved; if backward, N + number moved.
-With positive N, a non-empty line at the end counts as one line
+that is ARG - number of lines moved; if backward, ARG + number moved.
+With positive ARG, a non-empty line at the end counts as one line
   successfully moved (for the return value).
 If BUFFER is nil, the current buffer is assumed.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   struct buffer *buf = decode_buffer (buffer, 1);
   Bufpos pos2 = BUF_PT (buf);
   Bufpos pos;
   EMACS_INT count, shortage, negp;
 
-  if (NILP (n))
+  if (NILP (arg))
     count = 1;
   else
     {
-      CHECK_INT (n);
-      count = XINT (n);
+      CHECK_INT (arg);
+      count = XINT (arg);
     }
 
   negp = count <= 0;
@@ -148,39 +143,36 @@ With argument N not nil or 1, move forward N - 1 lines first.
 If scan reaches end of buffer, return that position.
 This function does not move point.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   struct buffer *b = decode_buffer (buffer, 1);
   REGISTER int orig, end;
 
   XSETBUFFER (buffer, b);
-  if (NILP (n))
-    n = make_int (0);
+  if (NILP (arg))
+    arg = make_int (1);
   else
-    {
-      CHECK_INT (n);
-      n = make_int (XINT (n) - 1);
-    }
+    CHECK_INT (arg);
 
-  orig = BUF_PT (b);
-  Fforward_line (n, buffer);
-  end = BUF_PT (b);
-  BUF_SET_PT (b, orig);
+  orig = BUF_PT(b);
+  Fforward_line (make_int (XINT (arg) - 1), buffer);
+  end = BUF_PT(b);
+  BUF_SET_PT(b, orig);
 
   return make_int (end);
 }
 
 DEFUN ("beginning-of-line", Fbeginning_of_line, 0, 2, "_p", /*
 Move point to beginning of current line.
-With argument N not nil or 1, move forward N - 1 lines first.
+With argument ARG not nil or 1, move forward ARG - 1 lines first.
 If scan reaches end of buffer, stop there without error.
 If BUFFER is nil, the current buffer is assumed.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   struct buffer *b = decode_buffer (buffer, 1);
 
-  BUF_SET_PT (b, XINT (Fpoint_at_bol (n, buffer)));
+  BUF_SET_PT(b, XINT (Fpoint_at_bol(arg, buffer)));
   return Qnil;
 }
 
@@ -190,57 +182,53 @@ With argument N not nil or 1, move forward N - 1 lines first.
 If scan reaches end of buffer, return that position.
 This function does not move point.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   struct buffer *buf = decode_buffer (buffer, 1);
-  int count;
 
-  if (NILP (n))
-    count = 1;
+  XSETBUFFER (buffer, buf);
+
+  if (NILP (arg))
+    arg = make_int (1);
   else
-    {
-      CHECK_INT (n);
-      count = XINT (n);
-    }
+    CHECK_INT (arg);
 
   return make_int (find_before_next_newline (buf, BUF_PT (buf), 0,
-                                            count - (count <= 0)));
+                                            XINT (arg) - (XINT (arg) <= 0)));
 }
 
 DEFUN ("end-of-line", Fend_of_line, 0, 2, "_p", /*
 Move point to end of current line.
-With argument N not nil or 1, move forward N - 1 lines first.
+With argument ARG not nil or 1, move forward ARG - 1 lines first.
 If scan reaches end of buffer, stop there without error.
 If BUFFER is nil, the current buffer is assumed.
 */
-       (n, buffer))
+       (arg, buffer))
 {
   struct buffer *b = decode_buffer (buffer, 1);
 
-  BUF_SET_PT (b, XINT (Fpoint_at_eol (n, buffer)));
+  BUF_SET_PT(b, XINT (Fpoint_at_eol (arg, buffer)));
   return Qnil;
 }
 
 DEFUN ("delete-char", Fdelete_char, 1, 2, "*p\nP", /*
-Delete the following N characters (previous, with negative N).
+Delete the following ARG characters (previous, with negative arg).
 Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
-Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified.
+Interactively, ARG is the prefix arg, and KILLFLAG is set if
+ARG was explicitly specified.
 */
-       (n, killflag))
+       (arg, killflag))
 {
   /* This function can GC */
   Bufpos pos;
   struct buffer *buf = current_buffer;
-  int count;
 
-  CHECK_INT (n);
-  count = XINT (n);
+  CHECK_INT (arg);
 
-  pos = BUF_PT (buf) + count;
+  pos = BUF_PT (buf) + XINT (arg);
   if (NILP (killflag))
     {
-      if (count < 0)
+      if (XINT (arg) < 0)
        {
          if (pos < BUF_BEGV (buf))
            signal_error (Qbeginning_of_buffer, Qnil);
@@ -257,22 +245,22 @@ N was explicitly specified.
     }
   else
     {
-      call1 (Qkill_forward_chars, n);
+      call1 (Qkill_forward_chars, arg);
     }
   return Qnil;
 }
 
 DEFUN ("delete-backward-char", Fdelete_backward_char, 1, 2, "*p\nP", /*
-Delete the previous N characters (following, with negative N).
+Delete the previous ARG characters (following, with negative ARG).
 Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
-Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified.
+Interactively, ARG is the prefix arg, and KILLFLAG is set if
+ARG was explicitly specified.
 */
-       (n, killflag))
+       (arg, killflag))
 {
   /* This function can GC */
-  CHECK_INT (n);
-  return Fdelete_char (make_int (- XINT (n)), killflag);
+  CHECK_INT (arg);
+  return Fdelete_char (make_int (-XINT (arg)), killflag);
 }
 
 static void internal_self_insert (Emchar ch, int noautofill);
@@ -281,15 +269,13 @@ DEFUN ("self-insert-command", Fself_insert_command, 1, 1, "*p", /*
 Insert the character you type.
 Whichever character you type to run this command is inserted.
 */
-       (n))
+       (arg))
 {
   /* This function can GC */
+  int n;
   Emchar ch;
   Lisp_Object c;
-  int count;
-
-  CHECK_NATNUM (n);
-  count = XINT (n);
+  CHECK_INT (arg);
 
   if (CHAR_OR_CHAR_INTP (Vlast_command_char))
     c = Vlast_command_char;
@@ -297,16 +283,36 @@ Whichever character you type to run this command is inserted.
     c = Fevent_to_character (Vlast_command_event, Qnil, Qnil, Qt);
 
   if (NILP (c))
-    signal_simple_error ("Last typed character has no ASCII equivalent",
+    signal_simple_error ("last typed character has no ASCII equivalent",
                          Fcopy_event (Vlast_command_event, Qnil));
 
   CHECK_CHAR_COERCE_INT (c);
 
+  n = XINT (arg);
   ch = XCHAR (c);
-
-  while (count--)
-    internal_self_insert (ch, (count != 0));
-
+#if 0 /* FSFmacs */
+  /* #### This optimization won't work because of differences in
+     how the start-open and end-open properties default for text
+     properties.  See internal_self_insert(). */
+  if (n >= 2 && NILP (current_buffer->overwrite_mode))
+    {
+      n -= 2;
+      /* The first one might want to expand an abbrev.  */
+      internal_self_insert (c, 1);
+      /* The bulk of the copies of this char can be inserted simply.
+        We don't have to handle a user-specified face specially
+        because it will get inherited from the first char inserted.  */
+      Finsert_char (make_char (c), make_int (n), Qt, Qnil);
+      /* The last one might want to auto-fill.  */
+      internal_self_insert (c, 0);
+    }
+  else
+#endif /* 0 */
+    while (n > 0)
+      {
+       n--;
+       internal_self_insert (ch, (n != 0));
+      }
   return Qnil;
 }
 
@@ -329,7 +335,6 @@ internal_self_insert (Emchar c1, int noautofill)
   Lisp_Object overwrite;
   struct Lisp_Char_Table *syntax_table;
   struct buffer *buf = current_buffer;
-  int tab_width;
 
   overwrite = buf->overwrite_mode;
   syntax_table = XCHAR_TABLE (buf->mirror_syntax_table);
@@ -349,9 +354,9 @@ internal_self_insert (Emchar c1, int noautofill)
          || (c1 != '\n' && BUF_FETCH_CHAR (buf, BUF_PT (buf)) != '\n'))
       && (EQ (overwrite, Qoverwrite_mode_binary)
           || BUF_FETCH_CHAR (buf, BUF_PT (buf)) != '\t'
-         || ((tab_width = XINT (buf->tab_width), tab_width <= 0)
-         || tab_width > 20
-         || !((current_column (buf) + 1) % tab_width))))
+         || XINT (buf->tab_width) <= 0
+         || XINT (buf->tab_width) > 20
+         || !((current_column (buf) + 1) % XINT (buf->tab_width))))
     {
       buffer_delete_range (buf, BUF_PT (buf), BUF_PT (buf) + 1, 0);
       /* hairy = 2; */
index 40b56c3..d8508cc 100644 (file)
@@ -1,5 +1,5 @@
 /* XEmacs site configuration template file.  -*- C -*-
-   Copyright (C) 1986, 1991-1994, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1986, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
 
 This file is part of XEmacs.
 
@@ -81,9 +81,6 @@ char *alloca();
 /* Allow the configurer to specify if she wants site-lisp. */
 #undef INHIBIT_SITE_LISP
 
-/* Allow the configurer to specify if she wants site-modules. */
-#undef INHIBIT_SITE_MODULES
-
 /* This will be removed in 19.15. */
 /* Hah!  Try 20.3 ... */
 /* Hah!  Try never ... */
@@ -197,7 +194,6 @@ char *alloca();
 #undef HAVE_ULIMIT_H
 #undef HAVE_X11_XLOCALE_H
 #undef HAVE_LINUX_VERSION_H
-#undef HAVE_CYGWIN_VERSION_H
 #undef HAVE_INTTYPES_H
 #undef HAVE_SYS_UN_H
 #undef HAVE_A_OUT_H
@@ -217,11 +213,9 @@ char *alloca();
 /* Have shared library support */
 #undef HAVE_DLOPEN
 #undef HAVE_DLERROR
-#undef HAVE__DLERROR
 #undef HAVE_SHL_LOAD
 #undef HAVE_DLD_INIT
 #undef HAVE_SHLIB
-#undef HAVE_DLFCN_H
 
 #undef HAVE_LIBKSTAT
 #undef HAVE_LIBINTL
@@ -408,19 +402,11 @@ char *alloca();
    determine where XEmacs' memory is going. */
 #undef MEMORY_USAGE_STATS
 
-/* Define QUANTIFY if using Quantify from Rational/Pure/Atria Software.
+/* Define QUANTIFY if using Quantify from Pure/Atria Software.
    This adds some additional calls to control data collection.
    It is only intended for use by the developers. */
 #undef QUANTIFY
 
-/* Define QUANTIFY if using Purify from Rational/Pure/Atria Software.
-   It is only intended for use by the developers. */
-#undef PURIFY
-
-#if (defined (QUANTIFY) || defined (PURIFY)) && !defined (XLIB_ILLEGAL_ACCESS)
-#define XLIB_ILLEGAL_ACCESS 1
-#endif
-
 /* Define EXTERNAL_WIDGET to compile support for using the editor as a
    widget within another program. */
 #undef EXTERNAL_WIDGET
index 74d8e4a..393d19d 100644 (file)
@@ -241,10 +241,8 @@ stream_clear_to_window_end (struct window *w, int ypos1, int ypos2)
 }
 
 static void
-stream_clear_region (Lisp_Object window, struct device* d, struct frame * f,
-                 face_index findex, int x, int y,
-                 int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, 
-                 Lisp_Object background_pixmap)
+stream_clear_region (Lisp_Object locale, face_index findex, int x, int y,
+                      int width, int height)
 {
 }
 
index e285226..91f91db 100644 (file)
@@ -70,9 +70,6 @@ struct x_device
   /* The X connection of this device. */
   Display *display;
 
-  /* Set by x_IO_error_handler(). */
-  int being_deleted;
-
   /* Xt application info. */
   Widget Xt_app_shell;
 
@@ -134,7 +131,7 @@ struct x_device
   int x_keysym_map_min_code;
   int x_keysym_map_max_code;
   int x_keysym_map_keysyms_per_code;
-  Lisp_Object x_keysym_map_hash_table;
+  Lisp_Object x_keysym_map_hashtable;
 
   /* frame that holds the WM_COMMAND property; there should be exactly
      one of these per device. */
@@ -187,7 +184,6 @@ struct x_device
 
 #define FRAME_X_DISPLAY(f) (DEVICE_X_DISPLAY (XDEVICE (f->device)))
 #define DEVICE_X_DISPLAY(d)    (DEVICE_X_DATA (d)->display)
-#define DEVICE_X_BEING_DELETED(d) (DEVICE_X_DATA (d)->being_deleted)
 #define DEVICE_X_VISUAL(d)     (DEVICE_X_DATA (d)->visual)
 #define DEVICE_X_DEPTH(d)      (DEVICE_X_DATA (d)->depth)
 #define DEVICE_X_COLORMAP(d)   (DEVICE_X_DATA (d)->device_cmap)
@@ -198,7 +194,7 @@ struct x_device
 #define DEVICE_X_MOUSE_TIMESTAMP(d)  (DEVICE_X_DATA (d)->mouse_timestamp)
 #define DEVICE_X_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_X_DATA (d)->global_mouse_timestamp)
 #define DEVICE_X_LAST_SERVER_TIMESTAMP(d)  (DEVICE_X_DATA (d)->last_server_timestamp)
-#define DEVICE_X_KEYSYM_MAP_HASH_TABLE(d)  (DEVICE_X_DATA (d)->x_keysym_map_hash_table)
+#define DEVICE_X_KEYSYM_MAP_HASHTABLE(d)  (DEVICE_X_DATA (d)->x_keysym_map_hashtable)
 /* #define DEVICE_X_X_COMPOSE_STATUS(d) (DEVICE_X_DATA (d)->x_compose_status) */
 #ifdef HAVE_XIM
 #define DEVICE_X_XIM(d)        (DEVICE_X_DATA (d)->xim)
index 034c585..2ba1b15 100644 (file)
@@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA.  */
    always tagged to a particular X window (i.e. frame),
    which exists on only one screen; therefore the event won't be
    reported multiple times even if there are multiple devices on
-   the same physical display.  This is an implementation detail
+   the same physical display.  This is an implementational detail
    specific to X consoles (e.g. under NeXTstep or Windows, this
    could be different, and input would come directly from the console).
 */
@@ -139,9 +139,7 @@ struct console_methods
   int (*eol_cursor_width_method) (void);
   void (*output_vertical_divider_method) (struct window *, int);
   void (*clear_to_window_end_method) (struct window *, int, int);
-  void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, face_index,
-                              int, int, int, int,
-                              Lisp_Object, Lisp_Object, Lisp_Object);
+  void (*clear_region_method) (Lisp_Object, face_index, int, int, int, int);
   void (*clear_frame_method) (struct frame *);
   void (*output_begin_method) (struct device *);
   void (*output_end_method) (struct device *);
@@ -204,10 +202,6 @@ struct console_methods
                                       Lisp_Object printcharfun,
                                       int escapeflag);
   void (*finalize_image_instance_method) (struct Lisp_Image_Instance *);
-  void (*unmap_subwindow_method) (struct Lisp_Image_Instance *);
-  void (*map_subwindow_method) (struct Lisp_Image_Instance *, int x, int y);
-  void (*resize_subwindow_method) (struct Lisp_Image_Instance *, int w, int h);
-  void (*update_subwindow_method) (struct Lisp_Image_Instance *);
   int (*image_instance_equal_method) (struct Lisp_Image_Instance *,
                                      struct Lisp_Image_Instance *,
                                      int depth);
@@ -215,13 +209,29 @@ struct console_methods
                                               int depth);
   void (*init_image_instance_from_eimage_method) (struct Lisp_Image_Instance *ii,
                                                  int width, int height,
-                                                 unsigned char *eimage,
+                                                 unsigned char *eimage, 
                                                  int dest_mask,
                                                  Lisp_Object instantiator,
                                                  Lisp_Object domain);
   Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method);
   int (*colorize_image_instance_method) (Lisp_Object image_instance,
                                         Lisp_Object fg, Lisp_Object bg);
+#ifdef HAVE_XPM
+    /* which is more tacky - this or #defines in glyphs.c? */
+  void (*xpm_instantiate_method)(Lisp_Object image_instance, 
+                                Lisp_Object instantiator,
+                                Lisp_Object pointer_fg, 
+                                Lisp_Object pointer_bg,
+                                int dest_mask, Lisp_Object domain);
+#endif
+#ifdef HAVE_WINDOW_SYSTEM
+    /* which is more tacky - this or #defines in glyphs.c? */
+  void (*xbm_instantiate_method)(Lisp_Object image_instance, 
+                                Lisp_Object instantiator,
+                                Lisp_Object pointer_fg, 
+                                Lisp_Object pointer_bg,
+                                int dest_mask, Lisp_Object domain);
+#endif
   Lisp_Object image_conversion_list;
 
 #ifdef HAVE_TOOLBARS
@@ -287,9 +297,9 @@ struct console_methods
 
 /* Call a void-returning console method, if it exists */
 #define MAYBE_CONTYPE_METH(meth, m, args) do {                 \
-  struct console_methods *maybe_contype_meth_meth = (meth);    \
-  if (HAS_CONTYPE_METH_P (maybe_contype_meth_meth, m))         \
-    CONTYPE_METH (maybe_contype_meth_meth, m, args);           \
+  struct console_methods *_maybe_contype_meth_meth = (meth);   \
+  if (HAS_CONTYPE_METH_P (_maybe_contype_meth_meth, m))                \
+    CONTYPE_METH (_maybe_contype_meth_meth, m, args);          \
 } while (0)
 
 /* Call a console method, if it exists; otherwise return
@@ -521,7 +531,7 @@ int valid_console_type_p (Lisp_Object type);
 #define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device)
 #define CONSOLE_SELECTED_FRAME(con) \
   DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device))
-#define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame)
+#define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->_last_nonminibuf_frame)
 #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char)
 
 #define CDFW_CONSOLE(obj)                              \
index 4e4a274..c0f2c54 100644 (file)
@@ -52,7 +52,7 @@ Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error;
 Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
 Lisp_Object Qintegerp, Qnatnump, Qsymbolp, Qkeywordp;
 Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp;
-Lisp_Object Qconsp, Qsubrp;
+Lisp_Object Qconsp, Qsubrp, Qcompiled_functionp;
 Lisp_Object Qcharacterp, Qstringp, Qarrayp, Qsequencep, Qvectorp;
 Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qbufferp;
 Lisp_Object Qinteger_or_char_p, Qinteger_char_or_marker_p;
@@ -77,17 +77,15 @@ int debug_ebola_backtrace_length;
 int
 eq_with_ebola_notice (Lisp_Object obj1, Lisp_Object obj2)
 {
-  if (debug_issue_ebola_notices != -42 /* abracadabra */ &&
-      (((CHARP (obj1) && INTP (obj2)) || (CHARP (obj2) && INTP (obj1)))
-       && (debug_issue_ebola_notices >= 2
-          || XCHAR_OR_INT (obj1) == XCHAR_OR_INT (obj2))))
+  if (((CHARP (obj1) && INTP (obj2)) || (CHARP (obj2) && INTP (obj1)))
+      && (debug_issue_ebola_notices >= 2
+         || XCHAR_OR_INT (obj1) == XCHAR_OR_INT (obj2)))
     {
-      write_c_string ("Comparison between integer and character is constant nil (",
-                     Qexternal_debugging_output);
+      stderr_out("Comparison between integer and character is constant nil (");
       Fprinc (obj1, Qexternal_debugging_output);
-      write_c_string (" and ", Qexternal_debugging_output);
+      stderr_out (" and ");
       Fprinc (obj2, Qexternal_debugging_output);
-      write_c_string (")\n", Qexternal_debugging_output);
+      stderr_out (")\n");
       debug_short_backtrace (debug_ebola_backtrace_length);
     }
   return EQ (obj1, obj2);
@@ -209,7 +207,7 @@ Return t if OBJECT is nil.
 }
 
 DEFUN ("consp", Fconsp, 1, 1, 0, /*
-Return t if OBJECT is a cons cell.  `nil' is not a cons cell.
+Return t if OBJECT is a cons cell.
 */
        (object))
 {
@@ -217,7 +215,7 @@ Return t if OBJECT is a cons cell.  `nil' is not a cons cell.
 }
 
 DEFUN ("atom", Fatom, 1, 1, 0, /*
-Return t if OBJECT is not a cons cell.  `nil' is not a cons cell.
+Return t if OBJECT is not a cons cell.  Atoms include nil.
 */
        (object))
 {
@@ -225,7 +223,7 @@ Return t if OBJECT is not a cons cell.  `nil' is not a cons cell.
 }
 
 DEFUN ("listp", Flistp, 1, 1, 0, /*
-Return t if OBJECT is a list.  `nil' is a list.
+Return t if OBJECT is a list.  Lists includes nil.
 */
        (object))
 {
@@ -233,7 +231,7 @@ Return t if OBJECT is a list.  `nil' is a list.
 }
 
 DEFUN ("nlistp", Fnlistp, 1, 1, 0, /*
-Return t if OBJECT is not a list.  `nil' is a list.
+Return t if OBJECT is not a list.  Lists include nil.
 */
        (object))
 {
@@ -265,7 +263,7 @@ Return t if OBJECT is a keyword.
 }
 
 DEFUN ("vectorp", Fvectorp, 1, 1, 0, /*
-Return t if OBJECT is a vector.
+REturn t if OBJECT is a vector.
 */
        (object))
 {
@@ -304,7 +302,8 @@ Return t if OBJECT is a sequence (list or array).
 */
        (object))
 {
-  return (LISTP                (object) ||
+  return (CONSP                (object) ||
+         NILP          (object) ||
          VECTORP       (object) ||
          STRINGP       (object) ||
          BIT_VECTORP   (object))
@@ -364,6 +363,14 @@ If non-nil, the return value will be a list whose first element is
   return prompt ? list2 (Qinteractive, build_string (prompt)) : Qnil;
 }
 
+DEFUN ("compiled-function-p", Fcompiled_function_p, 1, 1, 0, /*
+Return t if OBJECT is a byte-compiled function object.
+*/
+       (object))
+{
+  return COMPILED_FUNCTIONP (object) ? Qt : Qnil;
+}
+
 \f
 DEFUN ("characterp", Fcharacterp, 1, 1, 0, /*
 Return t if OBJECT is a character.
@@ -544,31 +551,16 @@ Return a symbol representing the type of OBJECT.
 */
        (object))
 {
-  switch (XTYPE (object))
-    {
-#ifndef LRECORD_CONS
-      case Lisp_Type_Cons: return Qcons;
-#endif
-
-#ifndef LRECORD_SYMBOL
-    case Lisp_Type_Symbol: return Qsymbol;
-#endif
+  if (CONSP    (object)) return Qcons;
+  if (SYMBOLP  (object)) return Qsymbol;
+  if (KEYWORDP (object)) return Qkeyword;
+  if (INTP     (object)) return Qinteger;
+  if (CHARP    (object)) return Qcharacter;
+  if (STRINGP  (object)) return Qstring;
+  if (VECTORP  (object)) return Qvector;
 
-#ifndef LRECORD_STRING
-    case Lisp_Type_String: return Qstring;
-#endif
-
-#ifndef LRECORD_VECTOR
-    case Lisp_Type_Vector: return Qvector;
-#endif
-
-    case Lisp_Type_Record:
-      return intern (XRECORD_LHEADER_IMPLEMENTATION (object)->name);
-
-    case Lisp_Type_Char: return Qcharacter;
-
-    default: return Qinteger;
-    }
+  assert (LRECORDP (object));
+  return intern (XRECORD_LHEADER_IMPLEMENTATION (object)->name);
 }
 
 \f
@@ -650,9 +642,9 @@ Set the cdr of CONSCELL to be NEWCDR.  Return NEWCDR.
   return newcdr;
 }
 \f
-/* Find the function at the end of a chain of symbol function indirections.
+/* Find the function at the end of a chain of symbol function indirections.  */
 
-   If OBJECT is a symbol, find the end of its function chain and
+/* If OBJECT is a symbol, find the end of its function chain and
    return the value found there.  If OBJECT is not a symbol, just
    return it.  If there is a cycle in the function chain, signal a
    cyclic-function-indirection error.
@@ -662,25 +654,26 @@ Set the cdr of CONSCELL to be NEWCDR.  Return NEWCDR.
 Lisp_Object
 indirect_function (Lisp_Object object, int errorp)
 {
-#define FUNCTION_INDIRECTION_SUSPICION_LENGTH 16
-  Lisp_Object tortoise, hare;
-  int count;
+  Lisp_Object tortoise = object;
+  Lisp_Object hare     = object;
 
-  for (hare = tortoise = object, count = 0;
-       SYMBOLP (hare);
-       hare = XSYMBOL (hare)->function, count++)
+  for (;;)
     {
-      if (count < FUNCTION_INDIRECTION_SUSPICION_LENGTH) continue;
+      if (!SYMBOLP (hare) || UNBOUNDP (hare))
+       break;
+      hare = XSYMBOL (hare)->function;
+      if (!SYMBOLP (hare) || UNBOUNDP (hare))
+       break;
+      hare = XSYMBOL (hare)->function;
+
+      tortoise = XSYMBOL (tortoise)->function;
 
-      if (count & 1)
-       tortoise = XSYMBOL (tortoise)->function;
       if (EQ (hare, tortoise))
        return Fsignal (Qcyclic_function_indirection, list1 (object));
     }
 
-  if (errorp && UNBOUNDP (hare))
-    signal_void_function_error (object);
-
+  if (UNBOUNDP (hare) && errorp)
+    return Fsignal (Qvoid_function, list1 (object));
   return hare;
 }
 
@@ -702,44 +695,41 @@ function chain of symbols.
 
 DEFUN ("aref", Faref, 2, 2, 0, /*
 Return the element of ARRAY at index INDEX.
-ARRAY may be a vector, bit vector, or string.  INDEX starts at 0.
+ARRAY may be a vector, bit vector, string, or byte-code object.
+IDX starts at 0.
 */
-       (array, index_))
+       (array, idx))
 {
-  int idx;
+  int idxval;
 
  retry:
-
-  if      (INTP  (index_)) idx = XINT  (index_);
-  else if (CHARP (index_)) idx = XCHAR (index_); /* yuck! */
-  else
+  CHECK_INT_COERCE_CHAR (idx); /* yuck! */
+  idxval = XINT (idx);
+  if (idxval < 0)
     {
-      index_ = wrong_type_argument (Qinteger_or_char_p, index_);
-      goto retry;
+    lose:
+      args_out_of_range (array, idx);
     }
-
-  if (idx < 0) goto range_error;
-
   if (VECTORP (array))
     {
-      if (idx >= XVECTOR_LENGTH (array)) goto range_error;
-      return XVECTOR_DATA (array)[idx];
+      if (idxval >= XVECTOR_LENGTH (array)) goto lose;
+      return XVECTOR_DATA (array)[idxval];
     }
   else if (BIT_VECTORP (array))
     {
-      if (idx >= bit_vector_length (XBIT_VECTOR (array))) goto range_error;
-      return make_int (bit_vector_bit (XBIT_VECTOR (array), idx));
+      if (idxval >= bit_vector_length (XBIT_VECTOR (array))) goto lose;
+      return make_int (bit_vector_bit (XBIT_VECTOR (array), idxval));
     }
   else if (STRINGP (array))
     {
-      if (idx >= XSTRING_CHAR_LENGTH (array)) goto range_error;
-      return make_char (string_char (XSTRING (array), idx));
+      if (idxval >= XSTRING_CHAR_LENGTH (array)) goto lose;
+      return make_char (string_char (XSTRING (array), idxval));
     }
 #ifdef LOSING_BYTECODE
   else if (COMPILED_FUNCTIONP (array))
     {
       /* Weird, gross compatibility kludge */
-      return Felt (array, index_);
+      return Felt (array, idx);
     }
 #endif
   else
@@ -748,148 +738,290 @@ ARRAY may be a vector, bit vector, or string.  INDEX starts at 0.
       array = wrong_type_argument (Qarrayp, array);
       goto retry;
     }
-
- range_error:
-  args_out_of_range (array, index_);
-  return Qnil; /* not reached */
 }
 
 DEFUN ("aset", Faset, 3, 3, 0, /*
-Store into the element of ARRAY at index INDEX the value NEWVAL.
-ARRAY may be a vector, bit vector, or string.  INDEX starts at 0.
+Store into the element of ARRAY at index IDX the value NEWVAL.
+ARRAY may be a vector, bit vector, or string.  IDX starts at 0.
 */
-       (array, index_, newval))
+       (array, idx, newval))
 {
-  int idx;
+  int idxval;
 
- retry:
+  CHECK_INT_COERCE_CHAR (idx); /* yuck! */
+  if (!VECTORP (array) && !BIT_VECTORP (array) && !STRINGP (array))
+    array = wrong_type_argument (Qarrayp, array);
 
-  if      (INTP  (index_)) idx = XINT (index_);
-  else if (CHARP (index_)) idx = XCHAR (index_); /* yuck! */
-  else
+  idxval = XINT (idx);
+  if (idxval < 0)
     {
-      index_ = wrong_type_argument (Qinteger_or_char_p, index_);
-      goto retry;
+    lose:
+      args_out_of_range (array, idx);
     }
-
-  if (idx < 0) goto range_error;
-
   CHECK_IMPURE (array);
 
   if (VECTORP (array))
     {
-      if (idx >= XVECTOR_LENGTH (array)) goto range_error;
-      XVECTOR_DATA (array)[idx] = newval;
+      if (idxval >= XVECTOR_LENGTH (array)) goto lose;
+      XVECTOR_DATA (array)[idxval] = newval;
     }
   else if (BIT_VECTORP (array))
     {
-      if (idx >= bit_vector_length (XBIT_VECTOR (array))) goto range_error;
+      if (idxval >= bit_vector_length (XBIT_VECTOR (array))) goto lose;
       CHECK_BIT (newval);
-      set_bit_vector_bit (XBIT_VECTOR (array), idx, !ZEROP (newval));
+      set_bit_vector_bit (XBIT_VECTOR (array), idxval, !ZEROP (newval));
     }
-  else if (STRINGP (array))
+  else                          /* string */
     {
       CHECK_CHAR_COERCE_INT (newval);
-      if (idx >= XSTRING_CHAR_LENGTH (array)) goto range_error;
-      set_string_char (XSTRING (array), idx, XCHAR (newval));
+      if (idxval >= XSTRING_CHAR_LENGTH (array)) goto lose;
+      set_string_char (XSTRING (array), idxval, XCHAR (newval));
       bump_string_modiff (array);
     }
-  else
-    {
-      array = wrong_type_argument (Qarrayp, array);
-      goto retry;
-    }
 
   return newval;
-
- range_error:
-  args_out_of_range (array, index_);
-  return Qnil; /* not reached */
 }
 
 \f
 /**********************************************************************/
-/*                       Arithmetic functions                         */
+/*                      Compiled-function objects                     */
 /**********************************************************************/
-typedef struct
+
+/* The compiled_function->doc_and_interactive slot uses the minimal
+   number of conses, based on compiled_function->flags; it may take
+   any of the following forms:
+
+       doc
+       interactive
+       domain
+       (doc . interactive)
+       (doc . domain)
+       (interactive . domain)
+       (doc . (interactive . domain))
+ */
+
+/* Caller must check flags.interactivep first */
+Lisp_Object
+compiled_function_interactive (struct Lisp_Compiled_Function *b)
 {
-  int int_p;
-  union
-  {
-    int ival;
-    double dval;
-  } c;
-} int_or_double;
+  assert (b->flags.interactivep);
+  if (b->flags.documentationp && b->flags.domainp)
+    return XCAR (XCDR (b->doc_and_interactive));
+  else if (b->flags.documentationp)
+    return XCDR (b->doc_and_interactive);
+  else if (b->flags.domainp)
+    return XCAR (b->doc_and_interactive);
 
-static void
-number_char_or_marker_to_int_or_double (Lisp_Object obj, int_or_double *p)
+  /* if all else fails... */
+  return b->doc_and_interactive;
+}
+
+/* Caller need not check flags.documentationp first */
+Lisp_Object
+compiled_function_documentation (struct Lisp_Compiled_Function *b)
 {
- retry:
-  p->int_p = 1;
-  if      (INTP    (obj)) p->c.ival = XINT  (obj);
-  else if (CHARP   (obj)) p->c.ival = XCHAR (obj);
-  else if (MARKERP (obj)) p->c.ival = marker_position (obj);
-#ifdef LISP_FLOAT_TYPE
-  else if (FLOATP  (obj)) p->c.dval = XFLOAT_DATA (obj), p->int_p = 0;
-#endif
+  if (! b->flags.documentationp)
+    return Qnil;
+  else if (b->flags.interactivep && b->flags.domainp)
+    return XCAR (b->doc_and_interactive);
+  else if (b->flags.interactivep)
+    return XCAR (b->doc_and_interactive);
+  else if (b->flags.domainp)
+    return XCAR (b->doc_and_interactive);
   else
-    {
-      obj = wrong_type_argument (Qnumber_char_or_marker_p, obj);
-      goto retry;
-    }
+    return b->doc_and_interactive;
 }
 
-static double
-number_char_or_marker_to_double (Lisp_Object obj)
+/* Caller need not check flags.domainp first */
+Lisp_Object
+compiled_function_domain (struct Lisp_Compiled_Function *b)
 {
- retry:
-  if      (INTP    (obj)) return (double) XINT  (obj);
-  else if (CHARP   (obj)) return (double) XCHAR (obj);
-  else if (MARKERP (obj)) return (double) marker_position (obj);
-#ifdef LISP_FLOAT_TYPE
-  else if (FLOATP  (obj)) return XFLOAT_DATA (obj);
-#endif
+  if (! b->flags.domainp)
+    return Qnil;
+  else if (b->flags.documentationp && b->flags.interactivep)
+    return XCDR (XCDR (b->doc_and_interactive));
+  else if (b->flags.documentationp)
+    return XCDR (b->doc_and_interactive);
+  else if (b->flags.interactivep)
+    return XCDR (b->doc_and_interactive);
   else
-    {
-      obj = wrong_type_argument (Qnumber_char_or_marker_p, obj);
-      goto retry;
-    }
+    return b->doc_and_interactive;
 }
 
-static int
-integer_char_or_marker_to_int (Lisp_Object obj)
+#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
+
+Lisp_Object
+compiled_function_annotation (struct Lisp_Compiled_Function *b)
 {
- retry:
-  if      (INTP    (obj)) return XINT  (obj);
-  else if (CHARP   (obj)) return XCHAR (obj);
-  else if (MARKERP (obj)) return marker_position (obj);
+  return b->annotated;
+}
+
+#endif
+
+/* used only by Snarf-documentation; there must be doc already. */
+void
+set_compiled_function_documentation (struct Lisp_Compiled_Function *b,
+                                    Lisp_Object new)
+{
+  assert (b->flags.documentationp);
+  assert (INTP (new) || STRINGP (new));
+
+  if (b->flags.interactivep && b->flags.domainp)
+    XCAR (b->doc_and_interactive) = new;
+  else if (b->flags.interactivep)
+    XCAR (b->doc_and_interactive) = new;
+  else if (b->flags.domainp)
+    XCAR (b->doc_and_interactive) = new;
   else
+    b->doc_and_interactive = new;
+}
+
+DEFUN ("compiled-function-instructions", Fcompiled_function_instructions, 1, 1, 0, /*
+Return the byte-opcode string of the compiled-function object.
+*/
+       (function))
+{
+  CHECK_COMPILED_FUNCTION (function);
+  return XCOMPILED_FUNCTION (function)->bytecodes;
+}
+
+DEFUN ("compiled-function-constants", Fcompiled_function_constants, 1, 1, 0, /*
+Return the constants vector of the compiled-function object.
+*/
+       (function))
+{
+  CHECK_COMPILED_FUNCTION (function);
+  return XCOMPILED_FUNCTION (function)->constants;
+}
+
+DEFUN ("compiled-function-stack-depth", Fcompiled_function_stack_depth, 1, 1, 0, /*
+Return the max stack depth of the compiled-function object.
+*/
+       (function))
+{
+  CHECK_COMPILED_FUNCTION (function);
+  return make_int (XCOMPILED_FUNCTION (function)->maxdepth);
+}
+
+DEFUN ("compiled-function-arglist", Fcompiled_function_arglist, 1, 1, 0, /*
+Return the argument list of the compiled-function object.
+*/
+       (function))
+{
+  CHECK_COMPILED_FUNCTION (function);
+  return XCOMPILED_FUNCTION (function)->arglist;
+}
+
+DEFUN ("compiled-function-interactive", Fcompiled_function_interactive, 1, 1, 0, /*
+Return the interactive spec of the compiled-function object, or nil.
+If non-nil, the return value will be a list whose first element is
+`interactive' and whose second element is the interactive spec.
+*/
+       (function))
+{
+  CHECK_COMPILED_FUNCTION (function);
+  return XCOMPILED_FUNCTION (function)->flags.interactivep
+    ? list2 (Qinteractive,
+            compiled_function_interactive (XCOMPILED_FUNCTION (function)))
+    : Qnil;
+}
+
+DEFUN ("compiled-function-doc-string", Fcompiled_function_doc_string, 1, 1, 0, /*
+Return the doc string of the compiled-function object, if available.
+Functions that had their doc strings snarfed into the DOC file will have
+an integer returned instead of a string.
+*/
+       (function))
+{
+  CHECK_COMPILED_FUNCTION (function);
+  return compiled_function_documentation (XCOMPILED_FUNCTION (function));
+}
+
+#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
+
+/* Remove the `xx' if you wish to restore this feature */
+xxDEFUN ("compiled-function-annotation", Fcompiled_function_annotation, 1, 1, 0, /*
+Return the annotation of the compiled-function object, or nil.
+The annotation is a piece of information indicating where this
+compiled-function object came from.  Generally this will be
+a symbol naming a function; or a string naming a file, if the
+compiled-function object was not defined in a function; or nil,
+if the compiled-function object was not created as a result of
+a `load'.
+*/
+       (function))
+{
+  CHECK_COMPILED_FUNCTION (function);
+  return compiled_function_annotation (XCOMPILED_FUNCTION (function));
+}
+
+#endif /* COMPILED_FUNCTION_ANNOTATION_HACK */
+
+DEFUN ("compiled-function-domain", Fcompiled_function_domain, 1, 1, 0, /*
+Return the domain of the compiled-function object, or nil.
+This is only meaningful if I18N3 was enabled when emacs was compiled.
+*/
+       (function))
+{
+  CHECK_COMPILED_FUNCTION (function);
+  return XCOMPILED_FUNCTION (function)->flags.domainp
+    ? compiled_function_domain (XCOMPILED_FUNCTION (function))
+    : Qnil;
+}
+
+\f
+/**********************************************************************/
+/*                       Arithmetic functions                         */
+/**********************************************************************/
+
+Lisp_Object
+arithcompare (Lisp_Object num1, Lisp_Object num2,
+             enum arith_comparison comparison)
+{
+  CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (num1);
+  CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (num2);
+
+#ifdef LISP_FLOAT_TYPE
+  if (FLOATP (num1) || FLOATP (num2))
     {
-      obj = wrong_type_argument (Qinteger_char_or_marker_p, obj);
-      goto retry;
+      double f1 = FLOATP (num1) ? float_data (XFLOAT (num1)) : XINT (num1);
+      double f2 = FLOATP (num2) ? float_data (XFLOAT (num2)) : XINT (num2);
+
+      switch (comparison)
+       {
+       case arith_equal:         return f1 == f2 ? Qt : Qnil;
+       case arith_notequal:      return f1 != f2 ? Qt : Qnil;
+       case arith_less:          return f1 <  f2 ? Qt : Qnil;
+       case arith_less_or_equal: return f1 <= f2 ? Qt : Qnil;
+       case arith_grtr:          return f1 >  f2 ? Qt : Qnil;
+       case arith_grtr_or_equal: return f1 >= f2 ? Qt : Qnil;
+       }
+    }
+#endif /* LISP_FLOAT_TYPE */
+
+  switch (comparison)
+    {
+    case arith_equal:         return XINT (num1) == XINT (num2) ? Qt : Qnil;
+    case arith_notequal:      return XINT (num1) != XINT (num2) ? Qt : Qnil;
+    case arith_less:          return XINT (num1) <  XINT (num2) ? Qt : Qnil;
+    case arith_less_or_equal: return XINT (num1) <= XINT (num2) ? Qt : Qnil;
+    case arith_grtr:          return XINT (num1) >  XINT (num2) ? Qt : Qnil;
+    case arith_grtr_or_equal: return XINT (num1) >= XINT (num2) ? Qt : Qnil;
     }
+
+  abort ();
+  return Qnil; /* suppress compiler warning */
 }
 
-#define ARITHCOMPARE_MANY(op)                                  \
-{                                                              \
-  int_or_double iod1, iod2, *p = &iod1, *q = &iod2;            \
-  Lisp_Object *args_end = args + nargs;                                \
-                                                               \
-  number_char_or_marker_to_int_or_double (*args++, p);         \
-                                                               \
-  while (args < args_end)                                      \
-    {                                                          \
-      number_char_or_marker_to_int_or_double (*args++, q);     \
-                                                               \
-      if (!((p->int_p && q->int_p) ?                           \
-           (p->c.ival op q->c.ival) :                          \
-           ((p->int_p ? (double) p->c.ival : p->c.dval) op     \
-            (q->int_p ? (double) q->c.ival : q->c.dval))))     \
-       return Qnil;                                            \
-                                                               \
-      { /* swap */ int_or_double *r = p; p = q; q = r; }       \
-    }                                                          \
-  return Qt;                                                   \
+static Lisp_Object
+arithcompare_many (enum arith_comparison comparison,
+                  int nargs, Lisp_Object *args)
+{
+  for (; --nargs > 0; args++)
+    if (NILP (arithcompare (*args, *(args + 1), comparison)))
+      return Qnil;
+
+  return Qt;
 }
 
 DEFUN ("=", Feqlsign, 1, MANY, 0, /*
@@ -898,7 +1030,7 @@ The arguments may be numbers, characters or markers.
 */
        (int nargs, Lisp_Object *args))
 {
-  ARITHCOMPARE_MANY (==)
+  return arithcompare_many (arith_equal, nargs, args);
 }
 
 DEFUN ("<", Flss, 1, MANY, 0, /*
@@ -907,7 +1039,7 @@ The arguments may be numbers, characters or markers.
 */
        (int nargs, Lisp_Object *args))
 {
-  ARITHCOMPARE_MANY (<)
+  return arithcompare_many (arith_less, nargs, args);
 }
 
 DEFUN (">", Fgtr, 1, MANY, 0, /*
@@ -916,7 +1048,7 @@ The arguments may be numbers, characters or markers.
 */
        (int nargs, Lisp_Object *args))
 {
-  ARITHCOMPARE_MANY (>)
+  return arithcompare_many (arith_grtr, nargs, args);
 }
 
 DEFUN ("<=", Fleq, 1, MANY, 0, /*
@@ -925,7 +1057,7 @@ The arguments may be numbers, characters or markers.
 */
        (int nargs, Lisp_Object *args))
 {
-  ARITHCOMPARE_MANY (<=)
+  return arithcompare_many (arith_less_or_equal, nargs, args);
 }
 
 DEFUN (">=", Fgeq, 1, MANY, 0, /*
@@ -934,7 +1066,7 @@ The arguments may be numbers, characters or markers.
 */
        (int nargs, Lisp_Object *args))
 {
-  ARITHCOMPARE_MANY (>=)
+  return arithcompare_many (arith_grtr_or_equal, nargs, args);
 }
 
 DEFUN ("/=", Fneq, 1, MANY, 0, /*
@@ -943,28 +1075,7 @@ The arguments may be numbers, characters or markers.
 */
        (int nargs, Lisp_Object *args))
 {
-  Lisp_Object *args_end = args + nargs;
-  Lisp_Object *p, *q;
-
-  /* Unlike all the other comparisons, this is an N*N algorithm.
-     We could use a hash table for nargs > 50 to make this linear. */
-  for (p = args; p < args_end; p++)
-    {
-      int_or_double iod1, iod2;
-      number_char_or_marker_to_int_or_double (*p, &iod1);
-
-      for (q = p + 1; q < args_end; q++)
-       {
-         number_char_or_marker_to_int_or_double (*q, &iod2);
-
-         if (!((iod1.int_p && iod2.int_p) ?
-               (iod1.c.ival != iod2.c.ival) :
-               ((iod1.int_p ? (double) iod1.c.ival : iod1.c.dval) !=
-                (iod2.int_p ? (double) iod2.c.ival : iod2.c.dval))))
-           return Qnil;
-       }
-    }
-  return Qt;
+  return arithcompare_many (arith_notequal, nargs, args);
 }
 
 DEFUN ("zerop", Fzerop, 1, 1, 0, /*
@@ -972,18 +1083,14 @@ Return t if NUMBER is zero.
 */
        (number))
 {
- retry:
-  if (INTP (number))
-    return EQ (number, Qzero) ? Qt : Qnil;
+  CHECK_INT_OR_FLOAT (number);
+
 #ifdef LISP_FLOAT_TYPE
-  else if (FLOATP (number))
-    return XFLOAT_DATA (number) == 0.0 ? Qt : Qnil;
+  if (FLOATP (number))
+    return float_data (XFLOAT (number)) == 0.0 ? Qt : Qnil;
 #endif /* LISP_FLOAT_TYPE */
-  else
-    {
-      number = wrong_type_argument (Qnumberp, number);
-      goto retry;
-    }
+
+  return EQ (number, Qzero) ? Qt : Qnil;
 }
 \f
 /* Convert between a 32-bit value and a cons of two 16-bit values.
@@ -1031,7 +1138,7 @@ NUM may be an integer or a floating point number.
     {
       char pigbuf[350];        /* see comments in float_to_string */
 
-      float_to_string (pigbuf, XFLOAT_DATA (num));
+      float_to_string (pigbuf, float_data (XFLOAT (num)));
       return build_string (pigbuf);
     }
 #endif /* LISP_FLOAT_TYPE */
@@ -1092,7 +1199,7 @@ Floating point numbers always use base 10.
   if (b == 10)
     {
       /* Use the system-provided functions for base 10. */
-#if   SIZEOF_EMACS_INT == SIZEOF_INT
+#if SIZEOF_EMACS_INT == SIZEOF_INT
       return make_int (atoi (p));
 #elif SIZEOF_EMACS_INT == SIZEOF_LONG
       return make_int (atol (p));
@@ -1123,308 +1230,180 @@ Floating point numbers always use base 10.
     }
 }
 \f
+enum arithop
+  { Aadd, Asub, Amult, Adiv, Alogand, Alogior, Alogxor, Amax, Amin };
 
-DEFUN ("+", Fplus, 0, MANY, 0, /*
-Return sum of any number of arguments.
-The arguments should all be numbers, characters or markers.
-*/
-       (int nargs, Lisp_Object *args))
-{
-  EMACS_INT iaccum = 0;
-  Lisp_Object *args_end = args + nargs;
-
-  while (args < args_end)
-    {
-      int_or_double iod;
-      number_char_or_marker_to_int_or_double (*args++, &iod);
-      if (iod.int_p)
-       iaccum += iod.c.ival;
-      else
-       {
-         double daccum = (double) iaccum + iod.c.dval;
-         while (args < args_end)
-           daccum += number_char_or_marker_to_double (*args++);
-         return make_float (daccum);
-       }
-    }
-
-  return make_int (iaccum);
-}
 
-DEFUN ("-", Fminus, 1, MANY, 0, /*
-Negate number or subtract numbers, characters or markers.
-With one arg, negates it.  With more than one arg,
-subtracts all but the first from the first.
-*/
-       (int nargs, Lisp_Object *args))
+#ifdef LISP_FLOAT_TYPE
+static Lisp_Object
+float_arith_driver (double accum, int argnum, enum arithop code, int nargs,
+                   Lisp_Object *args)
 {
-  EMACS_INT iaccum;
-  double daccum;
-  Lisp_Object *args_end = args + nargs;
-  int_or_double iod;
+  REGISTER Lisp_Object val;
+  double next;
 
-  number_char_or_marker_to_int_or_double (*args++, &iod);
-  if (iod.int_p)
-    iaccum = nargs > 1 ? iod.c.ival : - iod.c.ival;
-  else
+  for (; argnum < nargs; argnum++)
     {
-      daccum = nargs > 1 ? iod.c.dval : - iod.c.dval;
-      goto do_float;
-    }
+      /* using args[argnum] as argument to CHECK_INT_OR_FLOAT_... */
+      val = args[argnum];
+      CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (val);
 
-  while (args < args_end)
-    {
-      number_char_or_marker_to_int_or_double (*args++, &iod);
-      if (iod.int_p)
-       iaccum -= iod.c.ival;
-      else
+      if (FLOATP (val))
        {
-         daccum = (double) iaccum - iod.c.dval;
-         goto do_float;
+         next = float_data (XFLOAT (val));
        }
-    }
-
-  return make_int (iaccum);
-
- do_float:
-  for (; args < args_end; args++)
-    daccum -= number_char_or_marker_to_double (*args);
-  return make_float (daccum);
-}
-
-DEFUN ("*", Ftimes, 0, MANY, 0, /*
-Return product of any number of arguments.
-The arguments should all be numbers, characters or markers.
-*/
-       (int nargs, Lisp_Object *args))
-{
-  EMACS_INT iaccum = 1;
-  Lisp_Object *args_end = args + nargs;
-
-  while (args < args_end)
-    {
-      int_or_double iod;
-      number_char_or_marker_to_int_or_double (*args++, &iod);
-      if (iod.int_p)
-       iaccum *= iod.c.ival;
       else
        {
-         double daccum = (double) iaccum * iod.c.dval;
-         while (args < args_end)
-           daccum *= number_char_or_marker_to_double (*args++);
-         return make_float (daccum);
+         args[argnum] = val;    /* runs into a compiler bug. */
+         next = XINT (args[argnum]);
        }
-    }
-
-  return make_int (iaccum);
-}
-
-DEFUN ("/", Fquo, 1, MANY, 0, /*
-Return first argument divided by all the remaining arguments.
-The arguments must be numbers, characters or markers.
-With one argument, reciprocates the argument.
-*/
-       (int nargs, Lisp_Object *args))
-{
-  EMACS_INT iaccum;
-  double daccum;
-  Lisp_Object *args_end = args + nargs;
-  int_or_double iod;
-
-  if (nargs == 1)
-    iaccum = 1;
-  else
-    {
-      number_char_or_marker_to_int_or_double (*args++, &iod);
-      if (iod.int_p)
-       iaccum = iod.c.ival;
-      else
+      switch (code)
        {
-         daccum = iod.c.dval;
-         goto divide_floats;
-       }
-    }
-
-  while (args < args_end)
-    {
-      number_char_or_marker_to_int_or_double (*args++, &iod);
-      if (iod.int_p)
-       {
-         if (iod.c.ival == 0) goto divide_by_zero;
-         iaccum /= iod.c.ival;
-       }
-      else
-       {
-         if (iod.c.dval == 0) goto divide_by_zero;
-         daccum = (double) iaccum / iod.c.dval;
-         goto divide_floats;
+       case Aadd:
+         accum += next;
+         break;
+       case Asub:
+         if (!argnum && nargs != 1)
+           next = - next;
+         accum -= next;
+         break;
+       case Amult:
+         accum *= next;
+         break;
+       case Adiv:
+         if (!argnum)
+           accum = next;
+         else
+           {
+             if (next == 0)
+               Fsignal (Qarith_error, Qnil);
+             accum /= next;
+           }
+         break;
+       case Alogand:
+       case Alogior:
+       case Alogxor:
+         return wrong_type_argument (Qinteger_char_or_marker_p, val);
+       case Amax:
+         if (!argnum || isnan (next) || next > accum)
+           accum = next;
+         break;
+       case Amin:
+         if (!argnum || isnan (next) || next < accum)
+           accum = next;
+         break;
        }
     }
 
-  return make_int (iaccum);
-
- divide_floats:
-  for (; args < args_end; args++)
-    {
-      double dval = number_char_or_marker_to_double (*args);
-      if (dval == 0) goto divide_by_zero;
-      daccum /= dval;
-    }
-  return make_float (daccum);
-
- divide_by_zero:
-  Fsignal (Qarith_error, Qnil);
-  return Qnil; /* not reached */
+  return make_float (accum);
 }
+#endif /* LISP_FLOAT_TYPE */
 
-DEFUN ("max", Fmax, 1, MANY, 0, /*
-Return largest of all the arguments.
-All arguments must be numbers, characters or markers.
-The value is always a number; markers and characters are converted
-to numbers.
-*/
-       (int nargs, Lisp_Object *args))
+static Lisp_Object
+arith_driver (enum arithop code, int nargs, Lisp_Object *args)
 {
-  EMACS_INT imax;
-  double dmax;
-  Lisp_Object *args_end = args + nargs;
-  int_or_double iod;
+  Lisp_Object val;
+  REGISTER int argnum;
+  REGISTER EMACS_INT accum = 0;
+  REGISTER EMACS_INT next;
 
-  number_char_or_marker_to_int_or_double (*args++, &iod);
-  if (iod.int_p)
-    imax = iod.c.ival;
-  else
+  switch (code)
     {
-      dmax = iod.c.dval;
-      goto max_floats;
-    }
-
-  while (args < args_end)
-    {
-      number_char_or_marker_to_int_or_double (*args++, &iod);
-      if (iod.int_p)
-       {
-         if (imax < iod.c.ival) imax = iod.c.ival;
-       }
-      else
-       {
-         dmax = (double) imax;
-         if (dmax < iod.c.dval) dmax = iod.c.dval;
-         goto max_floats;
-       }
-    }
-
-  return make_int (imax);
-
- max_floats:
-  while (args < args_end)
-    {
-      double dval = number_char_or_marker_to_double (*args++);
-      if (dmax < dval) dmax = dval;
+    case Alogior:
+    case Alogxor:
+    case Aadd:
+    case Asub:
+      accum = 0; break;
+    case Amult:
+      accum = 1; break;
+    case Alogand:
+      accum = -1; break;
+    case Adiv:
+    case Amax:
+    case Amin:
+      accum = 0; break;
+    default:
+      abort ();
     }
-  return make_float (dmax);
-}
-
-DEFUN ("min", Fmin, 1, MANY, 0, /*
-Return smallest of all the arguments.
-All arguments must be numbers, characters or markers.
-The value is always a number; markers and characters are converted
-to numbers.
-*/
-       (int nargs, Lisp_Object *args))
-{
-  EMACS_INT imin;
-  double dmin;
-  Lisp_Object *args_end = args + nargs;
-  int_or_double iod;
 
-  number_char_or_marker_to_int_or_double (*args++, &iod);
-  if (iod.int_p)
-    imin = iod.c.ival;
-  else
+  for (argnum = 0; argnum < nargs; argnum++)
     {
-      dmin = iod.c.dval;
-      goto min_floats;
-    }
+      /* using args[argnum] as argument to CHECK_INT_OR_FLOAT_... */
+      val = args[argnum];
+      CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (val);
 
-  while (args < args_end)
-    {
-      number_char_or_marker_to_int_or_double (*args++, &iod);
-      if (iod.int_p)
-       {
-         if (imin > iod.c.ival) imin = iod.c.ival;
-       }
-      else
+#ifdef LISP_FLOAT_TYPE
+      if (FLOATP (val)) /* time to do serious math */
+       return float_arith_driver ((double) accum, argnum, code,
+                                  nargs, args);
+#endif /* LISP_FLOAT_TYPE */
+      args[argnum] = val;    /* runs into a compiler bug. */
+      next = XINT (args[argnum]);
+      switch (code)
        {
-         dmin = (double) imin;
-         if (dmin > iod.c.dval) dmin = iod.c.dval;
-         goto min_floats;
+       case Aadd: accum += next; break;
+       case Asub:
+         if (!argnum && nargs != 1)
+           next = - next;
+         accum -= next;
+         break;
+       case Amult: accum *= next; break;
+       case Adiv:
+         if (!argnum) accum = next;
+         else
+           {
+             if (next == 0)
+               Fsignal (Qarith_error, Qnil);
+             accum /= next;
+           }
+         break;
+       case Alogand: accum &= next; break;
+       case Alogior: accum |= next; break;
+       case Alogxor: accum ^= next; break;
+       case Amax: if (!argnum || next > accum) accum = next; break;
+       case Amin: if (!argnum || next < accum) accum = next; break;
        }
     }
 
-  return make_int (imin);
-
- min_floats:
-  while (args < args_end)
-    {
-      double dval = number_char_or_marker_to_double (*args++);
-      if (dmin > dval) dmin = dval;
-    }
-  return make_float (dmin);
+  XSETINT (val, accum);
+  return val;
 }
 
-DEFUN ("logand", Flogand, 0, MANY, 0, /*
-Return bitwise-and of all the arguments.
-Arguments may be integers, or markers or characters converted to integers.
+DEFUN ("+", Fplus, 0, MANY, 0, /*
+Return sum of any number of arguments.
+The arguments should all be numbers, characters or markers.
 */
        (int nargs, Lisp_Object *args))
 {
-  EMACS_INT bits = ~0;
-  Lisp_Object *args_end = args + nargs;
-
-  while (args < args_end)
-    bits &= integer_char_or_marker_to_int (*args++);
-
-  return make_int (bits);
+  return arith_driver (Aadd, nargs, args);
 }
 
-DEFUN ("logior", Flogior, 0, MANY, 0, /*
-Return bitwise-or of all the arguments.
-Arguments may be integers, or markers or characters converted to integers.
+DEFUN ("-", Fminus, 0, MANY, 0, /*
+Negate number or subtract numbers, characters or markers.
+With one arg, negates it.  With more than one arg,
+subtracts all but the first from the first.
 */
        (int nargs, Lisp_Object *args))
 {
-  EMACS_INT bits = 0;
-  Lisp_Object *args_end = args + nargs;
-
-  while (args < args_end)
-    bits |= integer_char_or_marker_to_int (*args++);
-
-  return make_int (bits);
+  return arith_driver (Asub, nargs, args);
 }
 
-DEFUN ("logxor", Flogxor, 0, MANY, 0, /*
-Return bitwise-exclusive-or of all the arguments.
-Arguments may be integers, or markers or characters converted to integers.
+DEFUN ("*", Ftimes, 0, MANY, 0, /*
+Return product of any number of arguments.
+The arguments should all be numbers, characters or markers.
 */
        (int nargs, Lisp_Object *args))
 {
-  EMACS_INT bits = 0;
-  Lisp_Object *args_end = args + nargs;
-
-  while (args < args_end)
-    bits ^= integer_char_or_marker_to_int (*args++);
-
-  return make_int (bits);
+  return arith_driver (Amult, nargs, args);
 }
 
-DEFUN ("lognot", Flognot, 1, 1, 0, /*
-Return the bitwise complement of NUMBER.
-NUMBER may be an integer, marker or character converted to integer.
+DEFUN ("/", Fquo, 2, MANY, 0, /*
+Return first argument divided by all the remaining arguments.
+The arguments must be numbers, characters or markers.
 */
-       (number))
+       (int nargs, Lisp_Object *args))
 {
-  return make_int (~ integer_char_or_marker_to_int (number));
+  return arith_driver (Adiv, nargs, args);
 }
 
 DEFUN ("%", Frem, 2, 2, 0, /*
@@ -1433,13 +1412,13 @@ Both must be integers, characters or markers.
 */
        (num1, num2))
 {
-  int ival1 = integer_char_or_marker_to_int (num1);
-  int ival2 = integer_char_or_marker_to_int (num2);
+  CHECK_INT_COERCE_CHAR_OR_MARKER (num1);
+  CHECK_INT_COERCE_CHAR_OR_MARKER (num2);
 
-  if (ival2 == 0)
+  if (ZEROP (num2))
     Fsignal (Qarith_error, Qnil);
 
-  return make_int (ival1 % ival2);
+  return make_int (XINT (num1) % XINT (num2));
 }
 
 /* Note, ANSI *requires* the presence of the fmod() library routine.
@@ -1465,41 +1444,96 @@ If either argument is a float, a float will be returned.
 */
        (x, y))
 {
-  int_or_double iod1, iod2;
-  number_char_or_marker_to_int_or_double (x, &iod1);
-  number_char_or_marker_to_int_or_double (y, &iod2);
+  EMACS_INT i1, i2;
 
 #ifdef LISP_FLOAT_TYPE
-  if (!iod1.int_p || !iod2.int_p)
+  CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (x);
+  CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (y);
+
+  if (FLOATP (x) || FLOATP (y))
     {
-      double dval1 = iod1.int_p ? (double) iod1.c.ival : iod1.c.dval;
-      double dval2 = iod2.int_p ? (double) iod2.c.ival : iod2.c.dval;
-      if (dval2 == 0) goto divide_by_zero;
-      dval1 = fmod (dval1, dval2);
+      double f1, f2;
 
-      /* If the "remainder" comes out with the wrong sign, fix it.  */
-      if (dval2 < 0 ? dval1 > 0 : dval1 < 0)
-       dval1 += dval2;
+      f1 = ((FLOATP (x)) ? float_data (XFLOAT (x)) : XINT (x));
+      f2 = ((FLOATP (y)) ? float_data (XFLOAT (y)) : XINT (y));
+      if (f2 == 0)
+       Fsignal (Qarith_error, Qnil);
 
-      return make_float (dval1);
+      f1 = fmod (f1, f2);
+
+      /* If the "remainder" comes out with the wrong sign, fix it.  */
+      if (f2 < 0 ? f1 > 0 : f1 < 0)
+       f1 += f2;
+      return make_float (f1);
     }
-#endif /* LISP_FLOAT_TYPE */
-  {
-    int ival;
-    if (iod2.c.ival == 0) goto divide_by_zero;
+#else /* not LISP_FLOAT_TYPE */
+  CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (x);
+  CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (y);
+#endif /* not LISP_FLOAT_TYPE */
 
-    ival = iod1.c.ival % iod2.c.ival;
+  i1 = XINT (x);
+  i2 = XINT (y);
 
-    /* If the "remainder" comes out with the wrong sign, fix it.  */
-    if (iod2.c.ival < 0 ? ival > 0 : ival < 0)
-      ival += iod2.c.ival;
+  if (i2 == 0)
+    Fsignal (Qarith_error, Qnil);
 
-    return make_int (ival);
-  }
+  i1 %= i2;
 
- divide_by_zero:
-  Fsignal (Qarith_error, Qnil);
-  return Qnil; /* not reached */
+  /* If the "remainder" comes out with the wrong sign, fix it.  */
+  if (i2 < 0 ? i1 > 0 : i1 < 0)
+    i1 += i2;
+
+  return make_int (i1);
+}
+
+
+DEFUN ("max", Fmax, 1, MANY, 0, /*
+Return largest of all the arguments.
+All arguments must be numbers, characters or markers.
+The value is always a number; markers and characters are converted
+to numbers.
+*/
+       (int nargs, Lisp_Object *args))
+{
+  return arith_driver (Amax, nargs, args);
+}
+
+DEFUN ("min", Fmin, 1, MANY, 0, /*
+Return smallest of all the arguments.
+All arguments must be numbers, characters or markers.
+The value is always a number; markers and characters are converted
+to numbers.
+*/
+       (int nargs, Lisp_Object *args))
+{
+  return arith_driver (Amin, nargs, args);
+}
+
+DEFUN ("logand", Flogand, 0, MANY, 0, /*
+Return bitwise-and of all the arguments.
+Arguments may be integers, or markers or characters converted to integers.
+*/
+       (int nargs, Lisp_Object *args))
+{
+  return arith_driver (Alogand, nargs, args);
+}
+
+DEFUN ("logior", Flogior, 0, MANY, 0, /*
+Return bitwise-or of all the arguments.
+Arguments may be integers, or markers or characters converted to integers.
+*/
+       (int nargs, Lisp_Object *args))
+{
+  return arith_driver (Alogior, nargs, args);
+}
+
+DEFUN ("logxor", Flogxor, 0, MANY, 0, /*
+Return bitwise-exclusive-or of all the arguments.
+Arguments may be integers, or markers or characters converted to integers.
+*/
+       (int nargs, Lisp_Object *args))
+{
+  return arith_driver (Alogxor, nargs, args);
 }
 
 DEFUN ("ash", Fash, 2, 2, 0, /*
@@ -1510,7 +1544,7 @@ In this case, the sign bit is duplicated.
        (value, count))
 {
   CHECK_INT_COERCE_CHAR (value);
-  CONCHECK_INT (count);
+  CHECK_INT (count);
 
   return make_int (XINT (count) > 0 ?
                   XINT (value) <<  XINT (count) :
@@ -1525,7 +1559,7 @@ In this case, zeros are shifted in on the left.
        (value, count))
 {
   CHECK_INT_COERCE_CHAR (value);
-  CONCHECK_INT (count);
+  CHECK_INT (count);
 
   return make_int (XINT (count) > 0 ?
                   XUINT (value) <<  XINT (count) :
@@ -1533,41 +1567,44 @@ In this case, zeros are shifted in on the left.
 }
 
 DEFUN ("1+", Fadd1, 1, 1, 0, /*
-Return NUMBER plus one.  NUMBER may be a number, character or marker.
+Return NUMBER plus one.  NUMBER may be a number or a marker.
 Markers and characters are converted to integers.
 */
        (number))
 {
- retry:
+  CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (number);
 
-  if (INTP    (number)) return make_int (XINT  (number) + 1);
-  if (CHARP   (number)) return make_int (XCHAR (number) + 1);
-  if (MARKERP (number)) return make_int (marker_position (number) + 1);
 #ifdef LISP_FLOAT_TYPE
-  if (FLOATP  (number)) return make_float (XFLOAT_DATA (number) + 1.0);
+  if (FLOATP (number))
+    return make_float (1.0 + float_data (XFLOAT (number)));
 #endif /* LISP_FLOAT_TYPE */
 
-  number = wrong_type_argument (Qnumber_char_or_marker_p, number);
-  goto retry;
+  return make_int (XINT (number) + 1);
 }
 
 DEFUN ("1-", Fsub1, 1, 1, 0, /*
-Return NUMBER minus one.  NUMBER may be a number, character or marker.
+Return NUMBER minus one.  NUMBER may be a number or a marker.
 Markers and characters are converted to integers.
 */
        (number))
 {
- retry:
+  CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (number);
 
-  if (INTP    (number)) return make_int (XINT  (number) - 1);
-  if (CHARP   (number)) return make_int (XCHAR (number) - 1);
-  if (MARKERP (number)) return make_int (marker_position (number) - 1);
 #ifdef LISP_FLOAT_TYPE
-  if (FLOATP  (number)) return make_float (XFLOAT_DATA (number) - 1.0);
+  if (FLOATP (number))
+    return make_float (-1.0 + (float_data (XFLOAT (number))));
 #endif /* LISP_FLOAT_TYPE */
 
-  number = wrong_type_argument (Qnumber_char_or_marker_p, number);
-  goto retry;
+  return make_int (XINT (number) - 1);
+}
+
+DEFUN ("lognot", Flognot, 1, 1, 0, /*
+Return the bitwise complement of NUMBER.  NUMBER must be an integer.
+*/
+       (number))
+{
+  CHECK_INT (number);
+  return make_int (~XINT (number));
 }
 
 \f
@@ -1579,7 +1616,7 @@ Markers and characters are converted to integers.
    disappear when no longer in use, i.e. when no longer GC-protected.
    The basic idea is that we don't mark the elements during GC, but
    wait for them to be marked elsewhere.  If they're not marked, we
-   remove them.  This is analogous to weak hash tables; see the explanation
+   remove them.  This is analogous to weak hashtables; see the explanation
    there for more info. */
 
 static Lisp_Object Vall_weak_lists; /* Gemarke es nicht!!! */
@@ -1607,10 +1644,10 @@ print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 }
 
 static int
-weak_list_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+weak_list_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
-  struct weak_list *w1 = XWEAK_LIST (obj1);
-  struct weak_list *w2 = XWEAK_LIST (obj2);
+  struct weak_list *w1 = XWEAK_LIST (o1);
+  struct weak_list *w2 = XWEAK_LIST (o2);
 
   return ((w1->type == w2->type) &&
          internal_equal (w1->list, w2->list, depth + 1));
@@ -1675,7 +1712,7 @@ finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
       Lisp_Object rest2;
       enum weak_list_type type = XWEAK_LIST (rest)->type;
 
-      if (! obj_marked_p (rest))
+      if (! ((*obj_marked_p) (rest)))
        /* The weak list is probably garbage.  Ignore it. */
        continue;
 
@@ -1698,7 +1735,7 @@ finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
             (either because of an external pointer or because of
             a previous call to this function), and likewise for all
             the rest of the elements in the list, so we can stop now. */
-         if (obj_marked_p (rest2))
+         if ((*obj_marked_p) (rest2))
            break;
 
          elem = XCAR (rest2);
@@ -1706,7 +1743,7 @@ finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
          switch (type)
            {
            case WEAK_LIST_SIMPLE:
-             if (obj_marked_p (elem))
+             if ((*obj_marked_p) (elem))
                need_to_mark_cons = 1;
              break;
 
@@ -1717,8 +1754,8 @@ finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
                  need_to_mark_cons = 1;
                  need_to_mark_elem = 1;
                }
-             else if (obj_marked_p (XCAR (elem)) &&
-                      obj_marked_p (XCDR (elem)))
+             else if ((*obj_marked_p) (XCAR (elem)) &&
+                 (*obj_marked_p) (XCDR (elem)))
                {
                  need_to_mark_cons = 1;
                  /* We still need to mark elem, because it's
@@ -1734,7 +1771,7 @@ finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
                  need_to_mark_cons = 1;
                  need_to_mark_elem = 1;
                }
-             else if (obj_marked_p (XCAR (elem)))
+             else if ((*obj_marked_p) (XCAR (elem)))
                {
                  need_to_mark_cons = 1;
                  /* We still need to mark elem and XCDR (elem);
@@ -1750,7 +1787,7 @@ finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
                  need_to_mark_cons = 1;
                  need_to_mark_elem = 1;
                }
-             else if (obj_marked_p (XCDR (elem)))
+             else if ((*obj_marked_p) (XCDR (elem)))
                {
                  need_to_mark_cons = 1;
                  /* We still need to mark elem and XCAR (elem);
@@ -1763,9 +1800,9 @@ finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
              abort ();
            }
 
-         if (need_to_mark_elem && ! obj_marked_p (elem))
+         if (need_to_mark_elem && ! (*obj_marked_p) (elem))
            {
-             markobj (elem);
+             (*markobj) (elem);
              did_mark = 1;
            }
 
@@ -1787,9 +1824,9 @@ finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
 
       /* In case of imperfect list, need to mark the final cons
          because we're not removing it */
-      if (!GC_NILP (rest2) && ! obj_marked_p (rest2))
+      if (!GC_NILP (rest2) && ! (obj_marked_p) (rest2))
        {
-         markobj (rest2);
+         (markobj) (rest2);
          did_mark = 1;
        }
     }
@@ -1806,7 +1843,7 @@ prune_weak_lists (int (*obj_marked_p) (Lisp_Object))
        !GC_NILP (rest);
        rest = XWEAK_LIST (rest)->next_weak)
     {
-      if (! (obj_marked_p (rest)))
+      if (! ((*obj_marked_p) (rest)))
        {
          /* This weak list itself is garbage.  Remove it from the list. */
          if (GC_NILP (prev))
@@ -1836,7 +1873,7 @@ prune_weak_lists (int (*obj_marked_p) (Lisp_Object))
                    have been marked in finish_marking_weak_lists().
                 -- otherwise, it's not marked and should disappear.
                 */
-             if (! obj_marked_p (rest2))
+             if (!(*obj_marked_p) (rest2))
                {
                  /* bye bye :-( */
                  if (GC_NILP (prev2))
@@ -2049,17 +2086,14 @@ init_errors_once_early (void)
            "Attempt to set a constant symbol", Qerror);
   deferror (&Qinvalid_read_syntax, "invalid-read-syntax",
            "Invalid read syntax", Qerror);
-
-  /* Generated by list traversal macros */
   deferror (&Qmalformed_list, "malformed-list",
            "Malformed list", Qerror);
   deferror (&Qmalformed_property_list, "malformed-property-list",
-           "Malformed property list", Qmalformed_list);
+           "Malformed property list", Qerror);
   deferror (&Qcircular_list, "circular-list",
            "Circular list", Qerror);
   deferror (&Qcircular_property_list, "circular-property-list",
-           "Circular property list", Qcircular_list);
-
+           "Circular property list", Qerror);
   deferror (&Qinvalid_function, "invalid-function", "Invalid function",
            Qerror);
   deferror (&Qwrong_number_of_arguments, "wrong-number-of-arguments",
@@ -2112,6 +2146,7 @@ syms_of_data (void)
   defsymbol (&Qbitp, "bitp");
   defsymbol (&Qbit_vectorp, "bit-vector-p");
   defsymbol (&Qvectorp, "vectorp");
+  defsymbol (&Qcompiled_functionp, "compiled-function-p");
   defsymbol (&Qchar_or_string_p, "char-or-string-p");
   defsymbol (&Qmarkerp, "markerp");
   defsymbol (&Qinteger_or_marker_p, "integer-or-marker-p");
@@ -2132,7 +2167,6 @@ syms_of_data (void)
   DEFSUBR (Feq);
   DEFSUBR (Fold_eq);
   DEFSUBR (Fnull);
-  Ffset (intern ("not"), intern ("null"));
   DEFSUBR (Flistp);
   DEFSUBR (Fnlistp);
   DEFSUBR (Ftrue_list_p);
@@ -2168,6 +2202,7 @@ syms_of_data (void)
   DEFSUBR (Fsubr_min_args);
   DEFSUBR (Fsubr_max_args);
   DEFSUBR (Fsubr_interactive);
+  DEFSUBR (Fcompiled_function_p);
   DEFSUBR (Ftype_of);
   DEFSUBR (Fcar);
   DEFSUBR (Fcdr);
@@ -2179,6 +2214,17 @@ syms_of_data (void)
   DEFSUBR (Faref);
   DEFSUBR (Faset);
 
+  DEFSUBR (Fcompiled_function_instructions);
+  DEFSUBR (Fcompiled_function_constants);
+  DEFSUBR (Fcompiled_function_stack_depth);
+  DEFSUBR (Fcompiled_function_arglist);
+  DEFSUBR (Fcompiled_function_interactive);
+  DEFSUBR (Fcompiled_function_doc_string);
+  DEFSUBR (Fcompiled_function_domain);
+#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
+  DEFSUBR (Fcompiled_function_annotation);
+#endif
+
   DEFSUBR (Fnumber_to_string);
   DEFSUBR (Fstring_to_number);
   DEFSUBR (Feqlsign);
@@ -2220,9 +2266,9 @@ vars_of_data (void)
 
 #ifdef DEBUG_XEMACS
   DEFVAR_INT ("debug-issue-ebola-notices", &debug_issue_ebola_notices /*
-If non-zero, note when your code may be suffering from char-int confoundance.
+If non-nil, note when your code may be suffering from char-int confoundance.
 That is to say, if XEmacs encounters a usage of `eq', `memq', `equal',
-etc. where an int and a char with the same value are being compared,
+etc. where a int and a char with the same value are being compared,
 it will issue a notice on stderr to this effect, along with a backtrace.
 In such situations, the result would be different in XEmacs 19 versus
 XEmacs 20, and you probably don't want this.
index 350f9af..c30e990 100644 (file)
@@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA.  */
 #include <config.h>
 #include "lisp.h"
 #include "sysfile.h"
-#include "buffer.h"
 #include <errno.h>
 
 #ifndef HAVE_DATABASE
@@ -66,34 +65,29 @@ Lisp_Object Qhash, Qbtree, Qrecno, Qunknown;
 Lisp_Object Qdbm;
 #endif /* HAVE_DBM */
 
-#ifdef MULE
-/* #### The following should be settable on a per-database level.
-   But the whole coding-system infrastructure should be rewritten someday.
-   We really need coding-system aliases. -- martin */
-Lisp_Object Vdatabase_coding_system;
-#endif
-
 Lisp_Object Qdatabasep;
 
+typedef enum { DB_DBM, DB_BERKELEY, DB_IS_UNKNOWN } XEMACS_DB_TYPE;
+
 struct Lisp_Database;
-typedef struct Lisp_Database Lisp_Database;
 
 typedef struct
 {
-  Lisp_Object (*get_subtype) (Lisp_Database *);
-  Lisp_Object (*get_type) (Lisp_Database *);
-  Lisp_Object (*get) (Lisp_Database *, Lisp_Object);
-  int (*put) (Lisp_Database *, Lisp_Object, Lisp_Object, Lisp_Object);
-  int (*rem) (Lisp_Database *, Lisp_Object);
-  void (*map) (Lisp_Database *, Lisp_Object);
-  void (*close) (Lisp_Database *);
-  Lisp_Object (*last_error) (Lisp_Database *);
+  Lisp_Object (*get_subtype) (struct Lisp_Database *);
+  Lisp_Object (*get_type) (struct Lisp_Database *);
+  Lisp_Object (*get) (struct Lisp_Database *, Lisp_Object);
+  int (*put) (struct Lisp_Database *, Lisp_Object, Lisp_Object, Lisp_Object);
+  int (*rem) (struct Lisp_Database *, Lisp_Object);
+  void (*map) (struct Lisp_Database *, Lisp_Object);
+  void (*close) (struct Lisp_Database *);
+  Lisp_Object (*last_error) (struct Lisp_Database *);
 } DB_FUNCS;
 
 struct Lisp_Database
 {
   struct lcrecord_header header;
   Lisp_Object fname;
+  XEMACS_DB_TYPE type;
   int mode;
   int access_;
   int dberrno;
@@ -110,7 +104,7 @@ struct Lisp_Database
 #endif
 };
 
-#define XDATABASE(x) XRECORD (x, database, Lisp_Database)
+#define XDATABASE(x) XRECORD (x, database, struct Lisp_Database)
 #define XSETDATABASE(x, p) XSETRECORD (x, p, database)
 #define DATABASEP(x) RECORDP (x, database)
 #define GC_DATABASEP(x) GC_RECORDP (x, database)
@@ -125,10 +119,11 @@ struct Lisp_Database
 } while (0)
 
 
-static Lisp_Database *
+static struct Lisp_Database *
 allocate_database (void)
 {
-  Lisp_Database *db = alloc_lcrecord_type (Lisp_Database, lrecord_database);
+  struct Lisp_Database *db =
+    alloc_lcrecord_type (struct Lisp_Database, lrecord_database);
 
   db->fname = Qnil;
   db->live_p = 0;
@@ -141,6 +136,7 @@ allocate_database (void)
   db->access_ = 0;
   db->mode = 0;
   db->dberrno = 0;
+  db->type = DB_IS_UNKNOWN;
 #ifdef MULE
   db->coding_system = Fget_coding_system (Qbinary);
 #endif
@@ -150,9 +146,9 @@ allocate_database (void)
 static Lisp_Object
 mark_database (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
-  Lisp_Database *db = XDATABASE (obj);
+  struct Lisp_Database *db = XDATABASE (obj);
 
-  markobj (db->fname);
+  ((markobj) (db->fname));
   return Qnil;
 }
 
@@ -160,7 +156,7 @@ static void
 print_database (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
   char buf[64];
-  Lisp_Database *db = XDATABASE (obj);
+  struct Lisp_Database *db = XDATABASE (obj);
 
   if (print_readably)
     error ("printing unreadable object #<database 0x%x>", db->header.uid);
@@ -180,12 +176,12 @@ print_database (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 static void
 finalize_database (void *header, int for_disksave)
 {
-  Lisp_Database *db = (Lisp_Database *) header;
+  struct Lisp_Database *db = (struct Lisp_Database *) header;
 
   if (for_disksave)
     {
       Lisp_Object obj;
-      XSETDATABASE (obj, db);
+      XSETOBJ (obj, Lisp_Type_Record, (void *) db);
 
       signal_simple_error
        ("Can't dump an emacs containing database objects", obj);
@@ -196,14 +192,14 @@ finalize_database (void *header, int for_disksave)
 DEFINE_LRECORD_IMPLEMENTATION ("database", database,
                                mark_database, print_database,
                               finalize_database, 0, 0,
-                              Lisp_Database);
+                              struct Lisp_Database);
 
 DEFUN ("close-database", Fclose_database, 1, 1, 0, /*
 Close database DATABASE.
 */
        (database))
 {
-  Lisp_Database *db;
+  struct Lisp_Database *db;
   CHECK_LIVE_DATABASE (database);
   db = XDATABASE (database);
   db->funcs->close (db);
@@ -259,7 +255,7 @@ Return t if OBJ is a database.
 
 #ifdef HAVE_DBM
 static void
-dbm_map (Lisp_Database *db, Lisp_Object func)
+dbm_map (struct Lisp_Database *db, Lisp_Object func)
 {
   datum keydatum, valdatum;
   Lisp_Object key, val;
@@ -276,7 +272,7 @@ dbm_map (Lisp_Database *db, Lisp_Object func)
 }
 
 static Lisp_Object
-dbm_get (Lisp_Database *db, Lisp_Object key)
+dbm_get (struct Lisp_Database *db, Lisp_Object key)
 {
   datum keydatum, valdatum;
 
@@ -290,7 +286,7 @@ dbm_get (Lisp_Database *db, Lisp_Object key)
 }
 
 static int
-dbm_put (Lisp_Database *db,
+dbm_put (struct Lisp_Database *db,
         Lisp_Object key, Lisp_Object val, Lisp_Object replace)
 {
   datum keydatum, valdatum;
@@ -305,7 +301,7 @@ dbm_put (Lisp_Database *db,
 }
 
 static int
-dbm_remove (Lisp_Database *db, Lisp_Object key)
+dbm_remove (struct Lisp_Database *db, Lisp_Object key)
 {
   datum keydatum;
 
@@ -316,25 +312,25 @@ dbm_remove (Lisp_Database *db, Lisp_Object key)
 }
 
 static Lisp_Object
-dbm_type (Lisp_Database *db)
+dbm_type (struct Lisp_Database *db)
 {
   return Qdbm;
 }
 
 static Lisp_Object
-dbm_subtype (Lisp_Database *db)
+dbm_subtype (struct Lisp_Database *db)
 {
   return Qnil;
 }
 
 static Lisp_Object
-dbm_lasterr (Lisp_Database *db)
+dbm_lasterr (struct Lisp_Database *db)
 {
   return lisp_strerror (db->dberrno);
 }
 
 static void
-dbm_closeit (Lisp_Database *db)
+dbm_closeit (struct Lisp_Database *db)
 {
   if (db->dbm_handle)
     {
@@ -358,13 +354,13 @@ static DB_FUNCS ndbm_func_block =
 
 #ifdef HAVE_BERKELEY_DB
 static Lisp_Object
-berkdb_type (Lisp_Database *db)
+berkdb_type (struct Lisp_Database *db)
 {
   return Qberkeley_db;
 }
 
 static Lisp_Object
-berkdb_subtype (Lisp_Database *db)
+berkdb_subtype (struct Lisp_Database *db)
 {
   if (!db->db_handle)
     return Qnil;
@@ -379,20 +375,23 @@ berkdb_subtype (Lisp_Database *db)
 }
 
 static Lisp_Object
-berkdb_lasterr (Lisp_Database *db)
+berkdb_lasterr (struct Lisp_Database *db)
 {
   return lisp_strerror (db->dberrno);
 }
 
 static Lisp_Object
-berkdb_get (Lisp_Database *db, Lisp_Object key)
+berkdb_get (struct Lisp_Database *db, Lisp_Object key)
 {
+  /* #### Needs mule-izing */
   DBT keydatum, valdatum;
   int status = 0;
 
-  /* DB Version 2 requires DBT's to be zeroed before use. */
+#if DB_VERSION_MAJOR == 2
+  /* Always initialize keydatum, valdatum. */
   xzero (keydatum);
   xzero (valdatum);
+#endif /* DV_VERSION_MAJOR = 2 */
 
   keydatum.data = XSTRING_DATA (key);
   keydatum.size = XSTRING_LENGTH (key);
@@ -404,7 +403,6 @@ berkdb_get (Lisp_Database *db, Lisp_Object key)
 #endif /* DB_VERSION_MAJOR */
 
   if (!status)
-    /* #### Not mule-ized! will crash! */
     return make_string ((Bufbyte *) valdatum.data, valdatum.size);
 
 #if DB_VERSION_MAJOR == 1
@@ -417,7 +415,7 @@ berkdb_get (Lisp_Database *db, Lisp_Object key)
 }
 
 static int
-berkdb_put (Lisp_Database *db,
+berkdb_put (struct Lisp_Database *db,
            Lisp_Object key,
            Lisp_Object val,
            Lisp_Object replace)
@@ -425,9 +423,11 @@ berkdb_put (Lisp_Database *db,
   DBT keydatum, valdatum;
   int status = 0;
 
-  /* DB Version 2 requires DBT's to be zeroed before use. */
+#if DB_VERSION_MAJOR == 2
+  /* Always initalize keydatum, valdatum. */
   xzero (keydatum);
   xzero (valdatum);
+#endif /* DV_VERSION_MAJOR = 2 */
 
   keydatum.data = XSTRING_DATA   (key);
   keydatum.size = XSTRING_LENGTH (key);
@@ -447,13 +447,15 @@ berkdb_put (Lisp_Database *db,
 }
 
 static int
-berkdb_remove (Lisp_Database *db, Lisp_Object key)
+berkdb_remove (struct Lisp_Database *db, Lisp_Object key)
 {
   DBT keydatum;
   int status;
 
-  /* DB Version 2 requires DBT's to be zeroed before use. */
+#if DB_VERSION_MAJOR == 2
+  /* Always initialize keydatum. */
   xzero (keydatum);
+#endif /* DV_VERSION_MAJOR = 2 */
 
   keydatum.data = XSTRING_DATA   (key);
   keydatum.size = XSTRING_LENGTH (key);
@@ -477,16 +479,13 @@ berkdb_remove (Lisp_Database *db, Lisp_Object key)
 }
 
 static void
-berkdb_map (Lisp_Database *db, Lisp_Object func)
+berkdb_map (struct Lisp_Database *db, Lisp_Object func)
 {
   DBT keydatum, valdatum;
   Lisp_Object key, val;
   DB *dbp = db->db_handle;
   int status;
 
-  xzero (keydatum);
-  xzero (valdatum);
-
 #if DB_VERSION_MAJOR == 1
   for (status = dbp->seq (dbp, &keydatum, &valdatum, R_FIRST);
        status == 0;
@@ -498,26 +497,27 @@ berkdb_map (Lisp_Database *db, Lisp_Object func)
       call2 (func, key, val);
     }
 #else
-  {
-    DBC *dbcp;
+  DBC *dbcp;
+  /* Initialize the key/data pair so the flags aren't set. */
+  xzero (keydatum);
+  xzero (valdatum);
 
-    status = dbp->cursor (dbp, NULL, &dbcp);
-    for (status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_FIRST);
-        status == 0;
-        status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_NEXT))
-      {
-       /* ### Needs mule-izing */
-       key = make_string ((Bufbyte *) keydatum.data, keydatum.size);
-       val = make_string ((Bufbyte *) valdatum.data, valdatum.size);
-       call2 (func, key, val);
-      }
-    dbcp->c_close (dbcp);
-  }
+  status = dbp->cursor (dbp, NULL, &dbcp);
+  for (status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_FIRST);
+       status == 0;
+       status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_NEXT))
+    {
+      /* ### Needs mule-izing */
+      key = make_string ((Bufbyte *) keydatum.data, keydatum.size);
+      val = make_string ((Bufbyte *) valdatum.data, valdatum.size);
+      call2 (func, key, val);
+    }
+  dbcp->c_close (dbcp);
 #endif /* DB_VERSION_MAJOR */
 }
 
 static void
-berkdb_close (Lisp_Database *db)
+berkdb_close (struct Lisp_Database *db)
 {
   if (db->db_handle)
     {
@@ -571,7 +571,7 @@ and defaults to 0755.
   /* This function can GC */
   int modemask;
   int accessmask = 0;
-  Lisp_Database *db = NULL;
+  struct Lisp_Database *db = NULL;
   char *filename;
   struct gcpro gcpro1, gcpro2;
 
@@ -579,8 +579,7 @@ and defaults to 0755.
   GCPRO2 (file, access_);
   file = Fexpand_file_name (file, Qnil);
   UNGCPRO;
-
-  GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (XSTRING_DATA (file), filename);
+  filename = (char *) XSTRING_DATA (file);
 
   if (NILP (access_))
     {
@@ -623,6 +622,7 @@ and defaults to 0755.
 
       db = allocate_database ();
       db->dbm_handle = dbase;
+      db->type = DB_DBM;
       db->funcs = &ndbm_func_block;
       goto db_done;
     }
@@ -676,6 +676,7 @@ and defaults to 0755.
 
       db = allocate_database ();
       db->db_handle = dbase;
+      db->type = DB_BERKELEY;
       db->funcs = &berk_func_block;
       goto db_done;
     }
@@ -708,7 +709,7 @@ replace any existing entry in the database.
   CHECK_STRING (key);
   CHECK_STRING (value);
   {
-    Lisp_Database *db = XDATABASE (database);
+    struct Lisp_Database *db = XDATABASE (database);
     int status = db->funcs->put (db, key, value, replace);
     return status ? Qt : Qnil;
   }
@@ -722,7 +723,7 @@ Remove KEY from DATABASE.
   CHECK_LIVE_DATABASE (database);
   CHECK_STRING (key);
   {
-    Lisp_Database *db = XDATABASE (database);
+    struct Lisp_Database *db = XDATABASE (database);
     int status = db->funcs->rem (db, key);
     return status ? Qt : Qnil;
   }
@@ -737,7 +738,7 @@ If there is no corresponding value, return DEFAULT (defaults to nil).
   CHECK_LIVE_DATABASE (database);
   CHECK_STRING (key);
   {
-    Lisp_Database *db = XDATABASE (database);
+    struct Lisp_Database *db = XDATABASE (database);
     Lisp_Object retval = db->funcs->get (db, key);
     return NILP (retval) ? default_ : retval;
   }
@@ -794,13 +795,4 @@ vars_of_database (void)
 #ifdef HAVE_BERKELEY_DB
   Fprovide (Qberkeley_db);
 #endif
-
-#if 0 /* #### implement me! */
-#ifdef MULE
-  DEFVAR_LISP ("database-coding-system", &Vdatabase_coding_system /*
-Coding system used to convert data in database files.
-*/ );
-  Vdatabase_coding_system = Qnil;
-#endif
-#endif /* 0 */
 }
diff --git a/src/dbxrc b/src/dbxrc
new file mode 100644 (file)
index 0000000..b9ae837
--- /dev/null
+++ b/src/dbxrc
@@ -0,0 +1,318 @@
+# -*- ksh -*-
+# Copyright (C) 1998 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.
+
+# Author: Martin Buchholz
+
+# You can use this file to debug XEmacs using Sun WorkShop's dbx.
+# Add the contents of this file to $HOME/.dbxrc or
+# Source the contents of this file with something like:
+# test -r ./dbxrc && . ./dbxrc
+
+# Some functions defined here require a running process, but most
+# don't.  Considerable effort has been expended to this end.
+
+# See also the comments in gdbinit.
+
+# See also the question of the XEmacs FAQ, titled
+# "How to Debug an XEmacs problem with a debugger".
+
+ignore POLL
+ignore IO
+
+document lbt << 'end'
+Usage: lbt
+Print the current Lisp stack trace.
+Requires a running xemacs process.
+end
+
+function lbt {
+  call debug_backtrace()
+}
+
+document ldp << 'end'
+Usage: ldp lisp_object
+Print a Lisp Object value using the Lisp printer.
+Requires a running xemacs process.
+end
+
+function ldp {
+  call debug_print ($1);
+}
+
+# A bug in dbx prevents string variables from having values beginning with `-'!!
+function XEmacsInit {
+  eval $(echo $(whatis -t `alloc.c`dbg_constants) | \
+    perl -e 'print "@{[map {s/=(-\d+)/sprintf(q[=0x%x],$1)/oge; /\w+=[0-9a-fx]+/og} <>]}\n"')
+  xemacs_initted=yes
+  #printvar dbg_valbits dbg_valmask
+}
+
+function printvar {
+  for i in $*; do eval "echo $i=\$$i"; done
+}
+
+document decode_object << 'end'
+Usage: decode_object lisp_object
+Extract implementation information from a Lisp Object.
+Defines variables $val, $type and $imp.
+end
+
+# Various dbx bugs cause ugliness in following code
+function decode_object {
+  test -z "$xemacs_initted" && XEmacsInit
+  obj=$[*(void**)(&$1)]
+  test "$obj" = "(nil)" && obj="0x0"
+  if test $dbg_USE_MINIMAL_TAGBITS = 1; then
+    if test $[(int)($obj & 1)] = 1; then
+      # It's an int
+      val=$[(long)(((unsigned long long)$obj) >> 1)]
+      type=$dbg_Lisp_Type_Int
+    else
+      type=$[(int)(((void*)$obj) & $dbg_typemask)]
+      if test $type = $dbg_Lisp_Type_Char; then
+        val=$[(void*)(long)(((unsigned long long)($obj & $dbg_valmask)) >> $dbg_gctypebits)]
+      else
+        # It's a record pointer
+        val=$[(void*)$obj]
+      fi
+    fi
+  else
+    # not dbg_USE_MINIMAL_TAGBITS
+    val=$[(void*)($obj & $dbg_valmask)]
+    test "$val" = "(nil)" && val="0x0"
+    type=$[(int)(((unsigned long long)($obj & $dbg_typemask)) >> ($dbg_valbits + 1))]
+  fi
+
+  if test $type = $dbg_Lisp_Type_Record; then
+    typeset lheader="((struct lrecord_header *) $val)"
+    if test $dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1; then
+      imp=$[(void*)(lrecord_implementations_table[$lheader->type])]
+    else
+      imp=$[(void*)($lheader->implementation)]
+    fi
+  else
+    imp="0xdeadbeef"
+  fi
+  #printvar obj val type imp
+}
+
+function xint {
+  decode_object "$*"
+  print (long) ($val)
+}
+
+function xtype {
+  decode_object "$*"
+  if   test $type = $dbg_Lisp_Type_Int;    then echo "int"
+  elif test $type = $dbg_Lisp_Type_Char;   then echo "char"
+  elif test $type = $dbg_Lisp_Type_Symbol; then echo "symbol"
+  elif test $type = $dbg_Lisp_Type_String; then echo "string"
+  elif test $type = $dbg_Lisp_Type_Vector; then echo "vector"
+  elif test $type = $dbg_Lisp_Type_Cons;   then echo "cons"
+  else
+    echo "record type with name: $[((struct lrecord_implementation *)$imp)->name]"
+  fi
+}
+
+document run-temacs << 'end'
+Usage: run-temacs
+Run temacs interactively, like xemacs.
+Use this with debugging tools (like purify) that cannot deal with dumping,
+or when temacs builds successfully, but xemacs does not.
+end
+
+function run-temacs {
+  unset EMACSLOADPATH
+  export EMACSBOOTSTRAPLOADPATH=../lisp/:..
+  run -batch -l ../lisp/loadup.el run-temacs -q
+}
+
+document update-elc << 'end'
+Usage: update-elc
+Run the core lisp byte compilation part of the build procedure.
+Use when debugging temacs, not xemacs!
+Use this when temacs builds successfully, but xemacs does not.
+end
+
+function update-elc {
+  unset EMACSLOADPATH
+  export EMACSBOOTSTRAPLOADPATH=../lisp/:..
+  run -batch -l ../lisp/update-elc.el
+}
+
+
+function dump-temacs {
+  unset EMACSLOADPATH
+  export EMACSBOOTSTRAPLOADPATH=../lisp/:..
+  run -batch -l ../lisp/loadup.el dump
+}
+
+document dump-temacs << 'end'
+Usage: dump-temacs
+Run the dumping part of the build procedure.
+Use when debugging temacs, not xemacs!
+Use this when temacs builds successfully, but xemacs does not.
+end
+
+function pstruct {
+  xstruct="((struct $1 *) $val)"
+  print $xstruct
+  print *$xstruct
+}
+
+function lrecord_type_p {
+  if eval test -z \"\$lrecord_$1\" && test $imp = $[(void*)(&lrecord_$1)]; then return 0; else return 1; fi
+}
+
+document pobj << 'end'
+Usage: pobj lisp_object
+Print the internal C structure of a underlying Lisp Object.
+end
+
+function pobj {
+  decode_object $1
+  if test $type = $dbg_Lisp_Type_Int; then
+    print -f"Integer: %d" $val
+  elif test $type = $dbg_Lisp_Type_Char; then
+    if $val < 128; then
+      print -f"Char: %c" $val
+    else
+      print -f"Char: %d" $val
+    fi
+  elif test $type = $dbg_Lisp_Type_String || lrecord_type_p string; then
+    pstruct Lisp_String
+  elif test $type = $dbg_Lisp_Type_Cons   || lrecord_type_p cons; then
+    pstruct Lisp_Cons
+  elif test $type = $dbg_Lisp_Type_Symbol || lrecord_type_p symbol; then
+    pstruct Lisp_Symbol
+    echo "Symbol name: $[(char *)($xstruct->name->_data)]"
+  elif test $type = $dbg_Lisp_Type_Vector || lrecord_type_p vector; then
+    pstruct Lisp_Vector
+    echo "Vector of length $[$xstruct->size]"
+  elif lrecord_type_p bit_vector; then
+    pstruct Lisp_Bit_Vector
+  elif lrecord_type_p buffer; then
+    pstruct buffer
+  elif lrecord_type_p char_table; then
+    pstruct Lisp_Char_Table
+  elif lrecord_type_p char_table_entry; then
+    pstruct Lisp_Char_Table_Entry
+  elif lrecord_type_p charset; then
+    pstruct Lisp_Charset
+  elif lrecord_type_p coding_system; then
+    pstruct Lisp_Coding_System
+  elif lrecord_type_p color_instance; then
+    pstruct Lisp_Color_Instance
+  elif lrecord_type_p command_builder; then
+    pstruct command_builder
+  elif lrecord_type_p compiled_function; then
+    pstruct Lisp_Compiled_Function
+  elif lrecord_type_p console; then
+    pstruct console
+  elif lrecord_type_p database; then
+    pstruct database
+  elif lrecord_type_p device; then
+    pstruct device
+  elif lrecord_type_p event; then
+    pstruct Lisp_Event
+  elif lrecord_type_p extent; then
+    pstruct extent
+  elif lrecord_type_p extent_auxiliary; then
+    pstruct extent_auxiliary
+  elif lrecord_type_p extent_info; then
+    pstruct extent_info
+  elif lrecord_type_p face; then
+    pstruct Lisp_Face
+  elif lrecord_type_p float; then
+    pstruct Lisp_Float
+  elif lrecord_type_p font_instance; then
+    pstruct Lisp_Font_Instance
+  elif lrecord_type_p frame; then
+    pstruct frame
+  elif lrecord_type_p glyph; then
+    pstruct Lisp_Glyph
+  elif lrecord_type_p hashtable; then
+    pstruct hashtable
+  elif lrecord_type_p image_instance; then
+    pstruct Lisp_Image_Instance
+  elif lrecord_type_p keymap; then
+    pstruct keymap
+  elif lrecord_type_p lcrecord_list; then
+    pstruct lcrecord_list
+  elif lrecord_type_p lstream; then
+    pstruct lstream
+  elif lrecord_type_p marker; then
+    pstruct Lisp_Marker
+  elif lrecord_type_p opaque; then
+    pstruct Lisp_Opaque
+  elif lrecord_type_p opaque_list; then
+    pstruct Lisp_Opaque_List
+  elif lrecord_type_p popup_data; then
+    pstruct popup_data
+  elif lrecord_type_p process; then
+    pstruct Lisp_Process
+  elif lrecord_type_p range_table; then
+    pstruct Lisp_Range_Table
+  elif lrecord_type_p specifier; then
+    pstruct Lisp_Specifier
+  elif lrecord_type_p subr; then
+    pstruct Lisp_Subr
+  elif lrecord_type_p symbol_value_buffer_local; then
+    pstruct symbol_value_buffer_local
+  elif lrecord_type_p symbol_value_forward; then
+    pstruct symbol_value_forward
+  elif lrecord_type_p symbol_value_lisp_magic; then
+    pstruct symbol_value_lisp_magic
+  elif lrecord_type_p symbol_value_varalias; then
+    pstruct symbol_value_varalias
+  elif lrecord_type_p toolbar_button; then
+    pstruct toolbar_button
+  elif lrecord_type_p tooltalk_message; then
+    pstruct Lisp_Tooltalk_Message
+  elif lrecord_type_p tooltalk_pattern; then
+    pstruct Lisp_Tooltalk_Pattern
+  elif lrecord_type_p weak_list; then
+    pstruct weak_list
+  elif lrecord_type_p window; then
+    pstruct window
+  elif lrecord_type_p window_configuration; then
+    pstruct window_config
+  else
+    echo "Unknown Lisp Object type"
+    print $1
+  fi
+}
+
+function pproc {
+  print *(`process.c`struct Lisp_Process*)$1 ;
+  ldp "(`process.c`struct Lisp_Process*)$1->name" ;
+  ldp "(`process.c`struct Lisp_Process*)$1->command" ;
+}
+
+dbxenv suppress_startup_message 4.0
+
+function dp_core {
+  print ((struct x_frame *)(((struct frame*)(Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget->core
+}
+
+# Barf!
+function print_shell {
+  print *(`frame-x.c`TopLevelShellRec*) (((struct `frame-x.c`x_frame*) (((struct `frame-x.c`frame*) (Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget)
+}
index d26e1c9..f1fefdc 100644 (file)
@@ -8,38 +8,37 @@ LISP_UNION_H=lisp-disunion.h
 LISP_H = lisp.h config.h $(LISP_UNION_H)
 #ifdef HAVE_MS_WINDOWS
 console-msw.o: $(LISP_H) conslots.h console-msw.h console.h events.h lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h systime.h
-device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h
-dialog-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
+device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h
+dialog-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h frame.h frameslots.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
 dired-msw.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h nt.h regex.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h systime.h
-event-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h dragdrop.h events-mod.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h menubar-msw.h mule-charset.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h systime.h syswait.h toolbar.h
-frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h window.h winslots.h
-gui-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h elhash.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
-menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+event-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h dragdrop.h events-mod.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h menubar-msw.h mule-charset.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h systime.h syswait.h toolbar.h
+frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-msw.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h
+menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
 objects-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h specifier.h symeval.h symsinit.h
-redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h window.h winslots.h
-scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h window.h winslots.h
+scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
 select-msw.o: $(LISP_H) conslots.h console-msw.h console.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 toolbar-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 #endif
 #ifdef HAVE_X_WINDOWS
 balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h xintrinsic.h
 console-x.o: $(LISP_H) conslots.h console-x.h console.h lisp-disunion.h lisp-union.h lrecord.h process.h redisplay.h symeval.h symsinit.h xintrinsic.h
-device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h
-dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
-glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h conslots.h console-x.h console.h device.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h window.h winslots.h xintrinsic.h xmu.h
-gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h
-input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h
+dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
+glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h conslots.h console-x.h console.h device.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h xintrinsic.h xmu.h
+gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h
+input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
 objects-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h specifier.h symeval.h symsinit.h xintrinsic.h
-redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
-scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h
-toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h
+redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
+scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h
+toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
 #endif
 #ifdef HAVE_DATABASE
-database.o: $(LISP_H) buffer.h bufslots.h database.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h
+database.o: $(LISP_H) database.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
 #endif
 #ifdef MULE
 mule-canna.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
@@ -57,122 +56,119 @@ ExternalShell.o: ExternalShell.h ExternalShellP.h config.h extw-Xlib.h extw-Xt.h
 extw-Xlib.o: config.h extw-Xlib.h
 extw-Xt.o: config.h extw-Xlib.h extw-Xt.h
 #endif
-EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
+EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
 EmacsManager.o: EmacsManager.h EmacsManagerP.h config.h xintrinsicp.h xmmanagerp.h
 EmacsShell-sub.o: EmacsShell.h EmacsShellP.h config.h xintrinsic.h xintrinsicp.h
 EmacsShell.o: EmacsShell.h ExternalShell.h config.h xintrinsicp.h
 abbrev.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h window.h winslots.h
-alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h device.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h puresize-adjust.h puresize.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h systime.h toolbar.h window.h winslots.h
+alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h device.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h puresize.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h systime.h toolbar.h window.h winslots.h
 alloca.o: config.h
 balloon_help.o: balloon_help.h config.h xintrinsic.h
 blocktype.o: $(LISP_H) blocktype.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h
-bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h syntax.h
+buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h
+bytecode.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
 callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h events.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h systime.h window.h winslots.h
-callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h nt.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h
-casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h nt.h paths.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h
+casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
 casetab.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h
-chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h
-cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h
+cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
 cmds.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
-console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs.h gpmevent.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h
-console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h gpmevent.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h
+console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
 data.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfloat.h syssignal.h
 debug.o: $(LISP_H) bytecode.h debug.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h
-device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h
-dgif_lib.o: gifrlib.h
-dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
-dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h opaque.h regex.h symeval.h symsinit.h sysdir.h sysfile.h syspwd.h systime.h
+device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h
+device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h
+dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
+dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h opaque.h regex.h symeval.h symsinit.h sysdir.h sysfile.h
+dll.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysdll.h
 doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h
 doprnt.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h
 dragdrop.o: $(LISP_H) dragdrop.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 dynarr.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 ecrt0.o: config.h
-editfns.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syspwd.h systime.h toolbar.h window.h winslots.h
-eldap.o: $(LISP_H) buffer.h bufslots.h eldap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h sysdep.h
-elhash.o: $(LISP_H) bytecode.h elhash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h paths.h process.h redisplay.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h
-emodules.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h toolbar.h window.h winslots.h
+editfns.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syspwd.h systime.h toolbar.h window.h winslots.h
+eldap.o: $(LISP_H) eldap.h lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h sysdep.h
+elhash.o: $(LISP_H) bytecode.h elhash.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h paths.h process.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h
 eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h
-event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h blocktype.h buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h toolbar.h xintrinsic.h xintrinsicp.h
-event-stream.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui-x.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h macros.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h process.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h
+event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h toolbar.h xintrinsic.h xintrinsicp.h
+event-stream.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h gui-x.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h macros.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h process.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h
 event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h gpmevent.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h
-events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h
-extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
-faces.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h
+extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h hash.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
+faces.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h hash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 file-coding.o: $(LISP_H) buffer.h bufslots.h elhash.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-ccl.h mule-charset.h symeval.h symsinit.h
-fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h ndir.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h
+fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h ndir.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h
 filelock.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h paths.h symeval.h symsinit.h sysdir.h sysfile.h syspwd.h syssignal.h
 filemode.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
 floatfns.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfloat.h syssignal.h
-fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h
+fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h
 font-lock.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h
-frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h
+frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h window.h winslots.h
 free-hook.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 general.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 getloadavg.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
-gif_io.o: gifrlib.h
-glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h
-glyphs-widget.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-glyphs.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h
+glyphs.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 gmalloc.o: config.h getpagesize.h
 gpmevent.o: $(LISP_H) conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h
-gui.o: $(LISP_H) bytecode.h elhash.h gui.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-hash.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+gui.o: $(LISP_H) bytecode.h gui.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+hash.o: $(LISP_H) elhash.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 hftctl.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 hpplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 imgproc.o: $(LISP_H) imgproc.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h systime.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h
-input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h
-insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
+indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h systime.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h
+input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h
+insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
 intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
 libsst.o: $(LISP_H) libsst.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-line-number.o: $(LISP_H) buffer.h bufslots.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
+line-number.o: $(LISP_H) buffer.h bufslots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
 linuxplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h syssignal.h
-lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h elhash.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h symeval.h symsinit.h sysfile.h sysfloat.h
+lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h paths.h symeval.h symsinit.h sysfile.h sysfloat.h
 lstream.o: $(LISP_H) buffer.h bufslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h sysfile.h
-macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h keymap.h lisp-disunion.h lisp-union.h lrecord.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
 malloc.o: config.h getpagesize.h
 marker.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
 md5.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h
-menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-nas.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysdep.h syssignal.h
+menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+nas.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.h
 nt.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nt.h ntheap.h symeval.h symsinit.h sysproc.h syssignal.h systime.h
 ntheap.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h ntheap.h symeval.h symsinit.h
 ntplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
 ntproc.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nt.h ntheap.h process.h symeval.h symsinit.h sysproc.h syssignal.h systime.h syswait.h
 objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-tty.h objects.h specifier.h symeval.h symsinit.h syssignal.h systty.h
-objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h
 opaque.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h
-print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syssignal.h systty.h toolbar.h
+print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syssignal.h systty.h toolbar.h
 process-nt.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h procimpl.h symeval.h symsinit.h sysdep.h
-process-unix.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
-process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
-profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.h systime.h
+process-unix.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+profile.o: $(LISP_H) backtrace.h bytecode.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.h systime.h
 pure.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h puresize-adjust.h puresize.h symeval.h symsinit.h
 ralloc.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 rangetab.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h rangetab.h symeval.h symsinit.h
 realpath.o: config.h
-redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
-redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h window.h winslots.h
+redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h faces.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h toolbar.h window.h winslots.h
+redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h window.h winslots.h
 regex.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h regex.h symeval.h symsinit.h syntax.h
-scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-search.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h regex.h symeval.h symsinit.h syntax.h
+scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+search.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h regex.h symeval.h symsinit.h syntax.h
 sgiplay.o: $(LISP_H) libst.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 sheap.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h sheap-adjust.h symeval.h symsinit.h
-signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h
-sound.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h symeval.h symsinit.h sysdep.h xintrinsic.h
-specifier.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h
+sound.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h symeval.h symsinit.h sysdep.h xintrinsic.h
+specifier.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 strcat.o: config.h
 strcmp.o: config.h
 strcpy.o: config.h
@@ -181,12 +177,12 @@ sunOS-fix.o: config.h
 sunplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysdep.h syssignal.h
 sunpro.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 symbols.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h ntheap.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h ntheap.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
 sysdll.o: config.h sysdll.h
 termcap.o: $(LISP_H) conslots.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 terminfo.o: config.h
-toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 tooltalk.o: $(LISP_H) buffer.h bufslots.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h process.h symeval.h symsinit.h tooltalk.h
 tparam.o: config.h
 undo.o: $(LISP_H) buffer.h bufslots.h extents.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
@@ -203,11 +199,11 @@ unexfreebsd.o: config.h
 unexhp9k3.o: config.h sysdep.h
 unexhp9k800.o: config.h
 unexmips.o: config.h getpagesize.h
-unexnt.o: config.h ntheap.h
+unexnt.o: ntheap.h
 unexsunos4.o: config.h
 vm-limit.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h mem-limits.h symeval.h symsinit.h
-widget.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+widget.o: $(LISP_H) buffer.h bufslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
+window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 xgccache.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h xgccache.h
 xmu.o: config.h
-xselect.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h xintrinsic.h
+xselect.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h xintrinsic.h
diff --git a/src/dll.c b/src/dll.c
new file mode 100644 (file)
index 0000000..94225cf
--- /dev/null
+++ b/src/dll.c
@@ -0,0 +1,94 @@
+/* Lisp interface to dynamic loading.
+   Copyright (C) 1998  Joshua Rowe.
+   Additional cleanup by Hrvoje Niksic.
+
+This file is part of XEmacs.
+
+This program 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 of the License, or
+(at your option) any later version.
+
+This program 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 this program; 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. */
+
+/* A shared object must have the symbol `emacs_initialize' defined.
+   It should contain initialization of functions, symbols, etc. and
+   their loading into Lisp-land.  The function will be called without
+   arguments and is not expected to return any.
+
+   All of this needs lots and LOTS of work.  Some things to work on:
+
+   1) A good foreign interface.  This is probably tough, because it
+   implies drawing a new border between "external" and "internal"
+   stuff (traditionally, Lisp code was external, while C was
+   internal).  Also, we need a modules/ directory with a few nice
+   sample modules, a sample Makefile, etc. so people can start
+   hacking.
+
+   2) All of this is sooo simple-minded.  As it gets more complex,
+   we'll have to look at how others have done similar things
+   (e.g. Perl 5 and Zsh 3.1), to avoid botching it up.  */
+
+#include <config.h>
+#include "lisp.h"
+#include "buffer.h"
+#include "sysdll.h"
+#include <errno.h>
+
+DEFUN ("dll-open", Fdll_open, 1, 1, "FShared object: ", /*
+Load LIBRARY as a shared object file.
+
+After the LIBRARY is dynamically linked with the executable, the
+`emacs_initialize' function will be called without arguments.  It
+should define all the symbols, subr's and variables the module
+introduces.
+
+After this point, any lisp symbols defined in the shared object are
+available for use.
+*/
+       (library))
+{
+  /* This function can GC */
+  dll_handle *handle;
+  void (*function) (void);
+  CONST char *filename;
+
+  CHECK_STRING (library);
+  library = Fexpand_file_name (library, Qnil);
+
+  GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (XSTRING_DATA (library), filename);
+
+  handle = (dll_handle *) dll_open (filename);
+  if (handle == NULL)
+    {
+      signal_error (Qerror,
+                   list3 (build_translated_string ("Cannot load shared library"),
+                          library, build_translated_string (dll_error (handle))));
+    }
+
+  /* #### Perhaps emacs_initialize() should return a Lisp_Object, so
+     we can return it?  */
+
+  function = (void (*)(void)) dll_function (handle, "emacs_initialize");
+  if (!function)
+    signal_simple_error ("Shared library does not define `emacs_initialize'",
+                        library);
+  (*function) ();
+
+  return Qnil;
+}
+
+void syms_of_dll ()
+{
+  DEFSUBR (Fdll_open);
+}
index 8259c5a..5dac446 100644 (file)
@@ -576,7 +576,7 @@ emacs_doprnt_1 (Lisp_Object stream, CONST Bufbyte *format_nonreloc,
            {
              Lisp_Object obj = largs[spec->argnum - 1];
              if (CHARP (obj))
-               obj = make_int (XCHAR (obj));
+               CHECK_INT_COERCE_CHAR (obj);
              if (!INT_OR_FLOATP (obj))
                {
                  error ("format specifier %%%c doesn't match argument type",
index d648161..5114354 100644 (file)
@@ -35,18 +35,14 @@ Boston, MA 02111-1307, USA.  */
 #include "commands.h"
 #include "console.h"
 #include "process.h"
-#include "redisplay.h"
 #include "sysdep.h"
 
+#include <setjmp.h>
 #include "syssignal.h" /* Always include before systty.h */
 #include "systty.h"
 #include "sysfile.h"
 #include "systime.h"
 
-#ifdef QUANTIFY
-#include <quantify.h>
-#endif
-
 #ifdef HAVE_SHLIB
 #include "sysdll.h"
 #endif
@@ -139,8 +135,6 @@ Lisp_Object Vemacs_program_name, Vemacs_program_version;
 Lisp_Object Vexec_path;
 Lisp_Object Vexec_directory, Vconfigure_exec_directory;
 Lisp_Object Vlisp_directory, Vconfigure_lisp_directory;
-Lisp_Object Vmodule_directory, Vconfigure_module_directory;
-Lisp_Object Vsite_module_directory, Vconfigure_site_module_directory;
 Lisp_Object Vconfigure_package_path;
 Lisp_Object Vdata_directory, Vconfigure_data_directory;
 Lisp_Object Vdoc_directory, Vconfigure_doc_directory;
@@ -203,9 +197,6 @@ int noninteractive1;
 /* Nonzero means don't perform site-lisp searches at startup */
 int inhibit_site_lisp;
 
-/* Nonzero means don't perform site-modules searches at startup */
-int inhibit_site_modules;
-
 /* Nonzero means don't respect early packages at startup */
 int inhibit_early_packages;
 
@@ -221,6 +212,8 @@ int initial_argc;
 
 static void sort_args (int argc, char **argv);
 
+extern int always_gc;           /* hack */
+
 Lisp_Object Qkill_emacs_hook;
 Lisp_Object Qsave_buffers_kill_emacs;
 
@@ -452,7 +445,7 @@ Return the directory name in which the Emacs executable was located.
 #endif
 
 #if defined (MULE) && defined (MSDOS) && defined (EMX)
-/* Setup all of files be input/output'ed with binary translation mode. */
+/* Setup all of files be input/output'ed with binary translation mdoe. */
 asm (" .text");
 asm ("L_setbinmode:");
 asm (" movl    $1, __fmode_bin");
@@ -526,10 +519,7 @@ argmatch (char **argv, int argc, char *sstr, char *lstr,
 /* Make stack traces always identify version + configuration */
 #define main_1 STACK_TRACE_EYE_CATCHER
 
-/* This function is not static, so that the compiler is less likely to
-   inline it, which would make it not show up in stack traces.  */
-DECLARE_DOESNT_RETURN (main_1 (int, char **, char **, int));
-DOESNT_RETURN
+static DOESNT_RETURN
 main_1 (int argc, char **argv, char **envp, int restart)
 {
   char stack_bottom_variable;
@@ -622,9 +612,6 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #if defined (HAVE_MMAP) && defined (REL_ALLOC)
   /* ralloc can only be used if using the GNU memory allocator. */
   init_ralloc ();
-#elif defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC)
-  if (initialized)
-    init_ralloc();
 #endif
 
 #ifdef HAVE_SOCKS
@@ -710,16 +697,6 @@ main_1 (int argc, char **argv, char **envp, int restart)
       inhibit_early_packages = 1;
       skip_args--;
     }
-#ifdef HAVE_SHLIB
-  if (argmatch (argv, argc, "-no-site-modules", "--no-site-modules",
-               9, NULL, &skip_args))
-    {
-      inhibit_site_modules = 1;
-      skip_args--;
-    }
-#else
-  inhibit_site_modules = 1;
-#endif
   if (argmatch (argv, argc, "-vanilla", "--vanilla",
                7, NULL, &skip_args))
     {
@@ -906,14 +883,14 @@ main_1 (int argc, char **argv, char **envp, int restart)
       syms_of_dialog ();
 #endif
       syms_of_dired ();
+#ifdef HAVE_SHLIB
+      syms_of_dll ();
+#endif
       syms_of_doc ();
       syms_of_editfns ();
       syms_of_elhash ();
       syms_of_emacs ();
       syms_of_eval ();
-#ifdef HAVE_X_WINDOWS
-      syms_of_event_Xt ();
-#endif
 #ifdef HAVE_DRAGNDROP
       syms_of_dragdrop ();
 #endif
@@ -932,7 +909,6 @@ main_1 (int argc, char **argv, char **envp, int restart)
       syms_of_general ();
       syms_of_glyphs ();
       syms_of_glyphs_eimage ();
-      syms_of_glyphs_widget ();
 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS)
       syms_of_gui ();
 #endif
@@ -950,9 +926,6 @@ main_1 (int argc, char **argv, char **envp, int restart)
       syms_of_menubar ();
 #endif
       syms_of_minibuf ();
-#ifdef HAVE_SHLIB
-      syms_of_module ();
-#endif
       syms_of_objects ();
       syms_of_print ();
 #if !defined (NO_SUBPROCESSES)
@@ -988,12 +961,12 @@ main_1 (int argc, char **argv, char **envp, int restart)
       syms_of_device_tty ();
       syms_of_objects_tty ();
 #endif
-
 #ifdef HAVE_X_WINDOWS
       syms_of_device_x ();
 #ifdef HAVE_DIALOGS
       syms_of_dialog_x ();
 #endif
+      syms_of_event_Xt ();
       syms_of_frame_x ();
       syms_of_glyphs_x ();
       syms_of_objects_x ();
@@ -1009,6 +982,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #ifdef HAVE_MS_WINDOWS
       syms_of_console_mswindows ();
       syms_of_device_mswindows ();
+      syms_of_event_mswindows ();
       syms_of_frame_mswindows ();
       syms_of_objects_mswindows ();
       syms_of_select_mswindows ();
@@ -1049,6 +1023,10 @@ main_1 (int argc, char **argv, char **envp, int restart)
       SYMS_MACHINE;
 #endif
 
+#ifdef EMACS_BTL
+      syms_of_btl ();
+#endif
+
       /*
 #if defined (GNU_MALLOC) && \
     defined (ERROR_CHECK_MALLOC) && \
@@ -1171,7 +1149,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
       structure_type_create_chartab ();
       structure_type_create_faces ();
       structure_type_create_rangetab ();
-      structure_type_create_hash_table ();
+      structure_type_create_hashtable ();
 
       /* Now initialize the image instantiator formats and associated symbols.
          Other than the first function below, the functions may
@@ -1186,7 +1164,6 @@ main_1 (int argc, char **argv, char **envp, int restart)
 
       image_instantiator_format_create ();
       image_instantiator_format_create_glyphs_eimage ();
-      image_instantiator_format_create_glyphs_widget ();
 #ifdef HAVE_X_WINDOWS
       image_instantiator_format_create_glyphs_x ();
 #endif /* HAVE_X_WINDOWS */
@@ -1209,7 +1186,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #if defined (HAVE_MS_WINDOWS) && !defined(HAVE_MSG_SELECT)
       lstream_type_create_mswindows_selectable ();
 #endif
-
+      
       /* Initialize processes implementation.
         The functions may make exactly the following function/macro calls:
 
@@ -1296,28 +1273,19 @@ main_1 (int argc, char **argv, char **envp, int restart)
       vars_of_elhash ();
       vars_of_emacs ();
       vars_of_eval ();
-
-#ifdef HAVE_X_WINDOWS
-      vars_of_event_Xt ();
-#endif
-#if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS))
-      vars_of_event_tty ();
-#endif
-#ifdef HAVE_MS_WINDOWS
-      vars_of_event_mswindows ();
-#endif
       vars_of_event_stream ();
-
       vars_of_events ();
       vars_of_extents ();
       vars_of_faces ();
       vars_of_fileio ();
+#ifdef CLASH_DETECTION
+      vars_of_filelock ();
+#endif
       vars_of_floatfns ();
       vars_of_font_lock ();
       vars_of_frame ();
       vars_of_glyphs ();
       vars_of_glyphs_eimage ();
-      vars_of_glyphs_widget ();
 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS)
       vars_of_gui ();
 #endif
@@ -1343,9 +1311,6 @@ main_1 (int argc, char **argv, char **envp, int restart)
       vars_of_menubar ();
 #endif
       vars_of_minibuf ();
-#ifdef HAVE_SHLIB
-      vars_of_module ();
-#endif
       vars_of_objects ();
       vars_of_print ();
 
@@ -1380,6 +1345,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
 
 #ifdef HAVE_TTY
       vars_of_console_tty ();
+      vars_of_event_tty ();
       vars_of_frame_tty ();
       vars_of_objects_tty ();
 #endif
@@ -1389,6 +1355,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #ifdef HAVE_DIALOGS
       vars_of_dialog_x ();
 #endif
+      vars_of_event_Xt ();
       vars_of_frame_x ();
       vars_of_glyphs_x ();
 #ifdef HAVE_MENUBARS
@@ -1407,6 +1374,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #ifdef HAVE_MS_WINDOWS
       vars_of_device_mswindows ();
       vars_of_console_mswindows ();
+      vars_of_event_mswindows ();
       vars_of_frame_mswindows ();
       vars_of_objects_mswindows ();
       vars_of_select_mswindows ();
@@ -1490,14 +1458,14 @@ main_1 (int argc, char **argv, char **envp, int restart)
       /* Calls Fmake_range_table(). */
       complex_vars_of_search ();
 
-      /* Calls make_lisp_hash_table(). */
+      /* Calls make_lisp_hashtable(). */
       complex_vars_of_extents ();
 
-      /* Depends on hash tables and specifiers. */
+      /* Depends on hashtables and specifiers. */
       complex_vars_of_faces ();
 
 #ifdef MULE
-      /* These two depend on hash tables and various variables declared
+      /* These two depend on hashtables and various variables declared
         earlier.  The second may also depend on the first. */
       complex_vars_of_mule_charset ();
 #endif
@@ -1567,22 +1535,20 @@ main_1 (int argc, char **argv, char **envp, int restart)
         might depend on all sorts of things; I'm not sure. */
       complex_vars_of_emacs ();
 
+#ifdef CLASH_DETECTION
+      complex_vars_of_filelock ();
+#endif /* CLASH_DETECTION */
+
       /* This creates a couple of basic keymaps and depends on Lisp
-        hash tables and Ffset() (both of which depend on some variables
+        hashtables and Ffset() (both of which depend on some variables
         initialized in the vars_of_*() section) and possibly other
         stuff. */
       complex_vars_of_keymap ();
-
-      /* Calls make_lisp_hash_table() and creates a keymap */
+      /* Calls Fmake_hashtable() and creates a keymap */
       complex_vars_of_event_stream ();
 
-#ifdef ERROR_CHECK_GC
-      {
-       extern int always_gc;
-       if (always_gc)                /* purification debugging hack */
-         garbage_collect_1 ();
-      }
-#endif
+      if (always_gc)                /* purification debugging hack */
+       garbage_collect_1 ();
     }
 
   /* CONGRATULATIONS!!!  We have successfully initialized the Lisp
@@ -1612,7 +1578,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #ifdef WINDOWSNT
   /*
    * For Win32, call init_environment() now, so that environment/registry
-   * variables will be properly entered into Vprocess_environment.
+   * variables will be properly entered into Vprocess_envonment.
    */
   init_environment();
 #endif
@@ -1695,11 +1661,11 @@ main_1 (int argc, char **argv, char **envp, int restart)
     char *buf = (char *)alloca (XSTRING_LENGTH (Vinvocation_directory)
                                + XSTRING_LENGTH (Vinvocation_name)
                                + 2);
-    sprintf (buf, "%s/%s", XSTRING_DATA (Vinvocation_directory),
-            XSTRING_DATA (Vinvocation_name));
+    sprintf (buf, "%s/%s", XSTRING_DATA(Vinvocation_directory),
+            XSTRING_DATA(Vinvocation_name));
 
     /* All we can do is cry if an error happens, so ignore it. */
-    (void) dll_init (buf);
+    (void)dll_init(buf);
   }
 #endif
 
@@ -1829,7 +1795,7 @@ static struct standard_args standard_args[] =
 static void
 sort_args (int argc, char **argv)
 {
-  char **new_argv = xnew_array (char *, argc);
+  char **new = xnew_array (char *, argc);
   /* For each element of argv,
      the corresponding element of options is:
      0 for an option that takes no arguments,
@@ -1909,8 +1875,8 @@ sort_args (int argc, char **argv)
        }
     }
 
-  /* Copy the arguments, in order of decreasing priority, to NEW_ARGV.  */
-  new_argv[0] = argv[0];
+  /* Copy the arguments, in order of decreasing priority, to NEW.  */
+  new[0] = argv[0];
   while (to < argc)
     {
       int best = -1;
@@ -1933,10 +1899,10 @@ sort_args (int argc, char **argv)
       if (best < 0)
        abort ();
 
-      /* Copy the highest priority remaining option, with its args, to NEW_ARGV.  */
-      new_argv[to++] = argv[best];
+      /* Copy the highest priority remaining option, with its args, to NEW.  */
+      new[to++] = argv[best];
       for (i = 0; i < options[best]; i++)
-       new_argv[to++] = argv[best + i + 1];
+       new[to++] = argv[best + i + 1];
 
       /* Clear out this option in ARGV.  */
       argv[best] = 0;
@@ -1944,10 +1910,7 @@ sort_args (int argc, char **argv)
        argv[best + i + 1] = 0;
     }
 
-  memcpy (argv, new_argv, sizeof (char *) * argc);
-  xfree (new_argv);
-  xfree (options);
-  xfree (priority);
+  memcpy (argv, new, sizeof (char *) * argc);
 }
 
 static JMP_BUF run_temacs_catch;
@@ -1979,9 +1942,7 @@ Do not call this.  It will reinitialize your XEmacs.  You'll be sorry.
    a dumped version in case you want to rerun it.  This function is most
    useful when used as part of the `make all-elc' command. --ben]
    This will "restart" emacs with the specified command-line arguments.
-
-   Martin thinks this function is most useful when using debugging
-   tools like Purify or tcov that get confused by XEmacs' dumping.  */
+ */
      (int nargs, Lisp_Object *args))
 {
   int ac;
@@ -2031,13 +1992,11 @@ Do not call this.  It will reinitialize your XEmacs.  You'll be sorry.
   unbind_to (0, Qnil); /* this closes loadup.el */
   purify_flag = 0;
   run_temacs_argc = nargs + 1;
-#if 0
 #ifdef REPORT_PURE_USAGE
   report_pure_usage (1, 0);
 #else
   report_pure_usage (0, 0);
 #endif
-#endif /* 0 */
   LONGJMP (run_temacs_catch, 1);
   return Qnil; /* not reached; warning suppression */
 }
@@ -2049,33 +2008,28 @@ main (int argc, char **argv, char **envp)
   int     volatile vol_argc = argc;
   char ** volatile vol_argv = argv;
   char ** volatile vol_envp = envp;
-  /* This is hairy.  We need to compute where the XEmacs binary was invoked
-     from because temacs initialization requires it to find the lisp
-     directories.  The code that recomputes the path is guarded by the
-     restarted flag.  There are three possible paths I've found so far
-     through this:
-
-     temacs -- When running temacs for basic build stuff, the first main_1
-      will be the only one invoked.  It must compute the path else there
-      will be a very ugly bomb in startup.el (can't find obvious location
-      for doc-directory data-directory, etc.).
-
-     temacs w/ run-temacs on the command line -- This is run to bytecompile
-      all the out of date dumped lisp.  It will execute both of the main_1
-      calls and the second one must not touch the first computation because
-      argc/argv are hosed the second time through.
-
-     xemacs -- Only the second main_1 is executed.  The invocation path must
-      computed but this only matters when running in place or when running
-      as a login shell.
-
-     As a bonus for straightening this out, XEmacs can now be run in place
-     as a login shell.  This never used to work.
-
-     As another bonus, we can now guarantee that
-     (concat invocation-directory invocation-name) contains the filename
-     of the XEmacs binary we are running.  This can now be used in a
-     definite test for out of date dumped files.  -slb */
+  /* This is hairy.  We need to compute where the XEmacs binary was invoked */
+  /* from because temacs initialization requires it to find the lisp */
+  /* directories.  The code that recomputes the path is guarded by the */
+  /* restarted flag.  There are three possible paths I've found so far */
+  /* through this: */
+  /* temacs -- When running temacs for basic build stuff, the first main_1 */
+  /*  will be the only one invoked.  It must compute the path else there */
+  /*  will be a very ugly bomb in startup.el (can't find obvious location */
+  /*  for doc-directory data-directory, etc.).  */
+  /* temacs w/ run-temacs on the command line -- This is run to bytecompile */
+  /*  all the out of date dumped lisp.  It will execute both of the main_1 */
+  /*  calls and the second one must not touch the first computation because */
+  /*  argc/argv are hosed the second time through. */
+  /* xemacs -- Only the second main_1 is executed.  The invocation path must */
+  /*  computed but this only matters when running in place or when running */
+  /*  as a login shell. */
+  /* As a bonus for straightening this out, XEmacs can now be run in place */
+  /*  as a login shell.  This never used to work. */
+  /* As another bonus, we can now guarantee that */
+  /* (concat invocation-directory invocation-name) contains the filename */
+  /* of the XEmacs binary we are running.  This can now be used in a */
+  /* definite test for out of date dumped files.  -slb */
   int restarted = 0;
 #ifdef QUANTIFY
   quantify_stop_recording_data ();
@@ -2130,7 +2084,7 @@ main (int argc, char **argv, char **envp)
     }
 #ifdef RUN_TIME_REMAP
   else
-    /* obviously no-one uses this because where it was before initialized was
+    /* obviously no-one uses this because where it was before initalized was
      *always* true */
     run_time_remap (argv[0]);
 #endif
@@ -2173,7 +2127,7 @@ main (int argc, char **argv, char **envp)
 /* GCC >= 2.8.  -slb */
 #if defined(GNU_MALLOC)
 static void
-voodoo_free_hook (void *mem)
+voodoo_free_hook(void *mem)
 {
   /* Disable all calls to free() when XEmacs is exiting and it doesn't */
   /* matter. */
@@ -2431,6 +2385,8 @@ and announce itself normally when it is run.
   /* When we're dumping, we can't use the debugging free() */
   disable_free_hook ();
 #endif
+#if 1 /* martin */
+#endif
 
   CHECK_STRING (intoname);
   intoname = Fexpand_file_name (intoname, Qnil);
@@ -2497,10 +2453,10 @@ and announce itself normally when it is run.
      It's a whole lot easier to do the conversion here than to
      modify all the unexec routines to ensure that filename
      conversion is applied everywhere.  Don't worry about memory
-     leakage because this call only happens once. */
-    unexec (intoname_ext, symname_ext, (uintptr_t) my_edata, 0, 0);
+     leakage because this call only happens once. */ 
+ unexec (intoname_ext, symname_ext, (uintptr_t) my_edata, 0, 0);
 #ifdef DOUG_LEA_MALLOC
-    free (malloc_state_ptr);
+  free (malloc_state_ptr);
 #endif
   }
 #endif /* not MSDOS and EMX */
@@ -2561,7 +2517,7 @@ decode_path (CONST char *path)
 
   GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA (path, newpath);
 
-  len = strlen ((const char *) newpath);
+  len = strlen (newpath);
   /* #### Does this make sense?  It certainly does for
      decode_env_path(), but it looks dubious here.  Does any code
      depend on decode_path("") returning nil instead of an empty
@@ -2653,7 +2609,7 @@ assert_failed (CONST char *file, int line, CONST char *expr)
 
 #ifdef QUANTIFY
 DEFUN ("quantify-start-recording-data", Fquantify_start_recording_data,
-       0, 0, "", /*
+       0, 0, 0, /*
 Start recording Quantify data.
 */
        ())
@@ -2663,7 +2619,7 @@ Start recording Quantify data.
 }
 
 DEFUN ("quantify-stop-recording-data", Fquantify_stop_recording_data,
-       0, 0, "", /*
+       0, 0, 0, /*
 Stop recording Quantify data.
 */
        ())
@@ -2672,7 +2628,7 @@ Stop recording Quantify data.
   return Qnil;
 }
 
-DEFUN ("quantify-clear-data", Fquantify_clear_data, 0, 0, "", /*
+DEFUN ("quantify-clear-data", Fquantify_clear_data, 0, 0, 0, /*
 Clear all Quantify data.
 */
        ())
@@ -2848,13 +2804,6 @@ Set to non-nil when the site-lisp should not be searched at startup.
   inhibit_site_lisp = 1;
 #endif
 
-  DEFVAR_BOOL ("inhibit-site-modules", &inhibit_site_modules /*
-Set to non-nil when site-modules should not be searched at startup.
-*/ );
-#ifdef INHIBIT_SITE_MODULES
-  inhibit_site_modules = 1;
-#endif
-
   DEFVAR_INT ("emacs-priority", &emacs_priority /*
 Priority for XEmacs to run at.
 This value is effective only if set before XEmacs is dumped,
@@ -2912,7 +2861,7 @@ void
 complex_vars_of_emacs (void)
 {
   /* This is all related to path searching. */
-
+  
   DEFVAR_LISP ("emacs-program-name", &Vemacs_program_name /*
 *Name of the Emacs variant.
 For example, this may be \"xemacs\" or \"infodock\".
@@ -2966,22 +2915,6 @@ configure's idea of what LISP-DIRECTORY will be.
   Vconfigure_lisp_directory = Qnil;
 #endif
 
-  DEFVAR_LISP ("module-directory", &Vmodule_directory /*
-*Directory of core dynamic modules that come with XEmacs.
-*/ );
-  Vmodule_directory = Qnil;
-
-  DEFVAR_LISP ("configure-module-directory", &Vconfigure_module_directory /*
-For internal use by the build procedure only.
-configure's idea of what MODULE-DIRECTORY will be.
-*/ );
-#ifdef PATH_MODULESEARCH
-  Vconfigure_module_directory = Ffile_name_as_directory
-    (build_string ((char *) PATH_MODULESEARCH));
-#else
-  Vconfigure_module_directory = Qnil;
-#endif
-
   DEFVAR_LISP ("configure-package-path", &Vconfigure_package_path /*
 For internal use by the build procedure only.
 configure's idea of what the package path will be.
@@ -3046,22 +2979,6 @@ configure's idea of what SITE-DIRECTORY will be.
   Vconfigure_site_directory = Qnil;
 #endif
 
-  DEFVAR_LISP ("site-module-directory", &Vsite_module_directory /*
-*Directory of site-specific loadable modules that come with XEmacs.
-*/ );
-  Vsite_module_directory = Qnil;
-
-  DEFVAR_LISP ("configure-site-module-directory", &Vconfigure_site_module_directory /*
-For internal use by the build procedure only.
-configure's idea of what SITE-DIRECTORY will be.
-*/ );
-#ifdef PATH_SITE_MODULES
-  Vconfigure_site_module_directory = Ffile_name_as_directory
-    (build_string ((char *) PATH_SITE_MODULES));
-#else
-  Vconfigure_site_module_directory = Qnil;
-#endif
-
   DEFVAR_LISP ("doc-directory", &Vdoc_directory /*
 *Directory containing the DOC file that comes with XEmacs.
 This is usually the same as exec-directory.
index 44fbd98..750055c 100644 (file)
@@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA.  */
 #include "faces.h"
 #include "frame.h"
 #include "glyphs.h"
+#include "hash.h"
 #include "objects.h"
 #include "specifier.h"
 #include "window.h"
@@ -55,7 +56,7 @@ Lisp_Object Qinit_global_faces;
    calling Ffind_face. */
 Lisp_Object Vdefault_face, Vmodeline_face, Vgui_element_face;
 Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face;
-Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face, Vwidget_face;
+Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face;
 
 /* Qdefault, Qhighlight defined in general.c */
 Lisp_Object Qmodeline, Qgui_element, Qleft_margin, Qright_margin, Qtext_cursor;
@@ -77,22 +78,22 @@ mark_face (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
   struct Lisp_Face *face =  XFACE (obj);
 
-  markobj (face->name);
-  markobj (face->doc_string);
+  ((markobj) (face->name));
+  ((markobj) (face->doc_string));
 
-  markobj (face->foreground);
-  markobj (face->background);
-  markobj (face->font);
-  markobj (face->display_table);
-  markobj (face->background_pixmap);
-  markobj (face->underline);
-  markobj (face->strikethru);
-  markobj (face->highlight);
-  markobj (face->dim);
-  markobj (face->blinking);
-  markobj (face->reverse);
+  ((markobj) (face->foreground));
+  ((markobj) (face->background));
+  ((markobj) (face->font));
+  ((markobj) (face->display_table));
+  ((markobj) (face->background_pixmap));
+  ((markobj) (face->underline));
+  ((markobj) (face->strikethru));
+  ((markobj) (face->highlight));
+  ((markobj) (face->dim));
+  ((markobj) (face->blinking));
+  ((markobj) (face->reverse));
 
-  markobj (face->charsets_warned_about);
+  ((markobj) (face->charsets_warned_about));
 
   return face->plist;
 }
@@ -128,10 +129,10 @@ print_face (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
    This isn't concerned with "unspecified" attributes, that's what
    #'face-differs-from-default-p is for. */
 static int
-face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+face_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
-  struct Lisp_Face *f1 = XFACE (obj1);
-  struct Lisp_Face *f2 = XFACE (obj2);
+  struct Lisp_Face *f1 = XFACE (o1);
+  struct Lisp_Face *f2 = XFACE (o2);
 
   depth++;
 
@@ -374,14 +375,19 @@ struct face_list_closure
 };
 
 static int
-add_face_to_list_mapper (Lisp_Object key, Lisp_Object value,
+add_face_to_list_mapper (CONST void *hash_key, void *hash_contents,
                         void *face_list_closure)
 {
   /* This function can GC */
+  Lisp_Object key, contents;
+  Lisp_Object *face_list;
   struct face_list_closure *fcl =
     (struct face_list_closure *) face_list_closure;
+  CVOID_TO_LISP (key, hash_key);
+  VOID_TO_LISP (contents, hash_contents);
+  face_list = fcl->face_list;
 
-  *(fcl->face_list) = Fcons (XFACE (value)->name, (*fcl->face_list));
+  *face_list = Fcons (XFACE (contents)->name, *face_list);
   return 0;
 }
 
@@ -414,12 +420,15 @@ temporary_faces_list (void)
 
 \f
 static int
-mark_face_as_clean_mapper (Lisp_Object key, Lisp_Object value,
+mark_face_as_clean_mapper (CONST void *hash_key, void *hash_contents,
                           void *flag_closure)
 {
   /* This function can GC */
+  Lisp_Object key, contents;
   int *flag = (int *) flag_closure;
-  XFACE (value)->dirty = *flag;
+  CVOID_TO_LISP (key, hash_key);
+  VOID_TO_LISP (contents, hash_contents);
+  XFACE (contents)->dirty = *flag;
   return 0;
 }
 
@@ -998,13 +1007,13 @@ mark_face_cachels (face_cachel_dynarr *elements,
 
        for (i = 0; i < NUM_LEADING_BYTES; i++)
          if (!NILP (cachel->font[i]) && !UNBOUNDP (cachel->font[i]))
-           markobj (cachel->font[i]);
+           ((markobj) (cachel->font[i]));
       }
-      markobj (cachel->face);
-      markobj (cachel->foreground);
-      markobj (cachel->background);
-      markobj (cachel->display_table);
-      markobj (cachel->background_pixmap);
+      ((markobj) (cachel->face));
+      ((markobj) (cachel->foreground));
+      ((markobj) (cachel->background));
+      ((markobj) (cachel->display_table));
+      ((markobj) (cachel->background_pixmap));
     }
 }
 
@@ -1629,19 +1638,23 @@ face_property_was_changed (Lisp_Object face, Lisp_Object property,
 
   if (WINDOWP (locale))
     {
-      MARK_FRAME_FACES_CHANGED (XFRAME (XWINDOW (locale)->frame));
+      struct frame *f = XFRAME (XWINDOW (locale)->frame);
+      MARK_FRAME_FACES_CHANGED (f);
     }
   else if (FRAMEP (locale))
     {
-      MARK_FRAME_FACES_CHANGED (XFRAME (locale));
+      struct frame *f = XFRAME (locale);
+      MARK_FRAME_FACES_CHANGED (f);
     }
   else if (DEVICEP (locale))
     {
-      MARK_DEVICE_FRAMES_FACES_CHANGED (XDEVICE (locale));
+      struct device *d = XDEVICE (locale);
+      MARK_DEVICE_FRAMES_FACES_CHANGED (d);
     }
   else
     {
       Lisp_Object devcons, concons;
+
       DEVICE_LOOP_NO_BREAK (devcons, concons)
        MARK_DEVICE_FRAMES_FACES_CHANGED (XDEVICE (XCAR (devcons)));
     }
@@ -1736,7 +1749,7 @@ LOCALE, TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'.
 void
 syms_of_faces (void)
 {
-  /* Qdefault & Qwidget defined in general.c */
+  /* Qdefault defined in general.c */
   defsymbol (&Qmodeline, "modeline");
   defsymbol (&Qgui_element, "gui-element");
   defsymbol (&Qleft_margin, "left-margin");
@@ -1793,8 +1806,6 @@ vars_of_faces (void)
   Vdefault_face = Qnil;
   staticpro (&Vgui_element_face);
   Vgui_element_face = Qnil;
-  staticpro (&Vwidget_face);
-  Vwidget_face = Qnil;
   staticpro (&Vmodeline_face);
   Vmodeline_face = Qnil;
   staticpro (&Vtoolbar_face);
@@ -1835,10 +1846,10 @@ vars_of_faces (void)
 void
 complex_vars_of_faces (void)
 {
-  Vpermanent_faces_cache =
-    make_lisp_hash_table (10, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
-  Vtemporary_faces_cache =
-    make_lisp_hash_table (0, HASH_TABLE_WEAK, HASH_TABLE_EQ);
+  Vpermanent_faces_cache = make_lisp_hashtable (10, HASHTABLE_NONWEAK,
+                                               HASHTABLE_EQ);
+  Vtemporary_faces_cache = make_lisp_hashtable (0, HASHTABLE_WEAK,
+                                               HASHTABLE_EQ);
 
   /* Create the default face now so we know what it is immediately. */
 
@@ -1908,12 +1919,8 @@ complex_vars_of_faces (void)
                       inst_list);
 #endif /* HAVE_TTY */
 #ifdef HAVE_MS_WINDOWS
-    inst_list = Fcons (Fcons (list1 (Qmswindows),
-                      build_string ("Fixedsys:Regular:9::Western")), inst_list);
-    inst_list = Fcons (Fcons (list1 (Qmswindows),
-                      build_string ("Courier:Regular:10::Western")), inst_list);
-    inst_list = Fcons (Fcons (list1 (Qmswindows),
-                      build_string ("Courier New:Regular:10::Western")), inst_list);
+    inst_list = Fcons (Fcons (list1 (Qmswindows), build_string ("Courier New")),
+                      inst_list);
 #endif /* HAVE_MS_WINDOWS */
     set_specifier_fallback (Fget (Vdefault_face, Qfont, Qnil), inst_list);
   }
@@ -1930,7 +1937,7 @@ complex_vars_of_faces (void)
                         list1 (Fcons (Qnil, Qnil)));
   set_specifier_fallback (Fget (Vdefault_face, Qreverse, Qnil),
                         list1 (Fcons (Qnil, Qnil)));
-
+  
   /* gui-element is the parent face of all gui elements such as
      modeline, vertical divider and toolbar. */
   Vgui_element_face = Fmake_face (Qgui_element,
@@ -1973,7 +1980,7 @@ complex_vars_of_faces (void)
   set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap, Qnil),
                          Fget (Vgui_element_face, Qbackground_pixmap,
                                Qunbound));
-
+  
   /* toolbar is another gui element */
   Vtoolbar_face = Fmake_face (Qtoolbar,
                              build_string ("toolbar face"),
@@ -2000,18 +2007,6 @@ complex_vars_of_faces (void)
                          Fget (Vgui_element_face, Qbackground_pixmap,
                                Qunbound));
 
-  /* widget is another gui element */
-  Vwidget_face = Fmake_face (Qwidget,
-                            build_string ("widget face"),
-                            Qnil);
-  set_specifier_fallback (Fget (Vwidget_face, Qforeground, Qunbound),
-                         Fget (Vgui_element_face, Qforeground, Qunbound));
-  set_specifier_fallback (Fget (Vwidget_face, Qbackground, Qunbound),
-                         Fget (Vgui_element_face, Qbackground, Qunbound));
-  set_specifier_fallback (Fget (Vwidget_face, Qbackground_pixmap, Qnil),
-                         Fget (Vgui_element_face, Qbackground_pixmap,
-                               Qunbound));
-
   Vleft_margin_face = Fmake_face (Qleft_margin,
                                  build_string ("left margin face"),
                                  Qnil);
index c2e821d..7d4523e 100644 (file)
@@ -215,7 +215,7 @@ struct face_cachel
      right sort are available on the system.  In this case, the
      whole program will just crash.  For the moment, this is
      OK (for debugging purposes) but we should fix this by
-     storing a "blank font" if the instantiation fails. */
+     storing a "blank font" if the instantation fails. */
   unsigned int dirty :1;
   unsigned int updated :1;
   /* #### Of course we should use a bit array or something. */
@@ -261,7 +261,7 @@ EXFUN (Fget_face, 1);
 extern Lisp_Object Qstrikethru, Vbuilt_in_face_specifiers, Vdefault_face;
 extern Lisp_Object Vleft_margin_face, Vpointer_face, Vright_margin_face;
 extern Lisp_Object Vtext_cursor_face, Vvertical_divider_face; 
-extern Lisp_Object Vtoolbar_face, Vgui_element_face, Vwidget_face;
+extern Lisp_Object Vtoolbar_face, Vgui_element_face;
 
 void mark_all_faces_as_clean (void);
 void init_frame_faces (struct frame *f);
index ce4f83b..48363a4 100644 (file)
@@ -75,7 +75,7 @@ Lisp_Object Qshort, Qno_ascii_eol, Qno_ascii_cntl, Qseven, Qlock_shift;
 #endif
 Lisp_Object Qencode, Qdecode;
 
-Lisp_Object Vcoding_system_hash_table;
+Lisp_Object Vcoding_system_hashtable;
 
 int enable_multibyte_characters;
 
@@ -232,12 +232,12 @@ mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
   struct Lisp_Coding_System *codesys = XCODING_SYSTEM (obj);
 
-  markobj (CODING_SYSTEM_NAME (codesys));
-  markobj (CODING_SYSTEM_DOC_STRING (codesys));
-  markobj (CODING_SYSTEM_MNEMONIC (codesys));
-  markobj (CODING_SYSTEM_EOL_LF (codesys));
-  markobj (CODING_SYSTEM_EOL_CRLF (codesys));
-  markobj (CODING_SYSTEM_EOL_CR (codesys));
+  (markobj) (CODING_SYSTEM_NAME (codesys));
+  (markobj) (CODING_SYSTEM_DOC_STRING (codesys));
+  (markobj) (CODING_SYSTEM_MNEMONIC (codesys));
+  (markobj) (CODING_SYSTEM_EOL_LF (codesys));
+  (markobj) (CODING_SYSTEM_EOL_CRLF (codesys));
+  (markobj) (CODING_SYSTEM_EOL_CR (codesys));
 
   switch (CODING_SYSTEM_TYPE (codesys))
     {
@@ -245,15 +245,15 @@ mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object))
       int i;
     case CODESYS_ISO2022:
       for (i = 0; i < 4; i++)
-       markobj (CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i));
+       (markobj) (CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i));
       if (codesys->iso2022.input_conv)
        {
          for (i = 0; i < Dynarr_length (codesys->iso2022.input_conv); i++)
            {
              struct charset_conversion_spec *ccs =
                Dynarr_atp (codesys->iso2022.input_conv, i);
-             markobj (ccs->from_charset);
-             markobj (ccs->to_charset);
+             (markobj) (ccs->from_charset);
+             (markobj) (ccs->to_charset);
            }
        }
       if (codesys->iso2022.output_conv)
@@ -262,22 +262,22 @@ mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object))
            {
              struct charset_conversion_spec *ccs =
                Dynarr_atp (codesys->iso2022.output_conv, i);
-             markobj (ccs->from_charset);
-             markobj (ccs->to_charset);
+             (markobj) (ccs->from_charset);
+             (markobj) (ccs->to_charset);
            }
        }
       break;
 
     case CODESYS_CCL:
-      markobj (CODING_SYSTEM_CCL_DECODE (codesys));
-      markobj (CODING_SYSTEM_CCL_ENCODE (codesys));
+      (markobj) (CODING_SYSTEM_CCL_DECODE (codesys));
+      (markobj) (CODING_SYSTEM_CCL_ENCODE (codesys));
       break;
 #endif /* MULE */
     default:
       break;
     }
 
-  markobj (CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys));
+  (markobj) (CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys));
   return CODING_SYSTEM_POST_READ_CONVERSION (codesys);
 }
 
@@ -344,11 +344,11 @@ eol_type_to_symbol (enum eol_type type)
 {
   switch (type)
     {
-    default: abort ();
     case EOL_LF:         return Qlf;
     case EOL_CRLF:       return Qcrlf;
     case EOL_CR:         return Qcr;
     case EOL_AUTODETECT: return Qnil;
+    default:             abort (); return Qnil; /* not reached */
     }
 }
 
@@ -439,7 +439,7 @@ associated coding system object is returned.
   else
     CHECK_SYMBOL (coding_system_or_name);
 
-  return Fgethash (coding_system_or_name, Vcoding_system_hash_table, Qnil);
+  return Fgethash (coding_system_or_name, Vcoding_system_hashtable, Qnil);
 }
 
 DEFUN ("get-coding-system", Fget_coding_system, 1, 1, 0, /*
@@ -465,15 +465,19 @@ struct coding_system_list_closure
 };
 
 static int
-add_coding_system_to_list_mapper (Lisp_Object key, Lisp_Object value,
+add_coding_system_to_list_mapper (CONST void *hash_key, void *hash_contents,
                                  void *coding_system_list_closure)
 {
   /* This function can GC */
+  Lisp_Object key, contents;
+  Lisp_Object *coding_system_list;
   struct coding_system_list_closure *cscl =
     (struct coding_system_list_closure *) coding_system_list_closure;
-  Lisp_Object *coding_system_list = cscl->coding_system_list;
+  CVOID_TO_LISP (key, hash_key);
+  VOID_TO_LISP (contents, hash_contents);
+  coding_system_list = cscl->coding_system_list;
 
-  *coding_system_list = Fcons (XCODING_SYSTEM (value)->name,
+  *coding_system_list = Fcons (XCODING_SYSTEM (contents)->name,
                               *coding_system_list);
   return 0;
 }
@@ -489,7 +493,7 @@ Return a list of the names of all defined coding systems.
 
   GCPRO1 (coding_system_list);
   coding_system_list_closure.coding_system_list = &coding_system_list;
-  elisp_maphash (add_coding_system_to_list_mapper, Vcoding_system_hash_table,
+  elisp_maphash (add_coding_system_to_list_mapper, Vcoding_system_hashtable,
                 &coding_system_list_closure);
   UNGCPRO;
 
@@ -886,7 +890,7 @@ if TYPE is 'ccl:
   {
     Lisp_Object codesys_obj;
     XSETCODING_SYSTEM (codesys_obj, codesys);
-    Fputhash (name, codesys_obj, Vcoding_system_hash_table);
+    Fputhash (name, codesys_obj, Vcoding_system_hashtable);
     return codesys_obj;
   }
 }
@@ -907,7 +911,7 @@ be created.
                         allocate_coding_system
                         (XCODING_SYSTEM_TYPE (old_coding_system),
                          new_name));
-      Fputhash (new_name, new_coding_system, Vcoding_system_hash_table);
+      Fputhash (new_name, new_coding_system, Vcoding_system_hashtable);
     }
 
   {
@@ -974,7 +978,6 @@ Return the type of CODING-SYSTEM.
 {
   switch (XCODING_SYSTEM_TYPE (Fget_coding_system (coding_system)))
     {
-    default: abort ();
     case CODESYS_AUTODETECT:   return Qundecided;
 #ifdef MULE
     case CODESYS_SHIFT_JIS:    return Qshift_jis;
@@ -986,7 +989,11 @@ Return the type of CODING-SYSTEM.
 #ifdef DEBUG_XEMACS
     case CODESYS_INTERNAL:     return Qinternal;
 #endif
+    default:
+      abort ();
     }
+
+  return Qnil; /* not reached */
 }
 
 #ifdef MULE
@@ -1739,7 +1746,7 @@ decoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object))
      and automatically marked. */
 
   XSETLSTREAM (str_obj, str);
-  markobj (str_obj);
+  (markobj) (str_obj);
   if (str->imp->marker)
     return (str->imp->marker) (str_obj, markobj);
   else
@@ -2185,7 +2192,7 @@ encoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object))
      and automatically marked. */
 
   XSETLSTREAM (str_obj, str);
-  markobj (str_obj);
+  (markobj) (str_obj);
   if (str->imp->marker)
     return (str->imp->marker) (str_obj, markobj);
   else
@@ -2741,7 +2748,7 @@ Return the corresponding character code in SHIFT-JIS as a cons of two bytes.
 
    Since the number of characters in Big5 is larger than maximum
    characters in Emacs' charset (96x96), it can't be handled as one
-   charset.  So, in Emacs, Big5 is divided into two: `charset-big5-1'
+   charset.  So, in Emacs, Big5 is devided into two: `charset-big5-1'
    and `charset-big5-2'.  Both <type>s are TYPE94x94.  The former
    contains frequently used characters and the latter contains less
    frequently used characters.  */
@@ -3586,15 +3593,11 @@ static int
 detect_coding_iso2022 (struct detection_state *st, CONST unsigned char *src,
                       unsigned int n)
 {
+  int c;
   int mask;
 
   /* #### There are serious deficiencies in the recognition mechanism
-     here.  This needs to be much smarter if it's going to cut it.
-     The sequence "\xff\x0f" is currently detected as LOCK_SHIFT while
-     it should be detected as Latin-1.
-     All the ISO2022 stuff in this file should be synced up with the
-     code from FSF Emacs-20.4, in which Mule should be more or less stable.
-     Perhaps we should wait till R2L works in FSF Emacs? */
+     here.  This needs to be much smarter if it's going to cut it. */
 
   if (!st->iso2022.initted)
     {
@@ -3614,7 +3617,7 @@ detect_coding_iso2022 (struct detection_state *st, CONST unsigned char *src,
 
   while (n--)
     {
-      int c = *src++;
+      c = *src++;
       if (c >= 0xA0)
        {
          mask &= ~CODING_CATEGORY_ISO_7_MASK;
@@ -3777,6 +3780,7 @@ static void
 decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src,
                       unsigned_char_dynarr *dst, unsigned int n)
 {
+  unsigned char c;
   unsigned int flags, ch;
   enum eol_type eol_type;
   struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
@@ -3792,7 +3796,7 @@ decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src,
 
   while (n--)
     {
-      unsigned char c = *src++;
+      c = *src++;
       if (flags & CODING_STATE_ESCAPE)
        {       /* Within ESC sequence */
          int retval = parse_iso2022_esc (coding_system, &str->iso2022,
@@ -3907,8 +3911,7 @@ decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src,
          charset = str->iso2022.charset[reg];
 
          /* Error checking: */
-         if (! CHARSETP (charset)
-             || str->iso2022.invalid_designated[reg]
+         if (NILP (charset) || str->iso2022.invalid_designated[reg]
              || (((c & 0x7F) == ' ' || (c & 0x7F) == ISO_CODE_DEL)
                  && XCHARSET_CHARS (charset) == 94))
            /* Mrmph.  We are trying to invoke a register that has no
@@ -4481,27 +4484,24 @@ static Bufbyte_dynarr *conversion_in_dynarr;
 
 /* Determine coding system from coding format */
 
+#define FILE_NAME_CODING_SYSTEM                        \
+ ((NILP (Vfile_name_coding_system) ||                  \
+   (EQ ((Vfile_name_coding_system), Qbinary))) ?       \
+  Qnil : Fget_coding_system (Vfile_name_coding_system))
+
 /* #### not correct for all values of `fmt'! */
-static Lisp_Object
-external_data_format_to_coding_system (enum external_data_format fmt)
-{
-  switch (fmt)
-    {
-    case FORMAT_FILENAME:
-    case FORMAT_TERMINAL:
-      if (EQ (Vfile_name_coding_system, Qnil) ||
-         EQ (Vfile_name_coding_system, Qbinary))
-       return Qnil;
-      else
-       return Fget_coding_system (Vfile_name_coding_system);
 #ifdef MULE
-    case FORMAT_CTEXT:
-      return Fget_coding_system (Qctext);
+#define FMT_CODING_SYSTEM(fmt)                                 \
+ (((fmt) == FORMAT_FILENAME) ? FILE_NAME_CODING_SYSTEM     :   \
+  ((fmt) == FORMAT_CTEXT   ) ? Fget_coding_system (Qctext) :   \
+  ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM     :   \
+  Qnil)
+#else
+#define FMT_CODING_SYSTEM(fmt)                                 \
+ (((fmt) == FORMAT_FILENAME) ? FILE_NAME_CODING_SYSTEM     :   \
+  ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM     :   \
+  Qnil)
 #endif
-    default:
-      return Qnil;
-    }
-}
 
 Extbyte *
 convert_to_external_format (CONST Bufbyte *ptr,
@@ -4509,7 +4509,7 @@ convert_to_external_format (CONST Bufbyte *ptr,
                            Extcount *len_out,
                            enum external_data_format fmt)
 {
-  Lisp_Object coding_system = external_data_format_to_coding_system (fmt);
+  Lisp_Object coding_system = FMT_CODING_SYSTEM (fmt);
 
   if (!conversion_out_dynarr)
     conversion_out_dynarr = Dynarr_new (Extbyte);
@@ -4577,7 +4577,7 @@ convert_from_external_format (CONST Extbyte *ptr,
                              Bytecount *len_out,
                              enum external_data_format fmt)
 {
-  Lisp_Object coding_system = external_data_format_to_coding_system (fmt);
+  Lisp_Object coding_system = FMT_CODING_SYSTEM (fmt);
 
   if (!conversion_in_dynarr)
     conversion_in_dynarr = Dynarr_new (Bufbyte);
@@ -4819,9 +4819,9 @@ Setting this to nil does not do anything.
 void
 complex_vars_of_mule_coding (void)
 {
-  staticpro (&Vcoding_system_hash_table);
-  Vcoding_system_hash_table =
-    make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
+  staticpro (&Vcoding_system_hashtable);
+  Vcoding_system_hashtable = make_lisp_hashtable (50, HASHTABLE_NONWEAK,
+                                                 HASHTABLE_EQ);
 
   the_codesys_prop_dynarr = Dynarr_new (codesys_prop);
 
index a29e3ec..2643f4c 100644 (file)
@@ -256,7 +256,7 @@ extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol, Qno_conversion;
 extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion;
 extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven;
 extern Lisp_Object Qshift_jis, Qshort, Vcoding_system_for_read;
-extern Lisp_Object Vcoding_system_for_write, Vcoding_system_hash_table;
+extern Lisp_Object Vcoding_system_for_write, Vcoding_system_hashtable;
 extern Lisp_Object Vfile_name_coding_system, Vkeyboard_coding_system;
 extern Lisp_Object Vterminal_coding_system;
 
index c9d19f6..22cba39 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -43,14 +43,12 @@ Boston, MA 02111-1307, USA.  */
 
 #include "buffer.h"
 #include "bytecode.h"
+#include "commands.h"
 #include "device.h"
 #include "events.h"
 #include "extents.h"
 #include "frame.h"
 #include "systime.h"
-#include "insdel.h"
-#include "lstream.h"
-#include "opaque.h"
 
 /* NOTE: This symbol is also used in lread.c */
 #define FEATUREP_SYNTAX
@@ -90,10 +88,10 @@ print_bit_vector (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 }
 
 static int
-bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+bit_vector_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
-  struct Lisp_Bit_Vector *v1 = XBIT_VECTOR (obj1);
-  struct Lisp_Bit_Vector *v2 = XBIT_VECTOR (obj2);
+  struct Lisp_Bit_Vector *v1 = XBIT_VECTOR (o1);
+  struct Lisp_Bit_Vector *v2 = XBIT_VECTOR (o2);
 
   return ((bit_vector_length (v1) == bit_vector_length (v2)) &&
          !memcmp (v1->bits, v2->bits,
@@ -177,10 +175,10 @@ length_with_bytecode_hack (Lisp_Object seq)
     return XINT (Flength (seq));
   else
     {
-      struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (seq);
+      struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (seq);
 
-      return (f->flags.interactivep ? COMPILED_INTERACTIVE :
-             f->flags.domainp      ? COMPILED_DOMAIN :
+      return (b->flags.interactivep ? COMPILED_INTERACTIVE :
+             b->flags.domainp      ? COMPILED_DOMAIN :
              COMPILED_DOC_STRING)
        + 1;
     }
@@ -208,9 +206,16 @@ Return the length of vector, bit vector, list or string SEQUENCE.
     return make_int (XSTRING_CHAR_LENGTH (sequence));
   else if (CONSP (sequence))
     {
-      int len;
-      GET_EXTERNAL_LIST_LENGTH (sequence, len);
-      return make_int (len);
+      Lisp_Object tail;
+      int i = 0;
+
+      EXTERNAL_LIST_LOOP (tail, sequence)
+       {
+         QUIT;
+         i++;
+       }
+
+      return make_int (i);
     }
   else if (VECTORP (sequence))
     return make_int (XVECTOR_LENGTH (sequence));
@@ -226,6 +231,9 @@ Return the length of vector, bit vector, list or string SEQUENCE.
     }
 }
 
+/* This does not check for quits.  That is safe
+   since it must terminate.  */
+
 DEFUN ("safe-length", Fsafe_length, 1, 1, 0, /*
 Return the length of a list, but avoid error or infinite loop.
 This function never gets an error.  If LIST is not really a list,
@@ -234,15 +242,17 @@ which is at least the number of distinct elements.
 */
        (list))
 {
-  Lisp_Object hare, tortoise;
-  int len;
+  Lisp_Object halftail = list; /* Used to detect circular lists. */
+  Lisp_Object tail;
+  int len = 0;
 
-  for (hare = tortoise = list, len = 0;
-       CONSP (hare) && (! EQ (hare, tortoise) || len == 0);
-       hare = XCDR (hare), len++)
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
-      if (len & 1)
-       tortoise = XCDR (tortoise);
+      if (EQ (tail, halftail) && len != 0)
+       break;
+      len++;
+      if ((len & 1) == 0)
+       halftail = XCDR (halftail);
     }
 
   return make_int (len);
@@ -498,65 +508,38 @@ arguments.  Each argument may be a list, vector, bit vector, or string.
   return concat (nargs, args, c_bit_vector, 0);
 }
 
-/* Copy a (possibly dotted) list.  LIST must be a cons.
-   Can't use concat (1, &alist, c_cons, 0) - doesn't handle dotted lists. */
-static Lisp_Object
-copy_list (Lisp_Object list)
-{
-  Lisp_Object list_copy = Fcons (XCAR (list), XCDR (list));
-  Lisp_Object last = list_copy;
-  Lisp_Object hare, tortoise;
-  int len;
-
-  for (tortoise = hare = XCDR (list), len = 1;
-       CONSP (hare);
-       hare = XCDR (hare), len++)
-    {
-      XCDR (last) = Fcons (XCAR (hare), XCDR (hare));
-      last = XCDR (last);
-
-      if (len < CIRCULAR_LIST_SUSPICION_LENGTH)
-       continue;
-      if (len & 1)
-       tortoise = XCDR (tortoise);
-      if (EQ (tortoise, hare))
-       signal_circular_list_error (list);
-    }
-
-  return list_copy;
-}
-
-DEFUN ("copy-list", Fcopy_list, 1, 1, 0, /*
-Return a copy of list LIST, which may be a dotted list.
-The elements of LIST are not copied; they are shared
+DEFUN ("copy-sequence", Fcopy_sequence, 1, 1, 0, /*
+Return a copy of a list, vector, bit vector or string.
+The elements of a list or vector are not copied; they are shared
 with the original.
 */
-       (list))
+       (arg))
 {
  again:
-  if (NILP  (list)) return list;
-  if (CONSP (list)) return copy_list (list);
+  if (NILP (arg)) return arg;
+  /* We handle conses separately because concat() is big and hairy and
+     doesn't handle (copy-sequence '(a b . c)) and it's easier to redo this
+     than to fix concat() without worrying about breaking other things.
+   */
+  if (CONSP (arg))
+    {
+      Lisp_Object head = Fcons (XCAR (arg), XCDR (arg));
+      Lisp_Object tail = head;
 
-  list = wrong_type_argument (Qlistp, list);
-  goto again;
-}
+      for (arg = XCDR (arg); CONSP (arg); arg = XCDR (arg))
+       {
+         XCDR (tail) = Fcons (XCAR (arg), XCDR (arg));
+         tail = XCDR (tail);
+         QUIT;
+       }
+      return head;
+    }
+  if (STRINGP     (arg)) return concat (1, &arg, c_string,     0);
+  if (VECTORP     (arg)) return concat (1, &arg, c_vector,     0);
+  if (BIT_VECTORP (arg)) return concat (1, &arg, c_bit_vector, 0);
 
-DEFUN ("copy-sequence", Fcopy_sequence, 1, 1, 0, /*
-Return a copy of list, vector, bit vector or string SEQUENCE.
-The elements of a list or vector are not copied; they are shared
-with the original. SEQUENCE may be a dotted list.
-*/
-       (sequence))
-{
- again:
-  if (NILP        (sequence)) return sequence;
-  if (CONSP       (sequence)) return copy_list (sequence);
-  if (STRINGP     (sequence)) return concat (1, &sequence, c_string,     0);
-  if (VECTORP     (sequence)) return concat (1, &sequence, c_vector,     0);
-  if (BIT_VECTORP (sequence)) return concat (1, &sequence, c_bit_vector, 0);
-
-  check_losing_bytecode ("copy-sequence", sequence);
-  sequence = wrong_type_argument (Qsequencep, sequence);
+  check_losing_bytecode ("copy-sequence", arg);
+  arg = wrong_type_argument (Qsequencep, arg);
   goto again;
 }
 
@@ -885,6 +868,7 @@ Relevant parts of the string-extent-data are copied in the new string.
   Lisp_Object val;
 
   CHECK_STRING (string);
+  /* Historically, FROM could not be omitted.  Whatever ... */
   CHECK_INT (from);
   get_string_range_char (string, from, to, &ccfr, &ccto,
                         GB_HISTORICAL_STRING_BEHAVIOR);
@@ -1036,9 +1020,9 @@ Return element of SEQUENCE at index N.
         args_out_of_range (sequence, n);
 #endif
     }
-  else if (STRINGP     (sequence) ||
-           VECTORP     (sequence) ||
-           BIT_VECTORP (sequence))
+  else if (STRINGP (sequence)
+           || VECTORP (sequence)
+           || BIT_VECTORP (sequence))
     return Faref (sequence, n);
 #ifdef LOSING_BYTECODE
   else if (COMPILED_FUNCTIONP (sequence))
@@ -1051,24 +1035,24 @@ Return element of SEQUENCE at index N.
         }
       /* Utter perversity */
       {
-       Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (sequence);
+        struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (sequence);
         switch (idx)
           {
           case COMPILED_ARGLIST:
-            return compiled_function_arglist (f);
-          case COMPILED_INSTRUCTIONS:
-            return compiled_function_instructions (f);
+            return b->arglist;
+          case COMPILED_BYTECODE:
+            return b->bytecodes;
           case COMPILED_CONSTANTS:
-            return compiled_function_constants (f);
+            return b->constants;
           case COMPILED_STACK_DEPTH:
-            return compiled_function_stack_depth (f);
+            return make_int (b->maxdepth);
           case COMPILED_DOC_STRING:
-           return compiled_function_documentation (f);
+           return compiled_function_documentation (b);
           case COMPILED_DOMAIN:
-           return compiled_function_domain (f);
+           return compiled_function_domain (b);
           case COMPILED_INTERACTIVE:
-           if (f->flags.interactivep)
-             return compiled_function_interactive (f);
+           if (b->flags.interactivep)
+             return compiled_function_interactive (b);
            /* if we return nil, can't tell interactive with no args
               from noninteractive. */
            goto lose;
@@ -1086,126 +1070,19 @@ Return element of SEQUENCE at index N.
     }
 }
 
-DEFUN ("last", Flast, 1, 2, 0, /*
-Return the tail of list LIST, of length N (default 1).
-LIST may be a dotted list, but not a circular list.
-Optional argument N must be a non-negative integer.
-If N is zero, then the atom that terminates the list is returned.
-If N is greater than the length of LIST, then LIST itself is returned.
-*/
-       (list, n))
-{
-  int int_n, count;
-  Lisp_Object retval, tortoise, hare;
-
-  CHECK_LIST (list);
-
-  if (NILP (n))
-    int_n = 1;
-  else
-    {
-      CHECK_NATNUM (n);
-      int_n = XINT (n);
-    }
-
-  for (retval = tortoise = hare = list, count = 0;
-       CONSP (hare);
-       hare = XCDR (hare),
-        (int_n-- <= 0 ? ((void) (retval = XCDR (retval))) : (void)0),
-        count++)
-    {
-      if (count < CIRCULAR_LIST_SUSPICION_LENGTH) continue;
-
-      if (count & 1)
-       tortoise = XCDR (tortoise);
-      if (EQ (hare, tortoise))
-       signal_circular_list_error (list);
-    }
-
-  return retval;
-}
-
-DEFUN ("nbutlast", Fnbutlast, 1, 2, 0, /*
-Modify LIST to remove the last N (default 1) elements.
-If LIST has N or fewer elements, nil is returned and LIST is unmodified.
-*/
-       (list, n))
-{
-  int int_n;
-
-  CHECK_LIST (list);
-
-  if (NILP (n))
-    int_n = 1;
-  else
-    {
-      CHECK_NATNUM (n);
-      int_n = XINT (n);
-    }
-
-  {
-    Lisp_Object last_cons = list;
-
-    EXTERNAL_LIST_LOOP_1 (list)
-      {
-       if (int_n-- < 0)
-         last_cons = XCDR (last_cons);
-      }
-
-    if (int_n >= 0)
-      return Qnil;
-
-    XCDR (last_cons) = Qnil;
-    return list;
-  }
-}
-
-DEFUN ("butlast", Fbutlast, 1, 2, 0, /*
-Return a copy of LIST with the last N (default 1) elements removed.
-If LIST has N or fewer elements, nil is returned.
-*/
-       (list, n))
-{
-  int int_n;
-
-  CHECK_LIST (list);
-
-  if (NILP (n))
-    int_n = 1;
-  else
-    {
-      CHECK_NATNUM (n);
-      int_n = XINT (n);
-    }
-
-  {
-    Lisp_Object retval = Qnil;
-    Lisp_Object tail = list;
-
-    EXTERNAL_LIST_LOOP_1 (list)
-      {
-       if (--int_n < 0)
-         {
-           retval = Fcons (XCAR (tail), retval);
-           tail = XCDR (tail);
-         }
-      }
-
-    return Fnreverse (retval);
-  }
-}
-
 DEFUN ("member", Fmember, 2, 2, 0, /*
 Return non-nil if ELT is an element of LIST.  Comparison done with `equal'.
 The value is actually the tail of LIST whose car is ELT.
 */
        (elt, list))
 {
-  Lisp_Object list_elt, tail;
-  EXTERNAL_LIST_LOOP_3 (list_elt, list, tail)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (internal_equal (elt, list_elt, 0))
+      CONCHECK_CONS (tail);
+      if (internal_equal (elt, XCAR (tail), 0))
         return tail;
+      QUIT;
     }
   return Qnil;
 }
@@ -1218,11 +1095,13 @@ Do not use it.
 */
        (elt, list))
 {
-  Lisp_Object list_elt, tail;
-  EXTERNAL_LIST_LOOP_3 (list_elt, list, tail)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (internal_old_equal (elt, list_elt, 0))
+      CONCHECK_CONS (tail);
+      if (internal_old_equal (elt, XCAR (tail), 0))
         return tail;
+      QUIT;
     }
   return Qnil;
 }
@@ -1233,11 +1112,14 @@ The value is actually the tail of LIST whose car is ELT.
 */
        (elt, list))
 {
-  Lisp_Object list_elt, tail;
-  EXTERNAL_LIST_LOOP_3 (list_elt, list, tail)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (EQ_WITH_EBOLA_NOTICE (elt, list_elt))
+      REGISTER Lisp_Object tem;
+      CONCHECK_CONS (tail);
+      if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem))
         return tail;
+      QUIT;
     }
   return Qnil;
 }
@@ -1250,11 +1132,14 @@ Do not use it.
 */
        (elt, list))
 {
-  Lisp_Object list_elt, tail;
-  EXTERNAL_LIST_LOOP_3 (list_elt, list, tail)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (HACKEQ_UNSAFE (elt, list_elt))
+      REGISTER Lisp_Object tem;
+      CONCHECK_CONS (tail);
+      if (tem = XCAR (tail), HACKEQ_UNSAFE (elt, tem))
         return tail;
+      QUIT;
     }
   return Qnil;
 }
@@ -1262,10 +1147,11 @@ Do not use it.
 Lisp_Object
 memq_no_quit (Lisp_Object elt, Lisp_Object list)
 {
-  Lisp_Object list_elt, tail;
-  LIST_LOOP_3 (list_elt, list, tail)
+  REGISTER Lisp_Object tail;
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
-      if (EQ_WITH_EBOLA_NOTICE (elt, list_elt))
+      REGISTER Lisp_Object tem;
+      if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem))
         return tail;
     }
   return Qnil;
@@ -1278,11 +1164,15 @@ The value is actually the element of LIST whose car equals KEY.
        (key, list))
 {
   /* This function can GC. */
-  Lisp_Object elt, elt_car, elt_cdr;
-  EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (internal_equal (key, elt_car, 0))
+      REGISTER Lisp_Object elt;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && internal_equal (XCAR (elt), key, 0))
        return elt;
+      QUIT;
     }
   return Qnil;
 }
@@ -1294,11 +1184,15 @@ The value is actually the element of LIST whose car equals KEY.
        (key, list))
 {
   /* This function can GC. */
-  Lisp_Object elt, elt_car, elt_cdr;
-  EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (internal_old_equal (key, elt_car, 0))
+      REGISTER Lisp_Object elt;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && internal_old_equal (XCAR (elt), key, 0))
        return elt;
+      QUIT;
     }
   return Qnil;
 }
@@ -1318,11 +1212,15 @@ Elements of LIST that are not conses are ignored.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
-  EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (EQ_WITH_EBOLA_NOTICE (key, elt_car))
+      REGISTER Lisp_Object elt, tem;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem)))
        return elt;
+      QUIT;
     }
   return Qnil;
 }
@@ -1336,11 +1234,15 @@ Do not use it.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
-  EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (HACKEQ_UNSAFE (key, elt_car))
+      REGISTER Lisp_Object elt, tem;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCAR (elt), HACKEQ_UNSAFE (key, tem)))
        return elt;
+      QUIT;
     }
   return Qnil;
 }
@@ -1352,12 +1254,13 @@ Lisp_Object
 assq_no_quit (Lisp_Object key, Lisp_Object list)
 {
   /* This cannot GC. */
-  Lisp_Object elt;
-  LIST_LOOP_2 (elt, list)
+  REGISTER Lisp_Object tail;
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
-      Lisp_Object elt_car = XCAR (elt);
-      if (EQ_WITH_EBOLA_NOTICE (key, elt_car))
-       return elt;
+      REGISTER Lisp_Object tem, elt;
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem)))
+         return elt;
     }
   return Qnil;
 }
@@ -1368,11 +1271,15 @@ The value is actually the element of LIST whose cdr equals KEY.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
-  EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (internal_equal (key, elt_cdr, 0))
+      REGISTER Lisp_Object elt;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && internal_equal (XCDR (elt), key, 0))
        return elt;
+      QUIT;
     }
   return Qnil;
 }
@@ -1383,11 +1290,15 @@ The value is actually the element of LIST whose cdr equals KEY.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
-  EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (internal_old_equal (key, elt_cdr, 0))
+      REGISTER Lisp_Object elt;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && internal_old_equal (XCDR (elt), key, 0))
        return elt;
+      QUIT;
     }
   return Qnil;
 }
@@ -1398,11 +1309,15 @@ The value is actually the element of LIST whose cdr is KEY.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
-  EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (EQ_WITH_EBOLA_NOTICE (key, elt_cdr))
+      REGISTER Lisp_Object elt, tem;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCDR (elt), EQ_WITH_EBOLA_NOTICE (key, tem)))
        return elt;
+      QUIT;
     }
   return Qnil;
 }
@@ -1413,25 +1328,28 @@ The value is actually the element of LIST whose cdr is KEY.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
-  EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
+  REGISTER Lisp_Object tail;
+  LIST_LOOP (tail, list)
     {
-      if (HACKEQ_UNSAFE (key, elt_cdr))
+      REGISTER Lisp_Object elt, tem;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCDR (elt), HACKEQ_UNSAFE (key, tem)))
        return elt;
+      QUIT;
     }
   return Qnil;
 }
 
-/* Like Frassq, but caller must ensure that LIST is properly
-   nil-terminated and ebola-free. */
 Lisp_Object
 rassq_no_quit (Lisp_Object key, Lisp_Object list)
 {
-  Lisp_Object elt;
-  LIST_LOOP_2 (elt, list)
+  REGISTER Lisp_Object tail;
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
-      Lisp_Object elt_cdr = XCDR (elt);
-      if (EQ_WITH_EBOLA_NOTICE (key, elt_cdr))
+      REGISTER Lisp_Object elt, tem;
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCDR (elt), EQ_WITH_EBOLA_NOTICE (key, tem)))
        return elt;
     }
   return Qnil;
@@ -1448,9 +1366,24 @@ Also see: `remove'.
 */
        (elt, list))
 {
-  Lisp_Object list_elt;
-  EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
-                               (internal_equal (elt, list_elt, 0)));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (!NILP (tail))
+    {
+      CONCHECK_CONS (tail);
+      if (internal_equal (elt, XCAR (tail), 0))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
   return list;
 }
 
@@ -1463,9 +1396,24 @@ of changing the value of `foo'.
 */
        (elt, list))
 {
-  Lisp_Object list_elt;
-  EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
-                               (internal_old_equal (elt, list_elt, 0)));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (!NILP (tail))
+    {
+      CONCHECK_CONS (tail);
+      if (internal_old_equal (elt, XCAR (tail), 0))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
   return list;
 }
 
@@ -1478,9 +1426,25 @@ changing the value of `foo'.
 */
        (elt, list))
 {
-  Lisp_Object list_elt;
-  EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
-                               (EQ_WITH_EBOLA_NOTICE (elt, list_elt)));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (!NILP (tail))
+    {
+      REGISTER Lisp_Object tem;
+      CONCHECK_CONS (tail);
+      if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
   return list;
 }
 
@@ -1493,21 +1457,50 @@ changing the value of `foo'.
 */
        (elt, list))
 {
-  Lisp_Object list_elt;
-  EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
-                               (HACKEQ_UNSAFE (elt, list_elt)));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (!NILP (tail))
+    {
+      REGISTER Lisp_Object tem;
+      CONCHECK_CONS (tail);
+      if (tem = XCAR (tail), HACKEQ_UNSAFE (elt, tem))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
   return list;
 }
 
-/* Like Fdelq, but caller must ensure that LIST is properly
-   nil-terminated and ebola-free. */
+/* no quit, no errors; be careful */
 
 Lisp_Object
 delq_no_quit (Lisp_Object elt, Lisp_Object list)
 {
-  Lisp_Object list_elt;
-  LIST_LOOP_DELETE_IF (list_elt, list,
-                      (EQ_WITH_EBOLA_NOTICE (elt, list_elt)));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (CONSP (tail))
+    {
+      REGISTER Lisp_Object tem;
+      if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+    }
   return list;
 }
 
@@ -1523,24 +1516,26 @@ delq_no_quit_and_free_cons (Lisp_Object elt, Lisp_Object list)
 {
   REGISTER Lisp_Object tail = list;
   REGISTER Lisp_Object prev = Qnil;
+  struct Lisp_Cons *cons_to_free = NULL;
 
-  while (!NILP (tail))
+  while (CONSP (tail))
     {
-      REGISTER Lisp_Object tem = XCAR (tail);
-      if (EQ (elt, tem))
+      REGISTER Lisp_Object tem;
+      if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem))
        {
-         Lisp_Object cons_to_free = tail;
          if (NILP (prev))
            list = XCDR (tail);
          else
            XCDR (prev) = XCDR (tail);
-         tail = XCDR (tail);
-         free_cons (XCONS (cons_to_free));
+         cons_to_free = XCONS (tail);
        }
       else
+       prev = tail;
+      tail = XCDR (tail);
+      if (cons_to_free)
        {
-         prev = tail;
-         tail = XCDR (tail);
+         free_cons (cons_to_free);
+         cons_to_free = NULL;
        }
     }
   return list;
@@ -1555,10 +1550,26 @@ the value of `foo'.
 */
        (key, list))
 {
-  Lisp_Object elt;
-  EXTERNAL_LIST_LOOP_DELETE_IF (elt, list,
-                               (CONSP (elt) &&
-                                internal_equal (key, XCAR (elt), 0)));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (!NILP (tail))
+    {
+      REGISTER Lisp_Object elt;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && internal_equal (key, XCAR (elt), 0))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
   return list;
 }
 
@@ -1579,10 +1590,26 @@ the value of `foo'.
 */
        (key, list))
 {
-  Lisp_Object elt;
-  EXTERNAL_LIST_LOOP_DELETE_IF (elt, list,
-                               (CONSP (elt) &&
-                                EQ_WITH_EBOLA_NOTICE (key, XCAR (elt))));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (!NILP (tail))
+    {
+      REGISTER Lisp_Object elt, tem;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem)))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
   return list;
 }
 
@@ -1591,10 +1618,24 @@ the value of `foo'.
 Lisp_Object
 remassq_no_quit (Lisp_Object key, Lisp_Object list)
 {
-  Lisp_Object elt;
-  LIST_LOOP_DELETE_IF (elt, list,
-                      (CONSP (elt) &&
-                       EQ_WITH_EBOLA_NOTICE (key, XCAR (elt))));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (CONSP (tail))
+    {
+      REGISTER Lisp_Object elt, tem;
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem)))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+    }
   return list;
 }
 
@@ -1607,10 +1648,26 @@ the value of `foo'.
 */
        (value, list))
 {
-  Lisp_Object elt;
-  EXTERNAL_LIST_LOOP_DELETE_IF (elt, list,
-                               (CONSP (elt) &&
-                                internal_equal (value, XCDR (elt), 0)));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (!NILP (tail))
+    {
+      REGISTER Lisp_Object elt;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && internal_equal (value, XCDR (elt), 0))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
   return list;
 }
 
@@ -1623,21 +1680,52 @@ the value of `foo'.
 */
        (value, list))
 {
-  Lisp_Object elt;
-  EXTERNAL_LIST_LOOP_DELETE_IF (elt, list,
-                               (CONSP (elt) &&
-                                EQ_WITH_EBOLA_NOTICE (value, XCDR (elt))));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (!NILP (tail))
+    {
+      REGISTER Lisp_Object elt, tem;
+      CONCHECK_CONS (tail);
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (value, tem)))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+      QUIT;
+    }
   return list;
 }
 
-/* Like Fremrassq, fast and unsafe; be careful */
+/* no quit, no errors; be careful */
+
 Lisp_Object
 remrassq_no_quit (Lisp_Object value, Lisp_Object list)
 {
-  Lisp_Object elt;
-  LIST_LOOP_DELETE_IF (elt, list,
-                      (CONSP (elt) &&
-                       EQ_WITH_EBOLA_NOTICE (value, XCDR (elt))));
+  REGISTER Lisp_Object tail = list;
+  REGISTER Lisp_Object prev = Qnil;
+
+  while (CONSP (tail))
+    {
+      REGISTER Lisp_Object elt, tem;
+      elt = XCAR (tail);
+      if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (value, tem)))
+       {
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           XCDR (prev) = XCDR (tail);
+       }
+      else
+       prev = tail;
+      tail = XCDR (tail);
+    }
   return list;
 }
 
@@ -1657,6 +1745,7 @@ Also see: `reverse'.
   while (!NILP (tail))
     {
       REGISTER Lisp_Object next;
+      QUIT;
       CONCHECK_CONS (tail);
       next = XCDR (tail);
       XCDR (tail) = prev;
@@ -1673,13 +1762,17 @@ See also the function `nreverse', which is used more often.
 */
        (list))
 {
-  Lisp_Object reversed_list = Qnil;
-  Lisp_Object elt;
-  EXTERNAL_LIST_LOOP_2 (elt, list)
+  REGISTER Lisp_Object tail;
+  Lisp_Object new = Qnil;
+
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
-      reversed_list = Fcons (elt, reversed_list);
+      new = Fcons (XCAR (tail), new);
+      QUIT;
     }
-  return reversed_list;
+  if (!NILP (tail))
+    dead_wrong_type_argument (Qlistp, tail);
+  return new;
 }
 \f
 static Lisp_Object list_merge (Lisp_Object org_l1, Lisp_Object org_l2,
@@ -1985,12 +2078,13 @@ If optional arg NIL-MEANS-NOT-PRESENT is non-nil, then a property with
 Lisp_Object
 internal_plist_get (Lisp_Object plist, Lisp_Object property)
 {
-  Lisp_Object tail;
+  Lisp_Object tail = plist;
 
-  for (tail = plist; !NILP (tail); tail = XCDR (XCDR (tail)))
+  for (; !NILP (tail); tail = XCDR (XCDR (tail)))
     {
-      if (EQ (XCAR (tail), property))
-       return XCAR (XCDR (tail));
+      struct Lisp_Cons *c = XCONS (tail);
+      if (EQ (c->car, property))
+       return XCAR (c->cdr);
     }
 
   return Qunbound;
@@ -2020,22 +2114,26 @@ internal_plist_put (Lisp_Object *plist, Lisp_Object property,
 int
 internal_remprop (Lisp_Object *plist, Lisp_Object property)
 {
-  Lisp_Object tail, prev;
+  Lisp_Object tail = *plist;
+
+  if (NILP (tail))
+    return 0;
+
+  if (EQ (XCAR (tail), property))
+    {
+      *plist = XCDR (XCDR (tail));
+      return 1;
+    }
 
-  for (tail = *plist, prev = Qnil;
-       !NILP (tail);
+  for (tail = XCDR (tail); !NILP (XCDR (tail));
        tail = XCDR (XCDR (tail)))
     {
-      if (EQ (XCAR (tail), property))
+      struct Lisp_Cons *c = XCONS (tail);
+      if (EQ (XCAR (c->cdr), property))
        {
-         if (NILP (prev))
-           *plist = XCDR (XCDR (tail));
-         else
-           XCDR (XCDR (prev)) = XCDR (XCDR (tail));
+         c->cdr = XCDR (XCDR (c->cdr));
          return 1;
        }
-      else
-       prev = tail;
     }
 
   return 0;
@@ -2110,7 +2208,7 @@ advance_plist_pointers (Lisp_Object *plist,
   Lisp_Object *tortsave = *tortoise;
 
   /* Note that our "fixing" may be more brutal than necessary,
-     but it's the user's own problem, not ours, if they went in and
+     but it's the user's own problem, not ours. if they went in and
      manually fucked up a plist. */
 
   for (i = 0; i < 2; i++)
@@ -2284,7 +2382,9 @@ one of the properties on the list.
        (plist, prop, default_))
 {
   Lisp_Object val = external_plist_get (&plist, prop, 0, ERROR_ME);
-  return UNBOUNDP (val) ? default_ : val;
+  if (UNBOUNDP (val))
+    return default_;
+  return val;
 }
 
 DEFUN ("plist-put", Fplist_put, 3, 3, 0, /*
@@ -2320,8 +2420,7 @@ Return t if PROP has a value specified in PLIST.
 */
        (plist, prop))
 {
-  Lisp_Object val = Fplist_get (plist, prop, Qunbound);
-  return UNBOUNDP (val) ? Qnil : Qt;
+  return UNBOUNDP (Fplist_get (plist, prop, Qunbound)) ? Qnil : Qt;
 }
 
 DEFUN ("check-valid-plist", Fcheck_valid_plist, 1, 1, 0, /*
@@ -2410,8 +2509,7 @@ The new plist is returned.  If NIL-MEANS-NOT-PRESENT is given, the
       /* external_remprop returns 1 if it removed any property.
         We have to loop till it didn't remove anything, in case
         the property occurs many times. */
-      while (external_remprop (&XCDR (next), prop, 0, ERROR_ME))
-       DO_NOTHING;
+      while (external_remprop (&XCDR (next), prop, 0, ERROR_ME));
       plist = Fcdr (next);
     }
 
@@ -2422,7 +2520,7 @@ DEFUN ("lax-plist-get", Flax_plist_get, 2, 3, 0, /*
 Extract a value from a lax property list.
 
 LAX-PLIST is a lax property list, which is a list of the form \(PROP1
-VALUE1 PROP2 VALUE2...), where comparisons between properties is done
+VALUE1 PROP2 VALUE2...), where comparions between properties is done
 using `equal' instead of `eq'.  This function returns the value
 corresponding to the given PROP, or DEFAULT if PROP is not one of the
 properties on the list.
@@ -2438,7 +2536,7 @@ properties on the list.
 DEFUN ("lax-plist-put", Flax_plist_put, 3, 3, 0, /*
 Change value in LAX-PLIST of PROP to VAL.
 LAX-PLIST is a lax property list, which is a list of the form \(PROP1
-VALUE1 PROP2 VALUE2...), where comparisons between properties is done
+VALUE1 PROP2 VALUE2...), where comparions between properties is done
 using `equal' instead of `eq'.  PROP is usually a symbol and VAL is
 any object.  If PROP is already a property on the list, its value is
 set to VAL, otherwise the new PROP VAL pair is added.  The new plist
@@ -2454,7 +2552,7 @@ use the new value.  The LAX-PLIST is modified by side effects.
 DEFUN ("lax-plist-remprop", Flax_plist_remprop, 2, 2, 0, /*
 Remove from LAX-PLIST the property PROP and its value.
 LAX-PLIST is a lax property list, which is a list of the form \(PROP1
-VALUE1 PROP2 VALUE2...), where comparisons between properties is done
+VALUE1 PROP2 VALUE2...), where comparions between properties is done
 using `equal' instead of `eq'.  PROP is usually a symbol.  The new
 plist is returned; use `(setq x (lax-plist-remprop x prop val))' to be
 sure to use the new value.  The LAX-PLIST is modified by side effects.
@@ -2468,7 +2566,7 @@ sure to use the new value.  The LAX-PLIST is modified by side effects.
 DEFUN ("lax-plist-member", Flax_plist_member, 2, 2, 0, /*
 Return t if PROP has a value specified in LAX-PLIST.
 LAX-PLIST is a lax property list, which is a list of the form \(PROP1
-VALUE1 PROP2 VALUE2...), where comparisons between properties is done
+VALUE1 PROP2 VALUE2...), where comparions between properties is done
 using `equal' instead of `eq'.
 */
        (lax_plist, prop))
@@ -2511,8 +2609,7 @@ The new plist is returned.  If NIL-MEANS-NOT-PRESENT is given, the
       /* external_remprop returns 1 if it removed any property.
         We have to loop till it didn't remove anything, in case
         the property occurs many times. */
-      while (external_remprop (&XCDR (next), prop, 1, ERROR_ME))
-       DO_NOTHING;
+      while (external_remprop (&XCDR (next), prop, 1, ERROR_ME));
       lax_plist = Fcdr (next);
     }
 
@@ -2633,35 +2730,37 @@ or string.  See also `put', `remprop', and `object-plist'.
 */
        (object, propname, default_))
 {
+  Lisp_Object val;
+
   /* Various places in emacs call Fget() and expect it not to quit,
      so don't quit. */
 
   /* It's easiest to treat symbols specially because they may not
      be an lrecord */
   if (SYMBOLP (object))
-    return symbol_getprop (object, propname, default_);
+    val = symbol_getprop (object, propname, default_);
   else if (STRINGP (object))
-    return string_getprop (XSTRING (object), propname, default_);
+    val = string_getprop (XSTRING (object), propname, default_);
   else if (LRECORDP (object))
     {
-      CONST struct lrecord_implementation *imp
-       = XRECORD_LHEADER_IMPLEMENTATION (object);
-      if (!imp->getprop)
+      CONST struct lrecord_implementation
+       *imp = XRECORD_LHEADER_IMPLEMENTATION (object);
+      if (imp->getprop)
+       {
+         val = (imp->getprop) (object, propname);
+         if (UNBOUNDP (val))
+           val = default_;
+       }
+      else
        goto noprops;
-
-      {
-       Lisp_Object val = (imp->getprop) (object, propname);
-       if (UNBOUNDP (val))
-         val = default_;
-       return val;
-      }
     }
   else
     {
     noprops:
       signal_simple_error ("Object type has no properties", object);
-      return Qnil;             /* Not reached */
     }
+
+  return val;
 }
 
 DEFUN ("put", Fput, 3, 3, 0, /*
@@ -2782,7 +2881,7 @@ interpretation, this will probably have no effect at all.)
 
 \f
 int
-internal_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+internal_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
   if (depth > 200)
     error ("Stack overflow in equal");
@@ -2790,28 +2889,28 @@ internal_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
  do_cdr:
 #endif
   QUIT;
-  if (EQ_WITH_EBOLA_NOTICE (obj1, obj2))
+  if (EQ_WITH_EBOLA_NOTICE (o1, o2))
     return 1;
   /* Note that (equal 20 20.0) should be nil */
-  if (XTYPE (obj1) != XTYPE (obj2))
+  else if (XTYPE (o1) != XTYPE (o2))
     return 0;
 #ifndef LRECORD_CONS
-  if (CONSP (obj1))
+  else if (CONSP (o1))
     {
-      if (!internal_equal (XCAR (obj1), XCAR (obj2), depth + 1))
+      if (!internal_equal (XCAR (o1), XCAR (o2), depth + 1))
         return 0;
-      obj1 = XCDR (obj1);
-      obj2 = XCDR (obj2);
+      o1 = XCDR (o1);
+      o2 = XCDR (o2);
       goto do_cdr;
     }
 #endif
 #ifndef LRECORD_VECTOR
-  if (VECTORP (obj1))
+  else if (VECTORP (o1))
     {
-      Lisp_Object *v1 = XVECTOR_DATA (obj1);
-      Lisp_Object *v2 = XVECTOR_DATA (obj2);
-      int len = XVECTOR_LENGTH (obj1);
-      if (len != XVECTOR_LENGTH (obj2))
+      Lisp_Object *v1 = XVECTOR_DATA (o1);
+      Lisp_Object *v2 = XVECTOR_DATA (o2);
+      int len = XVECTOR_LENGTH (o1);
+      if (len != XVECTOR_LENGTH (o2))
        return 0;
       while (len--)
        if (!internal_equal (*v1++, *v2++, depth + 1))
@@ -2820,22 +2919,25 @@ internal_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
     }
 #endif
 #ifndef LRECORD_STRING
-  if (STRINGP (obj1))
+  else if (STRINGP (o1))
     {
       Bytecount len;
-      return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) &&
-             !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len));
+      return (((len = XSTRING_LENGTH (o1)) == XSTRING_LENGTH (o2)) &&
+             !memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len));
     }
 #endif
-  if (LRECORDP (obj1))
+  else if (LRECORDP (o1))
     {
       CONST struct lrecord_implementation
-       *imp1 = XRECORD_LHEADER_IMPLEMENTATION (obj1),
-       *imp2 = XRECORD_LHEADER_IMPLEMENTATION (obj2);
-
-      return (imp1 == imp2) &&
+       *imp1 = XRECORD_LHEADER_IMPLEMENTATION (o1),
+       *imp2 = XRECORD_LHEADER_IMPLEMENTATION (o2);
+      if (imp1 != imp2)
+       return 0;
+      else if (imp1->equal == 0)
        /* EQ-ness of the objects was noticed above */
-       (imp1->equal && (imp1->equal) (obj1, obj2, depth));
+       return 0;
+      else
+       return (imp1->equal) (o1, o2, depth);
     }
 
   return 0;
@@ -2847,7 +2949,7 @@ internal_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
    but that seems unlikely. */
 
 static int
-internal_old_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+internal_old_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
   if (depth > 200)
     error ("Stack overflow in equal");
@@ -2855,37 +2957,64 @@ internal_old_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
  do_cdr:
 #endif
   QUIT;
-  if (HACKEQ_UNSAFE (obj1, obj2))
+  if (HACKEQ_UNSAFE (o1, o2))
     return 1;
   /* Note that (equal 20 20.0) should be nil */
-  if (XTYPE (obj1) != XTYPE (obj2))
+  else if (XTYPE (o1) != XTYPE (o2))
     return 0;
 #ifndef LRECORD_CONS
-  if (CONSP (obj1))
+  else if (CONSP (o1))
     {
-      if (!internal_old_equal (XCAR (obj1), XCAR (obj2), depth + 1))
+      if (!internal_old_equal (XCAR (o1), XCAR (o2), depth + 1))
         return 0;
-      obj1 = XCDR (obj1);
-      obj2 = XCDR (obj2);
+      o1 = XCDR (o1);
+      o2 = XCDR (o2);
       goto do_cdr;
     }
 #endif
 #ifndef LRECORD_VECTOR
-  if (VECTORP (obj1))
+  else if (VECTORP (o1))
     {
-      Lisp_Object *v1 = XVECTOR_DATA (obj1);
-      Lisp_Object *v2 = XVECTOR_DATA (obj2);
-      int len = XVECTOR_LENGTH (obj1);
-      if (len != XVECTOR_LENGTH (obj2))
+      int indice;
+      int len = XVECTOR_LENGTH (o1);
+      if (len != XVECTOR_LENGTH (o2))
+       return 0;
+      for (indice = 0; indice < len; indice++)
+       {
+         if (!internal_old_equal (XVECTOR_DATA (o1) [indice],
+                                  XVECTOR_DATA (o2) [indice],
+                                  depth + 1))
+            return 0;
+       }
+      return 1;
+    }
+#endif
+#ifndef LRECORD_STRING
+  else if (STRINGP (o1))
+    {
+      Bytecount len = XSTRING_LENGTH (o1);
+      if (len != XSTRING_LENGTH (o2))
+       return 0;
+      if (memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len))
        return 0;
-      while (len--)
-       if (!internal_old_equal (*v1++, *v2++, depth + 1))
-         return 0;
       return 1;
     }
 #endif
+  else if (LRECORDP (o1))
+    {
+      CONST struct lrecord_implementation
+       *imp1 = XRECORD_LHEADER_IMPLEMENTATION (o1),
+       *imp2 = XRECORD_LHEADER_IMPLEMENTATION (o2);
+      if (imp1 != imp2)
+       return 0;
+      else if (imp1->equal == 0)
+       /* EQ-ness of the objects was noticed above */
+       return 0;
+      else
+       return (imp1->equal) (o1, o2, depth);
+    }
 
-  return internal_equal (obj1, obj2, depth);
+  return 0;
 }
 
 DEFUN ("equal", Fequal, 2, 2, 0, /*
@@ -2895,9 +3024,9 @@ Conses are compared by comparing the cars and the cdrs.
 Vectors and strings are compared element by element.
 Numbers are compared by value.  Symbols must match exactly.
 */
-       (obj1, obj2))
+       (o1, o2))
 {
-  return internal_equal (obj1, obj2, 0) ? Qt : Qnil;
+  return internal_equal (o1, o2, 0) ? Qt : Qnil;
 }
 
 DEFUN ("old-equal", Fold_equal, 2, 2, 0, /*
@@ -2909,9 +3038,9 @@ this is known as the "char-int confoundance disease." See `eq' and
 This function is provided only for byte-code compatibility with v19.
 Do not use it.
 */
-       (obj1, obj2))
+       (o1, o2))
 {
-  return internal_old_equal (obj1, obj2, 0) ? Qt : Qnil;
+  return internal_old_equal (o1, o2, 0) ? Qt : Qnil;
 }
 
 \f
@@ -2963,53 +3092,12 @@ ARRAY is a vector, bit vector, or string.
 }
 
 Lisp_Object
-nconc2 (Lisp_Object arg1, Lisp_Object arg2)
+nconc2 (Lisp_Object s1, Lisp_Object s2)
 {
   Lisp_Object args[2];
-  struct gcpro gcpro1;
-  args[0] = arg1;
-  args[1] = arg2;
-
-  GCPRO1 (args[0]);
-  gcpro1.nvars = 2;
-
-  RETURN_UNGCPRO (bytecode_nconc2 (args));
-}
-
-Lisp_Object
-bytecode_nconc2 (Lisp_Object *args)
-{
- retry:
-
-  if (CONSP (args[0]))
-    {
-      /* (setcdr (last args[0]) args[1]) */
-      Lisp_Object tortoise, hare;
-      int count;
-
-      for (hare = tortoise = args[0], count = 0;
-          CONSP (XCDR (hare));
-          hare = XCDR (hare), count++)
-       {
-         if (count < CIRCULAR_LIST_SUSPICION_LENGTH) continue;
-
-         if (count & 1)
-           tortoise = XCDR (tortoise);
-         if (EQ (hare, tortoise))
-           signal_circular_list_error (args[0]);
-       }
-      XCDR (hare) = args[1];
-      return args[0];
-    }
-  else if (NILP (args[0]))
-    {
-      return args[1];
-    }
-  else
-    {
-      args[0] = wrong_type_argument (args[0], Qlistp);
-      goto retry;
-    }
+  args[0] = s1;
+  args[1] = s2;
+  return Fnconc (2, args);
 }
 
 DEFUN ("nconc", Fnconc, 0, MANY, 0, /*
@@ -3037,37 +3125,25 @@ changing the value of `foo'.
 
   while (argnum < nargs)
     {
-      Lisp_Object val;
-    retry:
-      val = args[argnum];
+      Lisp_Object val = args[argnum];
       if (CONSP (val))
        {
-         /* `val' is the first cons, which will be our return value.  */
-         /* `last_cons' will be the cons cell to mutate.  */
-         Lisp_Object last_cons = val;
-         Lisp_Object tortoise = val;
+         /* Found the first cons, which will be our return value.  */
+         Lisp_Object last = val;
 
          for (argnum++; argnum < nargs; argnum++)
            {
              Lisp_Object next = args[argnum];
-           retry_next:
+           redo:
              if (CONSP (next) || argnum == nargs -1)
                {
                  /* (setcdr (last val) next) */
-                 int count;
-
-                 for (count = 0;
-                      CONSP (XCDR (last_cons));
-                      last_cons = XCDR (last_cons), count++)
+                 while (CONSP (XCDR (last)))
                    {
-                     if (count < CIRCULAR_LIST_SUSPICION_LENGTH) continue;
-
-                     if (count & 1)
-                       tortoise = XCDR (tortoise);
-                     if (EQ (last_cons, tortoise))
-                       signal_circular_list_error (args[argnum-1]);
+                     last = XCDR (last);
+                     QUIT;
                    }
-                 XCDR (last_cons) = next;
+                 XCDR (last) = next;
                }
              else if (NILP (next))
                {
@@ -3075,8 +3151,8 @@ changing the value of `foo'.
                }
              else
                {
-                 next = wrong_type_argument (Qlistp, next);
-                 goto retry_next;
+                 next = wrong_type_argument (next, Qlistp);
+                 goto redo;
                }
            }
          RETURN_UNGCPRO (val);
@@ -3086,84 +3162,86 @@ changing the value of `foo'.
       else if (argnum == nargs - 1) /* last arg? */
        RETURN_UNGCPRO (val);
       else
-       {
-         args[argnum] = wrong_type_argument (Qlistp, val);
-         goto retry;
-       }
+       args[argnum] = wrong_type_argument (val, Qlistp);
     }
   RETURN_UNGCPRO (Qnil);  /* No non-nil args provided. */
 }
 
 \f
 /* This is the guts of all mapping functions.
-   Apply fn to each element of seq, one by one,
-   storing the results into elements of vals, a C vector of Lisp_Objects.
-   leni is the length of vals, which should also be the length of seq.
+ Apply fn to each element of seq, one by one,
+ storing the results into elements of vals, a C vector of Lisp_Objects.
+ leni is the length of vals, which should also be the length of seq.
 
-   If VALS is a null pointer, do not accumulate the results. */
+ If VALS is a null pointer, do not accumulate the results. */
 
 static void
-mapcar1 (size_t leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq)
+mapcar1 (int leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq)
 {
-  Lisp_Object result;
-  Lisp_Object args[2];
+  Lisp_Object tail;
+  Lisp_Object dummy = Qnil;
   int i;
-  struct gcpro gcpro1;
+  struct gcpro gcpro1, gcpro2, gcpro3;
+  Lisp_Object result;
+
+  GCPRO3 (dummy, fn, seq);
 
   if (vals)
     {
-      GCPRO1 (vals[0]);
-      gcpro1.nvars = 0;
+      /* Don't let vals contain any garbage when GC happens.  */
+      for (i = 0; i < leni; i++)
+       vals[i] = Qnil;
+      gcpro1.var = vals;
+      gcpro1.nvars = leni;
     }
 
-  args[0] = fn;
+  /* We need not explicitly protect `tail' because it is used only on
+    lists, and 1) lists are not relocated and 2) the list is marked
+    via `seq' so will not be freed */
 
-  if (LISTP (seq))
+  if (VECTORP (seq))
     {
       for (i = 0; i < leni; i++)
        {
-         args[1] = XCAR (seq);
-         seq = XCDR (seq);
-         result = Ffuncall (2, args);
-         if (vals) vals[gcpro1.nvars++] = result;
+         dummy = XVECTOR_DATA (seq)[i];
+         result = call1 (fn, dummy);
+         if (vals)
+           vals[i] = result;
        }
     }
-  else if (VECTORP (seq))
+  else if (BIT_VECTORP (seq))
     {
-      Lisp_Object *objs = XVECTOR_DATA (seq);
+      struct Lisp_Bit_Vector *v = XBIT_VECTOR (seq);
       for (i = 0; i < leni; i++)
        {
-         args[1] = *objs++;
-         result = Ffuncall (2, args);
-         if (vals) vals[gcpro1.nvars++] = result;
+         XSETINT (dummy, bit_vector_bit (v, i));
+         result = call1 (fn, dummy);
+         if (vals)
+           vals[i] = result;
        }
     }
   else if (STRINGP (seq))
     {
-      Bufbyte *p = XSTRING_DATA (seq);
       for (i = 0; i < leni; i++)
        {
-         args[1] = make_char (charptr_emchar (p));
-         INC_CHARPTR (p);
-         result = Ffuncall (2, args);
-         if (vals) vals[gcpro1.nvars++] = result;
+         result = call1 (fn, make_char (string_char (XSTRING (seq), i)));
+         if (vals)
+           vals[i] = result;
        }
     }
-  else if (BIT_VECTORP (seq))
+  else   /* Must be a list, since Flength did not get an error */
     {
-      struct Lisp_Bit_Vector *v = XBIT_VECTOR (seq);
+      tail = seq;
       for (i = 0; i < leni; i++)
        {
-         args[1] = make_int (bit_vector_bit (v, i));
-         result = Ffuncall (2, args);
-         if (vals) vals[gcpro1.nvars++] = result;
+         result = call1 (fn, Fcar (tail));
+         if (vals)
+           vals[i] = result;
+         tail = Fcdr (tail);
        }
     }
-  else
-    abort(); /* cannot get here since Flength(seq) did not get an error */
 
-  if (vals)
-    UNGCPRO;
+  UNGCPRO;
 }
 
 DEFUN ("mapconcat", Fmapconcat, 3, 3, 0, /*
@@ -3173,7 +3251,7 @@ Thus, " " as SEP results in spaces between the values returned by FN.
 */
        (fn, seq, sep))
 {
-  size_t len = XINT (Flength (seq));
+  int len = XINT (Flength (seq));
   Lisp_Object *args;
   int i;
   struct gcpro gcpro1;
@@ -3203,7 +3281,7 @@ SEQUENCE may be a list, a vector, a bit vector, or a string.
 */
        (fn, seq))
 {
-  size_t len = XINT (Flength (seq));
+  int len = XINT (Flength (seq));
   Lisp_Object *args = alloca_array (Lisp_Object, len);
 
   mapcar1 (len, args, fn, seq);
@@ -3218,7 +3296,9 @@ SEQUENCE may be a list, a vector or a string.
 */
        (fn, seq))
 {
-  size_t len = XINT (Flength (seq));
+  int len = XINT (Flength (seq));
+  /* Ideally, this should call make_vector_internal, because we don't
+     need initialization.  */
   Lisp_Object result = make_vector (len, Qnil);
   struct gcpro gcpro1;
 
@@ -3442,432 +3522,7 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name.
       return unbind_to (speccount, feature);
     }
 }
-\f
-/* base64 encode/decode functions.
-   Based on code from GNU recode. */
-
-#define MIME_LINE_LENGTH 76
-
-#define IS_ASCII(Character) \
-  ((Character) < 128)
-#define IS_BASE64(Character) \
-  (IS_ASCII (Character) && base64_char_to_value[Character] >= 0)
-
-/* Table of characters coding the 64 values.  */
-static char base64_value_to_char[64] =
-{
-  'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',    /*  0- 9 */
-  'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',    /* 10-19 */
-  'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',    /* 20-29 */
-  'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',    /* 30-39 */
-  'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',    /* 40-49 */
-  'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',    /* 50-59 */
-  '8', '9', '+', '/'                                   /* 60-63 */
-};
-
-/* Table of base64 values for first 128 characters.  */
-static short base64_char_to_value[128] =
-{
-  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,     /*   0-  9 */
-  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,     /*  10- 19 */
-  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,     /*  20- 29 */
-  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,     /*  30- 39 */
-  -1,  -1,  -1,  62,  -1,  -1,  -1,  63,  52,  53,     /*  40- 49 */
-  54,  55,  56,  57,  58,  59,  60,  61,  -1,  -1,     /*  50- 59 */
-  -1,  -1,  -1,  -1,  -1,  0,   1,   2,   3,   4,      /*  60- 69 */
-  5,   6,   7,   8,   9,   10,  11,  12,  13,  14,     /*  70- 79 */
-  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,     /*  80- 89 */
-  25,  -1,  -1,  -1,  -1,  -1,  -1,  26,  27,  28,     /*  90- 99 */
-  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,     /* 100-109 */
-  39,  40,  41,  42,  43,  44,  45,  46,  47,  48,     /* 110-119 */
-  49,  50,  51,  -1,  -1,  -1,  -1,  -1                        /* 120-127 */
-};
-
-/* The following diagram shows the logical steps by which three octets
-   get transformed into four base64 characters.
-
-                .--------.  .--------.  .--------.
-                |aaaaaabb|  |bbbbcccc|  |ccdddddd|
-                `--------'  `--------'  `--------'
-                    6   2      4   4       2   6
-              .--------+--------+--------+--------.
-              |00aaaaaa|00bbbbbb|00cccccc|00dddddd|
-              `--------+--------+--------+--------'
-
-              .--------+--------+--------+--------.
-              |AAAAAAAA|BBBBBBBB|CCCCCCCC|DDDDDDDD|
-              `--------+--------+--------+--------'
-
-   The octets are divided into 6 bit chunks, which are then encoded into
-   base64 characters.  */
-
-#define ADVANCE_INPUT(c, stream)                               \
- (ec = Lstream_get_emchar (stream),                            \
-  ec == -1 ? 0 :                                               \
-  ((ec > 255) ?                                                        \
-   (error ("Non-ascii character detected in base64 input"), 0) \
-   : (c = (Bufbyte)ec, 1)))
-
-static Bytind
-base64_encode_1 (Lstream *istream, Bufbyte *to, int line_break)
-{
-  EMACS_INT counter = 0;
-  Bufbyte *e = to;
-  Emchar ec;
-  unsigned int value;
-
-  while (1)
-    {
-      Bufbyte c;
-      if (!ADVANCE_INPUT (c, istream))
-       break;
-
-      /* Wrap line every 76 characters.  */
-      if (line_break)
-       {
-         if (counter < MIME_LINE_LENGTH / 4)
-           counter++;
-         else
-           {
-             *e++ = '\n';
-             counter = 1;
-           }
-       }
-
-      /* Process first byte of a triplet.  */
-      *e++ = base64_value_to_char[0x3f & c >> 2];
-      value = (0x03 & c) << 4;
-
-      /* Process second byte of a triplet.  */
-      if (!ADVANCE_INPUT (c, istream))
-       {
-         *e++ = base64_value_to_char[value];
-         *e++ = '=';
-         *e++ = '=';
-         break;
-       }
-
-      *e++ = base64_value_to_char[value | (0x0f & c >> 4)];
-      value = (0x0f & c) << 2;
-
-      /* Process third byte of a triplet.  */
-      if (!ADVANCE_INPUT (c, istream))
-       {
-         *e++ = base64_value_to_char[value];
-         *e++ = '=';
-         break;
-       }
-
-      *e++ = base64_value_to_char[value | (0x03 & c >> 6)];
-      *e++ = base64_value_to_char[0x3f & c];
-    }
-
-  /* Complete last partial line.  */
-  if (line_break)
-    if (counter > 0)
-      *e++ = '\n';
-
-  return e - to;
-}
-#undef ADVANCE_INPUT
-
-#define ADVANCE_INPUT(c, stream)               \
- (ec = Lstream_get_emchar (stream),            \
-  ec == -1 ? 0 : (c = (Bufbyte)ec, 1))
-
-#define INPUT_EOF_P(stream)                            \
- (ADVANCE_INPUT (c2, stream)                           \
-  ? (Lstream_unget_emchar (stream, (Emchar)c2), 0)     \
-  : 1)
-
-#define STORE_BYTE(pos, val) do {                                      \
-  pos += set_charptr_emchar (pos, (Emchar)((unsigned char)(val)));     \
-  ++*ccptr;                                                            \
-} while (0)
-
-static Bytind
-base64_decode_1 (Lstream *istream, Bufbyte *to, Charcount *ccptr)
-{
-  EMACS_INT counter = 0;
-  Emchar ec;
-  Bufbyte *e = to;
-  unsigned long value;
-
-  *ccptr = 0;
-  while (1)
-    {
-      Bufbyte c, c2;
-
-      if (!ADVANCE_INPUT (c, istream))
-       break;
-
-      /* Accept wrapping lines, reversibly if at each 76 characters.  */
-      if (c == '\n')
-       {
-         if (!ADVANCE_INPUT (c, istream))
-           break;
-         if (INPUT_EOF_P (istream))
-           break;
-         /* FSF Emacs has this check, apparently inherited from
-             recode.  However, I see no reason to be this picky about
-             line length -- why reject base64 with say 72-byte lines?
-             (yes, there are programs that generate them.)  */
-         /*if (counter != MIME_LINE_LENGTH / 4) return -1;*/
-         counter = 1;
-       }
-      else
-       counter++;
 
-      /* Process first byte of a quadruplet.  */
-      if (!IS_BASE64 (c))
-       return -1;
-      value = base64_char_to_value[c] << 18;
-
-      /* Process second byte of a quadruplet.  */
-      if (!ADVANCE_INPUT (c, istream))
-       return -1;
-
-      if (!IS_BASE64 (c))
-       return -1;
-      value |= base64_char_to_value[c] << 12;
-
-      STORE_BYTE (e, value >> 16);
-
-      /* Process third byte of a quadruplet.  */
-      if (!ADVANCE_INPUT (c, istream))
-       return -1;
-
-      if (c == '=')
-       {
-         if (!ADVANCE_INPUT (c, istream))
-           return -1;
-         if (c != '=')
-           return -1;
-         continue;
-       }
-
-      if (!IS_BASE64 (c))
-       return -1;
-      value |= base64_char_to_value[c] << 6;
-
-      STORE_BYTE (e, 0xff & value >> 8);
-
-      /* Process fourth byte of a quadruplet.  */
-      if (!ADVANCE_INPUT (c, istream))
-       return -1;
-
-      if (c == '=')
-       continue;
-
-      if (!IS_BASE64 (c))
-       return -1;
-      value |= base64_char_to_value[c];
-
-      STORE_BYTE (e, 0xff & value);
-    }
-
-  return e - to;
-}
-#undef ADVANCE_INPUT
-#undef INPUT_EOF_P
-
-static Lisp_Object
-free_malloced_ptr (Lisp_Object unwind_obj)
-{
-  void *ptr = (void *)get_opaque_ptr (unwind_obj);
-  xfree (ptr);
-  free_opaque_ptr (unwind_obj);
-  return Qnil;
-}
-
-/* Don't use alloca for regions larger than this, lest we overflow
-   the stack.  */
-#define MAX_ALLOCA 65536
-
-/* We need to setup proper unwinding, because there is a number of
-   ways these functions can blow up, and we don't want to have memory
-   leaks in those cases.  */
-#define XMALLOC_OR_ALLOCA(ptr, len, type) do {                 \
-  size_t XOA_len = (len);                                      \
-  if (XOA_len > MAX_ALLOCA)                                    \
-    {                                                          \
-      ptr = xnew_array (type, XOA_len);                                \
-      record_unwind_protect (free_malloced_ptr,                        \
-                            make_opaque_ptr ((void *)ptr));    \
-    }                                                          \
-  else                                                         \
-    ptr = alloca_array (type, XOA_len);                                \
-} while (0)
-
-#define XMALLOC_UNBIND(ptr, len, speccount) do {               \
-  if ((len) > MAX_ALLOCA)                                      \
-    unbind_to (speccount, Qnil);                               \
-} while (0)
-
-DEFUN ("base64-encode-region", Fbase64_encode_region, 2, 3, "r", /*
-Base64-encode the region between BEG and END.
-Return the length of the encoded text.
-Optional third argument NO-LINE-BREAK means do not break long lines
-into shorter lines.
-*/
-       (beg, end, no_line_break))
-{
-  Bufbyte *encoded;
-  Bytind encoded_length;
-  Charcount allength, length;
-  struct buffer *buf = current_buffer;
-  Bufpos begv, zv, old_pt = BUF_PT (buf);
-  Lisp_Object input;
-  int speccount = specpdl_depth();
-
-  get_buffer_range_char (buf, beg, end, &begv, &zv, 0);
-  barf_if_buffer_read_only (buf, begv, zv);
-
-  /* We need to allocate enough room for encoding the text.
-     We need 33 1/3% more space, plus a newline every 76
-     characters, and then we round up. */
-  length = zv - begv;
-  allength = length + length/3 + 1;
-  allength += allength / MIME_LINE_LENGTH + 1 + 6;
-
-  input = make_lisp_buffer_input_stream (buf, begv, zv, 0);
-  /* We needn't multiply allength with MAX_EMCHAR_LEN because all the
-     base64 characters will be single-byte.  */
-  XMALLOC_OR_ALLOCA (encoded, allength, Bufbyte);
-  encoded_length = base64_encode_1 (XLSTREAM (input), encoded,
-                                   NILP (no_line_break));
-  if (encoded_length > allength)
-    abort ();
-  Lstream_delete (XLSTREAM (input));
-
-  /* Now we have encoded the region, so we insert the new contents
-     and delete the old.  (Insert first in order to preserve markers.)  */
-  buffer_insert_raw_string_1 (buf, begv, encoded, encoded_length, 0);
-  XMALLOC_UNBIND (encoded, allength, speccount);
-  buffer_delete_range (buf, begv + encoded_length, zv + encoded_length, 0);
-
-  /* Simulate FSF Emacs: if point was in the region, place it at the
-     beginning.  */
-  if (old_pt >= begv && old_pt < zv)
-    BUF_SET_PT (buf, begv);
-
-  /* We return the length of the encoded text. */
-  return make_int (encoded_length);
-}
-
-DEFUN ("base64-encode-string", Fbase64_encode_string, 1, 1, 0, /*
-Base64 encode STRING and return the result.
-*/
-       (string))
-{
-  Charcount allength, length;
-  Bytind encoded_length;
-  Bufbyte *encoded;
-  Lisp_Object input, result;
-  int speccount = specpdl_depth();
-
-  CHECK_STRING (string);
-
-  length = XSTRING_CHAR_LENGTH (string);
-  allength = length + length/3 + 1 + 6;
-
-  input = make_lisp_string_input_stream (string, 0, -1);
-  XMALLOC_OR_ALLOCA (encoded, allength, Bufbyte);
-  encoded_length = base64_encode_1 (XLSTREAM (input), encoded, 0);
-  if (encoded_length > allength)
-    abort ();
-  Lstream_delete (XLSTREAM (input));
-  result = make_string (encoded, encoded_length);
-  XMALLOC_UNBIND (encoded, allength, speccount);
-  return result;
-}
-
-DEFUN ("base64-decode-region", Fbase64_decode_region, 2, 2, "r", /*
-Base64-decode the region between BEG and END.
-Return the length of the decoded text.
-If the region can't be decoded, return nil and don't modify the buffer.
-*/
-       (beg, end))
-{
-  struct buffer *buf = current_buffer;
-  Bufpos begv, zv, old_pt = BUF_PT (buf);
-  Bufbyte *decoded;
-  Bytind decoded_length;
-  Charcount length, cc_decoded_length;
-  Lisp_Object input;
-  int speccount = specpdl_depth();
-
-  get_buffer_range_char (buf, beg, end, &begv, &zv, 0);
-  barf_if_buffer_read_only (buf, begv, zv);
-
-  length = zv - begv;
-
-  input = make_lisp_buffer_input_stream (buf, begv, zv, 0);
-  /* We need to allocate enough room for decoding the text. */
-  XMALLOC_OR_ALLOCA (decoded, length * MAX_EMCHAR_LEN, Bufbyte);
-  decoded_length = base64_decode_1 (XLSTREAM (input), decoded, &cc_decoded_length);
-  if (decoded_length > length * MAX_EMCHAR_LEN)
-    abort ();
-  Lstream_delete (XLSTREAM (input));
-
-  if (decoded_length < 0)
-    {
-      /* The decoding wasn't possible. */
-      XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount);
-      return Qnil;
-    }
-
-  /* Now we have decoded the region, so we insert the new contents
-     and delete the old.  (Insert first in order to preserve markers.)  */
-  BUF_SET_PT (buf, begv);
-  buffer_insert_raw_string_1 (buf, begv, decoded, decoded_length, 0);
-  XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount);
-  buffer_delete_range (buf, begv + cc_decoded_length,
-                      zv + cc_decoded_length, 0);
-
-  /* Simulate FSF Emacs: if point was in the region, place it at the
-     beginning.  */
-  if (old_pt >= begv && old_pt < zv)
-    BUF_SET_PT (buf, begv);
-
-  return make_int (cc_decoded_length);
-}
-
-DEFUN ("base64-decode-string", Fbase64_decode_string, 1, 1, 0, /*
-Base64-decode STRING and return the result.
-*/
-       (string))
-{
-  Bufbyte *decoded;
-  Bytind decoded_length;
-  Charcount length, cc_decoded_length;
-  Lisp_Object input, result;
-  int speccount = specpdl_depth();
-
-  CHECK_STRING (string);
-
-  length = XSTRING_CHAR_LENGTH (string);
-  /* We need to allocate enough room for decoding the text. */
-  XMALLOC_OR_ALLOCA (decoded, length * MAX_EMCHAR_LEN, Bufbyte);
-
-  input = make_lisp_string_input_stream (string, 0, -1);
-  decoded_length = base64_decode_1 (XLSTREAM (input), decoded,
-                                   &cc_decoded_length);
-  if (decoded_length > length * MAX_EMCHAR_LEN)
-    abort ();
-  Lstream_delete (XLSTREAM (input));
-
-  if (decoded_length < 0)
-    {
-      /* The decoding wasn't possible. */
-      XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount);
-      return Qnil;
-    }
-
-  result = make_string (decoded, decoded_length);
-  XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount);
-  return result;
-}
 \f
 Lisp_Object Qyes_or_no_p;
 
@@ -3889,7 +3544,6 @@ syms_of_fns (void)
   DEFSUBR (Fconcat);
   DEFSUBR (Fvconcat);
   DEFSUBR (Fbvconcat);
-  DEFSUBR (Fcopy_list);
   DEFSUBR (Fcopy_sequence);
   DEFSUBR (Fcopy_alist);
   DEFSUBR (Fcopy_tree);
@@ -3898,9 +3552,6 @@ syms_of_fns (void)
   DEFSUBR (Fnthcdr);
   DEFSUBR (Fnth);
   DEFSUBR (Felt);
-  DEFSUBR (Flast);
-  DEFSUBR (Fbutlast);
-  DEFSUBR (Fnbutlast);
   DEFSUBR (Fmember);
   DEFSUBR (Fold_member);
   DEFSUBR (Fmemq);
@@ -3957,10 +3608,6 @@ syms_of_fns (void)
   DEFSUBR (Ffeaturep);
   DEFSUBR (Frequire);
   DEFSUBR (Fprovide);
-  DEFSUBR (Fbase64_encode_region);
-  DEFSUBR (Fbase64_encode_string);
-  DEFSUBR (Fbase64_decode_region);
-  DEFSUBR (Fbase64_decode_string);
 }
 
 void
index 6c7fde4..5891e24 100644 (file)
@@ -39,6 +39,9 @@ Boston, MA 02111-1307, USA.  */
 #include "scrollbar.h"
 #include "window.h"
 
+#include <errno.h>
+#include "sysdep.h"
+
 Lisp_Object Vselect_frame_hook, Qselect_frame_hook;
 Lisp_Object Vdeselect_frame_hook, Qdeselect_frame_hook;
 Lisp_Object Vcreate_frame_hook, Qcreate_frame_hook;
@@ -125,11 +128,9 @@ mark_frame (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
   struct frame *f = XFRAME (obj);
 
-#define MARKED_SLOT(x) ((void) (markobj (f->x)));
+#define MARKED_SLOT(x) ((markobj) (f->x));
 #include "frameslots.h"
 
-  mark_subwindow_cachels (f->subwindow_cachels, markobj);
-
   if (FRAME_LIVE_P (f)) /* device is nil for a dead frame */
     MAYBE_FRAMEMETH (f, mark_frame, (f, markobj));
 
@@ -189,10 +190,10 @@ allocate_frame_core (Lisp_Object device)
   XWINDOW (root_window)->frame = frame;
 
   /* 10 is arbitrary,
-     Just so that there is "something there."
+     just so that there is "something there."
      Correct size will be set up later with change_frame_size.  */
 
-  f->width  = 10;
+  f->width = 10;
   f->height = 10;
 
   XWINDOW (root_window)->pixel_width = 10;
@@ -205,9 +206,6 @@ allocate_frame_core (Lisp_Object device)
   f->selected_window = root_window;
   f->last_nonminibuf_window = root_window;
 
-  /* cache of subwindows visible on frame */
-  f->subwindow_cachels    = Dynarr_new (subwindow_cachel);
-
   /* Choose a buffer for the frame's root window.  */
   XWINDOW (root_window)->buffer = Qt;
   {
@@ -456,9 +454,9 @@ See `set-frame-properties', `default-x-frame-plist', and
         things. */
       init_frame_toolbars (f);
 #endif
+
       reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
       reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
-      reset_subwindow_cachels (f);
       change_frame_size (f, f->height, f->width, 0);
     }
 
@@ -582,7 +580,7 @@ unhold_frame_size_changes (void)
 void
 invalidate_vertical_divider_cache_in_frame (struct frame *f)
 {
-  /* Invalidate cached value of needs_vertical_divider_p in
+  /* Invalidate cached value of needs_vertical_divider_p in 
      every and all windows */
   map_windows (f, invalidate_vertical_divider_cache_in_window, 0);
 }
@@ -894,7 +892,7 @@ set_frame_selected_window (struct frame *f, Lisp_Object window)
 #ifdef HAVE_TOOLBARS
       if (!EQ (f->last_nonminibuf_window, window))
        MARK_TOOLBAR_CHANGED;
-#endif
+#endif      
       f->last_nonminibuf_window = window;
     }
 }
@@ -1536,13 +1534,6 @@ delete_frame_internal (struct frame *f, int force,
   delete_all_subwindows (XWINDOW (f->root_window));
   f->root_window = Qnil;
 
-  /* clear out the cached glyph information */
-  if (f->subwindow_cachels)
-    {
-      Dynarr_free (f->subwindow_cachels);
-      f->subwindow_cachels = 0;
-    }
-
   /* Remove the frame now from the list.  This way, any events generated
      on this frame by the maneuvers below will disperse themselves. */
 
@@ -2804,7 +2795,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth)
 
   /* when frame_conversion_internal() calculated the number of rows/cols
      in the frame, the theoretical toolbar sizes were subtracted out.
-     The calculations below adjust for real toolbar height/width in
+     The caluclations below adjust for real toolbar height/width in
      frame, which may be different from frame spec, taking the above
      fact into account */
   new_pixheight +=
@@ -2812,7 +2803,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth)
     + 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f)
     - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f)
     - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f);
-
+  
   new_pixheight +=
     + FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f)
     + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)
@@ -2824,13 +2815,13 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth)
     + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f)
     - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f)
     - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f);
-
+  
   new_pixwidth +=
     + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f)
     + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)
     - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f)
     - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f);
-
+  
   /* Adjust the width for the end glyph which may be a different width
      than the default character width. */
   {
@@ -2916,7 +2907,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth)
       FRAME_CHARWIDTH (f) = FRAME_WIDTH (f);
       FRAME_CHARHEIGHT (f) = FRAME_HEIGHT (f);
     }
-
+      
   MARK_FRAME_TOOLBARS_CHANGED (f);
   MARK_FRAME_CHANGED (f);
   f->echo_area_garbaged = 1;
diff --git a/src/gdbinit b/src/gdbinit
new file mode 100644 (file)
index 0000000..162b641
--- /dev/null
@@ -0,0 +1,421 @@
+# -*- ksh -*-
+# Copyright (C) 1998 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.
+
+# Author: Martin Buchholz
+
+# Some useful commands for debugging emacs with gdb 4.16 or better.
+# Install this as your .gdbinit file in your home directory,
+# or source this file from your .gdbinit
+# Configure xemacs with --debug, and compile with -g.
+#
+# See also the question of the XEmacs FAQ, titled
+# "How to Debug an XEmacs problem with a debugger".
+#
+# This can be used to debug XEmacs no matter how the following are
+# specified:
+
+# USE_UNION_TYPE
+# USE_MINIMAL_TAGBITS
+# USE_INDEXED_LRECORD_IMPLEMENTATION
+# LRECORD_(SYMBOL|STRING|VECTOR)
+
+# (the above all have configure equivalents)
+
+# Some functions defined here require a running process, but most
+# don't.  Considerable effort has been expended to this end.
+
+# See the dbg_ C support code in src/alloc.c that allows the functions
+# defined in this file to work correctly.
+
+set print union off
+set print pretty off
+
+define decode_object
+  set $obj = (unsigned long) $arg0
+  if dbg_USE_MINIMAL_TAGBITS
+    if $obj & 1
+    # It's an int
+      set $val = $obj >> 1
+      set $type = dbg_Lisp_Type_Int
+    else
+      set $type = $obj & dbg_typemask
+      if $type == dbg_Lisp_Type_Char
+        set $val = ($obj & dbg_valmask) >> dbg_gctypebits
+      else
+        # It's a record pointer
+        set $val = $obj
+      end
+    end
+  else
+    # not dbg_USE_MINIMAL_TAGBITS
+    set $val = $obj & dbg_valmask
+    set $type = ($obj & dbg_typemask) >> (dbg_valbits + 1)
+  end
+
+  if $type == dbg_Lisp_Type_Record
+    set $lheader = (struct lrecord_header *) $val
+    if dbg_USE_INDEXED_LRECORD_IMPLEMENTATION
+      set $imp = lrecord_implementations_table[$lheader->type]
+    else
+      set $imp = $lheader->implementation
+    end
+  else
+    set $imp = -1
+  end
+end
+
+document decode_object
+Usage: decode_object lisp_object
+Extract implementation information from a Lisp Object.
+Defines variables $val, $type and $imp.
+end
+
+define xint
+decode_object $arg0
+print ((long) $val)
+end
+
+define xtype
+  decode_object $arg0
+  if $type == dbg_Lisp_Type_Int
+    echo int\n
+  else
+  if $type == dbg_Lisp_Type_Char
+    echo char\n
+  else
+  if $type == dbg_Lisp_Type_Symbol
+    echo symbol\n
+  else
+  if $type == dbg_Lisp_Type_String
+    echo string\n
+  else
+  if $type == dbg_Lisp_Type_Vector
+    echo vector\n
+  else
+  if $type == dbg_Lisp_Type_Cons
+    echo cons\n
+  else
+    printf "record type: %s\n", $imp->name
+  # barf
+  end
+  end
+  end
+  end
+  end
+  end
+end
+
+define run-temacs
+  unset env EMACSLOADPATH
+  set env EMACSBOOTSTRAPLOADPATH ../lisp/:..
+  run -batch -l ../lisp/loadup.el run-temacs -q
+end
+
+document run-temacs
+Usage: run-temacs
+Run temacs interactively, like xemacs.
+Use this with debugging tools (like purify) that cannot deal with dumping,
+or when temacs builds successfully, but xemacs does not.
+end
+
+define update-elc
+  unset env EMACSLOADPATH
+  set env EMACSBOOTSTRAPLOADPATH ../lisp/:..
+  run -batch -l ../lisp/update-elc.el
+end
+
+document update-elc
+Usage: update-elc
+Run the core lisp byte compilation part of the build procedure.
+Use when debugging temacs, not xemacs!
+Use this when temacs builds successfully, but xemacs does not.
+end
+
+define dump-temacs
+  unset env EMACSLOADPATH
+  set env EMACSBOOTSTRAPLOADPATH ../lisp/:..
+  run -batch -l ../lisp/loadup.el dump
+end
+
+document dump-temacs
+Usage: dump-temacs
+Run the dumping part of the build procedure.
+Use when debugging temacs, not xemacs!
+Use this when temacs builds successfully, but xemacs does not.
+end
+
+# if you use Purify, do this:
+# export PURIFYOPTIONS='-pointer-mask=0x0fffffff'
+
+define ldp
+  printf "%s", "Lisp => "
+  call debug_print($arg0)
+end
+
+document ldp
+Usage: ldp lisp_object
+Print a Lisp Object value using the Lisp printer.
+Requires a running xemacs process.
+end
+
+define lbt
+call debug_backtrace()
+end
+
+document lbt
+Usage: lbt
+Print the current Lisp stack trace.
+Requires a running xemacs process.
+end
+
+define wtype
+print $arg0->core.widget_class->core_class.class_name
+end
+
+define xtname
+print XrmQuarkToString(((Object)($arg0))->object.xrm_name)
+end
+
+# GDB's command language makes you want to ...
+
+define pstruct
+  set $xstruct = (struct $arg0 *) $val
+  print $xstruct
+  print *$xstruct
+end
+
+define pobj
+  decode_object $arg0
+  if $type == dbg_Lisp_Type_Int
+    printf "Integer: %d\n", $val
+  else
+  if $type == dbg_Lisp_Type_Char
+    if $val < 128
+      printf "Char: %c\n", $val
+    else
+      printf "Char: %d\n", $val
+    end
+  else
+  if $type == dbg_Lisp_Type_String || $imp == lrecord_string
+    pstruct Lisp_String
+  else
+  if $type == dbg_Lisp_Type_Cons   || $imp == lrecord_cons
+    pstruct Lisp_Cons
+  else
+  if $type == dbg_Lisp_Type_Symbol || $imp == lrecord_symbol
+    pstruct Lisp_Symbol
+    printf "Symbol name: %s\n", $xstruct->name->_data
+  else
+  if $type == dbg_Lisp_Type_Vector || $imp == lrecord_vector
+    pstruct Lisp_Vector
+    printf "Vector of length %d\n", $xstruct->size
+    #print *($xstruct->_data) @ $xstruct->size
+  else
+  if $imp == lrecord_bit_vector
+    pstruct Lisp_Bit_Vector
+  else
+  if $imp == lrecord_buffer
+    pstruct buffer
+  else
+  if $imp == lrecord_char_table
+    pstruct Lisp_Char_Table
+  else
+  if $imp == lrecord_char_table_entry
+    pstruct Lisp_Char_Table_Entry
+  else
+  if $imp == lrecord_charset
+    pstruct Lisp_Charset
+  else
+  if $imp == lrecord_coding_system
+    pstruct Lisp_Coding_System
+  else
+  if $imp == lrecord_color_instance
+    pstruct Lisp_Color_Instance
+  else
+  if $imp == lrecord_command_builder
+    pstruct command_builder
+  else
+  if $imp == lrecord_compiled_function
+    pstruct Lisp_Compiled_Function
+  else
+  if $imp == lrecord_console
+    pstruct console
+  else
+  if $imp == lrecord_database
+    pstruct database
+  else
+  if $imp == lrecord_device
+    pstruct device
+  else
+  if $imp == lrecord_event
+    pstruct Lisp_Event
+  else
+  if $imp == lrecord_extent
+    pstruct extent
+  else
+  if $imp == lrecord_extent_auxiliary
+    pstruct extent_auxiliary
+  else
+  if $imp == lrecord_extent_info
+    pstruct extent_info
+  else
+  if $imp == lrecord_face
+    pstruct Lisp_Face
+  else
+  if $imp == lrecord_float
+    pstruct Lisp_Float
+  else
+  if $imp == lrecord_font_instance
+    pstruct Lisp_Font_Instance
+  else
+  if $imp == lrecord_frame
+    pstruct frame
+  else
+  if $imp == lrecord_glyph
+    pstruct Lisp_Glyph
+  else
+  if $imp == lrecord_hashtable
+    pstruct hashtable
+  else
+  if $imp == lrecord_image_instance
+    pstruct Lisp_Image_Instance
+  else
+  if $imp == lrecord_keymap
+    pstruct keymap
+  else
+  if $imp == lrecord_lcrecord_list
+    pstruct lcrecord_list
+  else
+  if $imp == lrecord_lstream
+    pstruct lstream
+  else
+  if $imp == lrecord_marker
+    pstruct Lisp_Marker
+  else
+  if $imp == lrecord_opaque
+    pstruct Lisp_Opaque
+  else
+  if $imp == lrecord_opaque_list
+    pstruct Lisp_Opaque_List
+  else
+  if $imp == lrecord_popup_data
+    pstruct popup_data
+  else
+  if $imp == lrecord_process
+    pstruct Lisp_Process
+  else
+  if $imp == lrecord_range_table
+    pstruct Lisp_Range_Table
+  else
+  if $imp == lrecord_specifier
+    pstruct Lisp_Specifier
+  else
+  if $imp == lrecord_subr
+    pstruct Lisp_Subr
+  else
+  if $imp == lrecord_symbol_value_buffer_local
+    pstruct symbol_value_buffer_local
+  else
+  if $imp == lrecord_symbol_value_forward
+    pstruct symbol_value_forward
+  else
+  if $imp == lrecord_symbol_value_lisp_magic
+    pstruct symbol_value_lisp_magic
+  else
+  if $imp == lrecord_symbol_value_varalias
+    pstruct symbol_value_varalias
+  else
+  if $imp == lrecord_toolbar_button
+    pstruct toolbar_button
+  else
+  if $imp == lrecord_tooltalk_message
+    pstruct Lisp_Tooltalk_Message
+  else
+  if $imp == lrecord_tooltalk_pattern
+    pstruct Lisp_Tooltalk_Pattern
+  else
+  if $imp == lrecord_weak_list
+    pstruct weak_list
+  else
+  if $imp == lrecord_window
+    pstruct window
+  else
+  if $imp == lrecord_window_configuration
+    pstruct window_config
+  else
+    echo Unknown Lisp Object type\n
+    print $arg0
+  # Barf, gag, retch
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+end
+
+document pobj
+Usage: pobj lisp_object
+Print the internal C structure of a underlying Lisp Object.
+end
index 6b80c82..c4daa12 100644 (file)
@@ -49,14 +49,15 @@ Boston, MA 02111-1307, USA.  */
 #include "lstream.h"
 #include "console.h"
 #include "device.h"
-#include "faces.h"
 #include "glyphs.h"
 #include "objects.h"
 
 #include "buffer.h"
 #include "frame.h"
+#include "insdel.h"
 #include "opaque.h"
 
+#include "imgproc.h"
 #include "sysfile.h"
 
 #ifdef HAVE_PNG
@@ -74,6 +75,16 @@ extern "C" {
 #include "file-coding.h"
 #endif
 
+#if INTBITS == 32
+# define FOUR_BYTE_TYPE unsigned int
+#elif LONGBITS == 32
+# define FOUR_BYTE_TYPE unsigned long
+#elif SHORTBITS == 32
+# define FOUR_BYTE_TYPE unsigned short
+#else
+#error What kind of strange-ass system are we running on?
+#endif
+
 #ifdef HAVE_TIFF
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (tiff);
 Lisp_Object Qtiff;
@@ -407,7 +418,7 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
       {
        /* we're relying on the jpeg driver to do any other conversions,
           or signal an error if the conversion isn't supported. */
-       cinfo.out_color_space = JCS_RGB;
+       cinfo.out_color_space = JCS_RGB;        
       }
 
     /* Step 5: Start decompressor */
@@ -453,7 +464,7 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
          for (i = 0; i < cinfo.output_width; i++)
            {
              int clr;
-             if (jpeg_gray)
+             if (jpeg_gray) 
                {
                  unsigned char val;
 #if (BITS_IN_JSAMPLE == 8)
@@ -480,10 +491,10 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
 
   /* Step 6.5: Create the pixmap and set up the image instance */
   /* now instantiate */
-  MAYBE_DEVMETH (XDEVICE (ii->device),
+  MAYBE_DEVMETH (XDEVICE (ii->device), 
                 init_image_instance_from_eimage,
-                (ii, cinfo.output_width, cinfo.output_height,
-                 unwind.eimage, dest_mask,
+                (ii, cinfo.output_width, cinfo.output_height, 
+                 unwind.eimage, dest_mask, 
                  instantiator, domain));
 
   /* Step 7: Finish decompression */
@@ -505,7 +516,7 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
  *                               GIF                                  *
  **********************************************************************/
 
-#include "gifrlib.h"
+#include <gifrlib.h>
 
 static void
 gif_validate (Lisp_Object instantiator)
@@ -564,9 +575,9 @@ static size_t
 gif_read_from_memory(GifByteType *buf, size_t size, VoidPtr data)
 {
   gif_memory_storage *mem = (gif_memory_storage*)data;
-
+  
   if (size > (mem->len - mem->index))
-    return (size_t) -1;
+    return -1;
   memcpy(buf, mem->bytes + mem->index, size);
   mem->index = mem->index + size;
   return size;
@@ -611,20 +622,20 @@ gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   Extcount len;
   int height = 0;
   int width = 0;
-
+  
   xzero (unwind);
   record_unwind_protect (gif_instantiate_unwind, make_opaque_ptr (&unwind));
-
+  
   /* 1. Now decode the data. */
-
+  
   {
     Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
-
+    
     assert (!NILP (data));
-
+    
     if (!(unwind.giffile = GifSetup()))
       signal_image_error ("Insufficent memory to instantiate GIF image", instantiator);
-
+    
     /* set up error facilities */
     if (setjmp(gif_err.setjmp_buffer))
       {
@@ -635,7 +646,7 @@ gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
        signal_image_error_2 ("GIF decoding error", errstring, instantiator);
       }
     GifSetErrorFunc(unwind.giffile, (Gif_error_func)gif_error_func, (VoidPtr)&gif_err);
-
+    
     GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len);
     mem_struct.bytes = bytes;
     mem_struct.len = len;
@@ -643,14 +654,14 @@ gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
     GifSetReadFunc(unwind.giffile, gif_read_from_memory, (VoidPtr)&mem_struct);
     GifSetCloseFunc(unwind.giffile, gif_memory_close, (VoidPtr)&mem_struct);
     DGifInitRead(unwind.giffile);
-
+    
     /* Then slurp the image into memory, decoding along the way.
        The result is the image in a simple one-byte-per-pixel
        format (#### the GIF routines only support 8-bit GIFs,
        it appears). */
     DGifSlurp (unwind.giffile);
   }
-
+  
   /* 3. Now create the EImage */
   {
     ColorMapObject *cmo = unwind.giffile->SColorMap;
@@ -660,15 +671,15 @@ gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
        0, 8, 16, ..., 4, 12, 20, ..., 2, 6, 10, ..., 1, 3, 5, ...  */
     static int InterlacedOffset[] = { 0, 4, 2, 1 };
     static int InterlacedJumps[] = { 8, 8, 4, 2 };
-
+    
     height = unwind.giffile->SHeight;
     width = unwind.giffile->SWidth;
     unwind.eimage = (unsigned char*) xmalloc (width * height * 3);
     if (!unwind.eimage)
       signal_image_error("Unable to allocate enough memory for image", instantiator);
-
+    
     /* write the data in EImage format (8bit RGB triples) */
-
+    
     /* Note: We just use the first image in the file and ignore the rest.
        We check here that that image covers the full "screen" size.
        I don't know whether that's always the case.
@@ -679,19 +690,15 @@ gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
        || unwind.giffile->SavedImages[0].ImageDesc.Top != 0)
       signal_image_error ("First image in GIF file is not full size",
                          instantiator);
-
+    
     interlace = unwind.giffile->SavedImages[0].ImageDesc.Interlace;
     pass = 0;
     row = interlace ? InterlacedOffset[pass] : 0;
     eip = unwind.eimage;
     for (i = 0; i < height; i++)
       {
-       if (interlace)
-         if (row >= height) {
-           row = InterlacedOffset[++pass];
-           while (row >= height)
-             row = InterlacedOffset[++pass];
-         }
+       if (interlace && row >= height)
+         row = InterlacedOffset[++pass];
        eip = unwind.eimage + (row * width * 3);
        for (j = 0; j < width; j++)
          {
@@ -704,11 +711,11 @@ gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
       }
   }
   /* now instantiate */
-  MAYBE_DEVMETH (XDEVICE (ii->device),
+  MAYBE_DEVMETH (XDEVICE (ii->device), 
                 init_image_instance_from_eimage,
-                (ii, width, height, unwind.eimage, dest_mask,
+                (ii, width, height, unwind.eimage, dest_mask, 
                  instantiator, domain));
-
+  
   unbind_to (speccount, Qnil);
 }
 
@@ -766,7 +773,7 @@ struct png_error_struct
 
 /* jh 98/03/12 - #### AARRRGH! libpng includes jmp_buf inside its own
    structure, and there are cases where the size can be different from
-   between inside the library, and inside the code!  To do an end run
+   between inside the libarary, and inside the code!  To do an end run
    around this, use our own error functions, and don't rely on things
    passed in the png_ptr to them.  This is an ugly hack and must
    go away when the lisp engine is threaded! */
@@ -805,8 +812,6 @@ png_instantiate_unwind (Lisp_Object unwind_obj)
   if (data->instream)
     fclose (data->instream);
 
-  if (data->eimage) xfree(data->eimage);
-
   return Qnil;
 }
 
@@ -836,7 +841,7 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
       png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
       signal_image_error ("Error obtaining memory for png_read", instantiator);
     }
-
+  
   xzero (unwind);
   unwind.png_ptr = png_ptr;
   unwind.info_ptr = info_ptr;
@@ -851,7 +856,7 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
      and is no longer usable for previous versions. jh
   */
 
-  /* Set the jmp_buf return context for png_error ... if this returns !0, then
+  /* Set the jmp_buf reurn context for png_error ... if this returns !0, then
      we ran into a problem somewhere, and need to clean up after ourselves. */
   if (setjmp (png_err_stct.setjmp_buffer))
     {
@@ -891,51 +896,15 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
     /* libpng expects that the image buffer passed in contains a
        picture to draw on top of if the png has any transparencies.
        This could be a good place to pass that in... */
-
+    
     row_pointers  = xnew_array (png_byte *, height);
 
     for (y = 0; y < height; y++)
       row_pointers[y] = unwind.eimage + (width * 3 * y);
 
-    {
-      /* if the png specifies a background chunk, go ahead and
-        use it, else use what we can get from the default face. */
-      png_color_16 my_background, *image_background;
-      Lisp_Object bkgd = Qnil;
-
-      my_background.red   = 0x7fff;
-      my_background.green = 0x7fff;
-      my_background.blue  = 0x7fff;
-      bkgd = FACE_BACKGROUND (Vdefault_face, domain);
-      if (!COLOR_INSTANCEP (bkgd))
-       {
-         warn_when_safe (Qpng, Qinfo, "Couldn't get background color!");
-       }
-      else
-       {
-         struct Lisp_Color_Instance *c;
-         Lisp_Object rgblist;
-
-         c = XCOLOR_INSTANCE (bkgd);
-         rgblist = MAYBE_LISP_DEVMETH (XDEVICE (c->device),
-                                       color_instance_rgb_components,
-                                       (c));
-         my_background.red = XINT (XCAR (rgblist));
-         my_background.green = XINT (XCAR (XCDR (rgblist)));
-         my_background.blue = XINT (XCAR (XCDR (XCDR (rgblist))));
-       }
-
-      if (png_get_bKGD (png_ptr, info_ptr, &image_background))
-       png_set_background (png_ptr, image_background,
-                           PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
-      else
-       png_set_background (png_ptr, &my_background,
-                           PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
-    }
-
     /* Now that we're using EImage, ask for 8bit RGB triples for any type
        of image*/
-    /* convert palette images to full RGB */
+    /* convert palatte images to full RGB */
     if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
       png_set_expand (png_ptr);
     /* send grayscale images to RGB too */
@@ -945,6 +914,12 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
     /* we can't handle alpha values */
     if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
       png_set_strip_alpha (png_ptr);
+    /* rip out any transparancy layers/colors */
+    if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS))
+      {
+        png_set_expand (png_ptr);
+       png_set_strip_alpha (png_ptr);
+      }
     /* tell libpng to strip 16 bit depth files down to 8 bits */
     if (info_ptr->bit_depth == 16)
       png_set_strip_16 (png_ptr);
@@ -957,9 +932,28 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
          png_set_packing (png_ptr);
       }
 
+#if 1 /* tests? or permanent? */
+    {
+      /* if the png specifies a background chunk, go ahead and
+        use it */
+      png_color_16 my_background, *image_background;
+    
+      /* ### how do I get the background of the current frame? */
+      my_background.red   = 0x7fff;
+      my_background.green = 0x7fff;
+      my_background.blue  = 0x7fff;
+
+      if (png_get_bKGD (png_ptr, info_ptr, &image_background))
+       png_set_background (png_ptr, image_background,
+                           PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
+      else 
+       png_set_background (png_ptr, &my_background,
+                           PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
+    }
+#endif
     png_read_image (png_ptr, row_pointers);
     png_read_end (png_ptr, info_ptr);
-
+    
 #ifdef PNG_SHOW_COMMENTS
     /* ####
      * I turn this off by default now, because the !%^@#!% comments
@@ -988,9 +982,9 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   }
 
   /* now instantiate */
-  MAYBE_DEVMETH (XDEVICE (ii->device),
+  MAYBE_DEVMETH (XDEVICE (ii->device), 
                 init_image_instance_from_eimage,
-                (ii, width, height, unwind.eimage, dest_mask,
+                (ii, width, height, unwind.eimage, dest_mask, 
                  instantiator, domain));
 
   /* This will clean up everything else. */
@@ -1094,7 +1088,7 @@ static toff_t tiff_memory_seek(thandle_t data, toff_t off, int whence)
 
   if ((newidx > mem->len) || (newidx < 0))
     return -1;
-
+  
   mem->index = newidx;
   return newidx;
 }
@@ -1194,7 +1188,7 @@ tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
 
   xzero (unwind);
   record_unwind_protect (tiff_instantiate_unwind, make_opaque_ptr (&unwind));
-
+  
   /* set up error facilities */
   if (setjmp (tiff_err_data.setjmp_buffer))
     {
@@ -1236,7 +1230,7 @@ tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
     unwind.eimage = (unsigned char *) xmalloc (width * height * 3);
 
     /* ### This is little more than proof-of-concept/function testing.
-       It needs to be reimplemented via scanline reads for both memory
+       It needs to be reimplimented via scanline reads for both memory
        compactness. */
     raster = (uint32*) _TIFFmalloc (width * height * sizeof (uint32));
     if (raster != NULL)
@@ -1268,9 +1262,9 @@ tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   }
 
   /* now instantiate */
-  MAYBE_DEVMETH (XDEVICE (ii->device),
+  MAYBE_DEVMETH (XDEVICE (ii->device), 
                 init_image_instance_from_eimage,
-                (ii, width, height, unwind.eimage, dest_mask,
+                (ii, width, height, unwind.eimage, dest_mask, 
                  instantiator, domain));
 
   unbind_to (speccount, Qnil);
index 5acac8d..b481ce8 100644 (file)
@@ -3,7 +3,6 @@
    Copyright (C) 1995 Tinker Systems
    Copyright (C) 1995, 1996 Ben Wing
    Copyright (C) 1995 Sun Microsystems
-   Copyright (C) 1998 Andy Piper
 
 This file is part of XEmacs.
 
@@ -35,13 +34,10 @@ Boston, MA 02111-1307, USA.  */
 #include "faces.h"
 #include "frame.h"
 #include "insdel.h"
-#include "opaque.h"
+#include "glyphs.h"
 #include "objects.h"
 #include "redisplay.h"
 #include "window.h"
-#include "frame.h"
-#include "chartab.h"
-#include "rangetab.h"
 
 #ifdef HAVE_XPM
 #include <X11/xpm.h>
@@ -56,11 +52,11 @@ Lisp_Object Qmono_pixmap_image_instance_p;
 Lisp_Object Qcolor_pixmap_image_instance_p;
 Lisp_Object Qpointer_image_instance_p;
 Lisp_Object Qsubwindow_image_instance_p;
-Lisp_Object Qwidget_image_instance_p;
 Lisp_Object Qconst_glyph_variable;
 Lisp_Object Qmono_pixmap, Qcolor_pixmap, Qsubwindow;
-Lisp_Object Q_file, Q_data, Q_face, Q_pixel_width, Q_pixel_height;
+Lisp_Object Q_file, Q_data, Q_face;
 Lisp_Object Qformatted_string;
+
 Lisp_Object Vcurrent_display_table;
 Lisp_Object Vtruncation_glyph, Vcontinuation_glyph, Voctal_escape_glyph;
 Lisp_Object Vcontrol_arrow_glyph, Vinvisible_text_glyph, Vhscroll_glyph;
@@ -74,7 +70,6 @@ DEFINE_IMAGE_INSTANTIATOR_FORMAT (nothing);
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (inherit);
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (string);
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (formatted_string);
-DEFINE_IMAGE_INSTANTIATOR_FORMAT (subwindow);
 
 #ifdef HAVE_WINDOW_SYSTEM
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (xbm);
@@ -90,11 +85,6 @@ Lisp_Object Q_foreground, Q_background;
 #endif
 #endif
 
-#ifdef HAVE_XFACE
-DEFINE_IMAGE_INSTANTIATOR_FORMAT (xface);
-Lisp_Object Qxface;
-#endif
-
 #ifdef HAVE_XPM
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (xpm);
 Lisp_Object Qxpm;
@@ -105,7 +95,6 @@ typedef struct image_instantiator_format_entry image_instantiator_format_entry;
 struct image_instantiator_format_entry
 {
   Lisp_Object symbol;
-  Lisp_Object device;
   struct image_instantiator_methods *meths;
 };
 
@@ -130,9 +119,8 @@ EXFUN (Fglyph_type, 1);
  *                          Image Instantiators                             *
  ****************************************************************************/
 
-struct image_instantiator_methods *
-decode_device_ii_format (Lisp_Object device, Lisp_Object format,
-                        Error_behavior errb)
+static struct image_instantiator_methods *
+decode_image_instantiator_format (Lisp_Object format, Error_behavior errb)
 {
   int i;
 
@@ -146,19 +134,10 @@ decode_device_ii_format (Lisp_Object device, Lisp_Object format,
   for (i = 0; i < Dynarr_length (the_image_instantiator_format_entry_dynarr);
        i++)
     {
-      if ( EQ (format,
-              Dynarr_at (the_image_instantiator_format_entry_dynarr, i).
-              symbol) )
-       {
-         Lisp_Object d = Dynarr_at (the_image_instantiator_format_entry_dynarr, i).
-           device;
-         if ((NILP (d) && NILP (device))
-             ||
-             (!NILP (device) &&
-              EQ (CONSOLE_TYPE (XCONSOLE 
-                                (DEVICE_CONSOLE (XDEVICE (device)))), d)))
-           return Dynarr_at (the_image_instantiator_format_entry_dynarr, i).meths;
-       }
+      if (EQ (format,
+             Dynarr_at (the_image_instantiator_format_entry_dynarr, i).
+             symbol))
+       return Dynarr_at (the_image_instantiator_format_entry_dynarr, i).meths;
     }
 
   maybe_signal_simple_error ("Invalid image-instantiator format", format,
@@ -167,12 +146,6 @@ decode_device_ii_format (Lisp_Object device, Lisp_Object format,
   return 0;
 }
 
-struct image_instantiator_methods *
-decode_image_instantiator_format (Lisp_Object format, Error_behavior errb)
-{
-  return decode_device_ii_format (Qnil, format, errb);
-}
-
 static int
 valid_image_instantiator_format_p (Lisp_Object format)
 {
@@ -184,7 +157,7 @@ DEFUN ("valid-image-instantiator-format-p", Fvalid_image_instantiator_format_p,
 Given an IMAGE-INSTANTIATOR-FORMAT, return non-nil if it is valid.
 Valid formats are some subset of 'nothing, 'string, 'formatted-string,
 'xpm, 'xbm, 'xface, 'gif, 'jpeg, 'png, 'tiff, 'cursor-font, 'font,
-'autodetect, 'widget and 'subwindow, depending on how XEmacs was compiled.
+'autodetect, and 'subwindow, depending on how XEmacs was compiled.
 */
        (image_instantiator_format))
 {
@@ -202,27 +175,19 @@ Return a list of valid image-instantiator formats.
 }
 
 void
-add_entry_to_device_ii_format_list (Lisp_Object device, Lisp_Object symbol,
-                                   struct image_instantiator_methods *meths)
+add_entry_to_image_instantiator_format_list (Lisp_Object symbol,
+                                            struct
+                                            image_instantiator_methods *meths)
 {
   struct image_instantiator_format_entry entry;
 
   entry.symbol = symbol;
-  entry.device = device;
   entry.meths = meths;
   Dynarr_add (the_image_instantiator_format_entry_dynarr, entry);
   Vimage_instantiator_format_list =
     Fcons (symbol, Vimage_instantiator_format_list);
 }
 
-void
-add_entry_to_image_instantiator_format_list (Lisp_Object symbol,
-                                            struct
-                                            image_instantiator_methods *meths)
-{
-  add_entry_to_device_ii_format_list (Qnil, symbol, meths);
-}
-
 static Lisp_Object *
 get_image_conversion_list (Lisp_Object console_type)
 {
@@ -390,13 +355,7 @@ check_valid_string (Lisp_Object data)
   CHECK_STRING (data);
 }
 
-void
-check_valid_vector (Lisp_Object data)
-{
-  CHECK_VECTOR (data);
-}
-
-void
+static void
 check_valid_face (Lisp_Object data)
 {
   Fget_face (data);
@@ -522,16 +481,12 @@ normalize_image_instantiator (Lisp_Object instantiator,
      longer exist (e.g. w3 pixmaps are almost always from temporary
      files). */
   {
-    struct gcpro gcpro1;
-    struct image_instantiator_methods *meths;
-
-    GCPRO1 (instantiator);
-    
-    meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0],
-                                             ERROR_ME);
-    RETURN_UNGCPRO (IIFORMAT_METH_OR_GIVEN (meths, normalize,
-                                           (instantiator, contype),
-                                           instantiator));
+    struct image_instantiator_methods * meths =
+      decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0],
+                                       ERROR_ME);
+    return IIFORMAT_METH_OR_GIVEN (meths, normalize,
+                                  (instantiator, contype),
+                                  instantiator);
   }
 }
 
@@ -544,25 +499,16 @@ instantiate_image_instantiator (Lisp_Object device, Lisp_Object domain,
   Lisp_Object ii = allocate_image_instance (device);
   struct image_instantiator_methods *meths;
   struct gcpro gcpro1;
-  int  methp = 0;
 
   GCPRO1 (ii);
   meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0],
                                            ERROR_ME);
-  methp = (int)HAS_IIFORMAT_METH_P (meths, instantiate);
-  MAYBE_IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg,
-                                           pointer_bg, dest_mask, domain));
-  
-  /* now do device specific instantiation */
-  meths = decode_device_ii_format (device, XVECTOR_DATA (instantiator)[0],
-                                  ERROR_ME_NOT);
-
-  if (!methp && (!meths || !HAS_IIFORMAT_METH_P (meths, instantiate)))
+  if (!HAS_IIFORMAT_METH_P (meths, instantiate))
     signal_simple_error
       ("Don't know how to instantiate this image instantiator?",
        instantiator);
-  MAYBE_IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg,
-                                           pointer_bg, dest_mask, domain));
+  IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg,
+                                     pointer_bg, dest_mask, domain));
   UNGCPRO;
 
   return ii;
@@ -580,31 +526,24 @@ mark_image_instance (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
   struct Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj);
 
-  markobj (i->name);
+  (markobj) (i->name);
   switch (IMAGE_INSTANCE_TYPE (i))
     {
     case IMAGE_TEXT:
-      markobj (IMAGE_INSTANCE_TEXT_STRING (i));
+      (markobj) (IMAGE_INSTANCE_TEXT_STRING (i));
       break;
     case IMAGE_MONO_PIXMAP:
     case IMAGE_COLOR_PIXMAP:
-      markobj (IMAGE_INSTANCE_PIXMAP_FILENAME (i));
-      markobj (IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (i));
-      markobj (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (i));
-      markobj (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (i));
-      markobj (IMAGE_INSTANCE_PIXMAP_FG (i));
-      markobj (IMAGE_INSTANCE_PIXMAP_BG (i));
+      (markobj) (IMAGE_INSTANCE_PIXMAP_FILENAME (i));
+      (markobj) (IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (i));
+      (markobj) (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (i));
+      (markobj) (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (i));
+      (markobj) (IMAGE_INSTANCE_PIXMAP_FG (i));
+      (markobj) (IMAGE_INSTANCE_PIXMAP_BG (i));
       break;
-
-    case IMAGE_WIDGET:
-      markobj (IMAGE_INSTANCE_WIDGET_TYPE (i));
-      markobj (IMAGE_INSTANCE_WIDGET_PROPS (i));
-      markobj (IMAGE_INSTANCE_WIDGET_FACE (i));
-      mark_gui_item (&IMAGE_INSTANCE_WIDGET_ITEM (i), markobj);
     case IMAGE_SUBWINDOW:
-      markobj (IMAGE_INSTANCE_SUBWINDOW_FRAME (i));
+      /* #### implement me */
       break;
-
     default:
       break;
     }
@@ -706,48 +645,8 @@ print_image_instance (Lisp_Object obj, Lisp_Object printcharfun,
        }
       break;
 
-    case IMAGE_WIDGET:
-      if (!NILP (IMAGE_INSTANCE_WIDGET_CALLBACK (ii)))
-       {
-         print_internal (IMAGE_INSTANCE_WIDGET_CALLBACK (ii), printcharfun, 0);
-         write_c_string (", ", printcharfun);
-       }
-      if (!NILP (IMAGE_INSTANCE_WIDGET_FACE (ii)))
-       {
-         write_c_string (" (", printcharfun);
-         print_internal
-           (IMAGE_INSTANCE_WIDGET_FACE (ii), printcharfun, 0);
-         write_c_string (")", printcharfun);
-       }
-
-      if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
-       print_internal (IMAGE_INSTANCE_WIDGET_TEXT (ii), printcharfun, 0);
-
     case IMAGE_SUBWINDOW:
-      sprintf (buf, " %dx%d", IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii),
-              IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii));
-      write_c_string (buf, printcharfun);
-
-      /* This is stolen from frame.c.  Subwindows are strange in that they
-        are specific to a particular frame so we want to print in their
-        description what that frame is. */
-
-      write_c_string (" on #<", printcharfun);
-      {
-       struct frame* f  = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));
-       
-       if (!FRAME_LIVE_P (f))
-         write_c_string ("dead", printcharfun);
-       else 
-         write_c_string (DEVICE_TYPE_NAME (XDEVICE (FRAME_DEVICE (f))),
-                         printcharfun);
-
-       write_c_string ("-frame ", printcharfun);
-      }
-      write_c_string (">", printcharfun);
-      sprintf (buf, " 0x%p", IMAGE_INSTANCE_SUBWINDOW_ID (ii));
-      write_c_string (buf, printcharfun);
-      
+      /* #### implement me */
       break;
 
     default:
@@ -770,23 +669,14 @@ finalize_image_instance (void *header, int for_disksave)
     return;
   if (for_disksave) finalose (i);
 
-  /* do this so that the cachels get reset */
-  if (IMAGE_INSTANCE_TYPE (i) == IMAGE_WIDGET
-      ||
-      IMAGE_INSTANCE_TYPE (i) == IMAGE_SUBWINDOW)
-    {
-      MARK_FRAME_GLYPHS_CHANGED 
-       (XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (i)));
-    }
-
   MAYBE_DEVMETH (XDEVICE (i->device), finalize_image_instance, (i));
 }
 
 static int
-image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+image_instance_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
-  struct Lisp_Image_Instance *i1 = XIMAGE_INSTANCE (obj1);
-  struct Lisp_Image_Instance *i2 = XIMAGE_INSTANCE (obj2);
+  struct Lisp_Image_Instance *i1 = XIMAGE_INSTANCE (o1);
+  struct Lisp_Image_Instance *i2 = XIMAGE_INSTANCE (o2);
   struct device *d1 = XDEVICE (i1->device);
   struct device *d2 = XDEVICE (i2->device);
 
@@ -832,26 +722,8 @@ image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
        return 0;
       break;
 
-    case IMAGE_WIDGET:
-      if (!(EQ (IMAGE_INSTANCE_WIDGET_TYPE (i1),
-               IMAGE_INSTANCE_WIDGET_TYPE (i2)) &&
-           EQ (IMAGE_INSTANCE_WIDGET_CALLBACK (i1),
-               IMAGE_INSTANCE_WIDGET_CALLBACK (i2))
-           && internal_equal (IMAGE_INSTANCE_WIDGET_PROPS (i1),
-                              IMAGE_INSTANCE_WIDGET_PROPS (i2),
-                              depth + 1)
-           && internal_equal (IMAGE_INSTANCE_WIDGET_TEXT (i1),
-                              IMAGE_INSTANCE_WIDGET_TEXT (i2),
-                              depth + 1)))
-       return 0;
     case IMAGE_SUBWINDOW:
-      if (!(IMAGE_INSTANCE_SUBWINDOW_WIDTH (i1) ==
-           IMAGE_INSTANCE_SUBWINDOW_WIDTH (i2) &&
-           IMAGE_INSTANCE_SUBWINDOW_HEIGHT (i1) ==
-           IMAGE_INSTANCE_SUBWINDOW_HEIGHT (i2) &&
-           IMAGE_INSTANCE_SUBWINDOW_ID (i1) ==
-           IMAGE_INSTANCE_SUBWINDOW_ID (i2)))
-       return 0;
+      /* #### implement me */
       break;
 
     default:
@@ -888,15 +760,8 @@ image_instance_hash (Lisp_Object obj, int depth)
                                   depth + 1));
       break;
 
-    case IMAGE_WIDGET:
-      hash = HASH4 (hash, 
-                   internal_hash (IMAGE_INSTANCE_WIDGET_TYPE (i), depth + 1),
-                   internal_hash (IMAGE_INSTANCE_WIDGET_PROPS (i), depth + 1),
-                   internal_hash (IMAGE_INSTANCE_WIDGET_CALLBACK (i), depth + 1));
     case IMAGE_SUBWINDOW:
-      hash = HASH4 (hash, IMAGE_INSTANCE_SUBWINDOW_WIDTH (i),
-                   IMAGE_INSTANCE_SUBWINDOW_HEIGHT (i),
-                   (int) IMAGE_INSTANCE_SUBWINDOW_ID (i));
+      /* #### implement me */
       break;
 
     default:
@@ -940,7 +805,6 @@ decode_image_instance_type (Lisp_Object type, Error_behavior errb)
   if (EQ (type, Qcolor_pixmap)) return IMAGE_COLOR_PIXMAP;
   if (EQ (type, Qpointer))      return IMAGE_POINTER;
   if (EQ (type, Qsubwindow))    return IMAGE_SUBWINDOW;
-  if (EQ (type, Qwidget))    return IMAGE_WIDGET;
 
   maybe_signal_simple_error ("Invalid image-instance type", type,
                             Qimage, errb);
@@ -959,7 +823,6 @@ encode_image_instance_type (enum image_instance_type type)
     case IMAGE_COLOR_PIXMAP: return Qcolor_pixmap;
     case IMAGE_POINTER:      return Qpointer;
     case IMAGE_SUBWINDOW:    return Qsubwindow;
-    case IMAGE_WIDGET:    return Qwidget;
     default:
       abort ();
     }
@@ -1095,14 +958,14 @@ make_image_instance_1 (Lisp_Object data, Lisp_Object device,
   /* instantiate_image_instantiator() will abort if given an
      image instance ... */
   if (IMAGE_INSTANCEP (data))
-    signal_simple_error ("Image instances not allowed here", data);
+    signal_simple_error ("image instances not allowed here", data);
   image_validate (data);
   dest_mask = decode_image_instance_type_list (dest_types);
   data = normalize_image_instantiator (data, DEVICE_TYPE (XDEVICE (device)),
                                       make_int (dest_mask));
   GCPRO1 (data);
   if (VECTORP (data) && EQ (XVECTOR_DATA (data)[0], Qinherit))
-    signal_simple_error ("Inheritance not allowed here", data);
+    signal_simple_error ("inheritance not allowed here", data);
   ii = instantiate_image_instantiator (device, device, data,
                                       Qnil, Qnil, dest_mask);
   RETURN_UNGCPRO (ii);
@@ -1206,94 +1069,17 @@ Return the name of the given image instance.
 
 DEFUN ("image-instance-string", Fimage_instance_string, 1, 1, 0, /*
 Return the string of the given image instance.
-This will only be non-nil for text image instances and widgets.
+This will only be non-nil for text image instances.
 */
        (image_instance))
 {
   CHECK_IMAGE_INSTANCE (image_instance);
   if (XIMAGE_INSTANCE_TYPE (image_instance) == IMAGE_TEXT)
     return XIMAGE_INSTANCE_TEXT_STRING (image_instance);
-  else if (XIMAGE_INSTANCE_TYPE (image_instance) == IMAGE_WIDGET)
-    return XIMAGE_INSTANCE_WIDGET_TEXT (image_instance);
   else
     return Qnil;
 }
 
-DEFUN ("image-instance-property", Fimage_instance_property, 2, 2, 0, /*
-Return the given property of the given image instance.  
-Returns nil if the property or the property method do not exist for
-the image instance in the domain.  
-*/
-       (image_instance, prop))
-{
-  struct Lisp_Image_Instance* ii;
-  Lisp_Object type, ret;
-  struct image_instantiator_methods* meths;
-
-  CHECK_IMAGE_INSTANCE (image_instance);
-  CHECK_SYMBOL (prop);
-  ii = XIMAGE_INSTANCE (image_instance);
-
-  /* ... then try device specific methods ... */
-  type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii));
-  meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), 
-                                  type, ERROR_ME_NOT);
-  if (meths && HAS_IIFORMAT_METH_P (meths, property)
-      && 
-      !UNBOUNDP (ret =  IIFORMAT_METH (meths, property, (image_instance, prop))))
-    {
-      return ret;
-    }
-  /* ... then format specific methods ... */
-  meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT);
-  if (meths && HAS_IIFORMAT_METH_P (meths, property)
-      &&
-      !UNBOUNDP (ret = IIFORMAT_METH (meths, property, (image_instance, prop))))
-    {
-      return ret;
-    }
-  /* ... then fail */
-  return Qnil;
-}
-
-DEFUN ("set-image-instance-property", Fset_image_instance_property, 3, 3, 0, /*
-Set the given property of the given image instance.  
-Does nothing if the property or the property method do not exist for
-the image instance in the domain.
-*/
-       (image_instance, prop, val))
-{
-  struct Lisp_Image_Instance* ii;
-  Lisp_Object type, ret;
-  struct image_instantiator_methods* meths;
-
-  CHECK_IMAGE_INSTANCE (image_instance);
-  CHECK_SYMBOL (prop);
-  ii = XIMAGE_INSTANCE (image_instance);
-  type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii));
-  /* try device specific methods first ... */
-  meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), 
-                                  type, ERROR_ME_NOT);
-  if (meths && HAS_IIFORMAT_METH_P (meths, set_property)
-      &&
-      !UNBOUNDP (ret = 
-                IIFORMAT_METH (meths, set_property, (image_instance, prop, val))))
-    {
-      return ret;
-    }
-  /* ... then format specific methods ... */
-  meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT);
-  if (meths && HAS_IIFORMAT_METH_P (meths, set_property)
-      &&
-      !UNBOUNDP (ret = 
-                IIFORMAT_METH (meths, set_property, (image_instance, prop, val))))
-    {
-      return ret;
-    }
-
-  return val;
-}
-
 DEFUN ("image-instance-file-name", Fimage_instance_file_name, 1, 1, 0, /*
 Return the file name from which IMAGE-INSTANCE was read, if known.
 */
@@ -1366,10 +1152,6 @@ Return the height of the image instance, in pixels.
     case IMAGE_POINTER:
       return make_int (XIMAGE_INSTANCE_PIXMAP_HEIGHT (image_instance));
 
-    case IMAGE_SUBWINDOW:
-    case IMAGE_WIDGET:
-      return make_int (XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (image_instance));
-
     default:
       return Qnil;
     }
@@ -1389,10 +1171,6 @@ Return the width of the image instance, in pixels.
     case IMAGE_POINTER:
       return make_int (XIMAGE_INSTANCE_PIXMAP_WIDTH (image_instance));
 
-    case IMAGE_SUBWINDOW:
-    case IMAGE_WIDGET:
-      return make_int (XIMAGE_INSTANCE_SUBWINDOW_WIDTH (image_instance));
-
     default:
       return Qnil;
     }
@@ -1462,12 +1240,6 @@ colorized mono pixmaps and for pointers.)
     case IMAGE_POINTER:
       return XIMAGE_INSTANCE_PIXMAP_FG (image_instance);
 
-    case IMAGE_WIDGET:
-      return FACE_FOREGROUND (
-                             XIMAGE_INSTANCE_WIDGET_FACE (image_instance),
-                             XIMAGE_INSTANCE_SUBWINDOW_FRAME 
-                             (image_instance));
-
     default:
       return Qnil;
     }
@@ -1489,12 +1261,6 @@ colorized mono pixmaps and for pointers.)
     case IMAGE_POINTER:
       return XIMAGE_INSTANCE_PIXMAP_BG (image_instance);
 
-    case IMAGE_WIDGET:
-      return FACE_BACKGROUND (
-                             XIMAGE_INSTANCE_WIDGET_FACE (image_instance),
-                             XIMAGE_INSTANCE_SUBWINDOW_FRAME 
-                             (image_instance));
-
     default:
       return Qnil;
     }
@@ -1717,7 +1483,7 @@ potential_pixmap_file_instantiator (Lisp_Object instantiator,
   if (!NILP (file) && NILP (data))
     {
       Lisp_Object retval = MAYBE_LISP_CONTYPE_METH
-       (decode_console_type(console_type, ERROR_ME),
+       (decode_console_type(console_type, ERROR_ME), 
         locate_pixmap_file, (file));
 
       if (!NILP (retval))
@@ -1725,7 +1491,7 @@ potential_pixmap_file_instantiator (Lisp_Object instantiator,
       else
        return Fcons (file, Qnil); /* should have been file */
     }
-
+  
   return Qnil;
 }
 
@@ -1748,7 +1514,7 @@ simple_image_type_normalize (Lisp_Object inst, Lisp_Object console_type,
      Note that if we cannot generate any regular inline data, we
      skip out. */
 
-  file = potential_pixmap_file_instantiator (inst, Q_file, Q_data,
+  file = potential_pixmap_file_instantiator (inst, Q_file, Q_data, 
                                             console_type);
 
   if (CONSP (file)) /* failure locating filename */
@@ -1834,9 +1600,7 @@ xbm_validate (Lisp_Object instantiator)
    -- maybe return an error, or return Qnil.
  */
 
-#ifdef HAVE_X_WINDOWS
-#include <X11/Xlib.h>
-#else
+#ifndef HAVE_X_WINDOWS
 #define XFree(data) free(data)
 #endif
 
@@ -1850,7 +1614,7 @@ bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot,
   CONST char *filename_ext;
 
   GET_C_STRING_FILENAME_DATA_ALLOCA (name, filename_ext);
-  result = read_bitmap_data_from_file (filename_ext, &w, &h,
+  result = read_bitmap_data_from_file (filename_ext, &w, &h, 
                                       &data, xhot, yhot);
 
   if (result == BitmapSuccess)
@@ -1911,11 +1675,11 @@ xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file,
       && !NILP (file))
     {
       mask_file = MAYBE_LISP_CONTYPE_METH
-       (decode_console_type(console_type, ERROR_ME),
+       (decode_console_type(console_type, ERROR_ME), 
         locate_pixmap_file, (concat2 (file, build_string ("Mask"))));
       if (NILP (mask_file))
        mask_file = MAYBE_LISP_CONTYPE_METH
-         (decode_console_type(console_type, ERROR_ME),
+         (decode_console_type(console_type, ERROR_ME), 
           locate_pixmap_file, (concat2 (file, build_string ("msk"))));
     }
 
@@ -2003,81 +1767,20 @@ xbm_possible_dest_types (void)
     IMAGE_POINTER_MASK;
 }
 
-#endif
-
-\f
-#ifdef HAVE_XFACE
-/**********************************************************************
- *                             X-Face                                 *
- **********************************************************************/
-
 static void
-xface_validate (Lisp_Object instantiator)
-{
-  file_or_data_must_be_present (instantiator);
-}
-
-static Lisp_Object
-xface_normalize (Lisp_Object inst, Lisp_Object console_type)
+xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
+                Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+                int dest_mask, Lisp_Object domain)
 {
-  /* This function can call lisp */
-  Lisp_Object file = Qnil, mask_file = Qnil;
-  struct gcpro gcpro1, gcpro2, gcpro3;
-  Lisp_Object alist = Qnil;
-
-  GCPRO3 (file, mask_file, alist);
-
-  /* Now, convert any file data into inline data for both the regular
-     data and the mask data.  At the end of this, `data' will contain
-     the inline data (if any) or Qnil, and `file' will contain
-     the name this data was derived from (if known) or Qnil.
-     Likewise for `mask_file' and `mask_data'.
-
-     Note that if we cannot generate any regular inline data, we
-     skip out. */
-
-  file = potential_pixmap_file_instantiator (inst, Q_file, Q_data,
-                                            console_type);
-  mask_file = potential_pixmap_file_instantiator (inst, Q_mask_file,
-                                                 Q_mask_data, console_type);
+  Lisp_Object device= IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (image_instance));
 
-  if (CONSP (file)) /* failure locating filename */
-    signal_double_file_error ("Opening bitmap file",
-                             "no such file or directory",
-                             Fcar (file));
-
-  if (NILP (file) && NILP (mask_file)) /* no conversion necessary */
-    RETURN_UNGCPRO (inst);
-
-  alist = tagged_vector_to_alist (inst);
-
-  {
-    Lisp_Object data = make_string_from_file (file);
-    alist = remassq_no_quit (Q_file, alist);
-    /* there can't be a :data at this point. */
-    alist = Fcons (Fcons (Q_file, file),
-                  Fcons (Fcons (Q_data, data), alist));
-  }
-
-  alist = xbm_mask_file_munging (alist, file, mask_file, console_type);
-
-  {
-    Lisp_Object result = alist_to_tagged_vector (Qxface, alist);
-    free_alist (alist);
-    RETURN_UNGCPRO (result);
-  }
-}
-
-static int
-xface_possible_dest_types (void)
-{
-  return
-    IMAGE_MONO_PIXMAP_MASK  |
-    IMAGE_COLOR_PIXMAP_MASK |
-    IMAGE_POINTER_MASK;
+  MAYBE_DEVMETH (XDEVICE (device), 
+                xbm_instantiate,
+                (image_instance, instantiator, pointer_fg, 
+                 pointer_bg, dest_mask, domain));
 }
 
-#endif /* HAVE_XFACE */
+#endif
 
 \f
 #ifdef HAVE_XPM
@@ -2091,10 +1794,8 @@ pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid)
 {
   char **data;
   int result;
-  char *fname = 0;
-  
-  GET_C_STRING_FILENAME_DATA_ALLOCA (name, fname);
-  result = XpmReadFileToData (fname, &data);
+
+  result = XpmReadFileToData ((char *) XSTRING_DATA (name), &data);
 
   if (result == XpmSuccess)
     {
@@ -2242,7 +1943,7 @@ xpm_normalize (Lisp_Object inst, Lisp_Object console_type)
      Note that if we cannot generate any regular inline data, we
      skip out. */
 
-  file = potential_pixmap_file_instantiator (inst, Q_file, Q_data,
+  file = potential_pixmap_file_instantiator (inst, Q_file, Q_data, 
                                             console_type);
 
   if (CONSP (file)) /* failure locating filename */
@@ -2256,7 +1957,7 @@ xpm_normalize (Lisp_Object inst, Lisp_Object console_type)
   if (NILP (file) && !UNBOUNDP (color_symbols))
     /* no conversion necessary */
     RETURN_UNGCPRO (inst);
-
+  
   alist = tagged_vector_to_alist (inst);
 
   if (!NILP (file))
@@ -2267,7 +1968,7 @@ xpm_normalize (Lisp_Object inst, Lisp_Object console_type)
       alist = Fcons (Fcons (Q_file, file),
                     Fcons (Fcons (Q_data, data), alist));
     }
-
+  
   if (UNBOUNDP (color_symbols))
     {
       color_symbols = evaluate_xpm_color_symbols ();
@@ -2291,6 +1992,19 @@ xpm_possible_dest_types (void)
     IMAGE_POINTER_MASK;
 }
 
+static void
+xpm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
+                Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+                int dest_mask, Lisp_Object domain)
+{
+  Lisp_Object device= IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (image_instance));
+
+  MAYBE_DEVMETH (XDEVICE (device), 
+                xpm_instantiate,
+                (image_instance, instantiator, pointer_fg, 
+                 pointer_bg, dest_mask, domain));
+}
+
 #endif /* HAVE_XPM */
 
 \f
@@ -2315,8 +2029,8 @@ image_mark (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
   struct Lisp_Specifier *image = XIMAGE_SPECIFIER (obj);
 
-  markobj (IMAGE_SPECIFIER_ATTACHEE (image));
-  markobj (IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image));
+  ((markobj) (IMAGE_SPECIFIER_ATTACHEE (image)));
+  ((markobj) (IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image)));
 }
 
 static Lisp_Object
@@ -2393,7 +2107,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
          /* For the image instance cache, we do comparisons with EQ rather
             than with EQUAL, as we do for color and font names.
             The reasons are:
-            
+
             1) pixmap data can be very long, and thus the hashing and
             comparing will take awhile.
             2) It's not so likely that we'll run into things that are EQUAL
@@ -2407,38 +2121,18 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
             pointer face.
           */
 
-         subtable = make_lisp_hash_table (20,
-                                          pointerp ? HASH_TABLE_KEY_CAR_WEAK
-                                          : HASH_TABLE_KEY_WEAK,
-                                          pointerp ? HASH_TABLE_EQUAL
-                                          : HASH_TABLE_EQ);
+         subtable = make_lisp_hashtable (20,
+                                         pointerp ? HASHTABLE_KEY_CAR_WEAK
+                                         : HASHTABLE_KEY_WEAK,
+                                         pointerp ? HASHTABLE_EQUAL
+                                         : HASHTABLE_EQ);
          Fputhash (make_int (dest_mask), subtable,
                    d->image_instance_cache);
          instance = Qunbound;
        }
       else
-       {
-         instance = Fgethash (pointerp ? ls3 : instantiator,
-                              subtable, Qunbound);
-         /* subwindows have a per-window cache and have to be treated
-            differently.  dest_mask can be a bitwise OR of all image
-            types so we will only catch someone possibly trying to
-            instantiate a subwindow type thing. Unfortunately, this
-            will occur most of the time so this probably slows things
-            down. But with the current design I don't see anyway
-            round it. */
-         if (UNBOUNDP (instance)
-             &&
-             dest_mask & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK))
-           {
-             if (!WINDOWP (domain))
-               signal_simple_error ("Can't instantiate subwindow outside a window",
-                                    instantiator);
-             instance = Fgethash (instantiator, 
-                                  XWINDOW (domain)->subwindow_instance_cache, 
-                                  Qunbound);
-           }
-       }
+       instance = Fgethash (pointerp ? ls3 : instantiator,
+                            subtable, Qunbound);
 
       if (UNBOUNDP (instance))
        {
@@ -2447,7 +2141,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
                          noseeum_cons (pointerp ? ls3 : instantiator,
                                        subtable));
          int speccount = specpdl_depth ();
-         
+
          /* make sure we cache the failures, too.
             Use an unwind-protect to catch such errors.
             If we fail, the unwind-protect records nil in
@@ -2461,21 +2155,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
                                                     instantiator,
                                                     pointer_fg, pointer_bg,
                                                     dest_mask);
-         
          Fsetcar (locative, instance);
-         /* only after the image has been instantiated do we know
-             whether we need to put it in the per-window image instance
-             cache. */
-         if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance))
-             &
-             (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK))
-           {
-             if (!WINDOWP (domain))
-               signal_simple_error ("Can't instantiate subwindow outside a window",
-                                    instantiator);
-             
-             Fsetcdr (XCDR (locative), XWINDOW (domain)->subwindow_instance_cache );
-           }
          unbind_to (speccount, Qnil);
        }
       else
@@ -2675,7 +2355,7 @@ pairs.  FORMAT should be one of
   (Display this image as a text string, with replaceable fields;
   not currently implemented.)
 'xbm
-  (An X bitmap; only if X or Windows support was compiled into this XEmacs.
+  (An X bitmap; only if X support was compiled into this XEmacs.
    Can be instanced as `mono-pixmap', `color-pixmap', or `pointer'.)
 'xpm
   (An XPM pixmap; only if XPM support was compiled into this XEmacs.
@@ -2686,17 +2366,15 @@ pairs.  FORMAT should be one of
   instanced as `mono-pixmap', `color-pixmap', or `pointer'.)
 'gif
   (A GIF87 or GIF89 image; only if GIF support was compiled into this
-   XEmacs.  NOTE: only the first frame of animated gifs will be displayed.
-   Can be instanced as `color-pixmap'.)
+   XEmacs.  Can be instanced as `color-pixmap'.)
 'jpeg
   (A JPEG image; only if JPEG support was compiled into this XEmacs.
    Can be instanced as `color-pixmap'.)
 'png
-  (A PNG image; only if PNG support was compiled into this XEmacs.
+  (A PNG/GIF24 image; only if PNG support was compiled into this XEmacs.
    Can be instanced as `color-pixmap'.)
 'tiff
-  (A TIFF image; only if TIFF support was compiled into this XEmacs.
-   Can be instanced as `color-pixmap'.)
+  (A TIFF image; not currently implemented.)
 'cursor-font
   (One of the standard cursor-font names, such as "watch" or
    "right_ptr" under X.  Under X, this is, more specifically, any
@@ -2711,8 +2389,6 @@ pairs.  FORMAT should be one of
    probably be fixed.)
 'subwindow
   (An embedded X window; not currently implemented.)
-'widget
-  (A widget control, for instance text field or radio button.)
 'autodetect
   (XEmacs tries to guess what format the data is in.  If X support
   exists, the data string will be checked to see if it names a filename.
@@ -2743,7 +2419,7 @@ The valid keywords are:
   `cursor-font', `font', `autodetect', and `inherit'.)
 :foreground
 :background
-  (For `xbm', `xface', `cursor-font', `widget' and `font'.  These keywords
+  (For `xbm', `xface', `cursor-font', and `font'.  These keywords
   allow you to explicitly specify foreground and background colors.
   The argument should be anything acceptable to `make-color-instance'.
   This will cause what would be a `mono-pixmap' to instead be colorized
@@ -2806,10 +2482,10 @@ mark_glyph (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
   struct Lisp_Glyph *glyph = XGLYPH (obj);
 
-  markobj (glyph->image);
-  markobj (glyph->contrib_p);
-  markobj (glyph->baseline);
-  markobj (glyph->face);
+  ((markobj) (glyph->image));
+  ((markobj) (glyph->contrib_p));
+  ((markobj) (glyph->baseline));
+  ((markobj) (glyph->face));
 
   return glyph->plist;
 }
@@ -2838,10 +2514,10 @@ print_glyph (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
    This isn't concerned with "unspecified" attributes, that's what
    #'glyph-differs-from-default-p is for. */
 static int
-glyph_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+glyph_equal (Lisp_Object o1, Lisp_Object o2, int depth)
 {
-  struct Lisp_Glyph *g1 = XGLYPH (obj1);
-  struct Lisp_Glyph *g2 = XGLYPH (obj2);
+  struct Lisp_Glyph *g1 = XGLYPH (o1);
+  struct Lisp_Glyph *g2 = XGLYPH (o2);
 
   depth++;
 
@@ -2948,9 +2624,8 @@ allocate_glyph (enum glyph_type type,
     {
     case GLYPH_BUFFER:
       XIMAGE_SPECIFIER_ALLOWED (g->image) =
-       IMAGE_NOTHING_MASK | IMAGE_TEXT_MASK 
-       | IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK 
-       | IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK;
+       IMAGE_NOTHING_MASK | IMAGE_TEXT_MASK | IMAGE_MONO_PIXMAP_MASK |
+         IMAGE_COLOR_PIXMAP_MASK | IMAGE_SUBWINDOW_MASK;
       break;
     case GLYPH_POINTER:
       XIMAGE_SPECIFIER_ALLOWED (g->image) =
@@ -3084,10 +2759,12 @@ The return value will be one of 'buffer, 'pointer, or 'icon.
   CHECK_GLYPH (glyph);
   switch (XGLYPH_TYPE (glyph))
     {
-    default: abort ();
     case GLYPH_BUFFER:  return Qbuffer;
     case GLYPH_POINTER: return Qpointer;
     case GLYPH_ICON:    return Qicon;
+    default:
+      abort ();
+      return Qnil; /* not reached */
     }
 }
 
@@ -3146,8 +2823,8 @@ glyph_width (Lisp_Object glyph, Lisp_Object frame_face,
       return 0;
 
     case IMAGE_SUBWINDOW:
-    case IMAGE_WIDGET:
-      return XIMAGE_INSTANCE_SUBWINDOW_WIDTH (instance);
+      /* #### implement me */
+      return 0;
 
     default:
       abort ();
@@ -3250,12 +2927,8 @@ glyph_height_internal (Lisp_Object glyph, Lisp_Object frame_face,
       return 0;
 
     case IMAGE_SUBWINDOW:
-    case IMAGE_WIDGET:
-      /* #### Ugh ugh ugh -- temporary crap */
-      if (function == RETURN_ASCENT || function == RETURN_HEIGHT)
-       return XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (instance);
-      else
-       return 0;
+      /* #### implement me */
+      return 0;
 
     default:
       abort ();
@@ -3409,7 +3082,7 @@ mark_glyph_cachels (glyph_cachel_dynarr *elements,
   for (elt = 0; elt < Dynarr_length (elements); elt++)
     {
       struct glyph_cachel *cachel = Dynarr_atp (elements, elt);
-      markobj (cachel->glyph);
+      ((markobj) (cachel->glyph));
     }
 }
 
@@ -3525,416 +3198,36 @@ compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels,
 
 #endif /* MEMORY_USAGE_STATS */
 
-
 \f
 /*****************************************************************************
- *                     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
-   redisplay. We have two caches - a per-window instance cache that
-   keeps track of subwindows on a window, these are linked to their
-   instantiator in the hashtable and when the instantiator goes away
-   we want the instance to go away also. However we also have a
-   per-frame instance cache that we use to determine if a subwindow is
-   obscuring an area that we want to clear. We need to be able to flip
-   through this quickly so a hashtable is not suitable hence the
-   subwindow_cachels. The question is should we just not mark
-   instances in the subwindow_cachelsnor should we try and invalidate
-   the cache at suitable points in redisplay? If we don't invalidate
-   the cache it will fill up with crud that will only get removed when
-   the frame is deleted. So invalidation is good, the question is when
-   and whether we mark as well. Go for the simple option - don't mark,
-   MARK_SUBWINDOWS_CHANGED when a subwindow gets deleted. */
-
-void
-mark_subwindow_cachels (subwindow_cachel_dynarr *elements,
-                       void (*markobj) (Lisp_Object))
-{
-  int elt;
-
-  if (!elements)
-    return;
-
-  for (elt = 0; elt < Dynarr_length (elements); elt++)
-    {
-      struct subwindow_cachel *cachel = Dynarr_atp (elements, elt);
-      markobj (cachel->subwindow);
-    }
-}
-
-static void
-update_subwindow_cachel_data (struct frame *f, Lisp_Object subwindow,
-                         struct subwindow_cachel *cachel)
-{
-  if (NILP (cachel->subwindow) || !EQ (cachel->subwindow, subwindow))
-    {
-      cachel->subwindow   = subwindow;
-      cachel->width   = XIMAGE_INSTANCE_SUBWINDOW_WIDTH (subwindow);
-      cachel->height   = XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (subwindow);
-    }
-
-  cachel->updated = 1;
-}
-
-static void
-add_subwindow_cachel (struct frame *f, Lisp_Object subwindow)
-{
-  struct subwindow_cachel new_cachel;
-
-  xzero (new_cachel);
-  new_cachel.subwindow = Qnil;
-  new_cachel.x=0;
-  new_cachel.y=0;
-  new_cachel.being_displayed=0;
-
-  update_subwindow_cachel_data (f, subwindow, &new_cachel);
-  Dynarr_add (f->subwindow_cachels, new_cachel);
-}
-
-static int
-get_subwindow_cachel_index (struct frame *f, Lisp_Object subwindow)
-{
-  int elt;
-
-  if (noninteractive)
-    return 0;
-
-  for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++)
-    {
-      struct subwindow_cachel *cachel =
-       Dynarr_atp (f->subwindow_cachels, elt);
-
-      if (EQ (cachel->subwindow, subwindow) && !NILP (subwindow))
-       {
-         if (!cachel->updated)
-           update_subwindow_cachel_data (f, subwindow, cachel);
-         return elt;
-       }
-    }
-
-  /* If we didn't find the glyph, add it and then return its index. */
-  add_subwindow_cachel (f, subwindow);
-  return elt;
-}
-
-/* redisplay in general assumes that drawing something will erase
-   what was there before. unfortunately this does not apply to
-   subwindows that need to be specifically unmapped in order to
-   disappear. we take a brute force approach - on the basis that its
-   cheap - and unmap all subwindows in a display line */
-void
-reset_subwindow_cachels (struct frame *f)
-{
-  int elt;
-  for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++)
-    {
-      struct subwindow_cachel *cachel =
-       Dynarr_atp (f->subwindow_cachels, elt);
-
-      if (!NILP (cachel->subwindow) && cachel->being_displayed)
-       {
-         struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (cachel->subwindow);
-         MAYBE_DEVMETH (XDEVICE (f->device), unmap_subwindow, (ii));
-       }
-    }
-  Dynarr_reset (f->subwindow_cachels);
-}
-
-void
-mark_subwindow_cachels_as_not_updated (struct frame *f)
-{
-  int elt;
-
-  for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++)
-    Dynarr_atp (f->subwindow_cachels, elt)->updated = 0;
-}
-
-\f
-/*****************************************************************************
- *                              subwindow functions                          *
+ *                              display tables                               *
  *****************************************************************************/
 
-/* update the displayed characteristics of a subwindow */
-static void
-update_subwindow (Lisp_Object subwindow)
-{
-  struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow);
+/* Get the display table for use currently on window W with face FACE.
+   Precedence:
 
-  if (!IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET
-      ||
-      NILP (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))
-    return;
+   -- FACE's display table
+   -- W's display table (comes from specifier `current-display-table')
 
-  MAYBE_DEVMETH (XDEVICE (ii->device), update_subwindow, (ii));
-}
+   Ignore the specified tables if they are not valid;
+   if no valid table is specified, return 0.  */
 
-void
-update_frame_subwindows (struct frame *f)
-{
-  int elt;
-
-  if (f->subwindows_changed || f->glyphs_changed)
-    for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++)
-      {
-       struct subwindow_cachel *cachel =
-         Dynarr_atp (f->subwindow_cachels, elt);
-       
-       if (cachel->being_displayed)
-         {
-           update_subwindow (cachel->subwindow);
-         }
-      }
-}
-
-/* remove a subwindow from its frame */
-void unmap_subwindow (Lisp_Object subwindow)
-{
-  struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow);
-  int elt;
-  struct subwindow_cachel* cachel;
-  struct frame* f;
-
-  if (!(IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET
-       ||
-       IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW)
-      ||
-      NILP (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))
-    return;
-
-  f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));
-  elt = get_subwindow_cachel_index (f, subwindow);
-  cachel = Dynarr_atp (f->subwindow_cachels, elt);
-
-  cachel->x = -1;
-  cachel->y = -1;
-  cachel->being_displayed = 0;
-  IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0;
-
-  MAYBE_DEVMETH (XDEVICE (ii->device), unmap_subwindow, (ii));
-}
-
-/* show a subwindow in its frame */
-void map_subwindow (Lisp_Object subwindow, int x, int y)
-{
-  struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow);
-  int elt; 
-  struct subwindow_cachel* cachel;
-  struct frame* f;
-
-  if (!(IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET
-       ||
-       IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW)
-      ||
-      NILP (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))
-    return;
-
-  f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));
-  IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 1;
-  elt = get_subwindow_cachel_index (f, subwindow);
-  cachel = Dynarr_atp (f->subwindow_cachels, elt);
-  cachel->x = x;
-  cachel->y = y;
-  cachel->being_displayed = 1;
-
-  MAYBE_DEVMETH (XDEVICE (ii->device), map_subwindow, (ii, x, y));
-}
-
-static int
-subwindow_possible_dest_types (void)
-{
-  return IMAGE_SUBWINDOW_MASK;
-}
-
-/* Partially instantiate a subwindow. */
-void
-subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
-                      Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-                      int dest_mask, Lisp_Object domain)
-{
-  struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
-  Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
-  Lisp_Object frame = FW_FRAME (domain);
-  Lisp_Object width = find_keyword_in_vector (instantiator, Q_pixel_width);
-  Lisp_Object height = find_keyword_in_vector (instantiator, Q_pixel_height);
-
-  if (NILP (frame))
-    signal_simple_error ("No selected frame", device);
-  
-  if (!(dest_mask & IMAGE_SUBWINDOW_MASK))
-    incompatible_image_types (instantiator, dest_mask, IMAGE_SUBWINDOW_MASK);
-
-  ii->data = 0;
-  IMAGE_INSTANCE_SUBWINDOW_ID (ii) = 0;
-  IMAGE_INSTANCE_SUBWINDOW_FRAME (ii) = Qnil;
-  IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0;
-  IMAGE_INSTANCE_SUBWINDOW_FRAME (ii) = frame;
-
-  /* this stuff may get overidden by the widget code */
-  if (NILP (width))
-    IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = 20;
-  else
-    {
-      int w = 1;
-      CHECK_INT (width);
-      if (XINT (width) > 1)
-       w = XINT (width);
-      IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = w;
-    }
-  if (NILP (height))
-    IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = 20;
-  else
-    {
-      int h = 1;
-      CHECK_INT (height);
-      if (XINT (height) > 1)
-       h = XINT (height);
-      IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = h;
-    }
-}
-
-DEFUN ("subwindowp", Fsubwindowp, 1, 1, 0, /*
-Return non-nil if OBJECT is a subwindow.
-*/
-       (object))
-{
-  CHECK_IMAGE_INSTANCE (object);
-  return (XIMAGE_INSTANCE_TYPE (object) == IMAGE_SUBWINDOW) ? Qt : Qnil;
-}
-
-DEFUN ("image-instance-subwindow-id", Fimage_instance_subwindow_id, 1, 1, 0, /*
-Return the window id of SUBWINDOW as a number.
-*/
-       (subwindow))
-{
-  CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow);
-  return make_int ((int) (XIMAGE_INSTANCE_SUBWINDOW_ID (subwindow)));
-}
-
-DEFUN ("resize-subwindow", Fresize_subwindow, 1, 3, 0, /*
-Resize SUBWINDOW to WIDTH x HEIGHT.
-If a value is nil that parameter is not changed.
-*/
-       (subwindow, width, height))
-{
-  int neww, newh;
-
-  CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow);
-
-  if (NILP (width))
-    neww = XIMAGE_INSTANCE_SUBWINDOW_WIDTH (subwindow);
-  else
-    neww = XINT (width);
-
-  if (NILP (height))
-    newh = XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (subwindow);
-  else
-    newh = XINT (height);
-
-  
-  MAYBE_DEVMETH (XDEVICE (XIMAGE_INSTANCE_DEVICE (subwindow)), 
-                resize_subwindow, (XIMAGE_INSTANCE (subwindow), neww, newh));
-
-  XIMAGE_INSTANCE_SUBWINDOW_HEIGHT (subwindow) = newh;
-  XIMAGE_INSTANCE_SUBWINDOW_WIDTH (subwindow) = neww;
-
-  return subwindow;
-}
-
-DEFUN ("force-subwindow-map", Fforce_subwindow_map, 1, 1, 0, /*
-Generate a Map event for SUBWINDOW.
-*/
-       (subwindow))
-{
-  CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow);
-
-  map_subwindow (subwindow, 0, 0);
-
-  return subwindow;
-}
-
-\f
-/*****************************************************************************
- *                              display tables                               *
- *****************************************************************************/
-
-/* Get the display tables for use currently on window W with face
-   FACE.  #### This will have to be redone.  */
-
-void
-get_display_tables (struct window *w, face_index findex,
-                   Lisp_Object *face_table, Lisp_Object *window_table)
+struct Lisp_Vector *
+get_display_table (struct window *w, face_index findex)
 {
   Lisp_Object tem;
-  tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex);
-  if (UNBOUNDP (tem))
-    tem = Qnil;
-  if (!LISTP (tem))
-    tem = noseeum_cons (tem, Qnil);
-  *face_table = tem;
-  tem = w->display_table;
-  if (UNBOUNDP (tem))
-    tem = Qnil;
-  if (!LISTP (tem))
-    tem = noseeum_cons (tem, Qnil);
-  *window_table = tem;
-}
 
-Lisp_Object
-display_table_entry (Emchar ch, Lisp_Object face_table,
-                    Lisp_Object window_table)
-{
-  Lisp_Object tail;
+  tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex);
+  if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE)
+    return XVECTOR (tem);
 
-  /* Loop over FACE_TABLE, and then over WINDOW_TABLE. */
-  for (tail = face_table; 1; tail = XCDR (tail))
-    {
-      Lisp_Object table;
-      if (NILP (tail))
-       {
-         if (!NILP (window_table))
-           {
-             tail = window_table;
-             window_table = Qnil;
-           }
-         else
-           return Qnil;
-       }
-      table = XCAR (tail);
+  tem = w->display_table;
+  if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE)
+    return XVECTOR (tem);
 
-      if (VECTORP (table))
-       {
-         if (ch < XVECTOR_LENGTH (table) && !NILP (XVECTOR_DATA (table)[ch]))
-           return XVECTOR_DATA (table)[ch];
-         else
-           continue;
-       }
-      else if (CHAR_TABLEP (table)
-              && XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_CHAR)
-       {
-         return get_char_table (ch, XCHAR_TABLE (table));
-       }
-      else if (CHAR_TABLEP (table)
-              && XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_GENERIC)
-       {
-         Lisp_Object gotit = get_char_table (ch, XCHAR_TABLE (table));
-         if (!NILP (gotit))
-           return gotit;
-         else
-           continue;
-       }
-      else if (RANGE_TABLEP (table))
-       {
-         Lisp_Object gotit = Fget_range_table (make_char (ch), table, Qnil);
-         if (!NILP (gotit))
-           return gotit;
-         else
-           continue;
-       }
-      else
-       abort ();
-    }
+  return 0;
 }
+
 \f
 /*****************************************************************************
  *                              initialization                               *
@@ -3953,8 +3246,6 @@ syms_of_glyphs (void)
   defkeyword (&Q_file, ":file");
   defkeyword (&Q_data, ":data");
   defkeyword (&Q_face, ":face");
-  defkeyword (&Q_pixel_height, ":pixel-height");
-  defkeyword (&Q_pixel_width, ":pixel-width");
 
 #ifdef HAVE_XPM
   defkeyword (&Q_color_symbols, ":color-symbols");
@@ -3981,7 +3272,6 @@ syms_of_glyphs (void)
   defsymbol (&Qmono_pixmap_image_instance_p, "mono-pixmap-image-instance-p");
   defsymbol (&Qcolor_pixmap_image_instance_p, "color-pixmap-image-instance-p");
   defsymbol (&Qpointer_image_instance_p, "pointer-image-instance-p");
-  defsymbol (&Qwidget_image_instance_p, "widget-image-instance-p");
   defsymbol (&Qsubwindow_image_instance_p, "subwindow-image-instance-p");
 
   DEFSUBR (Fmake_image_instance);
@@ -4000,14 +3290,7 @@ syms_of_glyphs (void)
   DEFSUBR (Fimage_instance_hotspot_y);
   DEFSUBR (Fimage_instance_foreground);
   DEFSUBR (Fimage_instance_background);
-  DEFSUBR (Fimage_instance_property);
-  DEFSUBR (Fset_image_instance_property);
   DEFSUBR (Fcolorize_image_instance);
-  /* subwindows */
-  DEFSUBR (Fsubwindowp);
-  DEFSUBR (Fimage_instance_subwindow_id);
-  DEFSUBR (Fresize_subwindow);
-  DEFSUBR (Fforce_subwindow_map);
 
   /* Qnothing defined as part of the "nothing" image-instantiator
      type. */
@@ -4015,6 +3298,7 @@ syms_of_glyphs (void)
   defsymbol (&Qmono_pixmap, "mono-pixmap");
   defsymbol (&Qcolor_pixmap, "color-pixmap");
   /* Qpointer defined in general.c */
+  defsymbol (&Qsubwindow, "subwindow");
 
   /* glyphs */
 
@@ -4104,19 +3388,13 @@ image_instantiator_format_create (void)
 
   IIFORMAT_VALID_KEYWORD (formatted_string, Q_data, check_valid_string);
 
-  /* subwindows */
-  INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (subwindow, "subwindow");
-  IIFORMAT_HAS_METHOD (subwindow, possible_dest_types);
-  IIFORMAT_HAS_METHOD (subwindow, instantiate);
-  IIFORMAT_VALID_KEYWORD (subwindow, Q_pixel_width, check_valid_int);
-  IIFORMAT_VALID_KEYWORD (subwindow, Q_pixel_height, check_valid_int);
-
 #ifdef HAVE_WINDOW_SYSTEM
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xbm, "xbm");
 
   IIFORMAT_HAS_METHOD (xbm, validate);
   IIFORMAT_HAS_METHOD (xbm, normalize);
   IIFORMAT_HAS_METHOD (xbm, possible_dest_types);
+  IIFORMAT_HAS_METHOD (xbm, instantiate);
 
   IIFORMAT_VALID_KEYWORD (xbm, Q_data, check_valid_xbm_inline);
   IIFORMAT_VALID_KEYWORD (xbm, Q_file, check_valid_string);
@@ -4128,27 +3406,13 @@ image_instantiator_format_create (void)
   IIFORMAT_VALID_KEYWORD (xbm, Q_background, check_valid_string);
 #endif /* HAVE_WINDOW_SYSTEM */
 
-#ifdef HAVE_XFACE
-  INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xface, "xface");
-
-  IIFORMAT_HAS_METHOD (xface, validate);
-  IIFORMAT_HAS_METHOD (xface, normalize);
-  IIFORMAT_HAS_METHOD (xface, possible_dest_types);
-
-  IIFORMAT_VALID_KEYWORD (xface, Q_data, check_valid_string);
-  IIFORMAT_VALID_KEYWORD (xface, Q_file, check_valid_string);
-  IIFORMAT_VALID_KEYWORD (xface, Q_hotspot_x, check_valid_int);
-  IIFORMAT_VALID_KEYWORD (xface, Q_hotspot_y, check_valid_int);
-  IIFORMAT_VALID_KEYWORD (xface, Q_foreground, check_valid_string);
-  IIFORMAT_VALID_KEYWORD (xface, Q_background, check_valid_string);
-#endif
-
 #ifdef HAVE_XPM
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xpm, "xpm");
 
   IIFORMAT_HAS_METHOD (xpm, validate);
   IIFORMAT_HAS_METHOD (xpm, normalize);
   IIFORMAT_HAS_METHOD (xpm, possible_dest_types);
+  IIFORMAT_HAS_METHOD (xpm, instantiate);
 
   IIFORMAT_VALID_KEYWORD (xpm, Q_data, check_valid_string);
   IIFORMAT_VALID_KEYWORD (xpm, Q_file, check_valid_string);
@@ -4164,9 +3428,8 @@ vars_of_glyphs (void)
 
   /* image instances */
 
-  Vimage_instance_type_list = Fcons (Qnothing, 
-                                    list6 (Qtext, Qmono_pixmap, Qcolor_pixmap, 
-                                           Qpointer, Qsubwindow, Qwidget));
+  Vimage_instance_type_list = list6 (Qnothing, Qtext, Qmono_pixmap,
+                                    Qcolor_pixmap, Qpointer, Qsubwindow);
   staticpro (&Vimage_instance_type_list);
 
   /* glyphs */
@@ -4202,9 +3465,7 @@ Normally this is three dots ("...").
 What to display at the beginning of horizontally scrolled lines.
 */);
   Vhscroll_glyph = allocate_glyph (GLYPH_BUFFER, redisplay_glyph_changed);
-#ifdef HAVE_WINDOW_SYSTEM
-  Fprovide (Qxbm);
-#endif
+
 #ifdef HAVE_XPM
   Fprovide (Qxpm);
 
@@ -4221,9 +3482,6 @@ The default value of this variable defines the logical color names
 */ );
   Vxpm_color_symbols = Qnil; /* initialized in x-faces.el */
 #endif /* HAVE_XPM */
-#ifdef HAVE_XFACE
-  Fprovide (Qxface);
-#endif
 }
 
 void
diff --git a/src/input-method-xfs.c b/src/input-method-xfs.c
new file mode 100644 (file)
index 0000000..ed9cd6d
--- /dev/null
@@ -0,0 +1,86 @@
+/* input-method-xfs.c provides just only locale initialize
+   for non Motif people. (stoled from input-method-xlib.c)
+   Why I made this code is to initialize X locale environment for
+   the purpose of use XFontSet correctly in lwlib/xlwmenu.c.
+   And this code donot provides input methods under Xlib while they
+   prefer to use Canna, Wnn, skk or something like that.
+   This code has been tested on FreeBSD 2.2.1 and Solaris2.5.
+
+   Copyright (C) 1997 Kazuyuki IENAGA.
+
+This file is a 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.  */
+
+#include <config.h>
+#include <X11/Xlocale.h>        /* More portable than <locale.h> ? */
+#include "lisp.h"
+#include "frame.h"
+#include "device.h"
+#include "window.h"
+#include "buffer.h"
+#include "console-x.h"
+#include "EmacsFrame.h"
+#include "events.h"
+
+#ifdef USE_XFONTSET
+void
+Initialize_Locale (void)
+{
+  char *locale;
+
+  XtSetLanguageProc (NULL, (XtLanguageProc) NULL, NULL);
+  if ((locale = setlocale (LC_ALL, "")) == NULL)
+    {
+      stderr_out ("Can't set locale.\n");
+      stderr_out ("Using C locale instead.\n");
+      putenv ("LANG=C");
+      putenv ("LC_ALL=C");
+      if ((locale = setlocale (LC_ALL, "C")) == NULL)
+       {
+         stderr_out ("Can't even set locale to `C'!\n");
+         return;
+       }
+    }
+
+  if (!XSupportsLocale ())
+    {
+      stderr_out ("X Windows does not support locale `%s'\n", locale);
+      stderr_out ("Using C Locale instead\n");
+      putenv ("LANG=C");
+      putenv ("LC_ALL=C");
+      if ((locale = setlocale (LC_ALL, "C")) == NULL)
+       {
+         stderr_out ("Can't even set locale to `C'!\n");
+         return;
+       }
+      if (!XSupportsLocale ())
+        {
+          stderr_out ("X Windows does not even support locale `C'!\n");
+          return;
+        }
+    }
+
+  setlocale(LC_NUMERIC, "C");
+  setlocale(LC_CTYPE, ""); /* take back CTYPE to previous state */
+  
+  if (XSetLocaleModifiers ("") == NULL)
+    {
+      stderr_out ("XSetLocaleModifiers(\"\") failed\n");
+      stderr_out ("Check the value of the XMODIFIERS environment variable.\n");
+    }
+}
+#endif /* USE_XFONTSET */
index 08d191d..01484b7 100644 (file)
@@ -1657,8 +1657,6 @@ gap_left (struct buffer *buf, Bytind pos)
   Bufbyte *to, *from;
   Bytecount i;
   Bytind new_s1;
-  struct buffer *mbuf;
-  Lisp_Object bufcons;
 
   from = BUF_GPT_ADDR (buf);
   to = from + BUF_GAP_SIZE (buf);
@@ -1710,22 +1708,13 @@ gap_left (struct buffer *buf, Bytind pos)
   /* Adjust markers, and buffer data structure, to put the gap at POS.
      POS is where the loop above stopped, which may be what was specified
      or may be where a quit was detected.  */
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      adjust_markers (mbuf, pos, BI_BUF_GPT (mbuf), BUF_GAP_SIZE (mbuf));
-    }
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      adjust_extents (make_buffer (mbuf), pos, BI_BUF_GPT (mbuf),
-                     BUF_GAP_SIZE (mbuf));
-    }
+  adjust_markers (buf, pos, BI_BUF_GPT (buf), BUF_GAP_SIZE (buf));
+  adjust_extents (make_buffer (buf), pos, BI_BUF_GPT (buf),
+                 BUF_GAP_SIZE (buf));
   SET_BI_BUF_GPT (buf, pos);
   SET_GAP_SENTINEL (buf);
 #ifdef ERROR_CHECK_EXTENTS
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      sledgehammer_extent_check (make_buffer (mbuf));
-    }
+  sledgehammer_extent_check (make_buffer (buf));
 #endif
   QUIT;
 }
@@ -1736,8 +1725,6 @@ gap_right (struct buffer *buf, Bytind pos)
   Bufbyte *to, *from;
   Bytecount i;
   Bytind new_s1;
-  struct buffer *mbuf;
-  Lisp_Object bufcons;
 
   to = BUF_GPT_ADDR (buf);
   from = to + BUF_GAP_SIZE (buf);
@@ -1788,22 +1775,13 @@ gap_right (struct buffer *buf, Bytind pos)
 
   {
     int gsize = BUF_GAP_SIZE (buf);
-    MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-      {
-       adjust_markers (mbuf, BI_BUF_GPT (mbuf) + gsize, pos + gsize, - gsize);
-      }
-    MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-      {
-       adjust_extents (make_buffer (mbuf), BI_BUF_GPT (mbuf) + gsize,
-                       pos + gsize, - gsize);
-      }
+    adjust_markers (buf, BI_BUF_GPT (buf) + gsize, pos + gsize, - gsize);
+    adjust_extents (make_buffer (buf), BI_BUF_GPT (buf) + gsize, pos + gsize,
+                   - gsize);
     SET_BI_BUF_GPT (buf, pos);
     SET_GAP_SENTINEL (buf);
 #ifdef ERROR_CHECK_EXTENTS
-    MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-      {
-       sledgehammer_extent_check (make_buffer (mbuf));
-      }
+    sledgehammer_extent_check (make_buffer (buf));
 #endif
   }
   if (pos == BI_BUF_Z (buf))
@@ -1886,7 +1864,7 @@ make_gap (struct buffer *buf, Bytecount increment)
   Bytecount old_gap_size;
 
   /* If we have to get more space, get enough to last a while.  We use
-     a geometric progression that saves on realloc space. */
+     a geometric progession that saves on realloc space. */
   increment += 2000 + ((BI_BUF_Z (buf) - BI_BUF_BEG (buf)) / 8);
 
   if (increment > BUF_END_GAP_SIZE (buf))
@@ -2102,10 +2080,8 @@ static int inside_change_hook;
 static Lisp_Object
 change_function_restore (Lisp_Object buffer)
 {
-  /* We should first reset the variable and then change the buffer,
-     because Fset_buffer() can throw.  */
-  inside_change_hook = 0;
   Fset_buffer (buffer);
+  inside_change_hook = 0;
   return Qnil;
 }
 
@@ -2114,8 +2090,8 @@ static int in_first_change;
 static Lisp_Object
 first_change_hook_restore (Lisp_Object buffer)
 {
-  in_first_change = 0;
   Fset_buffer (buffer);
+  in_first_change = 0;
   return Qnil;
 }
 
@@ -2130,7 +2106,8 @@ signal_first_change (struct buffer *buf)
 
   if (!in_first_change)
     {
-      if (!NILP (symbol_value_in_buffer (Qfirst_change_hook, buffer)))
+      if (!preparing_for_armageddon &&
+         !NILP (symbol_value_in_buffer (Qfirst_change_hook, buffer)))
        {
          int speccount = specpdl_depth ();
          record_unwind_protect (first_change_hook_restore, buffer);
@@ -2149,13 +2126,11 @@ static void
 signal_before_change (struct buffer *buf, Bufpos start, Bufpos end)
 {
   /* This function can GC */
-  struct buffer *mbuf;
-  Lisp_Object bufcons;
+  Lisp_Object buffer;
+  XSETBUFFER (buffer, buf);
 
   if (!inside_change_hook)
     {
-      Lisp_Object buffer;
-
       /* Are we in a multiple-change session? */
       if (buf->text->changes->in_multiple_change &&
          buf->text->changes->mc_begin != 0)
@@ -2184,46 +2159,35 @@ signal_before_change (struct buffer *buf, Bufpos start, Bufpos end)
 
       /* If buffer is unmodified, run a special hook for that case.  */
       if (BUF_SAVE_MODIFF (buf) >= BUF_MODIFF (buf))
-       {
-         MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-           {
-             signal_first_change (mbuf);
-           }
-       }
+       signal_first_change (buf);
 
       /* Now in any case run the before-change-functions if any.  */
 
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
+      if (!preparing_for_armageddon &&
+         (!NILP (symbol_value_in_buffer (Qbefore_change_functions, buffer)) ||
+          /* Obsolete, for compatibility */
+          !NILP (symbol_value_in_buffer (Qbefore_change_function, buffer))))
        {
-         XSETBUFFER (buffer, mbuf);
-         if (!NILP (symbol_value_in_buffer (Qbefore_change_functions, buffer))
-             /* Obsolete, for compatibility */
-             || !NILP (symbol_value_in_buffer (Qbefore_change_function, buffer)))
-           {
-             int speccount = specpdl_depth ();
-             record_unwind_protect (change_function_restore, Fcurrent_buffer ());
-             set_buffer_internal (buf);
-             inside_change_hook = 1;
-             va_run_hook_with_args (Qbefore_change_functions, 2,
-                                    make_int (start), make_int (end));
-             /* Obsolete, for compatibility */
-             va_run_hook_with_args (Qbefore_change_function, 2,
-                                    make_int (start), make_int (end));
-             unbind_to (speccount, Qnil);
-           }
-       }
-
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         XSETBUFFER (buffer, mbuf);
-         report_extent_modification (buffer, start, end,
-                                     &inside_change_hook, 0);
+         int speccount = specpdl_depth ();
+         record_unwind_protect (change_function_restore, Fcurrent_buffer ());
+         set_buffer_internal (buf);
+         inside_change_hook = 1;
+         va_run_hook_with_args (Qbefore_change_functions, 2,
+                                make_int (start), make_int (end));
+         /* Obsolete, for compatibility */
+         va_run_hook_with_args (Qbefore_change_function, 2,
+                                make_int (start), make_int (end));
+         unbind_to (speccount, Qnil);
        }
 
       /* Only now do we indicate that the before-change-functions have
         been called, in case some function throws out. */
       buf->text->changes->mc_begin_signaled = 1;
     }
+
+  /* #### At this point we should map over extents calling
+     modification-hooks, insert-before-hooks and insert-after-hooks
+     of relevant extents */
 }
 
 /* Signal a change immediately after it happens.
@@ -2237,25 +2201,15 @@ signal_after_change (struct buffer *buf, Bufpos start, Bufpos orig_end,
                     Bufpos new_end)
 {
   /* This function can GC */
-  struct buffer *mbuf;
-  Lisp_Object bufcons;
+  Lisp_Object buffer;
+  XSETBUFFER (buffer, buf);
 
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      /* always do this. */
-      buffer_signal_changed_region (mbuf, start, new_end);
-    }
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      /* #### This seems inefficient.  Wouldn't it be better to just
-         keep one cache per base buffer?  */
-      font_lock_maybe_update_syntactic_caches (mbuf, start, orig_end, new_end);
-    }
+  /* always do this. */
+  buffer_signal_changed_region (buf, start, new_end);
+  font_lock_maybe_update_syntactic_caches (buf, start, orig_end, new_end);
 
   if (!inside_change_hook)
     {
-      Lisp_Object buffer;
-
       if (buf->text->changes->in_multiple_change &&
          buf->text->changes->mc_begin != 0)
        {
@@ -2267,38 +2221,30 @@ signal_after_change (struct buffer *buf, Bufpos start, Bufpos orig_end,
          return; /* after-change-functions signalled when all changes done */
        }
 
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         XSETBUFFER (buffer, mbuf);
-
-         if (!NILP (symbol_value_in_buffer (Qafter_change_functions, buffer))
-             /* Obsolete, for compatibility */
-             || !NILP (symbol_value_in_buffer (Qafter_change_function, buffer)))
-           {
-             int speccount = specpdl_depth ();
-             record_unwind_protect (change_function_restore, Fcurrent_buffer ());
-             set_buffer_internal (buf);
-             inside_change_hook = 1;
-             /* The actual after-change functions take slightly
-                different arguments than what we were passed. */
-             va_run_hook_with_args (Qafter_change_functions, 3,
-                                    make_int (start), make_int (new_end),
-                                    make_int (orig_end - start));
-             /* Obsolete, for compatibility */
-             va_run_hook_with_args (Qafter_change_function, 3,
-                                    make_int (start), make_int (new_end),
-                                    make_int (orig_end - start));
-             unbind_to (speccount, Qnil);
-           }
-       }
-
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
+      if (!preparing_for_armageddon &&
+         (!NILP (symbol_value_in_buffer (Qafter_change_functions, buffer)) ||
+          /* Obsolete, for compatibility */
+          !NILP (symbol_value_in_buffer (Qafter_change_function, buffer))))
        {
-         XSETBUFFER (buffer, mbuf);
-         report_extent_modification (buffer, start, new_end,
-                                     &inside_change_hook, 1);
+         int speccount = specpdl_depth ();
+         record_unwind_protect (change_function_restore, Fcurrent_buffer ());
+         set_buffer_internal (buf);
+         inside_change_hook = 1;
+         /* The actual after-change functions take slightly
+            different arguments than what we were passed. */
+         va_run_hook_with_args (Qafter_change_functions, 3,
+                                make_int (start), make_int (new_end),
+                                make_int (orig_end - start));
+         /* Obsolete, for compatibility */
+         va_run_hook_with_args (Qafter_change_function, 3,
+                                make_int (start), make_int (new_end),
+                                make_int (orig_end - start));
+         unbind_to (speccount, Qnil);
        }
     }
+
+  /* #### At this point we should map over extents calling
+     some sort of modification hooks of relevant extents */
 }
 
 /* Call this if you're about to change the region of BUFFER from START
@@ -2314,14 +2260,10 @@ prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end,
   /* dmoore - This function can also kill the buffer buf, the current
      buffer, and do anything it pleases.  So if you call it, be
      careful. */
-  struct buffer *mbuf;
-  Lisp_Object buffer, bufcons;
+  Lisp_Object buffer;
   struct gcpro gcpro1;
 
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      barf_if_buffer_read_only (mbuf, start, end);
-    }
+  barf_if_buffer_read_only (buf, start, end);
 
   /* if this is the first modification, see about locking the buffer's
      file */
@@ -2365,10 +2307,7 @@ prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end,
   Vdeactivate_mark = Qt;
 #endif
 
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      mbuf->point_before_scroll = Qnil;
-    }
+  buf->point_before_scroll = Qnil;
 }
 
 \f
@@ -2428,8 +2367,6 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos,
   Bytind ind;
   Charcount cclen;
   int move_point = 0;
-  struct buffer *mbuf;
-  Lisp_Object bufcons;
 
   /* Defensive steps just in case a buffer gets deleted and a calling
      function doesn't notice it. */
@@ -2454,8 +2391,7 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos,
   if ((length + BUF_Z (buf)) > EMACS_INT_MAX)
     error ("Maximum buffer size exceeded");
 
-  /* theoretically not necessary -- caller should GCPRO.
-     #### buffer_insert_from_buffer_1() doesn't!  */
+  /* theoretically not necessary -- caller should GCPRO */
   GCPRO1 (reloc);
 
   prepare_to_modify_buffer (buf, pos, pos, !(flags & INSDEL_NO_LOCKING));
@@ -2497,11 +2433,7 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos,
 
   insert_invalidate_line_number_cache (buf, pos, nonreloc + offset, length);
 
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      record_insert (mbuf, pos, cclen);
-    }
-
+  record_insert (buf, pos, cclen);
   BUF_MODIFF (buf)++;
   MARK_BUFFERS_CHANGED;
 
@@ -2513,10 +2445,7 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos,
 
   SET_BUF_GAP_SIZE (buf, BUF_GAP_SIZE (buf) - length);
   SET_BI_BUF_GPT (buf, BI_BUF_GPT (buf) + length);
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      SET_BOTH_BUF_ZV (mbuf, BUF_ZV (mbuf) + cclen, BI_BUF_ZV (mbuf) + length);
-    }
+  SET_BOTH_BUF_ZV (buf, BUF_ZV (buf) + cclen, BI_BUF_ZV (buf) + length);
   SET_BOTH_BUF_Z (buf, BUF_Z (buf) + cclen, BI_BUF_Z (buf) + length);
   SET_GAP_SENTINEL (buf);
 
@@ -2524,48 +2453,29 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos,
   buffer_mule_signal_inserted_region (buf, pos, length, cclen);
 #endif
 
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      process_extents_for_insertion (make_buffer (mbuf), ind, length);
-    }
-
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      /* We know the gap is at IND so the cast is OK. */
-      adjust_markers_for_insert (mbuf, (Memind) ind, length);
-    }
+  process_extents_for_insertion (make_buffer (buf), ind, length);
+  /* We know the gap is at IND so the cast is OK. */
+  adjust_markers_for_insert (buf, (Memind) ind, length);
 
   /* Point logically doesn't move, but may need to be adjusted because
      it's a byte index.  point-marker doesn't change because it's a
      memory index. */
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      if (BI_BUF_PT (mbuf) > ind)
-       JUST_SET_POINT (mbuf, BUF_PT (mbuf) + cclen,
-                       BI_BUF_PT (mbuf) + length);
-    }
+  if (BI_BUF_PT (buf) > ind)
+    JUST_SET_POINT (buf, BUF_PT (buf) + cclen, BI_BUF_PT (buf) + length);
 
   /* Well, point might move. */
   if (move_point)
     BI_BUF_SET_PT (buf, ind + length);
 
   if (STRINGP (reloc))
-    {
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         splice_in_string_extents (reloc, mbuf, ind, length, offset);
-       }
-    }
+    splice_in_string_extents (reloc, buf, ind, length, offset);
 
   if (flags & INSDEL_BEFORE_MARKERS)
     {
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         /* ind - 1 is correct because the FROM argument is exclusive.
-            I formerly used DEC_BYTIND() but that caused problems at the
-            beginning of the buffer. */
-         adjust_markers (mbuf, ind - 1, ind, length);
-       }
+      /* ind - 1 is correct because the FROM argument is exclusive.
+        I formerly used DEC_BYTIND() but that caused problems at the
+        beginning of the buffer. */
+      adjust_markers (buf, ind - 1, ind, length);
     }
 
   signal_after_change (buf, pos, pos, pos + cclen);
@@ -2597,9 +2507,7 @@ buffer_insert_lisp_string_1 (struct buffer *buf, Bufpos pos, Lisp_Object str,
                             int flags)
 {
   /* This function can GC */
-#ifdef ERROR_CHECK_TYPECHECK
   assert (STRINGP (str));
-#endif
   return buffer_insert_string_1 (buf, pos, 0, str, 0,
                                 XSTRING_LENGTH (str),
                                 flags);
@@ -2612,6 +2520,7 @@ buffer_insert_c_string_1 (struct buffer *buf, Bufpos pos, CONST char *s,
                          int flags)
 {
   /* This function can GC */
+
   CONST char *translated = GETTEXT (s);
   return buffer_insert_string_1 (buf, pos, (CONST Bufbyte *) translated, Qnil,
                                 0, strlen (translated), flags);
@@ -2623,7 +2532,9 @@ buffer_insert_emacs_char_1 (struct buffer *buf, Bufpos pos, Emchar ch,
 {
   /* This function can GC */
   Bufbyte str[MAX_EMCHAR_LEN];
-  Bytecount len = set_charptr_emchar (str, ch);
+  Bytecount len;
+
+  len = set_charptr_emchar (str, ch);
   return buffer_insert_string_1 (buf, pos, str, Qnil, 0, len, flags);
 }
 
@@ -2662,8 +2573,7 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags)
   Bytind bi_from, bi_to;
   Bytecount bc_numdel;
   EMACS_INT shortage;
-  struct buffer *mbuf;
-  Lisp_Object bufcons;
+  Lisp_Object bufobj;
 
   /* Defensive steps just in case a buffer gets deleted and a calling
      function doesn't notice it. */
@@ -2694,6 +2604,8 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags)
   if ((numdel = to - from) <= 0)
     return;
 
+  XSETBUFFER (bufobj, buf);
+
   /* Redisplay needs to know if a newline was in the deleted region.
      If we've already marked the changed region as having a deleted
      newline there is no use in performing the check. */
@@ -2701,12 +2613,7 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags)
     {
       scan_buffer (buf, '\n', from, to, 1, &shortage, 1);
       if (!shortage)
-       {
-         MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-           {
-             mbuf->changes->newline_was_deleted = 1;
-           }
-       }
+       buf->changes->newline_was_deleted = 1;
     }
 
   bi_from = bufpos_to_bytind (buf, from);
@@ -2720,70 +2627,49 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags)
     {
       /* avoid moving the gap just to delete from the bottom. */
 
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         record_delete (mbuf, from, numdel);
-       }
+      record_delete (buf, from, numdel);
       BUF_MODIFF (buf)++;
       MARK_BUFFERS_CHANGED;
 
-      /* #### Point used to be modified here, but this causes problems
-        with MULE, as point is used to calculate bytinds, and if the
-        offset in bc_numdel causes point to move to a non first-byte
-        location, causing some other function to throw an assertion
-        in ASSERT_VALID_BYTIND. I've moved the code to right after
-        the other movements and adjustments, but before the gap is
-        moved.  -- jh 970813 */
+      /* ### Point used to be modified here, but this causes problems with MULE,
+        as point is used to calculate bytinds, and if the offset in bc_numdel causes
+        point to move to a non first-byte location, causing some other function to
+        throw an assertion in ASSERT_VALID_BYTIND. I've moved the code to right after
+         the other movements and adjustments, but before the gap is moved.
+         -- jh 970813 */
 
       /* Detach any extents that are completely within the range [FROM, TO],
         if the extents are detachable.
 
-        This must come AFTER record_delete(), so that the appropriate
-        extents will be present to be recorded, and BEFORE the gap
-        size is increased, as otherwise we will be confused about
-        where the extents end. */
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         process_extents_for_deletion (make_buffer (mbuf), bi_from, bi_to, 0);
-       }
+        This must come AFTER record_delete(), so that the appropriate extents
+        will be present to be recorded, and BEFORE the gap size is increased,
+        as otherwise we will be confused about where the extents end. */
+      process_extents_for_deletion (bufobj, bi_from, bi_to, 0);
 
-      /* Relocate all markers pointing into the new, larger gap to
-        point at the end of the text before the gap.  */
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         adjust_markers (mbuf,
-                         (bi_to + BUF_GAP_SIZE (mbuf)),
-                         (bi_to + BUF_GAP_SIZE (mbuf)),
-                         (- bc_numdel));
-       }
+      /* Relocate all markers pointing into the new, larger gap
+        to point at the end of the text before the gap.  */
+      adjust_markers (buf,
+                     (bi_to + BUF_GAP_SIZE (buf)),
+                     (bi_to + BUF_GAP_SIZE (buf)),
+                     (- bc_numdel));
 
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         /* Relocate any extent endpoints just like markers. */
-         adjust_extents_for_deletion (make_buffer (mbuf), bi_from, bi_to,
-                                      BUF_GAP_SIZE (mbuf), bc_numdel, 0);
-       }
+      /* Relocate any extent endpoints just like markers. */
+      adjust_extents_for_deletion (bufobj, bi_from, bi_to,
+                                  BUF_GAP_SIZE (buf), bc_numdel, 0);
 
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
+      /* Relocate point as if it were a marker.  */
+      if (bi_from < BI_BUF_PT (buf))
        {
-         /* Relocate point as if it were a marker.  */
-         if (bi_from < BI_BUF_PT (mbuf))
-           {
-             if (BI_BUF_PT (mbuf) < bi_to)
-               JUST_SET_POINT (mbuf, from, bi_from);
-             else
-               JUST_SET_POINT (mbuf, BUF_PT (mbuf) - numdel,
-                               BI_BUF_PT (mbuf) - bc_numdel);
-           }
+         if (BI_BUF_PT (buf) < bi_to)
+           JUST_SET_POINT (buf, from, bi_from);
+         else
+           JUST_SET_POINT (buf, BUF_PT (buf) - numdel,
+                           BI_BUF_PT (buf) - bc_numdel);
        }
 
       SET_BUF_END_GAP_SIZE (buf, BUF_END_GAP_SIZE (buf) + bc_numdel);
 
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         SET_BOTH_BUF_ZV (mbuf, BUF_ZV (mbuf) - numdel,
-                          BI_BUF_ZV (mbuf) - bc_numdel);
-       }
+      SET_BOTH_BUF_ZV (buf, BUF_ZV (buf) - numdel, BI_BUF_ZV (buf) - bc_numdel);
       SET_BOTH_BUF_Z (buf, BUF_Z (buf) - numdel, BI_BUF_Z (buf) - bc_numdel);
       SET_GAP_SENTINEL (buf);
     }
@@ -2795,20 +2681,16 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags)
       if (bi_from > BI_BUF_GPT (buf))
        gap_right (buf, bi_from);
 
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         record_delete (mbuf, from, numdel);
-       }
+      record_delete (buf, from, numdel);
       BUF_MODIFF (buf)++;
       MARK_BUFFERS_CHANGED;
 
-      /* #### Point used to be modified here, but this causes problems
-        with MULE, as point is used to calculate bytinds, and if the
-        offset in bc_numdel causes point to move to a non first-byte
-        location, causing some other function to throw an assertion
-        in ASSERT_VALID_BYTIND. I've moved the code to right after
-        the other movements and adjustments, but before the gap is
-        moved.  -- jh 970813 */
+      /* ### Point used to be modified here, but this causes problems with MULE,
+        as point is used to calculate bytinds, and if the offset in bc_numdel causes
+        point to move to a non first-byte location, causing some other function to
+        throw an assertion in ASSERT_VALID_BYTIND. I've moved the code to right after
+         the other movements and adjustments, but before the gap is moved.
+         -- jh 970813 */
 
       /* Detach any extents that are completely within the range [FROM, TO],
         if the extents are detachable.
@@ -2816,48 +2698,31 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags)
         This must come AFTER record_delete(), so that the appropriate extents
         will be present to be recorded, and BEFORE the gap size is increased,
         as otherwise we will be confused about where the extents end. */
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         process_extents_for_deletion (make_buffer (mbuf), bi_from, bi_to, 0);
-       }
+      process_extents_for_deletion (bufobj, bi_from, bi_to, 0);
 
-      /* Relocate all markers pointing into the new, larger gap to
-        point at the end of the text before the gap.  */
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         adjust_markers (mbuf,
-                         (bi_to + BUF_GAP_SIZE (mbuf)),
-                         (bi_to + BUF_GAP_SIZE (mbuf)),
-                         (- bc_numdel - BUF_GAP_SIZE (mbuf)));
-       }
+      /* Relocate all markers pointing into the new, larger gap
+        to point at the end of the text before the gap.  */
+      adjust_markers (buf,
+                     (bi_to + BUF_GAP_SIZE (buf)),
+                     (bi_to + BUF_GAP_SIZE (buf)),
+                     (- bc_numdel - BUF_GAP_SIZE (buf)));
 
       /* Relocate any extent endpoints just like markers. */
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         adjust_extents_for_deletion (make_buffer (mbuf), bi_from, bi_to,
-                                      BUF_GAP_SIZE (mbuf),
-                                      bc_numdel, BUF_GAP_SIZE (mbuf));
-       }
+      adjust_extents_for_deletion (bufobj, bi_from, bi_to, BUF_GAP_SIZE (buf),
+                                  bc_numdel, BUF_GAP_SIZE (buf));
 
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
+      /* Relocate point as if it were a marker.  */
+      if (bi_from < BI_BUF_PT (buf))
        {
-         /* Relocate point as if it were a marker.  */
-         if (bi_from < BI_BUF_PT (mbuf))
-           {
-             if (BI_BUF_PT (mbuf) < bi_to)
-               JUST_SET_POINT (mbuf, from, bi_from);
-             else
-               JUST_SET_POINT (mbuf, BUF_PT (mbuf) - numdel,
-                               BI_BUF_PT (mbuf) - bc_numdel);
-           }
+         if (BI_BUF_PT (buf) < bi_to)
+           JUST_SET_POINT (buf, from, bi_from);
+         else
+           JUST_SET_POINT (buf, BUF_PT (buf) - numdel,
+                           BI_BUF_PT (buf) - bc_numdel);
        }
 
       SET_BUF_GAP_SIZE (buf, BUF_GAP_SIZE (buf) + bc_numdel);
-      MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-       {
-         SET_BOTH_BUF_ZV (mbuf, BUF_ZV (mbuf) - numdel,
-                          BI_BUF_ZV (mbuf) - bc_numdel);
-       }
+      SET_BOTH_BUF_ZV (buf, BUF_ZV (buf) - numdel, BI_BUF_ZV (buf) - bc_numdel);
       SET_BOTH_BUF_Z (buf, BUF_Z (buf) - numdel, BI_BUF_Z (buf) - bc_numdel);
       SET_BI_BUF_GPT (buf, bi_from);
       SET_GAP_SENTINEL (buf);
@@ -2868,10 +2733,7 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags)
 #endif
 
 #ifdef ERROR_CHECK_EXTENTS
-  MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-    {
-      sledgehammer_extent_check (make_buffer (mbuf));
-    }
+  sledgehammer_extent_check (bufobj);
 #endif
 
   signal_after_change (buf, from, to, from);
@@ -2885,7 +2747,7 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags)
 /* Replace the character at POS in buffer B with CH. */
 
 void
-buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch,
+buffer_replace_char (struct buffer *b, Bufpos pos, Emchar ch,
                     int not_real_change, int force_lock_check)
 {
   /* This function can GC */
@@ -2895,54 +2757,42 @@ buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch,
 
   /* Defensive steps just in case a buffer gets deleted and a calling
      function doesn't notice it. */
-  if (!BUFFER_LIVE_P (buf))
+  if (!BUFFER_LIVE_P (b))
     return;
 
-  curlen = BUF_CHARPTR_COPY_CHAR (buf, pos, curstr);
+  curlen = BUF_CHARPTR_COPY_CHAR (b, pos, curstr);
   newlen = set_charptr_emchar (newstr, ch);
 
   if (curlen == newlen)
     {
-      struct buffer *mbuf;
-      Lisp_Object bufcons;
-
       /* then we can just replace the text. */
-      prepare_to_modify_buffer (buf, pos, pos + 1,
+      prepare_to_modify_buffer (b, pos, pos + 1,
                                !not_real_change || force_lock_check);
       /* Defensive steps in case the before-change-functions fuck around */
-      if (!BUFFER_LIVE_P (buf))
+      if (!BUFFER_LIVE_P (b))
        /* Bad bad pre-change function. */
        return;
 
       /* Make args be valid again.  prepare_to_modify_buffer() might have
         modified the buffer. */
-      if (pos < BUF_BEGV (buf))
-       pos = BUF_BEGV (buf);
-      if (pos >= BUF_ZV (buf))
-       pos = BUF_ZV (buf) - 1;
-      if (pos < BUF_BEGV (buf))
+      if (pos < BUF_BEGV (b))
+       pos = BUF_BEGV (b);
+      if (pos >= BUF_ZV (b))
+       pos = BUF_ZV (b) - 1;
+      if (pos < BUF_BEGV (b))
        /* no more characters in buffer! */
        return;
 
-      if (BUF_FETCH_CHAR (buf, pos) == '\n')
-       {
-         MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-           {
-             mbuf->changes->newline_was_deleted = 1;
-           }
-       }
+      if (BUF_FETCH_CHAR (b, pos) == '\n')
+       b->changes->newline_was_deleted = 1;
       MARK_BUFFERS_CHANGED;
       if (!not_real_change)
        {
-         MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons)
-           {
-             record_change (mbuf, pos, 1);
-           }
-         BUF_MODIFF (buf)++;
+         record_change (b, pos, 1);
+         BUF_MODIFF (b)++;
        }
-      memcpy (BUF_BYTE_ADDRESS (buf, pos), newstr, newlen);
-
-      signal_after_change (buf, pos, pos + 1, pos + 1);
+      memcpy (BUF_BYTE_ADDRESS (b, pos), newstr, newlen);
+      signal_after_change (b, pos, pos + 1, pos + 1);
 
       /* We do not have to adjust the Mule data; we just replaced a
         character with another of the same number of bytes. */
@@ -2957,21 +2807,21 @@ buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch,
        * point.  Point will drift backward by one position and stay
        * there otherwise.
        */
-      int movepoint = (pos == BUF_PT (buf) - 1);
+      int movepoint = (pos == BUF_PT (b) - 1);
 
-      buffer_delete_range (buf, pos, pos + 1, 0);
+      buffer_delete_range (b, pos, pos + 1, 0);
       /* Defensive steps in case the before-change-functions fuck around */
-      if (!BUFFER_LIVE_P (buf))
+      if (!BUFFER_LIVE_P (b))
        /* Bad bad pre-change function. */
        return;
 
       /* Make args be valid again.  prepare_to_modify_buffer() might have
         modified the buffer. */
-      if (pos < BUF_BEGV (buf))
-       pos = BUF_BEGV (buf);
-      if (pos >= BUF_ZV (buf))
-       pos = BUF_ZV (buf) - 1;
-      if (pos < BUF_BEGV (buf))
+      if (pos < BUF_BEGV (b))
+       pos = BUF_BEGV (b);
+      if (pos >= BUF_ZV (b))
+       pos = BUF_ZV (b) - 1;
+      if (pos < BUF_BEGV (b))
        /* no more characters in buffer! */
        return;
       /*
@@ -2979,7 +2829,7 @@ buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch,
        * insertion, which we must do if the deletion moved point
        * backward so that it now equals the insertion point.
        */
-      buffer_insert_string_1 (buf, (movepoint ? -1 : pos),
+      buffer_insert_string_1 (b, (movepoint ? -1 : pos),
                              newstr, Qnil, 0, newlen, 0);
     }
 }
@@ -2992,20 +2842,22 @@ buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch,
 /* Make a string from a buffer.  This needs to take into account the gap,
    and add any necessary extents from the buffer. */
 
-static Lisp_Object
-make_string_from_buffer_1 (struct buffer *buf, Bufpos pos, Charcount length,
-                          int no_extents)
+Lisp_Object
+make_string_from_buffer (struct buffer *buf, Bufpos pos, Charcount length)
 {
   /* This function can GC */
-  Bytind    bi_ind = bufpos_to_bytind (buf, pos);
-  Bytecount bi_len = bufpos_to_bytind (buf, pos + length) - bi_ind;
-  Lisp_Object  val = make_uninit_string (bi_len);
-
+  Lisp_Object val;
   struct gcpro gcpro1;
+  Bytind bi_ind;
+  Bytecount bi_len;
+
+  bi_ind = bufpos_to_bytind (buf, pos);
+  bi_len = bufpos_to_bytind (buf, pos + length) - bi_ind;
+
+  val = make_uninit_string (bi_len);
   GCPRO1 (val);
 
-  if (!no_extents)
-    add_string_extents (val, buf, bi_ind, bi_len);
+  add_string_extents (val, buf, bi_ind, bi_len);
 
   {
     Bytecount len1 = BI_BUF_GPT (buf) - bi_ind;
@@ -3037,19 +2889,6 @@ make_string_from_buffer_1 (struct buffer *buf, Bufpos pos, Charcount length,
   return val;
 }
 
-Lisp_Object
-make_string_from_buffer (struct buffer *buf, Bufpos pos, Charcount length)
-{
-  return make_string_from_buffer_1 (buf, pos, length, 0);
-}
-
-Lisp_Object
-make_string_from_buffer_no_extents (struct buffer *buf, Bufpos pos,
-                                   Charcount length)
-{
-  return make_string_from_buffer_1 (buf, pos, length, 1);
-}
-
 void
 barf_if_buffer_read_only (struct buffer *buf, Bufpos from, Bufpos to)
 {
@@ -3167,7 +3006,7 @@ convert_bufbyte_string_into_emchar_dynarr (CONST Bufbyte *str, Bytecount len,
     }
 }
 
-Charcount
+int
 convert_bufbyte_string_into_emchar_string (CONST Bufbyte *str, Bytecount len,
                                           Emchar *arr)
 {
@@ -3246,9 +3085,9 @@ vars_of_insdel (void)
 }
 
 void
-init_buffer_text (struct buffer *b)
+init_buffer_text (struct buffer *b, int indirect_p)
 {
-  if (!b->base_buffer)
+  if (!indirect_p)
     {
       SET_BUF_GAP_SIZE (b, 20);
       BUFFER_ALLOC (b->text->beg, BUF_GAP_SIZE (b) + BUF_END_SENTINEL_SIZE);
@@ -3276,7 +3115,6 @@ init_buffer_text (struct buffer *b)
          }
       }
 #endif /* MULE */
-      b->text->line_number_cache = Qnil;
 
       BUF_MODIFF (b) = 1;
       BUF_SAVE_MODIFF (b) = 1;
@@ -3307,9 +3145,9 @@ init_buffer_text (struct buffer *b)
 }
 
 void
-uninit_buffer_text (struct buffer *b)
+uninit_buffer_text (struct buffer *b, int indirect_p)
 {
-  if (!b->base_buffer)
+  if (!indirect_p)
     {
       BUFFER_FREE (b->text->beg);
       xfree (b->text->changes);
index 6ca10ef..2ac90c8 100644 (file)
@@ -109,11 +109,10 @@ typedef EMACS_INT Lisp_Object;
 
 #ifdef USE_MINIMAL_TAGBITS
 
-# define Lisp_Type_Int_Bit (Lisp_Type_Int_Even & Lisp_Type_Int_Odd)
 # define XUNMARK(x) DO_NOTHING
 # define make_obj(vartype, x) ((Lisp_Object) (x))
-# define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) | Lisp_Type_Int_Bit))
-# define make_char(x) ((Lisp_Object) (((x) << GCBITS) | Lisp_Type_Char))
+# define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) + 1))
+# define make_char(x) ((Lisp_Object) (((x) << GCBITS) + Lisp_Type_Char))
 # define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS)
 # define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK))
 # define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */
@@ -121,7 +120,8 @@ typedef EMACS_INT Lisp_Object;
 # define GC_EQ(x,y) EQ (x,y)
 # define XREALINT(x) ((x) >> INT_GCBITS)
 # define XUINT(x) ((EMACS_UINT)(x) >> INT_GCBITS)
-# define INTP(x) ((EMACS_UINT)(x) & Lisp_Type_Int_Bit)
+# define INTP(x) ((EMACS_UINT)(x) & 1)
+# define Qzero ((Lisp_Object) 1UL)
 
 #else /* !USE_MINIMAL_TAGBITS */
 
@@ -142,11 +142,11 @@ typedef EMACS_INT Lisp_Object;
 # define XREALINT(x) (((x) << INT_GCBITS) >> INT_GCBITS)
 # define XUINT(x) ((EMACS_UINT) ((x) & VALMASK))
 # define INTP(x) (XTYPE (x) == Lisp_Type_Int)
+# define Qzero ((Lisp_Object) Lisp_Type_Int)
 
 #endif /* !USE_MINIMAL_TAGBITS */
 
-#define Qzero make_int (0)
-#define Qnull_pointer ((Lisp_Object) 0)
+#define Qnull_pointer 0
 #define XGCTYPE(x) XTYPE(x)
 #define EQ(x,y) ((x) == (y))
 #define XSETINT(var,  value) ((void) ((var) = make_int (value)))
index 5a990c3..d8a1f7f 100644 (file)
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA.  */
 #define _XEMACS_LISP_H_
 
 /************************************************************************/
-/*                       general definitions                           */
+/*                        general definitions                           */
 /************************************************************************/
 
 /* We include the following generally useful header files so that you
@@ -181,7 +181,7 @@ void xfree (void *);
 #   define DOESNT_RETURN void volatile
 #   define DECLARE_DOESNT_RETURN(decl) \
            extern void volatile decl __attribute__ ((noreturn))
-#   define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
+#   define DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS(decl,str,idx) \
      /* Should be able to state multiple independent __attribute__s, but  \
         the losing syntax doesn't work that way, and screws losing cpp */ \
            extern void volatile decl \
@@ -189,13 +189,13 @@ void xfree (void *);
 #  else
 #   define DOESNT_RETURN void volatile
 #   define DECLARE_DOESNT_RETURN(decl) extern void volatile decl
-#   define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
+#   define DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS(decl,str,idx) \
            extern void volatile decl PRINTF_ARGS(str,idx)
 #  endif /* GNUC 2.5 */
 # else
 #  define DOESNT_RETURN void
 #  define DECLARE_DOESNT_RETURN(decl) extern void decl
-#  define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
+#  define DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS(decl,str,idx) \
           extern void decl PRINTF_ARGS(str,idx)
 # endif /* GNUC */
 #endif
@@ -215,6 +215,15 @@ void xfree (void *);
 #define ALIGN_PTR(ptr, unit) \
   ((void *) ALIGN_SIZE ((long) (ptr), unit))
 
+#ifdef QUANTIFY
+#include "quantify.h"
+#define QUANTIFY_START_RECORDING quantify_start_recording_data ()
+#define QUANTIFY_STOP_RECORDING  quantify_stop_recording_data  ()
+#else /* !QUANTIFY */
+#define QUANTIFY_START_RECORDING
+#define QUANTIFY_STOP_RECORDING
+#endif /* !QUANTIFY */
+
 #ifndef DO_NOTHING
 #define DO_NOTHING do {} while (0)
 #endif
@@ -251,7 +260,7 @@ DECLARE_DOESNT_RETURN (assert_failed (CONST char *, int, CONST char *));
 
 \f
 /************************************************************************/
-/*                               typedefs                              */
+/*                                typedefs                              */
 /************************************************************************/
 
 /* We put typedefs here so that prototype declarations don't choke.
@@ -324,18 +333,12 @@ typedef struct extent *EXTENT;
 struct frame;                  /* "frame.h" */
 struct window;                  /* "window.h" */
 struct Lisp_Event;              /* "events.h" */
-typedef struct Lisp_Event Lisp_Event;
 struct Lisp_Face;
-typedef struct Lisp_Face Lisp_Face;
 struct Lisp_Process;            /* "process.c" */
-typedef struct Lisp_Process Lisp_Process;
 struct stat;                    /* <sys/stat.h> */
 struct Lisp_Color_Instance;
-typedef struct Lisp_Color_Instance Lisp_Color_Instance;
 struct Lisp_Font_Instance;
-typedef struct Lisp_Font_Instance Lisp_Font_Instance;
 struct Lisp_Image_Instance;
-typedef struct Lisp_Image_Instance Lisp_Image_Instance;
 struct display_line;
 struct redisplay_info;
 struct window_mirror;
@@ -503,7 +506,7 @@ enum munge_me_out_the_door
 
 \f
 /************************************************************************/
-/*                  Definition of Lisp_Object data type                */
+/*                   Definition of Lisp_Object data type                */
 /************************************************************************/
 
 #ifdef USE_MINIMAL_TAGBITS
@@ -521,14 +524,14 @@ enum munge_me_out_the_door
 
 enum Lisp_Type
 {
+  /* Integer.  XINT(obj) is the integer value. */
+  Lisp_Type_Int,
+
   /* XRECORD_LHEADER (object) points to a struct lrecord_header
-     lheader->implementation determines the type (and GC behavior)
+     lheader->implementation determines the type (and GC behaviour)
      of the object. */
   Lisp_Type_Record,
 
-  /* Integer.  XINT(obj) is the integer value. */
-  Lisp_Type_Int,
-
 #ifndef LRECORD_CONS
   /* Cons.  XCONS (object) points to a struct Lisp_Cons. */
   Lisp_Type_Cons,
@@ -571,28 +574,22 @@ enum Lisp_Type
 
 #endif /* USE_MINIMAL_TAGBITS */
 
-/* EMACS_INT is the underlying integral type into which a Lisp_Object must fit.
-   In particular, it must be large enough to contain a pointer.
-   config.h can override this, e.g. to use `long long' for bigger lisp ints. */
-
-#ifndef SIZEOF_EMACS_INT
-# define SIZEOF_EMACS_INT SIZEOF_VOID_P
-#endif
-
-#ifndef EMACS_INT
-# if   SIZEOF_EMACS_INT == SIZEOF_LONG
-#  define EMACS_INT long
-# elif SIZEOF_EMACS_INT == SIZEOF_INT
-#  define EMACS_INT int
-# elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG
-#  define EMACS_INT long long
-# else
-#  error Unable to determine suitable type for EMACS_INT
-# endif
-#endif
-
-#ifndef EMACS_UINT
-# define EMACS_UINT unsigned EMACS_INT
+/* This should be the underlying type into which a Lisp_Object must fit.
+   In a strict ANSI world, this must be `int', since ANSI says you can't
+   use bitfields on any type other than `int'.  However, on a machine
+   where `int' and `long' are not the same size, this should be the
+   longer of the two.  (This also must be something into which a pointer
+   to an arbitrary object will fit, modulo any DATA_SEG_BITS cruft.)
+ */
+/* ### We should be using uintptr_t and SIZEOF_VOID_P here */
+#if (LONGBITS > INTBITS)
+# define EMACS_INT long
+# define EMACS_UINT unsigned long
+# define SIZEOF_EMACS_INT SIZEOF_LONG
+#else
+# define EMACS_INT int
+# define EMACS_UINT unsigned int
+# define SIZEOF_EMACS_INT SIZEOF_INT
 #endif
 
 #define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR)
@@ -672,12 +669,12 @@ int eq_with_ebola_notice (Lisp_Object, Lisp_Object);
 
 \f
 /************************************************************************/
-/*                  Definitions of basic Lisp objects                  */
+/*                   Definitions of basic Lisp objects                  */
 /************************************************************************/
 
 #include "lrecord.h"
 
-/*********** unbound ***********/
+/********** unbound ***********/
 
 /* Qunbound is a special Lisp_Object (actually of type
    symbol-value-forward), that can never be visible to
@@ -698,7 +695,6 @@ struct Lisp_Cons
 #endif
   Lisp_Object car, cdr;
 };
-typedef struct Lisp_Cons Lisp_Cons;
 
 #if 0 /* FSFmacs */
 /* Like a cons, but records info on where the text lives that it was read from */
@@ -714,8 +710,8 @@ struct Lisp_Buffer_Cons
 
 #ifdef LRECORD_CONS
 
-DECLARE_LRECORD (cons, Lisp_Cons);
-#define XCONS(x) XRECORD (x, cons, Lisp_Cons)
+DECLARE_LRECORD (cons, struct Lisp_Cons);
+#define XCONS(x) XRECORD (x, cons, struct Lisp_Cons)
 #define XSETCONS(x, p) XSETRECORD (x, p, cons)
 #define CONSP(x) RECORDP (x, cons)
 #define GC_CONSP(x) GC_RECORDP (x, cons)
@@ -727,8 +723,8 @@ DECLARE_LRECORD (cons, Lisp_Cons);
 
 #else /* ! LRECORD_CONS */
 
-DECLARE_NONRECORD (cons, Lisp_Type_Cons, Lisp_Cons);
-#define XCONS(a) XNONRECORD (a, cons, Lisp_Type_Cons, Lisp_Cons)
+DECLARE_NONRECORD (cons, Lisp_Type_Cons, struct Lisp_Cons);
+#define XCONS(a) XNONRECORD (a, cons, Lisp_Type_Cons, struct Lisp_Cons)
 #define XSETCONS(c, p) XSETOBJ (c, Lisp_Type_Cons, p)
 #define CONSP(x) (XTYPE (x) == Lisp_Type_Cons)
 #define GC_CONSP(x) (XGCTYPE (x) == Lisp_Type_Cons)
@@ -742,8 +738,6 @@ DECLARE_NONRECORD (cons, Lisp_Type_Cons, Lisp_Cons);
 
 #endif /* ! LRECORD_CONS */
 
-extern Lisp_Object Qnil;
-
 #define NILP(x)  EQ (x, Qnil)
 #define GC_NILP(x)  GC_EQ (x, Qnil)
 #define XCAR(a) (XCONS (a)->car)
@@ -762,312 +756,78 @@ extern Lisp_Object Qnil;
 
 /* For a list that's known to be in valid list format --
    will abort() if the list is not in valid format */
-#define LIST_LOOP(tail, list)          \
-  for (tail = list;                    \
-       !NILP (tail);                   \
-       tail = XCDR (tail))
-
-#define LIST_LOOP_2(elt, list)         \
-  Lisp_Object tail##elt;               \
-  LIST_LOOP_3(elt, list, tail##elt)
-
-#define LIST_LOOP_3(elt, list, tail)   \
-  for (tail = list;                    \
-       NILP (tail) ?                   \
-        0 : (elt = XCAR (tail), 1);    \
-       tail = XCDR (tail))
-
-#define GET_LIST_LENGTH(list, len) do {                \
-  Lisp_Object GLL_tail;                                \
-  for (GLL_tail = list, len = 0;               \
-       !NILP (GLL_tail);                       \
-       GLL_tail = XCDR (GLL_tail), ++len)      \
-    DO_NOTHING;                                        \
-} while (0)
-
-#define GET_EXTERNAL_LIST_LENGTH(list, len)            \
-do {                                                   \
-  Lisp_Object GELL_elt, GELL_tail;                     \
-  EXTERNAL_LIST_LOOP_4 (GELL_elt, list, GELL_tail, len)        \
-    ;                                                  \
-} while (0)
+#define LIST_LOOP(consvar, list) \
+  for (consvar = list; !NILP (consvar); consvar = XCDR (consvar))
 
 /* For a list that's known to be in valid list format, where we may
    be deleting the current element out of the list --
    will abort() if the list is not in valid format */
-#define LIST_LOOP_DELETING(consvar, nextconsvar, list)         \
-  for (consvar = list;                                         \
-       !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) :0; \
+#define LIST_LOOP_DELETING(consvar, nextconsvar, list)                 \
+  for (consvar = list;                                                 \
+       !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) : 0;                \
        consvar = nextconsvar)
 
-/* Delete all elements of external list LIST
-   satisfying CONDITION, an expression referring to variable ELT */
-#define EXTERNAL_LIST_LOOP_DELETE_IF(elt, list, condition) do {        \
-  Lisp_Object prev_tail_##list = Qnil;                         \
-  Lisp_Object tail_##list;                                     \
-  int len_##list;                                              \
-  EXTERNAL_LIST_LOOP_4 (elt, list, tail_##list, len_##list)    \
-    {                                                          \
-      if (condition)                                           \
-       {                                                       \
-         if (NILP (prev_tail_##list))                          \
-           list = XCDR (tail_##list);                          \
-         else                                                  \
-           XCDR (prev_tail_##list) = XCDR (tail_##list);       \
-          /* Keep tortoise from ever passing hare. */          \
-         len_##list = 0;                                       \
-       }                                                       \
-      else                                                     \
-       prev_tail_##list = tail_##list;                         \
-    }                                                          \
-} while (0)
-
-/* Delete all elements of true non-circular list LIST
-   satisfying CONDITION, an expression referring to variable ELT */
-#define LIST_LOOP_DELETE_IF(elt, list, condition) do {         \
-  Lisp_Object prev_tail_##list = Qnil;                         \
-  Lisp_Object tail_##list;                                     \
-  LIST_LOOP_3 (elt, list, tail_##list)                         \
-    {                                                          \
-      if (condition)                                           \
-       {                                                       \
-         if (NILP (prev_tail_##list))                          \
-           list = XCDR (tail_##list);                          \
-         else                                                  \
-           XCDR (prev_tail_##list) = XCDR (tail_##list);       \
-       }                                                       \
-      else                                                     \
-       prev_tail_##list = tail_##list;                         \
-    }                                                          \
-} while (0)
-
 /* For a list that may not be in valid list format --
    will signal an error if the list is not in valid format */
-#define EXTERNAL_LIST_LOOP(tail, list)                 \
-  for (tail = list; !NILP (tail); tail = XCDR (tail))  \
-     if (!CONSP (tail))                                        \
-       signal_malformed_list_error (list);             \
+#define EXTERNAL_LIST_LOOP(consvar, listp)                             \
+  for (consvar = listp; !NILP (consvar); consvar = XCDR (consvar))     \
+     if (!CONSP (consvar))                                             \
+       signal_simple_error ("Invalid list format", listp);             \
      else
 
+extern Lisp_Object Qnil;
 
-/* The following macros are for traversing lisp lists.
-   Signal an error if LIST is not properly acyclic and nil-terminated.
-
-   Use tortoise/hare algorithm to check for cycles, but only if it
-   looks like the list is getting too long.  Not only is the hare
-   faster than the tortoise; it even gets a head start! */
-
-/* Optimized and safe macros for looping over external lists.  */
-#define CIRCULAR_LIST_SUSPICION_LENGTH 1024
-
-#define EXTERNAL_LIST_LOOP_1(list)                                     \
-Lisp_Object ELL1_elt, ELL1_hare, ELL1_tortoise;                                \
-int ELL1_len;                                                          \
-EXTERNAL_LIST_LOOP_6(ELL1_elt, list, ELL1_len, ELL1_hare,              \
-                    ELL1_tortoise, CIRCULAR_LIST_SUSPICION_LENGTH)
-
-#define EXTERNAL_LIST_LOOP_2(elt, list)                                        \
-Lisp_Object hare_##elt, tortoise_##elt;                                        \
-int len_##elt;                                                         \
-EXTERNAL_LIST_LOOP_6(elt, list, len_##elt, hare_##elt,                 \
-                    tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
-
-#define EXTERNAL_LIST_LOOP_3(elt, list, tail)                          \
-Lisp_Object tortoise_##elt;                                            \
-int len_##elt;                                                         \
-EXTERNAL_LIST_LOOP_6(elt, list, len_##elt, tail,                       \
-                    tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
-
-#define EXTERNAL_LIST_LOOP_4(elt, list, tail, len)                     \
-Lisp_Object tortoise_##elt;                                            \
-EXTERNAL_LIST_LOOP_6(elt, list, len, tail,                             \
-                    tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
-
-
-#define EXTERNAL_LIST_LOOP_6(elt, list, len, hare,             \
-                             tortoise, suspicion_length)       \
-  for (tortoise = hare = list, len = 0;                                \
-                                                               \
-       (CONSP (hare) ? ((elt = XCAR (hare)), 1) :              \
-       (NILP (hare) ? 0 :                                      \
-        (signal_malformed_list_error (list), 0)));             \
-                                                               \
-       hare = XCDR (hare),                                     \
-        ((++len < suspicion_length) ?                          \
-         ((void) 0) :                                          \
-         (((len & 1) ?                                         \
-           ((void) (tortoise = XCDR (tortoise))) :             \
-           ((void) 0))                                         \
-          ,                                                    \
-          (EQ (hare, tortoise) ?                               \
-           ((void) signal_circular_list_error (list)) :        \
-           ((void) 0)))))
-
-
-
-/* Optimized and safe macros for looping over external alists. */
-#define EXTERNAL_ALIST_LOOP_4(elt, elt_car, elt_cdr, list)             \
-Lisp_Object hare_##elt, tortoise_##elt;                                        \
-int len_##elt;                                                         \
-EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,                    \
-                      len_##elt, hare_##elt, tortoise_##elt,           \
-                      CIRCULAR_LIST_SUSPICION_LENGTH)
-
-#define EXTERNAL_ALIST_LOOP_5(elt, elt_car, elt_cdr, list, tail)       \
-Lisp_Object tortoise_##elt;                                            \
-int len_##elt;                                                         \
-EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list,                     \
-                     len_##elt, tail, tortoise_##elt,                  \
-                     CIRCULAR_LIST_SUSPICION_LENGTH)
-
-#define EXTERNAL_ALIST_LOOP_6(elt, elt_car, elt_cdr, list, tail, len)  \
-Lisp_Object tortoise_##elt;                                            \
-EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list,                     \
-                     len, tail, tortoise_##elt,                        \
-                     CIRCULAR_LIST_SUSPICION_LENGTH)
-
-
-#define EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, len, hare,  \
-                             tortoise, suspicion_length)               \
-EXTERNAL_LIST_LOOP_6(elt, list, len, hare, tortoise, suspicion_length) \
-  if (CONSP (elt) ? (elt_car = XCAR (elt), elt_cdr = XCDR (elt), 0) :1)        \
-    continue;                                                          \
-  else
-
+INLINE int TRUE_LIST_P (Lisp_Object object);
+INLINE int
+TRUE_LIST_P (Lisp_Object object)
+{
+  while (CONSP (object))
+    object = XCDR (object);
+  return NILP (object);
+}
 
-/* Optimized and safe macros for looping over external property lists. */
-#define EXTERNAL_PROPERTY_LIST_LOOP_3(key, value, list)                        \
-Lisp_Object key, value, hare_##key, tortoise_##key;                    \
-int len_##key;                                                         \
-EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len_##key, hare_##key,\
-                    tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
-
-#define EXTERNAL_PROPERTY_LIST_LOOP_4(key, value, list, tail)          \
-Lisp_Object key, value, tail, tortoise_##key;                          \
-int len_##key;                                                         \
-EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len_##key, tail,       \
-                    tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
-
-#define EXTERNAL_PROPERTY_LIST_LOOP_5(key, value, list, tail, len)     \
-Lisp_Object key, value, tail, tortoise_##key;                          \
-int len;                                                               \
-EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len, tail,             \
-                    tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
-
-
-#define EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len, hare,     \
-                             tortoise, suspicion_length)               \
-  for (tortoise = hare = list, len = 0;                                        \
-                                                                       \
-       ((CONSP (hare) &&                                               \
-        (key = XCAR (hare),                                            \
-         hare = XCDR (hare),                                           \
-         CONSP (hare))) ?                                              \
-       (value = XCAR (hare), 1) :                                      \
-       (NILP (hare) ? 0 :                                              \
-        (signal_malformed_property_list_error (list), 0)));            \
-                                                                       \
-       hare = XCDR (hare),                                             \
-        ((++len < suspicion_length) ?                                  \
-         ((void) 0) :                                                  \
-         (((len & 1) ?                                                 \
-           ((void) (tortoise = XCDR (XCDR (tortoise)))) :              \
-           ((void) 0))                                                 \
-          ,                                                            \
-          (EQ (hare, tortoise) ?                                       \
-           ((void) signal_circular_property_list_error (list)) :       \
-           ((void) 0)))))
+#define CHECK_TRUE_LIST(object) do {                   \
+  if (!TRUE_LIST_P (object))                           \
+    dead_wrong_type_argument (Qtrue_list_p, object);   \
+} while (0)
 
 /* For a property list (alternating keywords/values) that may not be
    in valid list format -- will signal an error if the list is not in
    valid format.  CONSVAR is used to keep track of the iterations
-   without modifying PLIST.
+   without modifying LISTP.
 
    We have to be tricky to still keep the same C format.*/
-#define EXTERNAL_PROPERTY_LIST_LOOP(tail, key, value, plist)   \
-  for (tail = plist;                                           \
-       (CONSP (tail) && CONSP (XCDR (tail)) ?                  \
-       (key = XCAR (tail), value = XCAR (XCDR (tail))) :       \
-       (key = Qunbound,    value = Qunbound)),                 \
-       !NILP (tail);                                           \
-       tail = XCDR (XCDR (tail)))                              \
-    if (UNBOUNDP (key))                                                \
-      Fsignal (Qmalformed_property_list, list1 (plist));       \
+#define EXTERNAL_PROPERTY_LIST_LOOP(consvar, keyword, value, listp)    \
+  for (consvar = listp;                                                        \
+       (CONSP (consvar) && CONSP (XCDR (consvar)) ?                    \
+       (keyword = XCAR (consvar), value = XCAR (XCDR (consvar))) :     \
+       (keyword = Qunbound, value = Qunbound)),                        \
+       !NILP (consvar);                                                        \
+       consvar = XCDR (XCDR (consvar)))                                        \
+    if (UNBOUNDP (keyword))                                            \
+      signal_simple_error ("Invalid property list format", listp);     \
     else
 
-#define PROPERTY_LIST_LOOP(tail, key, value, plist)    \
-  for (tail = plist;                                   \
-       NILP (tail) ? 0 :                               \
-        (key   = XCAR (tail), tail = XCDR (tail),      \
-         value = XCAR (tail), tail = XCDR (tail), 1);  \
-       )
-
-/* Return 1 if LIST is properly acyclic and nil-terminated, else 0. */
-INLINE int TRUE_LIST_P (Lisp_Object object);
-INLINE int
-TRUE_LIST_P (Lisp_Object object)
-{
-  Lisp_Object hare, tortoise;
-  int len;
-
-  for (hare = tortoise = object, len = 0;
-       CONSP (hare);
-       hare = XCDR (hare), len++)
-    {
-      if (len < CIRCULAR_LIST_SUSPICION_LENGTH)
-       continue;
-
-      if (len & 1)
-       tortoise = XCDR (tortoise);
-      else if (EQ (hare, tortoise))
-       return 0;
-    }
-
-  return NILP (hare);
-}
-
-/* Signal an error if LIST is not properly acyclic and nil-terminated. */
-#define CHECK_TRUE_LIST(list) do {                     \
-  Lisp_Object CTL_list = (list);                       \
-  Lisp_Object CTL_hare, CTL_tortoise;                  \
-  int CTL_len;                                         \
-                                                       \
-  for (CTL_hare = CTL_tortoise = CTL_list, CTL_len = 0;        \
-       CONSP (CTL_hare);                               \
-       CTL_hare = XCDR (CTL_hare), CTL_len++)          \
-    {                                                  \
-      if (CTL_len < CIRCULAR_LIST_SUSPICION_LENGTH)    \
-       continue;                                       \
-                                                       \
-      if (CTL_len & 1)                                 \
-       CTL_tortoise = XCDR (CTL_tortoise);             \
-      else if (EQ (CTL_hare, CTL_tortoise))            \
-       Fsignal (Qcircular_list, list1 (CTL_list));     \
-    }                                                  \
-                                                       \
-  if (! NILP (CTL_hare))                               \
-    signal_malformed_list_error (CTL_list);            \
-} while (0)
-
 /*********** string ***********/
 
-/* In a string, the markbit of the plist is used as the gc mark bit */
+/* In a string or vector, the sign bit of the `size' is the gc mark bit */
 
+/* (The size and data fields have underscores prepended to catch old
+   code that attempts to reference the fields directly) */
 struct Lisp_String
 {
 #ifdef LRECORD_STRING
   struct lrecord_header lheader;
 #endif
-  Bytecount size;
-  Bufbyte *data;
+  Bytecount _size;
+  Bufbyte *_data;
   Lisp_Object plist;
 };
-typedef struct Lisp_String Lisp_String;
 
 #ifdef LRECORD_STRING
 
-DECLARE_LRECORD (string, Lisp_String);
-#define XSTRING(x) XRECORD (x, string, Lisp_String)
+DECLARE_LRECORD (string, struct Lisp_String);
+#define XSTRING(x) XRECORD (x, string, struct Lisp_String)
 #define XSETSTRING(x, p) XSETRECORD (x, p, string)
 #define STRINGP(x) RECORDP (x, string)
 #define GC_STRINGP(x) GC_RECORDP (x, string)
@@ -1076,8 +836,8 @@ DECLARE_LRECORD (string, Lisp_String);
 
 #else /* ! LRECORD_STRING */
 
-DECLARE_NONRECORD (string, Lisp_Type_String, Lisp_String);
-#define XSTRING(x) XNONRECORD (x, string, Lisp_Type_String, Lisp_String)
+DECLARE_NONRECORD (string, Lisp_Type_String, struct Lisp_String);
+#define XSTRING(x) XNONRECORD (x, string, Lisp_Type_String, struct Lisp_String)
 #define XSETSTRING(x, p) XSETOBJ (x, Lisp_Type_String, p)
 #define STRINGP(x) (XTYPE (x) == Lisp_Type_String)
 #define GC_STRINGP(x) (XGCTYPE (x) == Lisp_Type_String)
@@ -1098,32 +858,32 @@ Bytecount charcount_to_bytecount (CONST Bufbyte *ptr, Charcount len);
 
 #endif /* not MULE */
 
-#define string_length(s) ((s)->size)
+#define string_length(s) ((s)->_size)
 #define XSTRING_LENGTH(s) string_length (XSTRING (s))
 #define XSTRING_CHAR_LENGTH(s) string_char_length (XSTRING (s))
-#define string_data(s) ((s)->data + 0)
+#define string_data(s) ((s)->_data + 0)
 #define XSTRING_DATA(s) string_data (XSTRING (s))
-#define string_byte(s, i) ((s)->data[i] + 0)
+#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 set_string_length(s, len) ((void) ((s)->size = (len)))
-#define set_string_data(s, ptr) ((void) ((s)->data = (ptr)))
-#define set_string_byte(s, i, c) ((void) ((s)->data[i] = (c)))
+#define string_byte_addr(s, i) (&((s)->_data[i]))
+#define set_string_length(s, len) ((void) ((s)->_size = (len)))
+#define set_string_data(s, ptr) ((void) ((s)->_data = (ptr)))
+#define set_string_byte(s, i, c) ((void) ((s)->_data[i] = (c)))
 
-void resize_string (Lisp_String *s, Bytecount pos, Bytecount delta);
+void resize_string (struct Lisp_String *s, Bytecount pos, Bytecount delta);
 
 #ifdef MULE
 
-INLINE Charcount string_char_length (Lisp_String *s);
+INLINE Charcount string_char_length (struct Lisp_String *s);
 INLINE Charcount
-string_char_length (Lisp_String *s)
+string_char_length (struct Lisp_String *s)
 {
   return bytecount_to_charcount (string_data (s), string_length (s));
 }
 
 # define string_char(s, i) charptr_emchar_n (string_data (s), i)
 # define string_char_addr(s, i) charptr_n_addr (string_data (s), i)
-void set_string_char (Lisp_String *s, Charcount i, Emchar c);
+void set_string_char (struct Lisp_String *s, Charcount i, Emchar c);
 
 #else /* not MULE */
 
@@ -1147,12 +907,11 @@ struct Lisp_Vector
   /* struct Lisp_Vector *next; */
   Lisp_Object contents[1];
 };
-typedef struct Lisp_Vector Lisp_Vector;
 
 #ifdef LRECORD_VECTOR
 
-DECLARE_LRECORD (vector, Lisp_Vector);
-#define XVECTOR(x) XRECORD (x, vector, Lisp_Vector)
+DECLARE_LRECORD (vector, struct Lisp_Vector);
+#define XVECTOR(x) XRECORD (x, vector, struct Lisp_Vector)
 #define XSETVECTOR(x, p) XSETRECORD (x, p, vector)
 #define VECTORP(x) RECORDP (x, vector)
 #define GC_VECTORP(x) GC_RECORDP (x, vector)
@@ -1161,8 +920,8 @@ DECLARE_LRECORD (vector, Lisp_Vector);
 
 #else
 
-DECLARE_NONRECORD (vector, Lisp_Type_Vector, Lisp_Vector);
-#define XVECTOR(x) XNONRECORD (x, vector, Lisp_Type_Vector, Lisp_Vector)
+DECLARE_NONRECORD (vector, Lisp_Type_Vector, struct Lisp_Vector);
+#define XVECTOR(x) XNONRECORD (x, vector, Lisp_Type_Vector, struct Lisp_Vector)
 #define XSETVECTOR(x, p) XSETOBJ (x, Lisp_Type_Vector, p)
 #define VECTORP(x) (XTYPE (x) == Lisp_Type_Vector)
 #define GC_VECTORP(x) (XGCTYPE (x) == Lisp_Type_Vector)
@@ -1200,13 +959,12 @@ struct Lisp_Bit_Vector
 {
   struct lrecord_header lheader;
   Lisp_Object next;
-  size_t size;
-  unsigned long bits[1];
+  long size;
+  unsigned int bits[1];
 };
-typedef struct Lisp_Bit_Vector Lisp_Bit_Vector;
 
-DECLARE_LRECORD (bit_vector, Lisp_Bit_Vector);
-#define XBIT_VECTOR(x) XRECORD (x, bit_vector, Lisp_Bit_Vector)
+DECLARE_LRECORD (bit_vector, struct Lisp_Bit_Vector);
+#define XBIT_VECTOR(x) XRECORD (x, bit_vector, struct Lisp_Bit_Vector)
 #define XSETBIT_VECTOR(x, p) XSETRECORD (x, p, bit_vector)
 #define BIT_VECTORP(x) RECORDP (x, bit_vector)
 #define GC_BIT_VECTORP(x) GC_RECORDP (x, bit_vector)
@@ -1229,9 +987,9 @@ DECLARE_LRECORD (bit_vector, Lisp_Bit_Vector);
 #define bit_vector_length(v) ((v)->size)
 #define bit_vector_next(v) ((v)->next)
 
-INLINE int bit_vector_bit (Lisp_Bit_Vector *v, int i);
+INLINE int bit_vector_bit (struct Lisp_Bit_Vector *v, int i);
 INLINE int
-bit_vector_bit (Lisp_Bit_Vector *v, int i)
+bit_vector_bit (struct Lisp_Bit_Vector *v, int i)
 {
   unsigned int ui = (unsigned int) i;
 
@@ -1239,15 +997,15 @@ bit_vector_bit (Lisp_Bit_Vector *v, int i)
          & 1);
 }
 
-INLINE void set_bit_vector_bit (Lisp_Bit_Vector *v, int i, int value);
+INLINE void set_bit_vector_bit (struct Lisp_Bit_Vector *v, int i, int value);
 INLINE void
-set_bit_vector_bit (Lisp_Bit_Vector *v, int i, int value)
+set_bit_vector_bit (struct Lisp_Bit_Vector *v, int i, int value)
 {
   unsigned int ui = (unsigned int) i;
   if (value)
-    (v)->bits[ui >> LONGBITS_LOG2] |= (1U << (ui & (LONGBITS_POWER_OF_2 - 1)));
+    (v)->bits[ui >> LONGBITS_LOG2] |= (1 << (ui & (LONGBITS_POWER_OF_2 - 1)));
   else
-    (v)->bits[ui >> LONGBITS_LOG2] &= ~(1U << (ui & (LONGBITS_POWER_OF_2 - 1)));
+    (v)->bits[ui >> LONGBITS_LOG2] &= ~(1 << (ui & (LONGBITS_POWER_OF_2 - 1)));
 }
 
 /* Number of longs required to hold LEN bits */
@@ -1273,15 +1031,14 @@ struct Lisp_Symbol
   Lisp_Object obarray;
   Lisp_Object plist;
 };
-typedef struct Lisp_Symbol Lisp_Symbol;
 
 #define SYMBOL_IS_KEYWORD(sym) (string_byte (XSYMBOL(sym)->name, 0) == ':')
 #define KEYWORDP(obj) (SYMBOLP (obj) && SYMBOL_IS_KEYWORD (obj))
 
 #ifdef LRECORD_SYMBOL
 
-DECLARE_LRECORD (symbol, Lisp_Symbol);
-#define XSYMBOL(x) XRECORD (x, symbol, Lisp_Symbol)
+DECLARE_LRECORD (symbol, struct Lisp_Symbol);
+#define XSYMBOL(x) XRECORD (x, symbol, struct Lisp_Symbol)
 #define XSETSYMBOL(x, p) XSETRECORD (x, p, symbol)
 #define SYMBOLP(x) RECORDP (x, symbol)
 #define GC_SYMBOLP(x) GC_RECORDP (x, symbol)
@@ -1290,8 +1047,8 @@ DECLARE_LRECORD (symbol, Lisp_Symbol);
 
 #else
 
-DECLARE_NONRECORD (symbol, Lisp_Type_Symbol, Lisp_Symbol);
-#define XSYMBOL(x) XNONRECORD (x, symbol, Lisp_Type_Symbol, Lisp_Symbol)
+DECLARE_NONRECORD (symbol, Lisp_Type_Symbol, struct Lisp_Symbol);
+#define XSYMBOL(x) XNONRECORD (x, symbol, Lisp_Type_Symbol, struct Lisp_Symbol)
 #define XSETSYMBOL(s, p) XSETOBJ ((s), Lisp_Type_Symbol, (p))
 #define SYMBOLP(x) (XTYPE (x) == Lisp_Type_Symbol)
 #define GC_SYMBOLP(x) (XGCTYPE (x) == Lisp_Type_Symbol)
@@ -1319,10 +1076,9 @@ struct Lisp_Subr
   CONST char *name;
   lisp_fn_t subr_fn;
 };
-typedef struct Lisp_Subr Lisp_Subr;
 
-DECLARE_LRECORD (subr, Lisp_Subr);
-#define XSUBR(x) XRECORD (x, subr, Lisp_Subr)
+DECLARE_LRECORD (subr, struct Lisp_Subr);
+#define XSUBR(x) XRECORD (x, subr, struct Lisp_Subr)
 #define XSETSUBR(x, p) XSETRECORD (x, p, subr)
 #define SUBRP(x) RECORDP (x, subr)
 #define GC_SUBRP(x) GC_RECORDP (x, subr)
@@ -1342,10 +1098,9 @@ struct Lisp_Marker
   Memind memind;
   char insertion_type;
 };
-typedef struct Lisp_Marker Lisp_Marker;
 
-DECLARE_LRECORD (marker, Lisp_Marker);
-#define XMARKER(x) XRECORD (x, marker, Lisp_Marker)
+DECLARE_LRECORD (marker, struct Lisp_Marker);
+#define XMARKER(x) XRECORD (x, marker, struct Lisp_Marker)
 #define XSETMARKER(x, p) XSETRECORD (x, p, marker)
 #define MARKERP(x) RECORDP (x, marker)
 #define GC_MARKERP(x) GC_RECORDP (x, marker)
@@ -1387,7 +1142,7 @@ XCHAR (Lisp_Object obj)
 
 #ifdef LISP_FLOAT_TYPE
 
-/* Note: the 'unused_next_' field exists only to ensure that the
+/* Note: the 'unused__next__' field exists only to ensure that the
    `next' pointer fits within the structure, for the purposes of the
    free list.  This makes a difference in the unlikely case of
    sizeof(double) being smaller than sizeof(void *). */
@@ -1395,12 +1150,11 @@ XCHAR (Lisp_Object obj)
 struct Lisp_Float
 {
   struct lrecord_header lheader;
-  union { double d; struct Lisp_Float *unused_next_; } data;
+  union { double d; struct Lisp_Float *unused__next__; } data;
 };
-typedef struct Lisp_Float Lisp_Float;
 
-DECLARE_LRECORD (float, Lisp_Float);
-#define XFLOAT(x) XRECORD (x, float, Lisp_Float)
+DECLARE_LRECORD (float, struct Lisp_Float);
+#define XFLOAT(x) XRECORD (x, float, struct Lisp_Float)
 #define XSETFLOAT(x, p) XSETRECORD (x, p, float)
 #define FLOATP(x) RECORDP (x, float)
 #define GC_FLOATP(x) GC_RECORDP (x, float)
@@ -1408,7 +1162,6 @@ DECLARE_LRECORD (float, Lisp_Float);
 #define CONCHECK_FLOAT(x) CONCHECK_RECORD (x, float)
 
 #define float_data(f) ((f)->data.d)
-#define XFLOAT_DATA(x) float_data (XFLOAT (x))
 
 #define XFLOATINT(n) extract_float (n)
 
@@ -1422,6 +1175,29 @@ DECLARE_LRECORD (float, Lisp_Float);
     x = wrong_type_argument (Qnumberp, x);     \
 } while (0)
 
+/* These are always continuable because they change their arguments
+   even when no error is signalled. */
+
+#define CHECK_INT_OR_FLOAT_COERCE_MARKER(x) do {       \
+  if (INT_OR_FLOATP (x))                               \
+    ;                                                  \
+  else if (MARKERP (x))                                        \
+    x = make_int (marker_position (x));                        \
+  else                                                 \
+    x = wrong_type_argument (Qnumber_or_marker_p, x);  \
+} while (0)
+
+#define CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER(x) do {       \
+  if (INT_OR_FLOATP (x))                                       \
+    ;                                                          \
+  else if (CHARP (x))                                          \
+    x = make_int (XCHAR (x));                                  \
+  else if (MARKERP (x))                                                \
+    x = make_int (marker_position (x));                                \
+  else                                                         \
+    x = wrong_type_argument (Qnumber_char_or_marker_p, x);     \
+} while (0)
+
 # define INT_OR_FLOATP(x) (INTP (x) || FLOATP (x))
 # define GC_INT_OR_FLOATP(x) (GC_INTP (x) || GC_FLOATP (x))
 
@@ -1437,6 +1213,9 @@ DECLARE_LRECORD (float, Lisp_Float);
 #define XFLOATINT(n) XINT(n)
 #define CHECK_INT_OR_FLOAT CHECK_INT
 #define CONCHECK_INT_OR_FLOAT CONCHECK_INT
+#define CHECK_INT_OR_FLOAT_COERCE_MARKER CHECK_INT_COERCE_MARKER
+#define CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER \
+     CHECK_INT_COERCE_CHAR_OR_MARKER
 #define INT_OR_FLOATP(x) (INTP (x))
 # define GC_INT_OR_FLOATP(x) (GC_INTP (x))
 
@@ -1527,7 +1306,6 @@ XCHAR_OR_INT (Lisp_Object obj)
     x = wrong_type_argument (Qinteger_char_or_marker_p, x);    \
 } while (0)
 
-
 /*********** pure space ***********/
 
 #define CHECK_IMPURE(obj)                                      \
@@ -1641,7 +1419,7 @@ void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord);
 
 \f
 /************************************************************************/
-/*        Definitions of primitive Lisp functions and variables        */
+/*         Definitions of primitive Lisp functions and variables        */
 /************************************************************************/
 
 
@@ -1652,8 +1430,8 @@ void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord);
     valid in a C identifier, with an "F" prepended.
     The name of the C constant structure that records information
     on this function for internal use is "S" concatenated with Fname.
- `min_args' should be a number, the minimum number of arguments allowed.
- `max_args' should be a number, the maximum number of arguments allowed,
+ `minargs' should be a number, the minimum number of arguments allowed.
+ `maxargs' should be a number, the maximum number of arguments allowed,
     or else MANY or UNEVALLED.
     MANY means pass a vector of evaluated arguments,
         in the form of an integer number-of-arguments
@@ -1684,7 +1462,7 @@ Lisp_Object,Lisp_Object
 Lisp_Object,Lisp_Object,Lisp_Object
 #define EXFUN_MANY int, Lisp_Object*
 #define EXFUN_UNEVALLED Lisp_Object
-#define EXFUN(sym, max_args) Lisp_Object sym (EXFUN_##max_args)
+#define EXFUN(sym, maxargs) Lisp_Object sym (EXFUN_##maxargs)
 
 #define SUBR_MAX_ARGS 8
 #define MANY -2
@@ -1699,14 +1477,14 @@ Lisp_Object,Lisp_Object,Lisp_Object
 # define subr_lheader_initializer { lrecord_subr }
 #endif
 
-#define DEFUN(lname, Fname, min_args, max_args, prompt, arglist)       \
-  Lisp_Object Fname (EXFUN_##max_args);                                        \
+#define DEFUN(lname, Fname, minargs, maxargs, prompt, arglist)         \
+  Lisp_Object Fname (EXFUN_##maxargs);                                 \
   static struct Lisp_Subr S##Fname = { subr_lheader_initializer,       \
-       min_args, max_args, prompt, 0, lname, (lisp_fn_t) Fname };      \
-  Lisp_Object Fname (DEFUN_##max_args arglist)
+       minargs, maxargs, prompt, 0, lname, (lisp_fn_t) Fname };        \
+  Lisp_Object Fname (DEFUN_##maxargs arglist)
 
 /* Heavy ANSI C preprocessor hackery to get DEFUN to declare a
-   prototype that matches max_args, and add the obligatory
+   prototype that matches maxargs, and add the obligatory
    `Lisp_Object' type declaration to the formal C arguments.  */
 
 #define DEFUN_MANY(named_int, named_Lisp_Object) named_int, named_Lisp_Object
@@ -1721,27 +1499,18 @@ Lisp_Object,Lisp_Object,Lisp_Object
 #define DEFUN_7(a,b,c,d,e,f,g)  DEFUN_6(a,b,c,d,e,f),  Lisp_Object g
 #define DEFUN_8(a,b,c,d,e,f,g,h) DEFUN_7(a,b,c,d,e,f,g),Lisp_Object h
 
-/* WARNING: If you add defines here for higher values of max_args,
-   make sure to also fix the clauses in PRIMITIVE_FUNCALL(),
+/* WARNING: If you add defines here for higher values of maxargs,
+   make sure to also fix the clauses in inline_funcall_fn(),
    and change the define of SUBR_MAX_ARGS above.  */
 
 #include "symeval.h"
 
-/* `specpdl' is the special binding/unwind-protect stack.
-
-   Knuth says (see the Jargon File):
-   At MIT, `pdl' [abbreviation for `Push Down List'] used to
-   be a more common synonym for `stack'.
-   Everywhere else `stack' seems to be the preferred term.
-
-   specpdl_depth is the current depth of `specpdl'.
-   Save this for use later as arg to `unbind_to'.  */
-extern int specpdl_depth_counter;
-#define specpdl_depth() specpdl_depth_counter
+/* Depth of special binding/unwind-protect stack.  Use as arg to `unbind_to' */
+int specpdl_depth (void);
 
 \f
 /************************************************************************/
-/*                        Checking for QUIT                            */
+/*                         Checking for QUIT                            */
 /************************************************************************/
 
 /* Asynchronous events set something_happened, and then are processed
@@ -1785,7 +1554,7 @@ void signal_quit (void);
 
 \f
 /************************************************************************/
-/*                              hashing                                */
+/*                               hashing                                */
 /************************************************************************/
 
 /* #### for a 64-bit machine, we should substitute a prime just over 2^32 */
@@ -1799,6 +1568,8 @@ void signal_quit (void);
 #define HASH8(a,b,c,d,e,f,g,h)   (GOOD_HASH * HASH7 (a,b,c,d,e,f,g)   + (h))
 #define HASH9(a,b,c,d,e,f,g,h,i) (GOOD_HASH * HASH8 (a,b,c,d,e,f,g,h) + (i))
 
+/* Enough already! */
+
 #define LISP_HASH(obj) ((unsigned long) LISP_TO_VOID (obj))
 unsigned long string_hash (CONST void *xv);
 unsigned long memory_hash (CONST void *xv, size_t size);
@@ -1807,7 +1578,7 @@ unsigned long internal_array_hash (Lisp_Object *arr, int size, int depth);
 
 \f
 /************************************************************************/
-/*                      String translation                             */
+/*                       String translation                             */
 /************************************************************************/
 
 #ifdef I18N3
@@ -1835,7 +1606,7 @@ char *bindtextdomain (CONST char *, CONST char *);
 
 \f
 /************************************************************************/
-/*                  Garbage collection / GC-protection                 */
+/*                   Garbage collection / GC-protection                 */
 /************************************************************************/
 
 /* number of bytes of structure consed since last GC */
@@ -1937,104 +1708,101 @@ void debug_ungcpro(char *, int, struct gcpro *);
 
 #else /* ! DEBUG_GCPRO */
 
-#define GCPRO1(var1) ((void) (                                         \
-  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
-  gcprolist = &gcpro1 ))
-
-#define GCPRO2(var1, var2) ((void) (                                   \
-  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
-  gcpro2.next = &gcpro1,   gcpro2.var = &var2, gcpro2.nvars = 1,       \
-  gcprolist = &gcpro2 ))
-
-#define GCPRO3(var1, var2, var3) ((void) (                             \
-  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
-  gcpro2.next = &gcpro1,   gcpro2.var = &var2, gcpro2.nvars = 1,       \
-  gcpro3.next = &gcpro2,   gcpro3.var = &var3, gcpro3.nvars = 1,       \
-  gcprolist = &gcpro3 ))
-
-#define GCPRO4(var1, var2, var3, var4) ((void) (                       \
-  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
-  gcpro2.next = &gcpro1,   gcpro2.var = &var2, gcpro2.nvars = 1,       \
-  gcpro3.next = &gcpro2,   gcpro3.var = &var3, gcpro3.nvars = 1,       \
-  gcpro4.next = &gcpro3,   gcpro4.var = &var4, gcpro4.nvars = 1,       \
-  gcprolist = &gcpro4 ))
-
-#define GCPRO5(var1, var2, var3, var4, var5)                           \
-  ((void) (                                                            \
-  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
-  gcpro2.next = &gcpro1,   gcpro2.var = &var2, gcpro2.nvars = 1,       \
-  gcpro3.next = &gcpro2,   gcpro3.var = &var3, gcpro3.nvars = 1,       \
-  gcpro4.next = &gcpro3,   gcpro4.var = &var4, gcpro4.nvars = 1,       \
-  gcpro5.next = &gcpro4,   gcpro5.var = &var5, gcpro5.nvars = 1,       \
-  gcprolist = &gcpro5 ))
-
-#define UNGCPRO ((void) (gcprolist = gcpro1.next))
-
-#define NGCPRO1(var1) ((void) (                                                \
-  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
-  gcprolist = &ngcpro1 ))
-
-#define NGCPRO2(var1, var2) ((void) (                                  \
-  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
-  ngcpro2.next = &ngcpro1,  ngcpro2.var = &var2, ngcpro2.nvars = 1,    \
-  gcprolist = &ngcpro2 ))
-
-#define NGCPRO3(var1, var2, var3) ((void) (                            \
-  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
-  ngcpro2.next = &ngcpro1,  ngcpro2.var = &var2, ngcpro2.nvars = 1,    \
-  ngcpro3.next = &ngcpro2,  ngcpro3.var = &var3, ngcpro3.nvars = 1,    \
-  gcprolist = &ngcpro3 ))
-
-#define NGCPRO4(var1, var2, var3, var4) ((void) (                      \
-  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
-  ngcpro2.next = &ngcpro1,  ngcpro2.var = &var2, ngcpro2.nvars = 1,    \
-  ngcpro3.next = &ngcpro2,  ngcpro3.var = &var3, ngcpro3.nvars = 1,    \
-  ngcpro4.next = &ngcpro3,  ngcpro4.var = &var4, ngcpro4.nvars = 1,    \
-  gcprolist = &ngcpro4 ))
-
-#define NGCPRO5(var1, var2, var3, var4, var5)                          \
-  ((void) (                                                            \
-  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
-  ngcpro2.next = &ngcpro1,  ngcpro2.var = &var2, ngcpro2.nvars = 1,    \
-  ngcpro3.next = &ngcpro2,  ngcpro3.var = &var3, ngcpro3.nvars = 1,    \
-  ngcpro4.next = &ngcpro3,  ngcpro4.var = &var4, ngcpro4.nvars = 1,    \
-  ngcpro5.next = &ngcpro4,  ngcpro5.var = &var5, ngcpro5.nvars = 1,    \
-  gcprolist = &ngcpro5 ))
-
-#define NUNGCPRO ((void) (gcprolist = ngcpro1.next))
-
-#define NNGCPRO1(var1) ((void) (                                       \
-  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
-  gcprolist = &nngcpro1 ))
-
-#define NNGCPRO2(var1, var2) ((void) (                                 \
-  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
-  nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
-  gcprolist = &nngcpro2 ))
-
-#define NNGCPRO3(var1, var2, var3) ((void) (                           \
-  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
-  nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
-  nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
-  gcprolist = &nngcpro3 ))
-
-#define NNGCPRO4(var1, var2, var3, var4)  ((void) (                    \
-  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
-  nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
-  nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
-  nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \
-  gcprolist = &nngcpro4 ))
-
-#define NNGCPRO5(var1, var2, var3, var4, var5)                         \
-  ((void) (                                                            \
-  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
-  nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
-  nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
-  nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \
-  nngcpro5.next = &nngcpro4, nngcpro5.var = &var5, nngcpro5.nvars = 1, \
-  gcprolist = &nngcpro5 ))
-
-#define NNUNGCPRO ((void) (gcprolist = nngcpro1.next))
+#define GCPRO1(varname) \
+ {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \
+  gcprolist = &gcpro1; }
+
+#define GCPRO2(varname1, varname2) \
+ {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
+  gcpro2.next = &gcpro1;   gcpro2.var = &varname2; gcpro2.nvars = 1; \
+  gcprolist = &gcpro2; }
+
+#define GCPRO3(varname1, varname2, varname3) \
+ {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
+  gcpro2.next = &gcpro1;   gcpro2.var = &varname2; gcpro2.nvars = 1; \
+  gcpro3.next = &gcpro2;   gcpro3.var = &varname3; gcpro3.nvars = 1; \
+  gcprolist = &gcpro3; }
+
+#define GCPRO4(varname1, varname2, varname3, varname4) \
+ {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
+  gcpro2.next = &gcpro1;   gcpro2.var = &varname2; gcpro2.nvars = 1; \
+  gcpro3.next = &gcpro2;   gcpro3.var = &varname3; gcpro3.nvars = 1; \
+  gcpro4.next = &gcpro3;   gcpro4.var = &varname4; gcpro4.nvars = 1; \
+  gcprolist = &gcpro4; }
+
+#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
+ {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
+  gcpro2.next = &gcpro1;   gcpro2.var = &varname2; gcpro2.nvars = 1; \
+  gcpro3.next = &gcpro2;   gcpro3.var = &varname3; gcpro3.nvars = 1; \
+  gcpro4.next = &gcpro3;   gcpro4.var = &varname4; gcpro4.nvars = 1; \
+  gcpro5.next = &gcpro4;   gcpro5.var = &varname5; gcpro5.nvars = 1; \
+  gcprolist = &gcpro5; }
+
+#define UNGCPRO (gcprolist = gcpro1.next)
+
+#define NGCPRO1(varname) \
+ {ngcpro1.next = gcprolist; ngcpro1.var = &varname; ngcpro1.nvars = 1; \
+  gcprolist = &ngcpro1; }
+
+#define NGCPRO2(varname1, varname2) \
+ {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \
+  ngcpro2.next = &ngcpro1;  ngcpro2.var = &varname2; ngcpro2.nvars = 1; \
+  gcprolist = &ngcpro2; }
+
+#define NGCPRO3(varname1, varname2, varname3) \
+ {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \
+  ngcpro2.next = &ngcpro1;  ngcpro2.var = &varname2; ngcpro2.nvars = 1; \
+  ngcpro3.next = &ngcpro2;  ngcpro3.var = &varname3; ngcpro3.nvars = 1; \
+  gcprolist = &ngcpro3; }
+
+#define NGCPRO4(varname1, varname2, varname3, varname4) \
+ {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \
+  ngcpro2.next = &ngcpro1;  ngcpro2.var = &varname2; ngcpro2.nvars = 1; \
+  ngcpro3.next = &ngcpro2;  ngcpro3.var = &varname3; ngcpro3.nvars = 1; \
+  ngcpro4.next = &ngcpro3;  ngcpro4.var = &varname4; ngcpro4.nvars = 1; \
+  gcprolist = &ngcpro4; }
+
+#define NGCPRO5(varname1, varname2, varname3, varname4, varname5) \
+ {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \
+  ngcpro2.next = &ngcpro1;  ngcpro2.var = &varname2; ngcpro2.nvars = 1; \
+  ngcpro3.next = &ngcpro2;  ngcpro3.var = &varname3; ngcpro3.nvars = 1; \
+  ngcpro4.next = &ngcpro3;  ngcpro4.var = &varname4; ngcpro4.nvars = 1; \
+  ngcpro5.next = &ngcpro4;  ngcpro5.var = &varname5; ngcpro5.nvars = 1; \
+  gcprolist = &ngcpro5; }
+
+#define NUNGCPRO (gcprolist = ngcpro1.next)
+
+#define NNGCPRO1(varname) \
+ {nngcpro1.next = gcprolist; nngcpro1.var = &varname; nngcpro1.nvars = 1; \
+  gcprolist = &nngcpro1; }
+
+#define NNGCPRO2(varname1, varname2) \
+ {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \
+  nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \
+  gcprolist = &nngcpro2; }
+
+#define NNGCPRO3(varname1, varname2, varname3) \
+ {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \
+  nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \
+  nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \
+  gcprolist = &nngcpro3; }
+
+#define NNGCPRO4(varname1, varname2, varname3, varname4) \
+ {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \
+  nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \
+  nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \
+  nngcpro4.next = &nngcpro3; nngcpro4.var = &varname4; nngcpro4.nvars = 1; \
+  gcprolist = &nngcpro4; }
+
+#define NNGCPRO5(varname1, varname2, varname3, varname4, varname5) \
+ {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \
+  nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \
+  nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \
+  nngcpro4.next = &nngcpro3; nngcpro4.var = &varname4; nngcpro4.nvars = 1; \
+  nngcpro5.next = &nngcpro4; nngcpro5.var = &varname5; nngcpro5.nvars = 1; \
+  gcprolist = &nngcpro5; }
+
+#define NNUNGCPRO (gcprolist = nngcpro1.next)
 
 #endif /* ! DEBUG_GCPRO */
 
@@ -2042,10 +1810,10 @@ void debug_ungcpro(char *, int, struct gcpro *);
 /* "end-of-loop code not reached" */
 /* "statement not reached */
 #ifdef __SUNPRO_C
-#define RETURN_SANS_WARNINGS if (1) return
+#define RETURN__ if (1) return
 #define RETURN_NOT_REACHED(value)
 #else
-#define RETURN_SANS_WARNINGS return
+#define RETURN__ return
 #define RETURN_NOT_REACHED(value) return value;
 #endif
 
@@ -2054,7 +1822,7 @@ void debug_ungcpro(char *, int, struct gcpro *);
 {                                      \
   Lisp_Object ret_ungc_val = (expr);   \
   UNGCPRO;                             \
-  RETURN_SANS_WARNINGS ret_ungc_val;   \
+  RETURN__ ret_ungc_val;               \
 } while (0)
 
 /* Evaluate expr, NUNGCPRO, UNGCPRO, and then return the value of expr.  */
@@ -2063,7 +1831,7 @@ void debug_ungcpro(char *, int, struct gcpro *);
   Lisp_Object ret_ungc_val = (expr);   \
   NUNGCPRO;                            \
   UNGCPRO;                             \
-  RETURN_SANS_WARNINGS ret_ungc_val;   \
+  RETURN__ ret_ungc_val;               \
 } while (0)
 
 /* Evaluate expr, NNUNGCPRO, NUNGCPRO, UNGCPRO, and then return the
@@ -2074,7 +1842,7 @@ void debug_ungcpro(char *, int, struct gcpro *);
   NNUNGCPRO;                           \
   NUNGCPRO;                            \
   UNGCPRO;                             \
-  RETURN_SANS_WARNINGS ret_ungc_val;   \
+  RETURN__ ret_ungc_val;               \
 } while (0)
 
 /* Evaluate expr, return it if it's not Qunbound. */
@@ -2082,7 +1850,7 @@ void debug_ungcpro(char *, int, struct gcpro *);
 {                                      \
   Lisp_Object ret_nunb_val = (expr);   \
   if (!UNBOUNDP (ret_nunb_val))                \
-    RETURN_SANS_WARNINGS ret_nunb_val; \
+    RETURN__ ret_nunb_val;             \
 } while (0)
 
 /* Call staticpro (&var) to protect static variable `var'. */
@@ -2127,17 +1895,17 @@ struct overhead_stats
 #define DIRECTORY_SEP '/'
 #endif
 #ifndef IS_DIRECTORY_SEP
-#define IS_DIRECTORY_SEP(c) ((c) == DIRECTORY_SEP)
+#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
 #endif
 #ifndef IS_DEVICE_SEP
 #ifndef DEVICE_SEP
-#define IS_DEVICE_SEP(c) 0
+#define IS_DEVICE_SEP(_c_) 0
 #else
-#define IS_DEVICE_SEP(c) ((c) == DEVICE_SEP)
+#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP)
 #endif
 #endif
 #ifndef IS_ANY_SEP
-#define IS_ANY_SEP(c) (IS_DIRECTORY_SEP (c))
+#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
 #endif
 
 #ifdef HAVE_INTTYPES_H
@@ -2160,12 +1928,12 @@ typedef unsigned long uintptr_t;
 /* Defined in alloc.c */
 void release_breathing_space (void);
 Lisp_Object noseeum_cons (Lisp_Object, Lisp_Object);
-Lisp_Object make_vector (size_t, Lisp_Object);
+Lisp_Object make_vector (EMACS_INT, Lisp_Object);
 Lisp_Object vector1 (Lisp_Object);
 Lisp_Object vector2 (Lisp_Object, Lisp_Object);
 Lisp_Object vector3 (Lisp_Object, Lisp_Object, Lisp_Object);
-Lisp_Object make_bit_vector (size_t, Lisp_Object);
-Lisp_Object make_bit_vector_from_byte_vector (unsigned char *, size_t);
+Lisp_Object make_bit_vector (EMACS_INT, Lisp_Object);
+Lisp_Object make_bit_vector_from_byte_vector (unsigned char *, EMACS_INT);
 Lisp_Object noseeum_make_marker (void);
 void garbage_collect_1 (void);
 Lisp_Object acons (Lisp_Object, Lisp_Object, Lisp_Object);
@@ -2200,11 +1968,11 @@ Lisp_Object make_pure_pname (CONST Bufbyte *, Bytecount, int);
 Lisp_Object pure_cons (Lisp_Object, Lisp_Object);
 Lisp_Object pure_list (int, Lisp_Object *);
 Lisp_Object make_pure_vector (size_t, Lisp_Object);
-void free_cons (Lisp_Cons *);
+void free_cons (struct Lisp_Cons *);
 void free_list (Lisp_Object);
 void free_alist (Lisp_Object);
 void mark_conses_in_list (Lisp_Object);
-void free_marker (Lisp_Marker *);
+void free_marker (struct Lisp_Marker *);
 int object_dead_p (Lisp_Object);
 
 #ifdef MEMORY_USAGE_STATS
@@ -2280,7 +2048,6 @@ Bufpos bufpos_clip_to_bounds (Bufpos, Bufpos, Bufpos);
 Bytind bytind_clip_to_bounds (Bytind, Bytind, Bytind);
 void buffer_insert1 (struct buffer *, Lisp_Object);
 Lisp_Object make_string_from_buffer (struct buffer *, int, int);
-Lisp_Object make_string_from_buffer_no_extents (struct buffer *, int, int);
 Lisp_Object save_excursion_save (void);
 Lisp_Object save_restriction_save (void);
 Lisp_Object save_excursion_restore (Lisp_Object);
@@ -2290,7 +2057,7 @@ Lisp_Object save_restriction_restore (Lisp_Object);
 Lisp_Object save_current_buffer_restore (Lisp_Object);
 
 /* Defined in emacs.c */
-DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (fatal (CONST char *,
+DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (fatal (CONST char *,
                                                           ...), 1, 2);
 int stderr_out (CONST char *, ...) PRINTF_ARGS (1, 2);
 int stdout_out (CONST char *, ...) PRINTF_ARGS (1, 2);
@@ -2312,7 +2079,7 @@ DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, Lisp_Object));
 void maybe_signal_error (Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior);
 Lisp_Object maybe_signal_continuable_error (Lisp_Object, Lisp_Object,
                                            Lisp_Object, Error_behavior);
-DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error (CONST char *,
+DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error (CONST char *,
                                                           ...), 1, 2);
 void maybe_error (Lisp_Object, Error_behavior, CONST char *,
                  ...) PRINTF_ARGS (3, 4);
@@ -2325,7 +2092,7 @@ void maybe_signal_simple_error (CONST char *, Lisp_Object,
 Lisp_Object signal_simple_continuable_error (CONST char *, Lisp_Object);
 Lisp_Object maybe_signal_simple_continuable_error (CONST char *, Lisp_Object,
                                                   Lisp_Object, Error_behavior);
-DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error_with_frob
+DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error_with_frob
                                                    (Lisp_Object, CONST char *,
                                                     ...), 2, 3);
 void maybe_error_with_frob (Lisp_Object, Lisp_Object, Error_behavior,
@@ -2343,11 +2110,7 @@ Lisp_Object signal_simple_continuable_error_2 (CONST char *,
 Lisp_Object maybe_signal_simple_continuable_error_2 (CONST char *, Lisp_Object,
                                                     Lisp_Object, Lisp_Object,
                                                     Error_behavior);
-void signal_malformed_list_error (Lisp_Object);
-void signal_malformed_property_list_error (Lisp_Object);
-void signal_circular_list_error (Lisp_Object);
-void signal_circular_property_list_error (Lisp_Object);
-void signal_void_function_error (Lisp_Object);
+Lisp_Object funcall_recording_as (Lisp_Object, int, Lisp_Object *);
 Lisp_Object run_hook_with_args_in_buffer (struct buffer *, int, Lisp_Object *,
                                          enum run_hooks_condition);
 Lisp_Object run_hook_with_args (int, Lisp_Object *, enum run_hooks_condition);
@@ -2431,7 +2194,7 @@ void signal_special_Xt_user_event (Lisp_Object, Lisp_Object, Lisp_Object);
 /* Defined in events.c */
 void clear_event_resource (void);
 Lisp_Object allocate_event (void);
-int event_to_character (Lisp_Event *, int, int, int);
+int event_to_character (struct Lisp_Event *, int, int, int);
 
 /* Defined in fileio.c */
 void record_auto_save (void);
@@ -2501,7 +2264,6 @@ Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object);
 Lisp_Object vconcat2 (Lisp_Object, Lisp_Object);
 Lisp_Object vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object);
 Lisp_Object nconc2 (Lisp_Object, Lisp_Object);
-Lisp_Object bytecode_nconc2 (Lisp_Object *);
 void check_losing_bytecode (CONST char *, Lisp_Object);
 
 /* Defined in getloadavg.c */
@@ -2591,7 +2353,7 @@ void write_string_to_stdio_stream (FILE *, struct console *,
                                   enum external_data_format);
 void debug_print (Lisp_Object);
 void debug_short_backtrace (int);
-void temp_output_buffer_setup (Lisp_Object);
+void temp_output_buffer_setup (CONST char *);
 void temp_output_buffer_show (Lisp_Object, Lisp_Object);
 /* NOTE: Do not call this with the data of a Lisp_String.  Use princ.
  * Note: stream should be defaulted before calling
@@ -2606,9 +2368,10 @@ void long_to_string (char *, long);
 void print_internal (Lisp_Object, Lisp_Object, int);
 void print_symbol (Lisp_Object, Lisp_Object, int);
 void print_float (Lisp_Object, Lisp_Object, int);
+void print_compiled_function (Lisp_Object, Lisp_Object, int);
 extern int print_escape_newlines;
 extern int print_readably;
-Lisp_Object internal_with_output_to_temp_buffer (Lisp_Object,
+Lisp_Object internal_with_output_to_temp_buffer (CONST char *,
                                                 Lisp_Object (*) (Lisp_Object),
                                                 Lisp_Object, Lisp_Object);
 void float_to_string (char *, double);
@@ -2673,9 +2436,6 @@ int symbol_value_buffer_local_info (Lisp_Object, struct buffer *);
 Lisp_Object find_symbol_value (Lisp_Object);
 Lisp_Object find_symbol_value_quickly (Lisp_Object, int);
 Lisp_Object top_level_value (Lisp_Object);
-void reject_constant_symbols (Lisp_Object sym, Lisp_Object newval,
-                             int function_p,
-                             Lisp_Object follow_past_lisp_magic);
 
 /* Defined in syntax.c */
 int scan_words (struct buffer *, int, int);
@@ -2731,6 +2491,7 @@ EXFUN (Fchar_after, 2);
 EXFUN (Fchar_to_string, 1);
 EXFUN (Fcheck_valid_plist, 1);
 EXFUN (Fclear_range_table, 1);
+EXFUN (Fclrhash, 1);
 EXFUN (Fcoding_category_list, 0);
 EXFUN (Fcoding_category_system, 1);
 EXFUN (Fcoding_priority_list, 0);
@@ -2743,12 +2504,12 @@ EXFUN (Fcoding_system_property, 2);
 EXFUN (Fcoding_system_type, 1);
 EXFUN (Fcommand_execute, 3);
 EXFUN (Fcommandp, 1);
+EXFUN (Fcompiled_function_domain, 1);
 EXFUN (Fconcat, MANY);
 EXFUN (Fcons, 2);
 EXFUN (Fcopy_alist, 1);
 EXFUN (Fcopy_coding_system, 2);
 EXFUN (Fcopy_event, 2);
-EXFUN (Fcopy_list, 1);
 EXFUN (Fcopy_marker, 2);
 EXFUN (Fcopy_sequence, 1);
 EXFUN (Fcopy_tree, 2);
@@ -2815,9 +2576,11 @@ EXFUN (Fget_buffer_process, 1);
 EXFUN (Fget_coding_system, 1);
 EXFUN (Fget_process, 1);
 EXFUN (Fget_range_table, 3);
+EXFUN (Fgethash, 3);
 EXFUN (Fgettext, 1);
 EXFUN (Fgoto_char, 2);
 EXFUN (Fgtr, MANY);
+EXFUN (Fhashtablep, 1);
 EXFUN (Findent_to, 3);
 EXFUN (Findirect_function, 1);
 EXFUN (Finsert, MANY);
@@ -2836,14 +2599,11 @@ EXFUN (Flength, 1);
 EXFUN (Fleq, MANY);
 EXFUN (Flist, MANY);
 EXFUN (Flistp, 1);
-#ifdef HAVE_SHLIB
-EXFUN (Flist_modules, 0);
-EXFUN (Fload_module, 3);
-#endif
 EXFUN (Flss, MANY);
 EXFUN (Fmake_byte_code, MANY);
 EXFUN (Fmake_coding_system, 4);
 EXFUN (Fmake_glyph_internal, 1);
+EXFUN (Fmake_hashtable, 2);
 EXFUN (Fmake_list, 2);
 EXFUN (Fmake_marker, 0);
 EXFUN (Fmake_range_table, 0);
@@ -2872,7 +2632,6 @@ EXFUN (Fold_equal, 2);
 EXFUN (Fold_member, 2);
 EXFUN (Fold_memq, 2);
 EXFUN (Fplist_get, 3);
-EXFUN (Fplist_member, 2);
 EXFUN (Fplist_put, 3);
 EXFUN (Fplus, MANY);
 EXFUN (Fpoint, 1);
@@ -2892,6 +2651,7 @@ EXFUN (Fpurecopy, 1);
 EXFUN (Fput, 3);
 EXFUN (Fput_range_table, 4);
 EXFUN (Fput_text_property, 5);
+EXFUN (Fputhash, 3);
 EXFUN (Fquo, MANY);
 EXFUN (Frassq, 2);
 EXFUN (Fread, 1);
@@ -2929,7 +2689,6 @@ EXFUN (Fsymbol_function, 1);
 EXFUN (Fsymbol_name, 1);
 EXFUN (Fsymbol_plist, 1);
 EXFUN (Fsymbol_value, 1);
-EXFUN (Fsystem_name, 0);
 EXFUN (Fthrow, 2);
 EXFUN (Ftimes, MANY);
 EXFUN (Ftruncate, 1);
@@ -2959,9 +2718,8 @@ extern Lisp_Object Qbyte_code, Qcall_interactively, Qcategory;
 extern Lisp_Object Qcategory_designator_p, Qcategory_table_value_p, Qccl, Qcdr;
 extern Lisp_Object Qchannel, Qchar, Qchar_or_string_p, Qcharacter, Qcharacterp;
 extern Lisp_Object Qchars, Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3;
-extern Lisp_Object Qcircular_list, Qcircular_property_list;
-extern Lisp_Object Qcoding_system_error, Qcoding_system_p;
-extern Lisp_Object Qcolor, Qcolor_pixmap_image_instance_p;
+extern Lisp_Object Qcircular_property_list, Qcoding_system_error;
+extern Lisp_Object Qcoding_system_p, Qcolor, Qcolor_pixmap_image_instance_p;
 extern Lisp_Object Qcolumns, Qcommand, Qcommandp, Qcompletion_ignore_case;
 extern Lisp_Object Qconsole, Qconsole_live_p, Qconst_specifier, Qcr, Qcritical;
 extern Lisp_Object Qcrlf, Qctext, Qcurrent_menubar, Qcursor;
@@ -2986,12 +2744,11 @@ extern Lisp_Object Qinteger_or_marker_p, Qintegerp, Qinteractive, Qinternal;
 extern Lisp_Object Qinvalid_function, Qinvalid_read_syntax, Qio_error;
 extern Lisp_Object Qiso2022, Qkey, Qkey_assoc, Qkeymap, Qlambda, Qleft, Qlf;
 extern Lisp_Object Qlist, Qlistp, Qload, Qlock_shift, Qmacro, Qmagic;
-extern Lisp_Object Qmalformed_list, Qmalformed_property_list;
-extern Lisp_Object Qmalloc_overhead, Qmark, Qmarkers;
+extern Lisp_Object Qmalformed_property_list, Qmalloc_overhead, Qmark, Qmarkers;
 extern Lisp_Object Qmax, Qmemory, Qmessage, Qminus, Qmnemonic, Qmodifiers;
 extern Lisp_Object Qmono_pixmap_image_instance_p, Qmotion;
 extern Lisp_Object Qmouse_leave_buffer_hook, Qmswindows, Qname, Qnas, Qnatnump;
-extern Lisp_Object Qno_ascii_cntl, Qno_ascii_eol, Qno_catch;
+extern Lisp_Object Qnil, Qno_ascii_cntl, Qno_ascii_eol, Qno_catch;
 extern Lisp_Object Qno_conversion, Qno_iso6429, Qnone, Qnot, Qnothing;
 extern Lisp_Object Qnothing_image_instance_p, Qnotice;
 extern Lisp_Object Qnumber_char_or_marker_p, Qnumber_or_marker_p, Qnumberp;
@@ -3005,11 +2762,11 @@ extern Lisp_Object Qquote, Qrange_error, Qrassoc, Qrassq, Qread_char;
 extern Lisp_Object Qread_from_minibuffer, Qreally_early_error_handler;
 extern Lisp_Object Qregion_beginning, Qregion_end, Qrequire, Qresource;
 extern Lisp_Object Qreturn, Qreverse, Qright, Qrun_hooks, Qsans_modifiers;
-extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, Qselected, Qself_insert_command;
+extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, Qself_insert_command;
 extern Lisp_Object Qsequencep, Qsetting_constant, Qseven, Qshift_jis, Qshort;
 extern Lisp_Object Qsignal, Qsimple, Qsingularity_error, Qsize, Qspace;
 extern Lisp_Object Qspecifier, Qstandard_input, Qstandard_output, Qstart_open;
-extern Lisp_Object Qstream, Qstring, Qstring_lessp, Qsubwindow;
+extern Lisp_Object Qstream, Qstring, Qstring_lessp;
 extern Lisp_Object Qsubwindow_image_instance_p, Qsymbol, Qsyntax, Qt, Qtest;
 extern Lisp_Object Qtext, Qtext_image_instance_p, Qtimeout, Qtimestamp;
 extern Lisp_Object Qtoolbar, Qtop, Qtop_level, Qtrue_list_p, Qtty, Qtype;
@@ -3017,7 +2774,7 @@ extern Lisp_Object Qunbound, Qundecided, Qundefined, Qunderflow_error;
 extern Lisp_Object Qunderline, Qunimplemented, Quser_files_and_directories;
 extern Lisp_Object Qvalue_assoc, Qvalues;
 extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvector;
-extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning, Qwidth, Qwidget, Qwindow;
+extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning, Qwidth, Qwindow;
 extern Lisp_Object Qwindow_live_p, Qwindow_system, Qwrong_number_of_arguments;
 extern Lisp_Object Qwrong_type_argument, Qx, Qy, Qyes_or_no_p;
 extern Lisp_Object Vactivate_menubar_hook, Vascii_canon_table;
@@ -3026,9 +2783,8 @@ extern Lisp_Object Vascii_upcase_table, Vautoload_queue, Vbinary_process_input;
 extern Lisp_Object Vbinary_process_output, Vblank_menubar;
 extern Lisp_Object Vcharset_ascii, Vcharset_composite, Vcharset_control_1;
 extern Lisp_Object Vcoding_system_for_read, Vcoding_system_for_write;
-extern Lisp_Object Vcoding_system_hash_table, Vcommand_history;
+extern Lisp_Object Vcoding_system_hashtable, Vcommand_history;
 extern Lisp_Object Vcommand_line_args, Vconfigure_info_directory;
-extern Lisp_Object Vconfigure_site_directory, Vconfigure_site_module_directory;
 extern Lisp_Object Vconsole_list, Vcontrolling_terminal;
 extern Lisp_Object Vcurrent_compiled_function_annotation, Vcurrent_load_list;
 extern Lisp_Object Vcurrent_mouse_event, Vcurrent_prefix_arg, Vdata_directory;
@@ -3046,18 +2802,16 @@ extern Lisp_Object Vload_path, Vmark_even_if_inactive, Vmenubar_configuration;
 extern Lisp_Object Vminibuf_preprompt, Vminibuf_prompt, Vminibuffer_zero;
 extern Lisp_Object Vmirror_ascii_canon_table, Vmirror_ascii_downcase_table;
 extern Lisp_Object Vmirror_ascii_eqv_table, Vmirror_ascii_upcase_table;
-extern Lisp_Object Vmodule_directory, Vmswindows_downcase_file_names;
+extern Lisp_Object Vmswindows_downcase_file_names;
 extern Lisp_Object Vmswindows_get_true_file_attributes, Vobarray;
 extern Lisp_Object Vprint_length, Vprint_level, Vprocess_environment;
 extern Lisp_Object Vpure_uninterned_symbol_table, Vquit_flag;
 extern Lisp_Object Vrecent_keys_ring, Vshell_file_name, Vsite_directory;
-extern Lisp_Object Vsite_module_directory;
 extern Lisp_Object Vstandard_input, Vstandard_output, Vstdio_str;
 extern Lisp_Object Vsynchronous_sounds, Vsystem_name, Vterminal_coding_system;
 extern Lisp_Object Vthis_command_keys, Vunread_command_event;
 extern Lisp_Object Vwin32_generate_fake_inodes, Vwin32_pipe_read_delay;
 extern Lisp_Object Vx_initial_argv_list;
 
-extern Lisp_Object Qmakunbound, Qset;
 
 #endif /* _XEMACS_LISP_H_ */
index 479ea25..9c0fa8b 100644 (file)
@@ -29,9 +29,11 @@ Boston, MA 02111-1307, USA.  */
 
 #include "buffer.h"
 #include "bytecode.h"
-#include "elhash.h"
+#include "commands.h"
+#include "insdel.h"
 #include "lstream.h"
 #include "opaque.h"
+#include <paths.h>
 #ifdef FILE_CODING
 #include "file-coding.h"
 #endif
@@ -89,6 +91,9 @@ int load_warn_when_source_only;
 /* Whether Fload_internal() should ignore .elc files when no suffix is given */
 int load_ignore_elc_files;
 
+/* Directory in which the sources were found.  */
+Lisp_Object Vsource_directory;
+
 /* Search path for files to be loaded. */
 Lisp_Object Vload_path;
 
@@ -399,18 +404,22 @@ ebolify_bytecode_constants (Lisp_Object vector)
         something to `funcall', but who would really do that?  As
         they say in law, we've made a "good-faith effort" to
         unfuckify ourselves.  And doing it this way avoids screwing
-        up args to `make-hash-table' and such.  As it is, we have to
+        up args to `make-hashtable' and such.  As it is, we have to
         add an extra Ebola check in decode_weak_list_type(). --ben */
-      if      (EQ (el, Qassoc))  el = Qold_assoc;
-      else if (EQ (el, Qdelq))   el = Qold_delq;
+      if (EQ (el, Qassoc))
+       el = Qold_assoc;
+      if (EQ (el, Qdelq))
+       el = Qold_delq;
 #if 0
       /* I think this is a bad idea because it will probably mess
         with keymap code. */
-      else if (EQ (el, Qdelete)) el = Qold_delete;
+      if (EQ (el, Qdelete))
+       el = Qold_delete;
 #endif
-      else if (EQ (el, Qrassq))  el = Qold_rassq;
-      else if (EQ (el, Qrassoc)) el = Qold_rassoc;
-
+      if (EQ (el, Qrassq))
+       el = Qold_rassq;
+      if (EQ (el, Qrassoc))
+       el = Qold_rassoc;
       XVECTOR_DATA (vector)[i] = el;
     }
 }
@@ -464,11 +473,11 @@ load_force_doc_string_unwind (Lisp_Object oldlist)
          Lisp_Object doc;
 
          assert (COMPILED_FUNCTIONP (john));
-         if (CONSP (XCOMPILED_FUNCTION (john)->instructions))
+         if (CONSP (XCOMPILED_FUNCTION (john)->bytecodes))
            {
              struct gcpro ngcpro1;
              Lisp_Object juan = (pas_de_lache_ici
-                                 (fd, XCOMPILED_FUNCTION (john)->instructions));
+                                 (fd, XCOMPILED_FUNCTION (john)->bytecodes));
              Lisp_Object ivan;
 
              NGCPRO1 (juan);
@@ -476,7 +485,7 @@ load_force_doc_string_unwind (Lisp_Object oldlist)
              if (!CONSP (ivan))
                signal_simple_error ("invalid lazy-loaded byte code", ivan);
              /* Remember to purecopy; see above. */
-             XCOMPILED_FUNCTION (john)->instructions = Fpurecopy (XCAR (ivan));
+             XCOMPILED_FUNCTION (john)->bytecodes = Fpurecopy (XCAR (ivan));
              /* v18 or v19 bytecode file.  Need to Ebolify. */
              if (XCOMPILED_FUNCTION (john)->flags.ebolified
                  && VECTORP (XCDR (ivan)))
@@ -787,11 +796,10 @@ encoding detection or end-of-line detection.
   if (purify_flag && noninteractive)
     {
       if (EQ (last_file_loaded, file))
-       message_append (" (%ld)",
-                       (unsigned long) (purespace_usage() - pure_usage));
+       message_append (" (%d)", purespace_usage() - pure_usage);
       else
-       message ("Loading %s ...done (%ld)", XSTRING_DATA (file),
-                (unsigned long) (purespace_usage() - pure_usage));
+       message ("Loading %s ...done (%d)", XSTRING_DATA (file),
+                purespace_usage() - pure_usage);
     }
 /*#endif / * DEBUG_XEMACS */
 
@@ -842,11 +850,10 @@ for details.
   if (!NILP (mode))
     CHECK_NATNUM (mode);
 
-  locate_file (path_list,
-              filename,
-               NILP (suffixes) ? "" : (char *) XSTRING_DATA (suffixes),
-              &tp,
-              NILP (mode) ? R_OK : XINT (mode));
+  locate_file (path_list, filename,
+               ((NILP (suffixes)) ? "" :
+               (char *) (XSTRING_DATA (suffixes))),
+              &tp, (NILP (mode) ? R_OK : XINT (mode)));
   return tp;
 }
 
@@ -855,7 +862,8 @@ for details.
 static Lisp_Object
 locate_file_refresh_hashing (Lisp_Object str)
 {
-  Lisp_Object hash = make_directory_hash_table ((char *) XSTRING_DATA (str));
+  Lisp_Object hash =
+    make_directory_hash_table ((char *) XSTRING_DATA (str));
   Fput (str, Qlocate_file_hash_table, hash);
   return hash;
 }
@@ -866,7 +874,7 @@ static Lisp_Object
 locate_file_find_directory_hash_table (Lisp_Object str)
 {
   Lisp_Object hash = Fget (str, Qlocate_file_hash_table, Qnil);
-  if (! HASH_TABLEP (hash))
+  if (NILP (Fhashtablep (hash)))
     return locate_file_refresh_hashing (str);
   return hash;
 }
@@ -898,7 +906,7 @@ locate_file_in_directory (Lisp_Object path, Lisp_Object str,
        default-directory to be something non-absolute ... */
     {
       if (NILP (filename))
-       /* NIL means current directory */
+       /* NIL means current dirctory */
        filename = current_buffer->directory;
       else
        filename = Fexpand_file_name (filename,
@@ -1113,7 +1121,7 @@ locate_file (Lisp_Object path, Lisp_Object str, CONST char *suffix,
   for (pathtail = path; !NILP (pathtail); pathtail = Fcdr (pathtail))
     {
       Lisp_Object pathel = Fcar (pathtail);
-      Lisp_Object hash_table;
+      Lisp_Object hashtab;
       Lisp_Object tail;
       int found;
 
@@ -1132,13 +1140,13 @@ locate_file (Lisp_Object path, Lisp_Object str, CONST char *suffix,
          continue;
        }
 
-      hash_table = locate_file_find_directory_hash_table (pathel);
+      hashtab = locate_file_find_directory_hash_table (pathel);
 
       /* Loop over suffixes.  */
       for (tail = suffixtab, found = 0; !found && CONSP (tail);
           tail = XCDR (tail))
        {
-         if (!NILP (Fgethash (XCAR (tail), hash_table, Qnil)))
+         if (!NILP (Fgethash (XCAR (tail), hashtab, Qnil)))
            found = 1;
        }
 
@@ -1268,9 +1276,9 @@ readevalloop (Lisp_Object readcharfun,
 {
   /* This function can GC */
   REGISTER Emchar c;
-  REGISTER Lisp_Object val = Qnil;
+  REGISTER Lisp_Object val;
   int speccount = specpdl_depth ();
-  struct gcpro gcpro1, gcpro2;
+  struct gcpro gcpro1;
   struct buffer *b = 0;
 
   if (BUFFERP (readcharfun))
@@ -1287,7 +1295,7 @@ readevalloop (Lisp_Object readcharfun,
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
   Vcurrent_compiled_function_annotation = Qnil;
 #endif
-  GCPRO2 (val, sourcename);
+  GCPRO1 (sourcename);
 
   LOADHIST_ATTACH (sourcename);
 
@@ -2395,11 +2403,11 @@ retry:
              obj = read0(readcharfun);
 
              /* the call to `featurep' may GC. */
-             GCPRO2 (fexp, obj);
-             tem = call1 (Qfeaturep, fexp);
+             GCPRO2(fexp, obj);
+             tem = call1(Qfeaturep, fexp);
              UNGCPRO;
 
-             if (c == '+' &&  NILP(tem)) goto retry;
+             if (c == '+' && NILP(tem)) goto retry;
              if (c == '-' && !NILP(tem)) goto retry;
              return obj;
            }
@@ -2985,7 +2993,7 @@ init_lread (void)
   Vvalues = Qnil;
 
   load_in_progress = 0;
-
+  
   Vload_descriptor_list = Qnil;
 
   /* kludge: locate-file does not work for a null load-path, even if
@@ -3145,6 +3153,12 @@ This is useful when the file being loaded is a temporary copy.
 */ );
   load_force_doc_strings = 0;
 
+  DEFVAR_LISP ("source-directory", &Vsource_directory /*
+Directory in which XEmacs sources were found when XEmacs was built.
+You cannot count on them to still be there!
+*/ );
+  Vsource_directory = Qnil;
+
   /* See read_escape().  */
 #if 0
   /* Used to be named `puke-on-fsf-keys' */
index b15c1cb..dae210b 100644 (file)
@@ -50,7 +50,7 @@ Boston, MA 02111-1307, USA.  */
    a `next' pointer, and are allocated using alloc_lcrecord().
 
    Creating a new lcrecord type is fairly easy; just follow the
-   lead of some existing type (e.g. hash tables).  Note that you
+   lead of some existing type (e.g. hashtables).  Note that you
    do not need to supply all the methods (see below); reasonable
    defaults are provided for many of them.  Alternatively, if you're
    just looking for a way of encapsulating data (which possibly
@@ -89,11 +89,11 @@ struct lrecord_header
    */
 #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
   /* index into lrecord_implementations_table[] */
-  unsigned char type;
+  unsigned type:8;
   /* 1 if the object is marked during GC, 0 otherwise. */
-  char mark;
+  unsigned mark:1;
   /* 1 if the object resides in pure (read-only) space */
-  char pure;
+  unsigned pure:1;
 #else
   CONST struct lrecord_implementation *implementation;
 #endif
@@ -103,11 +103,11 @@ struct lrecord_implementation;
 int lrecord_type_index (CONST struct lrecord_implementation *implementation);
 
 #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
-# define set_lheader_implementation(header,imp) do {   \
-  struct lrecord_header* SLI_header = (header);                \
-  (SLI_header)->type = lrecord_type_index (imp);       \
-  (SLI_header)->mark = 0;                              \
-  (SLI_header)->pure = 0;                              \
+# define set_lheader_implementation(header,imp) do     \
+{                                                      \
+  (header)->type = lrecord_type_index (imp);           \
+  (header)->mark = 0;                                  \
+  (header)->pure = 0;                                  \
 } while (0)
 #else
 # define set_lheader_implementation(header,imp) \
@@ -117,31 +117,27 @@ int lrecord_type_index (CONST struct lrecord_implementation *implementation);
 struct lcrecord_header
 {
   struct lrecord_header lheader;
-
-  /* The `next' field is normally used to chain all lrecords together
+  /* The "next" field is normally used to chain all lrecords together
      so that the GC can find (and free) all of them.
-     `alloc_lcrecord' threads records together.
-
-     The `next' field may be used for other purposes as long as some
-     other mechanism is provided for letting the GC do its work.
+     "alloc_lcrecord" threads records together.
 
-     For example, the event and marker object types allocate members
-     out of memory chunks, and are able to find all unmarked members
-     by sweeping through the elements of the list of chunks.  */
+     The "next" field may be used for other purposes as long as some
+     other mechanism is provided for letting the GC do its work.  (For
+     example, the event and marker datatypes allocate members out of
+     memory chunks, and are able to find all unmarked members by
+     sweeping through the elements of the list of chunks) */
   struct lcrecord_header *next;
-
-  /* The `uid' field is just for debugging/printing convenience.
-     Having this slot doesn't hurt us much spacewise, since an
-     lcrecord already has the above slots plus malloc overhead. */
+  /* This is just for debugging/printing convenience.
+     Having this slot doesn't hurt us much spacewise, since an lcrecord
+     already has the above slots together with malloc overhead. */
   unsigned int uid :31;
-
-  /* The `free' field is a flag that indicates whether this lcrecord
-     is on a "free list".  Free lists are used to minimize the number
-     of calls to malloc() when we're repeatedly allocating and freeing
-     a number of the same sort of lcrecord.  Lcrecords on a free list
-     always get marked in a different fashion, so we can use this flag
-     as a sanity check to make sure that free lists only have freed
-     lcrecords and there are no freed lcrecords elsewhere. */
+  /* A flag that indicates whether this lcrecord is on a "free list".
+     Free lists are used to minimize the number of calls to malloc()
+     when we're repeatedly allocating and freeing a number of the
+     same sort of lcrecord.  Lcrecords on a free list always get
+     marked in a different fashion, so we can use this flag as a
+     sanity check to make sure that free lists only have freed lcrecords
+     and there are no freed lcrecords elsewhere. */
   unsigned int free :1;
 };
 
@@ -153,7 +149,7 @@ struct free_lcrecord_header
 };
 
 /* This as the value of lheader->implementation->finalizer
-   means that this record is already marked */
+ *  means that this record is already marked */
 void this_marks_a_marked_record (void *, int);
 
 /* see alloc.c for an explanation */
@@ -236,21 +232,24 @@ extern int gc_in_progress;
 
 #ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
 
-# define MARKED_RECORD_HEADER_P(lheader) ((lheader)->mark)
-# define MARK_RECORD_HEADER(lheader)   ((void) ((lheader)->mark = 1))
-# define UNMARK_RECORD_HEADER(lheader) ((void) ((lheader)->mark = 0))
+# define MARKED_RECORD_HEADER_P(lheader) (lheader)->mark
+# define MARK_RECORD_HEADER(lheader) (lheader)->mark = 1
+# define UNMARK_RECORD_HEADER(lheader) (lheader)->mark = 0
 
 #else /* ! USE_INDEXED_LRECORD_IMPLEMENTATION */
 
 # define MARKED_RECORD_HEADER_P(lheader) \
-  ((lheader)->implementation->finalizer == this_marks_a_marked_record)
-# define MARK_RECORD_HEADER(lheader)   ((void) (((lheader)->implementation)++))
-# define UNMARK_RECORD_HEADER(lheader) ((void) (((lheader)->implementation)--))
+  (((lheader)->implementation->finalizer) == this_marks_a_marked_record)
+# define MARK_RECORD_HEADER(lheader) \
+  do { (((lheader)->implementation)++); } while (0)
+# define UNMARK_RECORD_HEADER(lheader) \
+  do { (((lheader)->implementation)--); } while (0)
 
 #endif /* ! USE_INDEXED_LRECORD_IMPLEMENTATION */
 
 #define UNMARKABLE_RECORD_HEADER_P(lheader) \
-  (LHEADER_IMPLEMENTATION (lheader)->marker == this_one_is_unmarkable)
+  ((LHEADER_IMPLEMENTATION (lheader)->marker) \
+   == this_one_is_unmarkable)
 
 /* Declaring the following structures as const puts them in the
    text (read-only) segment, which makes debugging inconvenient
@@ -326,25 +325,25 @@ CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name[2] =    \
 # define DECLARE_LRECORD(c_name, structtype)                   \
 extern CONST_IF_NOT_DEBUG struct lrecord_implementation                \
   lrecord_##c_name[];                                          \
-INLINE structtype *error_check_##c_name (Lisp_Object obj);     \
+INLINE structtype *error_check_##c_name (Lisp_Object _obj);    \
 INLINE structtype *                                            \
-error_check_##c_name (Lisp_Object obj)                         \
+error_check_##c_name (Lisp_Object _obj)                                \
 {                                                              \
-  XUNMARK (obj);                                               \
-  assert (RECORD_TYPEP (obj, lrecord_##c_name) ||              \
-         MARKED_RECORD_P (obj));                               \
-  return (structtype *) XPNTR (obj);                           \
+  XUNMARK (_obj);                                              \
+  assert (RECORD_TYPEP (_obj, lrecord_##c_name) ||             \
+         MARKED_RECORD_P (_obj));                              \
+  return (structtype *) XPNTR (_obj);                          \
 }                                                              \
 extern Lisp_Object Q##c_name##p
 
 # define DECLARE_NONRECORD(c_name, type_enum, structtype)      \
-INLINE structtype *error_check_##c_name (Lisp_Object obj);     \
+INLINE structtype *error_check_##c_name (Lisp_Object _obj);    \
 INLINE structtype *                                            \
-error_check_##c_name (Lisp_Object obj)                         \
+error_check_##c_name (Lisp_Object _obj)                                \
 {                                                              \
-  XUNMARK (obj);                                               \
-  assert (XGCTYPE (obj) == type_enum);                         \
-  return (structtype *) XPNTR (obj);                           \
+  XUNMARK (_obj);                                              \
+  assert (XGCTYPE (_obj) == type_enum);                                \
+  return (structtype *) XPNTR (_obj);                          \
 }                                                              \
 extern Lisp_Object Q##c_name##p
 
index 931e93c..7ad6409 100644 (file)
@@ -169,21 +169,21 @@ extern char *jrKanjiError;
 static unsigned char buf[KEYTOSTRSIZE];
 static char **warning;
 
-static int canna_empty_info, canna_through_info;
-static int canna_underline;
-static int canna_inhibit_hankakukana;
+static int Vcanna_empty_info, Vcanna_through_info;
+static int Vcanna_underline;
+static int Vcanna_inhibit_hankakukana;
 
 static Lisp_Object Vcanna_kakutei_string;
 static Lisp_Object Vcanna_kakutei_yomi;
 static Lisp_Object Vcanna_kakutei_romaji;
 static Lisp_Object Vcanna_henkan_string;
-static int         canna_henkan_length;
-static int         canna_henkan_revPos;
-static int         canna_henkan_revLen;
+static int         Vcanna_henkan_length;
+static int         Vcanna_henkan_revPos;
+static int         Vcanna_henkan_revLen;
 static Lisp_Object Vcanna_ichiran_string;
-static int         canna_ichiran_length;
-static int         canna_ichiran_revPos;
-static int         canna_ichiran_revLen;
+static int         Vcanna_ichiran_length;
+static int         Vcanna_ichiran_revPos;
+static int         Vcanna_ichiran_revLen;
 static Lisp_Object Vcanna_mode_string;
 
 static int IRCP_context;
@@ -259,21 +259,21 @@ storeResults (unsigned char *buf, int len, jrKanjiStatus *ks)
        {
          Vcanna_henkan_string = make_string (ks->echoStr, ks->length);
 #ifndef CANNA_MULE
-         canna_henkan_length = ks->length;
-         canna_henkan_revPos = ks->revPos;
-         canna_henkan_revLen = ks->revLen;
+         Vcanna_henkan_length = ks->length;
+         Vcanna_henkan_revPos = ks->revPos;
+         Vcanna_henkan_revLen = ks->revLen;
 #else /* CANNA_MULE */
-         if (canna_underline)
+         if (Vcanna_underline)
            {
-             canna_henkan_length = mule_strlen (ks->echoStr,ks->length);
-             canna_henkan_revPos = mule_strlen (ks->echoStr,ks->revPos);
-             canna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos,ks->revLen);
+             Vcanna_henkan_length = mule_strlen (ks->echoStr,ks->length);
+             Vcanna_henkan_revPos = mule_strlen (ks->echoStr,ks->revPos);
+             Vcanna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos,ks->revLen);
            }
          else
            {
              count_char (ks->echoStr, ks->length, ks->revPos, ks->revLen,
-                         &canna_henkan_length, &canna_henkan_revPos,
-                         &canna_henkan_revLen);
+                         &Vcanna_henkan_length, &Vcanna_henkan_revPos,
+                         &Vcanna_henkan_revLen);
            }
 #endif /* CANNA_MULE */
        }
@@ -284,13 +284,13 @@ storeResults (unsigned char *buf, int len, jrKanjiStatus *ks)
        {
          Vcanna_ichiran_string = make_string (ks->gline.line, ks->gline.length);
 #ifndef CANNA_MULE
-         canna_ichiran_length = ks->gline.length;
-         canna_ichiran_revPos = ks->gline.revPos;
-         canna_ichiran_revLen = ks->gline.revLen;
+         Vcanna_ichiran_length = ks->gline.length;
+         Vcanna_ichiran_revPos = ks->gline.revPos;
+         Vcanna_ichiran_revLen = ks->gline.revLen;
 #else /* CANNA_MULE */
          count_char (ks->gline.line, ks->gline.length,
-                     ks->gline.revPos, ks->gline.revLen, &canna_ichiran_length,
-                     &canna_ichiran_revPos, &canna_ichiran_revLen);
+                     ks->gline.revPos, ks->gline.revLen, &Vcanna_ichiran_length,
+                     &Vcanna_ichiran_revPos, &Vcanna_ichiran_revLen);
 #endif /* CANNA_MULE */
        }
 
@@ -302,8 +302,8 @@ storeResults (unsigned char *buf, int len, jrKanjiStatus *ks)
        }
 
       /* Â¤Â½Â¤ÃŽÃ‚¾¤Î¾ðÊó */
-      canna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0;
-      canna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0;
+      Vcanna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0;
+      Vcanna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0;
     }
 
   return val;
@@ -372,8 +372,8 @@ If nil is specified for each arg, the default value will be used.
       char servername[256];
 
       CHECK_STRING (server);
-      strncpy (servername, XSTRING_DATA (server), XSTRING_LENGTH (server));
-      servername[XSTRING_LENGTH (server)] = '\0';
+      strncpy (servername, XSTRING (server)->_data, XSTRING (server)->_size);
+      servername[XSTRING (server)->_size] = '\0';
       jrKanjiControl (0, KC_SETSERVERNAME, servername);
     }
 
@@ -386,8 +386,8 @@ If nil is specified for each arg, the default value will be used.
       char rcname[256];
 
       CHECK_STRING (rcfile);
-      strncpy (rcname, XSTRING_DATA (rcfile), XSTRING_LENGTH (rcfile));
-      rcname[XSTRING_LENGTH (rcfile)] = '\0';
+      strncpy (rcname, XSTRING (rcfile)->_data, XSTRING (rcfile)->_size);
+      rcname[XSTRING (rcfile)->_size] = '\0';
       jrKanjiControl (0, KC_SETINITFILENAME, rcname);
     }
 
@@ -414,7 +414,7 @@ If nil is specified for each arg, the default value will be used.
 
   if (res == -1)
     {
-      val = Fcons (make_string ((unsigned char*) jrKanjiError,
+      val = Fcons (make_string ((unsigned char*) jrKanjiError, 
                                strlen (jrKanjiError)), val);
       /* Â¥Â¤Â¥Ã‹Â¥Â·Â¥Ã£Â¥Ã©Â¥Â¤Â¥ÂºÂ¤Ã‡Â¼ÂºÃ‡Ã”¤·¤¿¾ì¹ç¡£ */
       return Fcons (Qnil, val);
@@ -440,7 +440,7 @@ If nil is specified for each arg, the default value will be used.
       jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
 #else
       /* mule Â¤Ã€Â¤ÃƒÂ¤Â¿Â¤Ã©ÃˆÂ¾Â³Ã‘¥«¥¿¥«¥Ê¤â»È¤¨¤ë */
-      if (canna_inhibit_hankakukana)
+      if (Vcanna_inhibit_hankakukana)
        jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
 #endif
       jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* Â¢Â¨Â£Â²: Â¥Ã­Â¡Â¼Â¥ÃžÂ»ÃºÂ¤ÃžÂ¤Ã‡ÃŠÃ–¤¹ */
@@ -490,10 +490,10 @@ Register Kanji words into kana-to-kanji conversion dictionary.
   ksv.buffer = (unsigned char *) buf;
   ksv.bytes_buffer = KEYTOSTRSIZE;
 #ifndef CANNA_MULE
-  ks.echoStr = XSTRING_DATA (str);
-  ks.length = XSTRING_LENGTH (str);
+  ks.echoStr = XSTRING (str)->_data;
+  ks.length = XSTRING (str)->_size;
 #else /* CANNA_MULE */
-  m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), cbuf);
+  m2c (XSTRING (str)->_data, XSTRING (str)->_size, cbuf);
   ks.echoStr = cbuf;
   ks.length = strlen (cbuf);
 #endif /* CANNA_MULE */
@@ -504,7 +504,7 @@ Register Kanji words into kana-to-kanji conversion dictionary.
 }
 
 DEFUN ("canna-set-width", Fcanna_set_width, 1, 1, 0, /*
-Set status-line width information, which is used to display
+Set status-line width information, which is used to display 
 kanji candidates.
 */
        (num))
@@ -564,11 +564,11 @@ Store yomi characters as a YOMI of kana-to-kanji conversion.
 
   CHECK_STRING (yomi);
 #ifndef CANNA_MULE
-  strncpy (buf, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi));
-  ks.length = XSTRING_LENGTH (yomi);
+  strncpy (buf, XSTRING (yomi)->_data, XSTRING (yomi)->_size);
+  ks.length = XSTRING (yomi)->_size;
   buf[ks.length] = '\0';
 #else /* CANNA_MULE */
-  m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), buf);
+  m2c (XSTRING (yomi)->_data, XSTRING (yomi)->_size, buf);
   ks.length = strlen (buf);
 #endif /* CANNA_MULE */
 
@@ -581,13 +581,13 @@ Store yomi characters as a YOMI of kana-to-kanji conversion.
       CHECK_STRING (roma);
 
 #ifndef CANNA_MULE
-      strncpy (buf + XSTRING_LENGTH (yomi) + 1, XSTRING_DATA (roma),
-              XSTRING_LENGTH (roma));
-      buf[XSTRING_LENGTH (yomi) + 1 + XSTRING_LENGTH (roma)] = '\0';
-      ks.mode = (unsigned char *)(buf + XSTRING_LENGTH (yomi) + 1);
+      strncpy (buf + XSTRING (yomi)->_size + 1, XSTRING (roma)->_data,
+              XSTRING (roma)->_size);
+      buf[XSTRING (yomi)->_size + 1 + XSTRING (roma)->_size] = '\0';
+      ks.mode = (unsigned char *)(buf + XSTRING (yomi)->_size + 1);
 #else /* CANNA_MULE */
       ks.mode = (unsigned char *)(buf + ks.length + 1);
-      m2c (XSTRING_DATA (roma), XSTRING_LENGTH (roma), ks.mode);
+      m2c (XSTRING (roma)->_data, XSTRING (roma)->_size, ks.mode);
 #endif /* CANNA_MULE */
     }
 
@@ -643,10 +643,10 @@ Parse customize string.
   CHECK_STRING (str);
 
 #ifndef CANNA_MULE
-  strncpy (buf, XSTRING_DATA (str), XSTRING_LENGTH (str));
-  buf[XSTRING_LENGTH (str)] = '\0';
+  strncpy (buf, XSTRING (str)->_data, XSTRING (str)->_size);
+  buf[XSTRING (str)->_size] = '\0';
 #else /* CANNA_MULE */
-  m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), buf);
+  m2c (XSTRING (str)->_data, XSTRING (str)->_size, buf);
 #endif /* CANNA_MULE */
   p = (unsigned char**) buf;
   n = jrKanjiControl (0, KC_PARSE,  (char *) &p);
@@ -730,12 +730,12 @@ DEFUN ("canna-henkan-begin", Fcanna_henkan_begin, 1, 1, 0, /*
       return Qnil;
     }
 #ifndef CANNA_MULE
-  strncpy (yomibuf, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi));
-  yomibuf[XSTRING_LENGTH (yomi)] = '\0';
-  nbun = RkBgnBun (IRCP_context, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi),
+  strncpy (yomibuf, XSTRING (yomi)->_data, XSTRING (yomi)->_size);
+  yomibuf[XSTRING (yomi)->_size] = '\0';
+  nbun = RkBgnBun (IRCP_context, XSTRING (yomi)->_data, XSTRING (yomi)->_size,
                   (RK_XFER << RK_XFERBITS) | RK_KFER);
 #else /* CANNA_MULE */
-  m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), yomibuf);
+  m2c (XSTRING (yomi)->_data, XSTRING (yomi)->_size, yomibuf);
   nbun = RkBgnBun (IRCP_context, (char *) yomibuf, strlen (yomibuf),
                   (RK_XFER << RK_XFERBITS) | RK_KFER);
 #endif /* CANNA_MULE */
@@ -814,7 +814,7 @@ DEFUN ("canna-bunsetu-henkou", Fcanna_bunsetu_henkou, 2, 2, 0, /*
 
   CHECK_INT (bunsetsu);
   CHECK_INT (bunlen);
-
+  
   nbun = XINT (bunsetsu);
   if (confirmContext () == 0)
     {
@@ -872,149 +872,150 @@ DEFUN ("canna-henkan-quit", Fcanna_henkan_quit, 0, 0, 0, /*
 
 /* variables below this line is constants of Canna */
 
-static int canna_mode_AlphaMode;
-static int canna_mode_EmptyMode;
-static int canna_mode_KigoMode;
-static int canna_mode_YomiMode;
-static int canna_mode_JishuMode;
-static int canna_mode_TankouhoMode;
-static int canna_mode_IchiranMode;
-static int canna_mode_YesNoMode;
-static int canna_mode_OnOffMode;
+static int Vcanna_mode_AlphaMode = IROHA_MODE_AlphaMode;
+static int Vcanna_mode_EmptyMode = IROHA_MODE_EmptyMode;
+static int Vcanna_mode_KigoMode = IROHA_MODE_KigoMode;
+static int Vcanna_mode_YomiMode = IROHA_MODE_YomiMode;
+static int Vcanna_mode_JishuMode = IROHA_MODE_JishuMode;
+static int Vcanna_mode_TankouhoMode = IROHA_MODE_TankouhoMode;
+static int Vcanna_mode_IchiranMode = IROHA_MODE_IchiranMode;
+static int Vcanna_mode_YesNoMode = IROHA_MODE_YesNoMode;
+static int Vcanna_mode_OnOffMode = IROHA_MODE_OnOffMode;
 #ifdef CANNA_MODE_AdjustBunsetsuMode
-static int canna_mode_AdjustBunsetsuMode;
+static int Vcanna_mode_AdjustBunsetsuMode = CANNA_MODE_AdjustBunsetsuMode;
 #endif
 #ifdef CANNA_MODE_ChikujiYomiMode
-static int canna_mode_ChikujiYomiMode;
-static int canna_mode_ChikujiTanMode;
+static int Vcanna_mode_ChikujiYomiMode = CANNA_MODE_ChikujiYomiMode;
+static int Vcanna_mode_ChikujiTanMode = CANNA_MODE_ChikujiTanMode;
 #endif
 
-static int canna_mode_HenkanMode;
+static int Vcanna_mode_HenkanMode = IROHA_MODE_HenkanMode;
 #ifdef CANNA_MODE_HenkanNyuryokuMode
-static int canna_mode_HenkanNyuryokuMode;
+static int Vcanna_mode_HenkanNyuryokuMode = CANNA_MODE_HenkanNyuryokuMode;
 #endif
 #ifdef CANNA_MODE_ZenHiraHenkanMode
-static int canna_mode_ZenHiraHenkanMode;
+static int Vcanna_mode_ZenHiraHenkanMode = CANNA_MODE_ZenHiraHenkanMode;
 #ifdef CANNA_MODE_HanHiraHenkanMode
-static int canna_mode_HanHiraHenkanMode;
+static int Vcanna_mode_HanHiraHenkanMode = CANNA_MODE_HanHiraHenkanMode;
 #endif
-static int canna_mode_ZenKataHenkanMode;
-static int canna_mode_HanKataHenkanMode;
-static int canna_mode_ZenAlphaHenkanMode;
-static int canna_mode_HanAlphaHenkanMode;
+static int Vcanna_mode_ZenKataHenkanMode = CANNA_MODE_ZenKataHenkanMode;
+static int Vcanna_mode_HanKataHenkanMode = CANNA_MODE_HanKataHenkanMode;
+static int Vcanna_mode_ZenAlphaHenkanMode = CANNA_MODE_ZenAlphaHenkanMode;
+static int Vcanna_mode_HanAlphaHenkanMode = CANNA_MODE_HanAlphaHenkanMode;
 #endif
-static int canna_mode_ZenHiraKakuteiMode;
+static int Vcanna_mode_ZenHiraKakuteiMode = IROHA_MODE_ZenHiraKakuteiMode;
 #ifdef CANNA_MODE_HanHiraKakuteiMode
-static int canna_mode_HanHiraKakuteiMode;
+static int Vcanna_mode_HanHiraKakuteiMode = CANNA_MODE_HanHiraKakuteiMode;
 #endif
-static int canna_mode_ZenKataKakuteiMode;
-static int canna_mode_HanKataKakuteiMode;
-static int canna_mode_ZenAlphaKakuteiMode;
-static int canna_mode_HanAlphaKakuteiMode;
-static int canna_mode_HexMode;
-static int canna_mode_BushuMode;
-static int canna_mode_ExtendMode;
-static int canna_mode_RussianMode;
-static int canna_mode_GreekMode;
-static int canna_mode_LineMode;
-static int canna_mode_ChangingServerMode;
-static int canna_mode_HenkanMethodMode;
-static int canna_mode_DeleteDicMode;
-static int canna_mode_TourokuMode;
-static int canna_mode_TourokuEmptyMode;
-static int canna_mode_TourokuHinshiMode;
-static int canna_mode_TourokuDicMode;
-static int canna_mode_QuotedInsertMode;
-static int canna_mode_BubunMuhenkanMode;
-static int canna_mode_MountDicMode;
-
-static int canna_fn_SelfInsert;
-static int canna_fn_FunctionalInsert;
-static int canna_fn_QuotedInsert;
-static int canna_fn_JapaneseMode;
-static int canna_fn_AlphaMode;
-static int canna_fn_HenkanNyuryokuMode;
-static int canna_fn_Forward;
-static int canna_fn_Backward;
-static int canna_fn_Next;
-static int canna_fn_Prev;
-static int canna_fn_BeginningOfLine;
-static int canna_fn_EndOfLine;
-static int canna_fn_DeleteNext;
-static int canna_fn_DeletePrevious;
-static int canna_fn_KillToEndOfLine;
-static int canna_fn_Henkan;
-static int canna_fn_Kakutei;
-static int canna_fn_Extend;
-static int canna_fn_Shrink;
+static int Vcanna_mode_ZenKataKakuteiMode = IROHA_MODE_ZenKataKakuteiMode;
+static int Vcanna_mode_HanKataKakuteiMode = IROHA_MODE_HanKataKakuteiMode;
+static int Vcanna_mode_ZenAlphaKakuteiMode = IROHA_MODE_ZenAlphaKakuteiMode;
+static int Vcanna_mode_HanAlphaKakuteiMode = IROHA_MODE_HanAlphaKakuteiMode;
+static int Vcanna_mode_HexMode = IROHA_MODE_HexMode;
+static int Vcanna_mode_BushuMode = IROHA_MODE_BushuMode;
+static int Vcanna_mode_ExtendMode = IROHA_MODE_ExtendMode;
+static int Vcanna_mode_RussianMode = IROHA_MODE_RussianMode;
+static int Vcanna_mode_GreekMode = IROHA_MODE_GreekMode;
+static int Vcanna_mode_LineMode = IROHA_MODE_LineMode;
+static int Vcanna_mode_ChangingServerMode = IROHA_MODE_ChangingServerMode;
+static int Vcanna_mode_HenkanMethodMode = IROHA_MODE_HenkanMethodMode;
+static int Vcanna_mode_DeleteDicMode = IROHA_MODE_DeleteDicMode;
+static int Vcanna_mode_TourokuMode = IROHA_MODE_TourokuMode;
+static int Vcanna_mode_TourokuEmptyMode = IROHA_MODE_TourokuEmptyMode;
+static int Vcanna_mode_TourokuHinshiMode = IROHA_MODE_TourokuHinshiMode;
+static int Vcanna_mode_TourokuDicMode = IROHA_MODE_TourokuDicMode;
+static int Vcanna_mode_QuotedInsertMode = IROHA_MODE_QuotedInsertMode;
+static int Vcanna_mode_BubunMuhenkanMode = IROHA_MODE_BubunMuhenkanMode;
+static int Vcanna_mode_MountDicMode = IROHA_MODE_MountDicMode;
+
+static int Vcanna_fn_SelfInsert = IROHA_FN_SelfInsert;
+static int Vcanna_fn_FunctionalInsert = IROHA_FN_FunctionalInsert;
+static int Vcanna_fn_QuotedInsert = IROHA_FN_QuotedInsert;
+static int Vcanna_fn_JapaneseMode = IROHA_FN_JapaneseMode;
+static int Vcanna_fn_AlphaMode = IROHA_FN_AlphaMode;
+static int Vcanna_fn_HenkanNyuryokuMode = IROHA_FN_HenkanNyuryokuMode;
+static int Vcanna_fn_Forward = IROHA_FN_Forward;
+static int Vcanna_fn_Backward = IROHA_FN_Backward;
+static int Vcanna_fn_Next = IROHA_FN_Next;
+static int Vcanna_fn_Prev = IROHA_FN_Prev;
+static int Vcanna_fn_BeginningOfLine = IROHA_FN_BeginningOfLine;
+static int Vcanna_fn_EndOfLine = IROHA_FN_EndOfLine;
+static int Vcanna_fn_DeleteNext = IROHA_FN_DeleteNext;
+static int Vcanna_fn_DeletePrevious = IROHA_FN_DeletePrevious;
+static int Vcanna_fn_KillToEndOfLine = IROHA_FN_KillToEndOfLine;
+static int Vcanna_fn_Henkan = IROHA_FN_Henkan;
+static int Vcanna_fn_Kakutei = IROHA_FN_Kakutei;
+static int Vcanna_fn_Extend = IROHA_FN_Extend;
+static int Vcanna_fn_Shrink = IROHA_FN_Shrink;
 #ifdef CANNA_FN_AdjustBunsetsu
-static int canna_fn_AdjustBunsetsu;
+static int Vcanna_fn_AdjustBunsetsu = CANNA_FN_AdjustBunsetsu;
 #endif
-static int canna_fn_Quit;
-static int canna_fn_ConvertAsHex;
-static int canna_fn_ConvertAsBushu;
-static int canna_fn_KouhoIchiran;
-static int canna_fn_BubunMuhenkan;
-static int canna_fn_Zenkaku;
-static int canna_fn_Hankaku;
-static int canna_fn_ToUpper;
-static int canna_fn_Capitalize;
-static int canna_fn_ToLower;
-static int canna_fn_Hiragana;
-static int canna_fn_Katakana;
-static int canna_fn_Romaji;
+static int Vcanna_fn_Quit = IROHA_FN_Quit;
+static int Vcanna_fn_ConvertAsHex = IROHA_FN_ConvertAsHex;
+static int Vcanna_fn_ConvertAsBushu = IROHA_FN_ConvertAsBushu;
+static int Vcanna_fn_KouhoIchiran = IROHA_FN_KouhoIchiran;
+static int Vcanna_fn_BubunMuhenkan = IROHA_FN_BubunMuhenkan;
+static int Vcanna_fn_Zenkaku = IROHA_FN_Zenkaku;
+static int Vcanna_fn_Hankaku = IROHA_FN_Hankaku;
+static int Vcanna_fn_ToUpper = IROHA_FN_ToUpper;
+static int Vcanna_fn_Capitalize = IROHA_FN_Capitalize;
+static int Vcanna_fn_ToLower = IROHA_FN_ToLower;
+static int Vcanna_fn_Hiragana = IROHA_FN_Hiragana;
+static int Vcanna_fn_Katakana = IROHA_FN_Katakana;
+static int Vcanna_fn_Romaji = IROHA_FN_Romaji;
 #ifdef CANNA_FN_BaseHiragana
-static int canna_fn_BaseHiragana;
-static int canna_fn_BaseKatakana;
-static int canna_fn_BaseEisu;
-static int canna_fn_BaseZenkaku;
-static int canna_fn_BaseHankaku;
-static int canna_fn_BaseKana;
-static int canna_fn_BaseKakutei;
-static int canna_fn_BaseHenkan;
-static int canna_fn_BaseHiraKataToggle;
-static int canna_fn_BaseZenHanToggle;
-static int canna_fn_BaseKanaEisuToggle;
-static int canna_fn_BaseKakuteiHenkanToggle;
-static int canna_fn_BaseRotateForward;
-static int canna_fn_BaseRotateBackward;
+static int Vcanna_fn_BaseHiragana = CANNA_FN_BaseHiragana;
+static int Vcanna_fn_BaseKatakana = CANNA_FN_BaseKatakana;
+static int Vcanna_fn_BaseEisu = CANNA_FN_BaseEisu;
+static int Vcanna_fn_BaseZenkaku = CANNA_FN_BaseZenkaku;
+static int Vcanna_fn_BaseHankaku = CANNA_FN_BaseHankaku;
+static int Vcanna_fn_BaseKana = CANNA_FN_BaseKana;
+static int Vcanna_fn_BaseKakutei = CANNA_FN_BaseKakutei;
+static int Vcanna_fn_BaseHenkan = CANNA_FN_BaseHenkan;
+static int Vcanna_fn_BaseHiraKataToggle = CANNA_FN_BaseHiraKataToggle;
+static int Vcanna_fn_BaseZenHanToggle = CANNA_FN_BaseZenHanToggle;
+static int Vcanna_fn_BaseKanaEisuToggle = CANNA_FN_BaseKanaEisuToggle;
+static int Vcanna_fn_BaseKakuteiHenkanToggle =
+  CANNA_FN_BaseKakuteiHenkanToggle;
+static int Vcanna_fn_BaseRotateForward = CANNA_FN_BaseRotateForward;
+static int Vcanna_fn_BaseRotateBackward = CANNA_FN_BaseRotateBackward;
 #endif
-static int canna_fn_ExtendMode;
-static int canna_fn_Touroku;
-static int canna_fn_HexMode;
-static int canna_fn_BushuMode;
-static int canna_fn_KigouMode;
+static int Vcanna_fn_ExtendMode = IROHA_FN_ExtendMode;
+static int Vcanna_fn_Touroku = IROHA_FN_Touroku;
+static int Vcanna_fn_HexMode = IROHA_FN_HexMode;
+static int Vcanna_fn_BushuMode = IROHA_FN_BushuMode;
+static int Vcanna_fn_KigouMode = IROHA_FN_KigouMode;
 #ifdef CANNA_FN_Mark
-static int canna_fn_Mark;
+static int Vcanna_fn_Mark = CANNA_FN_Mark;
 #endif
 #ifdef CANNA_FN_TemporalMode
-static int canna_fn_TemporalMode;
+static int Vcanna_fn_TemporalMode = CANNA_FN_TemporalMode;
 #endif
 
-static int canna_key_Nfer;
-static int canna_key_Xfer;
-static int canna_key_Up;
-static int canna_key_Left;
-static int canna_key_Right;
-static int canna_key_Down;
-static int canna_key_Insert;
-static int canna_key_Rollup;
-static int canna_key_Rolldown;
-static int canna_key_Home;
-static int canna_key_Help;
-static int canna_key_KP_Key;
-static int canna_key_Shift_Nfer;
-static int canna_key_Shift_Xfer;
-static int canna_key_Shift_Up;
-static int canna_key_Shift_Left;
-static int canna_key_Shift_Right;
-static int canna_key_Shift_Down;
-static int canna_key_Cntrl_Nfer;
-static int canna_key_Cntrl_Xfer;
-static int canna_key_Cntrl_Up;
-static int canna_key_Cntrl_Left;
-static int canna_key_Cntrl_Right;
-static int canna_key_Cntrl_Down;
+static int Vcanna_key_Nfer = IROHA_KEY_Nfer;
+static int Vcanna_key_Xfer = IROHA_KEY_Xfer;
+static int Vcanna_key_Up = IROHA_KEY_Up;
+static int Vcanna_key_Left = IROHA_KEY_Left;
+static int Vcanna_key_Right = IROHA_KEY_Right;
+static int Vcanna_key_Down = IROHA_KEY_Down;
+static int Vcanna_key_Insert = IROHA_KEY_Insert;
+static int Vcanna_key_Rollup = IROHA_KEY_Rollup;
+static int Vcanna_key_Rolldown = IROHA_KEY_Rolldown;
+static int Vcanna_key_Home = IROHA_KEY_Home;
+static int Vcanna_key_Help = IROHA_KEY_Help;
+static int Vcanna_key_KP_Key = IROHA_KEY_KP_Key;
+static int Vcanna_key_Shift_Nfer = IROHA_KEY_Shift_Nfer;
+static int Vcanna_key_Shift_Xfer = IROHA_KEY_Shift_Xfer;
+static int Vcanna_key_Shift_Up = IROHA_KEY_Shift_Up;
+static int Vcanna_key_Shift_Left = IROHA_KEY_Shift_Left;
+static int Vcanna_key_Shift_Right = IROHA_KEY_Shift_Right;
+static int Vcanna_key_Shift_Down = IROHA_KEY_Shift_Down;
+static int Vcanna_key_Cntrl_Nfer = IROHA_KEY_Cntrl_Nfer;
+static int Vcanna_key_Cntrl_Xfer = IROHA_KEY_Cntrl_Xfer;
+static int Vcanna_key_Cntrl_Up = IROHA_KEY_Cntrl_Up;
+static int Vcanna_key_Cntrl_Left = IROHA_KEY_Cntrl_Left;
+static int Vcanna_key_Cntrl_Right = IROHA_KEY_Cntrl_Right;
+static int Vcanna_key_Cntrl_Down = IROHA_KEY_Cntrl_Down;
 
 Lisp_Object VCANNA; /* by MORIOKA Tomohiko <morioka@jaist.ac.jp>
                          1996/6/7 */
@@ -1024,7 +1025,7 @@ syms_of_mule_canna (void)
 {
   DEFVAR_LISP ("CANNA", &VCANNA);              /* hir@nec, 1992.5.21 */
   VCANNA = Qt;                                 /* hir@nec, 1992.5.21 */
-
+  
   DEFSUBR (Fcanna_key_proc);
   DEFSUBR (Fcanna_initialize);
   DEFSUBR (Fcanna_finalize);
@@ -1051,721 +1052,464 @@ vars_of_mule_canna (void)
   DEFVAR_LISP ("canna-kakutei-string", &Vcanna_kakutei_string /*
 
 */ );
-  Vcanna_kakutei_string = Qnil;
-
   DEFVAR_LISP ("canna-kakutei-yomi",   &Vcanna_kakutei_yomi /*
 
 */ );
-  Vcanna_kakutei_yomi = Qnil;
-
   DEFVAR_LISP ("canna-kakutei-romaji", &Vcanna_kakutei_romaji /*
 
 */ );
-  Vcanna_kakutei_romaji = Qnil;
-
   DEFVAR_LISP ("canna-henkan-string",  &Vcanna_henkan_string /*
 
 */ );
-  Vcanna_henkan_string = Qnil;
-
-  DEFVAR_INT ("canna-henkan-length",  &canna_henkan_length /*
+  DEFVAR_INT ("canna-henkan-length",  &Vcanna_henkan_length /*
 
 */ );
-  canna_henkan_length = 0;
-
-  DEFVAR_INT ("canna-henkan-revpos",  &canna_henkan_revPos /*
+  DEFVAR_INT ("canna-henkan-revpos",  &Vcanna_henkan_revPos /*
 
 */ );
-  canna_henkan_revPos = 0;
-
-  DEFVAR_INT ("canna-henkan-revlen",  &canna_henkan_revLen /*
+  DEFVAR_INT ("canna-henkan-revlen",  &Vcanna_henkan_revLen /*
 
 */ );
-  canna_henkan_revLen = 0;
-
   DEFVAR_LISP ("canna-ichiran-string", &Vcanna_ichiran_string /*
 
 */ );
-  Vcanna_ichiran_string = Qnil;
-
-  DEFVAR_INT ("canna-ichiran-length", &canna_ichiran_length /*
+  DEFVAR_INT ("canna-ichiran-length", &Vcanna_ichiran_length /*
 
 */ );
-  canna_ichiran_length = 0;
-
-  DEFVAR_INT ("canna-ichiran-revpos", &canna_ichiran_revPos /*
+  DEFVAR_INT ("canna-ichiran-revpos", &Vcanna_ichiran_revPos /*
 
 */ );
-  canna_ichiran_revPos = 0;
-
-  DEFVAR_INT ("canna-ichiran-revlen", &canna_ichiran_revLen /*
+  DEFVAR_INT ("canna-ichiran-revlen", &Vcanna_ichiran_revLen /*
 
 */ );
-  canna_ichiran_revLen = 0;
-
   DEFVAR_LISP ("canna-mode-string",    &Vcanna_mode_string /*
 
 */ );
-  Vcanna_mode_string = Qnil;
 
-  DEFVAR_BOOL ("canna-empty-info", &canna_empty_info /*
+  DEFVAR_BOOL ("canna-empty-info", &Vcanna_empty_info /*
 For canna
 */ );
-  canna_empty_info = 0;
-
-  DEFVAR_BOOL ("canna-through-info", &canna_through_info /*
+  DEFVAR_BOOL ("canna-through-info", &Vcanna_through_info /*
 For canna
 */ );
-  canna_through_info = 0;
-
-  DEFVAR_BOOL ("canna-underline", &canna_underline /*
+  DEFVAR_BOOL ("canna-underline", &Vcanna_underline /*
 For canna
 */ );
-  canna_underline = 0;
-
-  DEFVAR_BOOL ("canna-inhibit-hankakukana", &canna_inhibit_hankakukana /*
+  DEFVAR_BOOL ("canna-inhibit-hankakukana", &Vcanna_inhibit_hankakukana /*
 For canna
 */ );
-  canna_inhibit_hankakukana = 0;
 
-  DEFVAR_INT ("canna-mode-alpha-mode", &canna_mode_AlphaMode /*
+  DEFVAR_INT ("canna-mode-alpha-mode", &Vcanna_mode_AlphaMode /*
 
 */ );
-  canna_mode_AlphaMode = IROHA_MODE_AlphaMode;
-
-  DEFVAR_INT ("canna-mode-empty-mode", &canna_mode_EmptyMode /*
+  DEFVAR_INT ("canna-mode-empty-mode", &Vcanna_mode_EmptyMode /*
 
 */ );
-  canna_mode_EmptyMode = IROHA_MODE_EmptyMode;
-
-  DEFVAR_INT ("canna-mode-kigo-mode",  &canna_mode_KigoMode /*
+  DEFVAR_INT ("canna-mode-kigo-mode",  &Vcanna_mode_KigoMode /*
 
 */ );
-  canna_mode_KigoMode = IROHA_MODE_KigoMode;
-
-  DEFVAR_INT ("canna-mode-yomi-mode",  &canna_mode_YomiMode /*
+  DEFVAR_INT ("canna-mode-yomi-mode",  &Vcanna_mode_YomiMode /*
 
 */ );
-  canna_mode_YomiMode = IROHA_MODE_YomiMode;
-
-  DEFVAR_INT ("canna-mode-jishu-mode", &canna_mode_JishuMode /*
+  DEFVAR_INT ("canna-mode-jishu-mode", &Vcanna_mode_JishuMode /*
 
 */ );
-  canna_mode_JishuMode = IROHA_MODE_JishuMode;
-
-  DEFVAR_INT ("canna-mode-tankouho-mode", &canna_mode_TankouhoMode /*
+  DEFVAR_INT ("canna-mode-tankouho-mode", &Vcanna_mode_TankouhoMode /*
 
 */ );
-  canna_mode_TankouhoMode = IROHA_MODE_TankouhoMode;
-
-  DEFVAR_INT ("canna-mode-ichiran-mode",  &canna_mode_IchiranMode /*
+  DEFVAR_INT ("canna-mode-ichiran-mode",  &Vcanna_mode_IchiranMode /*
 
 */ );
-  canna_mode_IchiranMode = IROHA_MODE_IchiranMode;
-
-  DEFVAR_INT ("canna-mode-yes-no-mode", &canna_mode_YesNoMode /*
+  DEFVAR_INT ("canna-mode-yes-no-mode", &Vcanna_mode_YesNoMode /*
 
 */ );
-  canna_mode_YesNoMode = IROHA_MODE_YesNoMode;
-
-  DEFVAR_INT ("canna-mode-on-off-mode", &canna_mode_OnOffMode /*
+  DEFVAR_INT ("canna-mode-on-off-mode", &Vcanna_mode_OnOffMode /*
 
 */ );
-  canna_mode_OnOffMode = IROHA_MODE_OnOffMode;
-
 #ifdef CANNA_MODE_AdjustBunsetsuMode
   DEFVAR_INT ("canna-mode-adjust-bunsetsu-mode",
-             &canna_mode_AdjustBunsetsuMode /*
+             &Vcanna_mode_AdjustBunsetsuMode /*
 
 */ );
-  canna_mode_AdjustBunsetsuMode = CANNA_MODE_AdjustBunsetsuMode;
 #endif
 #ifdef CANNA_MODE_ChikujiYomiMode
-  DEFVAR_INT ("canna-mode-chikuji-yomi-mode", &canna_mode_ChikujiYomiMode /*
+  DEFVAR_INT ("canna-mode-chikuji-yomi-mode", &Vcanna_mode_ChikujiYomiMode /*
 
 */ );
-  canna_mode_ChikujiYomiMode = CANNA_MODE_ChikujiYomiMode;
-
   DEFVAR_INT ("canna-mode-chikuji-bunsetsu-mode",
-             &canna_mode_ChikujiTanMode /*
+             &Vcanna_mode_ChikujiTanMode /*
 
 */ );
-  canna_mode_ChikujiTanMode = CANNA_MODE_ChikujiTanMode;
 #endif
 
-  DEFVAR_INT ("canna-mode-henkan-mode", &canna_mode_HenkanMode /*
+  DEFVAR_INT ("canna-mode-henkan-mode", &Vcanna_mode_HenkanMode /*
 
 */ );
-  canna_mode_HenkanMode = IROHA_MODE_HenkanMode;
-
 #ifdef CANNA_MODE_HenkanNyuryokuMode
   DEFVAR_INT ("canna-mode-henkan-nyuuryoku-mode",
-             &canna_mode_HenkanNyuryokuMode /*
+             &Vcanna_mode_HenkanNyuryokuMode /*
 
 */ );
-  canna_mode_HenkanNyuryokuMode = CANNA_MODE_HenkanNyuryokuMode;
 #endif
 #ifdef CANNA_MODE_ZenHiraHenkanMode
   DEFVAR_INT ("canna-mode-zen-hira-henkan-mode",
-             &canna_mode_ZenHiraHenkanMode /*
+             &Vcanna_mode_ZenHiraHenkanMode /*
 
 */ );
-  canna_mode_ZenHiraHenkanMode = CANNA_MODE_ZenHiraHenkanMode;
 #ifdef CANNA_MODE_HanHiraHenkanMode
   DEFVAR_INT ("canna-mode-han-hira-henkan-mode",
-             &canna_mode_HanHiraHenkanMode /*
+             &Vcanna_mode_HanHiraHenkanMode /*
 
 */ );
-  canna_mode_HanHiraHenkanMode = CANNA_MODE_HanHiraHenkanMode;
 #endif
   DEFVAR_INT ("canna-mode-zen-kata-henkan-mode",
-             &canna_mode_ZenKataHenkanMode /*
+             &Vcanna_mode_ZenKataHenkanMode /*
 
 */ );
-  canna_mode_ZenKataHenkanMode = CANNA_MODE_ZenKataHenkanMode;
-
   DEFVAR_INT ("canna-mode-han-kata-henkan-mode",
-             &canna_mode_HanKataHenkanMode /*
+             &Vcanna_mode_HanKataHenkanMode /*
 
 */ );
-  canna_mode_HanKataHenkanMode = CANNA_MODE_HanKataHenkanMode;
-
   DEFVAR_INT ("canna-mode-zen-alpha-henkan-mode",
-             &canna_mode_ZenAlphaHenkanMode /*
+             &Vcanna_mode_ZenAlphaHenkanMode /*
 
 */ );
-  canna_mode_ZenAlphaHenkanMode = CANNA_MODE_ZenAlphaHenkanMode;
-
   DEFVAR_INT ("canna-mode-han-alpha-henkan-mode",
-             &canna_mode_HanAlphaHenkanMode /*
+             &Vcanna_mode_HanAlphaHenkanMode /*
 
 */ );
-  canna_mode_HanAlphaHenkanMode = CANNA_MODE_HanAlphaHenkanMode;
 #endif
   DEFVAR_INT ("canna-mode-zen-hira-kakutei-mode",
-             &canna_mode_ZenHiraKakuteiMode /*
+             &Vcanna_mode_ZenHiraKakuteiMode /*
 
 */ );
-  canna_mode_ZenHiraKakuteiMode = IROHA_MODE_ZenHiraKakuteiMode;
 #ifdef CANNA_MODE_HanHiraKakuteiMode
   DEFVAR_INT ("canna-mode-han-hira-kakutei-mode",
-             &canna_mode_HanHiraKakuteiMode /*
+             &Vcanna_mode_HanHiraKakuteiMode /*
 
 */ );
-  canna_mode_HanHiraKakuteiMode = CANNA_MODE_HanHiraKakuteiMode;
 #endif
   DEFVAR_INT ("canna-mode-zen-kata-kakutei-mode",
-             &canna_mode_ZenKataKakuteiMode /*
+             &Vcanna_mode_ZenKataKakuteiMode /*
 
 */ );
-  canna_mode_ZenKataKakuteiMode = IROHA_MODE_ZenKataKakuteiMode;
-
   DEFVAR_INT ("canna-mode-han-kata-kakutei-mode",
-             &canna_mode_HanKataKakuteiMode /*
+             &Vcanna_mode_HanKataKakuteiMode /*
 
 */ );
-  canna_mode_HanKataKakuteiMode = IROHA_MODE_HanKataKakuteiMode;
-
   DEFVAR_INT ("canna-mode-zen-alpha-kakutei-mode",
-             &canna_mode_ZenAlphaKakuteiMode /*
+             &Vcanna_mode_ZenAlphaKakuteiMode /*
 
 */ );
-  canna_mode_ZenAlphaKakuteiMode = IROHA_MODE_ZenAlphaKakuteiMode;
-
   DEFVAR_INT ("canna-mode-han-alpha-kakutei-mode",
-             &canna_mode_HanAlphaKakuteiMode /*
+             &Vcanna_mode_HanAlphaKakuteiMode /*
 
 */ );
-  canna_mode_HanAlphaKakuteiMode = IROHA_MODE_HanAlphaKakuteiMode;
-
-  DEFVAR_INT ("canna-mode-hex-mode", &canna_mode_HexMode /*
+  DEFVAR_INT ("canna-mode-hex-mode", &Vcanna_mode_HexMode /*
 
 */ );
-  canna_mode_HexMode = IROHA_MODE_HexMode;
-
-  DEFVAR_INT ("canna-mode-bushu-mode", &canna_mode_BushuMode /*
+  DEFVAR_INT ("canna-mode-bushu-mode", &Vcanna_mode_BushuMode /*
 
 */ );
-  canna_mode_BushuMode = IROHA_MODE_BushuMode;
-
-  DEFVAR_INT ("canna-mode-extend-mode", &canna_mode_ExtendMode /*
+  DEFVAR_INT ("canna-mode-extend-mode", &Vcanna_mode_ExtendMode /*
 
 */ );
-  canna_mode_ExtendMode = IROHA_MODE_ExtendMode;
-
-  DEFVAR_INT ("canna-mode-russian-mode", &canna_mode_RussianMode /*
+  DEFVAR_INT ("canna-mode-russian-mode", &Vcanna_mode_RussianMode /*
 
 */ );
-  canna_mode_RussianMode = IROHA_MODE_RussianMode;
-
-  DEFVAR_INT ("canna-mode-greek-mode", &canna_mode_GreekMode /*
+  DEFVAR_INT ("canna-mode-greek-mode", &Vcanna_mode_GreekMode /*
 
 */ );
-  canna_mode_GreekMode = IROHA_MODE_GreekMode;
-
-  DEFVAR_INT ("canna-mode-line-mode", &canna_mode_LineMode /*
+  DEFVAR_INT ("canna-mode-line-mode", &Vcanna_mode_LineMode /*
 
 */ );
-  canna_mode_LineMode = IROHA_MODE_LineMode;
-
   DEFVAR_INT ("canna-mode-changing-server-mode",
-             &canna_mode_ChangingServerMode /*
+             &Vcanna_mode_ChangingServerMode /*
 
 */ );
-  canna_mode_ChangingServerMode = IROHA_MODE_ChangingServerMode;
-
   DEFVAR_INT ("canna-mode-henkan-method-mode",
-             &canna_mode_HenkanMethodMode /*
+             &Vcanna_mode_HenkanMethodMode /*
 
 */ );
-  canna_mode_HenkanMethodMode = IROHA_MODE_HenkanMethodMode;
-
-  DEFVAR_INT ("canna-mode-delete-dic-mode", &canna_mode_DeleteDicMode /*
+  DEFVAR_INT ("canna-mode-delete-dic-mode", &Vcanna_mode_DeleteDicMode /*
 
 */ );
-  canna_mode_DeleteDicMode = IROHA_MODE_DeleteDicMode;
-
-  DEFVAR_INT ("canna-mode-touroku-mode", &canna_mode_TourokuMode /*
+  DEFVAR_INT ("canna-mode-touroku-mode", &Vcanna_mode_TourokuMode /*
 
 */ );
-  canna_mode_TourokuMode = IROHA_MODE_TourokuMode;
-
   DEFVAR_INT ("canna-mode-touroku-empty-mode",
-             &canna_mode_TourokuEmptyMode /*
+             &Vcanna_mode_TourokuEmptyMode /*
 
 */ );
-  canna_mode_TourokuEmptyMode = IROHA_MODE_TourokuEmptyMode;
-
   DEFVAR_INT ("canna-mode-touroku-hinshi-mode",
-             &canna_mode_TourokuHinshiMode /*
+             &Vcanna_mode_TourokuHinshiMode /*
 
 */ );
-  canna_mode_TourokuHinshiMode = IROHA_MODE_TourokuHinshiMode;
-
-  DEFVAR_INT ("canna-mode-touroku-dic-mode", &canna_mode_TourokuDicMode /*
+  DEFVAR_INT ("canna-mode-touroku-dic-mode", &Vcanna_mode_TourokuDicMode /*
 
 */ );
-  canna_mode_TourokuDicMode = IROHA_MODE_TourokuDicMode;
-
   DEFVAR_INT ("canna-mode-quoted-insert-mode",
-             &canna_mode_QuotedInsertMode /*
+             &Vcanna_mode_QuotedInsertMode /*
 
 */ );
-  canna_mode_QuotedInsertMode = IROHA_MODE_QuotedInsertMode;
-
   DEFVAR_INT ("canna-mode-bubun-muhenkan-mode",
-             &canna_mode_BubunMuhenkanMode /*
+             &Vcanna_mode_BubunMuhenkanMode /*
 
 */ );
-  canna_mode_BubunMuhenkanMode = IROHA_MODE_BubunMuhenkanMode;
-
-  DEFVAR_INT ("canna-mode-mount-dic-mode", &canna_mode_MountDicMode /*
+  DEFVAR_INT ("canna-mode-mount-dic-mode", &Vcanna_mode_MountDicMode /*
 
 */ );
-  canna_mode_MountDicMode = IROHA_MODE_MountDicMode;
 
-  DEFVAR_INT ("canna-func-self-insert", &canna_fn_SelfInsert  /*
+  DEFVAR_INT ("canna-func-self-insert", &Vcanna_fn_SelfInsert  /*
 
 */ );
-  canna_fn_SelfInsert = IROHA_FN_SelfInsert;
-
-  DEFVAR_INT ("canna-func-functional-insert", &canna_fn_FunctionalInsert  /*
+  DEFVAR_INT ("canna-func-functional-insert", &Vcanna_fn_FunctionalInsert  /*
 
 */ );
-  canna_fn_FunctionalInsert = IROHA_FN_FunctionalInsert;
-
-  DEFVAR_INT ("canna-func-quoted-insert", &canna_fn_QuotedInsert  /*
+  DEFVAR_INT ("canna-func-quoted-insert", &Vcanna_fn_QuotedInsert  /*
 
 */ );
-  canna_fn_QuotedInsert = IROHA_FN_QuotedInsert;
-
-  DEFVAR_INT ("canna-func-japanese-mode", &canna_fn_JapaneseMode  /*
+  DEFVAR_INT ("canna-func-japanese-mode", &Vcanna_fn_JapaneseMode  /*
 
 */ );
-  canna_fn_JapaneseMode = IROHA_FN_JapaneseMode;
-
-  DEFVAR_INT ("canna-func-alpha-mode", &canna_fn_AlphaMode  /*
+  DEFVAR_INT ("canna-func-alpha-mode", &Vcanna_fn_AlphaMode  /*
 
 */ );
-  canna_fn_AlphaMode = IROHA_FN_AlphaMode;
-
   DEFVAR_INT ("canna-func-henkan-nyuryoku-mode",
-             &canna_fn_HenkanNyuryokuMode  /*
+             &Vcanna_fn_HenkanNyuryokuMode  /*
 
 */ );
-  canna_fn_HenkanNyuryokuMode = IROHA_FN_HenkanNyuryokuMode;
-
-  DEFVAR_INT ("canna-func-forward", &canna_fn_Forward  /*
+  DEFVAR_INT ("canna-func-forward", &Vcanna_fn_Forward  /*
 
 */ );
-  canna_fn_Forward = IROHA_FN_Forward;
-
-  DEFVAR_INT ("canna-func-backward", &canna_fn_Backward  /*
+  DEFVAR_INT ("canna-func-backward", &Vcanna_fn_Backward  /*
 
 */ );
-  canna_fn_Backward = IROHA_FN_Backward;
-
-  DEFVAR_INT ("canna-func-next", &canna_fn_Next  /*
+  DEFVAR_INT ("canna-func-next", &Vcanna_fn_Next  /*
 
 */ );
-  canna_fn_Next = IROHA_FN_Next;
-
-  DEFVAR_INT ("canna-func-previous", &canna_fn_Prev  /*
+  DEFVAR_INT ("canna-func-previous", &Vcanna_fn_Prev  /*
 
 */ );
-  canna_fn_Prev = IROHA_FN_Prev;
-
-  DEFVAR_INT ("canna-func-beginning-of-line", &canna_fn_BeginningOfLine  /*
+  DEFVAR_INT ("canna-func-beginning-of-line", &Vcanna_fn_BeginningOfLine  /*
 
 */ );
-  canna_fn_BeginningOfLine = IROHA_FN_BeginningOfLine;
-
-  DEFVAR_INT ("canna-func-end-of-line", &canna_fn_EndOfLine  /*
+  DEFVAR_INT ("canna-func-end-of-line", &Vcanna_fn_EndOfLine  /*
 
 */ );
-  canna_fn_EndOfLine = IROHA_FN_EndOfLine;
-
-  DEFVAR_INT ("canna-func-delete-next", &canna_fn_DeleteNext  /*
+  DEFVAR_INT ("canna-func-delete-next", &Vcanna_fn_DeleteNext  /*
 
 */ );
-  canna_fn_DeleteNext = IROHA_FN_DeleteNext;
-
-  DEFVAR_INT ("canna-func-delete_previous", &canna_fn_DeletePrevious  /*
+  DEFVAR_INT ("canna-func-delete_previous", &Vcanna_fn_DeletePrevious  /*
 
 */ );
-  canna_fn_DeletePrevious = IROHA_FN_DeletePrevious;
-
-  DEFVAR_INT ("canna-func-kill-to-end-of-line", &canna_fn_KillToEndOfLine /*
+  DEFVAR_INT ("canna-func-kill-to-end-of-line", &Vcanna_fn_KillToEndOfLine /*
 
 */ );
-  canna_fn_KillToEndOfLine = IROHA_FN_KillToEndOfLine;
-
-  DEFVAR_INT ("canna-func-henkan", &canna_fn_Henkan  /*
+  DEFVAR_INT ("canna-func-henkan", &Vcanna_fn_Henkan  /*
 
 */ );
-  canna_fn_Henkan = IROHA_FN_Henkan;
-
-  DEFVAR_INT ("canna-func-kakutei", &canna_fn_Kakutei  /*
+  DEFVAR_INT ("canna-func-kakutei", &Vcanna_fn_Kakutei  /*
 
 */ );
-  canna_fn_Kakutei = IROHA_FN_Kakutei;
-
-  DEFVAR_INT ("canna-func-extend", &canna_fn_Extend  /*
+  DEFVAR_INT ("canna-func-extend", &Vcanna_fn_Extend  /*
 
 */ );
-  canna_fn_Extend = IROHA_FN_Extend;
-
-  DEFVAR_INT ("canna-func-shrink", &canna_fn_Shrink  /*
+  DEFVAR_INT ("canna-func-shrink", &Vcanna_fn_Shrink  /*
 
 */ );
-  canna_fn_Shrink = IROHA_FN_Shrink;
-
 #ifdef CANNA_FN_AdjustBunsetsu
-  DEFVAR_INT ("canna-func-adjust-bunsetsu", &canna_fn_AdjustBunsetsu  /*
+  DEFVAR_INT ("canna-func-adjust-bunsetsu", &Vcanna_fn_AdjustBunsetsu  /*
 
 */ );
-  canna_fn_AdjustBunsetsu = CANNA_FN_AdjustBunsetsu;
 #endif
-  DEFVAR_INT ("canna-func-quit", &canna_fn_Quit  /*
+  DEFVAR_INT ("canna-func-quit", &Vcanna_fn_Quit  /*
 
 */ );
-  canna_fn_Quit = IROHA_FN_Quit;
-
-  DEFVAR_INT ("canna-func-convert-as-hex", &canna_fn_ConvertAsHex  /*
+  DEFVAR_INT ("canna-func-convert-as-hex", &Vcanna_fn_ConvertAsHex  /*
 
 */ );
-  canna_fn_ConvertAsHex = IROHA_FN_ConvertAsHex;
-
-  DEFVAR_INT ("canna-func-convert-as-bushu", &canna_fn_ConvertAsBushu  /*
+  DEFVAR_INT ("canna-func-convert-as-bushu", &Vcanna_fn_ConvertAsBushu  /*
 
 */ );
-  canna_fn_ConvertAsBushu = IROHA_FN_ConvertAsBushu;
-
-  DEFVAR_INT ("canna-func-kouho-ichiran", &canna_fn_KouhoIchiran  /*
+  DEFVAR_INT ("canna-func-kouho-ichiran", &Vcanna_fn_KouhoIchiran  /*
 
 */ );
-  canna_fn_KouhoIchiran = IROHA_FN_KouhoIchiran;
-
-  DEFVAR_INT ("canna-func-bubun-muhenkan", &canna_fn_BubunMuhenkan  /*
+  DEFVAR_INT ("canna-func-bubun-muhenkan", &Vcanna_fn_BubunMuhenkan  /*
 
 */ );
-  canna_fn_BubunMuhenkan = IROHA_FN_BubunMuhenkan;
-
-  DEFVAR_INT ("canna-func-zenkaku", &canna_fn_Zenkaku  /*
+  DEFVAR_INT ("canna-func-zenkaku", &Vcanna_fn_Zenkaku  /*
 
 */ );
-  canna_fn_Zenkaku = IROHA_FN_Zenkaku;
-
-  DEFVAR_INT ("canna-func-hankaku", &canna_fn_Hankaku  /*
+  DEFVAR_INT ("canna-func-hankaku", &Vcanna_fn_Hankaku  /*
 
 */ );
-  canna_fn_Hankaku = IROHA_FN_Hankaku;
-
-  DEFVAR_INT ("canna-func-to-upper", &canna_fn_ToUpper  /*
+  DEFVAR_INT ("canna-func-to-upper", &Vcanna_fn_ToUpper  /*
 
 */ );
-  canna_fn_ToUpper = IROHA_FN_ToUpper;
-
-  DEFVAR_INT ("canna-func-capitalize", &canna_fn_Capitalize  /*
+  DEFVAR_INT ("canna-func-capitalize", &Vcanna_fn_Capitalize  /*
 
 */ );
-  canna_fn_Capitalize = IROHA_FN_Capitalize;
-
-  DEFVAR_INT ("canna-func-to-lower", &canna_fn_ToLower  /*
+  DEFVAR_INT ("canna-func-to-lower", &Vcanna_fn_ToLower  /*
 
 */ );
-  canna_fn_ToLower = IROHA_FN_ToLower;
-
-  DEFVAR_INT ("canna-func-hiragana", &canna_fn_Hiragana  /*
+  DEFVAR_INT ("canna-func-hiragana", &Vcanna_fn_Hiragana  /*
 
 */ );
-  canna_fn_Hiragana = IROHA_FN_Hiragana;
-
-  DEFVAR_INT ("canna-func-katakana", &canna_fn_Katakana  /*
+  DEFVAR_INT ("canna-func-katakana", &Vcanna_fn_Katakana  /*
 
 */ );
-  canna_fn_Katakana = IROHA_FN_Katakana;
-
-  DEFVAR_INT ("canna-func-romaji", &canna_fn_Romaji  /*
+  DEFVAR_INT ("canna-func-romaji", &Vcanna_fn_Romaji  /*
 
 */ );
-  canna_fn_Romaji = IROHA_FN_Romaji;
-
 #ifdef CANNA_FN_BaseHiragana
-  DEFVAR_INT ("canna-func-base-hiragana", &canna_fn_BaseHiragana  /*
+  DEFVAR_INT ("canna-func-base-hiragana", &Vcanna_fn_BaseHiragana  /*
 
 */ );
-  canna_fn_BaseHiragana = CANNA_FN_BaseHiragana;
-
-  DEFVAR_INT ("canna-func-base-katakana", &canna_fn_BaseKatakana  /*
+  DEFVAR_INT ("canna-func-base-katakana", &Vcanna_fn_BaseKatakana  /*
 
 */ );
-  canna_fn_BaseKatakana = CANNA_FN_BaseKatakana;
-
-  DEFVAR_INT ("canna-func-base-eisu", &canna_fn_BaseEisu  /*
+  DEFVAR_INT ("canna-func-base-eisu", &Vcanna_fn_BaseEisu  /*
 
 */ );
-  canna_fn_BaseEisu = CANNA_FN_BaseEisu;
-
-  DEFVAR_INT ("canna-func-base-zenkaku", &canna_fn_BaseZenkaku  /*
+  DEFVAR_INT ("canna-func-base-zenkaku", &Vcanna_fn_BaseZenkaku  /*
 
 */ );
-  canna_fn_BaseZenkaku = CANNA_FN_BaseZenkaku;
-
-  DEFVAR_INT ("canna-func-base-hankaku", &canna_fn_BaseHankaku  /*
+  DEFVAR_INT ("canna-func-base-hankaku", &Vcanna_fn_BaseHankaku  /*
 
 */ );
-  canna_fn_BaseHankaku = CANNA_FN_BaseHankaku;
-
-  DEFVAR_INT ("canna-func-base-kana", &canna_fn_BaseKana  /*
+  DEFVAR_INT ("canna-func-base-kana", &Vcanna_fn_BaseKana  /*
 
 */ );
-  canna_fn_BaseKana = CANNA_FN_BaseKana;
-
-  DEFVAR_INT ("canna-func-base-kakutei", &canna_fn_BaseKakutei  /*
+  DEFVAR_INT ("canna-func-base-kakutei", &Vcanna_fn_BaseKakutei  /*
 
 */ );
-  canna_fn_BaseKakutei = CANNA_FN_BaseKakutei;
-
-  DEFVAR_INT ("canna-func-base-henkan", &canna_fn_BaseHenkan  /*
+  DEFVAR_INT ("canna-func-base-henkan", &Vcanna_fn_BaseHenkan  /*
 
 */ );
-  canna_fn_BaseHenkan = CANNA_FN_BaseHenkan;
-
   DEFVAR_INT ("canna-func-base-hiragana-katakana-toggle",
-             &canna_fn_BaseHiraKataToggle  /*
+             &Vcanna_fn_BaseHiraKataToggle  /*
 
 */ );
-  canna_fn_BaseHiraKataToggle = CANNA_FN_BaseHiraKataToggle;
-
   DEFVAR_INT ("canna-func-base-zenkaku-hankaku-toggle",
-             &canna_fn_BaseZenHanToggle  /*
+             &Vcanna_fn_BaseZenHanToggle  /*
 
 */ );
-  canna_fn_BaseZenHanToggle = CANNA_FN_BaseZenHanToggle;
-
   DEFVAR_INT ("canna-func-base-kana-eisu-toggle",
-             &canna_fn_BaseKanaEisuToggle  /*
+             &Vcanna_fn_BaseKanaEisuToggle  /*
 
 */ );
-  canna_fn_BaseKanaEisuToggle = CANNA_FN_BaseKanaEisuToggle;
-
   DEFVAR_INT ("canna-func-base-kakutei-henkan-toggle",
-             &canna_fn_BaseKakuteiHenkanToggle  /*
+             &Vcanna_fn_BaseKakuteiHenkanToggle  /*
 
 */ );
-  canna_fn_BaseKakuteiHenkanToggle = CANNA_FN_BaseKakuteiHenkanToggle;
-
   DEFVAR_INT ("canna-func-base-rotate-forward",
-             &canna_fn_BaseRotateForward  /*
+             &Vcanna_fn_BaseRotateForward  /*
 
 */ );
-  canna_fn_BaseRotateForward = CANNA_FN_BaseRotateForward;
-
   DEFVAR_INT ("canna-func-base-rotate-backward",
-             &canna_fn_BaseRotateBackward  /*
+             &Vcanna_fn_BaseRotateBackward  /*
 
 */ );
-  canna_fn_BaseRotateBackward = CANNA_FN_BaseRotateBackward;
-
 #endif
-  DEFVAR_INT ("canna-func-extend-mode", &canna_fn_ExtendMode  /*
+  DEFVAR_INT ("canna-func-extend-mode", &Vcanna_fn_ExtendMode  /*
 
 */ );
-  canna_fn_ExtendMode = IROHA_FN_ExtendMode;
-
-  DEFVAR_INT ("canna-func-touroku", &canna_fn_Touroku  /*
+  DEFVAR_INT ("canna-func-touroku", &Vcanna_fn_Touroku  /*
 
 */ );
-  canna_fn_Touroku = IROHA_FN_Touroku;
-
-  DEFVAR_INT ("canna-func-hex-mode", &canna_fn_HexMode  /*
+  DEFVAR_INT ("canna-func-hex-mode", &Vcanna_fn_HexMode  /*
 
 */ );
-  canna_fn_HexMode = IROHA_FN_HexMode;
-
-  DEFVAR_INT ("canna-func-bushu-mode", &canna_fn_BushuMode  /*
+  DEFVAR_INT ("canna-func-bushu-mode", &Vcanna_fn_BushuMode  /*
 
 */ );
-  canna_fn_BushuMode = IROHA_FN_BushuMode;
-
-  DEFVAR_INT ("canna-func-kigo-mode", &canna_fn_KigouMode  /*
+  DEFVAR_INT ("canna-func-kigo-mode", &Vcanna_fn_KigouMode  /*
 
 */ );
-  canna_fn_KigouMode = IROHA_FN_KigouMode;
-
 #ifdef CANNA_FN_Mark
-  DEFVAR_INT ("canna-func-mark", &canna_fn_Mark  /*
+  DEFVAR_INT ("canna-func-mark", &Vcanna_fn_Mark  /*
 
 */ );
-  canna_fn_Mark = CANNA_FN_Mark;
 #endif
 #ifdef CANNA_FN_TemporalMode
-  DEFVAR_INT ("canna-func-temporal-mode", &canna_fn_TemporalMode  /*
+  DEFVAR_INT ("canna-func-temporal-mode", &Vcanna_fn_TemporalMode  /*
 
 */ );
-  canna_fn_TemporalMode = CANNA_FN_TemporalMode;
 #endif
 
-  DEFVAR_INT ("canna-key-nfer", &canna_key_Nfer /*
+  DEFVAR_INT ("canna-key-nfer", &Vcanna_key_Nfer /*
 
 */ );
-  canna_key_Nfer = IROHA_KEY_Nfer;
-
-  DEFVAR_INT ("canna-key-xfer", &canna_key_Xfer /*
+  DEFVAR_INT ("canna-key-xfer", &Vcanna_key_Xfer /*
 
 */ );
-  canna_key_Xfer = IROHA_KEY_Xfer;
-
-  DEFVAR_INT ("canna-key-up", &canna_key_Up /*
+  DEFVAR_INT ("canna-key-up", &Vcanna_key_Up /*
 
 */ );
-  canna_key_Up = IROHA_KEY_Up;
-
-  DEFVAR_INT ("canna-key-left", &canna_key_Left /*
+  DEFVAR_INT ("canna-key-left", &Vcanna_key_Left /*
 
 */ );
-  canna_key_Left = IROHA_KEY_Left;
-
-  DEFVAR_INT ("canna-key-right", &canna_key_Right /*
+  DEFVAR_INT ("canna-key-right", &Vcanna_key_Right /*
 
 */ );
-  canna_key_Right = IROHA_KEY_Right;
-
-  DEFVAR_INT ("canna-key-down", &canna_key_Down /*
+  DEFVAR_INT ("canna-key-down", &Vcanna_key_Down /*
 
 */ );
-  canna_key_Down = IROHA_KEY_Down;
-
-  DEFVAR_INT ("canna-key-insert", &canna_key_Insert /*
+  DEFVAR_INT ("canna-key-insert", &Vcanna_key_Insert /*
 
 */ );
-  canna_key_Insert = IROHA_KEY_Insert;
-
-  DEFVAR_INT ("canna-key-rollup", &canna_key_Rollup /*
+  DEFVAR_INT ("canna-key-rollup", &Vcanna_key_Rollup /*
 
 */ );
-  canna_key_Rollup = IROHA_KEY_Rollup;
-
-  DEFVAR_INT ("canna-key-rolldown", &canna_key_Rolldown /*
+  DEFVAR_INT ("canna-key-rolldown", &Vcanna_key_Rolldown /*
 
 */ );
-  canna_key_Rolldown = IROHA_KEY_Rolldown;
-
-  DEFVAR_INT ("canna-key-home", &canna_key_Home /*
+  DEFVAR_INT ("canna-key-home", &Vcanna_key_Home /*
 
 */ );
-  canna_key_Home = IROHA_KEY_Home;
-
-  DEFVAR_INT ("canna-key-help", &canna_key_Help /*
+  DEFVAR_INT ("canna-key-help", &Vcanna_key_Help /*
 
 */ );
-  canna_key_Help = IROHA_KEY_Help;
-
-  DEFVAR_INT ("canna-key-kp-key", &canna_key_KP_Key /*
+  DEFVAR_INT ("canna-key-kp-key", &Vcanna_key_KP_Key /*
 
 */ );
-  canna_key_KP_Key = IROHA_KEY_KP_Key;
-
-  DEFVAR_INT ("canna-key-shift-nfer", &canna_key_Shift_Nfer /*
+  DEFVAR_INT ("canna-key-shift-nfer", &Vcanna_key_Shift_Nfer /*
 
 */ );
-  canna_key_Shift_Nfer = IROHA_KEY_Shift_Nfer;
-
-  DEFVAR_INT ("canna-key-shift-xfer", &canna_key_Shift_Xfer /*
+  DEFVAR_INT ("canna-key-shift-xfer", &Vcanna_key_Shift_Xfer /*
 
 */ );
-  canna_key_Shift_Xfer = IROHA_KEY_Shift_Xfer;
-
-  DEFVAR_INT ("canna-key-shift-up", &canna_key_Shift_Up /*
+  DEFVAR_INT ("canna-key-shift-up", &Vcanna_key_Shift_Up /*
 
 */ );
-  canna_key_Shift_Up = IROHA_KEY_Shift_Up;
-
-  DEFVAR_INT ("canna-key-shift-left", &canna_key_Shift_Left /*
+  DEFVAR_INT ("canna-key-shift-left", &Vcanna_key_Shift_Left /*
 
 */ );
-  canna_key_Shift_Left = IROHA_KEY_Shift_Left;
-
-  DEFVAR_INT ("canna-key-shift-right", &canna_key_Shift_Right /*
+  DEFVAR_INT ("canna-key-shift-right", &Vcanna_key_Shift_Right /*
 
 */ );
-  canna_key_Shift_Right = IROHA_KEY_Shift_Right;
-
-  DEFVAR_INT ("canna-key-shift-down", &canna_key_Shift_Down /*
+  DEFVAR_INT ("canna-key-shift-down", &Vcanna_key_Shift_Down /*
 
 */ );
-  canna_key_Shift_Down = IROHA_KEY_Shift_Down;
-
-  DEFVAR_INT ("canna-key-control-nfer", &canna_key_Cntrl_Nfer /*
+  DEFVAR_INT ("canna-key-control-nfer", &Vcanna_key_Cntrl_Nfer /*
 
 */ );
-  canna_key_Cntrl_Nfer = IROHA_KEY_Cntrl_Nfer;
-
-  DEFVAR_INT ("canna-key-control-xfer", &canna_key_Cntrl_Xfer /*
+  DEFVAR_INT ("canna-key-control-xfer", &Vcanna_key_Cntrl_Xfer /*
 
 */ );
-  canna_key_Cntrl_Xfer = IROHA_KEY_Cntrl_Xfer;
-
-  DEFVAR_INT ("canna-key-control-up", &canna_key_Cntrl_Up /*
+  DEFVAR_INT ("canna-key-control-up", &Vcanna_key_Cntrl_Up /*
 
 */ );
-  canna_key_Cntrl_Up = IROHA_KEY_Cntrl_Up;
-
-  DEFVAR_INT ("canna-key-control-left", &canna_key_Cntrl_Left /*
+  DEFVAR_INT ("canna-key-control-left", &Vcanna_key_Cntrl_Left /*
 
 */ );
-  canna_key_Cntrl_Left = IROHA_KEY_Cntrl_Left;
-
-  DEFVAR_INT ("canna-key-control-right", &canna_key_Cntrl_Right /*
+  DEFVAR_INT ("canna-key-control-right", &Vcanna_key_Cntrl_Right /*
 
 */ );
-  canna_key_Cntrl_Right = IROHA_KEY_Cntrl_Right;
-
-  DEFVAR_INT ("canna-key-control-down", &canna_key_Cntrl_Down /*
+  DEFVAR_INT ("canna-key-control-down", &Vcanna_key_Cntrl_Down /*
 
 */ );
-  canna_key_Cntrl_Down = IROHA_KEY_Cntrl_Down;
 
   Fprovide(intern("CANNA"));
 }
@@ -1780,7 +1524,7 @@ static void
 c2mu (char *cp, int l, char *mp)
 {
   char ch, *ep = cp+l;
-
+  
   while ((cp < ep) && (ch = *cp))
     {
       if ((unsigned char) ch == ISO_CODE_SS2)
@@ -1809,8 +1553,8 @@ c2mu (char *cp, int l, char *mp)
 static void
 m2c (unsigned char *mp, int l, unsigned char *cp)
 {
-  unsigned char        ch, *ep = mp + l;
-
+  unsigned char        ch, *ep = mp + l;;
+  
   while ((mp < ep) && (ch = *mp++))
     {
       switch (ch)
@@ -1829,7 +1573,7 @@ m2c (unsigned char *mp, int l, unsigned char *cp)
          *cp++ = ch;
          break;
        }
-    }
+    }  
   *cp = 0;
 }
 
@@ -1840,10 +1584,10 @@ static Lisp_Object
 mule_make_string (unsigned char *p, int l)
 {
   unsigned char cbuf[4096];
-
+  
   c2mu (p,l,cbuf);
   return (make_string (cbuf,strlen (cbuf)));
-}
+}      
 
 /* return the MULE internal string length of EUC string */
 /* Modified by sb to return a character count not byte count. */
@@ -1852,7 +1596,7 @@ mule_strlen (unsigned char *p, int l)
 {
   unsigned char ch, *cp = p;
   int len = 0;
-
+  
   while ((cp < p + l) && (ch = *cp))
     {
       if ((unsigned char) ch == ISO_CODE_SS2)
@@ -1873,7 +1617,7 @@ mule_strlen (unsigned char *p, int l)
       else
        {
          len++;
-         cp++;
+         cp++; 
        }
     }
   return (len);
@@ -1885,7 +1629,7 @@ count_char (unsigned char *p, int len, int pos, int rev, int *clen, int *cpos,
            int *crev)
 {
   unsigned char *q = p;
-
+  
   *clen = *cpos = *crev = 0;
   if (len == 0) return;
   while (q < p + pos)
@@ -1899,7 +1643,7 @@ count_char (unsigned char *p, int len, int pos, int rev, int *clen, int *cpos,
       (*clen)++;
       (*crev)++;
       if (*q++ & 0x80) q++;
-    }
+    }          
   while (q < p + len)
     {
       (*clen)++;
index dded758..6bf60e9 100644 (file)
@@ -844,7 +844,7 @@ ccl_driver (struct ccl_program *ccl, CONST unsigned char *source, unsigned_char_
            case CCL_MOD: reg[rrr] = i % j; break;
            case CCL_AND: reg[rrr] = i & j; break;
            case CCL_OR: reg[rrr] = i | j; break;
-           case CCL_XOR: reg[rrr] = i ^ j; break;
+           case CCL_XOR: reg[rrr] = i ^ j;; break;
            case CCL_LSH: reg[rrr] = i << j; break;
            case CCL_RSH: reg[rrr] = i >> j; break;
            case CCL_LSH8: reg[rrr] = (i << 8) | j; break;
index 6e4c96d..eb86610 100644 (file)
@@ -60,11 +60,11 @@ Lisp_Object Vcharset_chinese_cns11643_2;
 Lisp_Object Vcharset_korean_ksc5601;
 Lisp_Object Vcharset_composite;
 
-/* Hash tables for composite chars.  One maps string representing
+/* Hashtables for composite chars.  One maps string representing
    composed chars to their equivalent chars; one goes the
    other way. */
-Lisp_Object Vcomposite_char_char2string_hash_table;
-Lisp_Object Vcomposite_char_string2char_hash_table;
+Lisp_Object Vcomposite_char_char2string_hashtable;
+Lisp_Object Vcomposite_char_string2char_hashtable;
 
 /* Table of charsets indexed by leading byte. */
 Lisp_Object charset_by_leading_byte[128];
@@ -136,7 +136,7 @@ Lisp_Object Qascii, Qcontrol_1,
 
 Lisp_Object Ql2r, Qr2l;
 
-Lisp_Object Vcharset_hash_table;
+Lisp_Object Vcharset_hashtable;
 
 static Bufbyte next_allocated_1_byte_leading_byte;
 static Bufbyte next_allocated_2_byte_leading_byte;
@@ -280,7 +280,7 @@ non_ascii_valid_char_p (Emchar ch)
       if (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE == LEADING_BYTE_COMPOSITE)
        {
          if (UNBOUNDP (Fgethash (make_int (ch),
-                                 Vcomposite_char_char2string_hash_table,
+                                 Vcomposite_char_char2string_hashtable,
                                  Qunbound)))
            return 0;
          return 1;
@@ -391,9 +391,9 @@ mark_charset (Lisp_Object obj, void (*markobj) (Lisp_Object))
 {
   struct Lisp_Charset *cs = XCHARSET (obj);
 
-  markobj (cs->doc_string);
-  markobj (cs->registry);
-  markobj (cs->ccl_program);
+  (markobj) (cs->doc_string);
+  (markobj) (cs->registry);
+  (markobj) (cs->ccl_program);
   return cs->name;
 }
 
@@ -461,7 +461,7 @@ make_charset (int id, Lisp_Object name, Bufbyte leading_byte, unsigned char rep_
                                CHARSET_TYPE (cs) == CHARSET_TYPE_96) ? 1 : 2;
   CHARSET_CHARS         (cs) = (CHARSET_TYPE (cs) == CHARSET_TYPE_94 ||
                                CHARSET_TYPE (cs) == CHARSET_TYPE_94X94) ? 94 : 96;
-
+    
   if (final)
     {
       /* some charsets do not have final characters.  This includes
@@ -480,7 +480,7 @@ make_charset (int id, Lisp_Object name, Bufbyte leading_byte, unsigned char rep_
   /* Some charsets are "faux" and don't have names or really exist at
      all except in the leading-byte table. */
   if (!NILP (name))
-    Fputhash (name, obj, Vcharset_hash_table);
+    Fputhash (name, obj, Vcharset_hashtable);
   return obj;
 }
 
@@ -537,7 +537,7 @@ nil is returned.  Otherwise the associated charset object is returned.
     return charset_or_name;
 
   CHECK_SYMBOL (charset_or_name);
-  return Fgethash (charset_or_name, Vcharset_hash_table, Qnil);
+  return Fgethash (charset_or_name, Vcharset_hashtable, Qnil);
 }
 
 DEFUN ("get-charset", Fget_charset, 1, 1, 0, /*
@@ -563,15 +563,19 @@ struct charset_list_closure
 };
 
 static int
-add_charset_to_list_mapper (Lisp_Object key, Lisp_Object value,
+add_charset_to_list_mapper (CONST void *hash_key, void *hash_contents,
                            void *charset_list_closure)
 {
   /* This function can GC */
+  Lisp_Object key, contents;
+  Lisp_Object *charset_list;
   struct charset_list_closure *chcl =
     (struct charset_list_closure*) charset_list_closure;
-  Lisp_Object *charset_list = chcl->charset_list;
+  CVOID_TO_LISP (key, hash_key);
+  VOID_TO_LISP (contents, hash_contents);
+  charset_list = chcl->charset_list;
 
-  *charset_list = Fcons (XCHARSET_NAME (value), *charset_list);
+  *charset_list = Fcons (XCHARSET_NAME (contents), *charset_list);
   return 0;
 }
 
@@ -586,7 +590,7 @@ Return a list of the names of all defined charsets.
 
   GCPRO1 (charset_list);
   charset_list_closure.charset_list = &charset_list;
-  elisp_maphash (add_charset_to_list_mapper, Vcharset_hash_table,
+  elisp_maphash (add_charset_to_list_mapper, Vcharset_hashtable,
                 &charset_list_closure);
   UNGCPRO;
 
@@ -962,13 +966,13 @@ static void
 invalidate_charset_font_caches (Lisp_Object charset)
 {
   /* Invalidate font cache entries for charset on all devices. */
-  Lisp_Object devcons, concons, hash_table;
+  Lisp_Object devcons, concons, hashtab;
   DEVICE_LOOP_NO_BREAK (devcons, concons)
     {
       struct device *d = XDEVICE (XCAR (devcons));
-      hash_table = Fgethash (charset, d->charset_font_cache, Qunbound);
-      if (!UNBOUNDP (hash_table))
-        Fclrhash (hash_table);
+      hashtab = Fgethash (charset, d->charset_font_cache, Qunbound);
+      if (!UNBOUNDP (hashtab))
+        Fclrhash (hashtab);
     }
 }
 
@@ -1073,7 +1077,7 @@ lookup_composite_char (Bufbyte *str, int len)
 {
   Lisp_Object lispstr = make_string (str, len);
   Lisp_Object ch = Fgethash (lispstr,
-                            Vcomposite_char_string2char_hash_table,
+                            Vcomposite_char_string2char_hashtable,
                             Qunbound);
   Emchar emch;
 
@@ -1084,9 +1088,9 @@ lookup_composite_char (Bufbyte *str, int len)
       emch = MAKE_CHAR (Vcharset_composite, composite_char_row_next,
                        composite_char_col_next);
       Fputhash (make_char (emch), lispstr,
-               Vcomposite_char_char2string_hash_table);
+               Vcomposite_char_char2string_hashtable);
       Fputhash (lispstr, make_char (emch),
-               Vcomposite_char_string2char_hash_table);
+               Vcomposite_char_string2char_hashtable);
       composite_char_col_next++;
       if (composite_char_col_next >= 128)
        {
@@ -1103,7 +1107,7 @@ Lisp_Object
 composite_char_string (Emchar ch)
 {
   Lisp_Object str = Fgethash (make_char (ch),
-                             Vcomposite_char_char2string_hash_table,
+                             Vcomposite_char_char2string_hashtable,
                              Qunbound);
   assert (!UNBOUNDP (str));
   return str;
@@ -1230,9 +1234,9 @@ vars_of_mule_charset (void)
 void
 complex_vars_of_mule_charset (void)
 {
-  staticpro (&Vcharset_hash_table);
-  Vcharset_hash_table =
-    make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
+  staticpro (&Vcharset_hashtable);
+  Vcharset_hashtable = make_lisp_hashtable (50, HASHTABLE_NONWEAK,
+                                           HASHTABLE_EQ);
 
   /* Predefined character sets.  We store them into variables for
      ease of access. */
@@ -1245,7 +1249,7 @@ complex_vars_of_mule_charset (void)
                  build_string ("iso8859-1"));
   Vcharset_control_1 =
     make_charset (-1, Qcontrol_1, LEADING_BYTE_CONTROL_1, 2,
-                 CHARSET_TYPE_94, 1, 1, 0,
+                 CHARSET_TYPE_94, 1, 0, 0,
                  CHARSET_LEFT_TO_RIGHT,
                  build_string ("Control characters"),
                  build_string (""));
@@ -1406,11 +1410,11 @@ complex_vars_of_mule_charset (void)
   composite_char_row_next = 32;
   composite_char_col_next = 32;
 
-  Vcomposite_char_string2char_hash_table =
-    make_lisp_hash_table (500, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL);
-  Vcomposite_char_char2string_hash_table =
-    make_lisp_hash_table (500, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
-  staticpro (&Vcomposite_char_string2char_hash_table);
-  staticpro (&Vcomposite_char_char2string_hash_table);
+  Vcomposite_char_string2char_hashtable =
+    make_lisp_hashtable (500, HASHTABLE_NONWEAK, HASHTABLE_EQUAL);
+  Vcomposite_char_char2string_hashtable =
+    make_lisp_hashtable (500, HASHTABLE_NONWEAK, HASHTABLE_EQ);
+  staticpro (&Vcomposite_char_string2char_hashtable);
+  staticpro (&Vcomposite_char_char2string_hashtable);
 
 }
diff --git a/src/mule-coding.c b/src/mule-coding.c
new file mode 100644 (file)
index 0000000..a0a4ff9
--- /dev/null
@@ -0,0 +1,4807 @@
+/* Code conversion functions.
+   Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Mule 2.3.   Not in FSF. */
+
+/* Rewritten by Ben Wing <ben@xemacs.org>. */
+
+#if 0                          /* while file-coding not split up */
+
+#include <config.h>
+#include "lisp.h"
+
+#include "buffer.h"
+#include "elhash.h"
+#include "insdel.h"
+#include "lstream.h"
+#include "mule-ccl.h"
+#include "mule-coding.h"
+
+Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error;
+
+Lisp_Object Vkeyboard_coding_system;
+Lisp_Object Vterminal_coding_system;
+Lisp_Object Vcoding_system_for_read;
+Lisp_Object Vcoding_system_for_write;
+Lisp_Object Vfile_name_coding_system;
+
+/* Table of symbols identifying each coding category. */
+Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1];
+
+/* Coding system currently associated with each coding category. */
+Lisp_Object coding_category_system[CODING_CATEGORY_LAST + 1];
+
+/* Table of all coding categories in decreasing order of priority.
+   This describes a permutation of the possible coding categories. */
+int coding_category_by_priority[CODING_CATEGORY_LAST + 1];
+
+Lisp_Object Qcoding_system_p;
+
+Lisp_Object Qbig5, Qshift_jis, Qno_conversion, Qccl, Qiso2022;
+/* Qinternal in general.c */
+
+Lisp_Object Qmnemonic, Qeol_type;
+Lisp_Object Qcr, Qcrlf, Qlf;
+Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf;
+Lisp_Object Qpost_read_conversion;
+Lisp_Object Qpre_write_conversion;
+
+Lisp_Object Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3;
+Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output;
+Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output;
+Lisp_Object Qshort, Qno_ascii_eol, Qno_ascii_cntl, Qseven, Qlock_shift;
+Lisp_Object Qno_iso6429, Qescape_quoted;
+Lisp_Object Qinput_charset_conversion, Qoutput_charset_conversion;
+
+Lisp_Object Qencode, Qdecode;
+
+Lisp_Object Qctext;
+
+Lisp_Object Vcoding_system_hashtable;
+
+int enable_multibyte_characters;
+
+/* Additional information used by the ISO2022 decoder and detector. */
+struct iso2022_decoder
+{
+  /* CHARSET holds the character sets currently assigned to the G0
+     through G3 variables.  It is initialized from the array
+     INITIAL_CHARSET in CODESYS. */
+  Lisp_Object charset[4];
+
+  /* Which registers are currently invoked into the left (GL) and
+     right (GR) halves of the 8-bit encoding space? */
+  int register_left, register_right;
+
+  /* ISO_ESC holds a value indicating part of an escape sequence
+     that has already been seen. */
+  enum iso_esc_flag esc;
+
+  /* This records the bytes we've seen so far in an escape sequence,
+     in case the sequence is invalid (we spit out the bytes unchanged). */
+  unsigned char esc_bytes[8];
+
+  /* Index for next byte to store in ISO escape sequence. */
+  int esc_bytes_index;
+
+  /* Stuff seen so far when composing a string. */
+  unsigned_char_dynarr *composite_chars;
+
+  /* If we saw an invalid designation sequence for a particular
+     register, we flag it here and switch to ASCII.  The next time we
+     see a valid designation for this register, we turn off the flag
+     and do the designation normally, but pretend the sequence was
+     invalid.  The effect of all this is that (most of the time) the
+     escape sequences for both the switch to the unknown charset, and
+     the switch back to the known charset, get inserted literally into
+     the buffer and saved out as such.  The hope is that we can
+     preserve the escape sequences so that the resulting written out
+     file makes sense.  If we don't do any of this, the designation
+     to the invalid charset will be preserved but that switch back
+     to the known charset will probably get eaten because it was
+     the same charset that was already present in the register. */
+  unsigned char invalid_designated[4];
+
+  /* We try to do similar things as above for direction-switching
+     sequences.  If we encountered a direction switch while an
+     invalid designation was present, or an invalid designation
+     just after a direction switch (i.e. no valid designation
+     encountered yet), we insert the direction-switch escape
+     sequence literally into the output stream, and later on
+     insert the corresponding direction-restoring escape sequence
+     literally also. */
+  unsigned int switched_dir_and_no_valid_charset_yet :1;
+  unsigned int invalid_switch_dir :1;
+
+  /* Tells the decoder to output the escape sequence literally
+     even though it was valid.  Used in the games we play to
+     avoid lossage when we encounter invalid designations. */
+  unsigned int output_literally :1;
+  /* We encountered a direction switch followed by an invalid
+     designation.  We didn't output the direction switch
+     literally because we didn't know about the invalid designation;
+     but we have to do so now. */
+  unsigned int output_direction_sequence :1;
+};
+
+EXFUN (Fcopy_coding_system, 2);
+struct detection_state;
+static int detect_coding_sjis (struct detection_state *st,
+                              CONST unsigned char *src,
+                              unsigned int n);
+static void decode_coding_sjis (Lstream *decoding,
+                               CONST unsigned char *src,
+                               unsigned_char_dynarr *dst,
+                               unsigned int n);
+static void encode_coding_sjis (Lstream *encoding,
+                               CONST unsigned char *src,
+                               unsigned_char_dynarr *dst,
+                               unsigned int n);
+static int detect_coding_big5 (struct detection_state *st,
+                              CONST unsigned char *src,
+                              unsigned int n);
+static void decode_coding_big5 (Lstream *decoding,
+                               CONST unsigned char *src,
+                               unsigned_char_dynarr *dst, unsigned int n);
+static void encode_coding_big5 (Lstream *encoding,
+                               CONST unsigned char *src,
+                               unsigned_char_dynarr *dst, unsigned int n);
+static int postprocess_iso2022_mask (int mask);
+static void reset_iso2022 (Lisp_Object coding_system,
+                          struct iso2022_decoder *iso);
+static int detect_coding_iso2022 (struct detection_state *st,
+                                 CONST unsigned char *src,
+                                 unsigned int n);
+static void decode_coding_iso2022 (Lstream *decoding,
+                                  CONST unsigned char *src,
+                                  unsigned_char_dynarr *dst, unsigned int n);
+static void encode_coding_iso2022 (Lstream *encoding,
+                                  CONST unsigned char *src,
+                                  unsigned_char_dynarr *dst, unsigned int n);
+static void decode_coding_no_conversion (Lstream *decoding,
+                                        CONST unsigned char *src,
+                                        unsigned_char_dynarr *dst,
+                                        unsigned int n);
+static void encode_coding_no_conversion (Lstream *encoding,
+                                        CONST unsigned char *src,
+                                        unsigned_char_dynarr *dst,
+                                        unsigned int n);
+static void mule_decode (Lstream *decoding, CONST unsigned char *src,
+                        unsigned_char_dynarr *dst, unsigned int n);
+static void mule_encode (Lstream *encoding, CONST unsigned char *src,
+                        unsigned_char_dynarr *dst, unsigned int n);
+
+typedef struct codesys_prop codesys_prop;
+struct codesys_prop
+{
+  Lisp_Object sym;
+  int prop_type;
+};
+
+typedef struct
+{
+  Dynarr_declare (codesys_prop);
+} codesys_prop_dynarr;
+
+codesys_prop_dynarr *the_codesys_prop_dynarr;
+
+enum codesys_prop_enum
+{
+  CODESYS_PROP_ALL_OK,
+  CODESYS_PROP_ISO2022,
+  CODESYS_PROP_CCL
+};
+
+\f
+/************************************************************************/
+/*                       Coding system functions                        */
+/************************************************************************/
+
+static Lisp_Object
+mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object))
+{
+  struct Lisp_Coding_System *codesys = XCODING_SYSTEM (obj);
+
+  (markobj) (CODING_SYSTEM_NAME (codesys));
+  (markobj) (CODING_SYSTEM_DOC_STRING (codesys));
+  (markobj) (CODING_SYSTEM_MNEMONIC (codesys));
+  (markobj) (CODING_SYSTEM_EOL_LF (codesys));
+  (markobj) (CODING_SYSTEM_EOL_CRLF (codesys));
+  (markobj) (CODING_SYSTEM_EOL_CR (codesys));
+
+  switch (CODING_SYSTEM_TYPE (codesys))
+    {
+      int i;
+    case CODESYS_ISO2022:
+      for (i = 0; i < 4; i++)
+       (markobj) (CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i));
+      if (codesys->iso2022.input_conv)
+       {
+         for (i = 0; i < Dynarr_length (codesys->iso2022.input_conv); i++)
+           {
+             struct charset_conversion_spec *ccs =
+               Dynarr_atp (codesys->iso2022.input_conv, i);
+             (markobj) (ccs->from_charset);
+             (markobj) (ccs->to_charset);
+           }
+       }
+      if (codesys->iso2022.output_conv)
+       {
+         for (i = 0; i < Dynarr_length (codesys->iso2022.output_conv); i++)
+           {
+             struct charset_conversion_spec *ccs =
+               Dynarr_atp (codesys->iso2022.output_conv, i);
+             (markobj) (ccs->from_charset);
+             (markobj) (ccs->to_charset);
+           }
+       }
+      break;
+
+    case CODESYS_CCL:
+      (markobj) (CODING_SYSTEM_CCL_DECODE (codesys));
+      (markobj) (CODING_SYSTEM_CCL_ENCODE (codesys));
+      break;
+    default:
+      break;
+    }
+
+  (markobj) (CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys));
+  return CODING_SYSTEM_POST_READ_CONVERSION (codesys);
+}
+
+static void
+print_coding_system (Lisp_Object obj, Lisp_Object printcharfun,
+                    int escapeflag)
+{
+  struct Lisp_Coding_System *c = XCODING_SYSTEM (obj);
+  if (print_readably)
+    error ("printing unreadable object #<coding_system 0x%x>",
+          c->header.uid);
+
+  write_c_string ("#<coding_system ", printcharfun);
+  print_internal (c->name, printcharfun, 1);
+  write_c_string (">", printcharfun);
+}
+
+static void
+finalize_coding_system (void *header, int for_disksave)
+{
+  struct Lisp_Coding_System *c = (struct Lisp_Coding_System *) header;
+  /* Since coding systems never go away, this function is not
+     necessary.  But it would be necessary if we changed things
+     so that coding systems could go away. */
+  if (!for_disksave) /* see comment in lstream.c */
+    {
+      switch (CODING_SYSTEM_TYPE (c))
+       {
+       case CODESYS_ISO2022:
+         if (c->iso2022.input_conv)
+           {
+             Dynarr_free (c->iso2022.input_conv);
+             c->iso2022.input_conv = 0;
+           }
+         if (c->iso2022.output_conv)
+           {
+             Dynarr_free (c->iso2022.output_conv);
+             c->iso2022.output_conv = 0;
+           }
+         break;
+
+       default:
+         break;
+       }
+    }
+}
+
+DEFINE_LRECORD_IMPLEMENTATION ("coding-system", coding_system,
+                              mark_coding_system, print_coding_system,
+                              finalize_coding_system,
+                              0, 0, struct Lisp_Coding_System);
+
+static enum eol_type
+symbol_to_eol_type (Lisp_Object symbol)
+{
+  CHECK_SYMBOL (symbol);
+  if (NILP (symbol))      return EOL_AUTODETECT;
+  if (EQ (symbol, Qlf))   return EOL_LF;
+  if (EQ (symbol, Qcrlf)) return EOL_CRLF;
+  if (EQ (symbol, Qcr))   return EOL_CR;
+
+  signal_simple_error ("Unrecognized eol type", symbol);
+  return EOL_AUTODETECT; /* not reached */
+}
+
+static Lisp_Object
+eol_type_to_symbol (enum eol_type type)
+{
+  switch (type)
+    {
+    case EOL_LF:         return Qlf;
+    case EOL_CRLF:       return Qcrlf;
+    case EOL_CR:         return Qcr;
+    case EOL_AUTODETECT: return Qnil;
+    default:             abort (); return Qnil; /* not reached */
+    }
+}
+
+static void
+setup_eol_coding_systems (struct Lisp_Coding_System *codesys)
+{
+  Lisp_Object codesys_obj;
+  int len = string_length (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name);
+  char *codesys_name = (char *) alloca (len + 7);
+  Lisp_Object codesys_name_sym, sub_codesys_obj;
+
+  /* kludge */
+
+  XSETCODING_SYSTEM (codesys_obj, codesys);
+
+  memcpy (codesys_name,
+         string_data (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name), len);
+
+#define DEFINE_SUB_CODESYS(op_sys, Type) do {  \
+    strcpy (codesys_name + len, "-" op_sys);   \
+    codesys_name_sym = intern (codesys_name);  \
+    sub_codesys_obj = Fcopy_coding_system (codesys_obj, codesys_name_sym); \
+    XCODING_SYSTEM_EOL_TYPE (sub_codesys_obj) = Type; \
+    CODING_SYSTEM_##Type (codesys) = sub_codesys_obj; \
+} while (0)
+
+  DEFINE_SUB_CODESYS("unix", EOL_LF);
+  DEFINE_SUB_CODESYS("dos",  EOL_CRLF);
+  DEFINE_SUB_CODESYS("mac",  EOL_CR);
+}
+
+DEFUN ("coding-system-p", Fcoding_system_p, 1, 1, 0, /*
+Return t if OBJECT is a coding system.
+A coding system is an object that defines how text containing multiple
+character sets is encoded into a stream of (typically 8-bit) bytes.
+The coding system is used to decode the stream into a series of
+characters (which may be from multiple charsets) when the text is read
+from a file or process, and is used to encode the text back into the
+same format when it is written out to a file or process.
+
+For example, many ISO2022-compliant coding systems (such as Compound
+Text, which is used for inter-client data under the X Window System)
+use escape sequences to switch between different charsets -- Japanese
+Kanji, for example, is invoked with "ESC $ ( B"; ASCII is invoked
+with "ESC ( B"; and Cyrillic is invoked with "ESC - L".  See
+`make-coding-system' for more information.
+
+Coding systems are normally identified using a symbol, and the
+symbol is accepted in place of the actual coding system object whenever
+a coding system is called for. (This is similar to how faces work.)
+*/
+       (object))
+{
+  return CODING_SYSTEMP (object) ? Qt : Qnil;
+}
+
+DEFUN ("find-coding-system", Ffind_coding_system, 1, 1, 0, /*
+Retrieve the coding system of the given name.
+
+If CODING-SYSTEM-OR-NAME is a coding-system object, it is simply
+returned.  Otherwise, CODING-SYSTEM-OR-NAME should be a symbol.
+If there is no such coding system, nil is returned.  Otherwise the
+associated coding system object is returned.
+*/
+       (coding_system_or_name))
+{
+  if (NILP (coding_system_or_name))
+    coding_system_or_name = Qbinary;
+  if (CODING_SYSTEMP (coding_system_or_name))
+    return coding_system_or_name;
+  CHECK_SYMBOL (coding_system_or_name);
+
+  return Fgethash (coding_system_or_name, Vcoding_system_hashtable, Qnil);
+}
+
+DEFUN ("get-coding-system", Fget_coding_system, 1, 1, 0, /*
+Retrieve the coding system of the given name.
+Same as `find-coding-system' except that if there is no such
+coding system, an error is signaled instead of returning nil.
+*/
+       (name))
+{
+  Lisp_Object coding_system = Ffind_coding_system (name);
+
+  if (NILP (coding_system))
+    signal_simple_error ("No such coding system", name);
+  return coding_system;
+}
+
+/* We store the coding systems in hash tables with the names as the key and the
+   actual coding system object as the value.  Occasionally we need to use them
+   in a list format.  These routines provide us with that. */
+struct coding_system_list_closure
+{
+  Lisp_Object *coding_system_list;
+};
+
+static int
+add_coding_system_to_list_mapper (CONST void *hash_key, void *hash_contents,
+                                 void *coding_system_list_closure)
+{
+  /* This function can GC */
+  Lisp_Object key, contents;
+  Lisp_Object *coding_system_list;
+  struct coding_system_list_closure *cscl =
+    (struct coding_system_list_closure *) coding_system_list_closure;
+  CVOID_TO_LISP (key, hash_key);
+  VOID_TO_LISP (contents, hash_contents);
+  coding_system_list = cscl->coding_system_list;
+
+  *coding_system_list = Fcons (XCODING_SYSTEM (contents)->name,
+                              *coding_system_list);
+  return 0;
+}
+
+DEFUN ("coding-system-list", Fcoding_system_list, 0, 0, 0, /*
+Return a list of the names of all defined coding systems.
+*/
+       ())
+{
+  Lisp_Object coding_system_list = Qnil;
+  struct gcpro gcpro1;
+  struct coding_system_list_closure coding_system_list_closure;
+
+  GCPRO1 (coding_system_list);
+  coding_system_list_closure.coding_system_list = &coding_system_list;
+  elisp_maphash (add_coding_system_to_list_mapper, Vcoding_system_hashtable,
+                &coding_system_list_closure);
+  UNGCPRO;
+
+  return coding_system_list;
+}
+
+DEFUN ("coding-system-name", Fcoding_system_name, 1, 1, 0, /*
+Return the name of the given coding system.
+*/
+       (coding_system))
+{
+  coding_system = Fget_coding_system (coding_system);
+  return XCODING_SYSTEM_NAME (coding_system);
+}
+
+static struct Lisp_Coding_System *
+allocate_coding_system (enum coding_system_type type, Lisp_Object name)
+{
+  struct Lisp_Coding_System *codesys =
+    alloc_lcrecord_type (struct Lisp_Coding_System, lrecord_coding_system);
+
+  zero_lcrecord (codesys);
+  CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = Qnil;
+  CODING_SYSTEM_POST_READ_CONVERSION (codesys) = Qnil;
+  CODING_SYSTEM_EOL_TYPE (codesys) = EOL_AUTODETECT;
+  CODING_SYSTEM_EOL_CRLF (codesys) = Qnil;
+  CODING_SYSTEM_EOL_CR   (codesys) = Qnil;
+  CODING_SYSTEM_EOL_LF   (codesys) = Qnil;
+  CODING_SYSTEM_TYPE     (codesys) = type;
+
+  if (type == CODESYS_ISO2022)
+    {
+      int i;
+      for (i = 0; i < 4; i++)
+       CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i) = Qnil;
+    }
+  else if (type == CODESYS_CCL)
+    {
+      CODING_SYSTEM_CCL_DECODE (codesys) = Qnil;
+      CODING_SYSTEM_CCL_ENCODE (codesys) = Qnil;
+    }
+
+  CODING_SYSTEM_NAME (codesys) = name;
+
+  return codesys;
+}
+
+/* Given a list of charset conversion specs as specified in a Lisp
+   program, parse it into STORE_HERE. */
+
+static void
+parse_charset_conversion_specs (charset_conversion_spec_dynarr *store_here,
+                               Lisp_Object spec_list)
+{
+  Lisp_Object rest;
+
+  EXTERNAL_LIST_LOOP (rest, spec_list)
+    {
+      Lisp_Object car = XCAR (rest);
+      Lisp_Object from, to;
+      struct charset_conversion_spec spec;
+
+      if (!CONSP (car) || !CONSP (XCDR (car)) || !NILP (XCDR (XCDR (car))))
+       signal_simple_error ("Invalid charset conversion spec", car);
+      from = Fget_charset (XCAR (car));
+      to = Fget_charset (XCAR (XCDR (car)));
+      if (XCHARSET_TYPE (from) != XCHARSET_TYPE (to))
+       signal_simple_error_2
+         ("Attempted conversion between different charset types",
+          from, to);
+      spec.from_charset = from;
+      spec.to_charset = to;
+
+      Dynarr_add (store_here, spec);
+    }
+}
+
+/* Given a dynarr LOAD_HERE of internally-stored charset conversion
+   specs, return the equivalent as the Lisp programmer would see it.
+
+   If LOAD_HERE is 0, return Qnil. */
+
+static Lisp_Object
+unparse_charset_conversion_specs (charset_conversion_spec_dynarr *load_here)
+{
+  int i;
+  Lisp_Object result = Qnil;
+
+  if (!load_here)
+    return Qnil;
+  for (i = 0; i < Dynarr_length (load_here); i++)
+    {
+      struct charset_conversion_spec *ccs =
+       Dynarr_atp (load_here, i);
+      result = Fcons (list2 (ccs->from_charset, ccs->to_charset), result);
+    }
+
+  return Fnreverse (result);
+}
+
+DEFUN ("make-coding-system", Fmake_coding_system, 2, 4, 0, /*
+Register symbol NAME as a coding system.
+
+TYPE describes the conversion method used and should be one of
+
+nil or 'undecided
+     Automatic conversion.  XEmacs attempts to detect the coding system
+     used in the file.
+'no-conversion
+     No conversion.  Use this for binary files and such.  On output,
+     graphic characters that are not in ASCII or Latin-1 will be
+     replaced by a ?. (For a no-conversion-encoded buffer, these
+     characters will only be present if you explicitly insert them.)
+'shift-jis
+     Shift-JIS (a Japanese encoding commonly used in PC operating systems).
+'iso2022
+     Any ISO2022-compliant encoding.  Among other things, this includes
+     JIS (the Japanese encoding commonly used for e-mail), EUC (the
+     standard Unix encoding for Japanese and other languages), and
+     Compound Text (the encoding used in X11).  You can specify more
+     specific information about the conversion with the FLAGS argument.
+'big5
+     Big5 (the encoding commonly used for Taiwanese).
+'ccl
+     The conversion is performed using a user-written pseudo-code
+     program.  CCL (Code Conversion Language) is the name of this
+     pseudo-code.
+'internal
+     Write out or read in the raw contents of the memory representing
+     the buffer's text.  This is primarily useful for debugging
+     purposes, and is only enabled when XEmacs has been compiled with
+     DEBUG_XEMACS defined (via the --debug configure option).
+     WARNING: Reading in a file using 'internal conversion can result
+     in an internal inconsistency in the memory representing a
+     buffer's text, which will produce unpredictable results and may
+     cause XEmacs to crash.  Under normal circumstances you should
+     never use 'internal conversion.
+
+DOC-STRING is a string describing the coding system.
+
+PROPS is a property list, describing the specific nature of the
+character set.  Recognized properties are:
+
+'mnemonic
+     String to be displayed in the modeline when this coding system is
+     active.
+
+'eol-type
+     End-of-line conversion to be used.  It should be one of
+
+       nil
+               Automatically detect the end-of-line type (LF, CRLF,
+               or CR).  Also generate subsidiary coding systems named
+               `NAME-unix', `NAME-dos', and `NAME-mac', that are
+               identical to this coding system but have an EOL-TYPE
+               value of 'lf, 'crlf, and 'cr, respectively.
+       'lf
+               The end of a line is marked externally using ASCII LF.
+               Since this is also the way that XEmacs represents an
+               end-of-line internally, specifying this option results
+               in no end-of-line conversion.  This is the standard
+               format for Unix text files.
+       'crlf
+               The end of a line is marked externally using ASCII
+               CRLF.  This is the standard format for MS-DOS text
+               files.
+       'cr
+               The end of a line is marked externally using ASCII CR.
+               This is the standard format for Macintosh text files.
+       t
+               Automatically detect the end-of-line type but do not
+               generate subsidiary coding systems.  (This value is
+               converted to nil when stored internally, and
+               `coding-system-property' will return nil.)
+
+'post-read-conversion
+     Function called after a file has been read in, to perform the
+     decoding.  Called with two arguments, BEG and END, denoting
+     a region of the current buffer to be decoded.
+
+'pre-write-conversion
+     Function called before a file is written out, to perform the
+     encoding.  Called with two arguments, BEG and END, denoting
+     a region of the current buffer to be encoded.
+
+
+The following additional properties are recognized if TYPE is 'iso2022:
+
+'charset-g0
+'charset-g1
+'charset-g2
+'charset-g3
+     The character set initially designated to the G0 - G3 registers.
+     The value should be one of
+
+          -- A charset object (designate that character set)
+         -- nil (do not ever use this register)
+         -- t (no character set is initially designated to
+               the register, but may be later on; this automatically
+               sets the corresponding `force-g*-on-output' property)
+
+'force-g0-on-output
+'force-g1-on-output
+'force-g2-on-output
+'force-g2-on-output
+     If non-nil, send an explicit designation sequence on output before
+     using the specified register.
+
+'short
+     If non-nil, use the short forms "ESC $ @", "ESC $ A", and
+     "ESC $ B" on output in place of the full designation sequences
+     "ESC $ ( @", "ESC $ ( A", and "ESC $ ( B".
+
+'no-ascii-eol
+     If non-nil, don't designate ASCII to G0 at each end of line on output.
+     Setting this to non-nil also suppresses other state-resetting that
+     normally happens at the end of a line.
+
+'no-ascii-cntl
+     If non-nil, don't designate ASCII to G0 before control chars on output.
+
+'seven
+     If non-nil, use 7-bit environment on output.  Otherwise, use 8-bit
+     environment.
+
+'lock-shift
+     If non-nil, use locking-shift (SO/SI) instead of single-shift
+     or designation by escape sequence.
+
+'no-iso6429
+     If non-nil, don't use ISO6429's direction specification.
+
+'escape-quoted
+     If non-nil, literal control characters that are the same as
+     the beginning of a recognized ISO2022 or ISO6429 escape sequence
+     (in particular, ESC (0x1B), SO (0x0E), SI (0x0F), SS2 (0x8E),
+     SS3 (0x8F), and CSI (0x9B)) are "quoted" with an escape character
+     so that they can be properly distinguished from an escape sequence.
+     (Note that doing this results in a non-portable encoding.) This
+     encoding flag is used for byte-compiled files.  Note that ESC
+     is a good choice for a quoting character because there are no
+     escape sequences whose second byte is a character from the Control-0
+     or Control-1 character sets; this is explicitly disallowed by the
+     ISO2022 standard.
+
+'input-charset-conversion
+     A list of conversion specifications, specifying conversion of
+     characters in one charset to another when decoding is performed.
+     Each specification is a list of two elements: the source charset,
+     and the destination charset.
+
+'output-charset-conversion
+     A list of conversion specifications, specifying conversion of
+     characters in one charset to another when encoding is performed.
+     The form of each specification is the same as for
+     'input-charset-conversion.
+
+
+The following additional properties are recognized (and required)
+if TYPE is 'ccl:
+
+'decode
+     CCL program used for decoding (converting to internal format).
+
+'encode
+     CCL program used for encoding (converting to external format).
+*/
+       (name, type, doc_string, props))
+{
+  struct Lisp_Coding_System *codesys;
+  Lisp_Object rest, key, value;
+  enum coding_system_type ty;
+  int need_to_setup_eol_systems = 1;
+
+  /* Convert type to constant */
+  if (NILP (type) || EQ (type, Qundecided))
+                                      { ty = CODESYS_AUTODETECT; }
+  else if (EQ (type, Qshift_jis))     { ty = CODESYS_SHIFT_JIS; }
+  else if (EQ (type, Qiso2022))       { ty = CODESYS_ISO2022; }
+  else if (EQ (type, Qbig5))          { ty = CODESYS_BIG5; }
+  else if (EQ (type, Qccl))           { ty = CODESYS_CCL; }
+  else if (EQ (type, Qno_conversion)) { ty = CODESYS_NO_CONVERSION; }
+#ifdef DEBUG_XEMACS
+  else if (EQ (type, Qinternal))      { ty = CODESYS_INTERNAL; }
+#endif
+  else
+    signal_simple_error ("Invalid coding system type", type);
+
+  CHECK_SYMBOL (name);
+
+  codesys = allocate_coding_system (ty, name);
+
+  if (NILP (doc_string))
+    doc_string = build_string ("");
+  else
+    CHECK_STRING (doc_string);
+  CODING_SYSTEM_DOC_STRING (codesys) = doc_string;
+
+  EXTERNAL_PROPERTY_LIST_LOOP (rest, key, value, props)
+    {
+      if (EQ (key, Qmnemonic))
+       {
+          if (!NILP (value))
+           CHECK_STRING (value);
+         CODING_SYSTEM_MNEMONIC (codesys) = value;
+       }
+
+      else if (EQ (key, Qeol_type))
+       {
+         need_to_setup_eol_systems = NILP (value);
+         if (EQ (value, Qt))
+           value = Qnil;
+         CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value);
+       }
+
+      else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value;
+      else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value;
+      else if (ty == CODESYS_ISO2022)
+       {
+#define FROB_INITIAL_CHARSET(charset_num) \
+  CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, charset_num) = \
+    ((EQ (value, Qt) || EQ (value, Qnil)) ? value : Fget_charset (value))
+
+         if      (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0);
+         else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1);
+         else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2);
+         else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3);
+
+#define FROB_FORCE_CHARSET(charset_num) \
+  CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (codesys, charset_num) = !NILP (value)
+
+         else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0);
+         else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1);
+         else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2);
+         else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3);
+
+#define FROB_BOOLEAN_PROPERTY(prop) \
+  CODING_SYSTEM_ISO2022_##prop (codesys) = !NILP (value)
+
+         else if (EQ (key, Qshort))         FROB_BOOLEAN_PROPERTY (SHORT);
+         else if (EQ (key, Qno_ascii_eol))  FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL);
+         else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL);
+         else if (EQ (key, Qseven))         FROB_BOOLEAN_PROPERTY (SEVEN);
+         else if (EQ (key, Qlock_shift))    FROB_BOOLEAN_PROPERTY (LOCK_SHIFT);
+         else if (EQ (key, Qno_iso6429))    FROB_BOOLEAN_PROPERTY (NO_ISO6429);
+         else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED);
+
+         else if (EQ (key, Qinput_charset_conversion))
+           {
+             codesys->iso2022.input_conv =
+               Dynarr_new (charset_conversion_spec);
+             parse_charset_conversion_specs (codesys->iso2022.input_conv,
+                                             value);
+           }
+         else if (EQ (key, Qoutput_charset_conversion))
+           {
+             codesys->iso2022.output_conv =
+               Dynarr_new (charset_conversion_spec);
+             parse_charset_conversion_specs (codesys->iso2022.output_conv,
+                                             value);
+           }
+         else
+           signal_simple_error ("Unrecognized property", key);
+       }
+      else if (EQ (type, Qccl))
+       {
+         if (EQ (key, Qdecode))
+           {
+             CHECK_VECTOR (value);
+             CODING_SYSTEM_CCL_DECODE (codesys) = value;
+           }
+         else if (EQ (key, Qencode))
+           {
+             CHECK_VECTOR (value);
+             CODING_SYSTEM_CCL_ENCODE (codesys) = value;
+           }
+         else
+           signal_simple_error ("Unrecognized property", key);
+       }
+      else
+       signal_simple_error ("Unrecognized property", key);
+    }
+
+  if (need_to_setup_eol_systems)
+    setup_eol_coding_systems (codesys);
+
+  {
+    Lisp_Object codesys_obj;
+    XSETCODING_SYSTEM (codesys_obj, codesys);
+    Fputhash (name, codesys_obj, Vcoding_system_hashtable);
+    return codesys_obj;
+  }
+}
+
+DEFUN ("copy-coding-system", Fcopy_coding_system, 2, 2, 0, /*
+Copy OLD-CODING-SYSTEM to NEW-NAME.
+If NEW-NAME does not name an existing coding system, a new one will
+be created.
+*/
+       (old_coding_system, new_name))
+{
+  Lisp_Object new_coding_system;
+  old_coding_system = Fget_coding_system (old_coding_system);
+  new_coding_system = Ffind_coding_system (new_name);
+  if (NILP (new_coding_system))
+    {
+      XSETCODING_SYSTEM (new_coding_system,
+                        allocate_coding_system
+                        (XCODING_SYSTEM_TYPE (old_coding_system),
+                         new_name));
+      Fputhash (new_name, new_coding_system, Vcoding_system_hashtable);
+    }
+
+  {
+    struct Lisp_Coding_System *to = XCODING_SYSTEM (new_coding_system);
+    struct Lisp_Coding_System *from = XCODING_SYSTEM (old_coding_system);
+    memcpy (((char *) to  ) + sizeof (to->header),
+           ((char *) from) + sizeof (from->header),
+           sizeof (*from) - sizeof (from->header));
+    to->name = new_name;
+  }
+  return new_coding_system;
+}
+
+static Lisp_Object
+subsidiary_coding_system (Lisp_Object coding_system, enum eol_type type)
+{
+  struct Lisp_Coding_System *cs = XCODING_SYSTEM (coding_system);
+  Lisp_Object new_coding_system;
+
+  if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT)
+    return coding_system;
+
+  switch (type)
+    {
+    case EOL_AUTODETECT: return coding_system;
+    case EOL_LF:   new_coding_system = CODING_SYSTEM_EOL_LF   (cs); break;
+    case EOL_CR:   new_coding_system = CODING_SYSTEM_EOL_CR   (cs); break;
+    case EOL_CRLF: new_coding_system = CODING_SYSTEM_EOL_CRLF (cs); break;
+    default:       abort ();
+    }
+
+  return NILP (new_coding_system) ? coding_system : new_coding_system;
+}
+
+DEFUN ("subsidiary-coding-system", Fsubsidiary_coding_system, 2, 2, 0, /*
+Return the subsidiary coding system of CODING-SYSTEM with eol type EOL-TYPE.
+*/
+       (coding_system, eol_type))
+{
+  coding_system = Fget_coding_system (coding_system);
+
+  return subsidiary_coding_system (coding_system,
+                                  symbol_to_eol_type (eol_type));
+}
+
+\f
+/************************************************************************/
+/*                         Coding system accessors                      */
+/************************************************************************/
+
+DEFUN ("coding-system-doc-string", Fcoding_system_doc_string, 1, 1, 0, /*
+Return the doc string for CODING-SYSTEM.
+*/
+       (coding_system))
+{
+  coding_system = Fget_coding_system (coding_system);
+  return XCODING_SYSTEM_DOC_STRING (coding_system);
+}
+
+DEFUN ("coding-system-type", Fcoding_system_type, 1, 1, 0, /*
+Return the type of CODING-SYSTEM.
+*/
+       (coding_system))
+{
+  switch (XCODING_SYSTEM_TYPE (Fget_coding_system (coding_system)))
+    {
+    case CODESYS_AUTODETECT:   return Qundecided;
+    case CODESYS_SHIFT_JIS:    return Qshift_jis;
+    case CODESYS_ISO2022:      return Qiso2022;
+    case CODESYS_BIG5:         return Qbig5;
+    case CODESYS_CCL:          return Qccl;
+    case CODESYS_NO_CONVERSION:        return Qno_conversion;
+#ifdef DEBUG_XEMACS
+    case CODESYS_INTERNAL:     return Qinternal;
+#endif
+    default:
+      abort ();
+    }
+
+  return Qnil; /* not reached */
+}
+
+static
+Lisp_Object coding_system_charset (Lisp_Object coding_system, int gnum)
+{
+  Lisp_Object cs
+    = XCODING_SYSTEM_ISO2022_INITIAL_CHARSET (coding_system, gnum);
+
+  return CHARSETP (cs) ? XCHARSET_NAME (cs) : Qnil;
+}
+
+DEFUN ("coding-system-charset", Fcoding_system_charset, 2, 2, 0, /*
+Return initial charset of CODING-SYSTEM designated to GNUM.
+GNUM allows 0 .. 3.
+*/
+       (coding_system, gnum))
+{
+  coding_system = Fget_coding_system (coding_system);
+  CHECK_INT (gnum);
+
+  return coding_system_charset (coding_system, XINT (gnum));
+}
+
+DEFUN ("coding-system-property", Fcoding_system_property, 2, 2, 0, /*
+Return the PROP property of CODING-SYSTEM.
+*/
+       (coding_system, prop))
+{
+  int i, ok = 0;
+  enum coding_system_type type;
+
+  coding_system = Fget_coding_system (coding_system);
+  CHECK_SYMBOL (prop);
+  type = XCODING_SYSTEM_TYPE (coding_system);
+
+  for (i = 0; !ok && i < Dynarr_length (the_codesys_prop_dynarr); i++)
+    if (EQ (Dynarr_at (the_codesys_prop_dynarr, i).sym, prop))
+      {
+       ok = 1;
+       switch (Dynarr_at (the_codesys_prop_dynarr, i).prop_type)
+         {
+         case CODESYS_PROP_ALL_OK:
+           break;
+
+         case CODESYS_PROP_ISO2022:
+           if (type != CODESYS_ISO2022)
+             signal_simple_error
+               ("Property only valid in ISO2022 coding systems",
+                prop);
+           break;
+
+         case CODESYS_PROP_CCL:
+           if (type != CODESYS_CCL)
+             signal_simple_error
+               ("Property only valid in CCL coding systems",
+                prop);
+           break;
+
+         default:
+           abort ();
+         }
+      }
+
+  if (!ok)
+    signal_simple_error ("Unrecognized property", prop);
+
+  if (EQ (prop, Qname))
+    return XCODING_SYSTEM_NAME (coding_system);
+  else if (EQ (prop, Qtype))
+    return Fcoding_system_type (coding_system);
+  else if (EQ (prop, Qdoc_string))
+    return XCODING_SYSTEM_DOC_STRING (coding_system);
+  else if (EQ (prop, Qmnemonic))
+    return XCODING_SYSTEM_MNEMONIC (coding_system);
+  else if (EQ (prop, Qeol_type))
+    return eol_type_to_symbol (XCODING_SYSTEM_EOL_TYPE (coding_system));
+  else if (EQ (prop, Qeol_lf))
+    return XCODING_SYSTEM_EOL_LF (coding_system);
+  else if (EQ (prop, Qeol_crlf))
+    return XCODING_SYSTEM_EOL_CRLF (coding_system);
+  else if (EQ (prop, Qeol_cr))
+    return XCODING_SYSTEM_EOL_CR (coding_system);
+  else if (EQ (prop, Qpost_read_conversion))
+    return XCODING_SYSTEM_POST_READ_CONVERSION (coding_system);
+  else if (EQ (prop, Qpre_write_conversion))
+    return XCODING_SYSTEM_PRE_WRITE_CONVERSION (coding_system);
+  else if (type == CODESYS_ISO2022)
+    {
+      if (EQ (prop, Qcharset_g0))
+       return coding_system_charset (coding_system, 0);
+      else if (EQ (prop, Qcharset_g1))
+       return coding_system_charset (coding_system, 1);
+      else if (EQ (prop, Qcharset_g2))
+       return coding_system_charset (coding_system, 2);
+      else if (EQ (prop, Qcharset_g3))
+       return coding_system_charset (coding_system, 3);
+
+#define FORCE_CHARSET(charset_num) \
+  (XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT \
+   (coding_system, charset_num) ? Qt : Qnil)
+
+      else if (EQ (prop, Qforce_g0_on_output)) return FORCE_CHARSET (0);
+      else if (EQ (prop, Qforce_g1_on_output)) return FORCE_CHARSET (1);
+      else if (EQ (prop, Qforce_g2_on_output)) return FORCE_CHARSET (2);
+      else if (EQ (prop, Qforce_g3_on_output)) return FORCE_CHARSET (3);
+
+#define LISP_BOOLEAN(prop) \
+  (XCODING_SYSTEM_ISO2022_##prop (coding_system) ? Qt : Qnil)
+
+      else if (EQ (prop, Qshort))         return LISP_BOOLEAN (SHORT);
+      else if (EQ (prop, Qno_ascii_eol))  return LISP_BOOLEAN (NO_ASCII_EOL);
+      else if (EQ (prop, Qno_ascii_cntl)) return LISP_BOOLEAN (NO_ASCII_CNTL);
+      else if (EQ (prop, Qseven))         return LISP_BOOLEAN (SEVEN);
+      else if (EQ (prop, Qlock_shift))    return LISP_BOOLEAN (LOCK_SHIFT);
+      else if (EQ (prop, Qno_iso6429))    return LISP_BOOLEAN (NO_ISO6429);
+      else if (EQ (prop, Qescape_quoted)) return LISP_BOOLEAN (ESCAPE_QUOTED);
+
+      else if (EQ (prop, Qinput_charset_conversion))
+       return
+         unparse_charset_conversion_specs
+           (XCODING_SYSTEM (coding_system)->iso2022.input_conv);
+      else if (EQ (prop, Qoutput_charset_conversion))
+       return
+         unparse_charset_conversion_specs
+           (XCODING_SYSTEM (coding_system)->iso2022.output_conv);
+      else
+       abort ();
+    }
+  else if (type == CODESYS_CCL)
+    {
+      if (EQ (prop, Qdecode))
+       return XCODING_SYSTEM_CCL_DECODE (coding_system);
+      else if (EQ (prop, Qencode))
+       return XCODING_SYSTEM_CCL_ENCODE (coding_system);
+      else
+       abort ();
+    }
+  else
+    abort ();
+
+  return Qnil; /* not reached */
+}
+
+\f
+/************************************************************************/
+/*                       Coding category functions                      */
+/************************************************************************/
+
+static int
+decode_coding_category (Lisp_Object symbol)
+{
+  int i;
+
+  CHECK_SYMBOL (symbol);
+  for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+    if (EQ (coding_category_symbol[i], symbol))
+      return i;
+
+  signal_simple_error ("Unrecognized coding category", symbol);
+  return 0; /* not reached */
+}
+
+DEFUN ("coding-category-list", Fcoding_category_list, 0, 0, 0, /*
+Return a list of all recognized coding categories.
+*/
+       ())
+{
+  int i;
+  Lisp_Object list = Qnil;
+
+  for (i = CODING_CATEGORY_LAST; i >= 0; i--)
+    list = Fcons (coding_category_symbol[i], list);
+  return list;
+}
+
+DEFUN ("set-coding-priority-list", Fset_coding_priority_list, 1, 1, 0, /*
+Change the priority order of the coding categories.
+LIST should be list of coding categories, in descending order of
+priority.  Unspecified coding categories will be lower in priority
+than all specified ones, in the same relative order they were in
+previously.
+*/
+       (list))
+{
+  int category_to_priority[CODING_CATEGORY_LAST + 1];
+  int i, j;
+  Lisp_Object rest;
+
+  /* First generate a list that maps coding categories to priorities. */
+
+  for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+    category_to_priority[i] = -1;
+
+  /* Highest priority comes from the specified list. */
+  i = 0;
+  EXTERNAL_LIST_LOOP (rest, list)
+    {
+      int cat = decode_coding_category (XCAR (rest));
+
+      if (category_to_priority[cat] >= 0)
+       signal_simple_error ("Duplicate coding category in list", XCAR (rest));
+      category_to_priority[cat] = i++;
+    }
+
+  /* Now go through the existing categories by priority to retrieve
+     the categories not yet specified and preserve their priority
+     order. */
+  for (j = 0; j <= CODING_CATEGORY_LAST; j++)
+    {
+      int cat = coding_category_by_priority[j];
+      if (category_to_priority[cat] < 0)
+       category_to_priority[cat] = i++;
+    }
+
+  /* Now we need to construct the inverse of the mapping we just
+     constructed. */
+
+  for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+    coding_category_by_priority[category_to_priority[i]] = i;
+
+  /* Phew!  That was confusing. */
+  return Qnil;
+}
+
+DEFUN ("coding-priority-list", Fcoding_priority_list, 0, 0, 0, /*
+Return a list of coding categories in descending order of priority.
+*/
+       ())
+{
+  int i;
+  Lisp_Object list = Qnil;
+
+  for (i = CODING_CATEGORY_LAST; i >= 0; i--)
+    list = Fcons (coding_category_symbol[coding_category_by_priority[i]],
+                 list);
+  return list;
+}
+
+DEFUN ("set-coding-category-system", Fset_coding_category_system, 2, 2, 0, /*
+Change the coding system associated with a coding category.
+*/
+       (coding_category, coding_system))
+{
+  int cat = decode_coding_category (coding_category);
+
+  coding_system = Fget_coding_system (coding_system);
+  coding_category_system[cat] = coding_system;
+  return Qnil;
+}
+
+DEFUN ("coding-category-system", Fcoding_category_system, 1, 1, 0, /*
+Return the coding system associated with a coding category.
+*/
+       (coding_category))
+{
+  int cat = decode_coding_category (coding_category);
+  Lisp_Object sys = coding_category_system[cat];
+
+  if (!NILP (sys))
+    return XCODING_SYSTEM_NAME (sys);
+  return Qnil;
+}
+
+\f
+/************************************************************************/
+/*                     Detecting the encoding of data                   */
+/************************************************************************/
+
+struct detection_state
+{
+  enum eol_type eol_type;
+  int seen_non_ascii;
+  int mask;
+
+  struct
+  {
+    int mask;
+    int in_second_byte;
+  }
+  big5;
+
+  struct
+  {
+    int mask;
+    int in_second_byte;
+  }
+  shift_jis;
+
+  struct
+  {
+    int mask;
+    int initted;
+    struct iso2022_decoder iso;
+    unsigned int flags;
+    int high_byte_count;
+    unsigned int saw_single_shift:1;
+  }
+  iso2022;
+
+  struct
+  {
+    int seen_anything;
+    int just_saw_cr;
+  }
+  eol;
+};
+
+static int
+acceptable_control_char_p (int c)
+{
+  switch (c)
+    {
+      /* Allow and ignore control characters that you might
+        reasonably see in a text file */
+    case '\r':
+    case '\n':
+    case '\t':
+    case  7: /* bell */
+    case  8: /* backspace */
+    case 11: /* vertical tab */
+    case 12: /* form feed */
+    case 26: /* MS-DOS C-z junk */
+    case 31: /* '^_' -- for info */
+      return 1;
+    default:
+      return 0;
+    }
+}
+
+static int
+mask_has_at_most_one_bit_p (int mask)
+{
+  /* Perhaps the only thing useful you learn from intensive Microsoft
+     technical interviews */
+  return (mask & (mask - 1)) == 0;
+}
+
+static enum eol_type
+detect_eol_type (struct detection_state *st, CONST unsigned char *src,
+                unsigned int n)
+{
+  int c;
+
+  while (n--)
+    {
+      c = *src++;
+      if (c == '\r')
+       st->eol.just_saw_cr = 1;
+      else
+       {
+         if (c == '\n')
+           {
+             if (st->eol.just_saw_cr)
+               return EOL_CRLF;
+             else if (st->eol.seen_anything)
+               return EOL_LF;
+           }
+         else if (st->eol.just_saw_cr)
+           return EOL_CR;
+         st->eol.just_saw_cr = 0;
+       }
+      st->eol.seen_anything = 1;
+    }
+
+  return EOL_AUTODETECT;
+}
+
+/* Attempt to determine the encoding and EOL type of the given text.
+   Before calling this function for the first type, you must initialize
+   st->eol_type as appropriate and initialize st->mask to ~0.
+
+   st->eol_type holds the determined EOL type, or EOL_AUTODETECT if
+   not yet known.
+
+   st->mask holds the determined coding category mask, or ~0 if only
+   ASCII has been seen so far.
+
+   Returns:
+
+   0 == st->eol_type is EOL_AUTODETECT and/or more than coding category
+        is present in st->mask
+   1 == definitive answers are here for both st->eol_type and st->mask
+*/
+
+static int
+detect_coding_type (struct detection_state *st, CONST unsigned char *src,
+                   unsigned int n, int just_do_eol)
+{
+  int c;
+
+  if (st->eol_type == EOL_AUTODETECT)
+    st->eol_type = detect_eol_type (st, src, n);
+
+  if (just_do_eol)
+    return st->eol_type != EOL_AUTODETECT;
+
+  if (!st->seen_non_ascii)
+    {
+      for (; n; n--, src++)
+       {
+         c = *src;
+         if ((c < 0x20 && !acceptable_control_char_p (c)) || c >= 0x80)
+           {
+             st->seen_non_ascii = 1;
+             st->shift_jis.mask = ~0;
+             st->big5.mask = ~0;
+             st->iso2022.mask = ~0;
+             break;
+           }
+       }
+    }
+
+  if (!n)
+    return 0;
+
+  if (!mask_has_at_most_one_bit_p (st->iso2022.mask))
+    st->iso2022.mask = detect_coding_iso2022 (st, src, n);
+  if (!mask_has_at_most_one_bit_p (st->shift_jis.mask))
+    st->shift_jis.mask = detect_coding_sjis (st, src, n);
+  if (!mask_has_at_most_one_bit_p (st->big5.mask))
+    st->big5.mask = detect_coding_big5 (st, src, n);
+
+  st->mask = st->iso2022.mask | st->shift_jis.mask | st->big5.mask;
+
+  {
+    int retval = mask_has_at_most_one_bit_p (st->mask);
+    st->mask |= CODING_CATEGORY_NO_CONVERSION_MASK;
+    return retval && st->eol_type != EOL_AUTODETECT;
+  }
+}
+
+static Lisp_Object
+coding_system_from_mask (int mask)
+{
+  if (mask == ~0)
+    {
+      /* If the file was entirely or basically ASCII, use the
+        default value of `buffer-file-coding-system'. */
+      Lisp_Object retval =
+       XBUFFER (Vbuffer_defaults)->buffer_file_coding_system;
+      if (!NILP (retval))
+       {
+         retval = Ffind_coding_system (retval);
+         if (NILP (retval))
+           {
+             warn_when_safe
+               (Qbad_variable, Qwarning,
+                "Invalid `default-buffer-file-coding-system', set to nil");
+             XBUFFER (Vbuffer_defaults)->buffer_file_coding_system = Qnil;
+           }
+       }
+      if (NILP (retval))
+       retval = Fget_coding_system (Qno_conversion);
+      return retval;
+    }
+  else
+    {
+      int i;
+      int cat = -1;
+
+      mask = postprocess_iso2022_mask (mask);
+
+      /* Look through the coding categories by priority and find
+        the first one that is allowed. */
+      for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+       {
+         cat = coding_category_by_priority[i];
+         if ((mask & (1 << cat)) &&
+             !NILP (coding_category_system[cat]))
+           break;
+       }
+      if (cat >= 0)
+       return coding_category_system[cat];
+      else
+       return Fget_coding_system (Qno_conversion);
+    }
+}
+
+/* Given a seekable read stream and potential coding system and EOL type
+   as specified, do any autodetection that is called for.  If the
+   coding system and/or EOL type are not autodetect, they will be left
+   alone; but this function will never return an autodetect coding system
+   or EOL type.
+
+   This function does not automatically fetch subsidiary coding systems;
+   that should be unnecessary with the explicit eol-type argument. */
+
+void
+determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out,
+                             enum eol_type *eol_type_in_out)
+{
+  struct detection_state decst;
+
+  if (*eol_type_in_out == EOL_AUTODETECT)
+    *eol_type_in_out = XCODING_SYSTEM_EOL_TYPE (*codesys_in_out);
+
+  xzero (decst);
+  decst.eol_type = *eol_type_in_out;
+  decst.mask = ~0;
+
+  /* If autodetection is called for, do it now. */
+  if (XCODING_SYSTEM_TYPE (*codesys_in_out) == CODESYS_AUTODETECT ||
+      *eol_type_in_out == EOL_AUTODETECT)
+    {
+
+      while (1)
+       {
+         unsigned char random_buffer[4096];
+         int nread;
+
+         nread = Lstream_read (stream, random_buffer, sizeof (random_buffer));
+         if (!nread)
+           break;
+         if (detect_coding_type (&decst, random_buffer, nread,
+                                 XCODING_SYSTEM_TYPE (*codesys_in_out) !=
+                                 CODESYS_AUTODETECT))
+           break;
+       }
+
+      *eol_type_in_out = decst.eol_type;
+      if (XCODING_SYSTEM_TYPE (*codesys_in_out) == CODESYS_AUTODETECT)
+       *codesys_in_out = coding_system_from_mask (decst.mask);
+    }
+
+  /* If we absolutely can't determine the EOL type, just assume LF. */
+  if (*eol_type_in_out == EOL_AUTODETECT)
+    *eol_type_in_out = EOL_LF;
+
+  Lstream_rewind (stream);
+}
+
+DEFUN ("detect-coding-region", Fdetect_coding_region, 2, 3, 0, /*
+Detect coding system of the text in the region between START and END.
+Returned a list of possible coding systems ordered by priority.
+If only ASCII characters are found, it returns 'undecided or one of
+its subsidiary coding systems according to a detected end-of-line
+type.  Optional arg BUFFER defaults to the current buffer.
+*/
+       (start, end, buffer))
+{
+  Lisp_Object val = Qnil;
+  struct buffer *buf = decode_buffer (buffer, 0);
+  Bufpos b, e;
+  Lisp_Object instream, lb_instream;
+  Lstream *istr, *lb_istr;
+  struct detection_state decst;
+  struct gcpro gcpro1, gcpro2;
+
+  get_buffer_range_char (buf, start, end, &b, &e, 0);
+  lb_instream = make_lisp_buffer_input_stream (buf, b, e, 0);
+  lb_istr = XLSTREAM (lb_instream);
+  instream = make_encoding_input_stream (lb_istr, Fget_coding_system (Qbinary));
+  istr = XLSTREAM (instream);
+  GCPRO2 (instream, lb_instream);
+  xzero (decst);
+  decst.eol_type = EOL_AUTODETECT;
+  decst.mask = ~0;
+  while (1)
+    {
+      unsigned char random_buffer[4096];
+      int nread = Lstream_read (istr, random_buffer, sizeof (random_buffer));
+
+      if (!nread)
+       break;
+      if (detect_coding_type (&decst, random_buffer, nread, 0))
+       break;
+    }
+
+  if (decst.mask == ~0)
+    val = subsidiary_coding_system (Fget_coding_system (Qundecided),
+                                   decst.eol_type);
+  else
+    {
+      int i;
+
+      val = Qnil;
+
+      decst.mask = postprocess_iso2022_mask (decst.mask);
+
+      for (i = CODING_CATEGORY_LAST; i >= 0; i--)
+       {
+         int sys = coding_category_by_priority[i];
+         if (decst.mask & (1 << sys))
+           {
+             Lisp_Object codesys = coding_category_system[sys];
+             if (!NILP (codesys))
+               codesys = subsidiary_coding_system (codesys, decst.eol_type);
+             val = Fcons (codesys, val);
+           }
+       }
+    }
+  Lstream_close (istr);
+  UNGCPRO;
+  Lstream_delete (istr);
+  Lstream_delete (lb_istr);
+  return val;
+}
+
+\f
+/************************************************************************/
+/*           Converting to internal Mule format ("decoding")            */
+/************************************************************************/
+
+/* A decoding stream is a stream used for decoding text (i.e.
+   converting from some external format to internal format).
+   The decoding-stream object keeps track of the actual coding
+   stream, the stream that is at the other end, and data that
+   needs to be persistent across the lifetime of the stream. */
+
+/* Handle the EOL stuff related to just-read-in character C.
+   EOL_TYPE is the EOL type of the coding stream.
+   FLAGS is the current value of FLAGS in the coding stream, and may
+   be modified by this macro.  (The macro only looks at the
+   CODING_STATE_CR flag.)  DST is the Dynarr to which the decoded
+   bytes are to be written.  You need to also define a local goto
+   label "label_continue_loop" that is at the end of the main
+   character-reading loop.
+
+   If C is a CR character, then this macro handles it entirely and
+   jumps to label_continue_loop.  Otherwise, this macro does not add
+   anything to DST, and continues normally.  You should continue
+   processing C normally after this macro. */
+
+#define DECODE_HANDLE_EOL_TYPE(eol_type, c, flags, dst)                \
+do {                                                           \
+  if (c == '\r')                                               \
+    {                                                          \
+      if (eol_type == EOL_CR)                                  \
+       Dynarr_add (dst, '\n');                                 \
+      else if (eol_type != EOL_CRLF || flags & CODING_STATE_CR)        \
+       Dynarr_add (dst, c);                                    \
+      else                                                     \
+       flags |= CODING_STATE_CR;                               \
+      goto label_continue_loop;                                        \
+    }                                                          \
+  else if (flags & CODING_STATE_CR)                            \
+    {  /* eol_type == CODING_SYSTEM_EOL_CRLF */                \
+      if (c != '\n')                                           \
+       Dynarr_add (dst, '\r');                                 \
+      flags &= ~CODING_STATE_CR;                               \
+    }                                                          \
+} while (0)
+
+/* C should be a binary character in the range 0 - 255; convert
+   to internal format and add to Dynarr DST. */
+
+#define DECODE_ADD_BINARY_CHAR(c, dst)         \
+do {                                           \
+  if (BYTE_ASCII_P (c))                                \
+    Dynarr_add (dst, c);                       \
+  else if (BYTE_C1_P (c))                      \
+    {                                          \
+      Dynarr_add (dst, LEADING_BYTE_CONTROL_1);        \
+      Dynarr_add (dst, c + 0x20);              \
+    }                                          \
+  else                                         \
+    {                                          \
+      Dynarr_add (dst, LEADING_BYTE_LATIN_ISO8859_1); \
+      Dynarr_add (dst, c);                     \
+    }                                          \
+} while (0)
+
+#define DECODE_OUTPUT_PARTIAL_CHAR(ch) \
+do {                                   \
+  if (ch)                              \
+    {                                  \
+      DECODE_ADD_BINARY_CHAR (ch, dst);        \
+      ch = 0;                          \
+    }                                  \
+} while (0)
+
+#define DECODE_HANDLE_END_OF_CONVERSION(flags, ch, dst)        \
+do {                                   \
+  DECODE_OUTPUT_PARTIAL_CHAR (ch);     \
+  if ((flags & CODING_STATE_END) &&    \
+      (flags & CODING_STATE_CR))       \
+    Dynarr_add (dst, '\r');            \
+} while (0)
+
+#define DECODING_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, decoding)
+
+struct decoding_stream
+{
+  /* Coding system that governs the conversion. */
+  struct Lisp_Coding_System *codesys;
+
+  /* Stream that we read the encoded data from or
+     write the decoded data to. */
+  Lstream *other_end;
+
+  /* If we are reading, then we can return only a fixed amount of
+     data, so if the conversion resulted in too much data, we store it
+     here for retrieval the next time around. */
+  unsigned_char_dynarr *runoff;
+
+  /* FLAGS holds flags indicating the current state of the decoding.
+     Some of these flags are dependent on the coding system. */
+  unsigned int flags;
+
+  /* CH holds a partially built-up character.  Since we only deal
+     with one- and two-byte characters at the moment, we only use
+     this to store the first byte of a two-byte character. */
+  unsigned int ch;
+
+  /* EOL_TYPE specifies the type of end-of-line conversion that
+     currently applies.  We need to keep this separate from the
+     EOL type stored in CODESYS because the latter might indicate
+     automatic EOL-type detection while the former will always
+     indicate a particular EOL type. */
+  enum eol_type eol_type;
+
+  /* Additional ISO2022 information.  We define the structure above
+     because it's also needed by the detection routines. */
+  struct iso2022_decoder iso2022;
+
+  /* Additional information (the state of the running CCL program)
+     used by the CCL decoder. */
+  struct ccl_program ccl;
+
+  struct detection_state decst;
+};
+
+static int decoding_reader     (Lstream *stream,       unsigned char *data, size_t size);
+static int decoding_writer     (Lstream *stream, CONST unsigned char *data, size_t size);
+static int decoding_rewinder   (Lstream *stream);
+static int decoding_seekable_p (Lstream *stream);
+static int decoding_flusher    (Lstream *stream);
+static int decoding_closer     (Lstream *stream);
+static Lisp_Object decoding_marker (Lisp_Object stream,
+                                   void (*markobj) (Lisp_Object));
+
+DEFINE_LSTREAM_IMPLEMENTATION ("decoding", lstream_decoding,
+                              sizeof (struct decoding_stream));
+
+static Lisp_Object
+decoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object))
+{
+  Lstream *str = DECODING_STREAM_DATA (XLSTREAM (stream))->other_end;
+  Lisp_Object str_obj;
+
+  /* We do not need to mark the coding systems or charsets stored
+     within the stream because they are stored in a global list
+     and automatically marked. */
+
+  XSETLSTREAM (str_obj, str);
+  (markobj) (str_obj);
+  if (str->imp->marker)
+    return (str->imp->marker) (str_obj, markobj);
+  else
+    return Qnil;
+}
+
+/* Read SIZE bytes of data and store it into DATA.  We are a decoding stream
+   so we read data from the other end, decode it, and store it into DATA. */
+
+static int
+decoding_reader (Lstream *stream, unsigned char *data, size_t size)
+{
+  struct decoding_stream *str = DECODING_STREAM_DATA (stream);
+  unsigned char *orig_data = data;
+  int read_size;
+  int error_occurred = 0;
+
+  /* We need to interface to mule_decode(), which expects to take some
+     amount of data and store the result into a Dynarr.  We have
+     mule_decode() store into str->runoff, and take data from there
+     as necessary. */
+
+  /* We loop until we have enough data, reading chunks from the other
+     end and decoding it. */
+  while (1)
+    {
+      /* Take data from the runoff if we can.  Make sure to take at
+        most SIZE bytes, and delete the data from the runoff. */
+      if (Dynarr_length (str->runoff) > 0)
+       {
+         size_t chunk = min (size, (size_t) Dynarr_length (str->runoff));
+         memcpy (data, Dynarr_atp (str->runoff, 0), chunk);
+         Dynarr_delete_many (str->runoff, 0, chunk);
+         data += chunk;
+         size -= chunk;
+       }
+
+      if (size == 0)
+       break; /* No more room for data */
+
+      if (str->flags & CODING_STATE_END)
+       /* This means that on the previous iteration, we hit the EOF on
+          the other end.  We loop once more so that mule_decode() can
+          output any final stuff it may be holding, or any "go back
+          to a sane state" escape sequences. (This latter makes sense
+          during encoding.) */
+       break;
+
+      /* Exhausted the runoff, so get some more.  DATA has at least
+        SIZE bytes left of storage in it, so it's OK to read directly
+        into it.  (We'll be overwriting above, after we've decoded it
+        into the runoff.) */
+      read_size = Lstream_read (str->other_end, data, size);
+      if (read_size < 0)
+       {
+         error_occurred = 1;
+         break;
+       }
+      if (read_size == 0)
+       /* There might be some more end data produced in the translation.
+          See the comment above. */
+       str->flags |= CODING_STATE_END;
+      mule_decode (stream, data, str->runoff, read_size);
+    }
+
+  if (data - orig_data == 0)
+    return error_occurred ? -1 : 0;
+  else
+    return data - orig_data;
+}
+
+static int
+decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size)
+{
+  struct decoding_stream *str = DECODING_STREAM_DATA (stream);
+  int retval;
+
+  /* Decode all our data into the runoff, and then attempt to write
+     it all out to the other end.  Remove whatever chunk we succeeded
+     in writing. */
+  mule_decode (stream, data, str->runoff, size);
+  retval = Lstream_write (str->other_end, Dynarr_atp (str->runoff, 0),
+                         Dynarr_length (str->runoff));
+  if (retval > 0)
+    Dynarr_delete_many (str->runoff, 0, retval);
+  /* Do NOT return retval.  The return value indicates how much
+     of the incoming data was written, not how many bytes were
+     written. */
+  return size;
+}
+
+static void
+reset_decoding_stream (struct decoding_stream *str)
+{
+  if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_ISO2022)
+    {
+      Lisp_Object coding_system;
+      XSETCODING_SYSTEM (coding_system, str->codesys);
+      reset_iso2022 (coding_system, &str->iso2022);
+    }
+  else if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_CCL)
+    {
+      setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_DECODE (str->codesys));
+    }
+
+  str->flags = str->ch = 0;
+}
+
+static int
+decoding_rewinder (Lstream *stream)
+{
+  struct decoding_stream *str = DECODING_STREAM_DATA (stream);
+  reset_decoding_stream (str);
+  Dynarr_reset (str->runoff);
+  return Lstream_rewind (str->other_end);
+}
+
+static int
+decoding_seekable_p (Lstream *stream)
+{
+  struct decoding_stream *str = DECODING_STREAM_DATA (stream);
+  return Lstream_seekable_p (str->other_end);
+}
+
+static int
+decoding_flusher (Lstream *stream)
+{
+  struct decoding_stream *str = DECODING_STREAM_DATA (stream);
+  return Lstream_flush (str->other_end);
+}
+
+static int
+decoding_closer (Lstream *stream)
+{
+  struct decoding_stream *str = DECODING_STREAM_DATA (stream);
+  if (stream->flags & LSTREAM_FL_WRITE)
+    {
+      str->flags |= CODING_STATE_END;
+      decoding_writer (stream, 0, 0);
+    }
+  Dynarr_free (str->runoff);
+  if (str->iso2022.composite_chars)
+    Dynarr_free (str->iso2022.composite_chars);
+  return Lstream_close (str->other_end);
+}
+
+Lisp_Object
+decoding_stream_coding_system (Lstream *stream)
+{
+  Lisp_Object coding_system;
+  struct decoding_stream *str = DECODING_STREAM_DATA (stream);
+
+  XSETCODING_SYSTEM (coding_system, str->codesys);
+  return subsidiary_coding_system (coding_system, str->eol_type);
+}
+
+void
+set_decoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys)
+{
+  struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys);
+  struct decoding_stream *str = DECODING_STREAM_DATA (lstr);
+  str->codesys = cs;
+  if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT)
+    str->eol_type = CODING_SYSTEM_EOL_TYPE (cs);
+  reset_decoding_stream (str);
+}
+
+/* WARNING WARNING WARNING WARNING!!!!!  If you open up a decoding
+   stream for writing, no automatic code detection will be performed.
+   The reason for this is that automatic code detection requires a
+   seekable input.  Things will also fail if you open a decoding
+   stream for reading using a non-fully-specified coding system and
+   a non-seekable input stream. */
+
+static Lisp_Object
+make_decoding_stream_1 (Lstream *stream, Lisp_Object codesys,
+                       CONST char *mode)
+{
+  Lstream *lstr = Lstream_new (lstream_decoding, mode);
+  struct decoding_stream *str = DECODING_STREAM_DATA (lstr);
+  Lisp_Object obj;
+
+  xzero (*str);
+  str->other_end = stream;
+  str->runoff = (unsigned_char_dynarr *) Dynarr_new (unsigned_char);
+  str->eol_type = EOL_AUTODETECT;
+  if (!strcmp (mode, "r")
+      && Lstream_seekable_p (stream))
+    /* We can determine the coding system now. */
+    determine_real_coding_system (stream, &codesys, &str->eol_type);
+  set_decoding_stream_coding_system (lstr, codesys);
+  str->decst.eol_type = str->eol_type;
+  str->decst.mask = ~0;
+  XSETLSTREAM (obj, lstr);
+  return obj;
+}
+
+Lisp_Object
+make_decoding_input_stream (Lstream *stream, Lisp_Object codesys)
+{
+  return make_decoding_stream_1 (stream, codesys, "r");
+}
+
+Lisp_Object
+make_decoding_output_stream (Lstream *stream, Lisp_Object codesys)
+{
+  return make_decoding_stream_1 (stream, codesys, "w");
+}
+
+/* Note: the decode_coding_* functions all take the same
+   arguments as mule_decode(), which is to say some SRC data of
+   size N, which is to be stored into dynamic array DST.
+   DECODING is the stream within which the decoding is
+   taking place, but no data is actually read from or
+   written to that stream; that is handled in decoding_reader()
+   or decoding_writer().  This allows the same functions to
+   be used for both reading and writing. */
+
+static void
+mule_decode (Lstream *decoding, CONST unsigned char *src,
+            unsigned_char_dynarr *dst, unsigned int n)
+{
+  struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
+
+  /* If necessary, do encoding-detection now.  We do this when
+     we're a writing stream or a non-seekable reading stream,
+     meaning that we can't just process the whole input,
+     rewind, and start over. */
+
+  if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT ||
+      str->eol_type == EOL_AUTODETECT)
+    {
+      Lisp_Object codesys;
+
+      XSETCODING_SYSTEM (codesys, str->codesys);
+      detect_coding_type (&str->decst, src, n,
+                         CODING_SYSTEM_TYPE (str->codesys) !=
+                         CODESYS_AUTODETECT);
+      if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT &&
+         str->decst.mask != ~0)
+       /* #### This is cheesy.  What we really ought to do is
+          buffer up a certain amount of data so as to get a
+          less random result. */
+       codesys = coding_system_from_mask (str->decst.mask);
+      str->eol_type = str->decst.eol_type;
+      if (XCODING_SYSTEM (codesys) != str->codesys)
+       {
+         /* Preserve the CODING_STATE_END flag in case it was set.
+            If we erase it, bad things might happen. */
+         int was_end = str->flags & CODING_STATE_END;
+          set_decoding_stream_coding_system (decoding, codesys);
+         if (was_end)
+           str->flags |= CODING_STATE_END;
+       }
+    }
+
+  switch (CODING_SYSTEM_TYPE (str->codesys))
+    {
+#ifdef DEBUG_XEMACS
+    case CODESYS_INTERNAL:
+      Dynarr_add_many (dst, src, n);
+      break;
+#endif
+    case CODESYS_AUTODETECT:
+      /* If we got this far and still haven't decided on the coding
+        system, then do no conversion. */
+    case CODESYS_NO_CONVERSION:
+      decode_coding_no_conversion (decoding, src, dst, n);
+      break;
+    case CODESYS_SHIFT_JIS:
+      decode_coding_sjis (decoding, src, dst, n);
+      break;
+    case CODESYS_BIG5:
+      decode_coding_big5 (decoding, src, dst, n);
+      break;
+    case CODESYS_CCL:
+      ccl_driver (&str->ccl, src, dst, n, 0);
+      break;
+    case CODESYS_ISO2022:
+      decode_coding_iso2022 (decoding, src, dst, n);
+      break;
+    default:
+      abort ();
+    }
+}
+
+DEFUN ("decode-coding-region", Fdecode_coding_region, 3, 4, 0, /*
+Decode the text between START and END which is encoded in CODING-SYSTEM.
+This is useful if you've read in encoded text from a file without decoding
+it (e.g. you read in a JIS-formatted file but used the `binary' or
+`no-conversion' coding system, so that it shows up as "^[$B!<!+^[(B").
+Return length of decoded text.
+BUFFER defaults to the current buffer if unspecified.
+*/
+       (start, end, coding_system, buffer))
+{
+  Bufpos b, e;
+  struct buffer *buf = decode_buffer (buffer, 0);
+  Lisp_Object instream, lb_outstream, de_outstream, outstream;
+  Lstream *istr, *ostr;
+  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+
+  get_buffer_range_char (buf, start, end, &b, &e, 0);
+
+  barf_if_buffer_read_only (buf, b, e);
+
+  coding_system = Fget_coding_system (coding_system);
+  instream = make_lisp_buffer_input_stream  (buf, b, e, 0);
+  lb_outstream = make_lisp_buffer_output_stream (buf, b, 0);
+  de_outstream = make_decoding_output_stream (XLSTREAM (lb_outstream),
+                                             coding_system);
+  outstream = make_encoding_output_stream (XLSTREAM (de_outstream),
+                                          Fget_coding_system (Qbinary));
+  istr = XLSTREAM (instream);
+  ostr = XLSTREAM (outstream);
+  GCPRO4 (instream, lb_outstream, de_outstream, outstream);
+
+  /* The chain of streams looks like this:
+
+     [BUFFER] <----- send through
+                     ------> [ENCODE AS BINARY]
+                            ------> [DECODE AS SPECIFIED]
+                                    ------> [BUFFER]
+   */
+
+  while (1)
+    {
+      char tempbuf[1024]; /* some random amount */
+      Bufpos newpos, even_newer_pos;
+      Bufpos oldpos = lisp_buffer_stream_startpos (istr);
+      int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf));
+
+      if (!size_in_bytes)
+       break;
+      newpos = lisp_buffer_stream_startpos (istr);
+      Lstream_write (ostr, tempbuf, size_in_bytes);
+      even_newer_pos = lisp_buffer_stream_startpos (istr);
+      buffer_delete_range (buf, even_newer_pos - (newpos - oldpos),
+                          even_newer_pos, 0);
+    }
+  Lstream_close (istr);
+  Lstream_close (ostr);
+  UNGCPRO;
+  Lstream_delete (istr);
+  Lstream_delete (ostr);
+  Lstream_delete (XLSTREAM (de_outstream));
+  Lstream_delete (XLSTREAM (lb_outstream));
+  return Qnil;
+}
+
+\f
+/************************************************************************/
+/*           Converting to an external encoding ("encoding")            */
+/************************************************************************/
+
+/* An encoding stream is an output stream.  When you create the
+   stream, you specify the coding system that governs the encoding
+   and another stream that the resulting encoded data is to be
+   sent to, and then start sending data to it. */
+
+#define ENCODING_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, encoding)
+
+struct encoding_stream
+{
+  /* Coding system that governs the conversion. */
+  struct Lisp_Coding_System *codesys;
+
+  /* Stream that we read the encoded data from or
+     write the decoded data to. */
+  Lstream *other_end;
+
+  /* If we are reading, then we can return only a fixed amount of
+     data, so if the conversion resulted in too much data, we store it
+     here for retrieval the next time around. */
+  unsigned_char_dynarr *runoff;
+
+  /* FLAGS holds flags indicating the current state of the encoding.
+     Some of these flags are dependent on the coding system. */
+  unsigned int flags;
+
+  /* CH holds a partially built-up character.  Since we only deal
+     with one- and two-byte characters at the moment, we only use
+     this to store the first byte of a two-byte character. */
+  unsigned int ch;
+
+  /* Additional information used by the ISO2022 encoder. */
+  struct
+    {
+      /* CHARSET holds the character sets currently assigned to the G0
+        through G3 registers.  It is initialized from the array
+        INITIAL_CHARSET in CODESYS. */
+      Lisp_Object charset[4];
+
+      /* Which registers are currently invoked into the left (GL) and
+        right (GR) halves of the 8-bit encoding space? */
+      int register_left, register_right;
+
+      /* Whether we need to explicitly designate the charset in the
+        G? register before using it.  It is initialized from the
+        array FORCE_CHARSET_ON_OUTPUT in CODESYS. */
+      unsigned char force_charset_on_output[4];
+
+      /* Other state variables that need to be preserved across
+        invocations. */
+      Lisp_Object current_charset;
+      int current_half;
+      int current_char_boundary;
+    } iso2022;
+
+  /* Additional information (the state of the running CCL program)
+     used by the CCL encoder. */
+  struct ccl_program ccl;
+};
+
+static int encoding_reader (Lstream *stream, unsigned char *data, size_t size);
+static int encoding_writer (Lstream *stream, CONST unsigned char *data,
+                           size_t size);
+static int encoding_rewinder   (Lstream *stream);
+static int encoding_seekable_p (Lstream *stream);
+static int encoding_flusher    (Lstream *stream);
+static int encoding_closer     (Lstream *stream);
+static Lisp_Object encoding_marker (Lisp_Object stream,
+                                   void (*markobj) (Lisp_Object));
+
+DEFINE_LSTREAM_IMPLEMENTATION ("encoding", lstream_encoding,
+                              sizeof (struct encoding_stream));
+
+static Lisp_Object
+encoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object))
+{
+  Lstream *str = ENCODING_STREAM_DATA (XLSTREAM (stream))->other_end;
+  Lisp_Object str_obj;
+
+  /* We do not need to mark the coding systems or charsets stored
+     within the stream because they are stored in a global list
+     and automatically marked. */
+
+  XSETLSTREAM (str_obj, str);
+  (markobj) (str_obj);
+  if (str->imp->marker)
+    return (str->imp->marker) (str_obj, markobj);
+  else
+    return Qnil;
+}
+
+/* Read SIZE bytes of data and store it into DATA.  We are a encoding stream
+   so we read data from the other end, encode it, and store it into DATA. */
+
+static int
+encoding_reader (Lstream *stream, unsigned char *data, size_t size)
+{
+  struct encoding_stream *str = ENCODING_STREAM_DATA (stream);
+  unsigned char *orig_data = data;
+  int read_size;
+  int error_occurred = 0;
+
+  /* We need to interface to mule_encode(), which expects to take some
+     amount of data and store the result into a Dynarr.  We have
+     mule_encode() store into str->runoff, and take data from there
+     as necessary. */
+
+  /* We loop until we have enough data, reading chunks from the other
+     end and encoding it. */
+  while (1)
+    {
+      /* Take data from the runoff if we can.  Make sure to take at
+        most SIZE bytes, and delete the data from the runoff. */
+      if (Dynarr_length (str->runoff) > 0)
+       {
+         int chunk = min ((int) size, Dynarr_length (str->runoff));
+         memcpy (data, Dynarr_atp (str->runoff, 0), chunk);
+         Dynarr_delete_many (str->runoff, 0, chunk);
+         data += chunk;
+         size -= chunk;
+       }
+
+      if (size == 0)
+       break; /* No more room for data */
+
+      if (str->flags & CODING_STATE_END)
+       /* This means that on the previous iteration, we hit the EOF on
+          the other end.  We loop once more so that mule_encode() can
+          output any final stuff it may be holding, or any "go back
+          to a sane state" escape sequences. (This latter makes sense
+          during encoding.) */
+       break;
+
+      /* Exhausted the runoff, so get some more.  DATA at least SIZE bytes
+        left of storage in it, so it's OK to read directly into it.
+        (We'll be overwriting above, after we've encoded it into the
+        runoff.) */
+      read_size = Lstream_read (str->other_end, data, size);
+      if (read_size < 0)
+       {
+         error_occurred = 1;
+         break;
+       }
+      if (read_size == 0)
+       /* There might be some more end data produced in the translation.
+          See the comment above. */
+       str->flags |= CODING_STATE_END;
+      mule_encode (stream, data, str->runoff, read_size);
+    }
+
+  if (data == orig_data)
+    return error_occurred ? -1 : 0;
+  else
+    return data - orig_data;
+}
+
+static int
+encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size)
+{
+  struct encoding_stream *str = ENCODING_STREAM_DATA (stream);
+  int retval;
+
+  /* Encode all our data into the runoff, and then attempt to write
+     it all out to the other end.  Remove whatever chunk we succeeded
+     in writing. */
+  mule_encode (stream, data, str->runoff, size);
+  retval = Lstream_write (str->other_end, Dynarr_atp (str->runoff, 0),
+                         Dynarr_length (str->runoff));
+  if (retval > 0)
+    Dynarr_delete_many (str->runoff, 0, retval);
+  /* Do NOT return retval.  The return value indicates how much
+     of the incoming data was written, not how many bytes were
+     written. */
+  return size;
+}
+
+static void
+reset_encoding_stream (struct encoding_stream *str)
+{
+  switch (CODING_SYSTEM_TYPE (str->codesys))
+    {
+    case CODESYS_ISO2022:
+      {
+       int i;
+
+       for (i = 0; i < 4; i++)
+         {
+           str->iso2022.charset[i] =
+             CODING_SYSTEM_ISO2022_INITIAL_CHARSET (str->codesys, i);
+           str->iso2022.force_charset_on_output[i] =
+             CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (str->codesys, i);
+         }
+       str->iso2022.register_left = 0;
+       str->iso2022.register_right = 1;
+       str->iso2022.current_charset = Qnil;
+       str->iso2022.current_half = 0;
+       str->iso2022.current_char_boundary = 1;
+       break;
+      }
+    case CODESYS_CCL:
+      setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_ENCODE (str->codesys));
+      break;
+    default:
+      break;
+    }
+
+  str->flags = str->ch = 0;
+}
+
+static int
+encoding_rewinder (Lstream *stream)
+{
+  struct encoding_stream *str = ENCODING_STREAM_DATA (stream);
+  reset_encoding_stream (str);
+  Dynarr_reset (str->runoff);
+  return Lstream_rewind (str->other_end);
+}
+
+static int
+encoding_seekable_p (Lstream *stream)
+{
+  struct encoding_stream *str = ENCODING_STREAM_DATA (stream);
+  return Lstream_seekable_p (str->other_end);
+}
+
+static int
+encoding_flusher (Lstream *stream)
+{
+  struct encoding_stream *str = ENCODING_STREAM_DATA (stream);
+  return Lstream_flush (str->other_end);
+}
+
+static int
+encoding_closer (Lstream *stream)
+{
+  struct encoding_stream *str = ENCODING_STREAM_DATA (stream);
+  if (stream->flags & LSTREAM_FL_WRITE)
+    {
+      str->flags |= CODING_STATE_END;
+      encoding_writer (stream, 0, 0);
+    }
+  Dynarr_free (str->runoff);
+  return Lstream_close (str->other_end);
+}
+
+Lisp_Object
+encoding_stream_coding_system (Lstream *stream)
+{
+  Lisp_Object coding_system;
+  struct encoding_stream *str = ENCODING_STREAM_DATA (stream);
+
+  XSETCODING_SYSTEM (coding_system, str->codesys);
+  return coding_system;
+}
+
+void
+set_encoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys)
+{
+  struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys);
+  struct encoding_stream *str = ENCODING_STREAM_DATA (lstr);
+  str->codesys = cs;
+  reset_encoding_stream (str);
+}
+
+static Lisp_Object
+make_encoding_stream_1 (Lstream *stream, Lisp_Object codesys,
+                       CONST char *mode)
+{
+  Lstream *lstr = Lstream_new (lstream_encoding, mode);
+  struct encoding_stream *str = ENCODING_STREAM_DATA (lstr);
+  Lisp_Object obj;
+
+  xzero (*str);
+  str->runoff = Dynarr_new (unsigned_char);
+  str->other_end = stream;
+  set_encoding_stream_coding_system (lstr, codesys);
+  XSETLSTREAM (obj, lstr);
+  return obj;
+}
+
+Lisp_Object
+make_encoding_input_stream (Lstream *stream, Lisp_Object codesys)
+{
+  return make_encoding_stream_1 (stream, codesys, "r");
+}
+
+Lisp_Object
+make_encoding_output_stream (Lstream *stream, Lisp_Object codesys)
+{
+  return make_encoding_stream_1 (stream, codesys, "w");
+}
+
+/* Convert N bytes of internally-formatted data stored in SRC to an
+   external format, according to the encoding stream ENCODING.
+   Store the encoded data into DST. */
+
+static void
+mule_encode (Lstream *encoding, CONST unsigned char *src,
+            unsigned_char_dynarr *dst, unsigned int n)
+{
+  struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
+
+  switch (CODING_SYSTEM_TYPE (str->codesys))
+    {
+#ifdef DEBUG_XEMACS
+    case CODESYS_INTERNAL:
+      Dynarr_add_many (dst, src, n);
+      break;
+#endif
+    case CODESYS_AUTODETECT:
+      /* If we got this far and still haven't decided on the coding
+        system, then do no conversion. */
+    case CODESYS_NO_CONVERSION:
+      encode_coding_no_conversion (encoding, src, dst, n);
+      break;
+    case CODESYS_SHIFT_JIS:
+      encode_coding_sjis (encoding, src, dst, n);
+      break;
+    case CODESYS_BIG5:
+      encode_coding_big5 (encoding, src, dst, n);
+      break;
+    case CODESYS_CCL:
+      ccl_driver (&str->ccl, src, dst, n, 0);
+      break;
+    case CODESYS_ISO2022:
+      encode_coding_iso2022 (encoding, src, dst, n);
+      break;
+    default:
+      abort ();
+    }
+}
+
+DEFUN ("encode-coding-region", Fencode_coding_region, 3, 4, 0, /*
+Encode the text between START and END using CODING-SYSTEM.
+This will, for example, convert Japanese characters into stuff such as
+"^[$B!<!+^[(B" if you use the JIS encoding.  Return length of encoded
+text.  BUFFER defaults to the current buffer if unspecified.
+*/
+       (start, end, coding_system, buffer))
+{
+  Bufpos b, e;
+  struct buffer *buf = decode_buffer (buffer, 0);
+  Lisp_Object instream, lb_outstream, de_outstream, outstream;
+  Lstream *istr, *ostr;
+  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+
+  get_buffer_range_char (buf, start, end, &b, &e, 0);
+
+  barf_if_buffer_read_only (buf, b, e);
+
+  coding_system = Fget_coding_system (coding_system);
+  instream  = make_lisp_buffer_input_stream  (buf, b, e, 0);
+  lb_outstream = make_lisp_buffer_output_stream (buf, b, 0);
+  de_outstream = make_decoding_output_stream (XLSTREAM (lb_outstream),
+                                             Fget_coding_system (Qbinary));
+  outstream = make_encoding_output_stream (XLSTREAM (de_outstream),
+                                          coding_system);
+  istr = XLSTREAM (instream);
+  ostr = XLSTREAM (outstream);
+  GCPRO4 (instream, outstream, de_outstream, lb_outstream);
+  /* The chain of streams looks like this:
+
+     [BUFFER] <----- send through
+                     ------> [ENCODE AS SPECIFIED]
+                            ------> [DECODE AS BINARY]
+                                    ------> [BUFFER]
+   */
+  while (1)
+    {
+      char tempbuf[1024]; /* some random amount */
+      Bufpos newpos, even_newer_pos;
+      Bufpos oldpos = lisp_buffer_stream_startpos (istr);
+      int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf));
+
+      if (!size_in_bytes)
+       break;
+      newpos = lisp_buffer_stream_startpos (istr);
+      Lstream_write (ostr, tempbuf, size_in_bytes);
+      even_newer_pos = lisp_buffer_stream_startpos (istr);
+      buffer_delete_range (buf, even_newer_pos - (newpos - oldpos),
+                          even_newer_pos, 0);
+    }
+
+  {
+    Charcount retlen =
+      lisp_buffer_stream_startpos (XLSTREAM (instream)) - b;
+    Lstream_close (istr);
+    Lstream_close (ostr);
+    UNGCPRO;
+    Lstream_delete (istr);
+    Lstream_delete (ostr);
+    Lstream_delete (XLSTREAM (de_outstream));
+    Lstream_delete (XLSTREAM (lb_outstream));
+    return make_int (retlen);
+  }
+}
+
+\f
+/************************************************************************/
+/*                          Shift-JIS methods                           */
+/************************************************************************/
+
+/* Shift-JIS is a coding system encoding three character sets: ASCII, right
+   half of JISX0201-Kana, and JISX0208.  An ASCII character is encoded
+   as is.  A character of JISX0201-Kana (TYPE94 character set) is
+   encoded by "position-code + 0x80".  A character of JISX0208
+   (TYPE94x94 character set) is encoded in 2-byte but two
+   position-codes are divided and shifted so that it fit in the range
+   below.
+
+   --- CODE RANGE of Shift-JIS ---
+   (character set)     (range)
+   ASCII               0x00 .. 0x7F
+   JISX0201-Kana       0xA0 .. 0xDF
+   JISX0208 (1st byte) 0x80 .. 0x9F and 0xE0 .. 0xEF
+           (2nd byte)  0x40 .. 0x7E and 0x80 .. 0xFC
+   -------------------------------
+
+*/
+
+/* Is this the first byte of a Shift-JIS two-byte char? */
+
+#define BYTE_SJIS_TWO_BYTE_1_P(c) \
+  (((c) >= 0x81 && (c) <= 0x9F) || ((c) >= 0xE0 && (c) <= 0xEF))
+
+/* Is this the second byte of a Shift-JIS two-byte char? */
+
+#define BYTE_SJIS_TWO_BYTE_2_P(c) \
+  (((c) >= 0x40 && (c) <= 0x7E) || ((c) >= 0x80 && (c) <= 0xFC))
+
+#define BYTE_SJIS_KATAKANA_P(c)        \
+  ((c) >= 0xA1 && (c) <= 0xDF)
+
+static int
+detect_coding_sjis (struct detection_state *st, CONST unsigned char *src,
+                   unsigned int n)
+{
+  int c;
+
+  while (n--)
+    {
+      c = *src++;
+      if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO)
+       return 0;
+      if (st->shift_jis.in_second_byte)
+       {
+         st->shift_jis.in_second_byte = 0;
+         if (c < 0x40)
+           return 0;
+       }
+      else if ((c >= 0x80 && c < 0xA0) || c >= 0xE0)
+       st->shift_jis.in_second_byte = 1;
+    }
+  return CODING_CATEGORY_SHIFT_JIS_MASK;
+}
+
+/* Convert Shift-JIS data to internal format. */
+
+static void
+decode_coding_sjis (Lstream *decoding, CONST unsigned char *src,
+                   unsigned_char_dynarr *dst, unsigned int n)
+{
+  unsigned char c;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
+  struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
+
+  CODING_STREAM_DECOMPOSE (str, flags, ch);
+  eol_type = str->eol_type;
+
+  while (n--)
+    {
+      c = *src++;
+
+      if (ch)
+       {
+         /* Previous character was first byte of Shift-JIS Kanji char. */
+         if (BYTE_SJIS_TWO_BYTE_2_P (c))
+           {
+             unsigned char e1, e2;
+
+             Dynarr_add (dst, LEADING_BYTE_JAPANESE_JISX0208);
+             DECODE_SJIS (ch, c, e1, e2);
+             Dynarr_add (dst, e1);
+             Dynarr_add (dst, e2);
+           }
+         else
+           {
+             DECODE_ADD_BINARY_CHAR (ch, dst);
+             DECODE_ADD_BINARY_CHAR (c, dst);
+           }
+         ch = 0;
+       }
+      else
+       {
+         DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
+         if (BYTE_SJIS_TWO_BYTE_1_P (c))
+           ch = c;
+         else if (BYTE_SJIS_KATAKANA_P (c))
+           {
+             Dynarr_add (dst, LEADING_BYTE_KATAKANA_JISX0201);
+             Dynarr_add (dst, c);
+           }
+         else
+           DECODE_ADD_BINARY_CHAR (c, dst);
+       }
+    label_continue_loop:;
+    }
+
+  DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst);
+
+  CODING_STREAM_COMPOSE (str, flags, ch);
+}
+
+/* Convert internally-formatted data to Shift-JIS. */
+
+static void
+encode_coding_sjis (Lstream *encoding, CONST unsigned char *src,
+                   unsigned_char_dynarr *dst, unsigned int n)
+{
+  unsigned char c;
+  struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
+  unsigned int flags, ch;
+  enum eol_type eol_type;
+
+  CODING_STREAM_DECOMPOSE (str, flags, ch);
+  eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
+
+  while (n--)
+    {
+      c = *src++;
+      if (c == '\n')
+       {
+         if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
+           Dynarr_add (dst, '\r');
+         if (eol_type != EOL_CR)
+           Dynarr_add (dst, '\n');
+         ch = 0;
+       }
+      else if (BYTE_ASCII_P (c))
+       {
+         Dynarr_add (dst, c);
+         ch = 0;
+       }
+      else if (BUFBYTE_LEADING_BYTE_P (c))
+       ch = (c == LEADING_BYTE_KATAKANA_JISX0201 ||
+             c == LEADING_BYTE_JAPANESE_JISX0208_1978 ||
+             c == LEADING_BYTE_JAPANESE_JISX0208) ? c : 0;
+      else if (ch)
+       {
+         if (ch == LEADING_BYTE_KATAKANA_JISX0201)
+           {
+             Dynarr_add (dst, c);
+             ch = 0;
+           }
+         else if (ch == LEADING_BYTE_JAPANESE_JISX0208_1978 ||
+                  ch == LEADING_BYTE_JAPANESE_JISX0208)
+           ch = c;
+         else
+           {
+             unsigned char j1, j2;
+             ENCODE_SJIS (ch, c, j1, j2);
+             Dynarr_add (dst, j1);
+             Dynarr_add (dst, j2);
+             ch = 0;
+           }
+       }
+    }
+
+  CODING_STREAM_COMPOSE (str, flags, ch);
+}
+
+DEFUN ("decode-shift-jis-char", Fdecode_shift_jis_char, 1, 1, 0, /*
+Decode a JISX0208 character of Shift-JIS coding-system.
+CODE is the character code in Shift-JIS as a cons of type bytes.
+Return the corresponding character.
+*/
+       (code))
+{
+  unsigned char c1, c2, s1, s2;
+
+  CHECK_CONS (code);
+  CHECK_INT (XCAR (code));
+  CHECK_INT (XCDR (code));
+  s1 = XINT (XCAR (code));
+  s2 = XINT (XCDR (code));
+  if (BYTE_SJIS_TWO_BYTE_1_P (s1) &&
+      BYTE_SJIS_TWO_BYTE_2_P (s2))
+    {
+      DECODE_SJIS (s1, s2, c1, c2);
+      return make_char (MAKE_CHAR (Vcharset_japanese_jisx0208,
+                                  c1 & 0x7F, c2 & 0x7F));
+    }
+  else
+    return Qnil;
+}
+
+DEFUN ("encode-shift-jis-char", Fencode_shift_jis_char, 1, 1, 0, /*
+Encode a JISX0208 character CHAR to SHIFT-JIS coding-system.
+Return the corresponding character code in SHIFT-JIS as a cons of two bytes.
+*/
+       (ch))
+{
+  Lisp_Object charset;
+  int c1, c2, s1, s2;
+
+  CHECK_CHAR_COERCE_INT (ch);
+  BREAKUP_CHAR (XCHAR (ch), charset, c1, c2);
+  if (EQ (charset, Vcharset_japanese_jisx0208))
+    {
+      ENCODE_SJIS (c1 | 0x80, c2 | 0x80, s1, s2);
+      return Fcons (make_int (s1), make_int (s2));
+    }
+  else
+    return Qnil;
+}
+
+\f
+/************************************************************************/
+/*                            Big5 methods                              */
+/************************************************************************/
+
+/* BIG5 is a coding system encoding two character sets: ASCII and
+   Big5.  An ASCII character is encoded as is.  Big5 is a two-byte
+   character set and is encoded in two-byte.
+
+   --- CODE RANGE of BIG5 ---
+   (character set)     (range)
+   ASCII               0x00 .. 0x7F
+   Big5 (1st byte)     0xA1 .. 0xFE
+       (2nd byte)      0x40 .. 0x7E and 0xA1 .. 0xFE
+   --------------------------
+
+   Since the number of characters in Big5 is larger than maximum
+   characters in Emacs' charset (96x96), it can't be handled as one
+   charset.  So, in Emacs, Big5 is devided into two: `charset-big5-1'
+   and `charset-big5-2'.  Both <type>s are TYPE94x94.  The former
+   contains frequently used characters and the latter contains less
+   frequently used characters.  */
+
+#define BYTE_BIG5_TWO_BYTE_1_P(c) \
+  ((c) >= 0xA1 && (c) <= 0xFE)
+
+/* Is this the second byte of a Shift-JIS two-byte char? */
+
+#define BYTE_BIG5_TWO_BYTE_2_P(c) \
+  (((c) >= 0x40 && (c) <= 0x7E) || ((c) >= 0xA1 && (c) <= 0xFE))
+
+/* Number of Big5 characters which have the same code in 1st byte.  */
+
+#define BIG5_SAME_ROW (0xFF - 0xA1 + 0x7F - 0x40)
+
+/* Code conversion macros.  These are macros because they are used in
+   inner loops during code conversion.
+
+   Note that temporary variables in macros introduce the classic
+   dynamic-scoping problems with variable names.  We use capital-
+   lettered variables in the assumption that XEmacs does not use
+   capital letters in variables except in a very formalized way
+   (e.g. Qstring). */
+
+/* Convert Big5 code (b1, b2) into its internal string representation
+   (lb, c1, c2). */
+
+/* There is a much simpler way to split the Big5 charset into two.
+   For the moment I'm going to leave the algorithm as-is because it
+   claims to separate out the most-used characters into a single
+   charset, which perhaps will lead to optimizations in various
+   places.
+
+   The way the algorithm works is something like this:
+
+   Big5 can be viewed as a 94x157 charset, where the row is
+   encoded into the bytes 0xA1 .. 0xFE and the column is encoded
+   into the bytes 0x40 .. 0x7E and 0xA1 .. 0xFE.  As for frequency,
+   the split between low and high column numbers is apparently
+   meaningless; ascending rows produce less and less frequent chars.
+   Therefore, we assign the lower half of rows (0xA1 .. 0xC8) to
+   the first charset, and the upper half (0xC9 .. 0xFE) to the
+   second.  To do the conversion, we convert the character into
+   a single number where 0 .. 156 is the first row, 157 .. 313
+   is the second, etc.  That way, the characters are ordered by
+   decreasing frequency.  Then we just chop the space in two
+   and coerce the result into a 94x94 space.
+   */
+
+#define DECODE_BIG5(b1, b2, lb, c1, c2) do                             \
+{                                                                      \
+  int B1 = b1, B2 = b2;                                                        \
+  unsigned int I                                                       \
+    = (B1 - 0xA1) * BIG5_SAME_ROW + B2 - (B2 < 0x7F ? 0x40 : 0x62);    \
+                                                                       \
+  if (B1 < 0xC9)                                                       \
+    {                                                                  \
+      lb = LEADING_BYTE_CHINESE_BIG5_1;                                        \
+    }                                                                  \
+  else                                                                 \
+    {                                                                  \
+      lb = LEADING_BYTE_CHINESE_BIG5_2;                                        \
+      I -= (BIG5_SAME_ROW) * (0xC9 - 0xA1);                            \
+    }                                                                  \
+  c1 = I / (0xFF - 0xA1) + 0xA1;                                       \
+  c2 = I % (0xFF - 0xA1) + 0xA1;                                       \
+} while (0)
+
+/* Convert the internal string representation of a Big5 character
+   (lb, c1, c2) into Big5 code (b1, b2). */
+
+#define ENCODE_BIG5(lb, c1, c2, b1, b2) do                             \
+{                                                                      \
+  unsigned int I = ((c1) - 0xA1) * (0xFF - 0xA1) + ((c2) - 0xA1);      \
+                                                                       \
+  if (lb == LEADING_BYTE_CHINESE_BIG5_2)                               \
+    {                                                                  \
+      I += BIG5_SAME_ROW * (0xC9 - 0xA1);                              \
+    }                                                                  \
+  b1 = I / BIG5_SAME_ROW + 0xA1;                                       \
+  b2 = I % BIG5_SAME_ROW;                                              \
+  b2 += b2 < 0x3F ? 0x40 : 0x62;                                       \
+} while (0)
+
+static int
+detect_coding_big5 (struct detection_state *st, CONST unsigned char *src,
+                   unsigned int n)
+{
+  int c;
+
+  while (n--)
+    {
+      c = *src++;
+      if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO ||
+         (c >= 0x80 && c <= 0xA0))
+       return 0;
+      if (st->big5.in_second_byte)
+       {
+         st->big5.in_second_byte = 0;
+         if (c < 0x40 || (c >= 0x80 && c <= 0xA0))
+           return 0;
+       }
+      else if (c >= 0xA1)
+       st->big5.in_second_byte = 1;
+    }
+  return CODING_CATEGORY_BIG5_MASK;
+}
+
+/* Convert Big5 data to internal format. */
+
+static void
+decode_coding_big5 (Lstream *decoding, CONST unsigned char *src,
+                   unsigned_char_dynarr *dst, unsigned int n)
+{
+  unsigned char c;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
+  struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
+
+  CODING_STREAM_DECOMPOSE (str, flags, ch);
+  eol_type = str->eol_type;
+
+  while (n--)
+    {
+      c = *src++;
+      if (ch)
+       {
+         /* Previous character was first byte of Big5 char. */
+         if (BYTE_BIG5_TWO_BYTE_2_P (c))
+           {
+             unsigned char b1, b2, b3;
+             DECODE_BIG5 (ch, c, b1, b2, b3);
+             Dynarr_add (dst, b1);
+             Dynarr_add (dst, b2);
+             Dynarr_add (dst, b3);
+           }
+         else
+           {
+             DECODE_ADD_BINARY_CHAR (ch, dst);
+             DECODE_ADD_BINARY_CHAR (c, dst);
+           }
+         ch = 0;
+       }
+      else
+       {
+         DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
+         if (BYTE_BIG5_TWO_BYTE_1_P (c))
+           ch = c;
+         else
+           DECODE_ADD_BINARY_CHAR (c, dst);
+       }
+    label_continue_loop:;
+    }
+
+  DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst);
+
+  CODING_STREAM_COMPOSE (str, flags, ch);
+}
+
+/* Convert internally-formatted data to Big5. */
+
+static void
+encode_coding_big5 (Lstream *encoding, CONST unsigned char *src,
+                   unsigned_char_dynarr *dst, unsigned int n)
+{
+  unsigned char c;
+  struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
+  unsigned int flags, ch;
+  enum eol_type eol_type;
+
+  CODING_STREAM_DECOMPOSE (str, flags, ch);
+  eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
+
+  while (n--)
+    {
+      c = *src++;
+      if (c == '\n')
+       {
+         if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
+           Dynarr_add (dst, '\r');
+         if (eol_type != EOL_CR)
+           Dynarr_add (dst, '\n');
+       }
+      else if (BYTE_ASCII_P (c))
+       {
+         /* ASCII. */
+         Dynarr_add (dst, c);
+       }
+      else if (BUFBYTE_LEADING_BYTE_P (c))
+       {
+         if (c == LEADING_BYTE_CHINESE_BIG5_1 ||
+             c == LEADING_BYTE_CHINESE_BIG5_2)
+           {
+             /* A recognized leading byte. */
+             ch = c;
+             continue; /* not done with this character. */
+           }
+         /* otherwise just ignore this character. */
+       }
+      else if (ch == LEADING_BYTE_CHINESE_BIG5_1 ||
+              ch == LEADING_BYTE_CHINESE_BIG5_2)
+       {
+         /* Previous char was a recognized leading byte. */
+         ch = (ch << 8) | c;
+         continue; /* not done with this character. */
+       }
+      else if (ch)
+       {
+         /* Encountering second byte of a Big5 character. */
+         unsigned char b1, b2;
+
+         ENCODE_BIG5 (ch >> 8, ch & 0xFF, c, b1, b2);
+         Dynarr_add (dst, b1);
+         Dynarr_add (dst, b2);
+       }
+
+      ch = 0;
+    }
+
+  CODING_STREAM_COMPOSE (str, flags, ch);
+}
+
+
+DEFUN ("decode-big5-char", Fdecode_big5_char, 1, 1, 0, /*
+Decode a Big5 character CODE of BIG5 coding-system.
+CODE is the character code in BIG5, a cons of two integers.
+Return the corresponding character.
+*/
+       (code))
+{
+  unsigned char c1, c2, b1, b2;
+
+  CHECK_CONS (code);
+  CHECK_INT (XCAR (code));
+  CHECK_INT (XCDR (code));
+  b1 = XINT (XCAR (code));
+  b2 = XINT (XCDR (code));
+  if (BYTE_BIG5_TWO_BYTE_1_P (b1) &&
+      BYTE_BIG5_TWO_BYTE_2_P (b2))
+    {
+      int leading_byte;
+      Lisp_Object charset;
+      DECODE_BIG5 (b1, b2, leading_byte, c1, c2);
+      charset = CHARSET_BY_LEADING_BYTE (leading_byte);
+      return make_char (MAKE_CHAR (charset, c1 & 0x7F, c2 & 0x7F));
+    }
+  else
+    return Qnil;
+}
+
+DEFUN ("encode-big5-char", Fencode_big5_char, 1, 1, 0, /*
+Encode the Big5 character CH to BIG5 coding-system.
+Return the corresponding character code in Big5.
+*/
+       (ch))
+{
+  Lisp_Object charset;
+  int c1, c2, b1, b2;
+
+  CHECK_CHAR_COERCE_INT (ch);
+  BREAKUP_CHAR (XCHAR (ch), charset, c1, c2);
+  if (EQ (charset, Vcharset_chinese_big5_1) ||
+      EQ (charset, Vcharset_chinese_big5_2))
+    {
+      ENCODE_BIG5 (XCHARSET_LEADING_BYTE (charset), c1 | 0x80, c2 | 0x80,
+                  b1, b2);
+      return Fcons (make_int (b1), make_int (b2));
+    }
+  else
+    return Qnil;
+}
+
+\f
+/************************************************************************/
+/*                           ISO2022 methods                            */
+/************************************************************************/
+
+/* The following note describes the coding system ISO2022 briefly.
+   Since the intention of this note is to help understanding of the
+   programs in this file, some parts are NOT ACCURATE or OVERLY
+   SIMPLIFIED.  For thorough understanding, please refer to the
+   original document of ISO2022.
+
+   ISO2022 provides many mechanisms to encode several character sets
+   in 7-bit and 8-bit environments.  If one chooses 7-bit environment,
+   all text is encoded by codes of less than 128.  This may make the
+   encoded text a little bit longer, but the text get more stability
+   to pass through several gateways (some of them strip off MSB).
+
+   There are two kind of character sets: control character set and
+   graphic character set.  The former contains control characters such
+   as `newline' and `escape' to provide control functions (control
+   functions are provided also by escape sequence).  The latter
+   contains graphic characters such as 'A' and '-'.  Emacs recognizes
+   two control character sets and many graphic character sets.
+
+   Graphic character sets are classified into one of four types,
+   according to the dimension and number of characters in the set:
+   TYPE94, TYPE96, TYPE94x94, and TYPE96x96.  In addition, each
+   character set is assigned an identification byte, unique for each
+   type, called "final character" (denoted as <F> hereafter).  The <F>
+   of each character set is decided by ECMA(*) when it is registered
+   in ISO.  Code range of <F> is 0x30..0x7F (0x30..0x3F are for
+   private use only).
+
+   Note (*): ECMA = European Computer Manufacturers Association
+
+   Here are examples of graphic character set [NAME(<F>)]:
+       o TYPE94 -- ASCII('B'), right-half-of-JISX0201('I'), ...
+       o TYPE96 -- right-half-of-ISO8859-1('A'), ...
+       o TYPE94x94 -- GB2312('A'), JISX0208('B'), ...
+       o TYPE96x96 -- none for the moment
+
+   A code area (1byte=8bits) is divided into 4 areas, C0, GL, C1, and GR.
+       C0 [0x00..0x1F] -- control character plane 0
+       GL [0x20..0x7F] -- graphic character plane 0
+       C1 [0x80..0x9F] -- control character plane 1
+       GR [0xA0..0xFF] -- graphic character plane 1
+
+   A control character set is directly designated and invoked to C0 or
+   C1 by an escape sequence.  The most common case is that:
+   - ISO646's  control character set is designated/invoked to C0, and
+   - ISO6429's control character set is designated/invoked to C1,
+   and usually these designations/invocations are omitted in encoded
+   text.  In a 7-bit environment, only C0 can be used, and a control
+   character for C1 is encoded by an appropriate escape sequence to
+   fit into the environment.  All control characters for C1 are
+   defined to have corresponding escape sequences.
+
+   A graphic character set is at first designated to one of four
+   graphic registers (G0 through G3), then these graphic registers are
+   invoked to GL or GR.  These designations and invocations can be
+   done independently.  The most common case is that G0 is invoked to
+   GL, G1 is invoked to GR, and ASCII is designated to G0.  Usually
+   these invocations and designations are omitted in encoded text.
+   In a 7-bit environment, only GL can be used.
+
+   When a graphic character set of TYPE94 or TYPE94x94 is invoked to
+   GL, codes 0x20 and 0x7F of the GL area work as control characters
+   SPACE and DEL respectively, and code 0xA0 and 0xFF of GR area
+   should not be used.
+
+   There are two ways of invocation: locking-shift and single-shift.
+   With locking-shift, the invocation lasts until the next different
+   invocation, whereas with single-shift, the invocation works only
+   for the following character and doesn't affect locking-shift.
+   Invocations are done by the following control characters or escape
+   sequences.
+
+   ----------------------------------------------------------------------
+   abbrev  function                 cntrl escape seq   description
+   ----------------------------------------------------------------------
+   SI/LS0  (shift-in)               0x0F  none         invoke G0 into GL
+   SO/LS1  (shift-out)              0x0E  none         invoke G1 into GL
+   LS1R    (locking-shift-1 right)   none  ESC '~'      invoke G1 into GR
+   LS2     (locking-shift-2)        none  ESC 'n'      invoke G2 into GL
+   LS2R    (locking-shift-2 right)   none  ESC '}'      invoke G2 into GR
+   LS3     (locking-shift-3)        none  ESC 'o'      invoke G3 into GL
+   LS3R    (locking-shift 3 right)   none  ESC '|'      invoke G3 into GR
+   SS2     (single-shift-2)         0x8E  ESC 'N'      invoke G2 for one char
+   SS3     (single-shift-3)         0x8F  ESC 'O'      invoke G3 for one char
+   ----------------------------------------------------------------------
+   The first four are for locking-shift.  Control characters for these
+   functions are defined by macros ISO_CODE_XXX in `coding.h'.
+
+   Designations are done by the following escape sequences.
+   ----------------------------------------------------------------------
+   escape sequence     description
+   ----------------------------------------------------------------------
+   ESC '(' <F>         designate TYPE94<F> to G0
+   ESC ')' <F>         designate TYPE94<F> to G1
+   ESC '*' <F>         designate TYPE94<F> to G2
+   ESC '+' <F>         designate TYPE94<F> to G3
+   ESC ',' <F>         designate TYPE96<F> to G0 (*)
+   ESC '-' <F>         designate TYPE96<F> to G1
+   ESC '.' <F>         designate TYPE96<F> to G2
+   ESC '/' <F>         designate TYPE96<F> to G3
+   ESC '$' '(' <F>     designate TYPE94x94<F> to G0 (**)
+   ESC '$' ')' <F>     designate TYPE94x94<F> to G1
+   ESC '$' '*' <F>     designate TYPE94x94<F> to G2
+   ESC '$' '+' <F>     designate TYPE94x94<F> to G3
+   ESC '$' ',' <F>     designate TYPE96x96<F> to G0 (*)
+   ESC '$' '-' <F>     designate TYPE96x96<F> to G1
+   ESC '$' '.' <F>     designate TYPE96x96<F> to G2
+   ESC '$' '/' <F>     designate TYPE96x96<F> to G3
+   ----------------------------------------------------------------------
+   In this list, "TYPE94<F>" means a graphic character set of type TYPE94
+   and final character <F>, and etc.
+
+   Note (*): Although these designations are not allowed in ISO2022,
+   Emacs accepts them on decoding, and produces them on encoding
+   TYPE96 or TYPE96x96 character set in a coding system which is
+   characterized as 7-bit environment, non-locking-shift, and
+   non-single-shift.
+
+   Note (**): If <F> is '@', 'A', or 'B', the intermediate character
+   '(' can be omitted.  We call this as "short-form" here after.
+
+   Now you may notice that there are a lot of ways for encoding the
+   same multilingual text in ISO2022.  Actually, there exist many
+   coding systems such as Compound Text (used in X's inter client
+   communication, ISO-2022-JP (used in Japanese internet), ISO-2022-KR
+   (used in Korean internet), EUC (Extended UNIX Code, used in Asian
+   localized platforms), and all of these are variants of ISO2022.
+
+   In addition to the above, Emacs handles two more kinds of escape
+   sequences: ISO6429's direction specification and Emacs' private
+   sequence for specifying character composition.
+
+   ISO6429's direction specification takes the following format:
+       o CSI ']'      -- end of the current direction
+       o CSI '0' ']'  -- end of the current direction
+       o CSI '1' ']'  -- start of left-to-right text
+       o CSI '2' ']'  -- start of right-to-left text
+   The control character CSI (0x9B: control sequence introducer) is
+   abbreviated to the escape sequence ESC '[' in 7-bit environment.
+
+   Character composition specification takes the following format:
+       o ESC '0' -- start character composition
+       o ESC '1' -- end character composition
+   Since these are not standard escape sequences of any ISO, the use
+   of them for these meanings is restricted to Emacs only.  */
+
+static void
+reset_iso2022 (Lisp_Object coding_system, struct iso2022_decoder *iso)
+{
+  int i;
+
+  for (i = 0; i < 4; i++)
+    {
+      if (!NILP (coding_system))
+       iso->charset[i] =
+         XCODING_SYSTEM_ISO2022_INITIAL_CHARSET (coding_system, i);
+      else
+       iso->charset[i] = Qt;
+      iso->invalid_designated[i] = 0;
+    }
+  iso->esc = ISO_ESC_NOTHING;
+  iso->esc_bytes_index = 0;
+  iso->register_left = 0;
+  iso->register_right = 1;
+  iso->switched_dir_and_no_valid_charset_yet = 0;
+  iso->invalid_switch_dir = 0;
+  iso->output_direction_sequence = 0;
+  iso->output_literally = 0;
+  if (iso->composite_chars)
+    Dynarr_reset (iso->composite_chars);
+}
+
+static int
+fit_to_be_escape_quoted (unsigned char c)
+{
+  switch (c)
+    {
+    case ISO_CODE_ESC:
+    case ISO_CODE_CSI:
+    case ISO_CODE_SS2:
+    case ISO_CODE_SS3:
+    case ISO_CODE_SO:
+    case ISO_CODE_SI:
+      return 1;
+
+    default:
+      return 0;
+    }
+}
+
+/* Parse one byte of an ISO2022 escape sequence.
+   If the result is an invalid escape sequence, return 0 and
+   do not change anything in STR.  Otherwise, if the result is
+   an incomplete escape sequence, update ISO2022.ESC and
+   ISO2022.ESC_BYTES and return -1.  Otherwise, update
+   all the state variables (but not ISO2022.ESC_BYTES) and
+   return 1.
+
+   If CHECK_INVALID_CHARSETS is non-zero, check for designation
+   or invocation of an invalid character set and treat that as
+   an unrecognized escape sequence. */
+
+static int
+parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso,
+                  unsigned char c, unsigned int *flags,
+                  int check_invalid_charsets)
+{
+  /* (1) If we're at the end of a designation sequence, CS is the
+     charset being designated and REG is the register to designate
+     it to.
+
+     (2) If we're at the end of a locking-shift sequence, REG is
+     the register to invoke and HALF (0 == left, 1 == right) is
+     the half to invoke it into.
+
+     (3) If we're at the end of a single-shift sequence, REG is
+     the register to invoke. */
+  Lisp_Object cs = Qnil;
+  int reg, half;
+
+  /* NOTE: This code does goto's all over the fucking place.
+     The reason for this is that we're basically implementing
+     a state machine here, and hierarchical languages like C
+     don't really provide a clean way of doing this. */
+
+  if (! (*flags & CODING_STATE_ESCAPE))
+    /* At beginning of escape sequence; we need to reset our
+       escape-state variables. */
+    iso->esc = ISO_ESC_NOTHING;
+
+  iso->output_literally = 0;
+  iso->output_direction_sequence = 0;
+
+  switch (iso->esc)
+    {
+    case ISO_ESC_NOTHING:
+      iso->esc_bytes_index = 0;
+      switch (c)
+       {
+       case ISO_CODE_ESC:      /* Start escape sequence */
+         *flags |= CODING_STATE_ESCAPE;
+         iso->esc = ISO_ESC;
+         goto not_done;
+
+       case ISO_CODE_CSI:      /* ISO6429 (specifying directionality) */
+         *flags |= CODING_STATE_ESCAPE;
+         iso->esc = ISO_ESC_5_11;
+         goto not_done;
+
+       case ISO_CODE_SO:       /* locking shift 1 */
+         reg = 1; half = 0;
+         goto locking_shift;
+       case ISO_CODE_SI:       /* locking shift 0 */
+         reg = 0; half = 0;
+         goto locking_shift;
+
+       case ISO_CODE_SS2:      /* single shift */
+         reg = 2;
+         goto single_shift;
+       case ISO_CODE_SS3:      /* single shift */
+         reg = 3;
+         goto single_shift;
+
+       default:                        /* Other control characters */
+         return 0;
+       }
+
+    case ISO_ESC:
+      switch (c)
+       {
+         /**** single shift ****/
+
+       case 'N':       /* single shift 2 */
+         reg = 2;
+         goto single_shift;
+       case 'O':       /* single shift 3 */
+         reg = 3;
+         goto single_shift;
+
+         /**** locking shift ****/
+
+       case '~':       /* locking shift 1 right */
+         reg = 1; half = 1;
+         goto locking_shift;
+       case 'n':       /* locking shift 2 */
+         reg = 2; half = 0;
+         goto locking_shift;
+       case '}':       /* locking shift 2 right */
+         reg = 2; half = 1;
+         goto locking_shift;
+       case 'o':       /* locking shift 3 */
+         reg = 3; half = 0;
+         goto locking_shift;
+       case '|':       /* locking shift 3 right */
+         reg = 3; half = 1;
+         goto locking_shift;
+
+         /**** composite ****/
+
+       case '0':
+         iso->esc = ISO_ESC_START_COMPOSITE;
+         *flags = (*flags & CODING_STATE_ISO2022_LOCK) |
+           CODING_STATE_COMPOSITE;
+         return 1;
+
+       case '1':
+         iso->esc = ISO_ESC_END_COMPOSITE;
+         *flags = (*flags & CODING_STATE_ISO2022_LOCK) &
+           ~CODING_STATE_COMPOSITE;
+         return 1;
+
+         /**** directionality ****/
+
+       case '[':
+         iso->esc = ISO_ESC_5_11;
+         goto not_done;
+
+         /**** designation ****/
+
+       case '$':       /* multibyte charset prefix */
+         iso->esc = ISO_ESC_2_4;
+         goto not_done;
+
+       default:
+         if (0x28 <= c && c <= 0x2F)
+           {
+             iso->esc = (enum iso_esc_flag) (c - 0x28 + ISO_ESC_2_8);
+             goto not_done;
+           }
+
+         /* This function is called with CODESYS equal to nil when
+            doing coding-system detection. */
+         if (!NILP (codesys)
+             && XCODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys)
+             && fit_to_be_escape_quoted (c))
+           {
+             iso->esc = ISO_ESC_LITERAL;
+             *flags &= CODING_STATE_ISO2022_LOCK;
+             return 1;
+           }
+
+         /* bzzzt! */
+         return 0;
+       }
+
+
+
+      /**** directionality ****/
+
+    case ISO_ESC_5_11:         /* ISO6429 direction control */
+      if (c == ']')
+       {
+         *flags &= (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L);
+         goto directionality;
+       }
+      if      (c == '0') iso->esc = ISO_ESC_5_11_0;
+      else if (c == '1') iso->esc = ISO_ESC_5_11_1;
+      else if (c == '2') iso->esc = ISO_ESC_5_11_2;
+      else               return 0;
+      goto not_done;
+
+    case ISO_ESC_5_11_0:
+      if (c == ']')
+       {
+         *flags &= (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L);
+         goto directionality;
+       }
+      return 0;
+
+    case ISO_ESC_5_11_1:
+      if (c == ']')
+       {
+         *flags = (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L);
+         goto directionality;
+       }
+      return 0;
+
+    case ISO_ESC_5_11_2:
+      if (c == ']')
+       {
+         *flags = (*flags & CODING_STATE_ISO2022_LOCK) | CODING_STATE_R2L;
+         goto directionality;
+       }
+      return 0;
+
+    directionality:
+      iso->esc = ISO_ESC_DIRECTIONALITY;
+      /* Various junk here to attempt to preserve the direction sequences
+        literally in the text if they would otherwise be swallowed due
+        to invalid designations that don't show up as actual charset
+        changes in the text. */
+      if (iso->invalid_switch_dir)
+       {
+         /* We already inserted a direction switch literally into the
+            text.  We assume (#### this may not be right) that the
+            next direction switch is the one going the other way,
+            and we need to output that literally as well. */
+         iso->output_literally = 1;
+         iso->invalid_switch_dir = 0;
+       }
+      else
+       {
+         int jj;
+
+         /* If we are in the thrall of an invalid designation,
+          then stick the directionality sequence literally into the
+          output stream so it ends up in the original text again. */
+         for (jj = 0; jj < 4; jj++)
+           if (iso->invalid_designated[jj])
+             break;
+         if (jj < 4)
+           {
+             iso->output_literally = 1;
+             iso->invalid_switch_dir = 1;
+           }
+         else
+           /* Indicate that we haven't yet seen a valid designation,
+              so that if a switch-dir is directly followed by an
+              invalid designation, both get inserted literally. */
+           iso->switched_dir_and_no_valid_charset_yet = 1;
+       }
+      return 1;
+
+
+      /**** designation ****/
+
+    case ISO_ESC_2_4:
+      if (0x28 <= c && c <= 0x2F)
+       {
+         iso->esc = (enum iso_esc_flag) (c - 0x28 + ISO_ESC_2_4_8);
+         goto not_done;
+       }
+      if (0x40 <= c && c <= 0x42)
+       {
+         cs = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_94X94, c,
+                                     *flags & CODING_STATE_R2L ?
+                                     CHARSET_RIGHT_TO_LEFT :
+                                     CHARSET_LEFT_TO_RIGHT);
+         reg = 0;
+         goto designated;
+       }
+      return 0;
+
+    default:
+      {
+       int type =-1;
+
+       if (c < '0' || c > '~')
+         return 0; /* bad final byte */
+
+       if (iso->esc >= ISO_ESC_2_8 &&
+           iso->esc <= ISO_ESC_2_15)
+         {
+           type = ((iso->esc >= ISO_ESC_2_12) ?
+                   CHARSET_TYPE_96 : CHARSET_TYPE_94);
+           reg = (iso->esc - ISO_ESC_2_8) & 3;
+         }
+       else if (iso->esc >= ISO_ESC_2_4_8 &&
+                iso->esc <= ISO_ESC_2_4_15)
+         {
+           type = ((iso->esc >= ISO_ESC_2_4_12) ?
+                   CHARSET_TYPE_96X96 : CHARSET_TYPE_94X94);
+           reg = (iso->esc - ISO_ESC_2_4_8) & 3;
+         }
+       else
+         {
+           /* Can this ever be reached? -slb */
+           abort();
+         }
+
+       cs = CHARSET_BY_ATTRIBUTES (type, c,
+                                   *flags & CODING_STATE_R2L ?
+                                   CHARSET_RIGHT_TO_LEFT :
+                                   CHARSET_LEFT_TO_RIGHT);
+       goto designated;
+      }
+    }
+
+ not_done:
+  iso->esc_bytes[iso->esc_bytes_index++] = (unsigned char) c;
+  return -1;
+
+ single_shift:
+  if (check_invalid_charsets && !CHARSETP (iso->charset[reg]))
+    /* can't invoke something that ain't there. */
+    return 0;
+  iso->esc = ISO_ESC_SINGLE_SHIFT;
+  *flags &= CODING_STATE_ISO2022_LOCK;
+  if (reg == 2)
+    *flags |= CODING_STATE_SS2;
+  else
+    *flags |= CODING_STATE_SS3;
+  return 1;
+
+ locking_shift:
+  if (check_invalid_charsets &&
+      !CHARSETP (iso->charset[reg]))
+    /* can't invoke something that ain't there. */
+    return 0;
+  if (half)
+    iso->register_right = reg;
+  else
+    iso->register_left = reg;
+  *flags &= CODING_STATE_ISO2022_LOCK;
+  iso->esc = ISO_ESC_LOCKING_SHIFT;
+  return 1;
+
+ designated:
+  if (NILP (cs) && check_invalid_charsets)
+    {
+      iso->invalid_designated[reg] = 1;
+      iso->charset[reg] = Vcharset_ascii;
+      iso->esc = ISO_ESC_DESIGNATE;
+      *flags &= CODING_STATE_ISO2022_LOCK;
+      iso->output_literally = 1;
+      if (iso->switched_dir_and_no_valid_charset_yet)
+       {
+         /* We encountered a switch-direction followed by an
+            invalid designation.  Ensure that the switch-direction
+            gets outputted; otherwise it will probably get eaten
+            when the text is written out again. */
+         iso->switched_dir_and_no_valid_charset_yet = 0;
+         iso->output_direction_sequence = 1;
+         /* And make sure that the switch-dir going the other
+            way gets outputted, as well. */
+         iso->invalid_switch_dir = 1;
+       }
+      return 1;
+    }
+  /* This function is called with CODESYS equal to nil when
+     doing coding-system detection. */
+  if (!NILP (codesys))
+    {
+      charset_conversion_spec_dynarr *dyn =
+       XCODING_SYSTEM (codesys)->iso2022.input_conv;
+
+      if (dyn)
+       {
+         int i;
+
+         for (i = 0; i < Dynarr_length (dyn); i++)
+           {
+             struct charset_conversion_spec *spec = Dynarr_atp (dyn, i);
+             if (EQ (cs, spec->from_charset))
+               cs = spec->to_charset;
+           }
+       }
+    }
+
+  iso->charset[reg] = cs;
+  iso->esc = ISO_ESC_DESIGNATE;
+  *flags &= CODING_STATE_ISO2022_LOCK;
+  if (iso->invalid_designated[reg])
+    {
+      iso->invalid_designated[reg] = 0;
+      iso->output_literally = 1;
+    }
+  if (iso->switched_dir_and_no_valid_charset_yet)
+    iso->switched_dir_and_no_valid_charset_yet = 0;
+  return 1;
+}
+
+static int
+detect_coding_iso2022 (struct detection_state *st, CONST unsigned char *src,
+                      unsigned int n)
+{
+  int c;
+  int mask;
+
+  /* #### There are serious deficiencies in the recognition mechanism
+     here.  This needs to be much smarter if it's going to cut it. */
+
+  if (!st->iso2022.initted)
+    {
+      reset_iso2022 (Qnil, &st->iso2022.iso);
+      st->iso2022.mask = (CODING_CATEGORY_ISO_7_MASK |
+                         CODING_CATEGORY_ISO_8_DESIGNATE_MASK |
+                         CODING_CATEGORY_ISO_8_1_MASK |
+                         CODING_CATEGORY_ISO_8_2_MASK |
+                         CODING_CATEGORY_ISO_LOCK_SHIFT_MASK);
+      st->iso2022.flags = 0;
+      st->iso2022.high_byte_count = 0;
+      st->iso2022.saw_single_shift = 0;
+      st->iso2022.initted = 1;
+    }
+
+  mask = st->iso2022.mask;
+
+  while (n--)
+    {
+      c = *src++;
+      if (c >= 0xA0)
+       {
+         mask &= ~CODING_CATEGORY_ISO_7_MASK;
+         st->iso2022.high_byte_count++;
+       }
+      else
+       {
+         if (st->iso2022.high_byte_count && !st->iso2022.saw_single_shift)
+           {
+             if (st->iso2022.high_byte_count & 1)
+               /* odd number of high bytes; assume not iso-8-2 */
+               mask &= ~CODING_CATEGORY_ISO_8_2_MASK;
+           }
+         st->iso2022.high_byte_count = 0;
+         st->iso2022.saw_single_shift = 0;
+         if (c > 0x80)
+           mask &= ~CODING_CATEGORY_ISO_7_MASK;
+       }
+      if (!(st->iso2022.flags & CODING_STATE_ESCAPE)
+         && (BYTE_C0_P (c) || BYTE_C1_P (c)))
+       { /* control chars */
+         switch (c)
+           {
+             /* Allow and ignore control characters that you might
+                reasonably see in a text file */
+           case '\r':
+           case '\n':
+           case '\t':
+           case  7: /* bell */
+           case  8: /* backspace */
+           case 11: /* vertical tab */
+           case 12: /* form feed */
+           case 26: /* MS-DOS C-z junk */
+           case 31: /* '^_' -- for info */
+             goto label_continue_loop;
+
+           default:
+             break;
+           }
+       }
+
+      if ((st->iso2022.flags & CODING_STATE_ESCAPE) || BYTE_C0_P (c)
+          || BYTE_C1_P (c))
+       {
+         if (parse_iso2022_esc (Qnil, &st->iso2022.iso, c,
+                                &st->iso2022.flags, 0))
+           {
+             switch (st->iso2022.iso.esc)
+               {
+               case ISO_ESC_DESIGNATE:
+                 mask &= ~CODING_CATEGORY_ISO_8_1_MASK;
+                 mask &= ~CODING_CATEGORY_ISO_8_2_MASK;
+                 break;
+               case ISO_ESC_LOCKING_SHIFT:
+                 mask = CODING_CATEGORY_ISO_LOCK_SHIFT_MASK;
+                 goto ran_out_of_chars;
+               case ISO_ESC_SINGLE_SHIFT:
+                 mask &= ~CODING_CATEGORY_ISO_8_DESIGNATE_MASK;
+                 st->iso2022.saw_single_shift = 1;
+                 break;
+               default:
+                 break;
+               }
+           }
+         else
+           {
+             mask = 0;
+             goto ran_out_of_chars;
+           }
+       }
+    label_continue_loop:;
+    }
+
+ ran_out_of_chars:
+
+  return mask;
+}
+
+static int
+postprocess_iso2022_mask (int mask)
+{
+  /* #### kind of cheesy */
+  /* If seven-bit ISO is allowed, then assume that the encoding is
+     entirely seven-bit and turn off the eight-bit ones. */
+  if (mask & CODING_CATEGORY_ISO_7_MASK)
+    mask &= ~ (CODING_CATEGORY_ISO_8_DESIGNATE_MASK |
+              CODING_CATEGORY_ISO_8_1_MASK |
+              CODING_CATEGORY_ISO_8_2_MASK);
+  return mask;
+}
+
+/* If FLAGS is a null pointer or specifies right-to-left motion,
+   output a switch-dir-to-left-to-right sequence to DST.
+   Also update FLAGS if it is not a null pointer.
+   If INTERNAL_P is set, we are outputting in internal format and
+   need to handle the CSI differently. */
+
+static void
+restore_left_to_right_direction (struct Lisp_Coding_System *codesys,
+                                unsigned_char_dynarr *dst,
+                                unsigned int *flags,
+                                int internal_p)
+{
+  if (!flags || (*flags & CODING_STATE_R2L))
+    {
+      if (CODING_SYSTEM_ISO2022_SEVEN (codesys))
+       {
+         Dynarr_add (dst, ISO_CODE_ESC);
+         Dynarr_add (dst, '[');
+       }
+      else if (internal_p)
+       DECODE_ADD_BINARY_CHAR (ISO_CODE_CSI, dst);
+      else
+       Dynarr_add (dst, ISO_CODE_CSI);
+      Dynarr_add (dst, '0');
+      Dynarr_add (dst, ']');
+      if (flags)
+       *flags &= ~CODING_STATE_R2L;
+    }
+}
+
+/* If FLAGS is a null pointer or specifies a direction different from
+   DIRECTION (which should be either CHARSET_RIGHT_TO_LEFT or
+   CHARSET_LEFT_TO_RIGHT), output the appropriate switch-dir escape
+   sequence to DST.  Also update FLAGS if it is not a null pointer.
+   If INTERNAL_P is set, we are outputting in internal format and
+   need to handle the CSI differently. */
+
+static void
+ensure_correct_direction (int direction, struct Lisp_Coding_System *codesys,
+                         unsigned_char_dynarr *dst, unsigned int *flags,
+                         int internal_p)
+{
+  if ((!flags || (*flags & CODING_STATE_R2L)) &&
+      direction == CHARSET_LEFT_TO_RIGHT)
+    restore_left_to_right_direction (codesys, dst, flags, internal_p);
+  else if (!CODING_SYSTEM_ISO2022_NO_ISO6429 (codesys)
+          && (!flags || !(*flags & CODING_STATE_R2L)) &&
+          direction == CHARSET_RIGHT_TO_LEFT)
+    {
+      if (CODING_SYSTEM_ISO2022_SEVEN (codesys))
+       {
+         Dynarr_add (dst, ISO_CODE_ESC);
+         Dynarr_add (dst, '[');
+       }
+      else if (internal_p)
+       DECODE_ADD_BINARY_CHAR (ISO_CODE_CSI, dst);
+      else
+       Dynarr_add (dst, ISO_CODE_CSI);
+      Dynarr_add (dst, '2');
+      Dynarr_add (dst, ']');
+      if (flags)
+       *flags |= CODING_STATE_R2L;
+    }
+}
+
+/* Convert ISO2022-format data to internal format. */
+
+static void
+decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src,
+                      unsigned_char_dynarr *dst, unsigned int n)
+{
+  unsigned char c;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
+  struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
+  Lisp_Object coding_system;
+  unsigned_char_dynarr *real_dst = dst;
+
+  CODING_STREAM_DECOMPOSE (str, flags, ch);
+  eol_type = str->eol_type;
+  XSETCODING_SYSTEM (coding_system, str->codesys);
+
+  if (flags & CODING_STATE_COMPOSITE)
+    dst = str->iso2022.composite_chars;
+
+  while (n--)
+    {
+      c = *src++;
+      if (flags & CODING_STATE_ESCAPE)
+       {       /* Within ESC sequence */
+         int retval = parse_iso2022_esc (coding_system, &str->iso2022,
+                                         c, &flags, 1);
+
+         if (retval)
+           {
+             switch (str->iso2022.esc)
+               {
+               case ISO_ESC_START_COMPOSITE:
+                 if (str->iso2022.composite_chars)
+                   Dynarr_reset (str->iso2022.composite_chars);
+                 else
+                   str->iso2022.composite_chars = Dynarr_new (unsigned_char);
+                 dst = str->iso2022.composite_chars;
+                 break;
+               case ISO_ESC_END_COMPOSITE:
+                 {
+                   Bufbyte comstr[MAX_EMCHAR_LEN];
+                   Bytecount len;
+                   Emchar emch = lookup_composite_char (Dynarr_atp (dst, 0),
+                                                        Dynarr_length (dst));
+                   dst = real_dst;
+                   len = set_charptr_emchar (comstr, emch);
+                   Dynarr_add_many (dst, comstr, len);
+                   break;
+                 }
+
+               case ISO_ESC_LITERAL:
+                 DECODE_ADD_BINARY_CHAR (c, dst);
+                 break;
+
+               default:
+                 /* Everything else handled already */
+                 break;
+               }
+           }
+
+         /* Attempted error recovery. */
+         if (str->iso2022.output_direction_sequence)
+           ensure_correct_direction (flags & CODING_STATE_R2L ?
+                                     CHARSET_RIGHT_TO_LEFT :
+                                     CHARSET_LEFT_TO_RIGHT,
+                                     str->codesys, dst, 0, 1);
+         /* More error recovery. */
+         if (!retval || str->iso2022.output_literally)
+           {
+             /* Output the (possibly invalid) sequence */
+             int i;
+             for (i = 0; i < str->iso2022.esc_bytes_index; i++)
+               DECODE_ADD_BINARY_CHAR (str->iso2022.esc_bytes[i], dst);
+             flags &= CODING_STATE_ISO2022_LOCK;
+             if (!retval)
+               n++, src--;/* Repeat the loop with the same character. */
+             else
+               {
+                 /* No sense in reprocessing the final byte of the
+                    escape sequence; it could mess things up anyway.
+                    Just add it now. */
+                 DECODE_ADD_BINARY_CHAR (c, dst);
+               }
+           }
+         ch = 0;
+       }
+      else if (BYTE_C0_P (c) || BYTE_C1_P (c))
+       { /* Control characters */
+
+         /***** Error-handling *****/
+
+         /* If we were in the middle of a character, dump out the
+            partial character. */
+         DECODE_OUTPUT_PARTIAL_CHAR (ch);
+
+         /* If we just saw a single-shift character, dump it out.
+            This may dump out the wrong sort of single-shift character,
+            but least it will give an indication that something went
+            wrong. */
+         if (flags & CODING_STATE_SS2)
+           {
+             DECODE_ADD_BINARY_CHAR (ISO_CODE_SS2, dst);
+             flags &= ~CODING_STATE_SS2;
+           }
+         if (flags & CODING_STATE_SS3)
+           {
+             DECODE_ADD_BINARY_CHAR (ISO_CODE_SS3, dst);
+             flags &= ~CODING_STATE_SS3;
+           }
+
+         /***** Now handle the control characters. *****/
+
+         /* Handle CR/LF */
+         DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
+
+         flags &= CODING_STATE_ISO2022_LOCK;
+
+         if (!parse_iso2022_esc (coding_system, &str->iso2022, c, &flags, 1))
+           DECODE_ADD_BINARY_CHAR (c, dst);
+       }
+      else
+       {                       /* Graphic characters */
+         Lisp_Object charset;
+         int lb;
+         int reg;
+
+         DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
+
+         /* Now determine the charset. */
+         reg = ((flags & CODING_STATE_SS2) ? 2
+                : (flags & CODING_STATE_SS3) ? 3
+                : !BYTE_ASCII_P (c) ? str->iso2022.register_right
+                : str->iso2022.register_left);
+         charset = str->iso2022.charset[reg];
+
+         /* Error checking: */
+         if (NILP (charset) || str->iso2022.invalid_designated[reg]
+             || (((c & 0x7F) == ' ' || (c & 0x7F) == ISO_CODE_DEL)
+                 && XCHARSET_CHARS (charset) == 94))
+           /* Mrmph.  We are trying to invoke a register that has no
+              or an invalid charset in it, or trying to add a character
+              outside the range of the charset.  Insert that char literally
+              to preserve it for the output. */
+           {
+             DECODE_OUTPUT_PARTIAL_CHAR (ch);
+             DECODE_ADD_BINARY_CHAR (c, dst);
+           }
+
+         else
+           {
+             /* Things are probably hunky-dorey. */
+
+             /* Fetch reverse charset, maybe. */
+             if (((flags & CODING_STATE_R2L) &&
+                  XCHARSET_DIRECTION (charset) == CHARSET_LEFT_TO_RIGHT)
+                 ||
+                 (!(flags & CODING_STATE_R2L) &&
+                  XCHARSET_DIRECTION (charset) == CHARSET_RIGHT_TO_LEFT))
+               {
+                 Lisp_Object new_charset =
+                   XCHARSET_REVERSE_DIRECTION_CHARSET (charset);
+                 if (!NILP (new_charset))
+                   charset = new_charset;
+               }
+
+             lb = XCHARSET_LEADING_BYTE (charset);
+             switch (XCHARSET_REP_BYTES (charset))
+               {
+               case 1: /* ASCII */
+                 DECODE_OUTPUT_PARTIAL_CHAR (ch);
+                 Dynarr_add (dst, c & 0x7F);
+                 break;
+
+               case 2: /* one-byte official */
+                 DECODE_OUTPUT_PARTIAL_CHAR (ch);
+                 Dynarr_add (dst, lb);
+                 Dynarr_add (dst, c | 0x80);
+                 break;
+
+               case 3: /* one-byte private or two-byte official */
+                 if (XCHARSET_PRIVATE_P (charset))
+                   {
+                     DECODE_OUTPUT_PARTIAL_CHAR (ch);
+                     Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_1);
+                     Dynarr_add (dst, lb);
+                     Dynarr_add (dst, c | 0x80);
+                   }
+                 else
+                   {
+                     if (ch)
+                       {
+                         Dynarr_add (dst, lb);
+                         Dynarr_add (dst, ch | 0x80);
+                         Dynarr_add (dst, c | 0x80);
+                         ch = 0;
+                       }
+                     else
+                       ch = c;
+                   }
+                 break;
+
+               default:        /* two-byte private */
+                 if (ch)
+                   {
+                     Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_2);
+                     Dynarr_add (dst, lb);
+                     Dynarr_add (dst, ch | 0x80);
+                     Dynarr_add (dst, c | 0x80);
+                     ch = 0;
+                   }
+                 else
+                   ch = c;
+               }
+           }
+
+         if (!ch)
+           flags &= CODING_STATE_ISO2022_LOCK;
+       }
+
+    label_continue_loop:;
+    }
+
+  if (flags & CODING_STATE_END)
+    DECODE_OUTPUT_PARTIAL_CHAR (ch);
+
+  CODING_STREAM_COMPOSE (str, flags, ch);
+}
+
+
+/***** ISO2022 encoder *****/
+
+/* Designate CHARSET into register REG. */
+
+static void
+iso2022_designate (Lisp_Object charset, unsigned char reg,
+                  struct encoding_stream *str, unsigned_char_dynarr *dst)
+{
+  CONST char *inter94 = "()*+", *inter96= ",-./";
+  unsigned int type;
+  unsigned char final;
+  Lisp_Object old_charset = str->iso2022.charset[reg];
+
+  str->iso2022.charset[reg] = charset;
+  if (!CHARSETP (charset))
+    /* charset might be an initial nil or t. */
+    return;
+  type = XCHARSET_TYPE (charset);
+  final = XCHARSET_FINAL (charset);
+  if (!str->iso2022.force_charset_on_output[reg] &&
+      CHARSETP (old_charset) &&
+      XCHARSET_TYPE (old_charset) == type &&
+      XCHARSET_FINAL (old_charset) == final)
+    return;
+
+  str->iso2022.force_charset_on_output[reg] = 0;
+
+  {
+    charset_conversion_spec_dynarr *dyn =
+      str->codesys->iso2022.output_conv;
+
+    if (dyn)
+      {
+       int i;
+
+       for (i = 0; i < Dynarr_length (dyn); i++)
+         {
+           struct charset_conversion_spec *spec = Dynarr_atp (dyn, i);
+           if (EQ (charset, spec->from_charset))
+               charset = spec->to_charset;
+         }
+      }
+  }
+
+  Dynarr_add (dst, ISO_CODE_ESC);
+  switch (type)
+    {
+    case CHARSET_TYPE_94:
+      Dynarr_add (dst, inter94[reg]);
+      break;
+    case CHARSET_TYPE_96:
+      Dynarr_add (dst, inter96[reg]);
+      break;
+    case CHARSET_TYPE_94X94:
+      Dynarr_add (dst, '$');
+      if (reg != 0
+         || !(CODING_SYSTEM_ISO2022_SHORT (str->codesys))
+         || final < '@'
+         || final > 'B')
+       Dynarr_add (dst, inter94[reg]);
+      break;
+    case CHARSET_TYPE_96X96:
+      Dynarr_add (dst, '$');
+      Dynarr_add (dst, inter96[reg]);
+      break;
+    }
+  Dynarr_add (dst, final);
+}
+
+static void
+ensure_normal_shift (struct encoding_stream *str, unsigned_char_dynarr *dst)
+{
+  if (str->iso2022.register_left != 0)
+    {
+      Dynarr_add (dst, ISO_CODE_SI);
+      str->iso2022.register_left = 0;
+    }
+}
+
+static void
+ensure_shift_out (struct encoding_stream *str, unsigned_char_dynarr *dst)
+{
+  if (str->iso2022.register_left != 1)
+    {
+      Dynarr_add (dst, ISO_CODE_SO);
+      str->iso2022.register_left = 1;
+    }
+}
+
+/* Convert internally-formatted data to ISO2022 format. */
+
+static void
+encode_coding_iso2022 (Lstream *encoding, CONST unsigned char *src,
+                      unsigned_char_dynarr *dst, unsigned int n)
+{
+  unsigned char charmask, c;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
+  unsigned char char_boundary;
+  struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
+  struct Lisp_Coding_System *codesys = str->codesys;
+  int i;
+  Lisp_Object charset;
+  int half;
+
+  /* flags for handling composite chars.  We do a little switcharoo
+     on the source while we're outputting the composite char. */
+  unsigned int saved_n = 0;
+  CONST unsigned char *saved_src = NULL;
+  int in_composite = 0;
+
+  CODING_STREAM_DECOMPOSE (str, flags, ch);
+  eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
+  char_boundary = str->iso2022.current_char_boundary;
+  charset = str->iso2022.current_charset;
+  half = str->iso2022.current_half;
+
+ back_to_square_n:
+  while (n--)
+    {
+      c = *src++;
+
+      if (BYTE_ASCII_P (c))
+       {               /* Processing ASCII character */
+         ch = 0;
+
+         restore_left_to_right_direction (codesys, dst, &flags, 0);
+
+         /* Make sure G0 contains ASCII */
+         if ((c > ' ' && c < ISO_CODE_DEL) ||
+             !CODING_SYSTEM_ISO2022_NO_ASCII_CNTL (codesys))
+           {
+             ensure_normal_shift (str, dst);
+             iso2022_designate (Vcharset_ascii, 0, str, dst);
+           }
+
+         /* If necessary, restore everything to the default state
+            at end-of-line */
+         if (c == '\n' &&
+             !(CODING_SYSTEM_ISO2022_NO_ASCII_EOL (codesys)))
+           {
+             restore_left_to_right_direction (codesys, dst, &flags, 0);
+
+             ensure_normal_shift (str, dst);
+
+             for (i = 0; i < 4; i++)
+               {
+                 Lisp_Object initial_charset =
+                   CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i);
+                 iso2022_designate (initial_charset, i, str, dst);
+               }
+           }
+         if (c == '\n')
+           {
+             if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
+               Dynarr_add (dst, '\r');
+             if (eol_type != EOL_CR)
+               Dynarr_add (dst, c);
+           }
+         else
+           {
+             if (CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys)
+                 && fit_to_be_escape_quoted (c))
+               Dynarr_add (dst, ISO_CODE_ESC);
+             Dynarr_add (dst, c);
+           }
+         char_boundary = 1;
+       }
+
+      else if (BUFBYTE_LEADING_BYTE_P (c) || BUFBYTE_LEADING_BYTE_P (ch))
+       { /* Processing Leading Byte */
+         ch = 0;
+         charset = CHARSET_BY_LEADING_BYTE (c);
+         if (LEADING_BYTE_PREFIX_P(c))
+           ch = c;
+         else if (!EQ (charset, Vcharset_control_1)
+                  && !EQ (charset, Vcharset_composite))
+           {
+             int reg;
+
+             ensure_correct_direction (XCHARSET_DIRECTION (charset),
+                                       codesys, dst, &flags, 0);
+
+             /* Now determine which register to use. */
+             reg = -1;
+             for (i = 0; i < 4; i++)
+               {
+                 if (EQ (charset, str->iso2022.charset[i]) ||
+                     EQ (charset,
+                         CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i)))
+                   {
+                     reg = i;
+                     break;
+                   }
+               }
+
+             if (reg == -1)
+               {
+                 if (XCHARSET_GRAPHIC (charset) != 0)
+                   {
+                     if (!NILP (str->iso2022.charset[1]) &&
+                         (!CODING_SYSTEM_ISO2022_SEVEN (codesys) ||
+                          CODING_SYSTEM_ISO2022_LOCK_SHIFT (codesys)))
+                       reg = 1;
+                     else if (!NILP (str->iso2022.charset[2]))
+                       reg = 2;
+                     else if (!NILP (str->iso2022.charset[3]))
+                       reg = 3;
+                     else
+                       reg = 0;
+                   }
+                 else
+                   reg = 0;
+               }
+
+             iso2022_designate (charset, reg, str, dst);
+
+             /* Now invoke that register. */
+             switch (reg)
+               {
+               case 0:
+                 ensure_normal_shift (str, dst);
+                 half = 0;
+                 break;
+
+               case 1:
+                 if (CODING_SYSTEM_ISO2022_SEVEN (codesys))
+                   {
+                     ensure_shift_out (str, dst);
+                     half = 0;
+                   }
+                 else
+                   half = 1;
+                 break;
+
+               case 2:
+                 if (CODING_SYSTEM_ISO2022_SEVEN (str->codesys))
+                   {
+                     Dynarr_add (dst, ISO_CODE_ESC);
+                     Dynarr_add (dst, 'N');
+                     half = 0;
+                   }
+                 else
+                   {
+                     Dynarr_add (dst, ISO_CODE_SS2);
+                     half = 1;
+                   }
+                 break;
+
+               case 3:
+                 if (CODING_SYSTEM_ISO2022_SEVEN (str->codesys))
+                   {
+                     Dynarr_add (dst, ISO_CODE_ESC);
+                     Dynarr_add (dst, 'O');
+                     half = 0;
+                   }
+                 else
+                   {
+                     Dynarr_add (dst, ISO_CODE_SS3);
+                     half = 1;
+                   }
+                 break;
+
+               default:
+                 abort ();
+               }
+           }
+         char_boundary = 0;
+       }
+      else
+       {                       /* Processing Non-ASCII character */
+         charmask = (half == 0 ? 0x7F : 0xFF);
+         char_boundary = 1;
+         if (EQ (charset, Vcharset_control_1))
+           {
+             if (CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys)
+                 && fit_to_be_escape_quoted (c))
+               Dynarr_add (dst, ISO_CODE_ESC);
+             /* you asked for it ... */
+             Dynarr_add (dst, c - 0x20);
+           }
+         else
+           {
+             switch (XCHARSET_REP_BYTES (charset))
+               {
+               case 2:
+                 Dynarr_add (dst, c & charmask);
+                 break;
+               case 3:
+                 if (XCHARSET_PRIVATE_P (charset))
+                   {
+                     Dynarr_add (dst, c & charmask);
+                     ch = 0;
+                   }
+                 else if (ch)
+                   {
+                     if (EQ (charset, Vcharset_composite))
+                       {
+                         if (in_composite)
+                           {
+                             /* #### Bother! We don't know how to
+                                handle this yet. */
+                             Dynarr_add (dst, '~');
+                           }
+                         else
+                           {
+                             Emchar emch = MAKE_CHAR (Vcharset_composite,
+                                                      ch & 0x7F, c & 0x7F);
+                             Lisp_Object lstr = composite_char_string (emch);
+                             saved_n = n;
+                             saved_src = src;
+                             in_composite = 1;
+                             src = XSTRING_DATA   (lstr);
+                             n   = XSTRING_LENGTH (lstr);
+                             Dynarr_add (dst, ISO_CODE_ESC);
+                             Dynarr_add (dst, '0'); /* start composing */
+                           }
+                       }
+                     else
+                       {
+                         Dynarr_add (dst, ch & charmask);
+                         Dynarr_add (dst, c & charmask);
+                       }
+                     ch = 0;
+                   }
+                 else
+                   {
+                     ch = c;
+                     char_boundary = 0;
+                   }
+                 break;
+               case 4:
+                 if (ch)
+                   {
+                     Dynarr_add (dst, ch & charmask);
+                     Dynarr_add (dst, c & charmask);
+                     ch = 0;
+                   }
+                 else
+                   {
+                     ch = c;
+                     char_boundary = 0;
+                   }
+                 break;
+               default:
+                 abort ();
+               }
+           }
+       }
+    }
+
+  if (in_composite)
+    {
+      n = saved_n;
+      src = saved_src;
+      in_composite = 0;
+      Dynarr_add (dst, ISO_CODE_ESC);
+      Dynarr_add (dst, '1'); /* end composing */
+      goto back_to_square_n; /* Wheeeeeeeee ..... */
+    }
+
+  if (char_boundary && flags & CODING_STATE_END)
+    {
+      restore_left_to_right_direction (codesys, dst, &flags, 0);
+      ensure_normal_shift (str, dst);
+      for (i = 0; i < 4; i++)
+       {
+         Lisp_Object initial_charset =
+           CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i);
+         iso2022_designate (initial_charset, i, str, dst);
+       }
+    }
+
+  CODING_STREAM_COMPOSE (str, flags, ch);
+  str->iso2022.current_char_boundary = char_boundary;
+  str->iso2022.current_charset = charset;
+  str->iso2022.current_half = half;
+
+  /* Verbum caro factum est! */
+}
+
+\f
+/************************************************************************/
+/*                     No-conversion methods                            */
+/************************************************************************/
+
+/* This is used when reading in "binary" files -- i.e. files that may
+   contain all 256 possible byte values and that are not to be
+   interpreted as being in any particular decoding. */
+static void
+decode_coding_no_conversion (Lstream *decoding, CONST unsigned char *src,
+                            unsigned_char_dynarr *dst, unsigned int n)
+{
+  unsigned char c;
+  unsigned int flags, ch;
+  enum eol_type eol_type;
+  struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
+
+  CODING_STREAM_DECOMPOSE (str, flags, ch);
+  eol_type = str->eol_type;
+
+  while (n--)
+    {
+      c = *src++;
+
+      DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
+      DECODE_ADD_BINARY_CHAR (c, dst);
+    label_continue_loop:;
+    }
+
+  DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst);
+
+  CODING_STREAM_COMPOSE (str, flags, ch);
+}
+
+static void
+encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src,
+                            unsigned_char_dynarr *dst, unsigned int n)
+{
+  unsigned char c;
+  struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
+  unsigned int flags, ch;
+  enum eol_type eol_type;
+
+  CODING_STREAM_DECOMPOSE (str, flags, ch);
+  eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
+
+  while (n--)
+    {
+      c = *src++;
+      if (c == '\n')
+       {
+         if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
+           Dynarr_add (dst, '\r');
+         if (eol_type != EOL_CR)
+           Dynarr_add (dst, '\n');
+         ch = 0;
+       }
+      else if (BYTE_ASCII_P (c))
+       {
+         assert (ch == 0);
+         Dynarr_add (dst, c);
+       }
+      else if (BUFBYTE_LEADING_BYTE_P (c))
+       {
+         assert (ch == 0);
+         if (c == LEADING_BYTE_LATIN_ISO8859_1 ||
+             c == LEADING_BYTE_CONTROL_1)
+           ch = c;
+         else
+           Dynarr_add (dst, '~'); /* untranslatable character */
+       }
+      else
+       {
+         if (ch == LEADING_BYTE_LATIN_ISO8859_1)
+           Dynarr_add (dst, c);
+         else if (ch == LEADING_BYTE_CONTROL_1)
+           {
+             assert (c < 0xC0);
+             Dynarr_add (dst, c - 0x20);
+           }
+         /* else it should be the second or third byte of an
+            untranslatable character, so ignore it */
+         ch = 0;
+       }
+    }
+
+  CODING_STREAM_COMPOSE (str, flags, ch);
+}
+
+\f
+/************************************************************************/
+/*                   Simple internal/external functions                 */
+/************************************************************************/
+
+static Extbyte_dynarr *conversion_out_dynarr;
+static Bufbyte_dynarr *conversion_in_dynarr;
+
+/* Determine coding system from coding format */
+
+#define FILE_NAME_CODING_SYSTEM                        \
+ ((NILP (Vfile_name_coding_system) ||                  \
+   (EQ ((Vfile_name_coding_system), Qbinary))) ?       \
+  Qnil : Fget_coding_system (Vfile_name_coding_system))
+
+/* #### not correct for all values of `fmt'! */
+#define FMT_CODING_SYSTEM(fmt)                                 \
+ (((fmt) == FORMAT_FILENAME) ? FILE_NAME_CODING_SYSTEM     :   \
+  ((fmt) == FORMAT_CTEXT   ) ? Fget_coding_system (Qctext) :   \
+  ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM     :   \
+  Qnil)
+
+CONST Extbyte *
+convert_to_external_format (CONST Bufbyte *ptr,
+                           Bytecount len,
+                           Extcount *len_out,
+                           enum external_data_format fmt)
+{
+  Lisp_Object coding_system = FMT_CODING_SYSTEM (fmt);
+
+  if (!conversion_out_dynarr)
+    conversion_out_dynarr = Dynarr_new (Extbyte);
+  else
+    Dynarr_reset (conversion_out_dynarr);
+
+  if (NILP (coding_system))
+    {
+      CONST Bufbyte *end = ptr + len;
+
+      for (; ptr < end;)
+        {
+          Bufbyte c =
+            (BYTE_ASCII_P (*ptr))                 ? *ptr :
+            (*ptr == LEADING_BYTE_CONTROL_1)      ? (*(ptr+1) - 0x20) :
+            (*ptr == LEADING_BYTE_LATIN_ISO8859_1) ? (*(ptr+1)) :
+            '~';
+
+          Dynarr_add (conversion_out_dynarr, (Extbyte) c);
+          INC_CHARPTR (ptr);
+        }
+
+#ifdef ERROR_CHECK_BUFPOS
+      assert (ptr == end);
+#endif
+    }
+  else
+    {
+      Lisp_Object instream, outstream, da_outstream;
+      Lstream *istr, *ostr;
+      struct gcpro gcpro1, gcpro2, gcpro3;
+      char tempbuf[1024]; /* some random amount */
+
+      instream = make_fixed_buffer_input_stream ((unsigned char *) ptr, len);
+      da_outstream = make_dynarr_output_stream
+        ((unsigned_char_dynarr *) conversion_out_dynarr);
+      outstream =
+        make_encoding_output_stream (XLSTREAM (da_outstream), coding_system);
+      istr = XLSTREAM (instream);
+      ostr = XLSTREAM (outstream);
+      GCPRO3 (instream, outstream, da_outstream);
+      while (1)
+        {
+          int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf));
+          if (!size_in_bytes)
+            break;
+          Lstream_write (ostr, tempbuf, size_in_bytes);
+        }
+      Lstream_close (istr);
+      Lstream_close (ostr);
+      UNGCPRO;
+      Lstream_delete (istr);
+      Lstream_delete (ostr);
+      Lstream_delete (XLSTREAM (da_outstream));
+    }
+
+  *len_out = Dynarr_length (conversion_out_dynarr);
+  Dynarr_add (conversion_out_dynarr, 0); /* remember to zero-terminate! */
+  return Dynarr_atp (conversion_out_dynarr, 0);
+}
+
+CONST Bufbyte *
+convert_from_external_format (CONST Extbyte *ptr,
+                             Extcount len,
+                             Bytecount *len_out,
+                             enum external_data_format fmt)
+{
+  Lisp_Object coding_system = FMT_CODING_SYSTEM (fmt);
+
+  if (!conversion_in_dynarr)
+    conversion_in_dynarr = Dynarr_new (Bufbyte);
+  else
+    Dynarr_reset (conversion_in_dynarr);
+
+  if (NILP (coding_system))
+    {
+      CONST Extbyte *end = ptr + len;
+      for (; ptr < end; ptr++)
+        {
+          Extbyte c = *ptr;
+          DECODE_ADD_BINARY_CHAR (c, conversion_in_dynarr);
+        }
+    }
+  else
+    {
+      Lisp_Object instream, outstream, da_outstream;
+      Lstream *istr, *ostr;
+      struct gcpro gcpro1, gcpro2, gcpro3;
+      char tempbuf[1024]; /* some random amount */
+
+      instream = make_fixed_buffer_input_stream ((unsigned char *) ptr, len);
+      da_outstream = make_dynarr_output_stream
+        ((unsigned_char_dynarr *) conversion_in_dynarr);
+      outstream =
+        make_decoding_output_stream (XLSTREAM (da_outstream), coding_system);
+      istr = XLSTREAM (instream);
+      ostr = XLSTREAM (outstream);
+      GCPRO3 (instream, outstream, da_outstream);
+      while (1)
+        {
+          int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf));
+          if (!size_in_bytes)
+            break;
+          Lstream_write (ostr, tempbuf, size_in_bytes);
+        }
+      Lstream_close (istr);
+      Lstream_close (ostr);
+      UNGCPRO;
+      Lstream_delete (istr);
+      Lstream_delete (ostr);
+      Lstream_delete (XLSTREAM (da_outstream));
+    }
+
+  *len_out = Dynarr_length (conversion_in_dynarr);
+  Dynarr_add (conversion_in_dynarr, 0); /* remember to zero-terminate! */
+  return Dynarr_atp (conversion_in_dynarr, 0);
+}
+
+\f
+/************************************************************************/
+/*                             Initialization                           */
+/************************************************************************/
+
+void
+syms_of_mule_coding (void)
+{
+  defsymbol (&Qbuffer_file_coding_system, "buffer-file-coding-system");
+  deferror (&Qcoding_system_error, "coding-system-error",
+           "Coding-system error", Qio_error);
+
+  DEFSUBR (Fcoding_system_p);
+  DEFSUBR (Ffind_coding_system);
+  DEFSUBR (Fget_coding_system);
+  DEFSUBR (Fcoding_system_list);
+  DEFSUBR (Fcoding_system_name);
+  DEFSUBR (Fmake_coding_system);
+  DEFSUBR (Fcopy_coding_system);
+  DEFSUBR (Fsubsidiary_coding_system);
+
+  DEFSUBR (Fcoding_system_type);
+  DEFSUBR (Fcoding_system_doc_string);
+  DEFSUBR (Fcoding_system_charset);
+  DEFSUBR (Fcoding_system_property);
+
+  DEFSUBR (Fcoding_category_list);
+  DEFSUBR (Fset_coding_priority_list);
+  DEFSUBR (Fcoding_priority_list);
+  DEFSUBR (Fset_coding_category_system);
+  DEFSUBR (Fcoding_category_system);
+
+  DEFSUBR (Fdetect_coding_region);
+  DEFSUBR (Fdecode_coding_region);
+  DEFSUBR (Fencode_coding_region);
+  DEFSUBR (Fdecode_shift_jis_char);
+  DEFSUBR (Fencode_shift_jis_char);
+  DEFSUBR (Fdecode_big5_char);
+  DEFSUBR (Fencode_big5_char);
+
+  defsymbol (&Qcoding_system_p, "coding-system-p");
+
+  defsymbol (&Qbig5, "big5");
+  defsymbol (&Qshift_jis, "shift-jis");
+  defsymbol (&Qno_conversion, "no-conversion");
+  defsymbol (&Qccl, "ccl");
+  defsymbol (&Qiso2022, "iso2022");
+
+  defsymbol (&Qmnemonic, "mnemonic");
+  defsymbol (&Qeol_type, "eol-type");
+  defsymbol (&Qpost_read_conversion, "post-read-conversion");
+  defsymbol (&Qpre_write_conversion, "pre-write-conversion");
+
+  defsymbol (&Qcr, "cr");
+  defsymbol (&Qlf, "lf");
+  defsymbol (&Qcrlf, "crlf");
+  defsymbol (&Qeol_cr, "eol-cr");
+  defsymbol (&Qeol_lf, "eol-lf");
+  defsymbol (&Qeol_crlf, "eol-crlf");
+
+  defsymbol (&Qcharset_g0, "charset-g0");
+  defsymbol (&Qcharset_g1, "charset-g1");
+  defsymbol (&Qcharset_g2, "charset-g2");
+  defsymbol (&Qcharset_g3, "charset-g3");
+  defsymbol (&Qforce_g0_on_output, "force-g0-on-output");
+  defsymbol (&Qforce_g1_on_output, "force-g1-on-output");
+  defsymbol (&Qforce_g2_on_output, "force-g2-on-output");
+  defsymbol (&Qforce_g3_on_output, "force-g3-on-output");
+  defsymbol (&Qshort, "short");
+  defsymbol (&Qno_ascii_eol, "no-ascii-eol");
+  defsymbol (&Qno_ascii_cntl, "no-ascii-cntl");
+  defsymbol (&Qseven, "seven");
+  defsymbol (&Qlock_shift, "lock-shift");
+  defsymbol (&Qno_iso6429, "no-iso6429");
+  defsymbol (&Qescape_quoted, "escape-quoted");
+  defsymbol (&Qinput_charset_conversion, "input-charset-conversion");
+  defsymbol (&Qoutput_charset_conversion, "output-charset-conversion");
+
+  defsymbol (&Qencode, "encode");
+  defsymbol (&Qdecode, "decode");
+
+  defsymbol (&Qctext, "ctext");
+
+  defsymbol (&coding_category_symbol[CODING_CATEGORY_SHIFT_JIS],
+            "shift-jis");
+  defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_7],
+            "iso-7");
+  defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_DESIGNATE],
+            "iso-8-designate");
+  defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_1],
+            "iso-8-1");
+  defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_2],
+            "iso-8-2");
+  defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_LOCK_SHIFT],
+            "iso-lock-shift");
+  defsymbol (&coding_category_symbol[CODING_CATEGORY_BIG5],
+            "big5");
+  defsymbol (&coding_category_symbol[CODING_CATEGORY_NO_CONVERSION],
+            "no-conversion");
+}
+
+void
+lstream_type_create_mule_coding (void)
+{
+  LSTREAM_HAS_METHOD (decoding, reader);
+  LSTREAM_HAS_METHOD (decoding, writer);
+  LSTREAM_HAS_METHOD (decoding, rewinder);
+  LSTREAM_HAS_METHOD (decoding, seekable_p);
+  LSTREAM_HAS_METHOD (decoding, flusher);
+  LSTREAM_HAS_METHOD (decoding, closer);
+  LSTREAM_HAS_METHOD (decoding, marker);
+
+  LSTREAM_HAS_METHOD (encoding, reader);
+  LSTREAM_HAS_METHOD (encoding, writer);
+  LSTREAM_HAS_METHOD (encoding, rewinder);
+  LSTREAM_HAS_METHOD (encoding, seekable_p);
+  LSTREAM_HAS_METHOD (encoding, flusher);
+  LSTREAM_HAS_METHOD (encoding, closer);
+  LSTREAM_HAS_METHOD (encoding, marker);
+}
+
+void
+vars_of_mule_coding (void)
+{
+  int i;
+
+  /* Initialize to something reasonable ... */
+  for (i = 0; i <= CODING_CATEGORY_LAST; i++)
+    {
+      coding_category_system[i] = Qnil;
+      coding_category_by_priority[i] = i;
+    }
+
+  DEFVAR_LISP ("keyboard-coding-system", &Vkeyboard_coding_system /*
+Coding system used for TTY keyboard input.
+Not used under a windowing system.
+*/ );
+  Vkeyboard_coding_system = Qnil;
+
+  DEFVAR_LISP ("terminal-coding-system", &Vterminal_coding_system /*
+Coding system used for TTY display output.
+Not used under a windowing system.
+*/ );
+  Vterminal_coding_system = Qnil;
+
+  DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read /*
+Overriding coding system used when writing a file or process.
+You should *bind* this, not set it.  If this is non-nil, it specifies
+the coding system that will be used when a file or process is read
+in, and overrides `buffer-file-coding-system-for-read',
+`insert-file-contents-pre-hook', etc.  Use those variables instead of
+this one for permanent changes to the environment.
+*/ );
+  Vcoding_system_for_read = Qnil;
+
+  DEFVAR_LISP ("coding-system-for-write",
+               &Vcoding_system_for_write /*
+Overriding coding system used when writing a file or process.
+You should *bind* this, not set it.  If this is non-nil, it specifies
+the coding system that will be used when a file or process is wrote
+in, and overrides `buffer-file-coding-system',
+`write-region-pre-hook', etc.  Use those variables instead of this one
+for permanent changes to the environment.
+*/ );
+  Vcoding_system_for_write = Qnil;
+
+  DEFVAR_LISP ("file-name-coding-system", &Vfile_name_coding_system /*
+Coding system used to convert pathnames when accessing files.
+*/ );
+  Vfile_name_coding_system = Qnil;
+
+  DEFVAR_BOOL ("enable-multibyte-characters", &enable_multibyte_characters /*
+Non-nil means the buffer contents are regarded as multi-byte form
+of characters, not a binary code.  This affects the display, file I/O,
+and behaviors of various editing commands.
+
+Setting this to nil does not do anything.
+*/ );
+  enable_multibyte_characters = 1;
+}
+
+void
+complex_vars_of_mule_coding (void)
+{
+  staticpro (&Vcoding_system_hashtable);
+  Vcoding_system_hashtable = make_lisp_hashtable (50, HASHTABLE_NONWEAK,
+                                                 HASHTABLE_EQ);
+
+  the_codesys_prop_dynarr = Dynarr_new (codesys_prop);
+
+#define DEFINE_CODESYS_PROP(Prop_Type, Sym) do \
+{                                              \
+  struct codesys_prop csp;                     \
+  csp.sym = (Sym);                             \
+  csp.prop_type = (Prop_Type);                 \
+  Dynarr_add (the_codesys_prop_dynarr, csp);   \
+} while (0)
+
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK,  Qmnemonic);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK,  Qeol_type);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK,  Qeol_cr);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK,  Qeol_crlf);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK,  Qeol_lf);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK,  Qpost_read_conversion);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK,  Qpre_write_conversion);
+
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g0);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g1);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g2);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g3);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g0_on_output);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g1_on_output);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g2_on_output);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g3_on_output);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qshort);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_ascii_eol);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_ascii_cntl);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qseven);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qlock_shift);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_iso6429);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qescape_quoted);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qinput_charset_conversion);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qoutput_charset_conversion);
+
+  DEFINE_CODESYS_PROP (CODESYS_PROP_CCL,     Qencode);
+  DEFINE_CODESYS_PROP (CODESYS_PROP_CCL,     Qdecode);
+
+  /* Need to create this here or we're really screwed. */
+  Fmake_coding_system (Qno_conversion, Qno_conversion, build_string ("No conversion"),
+                      list2 (Qmnemonic, build_string ("Noconv")));
+
+  Fcopy_coding_system (Fcoding_system_property (Qno_conversion, Qeol_lf),
+                      Qbinary);
+
+  /* Need this for bootstrapping */
+  coding_category_system[CODING_CATEGORY_NO_CONVERSION] =
+    Fget_coding_system (Qno_conversion);
+}
+
+#endif
diff --git a/src/mule-coding.h b/src/mule-coding.h
new file mode 100644 (file)
index 0000000..7c631d9
--- /dev/null
@@ -0,0 +1,450 @@
+/* Header for code conversion stuff
+   Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Mule 2.3.  Not in FSF. */
+
+/* 91.10.09 written by K.Handa <handa@etl.go.jp> */
+/* Rewritten by Ben Wing <ben@xemacs.org>. */
+
+#ifndef _XEMACS_MULE_CODING_H_
+#define _XEMACS_MULE_CODING_H_
+
+struct decoding_stream;
+struct encoding_stream;
+
+/* Coding system types.  These go into the TYPE field of a
+   struct Lisp_Coding_System. */
+
+enum coding_system_type
+{
+  CODESYS_AUTODETECT,  /* Automatic conversion. */
+  CODESYS_SHIFT_JIS,   /* Shift-JIS; Hankaku (half-width) KANA
+                          is also supported. */
+  CODESYS_ISO2022,     /* Any ISO2022-compliant coding system.
+                          Includes JIS, EUC, CTEXT */
+  CODESYS_BIG5,                /* BIG5 (used for Taiwanese). */
+  CODESYS_CCL,         /* Converter written in CCL. */
+  CODESYS_NO_CONVERSION        /* "No conversion"; used for binary files.
+                          We use quotes because there really
+                          is some conversion being applied,
+                          but it appears to the user as if
+                          the text is read in without conversion. */
+#ifdef DEBUG_XEMACS
+  ,CODESYS_INTERNAL    /* Raw (internally-formatted) data. */
+#endif
+};
+
+enum eol_type
+{
+  EOL_AUTODETECT,
+  EOL_LF,
+  EOL_CRLF,
+  EOL_CR
+};
+
+typedef struct charset_conversion_spec charset_conversion_spec;
+struct charset_conversion_spec
+{
+  Lisp_Object from_charset;
+  Lisp_Object to_charset;
+};
+
+typedef struct
+{
+  Dynarr_declare (charset_conversion_spec);
+} charset_conversion_spec_dynarr;
+
+struct Lisp_Coding_System
+{
+  struct lcrecord_header header;
+
+  /* Name and doc string of this coding system. */
+  Lisp_Object name, doc_string;
+
+  /* This is the major type of the coding system -- one of Big5, ISO2022,
+     Shift-JIS, etc.  See the constants above. */
+  enum coding_system_type type;
+
+  /* Mnemonic string displayed in the modeline when this coding
+     system is active for a particular buffer. */
+  Lisp_Object mnemonic;
+
+  Lisp_Object post_read_conversion, pre_write_conversion;
+
+  enum eol_type eol_type;
+
+  /* Subsidiary coding systems that specify a particular type of EOL
+     marking, rather than autodetecting it.  These will only be non-nil
+     if (eol_type == EOL_AUTODETECT). */
+  Lisp_Object eol_lf, eol_crlf, eol_cr;
+
+  struct
+  {
+    /* What are the charsets to be initially designated to G0, G1,
+       G2, G3?  If t, no charset is initially designated.  If nil,
+       no charset is initially designated and no charset is allowed
+       to be designated. */
+    Lisp_Object initial_charset[4];
+
+    /* If true, a designation escape sequence needs to be sent on output
+       for the charset in G[0-3] before that charset is used. */
+    unsigned char force_charset_on_output[4];
+
+    charset_conversion_spec_dynarr *input_conv;
+    charset_conversion_spec_dynarr *output_conv;
+
+    unsigned int shoort                :1; /* C makes you speak Dutch */
+    unsigned int no_ascii_eol  :1;
+    unsigned int no_ascii_cntl :1;
+    unsigned int seven         :1;
+    unsigned int lock_shift    :1;
+    unsigned int no_iso6429    :1;
+    unsigned int escape_quoted :1;
+  } iso2022;
+
+  struct
+  {
+    /* For a CCL coding system, these specify the CCL programs used for
+       decoding (input) and encoding (output). */
+    Lisp_Object decode, encode;
+  } ccl;
+};
+
+DECLARE_LRECORD (coding_system, struct Lisp_Coding_System);
+#define XCODING_SYSTEM(x) XRECORD (x, coding_system, struct Lisp_Coding_System)
+#define XSETCODING_SYSTEM(x, p) XSETRECORD (x, p, coding_system)
+#define CODING_SYSTEMP(x) RECORDP (x, coding_system)
+#define GC_CODING_SYSTEMP(x) GC_RECORDP (x, coding_system)
+#define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system)
+#define CONCHECK_CODING_SYSTEM(x) CONCHECK_RECORD (x, coding_system)
+
+#define CODING_SYSTEM_NAME(codesys) ((codesys)->name)
+#define CODING_SYSTEM_DOC_STRING(codesys) ((codesys)->doc_string)
+#define CODING_SYSTEM_TYPE(codesys) ((codesys)->type)
+#define CODING_SYSTEM_MNEMONIC(codesys) ((codesys)->mnemonic)
+#define CODING_SYSTEM_POST_READ_CONVERSION(codesys) \
+  ((codesys)->post_read_conversion)
+#define CODING_SYSTEM_PRE_WRITE_CONVERSION(codesys) \
+  ((codesys)->pre_write_conversion)
+#define CODING_SYSTEM_EOL_TYPE(codesys) ((codesys)->eol_type)
+#define CODING_SYSTEM_EOL_LF(codesys)   ((codesys)->eol_lf)
+#define CODING_SYSTEM_EOL_CRLF(codesys) ((codesys)->eol_crlf)
+#define CODING_SYSTEM_EOL_CR(codesys)   ((codesys)->eol_cr)
+#define CODING_SYSTEM_ISO2022_INITIAL_CHARSET(codesys, g) \
+  ((codesys)->iso2022.initial_charset[g])
+#define CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT(codesys, g) \
+  ((codesys)->iso2022.force_charset_on_output[g])
+#define CODING_SYSTEM_ISO2022_SHORT(codesys) ((codesys)->iso2022.shoort)
+#define CODING_SYSTEM_ISO2022_NO_ASCII_EOL(codesys) \
+  ((codesys)->iso2022.no_ascii_eol)
+#define CODING_SYSTEM_ISO2022_NO_ASCII_CNTL(codesys) \
+  ((codesys)->iso2022.no_ascii_cntl)
+#define CODING_SYSTEM_ISO2022_SEVEN(codesys) ((codesys)->iso2022.seven)
+#define CODING_SYSTEM_ISO2022_LOCK_SHIFT(codesys) \
+  ((codesys)->iso2022.lock_shift)
+#define CODING_SYSTEM_ISO2022_NO_ISO6429(codesys) \
+  ((codesys)->iso2022.no_iso6429)
+#define CODING_SYSTEM_ISO2022_ESCAPE_QUOTED(codesys) \
+  ((codesys)->iso2022.escape_quoted)
+#define CODING_SYSTEM_CCL_DECODE(codesys) ((codesys)->ccl.decode)
+#define CODING_SYSTEM_CCL_ENCODE(codesys) ((codesys)->ccl.encode)
+
+#define XCODING_SYSTEM_NAME(codesys) \
+  CODING_SYSTEM_NAME (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_DOC_STRING(codesys) \
+  CODING_SYSTEM_DOC_STRING (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_TYPE(codesys) \
+  CODING_SYSTEM_TYPE (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_MNEMONIC(codesys) \
+  CODING_SYSTEM_MNEMONIC (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_POST_READ_CONVERSION(codesys) \
+  CODING_SYSTEM_POST_READ_CONVERSION (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_PRE_WRITE_CONVERSION(codesys) \
+  CODING_SYSTEM_PRE_WRITE_CONVERSION (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_EOL_TYPE(codesys) \
+  CODING_SYSTEM_EOL_TYPE (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_EOL_LF(codesys) \
+  CODING_SYSTEM_EOL_LF (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_EOL_CRLF(codesys) \
+  CODING_SYSTEM_EOL_CRLF (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_EOL_CR(codesys) \
+  CODING_SYSTEM_EOL_CR (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_ISO2022_INITIAL_CHARSET(codesys, g) \
+  CODING_SYSTEM_ISO2022_INITIAL_CHARSET (XCODING_SYSTEM (codesys), g)
+#define XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT(codesys, g) \
+  CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (XCODING_SYSTEM (codesys), g)
+#define XCODING_SYSTEM_ISO2022_SHORT(codesys) \
+  CODING_SYSTEM_ISO2022_SHORT (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_ISO2022_NO_ASCII_EOL(codesys) \
+  CODING_SYSTEM_ISO2022_NO_ASCII_EOL (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_ISO2022_NO_ASCII_CNTL(codesys) \
+  CODING_SYSTEM_ISO2022_NO_ASCII_CNTL (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_ISO2022_SEVEN(codesys) \
+  CODING_SYSTEM_ISO2022_SEVEN (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_ISO2022_LOCK_SHIFT(codesys) \
+  CODING_SYSTEM_ISO2022_LOCK_SHIFT (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_ISO2022_NO_ISO6429(codesys) \
+  CODING_SYSTEM_ISO2022_NO_ISO6429 (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_ISO2022_ESCAPE_QUOTED(codesys) \
+  CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_CCL_DECODE(codesys) \
+  CODING_SYSTEM_CCL_DECODE (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_CCL_ENCODE(codesys) \
+  CODING_SYSTEM_CCL_ENCODE (XCODING_SYSTEM (codesys))
+
+extern Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error;
+
+extern Lisp_Object Vkeyboard_coding_system;
+extern Lisp_Object Vterminal_coding_system;
+extern Lisp_Object Vcoding_system_for_read;
+extern Lisp_Object Vcoding_system_for_write;
+extern Lisp_Object Vpathname_coding_system;
+
+extern Lisp_Object Qescape_quoted;
+
+/* Flags indicating current state while converting code. */
+
+/* Used by everyone. */
+
+#define CODING_STATE_END       (1 << 0) /* If set, this is the last chunk of
+                                           data being processed.  When this
+                                           is finished, output any necessary
+                                           terminating control characters,
+                                           escape sequences, etc. */
+#define CODING_STATE_CR                (1 << 1) /* If set, we just saw a CR. */
+
+
+/* Used by Big 5 on output. */
+
+#define CODING_STATE_BIG5_1    (1 << 2) /* If set, we just encountered
+                                           LEADING_BYTE_BIG5_1. */
+#define CODING_STATE_BIG5_2    (1 << 3) /* If set, we just encountered
+                                           LEADING_BYTE_BIG5_2. */
+
+
+/* Used by ISO2022 on input and output. */
+
+#define CODING_STATE_R2L       (1 << 4)  /* If set, the current
+                                            directionality is right-to-left.
+                                            Otherwise, it's left-to-right. */
+
+
+/* Used by ISO2022 on input. */
+
+#define CODING_STATE_ESCAPE    (1 << 5)  /* If set, we're currently parsing
+                                            an escape sequence and the upper
+                                            16 bits should be looked at to
+                                            indicate what partial escape
+                                            sequence we've seen so far.
+                                            Otherwise, we're running
+                                            through actual text. */
+#define CODING_STATE_SS2       (1 << 6)  /* If set, G2 is invoked into GL, but
+                                            only for the next character. */
+#define CODING_STATE_SS3       (1 << 7)  /* If set, G3 is invoked into GL,
+                                            but only for the next character.
+                                            If both CODING_STATE_SS2 and
+                                            CODING_STATE_SS3 are set,
+                                            CODING_STATE_SS2 overrides; but
+                                            this probably indicates an error
+                                            in the text encoding. */
+#define CODING_STATE_COMPOSITE  (1 << 8)  /* If set, we're currently processing
+                                            a composite character (i.e. a
+                                            character constructed by
+                                            overstriking two or more
+                                            characters). */
+
+
+/* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until
+   explicitly turned off when in the ISO2022 encoder/decoder.  Other flags are
+   turned off at the end of processing each character or escape sequence. */
+# define CODING_STATE_ISO2022_LOCK \
+  (CODING_STATE_END | CODING_STATE_COMPOSITE | CODING_STATE_R2L)
+#define CODING_STATE_BIG5_LOCK \
+  CODING_STATE_END
+
+/* Flags indicating what we've seen so far when parsing an
+   ISO2022 escape sequence. */
+enum iso_esc_flag
+{
+  /* Partial sequences */
+  ISO_ESC_NOTHING,     /* Nothing has been seen. */
+  ISO_ESC,             /* We've seen ESC. */
+  ISO_ESC_2_4,         /* We've seen ESC $.  This indicates
+                          that we're designating a multi-byte, rather
+                          than a single-byte, character set. */
+  ISO_ESC_2_8,         /* We've seen ESC 0x28, i.e. ESC (.
+                          This means designate a 94-character
+                          character set into G0. */
+  ISO_ESC_2_9,         /* We've seen ESC 0x29 -- designate a
+                          94-character character set into G1. */
+  ISO_ESC_2_10,                /* We've seen ESC 0x2A. */
+  ISO_ESC_2_11,                /* We've seen ESC 0x2B. */
+  ISO_ESC_2_12,                /* We've seen ESC 0x2C -- designate a
+                          96-character character set into G0.
+                          (This is not ISO2022-standard.
+                          The following 96-character
+                          control sequences are standard,
+                          though.) */
+  ISO_ESC_2_13,                /* We've seen ESC 0x2D -- designate a
+                          96-character character set into G1.
+                          */
+  ISO_ESC_2_14,                /* We've seen ESC 0x2E. */
+  ISO_ESC_2_15,                /* We've seen ESC 0x2F. */
+  ISO_ESC_2_4_8,       /* We've seen ESC $ 0x28 -- designate
+                          a 94^N character set into G0. */
+  ISO_ESC_2_4_9,       /* We've seen ESC $ 0x29. */
+  ISO_ESC_2_4_10,      /* We've seen ESC $ 0x2A. */
+  ISO_ESC_2_4_11,      /* We've seen ESC $ 0x2B. */
+  ISO_ESC_2_4_12,      /* We've seen ESC $ 0x2C. */
+  ISO_ESC_2_4_13,      /* We've seen ESC $ 0x2D. */
+  ISO_ESC_2_4_14,      /* We've seen ESC $ 0x2E. */
+  ISO_ESC_2_4_15,      /* We've seen ESC $ 0x2F. */
+  ISO_ESC_5_11,                /* We've seen ESC [ or 0x9B.  This
+                          starts a directionality-control
+                          sequence.  The next character
+                          must be 0, 1, 2, or ]. */
+  ISO_ESC_5_11_0,      /* We've seen 0x9B 0.  The next
+                          character must be ]. */
+  ISO_ESC_5_11_1,      /* We've seen 0x9B 1.  The next
+                          character must be ]. */
+  ISO_ESC_5_11_2,      /* We've seen 0x9B 2.  The next
+                          character must be ]. */
+
+  /* Full sequences. */
+  ISO_ESC_START_COMPOSITE, /* Private usage for START COMPOSING */
+  ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */
+  ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */
+  ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */
+  ISO_ESC_DESIGNATE,   /* We've seen a complete designation sequence. */
+  ISO_ESC_DIRECTIONALITY,/* We've seen a complete ISO6429 directionality
+                          sequence. */
+  ISO_ESC_LITERAL      /* We've seen a literal character ala
+                          escape-quoting. */
+};
+
+/* Macros to define code of control characters for ISO2022's functions.  */
+                       /* code */      /* function */
+#define ISO_CODE_LF    0x0A            /* line-feed */
+#define ISO_CODE_CR    0x0D            /* carriage-return */
+#define ISO_CODE_SO    0x0E            /* shift-out */
+#define ISO_CODE_SI    0x0F            /* shift-in */
+#define ISO_CODE_ESC   0x1B            /* escape */
+#define ISO_CODE_DEL   0x7F            /* delete */
+#define ISO_CODE_SS2   0x8E            /* single-shift-2 */
+#define ISO_CODE_SS3   0x8F            /* single-shift-3 */
+#define ISO_CODE_CSI   0x9B            /* control-sequence-introduce */
+
+/* Macros to access an encoding stream or decoding stream */
+
+#define CODING_STREAM_DECOMPOSE(str, flags, ch)        \
+do {                                           \
+  flags = (str)->flags;                                \
+  ch = (str)->ch;                              \
+} while (0)
+
+#define CODING_STREAM_COMPOSE(str, flags, ch)  \
+do {                                           \
+  (str)->flags = flags;                                \
+  (str)->ch = ch;                              \
+} while (0)
+
+
+/* For detecting the encoding of text */
+enum coding_category_type
+{
+  CODING_CATEGORY_SHIFT_JIS,
+  CODING_CATEGORY_ISO_7, /* ISO2022 system using only seven-bit bytes,
+                           no locking shift */
+  CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes,
+                                     no locking shift, no single shift,
+                                     using designation to switch charsets */
+  CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes,
+                             no locking shift, no designation sequences,
+                             one-dimension characters in the upper half. */
+  CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes,
+                             no locking shift, no designation sequences,
+                             two-dimension characters in the upper half. */
+  CODING_CATEGORY_ISO_LOCK_SHIFT, /* ISO2022 system using locking shift */
+  CODING_CATEGORY_BIG5,
+  CODING_CATEGORY_NO_CONVERSION
+};
+
+#define CODING_CATEGORY_LAST CODING_CATEGORY_NO_CONVERSION
+
+#define CODING_CATEGORY_SHIFT_JIS_MASK \
+  (1 << CODING_CATEGORY_SHIFT_JIS)
+#define CODING_CATEGORY_ISO_7_MASK \
+  (1 << CODING_CATEGORY_ISO_7)
+#define CODING_CATEGORY_ISO_8_DESIGNATE_MASK \
+  (1 << CODING_CATEGORY_ISO_8_DESIGNATE)
+#define CODING_CATEGORY_ISO_8_1_MASK \
+  (1 << CODING_CATEGORY_ISO_8_1)
+#define CODING_CATEGORY_ISO_8_2_MASK \
+  (1 << CODING_CATEGORY_ISO_8_2)
+#define CODING_CATEGORY_ISO_LOCK_SHIFT_MASK \
+  (1 << CODING_CATEGORY_ISO_LOCK_SHIFT)
+#define CODING_CATEGORY_BIG5_MASK \
+  (1 << CODING_CATEGORY_BIG5)
+#define CODING_CATEGORY_NO_CONVERSION_MASK \
+  (1 << CODING_CATEGORY_NO_CONVERSION)
+#define CODING_CATEGORY_NOT_FINISHED_MASK \
+  (1 << 30)
+
+/* Convert shift-JIS code (sj1, sj2) into internal string
+   representation (c1, c2). (The leading byte is assumed.) */
+
+#define DECODE_SJIS(sj1, sj2, c1, c2)                  \
+do {                                                   \
+  int I1 = sj1, I2 = sj2;                              \
+  if (I2 >= 0x9f)                                      \
+    c1 = (I1 << 1) - ((I1 >= 0xe0) ? 0xe0 : 0x60),     \
+    c2 = I2 + 2;                                       \
+  else                                                 \
+    c1 = (I1 << 1) - ((I1 >= 0xe0) ? 0xe1 : 0x61),     \
+    c2 = I2 + ((I2 >= 0x7f) ? 0x60 : 0x61);            \
+} while (0)
+
+/* Convert the internal string representation of a Shift-JIS character
+   (c1, c2) into Shift-JIS code (sj1, sj2).  The leading byte is
+   assumed. */
+
+#define ENCODE_SJIS(c1, c2, sj1, sj2)                  \
+do {                                                   \
+  int I1 = c1, I2 = c2;                                        \
+  if (I1 & 1)                                          \
+    sj1 = (I1 >> 1) + ((I1 < 0xdf) ? 0x31 : 0x71),     \
+    sj2 = I2 - ((I2 >= 0xe0) ? 0x60 : 0x61);           \
+  else                                                 \
+    sj1 = (I1 >> 1) + ((I1 < 0xdf) ? 0x30 : 0x70),     \
+    sj2 = I2 - 2;                                      \
+} while (0)
+
+Lisp_Object make_decoding_input_stream  (Lstream *stream, Lisp_Object codesys);
+Lisp_Object make_encoding_input_stream  (Lstream *stream, Lisp_Object codesys);
+Lisp_Object make_decoding_output_stream (Lstream *stream, Lisp_Object codesys);
+Lisp_Object make_encoding_output_stream (Lstream *stream, Lisp_Object codesys);
+Lisp_Object decoding_stream_coding_system (Lstream *stream);
+Lisp_Object encoding_stream_coding_system (Lstream *stream);
+void set_decoding_stream_coding_system (Lstream *stream, Lisp_Object codesys);
+void set_encoding_stream_coding_system (Lstream *stream, Lisp_Object codesys);
+void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out,
+                                  enum eol_type *eol_type_in_out);
+#endif /* _XEMACS_MULE_CODING_H_ */
diff --git a/src/mule-mcpath.c b/src/mule-mcpath.c
new file mode 100644 (file)
index 0000000..9e10b70
--- /dev/null
@@ -0,0 +1,306 @@
+/* Support for Non-ASCII Path Name
+   Copyright (C) 1985, 1986, 1992, 1993, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Mule 2.3.   Not in FSF. */
+
+/* mcpath.h should be included in config.h */
+#include <config.h>
+#include "lisp.h"
+
+#include "sysfile.h"
+#include "buffer.h"
+#include "mule.h"
+
+Lisp_Object Qpathname_coding_system = 0;
+
+static void
+mcpath_encode_code (struct Lisp_Coding_System *cp)
+{
+  Lisp_Object coding_system;
+
+  coding_system = Fsymbol_value (Qpathname_coding_system);
+
+  mule_encode_code (coding_system, cp);
+  CODE_CNTL (cp) |= CC_END;
+}
+
+static int
+mule_encode_path_1 (unsigned char *src, unsigned int srcsize,
+                   unsigned char *dst, unsigned int dstsize)
+{
+  struct Lisp_Coding_System code;
+
+  mcpath_encode_code (&code);
+  if (CODE_TYPE (&code) > MULE_AUTOCONV)
+    {
+      unsigned char *buf;
+
+                                       /* get_conversion_buffer () is not */
+                                       /* re-entrant. */
+      buf = (unsigned char *) alloca (MULE_ENCODE_BUF_SIZE (srcsize, &code));
+      if (buf)
+       {
+         int len;
+         Lisp_Object dummy = Qnil;
+
+         len = mule_encode (&code, src, buf, srcsize, &dummy);
+         if (!CODE_CHAR (&code) && len <= dstsize)
+           {
+             memcpy (dst, buf, len);
+             return len;
+           }
+       }
+    }
+  return -1;                           /* use original */
+}
+
+static unsigned char *
+mule_decode_path_1 (unsigned char *src, unsigned char *dst,
+                   unsigned int dstsize)
+{
+  struct Lisp_Coding_System code;
+
+  mcpath_encode_code (&code);
+  if (CODE_TYPE (&code) > MULE_AUTOCONV)
+    {
+      int len;
+      unsigned char *buf;
+
+      len = strlen (src) + 1;          /* + 1 for '\0' */
+
+                                       /* get_conversion_buffer () is not */
+                                       /* re-entrant. */
+      buf = (unsigned char *) alloca (MULE_DECODE_BUF_SIZE (len, &code));
+      if (buf)
+       {
+         CODE_CNTL (&code) |= CC_END;
+         len = mule_decode (&code, src, buf, len);
+         if (!CODE_CHAR (&code) && len <= dstsize)
+           {
+             memcpy (dst, buf, len);   /* len should include '\0' */
+             return dst;
+           }
+       }
+    }
+  return src;
+}
+
+static unsigned char *
+mule_decode_path (unsigned char *path, unsigned char ext_path[MC_MAXPATHLEN])
+{
+  return
+    (Qpathname_coding_system
+     ? mule_decode_path_1 (path, ext_path, MC_MAXPATHLEN)
+     : path);                          /* in case of before initialization */
+}
+
+static unsigned char *
+mule_encode_path (unsigned char *path, unsigned char *encode_buffer,
+                 unsigned int size)
+{
+  int len;
+
+  len = mule_encode_path_1 (path, strlen (path), encode_buffer, size);
+  if (len > 0)
+    path = encode_buffer;
+#ifdef MSDOS
+  /* convert the MSDOS style path delimiter to the UNIX style.  Note
+     that now the code is *internal*, so we can simply compare each
+     character with '\\'.  And this operation will alter the contents
+     of Lisp Object, PATH. */
+  {
+    unsigned char *p = path;
+
+    while (*p)
+      {
+       if (*p == '\\')
+         *p = '/';
+       p++;
+      }
+  }
+#endif /* MSDOS */
+  return path;
+}
+
+#if 0 /* example of how they do it (similar junk deleted) ... */
+
+int
+mc_creat (unsigned char *path, int mode)
+{
+  unsigned char buffer[MC_MAXPATHLEN];
+  return creat (mule_decode_path (path, buffer), mode);
+}
+
+int
+mc_readlink (unsigned char *path, unsigned char *buf, int size)
+{
+  unsigned char buffer[MC_MAXPATHLEN], buffer2[MAXPATHLEN];
+  int nread;
+
+  nread = readlink (mule_decode_path (path, buffer), buffer2, MAXPATHLEN);
+  if (nread > 0)
+    {
+      int len;
+      unsigned char *p;
+
+      len = mule_encode_path_1 (buffer2, nread, buffer, sizeof (buffer));
+      if (0 <= len && len <= size)
+       {
+         memcpy (buf, buffer, len);
+         return len;
+       }
+    }
+  return -1;
+}
+
+int
+mc_chdir (unsigned char *path)
+{
+  unsigned char buffer[MC_MAXPATHLEN];
+
+  path = mule_decode_path (path, buffer);
+
+#ifdef MSDOS
+  if ((path[0] != 0) && (path[1] == ':'))
+    {
+      int drive = (tolower (path[0]) - 'a');
+      if (getdisk () != drive)
+       setdisk (drive);
+    }
+
+  /* If path != "/" and path != "a:/" and path ends with slash, remove
+     it. */
+  {
+    int len = strlen (path);
+
+    if (strcmp (path + 1, ":/") && (len > 1) && (path[len - 1] == '/'))
+      {
+       if (path != buffer)     /* It is not good to modify original path. */
+         {
+           memcpy (buffer, path, len - 1); /* no need to copy last /. */
+           path = buffer;
+         }
+       path[len - 1] = 0;
+      }
+  }
+#endif /* MSDOS */
+
+  return chdir (path);
+}
+
+#ifdef MSDOS
+#ifndef HAVE_GETWD
+unsigned char *
+mc_getcwd (unsigned char *null, size_t size)
+{
+  unsigned char buffer[MAXPATHLEN];
+  unsigned char *path;
+
+  path = (unsigned char *) getcwd ((char *)buffer, MAXPATHLEN);
+  if (path)
+    {
+      /* here, shoule be (path == buffer). */
+      path = (unsigned char *) xmalloc (MC_MAXPATHLEN);        /* MSDOS */
+      if (path)
+       {
+         int len;
+         int buffer_length = strlen (buffer) + 1;
+
+         len = mule_encode_path_1 (buffer, buffer_length, path, MC_MAXPATHLEN);
+         if (len < 0)
+           {
+             /* conversion failed.  use value that is returned from system. */
+             memcpy (path, buffer, buffer_length);
+           }
+       }
+    }
+  return path;
+}
+#else /* HAVE_GETWD */
+unsigned char *
+mc_getwd (unsigned char path[])
+{
+  unsigned char *p;
+  p = getwd (path);
+  if (p)
+    {
+      unsigned char buffer[MC_MAXPATHLEN];
+      int len;
+      
+      len = mule_encode_path_1 (path, strlen (path) + 1, buffer, sizeof buffer);
+      if (len > 0)
+       {
+         memcpy (path, buffer, len);
+       }
+    }
+  return p;
+}
+#endif /* HAVE_GETWD */
+#endif /* MSDOS */
+
+/* In callproc.c, execvp() is called like this:
+ *     execvp (new_argv[0], new_argv);
+ * following implement depends this.
+ */
+#ifndef NO_MC_EXECVP
+void
+mc_execvp (unsigned char *path, unsigned char *argv[])
+{
+  unsigned char buffer[MC_MAXPATHLEN];
+  argv[0] = path = mule_decode_path (path, buffer);
+  execvp (path, argv);
+}
+#endif /* !NO_MC_EXECVP */
+
+static DIRENTRY mcpath_directory_entry;
+DIRENTRY *
+mc_readdir (DIR *d)
+{
+  SYSTEM_DIRENTRY *sp;
+  DIRENTRY *dp = &mcpath_directory_entry;
+
+  sp = readdir (d);
+  if (!sp) return 0;
+
+#ifndef MSDOS
+  dp->d_ino = sp->d_ino;
+#endif /* MSDOS */
+  {                            /* copy d_name with conversion. */
+    int len;
+
+    len = mule_encode_path_1 (sp->d_name, NAMLEN (sp),
+                             dp->d_name, sizeof (dp->d_name) - 1);
+    if (len < 0)
+      {
+       len = NAMLEN (sp);
+#ifdef MCPATH_ASSERT
+       assert (len < sizeof (dp->d_name));
+#endif
+       memcpy (dp->d_name, sp->d_name, len);
+      }
+    dp->d_name[len] = 0;
+  }
+  return dp;
+}
+
+#endif /* 0 */
+
diff --git a/src/mule-mcpath.h b/src/mule-mcpath.h
new file mode 100644 (file)
index 0000000..0033b62
--- /dev/null
@@ -0,0 +1,95 @@
+/* Support for Non-ASCII Path Name
+   Copyright (C) 1985, 1986, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Mule 2.3.  Not in FSF. */
+
+/* This part cannot be surround with #ifdef emacs, because it is needed */
+/* during generate xmakefile. */
+#ifndef MCPATH
+# define MCPATH
+#endif /* !MCPATH */
+
+/* not to confuse while compiling etc/*.c */
+#ifdef emacs
+#ifdef MCPATH
+#  ifndef _MCPATH_H                    /* enable to include twice */
+
+#if 1
+\f
+/* !!! This page is copied from dired.c except that DIRENTRY is
+   changed to SYSTEM_DIRENTRY.  Don't modify this page. */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+/* The d_nameln member of a struct dirent includes the '\0' character
+   on some systems, but not on others.  What's worse, you can't tell
+   at compile-time which one it will be, since it really depends on
+   the sort of system providing the filesystem you're reading from,
+   not the system you are running on.  Paul Eggert
+   <eggert@bi.twinsun.com> says this occurs when Emacs is running on a
+   SunOS 4.1.2 host, reading a directory that is remote-mounted from a
+   Solaris 2.1 host and is in a native Solaris 2.1 filesystem.
+
+   Since applying strlen to the name always works, we'll just do that.  */
+#define NAMLEN(p) strlen (p->d_name)
+
+#ifdef SYSV_SYSTEM_DIR
+
+#include <dirent.h>
+#define SYSTEM_DIRENTRY struct dirent
+
+#else /* not SYSV_SYSTEM_DIR */
+
+#ifdef NONSYSTEM_DIR_LIBRARY
+#include "ndir.h"
+#else /* not NONSYSTEM_DIR_LIBRARY */
+#ifdef MSDOS
+#include <dirent.h>
+#else
+#include <sys/dir.h>
+#endif
+#endif /* not NONSYSTEM_DIR_LIBRARY */
+
+#ifndef MSDOS
+#define SYSTEM_DIRENTRY struct direct
+
+extern DIR *opendir ();
+extern struct direct *readdir ();
+
+#endif /* not MSDOS */
+#endif /* not SYSV_SYSTEM_DIR */
+#endif
+\f
+                               /* maximum buffer size to do conversion. */
+#define MCPATH_BUFSIZ(s) (((s) * 3) + 256)
+#define MC_MAXPATHLEN MCPATH_BUFSIZ (MAXPATHLEN)
+
+#define DIRENTRY struct mcpath_direntry
+struct mcpath_direntry
+{
+                               /* emacs 19.28 uses d_ino and d_name. */
+#ifndef MSDOS
+  int d_ino;
+#endif /* not MSDOS */
+  unsigned char d_name [MCPATH_BUFSIZ (MAXNAMLEN) + 1];
+};
index 1569365..a4c3629 100644 (file)
@@ -285,7 +285,7 @@ Boston, MA 02111-1307, USA.  */
 #define WNNSERVER_T 2
 #define WNNSERVER_K 3
 
-int check_wnn_server_type (void);
+int check_wnn_server_type (void); 
 void w2m (w_char *wp, unsigned char *mp, unsigned char lb);
 void m2w (unsigned char *mp, w_char *wp);
 void w2y (w_char *w);
@@ -348,7 +348,7 @@ Return nil if error occurs
     case WNNSERVER_C:
       langname = "zh_CN";
       break;
-/*
+/*  
     case WNNSERVER_T:
     strcpy (langname, "zh_TW");
     break;
@@ -408,7 +408,7 @@ Return nil if error occurs
 
 
 DEFUN ("wnn-server-close", Fwnn_close, 0, 0, 0, /*
-Close the connection to jserver, Dictionary and frequency files
+Close the connection to jserver, Dictionary and friquency files
 are not saved.
 */
      ())
@@ -418,13 +418,13 @@ are not saved.
   if (!wnnfns_buf[snum]) return Qnil;
   if (wnnfns_env_norm[snum])
     {
-      if (NILP (Vwnnenv_sticky)) jl_env_un_sticky_e (wnnfns_env_norm[snum]);
+      if (EQ(Vwnnenv_sticky, Qnil)) jl_env_un_sticky_e (wnnfns_env_norm[snum]);
       else jl_env_sticky_e (wnnfns_env_norm[snum]);
       jl_disconnect (wnnfns_env_norm[snum]);
     }
   if (wnnfns_env_rev[snum])
     {
-      if (NILP (Vwnnenv_sticky)) jl_env_un_sticky_e (wnnfns_env_rev[snum]);
+      if (EQ(Vwnnenv_sticky, Qnil)) jl_env_un_sticky_e (wnnfns_env_rev[snum]);
       else jl_env_sticky_e (wnnfns_env_rev[snum]);
       jl_disconnect (wnnfns_env_rev[snum]);
     }
@@ -447,21 +447,21 @@ Specify password files of dictionary and frequency, PW1 and PW2, if needed.
   CHECK_STRING (args[0]);
   CHECK_STRING (args[1]);
   CHECK_INT (args[2]);
-  if (! NILP (args[5])) CHECK_STRING (args[5]);
-  if (! NILP (args[6])) CHECK_STRING (args[6]);
+  if (!EQ(args[5], Qnil)) CHECK_STRING (args[5]);
+  if (!EQ(args[6], Qnil)) CHECK_STRING (args[6]);
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   if (!wnnfns_buf[snum]) return Qnil;
   GCPRO1 (*args);
   gcpro1.nvars = nargs;
   if (jl_dic_add (wnnfns_buf[snum],
-                 XSTRING_DATA (args[0]),
-                 XSTRING_DATA (args[1]),
+                 XSTRING (args[0])->_data,
+                 XSTRING (args[1])->_data,
                  wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
                  XINT (args[2]),
-                 NILP (args[3]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
-                 NILP (args[4]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
-                 NILP (args[5]) ? 0 : XSTRING_DATA (args[5]),
-                 NILP (args[6]) ? 0 : XSTRING_DATA (args[6]),
+                 (EQ(args[3], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
+                 (EQ(args[4], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
+                 (EQ(args[5], Qnil)) ? 0 : XSTRING (args[5])->_data,
+                 (EQ(args[6], Qnil)) ? 0 : XSTRING (args[6])->_data,
                  yes_or_no,
                  puts2 ) < 0)
     {
@@ -496,7 +496,7 @@ Return information of dictionaries.
   int          cnt, i;
   unsigned char        comment[1024];
   Lisp_Object  val;
-  int  snum;
+  int  snum;  
   unsigned char lb;
 
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
@@ -529,7 +529,7 @@ Return information of dictionaries.
 DEFUN ("wnn-server-dict-comment", Fwnn_dict_comment, 2, 2, 0, /*
 Set comment to dictionary specified by DIC-NUMBER.
 Comment string COMMENT
-*/
+*/ 
      (dicno, comment))
 {
   w_char wbuf[512];
@@ -538,8 +538,8 @@ Comment string COMMENT
   CHECK_STRING (comment);
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   if (!wnnfns_buf[snum]) return Qnil;
-  m2w (XSTRING_DATA (comment), wbuf);
-  if (jl_dic_comment_set (wnnfns_buf[snum], XINT (dicno), wbuf) < 0)
+  m2w (XSTRING (comment)->_data, wbuf);
+  if (jl_dic_comment_set (wnnfns_buf[snum], XINT (dicno), wbuf) < 0) 
     return Qnil;
   return Qt;
 }
@@ -552,7 +552,7 @@ Switch the translation mode to normal if T, or reverse if NIL.
 {
   int  snum;
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
-  if (NILP (rev))
+  if (EQ(rev, Qnil))
     {
       if ((!wnnfns_buf[snum]) || (!wnnfns_env_norm[snum])) return Qnil;
       jl_env_set (wnnfns_buf[snum], wnnfns_env_norm[snum]);
@@ -578,15 +578,15 @@ Translate YOMI string to kanji. Retuen the number of bunsetsu.
   CHECK_STRING (hstring);
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   if (!wnnfns_buf[snum]) return Qnil;
-  m2w (XSTRING_DATA (hstring), wbuf);
+  m2w (XSTRING (hstring)->_data, wbuf);
   if (snum == WNNSERVER_C)
     w2y (wbuf);
 
 #ifdef WNN6
-  if ((cnt = jl_fi_ren_conv (wnnfns_buf[snum], wbuf,   0, -1, WNN_USE_MAE)) < 0)
+  if ((cnt = jl_fi_ren_conv (wnnfns_buf[snum], wbuf,   0, -1, WNN_USE_MAE)) < 0) 
     return Qnil;
 #else
-  if ((cnt = jl_ren_conv (wnnfns_buf[snum], wbuf,      0, -1, WNN_USE_MAE)) < 0)
+  if ((cnt = jl_ren_conv (wnnfns_buf[snum], wbuf,      0, -1, WNN_USE_MAE)) < 0) 
     return Qnil;
 #endif
   return make_int (cnt);
@@ -696,7 +696,7 @@ Set candidate with OFFSET, DAI. DAI is T if dai-bunsetsu.
   CHECK_INT (offset);
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   if (!wnnfns_buf[snum]) return Qnil;
-  if (NILP (dai))
+  if (EQ(dai, Qnil))
     {
       if (jl_set_jikouho (wnnfns_buf[snum], XINT (offset)) < 0) return Qnil;
     }
@@ -722,11 +722,11 @@ Change length of BUN-NUMBER bunsetu to LEN. DAI is T if dai-bunsetsu.
   no = XINT (bunNo);
 #ifdef WNN6
   if ((cnt = jl_fi_nobi_conv (wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE,
-                             NILP (dai) ? WNN_SHO : WNN_DAI)) < 0)
+                             (EQ(dai, Qnil)) ? WNN_SHO : WNN_DAI)) < 0)
     return Qnil;
 #else
   if ((cnt = jl_nobi_conv (wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE,
-                          NILP (dai) ? WNN_SHO : WNN_DAI)) < 0)
+                          (EQ(dai, Qnil)) ? WNN_SHO : WNN_DAI)) < 0)
     return Qnil;
 #endif
   return make_int (cnt);
@@ -844,7 +844,7 @@ Update frequency of bunsetsu specified by NUM-NUMBER.
   int          no;
   int  snum;
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
-  if (NILP (bunNo)) no = -1;
+  if (EQ(bunNo, Qnil)) no = -1;
   else
     {
       CHECK_INT (bunNo);
@@ -875,13 +875,13 @@ DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER
   CHECK_INT (hinsi);
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   if (!wnnfns_buf[snum]) return Qnil;
-  m2w (XSTRING_DATA (yomi), yomi_buf);
+  m2w (XSTRING (yomi)->_data, yomi_buf);
   if (snum == WNNSERVER_C)
     w2y (yomi_buf);
-  m2w (XSTRING_DATA (kanji), kanji_buf);
-  m2w (XSTRING_DATA (comment), comment_buf);
+  m2w (XSTRING (kanji)->_data, kanji_buf);
+  m2w (XSTRING (comment)->_data, comment_buf);
   if (jl_word_add (wnnfns_buf[snum], XINT (dicno), yomi_buf, kanji_buf,
-                  comment_buf, XINT (hinsi), 0) < 0)
+                  comment_buf, XINT (hinsi), 0) < 0) 
     return Qnil;
   else return Qt;
 }
@@ -992,7 +992,7 @@ Return list of (kanji hinshi freq dic_no serial).
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   lb = lb_wnn_server_type[snum];
   if (!wnnfns_buf[snum]) return Qnil;
-  m2w (XSTRING_DATA (yomi), wbuf);
+  m2w (XSTRING (yomi)->_data, wbuf);
   if (snum == WNNSERVER_C)
     w2y (wbuf);
   if ((count = jl_word_search_by_env (wnnfns_buf[snum],
@@ -1080,7 +1080,7 @@ or wnn_kaikakko and the CDR contains the value.
       CHECK_INT (val);
       setval = XINT (val);
       if (EQ (key, Qwnn_n)) param.n = setval;
-      else if (EQ (key, Qwnn_nsho)) param.nsho = setval;
+      else if (EQ (key, Qwnn_nsho)) param.nsho = setval; 
       else if (EQ (key, Qwnn_hindo)) param.p1 = setval;
       else if (EQ (key, Qwnn_len)) param.p2 = setval;
       else if (EQ (key, Qwnn_jiri)) param.p3 = setval;
@@ -1106,21 +1106,21 @@ or wnn_kaikakko and the CDR contains the value.
 #if 0
   printf("wnn_n = %d\n",param.n);
   printf("wnn_nsho = %d\n",param.nsho);
-  printf("wnn_hindo = %d\n",param.p1);
-  printf("wnn_len = %d\n",param.p2);
-  printf("wnn_jiri = %d\n",param.p3);
-  printf("wnn_flag = %d\n",param.p4);
-  printf("wnn_jisho = %d\n",param.p5);
-  printf("wnn_sbn = %d\n",param.p6);
-  printf("wnn_dbn_len = %d\n",param.p7);
-  printf("wnn_sbn_cnt = %d\n",param.p8);
-  printf("wnn_suuji = %d\n",param.p9);
-  printf("wnn_kana = %d\n",param.p10);
-  printf("wnn_eisuu = %d\n",param.p11);
-  printf("wnn_kigou = %d\n",param.p12);
-  printf("wnn_toji_kakko = %d\n",param.p13);
-  printf("wnn_fuzokogo = %d\n",param.p14);
-  printf("wnn_kaikakko = %d\n",param.p15);
+  printf("wnn_hindo = %d\n",param.p1); 
+  printf("wnn_len = %d\n",param.p2); 
+  printf("wnn_jiri = %d\n",param.p3); 
+  printf("wnn_flag = %d\n",param.p4); 
+  printf("wnn_jisho = %d\n",param.p5); 
+  printf("wnn_sbn = %d\n",param.p6); 
+  printf("wnn_dbn_len = %d\n",param.p7); 
+  printf("wnn_sbn_cnt = %d\n",param.p8); 
+  printf("wnn_suuji = %d\n",param.p9); 
+  printf("wnn_kana = %d\n",param.p10); 
+  printf("wnn_eisuu = %d\n",param.p11); 
+  printf("wnn_kigou = %d\n",param.p12); 
+  printf("wnn_toji_kakko = %d\n",param.p13); 
+  printf("wnn_fuzokogo = %d\n",param.p14); 
+  printf("wnn_kaikakko = %d\n",param.p15); 
 #endif
 
   rc = jl_param_set (wnnfns_buf[snum], &param);
@@ -1175,7 +1175,7 @@ For Wnn.
   CHECK_STRING (file);
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   if (!wnnfns_buf[snum]) return Qnil;
-  if (jl_fuzokugo_set (wnnfns_buf[snum], XSTRING_DATA (file)) < 0)
+  if (jl_fuzokugo_set (wnnfns_buf[snum], XSTRING (file)->_data) < 0)
     return Qnil;
   return Qt;
 }
@@ -1246,7 +1246,7 @@ For Wnn.
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   lb = lb_wnn_server_type[snum];
   if (!wnnfns_buf[snum]) return Qnil;
-  m2w (XSTRING_DATA (name), wbuf);
+  m2w (XSTRING (name)->_data, wbuf);
   if ((cnt = jl_hinsi_list (wnnfns_buf[snum], XINT (dicno), wbuf, &area)) < 0)
     return Qnil;
   if (cnt == 0) return make_int (0);
@@ -1289,21 +1289,21 @@ Specify password files of dictionary and frequency, PW1 and PW2, if needed.
   int   snum;
   CHECK_STRING (args[0]);
   CHECK_STRING (args[1]);
-  if (! NILP (args[3])) CHECK_STRING (args[3]);
+  if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]);
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   GCPRO1 (*args);
   gcpro1.nvars = nargs;
   if(jl_fi_dic_add(wnnfns_buf[snum],
-                  XSTRING_DATA (args[0]),
-                  XSTRING_DATA (args[1]),
-                  WNN_FI_SYSTEM_DICT,
-                  WNN_DIC_RDONLY,
-                  NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
-                  0,
-                  NILP (args[3]) ? 0 : XSTRING_DATA (args[3]),
-                  yes_or_no,
-                  puts2 ) < 0) {
+                XSTRING(args[0])->_data,
+                XSTRING(args[1])->_data,
+               WNN_FI_SYSTEM_DICT,
+               WNN_DIC_RDONLY,
+                (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
+               0,
+                (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data,
+                yes_or_no,
+                puts2 ) < 0) {
     UNGCPRO;
     return Qnil;
   }
@@ -1322,22 +1322,22 @@ Specify password files of dictionary and frequency, PW1 and PW2, if needed.
   int   snum;
   CHECK_STRING (args[0]);
   CHECK_STRING (args[1]);
-  if (! NILP (args[4])) CHECK_STRING (args[4]);
-  if (! NILP (args[5])) CHECK_STRING (args[5]);
+  if (!EQ(args[4], Qnil)) CHECK_STRING (args[4]);
+  if (!EQ(args[5], Qnil)) CHECK_STRING (args[5]);
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   GCPRO1 (*args);
   gcpro1.nvars = nargs;
   if(jl_fi_dic_add(wnnfns_buf[snum],
-                  XSTRING_DATA (args[0]),
-                  XSTRING_DATA (args[1]),
-                  WNN_FI_USER_DICT,
-                  NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
-                  NILP (args[3]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
-                  NILP (args[4]) ? 0 : XSTRING_DATA (args[4]),
-                  NILP (args[5]) ? 0 : XSTRING_DATA (args[5]),
-                  yes_or_no,
-                  puts2 ) < 0) {
+                XSTRING(args[0])->_data,
+                XSTRING(args[1])->_data,
+                WNN_FI_USER_DICT,
+                (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
+               (EQ(args[3], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
+               (EQ(args[4], Qnil)) ? 0 : XSTRING(args[4])->_data,
+                (EQ(args[5], Qnil)) ? 0 : XSTRING(args[5])->_data,
+                yes_or_no,
+                puts2 ) < 0) {
     UNGCPRO;
     return Qnil;
   }
@@ -1359,7 +1359,7 @@ Specify password files of dictionary and frequency PW1 if needed.
   struct wnn_henkan_env henv;
   CHECK_STRING (args[0]);
   CHECK_INT (args[1]);
-  if (! NILP (args[3])) CHECK_STRING (args[3]);
+  if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]);
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   GCPRO1 (*args);
@@ -1371,12 +1371,12 @@ Specify password files of dictionary and frequency PW1 if needed.
   dic_no = js_get_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING);
   if (dic_no == WNN_NO_LEARNING) {
       if((dic_no = jl_dic_add(wnnfns_buf[snum],
-                             XSTRING_DATA (args[0]),
+                             XSTRING(args[0])->_data,
                              0,
                              wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
                              XINT(args[1]),
                              WNN_DIC_RW, WNN_DIC_RW,
-                             NILP (args[3]) ? 0 : XSTRING_DATA (args[3]),
+                             (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data,
                              0,
                              yes_or_no,
                              puts2)) < 0) {
@@ -1393,7 +1393,7 @@ Specify password files of dictionary and frequency PW1 if needed.
       }
   }
   vmask |= WNN_ENV_MUHENKAN_LEARN_MASK;
-  henv.muhenkan_flag = NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW;
+  henv.muhenkan_flag = (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                        vmask,
                        &henv) < 0) {
@@ -1418,7 +1418,7 @@ Specify password files of dictionary and frequency PW1 if needed.
   struct wnn_henkan_env henv;
   CHECK_STRING (args[0]);
   CHECK_INT (args[1]);
-  if (! NILP (args[3])) CHECK_STRING (args[3]);
+  if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]);
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   GCPRO1 (*args);
@@ -1430,12 +1430,12 @@ Specify password files of dictionary and frequency PW1 if needed.
   dic_no = js_get_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING);
   if (dic_no == WNN_NO_LEARNING) {
       if((dic_no = jl_dic_add(wnnfns_buf[snum],
-                              XSTRING_DATA (args[0]),
+                              XSTRING(args[0])->_data,
                               0,
                               wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
                               XINT(args[1]),
                               WNN_DIC_RW, WNN_DIC_RW,
-                              NILP (args[3]) ? 0 : XSTRING_DATA (args[3]),
+                              (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data,
                               0,
                               yes_or_no,
                               puts2)) < 0) {
@@ -1452,7 +1452,7 @@ Specify password files of dictionary and frequency PW1 if needed.
       }
   }
   vmask |= WNN_ENV_BUNSETSUGIRI_LEARN_MASK;
-  henv.bunsetsugiri_flag = NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW;
+  henv.bunsetsugiri_flag = (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                        vmask,
                        &henv) < 0) {
@@ -1473,8 +1473,8 @@ For FI-Wnn.
   struct wnn_henkan_env henv;
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
-  vmask |= WNN_ENV_LAST_IS_FIRST_MASK;
-  henv.last_is_first_flag = NILP (mode) ? False : True;
+  vmask |= WNN_ENV_LAST_IS_FIRST_MASK;      
+  henv.last_is_first_flag = (EQ(mode, Qnil)) ? False : True;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                       vmask,
                       &henv) < 0) return Qnil;
@@ -1492,7 +1492,7 @@ For FI-Wnn.
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   vmask |= WNN_ENV_COMPLEX_CONV_MASK;
-  henv.complex_flag = NILP (mode) ? False : True;
+  henv.complex_flag = (EQ(mode, Qnil)) ? False : True;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                        vmask,
                        &henv) < 0) return Qnil;
@@ -1510,7 +1510,7 @@ For FI-Wnn.
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   vmask |= WNN_ENV_OKURI_LEARN_MASK;
-  henv.okuri_learn_flag = NILP (mode) ? False : True;
+  henv.okuri_learn_flag = (EQ(mode, Qnil)) ? False : True;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                        vmask,
                        &henv) < 0) return Qnil;
@@ -1553,7 +1553,7 @@ For FI-Wnn.
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   vmask |= WNN_ENV_PREFIX_LEARN_MASK;
-  henv.prefix_learn_flag = NILP (mode) ? False : True;
+  henv.prefix_learn_flag = (EQ(mode, Qnil)) ? False : True;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                        vmask,
                        &henv) < 0) return Qnil;
@@ -1594,7 +1594,7 @@ For FI-Wnn.
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   vmask |= WNN_ENV_SUFFIX_LEARN_MASK;
-  henv.suffix_learn_flag = NILP (mode) ? False : True;
+  henv.suffix_learn_flag = (EQ(mode, Qnil)) ? False : True;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                        vmask,
                        &henv) < 0) return Qnil;
@@ -1612,7 +1612,7 @@ For FI-Wnn.
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   vmask |= WNN_ENV_COMMON_LAERN_MASK;
-  henv.common_learn_flag = NILP (mode) ? False : True;
+  henv.common_learn_flag = (EQ(mode, Qnil)) ? False : True;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                        vmask,
                        &henv) < 0) return Qnil;
@@ -1728,7 +1728,7 @@ For FI-Wnn.
   if ((snum = check_wnn_server_type()) == -1) return Qnil;
   if(!wnnfns_buf[snum]) return Qnil;
   vmask |= WNN_ENV_YURAGI_MASK;
-  henv.yuragi_flag = NILP (mode) ? False : True;
+  henv.yuragi_flag = (EQ(mode, Qnil)) ? False : True;
   if(jl_set_henkan_env(wnnfns_buf[snum],
                        vmask,
                        &henv) < 0) return Qnil;
@@ -1778,7 +1778,7 @@ For Wnn.
   CHECK_STRING (name);
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
   if (!wnnfns_buf[snum]) return Qnil;
-  m2w (XSTRING_DATA (name), w_buf);
+  m2w (XSTRING (name)->_data, w_buf);
   if ((no = jl_hinsi_number (wnnfns_buf[snum], w_buf)) < 0) return Qnil;
   return make_int (no);
 }
@@ -1926,7 +1926,7 @@ w2m (w_char *wp, unsigned char *mp, unsigned char lb)
          if (EQ(Vwnn_server_type, Qcserver))
            {
              len = cwnn_yincod_pzy (pzy, wc,
-                                    NILP (Vcwnn_zhuyin)
+                                    (EQ(Vcwnn_zhuyin, Qnil))
                                     ? CWNN_PINYIN
                                     : CWNN_ZHUYIN);
              for (i = 0; i < len; i++)
@@ -1972,7 +1972,7 @@ void
 m2w (unsigned char *mp, w_char *wp)
 {
   unsigned int ch;
-
+  
   while ((ch = *mp++) != 0)
     {
       if (BUFBYTE_LEADING_BYTE_P (ch))
@@ -2032,7 +2032,7 @@ w2y (w_char *w)
       w++; pin++;
     }
   len = cwnn_pzy_yincod (ybuf, pbuf,
-                        NILP (Vcwnn_zhuyin) ? CWNN_PINYIN : CWNN_ZHUYIN);
+                        (EQ(Vcwnn_zhuyin, Qnil)) ? CWNN_PINYIN : CWNN_ZHUYIN);
   if (len <= 0)
     return;
 
index 5ef4393..255d3fd 100644 (file)
@@ -51,14 +51,12 @@ Boston, MA 02111-1307, USA.  */
 
 #ifdef __CYGWIN32__
 #define stricmp strcasecmp
-#define FONTENUMPROC FONTENUMEXPROC
-#define ntmTm ntmentm
 #endif
 
 typedef struct colormap_t 
 {
-  CONST char *name;
-  CONST COLORREF colorref;
+  char *name;
+  COLORREF colorref;
 } colormap_t;
 
 /* Colors from X11R6 "XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp" */
@@ -723,58 +721,6 @@ static CONST colormap_t mswindows_X_color_map[] =
   {"LightGreen"                        , PALETTERGB (144, 238, 144) }
 };
 
-
-typedef struct fontmap_t 
-{
-  CONST char *name;
-  CONST int value;
-} fontmap_t;
-
-/* Default weight first, preferred names listed before synonyms */
-static CONST fontmap_t fontweight_map[] = 
-{
-  {"Regular"           , FW_REGULAR},  /* The standard font weight */
-  {"Thin"              , FW_THIN},
-  {"Extra Light"       , FW_EXTRALIGHT},
-  {"Ultra Light"       , FW_ULTRALIGHT},
-  {"Light"             , FW_LIGHT},
-  {"Normal"            , FW_NORMAL},
-  {"Medium"            , FW_MEDIUM},
-  {"Semi Bold"         , FW_SEMIBOLD},
-  {"Demi Bold"         , FW_DEMIBOLD},
-  {"Bold"              , FW_BOLD},     /* The standard bold font weight */
-  {"Extra Bold"                , FW_EXTRABOLD},
-  {"Ultra Bold"                , FW_ULTRABOLD},
-  {"Heavy"             , FW_HEAVY},
-  {"Black"             , FW_BLACK}
-};
-
-/* Default charset first, no synonyms allowed because these names are 
- * matched against the names reported by win32 by match_font() */
-static CONST fontmap_t charset_map[] = 
-{
-  {"Western"           , ANSI_CHARSET},
-  {"Symbol"            , SYMBOL_CHARSET},
-  {"Shift JIS"         , SHIFTJIS_CHARSET},    /* #### Name to be verified */
-  {"GB2312"            , GB2312_CHARSET},      /* #### Name to be verified */
-  {"Hanguel"           , HANGEUL_CHARSET},
-  {"Chinese Big 5"     , CHINESEBIG5_CHARSET}, /* #### Name to be verified */
-#if (WINVER >= 0x0400)
-  {"Johab"             , JOHAB_CHARSET},       /* #### Name to be verified */
-  {"Hebrew"            , HEBREW_CHARSET},      /* #### Name to be verified */
-  {"Arabic"            , ARABIC_CHARSET},      /* #### Name to be verified */
-  {"Greek"             , GREEK_CHARSET},
-  {"Turkish"           , TURKISH_CHARSET},
-  {"Vietnamese"                , VIETNAMESE_CHARSET},  /* #### Name to be verified */
-  {"Thai"              , THAI_CHARSET},        /* #### Name to be verified */
-  {"Central European"  , EASTEUROPE_CHARSET},
-  {"Cyrillic"          , RUSSIAN_CHARSET},
-  {"Mac"               , MAC_CHARSET},
-  {"Baltic"            , BALTIC_CHARSET},
-#endif
-  {"OEM/DOS"           , OEM_CHARSET}
-};
-
 \f
 /************************************************************************/
 /*                               helpers                                */
@@ -926,120 +872,6 @@ match_font (char *pattern1, char *pattern2, char *fontname)
   return 1;
 }
 
-
-
-
-\f
-/************************************************************************/
-/*                                 exports                              */
-/************************************************************************/
-
-struct font_enum_t
-{
-  HDC hdc;
-  struct device *d;
-};
-
-static int CALLBACK
-font_enum_callback_2 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, 
-                     int FontType, struct font_enum_t *font_enum)
-{
-  struct mswindows_font_enum *fontlist, **fonthead;
-  char fontname[MSW_FONTSIZE];
-  int i;
-
-  /*
-   * The enumerated font weights are not to be trusted because:
-   *  a) lpelfe->elfStyle is only filled in for TrueType fonts.
-   *  b) Not all Bold and Italic styles of all fonts (inluding some Vector,
-   *     Truetype and Raster fonts) are enumerated.
-   * I guess that fonts for which Bold and Italic styles are generated
-   * 'on-the-fly' are not enumerated. It would be overly restrictive to
-   * disallow Bold And Italic weights for these fonts, so we just leave
-   * weights unspecified. This means that we have to weed out duplicates of
-   * those fonts that do get enumerated with different weights.
-   */
-  if (FontType == 0 /*vector*/ || FontType == TRUETYPE_FONTTYPE)
-    /* Scalable, so leave pointsize blank */
-    sprintf (fontname, "%s::::", lpelfe->elfLogFont.lfFaceName);
-  else
-    /* Formula for pointsize->height from LOGFONT docs in Platform SDK */
-    sprintf (fontname, "%s::%d::", lpelfe->elfLogFont.lfFaceName,
-            MulDiv (lpntme->ntmTm.tmHeight - lpntme->ntmTm.tmInternalLeading,
-                    72, DEVICE_MSWINDOWS_LOGPIXELSY (font_enum->d)));
-
-  /*
-   * The enumerated font character set strings are not to be trusted because
-   * lpelfe->elfScript is returned in the host language and not in English.
-   * We can't know a priori the translations of "Western", "Central European"
-   * etc into the host language, so we must use English. The same argument
-   * applies to the font weight string when matching fonts.
-   */
-  for (i=0; i<countof (charset_map); i++)
-    if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value)
-      {
-       strcat (fontname, charset_map[i].name);
-       break;
-      }
-  if (i==countof (charset_map))
-    strcpy (fontname, charset_map[0].name);
-
-  /* Check that the new font is not a duplicate */
-  fonthead = &DEVICE_MSWINDOWS_FONTLIST (font_enum->d);
-  fontlist = *fonthead;
-  while (fontlist)
-    if (!strcmp (fontname, fontlist->fontname))
-      return 1;                /* found a duplicate */
-    else
-      fontlist = fontlist->next;
-
-  /* Insert entry at head */
-  fontlist = *fonthead;
-  *fonthead = xmalloc (sizeof (struct mswindows_font_enum));
-  if (*fonthead == NULL)
-    {
-      *fonthead = fontlist;
-      return 0;
-    }
-  strcpy ((*fonthead)->fontname, fontname);
-  (*fonthead)->next = fontlist;
-  return 1;
-}
-
-static int CALLBACK
-font_enum_callback_1 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, 
-                     int FontType, struct font_enum_t *font_enum)
-{
-  /* This function gets called once per facename per character set.
-   * We call a second callback to enumerate the fonts in each facename */
-  return EnumFontFamiliesEx (font_enum->hdc, &lpelfe->elfLogFont,
-                            (FONTENUMPROC) font_enum_callback_2,
-                            (LPARAM) font_enum, 0);
-}
-
-/*
- * Enumerate the available fonts. Called by mswindows_init_device().
- * Fills in the device's device-type-specfic fontlist.
- */
-void
-mswindows_enumerate_fonts (struct device *d)
-{
-  HDC hdc = CreateCompatibleDC (NULL);
-  LOGFONT logfont;
-  struct font_enum_t font_enum;
-
-  assert (hdc!=NULL);
-  logfont.lfCharSet = DEFAULT_CHARSET;
-  logfont.lfFaceName[0] = '\0';
-  logfont.lfPitchAndFamily = DEFAULT_PITCH;
-  font_enum.hdc = hdc;
-  font_enum.d = d;
-  DEVICE_MSWINDOWS_FONTLIST (d) = NULL;
-  EnumFontFamiliesEx (hdc, &logfont, (FONTENUMPROC) font_enum_callback_1,
-                     (LPARAM) (&font_enum), 0);
-  DeleteDC (hdc);
-}
-
 \f
 /************************************************************************/
 /*                               methods                                */
@@ -1060,7 +892,7 @@ mswindows_initialize_color_instance (struct Lisp_Color_Instance *c, Lisp_Object
       COLOR_INSTANCE_MSWINDOWS_COLOR (c) = color;
       return 1;
     }
-  maybe_signal_simple_error ("Unrecognized color", name, Qcolor, errb);
+  maybe_signal_simple_error ("unrecognized color", name, Qcolor, errb);
   return(0);
 }
 
@@ -1138,23 +970,19 @@ mswindows_finalize_font_instance (struct Lisp_Font_Instance *f)
     }
 }
 
-
 static int
 mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object name,
                                    Lisp_Object device, Error_behavior errb)
 {
   CONST char *extname;
   LOGFONT logfont;
-  int fields, i;
+  int fields;
   int pt;
   char fontname[LF_FACESIZE], weight[LF_FACESIZE], *style, points[8];
   char effects[LF_FACESIZE], charset[LF_FACESIZE];
   char *c;
-  HDC hdc;
-  HFONT holdfont;
-  TEXTMETRIC metrics;
-
-  extname = XSTRING_DATA (name);
+  
+  GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, extname);
 
   /*
    * mswindows fonts look like:
@@ -1175,12 +1003,12 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
   /* This function is implemented in a fairly ad-hoc manner.
    * The general idea is to validate and canonicalize each of the above fields
    * at the same time as we build up the win32 LOGFONT structure. This enables
-   * us to use match_font() on a canonicalized font string to check the
+   * us to use math_font() on a canonicalized font string to check the
    * availability of the requested font */
 
-  if (fields < 0)
+  if (fields<0)
   {
-    maybe_signal_simple_error ("Invalid font", name, Qfont, errb);
+    maybe_signal_simple_error ("Invalid font", f->name, Qfont, errb);
     return (0);
   }
 
@@ -1191,13 +1019,13 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
   }
   else
   {
-    maybe_signal_simple_error ("Must specify a font name", name, Qfont, errb);
+    maybe_signal_simple_error ("Must specify a font name", f->name, Qfont, errb);
     return (0);
   }
 
   /* weight */
   if (fields < 2)
-    strcpy (weight, fontweight_map[0].name);
+    strcpy (weight, "Regular");
 
   /* Maybe split weight into weight and style */
   if ((c=strchr(weight, ' ')))
@@ -1208,26 +1036,37 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
   else
     style = NULL;
 
-  for (i=0; i<countof (fontweight_map); i++)
-    if (!stricmp (weight, fontweight_map[i].name))
-      {        
-       logfont.lfWeight = fontweight_map[i].value;
-       break;
-      }
-  if (i == countof (fontweight_map))   /* No matching weight */
+#define FROB(wgt)                              \
+  if (stricmp (weight, #wgt) == 0)             \
+    logfont.lfWeight = FW_##wgt
+
+  FROB (REGULAR);
+  else FROB (THIN);
+  else FROB (EXTRALIGHT);
+  else FROB (ULTRALIGHT);
+  else FROB (LIGHT);
+  else FROB (NORMAL);
+  else FROB (MEDIUM);
+  else FROB (SEMIBOLD);
+  else FROB (DEMIBOLD);
+  else FROB (BOLD);
+  else FROB (EXTRABOLD);
+  else FROB (ULTRABOLD);
+  else FROB (HEAVY);
+  else FROB (BLACK);
+  else if (!style)
     {
-      if (!style)
-       {
-         logfont.lfWeight = FW_REGULAR;
-         style = weight;       /* May have specified style without weight */
-       }
-      else
-       {
-         maybe_signal_simple_error ("Invalid font weight", name, Qfont, errb);
-         return (0);
-       }
+      logfont.lfWeight = FW_REGULAR;
+      style = weight;  /* May have specified style without weight */
+    }
+  else
+    {
+      maybe_signal_simple_error ("Invalid font weight", f->name, Qfont, errb);
+      return (0);
     }
 
+#undef FROB
+
   if (style)
     {
       /* #### what about oblique? */
@@ -1235,7 +1074,7 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
        logfont.lfItalic = TRUE;
       else
       {
-        maybe_signal_simple_error ("Invalid font weight or style", name, Qfont, errb);
+        maybe_signal_simple_error ("Invalid font weight or style", f->name, Qfont, errb);
        return (0);
       }
 
@@ -1250,12 +1089,12 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
     pt = 10;   /* #### Should we reject strings that don't specify a size? */
   else if ((pt=atoi(points)) == 0)
     {
-      maybe_signal_simple_error ("Invalid font pointsize", name, Qfont, errb);
+      maybe_signal_simple_error ("Invalid font pointsize", f->name, Qfont, errb);
       return (0);
     }
 
   /* Formula for pointsize->height from LOGFONT docs in MSVC5 Platform SDK */
-  logfont.lfHeight = -MulDiv(pt, DEVICE_MSWINDOWS_LOGPIXELSY (XDEVICE (device)), 72);
+  logfont.lfHeight = -MulDiv(pt, DEVICE_MSWINDOWS_LOGPIXELSY(XDEVICE (device)), 72);
   logfont.lfWidth = 0;
 
   /* Effects */
@@ -1280,7 +1119,8 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
        logfont.lfStrikeOut = TRUE;
       else
         {
-          maybe_signal_simple_error ("Invalid font effect", name, Qfont, errb);
+          maybe_signal_simple_error ("Invalid font effect", f->name,
+                                    Qfont, errb);
          return (0);
        }
 
@@ -1292,7 +1132,7 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
            logfont.lfStrikeOut = TRUE;
          else
            {
-             maybe_signal_simple_error ("Invalid font effect", name,
+             maybe_signal_simple_error ("Invalid font effect", f->name,
                                         Qfont, errb);
              return (0);
            }
@@ -1312,50 +1152,63 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
   else
     effects[0] = '\0';
 
-  /* Charset */
+#define FROB(cs)                               \
+  else if (stricmp (charset, #cs) == 0)                \
+    logfont.lfCharSet = cs##_CHARSET
+
+  /* Charset aliases. Hangeul = Hangul is defined in windows.h.
+     We do not use the name "russian", only "cyrillic", as it is
+     the common name of this charset, used in other languages
+     than Russian. */
+#define CYRILLIC_CHARSET RUSSIAN_CHARSET
+#define CENTRALEUROPEAN_CHARSET EASTEUROPE_CHARSET
+#define CENTRALEUROPEAN_CHARSET EASTEUROPE_CHARSET
+
   /* charset can be specified even if earlier fields havn't been */
-  if (fields < 5)
+  if ((fields < 5) && (c=strchr (extname, ':')) && (c=strchr (c+1, ':')) &&
+      (c=strchr (c+1, ':')) && (c=strchr (c+1, ':')))
     {
-      if ((c=strchr (extname, ':')) && (c=strchr (c+1, ':')) &&
-         (c=strchr (c+1, ':')) && (c=strchr (c+1, ':')))
-       {
-         strncpy (charset, c+1, LF_FACESIZE);
-         charset[LF_FACESIZE-1] = '\0';
-       }
-      else
-       strcpy (charset, charset_map[0].name);
+      strncpy (charset, c+1, LF_FACESIZE);
+      charset[LF_FACESIZE-1] = '\0';
     }
-
-  for (i=0; i<countof (charset_map); i++)
-    if (!stricmp (charset, charset_map[i].name))
-      {
-       logfont.lfCharSet = charset_map[i].value;
-       break;
-      }
-
-  if (i == countof (charset_map))      /* No matching charset */
+  else
+    charset[0] = '\0';
+         
+  if (charset[0] == '\0' || (stricmp (charset, "ansi") == 0) ||
+      (stricmp (charset, "western") == 0))
+    {
+      logfont.lfCharSet = ANSI_CHARSET;
+      strcpy (charset, "western");
+    }
+  FROB (SYMBOL);
+  FROB (SHIFTJIS);
+  FROB (GB2312);
+  FROB (HANGEUL);
+  FROB (CHINESEBIG5);
+  FROB (JOHAB);
+  FROB (HEBREW);
+  FROB (ARABIC);
+  FROB (GREEK);
+  FROB (TURKISH);
+  FROB (THAI);
+  FROB (EASTEUROPE);
+  FROB (CENTRALEUROPEAN);
+  FROB (CYRILLIC);
+  FROB (MAC);
+  FROB (BALTIC);
+  else if (stricmp (charset, "oem/dos") == 0)
+    logfont.lfCharSet = OEM_CHARSET;
+  else
     {
-      maybe_signal_simple_error ("Invalid charset", name, Qfont, errb);
+      maybe_signal_simple_error ("Invalid charset", f->name, Qfont, errb);
       return 0;
     }
 
-  /* Misc crud */
-  logfont.lfEscapement = logfont.lfOrientation = 0;
-#if 1
-  logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
-  logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
-  logfont.lfQuality = DEFAULT_QUALITY;
-#else
-  logfont.lfOutPrecision = OUT_STROKE_PRECIS;
-  logfont.lfClipPrecision = CLIP_STROKE_PRECIS;
-  logfont.lfQuality = PROOF_QUALITY;
-#endif
-  /* Default to monospaced if the specified fontname doesn't exist. */
-  logfont.lfPitchAndFamily = FF_MODERN;
+#undef FROB
 
   /* Windows will silently substitute a default font if the fontname 
    * specifies a non-existent font. So we check the font against the device's
-   * list of font patterns to make sure that at least one of them matches. */
+   * list of font patterns to make sure that at least one of them matches */
   {
     struct mswindows_font_enum *fontlist;
     char truename[MSW_FONTSIZE];
@@ -1370,37 +1223,58 @@ mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object na
       }
     if (!done)
       {
-       maybe_signal_simple_error ("No matching font", name, Qfont, errb);
+       maybe_signal_simple_error ("No matching font", f->name, Qfont, errb);
        return 0;
       }
   }
 
+  /* Misc crud */
+  logfont.lfEscapement = logfont.lfOrientation = 0;
+#if 1
+  logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
+  logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+  logfont.lfQuality = DEFAULT_QUALITY;
+#else
+  logfont.lfOutPrecision = OUT_STROKE_PRECIS;
+  logfont.lfClipPrecision = CLIP_STROKE_PRECIS;
+  logfont.lfQuality = PROOF_QUALITY;
+#endif
+  /* Default to monospaced if the specified fontname doesn't exist.
+   * The match_font calls above should mean that this can't happen. */
+  logfont.lfPitchAndFamily = FF_MODERN;
+
   if ((f->data = CreateFontIndirect(&logfont)) == NULL)
   {
-    maybe_signal_simple_error ("Couldn't create font", name, Qfont, errb);
+    maybe_signal_simple_error ("Couldn't create font", f->name, Qfont, errb);
     return 0;
   }
 
-  hdc = CreateCompatibleDC (NULL);
-  if (hdc)
-    {
-      holdfont = SelectObject(hdc, f->data);
-      if (holdfont)
-       {
-         GetTextMetrics (hdc, &metrics);
-         SelectObject(hdc, holdfont);
-         DeleteDC (hdc);
-         f->width = (unsigned short) metrics.tmAveCharWidth;
-         f->height = (unsigned short) metrics.tmHeight;
-         f->ascent = (unsigned short) metrics.tmAscent;
-         f->descent = (unsigned short) metrics.tmDescent;
-         f->proportional_p = (metrics.tmPitchAndFamily & TMPF_FIXED_PITCH);
-         return 1;
-       }
-      DeleteDC (hdc);
-    }
-  mswindows_finalize_font_instance (f);
-  maybe_signal_simple_error ("Couldn't map font", name, Qfont, errb);
+  {
+    HDC hdc;
+    HFONT holdfont;
+    TEXTMETRIC metrics;
+
+    hdc = CreateCompatibleDC (NULL);
+    if (hdc)
+      {
+       holdfont = SelectObject(hdc, f->data);
+       if (holdfont)
+         {
+           GetTextMetrics (hdc, &metrics);
+           SelectObject(hdc, holdfont);
+           DeleteDC (hdc);
+           f->width = (unsigned short) metrics.tmAveCharWidth;
+           f->height = (unsigned short) metrics.tmHeight;
+           f->ascent = (unsigned short) metrics.tmAscent;
+           f->descent = (unsigned short) metrics.tmDescent;
+           f->proportional_p = (metrics.tmPitchAndFamily & TMPF_FIXED_PITCH);
+           return 1;
+         }
+       DeleteDC (hdc);
+      }
+    mswindows_finalize_font_instance (f);
+    maybe_signal_simple_error ("Couldn't map font", f->name, Qfont, errb);
+  }
   return 0;
 }
 
index 7e02318..513349d 100644 (file)
@@ -171,7 +171,7 @@ static void
 tty_mark_color_instance (struct Lisp_Color_Instance *c,
                         void (*markobj) (Lisp_Object))
 {
-  markobj (COLOR_INSTANCE_TTY_SYMBOL (c));
+  ((markobj) (COLOR_INSTANCE_TTY_SYMBOL (c)));
 }
 
 static void
@@ -259,7 +259,7 @@ static void
 tty_mark_font_instance (struct Lisp_Font_Instance *f,
                        void (*markobj) (Lisp_Object))
 {
-  markobj (FONT_INSTANCE_TTY_CHARSET (f));
+  ((markobj) (FONT_INSTANCE_TTY_CHARSET (f)));
 }
 
 static void
diff --git a/src/pure.c b/src/pure.c
new file mode 100644 (file)
index 0000000..0d15775
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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: FSF 19.30.  Split out of alloc.c. */
+
+#include <config.h>
+#include "lisp.h"
+#include "puresize.h"
+
+/* Moved from puresize.h to here so alloc.c does not get recompiled */
+
+# include <puresize-adjust.h>
+#define PURESIZE ((RAW_PURESIZE) + (PURESIZE_ADJUSTMENT))
+
+size_t
+get_PURESIZE (void)
+{
+  return PURESIZE;
+}
+
+/* Force linker to put it into data space! */
+EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = { (EMACS_INT) 0};
diff --git a/src/puresize.h b/src/puresize.h
new file mode 100644 (file)
index 0000000..0e4bc33
--- /dev/null
@@ -0,0 +1,169 @@
+/* Definition of PURESIZE.
+   Copyright (C) 1986, 1988, 1992, 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996 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. */
+
+#ifndef PURESIZE_H
+#define PURESIZE_H
+
+/* If RAW_PURESIZE is already defined then the user overrode it at
+   configure time. */
+#ifndef RAW_PURESIZE
+
+/* Basic amount of purespace to use, in the absence of extra
+   things configured in. */
+
+
+/* This computation is Barbra Streisand, BS
+#if (LONGBITS == 64)
+# define BASE_PURESIZE 938000
+#else
+# define BASE_PURESIZE 563000
+#endif
+*/
+
+#define BASE_PURESIZE 1400000
+
+/* If any particular systems need to change the base puresize, they
+   should define SYSTEM_PURESIZE_EXTRA.  Note that this can be
+   negative as well as positive.
+
+   Do NOT define PURESIZE or any other values.  This allows the
+   other values to shift while still keeping things in sync. */
+
+#ifndef SYSTEM_PURESIZE_EXTRA
+# define SYSTEM_PURESIZE_EXTRA 0
+#endif
+
+/* Extra amount of purespace needed for menubars. */
+
+#ifdef HAVE_DIALOGS
+# if (LONGBITS == 64)
+#  define DIALOG_PURESIZE_EXTRA 43000
+# else
+#  define DIALOG_PURESIZE_EXTRA 1800
+# endif
+#else
+# define DIALOG_PURESIZE_EXTRA 0
+#endif
+
+#ifdef HAVE_MENUBARS
+# if (LONGBITS == 64)
+#  define MENUBAR_PURESIZE_EXTRA 43000
+# else
+#  define MENUBAR_PURESIZE_EXTRA 36000
+# endif
+#else
+# define MENUBAR_PURESIZE_EXTRA 0
+#endif
+
+#ifdef HAVE_SCROLLBARS
+# if (LONGBITS == 64)
+#  define SCROLLBAR_PURESIZE_EXTRA 4000
+# else
+#  define SCROLLBAR_PURESIZE_EXTRA 1800
+# endif
+#else
+# define SCROLLBAR_PURESIZE_EXTRA 0
+#endif
+
+#ifdef HAVE_TOOLBARS
+# if (LONGBITS == 64)
+#  define TOOLBAR_PURESIZE_EXTRA 4000
+# else
+#  define TOOLBAR_PURESIZE_EXTRA 8400
+# endif
+#else
+# define TOOLBAR_PURESIZE_EXTRA 0
+#endif
+
+/* Extra amount of purespace needed for X11, separate from menubars
+   and scrollbars. */
+
+#ifdef HAVE_X_WINDOWS
+# if (LONGBITS == 64)
+#  define X11_PURESIZE_EXTRA 95000
+# else
+#  define X11_PURESIZE_EXTRA 68000
+# endif
+#else
+# define X11_PURESIZE_EXTRA 0
+#endif
+
+/* Extra amount of purespace needed for Mule. */
+
+#ifdef MULE
+#ifdef HAVE_CANNA
+# define MULE_PURESIZE_CANNA 5000
+#else
+# define MULE_PURESIZE_CANNA 0
+#endif
+#ifdef HAVE_WNN
+# define MULE_PURESIZE_WNN 5000
+#else
+# define MULE_PURESIZE_WNN 0
+#endif
+# if (LONGBITS == 64)
+#  define MULE_PURESIZE_EXTRA 99000+MULE_PURESIZE_CANNA+MULE_PURESIZE_WNN
+# else
+#  define MULE_PURESIZE_EXTRA 78000+MULE_PURESIZE_CANNA+MULE_PURESIZE_WNN
+# endif
+#else
+# define MULE_PURESIZE_EXTRA 0
+#endif
+
+/* Extra amount of purespace needed for Tooltalk. */
+
+#ifdef TOOLTALK
+# if (LONGBITS == 64)
+#  define TOOLTALK_PURESIZE_EXTRA 100000
+# else
+#  define TOOLTALK_PURESIZE_EXTRA 8300
+# endif
+#else
+# define TOOLTALK_PURESIZE_EXTRA 0
+#endif
+
+/* Extra amount of purespace needed for Sunpro builds. */
+
+#ifdef SUNPRO
+#define SUNPRO_PURESIZE_EXTRA 95000
+#else
+# define SUNPRO_PURESIZE_EXTRA 0
+#endif
+
+#define RAW_PURESIZE ((BASE_PURESIZE) +                                        \
+                     (DIALOG_PURESIZE_EXTRA) +                         \
+                     (MENUBAR_PURESIZE_EXTRA) +                        \
+                     (SCROLLBAR_PURESIZE_EXTRA) +                      \
+                     (TOOLBAR_PURESIZE_EXTRA) +                        \
+                     (X11_PURESIZE_EXTRA) +                            \
+                     (SYSTEM_PURESIZE_EXTRA) +                         \
+                     (MULE_PURESIZE_EXTRA) +                           \
+                     (TOOLTALK_PURESIZE_EXTRA) +                       \
+                     (SUNPRO_PURESIZE_EXTRA))
+
+#endif /* !RAW_PURESIZE */
+
+size_t get_PURESIZE (void);
+extern EMACS_INT pure[];
+
+#endif /* PURESIZE_H */
index 00ed917..17394f4 100644 (file)
@@ -54,10 +54,12 @@ Boston, MA 02111-1307, USA.  */
 #define MSWINDOWS_EOL_CURSOR_WIDTH     5
 
 /*
- * Random forward declarations
+ * Random forward delarations
  */
 static void mswindows_update_dc (HDC hdc, Lisp_Object font, Lisp_Object fg,
                                 Lisp_Object bg, Lisp_Object bg_pmap);
+static void mswindows_clear_region (Lisp_Object locale, face_index findex,
+                             int x, int y, int width, int height);
 static void mswindows_output_vertical_divider (struct window *w, int clear);
 static void mswindows_redraw_exposed_windows (Lisp_Object window, int x,
                                        int y, int width, int height);
@@ -310,7 +312,7 @@ mswindows_output_blank (struct window *w, struct display_line *dl, struct rune *
   struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, rb->findex);
 
   Lisp_Object bg_pmap = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, rb->findex);
-
+  
   if (!IMAGE_INSTANCEP (bg_pmap)
       || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
     bg_pmap = Qnil;
@@ -349,7 +351,7 @@ mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos,
 {
   struct frame *f = XFRAME (w->frame);
   struct device *d = XDEVICE (f->device);
-  struct face_cachel *cachel=0;
+  struct face_cachel *cachel;
   Lisp_Object font = Qnil;
   int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
   HDC hdc = FRAME_MSWINDOWS_DC (f);
@@ -502,7 +504,7 @@ mswindows_output_string (struct window *w, struct display_line *dl,
   xpos -= xoffset;
 
   /* sort out the destination rectangle */
-  height = DISPLAY_LINE_HEIGHT (dl);
+  height = dl->ascent + dl->descent - dl->clip;
   rect.left = clip_start;
   rect.top  = dl->ypos - dl->ascent;
   rect.right = clip_end;
@@ -553,7 +555,7 @@ mswindows_output_string (struct window *w, struct display_line *dl,
          int clear_end = min (xpos + this_width, clip_end);
          
          {
-           redisplay_clear_region (window, findex, clear_start,
+           mswindows_clear_region (window, findex, clear_start,
                                    dl->ypos - dl->ascent, 
                                    clear_end - clear_start,
                                    height);
@@ -591,7 +593,6 @@ mswindows_output_dibitmap (struct frame *f, struct Lisp_Image_Instance *p,
   int need_clipping = (clip_x || clip_y);
   int yoffset=0;
   int xoffset=0;
-
   /* do we need to offset the pixmap vertically? this is necessary
      for background pixmaps. */
   if (offset_bitmap)
@@ -714,7 +715,7 @@ mswindows_output_pixmap (struct window *w, struct display_line *dl,
   struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
   Lisp_Object window;
 
-  int lheight = DISPLAY_LINE_HEIGHT (dl);
+  int lheight = dl->ascent + dl->descent - dl->clip;
   int pheight = ((int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p) > lheight ? lheight :
                 IMAGE_INSTANCE_PIXMAP_HEIGHT (p));
   int clip_x, clip_y, clip_width, clip_height;
@@ -793,7 +794,7 @@ mswindows_output_pixmap (struct window *w, struct display_line *dl,
        }
 
       if (!offset_bitmap)      /* i.e. not a bg pixmap */
-       redisplay_clear_region (window, findex, clear_x, clear_y,
+       mswindows_clear_region (window, findex, clear_x, clear_y,
                                clear_width, clear_height);
     }
 
@@ -1086,7 +1087,7 @@ mswindows_ring_bell (struct device *d, int volume, int pitch, int duration)
 
  Given a display line, a block number for that start line, output all
  runes between start and end in the specified display block.
- Ripped off with minimal thought from the corresponding X routine.
+ Ripped off with mininmal thought from the corresponding X routine.
  ****************************************************************************/
 static void
 mswindows_output_display_block (struct window *w, struct display_line *dl, int block,
@@ -1178,9 +1179,9 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b
              else if (rb->object.chr.ch == '\n')
                {
                  /* Clear in case a cursor was formerly here. */
-                 int height = DISPLAY_LINE_HEIGHT (dl);
+                 int height = dl->ascent + dl->descent - dl->clip;
 
-                 redisplay_clear_region (window, findex, xpos, dl->ypos - dl->ascent,
+                 mswindows_clear_region (window, findex, xpos, dl->ypos - dl->ascent,
                                    rb->width, height);
                  elt++;
                }
@@ -1261,14 +1262,7 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b
                    abort ();
 
                  case IMAGE_SUBWINDOW:
-                 case IMAGE_WIDGET:
-                   redisplay_output_subwindow (w, dl, instance, xpos,
-                                               rb->object.dglyph.xoffset, start_pixpos,
-                                               rb->width, findex, cursor_start,
-                                               cursor_width, cursor_height);
-                   if (rb->cursor_type == CURSOR_ON)
-                     mswindows_output_cursor (w, dl, xpos, cursor_width,
-                                              findex, 0, 1);
+                   /* #### implement me */
                    break;
 
                  case IMAGE_NOTHING:
@@ -1352,7 +1346,7 @@ mswindows_output_vertical_divider (struct window *w, int clear_unused)
   /* Draw a shadow around the divider */
   if (shadow != 0)
     {
-      /* #### This will be fixed to support arbitrary thickness */
+      /* #### This will be fixed to support arbitrary thichkness */
       InflateRect (&rect, abs_shadow, abs_shadow);
       DrawEdge (FRAME_MSWINDOWS_DC (f), &rect,
                shadow > 0 ? EDGE_RAISED : EDGE_SUNKEN, BF_RECT);
@@ -1392,15 +1386,69 @@ mswindows_text_width (struct frame *f, struct face_cachel *cachel,
  given face.
  ****************************************************************************/
 static void
-mswindows_clear_region (Lisp_Object locale, struct device* d, struct frame* f, 
-                       face_index findex, int x, int y,
-                       int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
-                       Lisp_Object background_pixmap)
+mswindows_clear_region (Lisp_Object locale, face_index findex, int x, int y,
+                 int width, int height)
 {
+  struct window *w;
+  struct frame *f;
+  Lisp_Object background_pixmap = Qunbound;
+  Lisp_Object temp;
   RECT rect = { x, y, x+width, y+height };
 
-  if (!NILP (background_pixmap))
+  if (!(width && height))   /* We often seem to get called with width==0 */
+    return;
+
+  if (WINDOWP (locale))
+    {
+      w = XWINDOW (locale);
+      f = XFRAME (w->frame);
+    }
+  else if (FRAMEP (locale))
+    {
+      w = NULL;
+      f = XFRAME (locale);
+    }
+  else
+    abort ();
+  
+  if (w)
+    {
+      temp = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, findex);
+
+      if (IMAGE_INSTANCEP (temp)
+         && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
+       {
+         /* #### maybe we could implement such that a string
+            can be a background pixmap? */
+         background_pixmap = temp;
+       }
+    }
+  else
+    {
+      temp = FACE_BACKGROUND_PIXMAP (Vdefault_face, locale);
+
+      if (IMAGE_INSTANCEP (temp)
+         && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
+       {
+         background_pixmap = temp;
+       }
+    }
+
+  if (!UNBOUNDP (background_pixmap))
     {
+      Lisp_Object fcolor, bcolor;
+      
+      if (w)
+       {
+         fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
+         bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
+       }
+      else
+       {
+         fcolor = FACE_FOREGROUND (Vdefault_face, locale);
+         bcolor = FACE_BACKGROUND (Vdefault_face, locale);
+       }
+
       mswindows_update_dc (FRAME_MSWINDOWS_DC (f),
                           Qnil, fcolor, bcolor, background_pixmap);
 
@@ -1410,14 +1458,15 @@ mswindows_clear_region (Lisp_Object locale, struct device* d, struct frame* f,
     }
   else
     {
-      mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, fcolor, Qnil);
-      ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, 
-                 &rect, NULL, 0, NULL);
+      Lisp_Object color = (w ? WINDOW_FACE_CACHEL_BACKGROUND (w, findex) :
+                          FACE_BACKGROUND (Vdefault_face, locale));
+      mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, color, Qnil);
+      ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
     }
 
 #ifdef HAVE_SCROLLBARS
   if (WINDOWP (locale))
-    mswindows_redisplay_deadbox_maybe (XWINDOW (locale), &rect);
+    mswindows_redisplay_deadbox_maybe (w, &rect);
 #endif
 }
 
@@ -1444,27 +1493,27 @@ mswindows_clear_to_window_end (struct window *w, int ypos1, int ypos2)
       XSETWINDOW (window, w);
 
       if (window_is_leftmost (w))
-       redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
+       mswindows_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
                          ypos1, FRAME_BORDER_WIDTH (f), height);
 
       if (bounds.left_in - bounds.left_out > 0)
-       redisplay_clear_region (window,
+       mswindows_clear_region (window,
                          get_builtin_face_cache_index (w, Vleft_margin_face),
                          bounds.left_out, ypos1,
                          bounds.left_in - bounds.left_out, height);
 
       if (bounds.right_in - bounds.left_in > 0)
-       redisplay_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1,
+       mswindows_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1,
                          bounds.right_in - bounds.left_in, height);
 
       if (bounds.right_out - bounds.right_in > 0)
-       redisplay_clear_region (window,
+       mswindows_clear_region (window,
                          get_builtin_face_cache_index (w, Vright_margin_face),
                          bounds.right_in, ypos1,
                          bounds.right_out - bounds.right_in, height);
 
       if (window_is_rightmost (w))
-       redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f),
+       mswindows_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f),
                          ypos1, FRAME_BORDER_WIDTH (f), height);
     }
 
index 4a6ce5a..6266fd5 100644 (file)
@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA.  */
 
 #include <config.h>
 #include "lisp.h"
+#include "debug.h"
 
 #include "buffer.h"
 #include "window.h"
@@ -37,14 +38,12 @@ Boston, MA 02111-1307, USA.  */
 #include "redisplay.h"
 #include "faces.h"
 
+#include "sysdep.h"
+
 static int compare_runes (struct window *w, struct rune *crb,
                          struct rune *drb);
 static void redraw_cursor_in_window (struct window *w,
                                     int run_end_begin_glyphs);
-static void redisplay_output_display_block (struct window *w, struct display_line *dl,
-                                           int block, int start, int end, int start_pixpos,
-                                           int cursor_start, int cursor_width, 
-                                           int cursor_height);
 
 /*****************************************************************************
  sync_rune_structs
@@ -306,6 +305,8 @@ compare_display_blocks (struct window *w, struct display_line *cdl,
                        int cursor_height)
 {
   struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
+
   struct display_block *cdb, *ddb;
   int start_pos;
   int stop_pos;
@@ -415,10 +416,10 @@ compare_display_blocks (struct window *w, struct display_line *cdl,
          stop_pos = elt + 1;
        }
 
-      redisplay_output_display_block (w, ddl, d_block, start_pos,
-                                     stop_pos, start_pixpos,
-                                     cursor_start, cursor_width,
-                                     cursor_height);
+      DEVMETH (d, output_display_block, (w, ddl, d_block, start_pos,
+                                        stop_pos, start_pixpos,
+                                        cursor_start, cursor_width,
+                                        cursor_height));
       return 1;
     }
 
@@ -434,12 +435,13 @@ static void
 clear_left_border (struct window *w, int y, int height)
 {
   struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
   Lisp_Object window;
 
   XSETWINDOW (window, w);
-  redisplay_clear_region (window, DEFAULT_INDEX,
-               FRAME_LEFT_BORDER_START (f), y,
-               FRAME_BORDER_WIDTH (f), height);
+  DEVMETH (d, clear_region, (window, DEFAULT_INDEX,
+                            FRAME_LEFT_BORDER_START (f), y,
+                            FRAME_BORDER_WIDTH (f), height));
 }
 
 /*****************************************************************************
@@ -451,12 +453,13 @@ static void
 clear_right_border (struct window *w, int y, int height)
 {
   struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
   Lisp_Object window;
 
   XSETWINDOW (window, w);
-  redisplay_clear_region (window, DEFAULT_INDEX,
-               FRAME_RIGHT_BORDER_START (f),
-               y, FRAME_BORDER_WIDTH (f), height);
+  DEVMETH (d, clear_region, (window, DEFAULT_INDEX,
+                            FRAME_RIGHT_BORDER_START (f),
+                            y, FRAME_BORDER_WIDTH (f), height));
 }
 
 /*****************************************************************************
@@ -473,6 +476,7 @@ output_display_line (struct window *w, display_line_dynarr *cdla,
 
 {
   struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
   struct buffer *b = XBUFFER (w->buffer);
   struct buffer *old_b = window_display_buffer (w);
   struct display_line *cdl, *ddl;
@@ -534,7 +538,7 @@ output_display_line (struct window *w, display_line_dynarr *cdla,
      a TEXT block. */
   if (ddl->modeline)
     {
-      /* The shadow thickness check is necessary if only the sign of
+      /* The shadow thickness check is necesssary if only the sign of
          the size changed. */
       if (cdba && !w->shadow_thickness_changed)
        {
@@ -543,8 +547,8 @@ output_display_line (struct window *w, display_line_dynarr *cdla,
        }
       else
        {
-         redisplay_output_display_block (w, ddl, 0, 0, -1, start_pixpos,
-                                         0, 0, 0);
+         DEVMETH (d, output_display_block, (w, ddl, 0, 0, -1, start_pixpos,
+                                            0, 0, 0));
          must_sync = 1;
        }
 
@@ -616,8 +620,10 @@ output_display_line (struct window *w, display_line_dynarr *cdla,
                      XSETWINDOW (window, w);
 
                      /* Clear the empty area. */
-                     redisplay_clear_region (window, get_builtin_face_cache_index (w, face),
-                                   x, y, width, height);
+                     DEVMETH (d, clear_region,
+                              (window, get_builtin_face_cache_index (w,
+                                                                     face),
+                               x, y, width, height));
 
                      /* Mark that we should clear the border.  This is
                         necessary because italic fonts may leave
@@ -680,13 +686,13 @@ output_display_line (struct window *w, display_line_dynarr *cdla,
                }
 
              must_sync = 1;
-             redisplay_output_display_block (w, ddl, block, first_elt,
-                                             last_elt,
-                                             start_pixpos,
-                                             cursor_start, cursor_width,
-                                             cursor_height);
+             DEVMETH (d, output_display_block, (w, ddl, block, first_elt,
+                                                last_elt,
+                                                start_pixpos,
+                                                cursor_start, cursor_width,
+                                                cursor_height));
            }
-         
+
          start_pixpos = next_start_pixpos;
        }
     }
@@ -982,242 +988,6 @@ redisplay_redraw_cursor (struct frame *f, int run_end_begin_meths)
   redraw_cursor_in_window (XWINDOW (window), run_end_begin_meths);
 }
 
-/****************************************************************************
- redisplay_output_display_block
-
- Given a display line, a block number for that start line, output all
- runes between start and end in the specified display block.
- ****************************************************************************/
-static void
-redisplay_output_display_block (struct window *w, struct display_line *dl, int block,
-                               int start, int end, int start_pixpos, int cursor_start,
-                               int cursor_width, int cursor_height)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-
-  DEVMETH (d, output_display_block, (w, dl, block, start,
-                                    end, start_pixpos,
-                                    cursor_start, cursor_width,
-                                    cursor_height));
-}
-  
-/****************************************************************************
- redisplay_unmap_subwindows
-
- Remove subwindows from the area in the box defined by the given
- parameters.
- ****************************************************************************/
-static void redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height)
-{
-  int elt;
-
-  for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++)
-    {
-      struct subwindow_cachel *cachel =
-       Dynarr_atp (f->subwindow_cachels, elt);
-
-      if (cachel->being_displayed
-         &&
-         cachel->x + cachel->width > x && cachel->x < x + width
-         &&
-         cachel->y + cachel->height > y && cachel->y < y + height)
-       {
-         unmap_subwindow (cachel->subwindow);
-       }
-    }
-}
-
-/****************************************************************************
- redisplay_unmap_subwindows_maybe
-
- Potentially subwindows from the area in the box defined by the given
- parameters.
- ****************************************************************************/
-void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height)
-{
-  if (Dynarr_length (FRAME_SUBWINDOW_CACHE (f)))
-    {
-      redisplay_unmap_subwindows (f, x, y, width, height);
-    }
-}
-
-/****************************************************************************
- redisplay_output_subwindow
-
-
- output a subwindow.  This code borrows heavily from the pixmap stuff,
- although is much simpler not needing to account for partial
- pixmaps, backgrounds etc.
- ****************************************************************************/
-void
-redisplay_output_subwindow (struct window *w, struct display_line *dl,
-                           Lisp_Object image_instance, int xpos, int xoffset,
-                           int start_pixpos, int width, face_index findex,
-                           int cursor_start, int cursor_width, int cursor_height)
-{
-  struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
-  Lisp_Object window;
-
-  int lheight = dl->ascent + dl->descent - dl->clip;
-  int pheight = ((int) IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p) > lheight ? lheight :
-                IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p));
-
-  XSETWINDOW (window, w);
-
-  /* Clear the area the subwindow is going into.  The subwindow itself
-     will always take care of the full width.  We don't want to clear
-     where it is going to go in order to avoid flicker.  So, all we
-     have to take care of is any area above or below the subwindow. Of
-     course this is rubbish if the subwindow has transparent areas
-     (for instance with frames). */
-  /* #### We take a shortcut for now.  We know that since we have
-     subwindow_offset hardwired to 0 that the subwindow is against the top
-     edge so all we have to worry about is below it. */
-  if ((int) (dl->ypos - dl->ascent + pheight) <
-      (int) (dl->ypos + dl->descent - dl->clip))
-    {
-      int clear_x, clear_width;
-
-      int clear_y = dl->ypos - dl->ascent + pheight;
-      int clear_height = lheight - pheight;
-
-      if (start_pixpos >= 0 && start_pixpos > xpos)
-       {
-         clear_x = start_pixpos;
-         clear_width = xpos + width - start_pixpos;
-       }
-      else
-       {
-         clear_x = xpos;
-         clear_width = width;
-       }
-
-      redisplay_clear_region (window, findex, clear_x, clear_y,
-                             clear_width, clear_height);
-    }
-#if 0
-  redisplay_clear_region (window, findex, xpos - xoffset, dl->ypos - dl->ascent,
-                         width, lheight);
-#endif
-  /* if we can't view the whole window we can't view any of it */
-  if (IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p) > lheight
-      ||
-      IMAGE_INSTANCE_SUBWINDOW_WIDTH (p) > width)
-    {
-      redisplay_clear_region (window, findex, xpos - xoffset, dl->ypos - dl->ascent,
-                             width, lheight);
-      unmap_subwindow (image_instance);
-    }
-  else
-    map_subwindow (image_instance, xpos - xoffset, dl->ypos - dl->ascent);
-}
-
-/****************************************************************************
- redisplay_clear_region
-
- Clear the area in the box defined by the given parameters using the
- given face. This has been generalised so that subwindows can be
- coped with effectively.
- ****************************************************************************/
-void
-redisplay_clear_region (Lisp_Object locale, face_index findex, int x, int y,
-                       int width, int height)
-{
-  struct window *w = NULL;
-  struct frame *f = NULL;
-  struct device *d;
-  Lisp_Object background_pixmap = Qunbound;
-  Lisp_Object fcolor = Qnil, bcolor = Qnil;
-
-  if (!width || !height)
-     return;
-
-  if (WINDOWP (locale))
-    {
-      w = XWINDOW (locale);
-      f = XFRAME (w->frame);
-    }
-  else if (FRAMEP (locale))
-    {
-      w = NULL;
-      f = XFRAME (locale);
-    }
-  else
-    abort ();
-
-  d = XDEVICE (f->device);
-
-  /* if we have subwindows in the region we have to unmap them */
-  if (Dynarr_length (FRAME_SUBWINDOW_CACHE (f)))
-    {
-      redisplay_unmap_subwindows (f, x, y, width, height);
-    }
-
-  /* #### This isn't quite right for when this function is called
-     from the toolbar code. */
-  
-  /* Don't use a backing pixmap in the border area */
-  if (x >= FRAME_LEFT_BORDER_END (f)
-      && x < FRAME_RIGHT_BORDER_START (f)
-      && y >= FRAME_TOP_BORDER_END (f)
-      && y < FRAME_BOTTOM_BORDER_START (f))
-    {
-      Lisp_Object temp;
-      
-      if (w)
-       {
-         temp = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, findex);
-         
-         if (IMAGE_INSTANCEP (temp)
-             && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
-           {
-             /* #### maybe we could implement such that a string
-                can be a background pixmap? */
-             background_pixmap = temp;
-           }
-       }
-      else
-       {
-         temp = FACE_BACKGROUND_PIXMAP (Vdefault_face, locale);
-         
-         if (IMAGE_INSTANCEP (temp)
-             && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
-           {
-             background_pixmap = temp;
-           }
-       }
-    }      
-
-  if (!UNBOUNDP (background_pixmap) &&
-      XIMAGE_INSTANCE_PIXMAP_DEPTH (background_pixmap) == 0)
-    {
-      if (w)
-       {
-         fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
-         bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
-       }
-      else
-       {
-         fcolor = FACE_FOREGROUND (Vdefault_face, locale);
-         bcolor = FACE_BACKGROUND (Vdefault_face, locale);
-       }
-    }
-  else
-    {
-      fcolor = (w ?
-               WINDOW_FACE_CACHEL_BACKGROUND (w, findex) :
-               FACE_BACKGROUND (Vdefault_face, locale));
-      
-    }
-  
-  if (UNBOUNDP (background_pixmap))
-    background_pixmap = Qnil;
-  
-  DEVMETH (d, clear_region, 
-          (locale, d, f, findex, x, y, width, height, fcolor, bcolor, background_pixmap));
-}
-
 /*****************************************************************************
  redisplay_clear_top_of_window
 
@@ -1232,6 +1002,7 @@ redisplay_clear_top_of_window (struct window *w)
   if (!NILP (Fwindow_highest_p (window)))
     {
       struct frame *f = XFRAME (w->frame);
+      struct device *d = XDEVICE (f->device);
       int x, y, width, height;
 
       x = w->pixel_left;
@@ -1248,7 +1019,7 @@ redisplay_clear_top_of_window (struct window *w)
       y = FRAME_TOP_BORDER_START (f) - 1;
       height = FRAME_BORDER_HEIGHT (f) + 1;
 
-      redisplay_clear_region (window, DEFAULT_INDEX, x, y, width, height);
+      DEVMETH (d, clear_region, (window, DEFAULT_INDEX, x, y, width, height));
     }
 }
 
index 08899fa..9e8515d 100644 (file)
@@ -289,7 +289,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
                  elt++;
                }
            }
-         /* #### RUNE_HLINE is actually a little more complicated than this
+         /* #### RUNE_HLINE is actualy a little more complicated than this
              but at the moment it is only used to draw a turned off
              modeline and this will suffice for that. */
          else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE)
@@ -391,7 +391,6 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block,
                  case IMAGE_MONO_PIXMAP:
                  case IMAGE_COLOR_PIXMAP:
                  case IMAGE_SUBWINDOW:
-                 case IMAGE_WIDGET:
                    /* just do nothing here */
                    break;
 
@@ -462,14 +461,16 @@ tty_output_vertical_divider (struct window *w, int clear)
  Clear the area in the box defined by the given parameters.
  ****************************************************************************/
 static void
-tty_clear_region (Lisp_Object window, struct device* d, struct frame * f,
-                 face_index findex, int x, int y,
-                 int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, 
-                 Lisp_Object background_pixmap)
+tty_clear_region (Lisp_Object window, face_index findex, int x, int y,
+                 int width, int height)
 {
+  struct window *w = XWINDOW (window);
+  struct frame *f = XFRAME (w->frame);
   struct console *c = XCONSOLE (FRAME_CONSOLE (f));
   int line;
-  struct window* w = XWINDOW (window);
+
+  if (!width || !height)
+     return;
 
   tty_turn_on_face (w, findex);
   for (line = y; line < y + height; line++)
@@ -533,7 +534,7 @@ tty_clear_to_window_end (struct window *w, int ypos1, int ypos2)
       Lisp_Object window;
 
       XSETWINDOW (window, w);
-      redisplay_clear_region (window, DEFAULT_INDEX, x, ypos1, width, ypos2 - ypos1);
+      tty_clear_region (window, DEFAULT_INDEX, x, ypos1, width, ypos2 - ypos1);
     }
 }
 
@@ -958,7 +959,7 @@ tty_redisplay_shutdown (struct console *c)
          struct frame *f = XFRAME (frm);
 
          /* Clear the bottom line of the frame. */
-         redisplay_clear_region (FRAME_SELECTED_WINDOW (f), DEFAULT_INDEX, 0,
+         tty_clear_region (FRAME_SELECTED_WINDOW (f), DEFAULT_INDEX, 0,
                            f->height, f->width, 1);
 
          /* And then stick the cursor there. */
index 492231c..b6247a5 100644 (file)
@@ -74,6 +74,8 @@ static void x_redraw_exposed_window (struct window *w, int x, int y,
                                     int width, int height);
 static void x_redraw_exposed_windows (Lisp_Object window, int x, int y,
                                      int width, int height);
+static void x_clear_region (Lisp_Object window, face_index findex, int x,
+                           int y, int width, int height);
 static void x_output_eol_cursor (struct window *w, struct display_line *dl,
                                 int xpos, face_index findex);
 static void x_clear_frame (struct frame *f);
@@ -414,7 +416,7 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
                  /* Clear in case a cursor was formerly here. */
                  int height = dl->ascent + dl->descent - dl->clip;
 
-                 redisplay_clear_region (window, findex, xpos, dl->ypos - dl->ascent,
+                 x_clear_region (window, findex, xpos, dl->ypos - dl->ascent,
                                  rb->width, height);
                  elt++;
                }
@@ -488,12 +490,9 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
                  case IMAGE_POINTER:
                    abort ();
 
-                 case IMAGE_WIDGET:
                  case IMAGE_SUBWINDOW:
-                   redisplay_output_subwindow (w, dl, instance, xpos,
-                                               rb->object.dglyph.xoffset, start_pixpos,
-                                               rb->width, findex, cursor_start,
-                                               cursor_width, cursor_height);
+                   /* #### implement me */
+                   break;
 
                  case IMAGE_NOTHING:
                    /* nothing is as nothing does */
@@ -694,18 +693,8 @@ x_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
       mask |= GCBackground;
     }
 
-  /* This special case comes from a request to draw text with a face which has
-     the dim property. We'll use a stippled foreground GC. */
-  if (EQ (bg_pmap, Qdim))
-    {
-      assert (DEVICE_X_GRAY_PIXMAP (d) != None);
-
-      gcv.fill_style = FillStippled;
-      gcv.stipple = DEVICE_X_GRAY_PIXMAP (d);
-      mask |= (GCFillStyle | GCStipple);
-    }
-  else  if (IMAGE_INSTANCEP (bg_pmap)
-           && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
+  if (IMAGE_INSTANCEP (bg_pmap)
+      && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
     {
       if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0)
        {
@@ -903,21 +892,21 @@ x_output_string (struct window *w, struct display_line *dl,
 
              if (ypos1_line < ypos1_string)
                {
-                 redisplay_clear_region (window, findex, clear_start, ypos1_line,
+                 x_clear_region (window, findex, clear_start, ypos1_line,
                                  clear_end - clear_start,
                                  ypos1_string - ypos1_line);
                }
 
              if (ypos2_line > ypos2_string)
                {
-                 redisplay_clear_region (window, findex, clear_start, ypos2_string,
+                 x_clear_region (window, findex, clear_start, ypos2_string,
                                  clear_end - clear_start,
                                  ypos2_line - ypos2_string);
                }
            }
          else
            {
-             redisplay_clear_region (window, findex, clear_start,
+             x_clear_region (window, findex, clear_start,
                              dl->ypos - dl->ascent, clear_end - clear_start,
                              height);
            }
@@ -926,18 +915,6 @@ x_output_string (struct window *w, struct display_line *dl,
       if (cursor && cursor_cachel && focus && NILP (bar_cursor_value))
        gc = x_get_gc (d, font, cursor_cachel->foreground,
                       cursor_cachel->background, Qnil, Qnil);
-      else if (cachel->dim)
-       {
-         /* Ensure the gray bitmap exists */
-         if (DEVICE_X_GRAY_PIXMAP (d) == None)
-           DEVICE_X_GRAY_PIXMAP (d) =
-             XCreateBitmapFromData (dpy, x_win, (char *)gray_bits,
-                                    gray_width, gray_height);
-
-         /* Request a GC with the gray stipple pixmap to draw dimmed text */
-         gc = x_get_gc (d, font, cachel->foreground, cachel->background,
-                        Qdim, Qnil);
-       }
       else
        gc = x_get_gc (d, font, cachel->foreground, cachel->background,
                       Qnil, Qnil);
@@ -1335,7 +1312,7 @@ x_output_pixmap (struct window *w, struct display_line *dl,
          clear_width = width;
        }
 
-      redisplay_clear_region (window, findex, clear_x, clear_y,
+      x_clear_region (window, findex, clear_x, clear_y,
                      clear_width, clear_height);
     }
 
@@ -1411,7 +1388,7 @@ x_output_vertical_divider (struct window *w, int clear)
   unsigned long mask;
   int x, y1, y2, width, shadow_thickness, spacing, line_width;
   face_index div_face = get_builtin_face_cache_index (w, Vvertical_divider_face);
-
+  
   width = window_divider_width (w);
   shadow_thickness = XINT (w->vertical_divider_shadow_thickness);
   spacing = XINT (w->vertical_divider_spacing);
@@ -1419,20 +1396,20 @@ x_output_vertical_divider (struct window *w, int clear)
   x = WINDOW_RIGHT (w) - width;
   y1 = WINDOW_TOP (w);
   y2 = WINDOW_BOTTOM (w);
-
+  
   memset (&gcv, ~0, sizeof (XGCValues));
-
+  
   tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face);
   tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-
+  
   /* First, get the GC's. */
   top_shadow_pixel = tmp_color.pixel;
   bottom_shadow_pixel = tmp_color.pixel;
   background_pixel = tmp_color.pixel;
-
+  
   x_generate_shadow_pixels (f, &top_shadow_pixel, &bottom_shadow_pixel,
                            background_pixel, ef->core.background_pixel);
-
+  
   tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, div_face);
   tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
   gcv.background = tmp_color.pixel;
@@ -1440,11 +1417,11 @@ x_output_vertical_divider (struct window *w, int clear)
   mask = GCForeground | GCBackground | GCGraphicsExposures;
 
   /* If we can't distinguish one of the shadows (the color is the same as the
-     background), it's better to use a pixmap to generate a dithered gray. */
+     background), it's better to use a pixmap to generate a dithrered gray. */
   if (top_shadow_pixel == background_pixel ||
       bottom_shadow_pixel == background_pixel)
     use_pixmap = 1;
-
+  
   if (use_pixmap)
     {
       if (DEVICE_X_GRAY_PIXMAP (d) == None)
@@ -1453,7 +1430,7 @@ x_output_vertical_divider (struct window *w, int clear)
            XCreatePixmapFromBitmapData (dpy, x_win, (char *) gray_bits,
                                         gray_width, gray_height, 1, 0, 1);
        }
-
+      
       tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face);
       tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
       gcv.foreground = tmp_color.pixel;
@@ -1462,11 +1439,11 @@ x_output_vertical_divider (struct window *w, int clear)
       gcv.stipple = DEVICE_X_GRAY_PIXMAP (d);
       top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv,
                                       (mask | GCStipple | GCFillStyle));
-
+      
       tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, div_face);
       tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
       bottom_shadow_pixel = tmp_color.pixel;
-
+      
       flip_gcs = (bottom_shadow_pixel ==
                  WhitePixelOfScreen (DefaultScreenOfDisplay (dpy)));
     }
@@ -1475,20 +1452,20 @@ x_output_vertical_divider (struct window *w, int clear)
       gcv.foreground = top_shadow_pixel;
       top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask);
     }
-
+  
   gcv.foreground = bottom_shadow_pixel;
   bottom_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask);
-
+  
   if (use_pixmap && flip_gcs)
     {
       GC tmp_gc = bottom_shadow_gc;
       bottom_shadow_gc = top_shadow_gc;
       top_shadow_gc = tmp_gc;
     }
-
+  
   gcv.foreground = background_pixel;
   background_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask);
-
+  
   /* possibly revert the GC's in case the shadow thickness is < 0.
      This will give a depressed look to the divider */
   if (shadow_thickness < 0)
@@ -1498,8 +1475,8 @@ x_output_vertical_divider (struct window *w, int clear)
       temp = top_shadow_gc;
       top_shadow_gc = bottom_shadow_gc;
       bottom_shadow_gc = temp;
-
-      /* better avoid a Bad Address XLib error ;-) */
+      
+      /* better avoid a Bad Adress XLib error ;-) */
       shadow_thickness = - shadow_thickness;
     }
 
@@ -1509,12 +1486,12 @@ x_output_vertical_divider (struct window *w, int clear)
     XClearArea (dpy, x_win, x, y1, width, y2 - y1, False);
 
   /* Draw the divider line. */
-  XFillRectangle (dpy, x_win, background_gc,
+  XFillRectangle (dpy, x_win, background_gc, 
                  x + spacing + shadow_thickness, y1,
                  line_width, y2 - y1);
-
+  
   /* Draw the shadows around the divider line */
-  x_output_shadows (f, x + spacing, y1,
+  x_output_shadows (f, x + spacing, y1, 
                    width - 2 * spacing, y2 - y1,
                    top_shadow_gc, bottom_shadow_gc,
                    background_gc, shadow_thickness);
@@ -1679,7 +1656,7 @@ x_output_hline (struct window *w, struct display_line *dl, struct rune *rb)
  x_output_shadows
 
  Draw a shadow around the given area using the given GC's.  It is the
- callers responsibility to set the GC's appropriately.
+ callers responsibility to ste the GC's appropriately.
  ****************************************************************************/
 void
 x_output_shadows (struct frame *f, int x, int y, int width, int height,
@@ -1837,27 +1814,27 @@ x_clear_to_window_end (struct window *w, int ypos1, int ypos2)
       XSETWINDOW (window, w);
 
       if (window_is_leftmost (w))
-       redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
+       x_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
                        ypos1, FRAME_BORDER_WIDTH (f), height);
 
       if (bounds.left_in - bounds.left_out > 0)
-       redisplay_clear_region (window,
+       x_clear_region (window,
                        get_builtin_face_cache_index (w, Vleft_margin_face),
                        bounds.left_out, ypos1,
                        bounds.left_in - bounds.left_out, height);
 
       if (bounds.right_in - bounds.left_in > 0)
-       redisplay_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1,
+       x_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1,
                        bounds.right_in - bounds.left_in, height);
 
       if (bounds.right_out - bounds.right_in > 0)
-       redisplay_clear_region (window,
+       x_clear_region (window,
                        get_builtin_face_cache_index (w, Vright_margin_face),
                        bounds.right_in, ypos1,
                        bounds.right_out - bounds.right_in, height);
 
       if (window_is_rightmost (w))
-       redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f),
+       x_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f),
                        ypos1, FRAME_BORDER_WIDTH (f), height);
     }
 }
@@ -1997,27 +1974,110 @@ x_redraw_exposed_area (struct frame *f, int x, int y, int width, int height)
  given face.
  ****************************************************************************/
 static void
-x_clear_region (Lisp_Object locale, struct device* d, struct frame* f, face_index findex,
-               int x, int y,
-               int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
-               Lisp_Object background_pixmap)
+x_clear_region (Lisp_Object locale, face_index findex, int x, int y,
+               int width, int height)
 {
+  struct window *w = NULL;
+  struct frame *f = NULL;
+  struct device *d;
+  Lisp_Object background_pixmap;
+
   Display *dpy;
   Window x_win;
-  GC gc = NULL;
 
+  if (WINDOWP (locale))
+    {
+      w = XWINDOW (locale);
+      f = XFRAME (w->frame);
+    }
+  else if (FRAMEP (locale))
+    {
+      w = NULL;
+      f = XFRAME (locale);
+    }
+  else
+    abort ();
+
+  d = XDEVICE (f->device);
   dpy = DEVICE_X_DISPLAY (d);
   x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
 
-    if (!UNBOUNDP (background_pixmap))
+  /* #### This function is going to have to be made cursor aware. */
+  if (width && height)
     {
-      gc = x_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil);
-    }
+      GC gc = NULL;
 
-  if (gc)
-    XFillRectangle (dpy, x_win, gc, x, y, width, height);
-  else
-    XClearArea (dpy, x_win, x, y, width, height, False);
+      /* #### This isn't quite right for when this function is called
+         from the toolbar code. */
+      background_pixmap = Qunbound;
+
+      /* Don't use a backing pixmap in the border area */
+      if (x >= FRAME_LEFT_BORDER_END (f)
+         && x < FRAME_RIGHT_BORDER_START (f)
+         && y >= FRAME_TOP_BORDER_END (f)
+         && y < FRAME_BOTTOM_BORDER_START (f))
+       {
+         Lisp_Object temp;
+
+         if (w)
+           {
+             temp = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, findex);
+
+             if (IMAGE_INSTANCEP (temp)
+                 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
+               {
+                 /* #### maybe we could implement such that a string
+                    can be a background pixmap? */
+                 background_pixmap = temp;
+               }
+           }
+         else
+           {
+             temp = FACE_BACKGROUND_PIXMAP (Vdefault_face, locale);
+
+             if (IMAGE_INSTANCEP (temp)
+                 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
+               {
+                 background_pixmap = temp;
+               }
+           }
+
+         if (!UNBOUNDP (background_pixmap) &&
+             XIMAGE_INSTANCE_PIXMAP_DEPTH (background_pixmap) == 0)
+           {
+             Lisp_Object fcolor, bcolor;
+
+             if (w)
+               {
+                 fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
+                 bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
+               }
+             else
+               {
+                 fcolor = FACE_FOREGROUND (Vdefault_face, locale);
+                 bcolor = FACE_BACKGROUND (Vdefault_face, locale);
+               }
+
+             gc = x_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil);
+           }
+         else
+           {
+             Lisp_Object color = (w ?
+                                  WINDOW_FACE_CACHEL_BACKGROUND (w, findex) :
+                                  FACE_BACKGROUND (Vdefault_face, locale));
+
+             if (UNBOUNDP (background_pixmap))
+               background_pixmap = Qnil;
+
+             gc = x_get_gc (d, Qnil, color, Qnil, background_pixmap, Qnil);
+           }
+       }
+
+      if (gc)
+       XFillRectangle (dpy, x_win, gc, x, y, width, height);
+      else
+       XClearArea (dpy, x_win, x, y, width, height, False);
+    }
 }
 
 /*****************************************************************************
@@ -2052,7 +2112,7 @@ x_output_eol_cursor (struct window *w, struct display_line *dl, int xpos,
   int defheight, defascent;
 
   XSETWINDOW (window, w);
-  redisplay_clear_region (window, findex, x, y, width, height);
+  x_clear_region (window, findex, x, y, width, height);
 
   if (NILP (w->text_cursor_visible_p))
     return;
index 73a5a15..895f520 100644 (file)
@@ -46,7 +46,6 @@ Boston, MA 02111-1307, USA.  */
 #include "commands.h"
 #include "debug.h"
 #include "device.h"
-#include "elhash.h"
 #include "extents.h"
 #include "faces.h"
 #include "frame.h"
@@ -256,8 +255,7 @@ static prop_block_dynarr *add_glyph_rune (pos_data *data,
                                          struct glyph_cachel *cachel);
 static Bytind create_text_block (struct window *w, struct display_line *dl,
                                 Bytind bi_start_pos, int start_col,
-                                prop_block_dynarr **prop,
-                                int type);
+                                prop_block_dynarr **prop, int type);
 static int create_overlay_glyph_block (struct window *w,
                                       struct display_line *dl);
 static void create_left_glyph_block (struct window *w,
@@ -366,11 +364,6 @@ int frame_changed;
 int glyphs_changed;
 int glyphs_changed_set;
 
-/* non-zero if any displayed subwindow is in need of updating
-   somewhere. */
-int subwindows_changed;
-int subwindows_changed_set;
-
 /* This variable is 1 if the icon has to be updated.
  It is set to 1 when `frame-icon-glyph' changes. */
 int icon_changed;
@@ -687,8 +680,7 @@ calculate_display_line_boundaries (struct window *w, int modeline)
 static Bufpos
 generate_display_line (struct window *w, struct display_line *dl, int bounds,
                       Bufpos start_pos, int start_col,
-                      prop_block_dynarr **prop,
-                      int type)
+                      prop_block_dynarr **prop, int type)
 {
   Bufpos ret_bufpos;
   int overlay_width;
@@ -1240,12 +1232,66 @@ add_control_char_runes (pos_data *data, struct buffer *b)
     }
 }
 
+/* Given a display table entry, call the appropriate functions to
+   display each element of the entry. */
+
 static prop_block_dynarr *
-add_disp_table_entry_runes_1 (pos_data *data, Lisp_Object entry)
+add_disp_table_entry_runes (pos_data *data, Lisp_Object entry)
 {
   prop_block_dynarr *prop = NULL;
 
-  if (STRINGP (entry))
+  if (VECTORP (entry))
+    {
+      struct Lisp_Vector *de = XVECTOR (entry);
+      long len = vector_length (de);
+      int elt;
+
+      for (elt = 0; elt < len; elt++)
+       {
+         if (NILP (de->contents[elt]))
+           continue;
+         else if (STRINGP (de->contents[elt]))
+           {
+             prop =
+               add_bufbyte_string_runes
+                 (data,
+                  XSTRING_DATA   (de->contents[elt]),
+                  XSTRING_LENGTH (de->contents[elt]),
+                  0);
+           }
+         else if (GLYPHP (de->contents[elt]))
+           {
+             if (data->start_col)
+               data->start_col--;
+
+             if (!data->start_col && data->bi_start_col_enabled)
+               {
+                 prop = add_hscroll_rune (data);
+               }
+             else
+               {
+                 struct glyph_block gb;
+
+                 gb.glyph = de->contents[elt];
+                 gb.extent = Qnil;
+                 prop = add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0);
+               }
+           }
+         else if (CHAR_OR_CHAR_INTP (de->contents[elt]))
+           {
+             data->ch = XCHAR_OR_CHAR_INT (de->contents[elt]);
+             prop = add_emchar_rune (data);
+           }
+         /* Else blow it off because someone added a bad entry and we
+             don't have any safe way of signaling an error. */
+
+         /* #### Still need to add any remaining elements to the
+             propagation information. */
+         if (prop)
+           return prop;
+       }
+    }
+  else if (STRINGP (entry))
     {
       prop = add_bufbyte_string_runes (data,
                                       XSTRING_DATA   (entry),
@@ -1275,79 +1321,10 @@ add_disp_table_entry_runes_1 (pos_data *data, Lisp_Object entry)
       data->ch = XCHAR_OR_CHAR_INT (entry);
       prop = add_emchar_rune (data);
     }
-  else if (CONSP (entry))
-    {
-      if (EQ (XCAR (entry), Qformat)
-         && CONSP (XCDR (entry))
-         && STRINGP (XCAR (XCDR (entry))))
-       {
-         Lisp_Object format = XCAR (XCDR (entry));
-         Bytind len = XSTRING_LENGTH (format);
-         Bufbyte *src = XSTRING_DATA (format), *end = src + len;
-         Bufbyte *result = alloca_array (Bufbyte, len);
-         Bufbyte *dst = result;
-
-         while (src < end)
-           {
-             Emchar c = charptr_emchar (src);
-             INC_CHARPTR (src);
-             if (c != '%' || src == end)
-               dst += set_charptr_emchar (dst, c);
-             else
-               {
-                 c = charptr_emchar (src);
-                 INC_CHARPTR (src);
-                 switch (c)
-                   {
-                     /*case 'x':
-                     dst += long_to_string_base ((char *)dst, data->ch, 16);
-                     break;*/
-                   case '%':
-                     dst += set_charptr_emchar (dst, '%');
-                     break;
-                   }
-               }
-           }
-         prop = add_bufbyte_string_runes (data, result, dst - result, 0);
-       }
-    }
 
   /* Else blow it off because someone added a bad entry and we don't
-     have any safe way of signaling an error. */
-  return prop;
-}
-
-/* Given a display table entry, call the appropriate functions to
-   display each element of the entry. */
-
-static prop_block_dynarr *
-add_disp_table_entry_runes (pos_data *data, Lisp_Object entry)
-{
-  prop_block_dynarr *prop = NULL;
-  if (VECTORP (entry))
-    {
-      struct Lisp_Vector *de = XVECTOR (entry);
-      EMACS_INT len = vector_length (de);
-      int elt;
-
-      for (elt = 0; elt < len; elt++)
-       {
-         if (NILP (vector_data (de)[elt]))
-           continue;
-         else
-           prop = add_disp_table_entry_runes_1 (data, vector_data (de)[elt]);
-         /* Else blow it off because someone added a bad entry and we
-            don't have any safe way of signaling an error.  Hey, this
-            comment sounds familiar. */
-
-         /* #### Still need to add any remaining elements to the
-             propagation information. */
-         if (prop)
-           return prop;
-       }
-    }
-  else
-    prop = add_disp_table_entry_runes_1 (data, entry);
+     have any safe way of signaling an error.  Hey, this comment
+     sounds familiar. */
   return prop;
 }
 
@@ -1766,14 +1743,14 @@ add_glyph_runes (pos_data *data, int pos_type)
 static Bytind
 create_text_block (struct window *w, struct display_line *dl,
                   Bytind bi_start_pos, int start_col,
-                  prop_block_dynarr **prop,
-                  int type)
+                  prop_block_dynarr **prop, int type)
 {
   struct frame *f = XFRAME (w->frame);
   struct buffer *b = XBUFFER (w->buffer);
   struct device *d = XDEVICE (f->device);
 
   pos_data data;
+  struct Lisp_Vector *dt = 0;
 
   /* Don't display anything in the minibuffer if this window is not on
      a selected frame.  We consider all other windows to be active
@@ -1806,41 +1783,46 @@ create_text_block (struct window *w, struct display_line *dl,
      into a more general conversion mechanism.  Ideally you
      could specify a Lisp function that converts characters,
      but this violates the Second Golden Rule and besides would
-     make things way way way way slow.
-
-     So instead, we extend the display-table concept, which was
-     historically limited to 256-byte vectors, to one of the
-     following:
-
-     a) A 256-entry vector, for backward compatibility;
-     b) char-table, mapping characters to values;
-     c) range-table, mapping ranges of characters to values;
-     d) a list of the above.
-
-     The (d) option allows you to specify multiple display tables
-     instead of just one.  Each display table can specify conversions
-     for some characters and leave others unchanged.  The way the
-     character gets displayed is determined by the first display table
-     with a binding for that character.  This way, you could call a
-     function `enable-hex-display' that adds a hex display-table to
-     the list of display tables for the current buffer.
-
-     #### ...not yet implemented...  Also, we extend the concept of
-     "mapping" to include a printf-like spec.  Thus you can make all
-     extended characters show up as hex with a display table like
-     this:
-
-         #s(range-table data ((256 524288) (format "%x")))
+     make things way way way way slow.  An idea I like is to
+     be able to specify multiple display tables instead of just
+     one.  Each display table can specify conversions for some
+     characters and leave others unchanged.  The way the
+     character gets displayed is determined by the first display
+     table with a binding for that character.  This way, you
+     could call a function `enable-hex-display' that adds a
+     pre-defined hex display-table (or maybe computes one if
+     you give weird parameters to the function) and adds it
+     to the list of display tables for the current buffer.
+
+     Unfortunately there are still problems dealing with Mule
+     characters.  For example, maybe I want to specify that
+     all extended characters (i.e. >= 256) are displayed in hex.
+     It's not reasonable to create a mapping for all possible
+     such characters, because there are about 2^19 of them.
+     One way of dealing with this is to extend the concept
+     of what a display table is.  Currently it's only allowed
+     to be a 256-entry vector.  Instead, it should be something
+     like:
+
+     a) A 256-entry vector, for backward compatibility
+     b) Some sort of hashtable, mapping characters to values
+     c) A list that specifies a range of values and the
+        mapping to provide for those values.
+
+     Also, extend the concept of "mapping" to include a
+     printf-like spec.  Then, you could make all extended
+     characters show up as hex with a display table like
+
+     ((256 . 524288) . "%x")
 
      Since more than one display table is possible, you have
-     great flexibility in mapping ranges of characters.  */
+     great flexibility in mapping ranges of characters.
+     */
   Emchar printable_min = (CHAR_OR_CHAR_INTP (b->ctl_arrow)
                          ? XCHAR_OR_CHAR_INT (b->ctl_arrow)
                          : ((EQ (b->ctl_arrow, Qt) || EQ (b->ctl_arrow, Qnil))
                             ? 255 : 160));
 
-  Lisp_Object face_dt, window_dt;
-
   /* The text display block for this display line. */
   struct display_block *db = get_display_block_from_line (dl, TEXT);
 
@@ -1979,10 +1961,10 @@ create_text_block (struct window *w, struct display_line *dl,
            /* Remember that the extent-fragment routines deal in Bytind's. */
            extent_fragment_update (w, data.ef, data.bi_bufpos);
 
-         get_display_tables (w, data.findex, &face_dt, &window_dt);
-
          if (data.bi_bufpos == data.ef->end)
            no_more_frags = 1;
+
+         dt = get_display_table (w, data.findex);
        }
       initial = 0;
 
@@ -2094,17 +2076,16 @@ create_text_block (struct window *w, struct display_line *dl,
 
       else
        {
-         Lisp_Object entry = Qnil;
          /* Get the character at the current buffer position. */
          data.ch = BI_BUF_FETCH_CHAR (b, data.bi_bufpos);
-         if (!NILP (face_dt) || !NILP (window_dt))
-           entry = display_table_entry (data.ch, face_dt, window_dt);
 
          /* If there is a display table entry for it, hand it off to
              add_disp_table_entry_runes and let it worry about it. */
-         if (!NILP (entry) && !EQ (entry, make_char (data.ch)))
+         if (dt && !NILP (DISP_CHAR_ENTRY (dt, data.ch)))
            {
-             *prop = add_disp_table_entry_runes (&data, entry);
+             *prop =
+               add_disp_table_entry_runes (&data,
+                                           DISP_CHAR_ENTRY (dt, data.ch));
 
              if (*prop)
                goto done;
@@ -2357,7 +2338,7 @@ done:
        {
          /* If data.start_col_enabled is still true, then the window is
              scrolled far enough so that nothing on this line is visible.
-             We need to stick a truncation glyph at the beginning of the
+             We need to stick a trunctation glyph at the beginning of the
              line in that case unless the line is completely blank. */
          if (data.bi_start_col_enabled)
            {
@@ -2890,7 +2871,7 @@ create_left_glyph_block (struct window *w, struct display_line *dl,
      they should start.  The inside margin glyphs get whatever space
      is left after the whitespace glyphs have been displayed.  These
      are tricky to calculate since if we decide to use the overflow
-     area we basically have to start over.  So for these we build up a
+     area we basicaly have to start over.  So for these we build up a
      list of just the inside margin glyphs and manipulate it to
      determine the needed info. */
   {
@@ -3019,7 +3000,7 @@ create_left_glyph_block (struct window *w, struct display_line *dl,
       struct glyph_block *gb = Dynarr_atp (dl->left_glyphs, elt);
 
       if (NILP (gb->extent))
-       abort ();       /* these should have been handled in add_glyph_rune */
+       abort ();       /* these should have beeb handled in add_glyph_rune */
 
       if (extent_begin_glyph_layout (XEXTENT (gb->extent)) ==
          GL_OUTSIDE_MARGIN)
@@ -3209,7 +3190,7 @@ create_right_glyph_block (struct window *w, struct display_line *dl)
      they should start.  The inside margin glyphs get whatever space
      is left after the whitespace glyphs have been displayed.  These
      are tricky to calculate since if we decide to use the overflow
-     area we basically have to start over.  So for these we build up a
+     area we basicaly have to start over.  So for these we build up a
      list of just the inside margin glyphs and manipulate it to
      determine the needed info. */
   {
@@ -3332,7 +3313,7 @@ create_right_glyph_block (struct window *w, struct display_line *dl)
       struct glyph_block *gb = Dynarr_atp (dl->right_glyphs, elt);
 
       if (NILP (gb->extent))
-       abort ();       /* these should have been handled in add_glyph_rune */
+       abort ();       /* these should have beeb handled in add_glyph_rune */
 
       if (extent_end_glyph_layout (XEXTENT (gb->extent)) == GL_OUTSIDE_MARGIN)
        {
@@ -3543,7 +3524,7 @@ generate_modeline (struct window *w, struct display_line *dl, int type)
                                MODELINE_INDEX, min_pixpos, max_pixpos, type);
 
   /* The modeline is at the bottom of the gutters.  We have to wait to
-     set this until we've generated the modeline in order to account
+     set this until we've generated teh modeline in order to account
      for any embedded faces. */
   dl->ypos = WINDOW_BOTTOM (w) - dl->descent - ypos_adj;
 }
@@ -4328,7 +4309,7 @@ regenerate_window (struct window *w, Bufpos start_pos, Bufpos point, int type)
     }
 
   if (prop)
-    Dynarr_free (prop);
+      Dynarr_free (prop);
 
   /* #### More not quite right, but close enough. */
   /* #### Ben sez: apparently window_end_pos[] is measured
@@ -4643,9 +4624,11 @@ regenerate_window_incrementally (struct window *w, Bufpos startp,
   /* If the changes are below the visible area then if point hasn't
      moved return success otherwise fail in order to be safe. */
   if (line > dla_end)
-    return regenerate_window_extents_only_changed (w, startp, pointm,
-                                                  extent_beg_unchanged,
-                                                  extent_end_unchanged);
+    {
+      return regenerate_window_extents_only_changed (w, startp, pointm,
+                                                    extent_beg_unchanged,
+                                                    extent_end_unchanged);
+    }
   else
     /* At this point we know what line the changes first affect.  We
        now redraw that line.  If the changes are contained within it
@@ -4769,9 +4752,12 @@ regenerate_window_incrementally (struct window *w, Bufpos startp,
              && extent_end_unchanged != -1
              && ((extent_beg_unchanged < ddl->bufpos)
                  || (extent_end_unchanged > ddl->end_bufpos)))
-           return regenerate_window_extents_only_changed (w, startp, pointm,
-                                                          extent_beg_unchanged,
-                                                          extent_end_unchanged);
+           {
+             return
+               regenerate_window_extents_only_changed (w, startp, pointm,
+                                                       extent_beg_unchanged,
+                                                       extent_end_unchanged);
+           }
          else
            return 1;
        }
@@ -5063,7 +5049,7 @@ redisplay_window (Lisp_Object window, int skip_selected)
          Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm),
                       the_buffer);
 
-         /* #### BUFU amounts of overkill just to get the cursor
+         /* #### BUFU amounts of overkil just to get the cursor
              location marked properly.  FIX ME FIX ME FIX ME */
          regenerate_window (w, startp, pointm, DESIRED_DISP);
        }
@@ -5080,10 +5066,7 @@ redisplay_window (Lisp_Object window, int skip_selected)
          temporary change to the echo area. */
       && !(MINI_WINDOW_P (w) && f->buffers_changed)
       && !f->frame_changed
-      && !truncation_changed
-      /* check whether start is really at the begining of a line  GE */
-      && (!w->start_at_line_beg || beginning_of_line_p (b, startp))
-      )
+      && !truncation_changed)
     {
       /* Check if the cursor has actually moved. */
       if (EQ (Fmarker_buffer (w->last_point[CURRENT_DISP]), w->buffer)
@@ -5094,7 +5077,6 @@ redisplay_window (Lisp_Object window, int skip_selected)
          && !f->extents_changed
          && !f->faces_changed
          && !f->glyphs_changed
-         && !f->subwindows_changed
          && !f->point_changed
          && !f->windows_structure_changed)
        {
@@ -5115,7 +5097,6 @@ redisplay_window (Lisp_Object window, int skip_selected)
              && !f->extents_changed
              && !f->faces_changed
              && !f->glyphs_changed
-             && !f->subwindows_changed
              && !f->windows_structure_changed)
            {
              if (point_visible (w, pointm, CURRENT_DISP)
@@ -5173,7 +5154,6 @@ redisplay_window (Lisp_Object window, int skip_selected)
           && !f->clip_changed
           && !f->faces_changed
           && !f->glyphs_changed
-          && !f->subwindows_changed
           && !f->windows_structure_changed
           && !f->frame_changed
           && !truncation_changed
@@ -5258,7 +5238,7 @@ regeneration_done:
       redisplay_output_window (w);
       /*
        * If we just displayed the echo area, the line start cache is
-       * no longer valid, because the minibuffer window is associated
+       * no longer valid, because the minibuffer window is assocaited
        * with the window now.
        */
       if (echo_active)
@@ -5371,13 +5351,13 @@ redisplay_frame (struct frame *f, int preemption_check)
     change_frame_size (f, f->new_height, f->new_width, 0);
 
   /* If frame size might need to be changed, due to changed size
-     of toolbars, scrollbars etc, change it now */
+     of toolbars, scroolabrs etc, change it now */
   if (f->size_slipped)
     {
       adjust_frame_size (f);
       assert (!f->size_slipped);
     }
-
+  
   /* The menubar, toolbar, and icon updates must be done before
      hold_frame_size_changes is called and we are officially
      'in_display'.  They may eval lisp code which may call Fsignal.
@@ -5390,11 +5370,7 @@ redisplay_frame (struct frame *f, int preemption_check)
      being handled. */
   update_frame_menubars (f);
 #endif /* HAVE_MENUBARS */
-  /* widgets are similar to menus in that they can call lisp to
-     determine activation etc. Therefore update them before we get
-     into redisplay. This is primarily for connected widgets such as
-     radio buttons. */
-  update_frame_subwindows (f);
+
 #ifdef HAVE_TOOLBARS
   /* Update the toolbars. */
   update_frame_toolbars (f);
@@ -5432,20 +5408,7 @@ redisplay_frame (struct frame *f, int preemption_check)
 
   /* Erase the frame before outputting its contents. */
   if (f->clear)
-    {
-      DEVMETH (d, clear_frame, (f));
-    }
-
-  /* invalidate the subwindow cache. we are going to reuse the glyphs
-     flag here to cause subwindows to get instantiated. This is
-     because subwindows changed is less strict - dealing with things
-     like the clicked state of button. */
-  if (!Dynarr_length (f->subwindow_cachels)
-      || f->glyphs_changed
-      || f->frame_changed)
-    reset_subwindow_cachels (f);
-  else
-    mark_subwindow_cachels_as_not_updated (f);
+    DEVMETH (d, clear_frame, (f));
 
   /* Do the selected window first. */
   redisplay_window (FRAME_SELECTED_WINDOW (f), 0);
@@ -5467,7 +5430,6 @@ redisplay_frame (struct frame *f, int preemption_check)
   f->faces_changed    = 0;
   f->frame_changed    = 0;
   f->glyphs_changed   = 0;
-  f->subwindows_changed   = 0;
   f->icon_changed     = 0;
   f->menubar_changed  = 0;
   f->modeline_changed = 0;
@@ -5531,7 +5493,7 @@ redisplay_device (struct device *d)
          f->faces_changed    || f->frame_changed || f->menubar_changed ||
          f->modeline_changed || f->point_changed || f->size_changed    ||
          f->toolbar_changed  || f->windows_changed || f->size_slipped  ||
-         f->windows_structure_changed || f->glyphs_changed || f->subwindows_changed)
+         f->windows_structure_changed || f->glyphs_changed)
        {
          preempted = redisplay_frame (f, 0);
        }
@@ -5566,7 +5528,7 @@ redisplay_device (struct device *d)
              f->modeline_changed || f->point_changed || f->size_changed    ||
              f->toolbar_changed  || f->windows_changed ||
              f->windows_structure_changed ||
-             f->glyphs_changed || f->subwindows_changed)
+             f->glyphs_changed)
            {
              preempted = redisplay_frame (f, 0);
            }
@@ -5587,7 +5549,6 @@ redisplay_device (struct device *d)
   d->faces_changed    = 0;
   d->frame_changed    = 0;
   d->glyphs_changed   = 0;
-  d->subwindows_changed   = 0;
   d->icon_changed     = 0;
   d->menubar_changed  = 0;
   d->modeline_changed = 0;
@@ -5633,7 +5594,7 @@ redisplay_without_hooks (void)
       !faces_changed   && !frame_changed    && !icon_changed    &&
       !menubar_changed && !modeline_changed && !point_changed   &&
       !size_changed    && !toolbar_changed  && !windows_changed &&
-      !glyphs_changed  && !subwindows_changed &&
+      !glyphs_changed  &&
       !windows_structure_changed && !disable_preemption &&
       preemption_count < max_preempts)
     goto done;
@@ -5648,7 +5609,7 @@ redisplay_without_hooks (void)
          d->menubar_changed  || d->modeline_changed || d->point_changed   ||
          d->size_changed     || d->toolbar_changed  || d->windows_changed ||
          d->windows_structure_changed ||
-         d->glyphs_changed || d->subwindows_changed)
+         d->glyphs_changed)
        {
          preempted = redisplay_device (d);
 
@@ -5672,7 +5633,6 @@ redisplay_without_hooks (void)
   extents_changed  = 0;
   frame_changed    = 0;
   glyphs_changed   = 0;
-  subwindows_changed   = 0;
   icon_changed     = 0;
   menubar_changed  = 0;
   modeline_changed = 0;
@@ -5740,9 +5700,9 @@ window_line_number (struct window *w, int type)
 {
   struct device *d = XDEVICE (XFRAME (w->frame)->device);
   struct buffer *b = XBUFFER (w->buffer);
-  /* Be careful in the order of these tests. The first clause will
+  /* Be careful in the order of these tests. The first clasue will
      fail if DEVICE_SELECTED_FRAME == Qnil (since w->frame cannot be).
-     This can occur when the frame title is computed really early */
+     This can occur when the frame title is computed really early */ 
   Bufpos pos =
     ((EQ(DEVICE_SELECTED_FRAME(d), w->frame) &&
        (w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame(d)))) &&
@@ -6126,10 +6086,8 @@ mark_glyph_block_dynarr (glyph_block_dynarr *gba, void (*markobj) (Lisp_Object))
 
       for (; gb < gb_last; gb++)
        {
-         if (!NILP (gb->glyph))
-           markobj (gb->glyph);
-         if (!NILP (gb->extent))
-           markobj (gb->extent);
+         if (!NILP (gb->glyph))  ((markobj) (gb->glyph));
+         if (!NILP (gb->extent)) ((markobj) (gb->extent));
        }
     }
 }
@@ -6157,9 +6115,9 @@ mark_redisplay_structs (display_line_dynarr *dla, void (*markobj) (Lisp_Object))
              if (r->type == RUNE_DGLYPH)
                {
                  if (!NILP (r->object.dglyph.glyph))
-                   markobj (r->object.dglyph.glyph);
+                   ((markobj) (r->object.dglyph.glyph));
                  if (!NILP (r->object.dglyph.extent))
-                   markobj (r->object.dglyph.extent);
+                   ((markobj) (r->object.dglyph.extent));
                }
            }
        }
@@ -6303,7 +6261,7 @@ validate_line_start_cache (struct window *w)
          size changes can cause text shifting.  However, the extent
          covering the region is constantly having its face set and
          priority altered by the mouse code.  This means that the line
-         start cache is constantly being invalidated.  This is bad
+         start cache is constanty being invalidated.  This is bad
          since the mouse code also triggers heavy usage of the cache.
          Since it is an unlikely that f->extents being changed
          indicates that the cache really needs to be updated and if it
@@ -7103,7 +7061,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to,
 
           /*
            * Handle invisible text properly:
-           * If the last line we're inserting has the same end as the
+           * If the last line we're inserting has the same end as the 
            * line before which it will be added, merge the two lines.
            */
           if (Dynarr_length (cache)  &&
@@ -7339,7 +7297,7 @@ get_position_object (struct display_line *dl, Lisp_Object *obj1,
     d->pixel_to_glyph_cache.obj1 = *obj1;                              \
     d->pixel_to_glyph_cache.obj2 = *obj2;                              \
     d->pixel_to_glyph_cache.retval = position;                         \
-    RETURN_SANS_WARNINGS position;                                     \
+    RETURN__ position;                                                 \
   } while (0)
 
 /* Given x and y coordinates in pixels relative to a frame, return
@@ -8098,29 +8056,40 @@ redisplay_glyph_changed (Lisp_Object glyph, Lisp_Object property,
 {
   if (WINDOWP (locale))
     {
-      MARK_FRAME_GLYPHS_CHANGED (XFRAME (WINDOW_FRAME (XWINDOW (locale))));
+      struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (locale)));
+      MARK_FRAME_GLYPHS_CHANGED (f);
     }
   else if (FRAMEP (locale))
     {
-      MARK_FRAME_GLYPHS_CHANGED (XFRAME (locale));
+      struct frame *f = XFRAME (locale);
+      MARK_FRAME_GLYPHS_CHANGED (f);
     }
   else if (DEVICEP (locale))
     {
       Lisp_Object frmcons;
       DEVICE_FRAME_LOOP (frmcons, XDEVICE (locale))
-       MARK_FRAME_GLYPHS_CHANGED (XFRAME (XCAR (frmcons)));
+       {
+         struct frame *f = XFRAME (XCAR (frmcons));
+         MARK_FRAME_GLYPHS_CHANGED (f);
+       }
     }
   else if (CONSOLEP (locale))
     {
       Lisp_Object frmcons, devcons;
       CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, XCONSOLE (locale))
-       MARK_FRAME_GLYPHS_CHANGED (XFRAME (XCAR (frmcons)));
+       {
+         struct frame *f = XFRAME (XCAR (frmcons));
+         MARK_FRAME_GLYPHS_CHANGED (f);
+       }
     }
   else /* global or buffer */
     {
       Lisp_Object frmcons, devcons, concons;
       FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
-       MARK_FRAME_GLYPHS_CHANGED (XFRAME (XCAR (frmcons)));
+       {
+         struct frame *f = XFRAME (XCAR (frmcons));
+         MARK_FRAME_GLYPHS_CHANGED (f);
+       }
     }
 }
 
@@ -8330,7 +8299,7 @@ line start cache.
 Minimum pixel height for clipped bottom display line.
 A clipped line shorter than this won't be displayed.
 */ ,
-                   redisplay_variable_changed);
+                  redisplay_variable_changed);
   vertical_clip = 5;
 
   DEFVAR_INT_MAGIC ("pixel-horizontal-clip-threshold", &horizontal_clip /*
@@ -8338,7 +8307,7 @@ Minimum visible area for clipped glyphs at right boundary.
 Clipped glyphs shorter than this won't be displayed.
 Only pixmap glyph instances are currently allowed to be clipped.
 */ ,
-                   redisplay_variable_changed);
+             redisplay_variable_changed);
   horizontal_clip = 5;
 
   DEFVAR_LISP ("global-mode-string", &Vglobal_mode_string /*
@@ -8350,14 +8319,13 @@ String displayed by modeline-format's "%m" specification.
 Marker for where to display an arrow on top of the buffer text.
 This must be the beginning of a line in order to work.
 See also `overlay-arrow-string'.
-*/ ,
-                    redisplay_variable_changed);
+*/ , redisplay_variable_changed);
   Voverlay_arrow_position = Qnil;
 
   DEFVAR_LISP_MAGIC ("overlay-arrow-string", &Voverlay_arrow_string /*
 String to display as an arrow.  See also `overlay-arrow-position'.
 */ ,
-                    redisplay_variable_changed);
+                   redisplay_variable_changed);
   Voverlay_arrow_string = Qnil;
 
   DEFVAR_INT ("scroll-step", &scroll_step /*
@@ -8376,7 +8344,7 @@ If this is zero, point is always centered after it moves off screen.
                     &truncate_partial_width_windows /*
 *Non-nil means truncate lines in all windows less than full frame wide.
 */ ,
-                    redisplay_variable_changed);
+                   redisplay_variable_changed);
   truncate_partial_width_windows = 1;
 
   DEFVAR_BOOL ("visible-bell", &visible_bell /*
index aa6f742..0d609bc 100644 (file)
@@ -139,7 +139,7 @@ struct rune
     /* CHAR */
     struct
     {
-      Emchar ch;               /* Character of this rune. */
+      Emchar ch;               /* Cbaracter of this rune. */
     } chr;
 
     /* HLINE */
@@ -256,7 +256,7 @@ struct display_line
   int cursor_elt;                      /* rune block of TEXT display
                                           block cursor is at or -1 */
   char used_prop_data;                 /* can't incrementally update if line
-                                          used propagation data */
+                                          used propogation data */
 
   layout_bounds bounds;                        /* line boundary positions */
 
@@ -270,11 +270,6 @@ struct display_line
   glyph_block_dynarr *right_glyphs;
 };
 
-#define DISPLAY_LINE_HEIGHT(dl) \
-(dl->ascent + dl->descent - dl->clip)
-#define DISPLAY_LINE_YPOS(dl) \
-(dl->ypos - dl->ascent)
-
 typedef struct
 {
   Dynarr_declare (display_line);
@@ -355,11 +350,6 @@ extern int frame_changed;
 extern int glyphs_changed;
 extern int glyphs_changed_set;
 
-/* True if any displayed subwindow is in need of updating
-   somewhere. */
-extern int subwindows_changed;
-extern int subwindows_changed_set;
-
 /* True if an icon is in need of updating somewhere. */
 extern int icon_changed;
 extern int icon_changed_set;
@@ -399,23 +389,23 @@ extern int windows_structure_changed;
    if each has already been called and don't bother doing most of the
    work if it is currently set. */
 
-#define MARK_TYPE_CHANGED(object) do {                         \
-  if (!object##_changed_set) {                                 \
-    Lisp_Object MTC_devcons, MTC_concons;                      \
-    DEVICE_LOOP_NO_BREAK (MTC_devcons, MTC_concons)            \
-      {                                                                \
-        Lisp_Object MTC_frmcons;                               \
-        struct device *MTC_d = XDEVICE (XCAR (MTC_devcons));   \
-        DEVICE_FRAME_LOOP (MTC_frmcons, MTC_d)                 \
-         {                                                     \
-           struct frame *MTC_f = XFRAME (XCAR (MTC_frmcons));  \
-            MTC_f->object##_changed = 1;                       \
-           MTC_f->modiff++;                                    \
-         }                                                     \
-        MTC_d->object##_changed = 1;                           \
-      }                                                                \
-    object##_changed = 1;                                      \
-    object##_changed_set = 1; }                                        \
+#define MARK_TYPE_CHANGED(object) do {                                 \
+  if (!object##_changed_set) {                                         \
+    Lisp_Object _devcons_, _concons_;                                  \
+    DEVICE_LOOP_NO_BREAK (_devcons_, _concons_)                                \
+      {                                                                        \
+        Lisp_Object _frmcons_;                                         \
+        struct device *_d_ = XDEVICE (XCAR (_devcons_));               \
+        DEVICE_FRAME_LOOP (_frmcons_, _d_)                             \
+         {                                                             \
+           struct frame *_f_ = XFRAME (XCAR (_frmcons_));              \
+            _f_->object##_changed = 1;                                 \
+           _f_->modiff++;                                              \
+         }                                                             \
+        _d_->object##_changed = 1;                                     \
+      }                                                                        \
+    object##_changed = 1;                                              \
+    object##_changed_set = 1; }                                                \
   }  while (0)
 
 #define MARK_BUFFERS_CHANGED MARK_TYPE_CHANGED (buffers)
@@ -427,22 +417,20 @@ extern int windows_structure_changed;
 #define MARK_POINT_CHANGED MARK_TYPE_CHANGED (point)
 #define MARK_TOOLBAR_CHANGED MARK_TYPE_CHANGED (toolbar)
 #define MARK_GLYPHS_CHANGED MARK_TYPE_CHANGED (glyphs)
-#define MARK_SUBWINDOWS_CHANGED MARK_TYPE_CHANGED (subwindows)
 
 /* Anytime a console, device or frame is added or deleted we need to reset
    these flags. */
-#define RESET_CHANGED_SET_FLAGS                \
-  do {                                 \
-    buffers_changed_set = 0;           \
-    clip_changed_set = 0;              \
-    extents_changed_set = 0;           \
-    icon_changed_set = 0;              \
-    menubar_changed_set = 0;           \
-    modeline_changed_set = 0;          \
-    point_changed_set = 0;             \
-    toolbar_changed_set = 0;           \
-    glyphs_changed_set = 0;            \
-    subwindows_changed_set = 0;                \
+#define RESET_CHANGED_SET_FLAGS                                                \
+  do {                                                                 \
+    buffers_changed_set = 0;                                           \
+    clip_changed_set = 0;                                              \
+    extents_changed_set = 0;                                           \
+    icon_changed_set = 0;                                              \
+    menubar_changed_set = 0;                                           \
+    modeline_changed_set = 0;                                          \
+    point_changed_set = 0;                                             \
+    toolbar_changed_set = 0;                                           \
+    glyphs_changed_set = 0;                                            \
   } while (0)
 
 \f
@@ -450,7 +438,7 @@ extern int windows_structure_changed;
 /*                       redisplay global variables                      */
 /*************************************************************************/
 
-/* redisplay structure used by various utility routines. */
+/* redisplay structre used by various utility routines. */
 extern display_line_dynarr *cmotion_display_lines;
 
 /* Nonzero means truncate lines in all windows less wide than the frame. */
@@ -485,7 +473,7 @@ extern Lisp_Object Vglobal_mode_string;
 extern int display_arg;
 
 /* Type of display specified.  Defined in emacs.c. */
-extern CONST char *display_use;
+extern char *display_use;
 
 /* Nonzero means reading single-character input with prompt
    so put cursor on minibuffer after the prompt.  */
@@ -559,14 +547,6 @@ int compute_line_start_cache_dynarr_usage (line_start_cache_dynarr *dyn,
 int get_next_display_block (layout_bounds bounds,
                            display_block_dynarr *dba, int start_pos,
                            int *next_start);
-void redisplay_output_subwindow (struct window *w, struct display_line *dl,
-                                Lisp_Object image_instance, int xpos,
-                                int xoffset, int start_pixpos, int width,
-                                face_index findex, int cursor_start, 
-                                int cursor_width, int cursor_height);
-void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height);
-void redisplay_clear_region (Lisp_Object window, face_index findex, int x,
-                            int y, int width, int height);
 void redisplay_clear_bottom_of_window (struct window *w,
                                       display_line_dynarr *ddla,
                                       int min_start, int max_end);
index d7618d1..1b68465 100644 (file)
@@ -1284,14 +1284,14 @@ typedef struct
        DEBUG_PRINT2 ("  Pushing reg: %d\n", this_reg);                 \
         DEBUG_STATEMENT (num_regs_pushed++);                           \
                                                                        \
-       DEBUG_PRINT2 ("    start: 0x%lx\n", (long) regstart[this_reg]); \
+       DEBUG_PRINT2 ("    start: 0x%p\n", regstart[this_reg]);         \
         PUSH_FAILURE_POINTER (regstart[this_reg]);                     \
                                                                         \
-       DEBUG_PRINT2 ("    end: 0x%lx\n", (long) regend[this_reg]);     \
+       DEBUG_PRINT2 ("    end: 0x%p\n", regend[this_reg]);             \
         PUSH_FAILURE_POINTER (regend[this_reg]);                       \
                                                                        \
        DEBUG_PRINT2 ("    info: 0x%lx\n      ",                        \
-                     * (long *) (&reg_info[this_reg]));                \
+                     * (unsigned long *) (&reg_info[this_reg]));       \
         DEBUG_PRINT2 (" match_null=%d",                                        \
                       REG_MATCH_NULL_STRING_P (reg_info[this_reg]));   \
         DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg]));   \
@@ -1309,11 +1309,11 @@ typedef struct
     DEBUG_PRINT2 ("  Pushing high active reg: %d\n", highest_active_reg);\
     PUSH_FAILURE_INT (highest_active_reg);                             \
                                                                        \
-    DEBUG_PRINT2 ("  Pushing pattern 0x%lx: ", (long) pattern_place);  \
+    DEBUG_PRINT2 ("  Pushing pattern 0x%p: ", pattern_place);          \
     DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend);          \
     PUSH_FAILURE_POINTER (pattern_place);                              \
                                                                        \
-    DEBUG_PRINT2 ("  Pushing string 0x%lx: `", (long) string_place);   \
+    DEBUG_PRINT2 ("  Pushing string 0x%p: `", string_place);           \
     DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2,   \
                                 size2);                                \
     DEBUG_PRINT1 ("'\n");                                              \
@@ -1387,12 +1387,12 @@ typedef struct
   if (string_temp != NULL)                                             \
     str = (CONST char *) string_temp;                                  \
                                                                        \
-  DEBUG_PRINT2 ("  Popping string 0x%lx: `",  (long) str);             \
+  DEBUG_PRINT2 ("  Popping string 0x%p: `",  str);                     \
   DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2);     \
   DEBUG_PRINT1 ("'\n");                                                        \
                                                                        \
   pat = (unsigned char *) POP_FAILURE_POINTER ();                      \
-  DEBUG_PRINT2 ("  Popping pattern 0x%lx: ", (long) pat);              \
+  DEBUG_PRINT2 ("  Popping pattern 0x%p: ", pat);                      \
   DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend);                      \
                                                                        \
   /* Restore register info.  */                                                \
@@ -1408,13 +1408,13 @@ typedef struct
                                                                        \
       reg_info[this_reg].word = POP_FAILURE_ELT ();                    \
       DEBUG_PRINT2 ("      info: 0x%lx\n",                             \
-                   * (long *) &reg_info[this_reg]);                    \
+                   * (unsigned long *) &reg_info[this_reg]);           \
                                                                        \
       regend[this_reg] = (CONST char *) POP_FAILURE_POINTER ();                \
-      DEBUG_PRINT2 ("      end: 0x%lx\n", (long) regend[this_reg]);    \
+      DEBUG_PRINT2 ("      end: 0x%p\n", regend[this_reg]);            \
                                                                        \
       regstart[this_reg] = (CONST char *) POP_FAILURE_POINTER ();      \
-      DEBUG_PRINT2 ("      start: 0x%lx\n", (long) regstart[this_reg]);        \
+      DEBUG_PRINT2 ("      start: 0x%p\n", regstart[this_reg]);                \
     }                                                                  \
                                                                        \
   set_regs_matched_done = 0;                                           \
@@ -3315,7 +3315,7 @@ compile_extended_range (CONST char **p_ptr, CONST char *pend, char *translate,
     return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
 
   /* Can't have ranges spanning different charsets, except maybe for
-     ranges entirely within the first 256 chars. */
+     ranges entirely witin the first 256 chars. */
 
   if ((range_start >= 0x100 || range_end >= 0x100)
       && CHAR_LEADING_BYTE (range_start) !=
@@ -4473,7 +4473,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1,
      fails at this starting point in the input data.  */
   for (;;)
     {
-      DEBUG_PRINT2 ("\n0x%lx: ", (long) p);
+      DEBUG_PRINT2 ("\n0x%p: ", p);
 #ifdef emacs /* XEmacs added, w/removal of immediate_quit */
       if (!no_quit_in_re_search)
        QUIT;
@@ -4857,16 +4857,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1,
                   highest_active_reg = NO_HIGHEST_ACTIVE_REG;
                 }
               else
-               {
-                 highest_active_reg = r;
-
-                 /* 98/9/21 jhod:  We've also gotta set lowest_active_reg, don't we? */
-                 r = 1;
-                 while (r < highest_active_reg && !IS_ACTIVE(reg_info[r]))
-                   r++;
-                 lowest_active_reg = r;
-               }
-           }
+                highest_active_reg = r;
+            }
 
           /* If just failed to match something this time around with a
              group that's operated on by a repetition operator, try to
@@ -5084,7 +5076,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1,
           DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
 
           EXTRACT_NUMBER_AND_INCR (mcnt, p);
-          DEBUG_PRINT3 (" %d (to 0x%lx):\n", mcnt, (long) (p + mcnt));
+          DEBUG_PRINT3 (" %d (to 0x%p):\n", mcnt, p + mcnt);
 
           PUSH_FAILURE_POINT (p + mcnt, (char *) 0, -2);
           break;
@@ -5107,7 +5099,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1,
           DEBUG_PRINT1 ("EXECUTING on_failure_jump");
 
           EXTRACT_NUMBER_AND_INCR (mcnt, p);
-          DEBUG_PRINT3 (" %d (to 0x%lx)", mcnt, (long) (p + mcnt));
+          DEBUG_PRINT3 (" %d (to 0x%p)", mcnt, p + mcnt);
 
           /* If this on_failure_jump comes right before a group (i.e.,
              the original * applied to a group), save the information
@@ -5322,7 +5314,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1,
          EXTRACT_NUMBER_AND_INCR (mcnt, p);    /* Get the amount to jump.  */
           DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
          p += mcnt;                            /* Do the jump.  */
-          DEBUG_PRINT2 ("(to 0x%lx).\n", (long) p);
+          DEBUG_PRINT2 ("(to 0x%p).\n", p);
          break;
 
 
@@ -5371,12 +5363,11 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1,
                mcnt--;
               p += 2;
                STORE_NUMBER_AND_INCR (p, mcnt);
-               DEBUG_PRINT3 ("  Setting 0x%lx to %d.\n", (long) p, mcnt);
+               DEBUG_PRINT3 ("  Setting 0x%p to %d.\n", p, mcnt);
             }
          else if (mcnt == 0)
             {
-              DEBUG_PRINT2 ("  Setting two bytes from 0x%lx to no_op.\n",
-                           (long) (p+2));
+              DEBUG_PRINT2 ("  Setting two bytes from 0x%p to no_op.\n", p+2);
              p[2] = (unsigned char) no_op;
               p[3] = (unsigned char) no_op;
               goto on_failure;
@@ -5406,7 +5397,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1,
             EXTRACT_NUMBER_AND_INCR (mcnt, p);
             p1 = p + mcnt;
             EXTRACT_NUMBER_AND_INCR (mcnt, p);
-            DEBUG_PRINT3 ("  Setting 0x%lx to %d.\n", (long) p1, mcnt);
+            DEBUG_PRINT3 ("  Setting 0x%p to %d.\n", p1, mcnt);
            STORE_NUMBER (p1, mcnt);
             break;
           }
diff --git a/src/s/msdos.h b/src/s/msdos.h
new file mode 100644 (file)
index 0000000..875083c
--- /dev/null
@@ -0,0 +1,223 @@
+/* System description file for MS-DOS
+
+   Copyright (C) 1993 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs 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.
+
+GNU Emacs 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: FSF 19.31. */
+
+/* Note: lots of stuff here was taken from s-msdos.h in demacs. */
+
+
+/*
+ *     Define symbols to identify the version of Unix this is.
+ *     Define all the symbols that apply correctly.
+ */
+
+/* #define UNIPLUS */
+/* #define USG5 */
+/* #define USG */
+/* #define HPUX */
+/* #define UMAX */
+/* #define BSD4_1 */
+/* #define BSD4_2 */
+/* #define BSD4_3 */
+/* #define BSD */
+#ifndef MSDOS
+#define MSDOS
+#endif
+
+#ifdef __GO32__
+#ifndef __DJGPP__
+#define __DJGPP__ 1    /* V2 defines __DJGPP__ == 2 */
+#endif
+#else
+You lose; /* Emacs for DOS must be compiled with DJGPP */
+#endif
+
+#define DOS_NT /* MSDOS or WINDOWSNT */
+#undef BSD
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+ It sets the Lisp variable system-type.  */
+
+#define SYSTEM_TYPE "ms-dos"
+
+#define SYMS_SYSTEM syms_of_dosfns();syms_of_msdos()
+
+/* Letter to use in finding device name of first pty,
+  if system supports pty's.  'a' means it is /dev/ptya0  */
+
+/* #define FIRST_PTY_LETTER 'a' */
+
+/*
+ *     Define HAVE_PTYS if the system supports pty devices.
+ */
+
+/* #define HAVE_PTYS */
+
+/* MSDOS has dirent.h but doesn't behave otherwise like the SYSV
+   directory functions.  We have special tests for this in
+   sysdir.h. */
+
+#undef SYSV_SYSTEM_DIR
+
+/* Define this is the compiler understands `volatile'.  */
+#define HAVE_VOLATILE
+
+#define NO_SUBPROCESSES
+
+/* If your system uses COFF (Common Object File Format) then define the
+   preprocessor symbol "COFF". */
+
+#define COFF
+
+/* define MAIL_USE_FLOCK if the mailer uses flock
+   to interlock access to /usr/spool/mail/$USER.
+   The alternative is that a lock file named
+   /usr/spool/mail/$USER.lock.  */
+
+/* #define MAIL_USE_FLOCK */
+
+/* Here, on a separate page, add any special hacks needed
+   to make Emacs work on this system.  For example,
+   you might define certain system call names that don't
+   exist on your system, or that do different things on
+   your system and must be used only through an encapsulation
+   (Which you should place, by convention, in sysdep.c).  */
+\f
+/* Avoid incompatibilities between gmalloc.c and system header files
+   in how to declare valloc.  */
+#define GMALLOC_INHIBIT_VALLOC
+
+/* setjmp and longjmp can safely replace _setjmp and _longjmp,
+   but they will run slower.  */
+
+#define _setjmp setjmp
+#define _longjmp longjmp
+
+#if __DJGPP__ < 2
+
+#define NO_MODE_T
+
+/* New chdir () routine.
+   DJGPP v2.0 and later doesn't need it because its chdir() does
+   set the drive itself. */
+#ifdef chdir
+#undef chdir
+#endif
+#define chdir sys_chdir
+
+#define LIBS_SYSTEM "-lpc"  /* isn't required in DJGPP v2.0, either */
+
+#endif /* __DJGPP__ < 2 */
+
+#if __DJGPP__ > 1
+
+#define DATA_START  (&etext + 1)
+#define TEXT_START  &start
+#define TEXT_END    &etext
+
+#define _NAIVE_DOS_REGS
+
+#else /* not __DJGPP__ > 1 */
+
+/* This somehow needs to be defined even though we use COFF.  */
+#define TEXT_START -1
+
+#endif /* not __DJGPP__ > 1 */
+
+#define ORDINARY_LINK
+
+/* command.com does not understand `...` so we define this.  */
+#define LIB_GCC "-Lgcc"
+#define DONT_NEED_ENVIRON
+#define SEPCHAR ';'
+
+#define NULL_DEVICE "nul"
+#define EXEC_SUFFIXES ".exe:.com:.bat:"
+
+#if __DJGPP__ < 2
+#define O_RDONLY        0x0001
+#define O_WRONLY        0x0002
+#define O_RDWR          0x0004
+#define O_CREAT         0x0100
+#define O_TRUNC         0x0200
+#define O_EXCL          0x0400
+#define O_APPEND        0x0800
+#define O_TEXT          0x4000
+#define O_BINARY        0x8000
+#define NO_MATHERR
+#endif
+
+#define HAVE_INVERSE_HYPERBOLIC
+#define FLOAT_CHECK_DOMAIN
+
+/* When $TERM is "internal" then this is substituted:  */
+#define INTERNAL_TERMINAL "pc|bios|IBM PC with colour display:\
+:co#80:li#25:km:ms:cm=<CM>:cl=<CL>:ce=<CE>:"
+
+/* Define this to a function (Fdowncase, Fupcase) if your file system
+   likes that */
+#define FILE_SYSTEM_CASE Fmsdos_downcase_filename
+
+/* Define this to be the separator between devices and paths */
+#define DEVICE_SEP ':'
+
+/* We'll support either convention on MSDOG.  */
+#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
+#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
+
+/* Call init_gettimeofday when TZ changes.  */
+#if __DJGPP__ < 2
+#define LOCALTIME_CACHE
+#define tzset init_gettimeofday
+#endif
+
+/* bcopy under djgpp is quite safe */
+#define GAP_USE_BCOPY
+#define BCOPY_UPWARD_SAFE 1
+#define BCOPY_DOWNWARD_SAFE 1
+
+/* Mode line description of a buffer's type.  */
+#define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B")
+
+/* Do we have POSIX signals?  */
+#if __DJGPP__ > 1
+#define POSIX_SIGNALS
+#endif
+
+/* We have (the code to control) a mouse.  */
+#define HAVE_MOUSE
+
+/* We canuse mouse menus.  */
+#define HAVE_MENUS
+
+/* We have support for faces.  */
+#define HAVE_FACES
+
+/* Define one of these for easier conditionals.  */
+#ifdef HAVE_X_WINDOWS
+/* We need a little extra space, see ../../lisp/loadup.el */
+#define SYSTEM_PURESIZE_EXTRA 15000
+#define HAVE_X11R5
+#define LIBX11_SYSTEM "-lxext -lsys"
+#else
+/* We need a little extra space, see ../../lisp/loadup.el */
+#define SYSTEM_PURESIZE_EXTRA 85000
+#endif
diff --git a/src/s/windows95.h b/src/s/windows95.h
new file mode 100644 (file)
index 0000000..a6de39f
--- /dev/null
@@ -0,0 +1,7 @@
+/* Synched up with: FSF 19.31. */
+
+/* System description file for Windows 95.  */
+
+#include "windowsnt.h"
+
+#define WINDOWS95
index 051fded..82e27ca 100644 (file)
@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA.  */
 #include "lisp.h"
 
 #include "buffer.h"
+#include "commands.h"
 #include "insdel.h"
 #include "opaque.h"
 #ifdef REGION_CACHE_NEEDS_WORK
@@ -683,31 +684,31 @@ scan_buffer (struct buffer *buf, Emchar target, Bufpos start, Bufpos end,
 }
 
 Bytind
-bi_find_next_newline_no_quit (struct buffer *buf, Bytind from, int count)
+bi_find_next_newline_no_quit (struct buffer *buf, Bytind from, int cnt)
 {
-  return bi_scan_buffer (buf, '\n', from, 0, count, 0, 0);
+  return bi_scan_buffer (buf, '\n', from, 0, cnt, 0, 0);
 }
 
 Bufpos
-find_next_newline_no_quit (struct buffer *buf, Bufpos from, int count)
+find_next_newline_no_quit (struct buffer *buf, Bufpos from, int cnt)
 {
-  return scan_buffer (buf, '\n', from, 0, count, 0, 0);
+  return scan_buffer (buf, '\n', from, 0, cnt, 0, 0);
 }
 
 Bufpos
-find_next_newline (struct buffer *buf, Bufpos from, int count)
+find_next_newline (struct buffer *buf, Bufpos from, int cnt)
 {
-  return scan_buffer (buf, '\n', from, 0, count, 0, 1);
+  return scan_buffer (buf, '\n', from, 0, cnt, 0, 1);
 }
 
 /* Like find_next_newline, but returns position before the newline,
    not after, and only search up to TO.  This isn't just
    find_next_newline (...)-1, because you might hit TO.  */
 Bufpos
-find_before_next_newline (struct buffer *buf, Bufpos from, Bufpos to, int count)
+find_before_next_newline (struct buffer *buf, Bufpos from, Bufpos to, int cnt)
 {
   EMACS_INT shortage;
-  Bufpos pos = scan_buffer (buf, '\n', from, to, count, &shortage, 1);
+  Bufpos pos = scan_buffer (buf, '\n', from, to, cnt, &shortage, 1);
 
   if (shortage == 0)
     pos--;
@@ -729,21 +730,20 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp,
   REGISTER int i;
   struct Lisp_Char_Table *syntax_table =
     XCHAR_TABLE (buf->mirror_syntax_table);
-  Bufpos limit;
+
+  CHECK_STRING (string);
 
   if (NILP (lim))
-    limit = forwardp ? BUF_ZV (buf) : BUF_BEGV (buf);
+    XSETINT (lim, forwardp ? BUF_ZV (buf) : BUF_BEGV (buf));
   else
-    {
-      CHECK_INT_COERCE_MARKER (lim);
-      limit = XINT (lim);
+    CHECK_INT_COERCE_MARKER (lim);
 
-      /* In any case, don't allow scan outside bounds of buffer.  */
-      if (limit > BUF_ZV   (buf)) limit = BUF_ZV   (buf);
-      if (limit < BUF_BEGV (buf)) limit = BUF_BEGV (buf);
-    }
+  /* In any case, don't allow scan outside bounds of buffer.  */
+  if (XINT (lim) > BUF_ZV (buf))
+    lim = make_int (BUF_ZV (buf));
+  if (XINT (lim) < BUF_BEGV (buf))
+    lim = make_int (BUF_BEGV (buf));
 
-  CHECK_STRING (string);
   p = XSTRING_DATA (string);
   pend = p + XSTRING_LENGTH (string);
   memset (fastmap, 0, sizeof (fastmap));
@@ -828,7 +828,7 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp,
           to worry about */
        if (forwardp)
          {
-           while (BUF_PT (buf) < limit
+           while (BUF_PT (buf) < XINT (lim)
                   && fastmap[(unsigned char)
                               syntax_code_spec
                              [(int) SYNTAX (syntax_table,
@@ -838,7 +838,7 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp,
          }
        else
          {
-           while (BUF_PT (buf) > limit
+           while (BUF_PT (buf) > XINT (lim)
                   && fastmap[(unsigned char)
                               syntax_code_spec
                              [(int) SYNTAX (syntax_table,
@@ -851,7 +851,7 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp,
       {
        if (forwardp)
          {
-           while (BUF_PT (buf) < limit)
+           while (BUF_PT (buf) < XINT (lim))
              {
                Emchar ch = BUF_FETCH_CHAR (buf, BUF_PT (buf));
                if ((ch < 0400) ? fastmap[ch] :
@@ -866,7 +866,7 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp,
          }
        else
          {
-           while (BUF_PT (buf) > limit)
+           while (BUF_PT (buf) > XINT (lim))
              {
                Emchar ch = BUF_FETCH_CHAR (buf, BUF_PT (buf) - 1);
                if ((ch < 0400) ? fastmap[ch] :
@@ -1383,7 +1383,7 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos,
                               (EMACS_UINT) p_limit)
                          cursor += BM_tab[*cursor];
                    }
- /* If you are here, cursor is beyond the end of the searched region. */
+/* If you are here, cursor is beyond the end of the searched region. */
  /* This can happen if you match on the far character of the pattern, */
  /* because the "stride" of that character is infinity, a number able */
  /* to throw you well beyond the end of the search.  It can also */
@@ -1837,7 +1837,7 @@ and you do not need to specify it.)
   case_action = nochange;      /* We tried an initialization */
                                /* but some C compilers blew it */
 
-  if (search_regs.num_regs == 0)
+  if (search_regs.num_regs <= 0)
     error ("replace-match called before any match found");
 
   if (NILP (string))
@@ -1963,7 +1963,7 @@ and you do not need to specify it.)
              Charcount subend   = -1;
 
              c = string_char (XSTRING (newtext), strpos);
-             if (c == '\\' && strpos < stlen - 1)
+             if (c == '\\')
                {
                  c = string_char (XSTRING (newtext), ++strpos);
                  if (c == '&')
@@ -2109,7 +2109,7 @@ and you do not need to specify it.)
          Charcount offset = BUF_PT (buf) - search_regs.start[0];
 
          c = string_char (XSTRING (newtext), strpos);
-         if (c == '\\' && strpos < stlen - 1)
+         if (c == '\\')
            {
              c = string_char (XSTRING (newtext), ++strpos);
              if (c == '&')
@@ -2219,7 +2219,7 @@ match_limit (Lisp_Object num, int beginningp)
   n = XINT (num);
   if (n < 0 || n >= search_regs.num_regs)
     args_out_of_range (num, make_int (search_regs.num_regs));
-  if (search_regs.num_regs == 0 ||
+  if (search_regs.num_regs <= 0 ||
       search_regs.start[n] < 0)
     return Qnil;
   return make_int (beginningp ? search_regs.start[n] : search_regs.end[n]);
@@ -2310,7 +2310,7 @@ to hold all the values, and if INTEGERS is non-nil, no consing is done.
 
   /* If REUSE is a list, store as many value elements as will fit
      into the elements of REUSE.  */
-  for (prev = Qnil, i = 0, tail = reuse; CONSP (tail); i++, tail = XCDR (tail))
+  for (i = 0, tail = reuse; CONSP (tail); i++, tail = XCDR (tail))
     {
       if (i < 2 * len + 2)
        XCAR (tail) = data[i];
index 8c70d02..1ecc2d0 100644 (file)
@@ -56,7 +56,8 @@ Boston, MA 02111-1307, USA.  */
 
 #include "buffer.h"            /* for Vbuffer_defaults */
 #include "console.h"
-#include "elhash.h"
+
+#include "elhash.h"            /* for HASHTABLE_NONWEAK and HASHTABLE_EQ */
 
 Lisp_Object Qad_advice_info, Qad_activate;
 
@@ -65,8 +66,7 @@ Lisp_Object Qlocal_predicate, Qmake_local;
 
 Lisp_Object Qboundp, Qfboundp, Qglobally_boundp, Qmakunbound;
 Lisp_Object Qsymbol_value, Qset, Qdefault_boundp, Qdefault_value;
-Lisp_Object Qset_default, Qsetq_default;
-Lisp_Object Qmake_variable_buffer_local, Qmake_local_variable;
+Lisp_Object Qset_default, Qmake_variable_buffer_local, Qmake_local_variable;
 Lisp_Object Qkill_local_variable, Qkill_console_local_variable;
 Lisp_Object Qsymbol_value_in_buffer, Qsymbol_value_in_console;
 Lisp_Object Qlocal_variable_p;
@@ -80,10 +80,12 @@ static Lisp_Object maybe_call_magic_handler (Lisp_Object sym,
                                             Lisp_Object funsym,
                                             int nargs, ...);
 static Lisp_Object fetch_value_maybe_past_magic (Lisp_Object sym,
-                                                Lisp_Object follow_past_lisp_magic);
+                                                Lisp_Object
+                                                follow_past_lisp_magic);
 static Lisp_Object *value_slot_past_magic (Lisp_Object sym);
-static Lisp_Object follow_varalias_pointers (Lisp_Object symbol,
-                                            Lisp_Object follow_past_lisp_magic);
+static Lisp_Object follow_varalias_pointers (Lisp_Object object,
+                                            Lisp_Object
+                                            follow_past_lisp_magic);
 
 \f
 #ifdef LRECORD_SYMBOL
@@ -94,17 +96,17 @@ mark_symbol (Lisp_Object obj, void (*markobj) (Lisp_Object))
   struct Lisp_Symbol *sym = XSYMBOL (obj);
   Lisp_Object pname;
 
-  markobj (sym->value);
-  markobj (sym->function);
+  ((markobj) (sym->value));
+  ((markobj) (sym->function));
   /* No need to mark through ->obarray, because it only holds nil or t.  */
-  /* markobj (sym->obarray);*/
+  /*((markobj) (sym->obarray));*/
   XSETSTRING (pname, sym->name);
-  markobj (pname);
+  ((markobj) (pname));
   if (!symbol_next (sym))
     return sym->plist;
   else
   {
-    markobj (sym->plist);
+    ((markobj) (sym->plist));
     /* Mark the rest of the symbols in the obarray hash-chain */
     sym = symbol_next (sym);
     XSETSYMBOL (obj, sym);
@@ -148,22 +150,18 @@ check_obarray (Lisp_Object obarray)
 Lisp_Object
 intern (CONST char *str)
 {
+  Lisp_Object tem;
   Bytecount len = strlen (str);
-  CONST Bufbyte *buf = (CONST Bufbyte *) str;
   Lisp_Object obarray = Vobarray;
-
   if (!VECTORP (obarray) || XVECTOR_LENGTH (obarray) == 0)
     obarray = check_obarray (obarray);
+  tem = oblookup (obarray, (CONST Bufbyte *) str, len);
 
-  {
-    Lisp_Object tem = oblookup (obarray, buf, len);
-    if (SYMBOLP (tem))
-      return tem;
-  }
-
-  return Fintern ((purify_flag
-                  ? make_pure_pname (buf, len, 0)
-                  : make_string (buf, len)),
+  if (SYMBOLP (tem))
+    return tem;
+  return Fintern (((purify_flag)
+                  ? make_pure_pname ((CONST Bufbyte *) str, len, 0)
+                  : make_string ((CONST Bufbyte *) str, len)),
                  obarray);
 }
 
@@ -173,7 +171,7 @@ If there is none, one is created by this function and returned.
 A second optional argument specifies the obarray to use;
 it defaults to the value of `obarray'.
 */
-       (string, obarray))
+       (str, obarray))
 {
   Lisp_Object sym, *ptr;
   Bytecount len;
@@ -181,19 +179,19 @@ it defaults to the value of `obarray'.
   if (NILP (obarray)) obarray = Vobarray;
   obarray = check_obarray (obarray);
 
-  CHECK_STRING (string);
+  CHECK_STRING (str);
 
-  len = XSTRING_LENGTH (string);
-  sym = oblookup (obarray, XSTRING_DATA (string), len);
+  len = XSTRING_LENGTH (str);
+  sym = oblookup (obarray, XSTRING_DATA (str), len);
   if (!INTP (sym))
     /* Found it */
     return sym;
 
   ptr = &XVECTOR_DATA (obarray)[XINT (sym)];
 
-  if (purify_flag && ! purified (string))
-    string = make_pure_pname (XSTRING_DATA (string), len, 0);
-  sym = Fmake_symbol (string);
+  if (purify_flag && ! purified (str))
+    str = make_pure_pname (XSTRING_DATA (str), len, 0);
+  sym = Fmake_symbol (str);
   /* FSFmacs places OBARRAY here, but it is pointless because we do
      not mark through this slot, so it is not usable later (because
      the obarray might have been collected).  Marking through the
@@ -219,17 +217,19 @@ Return the canonical symbol whose name is STRING, or nil if none exists.
 A second optional argument specifies the obarray to use;
 it defaults to the value of `obarray'.
 */
-       (string, obarray))
+       (str, obarray))
 {
   Lisp_Object tem;
 
   if (NILP (obarray)) obarray = Vobarray;
   obarray = check_obarray (obarray);
 
-  CHECK_STRING (string);
+  CHECK_STRING (str);
 
-  tem = oblookup (obarray, XSTRING_DATA (string), XSTRING_LENGTH (string));
-  return !INTP (tem) ? tem : Qnil;
+  tem = oblookup (obarray, XSTRING_DATA (str), XSTRING_LENGTH (str));
+  if (!INTP (tem))
+    return tem;
+  return Qnil;
 }
 \f
 DEFUN ("unintern", Funintern, 1, 2, 0, /*
@@ -293,7 +293,7 @@ OBARRAY defaults to the value of the variable `obarray'
 \f
 /* Return the symbol in OBARRAY whose names matches the string
    of SIZE characters at PTR.  If there is no such symbol in OBARRAY,
-   return the index into OBARRAY that the string hashes to.
+   return nil.
 
    Also store the bucket number in oblookup_last_bucket_number.  */
 
@@ -315,9 +315,11 @@ oblookup (Lisp_Object obarray, CONST Bufbyte *ptr, Bytecount size)
   /* This is sometimes needed in the middle of GC.  */
   obsize &= ~ARRAY_MARK_FLAG;
 #endif
-  hash = hash_string (ptr, size) % obsize;
-  oblookup_last_bucket_number = hash;
+  /* Combining next two lines breaks VMS C 2.3.         */
+  hash = hash_string (ptr, size);
+  hash %= obsize;
   bucket = XVECTOR_DATA (obarray)[hash];
+  oblookup_last_bucket_number = hash;
   if (ZEROP (bucket))
     ;
   else if (!SYMBOLP (bucket))
@@ -482,29 +484,29 @@ static void set_up_buffer_local_cache (Lisp_Object sym,
 DEFUN ("boundp", Fboundp, 1, 1, 0, /*
 Return t if SYMBOL's value is not void.
 */
-       (symbol))
+       (sym))
 {
-  CHECK_SYMBOL (symbol);
-  return UNBOUNDP (find_symbol_value (symbol)) ? Qnil : Qt;
+  CHECK_SYMBOL (sym);
+  return UNBOUNDP (find_symbol_value (sym)) ? Qnil : Qt;
 }
 
 DEFUN ("globally-boundp", Fglobally_boundp, 1, 1, 0, /*
 Return t if SYMBOL has a global (non-bound) value.
 This is for the byte-compiler; you really shouldn't be using this.
 */
-       (symbol))
+       (sym))
 {
-  CHECK_SYMBOL (symbol);
-  return UNBOUNDP (top_level_value (symbol)) ? Qnil : Qt;
+  CHECK_SYMBOL (sym);
+  return UNBOUNDP (top_level_value (sym)) ? Qnil : Qt;
 }
 
 DEFUN ("fboundp", Ffboundp, 1, 1, 0, /*
 Return t if SYMBOL's function definition is not void.
 */
-       (symbol))
+       (sym))
 {
-  CHECK_SYMBOL (symbol);
-  return UNBOUNDP (XSYMBOL (symbol)->function) ? Qnil : Qt;
+  CHECK_SYMBOL (sym);
+  return UNBOUNDP (XSYMBOL (sym)->function) ? Qnil : Qt;
 }
 
 /* Return non-zero if SYM's value or function (the current contents of
@@ -535,7 +537,7 @@ symbol_is_constant (Lisp_Object sym, Lisp_Object val)
       }
 
   /* We don't return true for keywords here because they are handled
-     specially by reject_constant_symbols().  */
+       specially by reject_constant_symbols().  */
   return 0;
 }
 
@@ -544,7 +546,7 @@ symbol_is_constant (Lisp_Object sym, Lisp_Object val)
    FOLLOW_PAST_LISP_MAGIC specifies whether we delve past
    symbol-value-lisp-magic objects.  */
 
-void
+static void
 reject_constant_symbols (Lisp_Object sym, Lisp_Object newval, int function_p,
                         Lisp_Object follow_past_lisp_magic)
 {
@@ -601,21 +603,21 @@ verify_ok_for_buffer_local (Lisp_Object sym,
 DEFUN ("makunbound", Fmakunbound, 1, 1, 0, /*
 Make SYMBOL's value be void.
 */
-       (symbol))
+       (sym))
 {
-  Fset (symbol, Qunbound);
-  return symbol;
+  Fset (sym, Qunbound);
+  return sym;
 }
 
 DEFUN ("fmakunbound", Ffmakunbound, 1, 1, 0, /*
 Make SYMBOL's function definition be void.
 */
-       (symbol))
+       (sym))
 {
-  CHECK_SYMBOL (symbol);
-  reject_constant_symbols (symbol, Qunbound, 1, Qt);
-  XSYMBOL (symbol)->function = Qunbound;
-  return symbol;
+  CHECK_SYMBOL (sym);
+  reject_constant_symbols (sym, Qunbound, 1, Qt);
+  XSYMBOL (sym)->function = Qunbound;
+  return sym;
 }
 
 DEFUN ("symbol-function", Fsymbol_function, 1, 1, 0, /*
@@ -625,49 +627,49 @@ Return SYMBOL's function definition.  Error if that is void.
 {
   CHECK_SYMBOL (symbol);
   if (UNBOUNDP (XSYMBOL (symbol)->function))
-    signal_void_function_error (symbol);
+    return Fsignal (Qvoid_function, list1 (symbol));
   return XSYMBOL (symbol)->function;
 }
 
 DEFUN ("symbol-plist", Fsymbol_plist, 1, 1, 0, /*
 Return SYMBOL's property list.
 */
-       (symbol))
+       (sym))
 {
-  CHECK_SYMBOL (symbol);
-  return XSYMBOL (symbol)->plist;
+  CHECK_SYMBOL (sym);
+  return XSYMBOL (sym)->plist;
 }
 
 DEFUN ("symbol-name", Fsymbol_name, 1, 1, 0, /*
 Return SYMBOL's name, a string.
 */
-       (symbol))
+       (sym))
 {
   Lisp_Object name;
 
-  CHECK_SYMBOL (symbol);
-  XSETSTRING (name, XSYMBOL (symbol)->name);
+  CHECK_SYMBOL (sym);
+  XSETSTRING (name, XSYMBOL (sym)->name);
   return name;
 }
 
 DEFUN ("fset", Ffset, 2, 2, 0, /*
 Set SYMBOL's function definition to NEWDEF, and return NEWDEF.
 */
-       (symbol, newdef))
+       (sym, newdef))
 {
   /* This function can GC */
-  CHECK_SYMBOL (symbol);
-  reject_constant_symbols (symbol, newdef, 1, Qt);
-  if (!NILP (Vautoload_queue) && !UNBOUNDP (XSYMBOL (symbol)->function))
-    Vautoload_queue = Fcons (Fcons (symbol, XSYMBOL (symbol)->function),
+  CHECK_SYMBOL (sym);
+  reject_constant_symbols (sym, newdef, 1, Qt);
+  if (!NILP (Vautoload_queue) && !UNBOUNDP (XSYMBOL (sym)->function))
+    Vautoload_queue = Fcons (Fcons (sym, XSYMBOL (sym)->function),
                             Vautoload_queue);
-  XSYMBOL (symbol)->function = newdef;
+  XSYMBOL (sym)->function = newdef;
   /* Handle automatic advice activation */
-  if (CONSP (XSYMBOL (symbol)->plist) &&
-      !NILP (Fget (symbol, Qad_advice_info, Qnil)))
+  if (CONSP (XSYMBOL (sym)->plist) && !NILP (Fget (sym, Qad_advice_info,
+                                                  Qnil)))
     {
-      call2 (Qad_activate, symbol, Qnil);
-      newdef = XSYMBOL (symbol)->function;
+      call2 (Qad_activate, sym, Qnil);
+      newdef = XSYMBOL (sym)->function;
     }
   return newdef;
 }
@@ -677,11 +679,12 @@ DEFUN ("define-function", Fdefine_function, 2, 2, 0, /*
 Set SYMBOL's function definition to NEWDEF, and return NEWDEF.
 Associates the function with the current load file, if any.
 */
-       (symbol, newdef))
+       (sym, newdef))
 {
   /* This function can GC */
-  Ffset (symbol, newdef);
-  LOADHIST_ATTACH (symbol);
+  CHECK_SYMBOL (sym);
+  Ffset (sym, newdef);
+  LOADHIST_ATTACH (sym);
   return newdef;
 }
 
@@ -689,16 +692,16 @@ Associates the function with the current load file, if any.
 DEFUN ("setplist", Fsetplist, 2, 2, 0, /*
 Set SYMBOL's property list to NEWPLIST, and return NEWPLIST.
 */
-       (symbol, newplist))
+       (sym, newplist))
 {
-  CHECK_SYMBOL (symbol);
+  CHECK_SYMBOL (sym);
 #if 0 /* Inserted for debugging 6/28/1997 -slb */
   /* Somebody is setting a property list of integer 0, who? */
   /* Not this way apparently. */
   if (EQ(newplist, Qzero)) abort();
 #endif
 
-  XSYMBOL (symbol)->plist = newplist;
+  XSYMBOL (sym)->plist = newplist;
   return newplist;
 }
 
@@ -716,7 +719,7 @@ Set SYMBOL's property list to NEWPLIST, and return NEWPLIST.
    If a symbol is "unbound", then the contents of its value cell is
    Qunbound.  Despite appearances, this is *not* a symbol, but is a
    symbol-value-forward object.  This is so that printing it results
-   in "INTERNAL OBJECT (XEmacs bug?)", in case it leaks to Lisp, somehow.
+   in "INTERNAL EMACS BUG", in case it leaks to Lisp, somehow.
 
    Logically all of the following objects are "symbol-value-magic"
    objects, and there are some games played w.r.t. this (#### this
@@ -897,15 +900,13 @@ mark_symbol_value_buffer_local (Lisp_Object obj,
 {
   struct symbol_value_buffer_local *bfwd;
 
-#ifdef ERROR_CHECK_TYPECHECK
   assert (XSYMBOL_VALUE_MAGIC_TYPE (obj) == SYMVAL_BUFFER_LOCAL ||
          XSYMBOL_VALUE_MAGIC_TYPE (obj) == SYMVAL_SOME_BUFFER_LOCAL);
-#endif
 
   bfwd = XSYMBOL_VALUE_BUFFER_LOCAL (obj);
-  markobj (bfwd->default_value);
-  markobj (bfwd->current_value);
-  markobj (bfwd->current_buffer);
+  ((markobj) (bfwd->default_value));
+  ((markobj) (bfwd->current_value));
+  ((markobj) (bfwd->current_buffer));
   return bfwd->current_alist_element;
 }
 
@@ -921,8 +922,8 @@ mark_symbol_value_lisp_magic (Lisp_Object obj,
   bfwd = XSYMBOL_VALUE_LISP_MAGIC (obj);
   for (i = 0; i < MAGIC_HANDLER_MAX; i++)
     {
-      markobj (bfwd->handler[i]);
-      markobj (bfwd->harg[i]);
+      ((markobj) (bfwd->handler[i]));
+      ((markobj) (bfwd->harg[i]));
     }
   return bfwd->shadowed;
 }
@@ -936,7 +937,7 @@ mark_symbol_value_varalias (Lisp_Object obj,
   assert (XSYMBOL_VALUE_MAGIC_TYPE (obj) == SYMVAL_VARALIAS);
 
   bfwd = XSYMBOL_VALUE_VARALIAS (obj);
-  markobj (bfwd->shadowed);
+  ((markobj) (bfwd->shadowed));
   return bfwd->aliasee;
 }
 
@@ -946,10 +947,10 @@ print_symbol_value_magic (Lisp_Object obj,
                          Lisp_Object printcharfun, int escapeflag)
 {
   char buf[200];
-  sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (%s type %d) 0x%lx>",
+  sprintf (buf, "#<INTERNAL EMACS BUG (%s type %d) 0x%p>",
           XRECORD_LHEADER_IMPLEMENTATION (obj)->name,
           XSYMBOL_VALUE_MAGIC_TYPE (obj),
-          (long) XPNTR (obj));
+          (void *) XPNTR (obj));
   write_c_string (buf, printcharfun);
 }
 
@@ -1080,16 +1081,16 @@ set_default_buffer_slot_variable (Lisp_Object sym,
 
   if (mask > 0)                /* Not always per-buffer */
     {
-      Lisp_Object elt;
+      Lisp_Object tail;
 
       /* Set value in each buffer which hasn't shadowed the default */
-      LIST_LOOP_2 (elt, Vbuffer_alist)
+      LIST_LOOP (tail, Vbuffer_alist)
        {
-         struct buffer *b = XBUFFER (XCDR (elt));
+         struct buffer *b = XBUFFER (XCDR (XCAR (tail)));
          if (!(b->local_var_flags & mask))
            {
              if (magicfun)
-               magicfun (sym, &value, make_buffer (b), 0);
+               (magicfun) (sym, &value, make_buffer (b), 0);
              *((Lisp_Object *) (offset + (char *) b)) = value;
            }
        }
@@ -1122,16 +1123,17 @@ set_default_console_slot_variable (Lisp_Object sym,
 
   if (mask > 0)                /* Not always per-console */
     {
-      Lisp_Object console;
+      Lisp_Object tail;
 
       /* Set value in each console which hasn't shadowed the default */
-      LIST_LOOP_2 (console, Vconsole_list)
+      LIST_LOOP (tail, Vconsole_list)
        {
-         struct console *d = XCONSOLE (console);
+         Lisp_Object dev = XCAR (tail);
+         struct console *d = XCONSOLE (dev);
          if (!(d->local_var_flags & mask))
            {
              if (magicfun)
-               magicfun (sym, &value, console, 0);
+               (magicfun) (sym, &value, dev, 0);
              *((Lisp_Object *) (offset + (char *) d)) = value;
            }
        }
@@ -1173,60 +1175,77 @@ store_symval_forwarding (Lisp_Object sym, Lisp_Object ovalue,
              || !SYMBOL_VALUE_MAGIC_P (*store_pointer));
       *store_pointer = newval;
     }
+
   else
     {
-      CONST struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (ovalue);
+      CONST struct symbol_value_forward *fwd
+       = XSYMBOL_VALUE_FORWARD (ovalue);
+      int type = XSYMBOL_VALUE_MAGIC_TYPE (ovalue);
       int (*magicfun) (Lisp_Object simm, Lisp_Object *val,
-                      Lisp_Object in_object, int flags)
-       = symbol_value_forward_magicfun (fwd);
+                      Lisp_Object in_object, int flags) =
+                        symbol_value_forward_magicfun (fwd);
 
-      switch (XSYMBOL_VALUE_MAGIC_TYPE (ovalue))
+      switch (type)
        {
        case SYMVAL_FIXNUM_FORWARD:
-         CHECK_INT (newval);
-         if (magicfun)
-           magicfun (sym, &newval, Qnil, 0);
-         *((int *) symbol_value_forward_forward (fwd)) = XINT (newval);
-         return;
+         {
+           CHECK_INT (newval);
+           if (magicfun)
+             (magicfun) (sym, &newval, Qnil, 0);
+           *((int *) symbol_value_forward_forward (fwd)) = XINT (newval);
+           return;
+         }
 
        case SYMVAL_BOOLEAN_FORWARD:
-         if (magicfun)
-           magicfun (sym, &newval, Qnil, 0);
-         *((int *) symbol_value_forward_forward (fwd))
-           = ((NILP (newval)) ? 0 : 1);
-         return;
+         {
+           if (magicfun)
+             (magicfun) (sym, &newval, Qnil, 0);
+           *((int *) symbol_value_forward_forward (fwd))
+             = ((NILP (newval)) ? 0 : 1);
+           return;
+         }
 
        case SYMVAL_OBJECT_FORWARD:
-         if (magicfun)
-           magicfun (sym, &newval, Qnil, 0);
-         *((Lisp_Object *) symbol_value_forward_forward (fwd)) = newval;
-         return;
+         {
+           if (magicfun)
+             (magicfun) (sym, &newval, Qnil, 0);
+           *((Lisp_Object *) symbol_value_forward_forward (fwd)) = newval;
+           return;
+         }
 
        case SYMVAL_DEFAULT_BUFFER_FORWARD:
-         set_default_buffer_slot_variable (sym, newval);
-         return;
+         {
+           set_default_buffer_slot_variable (sym, newval);
+           return;
+         }
 
        case SYMVAL_CURRENT_BUFFER_FORWARD:
-         if (magicfun)
-           magicfun (sym, &newval, make_buffer (current_buffer), 0);
-         *((Lisp_Object *) ((char *) current_buffer
-                            + ((char *) symbol_value_forward_forward (fwd)
-                               - (char *) &buffer_local_flags)))
-           = newval;
-         return;
+         {
+           if (magicfun)
+             (magicfun) (sym, &newval, make_buffer (current_buffer), 0);
+           *((Lisp_Object *) ((char *) current_buffer
+                              + ((char *) symbol_value_forward_forward (fwd)
+                                 - (char *) &buffer_local_flags)))
+             = newval;
+           return;
+         }
 
        case SYMVAL_DEFAULT_CONSOLE_FORWARD:
-         set_default_console_slot_variable (sym, newval);
-         return;
+         {
+           set_default_console_slot_variable (sym, newval);
+           return;
+         }
 
        case SYMVAL_SELECTED_CONSOLE_FORWARD:
-         if (magicfun)
-           magicfun (sym, &newval, Vselected_console, 0);
-         *((Lisp_Object *) ((char *) XCONSOLE (Vselected_console)
-                            + ((char *) symbol_value_forward_forward (fwd)
-                               - (char *) &console_local_flags)))
-           = newval;
-         return;
+         {
+           if (magicfun)
+             (magicfun) (sym, &newval, Vselected_console, 0);
+           *((Lisp_Object *) ((char *) XCONSOLE (Vselected_console)
+                              + ((char *) symbol_value_forward_forward (fwd)
+                                 - (char *) &console_local_flags)))
+             = newval;
+           return;
+         }
 
        default:
          abort ();
@@ -1316,7 +1335,7 @@ set_up_buffer_local_cache (Lisp_Object sym,
   /* Retrieve the new alist element and new value. */
   if (NILP (new_alist_el)
       && set_it_p)
-    new_alist_el = buffer_local_alist_element (buf, sym, bfwd);
+  new_alist_el = buffer_local_alist_element (buf, sym, bfwd);
 
   if (NILP (new_alist_el))
     new_val = bfwd->default_value;
@@ -1441,7 +1460,7 @@ find_symbol_value_1 (Lisp_Object sym, struct buffer *buf,
            else if (NILP (symcons))
              {
                if (set_it_p)
-                 valcontents = assq_no_quit (sym, buf->local_var_alist);
+               valcontents = assq_no_quit (sym, buf->local_var_alist);
                if (NILP (valcontents))
                  valcontents = bfwd->default_value;
                else
@@ -1471,13 +1490,13 @@ symbol_value_in_buffer (Lisp_Object sym, Lisp_Object buffer)
 
   CHECK_SYMBOL (sym);
 
-  if (NILP (buffer))
-    buf = current_buffer;
-  else
+  if (!NILP (buffer))
     {
       CHECK_BUFFER (buffer);
       buf = XBUFFER (buffer);
     }
+  else
+    buf = current_buffer;
 
   return find_symbol_value_1 (sym, buf,
                              /* If it bombs out at startup due to a
@@ -1491,10 +1510,10 @@ symbol_value_in_console (Lisp_Object sym, Lisp_Object console)
 {
   CHECK_SYMBOL (sym);
 
-  if (NILP (console))
-    console = Vselected_console;
-  else
+  if (!NILP (console))
     CHECK_CONSOLE (console);
+  else
+    console = Vselected_console;
 
   return find_symbol_value_1 (sym, current_buffer, XCONSOLE (console), 0,
                              Qnil, 1);
@@ -1510,7 +1529,7 @@ find_symbol_value (Lisp_Object sym)
 {
   /* WARNING: This function can be called when current_buffer is 0
      and Vselected_console is Qnil, early in initialization. */
-  struct console *con;
+  struct console *dev;
   Lisp_Object valcontents;
 
   CHECK_SYMBOL (sym);
@@ -1520,17 +1539,17 @@ find_symbol_value (Lisp_Object sym)
     return valcontents;
 
   if (CONSOLEP (Vselected_console))
-    con = XCONSOLE (Vselected_console);
+    dev = XCONSOLE (Vselected_console);
   else
     {
       /* This can also get called while we're preparing to shutdown.
          #### What should really happen in that case?  Should we
          actually fix things so we can't get here in that case? */
       assert (!initialized || preparing_for_armageddon);
-      con = 0;
+      dev = 0;
     }
 
-  return find_symbol_value_1 (sym, current_buffer, con, 1, Qnil, 1);
+  return find_symbol_value_1 (sym, current_buffer, dev, 1, Qnil, 1);
 }
 
 /* This is an optimized function for quick lookup of buffer local symbols
@@ -1551,22 +1570,22 @@ find_symbol_value_quickly (Lisp_Object symbol_cons, int find_it_p)
 {
   /* WARNING: This function can be called when current_buffer is 0
      and Vselected_console is Qnil, early in initialization. */
-  struct console *con;
+  struct console *dev;
   Lisp_Object sym = find_it_p ? XCAR (symbol_cons) : symbol_cons;
 
   CHECK_SYMBOL (sym);
   if (CONSOLEP (Vselected_console))
-    con = XCONSOLE (Vselected_console);
+    dev = XCONSOLE (Vselected_console);
   else
     {
       /* This can also get called while we're preparing to shutdown.
          #### What should really happen in that case?  Should we
          actually fix things so we can't get here in that case? */
       assert (!initialized || preparing_for_armageddon);
-      con = 0;
+      dev = 0;
     }
 
-  return find_symbol_value_1 (sym, current_buffer, con, 1,
+  return find_symbol_value_1 (sym, current_buffer, dev, 1,
                              find_it_p ? symbol_cons : Qnil,
                              find_it_p);
 }
@@ -1574,12 +1593,12 @@ find_symbol_value_quickly (Lisp_Object symbol_cons, int find_it_p)
 DEFUN ("symbol-value", Fsymbol_value, 1, 1, 0, /*
 Return SYMBOL's value.  Error if that is void.
 */
-       (symbol))
+       (sym))
 {
-  Lisp_Object val = find_symbol_value (symbol);
+  Lisp_Object val = find_symbol_value (sym);
 
   if (UNBOUNDP (val))
-    return Fsignal (Qvoid_variable, list1 (symbol));
+    return Fsignal (Qvoid_variable, list1 (sym));
   else
     return val;
 }
@@ -1587,181 +1606,177 @@ Return SYMBOL's value.  Error if that is void.
 DEFUN ("set", Fset, 2, 2, 0, /*
 Set SYMBOL's value to NEWVAL, and return NEWVAL.
 */
-       (symbol, newval))
+       (sym, newval))
 {
   REGISTER Lisp_Object valcontents;
-  struct Lisp_Symbol *sym;
   /* remember, we're called by Fmakunbound() as well */
 
-  CHECK_SYMBOL (symbol);
+  CHECK_SYMBOL (sym);
 
  retry:
-  sym = XSYMBOL (symbol);
-  valcontents = sym->value;
-
-  if (EQ (symbol, Qnil) ||
-      EQ (symbol, Qt)   ||
-      SYMBOL_IS_KEYWORD (symbol))
-    reject_constant_symbols (symbol, newval, 0,
+  valcontents = XSYMBOL (sym)->value;
+  if (NILP (sym) || EQ (sym, Qt) || SYMBOL_VALUE_MAGIC_P (valcontents)
+      || SYMBOL_IS_KEYWORD (sym))
+    reject_constant_symbols (sym, newval, 0,
                             UNBOUNDP (newval) ? Qmakunbound : Qset);
-
-  if (!SYMBOL_VALUE_MAGIC_P (valcontents) || UNBOUNDP (valcontents))
+  else
     {
-      sym->value = newval;
+      XSYMBOL (sym)->value = newval;
       return newval;
     }
 
-  reject_constant_symbols (symbol, newval, 0,
-                          UNBOUNDP (newval) ? Qmakunbound : Qset);
-
  retry_2:
 
-  switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents))
+  if (SYMBOL_VALUE_MAGIC_P (valcontents))
     {
-    case SYMVAL_LISP_MAGIC:
-      {
-       Lisp_Object retval;
-
-       if (UNBOUNDP (newval))
-         retval = maybe_call_magic_handler (symbol, Qmakunbound, 0);
-       else
-         retval = maybe_call_magic_handler (symbol, Qset, 1, newval);
-       if (!UNBOUNDP (retval))
-         return newval;
-       valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed;
-       /* semi-change-o */
-       goto retry_2;
-      }
-
-    case SYMVAL_VARALIAS:
-      symbol = follow_varalias_pointers (symbol,
-                                        UNBOUNDP (newval)
-                                        ? Qmakunbound : Qset);
-      /* presto change-o! */
-      goto retry;
+      switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents))
+       {
+       case SYMVAL_LISP_MAGIC:
+         {
+           Lisp_Object retval;
 
-    case SYMVAL_FIXNUM_FORWARD:
-    case SYMVAL_BOOLEAN_FORWARD:
-    case SYMVAL_OBJECT_FORWARD:
-    case SYMVAL_DEFAULT_BUFFER_FORWARD:
-    case SYMVAL_DEFAULT_CONSOLE_FORWARD:
-      if (UNBOUNDP (newval))
-       signal_error (Qerror,
-                     list2 (build_string ("Cannot makunbound"), symbol));
-      break;
+           if (UNBOUNDP (newval))
+             retval = maybe_call_magic_handler (sym, Qmakunbound, 0);
+           else
+             retval = maybe_call_magic_handler (sym, Qset, 1, newval);
+           if (!UNBOUNDP (retval))
+             return newval;
+           valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed;
+           /* semi-change-o */
+           goto retry_2;
+         }
 
-      /* case SYMVAL_UNBOUND_MARKER: break; */
+       case SYMVAL_VARALIAS:
+         sym = follow_varalias_pointers (sym,
+                                         UNBOUNDP (newval)
+                                         ? Qmakunbound : Qset);
+         /* presto change-o! */
+         goto retry;
 
-    case SYMVAL_CURRENT_BUFFER_FORWARD:
-      {
-       CONST struct symbol_value_forward *fwd
-         = XSYMBOL_VALUE_FORWARD (valcontents);
-       int mask = XINT (*((Lisp_Object *)
-                          symbol_value_forward_forward (fwd)));
-       if (mask > 0)
-         /* Setting this variable makes it buffer-local */
-         current_buffer->local_var_flags |= mask;
-       break;
-      }
+       case SYMVAL_FIXNUM_FORWARD:
+       case SYMVAL_BOOLEAN_FORWARD:
+       case SYMVAL_OBJECT_FORWARD:
+       case SYMVAL_DEFAULT_BUFFER_FORWARD:
+       case SYMVAL_DEFAULT_CONSOLE_FORWARD:
+         if (UNBOUNDP (newval))
+           signal_error (Qerror,
+                         list2 (build_string ("Cannot makunbound"), sym));
+         break;
 
-    case SYMVAL_SELECTED_CONSOLE_FORWARD:
-      {
-       CONST struct symbol_value_forward *fwd
-         = XSYMBOL_VALUE_FORWARD (valcontents);
-       int mask = XINT (*((Lisp_Object *)
-                          symbol_value_forward_forward (fwd)));
-       if (mask > 0)
-         /* Setting this variable makes it console-local */
-         XCONSOLE (Vselected_console)->local_var_flags |= mask;
-       break;
-      }
+       case SYMVAL_UNBOUND_MARKER:
+         break;
 
-    case SYMVAL_BUFFER_LOCAL:
-    case SYMVAL_SOME_BUFFER_LOCAL:
-      {
-       /* If we want to examine or set the value and
-          CURRENT-BUFFER is current, we just examine or set
-          CURRENT-VALUE. If CURRENT-BUFFER is not current, we
-          store the current CURRENT-VALUE value into
-          CURRENT-ALIST- ELEMENT, then find the appropriate alist
-          element for the buffer now current and set up
-          CURRENT-ALIST-ELEMENT.  Then we set CURRENT-VALUE out
-          of that element, and store into CURRENT-BUFFER.
-
-          If we are setting the variable and the current buffer does
-          not have an alist entry for this variable, an alist entry is
-          created.
-
-          Note that CURRENT-VALUE can be a forwarding pointer.
-          Each time it is examined or set, forwarding must be
-          done. */
-       struct symbol_value_buffer_local *bfwd
-         = XSYMBOL_VALUE_BUFFER_LOCAL (valcontents);
-       int some_buffer_local_p =
-         (bfwd->magic.type == SYMVAL_SOME_BUFFER_LOCAL);
-       /* What value are we caching right now?  */
-       Lisp_Object aelt = bfwd->current_alist_element;
+       case SYMVAL_CURRENT_BUFFER_FORWARD:
+         {
+           CONST struct symbol_value_forward *fwd
+             = XSYMBOL_VALUE_FORWARD (valcontents);
+           int mask = XINT (*((Lisp_Object *)
+                               symbol_value_forward_forward (fwd)));
+           if (mask > 0)
+             /* Setting this variable makes it buffer-local */
+             current_buffer->local_var_flags |= mask;
+           break;
+         }
 
-       if (!NILP (bfwd->current_buffer) &&
-           current_buffer == XBUFFER (bfwd->current_buffer)
-           && ((some_buffer_local_p)
-               ? 1                /* doesn't automatically become local */
-               : !NILP (aelt) /* already local */
-               ))
+       case SYMVAL_SELECTED_CONSOLE_FORWARD:
          {
-           /* Cache is valid */
-           valcontents = bfwd->current_value;
+           CONST struct symbol_value_forward *fwd
+             = XSYMBOL_VALUE_FORWARD (valcontents);
+           int mask = XINT (*((Lisp_Object *)
+                               symbol_value_forward_forward (fwd)));
+           if (mask > 0)
+             /* Setting this variable makes it console-local */
+             XCONSOLE (Vselected_console)->local_var_flags |= mask;
+           break;
          }
-       else
+
+       case SYMVAL_BUFFER_LOCAL:
+       case SYMVAL_SOME_BUFFER_LOCAL:
          {
-           /* If the current buffer is not the buffer whose binding is
-              currently cached, or if it's a SYMVAL_BUFFER_LOCAL and
-              we're looking at the default value, the cache is invalid; we
-              need to write it out, and find the new CURRENT-ALIST-ELEMENT
-           */
-
-           /* Write out the cached value for the old buffer; copy it
-              back to its alist element.  This works if the current
-              buffer only sees the default value, too.  */
-           write_out_buffer_local_cache (symbol, bfwd);
-
-           /* Find the new value for CURRENT-ALIST-ELEMENT.  */
-           aelt = buffer_local_alist_element (current_buffer, symbol, bfwd);
-           if (NILP (aelt))
+           /* If we want to examine or set the value and
+              CURRENT-BUFFER is current, we just examine or set
+              CURRENT-VALUE. If CURRENT-BUFFER is not current, we
+              store the current CURRENT-VALUE value into
+              CURRENT-ALIST- ELEMENT, then find the appropriate alist
+              element for the buffer now current and set up
+              CURRENT-ALIST-ELEMENT.  Then we set CURRENT-VALUE out
+              of that element, and store into CURRENT-BUFFER.
+
+              If we are setting the variable and the current buffer does
+              not have an alist entry for this variable, an alist entry is
+              created.
+
+              Note that CURRENT-VALUE can be a forwarding pointer.
+              Each time it is examined or set, forwarding must be
+              done. */
+           struct symbol_value_buffer_local *bfwd
+             = XSYMBOL_VALUE_BUFFER_LOCAL (valcontents);
+           int some_buffer_local_p =
+             (bfwd->magic.type == SYMVAL_SOME_BUFFER_LOCAL);
+           /* What value are we caching right now?  */
+           Lisp_Object aelt = bfwd->current_alist_element;
+
+           if (!NILP (bfwd->current_buffer) &&
+               current_buffer == XBUFFER (bfwd->current_buffer)
+               && ((some_buffer_local_p)
+                   ? 1            /* doesn't automatically become local */
+                   : !NILP (aelt) /* already local */
+                   ))
              {
-               /* This buffer is still seeing the default value.  */
-               if (!some_buffer_local_p)
-                 {
-                   /* If it's a SYMVAL_BUFFER_LOCAL, give this buffer a
-                      new assoc for a local value and set
-                      CURRENT-ALIST-ELEMENT to point to that.  */
-                   aelt =
-                     do_symval_forwarding (bfwd->current_value,
-                                           current_buffer,
-                                           XCONSOLE (Vselected_console));
-                   aelt = Fcons (symbol, aelt);
-                   current_buffer->local_var_alist
-                     = Fcons (aelt, current_buffer->local_var_alist);
-                 }
-               else
+               /* Cache is valid */
+               valcontents = bfwd->current_value;
+             }
+           else
+             {
+               /* If the current buffer is not the buffer whose binding is
+                  currently cached, or if it's a SYMVAL_BUFFER_LOCAL and
+                  we're looking at the default value, the cache is invalid; we
+                  need to write it out, and find the new CURRENT-ALIST-ELEMENT
+                  */
+
+               /* Write out the cached value for the old buffer; copy it
+                  back to its alist element.  This works if the current
+                  buffer only sees the default value, too.  */
+               write_out_buffer_local_cache (sym, bfwd);
+
+               /* Find the new value for CURRENT-ALIST-ELEMENT.  */
+               aelt = buffer_local_alist_element (current_buffer, sym, bfwd);
+               if (NILP (aelt))
                  {
-                   /* If the variable is a SYMVAL_SOME_BUFFER_LOCAL,
-                      we're currently seeing the default value. */
-                   ;
+                   /* This buffer is still seeing the default value.  */
+                   if (!some_buffer_local_p)
+                     {
+                       /* If it's a SYMVAL_BUFFER_LOCAL, give this buffer a
+                          new assoc for a local value and set
+                          CURRENT-ALIST-ELEMENT to point to that.  */
+                       aelt =
+                         do_symval_forwarding (bfwd->current_value,
+                                               current_buffer,
+                                               XCONSOLE (Vselected_console));
+                       aelt = Fcons (sym, aelt);
+                       current_buffer->local_var_alist
+                         = Fcons (aelt, current_buffer->local_var_alist);
+                     }
+                   else
+                     {
+                       /* If the variable is a SYMVAL_SOME_BUFFER_LOCAL,
+                          we're currently seeing the default value. */
+                       ;
+                     }
                  }
+               /* 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);
+               valcontents = bfwd->current_value;
              }
-           /* 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);
-           valcontents = bfwd->current_value;
+           break;
          }
-       break;
-      }
-    default:
-      abort ();
+       default:
+         abort ();
+       }
     }
-  store_symval_forwarding (symbol, valcontents, newval);
+  store_symval_forwarding (sym, valcontents, newval);
 
   return newval;
 }
@@ -1843,7 +1858,7 @@ default_value (Lisp_Object sym)
                                   XCONSOLE (Vselected_console));
     }
 
-  RETURN_NOT_REACHED (Qnil)    /* suppress compiler warning */
+  RETURN_NOT_REACHED(Qnil)     /* suppress compiler warning */
 }
 
 DEFUN ("default-boundp", Fdefault_boundp, 1, 1, 0, /*
@@ -1851,9 +1866,9 @@ Return t if SYMBOL has a non-void default value.
 This is the value that is seen in buffers that do not have their own values
 for this variable.
 */
-       (symbol))
+       (sym))
 {
-  return UNBOUNDP (default_value (symbol)) ? Qnil : Qt;
+  return UNBOUNDP (default_value (sym)) ? Qnil : Qt;
 }
 
 DEFUN ("default-value", Fdefault_value, 1, 1, 0, /*
@@ -1862,11 +1877,11 @@ This is the value that is seen in buffers that do not have their own values
 for this variable.  The default value is meaningful for variables with
 local bindings in certain buffers.
 */
-       (symbol))
+       (sym))
 {
-  Lisp_Object value = default_value (symbol);
+  Lisp_Object value = default_value (sym);
 
-  return UNBOUNDP (value) ? Fsignal (Qvoid_variable, list1 (symbol)) : value;
+  return UNBOUNDP (value) ? Fsignal (Qvoid_variable, list1 (sym)) : value;
 }
 
 DEFUN ("set-default", Fset_default, 2, 2, 0, /*
@@ -1874,39 +1889,39 @@ Set SYMBOL's default value to VAL.  SYMBOL and VAL are evaluated.
 The default value is seen in buffers that do not have their own values
 for this variable.
 */
-       (symbol, value))
+       (sym, value))
 {
   Lisp_Object valcontents;
 
-  CHECK_SYMBOL (symbol);
+  CHECK_SYMBOL (sym);
 
  retry:
-  valcontents = XSYMBOL (symbol)->value;
+  valcontents = XSYMBOL (sym)->value;
 
  retry_2:
   if (!SYMBOL_VALUE_MAGIC_P (valcontents))
-    return Fset (symbol, value);
+    return Fset (sym, value);
 
   switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents))
     {
     case SYMVAL_LISP_MAGIC:
-      RETURN_IF_NOT_UNBOUND (maybe_call_magic_handler (symbol, Qset_default, 1,
+      RETURN_IF_NOT_UNBOUND (maybe_call_magic_handler (sym, Qset_default, 1,
                                                       value));
       valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed;
       /* semi-change-o */
       goto retry_2;
 
     case SYMVAL_VARALIAS:
-      symbol = follow_varalias_pointers (symbol, Qset_default);
+      sym = follow_varalias_pointers (sym, Qset_default);
       /* presto change-o! */
       goto retry;
 
     case SYMVAL_CURRENT_BUFFER_FORWARD:
-      set_default_buffer_slot_variable (symbol, value);
+      set_default_buffer_slot_variable (sym, value);
       return value;
 
     case SYMVAL_SELECTED_CONSOLE_FORWARD:
-      set_default_console_slot_variable (symbol, value);
+      set_default_console_slot_variable (sym, value);
       return value;
 
     case SYMVAL_BUFFER_LOCAL:
@@ -1920,48 +1935,50 @@ for this variable.
        /* If current-buffer doesn't shadow default_value,
         *  we must set the CURRENT-VALUE slot too */
        if (NILP (bfwd->current_alist_element))
-         store_symval_forwarding (symbol, bfwd->current_value, value);
+         store_symval_forwarding (sym, bfwd->current_value, value);
        return value;
       }
 
     default:
-      return Fset (symbol, value);
+      return Fset (sym, value);
     }
+  RETURN_NOT_REACHED(Qnil)     /* suppress compiler warning */
 }
 
-DEFUN ("setq-default", Fsetq_default, 0, UNEVALLED, 0, /*
-Set the default value of variable SYMBOL to VALUE.
-SYMBOL, the variable name, is literal (not evaluated);
+DEFUN ("setq-default", Fsetq_default, 2, UNEVALLED, 0, /*
+Set the default value of variable SYM to VALUE.
+SYM, the variable name, is literal (not evaluated);
 VALUE is an expression and it is evaluated.
 The default value of a variable is seen in buffers
 that do not have their own values for the variable.
 
 More generally, you can use multiple variables and values, as in
-  (setq-default SYMBOL VALUE SYMBOL VALUE...)
-This sets each SYMBOL's default value to the corresponding VALUE.
-The VALUE for the Nth SYMBOL can refer to the new default values
-of previous SYMBOLs.
+  (setq-default SYM VALUE SYM VALUE...)
+This sets each SYM's default value to the corresponding VALUE.
+The VALUE for the Nth SYM can refer to the new default values
+of previous SYMs.
 */
        (args))
 {
   /* This function can GC */
-  Lisp_Object symbol, tail, val = Qnil;
-  int nargs;
+  Lisp_Object args_left;
+  Lisp_Object val, sym;
   struct gcpro gcpro1;
 
-  GET_LIST_LENGTH (args, nargs);
-
-  if (nargs & 1)               /* Odd number of arguments? */
-    Fsignal (Qwrong_number_of_arguments,
-            list2 (Qsetq_default, make_int (nargs)));
+  if (NILP (args))
+    return Qnil;
 
-  GCPRO1 (val);
+  args_left = args;
+  GCPRO1 (args);
 
-  PROPERTY_LIST_LOOP (tail, symbol, val, args)
+  do
     {
-      val = Feval (val);
-      Fset_default (symbol, val);
+      val = Feval (Fcar (Fcdr (args_left)));
+      sym = Fcar (args_left);
+      Fset_default (sym, val);
+      args_left = Fcdr (Fcdr (args_left));
     }
+  while (!NILP (args_left));
 
   UNGCPRO;
   return val;
@@ -2362,7 +2379,7 @@ From now on the default value will apply in this console.
            Lisp_Object oldval = * (Lisp_Object *)
              (offset + (char *) XCONSOLE (Vconsole_defaults));
            if (magicfun)
-             magicfun (variable, &oldval, Vselected_console, 0);
+             (magicfun) (variable, &oldval, Vselected_console, 0);
            *(Lisp_Object *) (offset + (char *) XCONSOLE (Vselected_console))
              = oldval;
            XCONSOLE (Vselected_console)->local_var_flags &= ~mask;
@@ -2373,6 +2390,7 @@ From now on the default value will apply in this console.
     default:
       return variable;
     }
+  RETURN_NOT_REACHED(Qnil)     /* suppress compiler warning */
 }
 
 /* Used by specbind to determine what effects it might have.  Returns:
@@ -2446,7 +2464,10 @@ Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound.
   CHECK_SYMBOL (symbol);
   CHECK_BUFFER (buffer);
   value = symbol_value_in_buffer (symbol, buffer);
-  return UNBOUNDP (value) ? unbound_value : value;
+  if (UNBOUNDP (value))
+    return unbound_value;
+  else
+    return value;
 }
 
 DEFUN ("symbol-value-in-console", Fsymbol_value_in_console, 2, 3, 0, /*
@@ -2458,11 +2479,14 @@ Return the value of SYMBOL in CONSOLE, or UNBOUND-VALUE if it is unbound.
   CHECK_SYMBOL (symbol);
   CHECK_CONSOLE (console);
   value = symbol_value_in_console (symbol, console);
-  return UNBOUNDP (value) ? unbound_value : value;
+  if (UNBOUNDP (value))
+    return unbound_value;
+  else
+    return value;
 }
 
 DEFUN ("built-in-variable-type", Fbuilt_in_variable_type, 1, 1, 0, /*
-If SYMBOL is a built-in variable, return info about this; else return nil.
+If SYM is a built-in variable, return info about this; else return nil.
 The returned info will be a symbol, one of
 
 `object'               A simple built-in variable.
@@ -2481,56 +2505,85 @@ The returned info will be a symbol, one of
 `default-console'      Forwards to the default value of a built-in
                        console-local variable.
 */
-       (symbol))
+       (sym))
 {
   REGISTER Lisp_Object valcontents;
 
-  CHECK_SYMBOL (symbol);
+  CHECK_SYMBOL (sym);
 
  retry:
-  valcontents = XSYMBOL (symbol)->value;
-
+  valcontents = XSYMBOL (sym)->value;
  retry_2:
-  if (!SYMBOL_VALUE_MAGIC_P (valcontents))
-    return Qnil;
 
-  switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents))
+  if (SYMBOL_VALUE_MAGIC_P (valcontents))
     {
-    case SYMVAL_LISP_MAGIC:
-      valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed;
-      /* semi-change-o */
-      goto retry_2;
+      switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents))
+       {
+       case SYMVAL_LISP_MAGIC:
+         valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed;
+         /* semi-change-o */
+         goto retry_2;
 
-    case SYMVAL_VARALIAS:
-      symbol = follow_varalias_pointers (symbol, Qt);
-      /* presto change-o! */
-      goto retry;
+       case SYMVAL_VARALIAS:
+         sym = follow_varalias_pointers (sym, Qt);
+         /* presto change-o! */
+         goto retry;
 
-    case SYMVAL_BUFFER_LOCAL:
-    case SYMVAL_SOME_BUFFER_LOCAL:
-      valcontents =
-       XSYMBOL_VALUE_BUFFER_LOCAL (valcontents)->current_value;
-      /* semi-change-o */
-      goto retry_2;
+       case SYMVAL_BUFFER_LOCAL:
+       case SYMVAL_SOME_BUFFER_LOCAL:
+         valcontents =
+           XSYMBOL_VALUE_BUFFER_LOCAL (valcontents)->current_value;
+         /* semi-change-o */
+         goto retry_2;
+
+       case SYMVAL_FIXNUM_FORWARD:
+         return Qinteger;
 
-    case SYMVAL_FIXNUM_FORWARD:                        return Qinteger;
-    case SYMVAL_CONST_FIXNUM_FORWARD:          return Qconst_integer;
-    case SYMVAL_BOOLEAN_FORWARD:               return Qboolean;
-    case SYMVAL_CONST_BOOLEAN_FORWARD:         return Qconst_boolean;
-    case SYMVAL_OBJECT_FORWARD:                        return Qobject;
-    case SYMVAL_CONST_OBJECT_FORWARD:          return Qconst_object;
-    case SYMVAL_CONST_SPECIFIER_FORWARD:       return Qconst_specifier;
-    case SYMVAL_DEFAULT_BUFFER_FORWARD:                return Qdefault_buffer;
-    case SYMVAL_CURRENT_BUFFER_FORWARD:                return Qcurrent_buffer;
-    case SYMVAL_CONST_CURRENT_BUFFER_FORWARD:  return Qconst_current_buffer;
-    case SYMVAL_DEFAULT_CONSOLE_FORWARD:       return Qdefault_console;
-    case SYMVAL_SELECTED_CONSOLE_FORWARD:      return Qselected_console;
-    case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD: return Qconst_selected_console;
-    case SYMVAL_UNBOUND_MARKER:                        return Qnil;
+       case SYMVAL_CONST_FIXNUM_FORWARD:
+         return Qconst_integer;
 
-    default:
-      abort (); return Qnil;
+       case SYMVAL_BOOLEAN_FORWARD:
+         return Qboolean;
+
+       case SYMVAL_CONST_BOOLEAN_FORWARD:
+         return Qconst_boolean;
+
+       case SYMVAL_OBJECT_FORWARD:
+         return Qobject;
+
+       case SYMVAL_CONST_OBJECT_FORWARD:
+         return Qconst_object;
+
+       case SYMVAL_CONST_SPECIFIER_FORWARD:
+         return Qconst_specifier;
+
+       case SYMVAL_DEFAULT_BUFFER_FORWARD:
+         return Qdefault_buffer;
+
+       case SYMVAL_CURRENT_BUFFER_FORWARD:
+         return Qcurrent_buffer;
+
+       case SYMVAL_CONST_CURRENT_BUFFER_FORWARD:
+         return Qconst_current_buffer;
+
+       case SYMVAL_DEFAULT_CONSOLE_FORWARD:
+         return Qdefault_console;
+
+       case SYMVAL_SELECTED_CONSOLE_FORWARD:
+         return Qselected_console;
+
+       case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD:
+         return Qconst_selected_console;
+
+       case SYMVAL_UNBOUND_MARKER:
+         return Qnil;
+
+       default:
+         abort ();
+       }
     }
+
+  return Qnil;
 }
 
 
@@ -2583,7 +2636,7 @@ The interface and/or function name is sure to change before this
 gets into its final form.  I currently like the way everything is
 set up and it has all the features I want it to have, except for
 one: I really want to be able to have multiple nested handlers,
-to implement an `advice'-like capability.  This would allow,
+to implement an `advice'-like capabiility.  This would allow,
 for example, a clean way of implementing `debug-if-set' or
 `debug-if-referenced' and such.
 
@@ -2892,7 +2945,7 @@ pity, thereby invalidating your code.
 \f
 /* functions for working with variable aliases.  */
 
-/* Follow the chain of variable aliases for SYMBOL.  Return the
+/* Follow the chain of variable aliases for OBJECT.  Return the
    resulting symbol, whose value cell is guaranteed not to be a
    symbol-value-varalias.
 
@@ -2920,32 +2973,36 @@ pity, thereby invalidating your code.
  */
 
 static Lisp_Object
-follow_varalias_pointers (Lisp_Object symbol,
+follow_varalias_pointers (Lisp_Object object,
                          Lisp_Object follow_past_lisp_magic)
 {
-#define VARALIAS_INDIRECTION_SUSPICION_LENGTH 16
-  Lisp_Object tortoise, hare, val;
-  int count;
+  Lisp_Object tortoise = object;
+  Lisp_Object hare = object;
 
   /* quick out just in case */
-  if (!SYMBOL_VALUE_MAGIC_P (XSYMBOL (symbol)->value))
-    return symbol;
-
-  /* Compare implementation of indirect_function().  */
-  for (hare = tortoise = symbol, count = 0;
-       val = fetch_value_maybe_past_magic (hare, follow_past_lisp_magic),
-        SYMBOL_VALUE_VARALIAS_P (val);
-       hare = symbol_value_varalias_aliasee (XSYMBOL_VALUE_VARALIAS (val)),
-        count++)
+  if (!SYMBOL_VALUE_MAGIC_P (XSYMBOL (object)->value))
+    return object;
+
+  /* based off of indirect_function() */
+  for (;;)
     {
-      if (count < VARALIAS_INDIRECTION_SUSPICION_LENGTH) continue;
+      Lisp_Object value;
+
+      value = fetch_value_maybe_past_magic (hare, follow_past_lisp_magic);
+      if (!SYMBOL_VALUE_VARALIAS_P (value))
+       break;
+      hare = symbol_value_varalias_aliasee (XSYMBOL_VALUE_VARALIAS (value));
+      value = fetch_value_maybe_past_magic (hare, follow_past_lisp_magic);
+      if (!SYMBOL_VALUE_VARALIAS_P (value))
+       break;
+      hare = symbol_value_varalias_aliasee (XSYMBOL_VALUE_VARALIAS (value));
+
+      value = fetch_value_maybe_past_magic (tortoise, follow_past_lisp_magic);
+      tortoise = symbol_value_varalias_aliasee
+       (XSYMBOL_VALUE_VARALIAS (value));
 
-      if (count & 1)
-       tortoise = symbol_value_varalias_aliasee
-         (XSYMBOL_VALUE_VARALIAS (fetch_value_maybe_past_magic
-                                  (tortoise, follow_past_lisp_magic)));
       if (EQ (hare, tortoise))
-       return Fsignal (Qcyclic_variable_indirection, list1 (symbol));
+       return Fsignal (Qcyclic_variable_indirection, list1 (object));
     }
 
   return hare;
@@ -3090,13 +3147,13 @@ init_symbols_once_early (void)
 
 #ifndef Qnull_pointer
   /* C guarantees that Qnull_pointer will be initialized to all 0 bits,
-     so the following is actually a no-op.  */
+     so the following is a actually a no-op.  */
   XSETOBJ (Qnull_pointer, (enum Lisp_Type) 0, 0);
 #endif
 
   /* see comment in Fpurecopy() */
   Vpure_uninterned_symbol_table =
-    make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
+    make_lisp_hashtable (50, HASHTABLE_NONWEAK, HASHTABLE_EQ);
   staticpro (&Vpure_uninterned_symbol_table);
 
   Qnil = Fmake_symbol (make_pure_pname ((CONST Bufbyte *) "nil", 3, 1));
@@ -3158,16 +3215,17 @@ defkeyword (Lisp_Object *location, CONST char *name)
   Fset (*location, *location);
 }
 
-#ifdef DEBUG_XEMACS
-/* Check that nobody spazzed writing a DEFUN. */
-static void
-check_sane_subr (Lisp_Subr *subr, Lisp_Object sym)
+void
+defsubr (struct Lisp_Subr *subr)
 {
+  Lisp_Object sym = intern (subr_name (subr));
+
+#ifdef DEBUG_XEMACS
+  /* Check that nobody spazzed writing a DEFUN. */
   assert (subr->min_args >= 0);
   assert (subr->min_args <= SUBR_MAX_ARGS);
 
-  if (subr->max_args != MANY &&
-      subr->max_args != UNEVALLED)
+  if (subr->max_args != MANY && subr->max_args != UNEVALLED)
     {
       /* Need to fix lisp.h and eval.c if SUBR_MAX_ARGS too small */
       assert (subr->max_args <= SUBR_MAX_ARGS);
@@ -3175,75 +3233,9 @@ check_sane_subr (Lisp_Subr *subr, Lisp_Object sym)
     }
 
   assert (UNBOUNDP (XSYMBOL (sym)->function));
-}
-#else
-#define check_sane_subr(subr, sym) /* nothing */
-#endif
-
-#ifdef HAVE_SHLIB
-/*
- * If we are not in a pure undumped Emacs, we need to make a duplicate of
- * the subr. This is because the only time this function will be called
- * in a running Emacs is when a dynamically loaded module is adding a
- * subr, and we need to make sure that the subr is in allocated, Lisp-
- * accessible memory.  The address assigned to the static subr struct
- * in the shared object will be a trampoline address, so we need to create
- * a copy here to ensure that a real address is used.
- *
- * Once we have copied everything across, we re-use the original static
- * structure to store a pointer to the newly allocated one. This will be
- * used in emodules.c by emodules_doc_subr() to find a pointer to the
- * allocated object so that we can set its doc string propperly.
- *
- * NOTE: We dont actually use the DOC pointer here any more, but we did
- * in an earlier implementation of module support. There is no harm in
- * setting it here in case we ever need it in future implementations.
- * subr->doc will point to the new subr structure that was allocated.
- * Code can then get this value from the statis subr structure and use
- * it if required.
- *
- * FIXME: Should newsubr be staticpro()'ed? I dont think so but I need
- * a guru to check.
- */
-#define check_module_subr()                                             \
-do {                                                                    \
-  if (initialized) {                                                    \
-    struct Lisp_Subr *newsubr;                                          \
-    newsubr = (Lisp_Subr *)xmalloc(sizeof(struct Lisp_Subr));           \
-    memcpy (newsubr, subr, sizeof(struct Lisp_Subr));                   \
-    subr->doc = (CONST char *)newsubr;                                  \
-    subr = newsubr;                                                     \
-  }                                                                     \
-} while (0)
-#else /* ! HAVE_SHLIB */
-#define check_module_subr()
-#endif
+#endif /* DEBUG_XEMACS */
 
-void
-defsubr (Lisp_Subr *subr)
-{
-  Lisp_Object sym = intern (subr_name (subr));
-  Lisp_Object fun;
-
-  check_sane_subr (subr, sym);
-  check_module_subr ();
-
-  XSETSUBR (fun, subr);
-  XSYMBOL (sym)->function = fun;
-}
-
-/* Define a lisp macro using a Lisp_Subr. */
-void
-defsubr_macro (Lisp_Subr *subr)
-{
-  Lisp_Object sym = intern (subr_name (subr));
-  Lisp_Object fun;
-
-  check_sane_subr (subr, sym);
-  check_module_subr();
-
-  XSETSUBR (fun, subr);
-  XSYMBOL (sym)->function = Fcons (Qmacro, fun);
+  XSETSUBR (XSYMBOL (sym)->function, subr);
 }
 
 void
@@ -3283,7 +3275,6 @@ syms_of_symbols (void)
   defsymbol (&Qmakunbound, "makunbound");
   defsymbol (&Qsymbol_value, "symbol-value");
   defsymbol (&Qset, "set");
-  defsymbol (&Qsetq_default, "setq-default");
   defsymbol (&Qdefault_boundp, "default-boundp");
   defsymbol (&Qdefault_value, "default-value");
   defsymbol (&Qset_default, "set-default");
@@ -3322,7 +3313,6 @@ syms_of_symbols (void)
   DEFSUBR (Ffboundp);
   DEFSUBR (Ffset);
   DEFSUBR (Fdefine_function);
-  Ffset (intern ("defalias"), intern ("define-function"));
   DEFSUBR (Fsetplist);
   DEFSUBR (Fsymbol_value_in_buffer);
   DEFSUBR (Fsymbol_value_in_console);
@@ -3344,38 +3334,29 @@ syms_of_symbols (void)
   DEFSUBR (Fdontusethis_set_symbol_value_handler);
 }
 
-/* Create and initialize a Lisp variable whose value is forwarded to C data */
+/* Create and initialize a variable whose value is forwarded to C data */
 void
-defvar_magic (CONST char *symbol_name, CONST struct symbol_value_forward *magic)
+defvar_mumble (CONST char *namestring, CONST void *magic, size_t sizeof_magic)
 {
-  Lisp_Object sym, kludge;
+  Lisp_Object kludge;
+  Lisp_Object sym = Fintern (make_pure_pname ((CONST Bufbyte *) namestring,
+                                             strlen (namestring),
+                                             1),
+                            Qnil);
 
-  /* Check that `magic' points somewhere we can represent as a Lisp pointer */
+  /* Check that magic points somewhere we can represent as a Lisp pointer */
   XSETOBJ (kludge, Lisp_Type_Record, magic);
-  if ((void *)magic != (void*) XPNTR (kludge))
+  if (magic != (CONST void *) XPNTR (kludge))
     {
       /* This might happen on DATA_SEG_BITS machines. */
       /* abort (); */
       /* Copy it to somewhere which is representable. */
-      struct symbol_value_forward *p = xnew (struct symbol_value_forward);
-      memcpy (p, magic, sizeof *magic);
-      magic = p;
+      void *f = xmalloc (sizeof_magic);
+      memcpy (f, magic, sizeof_magic);
+      XSETOBJ (XSYMBOL (sym)->value, Lisp_Type_Record, f);
     }
-
-#if defined(HAVE_SHLIB)
-  /*
-   * As with defsubr(), this will only be called in a dumped Emacs when
-   * we are adding variables from a dynamically loaded module. That means
-   * we can't use purespace. Take that into account.
-   */
-  if (initialized)
-    sym = Fintern (build_string (symbol_name), Qnil);
   else
-#endif
-    sym = Fintern (make_pure_pname ((CONST Bufbyte *) symbol_name,
-                                    strlen (symbol_name), 1), Qnil);
-
-  XSETOBJ (XSYMBOL (sym)->value, Lisp_Type_Record, magic);
+    XSETOBJ (XSYMBOL (sym)->value, Lisp_Type_Record, magic);
 }
 
 void
index 7e05629..1b0b8f2 100644 (file)
@@ -68,6 +68,7 @@ void syms_of_dialog_x (void);
 void syms_of_dialog (void);
 void syms_of_dired (void);
 void syms_of_dired_mswindows (void);
+void syms_of_dll (void);
 void syms_of_doc (void);
 void syms_of_dragdrop (void);
 void syms_of_editfns (void);
@@ -92,7 +93,6 @@ void syms_of_free_hook (void);
 void syms_of_general (void);
 void syms_of_glyphs_x (void);
 void syms_of_glyphs_eimage (void);
-void syms_of_glyphs_widget (void);
 void syms_of_glyphs_mswindows (void);
 void syms_of_glyphs (void);
 void syms_of_gui_x (void);
@@ -108,7 +108,6 @@ void syms_of_menubar_x (void);
 void syms_of_menubar (void);
 void syms_of_menubar_mswindows (void);
 void syms_of_minibuf (void);
-void syms_of_module (void);
 void syms_of_mule (void);
 void syms_of_mule_canna (void);
 void syms_of_mule_ccl (void);
@@ -187,13 +186,12 @@ void structure_type_create (void);
 void structure_type_create_chartab (void);
 void structure_type_create_faces (void);
 void structure_type_create_rangetab (void);
-void structure_type_create_hash_table (void);
+void structure_type_create_hashtable (void);
 
 /* Initialize the image instantiator types (dump-time only). */
 
 void image_instantiator_format_create (void);
 void image_instantiator_format_create_glyphs_eimage (void);
-void image_instantiator_format_create_glyphs_widget (void);
 void image_instantiator_format_create_glyphs_x (void);
 void image_instantiator_format_create_glyphs_mswindows (void);
 
@@ -262,7 +260,6 @@ void vars_of_frame_x (void);
 void vars_of_frame (void);
 void vars_of_glyphs_x (void);
 void vars_of_glyphs_eimage (void);
-void vars_of_glyphs_widget (void);
 void vars_of_glyphs_mswindows (void);
 void vars_of_glyphs (void);
 void vars_of_gui_x (void);
@@ -281,7 +278,6 @@ void vars_of_menubar_x (void);
 void vars_of_menubar (void);
 void vars_of_menubar_mswindows (void);
 void vars_of_minibuf (void);
-void vars_of_module (void);
 void vars_of_mule (void);
 void vars_of_mule_canna (void);
 void vars_of_mule_charset (void);
index 33b396e..9a1d56b 100644 (file)
@@ -27,6 +27,8 @@ Boston, MA 02111-1307, USA.  */
 #include "lisp.h"
 
 #include "buffer.h"
+#include "commands.h"
+#include "insdel.h"
 #include "syntax.h"
 
 /* Here is a comment from Ken'ichi HANDA <handa@etl.go.jp>
@@ -394,12 +396,10 @@ scan_words (struct buffer *buf, Bufpos from, int count)
 }
 
 DEFUN ("forward-word", Fforward_word, 1, 2, "_p", /*
-Move point forward COUNT words (backward if COUNT is negative).
+Move point forward ARG words (backward if ARG is negative).
 Normally returns t.
 If an edge of the buffer is reached, point is left there
 and nil is returned.
-
-Optional argument BUFFER defaults to the current buffer.
 */
        (count, buffer))
 {
index e141eb0..9b66c7a 100644 (file)
@@ -89,7 +89,8 @@ INLINE int WORD_SYNTAX_P (struct Lisp_Char_Table *table, Emchar c);
 INLINE int
 WORD_SYNTAX_P (struct Lisp_Char_Table *table, Emchar c)
 {
-  return SYNTAX (table, c) == Sword;
+  int syncode = SYNTAX (table, c);
+  return syncode == Sword;
 }
 
 /* OK, here's a graphic diagram of the format of the syntax values:
index 9961950..40c2f02 100644 (file)
@@ -29,8 +29,10 @@ Boston, MA 02111-1307, USA.  */
 #include "console-x.h"
 #include "glyphs-x.h"
 #include "objects-x.h"
+#include "xgccache.h"
 #include "EmacsFrame.h"
 #include "EmacsFrameP.h"
+#include "EmacsManager.h"
 
 #include "faces.h"
 #include "frame.h"
@@ -504,9 +506,9 @@ x_output_toolbar (struct frame *f, enum toolbar_pos pos)
       Lisp_Object frame;
 
       XSETFRAME (frame, f);
-      redisplay_clear_region (frame,
-                             DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1,
-                             bar_height);
+      DEVMETH (d, clear_region, (frame,
+                                DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1,
+                                bar_height));
     }
 
   SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
@@ -542,7 +544,7 @@ x_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change)
 
   SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0);
 
-  redisplay_clear_region (frame, DEFAULT_INDEX, x, y, width, height);
+  DEVMETH (d, clear_region, (frame, DEFAULT_INDEX, x, y, width, height));
   XFlush (DEVICE_X_DISPLAY (d));
 }
 
diff --git a/src/xselect.c b/src/xselect.c
new file mode 100644 (file)
index 0000000..b974d25
--- /dev/null
@@ -0,0 +1,2160 @@
+/* X Selection processing for XEmacs
+   Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not synched with FSF. */
+
+/* Rewritten by jwz */
+
+#include <config.h>
+#include "lisp.h"
+
+#include "buffer.h"
+#include "console-x.h"
+#include "objects-x.h"
+
+#include "frame.h"
+#include "opaque.h"
+#include "systime.h"
+
+int lisp_to_time (Lisp_Object, time_t *);
+Lisp_Object time_to_lisp (time_t);
+
+#ifdef LWLIB_USES_MOTIF
+# define MOTIF_CLIPBOARDS
+#endif
+
+#ifdef MOTIF_CLIPBOARDS
+# include <Xm/CutPaste.h>
+static void hack_motif_clipboard_selection (Atom selection_atom,
+                                           Lisp_Object selection_value,
+                                           Time thyme, Display *display,
+                                           Window selecting_window,
+                                           Bool owned_p);
+#endif
+
+#define CUT_BUFFER_SUPPORT
+
+Lisp_Object QPRIMARY, QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP,
+  QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL,
+  QATOM_PAIR, QCOMPOUND_TEXT;
+
+#ifdef CUT_BUFFER_SUPPORT
+Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3,
+  QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7;
+#endif
+
+Lisp_Object Vx_lost_selection_hooks;
+Lisp_Object Vx_sent_selection_hooks;
+
+/* If this is a smaller number than the max-request-size of the display,
+   emacs will use INCR selection transfer when the selection is larger
+   than this.  The max-request-size is usually around 64k, so if you want
+   emacs to use incremental selection transfers when the selection is
+   smaller than that, set this.  I added this mostly for debugging the
+   incremental transfer stuff, but it might improve server performance.
+ */
+#define MAX_SELECTION_QUANTUM 0xFFFFFF
+
+#define SELECTION_QUANTUM(dpy) ((XMaxRequestSize (dpy) << 2) - 100)
+
+/* This is an association list whose elements are of the form
+     ( selection-name selection-value selection-timestamp )
+   selection-name is a lisp symbol, whose name is the name of an X Atom.
+   selection-value is the value that emacs owns for that selection.
+     It may be any kind of Lisp object.
+   selection-timestamp is the time at which emacs began owning this selection,
+     as a cons of two 16-bit numbers (making a 32 bit time).
+   If there is an entry in this alist, then it can be assumed that emacs owns
+    that selection.
+   The only (eq) parts of this list that are visible from elisp are the
+    selection-values.
+ */
+Lisp_Object Vselection_alist;
+
+/* This is an alist whose CARs are selection-types (whose names are the same
+   as the names of X Atoms) and whose CDRs are the names of Lisp functions to
+   call to convert the given Emacs selection value to a string representing
+   the given selection type.  This is for elisp-level extension of the emacs
+   selection handling.
+ */
+Lisp_Object Vselection_converter_alist;
+
+/* "Selection owner couldn't convert selection" */
+Lisp_Object Qselection_conversion_error;
+
+/* If the selection owner takes too long to reply to a selection request,
+   we give up on it.  This is in seconds (0 = no timeout).
+ */
+int x_selection_timeout;
+
+\f
+/* Utility functions */
+
+static void lisp_data_to_selection_data (struct device *,
+                                        Lisp_Object obj,
+                                        unsigned char **data_ret,
+                                        Atom *type_ret,
+                                        unsigned int *size_ret,
+                                        int *format_ret);
+static Lisp_Object selection_data_to_lisp_data (struct device *,
+                                               unsigned char *data,
+                                               size_t size,
+                                               Atom type,
+                                               int format);
+static Lisp_Object x_get_window_property_as_lisp_data (Display *,
+                                                      Window,
+                                                      Atom property,
+                                                      Lisp_Object target_type,
+                                                      Atom selection_atom);
+
+static int expect_property_change (Display *, Window, Atom prop, int state);
+static void wait_for_property_change (long);
+static void unexpect_property_change (int);
+static int waiting_for_other_props_on_window (Display *, Window);
+
+/* This converts a Lisp symbol to a server Atom, avoiding a server
+   roundtrip whenever possible.
+ */
+static Atom
+symbol_to_x_atom (struct device *d, Lisp_Object sym, int only_if_exists)
+{
+  Display *display = DEVICE_X_DISPLAY (d);
+
+  if (NILP (sym))              return XA_PRIMARY;
+  if (EQ (sym, Qt))            return XA_SECONDARY;
+  if (EQ (sym, QPRIMARY))      return XA_PRIMARY;
+  if (EQ (sym, QSECONDARY))    return XA_SECONDARY;
+  if (EQ (sym, QSTRING))       return XA_STRING;
+  if (EQ (sym, QINTEGER))      return XA_INTEGER;
+  if (EQ (sym, QATOM))         return XA_ATOM;
+  if (EQ (sym, QCLIPBOARD))    return DEVICE_XATOM_CLIPBOARD (d);
+  if (EQ (sym, QTIMESTAMP))    return DEVICE_XATOM_TIMESTAMP (d);
+  if (EQ (sym, QTEXT))         return DEVICE_XATOM_TEXT      (d);
+  if (EQ (sym, QDELETE))       return DEVICE_XATOM_DELETE    (d);
+  if (EQ (sym, QMULTIPLE))     return DEVICE_XATOM_MULTIPLE  (d);
+  if (EQ (sym, QINCR))         return DEVICE_XATOM_INCR      (d);
+  if (EQ (sym, QEMACS_TMP))    return DEVICE_XATOM_EMACS_TMP (d);
+  if (EQ (sym, QTARGETS))      return DEVICE_XATOM_TARGETS   (d);
+  if (EQ (sym, QNULL))         return DEVICE_XATOM_NULL      (d);
+  if (EQ (sym, QATOM_PAIR))    return DEVICE_XATOM_ATOM_PAIR (d);
+  if (EQ (sym, QCOMPOUND_TEXT)) return DEVICE_XATOM_COMPOUND_TEXT (d);
+
+#ifdef CUT_BUFFER_SUPPORT
+  if (EQ (sym, QCUT_BUFFER0))  return XA_CUT_BUFFER0;
+  if (EQ (sym, QCUT_BUFFER1))  return XA_CUT_BUFFER1;
+  if (EQ (sym, QCUT_BUFFER2))  return XA_CUT_BUFFER2;
+  if (EQ (sym, QCUT_BUFFER3))  return XA_CUT_BUFFER3;
+  if (EQ (sym, QCUT_BUFFER4))  return XA_CUT_BUFFER4;
+  if (EQ (sym, QCUT_BUFFER5))  return XA_CUT_BUFFER5;
+  if (EQ (sym, QCUT_BUFFER6))  return XA_CUT_BUFFER6;
+  if (EQ (sym, QCUT_BUFFER7))  return XA_CUT_BUFFER7;
+#endif /* CUT_BUFFER_SUPPORT */
+
+  {
+    CONST char *nameext;
+    GET_C_STRING_CTEXT_DATA_ALLOCA (Fsymbol_name (sym), nameext);
+    return XInternAtom (display, nameext, only_if_exists ? True : False);
+  }
+}
+
+
+/* This converts a server Atom to a Lisp symbol, avoiding server roundtrips
+   and calls to intern whenever possible.
+ */
+static Lisp_Object
+x_atom_to_symbol (struct device *d, Atom atom)
+{
+  Display *display = DEVICE_X_DISPLAY (d);
+
+  if (! atom) return Qnil;
+  if (atom == XA_PRIMARY)      return QPRIMARY;
+  if (atom == XA_SECONDARY)    return QSECONDARY;
+  if (atom == XA_STRING)       return QSTRING;
+  if (atom == XA_INTEGER)      return QINTEGER;
+  if (atom == XA_ATOM)         return QATOM;
+  if (atom == DEVICE_XATOM_CLIPBOARD (d)) return QCLIPBOARD;
+  if (atom == DEVICE_XATOM_TIMESTAMP (d)) return QTIMESTAMP;
+  if (atom == DEVICE_XATOM_TEXT      (d)) return QTEXT;
+  if (atom == DEVICE_XATOM_DELETE    (d)) return QDELETE;
+  if (atom == DEVICE_XATOM_MULTIPLE  (d)) return QMULTIPLE;
+  if (atom == DEVICE_XATOM_INCR      (d)) return QINCR;
+  if (atom == DEVICE_XATOM_EMACS_TMP (d)) return QEMACS_TMP;
+  if (atom == DEVICE_XATOM_TARGETS   (d)) return QTARGETS;
+  if (atom == DEVICE_XATOM_NULL      (d)) return QNULL;
+  if (atom == DEVICE_XATOM_ATOM_PAIR (d)) return QATOM_PAIR;
+  if (atom == DEVICE_XATOM_COMPOUND_TEXT (d)) return QCOMPOUND_TEXT;
+
+#ifdef CUT_BUFFER_SUPPORT
+  if (atom == XA_CUT_BUFFER0)  return QCUT_BUFFER0;
+  if (atom == XA_CUT_BUFFER1)  return QCUT_BUFFER1;
+  if (atom == XA_CUT_BUFFER2)  return QCUT_BUFFER2;
+  if (atom == XA_CUT_BUFFER3)  return QCUT_BUFFER3;
+  if (atom == XA_CUT_BUFFER4)  return QCUT_BUFFER4;
+  if (atom == XA_CUT_BUFFER5)  return QCUT_BUFFER5;
+  if (atom == XA_CUT_BUFFER6)  return QCUT_BUFFER6;
+  if (atom == XA_CUT_BUFFER7)  return QCUT_BUFFER7;
+#endif
+
+  {
+    Lisp_Object newsym;
+    CONST Bufbyte *intstr;
+    char *str = XGetAtomName (display, atom);
+
+    if (! str) return Qnil;
+
+    GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA (str, intstr);
+    newsym = intern ((char *) intstr);
+    XFree (str);
+    return newsym;
+  }
+}
+
+\f
+/* Do protocol to assert ourself as a selection owner.
+   Update the Vselection_alist so that we can reply to later requests for
+   our selection.
+ */
+static void
+x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
+{
+  struct device *d = decode_x_device (Qnil);
+  Display *display = DEVICE_X_DISPLAY (d);
+  struct frame *sel_frame = selected_frame ();
+  Window selecting_window = XtWindow (FRAME_X_TEXT_WIDGET (sel_frame));
+  /* Use the time of the last-read mouse or keyboard event.
+     For selection purposes, we use this as a sleazy way of knowing what the
+     current time is in server-time.  This assumes that the most recently read
+     mouse or keyboard event has something to do with the assertion of the
+     selection, which is probably true.
+     */
+  Time thyme = DEVICE_X_MOUSE_TIMESTAMP (d);
+  Atom selection_atom;
+
+  CHECK_SYMBOL (selection_name);
+  selection_atom = symbol_to_x_atom (d, selection_name, 0);
+
+  XSetSelectionOwner (display, selection_atom, selecting_window, thyme);
+
+  /* Now update the local cache */
+  {
+    /* We do NOT use time_to_lisp() here any more, like we used to.
+       That assumed equivalence of time_t and Time, which is not
+       necessarily the case (e.g. under OSF on the Alphas, where
+       Time is a 64-bit quantity and time_t is a 32-bit quantity).
+
+       Opaque pointers are the clean way to go here.
+     */
+    Lisp_Object selection_time = make_opaque (sizeof (thyme), (void *) &thyme);
+    Lisp_Object selection_data = list3 (selection_name,
+                                       selection_value,
+                                       selection_time);
+    Lisp_Object prev_value = assq_no_quit (selection_name, Vselection_alist);
+    Vselection_alist = Fcons (selection_data, Vselection_alist);
+
+    /* If we already owned the selection, remove the old selection data.
+       Perhaps we should destructively modify it instead.
+       Don't use Fdelq() as that may QUIT;.
+     */
+    if (!NILP (prev_value))
+      {
+       Lisp_Object rest;       /* we know it's not the CAR, so it's easy. */
+       for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+         if (EQ (prev_value, Fcar (XCDR (rest))))
+           {
+             XCDR (rest) = Fcdr (XCDR (rest));
+             break;
+           }
+      }
+#ifdef MOTIF_CLIPBOARDS
+    hack_motif_clipboard_selection (selection_atom, selection_value,
+                                   thyme, display, selecting_window,
+                                   !NILP (prev_value));
+#endif
+  }
+}
+
+
+#ifdef MOTIF_CLIPBOARDS /* Bend over baby.  Take it and like it. */
+
+# ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK
+static void motif_clipboard_cb ();
+# endif
+
+static void
+hack_motif_clipboard_selection (Atom selection_atom,
+                               Lisp_Object selection_value,
+                               Time thyme,
+                               Display *display,
+                               Window selecting_window,
+                               Bool owned_p)
+{
+  struct device *d = get_device_from_display (display);
+  /* Those Motif wankers can't be bothered to follow the ICCCM, and do
+     their own non-Xlib non-Xt clipboard processing.  So we have to do
+     this so that linked-in Motif widgets don't get themselves wedged.
+   */
+  if (selection_atom == DEVICE_XATOM_CLIPBOARD (d)
+      && STRINGP (selection_value)
+
+      /* If we already own the clipboard, don't own it again in the Motif
+        way.  This might lose in some subtle way, since the timestamp won't
+        be current, but owning the selection on the Motif way does a
+        SHITLOAD of X protocol, and it makes killing text be incredibly
+        slow when using an X terminal.  ARRRRGGGHHH!!!!
+       */
+      /* No, this is no good, because then Motif text fields don't bother
+        to look up the new value, and you can't Copy from a buffer, Paste
+        into a text field, then Copy something else from the buffer and
+        paste it into the text field -- it pastes the first thing again. */
+/*      && !owned_p */
+      )
+    {
+#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK
+      Widget widget = FRAME_X_TEXT_WIDGET (selected_frame());
+#endif
+      long itemid;
+#if XmVersion >= 1002
+      long dataid;
+#else
+      int dataid;      /* 1.2 wants long, but 1.1.5 wants int... */
+#endif
+      XmString fmh;
+      String encoding = "STRING";
+      CONST Extbyte *data  = XSTRING_DATA (selection_value);
+      Extcount bytes = XSTRING_LENGTH (selection_value);
+
+#ifdef MULE
+      {
+       enum { ASCII, LATIN_1, WORLD } chartypes = ASCII;
+       CONST Bufbyte *ptr = data, *end = ptr + bytes;
+       /* Optimize for the common ASCII case */
+       while (ptr <= end)
+         {
+           if (BYTE_ASCII_P (*ptr))
+             {
+               ptr++;
+               continue;
+             }
+
+           if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1 ||
+               (*ptr) == LEADING_BYTE_CONTROL_1)
+             {
+               chartypes = LATIN_1;
+               ptr += 2;
+               continue;
+             }
+
+           chartypes = WORLD;
+           break;
+         }
+
+       if (chartypes == LATIN_1)
+         GET_STRING_BINARY_DATA_ALLOCA (selection_value, data, bytes);
+       else if (chartypes == WORLD)
+         {
+           GET_STRING_CTEXT_DATA_ALLOCA (selection_value, data, bytes);
+           encoding = "COMPOUND_TEXT";
+         }
+      }
+#endif /* MULE */
+
+      fmh = XmStringCreateLtoR ("Clipboard", XmSTRING_DEFAULT_CHARSET);
+      while (ClipboardSuccess !=
+            XmClipboardStartCopy (display, selecting_window, fmh, thyme,
+#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK
+                                  widget, motif_clipboard_cb,
+#else
+                                  0, NULL,
+#endif
+                                  &itemid))
+       ;
+      XmStringFree (fmh);
+      while (ClipboardSuccess !=
+            XmClipboardCopy (display, selecting_window, itemid, encoding,
+#ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK
+                             /* O'Reilly examples say size can be 0,
+                                but this clearly is not the case. */
+                             0, bytes, (int) selecting_window, /* private id */
+#else /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */
+                             (XtPointer) data, bytes, 0,
+#endif /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */
+                             &dataid))
+       ;
+      while (ClipboardSuccess !=
+            XmClipboardEndCopy (display, selecting_window, itemid))
+       ;
+    }
+}
+
+# ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK
+/* I tried to treat the clipboard like a real selection, and not send
+   the data until it was requested, but it looks like that just doesn't
+   work at all unless the selection owner and requestor are in different
+   processes.  From reading the Motif source, it looks like they never
+   even considered having two widgets in the same application transfer
+   data between each other using "by-name" clipboard values.  What a
+   bunch of fuckups.
+ */
+static void
+motif_clipboard_cb (Widget widget, int *data_id, int *private_id, int *reason)
+{
+  switch (*reason)
+    {
+    case XmCR_CLIPBOARD_DATA_REQUEST:
+      {
+       Display *dpy = XtDisplay (widget);
+       Window window = (Window) *private_id;
+       Lisp_Object selection = assq_no_quit (QCLIPBOARD, Vselection_alist);
+       if (NILP (selection)) abort ();
+       selection = XCDR (selection);
+       if (!STRINGP (selection)) abort ();
+       XmClipboardCopyByName (dpy, window, *data_id,
+                              (char *) XSTRING_DATA (selection),
+                              XSTRING_LENGTH (selection) + 1,
+                              0);
+      }
+      break;
+    case XmCR_CLIPBOARD_DATA_DELETE:
+    default:
+      /* don't need to free anything */
+      break;
+    }
+}
+# endif /* MOTIF_INCREMENTAL_CLIPBOARDS_WORK */
+#endif /* MOTIF_CLIPBOARDS */
+
+
+/* Given a selection-name and desired type, this looks up our local copy of
+   the selection value and converts it to the type.  It returns nil or a
+   string.  This calls random elisp code, and may signal or gc.
+ */
+static Lisp_Object
+x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type)
+{
+  /* This function can GC */
+  Lisp_Object local_value = assq_no_quit (selection_symbol, Vselection_alist);
+  Lisp_Object handler_fn, value, check;
+
+  if (NILP (local_value)) return Qnil;
+
+  /* TIMESTAMP and MULTIPLE are special cases 'cause that's easiest. */
+  if (EQ (target_type, QTIMESTAMP))
+    {
+      handler_fn = Qnil;
+      value = XCAR (XCDR (XCDR (local_value)));
+    }
+
+#if 0 /* #### MULTIPLE doesn't work yet */
+  else if (CONSP (target_type) &&
+          XCAR (target_type) == QMULTIPLE)
+    {
+      Lisp_Object pairs = XCDR (target_type);
+      int len = XVECTOR_LENGTH (pairs);
+      int i;
+      /* If the target is MULTIPLE, then target_type looks like
+         (MULTIPLE . [[SELECTION1 TARGET1] [SELECTION2 TARGET2] ... ])
+        We modify the second element of each pair in the vector and
+        return it as [[SELECTION1 <value1>] [SELECTION2 <value2>] ... ]
+       */
+      for (i = 0; i < len; i++)
+       {
+         Lisp_Object pair = XVECTOR_DATA (pairs) [i];
+         XVECTOR_DATA (pair) [1] =
+           x_get_local_selection (XVECTOR_DATA (pair) [0],
+                                  XVECTOR_DATA (pair) [1]);
+       }
+      return pairs;
+    }
+#endif
+  else
+    {
+      CHECK_SYMBOL (target_type);
+      handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
+      if (NILP (handler_fn)) return Qnil;
+      value = call3 (handler_fn,
+                    selection_symbol, target_type,
+                    XCAR (XCDR (local_value)));
+    }
+
+  /* This lets the selection function to return (TYPE . VALUE).  For example,
+     when the selected type is LINE_NUMBER, the returned type is SPAN, not
+     INTEGER.
+   */
+  check = value;
+  if (CONSP (value) && SYMBOLP (XCAR (value)))
+    check = XCDR (value);
+
+  /* Strings, vectors, and symbols are converted to selection data format in
+     the obvious way.  Integers are converted to 16 bit quantities if they're
+     small enough, otherwise 32 bits are used.
+   */
+  if (STRINGP (check) ||
+      VECTORP (check) ||
+      SYMBOLP (check) ||
+      INTP    (check) ||
+      CHARP   (check) ||
+      NILP (value))
+    return value;
+
+  /* (N . M) or (N M) get turned into a 32 bit quantity.  So if you want to
+     always return a small quantity as 32 bits, your converter routine needs
+     to return a cons.
+   */
+  else if (CONSP (check) &&
+          INTP (XCAR (check)) &&
+          (INTP (XCDR (check)) ||
+           (CONSP (XCDR (check)) &&
+            INTP (XCAR (XCDR (check))) &&
+            NILP (XCDR (XCDR (check))))))
+    return value;
+  /* Otherwise the lisp converter function returned something unrecognized.
+   */
+  else
+    signal_error (Qerror,
+                  list3 (build_string
+                        ("unrecognized selection-conversion type"),
+                         handler_fn,
+                         value));
+
+  return Qnil; /* suppress compiler warning */
+}
+
+
+
+/* Send a SelectionNotify event to the requestor with property=None, meaning
+   we were unable to do what they wanted.
+ */
+static void
+x_decline_selection_request (XSelectionRequestEvent *event)
+{
+  XSelectionEvent reply;
+  reply.type      = SelectionNotify;
+  reply.display   = event->display;
+  reply.requestor = event->requestor;
+  reply.selection = event->selection;
+  reply.time      = event->time;
+  reply.target    = event->target;
+  reply.property  = None;
+
+  XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply);
+  XFlush (reply.display);
+}
+
+
+/* Used as an unwind-protect clause so that, if a selection-converter signals
+   an error, we tell the requestor that we were unable to do what they wanted
+   before we throw to top-level or go into the debugger or whatever.
+ */
+static Lisp_Object
+x_selection_request_lisp_error (Lisp_Object closure)
+{
+  XSelectionRequestEvent *event = (XSelectionRequestEvent *)
+    get_opaque_ptr (closure);
+
+  free_opaque_ptr (closure);
+  if (event->type == 0) /* we set this to mean "completed normally" */
+    return Qnil;
+  x_decline_selection_request (event);
+  return Qnil;
+}
+
+
+/* Convert our selection to the requested type, and put that data where the
+   requestor wants it.  Then tell them whether we've succeeded.
+ */
+static void
+x_reply_selection_request (XSelectionRequestEvent *event, int format,
+                          unsigned char *data, int size, Atom type)
+{
+  /* This function can GC */
+  XSelectionEvent reply;
+  Display *display = event->display;
+  struct device *d = get_device_from_display (display);
+  Window window = event->requestor;
+  int bytes_remaining;
+  int format_bytes = format/8;
+  int max_bytes = SELECTION_QUANTUM (display);
+  if (max_bytes > MAX_SELECTION_QUANTUM) max_bytes = MAX_SELECTION_QUANTUM;
+
+  reply.type      = SelectionNotify;
+  reply.display   = display;
+  reply.requestor = window;
+  reply.selection = event->selection;
+  reply.time      = event->time;
+  reply.target    = event->target;
+  reply.property  = (event->property == None ? event->target : event->property);
+
+  /* #### XChangeProperty can generate BadAlloc, and we must handle it! */
+
+  /* Store the data on the requested property.
+     If the selection is large, only store the first N bytes of it.
+   */
+  bytes_remaining = size * format_bytes;
+  if (bytes_remaining <= max_bytes)
+    {
+      /* Send all the data at once, with minimal handshaking. */
+#if 0
+      stderr_out ("\nStoring all %d\n", bytes_remaining);
+#endif
+      XChangeProperty (display, window, reply.property, type, format,
+                      PropModeReplace, data, size);
+      /* At this point, the selection was successfully stored; ack it. */
+      XSendEvent (display, window, False, 0L, (XEvent *) &reply);
+      XFlush (display);
+    }
+  else
+    {
+      /* Send an INCR selection. */
+      int prop_id;
+
+      if (x_window_to_frame (d, window)) /* #### debug */
+       error ("attempt to transfer an INCR to ourself!");
+#if 0
+      stderr_out ("\nINCR %d\n", bytes_remaining);
+#endif
+      prop_id = expect_property_change (display, window, reply.property,
+                                       PropertyDelete);
+
+      XChangeProperty (display, window, reply.property, DEVICE_XATOM_INCR (d),
+                      32, PropModeReplace, (unsigned char *)
+                      &bytes_remaining, 1);
+      XSelectInput (display, window, PropertyChangeMask);
+      /* Tell 'em the INCR data is there... */
+      XSendEvent (display, window, False, 0L, (XEvent *) &reply);
+      XFlush (display);
+
+      /* First, wait for the requestor to ack by deleting the property.
+        This can run random lisp code (process handlers) or signal.
+       */
+      wait_for_property_change (prop_id);
+
+      while (bytes_remaining)
+       {
+         int i = ((bytes_remaining < max_bytes)
+                  ? bytes_remaining
+                  : max_bytes);
+         prop_id = expect_property_change (display, window, reply.property,
+                                           PropertyDelete);
+#if 0
+         stderr_out ("  INCR adding %d\n", i);
+#endif
+         /* Append the next chunk of data to the property. */
+         XChangeProperty (display, window, reply.property, type, format,
+                          PropModeAppend, data, i / format_bytes);
+         bytes_remaining -= i;
+         data += i;
+
+         /* Now wait for the requestor to ack this chunk by deleting the
+            property.   This can run random lisp code or signal.
+          */
+         wait_for_property_change (prop_id);
+       }
+      /* Now write a zero-length chunk to the property to tell the requestor
+        that we're done. */
+#if 0
+      stderr_out ("  INCR done\n");
+#endif
+      if (! waiting_for_other_props_on_window (display, window))
+       XSelectInput (display, window, 0L);
+
+      XChangeProperty (display, window, reply.property, type, format,
+                      PropModeReplace, data, 0);
+    }
+}
+
+
+
+/* Called from the event-loop in response to a SelectionRequest event.
+ */
+void
+x_handle_selection_request (XSelectionRequestEvent *event)
+{
+  /* This function can GC */
+  struct gcpro gcpro1, gcpro2, gcpro3;
+  XSelectionEvent reply;
+  Lisp_Object local_selection_data = Qnil;
+  Lisp_Object selection_symbol;
+  Lisp_Object target_symbol = Qnil;
+  Lisp_Object converted_selection = Qnil;
+  Time local_selection_time;
+  Lisp_Object successful_p = Qnil;
+  int count;
+  struct device *d = get_device_from_display (event->display);
+
+  GCPRO3 (local_selection_data, converted_selection, target_symbol);
+
+  reply.type      = SelectionNotify;           /* Construct the reply event */
+  reply.display   = event->display;
+  reply.requestor = event->requestor;
+  reply.selection = event->selection;
+  reply.time      = event->time;
+  reply.target    = event->target;
+  reply.property  = (event->property == None ? event->target : event->property);
+
+  selection_symbol = x_atom_to_symbol (d, event->selection);
+
+  local_selection_data = assq_no_quit (selection_symbol, Vselection_alist);
+
+#if 0
+# define CDR(x) (XCDR (x))
+# define CAR(x) (XCAR (x))
+  /* This list isn't user-visible, so it can't "go bad." */
+  if (!CONSP (local_selection_data)) abort ();
+  if (!CONSP (CDR (local_selection_data))) abort ();
+  if (!CONSP (CDR (CDR (local_selection_data)))) abort ();
+  if (!NILP (CDR (CDR (CDR (local_selection_data))))) abort ();
+  if (!CONSP (CAR (CDR (CDR (local_selection_data))))) abort ();
+  if (!INTP (CAR (CAR (CDR (CDR (local_selection_data)))))) abort ();
+  if (!INTP (CDR (CAR (CDR (CDR (local_selection_data)))))) abort ();
+# undef CAR
+# undef CDR
+#endif
+
+  if (NILP (local_selection_data))
+    {
+      /* Someone asked for the selection, but we don't have it any more.
+       */
+      x_decline_selection_request (event);
+      goto DONE_LABEL;
+    }
+
+  local_selection_time =
+    * (Time *) XOPAQUE_DATA (XCAR (XCDR (XCDR (local_selection_data))));
+
+  if (event->time != CurrentTime &&
+      local_selection_time > event->time)
+    {
+      /* Someone asked for the selection, and we have one, but not the one
+        they're looking for.
+       */
+      x_decline_selection_request (event);
+      goto DONE_LABEL;
+    }
+
+  count = specpdl_depth ();
+  record_unwind_protect (x_selection_request_lisp_error,
+                        make_opaque_ptr (event));
+  target_symbol = x_atom_to_symbol (d, event->target);
+
+#if 0 /* #### MULTIPLE doesn't work yet */
+  if (EQ (target_symbol, QMULTIPLE))
+    target_symbol = fetch_multiple_target (event);
+#endif
+
+  /* Convert lisp objects back into binary data */
+
+  converted_selection =
+    x_get_local_selection (selection_symbol, target_symbol);
+
+  if (! NILP (converted_selection))
+    {
+      unsigned char *data;
+      unsigned int size;
+      int format;
+      Atom type;
+      lisp_data_to_selection_data (d, converted_selection,
+                                  &data, &type, &size, &format);
+
+      x_reply_selection_request (event, format, data, size, type);
+      successful_p = Qt;
+      /* Tell x_selection_request_lisp_error() it's cool. */
+      event->type = 0;
+      xfree (data);
+    }
+  unbind_to (count, Qnil);
+
+ DONE_LABEL:
+
+  UNGCPRO;
+
+  /* Let random lisp code notice that the selection has been asked for. */
+  {
+    Lisp_Object rest;
+    Lisp_Object val = Vx_sent_selection_hooks;
+    if (!UNBOUNDP (val) && !NILP (val))
+      {
+       if (CONSP (val) && !EQ (XCAR (val), Qlambda))
+         for (rest = val; !NILP (rest); rest = Fcdr (rest))
+           call3 (Fcar(rest), selection_symbol, target_symbol,
+                  successful_p);
+       else
+         call3 (val, selection_symbol, target_symbol,
+                successful_p);
+      }
+  }
+}
+
+
+/* Called from the event-loop in response to a SelectionClear event.
+ */
+void
+x_handle_selection_clear (XSelectionClearEvent *event)
+{
+  Display *display = event->display;
+  struct device *d = get_device_from_display (display);
+  Atom selection = event->selection;
+  Time changed_owner_time = event->time;
+
+  Lisp_Object selection_symbol, local_selection_data;
+  Time local_selection_time;
+
+  selection_symbol = x_atom_to_symbol (d, selection);
+
+  local_selection_data = assq_no_quit (selection_symbol, Vselection_alist);
+
+  /* Well, we already believe that we don't own it, so that's just fine. */
+  if (NILP (local_selection_data)) return;
+
+  local_selection_time =
+    * (Time *) XOPAQUE_DATA (XCAR (XCDR (XCDR (local_selection_data))));
+
+  /* This SelectionClear is for a selection that we no longer own, so we can
+     disregard it.  (That is, we have reasserted the selection since this
+     request was generated.)
+   */
+  if (changed_owner_time != CurrentTime &&
+      local_selection_time > changed_owner_time)
+    return;
+
+  /* Otherwise, we're really honest and truly being told to drop it.
+     Don't use Fdelq() as that may QUIT;.
+   */
+  if (EQ (local_selection_data, Fcar (Vselection_alist)))
+    Vselection_alist = Fcdr (Vselection_alist);
+  else
+    {
+      Lisp_Object rest;
+      for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+       if (EQ (local_selection_data, Fcar (XCDR (rest))))
+         {
+           XCDR (rest) = Fcdr (XCDR (rest));
+           break;
+         }
+    }
+
+  /* Let random lisp code notice that the selection has been stolen.
+   */
+  {
+    Lisp_Object rest;
+    Lisp_Object val = Vx_lost_selection_hooks;
+    if (!UNBOUNDP (val) && !NILP (val))
+      {
+       if (CONSP (val) && !EQ (XCAR (val), Qlambda))
+         for (rest = val; !NILP (rest); rest = Fcdr (rest))
+           call1 (Fcar (rest), selection_symbol);
+       else
+         call1 (val, selection_symbol);
+      }
+  }
+}
+
+\f
+/* This stuff is so that INCR selections are reentrant (that is, so we can
+   be servicing multiple INCR selection requests simultaneously).  I haven't
+   actually tested that yet.
+ */
+
+static int prop_location_tick;
+
+static struct prop_location {
+  int tick;
+  Display *display;
+  Window window;
+  Atom property;
+  int desired_state;
+  struct prop_location *next;
+} *for_whom_the_bell_tolls;
+
+
+static int
+property_deleted_p (void *tick)
+{
+  struct prop_location *rest = for_whom_the_bell_tolls;
+  while (rest)
+    if (rest->tick == (long) tick)
+      return 0;
+    else
+      rest = rest->next;
+  return 1;
+}
+
+static int
+waiting_for_other_props_on_window (Display *display, Window window)
+{
+  struct prop_location *rest = for_whom_the_bell_tolls;
+  while (rest)
+    if (rest->display == display && rest->window == window)
+      return 1;
+    else
+      rest = rest->next;
+  return 0;
+}
+
+
+static int
+expect_property_change (Display *display, Window window,
+                       Atom property, int state)
+{
+  struct prop_location *pl = xnew (struct prop_location);
+  pl->tick = ++prop_location_tick;
+  pl->display = display;
+  pl->window = window;
+  pl->property = property;
+  pl->desired_state = state;
+  pl->next = for_whom_the_bell_tolls;
+  for_whom_the_bell_tolls = pl;
+  return pl->tick;
+}
+
+static void
+unexpect_property_change (int tick)
+{
+  struct prop_location *prev = 0, *rest = for_whom_the_bell_tolls;
+  while (rest)
+    {
+      if (rest->tick == tick)
+       {
+         if (prev)
+           prev->next = rest->next;
+         else
+           for_whom_the_bell_tolls = rest->next;
+         xfree (rest);
+         return;
+       }
+      prev = rest;
+      rest = rest->next;
+    }
+}
+
+static void
+wait_for_property_change (long tick)
+{
+  /* This function can GC */
+  wait_delaying_user_input (property_deleted_p, (void *) tick);
+}
+
+
+/* Called from the event-loop in response to a PropertyNotify event.
+ */
+void
+x_handle_property_notify (XPropertyEvent *event)
+{
+  struct prop_location *prev = 0, *rest = for_whom_the_bell_tolls;
+  while (rest)
+    {
+      if (rest->property == event->atom &&
+         rest->window == event->window &&
+         rest->display == event->display &&
+         rest->desired_state == event->state)
+       {
+#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);
+#endif
+         if (prev)
+           prev->next = rest->next;
+         else
+           for_whom_the_bell_tolls = rest->next;
+         xfree (rest);
+         return;
+       }
+      prev = rest;
+      rest = rest->next;
+    }
+#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));
+#endif
+}
+
+
+\f
+#if 0 /* #### MULTIPLE doesn't work yet */
+
+static Lisp_Object
+fetch_multiple_target (XSelectionRequestEvent *event)
+{
+  /* This function can GC */
+  Display *display = event->display;
+  Window window = event->requestor;
+  Atom target = event->target;
+  Atom selection_atom = event->selection;
+  int result;
+
+  return
+    Fcons (QMULTIPLE,
+          x_get_window_property_as_lisp_data (display, window, target,
+                                              QMULTIPLE,
+                                              selection_atom));
+}
+
+static Lisp_Object
+copy_multiple_data (Lisp_Object obj)
+{
+  Lisp_Object vec;
+  int i;
+  int len;
+  if (CONSP (obj))
+    return Fcons (XCAR (obj), copy_multiple_data (XCDR (obj)));
+
+  CHECK_VECTOR (obj);
+  len = XVECTOR_LENGTH (obj);
+  vec = make_vector (len, Qnil);
+  for (i = 0; i < len; i++)
+    {
+      Lisp_Object vec2 = XVECTOR_DATA (obj) [i];
+      CHECK_VECTOR (vec2);
+      if (XVECTOR_LENGTH (vec2) != 2)
+       signal_error (Qerror, list2 (build_string
+                                    ("vectors must be of length 2"),
+                                     vec2));
+      XVECTOR_DATA (vec) [i] = make_vector (2, Qnil);
+      XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [0] = XVECTOR_DATA (vec2) [0];
+      XVECTOR_DATA (XVECTOR_DATA (vec) [i]) [1] = XVECTOR_DATA (vec2) [1];
+    }
+  return vec;
+}
+
+#endif /* 0 */
+
+\f
+static Window reading_selection_reply;
+static Atom reading_which_selection;
+static int selection_reply_timed_out;
+
+static int
+selection_reply_done (void *ignore)
+{
+  return !reading_selection_reply;
+}
+
+static Lisp_Object Qx_selection_reply_timeout_internal;
+
+DEFUN ("x-selection-reply-timeout-internal", Fx_selection_reply_timeout_internal,
+       1, 1, 0, /*
+*/
+       (arg))
+{
+  selection_reply_timed_out = 1;
+  reading_selection_reply = 0;
+  return Qnil;
+}
+
+
+/* Do protocol to read selection-data from the server.
+   Converts this to lisp data and returns it.
+ */
+static Lisp_Object
+x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type)
+{
+  /* This function can GC */
+  struct device *d = decode_x_device (Qnil);
+  Display *display = DEVICE_X_DISPLAY (d);
+  struct frame *sel_frame = selected_frame ();
+  Window requestor_window = XtWindow (FRAME_X_TEXT_WIDGET (sel_frame));
+  Time requestor_time = DEVICE_X_MOUSE_TIMESTAMP (d);
+  Atom target_property = DEVICE_XATOM_EMACS_TMP (d);
+  Atom selection_atom = symbol_to_x_atom (d, selection_symbol, 0);
+  int speccount;
+  Atom type_atom = symbol_to_x_atom (d, (CONSP (target_type) ?
+                                        XCAR (target_type) : target_type), 0);
+
+  XConvertSelection (display, selection_atom, type_atom, target_property,
+                    requestor_window, requestor_time);
+
+  /* Block until the reply has been read. */
+  reading_selection_reply = requestor_window;
+  reading_which_selection = selection_atom;
+  selection_reply_timed_out = 0;
+
+  speccount = specpdl_depth ();
+
+  /* add a timeout handler */
+  if (x_selection_timeout > 0)
+    {
+      Lisp_Object id = Fadd_timeout (make_int (x_selection_timeout),
+                                    Qx_selection_reply_timeout_internal,
+                                    Qnil, Qnil);
+      record_unwind_protect (Fdisable_timeout, id);
+    }
+
+  /* This is ^Gable */
+  wait_delaying_user_input (selection_reply_done, 0);
+
+  if (selection_reply_timed_out)
+    error ("timed out waiting for reply from selection owner");
+
+  unbind_to (speccount, Qnil);
+
+  /* otherwise, the selection is waiting for us on the requested property. */
+  return
+    x_get_window_property_as_lisp_data (display, requestor_window,
+                                       target_property, target_type,
+                                       selection_atom);
+}
+
+
+static void
+x_get_window_property (Display *display, Window window, Atom property,
+                      unsigned char **data_ret, int *bytes_ret,
+                      Atom *actual_type_ret, int *actual_format_ret,
+                      unsigned long *actual_size_ret, int delete_p)
+{
+  int total_size;
+  unsigned long bytes_remaining;
+  int offset = 0;
+  unsigned char *tmp_data = 0;
+  int result;
+  int buffer_size = SELECTION_QUANTUM (display);
+  if (buffer_size > MAX_SELECTION_QUANTUM) buffer_size = MAX_SELECTION_QUANTUM;
+
+  /* First probe the thing to find out how big it is. */
+  result = XGetWindowProperty (display, window, property,
+                              0, 0, False, AnyPropertyType,
+                              actual_type_ret, actual_format_ret,
+                              actual_size_ret,
+                              &bytes_remaining, &tmp_data);
+  if (result != Success)
+    {
+      *data_ret = 0;
+      *bytes_ret = 0;
+      return;
+    }
+  XFree ((char *) tmp_data);
+
+  if (*actual_type_ret == None || *actual_format_ret == 0)
+    {
+      if (delete_p) XDeleteProperty (display, window, property);
+      *data_ret = 0;
+      *bytes_ret = 0;
+      return;
+    }
+
+  total_size = bytes_remaining + 1;
+  *data_ret = (unsigned char *) xmalloc (total_size);
+
+  /* Now read, until weve gotten it all. */
+  while (bytes_remaining)
+    {
+#if 0
+      int last = bytes_remaining;
+#endif
+      result =
+       XGetWindowProperty (display, window, property,
+                           offset/4, buffer_size/4,
+                           (delete_p ? True : False),
+                           AnyPropertyType,
+                           actual_type_ret, actual_format_ret,
+                           actual_size_ret, &bytes_remaining, &tmp_data);
+#if 0
+      stderr_out ("<< read %d\n", last-bytes_remaining);
+#endif
+      /* If this doesn't return Success at this point, it means that
+        some clod deleted the selection while we were in the midst of
+        reading it.  Deal with that, I guess....
+       */
+      if (result != Success) break;
+      *actual_size_ret *= *actual_format_ret / 8;
+      memcpy ((*data_ret) + offset, tmp_data, *actual_size_ret);
+      offset += *actual_size_ret;
+      XFree ((char *) tmp_data);
+    }
+  *bytes_ret = offset;
+}
+
+
+static void
+receive_incremental_selection (Display *display, Window window, Atom property,
+                              /* this one is for error messages only */
+                              Lisp_Object target_type,
+                              unsigned int min_size_bytes,
+                              unsigned char **data_ret, int *size_bytes_ret,
+                              Atom *type_ret, int *format_ret,
+                              unsigned long *size_ret)
+{
+  /* This function can GC */
+  int offset = 0;
+  int prop_id;
+  *size_bytes_ret = min_size_bytes;
+  *data_ret = (unsigned char *) xmalloc (*size_bytes_ret);
+#if 0
+  stderr_out ("\nread INCR %d\n", min_size_bytes);
+#endif
+  /* At this point, we have read an INCR property, and deleted it (which
+     is how we ack its receipt: the sending window will be selecting
+     PropertyNotify events on our window to notice this).
+
+     Now, we must loop, waiting for the sending window to put a value on
+     that property, then reading the property, then deleting it to ack.
+     We are done when the sender places a property of length 0.
+   */
+  prop_id = expect_property_change (display, window, property,
+                                   PropertyNewValue);
+  while (1)
+    {
+      unsigned char *tmp_data;
+      int tmp_size_bytes;
+      wait_for_property_change (prop_id);
+      /* expect it again immediately, because x_get_window_property may
+        .. no it wont, I dont get it.
+        .. Ok, I get it now, the Xt code that implements INCR is broken.
+       */
+      prop_id = expect_property_change (display, window, property,
+                                       PropertyNewValue);
+      x_get_window_property (display, window, property,
+                            &tmp_data, &tmp_size_bytes,
+                            type_ret, format_ret, size_ret, 1);
+
+      if (tmp_size_bytes == 0) /* we're done */
+       {
+#if 0
+         stderr_out ("  read INCR done\n");
+#endif
+         unexpect_property_change (prop_id);
+         if (tmp_data) xfree (tmp_data);
+         break;
+       }
+#if 0
+      stderr_out ("  read INCR %d\n", tmp_size_bytes);
+#endif
+      if (*size_bytes_ret < offset + tmp_size_bytes)
+       {
+#if 0
+         stderr_out ("  read INCR realloc %d -> %d\n",
+                  *size_bytes_ret, offset + tmp_size_bytes);
+#endif
+         *size_bytes_ret = offset + tmp_size_bytes;
+         *data_ret = (unsigned char *) xrealloc (*data_ret, *size_bytes_ret);
+       }
+      memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes);
+      offset += tmp_size_bytes;
+      xfree (tmp_data);
+    }
+}
+
+
+static Lisp_Object
+x_get_window_property_as_lisp_data (Display *display,
+                                   Window window,
+                                   Atom property,
+                                   /* next two for error messages only */
+                                   Lisp_Object target_type,
+                                   Atom selection_atom)
+{
+  /* This function can GC */
+  Atom actual_type;
+  int actual_format;
+  unsigned long actual_size;
+  unsigned char *data = NULL;
+  int bytes = 0;
+  Lisp_Object val;
+  struct device *d = get_device_from_display (display);
+
+  x_get_window_property (display, window, property, &data, &bytes,
+                        &actual_type, &actual_format, &actual_size, 1);
+  if (! data)
+    {
+      if (XGetSelectionOwner (display, selection_atom))
+       /* there is a selection owner */
+       signal_error
+         (Qselection_conversion_error,
+          Fcons (build_string ("selection owner couldn't convert"),
+                 Fcons (x_atom_to_symbol (d, selection_atom),
+                        actual_type ?
+                        list2 (target_type, x_atom_to_symbol (d, actual_type)) :
+                        list1 (target_type))));
+      else
+       signal_error (Qerror,
+                     list2 (build_string ("no selection"),
+                            x_atom_to_symbol (d, selection_atom)));
+    }
+
+  if (actual_type == DEVICE_XATOM_INCR (d))
+    {
+      /* Ok, that data wasn't *the* data, it was just the beginning. */
+
+      unsigned int min_size_bytes = * ((unsigned int *) data);
+      xfree (data);
+      receive_incremental_selection (display, window, property, target_type,
+                                    min_size_bytes, &data, &bytes,
+                                    &actual_type, &actual_format,
+                                    &actual_size);
+    }
+
+  /* It's been read.  Now convert it to a lisp object in some semi-rational
+     manner. */
+  val = selection_data_to_lisp_data (d, data, bytes,
+                                    actual_type, actual_format);
+
+  xfree (data);
+  return val;
+}
+\f
+/* These functions convert from the selection data read from the server into
+   something that we can use from elisp, and vice versa.
+
+       Type:   Format: Size:           Elisp Type:
+       -----   ------- -----           -----------
+       *       8       *               String
+       ATOM    32      1               Symbol
+       ATOM    32      > 1             Vector of Symbols
+       *       16      1               Integer
+       *       16      > 1             Vector of Integers
+       *       32      1               if <=16 bits: Integer
+                                       if > 16 bits: Cons of top16, bot16
+       *       32      > 1             Vector of the above
+
+   When converting a Lisp number to C, it is assumed to be of format 16 if
+   it is an integer, and of format 32 if it is a cons of two integers.
+
+   When converting a vector of numbers from Elisp to C, it is assumed to be
+   of format 16 if every element in the vector is an integer, and is assumed
+   to be of format 32 if any element is a cons of two integers.
+
+   When converting an object to C, it may be of the form (SYMBOL . <data>)
+   where SYMBOL is what we should claim that the type is.  Format and
+   representation are as above.
+
+   NOTE: Under Mule, when someone shoves us a string without a type, we
+   set the type to 'COMPOUND_TEXT and automatically convert to Compound
+   Text.  If the string has a type, we assume that the user wants the
+   data sent as-is so we just do "binary" conversion.
+ */
+
+
+static Lisp_Object
+selection_data_to_lisp_data (struct device *d,
+                            unsigned char *data,
+                            size_t size,
+                            Atom type,
+                            int format)
+{
+  if (type == DEVICE_XATOM_NULL (d))
+    return QNULL;
+
+  /* Convert any 8-bit data to a string, for compactness. */
+  else if (format == 8)
+    return make_ext_string (data, size,
+                           type == DEVICE_XATOM_TEXT (d) ||
+                           type == DEVICE_XATOM_COMPOUND_TEXT (d)
+                           ? FORMAT_CTEXT : FORMAT_BINARY);
+
+  /* Convert a single atom to a Lisp Symbol.  Convert a set of atoms to
+     a vector of symbols.
+   */
+  else if (type == XA_ATOM)
+    {
+      if (size == sizeof (Atom))
+       return x_atom_to_symbol (d, *((Atom *) data));
+      else
+       {
+         int i;
+         int len = size / sizeof (Atom);
+         Lisp_Object v = Fmake_vector (make_int (len), Qzero);
+         for (i = 0; i < len; i++)
+           Faset (v, make_int (i), x_atom_to_symbol (d, ((Atom *) data) [i]));
+         return v;
+       }
+    }
+
+  /* Convert a single 16 or small 32 bit number to a Lisp Int.
+     If the number is > 16 bits, convert it to a cons of integers,
+     16 bits in each half.
+   */
+  else if (format == 32 && size == sizeof (long))
+    return word_to_lisp (((unsigned long *) data) [0]);
+  else if (format == 16 && size == sizeof (short))
+    return make_int ((int) (((unsigned short *) data) [0]));
+
+  /* Convert any other kind of data to a vector of numbers, represented
+     as above (as an integer, or a cons of two 16 bit integers).
+
+     #### Perhaps we should return the actual type to lisp as well.
+
+       (x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
+       ==> [4 4]
+
+     and perhaps it should be
+
+       (x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
+       ==> (SPAN . [4 4])
+
+     Right now the fact that the return type was SPAN is discarded before
+     lisp code gets to see it.
+   */
+  else if (format == 16)
+    {
+      int i;
+      Lisp_Object v = make_vector (size / 4, Qzero);
+      for (i = 0; i < (int) size / 4; i++)
+       {
+         int j = (int) ((unsigned short *) data) [i];
+         Faset (v, make_int (i), make_int (j));
+       }
+      return v;
+    }
+  else
+    {
+      int i;
+      Lisp_Object v = make_vector (size / 4, Qzero);
+      for (i = 0; i < (int) size / 4; i++)
+       {
+         unsigned long j = ((unsigned long *) data) [i];
+         Faset (v, make_int (i), word_to_lisp (j));
+       }
+      return v;
+    }
+}
+
+
+static void
+lisp_data_to_selection_data (struct device *d,
+                            Lisp_Object obj,
+                            unsigned char **data_ret,
+                            Atom *type_ret,
+                            unsigned int *size_ret,
+                            int *format_ret)
+{
+  Lisp_Object type = Qnil;
+
+  if (CONSP (obj) && SYMBOLP (XCAR (obj)))
+    {
+      type = XCAR (obj);
+      obj = XCDR (obj);
+      if (CONSP (obj) && NILP (XCDR (obj)))
+       obj = XCAR (obj);
+    }
+
+  if (EQ (obj, QNULL) || (EQ (type, QNULL)))
+    {                          /* This is not the same as declining */
+      *format_ret = 32;
+      *size_ret = 0;
+      *data_ret = 0;
+      type = QNULL;
+    }
+  else if (STRINGP (obj))
+    {
+      CONST Extbyte *extval;
+      Extcount extvallen;
+
+      if (NILP (type))
+       GET_STRING_CTEXT_DATA_ALLOCA (obj, extval, extvallen);
+      else
+       GET_STRING_BINARY_DATA_ALLOCA (obj, extval, extvallen);
+      *format_ret = 8;
+      *size_ret = extvallen;
+      *data_ret = (unsigned char *) xmalloc (*size_ret);
+      memcpy (*data_ret, extval, *size_ret);
+#ifdef MULE
+      if (NILP (type)) type = QCOMPOUND_TEXT;
+#else
+      if (NILP (type)) type = QSTRING;
+#endif
+    }
+  else if (CHARP (obj))
+    {
+      Bufbyte buf[MAX_EMCHAR_LEN];
+      Bytecount len;
+      CONST Extbyte *extval;
+      Extcount extvallen;
+
+      *format_ret = 8;
+      len = set_charptr_emchar (buf, XCHAR (obj));
+      GET_CHARPTR_EXT_CTEXT_DATA_ALLOCA (buf, len, extval, extvallen);
+      *size_ret = extvallen;
+      *data_ret = (unsigned char *) xmalloc (*size_ret);
+      memcpy (*data_ret, extval, *size_ret);
+#ifdef MULE
+      if (NILP (type)) type = QCOMPOUND_TEXT;
+#else
+      if (NILP (type)) type = QSTRING;
+#endif
+    }
+  else if (SYMBOLP (obj))
+    {
+      *format_ret = 32;
+      *size_ret = 1;
+      *data_ret = (unsigned char *) xmalloc (sizeof (Atom) + 1);
+      (*data_ret) [sizeof (Atom)] = 0;
+      (*(Atom **) data_ret) [0] = symbol_to_x_atom (d, obj, 0);
+      if (NILP (type)) type = QATOM;
+    }
+  else if (INTP (obj) &&
+          XINT (obj) <= 0x7FFF &&
+          XINT (obj) >= -0x8000)
+    {
+      *format_ret = 16;
+      *size_ret = 1;
+      *data_ret = (unsigned char *) xmalloc (sizeof (short) + 1);
+      (*data_ret) [sizeof (short)] = 0;
+      (*(short **) data_ret) [0] = (short) XINT (obj);
+      if (NILP (type)) type = QINTEGER;
+    }
+  else if (INTP (obj) || CONSP (obj))
+    {
+      *format_ret = 32;
+      *size_ret = 1;
+      *data_ret = (unsigned char *) xmalloc (sizeof (long) + 1);
+      (*data_ret) [sizeof (long)] = 0;
+      (*(unsigned long **) data_ret) [0] = lisp_to_word (obj);
+      if (NILP (type)) type = QINTEGER;
+    }
+  else if (VECTORP (obj))
+    {
+      /* Lisp Vectors may represent a set of ATOMs;
+        a set of 16 or 32 bit INTEGERs;
+        or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...]
+       */
+      int i;
+
+      if (SYMBOLP (XVECTOR_DATA (obj) [0]))
+       /* This vector is an ATOM set */
+       {
+         if (NILP (type)) type = QATOM;
+         *size_ret = XVECTOR_LENGTH (obj);
+         *format_ret = 32;
+         *data_ret = (unsigned char *) xmalloc ((*size_ret) * sizeof (Atom));
+         for (i = 0; i < (int) (*size_ret); i++)
+           if (SYMBOLP (XVECTOR_DATA (obj) [i]))
+             (*(Atom **) data_ret) [i] =
+               symbol_to_x_atom (d, XVECTOR_DATA (obj) [i], 0);
+           else
+              signal_error (Qerror, /* Qselection_error */
+                            list2 (build_string
+                  ("all elements of the vector must be of the same type"),
+                                   obj));
+       }
+#if 0 /* #### MULTIPLE doesn't work yet */
+      else if (VECTORP (XVECTOR_DATA (obj) [0]))
+       /* This vector is an ATOM_PAIR set */
+       {
+         if (NILP (type)) type = QATOM_PAIR;
+         *size_ret = XVECTOR_LENGTH (obj);
+         *format_ret = 32;
+         *data_ret = (unsigned char *)
+           xmalloc ((*size_ret) * sizeof (Atom) * 2);
+         for (i = 0; i < *size_ret; i++)
+           if (VECTORP (XVECTOR_DATA (obj) [i]))
+             {
+               Lisp_Object pair = XVECTOR_DATA (obj) [i];
+               if (XVECTOR_LENGTH (pair) != 2)
+                 signal_error (Qerror,
+                                list2 (build_string
+       ("elements of the vector must be vectors of exactly two elements"),
+                                 pair));
+
+               (*(Atom **) data_ret) [i * 2] =
+                 symbol_to_x_atom (d, XVECTOR_DATA (pair) [0], 0);
+               (*(Atom **) data_ret) [(i * 2) + 1] =
+                 symbol_to_x_atom (d, XVECTOR_DATA (pair) [1], 0);
+             }
+           else
+             signal_error (Qerror,
+                            list2 (build_string
+                  ("all elements of the vector must be of the same type"),
+                                   obj));
+       }
+#endif
+      else
+       /* This vector is an INTEGER set, or something like it */
+       {
+         *size_ret = XVECTOR_LENGTH (obj);
+         if (NILP (type)) type = QINTEGER;
+         *format_ret = 16;
+         for (i = 0; i < (int) (*size_ret); i++)
+           if (CONSP (XVECTOR_DATA (obj) [i]))
+             *format_ret = 32;
+           else if (!INTP (XVECTOR_DATA (obj) [i]))
+             signal_error (Qerror, /* Qselection_error */
+                            list2 (build_string
+       ("all elements of the vector must be integers or conses of integers"),
+                                   obj));
+
+         *data_ret = (unsigned char *) xmalloc (*size_ret * (*format_ret/8));
+         for (i = 0; i < (int) (*size_ret); i++)
+           if (*format_ret == 32)
+             (*((unsigned long **) data_ret)) [i] =
+               lisp_to_word (XVECTOR_DATA (obj) [i]);
+           else
+             (*((unsigned short **) data_ret)) [i] =
+               (unsigned short) lisp_to_word (XVECTOR_DATA (obj) [i]);
+       }
+    }
+  else
+    signal_error (Qerror, /* Qselection_error */
+                  list2 (build_string ("unrecognized selection data"),
+                         obj));
+
+  *type_ret = symbol_to_x_atom (d, type, 0);
+}
+
+static Lisp_Object
+clean_local_selection_data (Lisp_Object obj)
+{
+  if (CONSP (obj) &&
+      INTP (XCAR (obj)) &&
+      CONSP (XCDR (obj)) &&
+      INTP (XCAR (XCDR (obj))) &&
+      NILP (XCDR (XCDR (obj))))
+    obj = Fcons (XCAR (obj), XCDR (obj));
+
+  if (CONSP (obj) &&
+      INTP (XCAR (obj)) &&
+      INTP (XCDR (obj)))
+    {
+      if (XINT (XCAR (obj)) == 0)
+       return XCDR (obj);
+      if (XINT (XCAR (obj)) == -1)
+       return make_int (- XINT (XCDR (obj)));
+    }
+  if (VECTORP (obj))
+    {
+      int i;
+      int len = XVECTOR_LENGTH (obj);
+      Lisp_Object copy;
+      if (len == 1)
+       return clean_local_selection_data (XVECTOR_DATA (obj) [0]);
+      copy = make_vector (len, Qnil);
+      for (i = 0; i < len; i++)
+       XVECTOR_DATA (copy) [i] =
+         clean_local_selection_data (XVECTOR_DATA (obj) [i]);
+      return copy;
+    }
+  return obj;
+}
+
+\f
+/* Called from the event loop to handle SelectionNotify events.
+   I don't think this needs to be reentrant.
+ */
+void
+x_handle_selection_notify (XSelectionEvent *event)
+{
+  if (! reading_selection_reply)
+    message ("received an unexpected SelectionNotify event");
+  else if (event->requestor != reading_selection_reply)
+    message ("received a SelectionNotify event for the wrong window");
+  else if (event->selection != reading_which_selection)
+    message ("received the wrong selection type in SelectionNotify!");
+  else
+    reading_selection_reply = 0; /* we're done now. */
+}
+
+\f
+DEFUN ("x-own-selection-internal", Fx_own_selection_internal, 2, 2, 0, /*
+Assert an X selection of the given TYPE with the given VALUE.
+TYPE is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD.
+VALUE is typically a string, or a cons of two markers, but may be
+anything that the functions on selection-converter-alist know about.
+*/
+       (selection_name, selection_value))
+{
+  CHECK_SYMBOL (selection_name);
+  if (NILP (selection_value)) error ("selection-value may not be nil.");
+  x_own_selection (selection_name, selection_value);
+  return selection_value;
+}
+
+
+/* Request the selection value from the owner.  If we are the owner,
+   simply return our selection value.  If we are not the owner, this
+   will block until all of the data has arrived.
+ */
+DEFUN ("x-get-selection-internal", Fx_get_selection_internal, 2, 2, 0, /*
+Return text selected from some X window.
+SELECTION_SYMBOL is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD.
+TARGET_TYPE is the type of data desired, typically STRING or COMPOUND_TEXT.
+Under Mule, if the resultant data comes back as 8-bit data in type
+TEXT or COMPOUND_TEXT, it will be decoded as Compound Text.
+*/
+       (selection_symbol, target_type))
+{
+  /* This function can GC */
+  Lisp_Object val = Qnil;
+  struct gcpro gcpro1, gcpro2;
+  GCPRO2 (target_type, val); /* we store newly consed data into these */
+  CHECK_SYMBOL (selection_symbol);
+
+#if 0 /* #### MULTIPLE doesn't work yet */
+  if (CONSP (target_type) &&
+      XCAR (target_type) == QMULTIPLE)
+    {
+      CHECK_VECTOR (XCDR (target_type));
+      /* So we don't destructively modify this... */
+      target_type = copy_multiple_data (target_type);
+    }
+  else
+#endif
+    CHECK_SYMBOL (target_type);
+
+  val = x_get_local_selection (selection_symbol, target_type);
+
+  if (NILP (val))
+    {
+      val = x_get_foreign_selection (selection_symbol, target_type);
+    }
+  else
+    {
+      if (CONSP (val) && SYMBOLP (XCAR (val)))
+       {
+         val = XCDR (val);
+         if (CONSP (val) && NILP (XCDR (val)))
+           val = XCAR (val);
+       }
+      val = clean_local_selection_data (val);
+    }
+  UNGCPRO;
+  return val;
+}
+
+DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, 1, 2, 0, /*
+If we own the named selection, then disown it (make there be no selection).
+*/
+       (selection, timeval))
+{
+  struct device *d = decode_x_device (Qnil);
+  Display *display = DEVICE_X_DISPLAY (d);
+  Time timestamp;
+  Atom selection_atom;
+  XSelectionClearEvent event;
+
+  CHECK_SYMBOL (selection);
+  if (NILP (timeval))
+    timestamp = DEVICE_X_MOUSE_TIMESTAMP (d);
+  else
+    {
+      /* #### This is bogus.  See the comment above about problems
+        on OSF/1 and DEC Alphas.  Yet another reason why it sucks
+        to have the implementation (i.e. cons of two 16-bit
+        integers) exposed. */
+      time_t the_time;
+      lisp_to_time (timeval, &the_time);
+      timestamp = (Time) the_time;
+    }
+
+  if (NILP (assq_no_quit (selection, Vselection_alist)))
+    return Qnil;  /* Don't disown the selection when we're not the owner. */
+
+  selection_atom = symbol_to_x_atom (d, selection, 0);
+
+  XSetSelectionOwner (display, selection_atom, None, timestamp);
+
+  /* It doesn't seem to be guaranteed that a SelectionClear event will be
+     generated for a window which owns the selection when that window sets
+     the selection owner to None.  The NCD server does, the MIT Sun4 server
+     doesn't.  So we synthesize one; this means we might get two, but
+     that's ok, because the second one won't have any effect.
+   */
+  event.display = display;
+  event.selection = selection_atom;
+  event.time = timestamp;
+  x_handle_selection_clear (&event);
+
+  return Qt;
+}
+
+
+DEFUN ("x-selection-owner-p", Fx_selection_owner_p, 0, 1, 0, /*
+Return t if current emacs process owns the given X Selection.
+The arg should be the name of the selection in question, typically one of
+the symbols PRIMARY, SECONDARY, or CLIPBOARD.  (For convenience, the symbol
+nil is the same as PRIMARY, and t is the same as SECONDARY.)
+*/
+       (selection))
+{
+  CHECK_SYMBOL (selection);
+  if      (EQ (selection, Qnil)) selection = QPRIMARY;
+  else if (EQ (selection, Qt))   selection = QSECONDARY;
+
+  return NILP (Fassq (selection, Vselection_alist)) ? Qnil : Qt;
+}
+
+DEFUN ("x-selection-exists-p", Fx_selection_exists_p, 0, 1, 0, /*
+Whether there is an owner for the given X Selection.
+The arg should be the name of the selection in question, typically one of
+the symbols PRIMARY, SECONDARY, or CLIPBOARD.  (For convenience, the symbol
+nil is the same as PRIMARY, and t is the same as SECONDARY.)
+*/
+       (selection))
+{
+  struct device *d = decode_x_device (Qnil);
+  Display *dpy = DEVICE_X_DISPLAY (d);
+  CHECK_SYMBOL (selection);
+  if (!NILP (Fx_selection_owner_p (selection)))
+    return Qt;
+  return XGetSelectionOwner (dpy, symbol_to_x_atom (d, selection, 0)) != None ?
+    Qt : Qnil;
+}
+
+\f
+#ifdef CUT_BUFFER_SUPPORT
+
+static int cut_buffers_initialized; /* Whether we're sure they all exist */
+
+/* Ensure that all 8 cut buffers exist.  ICCCM says we gotta... */
+static void
+initialize_cut_buffers (Display *display, Window window)
+{
+  static unsigned CONST char * CONST data = (unsigned CONST char *) "";
+#define FROB(atom) XChangeProperty (display, window, atom, XA_STRING, 8, \
+                                   PropModeAppend, data, 0)
+  FROB (XA_CUT_BUFFER0);
+  FROB (XA_CUT_BUFFER1);
+  FROB (XA_CUT_BUFFER2);
+  FROB (XA_CUT_BUFFER3);
+  FROB (XA_CUT_BUFFER4);
+  FROB (XA_CUT_BUFFER5);
+  FROB (XA_CUT_BUFFER6);
+  FROB (XA_CUT_BUFFER7);
+#undef FROB
+  cut_buffers_initialized = 1;
+}
+
+#define CHECK_CUTBUFFER(symbol)                                                \
+  { CHECK_SYMBOL (symbol);                                             \
+    if (!EQ((symbol),QCUT_BUFFER0) && !EQ((symbol),QCUT_BUFFER1) &&    \
+       !EQ((symbol),QCUT_BUFFER2) && !EQ((symbol),QCUT_BUFFER3) &&     \
+       !EQ((symbol),QCUT_BUFFER4) && !EQ((symbol),QCUT_BUFFER5) &&     \
+       !EQ((symbol),QCUT_BUFFER6) && !EQ((symbol),QCUT_BUFFER7))       \
+      signal_error (Qerror, list2 (build_string ("Doesn't name a cutbuffer"), \
+                                   (symbol))); \
+  }
+
+DEFUN ("x-get-cutbuffer-internal", Fx_get_cutbuffer_internal, 1, 1, 0, /*
+Return the value of the named CUTBUFFER (typically CUT_BUFFER0).
+*/
+       (cutbuffer))
+{
+  struct device *d = decode_x_device (Qnil);
+  Display *display = DEVICE_X_DISPLAY (d);
+  Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */
+  Atom cut_buffer_atom;
+  unsigned char *data;
+  int bytes;
+  Atom type;
+  int format;
+  unsigned long size;
+  Lisp_Object ret;
+
+  CHECK_CUTBUFFER (cutbuffer);
+  cut_buffer_atom = symbol_to_x_atom (d, cutbuffer, 0);
+
+  x_get_window_property (display, window, cut_buffer_atom, &data, &bytes,
+                        &type, &format, &size, 0);
+  if (!data) return Qnil;
+
+  if (format != 8 || type != XA_STRING)
+    signal_simple_error_2 ("Cut buffer doesn't contain 8-bit STRING data",
+                          x_atom_to_symbol (d, type),
+                          make_int (format));
+
+  /* We cheat - if the string contains an ESC character, that's
+     technically not allowed in a STRING, so we assume it's
+     COMPOUND_TEXT that we stored there ourselves earlier,
+     in x-store-cutbuffer-internal  */
+  ret = (bytes ?
+        make_ext_string (data, bytes,
+                         memchr (data, 0x1b, bytes) ?
+                         FORMAT_CTEXT : FORMAT_BINARY)
+        : Qnil);
+  xfree (data);
+  return ret;
+}
+
+
+DEFUN ("x-store-cutbuffer-internal", Fx_store_cutbuffer_internal, 2, 2, 0, /*
+Set the value of the named CUTBUFFER (typically CUT_BUFFER0) to STRING.
+*/
+       (cutbuffer, string))
+{
+  struct device *d = decode_x_device (Qnil);
+  Display *display = DEVICE_X_DISPLAY (d);
+  Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */
+  Atom cut_buffer_atom;
+  CONST Extbyte *data  = XSTRING_DATA (string);
+  Extcount bytes = XSTRING_LENGTH (string);
+  Extcount bytes_remaining;
+  int max_bytes = SELECTION_QUANTUM (display);
+#ifdef MULE
+  CONST Bufbyte *ptr, *end;
+  enum { ASCII, LATIN_1, WORLD } chartypes = ASCII;
+#endif
+
+  if (max_bytes > MAX_SELECTION_QUANTUM)
+    max_bytes = MAX_SELECTION_QUANTUM;
+
+  CHECK_CUTBUFFER (cutbuffer);
+  CHECK_STRING (string);
+  cut_buffer_atom = symbol_to_x_atom (d, cutbuffer, 0);
+
+  if (! cut_buffers_initialized)
+    initialize_cut_buffers (display, window);
+
+  /* We use the STRING encoding (Latin-1 only) if we can, else COMPOUND_TEXT.
+     We cheat and use type = `STRING' even when using COMPOUND_TEXT.
+     The ICCCM requires that this be so, and other clients assume it,
+     as we do ourselves in initialize_cut_buffers.  */
+
+#ifdef MULE
+  /* Optimize for the common ASCII case */
+  for (ptr = data, end = ptr + bytes; ptr <= end; )
+    {
+      if (BYTE_ASCII_P (*ptr))
+       {
+         ptr++;
+         continue;
+       }
+
+      if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1 ||
+         (*ptr) == LEADING_BYTE_CONTROL_1)
+       {
+         chartypes = LATIN_1;
+         ptr += 2;
+         continue;
+       }
+
+      chartypes = WORLD;
+      break;
+    }
+
+  if (chartypes == LATIN_1)
+    GET_STRING_BINARY_DATA_ALLOCA (string, data, bytes);
+  else if (chartypes == WORLD)
+    GET_STRING_CTEXT_DATA_ALLOCA  (string, data, bytes);
+#endif /* MULE */
+
+  bytes_remaining = bytes;
+
+  while (bytes_remaining)
+    {
+      int chunk = bytes_remaining < max_bytes ? bytes_remaining : max_bytes;
+      XChangeProperty (display, window, cut_buffer_atom, XA_STRING, 8,
+                      (bytes_remaining == bytes
+                       ? PropModeReplace : PropModeAppend),
+                      data, chunk);
+      data += chunk;
+      bytes_remaining -= chunk;
+    }
+  return string;
+}
+
+
+DEFUN ("x-rotate-cutbuffers-internal", Fx_rotate_cutbuffers_internal, 1, 1, 0, /*
+Rotate the values of the cutbuffers by the given number of steps;
+positive means move values forward, negative means backward.
+*/
+       (n))
+{
+  struct device *d = decode_x_device (Qnil);
+  Display *display = DEVICE_X_DISPLAY (d);
+  Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */
+  Atom props [8];
+
+  CHECK_INT (n);
+  if (XINT (n) == 0)
+    return n;
+  if (! cut_buffers_initialized)
+    initialize_cut_buffers (display, window);
+  props[0] = XA_CUT_BUFFER0;
+  props[1] = XA_CUT_BUFFER1;
+  props[2] = XA_CUT_BUFFER2;
+  props[3] = XA_CUT_BUFFER3;
+  props[4] = XA_CUT_BUFFER4;
+  props[5] = XA_CUT_BUFFER5;
+  props[6] = XA_CUT_BUFFER6;
+  props[7] = XA_CUT_BUFFER7;
+  XRotateWindowProperties (display, window, props, 8, XINT (n));
+  return n;
+}
+
+#endif /* CUT_BUFFER_SUPPORT */
+
+
+\f
+/************************************************************************/
+/*                            initialization                            */
+/************************************************************************/
+
+void
+syms_of_xselect (void)
+{
+  DEFSUBR (Fx_get_selection_internal);
+  DEFSUBR (Fx_own_selection_internal);
+  DEFSUBR (Fx_disown_selection_internal);
+  DEFSUBR (Fx_selection_owner_p);
+  DEFSUBR (Fx_selection_exists_p);
+
+#ifdef CUT_BUFFER_SUPPORT
+  DEFSUBR (Fx_get_cutbuffer_internal);
+  DEFSUBR (Fx_store_cutbuffer_internal);
+  DEFSUBR (Fx_rotate_cutbuffers_internal);
+#endif /* CUT_BUFFER_SUPPORT */
+
+  /* Unfortunately, timeout handlers must be lisp functions. */
+  defsymbol (&Qx_selection_reply_timeout_internal,
+             "x-selection-reply-timeout-internal");
+  DEFSUBR (Fx_selection_reply_timeout_internal);
+
+  defsymbol (&QPRIMARY, "PRIMARY");
+  defsymbol (&QSECONDARY, "SECONDARY");
+  defsymbol (&QSTRING, "STRING");
+  defsymbol (&QINTEGER, "INTEGER");
+  defsymbol (&QCLIPBOARD, "CLIPBOARD");
+  defsymbol (&QTIMESTAMP, "TIMESTAMP");
+  defsymbol (&QTEXT, "TEXT");
+  defsymbol (&QDELETE, "DELETE");
+  defsymbol (&QMULTIPLE, "MULTIPLE");
+  defsymbol (&QINCR, "INCR");
+  defsymbol (&QEMACS_TMP, "_EMACS_TMP_");
+  defsymbol (&QTARGETS, "TARGETS");
+  defsymbol (&QATOM, "ATOM");
+  defsymbol (&QATOM_PAIR, "ATOM_PAIR");
+  defsymbol (&QCOMPOUND_TEXT, "COMPOUND_TEXT");
+  defsymbol (&QNULL, "NULL");
+
+#ifdef CUT_BUFFER_SUPPORT
+  defsymbol (&QCUT_BUFFER0, "CUT_BUFFER0");
+  defsymbol (&QCUT_BUFFER1, "CUT_BUFFER1");
+  defsymbol (&QCUT_BUFFER2, "CUT_BUFFER2");
+  defsymbol (&QCUT_BUFFER3, "CUT_BUFFER3");
+  defsymbol (&QCUT_BUFFER4, "CUT_BUFFER4");
+  defsymbol (&QCUT_BUFFER5, "CUT_BUFFER5");
+  defsymbol (&QCUT_BUFFER6, "CUT_BUFFER6");
+  defsymbol (&QCUT_BUFFER7, "CUT_BUFFER7");
+#endif /* CUT_BUFFER_SUPPORT */
+
+  deferror (&Qselection_conversion_error,
+           "selection-conversion-error",
+           "selection-conversion error", Qio_error);
+}
+
+void
+vars_of_xselect (void)
+{
+#ifdef CUT_BUFFER_SUPPORT
+  cut_buffers_initialized = 0;
+  Fprovide (intern ("cut-buffer"));
+#endif
+
+  reading_selection_reply = 0;
+  reading_which_selection = 0;
+  selection_reply_timed_out = 0;
+  for_whom_the_bell_tolls = 0;
+  prop_location_tick = 0;
+
+  Vselection_alist = Qnil;
+  staticpro (&Vselection_alist);
+
+  DEFVAR_LISP ("selection-converter-alist", &Vselection_converter_alist /*
+An alist associating selection-types (such as STRING and TIMESTAMP) with
+functions.  These functions will be called with three args: the name of the
+selection (typically PRIMARY, SECONDARY, or CLIPBOARD); a desired type to
+which the selection should be converted; and the local selection value
+ (whatever had been passed to `x-own-selection').  These functions should
+return the value to send to the X server, which should be one of:
+
+-- nil (the conversion could not be done)
+-- a cons of a symbol and any of the following values; the symbol
+   explicitly specifies the type that will be sent.
+-- a string (If the type is not specified, then if Mule support exists,
+             the string will be converted to Compound Text and sent in
+             the 'COMPOUND_TEXT format; otherwise (no Mule support),
+             the string will be left as-is and sent in the 'STRING
+             format.  If the type is specified, the string will be
+             left as-is (or converted to binary format under Mule).
+             In all cases, 8-bit data it sent.)
+-- a character (With Mule support, will be converted to Compound Text
+                whether or not a type is specified.  If a type is not
+                specified, a type of 'STRING or 'COMPOUND_TEXT will be
+               sent, as for strings.)
+-- the symbol 'NULL (Indicates that there is no meaningful return value.
+                     Empty 32-bit data with a type of 'NULL will be sent.)
+-- a symbol (Will be converted into an atom.  If the type is not specified,
+             a type of 'ATOM will be sent.)
+-- an integer (Will be converted into a 16-bit or 32-bit integer depending
+               on the value.  If the type is not specified, a type of
+              'INTEGER will be sent.)
+-- a cons (HIGH . LOW) of integers (Will be converted into a 32-bit integer.
+                                    If the type is not specified, a type of
+                                   'INTEGER will be sent.)
+-- a vector of symbols (Will be converted into a list of atoms.  If the type
+                        is not specified, a type of 'ATOM will be sent.)
+-- a vector of integers (Will be converted into a list of 16-bit integers.
+                         If the type is not specified, a type of 'INTEGER
+                        will be sent.)
+-- a vector of integers and/or conses (HIGH . LOW) of integers
+                        (Will be converted into a list of 16-bit integers.
+                         If the type is not specified, a type of 'INTEGER
+                        will be sent.)
+*/ );
+  Vselection_converter_alist = Qnil;
+
+  DEFVAR_LISP ("x-lost-selection-hooks", &Vx_lost_selection_hooks /*
+A function or functions to be called after the X server has notified us
+that we have lost the selection.  The function(s) will be called with one
+argument, a symbol naming the selection (typically PRIMARY, SECONDARY, or
+CLIPBOARD).
+*/ );
+  Vx_lost_selection_hooks = Qunbound;
+
+  DEFVAR_LISP ("x-sent-selection-hooks", &Vx_sent_selection_hooks /*
+A function or functions to be called after we have responded to some
+other client's request for the value of a selection that we own.  The
+function(s) will be called with four arguments:
+  - the name of the selection (typically PRIMARY, SECONDARY, or CLIPBOARD);
+  - the name of the selection-type which we were requested to convert the
+    selection into before sending (for example, STRING or LENGTH);
+  - and whether we successfully transmitted the selection.
+We might have failed (and declined the request) for any number of reasons,
+including being asked for a selection that we no longer own, or being asked
+to convert into a type that we don't know about or that is inappropriate.
+This hook doesn't let you change the behavior of emacs's selection replies,
+it merely informs you that they have happened.
+*/ );
+  Vx_sent_selection_hooks = Qunbound;
+
+  DEFVAR_INT ("x-selection-timeout", &x_selection_timeout /*
+If the selection owner doesn't reply in this many seconds, we give up.
+A value of 0 means wait as long as necessary.  This is initialized from the
+\"*selectionTimeout\" resource (which is expressed in milliseconds).
+*/ );
+  x_selection_timeout = 0;
+}
+
+void
+Xatoms_of_xselect (struct device *d)
+{
+  Display *D = DEVICE_X_DISPLAY (d);
+
+  /* Non-predefined atoms that we might end up using a lot */
+  DEVICE_XATOM_CLIPBOARD     (d) = XInternAtom (D, "CLIPBOARD",     False);
+  DEVICE_XATOM_TIMESTAMP     (d) = XInternAtom (D, "TIMESTAMP",     False);
+  DEVICE_XATOM_TEXT          (d) = XInternAtom (D, "TEXT",          False);
+  DEVICE_XATOM_DELETE        (d) = XInternAtom (D, "DELETE",        False);
+  DEVICE_XATOM_MULTIPLE      (d) = XInternAtom (D, "MULTIPLE",      False);
+  DEVICE_XATOM_INCR          (d) = XInternAtom (D, "INCR",          False);
+  DEVICE_XATOM_TARGETS       (d) = XInternAtom (D, "TARGETS",       False);
+  DEVICE_XATOM_NULL          (d) = XInternAtom (D, "NULL",          False);
+  DEVICE_XATOM_ATOM_PAIR     (d) = XInternAtom (D, "ATOM_PAIR",     False);
+  DEVICE_XATOM_COMPOUND_TEXT (d) = XInternAtom (D, "COMPOUND_TEXT", False);
+  DEVICE_XATOM_EMACS_TMP     (d) = XInternAtom (D, "_EMACS_TMP_",   False);
+}
diff --git a/tests/basic-lisp.el b/tests/basic-lisp.el
new file mode 100644 (file)
index 0000000..07a2676
--- /dev/null
@@ -0,0 +1,89 @@
+;;; Test basic Lisp functionality
+
+;;(when (not (boundp 'foo)) (setq foo 1))
+;;(incf foo)
+;;(print foo)
+
+(let ((my-vector [1 2 3 4])
+      (my-bit-vector (bit-vector 1 0 1 0))
+      (my-string "1234")
+      (my-list '(1 2 3 4)))
+
+  ;;(Assert (fooooo)) ;; Generate Other failure
+  ;;(Assert (eq 1 2)) ;; Generate Assertion failure
+  
+  (Assert (eq (elt my-vector 0) 1))
+  (Assert (eq (elt my-bit-vector 0) 1))
+  (Assert (eq (elt my-string 0) ?1))
+  (Assert (eq (elt my-list 0) 1))
+
+  (Assert (eq 4 (length my-vector)))
+  (Assert (eq 4 (length my-bit-vector)))
+  (Assert (eq 4 (length my-string)))
+
+  (fillarray my-vector 5)
+  (fillarray my-bit-vector 1)
+  (fillarray my-string ?5)
+
+  (Assert (eq 4 (length my-vector)))
+  (Assert (eq 4 (length my-bit-vector)))
+  (Assert (eq 4 (length my-string)))
+
+  (Assert (eq (elt my-vector 0) 5))
+  (Assert (eq (elt my-bit-vector 0) 1))
+  (Assert (eq (elt my-string 0) ?5))
+
+  (Assert (eq (elt my-vector 3) 5))
+  (Assert (eq (elt my-bit-vector 3) 1))
+  (Assert (eq (elt my-string 3) ?5))
+
+  (fillarray my-bit-vector 0)
+  (Assert (eq 4 (length my-bit-vector)))
+  (Assert (eq (elt my-bit-vector 2) 0))
+
+  ;; Test nconc
+  (let ((x (list 0 1 2)))
+    (Assert (eq (nconc) nil))
+    (Assert (eq (nconc nil) nil))
+    (Assert (eq (nconc nil x) x))
+    (Assert (eq (nconc x nil) x))
+    (let ((y (nconc x nil (list 3 4 5) nil)))
+      (Assert (eq (length y) 6))
+      (Assert (eq (nth 3 y) 3))
+      ))
+  )
+
+;;; Old cruft
+;;;(run-tests)
+
+;(defmacro Assert (assertion)
+;  `(condition-case error
+;       (progn
+;       (assert ,assertion)
+;       (princ (format "Assertion passed: %S" (quote ,assertion)))
+;       (terpri)
+;       (incf Assert-successes))
+;     (cl-assertion-failed
+;      (princ (format "Assertion failed: %S" (quote ,assertion)))
+;      (terpri)
+;      (incf Assert-failures))
+;     (t (princ (format "Test harness error: %S" error))
+;      (terpri)
+;      (incf Harness-failures)
+;      )))
+
+
+;(defun run-tests ()
+;  (with-output-to-temp-buffer "*Test-Log*"
+;    (let ((Assert-successes 0)
+;        (Assert-failures  0)
+;        (Harness-failures 0))
+;      (basic-lisp-test)
+;      (byte-compile 'basic-lisp-test)
+;      (basic-lisp-test)
+;      (print (format "%d successes, %d assertion failures, %d harness failures"
+;                   Assert-successes
+;                   Assert-failures
+;                   Harness-failures)))))
+
+;(defun the-test ()
diff --git a/tests/database.el b/tests/database.el
new file mode 100644 (file)
index 0000000..bc133df
--- /dev/null
@@ -0,0 +1,29 @@
+;;; Test database functionality
+
+(defun test-database (db)
+  (Assert (databasep db))
+  (put-database "key1" "val1" db)
+  (Assert (equal "val1" (get-database "key1" db)))
+  (remove-database "key1" db)
+  (Assert (equal nil (get-database "key1" db)))
+  (close-database db)
+  (Assert (not (database-live-p db)))
+  (Assert (databasep db))
+  (let ((filename (database-file-name db)))
+    (loop for fn in (list filename (concat filename ".db")) do
+      (when (file-exists-p fn)
+       (delete-file fn))))
+  )
+
+(let ((filename (expand-file-name "test-emacs" (temp-directory))))
+
+  (when (featurep 'dbm)
+  (let ((db (open-database filename 'dbm)))
+    (test-database db)))
+  
+  (princ "\n")
+
+  (when (featurep 'berkeley-db)
+    (let ((db (open-database filename 'berkeley-db)))
+      (test-database db)))
+  )
diff --git a/tests/test-emacs.el b/tests/test-emacs.el
new file mode 100644 (file)
index 0000000..bd34433
--- /dev/null
@@ -0,0 +1,219 @@
+;; test-emacs.el --- Run Emacs Lisp test suites.
+
+;;; Copyright (C) 1998 Free Software Foundation, Inc.
+
+;; Author: Martin Buchholz
+;; Keywords: testing
+
+;; 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
+
+(defvar test-emacs-verbose
+  (and (not noninteractive) (> (device-baud-rate) search-slow-speed))
+  "*Non-nil means print messages describing progress of emacs-tester.")
+
+(defvar test-emacs-current-file nil)
+
+(defvar emacs-lisp-file-regexp (purecopy "\\.el$")
+  "*Regexp which matches Emacs Lisp source files.")
+
+(defun test-emacs-test-file (filename)
+  "Test a file of Lisp code named FILENAME.
+The output file's name is made by appending `c' to the end of FILENAME."
+  ;;  (interactive "fTest file: ")
+  (interactive
+   (let ((file buffer-file-name)
+        (file-name nil)
+        (file-dir nil))
+     (and file
+         (eq (cdr (assq 'major-mode (buffer-local-variables)))
+             'emacs-lisp-mode)
+         (setq file-name (file-name-nondirectory file)
+               file-dir (file-name-directory file)))
+     (list (read-file-name "Test file: " file-dir nil nil file-name))))
+  ;; Expand now so we get the current buffer's defaults
+  (setq filename (expand-file-name filename))
+
+  ;; If we're testing a file that's in a buffer and is modified, offer
+  ;; to save it first.
+  (or noninteractive
+      (let ((b (get-file-buffer (expand-file-name filename))))
+       (if (and b (buffer-modified-p b)
+                (y-or-n-p (format "save buffer %s first? " (buffer-name b))))
+           (save-excursion (set-buffer b) (save-buffer)))))
+
+  (if (or noninteractive test-emacs-verbose)
+      (message "Testing %s..." filename))
+  (let ((test-emacs-current-file filename)
+       input-buffer)
+    (save-excursion
+      (setq input-buffer (get-buffer-create " *Test Input*"))
+      (set-buffer input-buffer)
+      (erase-buffer)
+      (insert-file-contents filename)
+      ;; Run hooks including the uncompression hook.
+      ;; If they change the file name, then change it for the output also.
+      (let ((buffer-file-name filename)
+           (default-major-mode 'emacs-lisp-mode)
+           (enable-local-eval nil))
+        (normal-mode)
+        (setq filename buffer-file-name)))
+    (test-emacs-from-buffer input-buffer filename)
+    (kill-buffer input-buffer)
+    ))
+
+(defun test-emacs-read-from-buffer (buffer)
+  "Read forms from BUFFER, and turn it into a lambda test form."
+  (let ((body nil))
+    (goto-char (point-min) buffer)
+    (condition-case nil
+       (while t
+         (setq body (cons (read inbuffer) body)))
+      (error nil))
+    `(lambda ()
+       (defvar passes)
+       (defvar assertion-failures)
+       (defvar other-failures)
+       ,@(nreverse body))))
+
+(defun test-emacs-from-buffer (inbuffer filename)
+  "Run tests in buffer INBUFFER, visiting FILENAME."
+  (let ((passes 0)
+       (assertion-failures 0)
+       (other-failures 0))
+    (with-output-to-temp-buffer "*Test-Log*"
+      (defmacro Assert (assertion)
+       `(condition-case error
+            (progn
+              (assert ,assertion)
+              (princ (format "PASS: %S" (quote ,assertion)))
+              (terpri)
+              (incf passes))
+          (cl-assertion-failed
+           (princ (format "Assertion failed: %S" (quote ,assertion)))
+           (terpri)
+           (incf assertion-failures))
+          (t (princ "Error during test execution:\n\t")
+             (display-error error nil)
+             (terpri)
+             (incf other-failures)
+             )))
+
+      (princ "Testing Interpreted Lisp\n\n")
+      (funcall (test-emacs-read-from-buffer inbuffer))
+      (princ "\nTesting Compiled Lisp\n\n")
+      (funcall (byte-compile (test-emacs-read-from-buffer inbuffer)))
+      (princ (format
+             "\nSUMMARY: %d passes, %d assertion failures, %d other failures\n"
+             passes
+             assertion-failures
+             other-failures))
+      (let* ((total (+ passes assertion-failures other-failures))
+            (basename (file-name-nondirectory filename))
+            (summary-msg
+             (if (> total 0)
+                 (format "%s: %d of %d (%d%%) tests successful."
+                         basename passes total (/ (* 100 passes) total))
+               (format "%s: No tests run" basename))))
+       (message "%s" summary-msg))
+      (fmakunbound 'Assert))))
+
+(defvar test-emacs-results-point-max nil)
+(defmacro displaying-emacs-test-results (&rest body)
+  `(let ((test-emacs-results-point-max test-emacs-results-point-max))
+     ;; Log the file name.
+     (test-emacs-log-file)
+     ;; Record how much is logged now.
+     ;; We will display the log buffer if anything more is logged
+     ;; before the end of BODY.
+     (or test-emacs-results-point-max
+        (save-excursion
+          (set-buffer (get-buffer-create "*Test-Log*"))
+          (setq test-emacs-results-point-max (point-max))))
+     (unwind-protect
+        (condition-case error-info
+            (progn ,@body)
+          (error
+           (test-emacs-report-error error-info)))
+       (save-excursion
+        ;; If there were compilation warnings, display them.
+        (set-buffer "*Test-Log*")
+        (if (= test-emacs-results-point-max (point-max))
+            nil
+          (if temp-buffer-show-function
+              (let ((show-buffer (get-buffer-create "*Test-Log-Show*")))
+                (save-excursion
+                  (set-buffer show-buffer)
+                  (setq buffer-read-only nil)
+                  (erase-buffer))
+                (copy-to-buffer show-buffer
+                                (save-excursion
+                                  (goto-char test-emacs-results-point-max)
+                                  (forward-line -1)
+                                  (point))
+                                (point-max))
+                (funcall temp-buffer-show-function show-buffer))
+              (select-window
+               (prog1 (selected-window)
+                 (select-window (display-buffer (current-buffer)))
+                 (goto-char test-emacs-results-point-max)
+                 (recenter 1)))))))))
+
+(defun batch-test-emacs-1 (file)
+  (condition-case err
+      (progn (test-emacs-test-file file) t)
+    (error
+     (princ ">>Error occurred processing ")
+     (princ file)
+     (princ ": ")
+     (display-error err nil)
+     (terpri)
+     nil)))
+
+(defun batch-test-emacs ()
+  "Run `test-emacs' on the files remaining on the command line.
+Use this from the command line, with `-batch';
+it won't work in an interactive Emacs.
+Each file is processed even if an error occurred previously.
+For example, invoke \"xemacs -batch -f batch-test-emacs tests/*.el\""
+  ;; command-line-args-left is what is left of the command line (from
+  ;; startup.el)
+  (defvar command-line-args-left)      ;Avoid 'free variable' warning
+  (if (not noninteractive)
+      (error "`batch-test-emacs' is to be used only with -batch"))
+  (let ((error nil)
+       (debug-issue-ebola-notices 0))
+    (loop for file in command-line-args-left
+      do
+      (if (file-directory-p (expand-file-name file))
+         (let ((files (directory-files file))
+               source)
+           (while files
+             (if (and (string-match emacs-lisp-file-regexp (car files))
+                      (not (auto-save-file-name-p (car files)))
+                      (setq source (expand-file-name
+                                    (car files)
+                                    file))
+                      (if (null (batch-test-emacs-1 source))
+                          (setq error t)))
+                 (setq files (cdr files)))))
+       (if (null (batch-test-emacs-1 file))
+           (setq error t))))
+    (message "Done")
+    (kill-emacs (if error 1 0))))