changeset 814:a634e3b7acc8

[xemacs-hg @ 2002-04-14 12:41:59 by ben] latest changes TODO.ben-mule-21-5: Update. make-docfile.c: Add basic support for handling ISO 2022 doc strings -- we parse the basic charset designation sequences so we know whether we're in ASCII and have to pay attention to end quotes and such. Reformat code according to coding standards. abbrev.el: Add `global-abbrev-mode', which turns on or off abbrev-mode in all buffers. Added `defining-abbrev-turns-on-abbrev-mode' -- if non-nil, defining an abbrev through an interactive function will automatically turn on abbrev-mode, either globally or locally depending on the command. This is the "what you'd expect" behavior. indent.el: general function for indenting a balanced expression in a mode-correct way. Works similar to indent-region in that a mode can specify a specific command to do the whole operation; if not, figure out the region using forward-sexp and indent each line using indent-according-to-mode. keydefs.el: Removed. Modify M-C-backslash to do indent-region-or-balanced-expression. Make S-Tab just insert a TAB char, like it's meant to do. make-docfile.el: Now that we're using the call-process-in-lisp, we need to load an extra file win32-native.el because we're running a bare temacs. menubar-items.el: Totally redo the Cmds menu so that most used commands appear directly on the menu and less used commands appear in submenus. The old way may have been very pretty, but rather impractical. process.el: Under Windows, don't ever use old-call-process-internal, even in batch mode. We can do processes in batch mode. subr.el: Someone recoded truncate-string-to-width, saying "the FSF version is too complicated and does lots of hard-to-understand stuff" but the resulting recoded version was *totally* wrong! it misunderstood the basic point of this function, which is work in *columns* not chars. i dumped ours and copied the version from FSF 21.1. Also added truncate-string-with-continuation-dots, since this idiom is used often. config.inc.samp, xemacs.mak: Separate out debug and optimize flags. Remove all vestiges of USE_MINIMAL_TAGBITS, USE_INDEXED_LRECORD_IMPLEMENTATION, and GUNG_HO, since those ifdefs have long been removed. Make error-checking support actually work. Some rearrangement of config.inc.samp to make it more logical. Remove callproc.c and ntproc.c from xemacs.mak, no longer used. Make pdump the default. lisp.h: Add support for strong type-checking of Bytecount, Bytebpos, Charcount, Charbpos, and others, by making them classes, overloading the operators to provide integer-like operation and carefully controlling what operations are allowed. Not currently enabled in C++ builds because there are still a number of compile errors, and it won't really work till we merge in my "8-bit-Mule" workspace, in which I make use of the new types Charxpos, Bytexpos, Memxpos, representing a "position" either in a buffer or a string. (This is especially important in the extent code.) abbrev.c, alloc.c, eval.c, buffer.c, buffer.h, editfns.c, fns.c, text.h: Warning fixes, some of them related to new C++ strict type checking of Bytecount, Charbpos, etc. dired.c: Caught an actual error due to strong type checking -- char len being passed when should be byte len. alloc.c, backtrace.h, bytecode.c, bytecode.h, eval.c, sysdep.c: Further optimize Ffuncall: -- process arg list at compiled-function creation time, converting into an array for extra-quick access at funcall time. -- rewrite funcall_compiled_function to use it, and inline this function. -- change the order of check for magic stuff in SPECBIND_FAST_UNSAFE to be faster. -- move the check for need to garbage collect into the allocation code, so only a single flag needs to be checked in funcall. buffer.c, symbols.c: add debug funs to check on mule optimization info in buffers and strings. eval.c, emacs.c, text.c, regex.c, scrollbar-msw.c, search.c: Fix evil crashes due to eistrings not properly reinitialized under pdump. Redo a bit some of the init routines; convert some complex_vars_of() into simple vars_of(), because they didn't need complex processing. callproc.c, emacs.c, event-stream.c, nt.c, process.c, process.h, sysdep.c, sysdep.h, syssignal.h, syswindows.h, ntproc.c: Delete. Hallelujah, praise the Lord, there is no god but Allah!!! fix so that processes can be invoked in bare temacs -- thereby eliminating any need for callproc.c. (currently only eliminated under NT.) remove all crufty and unnecessary old process code in ntproc.c and elsewhere. move non-callproc-specific stuff (mostly environment) into process.c, so callproc.c can be left out under NT. console-tty.c, doc.c, file-coding.c, file-coding.h, lstream.c, lstream.h: fix doc string handling so it works with Japanese, etc docs. change handling of "character mode" so callers don't have to manually set it (quite error-prone). event-msw.c: spacing fixes. lread.c: eliminate unused crufty vintage-19 "FSF defun hack" code. lrecord.h: improve pdump description docs. buffer.c, ntheap.c, unexnt.c, win32.c, emacs.c: Mule-ize some unexec and startup code. It was pseudo-Mule-ized before by simply always calling the ...A versions of functions, but that won't cut it -- eventually we want to be able to run properly even if XEmacs has been installed in a Japanese directory. (The current problem is the timing of the loading of the Unicode tables; this will eventually be fixed.) Go through and fix various other places where the code was not Mule-clean. Provide a function mswindows_get_module_file_name() to get our own name without resort to PATH_MAX and such. Add a big comment in main() about the problem with Unicode table load timing that I just alluded to. emacs.c: When error-checking is enabled (interpreted as "user is developing XEmacs"), don't ask user to "pause to read messages" when a fatal error has occurred, because it will wedge if we are in an inner modal loop (typically when a menu is popped up) and make us unable to get a useful stack trace in the debugger. text.c: Correct update_entirely_ascii_p_flag to actually work. lisp.h, symsinit.h: declarations for above changes.
author ben
date Sun, 14 Apr 2002 12:43:31 +0000
parents 9541922fb765
children 66265f190a16
files ChangeLog TODO.ben-mule-21-5 configure lib-src/ChangeLog lib-src/make-docfile.c lisp/ChangeLog lisp/abbrev.el lisp/indent.el lisp/keydefs.el lisp/make-docfile.el lisp/menubar-items.el lisp/process.el lisp/subr.el nt/ChangeLog nt/config.inc.samp nt/xemacs.mak src/ChangeLog src/abbrev.c src/alloc.c src/backtrace.h src/buffer.c src/buffer.h src/bytecode.c src/bytecode.h src/callproc.c src/console-tty.c src/dired.c src/doc.c src/editfns.c src/emacs.c src/eval.c src/event-msw.c src/event-stream.c src/file-coding.c src/file-coding.h src/fileio.c src/fns.c src/lisp.h src/lread.c src/lrecord.h src/lstream.c src/lstream.h src/nt.c src/ntheap.c src/ntproc.c src/process.c src/process.h src/regex.c src/scrollbar-msw.c src/search.c src/symbols.c src/symsinit.h src/sysdep.c src/sysdep.h src/syssignal.h src/syswindows.h src/text.c src/text.h src/unexnt.c src/win32.c
diffstat 60 files changed, 3516 insertions(+), 3457 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Apr 13 20:44:53 2002 +0000
+++ b/ChangeLog	Sun Apr 14 12:43:31 2002 +0000
@@ -1,3 +1,9 @@
+2002-04-14  Ben Wing  <ben@xemacs.org>
+
+	* TODO.ben-mule-21-5:
+	* TODO.ben-mule-21-5 (Priority): New.
+	Update.
+
 2002-04-05  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.6 "bok choi" is released.
--- a/TODO.ben-mule-21-5	Sat Apr 13 20:44:53 2002 +0000
+++ b/TODO.ben-mule-21-5	Sun Apr 14 12:43:31 2002 +0000
@@ -1,3 +1,15 @@
+April 11, 2002:
+
+Priority:
+
+1. Finish checking in current mule ws.
+2. Start working on bugs reported by others and noticed by me:
+   -- problems cutting and pasting binary data, e.g. from byte-compiler instructions
+   -- test suite failures
+   -- process i/o problems w.r.t. eol: |uniq (e.g.) leaves ^M's at end of
+      line; running "bash" as shell-file-name doesn't work because it doesn't
+      like the extra ^M's.
+
 March 20, 2002:
 
 bugs:
--- a/configure	Sat Apr 13 20:44:53 2002 +0000
+++ b/configure	Sun Apr 14 12:43:31 2002 +0000
@@ -4485,7 +4485,6 @@
 #line 4486 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -4494,7 +4493,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:4498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -4522,13 +4521,12 @@
   exit 1
 fi
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:4526: checking size of int" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4529 "configure"
+echo "configure:4525: checking size of int" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4528 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -4537,7 +4535,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:4541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -4559,13 +4557,12 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:4563: checking size of long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4566 "configure"
+echo "configure:4561: checking size of long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4564 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -4574,7 +4571,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:4578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -4596,13 +4593,12 @@
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:4600: checking size of long long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4603 "configure"
+echo "configure:4597: checking size of long long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4600 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -4611,7 +4607,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4611: \"$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
@@ -4633,13 +4629,12 @@
 
 
 echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:4637: checking size of void *" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4640 "configure"
+echo "configure:4633: checking size of void *" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4636 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -4648,7 +4643,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:4652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4647: \"$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
@@ -4671,7 +4666,7 @@
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:4675: checking for long file names" >&5
+echo "configure:4670: 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:
@@ -4717,10 +4712,10 @@
 
 
 echo $ac_n "checking for sin""... $ac_c" 1>&6
-echo "configure:4721: checking for sin" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4724 "configure"
+echo "configure:4716: checking for sin" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4719 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char sin(); below.  */
@@ -4743,7 +4738,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_sin=yes"
 else
@@ -4761,12 +4756,12 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:4765: checking for sin in -lm" >&5
+echo "configure:4760: 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 4770 "configure"
+#line 4765 "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
@@ -4777,7 +4772,7 @@
 sin()
 ; return 0; }
 EOF
-if { (eval echo configure:4781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4821,14 +4816,14 @@
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4825 "configure"
+#line 4820 "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:4832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_INVERSE_HYPERBOLIC
@@ -4847,10 +4842,10 @@
 for ac_func in mkstemp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4851: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4854 "configure"
+echo "configure:4846: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4849 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4873,7 +4868,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4902,14 +4897,14 @@
 
 
 echo "checking type of mail spool file locking" 1>&6
-echo "configure:4906: checking type of mail spool file locking" >&5
+echo "configure:4901: checking type of mail spool file locking" >&5
 for ac_func in lockf flock
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4910: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4913 "configure"
+echo "configure:4905: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4908 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4932,7 +4927,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5014,12 +5009,12 @@
 case "$opsys" in decosf*)
   
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:5018: checking for cma_open in -lpthreads" >&5
+echo "configure:5013: 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 5023 "configure"
+#line 5018 "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
@@ -5030,7 +5025,7 @@
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5067,7 +5062,7 @@
 
 
 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
-echo "configure:5071: checking whether the -xildoff compiler flag is required" >&5
+echo "configure:5066: 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;
@@ -5079,7 +5074,7 @@
 if test "$opsys" = "sol2"; then
   if test "$os_release" -ge 56; then
     echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
-echo "configure:5083: checking for \"-z ignore\" linker flag" >&5
+echo "configure:5078: 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 ;;
@@ -5090,7 +5085,7 @@
 
 if test "$pdump" != "yes"; then
   echo $ac_n "checking for \"-z nocombreloc\" linker flag""... $ac_c" 1>&6
-echo "configure:5094: checking for \"-z nocombreloc\" linker flag" >&5
+echo "configure:5089: checking for \"-z nocombreloc\" linker flag" >&5
   case "`ld --help 2>&1`" in
     *-z\ nocombreloc* ) echo "$ac_t""yes" 1>&6
       ld_switch_site="-z nocombreloc $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z nocombreloc\" to \$ld_switch_site"; fi ;;
@@ -5100,7 +5095,7 @@
 
 
 echo "checking "for specified window system"" 1>&6
-echo "configure:5104: checking "for specified window system"" >&5
+echo "configure:5099: checking "for specified window system"" >&5
 
 
 GNOME_CONFIG=no
@@ -5108,7 +5103,7 @@
 
 if test "$with_gnome" != "no"; then
    echo $ac_n "checking for GNOME configuration script""... $ac_c" 1>&6
-echo "configure:5112: checking for GNOME configuration script" >&5
+echo "configure:5107: checking for GNOME configuration script" >&5
    for possible in gnome-config
    do
       possible_version=`${possible} --version 2> /dev/null`
@@ -5139,7 +5134,7 @@
 
 if test "$with_gtk" != "no";then
    echo $ac_n "checking for GTK configuration script""... $ac_c" 1>&6
-echo "configure:5143: checking for GTK configuration script" >&5
+echo "configure:5138: checking for GTK configuration script" >&5
    for possible in gtk12-config gtk14-config gtk-config
    do
       possible_version=`${possible} --version 2> /dev/null`
@@ -5161,18 +5156,18 @@
 
 if test "${GTK_CONFIG}" != "no"; then
       echo $ac_n "checking gtk version""... $ac_c" 1>&6
-echo "configure:5165: checking gtk version" >&5
+echo "configure:5160: checking gtk version" >&5
       GTK_VERSION=`${GTK_CONFIG} --version`
       echo "$ac_t""${GTK_VERSION}" 1>&6
 
       echo $ac_n "checking gtk libs""... $ac_c" 1>&6
-echo "configure:5170: checking gtk libs" >&5
+echo "configure:5165: checking gtk libs" >&5
       GTK_LIBS=`${GTK_CONFIG} --libs`
       libs_gtk="$libs_gtk ${GTK_LIBS}" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"${GTK_LIBS}\" to \$libs_gtk"; fi
       echo "$ac_t""${GTK_LIBS}" 1>&6
 
       echo $ac_n "checking gtk cflags""... $ac_c" 1>&6
-echo "configure:5176: checking gtk cflags" >&5
+echo "configure:5171: checking gtk cflags" >&5
       GTK_CFLAGS=`${GTK_CONFIG} --cflags`
       if test "$GCC" = "yes"; then
       	GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow"
@@ -5182,19 +5177,19 @@
 
       
 echo $ac_n "checking for main in -lgdk_imlib""... $ac_c" 1>&6
-echo "configure:5186: checking for main in -lgdk_imlib" >&5
+echo "configure:5181: checking for main in -lgdk_imlib" >&5
 ac_lib_var=`echo gdk_imlib'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgdk_imlib "
 cat > conftest.$ac_ext <<EOF
-#line 5191 "configure"
+#line 5186 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5216,12 +5211,12 @@
 
       
 echo $ac_n "checking for Imlib_init in -lImlib""... $ac_c" 1>&6
-echo "configure:5220: checking for Imlib_init in -lImlib" >&5
+echo "configure:5215: checking for Imlib_init in -lImlib" >&5
 ac_lib_var=`echo Imlib'_'Imlib_init | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lImlib "
 cat > conftest.$ac_ext <<EOF
-#line 5225 "configure"
+#line 5220 "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
@@ -5232,7 +5227,7 @@
 Imlib_init()
 ; return 0; }
 EOF
-if { (eval echo configure:5236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5255,10 +5250,10 @@
       for ac_func in gdk_imlib_init
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5259: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5262 "configure"
+echo "configure:5254: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5257 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5281,7 +5276,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5347,15 +5342,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5351: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5354 "configure"
+echo "configure:5346: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5349 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5386,19 +5381,19 @@
 
       
 echo $ac_n "checking for main in -lxml""... $ac_c" 1>&6
-echo "configure:5390: checking for main in -lxml" >&5
+echo "configure:5385: checking for main in -lxml" >&5
 ac_lib_var=`echo xml'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lxml "
 cat > conftest.$ac_ext <<EOF
-#line 5395 "configure"
+#line 5390 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5420,19 +5415,19 @@
 
       
 echo $ac_n "checking for main in -lglade""... $ac_c" 1>&6
-echo "configure:5424: checking for main in -lglade" >&5
+echo "configure:5419: checking for main in -lglade" >&5
 ac_lib_var=`echo glade'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lglade "
 cat > conftest.$ac_ext <<EOF
-#line 5429 "configure"
+#line 5424 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5454,19 +5449,19 @@
 
       
 echo $ac_n "checking for main in -lglade-gnome""... $ac_c" 1>&6
-echo "configure:5458: checking for main in -lglade-gnome" >&5
+echo "configure:5453: checking for main in -lglade-gnome" >&5
 ac_lib_var=`echo glade-gnome'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lglade-gnome "
 cat > conftest.$ac_ext <<EOF
-#line 5463 "configure"
+#line 5458 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5487,7 +5482,7 @@
 
 
       cat > conftest.$ac_ext <<EOF
-#line 5491 "configure"
+#line 5486 "configure"
 #include "confdefs.h"
 #include <glade/glade-xml.h>
 EOF
@@ -5546,7 +5541,7 @@
 # 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:5550: checking for X" >&5
+echo "configure:5545: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -5606,12 +5601,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 5610 "configure"
+#line 5605 "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:5615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5680,14 +5675,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5684 "configure"
+#line 5679 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:5691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -5796,17 +5791,17 @@
     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:5800: checking whether -R must be followed by a space" >&5
+echo "configure:5795: 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 5803 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:5810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+#line 5798 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:5805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -5822,14 +5817,14 @@
       else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
 	cat > conftest.$ac_ext <<EOF
-#line 5826 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:5833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+#line 5821 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:5828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -5865,12 +5860,12 @@
 else
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:5869: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:5864: 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 5874 "configure"
+#line 5869 "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
@@ -5881,7 +5876,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:5885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5905,12 +5900,12 @@
     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:5909: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:5904: 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 5914 "configure"
+#line 5909 "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
@@ -5921,7 +5916,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:5925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5950,10 +5945,10 @@
     # 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:5954: checking for gethostbyname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5957 "configure"
+echo "configure:5949: checking for gethostbyname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5952 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -5976,7 +5971,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -5997,12 +5992,12 @@
     if test $ac_cv_func_gethostbyname = no; then
       
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:6001: checking for gethostbyname in -lnsl" >&5
+echo "configure:5996: 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 6006 "configure"
+#line 6001 "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
@@ -6013,7 +6008,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:6017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6043,10 +6038,10 @@
     # -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:6047: checking for connect" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6050 "configure"
+echo "configure:6042: checking for connect" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6045 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -6069,7 +6064,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -6092,12 +6087,12 @@
 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:6096: checking "$xe_msg_checking"" >&5
+echo "configure:6091: 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 6101 "configure"
+#line 6096 "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
@@ -6108,7 +6103,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:6112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6132,10 +6127,10 @@
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:6136: checking for remove" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6139 "configure"
+echo "configure:6131: checking for remove" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6134 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -6158,7 +6153,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -6179,12 +6174,12 @@
     if test $ac_cv_func_remove = no; then
       
 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:6183: checking for remove in -lposix" >&5
+echo "configure:6178: 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 6188 "configure"
+#line 6183 "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
@@ -6195,7 +6190,7 @@
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:6199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6219,10 +6214,10 @@
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:6223: checking for shmat" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6226 "configure"
+echo "configure:6218: checking for shmat" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6221 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -6245,7 +6240,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -6266,12 +6261,12 @@
     if test $ac_cv_func_shmat = no; then
       
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:6270: checking for shmat in -lipc" >&5
+echo "configure:6265: 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 6275 "configure"
+#line 6270 "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
@@ -6282,7 +6277,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:6286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6318,12 +6313,12 @@
 xe_msg_checking="for IceConnectionNumber in -lICE"
 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:6322: checking "$xe_msg_checking"" >&5
+echo "configure:6317: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lICE $X_EXTRA_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6327 "configure"
+#line 6322 "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
@@ -6334,7 +6329,7 @@
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:6338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6501,7 +6496,7 @@
 
 
     echo "checking for X defines extracted by xmkmf" 1>&6
-echo "configure:6505: checking for X defines extracted by xmkmf" >&5
+echo "configure:6500: checking for X defines extracted by xmkmf" >&5
   rm -fr conftestdir
   if mkdir conftestdir; then
     cd conftestdir
@@ -6550,15 +6545,15 @@
 
     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
-echo "configure:6554: checking for X11/Intrinsic.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6557 "configure"
+echo "configure:6549: checking for X11/Intrinsic.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6552 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6582,12 +6577,12 @@
 
       
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:6586: checking for XOpenDisplay in -lX11" >&5
+echo "configure:6581: 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 6591 "configure"
+#line 6586 "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
@@ -6598,7 +6593,7 @@
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:6602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6623,12 +6618,12 @@
 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:6627: checking "$xe_msg_checking"" >&5
+echo "configure:6622: 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 6632 "configure"
+#line 6627 "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
@@ -6639,7 +6634,7 @@
 XGetFontProperty()
 ; return 0; }
 EOF
-if { (eval echo configure:6643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6666,12 +6661,12 @@
 
     
 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
-echo "configure:6670: checking for XShapeSelectInput in -lXext" >&5
+echo "configure:6665: 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 6675 "configure"
+#line 6670 "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
@@ -6682,7 +6677,7 @@
 XShapeSelectInput()
 ; return 0; }
 EOF
-if { (eval echo configure:6686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6705,12 +6700,12 @@
 
     
 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
-echo "configure:6709: checking for XtOpenDisplay in -lXt" >&5
+echo "configure:6704: 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 6714 "configure"
+#line 6709 "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
@@ -6721,7 +6716,7 @@
 XtOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:6725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6744,14 +6739,14 @@
 
 
   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
-echo "configure:6748: checking the version of X11 being used" >&5
+echo "configure:6743: checking the version of X11 being used" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6750 "configure"
+#line 6745 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
 EOF
-if { (eval echo configure:6755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:6750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ./conftest foobar; x11_release=$?
 else
@@ -6782,10 +6777,10 @@
   for ac_func in XConvertCase
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6786: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6789 "configure"
+echo "configure:6781: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6784 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6808,7 +6803,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6840,15 +6835,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6844: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6847 "configure"
+echo "configure:6839: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6842 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6881,10 +6876,10 @@
     for ac_func in XRegisterIMInstantiateCallback
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6885: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6888 "configure"
+echo "configure:6880: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6883 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6907,7 +6902,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6935,9 +6930,9 @@
 done
 
   echo $ac_n "checking for standard XRegisterIMInstantiateCallback prototype""... $ac_c" 1>&6
-echo "configure:6939: checking for standard XRegisterIMInstantiateCallback prototype" >&5
+echo "configure:6934: checking for standard XRegisterIMInstantiateCallback prototype" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6941 "configure"
+#line 6936 "configure"
 #include "confdefs.h"
 
 #define NeedFunctionPrototypes 1
@@ -6949,7 +6944,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -6970,12 +6965,12 @@
 
     test -z "$with_xmu" && { 
 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
-echo "configure:6974: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
+echo "configure:6969: 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 6979 "configure"
+#line 6974 "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
@@ -6986,7 +6981,7 @@
 XmuReadBitmapDataFromFile()
 ; return 0; }
 EOF
-if { (eval echo configure:6990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7025,19 +7020,19 @@
 
       
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:7029: checking for main in -lXbsd" >&5
+echo "configure:7024: 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 7034 "configure"
+#line 7029 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7074,22 +7069,22 @@
 fi 
 if test "$with_msw" != "no"; then
   echo "checking for MS-Windows" 1>&6
-echo "configure:7078: checking for MS-Windows" >&5
+echo "configure:7073: checking for MS-Windows" >&5
   
 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
-echo "configure:7081: checking for main in -lgdi32" >&5
+echo "configure:7076: 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 7086 "configure"
+#line 7081 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7140,12 +7135,12 @@
       test "$with_widgets"    != "no" && with_widgets=msw
     fi
         cat > conftest.$ac_ext <<EOF
-#line 7144 "configure"
+#line 7139 "configure"
 #include "confdefs.h"
 #include <fcntl.h>
     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
 EOF
-if { (eval echo configure:7149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:7144: \"$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
@@ -7206,15 +7201,15 @@
 if test "$with_x11" = "yes"; then
   ac_safe=`echo "X11/extensions/shape.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6
-echo "configure:7210: checking for X11/extensions/shape.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7213 "configure"
+echo "configure:7205: checking for X11/extensions/shape.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7208 "configure"
 #include "confdefs.h"
 #include <X11/extensions/shape.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7264,7 +7259,7 @@
 esac
 
 echo "checking for WM_COMMAND option" 1>&6
-echo "configure:7268: checking for WM_COMMAND option" >&5;
+echo "configure:7263: checking for WM_COMMAND option" >&5;
 if test "$with_wmcommand" != "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_WMCOMMAND
@@ -7279,15 +7274,15 @@
 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:7283: checking for X11/Xauth.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7286 "configure"
+echo "configure:7278: checking for X11/Xauth.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7281 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7310,12 +7305,12 @@
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:7314: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:7309: 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 7319 "configure"
+#line 7314 "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
@@ -7326,7 +7321,7 @@
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:7330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7371,15 +7366,15 @@
       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:7375: checking for ${dir}tt_c.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7378 "configure"
+echo "configure:7370: checking for ${dir}tt_c.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7373 "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:7383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7415,12 +7410,12 @@
 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:7419: checking "$xe_msg_checking"" >&5
+echo "configure:7414: 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 7424 "configure"
+#line 7419 "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
@@ -7431,7 +7426,7 @@
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:7435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7485,15 +7480,15 @@
 
 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:7489: checking for Dt/Dt.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7492 "configure"
+echo "configure:7484: checking for Dt/Dt.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7487 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7516,12 +7511,12 @@
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:7520: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:7515: 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 7525 "configure"
+#line 7520 "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
@@ -7532,7 +7527,7 @@
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:7536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7613,7 +7608,7 @@
 
 if test "$with_dragndrop" != "no" ; then
   echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
-echo "configure:7617: checking if drag and drop API is needed" >&5
+echo "configure:7612: checking if drag and drop API is needed" >&5
   if test -n "$dragndrop_proto" ; then
     with_dragndrop=yes
     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6
@@ -7633,18 +7628,18 @@
 fi
 
 echo "checking for LDAP" 1>&6
-echo "configure:7637: checking for LDAP" >&5
+echo "configure:7632: 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:7640: checking for ldap.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7643 "configure"
+echo "configure:7635: checking for ldap.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7638 "configure"
 #include "confdefs.h"
 #include <ldap.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7667,15 +7662,15 @@
  }
 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:7671: checking for lber.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7674 "configure"
+echo "configure:7666: checking for lber.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7669 "configure"
 #include "confdefs.h"
 #include <lber.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7699,12 +7694,12 @@
 if test "$with_ldap" != "no"; then
   
 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
-echo "configure:7703: checking for ldap_search in -lldap" >&5
+echo "configure:7698: checking for ldap_search in -lldap" >&5
 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap "
 cat > conftest.$ac_ext <<EOF
-#line 7708 "configure"
+#line 7703 "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
@@ -7715,7 +7710,7 @@
 ldap_search()
 ; return 0; }
 EOF
-if { (eval echo configure:7719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7740,12 +7735,12 @@
 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:7744: checking "$xe_msg_checking"" >&5
+echo "configure:7739: 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 7749 "configure"
+#line 7744 "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
@@ -7756,7 +7751,7 @@
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:7760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7781,12 +7776,12 @@
 xe_msg_checking="for ldap_open in -lldap"
 test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:7785: checking "$xe_msg_checking"" >&5
+echo "configure:7780: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap -llber -lkrb"
 cat > conftest.$ac_ext <<EOF
-#line 7790 "configure"
+#line 7785 "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
@@ -7797,7 +7792,7 @@
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:7801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7822,12 +7817,12 @@
 xe_msg_checking="for ldap_open in -lldap"
 test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:7826: checking "$xe_msg_checking"" >&5
+echo "configure:7821: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap -llber -lkrb -ldes"
 cat > conftest.$ac_ext <<EOF
-#line 7831 "configure"
+#line 7826 "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
@@ -7838,7 +7833,7 @@
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:7842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7886,10 +7881,10 @@
   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7890: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7893 "configure"
+echo "configure:7885: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7888 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7912,7 +7907,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7943,20 +7938,20 @@
 
 if test "$with_postgresql" != "no"; then
   echo "checking for PostgreSQL" 1>&6
-echo "configure:7947: checking for PostgreSQL" >&5
+echo "configure:7942: checking for PostgreSQL" >&5
 
   for header_dir in "" "pgsql/" "postgresql/"; do
     ac_safe=`echo "${header_dir}libpq-fe.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${header_dir}libpq-fe.h""... $ac_c" 1>&6
-echo "configure:7952: checking for ${header_dir}libpq-fe.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7955 "configure"
+echo "configure:7947: checking for ${header_dir}libpq-fe.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7950 "configure"
 #include "confdefs.h"
 #include <${header_dir}libpq-fe.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7980,12 +7975,12 @@
 
   test -n "$libpq_fe_h_file" && { 
 echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6
-echo "configure:7984: checking for PQconnectdb in -lpq" >&5
+echo "configure:7979: checking for PQconnectdb in -lpq" >&5
 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpq "
 cat > conftest.$ac_ext <<EOF
-#line 7989 "configure"
+#line 7984 "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
@@ -7996,7 +7991,7 @@
 PQconnectdb()
 ; return 0; }
 EOF
-if { (eval echo configure:8000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8029,12 +8024,12 @@
 
     
 echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6
-echo "configure:8033: checking for PQconnectStart in -lpq" >&5
+echo "configure:8028: checking for PQconnectStart in -lpq" >&5
 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpq "
 cat > conftest.$ac_ext <<EOF
-#line 8038 "configure"
+#line 8033 "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
@@ -8045,7 +8040,7 @@
 PQconnectStart()
 ; return 0; }
 EOF
-if { (eval echo configure:8049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8090,7 +8085,7 @@
 
 if test "$window_system" != "none"; then
   echo "checking for graphics libraries" 1>&6
-echo "configure:8094: checking for graphics libraries" >&5
+echo "configure:8089: checking for graphics libraries" >&5
 
       libpath_xpm=
   incpath_xpm=
@@ -8116,10 +8111,10 @@
     CFLAGS=""$incpath_xpm" $CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi
     LDFLAGS=""$libpath_xpm" $LDFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$libpath_xpm"\" to \$LDFLAGS"; fi
     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:8120: checking for Xpm - no older than 3.4f" >&5
+echo "configure:8115: checking for Xpm - no older than 3.4f" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 8123 "configure"
+#line 8118 "configure"
 #include "confdefs.h"
 #define XPM_NUMBERS
 #include <X11/xpm.h>
@@ -8128,7 +8123,7 @@
       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
       XpmIncludeVersion < 30406 ? 2 : 0 ;}
 EOF
-if { (eval echo configure:8132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:8127: \"$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
@@ -8172,17 +8167,17 @@
     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
     CFLAGS=""$incpath_xpm" $CFLAGS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi
     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
-echo "configure:8176: checking for \"FOR_MSW\" xpm" >&5
+echo "configure:8171: checking for \"FOR_MSW\" xpm" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 8179 "configure"
+#line 8174 "configure"
 #include "confdefs.h"
 
 int main() {
 XpmCreatePixmapFromData()
 ; return 0; }
 EOF
-if { (eval echo configure:8186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   xpm_for_msw=no
 else
@@ -8208,15 +8203,15 @@
 
     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:8212: checking for compface.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8215 "configure"
+echo "configure:8207: checking for compface.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8210 "configure"
 #include "confdefs.h"
 #include <compface.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8239,12 +8234,12 @@
  }
   test -z "$with_xface" && { 
 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:8243: checking for UnGenFace in -lcompface" >&5
+echo "configure:8238: 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 8248 "configure"
+#line 8243 "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
@@ -8255,7 +8250,7 @@
 UnGenFace()
 ; return 0; }
 EOF
-if { (eval echo configure:8259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8304,12 +8299,12 @@
       if test "$with_png $with_tiff" != "no no"; then
     
 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
-echo "configure:8308: checking for inflate in -lc" >&5
+echo "configure:8303: 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 8313 "configure"
+#line 8308 "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
@@ -8320,7 +8315,7 @@
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:8324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8339,12 +8334,12 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
-echo "configure:8343: checking for inflate in -lz" >&5
+echo "configure:8338: 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 8348 "configure"
+#line 8343 "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 +8350,7 @@
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:8359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8374,12 +8369,12 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
-echo "configure:8378: checking for inflate in -lgz" >&5
+echo "configure:8373: checking for inflate in -lgz" >&5
 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgz "
 cat > conftest.$ac_ext <<EOF
-#line 8383 "configure"
+#line 8378 "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
@@ -8390,7 +8385,7 @@
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:8394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8420,15 +8415,15 @@
 
     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:8424: checking for jpeglib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8427 "configure"
+echo "configure:8419: checking for jpeglib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8422 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8451,12 +8446,12 @@
  }
   test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:8455: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:8450: 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 8460 "configure"
+#line 8455 "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
@@ -8467,7 +8462,7 @@
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:8471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8503,10 +8498,10 @@
 
     png_problem=""
   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:8507: checking for pow" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8510 "configure"
+echo "configure:8502: checking for pow" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8505 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -8529,7 +8524,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -8550,15 +8545,15 @@
  }
   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:8554: checking for png.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8557 "configure"
+echo "configure:8549: checking for png.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8552 "configure"
 #include "confdefs.h"
 #include <png.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8581,12 +8576,12 @@
  }
   test -z "$with_png" && { 
 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
-echo "configure:8585: checking for png_read_image in -lpng" >&5
+echo "configure:8580: 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 8590 "configure"
+#line 8585 "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
@@ -8597,7 +8592,7 @@
 png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:8601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8620,10 +8615,10 @@
  }
   if test -z "$with_png"; then
     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
-echo "configure:8624: checking for workable png version information" >&5
+echo "configure:8619: checking for workable png version information" >&5
     xe_check_libs="-lpng -lz"
     cat > conftest.$ac_ext <<EOF
-#line 8627 "configure"
+#line 8622 "configure"
 #include "confdefs.h"
 #include <png.h>
     int main(int c, char **v) {
@@ -8631,7 +8626,7 @@
     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
 EOF
-if { (eval echo configure:8635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:8630: \"$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
@@ -8674,15 +8669,15 @@
 
     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:8678: checking for tiffio.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8681 "configure"
+echo "configure:8673: checking for tiffio.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8676 "configure"
 #include "confdefs.h"
 #include <tiffio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8705,12 +8700,12 @@
  }
   test -z "$with_tiff" && { 
 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
-echo "configure:8709: checking for TIFFClientOpen in -ltiff" >&5
+echo "configure:8704: 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 8714 "configure"
+#line 8709 "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
@@ -8721,7 +8716,7 @@
 TIFFClientOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:8725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8760,15 +8755,15 @@
 if test "$with_gtk" = "yes"; then
     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:8764: checking for compface.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8767 "configure"
+echo "configure:8759: checking for compface.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8762 "configure"
 #include "confdefs.h"
 #include <compface.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8791,12 +8786,12 @@
  }
   test -z "$with_xface" && { 
 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:8795: checking for UnGenFace in -lcompface" >&5
+echo "configure:8790: 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 8800 "configure"
+#line 8795 "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
@@ -8807,7 +8802,7 @@
 UnGenFace()
 ; return 0; }
 EOF
-if { (eval echo configure:8811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8846,7 +8841,7 @@
 
 if test "$with_x11" = "yes"; then
   echo "checking for X11 graphics libraries" 1>&6
-echo "configure:8850: checking for X11 graphics libraries" >&5
+echo "configure:8845: checking for X11 graphics libraries" >&5
 fi
 
 case "$with_widgets" in
@@ -8856,7 +8851,7 @@
 
 if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then
   echo "checking for the Athena widgets" 1>&6
-echo "configure:8860: checking for the Athena widgets" >&5
+echo "configure:8855: checking for the Athena widgets" >&5
 
     case "$with_athena" in
         "xaw" | "")	athena_variant=Xaw	athena_3d=no  ;;
@@ -8870,12 +8865,12 @@
     if test "$athena_3d" = "no"; then
     
 echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6
-echo "configure:8874: checking for XawScrollbarSetThumb in -l$athena_variant" >&5
+echo "configure:8869: checking for XawScrollbarSetThumb in -l$athena_variant" >&5
 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$athena_variant "
 cat > conftest.$ac_ext <<EOF
-#line 8879 "configure"
+#line 8874 "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
@@ -8886,7 +8881,7 @@
 XawScrollbarSetThumb()
 ; return 0; }
 EOF
-if { (eval echo configure:8890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8902,12 +8897,12 @@
   echo "$ac_t""yes" 1>&6
           
 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
-echo "configure:8906: checking for threeDClassRec in -l$athena_variant" >&5
+echo "configure:8901: checking for threeDClassRec in -l$athena_variant" >&5
 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$athena_variant "
 cat > conftest.$ac_ext <<EOF
-#line 8911 "configure"
+#line 8906 "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
@@ -8918,7 +8913,7 @@
 threeDClassRec()
 ; return 0; }
 EOF
-if { (eval echo configure:8922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8949,12 +8944,12 @@
   else
         
 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
-echo "configure:8953: checking for threeDClassRec in -l$athena_variant" >&5
+echo "configure:8948: checking for threeDClassRec in -l$athena_variant" >&5
 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$athena_variant "
 cat > conftest.$ac_ext <<EOF
-#line 8958 "configure"
+#line 8953 "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
@@ -8965,7 +8960,7 @@
 threeDClassRec()
 ; return 0; }
 EOF
-if { (eval echo configure:8969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8983,12 +8978,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6
-echo "configure:8987: checking for threeDClassRec in -lXaw" >&5
+echo "configure:8982: checking for threeDClassRec in -lXaw" >&5
 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXaw "
 cat > conftest.$ac_ext <<EOF
-#line 8992 "configure"
+#line 8987 "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
@@ -8999,7 +8994,7 @@
 threeDClassRec()
 ; return 0; }
 EOF
-if { (eval echo configure:9003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9030,15 +9025,15 @@
     if test "$athena_3d" = "no"; then
     ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
-echo "configure:9034: checking for X11/Xaw/ThreeD.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9037 "configure"
+echo "configure:9029: checking for X11/Xaw/ThreeD.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9032 "configure"
 #include "confdefs.h"
 #include <X11/Xaw/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9058,15 +9053,15 @@
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6
-echo "configure:9062: checking for X11/Xaw/XawInit.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9065 "configure"
+echo "configure:9057: checking for X11/Xaw/XawInit.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9060 "configure"
 #include "confdefs.h"
 #include <X11/Xaw/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9092,15 +9087,15 @@
   else
             ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6
-echo "configure:9096: checking for X11/$athena_variant/XawInit.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9099 "configure"
+echo "configure:9091: checking for X11/$athena_variant/XawInit.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9094 "configure"
 #include "confdefs.h"
 #include <X11/$athena_variant/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9117,15 +9112,15 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6
-echo "configure:9121: checking for X11/$athena_variant/ThreeD.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9124 "configure"
+echo "configure:9116: checking for X11/$athena_variant/ThreeD.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9119 "configure"
 #include "confdefs.h"
 #include <X11/$athena_variant/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9153,15 +9148,15 @@
         if test -z "$athena_h_path"; then
       ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6
-echo "configure:9157: checking for $athena_variant/XawInit.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9160 "configure"
+echo "configure:9152: checking for $athena_variant/XawInit.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9155 "configure"
 #include "confdefs.h"
 #include <$athena_variant/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9178,15 +9173,15 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6
-echo "configure:9182: checking for $athena_variant/ThreeD.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9185 "configure"
+echo "configure:9177: checking for $athena_variant/ThreeD.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9180 "configure"
 #include "confdefs.h"
 #include <$athena_variant/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9215,15 +9210,15 @@
         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
       ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6
-echo "configure:9219: checking for X11/Xaw3d/XawInit.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9222 "configure"
+echo "configure:9214: checking for X11/Xaw3d/XawInit.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9217 "configure"
 #include "confdefs.h"
 #include <X11/Xaw3d/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9240,15 +9235,15 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6
-echo "configure:9244: checking for X11/Xaw3d/ThreeD.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9247 "configure"
+echo "configure:9239: checking for X11/Xaw3d/ThreeD.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9242 "configure"
 #include "confdefs.h"
 #include <X11/Xaw3d/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9280,15 +9275,15 @@
         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
       ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6
-echo "configure:9284: checking for Xaw3d/XawInit.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9287 "configure"
+echo "configure:9279: checking for Xaw3d/XawInit.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9282 "configure"
 #include "confdefs.h"
 #include <Xaw3d/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9305,15 +9300,15 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6
-echo "configure:9309: checking for Xaw3d/ThreeD.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9312 "configure"
+echo "configure:9304: checking for Xaw3d/ThreeD.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9307 "configure"
 #include "confdefs.h"
 #include <Xaw3d/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9345,15 +9340,15 @@
             if test -z "$athena_h_path"; then
       ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
-echo "configure:9349: checking for X11/Xaw/ThreeD.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9352 "configure"
+echo "configure:9344: checking for X11/Xaw/ThreeD.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9347 "configure"
 #include "confdefs.h"
 #include <X11/Xaw/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9392,15 +9387,15 @@
 if test "$with_x11" = "yes"; then
     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:9396: checking for Xm/Xm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9399 "configure"
+echo "configure:9391: checking for Xm/Xm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9394 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9417,12 +9412,12 @@
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:9421: checking for XmStringFree in -lXm" >&5
+echo "configure:9416: 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 9426 "configure"
+#line 9421 "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
@@ -9433,7 +9428,7 @@
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:9437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9462,9 +9457,9 @@
 
   if test "$have_motif" = "yes"; then
         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
-echo "configure:9466: checking for Lesstif" >&5
+echo "configure:9461: checking for Lesstif" >&5
     cat > conftest.$ac_ext <<EOF
-#line 9468 "configure"
+#line 9463 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 #ifdef LESSTIF_VERSION
@@ -9837,7 +9832,7 @@
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:9841: checking for Mule-related features" >&5
+echo "configure:9836: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -9851,15 +9846,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9855: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9858 "configure"
+echo "configure:9850: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9853 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9890,12 +9885,12 @@
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:9894: checking for strerror in -lintl" >&5
+echo "configure:9889: 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 9899 "configure"
+#line 9894 "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
@@ -9906,7 +9901,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:9910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9939,18 +9934,18 @@
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:9943: checking for Mule input methods" >&5
+echo "configure:9938: checking for Mule input methods" >&5
         case "$with_xim" in "" | "yes" )
     echo "checking for XIM" 1>&6
-echo "configure:9946: checking for XIM" >&5
+echo "configure:9941: checking for XIM" >&5
     
 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
-echo "configure:9949: checking for XOpenIM in -lX11" >&5
+echo "configure:9944: checking for XOpenIM in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 9954 "configure"
+#line 9949 "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
@@ -9961,7 +9956,7 @@
 XOpenIM()
 ; return 0; }
 EOF
-if { (eval echo configure:9965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9985,12 +9980,12 @@
         if test "$have_motif $have_lesstif" = "yes no"; then
       
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:9989: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:9984: 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 9994 "configure"
+#line 9989 "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
@@ -10001,7 +9996,7 @@
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:10005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10066,15 +10061,15 @@
 
     if test "$with_xfs" = "yes" ; then
     echo "checking for XFontSet" 1>&6
-echo "configure:10070: checking for XFontSet" >&5
+echo "configure:10065: checking for XFontSet" >&5
     
 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
-echo "configure:10073: checking for XmbDrawString in -lX11" >&5
+echo "configure:10068: 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 10078 "configure"
+#line 10073 "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
@@ -10085,7 +10080,7 @@
 XmbDrawString()
 ; return 0; }
 EOF
-if { (eval echo configure:10089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10125,15 +10120,15 @@
     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:10129: checking for wnn/jllib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10132 "configure"
+echo "configure:10124: checking for wnn/jllib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10127 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10156,15 +10151,15 @@
  }
     test -z "$with_wnn" && { ac_safe=`echo "wnn/commonhd.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for wnn/commonhd.h""... $ac_c" 1>&6
-echo "configure:10160: checking for wnn/commonhd.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10163 "configure"
+echo "configure:10155: checking for wnn/commonhd.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10158 "configure"
 #include "confdefs.h"
 #include <wnn/commonhd.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10189,10 +10184,10 @@
     for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10193: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10196 "configure"
+echo "configure:10188: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10191 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10215,7 +10210,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10244,12 +10239,12 @@
 
     test "$ac_cv_func_crypt" != "yes" && { 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:10248: checking for crypt in -lcrypt" >&5
+echo "configure:10243: 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 10253 "configure"
+#line 10248 "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
@@ -10260,7 +10255,7 @@
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:10264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10295,12 +10290,12 @@
     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
     
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:10299: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:10294: 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 10304 "configure"
+#line 10299 "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
@@ -10311,7 +10306,7 @@
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:10315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10329,12 +10324,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
-echo "configure:10333: checking for jl_dic_list_e in -lwnn4" >&5
+echo "configure:10328: 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 10338 "configure"
+#line 10333 "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
@@ -10345,7 +10340,7 @@
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:10349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10363,12 +10358,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
-echo "configure:10367: checking for jl_dic_list_e in -lwnn6" >&5
+echo "configure:10362: 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 10372 "configure"
+#line 10367 "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
@@ -10379,7 +10374,7 @@
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:10383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10397,12 +10392,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
-echo "configure:10401: checking for dic_list_e in -lwnn6_fromsrc" >&5
+echo "configure:10396: 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 10406 "configure"
+#line 10401 "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
@@ -10413,7 +10408,7 @@
 dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:10417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10458,12 +10453,12 @@
     if test "$with_wnn6" != "no"; then
       
 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
-echo "configure:10462: checking for jl_fi_dic_list in -l$libwnn" >&5
+echo "configure:10457: checking for jl_fi_dic_list in -l$libwnn" >&5
 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$libwnn "
 cat > conftest.$ac_ext <<EOF
-#line 10467 "configure"
+#line 10462 "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
@@ -10474,7 +10469,7 @@
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:10478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10509,15 +10504,15 @@
   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:10513: checking for canna/jrkanji.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10516 "configure"
+echo "configure:10508: checking for canna/jrkanji.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10511 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10544,15 +10539,15 @@
     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:10548: checking for canna/jrkanji.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10551 "configure"
+echo "configure:10543: checking for canna/jrkanji.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10546 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10580,15 +10575,15 @@
 
   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:10584: checking for canna/RK.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10587 "configure"
+echo "configure:10579: checking for canna/RK.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10582 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10611,12 +10606,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:10615: checking for RkBgnBun in -lRKC" >&5
+echo "configure:10610: 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 10620 "configure"
+#line 10615 "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
@@ -10627,7 +10622,7 @@
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:10631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10650,12 +10645,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:10654: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:10649: 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 10659 "configure"
+#line 10654 "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
@@ -10666,7 +10661,7 @@
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:10670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10712,12 +10707,12 @@
   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:10716: checking for layout_object_getvalue in -li18n" >&5
+echo "configure:10711: 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 10721 "configure"
+#line 10716 "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
@@ -10728,7 +10723,7 @@
 layout_object_getvalue()
 ; return 0; }
 EOF
-if { (eval echo configure:10732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10814,10 +10809,10 @@
 for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10818: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10821 "configure"
+echo "configure:10813: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10816 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10840,7 +10835,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10872,10 +10867,10 @@
 for ac_func in getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10876: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10879 "configure"
+echo "configure:10871: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10874 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10898,7 +10893,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10927,10 +10922,10 @@
 
 
 echo $ac_n "checking for openpty""... $ac_c" 1>&6
-echo "configure:10931: checking for openpty" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10934 "configure"
+echo "configure:10926: checking for openpty" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10929 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openpty(); below.  */
@@ -10953,7 +10948,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_openpty=yes"
 else
@@ -10972,12 +10967,12 @@
 
   
 echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6
-echo "configure:10976: checking for openpty in -lutil" >&5
+echo "configure:10971: checking for openpty in -lutil" >&5
 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lutil "
 cat > conftest.$ac_ext <<EOF
-#line 10981 "configure"
+#line 10976 "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
@@ -10988,7 +10983,7 @@
 openpty()
 ; return 0; }
 EOF
-if { (eval echo configure:10992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11023,15 +11018,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11027: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11030 "configure"
+echo "configure:11022: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11025 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11068,15 +11063,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11072: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11075 "configure"
+echo "configure:11067: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11070 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11109,15 +11104,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11113: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11116 "configure"
+echo "configure:11108: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11111 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11150,15 +11145,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11154: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11157 "configure"
+echo "configure:11149: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11152 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11194,15 +11189,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11198: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11201 "configure"
+echo "configure:11193: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11196 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11235,10 +11230,10 @@
   for ac_func in isastream
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11239: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11242 "configure"
+echo "configure:11234: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11237 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -11261,7 +11256,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:11265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -11292,15 +11287,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11296: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11299 "configure"
+echo "configure:11291: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11294 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11333,10 +11328,10 @@
 for ac_func in getloadavg
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11337: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11340 "configure"
+echo "configure:11332: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11335 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -11359,7 +11354,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:11363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -11392,15 +11387,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11396: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11399 "configure"
+echo "configure:11391: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11394 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11436,12 +11431,12 @@
 
     
 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
-echo "configure:11440: checking for kstat_open in -lkstat" >&5
+echo "configure:11435: 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 11445 "configure"
+#line 11440 "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
@@ -11452,7 +11447,7 @@
 kstat_open()
 ; return 0; }
 EOF
-if { (eval echo configure:11456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11487,15 +11482,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11491: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11494 "configure"
+echo "configure:11486: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11489 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11527,12 +11522,12 @@
 
     
 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
-echo "configure:11531: checking for kvm_read in -lkvm" >&5
+echo "configure:11526: 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 11536 "configure"
+#line 11531 "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
@@ -11543,7 +11538,7 @@
 kvm_read()
 ; return 0; }
 EOF
-if { (eval echo configure:11547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11577,16 +11572,16 @@
 fi
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:11581: checking whether netdb declares h_errno" >&5
-cat > conftest.$ac_ext <<EOF
-#line 11583 "configure"
+echo "configure:11576: checking whether netdb declares h_errno" >&5
+cat > conftest.$ac_ext <<EOF
+#line 11578 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:11590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -11606,16 +11601,16 @@
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:11610: checking for sigsetjmp" >&5
-cat > conftest.$ac_ext <<EOF
-#line 11612 "configure"
+echo "configure:11605: checking for sigsetjmp" >&5
+cat > conftest.$ac_ext <<EOF
+#line 11607 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:11619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11614: \"$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
@@ -11635,11 +11630,11 @@
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:11639: checking whether localtime caches TZ" >&5
+echo "configure:11634: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 11643 "configure"
+#line 11638 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -11674,7 +11669,7 @@
   exit (0);
 }
 EOF
-if { (eval echo configure:11678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:11673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
@@ -11704,9 +11699,9 @@
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
-echo "configure:11708: checking whether gettimeofday accepts one or two arguments" >&5
-cat > conftest.$ac_ext <<EOF
-#line 11710 "configure"
+echo "configure:11703: checking whether gettimeofday accepts one or two arguments" >&5
+cat > conftest.$ac_ext <<EOF
+#line 11705 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -11727,7 +11722,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:11731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""two" 1>&6
 else
@@ -11749,19 +11744,19 @@
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:11753: checking for inline" >&5
+echo "configure:11748: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 11758 "configure"
+#line 11753 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:11765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -11802,17 +11797,17 @@
   # 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:11806: checking for working alloca.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11809 "configure"
+echo "configure:11801: checking for working alloca.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11804 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:11816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -11836,10 +11831,10 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:11840: checking for alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11843 "configure"
+echo "configure:11835: checking for alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11838 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -11867,7 +11862,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:11871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -11906,10 +11901,10 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:11910: checking whether alloca needs Cray hooks" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11913 "configure"
+echo "configure:11905: checking whether alloca needs Cray hooks" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11908 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -11933,10 +11928,10 @@
 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:11937: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11940 "configure"
+echo "configure:11932: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11935 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -11959,7 +11954,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:11963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -11989,10 +11984,10 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:11993: checking stack direction for C alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11996 "configure"
+echo "configure:11988: checking stack direction for C alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11991 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -12011,7 +12006,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:12015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:12010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
@@ -12040,10 +12035,10 @@
 fi
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:12044: checking for working strcoll" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12047 "configure"
+echo "configure:12039: checking for working strcoll" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12042 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -12053,7 +12048,7 @@
 	strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:12057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:12052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
@@ -12081,10 +12076,10 @@
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12085: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12088 "configure"
+echo "configure:12080: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12083 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -12107,7 +12102,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:12111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -12135,10 +12130,10 @@
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:12139: checking whether getpgrp takes no argument" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12142 "configure"
+echo "configure:12134: checking whether getpgrp takes no argument" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12137 "configure"
 #include "confdefs.h"
 
 /*
@@ -12193,7 +12188,7 @@
 }
 
 EOF
-if { (eval echo configure:12197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:12192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
@@ -12220,10 +12215,10 @@
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:12224: checking for working mmap" >&5
+echo "configure:12219: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 12227 "configure"
+#line 12222 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -12256,7 +12251,7 @@
   return 1;
 }
 EOF
-if { (eval echo configure:12260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:12255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   have_mmap=yes
 else
@@ -12285,9 +12280,9 @@
 if test "$rel_alloc $have_mmap" = "default yes"; then
   if test "$doug_lea_malloc" = "yes"; then
         echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6
-echo "configure:12289: checking for M_MMAP_THRESHOLD" >&5
+echo "configure:12284: checking for M_MMAP_THRESHOLD" >&5
     cat > conftest.$ac_ext <<EOF
-#line 12291 "configure"
+#line 12286 "configure"
 #include "confdefs.h"
 #include <malloc.h>
 int main() {
@@ -12299,7 +12294,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:12303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rel_alloc=no; echo "$ac_t""yes" 1>&6;
 else
@@ -12324,15 +12319,15 @@
 
 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:12328: checking for termios.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12331 "configure"
+echo "configure:12323: checking for termios.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12326 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12375,15 +12370,15 @@
   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:12379: checking for termio.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12382 "configure"
+echo "configure:12374: checking for termio.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12377 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12387: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12415,10 +12410,10 @@
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:12419: checking for socket" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12422 "configure"
+echo "configure:12414: checking for socket" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12417 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -12441,7 +12436,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:12445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -12456,15 +12451,15 @@
   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:12460: checking for netinet/in.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12463 "configure"
+echo "configure:12455: checking for netinet/in.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12458 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12481,15 +12476,15 @@
   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:12485: checking for arpa/inet.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12488 "configure"
+echo "configure:12480: checking for arpa/inet.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12483 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12514,9 +12509,9 @@
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:12518: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:12513: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 12520 "configure"
+#line 12515 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12527,7 +12522,7 @@
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:12531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SOCKADDR_SUN_LEN
@@ -12545,9 +12540,9 @@
 fi
 rm -f conftest*
       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
-echo "configure:12549: checking "for ip_mreq struct in netinet/in.h"" >&5
+echo "configure:12544: checking "for ip_mreq struct in netinet/in.h"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 12551 "configure"
+#line 12546 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12557,7 +12552,7 @@
 static struct ip_mreq x;
 ; return 0; }
 EOF
-if { (eval echo configure:12561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MULTICAST
@@ -12588,10 +12583,10 @@
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:12592: checking for msgget" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12595 "configure"
+echo "configure:12587: checking for msgget" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12590 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -12614,7 +12609,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:12618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -12629,15 +12624,15 @@
   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:12633: checking for sys/ipc.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12636 "configure"
+echo "configure:12628: checking for sys/ipc.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12631 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12654,15 +12649,15 @@
   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:12658: checking for sys/msg.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12661 "configure"
+echo "configure:12653: checking for sys/msg.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12656 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12700,15 +12695,15 @@
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:12704: checking for dirent.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12707 "configure"
+echo "configure:12699: checking for dirent.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12702 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12735,15 +12730,15 @@
   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:12739: checking for sys/dir.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12742 "configure"
+echo "configure:12734: checking for sys/dir.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12737 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12776,15 +12771,15 @@
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:12780: checking for nlist.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12783 "configure"
+echo "configure:12775: checking for nlist.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12778 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12814,22 +12809,22 @@
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:12818: checking "for sound support"" >&5
+echo "configure:12813: checking "for sound support"" >&5
 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
 
 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:12825: checking for multimedia/audio_device.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12828 "configure"
+echo "configure:12820: checking for multimedia/audio_device.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12823 "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:12833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12877,12 +12872,12 @@
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:12881: checking for ALopenport in -laudio" >&5
+echo "configure:12876: 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 12886 "configure"
+#line 12881 "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
@@ -12893,7 +12888,7 @@
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:12897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12924,12 +12919,12 @@
       if test -z "$native_sound_lib"; then
 	
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:12928: checking for AOpenAudio in -lAlib" >&5
+echo "configure:12923: 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 12933 "configure"
+#line 12928 "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
@@ -12940,7 +12935,7 @@
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:12944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12988,15 +12983,15 @@
     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:12992: checking for ${dir}/soundcard.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 12995 "configure"
+echo "configure:12987: checking for ${dir}/soundcard.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 12990 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13050,15 +13045,15 @@
 if test "$with_nas_sound" != "no"; then
   ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6
-echo "configure:13054: checking for audio/audiolib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13057 "configure"
+echo "configure:13049: checking for audio/audiolib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13052 "configure"
 #include "confdefs.h"
 #include <audio/audiolib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13076,12 +13071,12 @@
   
     
 echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6
-echo "configure:13080: checking for AuOpenServer in -laudio" >&5
+echo "configure:13075: checking for AuOpenServer in -laudio" >&5
 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -laudio "
 cat > conftest.$ac_ext <<EOF
-#line 13085 "configure"
+#line 13080 "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
@@ -13092,7 +13087,7 @@
 AuOpenServer()
 ; return 0; }
 EOF
-if { (eval echo configure:13096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13131,7 +13126,7 @@
  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 13135 "configure"
+#line 13130 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -13162,7 +13157,7 @@
   # Extract the first word of "esd-config", so it can be a program name with args.
 set dummy esd-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:13166: checking for $ac_word" >&5
+echo "configure:13161: checking for $ac_word" >&5
 
 if test -n "$have_esd_config"; then
   ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test.
@@ -13191,10 +13186,10 @@
     c_switch_site="$c_switch_site `esd-config --cflags`" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"`esd-config --cflags`\" to \$c_switch_site"; fi
     LIBS="`esd-config --libs` $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"`esd-config --libs`\" to \$LIBS"; fi
     echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6
-echo "configure:13195: checking for esd_play_stream" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13198 "configure"
+echo "configure:13190: checking for esd_play_stream" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13193 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char esd_play_stream(); below.  */
@@ -13217,7 +13212,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:13221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_esd_play_stream=yes"
 else
@@ -13268,7 +13263,7 @@
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:13272: checking for TTY-related features" >&5
+echo "configure:13267: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -13281,12 +13276,12 @@
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:13285: checking for tgetent in -lncurses" >&5
+echo "configure:13280: 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 13290 "configure"
+#line 13285 "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
@@ -13297,7 +13292,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:13301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13330,15 +13325,15 @@
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:13334: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13337 "configure"
+echo "configure:13329: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13332 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13360,15 +13355,15 @@
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:13364: checking for ncurses/term.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13367 "configure"
+echo "configure:13359: checking for ncurses/term.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13362 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13398,15 +13393,15 @@
       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:13402: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13405 "configure"
+echo "configure:13397: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13400 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13441,12 +13436,12 @@
 	for lib in curses termlib termcap; do
 	  
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:13445: checking for tgetent in -l$lib" >&5
+echo "configure:13440: 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 13450 "configure"
+#line 13445 "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
@@ -13457,7 +13452,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:13461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13488,12 +13483,12 @@
       else
 	
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:13492: checking for tgetent in -lcurses" >&5
+echo "configure:13487: 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 13497 "configure"
+#line 13492 "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
@@ -13504,7 +13499,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:13508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13522,12 +13517,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:13526: checking for tgetent in -ltermcap" >&5
+echo "configure:13521: 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 13531 "configure"
+#line 13526 "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
@@ -13538,7 +13533,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:13542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13586,15 +13581,15 @@
 
     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:13590: checking for gpm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13593 "configure"
+echo "configure:13585: checking for gpm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13588 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13617,12 +13612,12 @@
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:13621: checking for Gpm_Open in -lgpm" >&5
+echo "configure:13616: 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 13626 "configure"
+#line 13621 "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
@@ -13633,7 +13628,7 @@
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:13637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13676,20 +13671,20 @@
 
 test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
   != "no no no" && echo "checking for database support" 1>&6
-echo "configure:13680: checking for database support" >&5
+echo "configure:13675: checking for database support" >&5
 
 if test "$with_database_gdbm $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:13685: checking for ndbm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13688 "configure"
+echo "configure:13680: checking for ndbm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13683 "configure"
 #include "confdefs.h"
 #include <ndbm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -13719,12 +13714,12 @@
 if test "$with_database_gdbm" != "no"; then
   
 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:13723: checking for dbm_open in -lgdbm" >&5
+echo "configure:13718: 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 13728 "configure"
+#line 13723 "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
@@ -13735,7 +13730,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:13739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13763,10 +13758,10 @@
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:13767: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13770 "configure"
+echo "configure:13762: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13765 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -13789,7 +13784,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:13793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -13808,12 +13803,12 @@
 
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:13812: checking for dbm_open in -ldbm" >&5
+echo "configure:13807: 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 13817 "configure"
+#line 13812 "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
@@ -13824,7 +13819,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:13828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13865,10 +13860,10 @@
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
-echo "configure:13869: checking for Berkeley db.h" >&5
+echo "configure:13864: checking for Berkeley db.h" >&5
   for header in "db/db.h" "db.h"; do
     cat > conftest.$ac_ext <<EOF
-#line 13872 "configure"
+#line 13867 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -13890,7 +13885,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:13894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_file="$header"; break
 else
@@ -13906,9 +13901,9 @@
 
   if test "$with_database_berkdb" != "no"; then
     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
-echo "configure:13910: checking for Berkeley DB version" >&5
+echo "configure:13905: checking for Berkeley DB version" >&5
     cat > conftest.$ac_ext <<EOF
-#line 13912 "configure"
+#line 13907 "configure"
 #include "confdefs.h"
 #include <$db_h_file>
 #if DB_VERSION_MAJOR > 1
@@ -13920,7 +13915,7 @@
   egrep "yes" >/dev/null 2>&1; then
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 13924 "configure"
+#line 13919 "configure"
 #include "confdefs.h"
 #include <$db_h_file>
 #if DB_VERSION_MAJOR > 2
@@ -13947,10 +13942,10 @@
 rm -f conftest*
 
     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
-echo "configure:13951: checking for $dbfunc" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 13954 "configure"
+echo "configure:13946: checking for $dbfunc" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 13949 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $dbfunc(); below.  */
@@ -13973,7 +13968,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:13977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$dbfunc=yes"
 else
@@ -13992,12 +13987,12 @@
 
     
 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
-echo "configure:13996: checking for $dbfunc in -ldb" >&5
+echo "configure:13991: 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 14001 "configure"
+#line 13996 "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
@@ -14008,7 +14003,7 @@
 $dbfunc()
 ; return 0; }
 EOF
-if { (eval echo configure:14012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14069,12 +14064,12 @@
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:14073: checking for SOCKSinit in -lsocks" >&5
+echo "configure:14068: 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 14078 "configure"
+#line 14073 "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
@@ -14085,7 +14080,7 @@
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:14089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14140,22 +14135,22 @@
 
 if test "$with_modules" != "no"; then
   echo "checking for module support" 1>&6
-echo "configure:14144: checking for module support" >&5
+echo "configure:14139: checking for module support" >&5
 
     if test "$with_msw" = "yes"; then
     have_dl=yes;
   else
         ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:14151: checking for dlfcn.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 14154 "configure"
+echo "configure:14146: checking for dlfcn.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 14149 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:14159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -14172,16 +14167,16 @@
   echo "$ac_t""yes" 1>&6
   
       echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
-echo "configure:14176: checking for dlopen in -lc" >&5
+echo "configure:14171: checking for dlopen in -lc" >&5
       cat > conftest.$ac_ext <<EOF
-#line 14178 "configure"
+#line 14173 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 int main() {
 	dlopen ("", 0);
 ; return 0; }
 EOF
-if { (eval echo configure:14185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
    have_dl=yes 
 else
@@ -14190,18 +14185,18 @@
   rm -rf conftest*
   
       echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:14194: checking for dlopen in -ldl" >&5
+echo "configure:14189: checking for dlopen in -ldl" >&5
       ac_save_LIBS="$LIBS"
       LIBS="-ldl $LIBS"
       cat > conftest.$ac_ext <<EOF
-#line 14198 "configure"
+#line 14193 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 int main() {
 	dlopen ("", 0);
 ; return 0; }
 EOF
-if { (eval echo configure:14205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
    have_dl=yes 
 else
@@ -14230,12 +14225,12 @@
     else
       
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:14234: checking for shl_load in -ldld" >&5
+echo "configure:14229: 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 14239 "configure"
+#line 14234 "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
@@ -14246,7 +14241,7 @@
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:14250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14273,12 +14268,12 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
-echo "configure:14277: checking for dld_init in -ldld" >&5
+echo "configure:14272: 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 14282 "configure"
+#line 14277 "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
@@ -14289,7 +14284,7 @@
 dld_init()
 ; return 0; }
 EOF
-if { (eval echo configure:14293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -14334,7 +14329,7 @@
 xealias=$internal_configuration
 
 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
-echo "configure:14338: checking how to build dynamic libraries for ${xehost}" >&5
+echo "configure:14333: checking how to build dynamic libraries for ${xehost}" >&5
 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
 case "$xehost" in
 *-*-linux-gnu*) ;;
@@ -14362,9 +14357,9 @@
   XEGCC=yes
 else
   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:14366: checking checking whether we are using GNU C" >&5
+echo "configure:14361: checking checking whether we are using GNU C" >&5
   cat > conftest.$ac_ext <<EOF
-#line 14368 "configure"
+#line 14363 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -14386,7 +14381,7 @@
 fi
 
 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
-echo "configure:14390: checking how to produce PIC code" >&5
+echo "configure:14385: checking how to produce PIC code" >&5
 wl=
 
 can_build_shared=yes
@@ -14487,18 +14482,18 @@
 
   # 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:14491: checking if PIC flag ${dll_cflags} really works" >&5
+echo "configure:14486: checking if PIC flag ${dll_cflags} really works" >&5
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $dll_cflags -DPIC"
   cat > conftest.$ac_ext <<EOF
-#line 14495 "configure"
+#line 14490 "configure"
 #include "confdefs.h"
 
 int main() {
 int x=0;
 ; return 0; }
 EOF
-if { (eval echo configure:14502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14497: \"$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
@@ -14529,7 +14524,7 @@
 xldf=
 xcldf=
 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
-echo "configure:14533: checking if C compiler can produce shared libraries" >&5
+echo "configure:14528: checking if C compiler can produce shared libraries" >&5
 if test "$XEGCC" = yes; then
   xcldf="-shared"
   xldf="-shared"
@@ -14580,14 +14575,14 @@
   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 14584 "configure"
+#line 14579 "configure"
 #include "confdefs.h"
 
 int main() {
 int x=0;
 ; return 0; }
 EOF
-if { (eval echo configure:14591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cc_produces_so=yes
 else
@@ -14612,7 +14607,7 @@
   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:14616: checking for ld used by GCC" >&5
+echo "configure:14611: checking for ld used by GCC" >&5
     ac_prog=`($CC -print-prog-name=ld) 2>&5`
     case "$ac_prog" in
     # Accept absolute paths.
@@ -14638,7 +14633,7 @@
     esac
   else
     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:14642: checking for GNU ld" >&5
+echo "configure:14637: checking for GNU ld" >&5
   fi
 
   if test -z "$LTLD"; then
@@ -14676,7 +14671,7 @@
 
 # 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:14680: checking if the linker is GNU ld" >&5
+echo "configure:14675: 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
@@ -14704,7 +14699,7 @@
   # 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:14708: checking whether the linker supports shared libraries" >&5
+echo "configure:14703: checking whether the linker supports shared libraries" >&5
   dll_ld=$CC
   dll_ldflags=$LDFLAGS
   ld_shlibs=yes
@@ -14912,10 +14907,10 @@
     for ac_func in dlerror _dlerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14916: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 14919 "configure"
+echo "configure:14911: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 14914 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -14938,7 +14933,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:14942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -14977,11 +14972,11 @@
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 14981 "configure"
+#line 14976 "configure"
 #include "confdefs.h"
 int main(int c,char *v[]){return 0;}
 EOF
-if { (eval echo configure:14985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:14980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   :
 else
--- a/lib-src/ChangeLog	Sat Apr 13 20:44:53 2002 +0000
+++ b/lib-src/ChangeLog	Sun Apr 14 12:43:31 2002 +0000
@@ -1,3 +1,22 @@
+2002-04-14  Ben Wing  <ben@xemacs.org>
+
+	* make-docfile.c:
+	* make-docfile.c (next_extra_elc):
+	* make-docfile.c (again): Removed.
+	* make-docfile.c (main):
+	* make-docfile.c (getc_iso2022):
+	* make-docfile.c (MDGET):
+	* make-docfile.c (read_c_string):
+	* make-docfile.c (write_c_args):
+	* make-docfile.c (scan_c_file):
+	* make-docfile.c (read_lisp_symbol):
+	* make-docfile.c (scan_lisp_file):
+	Add basic support for handling ISO 2022 doc strings -- we parse
+	the basic charset designation sequences so we know whether we're
+	in ASCII and have to pay attention to end quotes and such.
+	
+	Reformat code according to coding standards.
+
 2002-04-05  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.6 "bok choi" is released.
--- a/lib-src/make-docfile.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/lib-src/make-docfile.c	Sun Apr 14 12:43:31 2002 +0000
@@ -2,42 +2,42 @@
    Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1998, 1999 J. Kean Johnston.
-   Copyright (C) 2001 Ben Wing.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+   Copyright (C) 2001, 2002 Ben Wing.
+   
+   This file is part of XEmacs.
+   
+   XEmacs is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+   
+   XEmacs is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+   for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with XEmacs; see the file COPYING.  If not, write to
+   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: FSF 19.30. */
 
 /* The arguments given to this program are all the C and Lisp source files
- of XEmacs.  .elc and .el and .c files are allowed.
- A .o or .obj file can also be specified; the .c file it was made from is used.
- This helps the makefile pass the correct list of files.
-
- The results, which go to standard output or to a file
- specified with -a or -o (-a to append, -o to start from nothing),
- are entries containing function or variable names and their documentation.
- Each entry starts with a ^_ character.
- Then comes F for a function or V for a variable.
- Then comes the function or variable name, terminated with a newline.
- Then comes the documentation for that function or variable.
-
- Added 19.15/20.1:  `-i site-packages' allow installer to dump extra packages
- without modifying Makefiles, etc.
+   of XEmacs.  .elc and .el and .c files are allowed.
+   A .o or .obj file can also be specified; the .c file it was made from is
+   used.  This helps the makefile pass the correct list of files.
+   
+   The results, which go to standard output or to a file
+   specified with -a or -o (-a to append, -o to start from nothing),
+   are entries containing function or variable names and their documentation.
+   Each entry starts with a ^_ character.
+   Then comes F for a function or V for a variable.
+   Then comes the function or variable name, terminated with a newline.
+   Then comes the documentation for that function or variable.
+   
+   Added 19.15/20.1:  `-i site-packages' allow installer to dump extra packages
+   without modifying Makefiles, etc.
  */
 
 #include <config.h>
@@ -124,36 +124,40 @@
 }
 
 static char *
-next_extra_elc(char *extra_elcs)
+next_extra_elc (char *extra_elcs)
 {
   static FILE *fp = NULL;
   static char line_buf[BUFSIZ];
   char *p = line_buf+1;
 
-  if (!fp) {
-    if (!extra_elcs) {
-      return NULL;
-    } else if (!(fp = fopen(extra_elcs, READ_BINARY))) {
-      /* It is not an error if this file doesn't exist. */
-      /*fatal("error opening site package file list", 0);*/
+  if (!fp)
+    {
+      if (!extra_elcs)
+	return NULL;
+      else if (!(fp = fopen (extra_elcs, READ_BINARY)))
+	{
+	  /* It is not an error if this file doesn't exist. */
+	  /*fatal ("error opening site package file list", 0);*/
+	  return NULL;
+	}
+      fgets (line_buf, BUFSIZ, fp);
+    }
+
+ again:
+  if (!fgets (line_buf, BUFSIZ, fp))
+    {
+      fclose (fp);
+      fp = NULL;
       return NULL;
     }
-    fgets(line_buf, BUFSIZ, fp);
-  }
-
-again:
-  if (!fgets(line_buf, BUFSIZ, fp)) {
-    fclose(fp);
-    fp = NULL;
-    return NULL;
-  }
   line_buf[0] = '\0';
-  if (strlen(p) <= 2 || strlen(p) >= (BUFSIZ - 5)) {
-    /* reject too short or too long lines */
-    goto again;
-  }
-  p[strlen(p) - 2] = '\0';
-  strcat(p, ".elc");
+  if (strlen (p) <= 2 || strlen (p) >= (BUFSIZ - 5))
+    {
+      /* reject too short or too long lines */
+      goto again;
+    }
+  p[strlen (p) - 2] = '\0';
+  strcat (p, ".elc");
 
   return p;
 }
@@ -201,10 +205,11 @@
       i += 2;
     }
 
-  if (argc > (i + 1) && !strcmp(argv[i], "-i")) {
-    extra_elcs = argv[i + 1];
-    i += 2;
-  }
+  if (argc > (i + 1) && !strcmp (argv[i], "-i"))
+    {
+      extra_elcs = argv[i + 1];
+      i += 2;
+    }
 
   if (outfile == 0)
     fatal ("No output file specified", "");
@@ -246,13 +251,13 @@
 	}
     }
 
-  if (extra_elcs) {
-    char *p;
+  if (extra_elcs)
+    {
+      char *p;
 
-    while ((p = next_extra_elc(extra_elcs)) != NULL) {
-      err_count += scan_file(p);
+      while ((p = next_extra_elc (extra_elcs)) != NULL)
+	err_count += scan_file (p);
     }
-  }
 
   putc ('\n', outfile);
   if (ellcc)
@@ -286,17 +291,102 @@
       return scan_c_file (filename, READ_TEXT);
     }
 }
+
+static int
+getc_skipping_iso2022 (FILE *file)
+{
+  register int c;
+  /* #### Kludge -- Ignore any ISO2022 sequences */
+  c = getc (file);
+  while (c == 27)
+    {
+      c = getc (file);
+      if (c == '$')
+	c = getc (file);
+      if (c >= '(' && c <= '/')
+	c = getc (file);
+      c = getc (file);
+    }
+  return c;
+}
+
+enum iso2022_state
+{
+  ISO_NOTHING,
+  ISO_ESC,
+  ISO_DOLLAR,
+  ISO_FINAL_IS_NEXT,
+  ISO_DOLLAR_AND_FINAL_IS_NEXT
+};
+
+static int non_ascii_p;
+
+static int
+getc_iso2022 (FILE *file)
+{
+  /* #### Kludge -- Parse ISO2022 sequences (more or less) */
+  static enum iso2022_state state;
+  static int prevc;
+  register int c;
+  c = getc (file);
+  switch (state)
+    {
+    case ISO_NOTHING:
+      if (c == 27)
+	state = ISO_ESC;
+      break;
+
+    case ISO_ESC:
+      if (c == '$')
+	state = ISO_DOLLAR;
+      else if (c >= '(' && c <= '/')
+	state = ISO_FINAL_IS_NEXT;
+      else
+	state = ISO_NOTHING;
+      break;
+
+    case ISO_DOLLAR:
+      if (c >= '(' && c <= '/')
+	state = ISO_DOLLAR_AND_FINAL_IS_NEXT;
+      else if (c >= '@' && c <= 'B') /* ESC $ @ etc */
+	{
+	  non_ascii_p = 1;
+	  state = ISO_NOTHING;
+	}
+      else
+	state = ISO_NOTHING;
+      break;
+
+    case ISO_FINAL_IS_NEXT:
+      if (prevc == '(' && c == 'B') /* ESC ( B, invoke ASCII */
+	non_ascii_p = 0;
+      else if (prevc == '(' || prevc == ',') /* ESC ( x or ESC , x */
+	non_ascii_p = 1;
+      state = ISO_NOTHING;
+      break;
+
+    case ISO_DOLLAR_AND_FINAL_IS_NEXT:
+      if (prevc == '(' || prevc == ',') /* ESC $ ( x or ESC $ , x */
+	non_ascii_p = 1;
+      state = ISO_NOTHING;
+      break;
+    }
+      
+  prevc = c;
+  return c;
+}
+
 
 char buf[128];
 
 /* Skip a C string from INFILE,
- and return the character that follows the closing ".
+   and return the character that follows the closing ".
  If printflag is positive, output string contents to outfile.
  If it is negative, store contents in buf.
  Convert escape sequences \n and \t to newline and tab;
  discard \ followed by newline.  */
 
-#define MDGET do { prevc = c; c = getc (infile); } while (0)
+#define MDGET do { prevc = c; c = getc_iso2022 (infile); } while (0)
 static int
 read_c_string (FILE *infile, int printflag, int c_docstring)
 {
@@ -307,9 +397,9 @@
   MDGET;
   while (c != EOF)
     {
-      while ((c_docstring || c != '"') && c != EOF)
+      while ((c_docstring || c != '"' || non_ascii_p) && c != EOF)
 	{
-	  if (c == '*')
+	  if (c == '*' && !non_ascii_p)
 	    {
 	      int cc = getc (infile);
 	      if (cc == '/')
@@ -343,7 +433,7 @@
 		*p++ = '\n';
 	    }
 
-	  if (c == '\\')
+	  if (c == '\\' && !non_ascii_p)
 	    {
 	      MDGET;
 	      if (c == '\n')
@@ -364,7 +454,7 @@
 	      start = 0;
 	      if (printflag > 0)
 		{
-		  if (ellcc && c == '"')
+		  if (ellcc && c == '"' && !non_ascii_p)
 		    putc ('\\', outfile);
 		  putc (c, outfile);
 		}
@@ -381,22 +471,22 @@
 	      MDGET;
 	    }
 	  while (isspace (c));
-	  if (c != '"')
+	  if (c != '"' || non_ascii_p)
 	    break;
 	}
       else
 	{
 	  MDGET;
-	  if (c != '"')
+	  if (c != '"' || non_ascii_p)
 	    break;
 	  /* If we had a "", concatenate the two strings.  */
 	}
       MDGET;
     }
-
+  
   if (printflag < 0)
     *p = 0;
-
+  
   return c;
 }
 
@@ -437,7 +527,7 @@
       static char lo[] = "Lisp_Object";
       if ((C_IDENTIFIER_CHAR_P (c) != in_ident) && !in_ident &&
 	  (strncmp (p, lo, sizeof (lo) - 1) == 0) &&
-	  isspace((unsigned char) (* (p + sizeof (lo) - 1))))
+	  isspace ((unsigned char) (* (p + sizeof (lo) - 1))))
 	{
 	  p += (sizeof (lo) - 1);
 	  while (isspace ((unsigned char) (*p)))
@@ -495,7 +585,7 @@
 #endif
     }
   if (!ellcc)
-    putc ('\n', out); /* XEmacs addition */
+    putc ('\n', out);		/* XEmacs addition */
 }
 
 /* Read through a c file.  If a .o or .obj file is named,
@@ -617,7 +707,7 @@
 	commas = 2;
       else if (defvarflag)
 	commas = 1;
-      else  /* For DEFSIMPLE and DEFPRED */
+      else			/* For DEFSIMPLE and DEFPRED */
 	commas = 2;
 
       while (commas)
@@ -636,7 +726,7 @@
 		  ungetc (c, infile);
 		  if (commas == 2) /* pick up minargs */
 		    fscanf (infile, "%d", &minargs);
-		  else /* pick up maxargs */
+		  else		/* pick up maxargs */
 		    if (c == 'M' || c == 'U') /* MANY || UNEVALLED */
 		      maxargs = -1;
 		    else
@@ -672,15 +762,15 @@
 
       if (defunflag || defvarflag || c == '"')
 	{
-      if (ellcc)
-        fprintf (outfile, "  CDOC%s(\"%s\", \"\\\n",
-                 defvarflag ? "SYM" : "SUBR", buf);
-      else
-        {
-          putc (037, outfile);
-          putc (defvarflag ? 'V' : 'F', outfile);
-          fprintf (outfile, "%s\n", buf);
-        }
+	  if (ellcc)
+	    fprintf (outfile, "  CDOC%s(\"%s\", \"\\\n",
+		     defvarflag ? "SYM" : "SUBR", buf);
+	  else
+	    {
+	      putc (037, outfile);
+	      putc (defvarflag ? 'V' : 'F', outfile);
+	      fprintf (outfile, "%s\n", buf);
+	    }
 	  c = read_c_string (infile, 1, (defunflag || defvarflag));
 
 	  /* If this is a defun, find the arguments and print them.  If
@@ -690,7 +780,7 @@
 	  if (defunflag && maxargs != -1)
 	    {
 	      char argbuf[1024], *p = argbuf;
-#if 0 /* For old DEFUN's only */
+#if 0				/* For old DEFUN's only */
 	      while (c != ')')
 		{
 		  if (c < 0)
@@ -712,14 +802,14 @@
 	      while (c != ')');
 	      *p = '\0';
 	      /* Output them.  */
-          if (ellcc)
-            fprintf (outfile, "\\n\\\n\\n\\\n");
-          else
-            fprintf (outfile, "\n\n");
+	      if (ellcc)
+		fprintf (outfile, "\\n\\\n\\n\\\n");
+	      else
+		fprintf (outfile, "\n\n");
 	      write_c_args (outfile, buf, argbuf, minargs, maxargs);
 	    }
-      if (ellcc)
-        fprintf (outfile, "\\n\");\n\n");
+	  if (ellcc)
+	    fprintf (outfile, "\\n\");\n\n");
 	}
     }
  eof:
@@ -728,17 +818,17 @@
 }
 
 /* Read a file of Lisp code, compiled or interpreted.
- Looks for
-  (defun NAME ARGS DOCSTRING ...)
-  (defmacro NAME ARGS DOCSTRING ...)
-  (autoload (quote NAME) FILE DOCSTRING ...)
-  (defvar NAME VALUE DOCSTRING)
-  (defconst NAME VALUE DOCSTRING)
-  (fset (quote NAME) (make-byte-code ... DOCSTRING ...))
-  (fset (quote NAME) #[... DOCSTRING ...])
-  (defalias (quote NAME) #[... DOCSTRING ...])
- starting in column zero.
- (quote NAME) may appear as 'NAME as well.
+   Looks for
+   (defun NAME ARGS DOCSTRING ...)
+   (defmacro NAME ARGS DOCSTRING ...)
+   (autoload (quote NAME) FILE DOCSTRING ...)
+   (defvar NAME VALUE DOCSTRING)
+   (defconst NAME VALUE DOCSTRING)
+   (fset (quote NAME) (make-byte-code ... DOCSTRING ...))
+   (fset (quote NAME) #[... DOCSTRING ...])
+   (defalias (quote NAME) #[... DOCSTRING ...])
+   starting in column zero.
+   (quote NAME) may appear as 'NAME as well.
 
  We also look for #@LENGTH CONTENTS^_ at the beginning of the line.
  When we find that, we save it for the following defining-form,
@@ -792,7 +882,7 @@
 
   if (! buffer[0])
     fprintf (stderr, "## expected a symbol, got '%c'\n", c);
-
+  
   skip_white (infile);
 }
 
@@ -807,7 +897,7 @@
   if (infile == NULL)
     {
       perror (filename);
-      return 0;				/* No error */
+      return 0;			/* No error */
     }
 
   c = '\n';
@@ -818,21 +908,21 @@
 
       if (c != '\n')
 	{
-	  c = getc (infile);
+	  c = getc_skipping_iso2022 (infile);
 	  continue;
 	}
-      c = getc (infile);
+      c = getc_skipping_iso2022 (infile);
       /* Detect a dynamic doc string and save it for the next expression.  */
       if (c == '#')
 	{
-	  c = getc (infile);
+	  c = getc_skipping_iso2022 (infile);
 	  if (c == '@')
 	    {
 	      int length = 0;
 	      int i;
 
 	      /* Read the length.  */
-	      while ((c = getc (infile),
+	      while ((c = getc_skipping_iso2022 (infile),
 		      c >= '0' && c <= '9'))
 		{
 		  length *= 10;
@@ -855,9 +945,9 @@
 		 but it is redundant in DOC.  So get rid of it here.  */
 	      saved_string[length - 1] = 0;
 	      /* Skip the newline.  */
-	      c = getc (infile);
+	      c = getc_skipping_iso2022 (infile);
 	      while (c != '\n')
-		c = getc (infile);
+		c = getc_skipping_iso2022 (infile);
 	    }
 	  continue;
 	}
@@ -875,11 +965,11 @@
 
 	  /* Skip the arguments: either "nil" or a list in parens */
 
-	  c = getc (infile);
-	  if (c == 'n') /* nil */
+	  c = getc_skipping_iso2022 (infile);
+	  if (c == 'n')		/* nil */
 	    {
-	      if ((c = getc (infile)) != 'i' ||
-		  (c = getc (infile)) != 'l')
+	      if ((c = getc_skipping_iso2022 (infile)) != 'i' ||
+		  (c = getc_skipping_iso2022 (infile)) != 'l')
 		{
 		  fprintf (stderr, "## unparsable arglist in %s (%s)\n",
 			   buffer, filename);
@@ -894,15 +984,15 @@
 	    }
 	  else
 	    while (c != ')')
-	      c = getc (infile);
+	      c = getc_skipping_iso2022 (infile);
 	  skip_white (infile);
 
 	  /* If the next three characters aren't `dquote bslash newline'
 	     then we're not reading a docstring.
-	   */
-	  if ((c = getc (infile)) != '"' ||
-	      (c = getc (infile)) != '\\' ||
-	      (c = getc (infile)) != '\n')
+	     */
+	  if ((c = getc_skipping_iso2022 (infile)) != '"' ||
+	      (c = getc_skipping_iso2022 (infile)) != '\\' ||
+	      (c = getc_skipping_iso2022 (infile)) != '\n')
 	    {
 #ifdef DEBUG
 	      fprintf (stderr, "## non-docstring in %s (%s)\n",
@@ -922,21 +1012,13 @@
 	  if (saved_string == 0)
 	    {
 
-	      /* Skip until the first newline; remember the two previous chars. */
+	      /* Skip until the first newline; remember the two previous
+                 chars. */
 	      while (c != '\n' && c >= 0)
 		{
-		  /* #### Kludge -- Ignore any ESC x x ISO2022 sequences */
-		  if (c == 27)
-		    {
-		      getc (infile);
-		      getc (infile);
-		      goto nextchar;
-		    }
-
 		  c2 = c1;
 		  c1 = c;
-		nextchar:
-		  c = getc (infile);
+		  c = getc_skipping_iso2022 (infile);
 		}
 
 	      /* If two previous characters were " and \,
@@ -957,7 +1039,7 @@
 	  char c1 = 0, c2 = 0;
 	  type = 'F';
 
-	  c = getc (infile);
+	  c = getc_skipping_iso2022 (infile);
 	  if (c == '\'')
 	    read_lisp_symbol (infile, buffer);
 	  else
@@ -976,7 +1058,7 @@
 		  continue;
 		}
 	      read_lisp_symbol (infile, buffer);
-	      c = getc (infile);
+	      c = getc_skipping_iso2022 (infile);
 	      if (c != ')')
 		{
 		  fprintf (stderr,
@@ -988,12 +1070,13 @@
 
 	  if (saved_string == 0)
 	    {
-	      /* Skip until the first newline; remember the two previous chars. */
+	      /* Skip until the first newline; remember the two previous
+                 chars. */
 	      while (c != '\n' && c >= 0)
 		{
 		  c2 = c1;
 		  c1 = c;
-		  c = getc (infile);
+		  c = getc_skipping_iso2022 (infile);
 		}
 
 	      /* If two previous characters were " and \,
@@ -1012,7 +1095,7 @@
       else if (! strcmp (buffer, "autoload"))
 	{
 	  type = 'F';
-	  c = getc (infile);
+	  c = getc_skipping_iso2022 (infile);
 	  if (c == '\'')
 	    read_lisp_symbol (infile, buffer);
 	  else
@@ -1031,7 +1114,7 @@
 		  continue;
 		}
 	      read_lisp_symbol (infile, buffer);
-	      c = getc (infile);
+	      c = getc_skipping_iso2022 (infile);
 	      if (c != ')')
 		{
 		  fprintf (stderr,
@@ -1041,7 +1124,7 @@
 		}
 	    }
 	  skip_white (infile);
-	  if ((c = getc (infile)) != '\"')
+	  if ((c = getc_skipping_iso2022 (infile)) != '\"')
 	    {
 	      fprintf (stderr, "## autoload of %s unparsable (%s)\n",
 		       buffer, filename);
@@ -1054,9 +1137,9 @@
 	    {
 	      /* If the next three characters aren't `dquote bslash newline'
 		 then we're not reading a docstring.  */
-	      if ((c = getc (infile)) != '"'  ||
-		  (c = getc (infile)) != '\\' ||
-		  (c = getc (infile)) != '\n')
+	      if ((c = getc_skipping_iso2022 (infile)) != '"'  ||
+		  (c = getc_skipping_iso2022 (infile)) != '\\' ||
+		  (c = getc_skipping_iso2022 (infile)) != '\n')
 		{
 #ifdef DEBUG
 		  fprintf (stderr, "## non-docstring in %s (%s)\n",
@@ -1067,7 +1150,7 @@
 	    }
 	}
 
-#if 0 /* causes crash */
+#if 0				/* causes crash */
       else if (! strcmp (buffer, "if") ||
 	       ! strcmp (buffer, "byte-code"))
 	;
@@ -1085,10 +1168,10 @@
       /* At this point, we should either use the previous
 	 dynamic doc string in saved_string
 	 or gobble a doc string from the input file.
-
+	 
 	 In the latter case, the opening quote (and leading
 	 backslash-newline) have already been read.  */
-      putc ('\n', outfile); /* XEmacs addition */
+      putc ('\n', outfile);	/* XEmacs addition */
       putc (037, outfile);
       putc (type, outfile);
       fprintf (outfile, "%s\n", buffer);
--- a/lisp/ChangeLog	Sat Apr 13 20:44:53 2002 +0000
+++ b/lisp/ChangeLog	Sun Apr 14 12:43:31 2002 +0000
@@ -1,3 +1,58 @@
+2002-04-14  Ben Wing  <ben@xemacs.org>
+
+	* abbrev.el:
+	* abbrev.el (abbrev-mode):
+	* abbrev.el (only-global-abbrevs):
+	* abbrev.el (defining-abbrev-turns-on-abbrev-mode): New.
+	* abbrev.el (define-abbrev-table):
+	* abbrev.el (global-abbrev-mode): New.
+	* abbrev.el (add-mode-abbrev):
+	* abbrev.el (add-global-abbrev):
+	* abbrev.el (inverse-add-mode-abbrev):
+	* abbrev.el (inverse-add-global-abbrev):
+	Add `global-abbrev-mode', which turns on or off abbrev-mode in all
+	buffers.  Added `defining-abbrev-turns-on-abbrev-mode' -- if
+	non-nil, defining an abbrev through an interactive function will
+	automatically turn on abbrev-mode, either globally or locally
+	depending on the command.  This is the "what you'd expect"
+	behavior.
+	* indent.el:
+	* indent.el (indent-balanced-expression-function): New.
+	* indent.el (indent-balanced-expression): New.
+	* indent.el (indent-region-or-balanced-expression): New.
+	general function for indenting a balanced expression in a
+	mode-correct way.  Works similar to indent-region in that a mode
+	can specify a specific command to do the whole operation; if not,
+	figure out the region using forward-sexp and indent each line
+	using indent-according-to-mode.
+	* keydefs.el:
+	* keydefs.el (global-map): Removed.
+	Modify M-C-backslash to do indent-region-or-balanced-expression.
+	Make S-Tab just insert a TAB char, like it's meant to do.
+	* make-docfile.el:
+	* make-docfile.el (docfile-out-of-date):
+	Now that we're using the call-process-in-lisp, we need to load
+	an extra file win32-native.el because we're running a bare temacs.
+	* menubar-items.el:
+	* menubar-items.el (default-menubar):
+	Totally redo the Cmds menu so that most used commands appear
+	directly on the menu and less used commands appear in submenus.
+	The old way may have been very pretty, but rather impractical.
+	* process.el (call-process-internal):
+	Under Windows, don't ever use old-call-process-internal, even
+	in batch mode.  We can do processes in batch mode.
+	* subr.el:
+	* subr.el (truncate-string-to-width):
+	* subr.el (truncate-string-with-continuation-dots): New.
+	* subr.el (plist-to-alist):
+	Someone recoded truncate-string-to-width, saying "the FSF version
+	is too complicated and does lots of hard-to-understand stuff" but
+	the resulting recoded version was *totally* wrong!  it
+	misunderstood the basic point of this function, which is work in
+	*columns* not chars.  i dumped ours and copied the version from
+	FSF 21.1.  Also added truncate-string-with-continuation-dots,
+	since this idiom is used often.  
+
 2002-04-07  William M. Perry  <wmperry@gnu.org>
 
 	* startup.el (command-line): Don't call init-menubar-at-startup
--- a/lisp/abbrev.el	Sat Apr 13 20:44:53 2002 +0000
+++ b/lisp/abbrev.el	Sun Apr 14 12:43:31 2002 +0000
@@ -1,6 +1,7 @@
 ;;; abbrev.el --- abbrev mode commands for Emacs
 
 ;; Copyright (C) 1985, 1986, 1987, 1992, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: abbrev, dumped
@@ -37,17 +38,28 @@
   :tag "Abbreviations"
   :group 'editing)
 
-(defgroup abbrev-mode nil
+(defcustom abbrev-mode nil
   "Word abbreviations mode."
+  :initialize #'set-default
+  :set #'(lambda (sym val)
+	   (global-abbrev-mode (if val 1 0)))
   :group 'abbrev)
 
-;jwz: this is preloaded so don't ;;;###autoload
-(defcustom only-global-abbrevs nil "\
-*Non-nil means user plans to use global abbrevs only.
+(defcustom only-global-abbrevs nil
+  "*Non-nil means user plans to use global abbrevs only.
 Makes the commands to define mode-specific abbrevs define global ones instead."
   :type 'boolean
   :group 'abbrev)
 
+(defcustom defining-abbrev-turns-on-abbrev-mode t
+  "*NOn-nil turns on abbrev-mode whenever an abbrev is defined.
+This occurs only when the user-level commands (e.g. `add-global-abbrev')
+are used.  abbrev-mode is turned on in all buffers or the current-buffer
+only, depending on whether a global or mode-specific abbrev is defined."
+  ;;#### should turn on in all buffers of current mode in mode-specific abbrev!
+  :type 'boolean
+  :group 'abbrev)
+
 ;;; XEmacs: the following block of code is not in FSF
 (defvar abbrev-table-name-list '()
   "List of symbols whose values are abbrev tables.")
@@ -66,7 +78,6 @@
   (setq abbrevs-changed t)
   nil)
 
-
 (defun define-abbrev-table (table-name definitions)
   "Define TABLE-NAME (a symbol) as an abbrev table name.
 Define abbrevs in it according to DEFINITIONS, which is a list of elements
@@ -270,6 +281,22 @@
   ;; XEmacs change
   (redraw-modeline))
 
+;; XEmacs change
+(defun global-abbrev-mode (arg)
+  "Toggle abbrev mode in all buffers.
+With argument ARG, enable abbrev mode globally if ARG is positive, else
+disable.  In abbrev mode, inserting an abbreviation causes it to expand
+and be replaced by its expansion."
+  (interactive "P")
+  (let ((newval (if (null arg) (not abbrev-mode)
+		  (> (prefix-numeric-value arg) 0))))
+    (setq-default abbrev-mode newval)
+    (loop for buf being the buffers do
+      (if (not (eq (symbol-value-in-buffer 'abbrev-mode buf) newval))
+	  (with-current-buffer buf
+	    (setq abbrev-mode newval)))))
+  (redraw-modeline))
+
 
 (defvar edit-abbrevs-map nil
   "Keymap used in edit-abbrevs.")
@@ -423,11 +450,12 @@
 	  (save-excursion (backward-word arg) (point))))))
 
 (defun add-mode-abbrev (arg)
-  "Define mode-specific abbrev for last word(s) before point.
-Argument is how many words before point form the expansion;
-or zero means the region is the expansion.
-A negative argument means to undefine the specified abbrev.
-Reads the abbreviation in the minibuffer.
+  "Define mode-specific abbrev for region or last word(s) before point.
+If region active, use it as the expansion\; otherwise, choose the word
+before point.  A prefix argument specifies the number of words before point
+that form the expansion; or zero means the text between point and mark is
+the expansion.  A negative argument means to undefine the specified abbrev.
+This command uses the minibuffer to read the abbreviation.
 
 Don't use this function in a Lisp program; use `define-abbrev' instead."
   ;; XEmacs change:
@@ -437,19 +465,22 @@
        global-abbrev-table
      (or local-abbrev-table
 	 (error "No per-mode abbrev table")))
-   "Mode" arg))
+   "Mode" arg)
+  (if defining-abbrev-turns-on-abbrev-mode (abbrev-mode 1)))
 
 (defun add-global-abbrev (arg)
-  "Define global (all modes) abbrev for last word(s) before point.
-The prefix argument specifies the number of words before point that form the
-expansion; or zero means the region is the expansion.
-A negative argument means to undefine the specified abbrev.
+  "Define global (all modes) abbrev for region or last word(s) before point.
+If region active, use it as the expansion\; otherwise, choose the word
+before point.  A prefix argument specifies the number of words before point
+that form the expansion; or zero means the text between point and mark is
+the expansion.  A negative argument means to undefine the specified abbrev.
 This command uses the minibuffer to read the abbreviation.
 
 Don't use this function in a Lisp program; use `define-abbrev' instead."
   ;; XEmacs change:
   (interactive "P")
-  (add-abbrev global-abbrev-table "Global" arg))
+  (add-abbrev global-abbrev-table "Global" arg)
+  (if defining-abbrev-turns-on-abbrev-mode (global-abbrev-mode 1)))
 
 (defun add-abbrev (table type arg)
   "Add an abbreviation to abbrev table TABLE.
@@ -492,7 +523,8 @@
        global-abbrev-table
      (or local-abbrev-table
 	 (error "No per-mode abbrev table")))
-   "Mode" arg))
+   "Mode" arg)
+  (if defining-abbrev-turns-on-abbrev-mode (abbrev-mode 1)))
 
 (defun inverse-add-global-abbrev (arg)
   "Define last word before point as a global (mode-independent) abbrev.
@@ -500,7 +532,8 @@
 This command uses the minibuffer to read the expansion.
 Expands the abbreviation after defining it."
   (interactive "p")
-  (inverse-add-abbrev global-abbrev-table "Global" arg))
+  (inverse-add-abbrev global-abbrev-table "Global" arg)
+  (if defining-abbrev-turns-on-abbrev-mode (global-abbrev-mode 1)))
 
 (defun inverse-add-abbrev (table type arg)
   (let (name nameloc exp)
--- a/lisp/indent.el	Sat Apr 13 20:44:53 2002 +0000
+++ b/lisp/indent.el	Sun Apr 14 12:43:31 2002 +0000
@@ -1,6 +1,7 @@
 ;;; indent.el --- indentation commands for XEmacs
 
 ;; Copyright (C) 1985, 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Maintainer: FSF
 ;; Keywords: lisp, languages, tools, dumped
@@ -333,6 +334,39 @@
 	(forward-line 1))
       (move-marker end nil))))
 
+(defvar indent-balanced-expression-function nil
+  "Short cut function to indent balanced expression.
+A value of nil means really run `indent-according-to-mode' on each line of
+balanced expression as computed with `forward-sexp'.")
+
+(defun indent-balanced-expression ()
+  "Indent each nonblank line in the balanced expression at point.
+Use `indent-balanced-expression-function' if that's non-nil, or find
+expression with `forward-sexp' and use `indent-region' on result."
+  (interactive "")
+  (let ((fun (or indent-balanced-expression-function
+		 (cond ((memq major-mode '(c-mode c++-mode java-mode objc-mode
+						  idl-mode pike-mode
+						  c++-c-mode elec-c-mode))
+			'c-indent-exp)
+		       ((memq major-mode
+			      '(lisp-mode
+				emacs-lisp-mode lisp-interaction-mode
+				scheme-mode inferior-scheme-mode
+				scheme-interaction-mode))
+			'indent-sexp)))))
+    (if fun (funcall fun)
+      (let ((end (save-excursion (forward-sexp) (point))))
+	(indent-region (point) end nil)))))
+
+(defun indent-region-or-balanced-expression ()
+  "Indent region if active, or balanced expression at point.
+See `indent-region' and `indent-balanced-expression'."
+  (interactive "")
+  (if (region-active-p)
+      (indent-region (region-beginning) (region-end) nil)
+    (indent-balanced-expression)))
+
 (defun indent-relative-maybe ()
   "Indent a new line like previous nonblank line."
   (interactive)
--- a/lisp/keydefs.el	Sat Apr 13 20:44:53 2002 +0000
+++ b/lisp/keydefs.el	Sun Apr 14 12:43:31 2002 +0000
@@ -1,7 +1,7 @@
 ;;; keydefs.el --- Define standard keybindings.
 
 ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc.
-;; Copyright (C) 2000, 2001 Ben Wing.
+;; Copyright (C) 2000, 2001, 2002 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: internal, dumped
@@ -167,11 +167,11 @@
 
 ;;(define-key global-map "\t" 'self-insert-command)
 (define-key global-map "\t" 'indent-for-tab-command)
-(define-key global-map "\M-\C-\\" 'indent-region)
+(define-key global-map "\M-\C-\\" 'indent-region-or-balanced-expression)
 (define-key global-map "\C-x\t" 'indent-rigidly)
 (define-key global-map "\M-i" 'tab-to-tab-stop)
 ;; XEmacs addition:
-(define-key global-map [(shift tab)] 'tab-to-tab-stop)
+(define-key global-map [(shift tab)] 'self-insert-command)
 
 ;; FSFmacs isearch.el
 
--- a/lisp/make-docfile.el	Sat Apr 13 20:44:53 2002 +0000
+++ b/lisp/make-docfile.el	Sun Apr 14 12:43:31 2002 +0000
@@ -1,6 +1,7 @@
 ;;; make-docfile.el --- Cache docstrings in external file
 
 ;; Copyright (C) 1985, 1986, 1992-1995, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 2002 Ben Wing.
 
 ;; Author: Unknown
 ;; Maintainer: Steven L Baur <steve@xemacs.org>
@@ -88,6 +89,8 @@
 (load "dump-paths.el")
 (require 'custom)
 (load "process")
+;; need for stuff called from C by process code
+(if (featurep 'windows-nt) (load "win32-native"))
 
 (let (preloaded-file-list)
   (load (expand-file-name "../lisp/dumped-lisp.el"))
@@ -162,7 +165,8 @@
       ;; (locate-file-clear-hashing nil)
       (if (memq system-type '(berkeley-unix next-mach))
 	  ;; Suboptimal, but we have a unresolved bug somewhere in the
-	  ;; low-level process code
+	  ;; low-level process code.  #### Now that we've switched to using
+	  ;; the regular asynch process code, we should try removing this.
 	  (call-process-internal
 	   "/bin/csh"
 	   nil
--- a/lisp/menubar-items.el	Sat Apr 13 20:44:53 2002 +0000
+++ b/lisp/menubar-items.el	Sun Apr 14 12:43:31 2002 +0000
@@ -424,17 +424,17 @@
 
 
      ("C%_mds"
-      ["Repeat %_Last Complex Command..." repeat-complex-command]
+      ["Repeat Last %_Complex Command..." repeat-complex-command]
       ["E%_valuate Lisp Expression..." eval-expression]
       ["Execute %_Named Command..." execute-extended-command]
       "----"
-      ["Start %_Macro Recording" start-kbd-macro
+      ["Start %_Defining Macro" start-kbd-macro
        :included (not defining-kbd-macro)]
-      ["End %_Macro Recording" end-kbd-macro
+      ["Stop %_Defining Macro" end-kbd-macro
        :included defining-kbd-macro]
       ["E%_xecute Last Macro" call-last-kbd-macro
        :active last-kbd-macro]
-      ("%_Other Macro"
+      ("Other %_Macro"
        ["Edit %_Last Macro" edit-last-kbd-macro
 	:active last-kbd-macro]
        ["%_Edit Macro..." edit-kbd-macro]
@@ -460,24 +460,32 @@
 	:active (region-exists-p)]
        )
       "----"
-      ("%_Abbrev"
        ["D%_ynamic Abbrev Expand" dabbrev-expand]
+       ["Define %_Global Abbrev for " add-global-abbrev
+	:suffix	(truncate-string-with-continuation-dots
+		 (abbrev-string-to-be-defined nil)
+		 40)]
+      ("Other %_Abbrev"
        ["Dynamic Abbrev %_Complete" dabbrev-completion]
        ["Dynamic Abbrev Complete in %_All Buffers" (dabbrev-completion 16)]
        "----"
        "----"
        ["%_Define Global Abbrev for " add-global-abbrev
-	:suffix	(abbrev-string-to-be-defined nil)
-	:active abbrev-mode]
+	:suffix	(truncate-string-with-continuation-dots
+		 (abbrev-string-to-be-defined nil)
+		 40)]
        ["Define %_Mode-Specific Abbrev for " add-mode-abbrev
-	:suffix	(abbrev-string-to-be-defined nil)
-	:active abbrev-mode]
+	:suffix	(truncate-string-with-continuation-dots
+		 (abbrev-string-to-be-defined nil)
+		 40)]
        ["Define Global Ex%_pansion for " inverse-add-global-abbrev
-	:suffix	(inverse-abbrev-string-to-be-defined 1)
-	:active abbrev-mode]
+	:suffix	(truncate-string-with-continuation-dots
+		 (inverse-abbrev-string-to-be-defined 1)
+		 40)]
        ["Define Mode-Specific Expa%_nsion for " inverse-add-mode-abbrev
-	:suffix	(inverse-abbrev-string-to-be-defined 1)
-	:active abbrev-mode]
+	:suffix	(truncate-string-with-continuation-dots
+		 (inverse-abbrev-string-to-be-defined 1)
+		 40)]
        "---"
        ["E%_xpand Abbrev" expand-abbrev]
        ["Expand Abbrevs in Re%_gion" expand-region-abbrevs
@@ -497,8 +505,9 @@
        ["%_Save Abbrevs As..." write-abbrev-file]
        ["L%_oad Abbrevs..." read-abbrev-file]
        )
-      ("%_Rectangles"
-       ["%_Kill Rectangle" kill-rectangle]
+	"---"
+      ["%_Kill Rectangle" kill-rectangle]
+      ("Other %_Rectangles/Register"
        ["%_Yank Rectangle" yank-rectangle]
        ["Rectangle %_to Register" copy-rectangle-to-register]
        ["Rectangle %_from Register" insert-register]
@@ -509,61 +518,55 @@
 	(customize-set-variable	'mouse-track-rectangle-p
 				(not mouse-track-rectangle-p))
 	:style toggle :selected mouse-track-rectangle-p]
-       )
-      ("Re%_gister"
+       "---"
        ["%_Copy to Register..." copy-to-register :active (region-exists-p)]
        ["%_Paste Register..." insert-register]
        "---"
        ["%_Save Point to Register" point-to-register]
        ["%_Jump to Register"  register-to-point]
        )
-      ("%_Sort"
-       ["%_Lines in Region" sort-lines :active (region-exists-p)]
-       ["%_Paragraphs in Region" sort-paragraphs :active (region-exists-p)]
-       ["P%_ages in Region" sort-pages :active (region-exists-p)]
-       ["%_Columns in Region" sort-columns :active (region-exists-p)]
-       ["%_Regexp..." sort-regexp-fields :active (region-exists-p)]
-       )
-      ("%_Change Case"
-       ["%_Upcase Region" upcase-region :active (region-exists-p)]
-       ["%_Downcase Region" downcase-region :active (region-exists-p)]
-       ["%_Capitalize Region" capitalize-region :active (region-exists-p)]
-       ["%_Title-Case Region" capitalize-region-as-title
-	:active (region-exists-p)]
-       )
-      ("Ce%_nter"
-       ["%_Line" center-line]
-       ["%_Paragraph" center-paragraph]
-       ["%_Region" center-region :active (region-exists-p)]
+	"---"
+       ["%_Sort Lines in Region" sort-lines :active (region-exists-p)]
+       ["%_Uppercase Region or Word" upcase-region-or-word]
+       ["%_Lowercase Region or Word" downcase-region-or-word]
+       ["%_Indent Region or Balanced Expression"
+	indent-region-or-balanced-expression]
+       ["%_Fill Paragraph or Region" fill-paragraph-or-region]
+       ("Other %_Text Commands"
+	["Sort %_Paragraphs in Region" sort-paragraphs :active (region-exists-p)]
+	["Sort Pa%_ges in Region" sort-pages :active (region-exists-p)]
+	["Sort C%_olumns in Region" sort-columns :active (region-exists-p)]
+	["Sort %_Regexp..." sort-regexp-fields :active (region-exists-p)]
+	"---"
+	["%_Capitalize Region" capitalize-region :active (region-exists-p)]
+	["Title-C%_ase Region" capitalize-region-as-title
+	 :active (region-exists-p)]
+	"----"
+	["C%_enter Region or Paragraph"
+	 (if (region-active-p) (center-region) (center-line))]
+	["Center %_Line" center-line]
+	"---"
+	["%_Indent Region Rigidly" indent-rigidly :active (region-exists-p)]
+	["In%_dent To Column..." indent-to-column]
+	"---"
+	["%_Untabify (Tabs to Spaces)" untabify :active (and (region-exists-p)
+							  (fboundp 'untabify))]
+	["%_Tabify (Spaces to Tabs)" tabify :active (and (region-exists-p)
+							(fboundp 'tabify))]
+	["Tab to Tab %_Stop" tab-to-tab-stop]
+	["Edit Ta%_b Stops" edit-tab-stops]
+	)
+	"---"
+       ("S%_pell-Check"
+	["%_Buffer" ispell-buffer
+	 :active (fboundp 'ispell-buffer)]
+	"---"
+	["%_Word" ispell-word]
+	["%_Complete Word" ispell-complete-word]
+	["%_Region" ispell-region]
+	)
        )
-      ("%_Indent"
-       ["%_As Previous Line" indent-relative]
-       ["%_To Column..." indent-to-column]
-       "---"
-       ["%_Region" indent-region :active (region-exists-p)]
-       ["%_Balanced Expression" indent-sexp]
-       ["%_C Expression" indent-c-exp]
-       )
-      ("%_Tabs"
-       ["%_Convert Tabs to Spaces" untabify :active (and (region-exists-p)
-							 (fboundp 'untabify))]
-       ["Convert %_Spaces to Tabs" tabify :active (and (region-exists-p)
-						       (fboundp 'tabify))]
-       "---"
-       ["%_Tab to Tab Stop" tab-to-tab-stop]
-       ["%_Move to Tab Stop" move-to-tab-stop]
-       ["%_Edit Tab Stops" edit-tab-stops]
-       )
-      ("S%_pell-Check"
-       ["%_Buffer" ispell-buffer
-	:active (fboundp 'ispell-buffer)]
-       "---"
-       ["%_Word" ispell-word]
-       ["%_Complete Word" ispell-complete-word]
-       ["%_Region" ispell-region]
-       )
-      )
-
+     
      ("%_Tools"
       ("%_Packages"
        ("%_Add Download Site"
@@ -2101,6 +2104,14 @@
 
 (set-menubar default-menubar)
 
+(when (featurep 'menubar-items)
+  (loop for buf being the buffers do
+    (or (eq default-menubar (symbol-value-in-buffer 'current-menubar buf))
+	(with-current-buffer buf
+	  (condition-case nil
+	      (funcall major-mode)
+	    (error (setq current-menubar default-menubar)))))))
+
 
 ;;; Popup menus.
 
--- a/lisp/process.el	Sat Apr 13 20:44:53 2002 +0000
+++ b/lisp/process.el	Sun Apr 14 12:43:31 2002 +0000
@@ -98,7 +98,7 @@
 If you quit, the process is killed with SIGINT, or SIGKILL if you
  quit again."
   ;; #### remove windows-nt check when this is ready for prime time.
-  (if (or (noninteractive) (not (eq 'windows-nt system-type)))
+  (if (not (eq 'windows-nt system-type))
       (apply 'old-call-process-internal program infile buffer display args)
     (let (proc inbuf errbuf discard)
       (unwind-protect
--- a/lisp/subr.el	Sat Apr 13 20:44:53 2002 +0000
+++ b/lisp/subr.el	Sun Apr 14 12:43:31 2002 +0000
@@ -580,17 +580,14 @@
       (setq idx (1+ idx) i (1+ i)))
     string))
 
-;; #### 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
-;; version, which is very long and does lots of unnecessary stuff.
+;; From FSF 21.1
 (defun truncate-string-to-width (str end-column &optional start-column padding)
   "Truncate string STR to end at column END-COLUMN.
-The optional 2nd arg START-COLUMN, if non-nil, specifies
+The optional 3rd arg START-COLUMN, if non-nil, specifies
 the starting column; that means to return the characters occupying
 columns START-COLUMN ... END-COLUMN of STR.
 
-The optional 3rd arg PADDING, if non-nil, specifies a padding character
+The optional 4th arg PADDING, if non-nil, specifies a padding character
 to add at the end of the result if STR doesn't reach column END-COLUMN,
 or if END-COLUMN comes in the middle of a character in STR.
 PADDING is also added at the beginning of the result
@@ -600,11 +597,54 @@
 the resulting string may be narrower than END-COLUMN."
   (or start-column
       (setq start-column 0))
-  (let ((len (length str)))
-    (concat (substring str (min start-column len) (min end-column len))
-	    (and padding (> end-column len)
-		 (make-string (- end-column len) padding)))))
+  (let ((len (length str))
+	(idx 0)
+	(column 0)
+	(head-padding "") (tail-padding "")
+	ch last-column last-idx from-idx)
+    (condition-case nil
+	(while (< column start-column)
+	  (setq ch (aref str idx)
+		column (+ column (char-width ch))
+		idx (1+ idx)))
+      (args-out-of-range (setq idx len)))
+    (if (< column start-column)
+	(if padding (make-string end-column padding) "")
+      (if (and padding (> column start-column))
+	  (setq head-padding (make-string (- column start-column) padding)))
+      (setq from-idx idx)
+      (if (< end-column column)
+	  (setq idx from-idx)
+	(condition-case nil
+	    (while (< column end-column)
+	      (setq last-column column
+		    last-idx idx
+		    ch (aref str idx)
+		    column (+ column (char-width ch))
+		    idx (1+ idx)))
+	  (args-out-of-range (setq idx len)))
+	(if (> column end-column)
+	    (setq column last-column idx last-idx))
+	(if (and padding (< column end-column))
+	    (setq tail-padding (make-string (- end-column column) padding))))
+      (setq str (substring str from-idx idx))
+      (if padding
+	  (concat head-padding str tail-padding)
+	str))))
 
+(defun truncate-string-with-continuation-dots (str end-column &optional
+						   dots-str)
+  "Truncate string STR to end at column END-COLUMN, adding dots if needed.
+The dots (normally `...', but can be controlled by DOTS-STR)' will be added
+in such a way that the total string occupies no more than END-COLUMN
+columns -- i.e. if the string goes past END-COLUMN, it will be truncated
+somewhere short of END-COLUMN so that, with the dots added, the string
+occupies END-COLUMN columns."
+  (if (<= (string-width str) end-column) str
+    (let* ((dots-str (or dots-str "..."))
+	   (dotswidth (string-width dots-str)))
+      (concat (truncate-string-to-width str (- end-column dotswidth))
+	      dots-str))))
 
 
 ;; alist/plist functions
--- a/nt/ChangeLog	Sat Apr 13 20:44:53 2002 +0000
+++ b/nt/ChangeLog	Sun Apr 14 12:43:31 2002 +0000
@@ -1,3 +1,40 @@
+2002-04-14  Ben Wing  <ben@xemacs.org>
+
+	* config.inc.samp (HAVE_MS_WINDOWS):
+	* config.inc.samp (X11_DIR):
+	* config.inc.samp (ZLIB_DIR):
+	* config.inc.samp (MAKEINFO):
+	* config.inc.samp (OPTIMIZED_BUILD): New.
+	* config.inc.samp (DEPEND):
+	* config.inc.samp (USE_MINIMAL_TAGBITS): Removed.
+	* config.inc.samp (USE_INDEXED_LRECORD_IMPLEMENTATION): Removed.
+	* config.inc.samp (GUNG_HO): Removed.
+	* xemacs.mak (USE_MINITAR):
+	* xemacs.mak (USE_MINIMAL_TAGBITS): Removed.
+	* xemacs.mak (USE_INDEXED_LRECORD_IMPLEMENTATION): Removed.
+	* xemacs.mak (GUNG_HO): Removed.
+	* xemacs.mak (CONFIG_ERROR):
+	* xemacs.mak (DEBUGFLAGS): New.
+	* xemacs.mak (OPT): Removed.
+	* xemacs.mak (OPTFLAGS): New.
+	* xemacs.mak (CFLAGS):
+	* xemacs.mak (QUICK_DEFINES):
+	* xemacs.mak (TAGBITS_DEFINES): Removed.
+	* xemacs.mak (ERROR_CHECK_DEFINES): New.
+	* xemacs.mak (LRECORD_DEFINES): Removed.
+	* xemacs.mak (DEFINES):
+	* xemacs.mak (TEMACS_OBJS):
+	* xemacs.mak (OS):
+	Separate out debug and optimize flags.
+	Remove all vestiges of USE_MINIMAL_TAGBITS,
+	USE_INDEXED_LRECORD_IMPLEMENTATION, and GUNG_HO, since those
+	ifdefs have long been removed.
+	Make error-checking support actually work.
+	Some rearrangement of config.inc.samp to make it more logical.
+	Remove callproc.c and ntproc.c from xemacs.mak, no longer used.
+
+	Make pdump the default.
+
 2002-04-13  Jonathan Harris  <jonathan@xemacs.org>
 
 	* README: Document MSVC6 required
--- a/nt/config.inc.samp	Sat Apr 13 20:44:53 2002 +0000
+++ b/nt/config.inc.samp	Sun Apr 14 12:43:31 2002 +0000
@@ -14,11 +14,12 @@
 # Native MS Windows support.
 HAVE_MS_WINDOWS=1
 
-# X Windows support.
+# X Windows support.  Not working at all and probably never will.  If you
+# want X support under MS Windows, compile with Cygwin instead.
 HAVE_X_WINDOWS=0
 X11_DIR=
 
-# GTK support. Do NOT set this to 1; as of xemacs-21.2-b44
+# GTK support. Do NOT set this to 1; as of xemacs-21.5-b6
 # gtk-xemacs is not supported on MSWindows (mingw or msvc).
 # Yes, we know that gtk has been ported to native MSWindows
 # but XEmacs is not yet ready to use that port.
@@ -39,7 +40,7 @@
 # the directories containing png and zlib.
 HAVE_PNG=1
 PNG_DIR=c:\src\libpng-1.0.5
-ZLIB_DIR=c:\src\zlib-1.1.3
+ZLIB_DIR=c:\src\zlib
 
 # Set this to enable TIFF support, and specify the directory containing tiff.
 HAVE_TIFF=0
@@ -62,7 +63,19 @@
 
 ############################################################################
 
-# Set this to enable some debug code that doesn't slow things down.
+# Set this to turn on optimization when compiling.
+OPTIMIZED_BUILD=0
+
+############################################################################
+#                          Development options                             #
+############################################################################
+
+# Set this to enable debug code in XEmacs that doesn't slow things down,
+# and to add debugging information to the executable. (The code that's
+# enabled in XEmacs is primarily extra commands that aid in debugging
+# problems.  The kind of debugging code that slows things down --
+# i.e. internal error-checking -- is controlled by the ERROR_CHECK_ALL
+# variable, below.)
 DEBUG_XEMACS=1
 
 # Uncomment this to turn off or on the error-checking code, which adds
@@ -82,11 +95,6 @@
 # Requires cygwin or ActiveState versions of Perl to be installed.
 DEPEND=0
 
-############################################################################
-
-# Some technical options.
-
-USE_MINIMAL_TAGBITS=0
-USE_INDEXED_LRECORD_IMPLEMENTATION=0
-USE_PORTABLE_DUMPER=0
-GUNG_HO=0
+# Set this to use the portable dumper for dumping the preloaded Lisp
+# routines, instead of the older "unexec" routines in unexnt.c.
+USE_PORTABLE_DUMPER=1
--- a/nt/xemacs.mak	Sat Apr 13 20:44:53 2002 +0000
+++ b/nt/xemacs.mak	Sun Apr 14 12:43:31 2002 +0000
@@ -183,17 +183,8 @@
 !if !defined(USE_MINITAR)
 USE_MINITAR=$(HAVE_ZLIB)
 !endif
-!if !defined(USE_MINIMAL_TAGBITS)
-USE_MINIMAL_TAGBITS=0
-!endif
-!if !defined(USE_INDEXED_LRECORD_IMPLEMENTATION)
-USE_INDEXED_LRECORD_IMPLEMENTATION=0
-!endif
 !if !defined(USE_PORTABLE_DUMPER)
-USE_PORTABLE_DUMPER=0
-!endif
-!if !defined(GUNG_HO)
-GUNG_HO=0
+USE_PORTABLE_DUMPER=1
 !endif
 
 # A little bit of adhockery. Default to use system malloc and
@@ -321,14 +312,6 @@
 !endif
 
 #
-# Handle GUNG_HO
-#
-!if defined(GUNG_HO)
-USE_MINIMAL_TAGBITS=$(GUNG_HO)
-USE_INDEXED_LRECORD_IMPLEMENTATION=$(GUNG_HO)
-!endif
-
-#
 # Whether to use dependency information generated by make-src-depend
 #
 !if !defined(DEPEND)
@@ -359,9 +342,15 @@
 !endif
 
 !if $(DEBUG_XEMACS)
-OPT=-Od -Zi
+DEBUGFLAGS=-Zi
 !else
-OPT=-O2 -G5
+DEBUGFLAGS=
+!endif
+
+!if $(OPTIMIZED_BUILD)
+OPTFLAGS=-O2 -G5
+!else
+OPTFLAGS=-Od
 !endif
 
 !if $(USE_CRTDLL)
@@ -377,7 +366,7 @@
 LIBC_LIB=libc.lib
 !endif
 
-CFLAGS=-nologo -W3 $(OPT) $(C_LIBFLAG)
+CFLAGS=-nologo -W3 $(DEBUGFLAGS) $(OPTFLAGS) $(C_LIBFLAG)
 
 !if $(HAVE_X_WINDOWS)
 X_DEFINES=-DHAVE_X_WINDOWS
@@ -459,12 +448,10 @@
 QUICK_DEFINES=-DQUICK_BUILD
 !endif
 
-!if $(USE_MINIMAL_TAGBITS)
-TAGBITS_DEFINES=-DUSE_MINIMAL_TAGBITS
+!if $(ERROR_CHECK_ALL)
+ERROR_CHECK_DEFINES=-DERROR_CHECK_ALL
 !endif
-!if $(USE_INDEXED_LRECORD_IMPLEMENTATION)
-LRECORD_DEFINES=-DUSE_INDEXED_LRECORD_IMPLEMENTATION
-!endif
+
 !if $(USE_UNION_TYPE)
 UNION_DEFINES=-DUSE_UNION_TYPE
 !endif
@@ -493,9 +480,9 @@
 
 INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(NT)\inc -I$(SRC) -I$(LWLIB_SRCDIR)
 
-DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \
-	$(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \
+DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) $(UNION_DEFINES) \
 	$(DUMPER_DEFINES) $(MALLOC_DEFINES) $(QUICK_DEFINES) \
+	$(ERROR_CHECK_DEFINES) \
 	-DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs \
 	-DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
 
@@ -794,7 +781,6 @@
 	$(OUTDIR)\buffer.obj \
 	$(OUTDIR)\bytecode.obj \
 	$(OUTDIR)\callint.obj \
-	$(OUTDIR)\callproc.obj \
 	$(OUTDIR)\casefiddle.obj \
 	$(OUTDIR)\casetab.obj \
 	$(OUTDIR)\chartab.obj \
@@ -851,7 +837,6 @@
 	$(OUTDIR)\minibuf.obj \
 	$(OUTDIR)\nt.obj \
 	$(OUTDIR)\ntplay.obj \
-	$(OUTDIR)\ntproc.obj \
 	$(OUTDIR)\objects.obj \
 	$(OUTDIR)\opaque.obj \
 	$(OUTDIR)\print.obj \
@@ -1374,7 +1359,7 @@
   Compiling in support for Microsoft Windows native GUI.
 !endif
 !if $(HAVE_X_WINDOWS)
-  Compiling in support for X-Windows.
+  Compiling in support for X Windows.
 !endif
 !if $(MULE)
   Compiling in international (MULE) support.
@@ -1443,12 +1428,6 @@
   WARNING: expense of an additional ~4KB of code.
   --------------------------------------------------------------------
 !endif
-!if $(USE_MINIMAL_TAGBITS)
-  Using minimal tagbits.
-!endif
-!if $(USE_INDEXED_LRECORD_IMPLEMENTATION)
-  Using indexed lrecord implementation.
-!endif
 !if $(USE_UNION_TYPE)
   Using union type for Lisp object storage.
 !endif
@@ -1461,8 +1440,14 @@
 !if $(USE_CRTDLL)
   Using DLL version of C runtime library
 !endif
+!if $(ERROR_CHECK_ALL)
+  Compiling in extra internal error-checking. XEmacs will be slow!
+!endif
 !if $(DEBUG_XEMACS)
-  Compiling in extra debug checks. XEmacs will be slow!
+  Compiling in debugging support (no slowdown).
+!endif
+!if $(OPTIMIZED_BUILD)
+  Compiling with optimization.
 !endif
 !if $(QUICK_BUILD)
   Disabling non-essential build actions.  Use with care!
--- a/src/ChangeLog	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/ChangeLog	Sun Apr 14 12:43:31 2002 +0000
@@ -1,3 +1,228 @@
+2002-04-14  Ben Wing  <ben@xemacs.org>
+
+	* lisp.h:
+	Add support for strong type-checking of Bytecount, Bytebpos,
+	Charcount, Charbpos, and others, by making them classes,
+	overloading the operators to provide integer-like operation and
+	carefully controlling what operations are allowed.  Not currently
+	enabled in C++ builds because there are still a number of compile
+	errors, and it won't really work till we merge in my "8-bit-Mule"
+	workspace, in which I make use of the new types Charxpos,
+	Bytexpos, Memxpos, representing a "position" either in a buffer or
+	a string. (This is especially important in the extent code.)
+	
+	* abbrev.c:
+	* abbrev.c (abbrev_oblookup):
+	* alloc.c (STRING_CHARS_BLOCK_SIZE):
+	* alloc.c (allocate_string_chars_struct):
+	* alloc.c (make_uninit_string):
+	* alloc.c (set_string_char):
+	* alloc.c (build_intstring):
+	* eval.c (record_unwind_protect_restoring_lisp_object):
+	* eval.c (record_unwind_protect_restoring_int):
+	* buffer.c (init_initial_directory):
+	* buffer.h (BI_BUF_PTR_BYTE_POS):
+	* buffer.h (real_charbpos_to_bytebpos):
+	* editfns.c (Fuser_full_name):
+	* editfns.c (Finsert_char):
+	* fns.c (Ffillarray):
+	* text.h:
+	* text.h (REP_BYTES_BY_FIRST_BYTE_1):
+	* text.h (simple_set_charptr_emchar):
+	* text.h (DECLARE_INLINE_HEADER):
+	* text.h (endif):
+	Warning fixes, some of them related to new C++ strict type
+	checking of Bytecount, Charbpos, etc.
+
+	* dired.c (file_name_completion):
+	Caught an actual error due to strong type checking -- char len
+	being passed when should be byte len.
+
+	* alloc.c:
+	* alloc.c (DECREMENT_CONS_COUNTER):
+	* alloc.c (memory_full):
+	* alloc.c (Fmake_byte_code):
+	* alloc.c (garbage_collect_1):
+	* alloc.c (recompute_need_to_garbage_collect):
+	* alloc.c (common_init_alloc_once_early):
+	* backtrace.h:
+	* backtrace.h (SPECBIND_FAST_UNSAFE):
+	* bytecode.c:
+	* bytecode.c (execute_optimized_program):
+	* bytecode.c (mark_compiled_function):
+	* bytecode.h:
+	* bytecode.h (struct Lisp_Compiled_Function):
+	* eval.c:
+	* eval.c (handle_compiled_function_with_and_rest):
+	* eval.c (funcall_compiled_function):
+	* eval.c (Feval):
+	* eval.c (Ffuncall):
+	* eval.c (function_argcount):
+	* sysdep.c (total_data_usage):
+	Further optimize Ffuncall:
+
+	-- process arg list at compiled-function creation time, converting
+	into an array for extra-quick access at funcall time.
+	-- rewrite funcall_compiled_function to use it, and inline this
+	function.
+	-- change the order of check for magic stuff in
+	SPECBIND_FAST_UNSAFE to be faster.
+	-- move the check for need to garbage collect into the allocation
+	code, so only a single flag needs to be checked in funcall.
+	
+
+	* buffer.c (Fstring_char_byte_converion_info):
+	* buffer.c (syms_of_buffer):
+	* symbols.c:
+	* symbols.c (intern_converting_underscores_to_dashes):
+
+	add debug funs to check on mule optimization info in buffers and
+	strings.
+
+	* eval.c (init_eval_semi_early):
+	* emacs.c (main_1):
+	* text.c (reinit_eistring_once_early):
+	* regex.c (vars_of_regex):
+	* scrollbar-msw.c (vars_of_scrollbar_mswindows):
+	* search.c (vars_of_search):
+	Fix evil crashes due to eistrings not properly reinitialized under
+	pdump.  Redo a bit some of the init routines; convert some
+	complex_vars_of() into simple vars_of(), because they didn't need
+	complex processing.
+
+	* callproc.c:
+	* callproc.c (call_process_kill):
+	* callproc.c (call_process_cleanup):
+	* callproc.c (Fold_call_process_internal):
+	* callproc.c (child_setup):
+	* callproc.c (syms_of_callproc):
+	* callproc.c (getenv): Removed.
+	* emacs.c:
+	* emacs.c (main_1):
+	* event-stream.c (check_event_stream_ok):
+	* event-stream.c (init_event_stream):
+	* nt.c:
+	* nt.c (init_mswindows_environment):
+	* nt.c (Fmswindows_long_file_name):
+	* nt.c (init_nt):
+	* process.c:
+	* process.c (init_process_io_handles):
+	* process.c (Fstart_process_internal):
+	* process.c (getenv_internal):
+	* process.c (putenv_internal):
+	* process.c (getenv): New.
+	* process.c (DEFUN):
+	* process.c (Fgetenv):
+	* process.c (egetenv):
+	* process.c (init_xemacs_process):
+	* process.c (syms_of_process):
+	* process.c (vars_of_process):
+	* process.h:
+	* sysdep.c (wait_for_termination):
+	* sysdep.c (init_baud_rate):
+	* sysdep.c (emacs_get_tty):
+	* sysdep.c (emacs_set_tty):
+	* sysdep.c (tty_init_sys_modes_on_device):
+	* sysdep.h:
+	* syssignal.h:
+	* syswindows.h:
+	* ntproc.c: Delete.  Hallelujah, praise the Lord, there is no god
+	but Allah!!!
+
+	fix so that processes can be invoked in bare temacs -- thereby
+	eliminating any need for callproc.c. (currently only eliminated
+	under NT.) remove all crufty and unnecessary old process code in
+	ntproc.c and elsewhere.  move non-callproc-specific stuff (mostly
+	environment) into process.c, so callproc.c can be left out under
+	NT.
+
+	* console-tty.c (tty_init_console):
+	* doc.c:
+	* doc.c (unparesseuxify_doc_string):
+	* doc.c (get_doc_string):
+	* doc.c (Fsnarf_documentation):
+	* file-coding.c:
+	* file-coding.c (coding_reader):
+	* file-coding.c (set_coding_character_mode):
+	* file-coding.c (make_coding_stream_1):
+	* file-coding.c (make_coding_output_stream):
+	* file-coding.c (detect_coding_stream):
+	* file-coding.h:
+	* file-coding.h (struct coding_stream):
+	* file-coding.h (LSTREAM_FL_NO_CLOSE_OTHER):
+	* lstream.c:
+	* lstream.c (Lstream_read_1):
+	* lstream.c (Lstream_read):
+	* lstream.c (Lstream_fgetc):
+	* lstream.h (lstream_implementation):
+
+	fix doc string handling so it works with Japanese, etc docs.
+	change handling of "character mode" so callers don't have to
+	manually set it (quite error-prone).
+
+	* event-msw.c (init_event_mswindows_late): spacing fixes.
+
+	* lread.c:
+	* lread.c (pas_de_holgazan_ici):
+	* lread.c (load_force_doc_string_unwind):
+	* lread.c (readevalloop):
+	* lread.c (read_list_conser):
+	* lread.c (read_vector):
+
+	eliminate unused crufty vintage-19 "FSF defun hack" code.
+
+	* lrecord.h: improve pdump description docs.
+	
+	* buffer.c:
+	* ntheap.c:
+	* ntheap.c (round_to_next):
+	* ntheap.c (get_data_start):
+	* ntheap.c (get_data_end):
+	* ntheap.c (allocate_heap):
+	* ntheap.c (sbrk):
+	* ntheap.c (recreate_heap):
+	* unexnt.c:
+	* unexnt.c (_start):
+	* unexnt.c (unexec):
+	* unexnt.c (get_bss_info_from_map_file):
+	* unexnt.c (get_section_info):
+	* unexnt.c (copy_executable_and_dump_data_section):
+	* unexnt.c (dump_bss_and_heap):
+	* unexnt.c (read_in_bss):
+	* unexnt.c (map_in_heap):
+	* win32.c:
+	* win32.c (mswindows_get_module_file_name):
+	* emacs.c (make_arg_list_1):
+	* emacs.c (Fdump_emacs):
+	Mule-ize some unexec and startup code.  It was pseudo-Mule-ized
+	before by simply always calling the ...A versions of functions,
+	but that won't cut it -- eventually we want to be able to run
+	properly even if XEmacs has been installed in a Japanese
+	directory. (The current problem is the timing of the loading of
+	the Unicode tables; this will eventually be fixed.) Go through and
+	fix various other places where the code was not Mule-clean.
+	Provide a function mswindows_get_module_file_name() to get our own
+	name without resort to PATH_MAX and such.  Add a big comment in
+	main() about the problem with Unicode table load timing that I
+	just alluded to.
+
+	* emacs.c (guts_of_fatal_error_signal):
+	* emacs.c (mswindows_handle_hardware_exceptions_1):
+	When error-checking is enabled (interpreted as "user is developing
+	XEmacs"), don't ask user to "pause to read messages" when a fatal
+	error has occurred, because it will wedge if we are in an inner
+	modal loop (typically when a menu is popped up) and make us unable
+	to get a useful stack trace in the debugger.
+	
+	* text.c (update_entirely_ascii_p_flag):
+	* text.c (charbpos_to_bytebpos_func):
+	* text.c (bytebpos_to_charbpos_func):
+	Correct update_entirely_ascii_p_flag to actually work.
+
+	* lisp.h:
+	* symsinit.h:
+	 declarations for above changes.
+
 2002-04-13  Jonathan Harris  <jonathan@xemacs.org>
 
 	* unexnt.c (_start):
--- a/src/abbrev.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/abbrev.c	Sun Apr 14 12:43:31 2002 +0000
@@ -79,7 +79,8 @@
 struct abbrev_match_mapper_closure {
   struct buffer *buf;
   Lisp_Char_Table *chartab;
-  Charcount point, maxlen;
+  Charbpos point;
+  Charcount maxlen;
   Lisp_Symbol *found;
 };
 
@@ -182,7 +183,7 @@
 {
   Charbpos wordstart, wordend;
   Intbyte *word, *p;
-  Bytecount idx;
+  Charbpos idx;
   Lisp_Object lookup;
 
   CHECK_VECTOR (obarray);
--- a/src/alloc.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/alloc.c	Sun Apr 14 12:43:31 2002 +0000
@@ -70,6 +70,8 @@
 
 EXFUN (Fgarbage_collect, 0);
 
+static void recompute_need_to_garbage_collect (void);
+
 #if 0 /* this is _way_ too slow to be part of the standard debug options */
 #if defined(DEBUG_XEMACS) && defined(MULE)
 #define VERIFY_STRING_CHARS_INTEGRITY
@@ -90,8 +92,17 @@
 #endif
 
 /* Number of bytes of consing done since the last gc */
-EMACS_INT consing_since_gc;
-#define INCREMENT_CONS_COUNTER_1(size) (consing_since_gc += (size))
+static EMACS_INT consing_since_gc;
+int need_to_garbage_collect;
+
+/* Determine now whether we need to garbage collect or not, to make
+   Ffuncall() faster */
+#define INCREMENT_CONS_COUNTER_1(size)		\
+do						\
+{						\
+  consing_since_gc += (size);			\
+  recompute_need_to_garbage_collect ();		\
+} while (0)
 
 #define debug_allocation_backtrace()				\
 do {								\
@@ -130,6 +141,7 @@
   consing_since_gc -= (size);			\
   if (consing_since_gc < 0)			\
     consing_since_gc = 0;			\
+  recompute_need_to_garbage_collect ();		\
 } while (0)
 
 /* Number of bytes of consing since gc before another gc should be done. */
@@ -244,6 +256,7 @@
      to win) than to loop beeping and barfing "Memory exhausted"
    */
   consing_since_gc = gc_cons_threshold + 1;
+  recompute_need_to_garbage_collect ();
   release_breathing_space ();
 
   /* Flush some histories which might conceivably contain garbalogical
@@ -1456,7 +1469,7 @@
   /* Check for valid formal parameter list now, to allow us to use
      SPECBIND_FAST_UNSAFE() later in funcall_compiled_function(). */
   {
-    EXTERNAL_LIST_LOOP_3 (symbol, arglist, tail)
+    EXTERNAL_LIST_LOOP_2 (symbol, arglist)
       {
 	CHECK_SYMBOL (symbol);
 	if (EQ (symbol, Qt)   ||
@@ -1469,6 +1482,47 @@
   }
   f->arglist = arglist;
 
+  {
+    int minargs = 0, maxargs = 0, totalargs = 0;
+    int optional_p = 0, rest_p = 0, i = 0;
+    {
+      LIST_LOOP_2 (arg, arglist)
+	{
+	  if (EQ (arg, Qand_optional))
+	    optional_p = 1;
+	  else if (EQ (arg, Qand_rest))
+	    rest_p = 1;
+	  else
+	    {
+	      if (rest_p)
+		{
+		  maxargs = MANY;
+		  totalargs++;
+		  break;
+		}
+	      if (!optional_p)
+		minargs++;
+	      maxargs++;
+	      totalargs++;
+	    }
+	}
+    }
+  
+    f->args = xnew_array (Lisp_Object, totalargs);
+
+    {
+      LIST_LOOP_2 (arg, arglist)
+	{
+	  if (!EQ (arg, Qand_optional) && !EQ (arg, Qand_rest))
+	    f->args[i++] = arg;
+	}
+    }
+
+    f->max_args = maxargs;
+    f->min_args = minargs;
+    f->args_in_array = totalargs;
+  }
+  
   /* `instructions' is a string or a cons (string . int) for a
      lazy-loaded function. */
   if (CONSP (instructions))
@@ -1756,9 +1810,9 @@
 
 /* String blocks contain this many useful bytes. */
 #define STRING_CHARS_BLOCK_SIZE					\
-((Bytecount) (8192 - MALLOC_OVERHEAD -				\
-	      ((2 * sizeof (struct string_chars_block *))	\
-	       + sizeof (EMACS_INT))))
+  ((Bytecount) (8192 - MALLOC_OVERHEAD -			\
+	        ((2 * sizeof (struct string_chars_block *))	\
+	         + sizeof (EMACS_INT))))
 /* Block header for small strings. */
 struct string_chars_block
 {
@@ -1811,7 +1865,7 @@
 
 static struct string_chars *
 allocate_string_chars_struct (Lisp_Object string_it_goes_with,
-			      EMACS_INT fullsize)
+			      Bytecount fullsize)
 {
   struct string_chars *s_chars;
 
@@ -1873,7 +1927,7 @@
 make_uninit_string (Bytecount length)
 {
   Lisp_String *s;
-  EMACS_INT fullsize = STRING_FULLSIZE (length);
+  Bytecount fullsize = STRING_FULLSIZE (length);
 
   assert (length >= 0 && fullsize > 0);
 
@@ -2070,12 +2124,12 @@
 	/* We've extended ascii_begin, and we have to figure out how much by */
 	{
 	  Bytecount j;
-	  for (j = i + 1; j < XSTRING_LENGTH (s); j++)
+	  for (j = (Bytecount) i + 1; j < XSTRING_LENGTH (s); j++)
 	    {
 	      if (!BYTE_ASCII_P (XSTRING_DATA (s)[j]))
 		break;
 	    }
-	  XSET_STRING_ASCII_BEGIN (s, min (j, MAX_STRING_ASCII_BEGIN));
+	  XSET_STRING_ASCII_BEGIN (s, min (j, (Bytecount) MAX_STRING_ASCII_BEGIN));
 	}
     }
   sledgehammer_check_ascii_begin (s);
@@ -2201,7 +2255,7 @@
 build_intstring (const Intbyte *str)
 {
   /* Some strlen's crash and burn if passed null. */
-  return make_string (str, (str ? qxestrlen (str) : 0));
+  return make_string (str, (str ? qxestrlen (str) : (Bytecount) 0));
 }
 
 Lisp_Object
@@ -3741,6 +3795,7 @@
   if (gc_cons_threshold < 10000)
     gc_cons_threshold = 10000;
 #endif
+  recompute_need_to_garbage_collect ();
 
   inhibit_non_essential_printing_operations = 0;
   gc_in_progress = 0;
@@ -3956,15 +4011,20 @@
 }
 
 /* True if it's time to garbage collect now. */
-int
-need_to_garbage_collect (void)
+static void
+recompute_need_to_garbage_collect (void)
 {
   if (always_gc)
-    return 1;
-  
-  return (consing_since_gc > gc_cons_threshold &&
-	  (100 * consing_since_gc) / total_data_usage () >=
-	  gc_cons_percentage);
+    need_to_garbage_collect = 1;
+  else
+    need_to_garbage_collect =
+      (consing_since_gc > gc_cons_threshold
+#if 0 /* #### implement this better */
+       &&
+       (100 * consing_since_gc) / total_data_usage () >=
+       gc_cons_percentage
+#endif /* 0 */
+       );
 }
 
 
@@ -4169,6 +4229,8 @@
 #endif
 
   consing_since_gc = 0;
+  need_to_garbage_collect = always_gc;
+
 #if 1
   gc_cons_threshold = 500000; /* XEmacs change */
 #else
--- a/src/backtrace.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/backtrace.h	Sun Apr 14 12:43:31 2002 +0000
@@ -203,7 +203,9 @@
   Lisp_Object SFU_newval = (value_object);				\
   Lisp_Symbol *SFU_sym   = XSYMBOL (SFU_symbol);			\
   Lisp_Object SFU_oldval = SFU_sym->value;				\
-  if (!SYMBOL_VALUE_MAGIC_P (SFU_oldval) || UNBOUNDP (SFU_oldval))	\
+  /* Most of the time, will be previously unbound.  #### With a bit of	\
+   rearranging, this could be reduced to only one check. */		\
+  if (UNBOUNDP (SFU_oldval) || !SYMBOL_VALUE_MAGIC_P (SFU_oldval))	\
     {									\
       specpdl_ptr->symbol    = SFU_symbol;				\
       specpdl_ptr->old_value = SFU_oldval;				\
@@ -216,7 +218,6 @@
   else									\
     specbind_magic (SFU_symbol, SFU_newval);				\
 } while (0)
-
 /* Request enough room for SIZE future entries on special binding stack */
 #define SPECPDL_RESERVE(size) do {			\
   EMACS_INT SR_size = (size);				\
--- a/src/buffer.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/buffer.c	Sun Apr 14 12:43:31 2002 +0000
@@ -1721,7 +1721,72 @@
 }
 
 #endif /* MEMORY_USAGE_STATS */
-      
+
+#if defined (DEBUG_XEMACS) && defined (MULE)
+
+DEFUN ("buffer-char-byte-conversion-info", Fbuffer_char_byte_converion_info,
+       1, 1, 0, /*
+Return the current info used for char-byte conversion in BUFFER.
+The values returned are in the form of a plist of properties and values.
+*/
+       (buffer))
+{
+  struct buffer *b;
+  Lisp_Object plist = Qnil;
+
+  CHECK_BUFFER (buffer); /* dead buffers should be allowed, no? */
+  b = XBUFFER (buffer);
+
+#define ADD_INT(field) \
+  plist = cons3 (make_int (b->text->field), \
+		 intern_converting_underscores_to_dashes (#field), plist)
+#define ADD_BOOL(field) \
+  plist = cons3 (b->text->field ? Qt : Qnil, \
+		 intern_converting_underscores_to_dashes (#field), plist)
+  ADD_BOOL (entirely_ascii_p);
+  ADD_INT (bufz);
+  ADD_INT (z);
+  ADD_INT (mule_bufmin);
+  ADD_INT (mule_bufmax);
+  ADD_INT (mule_bytmin);
+  ADD_INT (mule_bytmax);
+  ADD_INT (mule_shifter);
+  ADD_BOOL (mule_three_p);
+  {
+    Lisp_Object pos[16];
+    int i;
+    for (i = 0; i < 16; i++)
+      pos[i] = make_int (b->text->mule_charbpos_cache[i]);
+    plist = cons3 (Flist (16, pos), intern ("mule-charbpos-cache"), plist);
+    for (i = 0; i < 16; i++)
+      pos[i] = make_int (b->text->mule_bytebpos_cache[i]);
+    plist = cons3 (Flist (16, pos), intern ("mule-bytebpos-cache"), plist);
+  }
+#undef ADD_INT
+#undef ADD_BOOL
+
+  return Fnreverse (plist);
+}
+
+DEFUN ("string-char-byte-conversion-info", Fstring_char_byte_converion_info, 1, 1, 0, /*
+Return the current info used for char-byte conversion in STRING.
+The values returned are in the form of a plist of properties and values.
+*/
+       (string))
+{
+  Lisp_Object plist = Qnil;
+  CHECK_STRING (string);
+
+  plist = cons3 (make_int (XSTRING_LENGTH (string)),
+		 intern ("byte-length"), plist);
+  plist = cons3 (make_int (XSTRING_ASCII_BEGIN (string)),
+		 intern ("ascii-begin"), plist);
+
+  return Fnreverse (plist);
+}
+
+#endif /* defined (DEBUG_XEMACS) && defined (MULE) */
+
 
 
 void
@@ -1789,6 +1854,10 @@
 #ifdef MEMORY_USAGE_STATS
   DEFSUBR (Fbuffer_memory_usage);
 #endif
+#if defined (DEBUG_XEMACS) && defined (MULE)
+  DEFSUBR (Fbuffer_char_byte_converion_info);
+  DEFSUBR (Fstring_char_byte_converion_info);
+#endif
 
   DEFERROR (Qprotected_field, "Attempt to modify a protected field",
 	    Qinvalid_change);
@@ -2747,15 +2816,14 @@
        when running subprocesses for the same reason.)  */
 
     Extbyte *p;
-    Extbyte modname[MAX_PATH * MAX_XETCHAR_SIZE];
+    Extbyte *modname = mswindows_get_module_file_name ();
       
-    if (!qxeGetModuleFileName (NULL, modname, MAX_PATH))
-      abort ();
-    if ((p = xetcsrchr (modname, '\\')) == NULL)
-      abort ();
+    assert (modname);
+    assert ((p = xetcsrchr (modname, '\\')));
     XECOPY_TCHAR (p, '\0');
   
     qxeSetCurrentDirectory (modname);
+    xfree (modname);
   }
 #endif
 }
--- a/src/buffer.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/buffer.h	Sun Apr 14 12:43:31 2002 +0000
@@ -302,7 +302,7 @@
 {
   return (ptr - buf->text->beg + 1
 	  - ((ptr - buf->text->beg + 1) > buf->text->gpt
-	     ? buf->text->gap_size : 0));
+	     ? buf->text->gap_size : (Bytebpos) 0));
 }
 
 #define BUF_PTR_BYTE_POS(buf, ptr) \
@@ -676,7 +676,8 @@
   if (x >= buf->text->mule_bufmin && x <= buf->text->mule_bufmax)
     return (buf->text->mule_bytmin +
 	    ((x - buf->text->mule_bufmin) << buf->text->mule_shifter) +
-	    (buf->text->mule_three_p ? (x - buf->text->mule_bufmin) : 0));
+	    (buf->text->mule_three_p ? (x - buf->text->mule_bufmin) :
+	     (Bytebpos) 0));
   else
     return charbpos_to_bytebpos_func (buf, x);
 }
--- a/src/bytecode.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/bytecode.c	Sun Apr 14 12:43:31 2002 +0000
@@ -1,7 +1,7 @@
 /* Execution of byte code produced by bytecomp.el.
    Implementation of compiled-function objects.
    Copyright (C) 1992, 1993 Free Software Foundation, Inc.
-   Copyright (C) 1995 Ben Wing.
+   Copyright (C) 1995, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -209,19 +209,12 @@
   Bconstant 		= 0300
 };
 typedef enum Opcode Opcode;
-typedef unsigned char Opbyte;
 
 
 Lisp_Object * execute_rare_opcode (Lisp_Object *stack_ptr,
 				   const Opbyte *program_ptr,
 				   Opcode opcode);
 
-static Lisp_Object execute_optimized_program (const Opbyte *program,
-					      int stack_depth,
-					      Lisp_Object *constants_data);
-
-extern Lisp_Object Qand_rest, Qand_optional;
-
 /* Define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
    This isn't defined in FSF Emacs and isn't defined in XEmacs v19. */
 /* #define BYTE_CODE_METER */
@@ -464,74 +457,6 @@
 #endif /* !LISP_FLOAT_TYPE */
 }
 
-/* Apply compiled-function object FUN to the NARGS evaluated arguments
-   in ARGS, and return the result of evaluation. */
-Lisp_Object
-funcall_compiled_function (Lisp_Object fun, int nargs, Lisp_Object args[])
-{
-  /* This function can GC */
-  int speccount = specpdl_depth();
-  REGISTER int i = 0;
-  Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
-  int optional = 0;
-
-  if (!OPAQUEP (f->instructions))
-    /* Lazily munge the instructions into a more efficient form */
-    optimize_compiled_function (fun);
-
-  /* optimize_compiled_function() guaranteed that f->specpdl_depth is
-     the required space on the specbinding stack for binding the args
-     and local variables of fun.   So just reserve it once. */
-  SPECPDL_RESERVE (f->specpdl_depth);
-
-  {
-    /* Fmake_byte_code() guaranteed that f->arglist is a valid list
-       containing only non-constant symbols. */
-    LIST_LOOP_3 (symbol, f->arglist, tail)
-      {
-	if (EQ (symbol, Qand_rest))
-	  {
-	    tail = XCDR (tail);
-	    symbol  = XCAR (tail);
-	    SPECBIND_FAST_UNSAFE (symbol, Flist (nargs - i, &args[i]));
-	    goto run_code;
-	  }
-	else if (EQ (symbol, Qand_optional))
-	  optional = 1;
-	else if (i == nargs && !optional)
-	  goto wrong_number_of_arguments;
-	else
-	  SPECBIND_FAST_UNSAFE (symbol, i < nargs ? args[i++] : Qnil);
-      }
-  }
-
-  if (i < nargs)
-    goto wrong_number_of_arguments;
-
- run_code:
-
-  {
-    Lisp_Object value =
-      execute_optimized_program ((Opbyte *) XOPAQUE_DATA (f->instructions),
-				 f->stack_depth,
-				 XVECTOR_DATA (f->constants));
-
-    /* The attempt to optimize this by only unbinding variables failed
-       because using buffer-local variables as function parameters
-       leads to specpdl_ptr->func != 0 */
-    /* UNBIND_TO_GCPRO_VARIABLES_ONLY (speccount, value); */
-    UNBIND_TO_GCPRO (speccount, value);
-    return value;
-  }
-
- wrong_number_of_arguments:
-  /* The actual printed compiled_function object is incomprehensible.
-     Check the backtrace to see if we can get a more meaningful symbol. */
-  if (EQ (fun, indirect_function (*backtrace_list->function, 0)))
-    fun = *backtrace_list->function;
-  return Fsignal (Qwrong_number_of_arguments, list2 (fun, make_int (nargs)));
-}
-
 
 /* Read next uint8 from the instruction stream. */
 #define READ_UINT_1 ((unsigned int) (unsigned char) *program_ptr++)
@@ -593,7 +518,7 @@
    real benchmarking and profiling work -- martin */
 
 
-static Lisp_Object
+Lisp_Object
 execute_optimized_program (const Opbyte *program,
 			   int stack_depth,
 			   Lisp_Object *constants_data)
@@ -1962,6 +1887,7 @@
 mark_compiled_function (Lisp_Object obj)
 {
   Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (obj);
+  int i;
 
   mark_object (f->instructions);
   mark_object (f->arglist);
@@ -1969,6 +1895,9 @@
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
   mark_object (f->annotated);
 #endif
+  for (i = 0; i < f->args_in_array; i++)
+    mark_object (f->args[i]);
+
   /* tail-recurse on constants */
   return f->constants;
 }
@@ -2001,7 +1930,20 @@
 		internal_hash (f->constants,    depth + 1));
 }
 
+static const struct lrecord_description lo_description_1[] = {
+  { XD_LISP_OBJECT, 0 },
+  { XD_END }
+};
+
+static const struct struct_description lo_description = {
+  sizeof (Lisp_Object),
+  lo_description_1
+};
+
 static const struct lrecord_description compiled_function_description[] = {
+  { XD_INT,         offsetof (Lisp_Compiled_Function, args_in_array) },
+  { XD_STRUCT_PTR,  offsetof (Lisp_Compiled_Function, args),
+      XD_INDIRECT (0, 0), &lo_description },
   { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, instructions) },
   { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, constants) },
   { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, arglist) },
--- a/src/bytecode.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/bytecode.h	Sun Apr 14 12:43:31 2002 +0000
@@ -1,5 +1,6 @@
 /* Definitions for bytecode interpretation and compiled-function objects.
    Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -61,6 +62,18 @@
   Lisp_Object instructions;
   Lisp_Object constants;
   Lisp_Object arglist;
+  /* For speed, we unroll arglist into an array of argument symbols, so we
+     don't have to process arglist every time we make a function call. */
+  Lisp_Object *args;
+  /* Minimum and maximum number of arguments.  If MAX_ARGS == MANY, the
+     function was declared with &rest, and (args_in_array - 1) indicates
+     how many arguments there are before the &rest argument. (We could
+     munge the max_non_rest_args into max_args by using a negative number,
+     but that interferes with pdump marking.  We don't want to use a flag
+     to indicate &rest because that would add an extra check in the
+     simplest case.) */
+  int min_args, max_args;
+  int args_in_array;
   /* This uses the minimal number of conses; see accessors in data.c. */
   Lisp_Object doc_and_interactive;
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
@@ -84,10 +97,13 @@
 void set_compiled_function_documentation (Lisp_Compiled_Function *f,
 					  Lisp_Object new_doc);
 
-Lisp_Object funcall_compiled_function (Lisp_Object fun,
-				       int nargs, Lisp_Object args[]);
 void optimize_compiled_function (Lisp_Object compiled_function);
 
+typedef unsigned char Opbyte;
+Lisp_Object execute_optimized_program (const Opbyte *program,
+				       int stack_depth,
+				       Lisp_Object *constants_data);
+
 DECLARE_LRECORD (compiled_function, Lisp_Compiled_Function);
 #define XCOMPILED_FUNCTION(x) XRECORD (x, compiled_function, \
 				       Lisp_Compiled_Function)
--- a/src/callproc.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/callproc.c	Sun Apr 14 12:43:31 2002 +0000
@@ -23,14 +23,8 @@
 /* Partly sync'ed with 19.36.4 */
 
 
-/* #### This ENTIRE file is only used in batch mode. (Well, almost;
-   certainly the main call-process stuff is only used in batch mode.)
-
-   We only need two things to get rid of both this and ntproc.c:
-
-   -- my `stderr-proc' ws, which adds support for a separate stderr
-      in asynch. subprocesses. (it's a feature in `old-call-process-internal'.)
-   -- a noninteractive event loop that supports processes.
+/* #### Everything in this file should go.  As soon as I merge my
+   stderr-proc WS, it will.
 */
 
 #include <config.h>
@@ -38,43 +32,19 @@
 
 #include "buffer.h"
 #include "commands.h"
+#include "file-coding.h"
 #include "insdel.h"
 #include "lstream.h"
 #include "process.h"
 #include "sysdep.h"
 #include "window.h"
-#include "file-coding.h"
 
-#include "systime.h"
-#include "sysproc.h"
-#include "sysfile.h" /* Always include after sysproc.h #### Why?  This
-			rule is not followed elsewhere in XEmacs, without
-			apparent problems */
-#include "syssignal.h" /* Always include before systty.h #### Why? This
-			rule is not followed elsewhere in XEmacs, without
-			apparent problems */
-#include "systty.h"
 #include "sysdir.h"
-
-#ifdef WIN32_NATIVE
-#include "syswindows.h"
-#endif
-
-#ifdef WIN32_NATIVE
-/* When we are starting external processes we need to know whether they
-   take binary input (no conversion) or text input (\n is converted to
-   \r\n).  Similarly for output: if newlines are written as \r\n then it's
-   text process output, otherwise it's binary.  */
-Lisp_Object Vbinary_process_input;
-Lisp_Object Vbinary_process_output;
-#endif /* WIN32_NATIVE */
-
-Lisp_Object Vshell_file_name;
-
-/* The environment to pass to all subprocesses when they are started.
-   This is in the semi-bogus format of ("VAR=VAL" "VAR2=VAL2" ... )
- */
-Lisp_Object Vprocess_environment;
+#include "sysfile.h"
+#include "sysproc.h"
+#include "syssignal.h"
+#include "systime.h"
+#include "systty.h"
 
 /* True iff we are about to fork off a synchronous process or if we
    are waiting for it.  */
@@ -94,11 +64,6 @@
 /* Nonzero if this is termination due to exit.  */
 static int call_process_exited;
 
-/* Make sure egetenv() not called too soon */
-int env_initted;
-
-Lisp_Object Vlisp_EXEC_SUFFIXES;
-
 static Lisp_Object
 call_process_kill (Lisp_Object fdpid)
 {
@@ -130,18 +95,7 @@
     /* #### "c-G" -- need non-consing Single-key-description */
     message ("Waiting for process to die...(type C-g again to kill it instantly)");
 
-#ifdef WIN32_NATIVE
-    {
-      HANDLE pHandle = OpenProcess (PROCESS_ALL_ACCESS, 0, pid);
-      if (pHandle == NULL)
-	warn_when_safe (Qprocess, Qnotice,
-			"cannot open process (PID %d) for cleanup", pid);
-      else
-	wait_for_termination (pHandle);
-    }
-#else
     wait_for_termination (pid);
-#endif
 
     /* "Discard" the unwind protect.  */
     XCAR (fdpid) = Qnil;
@@ -183,9 +137,6 @@
   Lisp_Object infile, buffer, current_dir, display, path;
   int fd[2];
   int filefd;
-#ifdef WIN32_NATIVE
-  HANDLE pHandle;
-#endif
   int pid;
   char buf[16384];
   char *bufptr = buf;
@@ -326,11 +277,7 @@
     }
   else
     {
-#ifdef WIN32_NATIVE
-      pipe_will_die_soon (fd);
-#else
       pipe (fd);
-#endif
 #if 0
       /* Replaced by close_process_descs */
       set_exclusive_use (fd[0]);
@@ -355,14 +302,8 @@
     else if (STRINGP (error_file))
       {
 	fd_error = qxe_open (XSTRING_DATA (error_file),
-#ifdef WIN32_NATIVE
-			     O_WRONLY | O_TRUNC | O_CREAT | O_TEXT,
-			     S_IREAD | S_IWRITE
-#else  /* not WIN32_NATIVE */
 			     O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY,
-			     CREAT_MODE
-#endif /* not WIN32_NATIVE */
-			     );
+			     CREAT_MODE);
       }
 
     if (fd_error < 0)
@@ -376,26 +317,6 @@
 	report_process_error ("Cannot open", Fcons (error_file, Qnil));
       }
 
-#ifdef WIN32_NATIVE
-    pid = child_setup (filefd, fd1, fd_error, new_argv, current_dir);
-    if (!INTP (buffer))
-      {
-	/* OpenProcess() as soon after child_setup as possible.  It's too
-	   late once the process terminated. */
-	pHandle = OpenProcess (PROCESS_ALL_ACCESS, 0, pid);
-#if 0
-	if (pHandle == NULL)
-	  {
-	    /* #### seems to cause crash in unbind_to_1(...) below. APA */
-	    warn_when_safe (Qprocess, Qnotice,
-			    "cannot open process to wait for");
-	  }
-#endif
-      }
-    /* Close STDERR into the parent process.  We no longer need it. */
-    if (fd_error >= 0)
-      retry_close (fd_error);
-#else  /* not WIN32_NATIVE */
     pid = fork ();
 
     if (pid == 0)
@@ -415,8 +336,6 @@
     if (fd_error >= 0)
       retry_close (fd_error);
 
-#endif /* not WIN32_NATIVE */
-
     /* Close most of our fd's, but not fd[0]
        since we will use that to read input from.  */
     retry_close (filefd);
@@ -424,7 +343,6 @@
       retry_close (fd1);
   }
 
-#ifndef WIN32_NATIVE
   if (pid < 0)
     {
       int save_errno = errno;
@@ -433,7 +351,6 @@
       errno = save_errno;
       report_process_error ("Doing fork", Qunbound);
     }
-#endif
 
   if (INTP (buffer))
     {
@@ -470,7 +387,6 @@
 	(XLSTREAM (instream),
 	 get_coding_system_for_text_file (Vcoding_system_for_read, 1),
 	 CODING_DECODE, 0);
-    Lstream_set_character_mode (XLSTREAM (instream));
     NGCPRO1 (instream);
     while (1)
       {
@@ -530,11 +446,7 @@
 
     QUIT;
     /* Wait for it to terminate, unless it already has.  */
-#ifdef WIN32_NATIVE
-    wait_for_termination (pHandle);
-#else
     wait_for_termination (pid);
-#endif
 
     /* Don't kill any children that the subprocess may have left behind
        when exiting.  */
@@ -586,20 +498,12 @@
    XEmacs?), this should be verified as an executable directory by the
    parent.  */
 
-#ifdef WIN32_NATIVE
-int
-#else
 void
-#endif
 child_setup (int in, int out, int err, Intbyte **new_argv,
 	     Lisp_Object current_dir)
 {
   Intbyte **env;
   Intbyte *pwd;
-#ifdef WIN32_NATIVE
-  int cpid;
-  HANDLE handles[4];
-#endif /* WIN32_NATIVE */
 
 #ifdef SET_EMACS_PRIORITY
   if (emacs_priority != 0)
@@ -621,13 +525,11 @@
      event-tty.c) to allow for stream devices to be handled correctly.
      There isn't much to do, in fact, and I'll fix it shortly.  That
      way, the Lisp definition can be used non-interactively too. */
-#if !defined (NO_SUBPROCESSES) && !defined (WIN32_NATIVE)
+#if !defined (NO_SUBPROCESSES)
   /* Close Emacs's descriptors that this process should not have.  */
   close_process_descs ();
 #endif /* not NO_SUBPROCESSES */
-#ifndef WIN32_NATIVE
   close_load_descs ();
-#endif
 
   /* [[Note that use of alloca is always safe here.  It's obvious for systems
      that do not have true vfork or that have true (stack) alloca.
@@ -720,11 +622,6 @@
     *new_env = 0;
   }
 
-#ifdef WIN32_NATIVE
-  prepare_standard_handles (in, out, err, handles);
-  /* #### junk!  But all this win32 code will die soon. */
-  set_process_dir ((char *) XSTRING_DATA (current_dir));
-#else  /* not WIN32_NATIVE */
   /* Make sure that in, out, and err are not actually already in
      descriptors zero, one, or two; this could happen if Emacs is
      started with its standard in, out, or error closed, as might
@@ -755,290 +652,20 @@
     for (fd=3; fd<=64; fd++)
       retry_close (fd);
   }
-#endif /* not WIN32_NATIVE */
 
 #ifdef vipc
   something missing here;
 #endif /* vipc */
 
-#ifdef WIN32_NATIVE
-  /* Spawn the child.  (See ntproc.c:Spawnve).  */
-  /* #### junk!  arguments not converted.  But all this win32 code
-     will die soon. */
-  cpid = spawnve_will_die_soon (_P_NOWAIT, new_argv[0],
-				(const char* const*)new_argv,
-				(const char* const*)env);
-  if (cpid == -1)
-    /* An error occurred while trying to spawn the process.  */
-    report_process_error ("Spawning child process", Qunbound);
-  reset_standard_handles (in, out, err, handles);
-  return cpid;
-#else /* not WIN32_NATIVE */
   /* we've wrapped execve; it translates its arguments */
   qxe_execve (new_argv[0], new_argv, env);
 
   stdout_out ("Can't exec program %s\n", new_argv[0]);
   _exit (1);
-#endif /* not WIN32_NATIVE */
-}
-
-static int
-getenv_internal (const Intbyte *var,
-		 Bytecount varlen,
-		 Intbyte **value,
-		 Bytecount *valuelen)
-{
-  Lisp_Object scan;
-
-  assert (env_initted);
-
-  for (scan = Vprocess_environment; CONSP (scan); scan = XCDR (scan))
-    {
-      Lisp_Object entry = XCAR (scan);
-
-      if (STRINGP (entry)
-	  && XSTRING_LENGTH (entry) > varlen
-	  && XSTRING_BYTE (entry, varlen) == '='
-#ifdef WIN32_NATIVE
-	  /* NT environment variables are case insensitive.  */
-	  && ! memicmp (XSTRING_DATA (entry), var, varlen)
-#else  /* not WIN32_NATIVE */
-	  && ! memcmp (XSTRING_DATA (entry), var, varlen)
-#endif /* not WIN32_NATIVE */
-	  )
-	{
-	  *value    = XSTRING_DATA   (entry) + (varlen + 1);
-	  *valuelen = XSTRING_LENGTH (entry) - (varlen + 1);
-	  return 1;
-	}
-    }
-
-  return 0;
-}
-
-static void
-putenv_internal (const Intbyte *var,
-		 Bytecount varlen,
-		 const Intbyte *value,
-		 Bytecount valuelen)
-{
-  Lisp_Object scan;
-
-  assert (env_initted);
-
-  for (scan = Vprocess_environment; CONSP (scan); scan = XCDR (scan))
-    {
-      Lisp_Object entry = XCAR (scan);
-
-      if (STRINGP (entry)
-	  && XSTRING_LENGTH (entry) > varlen
-	  && XSTRING_BYTE (entry, varlen) == '='
-#ifdef WIN32_NATIVE
-	  /* NT environment variables are case insensitive.  */
-	  && ! memicmp (XSTRING_DATA (entry), var, varlen)
-#else  /* not WIN32_NATIVE */
-	  && ! memcmp (XSTRING_DATA (entry), var, varlen)
-#endif /* not WIN32_NATIVE */
-	  )
-	{
-	  XCAR (scan) = concat3 (make_string (var, varlen),
-				 build_string ("="),
-				 make_string (value, valuelen));
-	  return;
-	}
-    }
-
-  Vprocess_environment = Fcons (concat3 (make_string (var, varlen),
-					 build_string ("="),
-					 make_string (value, valuelen)),
-				Vprocess_environment);
-}
-
-/* NOTE:
-
-   FSF has this as a Lisp function, as follows.  Generally moving things
-   out of C and into Lisp is a good idea, but in this case the Lisp
-   function is used so early in the startup sequence that it would be ugly
-   to rearrange the early dumped code to accommodate this.
-   
-(defun getenv (variable)
-  "Get the value of environment variable VARIABLE.
-VARIABLE should be a string.  Value is nil if VARIABLE is undefined in
-the environment.  Otherwise, value is a string.
-
-This function consults the variable `process-environment'
-for its value."
-  (interactive (list (read-envvar-name "Get environment variable: " t)))
-  (let ((value (getenv-internal variable)))
-    (when (interactive-p)
-      (message "%s" (if value value "Not set")))
-    value))
-*/
-
-DEFUN ("getenv", Fgetenv, 1, 2, "sEnvironment variable: \np", /*
-Return the value of environment variable VAR, as a string.
-VAR is a string, the name of the variable.
-When invoked interactively, prints the value in the echo area.
-*/
-       (var, interactivep))
-{
-  Intbyte *value;
-  Bytecount valuelen;
-  Lisp_Object v = Qnil;
-  struct gcpro gcpro1;
-
-  CHECK_STRING (var);
-  GCPRO1 (v);
-  if (getenv_internal (XSTRING_DATA (var), XSTRING_LENGTH (var),
-		       &value, &valuelen))
-    v = make_string (value, valuelen);
-  if (!NILP (interactivep))
-    {
-      if (NILP (v))
-	message ("%s not defined in environment", XSTRING_DATA (var));
-      else
-	/* #### Should use Fprin1_to_string or Fprin1 to handle string
-           containing quotes correctly.  */
-	message ("\"%s\"", value);
-    }
-  RETURN_UNGCPRO (v);
-}
-
-/* A version of getenv that consults Vprocess_environment, easily
-   callable from C.
-
-   (At init time, Vprocess_environment is initialized from the
-   environment, stored in the global variable environ. [Note that
-   at startup time, `environ' should be the same as the envp parameter
-   passed to main(); however, later calls to putenv() may change
-   `environ', making the envp parameter inaccurate.] Calls to getenv()
-   and putenv() consult and modify `environ'.  However, once
-   Vprocess_environment is initted, XEmacs C code should *NEVER* call
-   getenv() or putenv() directly, because (1) Lisp code that modifies
-   the environment only modifies Vprocess_environment, not `environ';
-   and (2) Vprocess_environment is in internal format but `environ'
-   is in some external format, and getenv()/putenv() are not Mule-
-   encapsulated.
-
-   WARNING: This value points into Lisp string data and thus will become
-   invalid after a GC. */
-
-Intbyte *
-egetenv (const CIntbyte *var)
-{
-  /* This cannot GC -- 7-28-00 ben */
-  Intbyte *value;
-  Bytecount valuelen;
-
-  if (getenv_internal ((const Intbyte *) var, strlen (var), &value, &valuelen))
-    return value;
-  else
-    return 0;
-}
-
-void
-eputenv (const CIntbyte *var, const CIntbyte *value)
-{
-  putenv_internal ((Intbyte *) var, strlen (var), (Intbyte *) value,
-		   strlen (value));
-}
-
-
-void
-init_callproc (void)
-{
-  /* This function can GC */
-
-  {
-    /* jwz: always initialize Vprocess_environment, so that egetenv()
-       works in temacs. */
-    char **envp;
-    Vprocess_environment = Qnil;
-    for (envp = environ; envp && *envp; envp++)
-      Vprocess_environment =
-	Fcons (build_ext_string (*envp, Qnative), Vprocess_environment);
-    /* This gets set back to 0 in disksave_object_finalization() */
-    env_initted = 1;
-  }
-
-  {
-    /* Initialize shell-file-name from environment variables or best guess. */
-#ifdef WIN32_NATIVE
-    const Intbyte *shell = egetenv ("SHELL");
-    if (!shell) shell = egetenv ("COMSPEC");
-    /* Should never happen! */
-    if (!shell) shell =
-      (Intbyte *) (GetVersion () & 0x80000000 ? "command" : "cmd");
-#else /* not WIN32_NATIVE */
-    const Intbyte *shell = egetenv ("SHELL");
-    if (!shell) shell = (Intbyte *) "/bin/sh";
-#endif
-
-#if 0 /* defined (WIN32_NATIVE) */
-    /* BAD BAD BAD.  We do not wanting to be passing an XEmacs-created
-       SHELL var down to some inferior Cygwin process, which might get
-       screwed up.
-	 
-       There are a few broken apps (eterm/term.el, eterm/tshell.el,
-       os-utils/terminal.el, texinfo/tex-mode.el) where this will
-       cause problems.  Those broken apps don't look at
-       shell-file-name, instead just at explicit-shell-file-name,
-       ESHELL and SHELL.  They are apparently attempting to borrow
-       what `M-x shell' uses, but that latter also looks at
-       shell-file-name.  What we want is for all of these apps to look
-       at shell-file-name, so that the user can change the value of
-       shell-file-name and everything will work out hunky-dorey.
-       */
-    
-    if (!egetenv ("SHELL"))
-      {
-	Intbyte *faux_var = alloca_array (Intbyte, 7 + qxestrlen (shell));
-	qxesprintf (faux_var, "SHELL=%s", shell);
-	Vprocess_environment = Fcons (build_intstring (faux_var),
-				      Vprocess_environment);
-      }
-#endif /* 0 */
-
-    Vshell_file_name = build_intstring (shell);
-  }
 }
 
 void
 syms_of_callproc (void)
 {
   DEFSUBR (Fold_call_process_internal);
-  DEFSUBR (Fgetenv);
 }
-
-void
-vars_of_callproc (void)
-{
-  /* This function can GC */
-#ifdef WIN32_NATIVE
-  /* Will die as soon as callproc.c dies */
-  DEFVAR_LISP ("binary-process-input", &Vbinary_process_input /*
-*If non-nil then new subprocesses are assumed to take binary input.
-*/ );
-  Vbinary_process_input = Qnil;
-
-  DEFVAR_LISP ("binary-process-output", &Vbinary_process_output /*
-*If non-nil then new subprocesses are assumed to produce binary output.
-*/ );
-  Vbinary_process_output = Qnil;
-#endif /* WIN32_NATIVE */
-
-  DEFVAR_LISP ("shell-file-name", &Vshell_file_name /*
-*File name to load inferior shells from.
-Initialized from the SHELL environment variable.
-*/ );
-
-  DEFVAR_LISP ("process-environment", &Vprocess_environment /*
-List of environment variables for subprocesses to inherit.
-Each element should be a string of the form ENVVARNAME=VALUE.
-The environment which Emacs inherits is placed in this variable
-when Emacs starts.
-*/ );
-
-  Vlisp_EXEC_SUFFIXES = build_string (EXEC_SUFFIXES);
-  staticpro (&Vlisp_EXEC_SUFFIXES);
-}
--- a/src/console-tty.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/console-tty.c	Sun Apr 14 12:43:31 2002 +0000
@@ -117,9 +117,9 @@
   tty_con->instream =
     make_coding_input_stream (XLSTREAM (tty_con->instream),
 			      get_coding_system_for_text_file (Qkeyboard, 0),
-			      CODING_DECODE, CODE_FL_READ_ONE_BYTE_AT_A_TIME);
+			      CODING_DECODE,
+			      LSTREAM_FL_READ_ONE_BYTE_AT_A_TIME);
   Lstream_set_buffering (XLSTREAM (tty_con->instream), LSTREAM_UNBUFFERED, 0);
-  Lstream_set_character_mode (XLSTREAM (tty_con->instream));
   tty_con->outstream = make_filedesc_output_stream (tty_con->outfd, 0, -1, 0);
   tty_con->outstream =
     make_coding_output_stream (XLSTREAM (tty_con->outstream),
--- a/src/dired.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/dired.c	Sun Apr 14 12:43:31 2002 +0000
@@ -418,7 +418,7 @@
 	  if (!passcount && ignored_extension_p)
 	    continue;
 
-	  if (!passcount && regexp_ignore_completion_p (d_name, Qnil, 0, cclen))
+	  if (!passcount && regexp_ignore_completion_p (d_name, Qnil, 0, len))
             continue;
 
           /* Update computation of how much all possible completions match */
--- a/src/doc.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/doc.c	Sun Apr 14 12:43:31 2002 +0000
@@ -22,30 +22,32 @@
 
 /* Synched up with: FSF 19.30. */
 
-/* This file has been Mule-ized except as noted. */
+/* This file has been Mule-ized. */
 
 #include <config.h>
 #include "lisp.h"
 
 #include "buffer.h"
 #include "bytecode.h"
+#include "file-coding.h"
 #include "insdel.h"
 #include "keymap.h"
+#include "lstream.h"
 #include "sysfile.h"
 
 Lisp_Object Vinternal_doc_file_name;
 
 Lisp_Object QSsubstitute;
 
-/* Read and return doc string from open file descriptor FD
-   at position POSITION.  Does not close the file.  Returns
-   string; or if error, returns a cons holding the error
-   data to pass to Fsignal.  NAME_NONRELOC and NAME_RELOC
-   are only used for the error messages. */
+/* Read and return doc string or instructions from open file descriptor FD
+   at position POSITION.  Does not close the file.  Returns string; or if
+   error, returns a cons holding the error data to pass to Fsignal.
+   NAME_NONRELOC and NAME_RELOC are only used for the error messages. */
 
 Lisp_Object
 unparesseuxify_doc_string (int fd, EMACS_INT position,
-                           Intbyte *name_nonreloc, Lisp_Object name_reloc)
+                           Intbyte *name_nonreloc, Lisp_Object name_reloc,
+			   int standard_doc_file)
 {
   Intbyte buf[512 * 32 + 1];
   Intbyte *buffer = buf;
@@ -53,6 +55,10 @@
   Intbyte *from, *to;
   REGISTER Intbyte *p = buffer;
   Lisp_Object return_me;
+  Lisp_Object fdstream = Qnil, instream = Qnil;
+  struct gcpro gcpro1, gcpro2;
+
+  GCPRO2 (fdstream, instream);
 
   if (0 > lseek (fd, position, 0))
     {
@@ -64,6 +70,21 @@
       goto done;
     }
 
+  fdstream = make_filedesc_input_stream (fd, 0, -1, 0);
+  Lstream_set_buffering (XLSTREAM (fdstream), LSTREAM_UNBUFFERED, 0);
+  instream =
+    make_coding_input_stream
+      /* Major trouble if we are too clever when reading byte-code
+	 instructions!
+
+	 #### We should have a way of handling escape-quoted elc files
+	 (i.e. files with non-ASCII/Latin-1 chars in them).  Currently this
+	 is "solved" in bytecomp.el by never inserting lazy references in
+	 such files. */
+      (XLSTREAM (fdstream), standard_doc_file ? Qundecided : Qbinary,
+       CODING_DECODE, 0);
+  Lstream_set_buffering (XLSTREAM (instream), LSTREAM_UNBUFFERED, 0);
+  
   /* Read the doc string into a buffer.
      Use the fixed buffer BUF if it is big enough; otherwise allocate one.
      We store the buffer in use in BUFFER and its size in BUFFER_SIZE.  */
@@ -91,7 +112,7 @@
       /* Don't read too much at one go.  */
       if (space_left > 1024 * 8)
 	space_left = 1024 * 8;
-      nread = retry_read (fd, p, space_left);
+      nread = Lstream_read (XLSTREAM (instream), p, space_left);
       if (nread < 0)
 	{
 	  return_me = list1 (build_msg_string
@@ -102,13 +123,13 @@
       if (!nread)
 	break;
       {
-        Intbyte *p1 = qxestrchr (p, '\037'); /* End of doc string marker */
-        if (p1)
-          {
-            *p1 = 0;
-            p = p1;
-            break;
-          }
+	Intbyte *p1 = qxestrchr (p, '\037'); /* End of doc string marker */
+	if (p1)
+	  {
+	    *p1 = 0;
+	    p = p1;
+	    break;
+	  }
       }
       p += nread;
     }
@@ -139,10 +160,15 @@
 	}
     }
 
-  /* !!#### mrb: following STILL completely broken */
-  return_me = make_ext_string ((Extbyte *) buffer, to - buffer, Qbinary);
+  return_me = make_string (buffer, to - buffer);
 
  done:
+  if (!NILP (instream))
+    {
+      Lstream_delete (XLSTREAM (instream));
+      Lstream_delete (XLSTREAM (fdstream));
+    }
+  UNGCPRO;
   if (buffer != buf) /* We must have allocated buffer above */
     xfree (buffer);
   return return_me;
@@ -172,10 +198,12 @@
   EMACS_INT position;
   Lisp_Object file, tem;
   Lisp_Object name_reloc = Qnil;
+  int standard_doc_file = 0;
 
   if (INTP (filepos))
     {
       file = Vinternal_doc_file_name;
+      standard_doc_file = 1;
       position = XINT (filepos);
     }
   else if (CONSP (filepos) && INTP (XCDR (filepos)))
@@ -232,12 +260,13 @@
 #endif /* CANNOT_DUMP */
 
       if (fd < 0)
-	signal_error (Qfile_error, "Cannot open doc string file",
-		      name_nonreloc ? build_intstring (name_nonreloc) :
-		      name_reloc);
+	report_file_error ("Cannot open doc string file",
+			   name_nonreloc ? build_intstring (name_nonreloc) :
+			   name_reloc);
     }
 
-  tem = unparesseuxify_doc_string (fd, position, name_nonreloc, name_reloc);
+  tem = unparesseuxify_doc_string (fd, position, name_nonreloc, name_reloc,
+				   standard_doc_file);
   retry_close (fd);
 
   if (!STRINGP (tem))
@@ -401,7 +430,6 @@
            weirdness, type, XSTRING_DATA (XSYMBOL (sym)->name), pos);
 }
 
-
 DEFUN ("Snarf-documentation", Fsnarf_documentation, 1, 1, 0, /*
 Used during Emacs initialization, before dumping runnable Emacs,
 to find pointers to doc strings stored in `.../lib-src/DOC' and
@@ -420,6 +448,14 @@
   Lisp_Object sym, fun, tem;
   Intbyte *name;
 
+  /* This function should not pass the data it's reading through a coding
+     stream.  The reason is that the only purpose of this function is to
+     find the file offsets for the documentation of the various functions,
+     not do anything with the documentation itself.  If we pass through a
+     coding stream, the pointers will get messed up when we start reading
+     ISO 2022 data because our pointers will reflect internal format, not
+     external format. */
+  
 #ifndef CANNOT_DUMP
   if (!purify_flag)
     invalid_operation ("Snarf-documentation can only be called in an undumped Emacs", Qunbound);
@@ -650,7 +686,6 @@
   return Qnil;
 }
 
-
 #if 1	/* Don't warn about functions whose doc was lost because they were
 	   wrapped by advice-freeze.el... */
 static int
--- a/src/editfns.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/editfns.c	Sun Apr 14 12:43:31 2002 +0000
@@ -818,7 +818,7 @@
 #endif
   tem = ((!NILP (user) && !pw)
 	 ? Qnil
-	 : make_string (p, (q ? q - p : qxestrlen (p))));
+	 : make_string (p, (q ? (Bytecount) (q - p) : qxestrlen (p))));
 
 #ifdef AMPERSAND_FULL_NAME
   if (!NILP (tem))
@@ -1577,8 +1577,8 @@
 {
   /* This function can GC */
   REGISTER Intbyte *string;
-  REGISTER int slen;
-  REGISTER int i, j;
+  REGISTER Bytecount slen;
+  REGISTER Bytecount i, j;
   REGISTER Bytecount n;
   REGISTER Bytecount charlen;
   Intbyte str[MAX_EMCHAR_LEN];
@@ -1598,7 +1598,7 @@
   n = cou * charlen;
   if (n <= 0)
     return Qnil;
-  slen = min (n, 768);
+  slen = min (n, (Bytecount) 768);
   string = alloca_array (Intbyte, slen);
   /* Write as many copies of the character into the temp string as will fit. */
   for (i = 0; i + charlen <= slen; i += charlen)
--- a/src/emacs.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/emacs.c	Sun Apr 14 12:43:31 2002 +0000
@@ -472,8 +472,6 @@
 Lisp_Object Qkill_emacs_hook;
 Lisp_Object Qsave_buffers_kill_emacs;
 
-extern Lisp_Object Vlisp_EXEC_SUFFIXES;
-
 /* Nonzero if handling a fatal error already. */
 int fatal_error_in_progress;
 
@@ -518,16 +516,20 @@
 	  if (i == 0)
 	    {
 	      /* Do not trust to what crt0 has stuffed into argv[0] */
-	      Extbyte full_exe_path[PATH_MAX];
+	      Extbyte *full_exe_path;
 	      Lisp_Object fullpath;
 
-	      qxeGetModuleFileName (NULL, full_exe_path, PATH_MAX);
+	      full_exe_path = mswindows_get_module_file_name ();
+	      assert (full_exe_path);
 	      fullpath = build_tstr_string (full_exe_path);
+	      xfree (full_exe_path);
 	      result = Fcons (fullpath, result);
-#if defined(HAVE_SHLIB)
+#ifdef HAVE_SHLIB
 	      {
 		Extbyte *fullpathext;
 
+		/* Don't use full_exe_path directly because it's probably
+		   in a different format. */
 		LISP_STRING_TO_EXTERNAL (fullpath, fullpathext,
 					 Qdll_filename_encoding);
 		(void) dll_init (fullpathext);
@@ -705,9 +707,9 @@
      initialized!=0 && restart==0 => either xemacs after conventional dump,
                                      or xemacs post pdump_load()
 */
-DECLARE_DOESNT_RETURN (main_1 (int, char **, char **, int));
+DECLARE_DOESNT_RETURN (main_1 (int, Extbyte **, Extbyte **, int));
 DOESNT_RETURN
-main_1 (int argc, char **argv, char **envp, int restart)
+main_1 (int argc, Extbyte **argv, Extbyte **envp, int restart)
 {
   char stack_bottom_variable;
   int skip_args = 0;
@@ -717,6 +719,16 @@
   extern int malloc_cookie;
 #endif
 
+  /* !!#### Under MS Windows, this should all be rewritten to deal with
+     Unicode arguments and environment.  We need to retrieve the command
+     line with GetCommandLine and convert to argv format with
+     CommandLineToArgvW.  Unfortunately we have a bootstrapping problem
+     currently because we can't initialize the Unicode tables until we've
+     computed the location of data-directory, which doesn't happen till
+     startup.el, which is way late.  We need to be dumping the Unicode
+     data, which means we need to fix pdump to correctly dump the "union"
+     format used by the tables. */
+  
 #if (!defined (SYSTEM_MALLOC) && !defined (HAVE_LIBMCHECK)	\
      && !defined (DOUG_LEA_MALLOC))
   /* Make sure that any libraries we link against haven't installed a
@@ -1093,13 +1105,6 @@
     purify_flag = 1;
 #endif
 
-  if (initialized)
-    {
-      /* Reset some vars that were also set during loadup (we called
-	 these same functions below) */
-      init_alloc_early ();
-    }
-
   if (!initialized)
     {
       /* Initialize things so that new Lisp objects
@@ -1126,11 +1131,16 @@
 
       /* Make sure that eistrings can be created. */
       init_eistring_once_early ();
-
-      /* Initialize some vars that will also be reset post-dumping
-         (see above) */
-      init_alloc_early ();
-
+    }
+
+  /* The following will get called in raw-temacs, post-dump/pdump-load XEmacs,
+     and run-temacs. */
+
+  /* Initialize some vars that will also be reset post-dumping */
+  init_alloc_early ();
+
+  if (!initialized)
+    {
       /* Now declare all the symbols and define all the Lisp primitives.
 
 	 The *only* thing that the syms_of_*() functions are allowed to do
@@ -1151,7 +1161,9 @@
       syms_of_buffer ();
       syms_of_bytecode ();
       syms_of_callint ();
+#ifndef WIN32_NATIVE
       syms_of_callproc ();
+#endif
       syms_of_casefiddle ();
       syms_of_casetab ();
       syms_of_chartab ();
@@ -1650,7 +1662,6 @@
       vars_of_buffer ();
       vars_of_bytecode ();
       vars_of_callint ();
-      vars_of_callproc ();
       vars_of_chartab ();
       vars_of_cmdloop ();
       vars_of_cmds ();
@@ -1673,7 +1684,7 @@
       vars_of_editfns ();
       vars_of_emacs ();
       vars_of_eval ();
-      init_eval_early ();
+      init_eval_semi_early ();
 
 #ifdef HAVE_X_WINDOWS
       vars_of_event_Xt ();
@@ -1733,7 +1744,6 @@
 #endif
 #ifdef WIN32_NATIVE
       vars_of_nt ();
-      vars_of_ntproc ();
 #endif
       vars_of_objects ();
       vars_of_print ();
@@ -1753,6 +1763,7 @@
       vars_of_ralloc ();
 #endif /* HAVE_MMAP && REL_ALLOC */
       vars_of_redisplay ();
+      vars_of_regex ();
 #ifdef HAVE_SCROLLBARS
       vars_of_scrollbar ();
 #endif
@@ -1914,20 +1925,19 @@
 	 function and another. */
 
 #ifdef MULE
-      /* These two depend on hash tables and various variables declared
-	 earlier.  The second may also depend on the first. */
+      /* This depends on vars initialized in vars_of_unicode(). */
       complex_vars_of_mule_charset ();
 #endif
+      /* This one doesn't depend on anything really, and could go into
+	 vars_of_(), but lots of lots of code gets called and it's easily
+	 possible that it could get changed to require being a
+	 complex_vars_of_(), for example if a charset appears anywhere,
+	 then we suddenly have dependence on the previous call. */
       complex_vars_of_file_coding ();
 #ifdef HAVE_WIN32_CODING_SYSTEMS
       complex_vars_of_intl_win32 ();
 #endif
 
-      /* Calls Fmake_range_table(). */
-      complex_vars_of_regex ();
-      /* Calls Fmake_range_table(). */
-      complex_vars_of_search ();
-
       /* Depends on specifiers. */
       complex_vars_of_faces ();
 
@@ -1960,10 +1970,6 @@
 #ifdef HAVE_SCROLLBARS
       /* This calls Fmake_glyph_internal(). */
       complex_vars_of_scrollbar ();
-#ifdef HAVE_MS_WINDOWS
-      /* Calls make_lisp_hash_table(). */
-      complex_vars_of_scrollbar_mswindows ();
-#endif
 #endif
 
       /* This calls allocate_glyph(). */
@@ -2020,6 +2026,7 @@
       reinit_alloc_once_early ();
       reinit_symbols_once_early ();
       reinit_opaque_once_early ();
+      reinit_eistring_once_early ();
 
       reinit_console_type_create_stream ();
 #ifdef HAVE_TTY
@@ -2148,7 +2155,7 @@
      engine. */
 
   if (initialized)
-    init_eval_early ();
+    init_eval_semi_early ();
 
 #ifdef MULE
   init_mule_charset ();
@@ -2178,19 +2185,19 @@
 		   on out! */
 #endif
 
-  init_callproc ();	/* Set up the process environment (so that egetenv
-			   works), the basic directory variables
-			   (exec-directory and so on), and stuff
-			   related to subprocesses.  This should be
-			   first because many of the functions below
-			   call egetenv() to get environment variables. */
+  init_xemacs_process (); /* Set up the process environment (so that
+			     egetenv works), the basic directory variables
+			     (exec-directory and so on), and stuff related
+			     to subprocesses.  This should be first because
+			     many of the functions below call egetenv() to
+			     get environment variables. */
 
 #ifdef WIN32_NATIVE
   /*
    * For Win32, call init_environment() to properly enter environment/registry
    * variables into Vprocess_environment.
    */
-  init_environment ();
+  init_mswindows_environment ();
 #endif
 
   init_initial_directory ();		/* get the directory to use for the
@@ -2202,7 +2209,7 @@
   init_buffer_2 ();	/* Set default directory of *scratch* buffer */
 
 #ifdef WIN32_NATIVE
-  init_ntproc ();
+  init_nt ();
   init_select_mswindows ();
 #endif
 
@@ -2212,7 +2219,6 @@
   init_event_stream (); /* Set up so we can get user input. */
   init_macros (); /* set up so we can run macros. */
   init_editfns (); /* Determine the name of the user we're running as */
-  init_xemacs_process (); /* set up for calling subprocesses */
 #ifdef SUNPRO
   init_sunpro (); /* Set up Sunpro usage tracking */
 #endif
@@ -2827,8 +2833,15 @@
   memory_warnings (my_edata, malloc_warning);
 #endif
 
-  UNGCPRO;
-
+  garbage_collect_1 ();
+
+#ifdef PDUMP
+  pdump ();
+#elif defined (WIN32_NATIVE)
+  unexec (XSTRING_DATA (filename),
+	  STRINGP (symfile) ? XSTRING_DATA (symfile) : 0,
+	  (uintptr_t) my_edata, 0, 0);
+#else
   {
     Extbyte *filename_ext;
     Extbyte *symfile_ext;
@@ -2840,15 +2853,9 @@
     else
       symfile_ext = 0;
 
-    garbage_collect_1 ();
-
-#ifdef PDUMP
-    pdump ();
-#else
-
-#ifdef DOUG_LEA_MALLOC
+# ifdef DOUG_LEA_MALLOC
     malloc_state_ptr = malloc_get_state ();
-#endif
+# endif
   /* here we break our rule that the filename conversion should
      be performed at the actual time that the system call is made.
      It's a whole lot easier to do the conversion here than to
@@ -2856,14 +2863,15 @@
      conversion is applied everywhere.  Don't worry about memory
      leakage because this call only happens once. */
     unexec (filename_ext, symfile_ext, (uintptr_t) my_edata, 0, 0);
-#ifdef DOUG_LEA_MALLOC
+# ifdef DOUG_LEA_MALLOC
     free (malloc_state_ptr);
-#endif
-#endif /* not PDUMP */
+# endif
   }
+#endif /* not PDUMP, not WIN32_NATIVE */
 
   purify_flag = opurify;
 
+  UNGCPRO;
   return Qnil;
 }
 
@@ -3281,6 +3289,24 @@
 /*   abnormal shutdowns: GP faults  */
 /* -------------------------------- */
 
+/* This is somewhat ad-hoc ...  figure out whether the user is developing
+   XEmacs, which means (under MS Windows) they have a system debugger
+   installed that catches GP faults in any application and lets them open
+   up MS Dev Studio and start debugging the application -- similar to
+   producing a core dump and then going back with a debugger to investigate
+   the core dump, except that the program is still running.  When this is
+   installed, it's better not to "pause so user gets messages" because the
+   debugger will pause anyway; and in case we're currently with a menu
+   popped up or somewhere else inside of an internal modal loop, we will
+   get wedged when we output the "pause". (It seems that the two modal
+   loops will fight each other and the return key will never be passed to
+   the "pause" handler so that XEmacs's GPF handler can return, resignal
+   the GPF, and properly go into the debugger.) */
+#if defined (ERROR_CHECK_TYPES) || defined (ERROR_CHECK_TEXT) || defined (ERROR_CHECK_GC) || defined (ERROR_CHECK_STRUCTURES)
+#define USER_IS_DEVELOPING_XEMACS
+#endif
+
+					      
 /* Handle bus errors, illegal instruction, etc: actual implementation. */
 static void
 guts_of_fatal_error_signal (int sig)
@@ -3332,7 +3358,7 @@
           }
       }
 # endif
-#ifdef HAVE_MS_WINDOWS
+#if defined (HAVE_MS_WINDOWS) && !defined (USER_IS_DEVELOPING_XEMACS)
       pause_so_user_can_read_messages (0);
 #endif
     }
@@ -3369,7 +3395,9 @@
 {
   inhibit_non_essential_printing_operations = 1;
   preparing_for_armageddon = 1;
+#if !defined (USER_IS_DEVELOPING_XEMACS)
   pause_so_user_can_read_messages (0);
+#endif
   return EXCEPTION_EXECUTE_HANDLER;
 }
 
--- a/src/eval.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/eval.c	Sun Apr 14 12:43:31 2002 +0000
@@ -3145,6 +3145,21 @@
 /*			   eval, funcall, apply				*/
 /************************************************************************/
 
+/* NOTE: If you are hearing the endless complaint that function calls in
+   elisp are extremely slow, it just isn't true any more!  The stuff below
+   -- in particular, the calling of subrs and compiled functions, the most
+   common cases -- has been highly optimized.  There isn't a whole lot left
+   to do to squeeze more speed out except by switching to lexical
+   variables, which would eliminate the specbind loop. (But the real gain
+   from lexical variables would come from better optimization -- with
+   dynamic binding, you have the constant problem that any function call
+   that you haven't explicitly proven to be side-effect-free might
+   potentially side effect your local variables, which makes optimization
+   extremely difficult when there are function calls anywhere in a chunk of
+   code to be optimized.  Even worse, you don't know that *your* local
+   variables aren't side-effecting an outer function's local variables, so
+   it's impossible to optimize away almost *any* variable assignment.) */
+
 static Lisp_Object funcall_lambda (Lisp_Object fun,
 				   int nargs, Lisp_Object args[]);
 static int in_warnings;
@@ -3156,6 +3171,122 @@
   return Qnil;
 }
 
+void handle_compiled_function_with_and_rest (Lisp_Compiled_Function *f,
+					     int nargs,
+					     Lisp_Object args[]);
+
+/* The theory behind making this a separate function is to shrink
+   funcall_compiled_function() so as to increase the likelihood of a cache
+   hit in the L1 cache -- &rest processing is not going to be fast anyway.
+   The idea is the same as with execute_rare_opcode() in bytecode.c.  We
+   make this non-static to ensure the compiler doesn't inline it. */
+
+void
+handle_compiled_function_with_and_rest (Lisp_Compiled_Function *f, int nargs,
+					Lisp_Object args[])
+{
+  REGISTER int i = 0;
+  int max_non_rest_args = f->args_in_array - 1;
+  int bindargs = min (nargs, max_non_rest_args);
+
+  for (i = 0; i < bindargs; i++)
+    SPECBIND_FAST_UNSAFE (f->args[i], args[i]);
+  for (i = bindargs; i < max_non_rest_args; i++)
+    SPECBIND_FAST_UNSAFE (f->args[i], Qnil);
+  SPECBIND_FAST_UNSAFE
+    (f->args[max_non_rest_args],
+     nargs > max_non_rest_args ?
+     Flist (nargs - max_non_rest_args, &args[max_non_rest_args]) :
+     Qnil);
+}
+
+/* Apply compiled-function object FUN to the NARGS evaluated arguments
+   in ARGS, and return the result of evaluation. */
+inline static Lisp_Object
+funcall_compiled_function (Lisp_Object fun, int nargs, Lisp_Object args[])
+{
+  /* This function can GC */
+  int speccount = specpdl_depth();
+  REGISTER int i = 0;
+  Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
+
+  if (!OPAQUEP (f->instructions))
+    /* Lazily munge the instructions into a more efficient form */
+    optimize_compiled_function (fun);
+
+  /* optimize_compiled_function() guaranteed that f->specpdl_depth is
+     the required space on the specbinding stack for binding the args
+     and local variables of fun.   So just reserve it once. */
+  SPECPDL_RESERVE (f->specpdl_depth);
+
+  if (nargs == f->max_args) /* Optimize for the common case -- no unspecified
+			       optional arguments. */
+    {
+#if 1
+      for (i = 0; i < nargs; i++)
+	SPECBIND_FAST_UNSAFE (f->args[i], args[i]);
+#else
+      /* Here's an alternate way to write the loop that tries to further
+         optimize funcalls for functions with few arguments by partially
+         unrolling the loop.  It's not clear whether this is a win since it
+         increases the size of the function and the possibility of L1 cache
+         misses. (Microsoft VC++ 6 with /O2 /G5 generates 0x90 == 144 bytes
+         per SPECBIND_FAST_UNSAFE().) Tests under VC++ 6, running the byte
+         compiler repeatedly and looking at the total time, show very
+         little difference between the simple loop above, the unrolled code
+         below, and a "partly unrolled" solution with only cases 0-2 below
+         instead of 0-4.  Therefore, I'm keeping it at the simple loop
+         because it's smaller. */
+      switch (nargs)
+	{
+	default:
+	  for (i = nargs - 1; i >= 4; i--)
+	    SPECBIND_FAST_UNSAFE (f->args[i], args[i]);
+	case 4: SPECBIND_FAST_UNSAFE (f->args[3], args[3]);
+	case 3: SPECBIND_FAST_UNSAFE (f->args[2], args[2]);
+	case 2: SPECBIND_FAST_UNSAFE (f->args[1], args[1]);
+	case 1: SPECBIND_FAST_UNSAFE (f->args[0], args[0]);
+	case 0: break;
+	}
+#endif
+    }
+  else if (nargs < f->min_args)
+    goto wrong_number_of_arguments;
+  else if (nargs < f->max_args)
+    {
+      for (i = 0; i < nargs; i++)
+	SPECBIND_FAST_UNSAFE (f->args[i], args[i]);
+      for (i = nargs; i < f->max_args; i++)
+	SPECBIND_FAST_UNSAFE (f->args[i], Qnil);
+    }
+  else if (f->max_args == MANY)
+    handle_compiled_function_with_and_rest (f, nargs, args);
+  else
+    {
+    wrong_number_of_arguments:
+      /* The actual printed compiled_function object is incomprehensible.
+	 Check the backtrace to see if we can get a more meaningful symbol. */
+      if (EQ (fun, indirect_function (*backtrace_list->function, 0)))
+	fun = *backtrace_list->function;
+      return Fsignal (Qwrong_number_of_arguments,
+		      list2 (fun, make_int (nargs)));
+    }
+
+  {
+    Lisp_Object value =
+      execute_optimized_program ((Opbyte *) XOPAQUE_DATA (f->instructions),
+				 f->stack_depth,
+				 XVECTOR_DATA (f->constants));
+
+    /* The attempt to optimize this by only unbinding variables failed
+       because using buffer-local variables as function parameters
+       leads to specpdl_ptr->func != 0 */
+    /* UNBIND_TO_GCPRO_VARIABLES_ONLY (speccount, value); */
+    UNBIND_TO_GCPRO (speccount, value);
+    return value;
+  }
+}
+
 DEFUN ("eval", Feval, 1, 1, 0, /*
 Evaluate FORM and return its value.
 */
@@ -3207,7 +3338,7 @@
     }
 
   QUIT;
-  if (need_to_garbage_collect ())
+  if (need_to_garbage_collect)
     {
       struct gcpro gcpro1;
       GCPRO1 (form);
@@ -3431,7 +3562,7 @@
   Lisp_Object *fun_args = args + 1;
 
   QUIT;
-  if (need_to_garbage_collect ())
+  if (need_to_garbage_collect)
     /* Callers should gcpro lexpr args */
     garbage_collect_1 ();
 
@@ -3597,7 +3728,14 @@
    }
   else if (COMPILED_FUNCTIONP (function))
     {
-      arglist = compiled_function_arglist (XCOMPILED_FUNCTION (function));
+      Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (function);
+      
+      if (function_min_args_p)
+	return make_int (f->min_args);
+      else if (f->max_args == MANY)
+	return Qnil;
+      else
+	return make_int (f->max_args);
     }
   else if (CONSP (function))
     {
@@ -4918,7 +5056,7 @@
 
 /* Establish an unwind-protect which will restore the Lisp_Object pointed to
    by ADDR with the value VAL. */
-int
+static int
 record_unwind_protect_restoring_lisp_object (Lisp_Object *addr,
 					     Lisp_Object val)
 {
@@ -4966,7 +5104,7 @@
 /* Establish an unwind-protect which will restore the int pointed to
    by ADDR with the value VAL.  This function works correctly with
    all ints, even those that don't fit into a Lisp integer. */
-int
+static int
 record_unwind_protect_restoring_int (int *addr, int val)
 {
   Lisp_Object opaque = make_opaque_ptr (addr);
@@ -5488,7 +5626,7 @@
 }
 
 void
-init_eval_early (void)
+init_eval_semi_early (void)
 {
   specpdl_ptr = specpdl;
   specpdl_depth_counter = 0;
--- a/src/event-msw.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/event-msw.c	Sun Apr 14 12:43:31 2002 +0000
@@ -4798,9 +4798,9 @@
 {
 #ifdef HAVE_MSG_SELECT
   windows_fd = retry_open ("/dev/windows", O_RDONLY | O_NONBLOCK, 0);
-  assert (windows_fd>=0);
+  assert (windows_fd >= 0);
   FD_SET (windows_fd, &input_wait_mask);
-  FD_ZERO(&zero_mask);
+  FD_ZERO (&zero_mask);
 #endif
 
   event_stream = mswindows_event_stream;
--- a/src/event-stream.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/event-stream.c	Sun Apr 14 12:43:31 2002 +0000
@@ -475,30 +475,9 @@
 check_event_stream_ok (enum event_stream_operation op)
 {
   if (!event_stream && noninteractive)
-    {
-      switch (op)
-	{
-	case EVENT_STREAM_PROCESS:
-	  invalid_operation ("Can't start subprocesses in -batch mode",
-			     Qunbound);
-	case EVENT_STREAM_TIMEOUT:
-	  invalid_operation ("Can't add timeouts in -batch mode", Qunbound);
-	case EVENT_STREAM_CONSOLE:
-	  invalid_operation ("Can't add consoles in -batch mode", Qunbound);
-	case EVENT_STREAM_READ:
-	  invalid_operation ("Can't read events in -batch mode", Qunbound);
-	case EVENT_STREAM_NOTHING:
-	  break;
-	default:
-	  abort ();
-	}
-    }
-  else if (!event_stream)
-    {
-      invalid_operation
-	("event-stream callbacks not initialized (internal error?)",
-	 Qunbound);
-    }
+    /* See comment in init_event_stream() */
+    init_event_stream ();
+  else assert (event_stream);
 }
 
 static int
@@ -5040,6 +5019,12 @@
 void
 init_event_stream (void)
 {
+  /* Normally we don't initialize the event stream when running a bare
+     temacs (the check for initialized) because it may do various things
+     (e.g. under Xt) that we don't want any traces of in a dumped xemacs.
+     However, sometimes we need to process events in a bare temacs (in
+     particular, when make-docfile.el is executed); so we initialize as
+     necessary in check_event_stream_ok(). */
   if (initialized)
     {
 #ifdef HAVE_UNIXOID_EVENT_LOOP
--- a/src/file-coding.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/file-coding.c	Sun Apr 14 12:43:31 2002 +0000
@@ -2037,7 +2037,9 @@
            and when we get 0, keep taking more data until we don't get 0 --
            we don't know how much data the conversion routine might need
            before it can generate any data of its own */
-	Bytecount readmore = max (size, str->one_byte_at_a_time ? 1 : 1024);
+	Bytecount readmore =
+	  str->one_byte_at_a_time ? (Bytecount) 1 :
+	    max (size, (Bytecount) 1024);
 
 	Dynarr_add_many (str->convert_from, 0, readmore);
 	read_size = Lstream_read (str->other_end,
@@ -2129,10 +2131,11 @@
    Lstream_set_character_mode(), which lays out rules for who is allowed to
    modify the character type mode on a stream.
 
-   NOTE: We could potentially implement the full-character checking stuff
-   ourselves, which might be a bit safer in case people mess up the
-   character mode themselves.  But people shouldn't be doing that -- don't
-   hide bugs -- and there's no sense duplicating code. */
+   If we're a read stream, we're always setting character mode on the
+   source, but we also set it on ourselves consistent with the flag that
+   can disable this (see again the comment above
+   Lstream_set_character_mode()).
+ */
 
 static void
 set_coding_character_mode (Lstream *stream)
@@ -2145,6 +2148,15 @@
     Lstream_set_character_mode (stream_to_set);
   else
     Lstream_unset_character_mode (stream_to_set);
+  if (str->set_char_mode_on_us_when_reading &&
+      (stream->flags & LSTREAM_FL_READ))
+    {
+      if (encode_decode_source_sink_type_is_char
+	  (str->codesys, CODING_SINK, str->direction))
+	Lstream_set_character_mode (stream);
+      else
+	Lstream_unset_character_mode (stream);
+    }
 }
 
 static Lisp_Object
@@ -2319,17 +2331,37 @@
   str->convert_to = Dynarr_new (unsigned_char);
   str->convert_from = Dynarr_new (unsigned_char);
   str->direction = direction;
-  if (flags & CODE_FL_NO_CLOSE_OTHER)
+  if (flags & LSTREAM_FL_NO_CLOSE_OTHER)
     str->no_close_other = 1;
-  else if (flags & CODE_FL_READ_ONE_BYTE_AT_A_TIME)
+  if (flags & LSTREAM_FL_READ_ONE_BYTE_AT_A_TIME)
     str->one_byte_at_a_time = 1;
+  if (!(flags & LSTREAM_FL_NO_INIT_CHAR_MODE_WHEN_READING))
+    str->set_char_mode_on_us_when_reading = 1;
     
   set_coding_stream_coding_system (lstr, codesys);
   return wrap_lstream (lstr);
 }
 
-/* FLAGS -- #### document me.  If NO_CLOSE_OTHER is non-zero, don't close
-   STREAM (the stream at the other end) when this stream is closed. */
+/* FLAGS:
+
+   LSTREAM_FL_NO_CLOSE_OTHER
+     Don't close STREAM (the stream at the other end) when this stream is
+     closed.
+
+   LSTREAM_FL_READ_ONE_BYTE_AT_A_TIME
+     When reading from STREAM, read and process one byte at a time rather
+     than in large chunks.  This is for reading from TTY's, so we don't
+     block.  #### We should instead create a non-blocking filedesc stream
+     that emulates the behavior as necessary using select(), when the
+     fcntls don't work. (As seems to be the case on Cygwin.)
+
+  LSTREAM_FL_NO_INIT_CHAR_MODE_WHEN_READING
+     When reading from STREAM, read and process one byte at a time rather
+     than in large chunks.  This is for reading from TTY's, so we don't
+     block.  #### We should instead create a non-blocking filedesc stream
+     that emulates the behavior as necessary using select(), when the
+     fcntls don't work. (As seems to be the case on Cygwin.)
+*/
 Lisp_Object
 make_coding_input_stream (Lstream *stream, Lisp_Object codesys,
 			  enum encode_decode direction, int flags)
@@ -2338,8 +2370,12 @@
                                flags);
 }
 
-/* FLAGS -- #### document me.  If NO_CLOSE_OTHER is non-zero, don't close
-   STREAM (the stream at the other end) when this stream is closed. */
+/* FLAGS:
+
+   LSTREAM_FL_NO_CLOSE_OTHER
+     Don't close STREAM (the stream at the other end) when this stream is
+     closed.
+ */
 Lisp_Object
 make_coding_output_stream (Lstream *stream, Lisp_Object codesys,
 			  enum encode_decode direction, int flags)
@@ -4151,7 +4187,7 @@
   Lisp_Object binary_instream =
     make_coding_input_stream
       (XLSTREAM (stream), Qbinary,
-       CODING_ENCODE, CODE_FL_NO_CLOSE_OTHER);
+       CODING_ENCODE, LSTREAM_FL_NO_CLOSE_OTHER);
   Lisp_Object decstream =
     make_coding_input_stream 
       (XLSTREAM (binary_instream),
--- a/src/file-coding.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/file-coding.h	Sun Apr 14 12:43:31 2002 +0000
@@ -933,6 +933,10 @@
   /* If set, read only one byte at a time from other end to avoid any
      possible blocking. */
   unsigned int one_byte_at_a_time:1;
+  /* If set, and we're a read stream, we init char mode on ourselves as
+     necessary to prevent the caller from getting partial characters. (the
+     default) */
+  unsigned int set_char_mode_on_us_when_reading:1;
   
   /* #### Temporary test */
   unsigned int finalized:1;
@@ -1061,8 +1065,10 @@
 					 Lisp_Object description,
 					 Lisp_Object props);
 
-#define CODE_FL_NO_CLOSE_OTHER (1 << 0)
-#define CODE_FL_READ_ONE_BYTE_AT_A_TIME (1 << 1)
+#define LSTREAM_FL_NO_CLOSE_OTHER	(1 << 16)
+#define LSTREAM_FL_READ_ONE_BYTE_AT_A_TIME (1 << 17)
+#define LSTREAM_FL_NO_INIT_CHAR_MODE_WHEN_READING (1 << 18)
+
 Lisp_Object make_coding_input_stream (Lstream *stream, Lisp_Object codesys,
 				      enum encode_decode direction,
 				      int flags);
--- a/src/fileio.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/fileio.c	Sun Apr 14 12:43:31 2002 +0000
@@ -2893,7 +2893,8 @@
 		break;
 	      charbpos = 0;
 	      while (charbpos < nread && same_at_start < BUF_ZV (buf)
-		     && BUF_FETCH_CHAR (buf, same_at_start) == buffer[charbpos])
+		     && BUF_FETCH_CHAR (buf, same_at_start) ==
+		     buffer[charbpos])
 		same_at_start++, charbpos++;
 	      /* If we found a discrepancy, stop the scan.
 		 Otherwise loop around and scan the next bufferful.  */
@@ -2916,7 +2917,7 @@
 	  while (1)
 	    {
 	      int total_read, nread;
-	      Charbpos charbpos, curpos, trial;
+	      Charcount charbpos, curpos, trial;
 
 	      /* At what file position are we now scanning?  */
 	      curpos = st.st_size - (BUF_ZV (buf) - same_at_end);
@@ -3008,7 +3009,6 @@
     stream = make_coding_input_stream
       (XLSTREAM (stream), get_coding_system_for_text_file (codesys, 1),
        CODING_DECODE, 0);
-    Lstream_set_character_mode (XLSTREAM (stream));
     Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
 
     record_unwind_protect (delete_stream_unwind, stream);
--- a/src/fns.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/fns.c	Sun Apr 14 12:43:31 2002 +0000
@@ -2887,7 +2887,7 @@
 
       sledgehammer_check_ascii_begin (array);
       item_bytecount = set_charptr_emchar (item_buf, XCHAR (item));
-      new_bytecount = item_bytecount * XSTRING_CHAR_LENGTH (array);
+      new_bytecount = item_bytecount * (Bytecount) XSTRING_CHAR_LENGTH (array);
 
       resize_string (array, -1, new_bytecount - old_bytecount);
 
--- a/src/lisp.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/lisp.h	Sun Apr 14 12:43:31 2002 +0000
@@ -146,6 +146,7 @@
    buffer.h (where they rightfully belong) to avoid syntax errors
    in function prototypes. */
 
+#if !defined (__cplusplus) || !defined (CPLUSPLUS_INTEGRAL_CLASSES_NOT_YET)
 
 typedef EMACS_INT Charbpos;
 typedef EMACS_INT Bytebpos;
@@ -154,6 +155,460 @@
 /* Counts of bytes or chars */
 typedef EMACS_INT Bytecount;
 typedef EMACS_INT Charcount;
+
+/* Not yet used */
+typedef EMACS_INT Charxpos;
+typedef EMACS_INT Bytexpos;
+typedef EMACS_INT Memxpos;
+
+#else /* __cplusplus */
+
+/* Implement strong type-checking of the above integral types by declaring
+   them to be classes and using operator overloading.  Unfortunately this
+   is a huge pain in the ass because C++ doesn't strongly distinguish
+   "bool" and "size_t" from int.  The problem is especially bad with "bool"
+   -- if you want to be able to say 'if (len--)' where len is e.g. a
+   Bytecount, you need to declare a conversion operator to bool(); and
+   since bool is just an alias for int, you suddenly get tons and tons of
+   ambiguities, which need to be resolved by lots of laborious declarations
+   for every single possible type combination.  Hence the multitude of
+   declarations in DECLARE_INTCLASS_ARITH_COMPARE().  The bool/int
+   equivalence also means that we have to forcibly block the combinations
+   we don't want by creating overloaded versions of them and declaring them
+   private. */
+   
+#undef class
+#undef this
+
+class Bytecount;
+class Bytebpos;
+class Bytexpos;
+class Charcount;
+class Charbpos;
+class Charxpos;
+class Membpos;
+class Memxpos;
+
+/* Declare the arithmetic and comparison operations for an integral class,
+   i.e. one of the above classes.  If this is a "position" class, where the
+   difference between two positions is a different class (a "count" class),
+   then use POSCL for the position class and COUNTCL for the count class.
+   If this is a simple class, where all operations yield the same class,
+   substitute the same class for POSCL and COUNTCL. */
+
+#define DECLARE_INTCLASS_ARITH_COMPARE(poscl, countcl)			      \
+  poscl operator += (const countcl& l) { data += l.data; return *this; }      \
+  poscl operator -= (const countcl& l) { data -= l.data; return *this; }      \
+  poscl operator + (const countcl& l) const { return poscl (data + l.data); } \
+  poscl operator - (const countcl& l) const { return poscl (data - l.data); } \
+  poscl operator += (const int& l) { data += l; return *this; }		      \
+  poscl operator -= (const int& l) { data -= l; return *this; }		      \
+  poscl operator + (const int& l) const { return poscl (data + l); }	      \
+  poscl operator - (const int& l) const { return poscl (data - l); }	      \
+  poscl operator += (const unsigned int& l) { data += l; return *this; }      \
+  poscl operator -= (const unsigned int& l) { data -= l; return *this; }      \
+  poscl operator + (const unsigned int& l) const			      \
+    { return poscl (data + l); }					      \
+  poscl operator - (const unsigned int& l) const			      \
+    { return poscl (data - l); }					      \
+  poscl operator += (const long& l) { data += l; return *this; }	      \
+  poscl operator -= (const long& l) { data -= l; return *this; }	      \
+  poscl operator + (const long& l) const { return poscl (data + l); }	      \
+  poscl operator - (const long& l) const { return poscl (data - l); }	      \
+  poscl operator += (const unsigned long& l) { data += l; return *this; }     \
+  poscl operator -= (const unsigned long& l) { data -= l; return *this; }     \
+  poscl operator + (const unsigned long& l) const			      \
+    { return poscl (data + l); }					      \
+  poscl operator - (const unsigned long& l) const			      \
+    { return poscl (data - l); }					      \
+  poscl operator += (const short& l) { data += l; return *this; }	      \
+  poscl operator -= (const short& l) { data -= l; return *this; }	      \
+  poscl operator + (const short& l) const { return poscl (data + l); }	      \
+  poscl operator - (const short& l) const { return poscl (data - l); }	      \
+  poscl operator += (const unsigned short& l) { data += l; return *this; }    \
+  poscl operator -= (const unsigned short& l) { data -= l; return *this; }    \
+  poscl operator + (const unsigned short& l) const			      \
+    { return poscl (data + l); }					      \
+  poscl operator - (const unsigned short& l) const			      \
+    { return poscl (data - l); }					      \
+									      \
+  poscl operator *= (const countcl& l) { data *= l.data; return *this; }      \
+  poscl operator /= (const countcl& l) { data /= l.data; return *this; }      \
+  poscl operator * (const countcl& l) const { return poscl (data * l.data); } \
+  poscl operator / (const countcl& l) const { return poscl (data / l.data); } \
+  poscl operator *= (const int& l) { data *= l; return *this; }		      \
+  poscl operator /= (const int& l) { data /= l; return *this; }		      \
+  poscl operator * (const int& l) const { return poscl (data * l); }	      \
+  poscl operator / (const int& l) const { return poscl (data / l); }	      \
+  poscl operator *= (const unsigned int& l) { data *= l; return *this; }      \
+  poscl operator /= (const unsigned int& l) { data /= l; return *this; }      \
+  poscl operator * (const unsigned int& l) const { return poscl (data * l); } \
+  poscl operator / (const unsigned int& l) const { return poscl (data / l); } \
+  poscl operator *= (const long& l) { data *= l; return *this; }	      \
+  poscl operator /= (const long& l) { data /= l; return *this; }	      \
+  poscl operator * (const long& l) const { return poscl (data * l); }	      \
+  poscl operator / (const long& l) const { return poscl (data / l); }	      \
+  poscl operator *= (const unsigned long& l) { data *= l; return *this; }     \
+  poscl operator /= (const unsigned long& l) { data /= l; return *this; }     \
+  poscl operator * (const unsigned long& l) const			      \
+    { return poscl (data * l); }					      \
+  poscl operator / (const unsigned long& l) const			      \
+    { return poscl (data / l); }					      \
+  poscl operator *= (const short& l) { data *= l; return *this; }	      \
+  poscl operator /= (const short& l) { data /= l; return *this; }	      \
+  poscl operator * (const short& l) const { return poscl (data * l); }	      \
+  poscl operator / (const short& l) const { return poscl (data / l); }	      \
+  poscl operator *= (const unsigned short& l) { data *= l; return *this; }    \
+  poscl operator /= (const unsigned short& l) { data /= l; return *this; }    \
+  poscl operator * (const unsigned short& l) const			      \
+    { return poscl (data * l); }					      \
+  poscl operator / (const unsigned short& l) const			      \
+    { return poscl (data / l); }					      \
+									      \
+  poscl operator &= (const countcl& l) { data &= l.data; return *this; }      \
+  poscl operator |= (const countcl& l) { data |= l.data; return *this; }      \
+  poscl operator & (const countcl& l) const { return poscl (data & l.data); } \
+  poscl operator | (const countcl& l) const { return poscl (data | l.data); } \
+  poscl operator &= (const int& l) { data &= l; return *this; }		      \
+  poscl operator |= (const int& l) { data |= l; return *this; }		      \
+  poscl operator & (const int& l) const { return poscl (data & l); }	      \
+  poscl operator | (const int& l) const { return poscl (data | l); }	      \
+  poscl operator &= (const unsigned int& l) { data &= l; return *this; }      \
+  poscl operator |= (const unsigned int& l) { data |= l; return *this; }      \
+  poscl operator & (const unsigned int& l) const { return poscl (data & l); } \
+  poscl operator | (const unsigned int& l) const { return poscl (data | l); } \
+  poscl operator &= (const long& l) { data &= l; return *this; }	      \
+  poscl operator |= (const long& l) { data |= l; return *this; }	      \
+  poscl operator & (const long& l) const { return poscl (data & l); }	      \
+  poscl operator | (const long& l) const { return poscl (data | l); }	      \
+  poscl operator &= (const unsigned long& l) { data &= l; return *this; }     \
+  poscl operator |= (const unsigned long& l) { data |= l; return *this; }     \
+  poscl operator & (const unsigned long& l) const			      \
+    { return poscl (data & l); }					      \
+  poscl operator | (const unsigned long& l) const			      \
+    { return poscl (data | l); }					      \
+  poscl operator &= (const short& l) { data &= l; return *this; }	      \
+  poscl operator |= (const short& l) { data |= l; return *this; }	      \
+  poscl operator & (const short& l) const { return poscl (data & l); }	      \
+  poscl operator | (const short& l) const { return poscl (data | l); }	      \
+  poscl operator &= (const unsigned short& l) { data &= l; return *this; }    \
+  poscl operator |= (const unsigned short& l) { data |= l; return *this; }    \
+  poscl operator & (const unsigned short& l) const			      \
+    { return poscl (data & l); }					      \
+  poscl operator | (const unsigned short& l) const			      \
+    { return poscl (data | l); }					      \
+									      \
+  poscl operator - ()           { return poscl (-data); }		      \
+  poscl operator-- ()           { data--; return *this; }		      \
+  poscl operator-- (int)	     { data--; return poscl (data + 1); }     \
+  poscl operator++ ()           { data++; return *this; }		      \
+  poscl operator++ (int)        { data++; return poscl (data - 1); }	      \
+									      \
+  bool operator < (const poscl& l) const { return data < l.data; }	      \
+  bool operator <= (const poscl& l) const { return data <= l.data; }	      \
+  bool operator > (const poscl& l) const { return data > l.data; }	      \
+  bool operator >= (const poscl& l) const { return data >= l.data; }	      \
+  bool operator == (const poscl& l) const { return data == l.data; }	      \
+  bool operator != (const poscl& l) const { return data != l.data; }	      \
+  bool operator < (const int& l) const { return data < (EMACS_INT) l; }	      \
+  bool operator <= (const int& l) const { return data <= (EMACS_INT) l; }     \
+  bool operator > (const int& l) const { return data > (EMACS_INT) l; }	      \
+  bool operator >= (const int& l) const { return data >= (EMACS_INT) l; }     \
+  bool operator == (const int& l) const { return data == (EMACS_INT) l; }     \
+  bool operator != (const int& l) const { return data != (EMACS_INT) l; }     \
+  bool operator < (const unsigned int& l) const				      \
+    { return data < (EMACS_INT) l; }					      \
+  bool operator <= (const unsigned int& l) const			      \
+    { return data <= (EMACS_INT) l; }					      \
+  bool operator > (const unsigned int& l) const				      \
+    { return data > (EMACS_INT) l; }					      \
+  bool operator >= (const unsigned int& l) const			      \
+    { return data >= (EMACS_INT) l; }					      \
+  bool operator == (const unsigned int& l) const			      \
+    { return data == (EMACS_INT) l; }					      \
+  bool operator != (const unsigned int& l) const			      \
+    { return data != (EMACS_INT) l; }					      \
+  bool operator < (const long& l) const { return data < (EMACS_INT) l; }      \
+  bool operator <= (const long& l) const { return data <= (EMACS_INT) l; }    \
+  bool operator > (const long& l) const { return data > (EMACS_INT) l; }      \
+  bool operator >= (const long& l) const { return data >= (EMACS_INT) l; }    \
+  bool operator == (const long& l) const { return data == (EMACS_INT) l; }    \
+  bool operator != (const long& l) const { return data != (EMACS_INT) l; }    \
+  bool operator < (const unsigned long& l) const			      \
+    { return data < (EMACS_INT) l; }					      \
+  bool operator <= (const unsigned long& l) const			      \
+    { return data <= (EMACS_INT) l; }					      \
+  bool operator > (const unsigned long& l) const			      \
+    { return data > (EMACS_INT) l; }					      \
+  bool operator >= (const unsigned long& l) const			      \
+    { return data >= (EMACS_INT) l; }					      \
+  bool operator == (const unsigned long& l) const			      \
+    { return data == (EMACS_INT) l; }					      \
+  bool operator != (const unsigned long& l) const			      \
+    { return data != (EMACS_INT) l; }					      \
+  bool operator < (const short& l) const { return data < (EMACS_INT) l; }     \
+  bool operator <= (const short& l) const { return data <= (EMACS_INT) l; }   \
+  bool operator > (const short& l) const { return data > (EMACS_INT) l; }     \
+  bool operator >= (const short& l) const { return data >= (EMACS_INT) l; }   \
+  bool operator == (const short& l) const { return data == (EMACS_INT) l; }   \
+  bool operator != (const short& l) const { return data != (EMACS_INT) l; }   \
+  bool operator < (const unsigned short& l) const			      \
+    { return data < (EMACS_INT) l; }					      \
+  bool operator <= (const unsigned short& l) const			      \
+    { return data <= (EMACS_INT) l; }					      \
+  bool operator > (const unsigned short& l) const			      \
+    { return data > (EMACS_INT) l; }					      \
+  bool operator >= (const unsigned short& l) const			      \
+    { return data >= (EMACS_INT) l; }					      \
+  bool operator == (const unsigned short& l) const			      \
+    { return data == (EMACS_INT) l; }					      \
+  bool operator != (const unsigned short& l) const			      \
+    { return data != (EMACS_INT) l; }					      \
+  bool operator ! () const { return !data; }
+
+/* Declare the "bad" or disallowed arithmetic and comparion operations
+   between class GOOD and class BAD.  Meant to go inside the private
+   section of class GOOD. */
+
+#define DECLARE_BAD_INTCLASS_ARITH_COMPARE(good, bad)	\
+  good operator += (const bad& l) { return badret; }	\
+  good operator -= (const bad& l) { return badret; }	\
+  good operator *= (const bad& l) { return badret; }	\
+  good operator /= (const bad& l) { return badret; }	\
+  good operator + (const bad& l) { return badret; }	\
+  good operator - (const bad& l) { return badret; }	\
+  good operator * (const bad& l) { return badret; }	\
+  good operator / (const bad& l) { return badret; }	\
+							\
+  bool operator < (const bad& l)  { return 0; }		\
+  bool operator <= (const bad& l) { return 0; }		\
+  bool operator > (const bad& l)  { return 0; }		\
+  bool operator >= (const bad& l) { return 0; }		\
+  bool operator == (const bad& l) { return 0; }		\
+  bool operator != (const bad& l) { return 0; }
+
+/* Declare the "bad" or disallowed arithmetic operations between class GOOD
+   and another of the same class, for a position class.  Meant to go inside
+   the private section of class GOOD. */
+
+#define DECLARE_BAD_POS_CLASS_ARITH(good)		\
+  good operator += (const good& l) { return badret; }	\
+  good operator -= (const good& l) { return badret; }	\
+  good operator *= (const good& l) { return badret; }	\
+  good operator /= (const good& l) { return badret; }	\
+  good operator + (const good& l) { return badret; }	\
+  good operator * (const good& l) { return badret; }	\
+  good operator / (const good& l) { return badret; }
+
+/* Basic declaration at the top of all integral classes.  Don't call
+   directly, use one of the more specific versions below. */
+
+#define DECLARE_INTCLASS(cl)			\
+ public:					\
+  EMACS_INT data;				\
+  cl () { data = 0xCDCDCDCD; }			\
+  cl (int i) { data = i; }			\
+  cl (unsigned int i) { data = i; }		\
+  cl (long i) { data = i; }			\
+  cl (unsigned long i) { data = i; }		\
+  cl (short i) { data = i; }			\
+  cl (unsigned short i) { data = i; }		\
+  operator EMACS_INT ()  const { return data; }
+
+/* Basic declaration at the top of all count classes. */
+
+#define DECLARE_COUNT_CLASS(cl)				\
+  DECLARE_INTCLASS (cl)					\
+  DECLARE_INTCLASS_ARITH_COMPARE (cl, cl)		\
+ private:						\
+  static cl badret;
+
+/* Basic declaration at the bottom of the prelude of all position classes.
+   Don't call directly. */
+
+#define DECLARE_POS_CLASS_SECOND_HALF(cl, countcl)			     \
+  DECLARE_INTCLASS_ARITH_COMPARE (cl, countcl)				     \
+  countcl operator - (const cl& l) const { return countcl (data - l.data); } \
+ private:								     \
+  static cl badret;							     \
+  DECLARE_BAD_POS_INTCLASS_ARITH (cl)
+
+/* Basic declaration at the top of all buffer position classes. */
+
+#define DECLARE_BPOS_CLASS(cl, countcl)		\
+  DECLARE_INTCLASS (cl)				\
+  DECLARE_POS_CLASS_SECOND_HALF (cl, countcl)
+
+/* Basic declaration at the top of all X-position classes (that can refer
+   to buffers or strings).  CL1 and CL2 are the equivalent more specific
+   classes referring only to buffers or strings, respefitvely. */
+
+#define DECLARE_XPOS_CLASS(cl, countcl, cl1, cl2)	\
+  DECLARE_INTCLASS (cl)					\
+  cl (const cl1& x) { data = x.data; }			\
+  cl (const cl2& x) { data = x.data; }			\
+  operator cl1 () const { return cl1 (data); }		\
+  operator cl2 () const { return cl2 (data); }		\
+  DECLARE_POS_CLASS_SECOND_HALF (cl, countcl)
+
+/* Declare the "bad" or disallowed arithmetic and comparion operations
+   between class CHARCL (a character class) and various non-character
+   classes.  Meant to go inside the private section of class GOOD. */
+
+#define DECLARE_BAD_CHAR_INTCLASS_ARITH_COMPARE(charcl)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Bytecount)	\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Bytebpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Bytexpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Membpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Memxpos)
+
+/* Declare the "bad" or disallowed arithmetic and comparion operations
+   between class BYTECL (a byte class) and various non-byte classes.
+   Meant to go inside the private section of class GOOD. */
+
+#define DECLARE_BAD_BYTE_INTCLASS_ARITH_COMPARE(bytecl)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charcount)	\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charbpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charxpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Membpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Memxpos)
+
+/* Declare the "bad" or disallowed arithmetic and comparion operations
+   between class BYTECL (a mem class) and various non-mem classes.
+   Meant to go inside the private section of class GOOD. */
+
+#define DECLARE_BAD_MEM_INTCLASS_ARITH_COMPARE(bytecl)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charcount)	\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charbpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charxpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Bytebpos)		\
+  DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Bytexpos)
+
+class Charcount
+{
+  DECLARE_COUNT_CLASS (Charcount)
+  DECLARE_BAD_CHAR_INTCLASS_ARITH_COMPARE (Charcount)
+};
+
+class Charbpos
+{
+  DECLARE_BPOS_CLASS (Charbpos, Charcount)
+  DECLARE_BAD_CHAR_INTCLASS_ARITH_COMPARE (Charbpos)
+};
+
+class Charxpos
+{
+  DECLARE_XPOS_CLASS (Charxpos, Charcount, Charbpos, Charcount)
+  DECLARE_BAD_CHAR_INTCLASS_ARITH_COMPARE (Charxpos)
+};
+
+class Bytecount
+{
+  DECLARE_COUNT_CLASS (Bytecount)
+  DECLARE_BAD_BYTE_INTCLASS_ARITH_COMPARE (Bytecount)
+};
+
+class Bytebpos
+{
+  DECLARE_BPOS_CLASS (Bytebpos, Bytecount)
+  DECLARE_BAD_BYTE_INTCLASS_ARITH_COMPARE (Bytebpos)
+};
+
+class Bytexpos
+{
+  DECLARE_XPOS_CLASS (Bytexpos, Bytecount, Bytebpos, Bytecount)
+  DECLARE_BAD_BYTE_INTCLASS_ARITH_COMPARE (Bytexpos)
+};
+
+class Membpos
+{
+  DECLARE_BPOS_CLASS (Membpos, Bytecount)
+  DECLARE_BAD_MEM_INTCLASS_ARITH_COMPARE (Membpos)
+};
+
+class Memxpos
+{
+  DECLARE_XPOS_CLASS (Memxpos, Bytecount, Membpos, Bytecount)
+  DECLARE_BAD_MEM_INTCLASS_ARITH_COMPARE (Memxpos)
+};
+
+#define DECLARE_POINTER_TYPE_ARITH_COUNT(pointer, countcl)	\
+inline pointer operator += (pointer & x, const countcl& y)	\
+{ x += y.data; return x; }					\
+inline pointer operator -= (pointer & x, const countcl& y)	\
+{ x -= y.data; return x; }					\
+inline pointer operator + (pointer x, const countcl& y)		\
+{ return x + y.data; }						\
+inline pointer operator - (pointer x, const countcl& y)		\
+{ return x - y.data; }
+
+#define DECLARE_INTEGRAL_TYPE_ARITH_COUNT(integral, countcl)	\
+inline integral operator += (integral & x, const countcl& y)	\
+{ x += y.data; return x; }					\
+inline integral operator -= (integral & x, const countcl& y)	\
+{ x -= y.data; return x; }					\
+inline countcl operator + (integral x, const countcl& y)	\
+{ return countcl (x + y.data); }				\
+inline countcl operator - (integral x, const countcl& y)	\
+{ return countcl (x - y.data); }
+
+#define DECLARE_INTEGRAL_TYPE_COMPARE(integral, cl)	\
+inline bool operator < (integral x, const cl& y)	\
+  { return (EMACS_INT) x < y.data; }			\
+inline bool operator <= (integral x, const cl& y)	\
+  { return (EMACS_INT) x <= y.data; }			\
+inline bool operator > (integral x, const cl& y)	\
+  { return (EMACS_INT) x > y.data; }			\
+inline bool operator >= (integral x, const cl& y)	\
+  { return (EMACS_INT) x >= y.data; }			\
+inline bool operator == (integral x, const cl& y)	\
+  { return (EMACS_INT) x == y.data; }			\
+inline bool operator != (integral x, const cl& y)	\
+  { return (EMACS_INT) x != y.data; }
+
+#if 0
+/* Unfortunately C++ doesn't let you overload the ?: operator, so we have
+   to manually deal with ambiguities using casting */
+#define DECLARE_INTEGRAL_TYPE_TRISTATE(integral, cl)	\
+inline cl operator ?: (bool b, integral x, const cl& y)	\
+  { return b ? cl (x) : y; }				\
+inline cl operator ?: (bool b, const cl& x, integral y)	\
+  { return b ? x : cl (y); }
+#endif /* 0 */
+
+DECLARE_POINTER_TYPE_ARITH_COUNT (const Intbyte *, Bytecount);
+DECLARE_POINTER_TYPE_ARITH_COUNT (const Extbyte *, Bytecount);
+DECLARE_POINTER_TYPE_ARITH_COUNT (Intbyte *, Bytecount);
+DECLARE_POINTER_TYPE_ARITH_COUNT (Extbyte *, Bytecount);
+
+DECLARE_INTEGRAL_TYPE_ARITH_COUNT (int, Bytecount);
+DECLARE_INTEGRAL_TYPE_ARITH_COUNT (int, Charcount);
+DECLARE_INTEGRAL_TYPE_ARITH_COUNT (unsigned int, Bytecount);
+DECLARE_INTEGRAL_TYPE_ARITH_COUNT (unsigned int, Charcount);
+DECLARE_INTEGRAL_TYPE_ARITH_COUNT (long, Bytecount);
+DECLARE_INTEGRAL_TYPE_ARITH_COUNT (long, Charcount);
+DECLARE_INTEGRAL_TYPE_ARITH_COUNT (unsigned long, Bytecount);
+DECLARE_INTEGRAL_TYPE_ARITH_COUNT (unsigned long, Charcount);
+
+DECLARE_INTEGRAL_TYPE_COMPARE (int, Bytecount);
+DECLARE_INTEGRAL_TYPE_COMPARE (int, Charcount);
+DECLARE_INTEGRAL_TYPE_COMPARE (unsigned int, Bytecount);
+DECLARE_INTEGRAL_TYPE_COMPARE (unsigned int, Charcount);
+DECLARE_INTEGRAL_TYPE_COMPARE (long, Bytecount);
+DECLARE_INTEGRAL_TYPE_COMPARE (long, Charcount);
+DECLARE_INTEGRAL_TYPE_COMPARE (unsigned long, Bytecount);
+DECLARE_INTEGRAL_TYPE_COMPARE (unsigned long, Charcount);
+
+#if 0 /* doesn't work */
+inline Bytecount operator - (const Intbyte *x, const Intbyte *y)	\
+  { return Bytecount (x - y); }
+#endif
+
+#define class c_class
+#define this c_this
+
+#endif /* __cplusplus */
+
 /* Counts of elements */
 typedef EMACS_INT Elemcount;
 /* Hash codes */
@@ -1453,7 +1908,7 @@
 {
   Charcount retval;
   if (idx <= (Bytecount) XSTRING_ASCII_BEGIN (s))
-    retval = idx;
+    retval = (Charcount) idx;
   else
     retval = (XSTRING_ASCII_BEGIN (s) +
 	      bytecount_to_charcount (XSTRING_DATA (s) +
@@ -1473,7 +1928,7 @@
 {
   Bytecount retval;
   if (idx <= (Charcount) XSTRING_ASCII_BEGIN (s))
-    retval = idx;
+    retval = (Bytecount) idx;
   else
     retval = (XSTRING_ASCII_BEGIN (s) +
 	      charcount_to_bytecount (XSTRING_DATA (s) +
@@ -1494,10 +1949,10 @@
 {
   Charcount retval;
   if (off + len <= (Bytecount) XSTRING_ASCII_BEGIN (s))
-    retval = len;
+    retval = (Charcount) len;
   else if (off < (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval =
-      XSTRING_ASCII_BEGIN (s) - off +
+      XSTRING_ASCII_BEGIN (s) - (Charcount) off +
 	bytecount_to_charcount (XSTRING_DATA (s) + XSTRING_ASCII_BEGIN (s),
 				len - (XSTRING_ASCII_BEGIN (s) - off));
   else
@@ -1516,13 +1971,16 @@
 )
 {
   Bytecount retval;
-  if (off + len <= (Bytecount) XSTRING_ASCII_BEGIN (s))
-    retval = len;
+  /* casts to avoid errors from combining Bytecount/Charcount and warnings
+     from signed/unsigned comparisons */
+  if (off + (Bytecount) len <= (Bytecount) XSTRING_ASCII_BEGIN (s))
+    retval = (Bytecount) len;
   else if (off < (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval =
       XSTRING_ASCII_BEGIN (s) - off +
 	charcount_to_bytecount (XSTRING_DATA (s) + XSTRING_ASCII_BEGIN (s),
-				len - (XSTRING_ASCII_BEGIN (s) - off));
+				len - (XSTRING_ASCII_BEGIN (s) -
+				       (Charcount) off));
   else
     retval = charcount_to_bytecount (XSTRING_DATA (s) + off, len);
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
@@ -1532,7 +1990,7 @@
 }
 
 DECLARE_INLINE_HEADER (
-Intbyte *
+const Intbyte *
 string_char_addr (Lisp_Object s, Charcount idx)
 )
 {
@@ -2699,7 +3157,7 @@
 int object_dead_p (Lisp_Object);
 void mark_object (Lisp_Object obj);
 int marked_p (Lisp_Object obj);
-int need_to_garbage_collect (void);
+extern int need_to_garbage_collect;
 
 #ifdef MEMORY_USAGE_STATS
 Bytecount malloced_storage_size (void *, Bytecount, struct overhead_stats *);
@@ -2811,7 +3269,10 @@
 Lisp_Object wasteful_word_to_lisp (unsigned int);
 
 /* Defined in doc.c */
-Lisp_Object unparesseuxify_doc_string (int, EMACS_INT, Intbyte *, Lisp_Object);
+Lisp_Object unparesseuxify_doc_string (int fd, EMACS_INT position,
+				       Intbyte *name_nonreloc,
+				       Lisp_Object name_reloc,
+				       int standard_doc_file);
 Lisp_Object read_doc_string (Lisp_Object);
 
 /* Defined in doprnt.c */
@@ -3397,6 +3858,7 @@
 /* Defined in process.c */
 DECLARE_DOESNT_RETURN (report_process_error (const char *, Lisp_Object));
 DECLARE_DOESNT_RETURN (report_network_error (const char *, Lisp_Object));
+extern Lisp_Object Vlisp_EXEC_SUFFIXES;
 
 /* Defined in profile.c */
 void mark_profiling_info (void);
@@ -3451,6 +3913,7 @@
 unsigned int hash_string (const Intbyte *, Bytecount);
 Lisp_Object intern_int (const Intbyte *str);
 Lisp_Object intern (const CIntbyte *str);
+Lisp_Object intern_converting_underscores_to_dashes (const CIntbyte *str);
 Lisp_Object oblookup (Lisp_Object, const Intbyte *, Bytecount);
 void map_obarray (Lisp_Object, int (*) (Lisp_Object, void *), void *);
 Lisp_Object indirect_function (Lisp_Object, int);
@@ -3810,7 +4273,11 @@
 void record_change (struct buffer *, Charbpos, Charcount);
 
 /* Defined in unex*.c */
-int unexec (char *, char *, uintptr_t, uintptr_t, uintptr_t);
+#ifdef WIN32_NATIVE
+int unexec (Intbyte *, Intbyte *, uintptr_t, uintptr_t, uintptr_t);
+#else
+int unexec (Extbyte *, Extbyte *, uintptr_t, uintptr_t, uintptr_t);
+#endif
 #ifdef RUN_TIME_REMAP
 int run_time_remap (char *);
 #endif
@@ -4109,15 +4576,16 @@
 
 */
 
-extern Lisp_Object Qactivate_menubar_hook, Qarith_error, Qarrayp, Qautoload;
-extern Lisp_Object Qbackground, Qbackground_pixmap, Qbeginning_of_buffer;
-extern Lisp_Object Qbitp, Qblinking, Qbuffer_glyph_p, Qbuffer_live_p;
-extern Lisp_Object Qbuffer_read_only, Qbyte_code, Qcall_interactively;
-extern Lisp_Object Qcategory_designator_p, Qcategory_table_value_p, Qcdr;
-extern Lisp_Object Qchar_or_string_p, Qcharacterp, Qcircular_list;
-extern Lisp_Object Qcircular_property_list, Qcolor_pixmap_image_instance_p;
-extern Lisp_Object Qcommandp, Qcompletion_ignore_case, Qconsole_live_p;
-extern Lisp_Object Qconst_specifier, Qconversion_error, Qcurrent_menubar;
+extern Lisp_Object Qactivate_menubar_hook, Qand_optional, Qand_rest;
+extern Lisp_Object Qarith_error, Qarrayp, Qautoload, Qbackground;
+extern Lisp_Object Qbackground_pixmap, Qbeginning_of_buffer, Qbitp, Qblinking;
+extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only;
+extern Lisp_Object Qbyte_code, Qcall_interactively, Qcategory_designator_p;
+extern Lisp_Object Qcategory_table_value_p, Qcdr, Qchar_or_string_p;
+extern Lisp_Object Qcharacterp, Qcircular_list, Qcircular_property_list;
+extern Lisp_Object Qcolor_pixmap_image_instance_p, Qcommandp;
+extern Lisp_Object Qcompletion_ignore_case, Qconsole_live_p, Qconst_specifier;
+extern Lisp_Object Qconversion_error, Qcurrent_menubar;
 extern Lisp_Object Qcyclic_variable_indirection, Qdefun, Qdevice_live_p, Qdim;
 extern Lisp_Object Qdirection, Qdisabled, Qdisabled_command_hook;
 extern Lisp_Object Qdisplay_table, Qdomain_error, Qediting_error;
--- a/src/lread.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/lread.c	Sun Apr 14 12:43:31 2002 +0000
@@ -150,11 +150,6 @@
 /* An array describing all known built-in structure types */
 static structure_type_dynarr *the_structure_type_dynarr;
 
-#if 0 /* FSF defun hack */
-/* When nonzero, read conses in pure space */
-static int read_pure;
-#endif
-
 #if 0 /* FSF stuff */
 /* For use within read-from-string (this reader is non-reentrant!!)  */
 static int read_from_string_index;
@@ -192,7 +187,7 @@
    the containing objects that have (#$ . INT) conses in them (this
    will only be compiled-function objects and lists), and when the
    file is finished loading, we go through and fill in all the
-   doc strings at once. */
+   doc strings at once. --ben */
 
  /* This contains the last string skipped with #@.  */
 static char *saved_doc_string;
@@ -317,21 +312,6 @@
 
 static Lisp_Object read0 (Lisp_Object readcharfun);
 static Lisp_Object read1 (Lisp_Object readcharfun);
-/* allow_dotted_lists means that something like (foo bar . baz)
-   is acceptable.  If -1, means check for starting with defun
-   and make structure pure. (not implemented, probably for very
-   good reasons)
-*/
-/*
-   If check_for_doc_references, look for (#$ . INT) doc references
-   in the list and record if load_force_doc_strings is non-zero.
-   (Such doc references will be destroyed during the loadup phase
-   by replacing with Qzero, because Snarf-documentation will fill
-   them in again.)
-
-   WARNING: If you set this, you sure as hell better not call
-   free_list() on the returned list here. */
-
 static Lisp_Object read_list (Lisp_Object readcharfun,
                               Emchar terminator,
                               int allow_dotted_lists,
@@ -426,7 +406,7 @@
   pos = XINT (XCDR (victim));
   if (pos < 0)
     pos = -pos; /* kludge to mark a user variable */
-  tem = unparesseuxify_doc_string (fd, pos, 0, Vload_file_name_internal);
+  tem = unparesseuxify_doc_string (fd, pos, 0, Vload_file_name_internal, 0);
   if (!STRINGP (tem))
     signal_error_1 (Qinvalid_byte_code, tem);
   return tem;
@@ -462,7 +442,8 @@
 	    {
 	      struct gcpro ngcpro1;
 	      Lisp_Object juan = (pas_de_holgazan_ici
-				  (fd, XCOMPILED_FUNCTION (john)->instructions));
+				  (fd,
+				   XCOMPILED_FUNCTION (john)->instructions));
 	      Lisp_Object ivan;
 
 	      NGCPRO1 (juan);
@@ -1367,15 +1348,6 @@
 #endif /* !LOADHIST */
 
 
-#if 0 /* FSFmacs defun hack */
-Lisp_Object
-unreadpure (void)	/* Used as unwind-protect function in readevalloop */
-{
-  read_pure = 0;
-  return Qnil;
-}
-#endif /* 0 */
-
 static void
 readevalloop (Lisp_Object readcharfun,
               Lisp_Object sourcename,
@@ -1429,25 +1401,12 @@
       if (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r')
         continue;
 
-#if 0 /* FSFmacs defun hack */
-      if (purify_flag && c == '(')
-	{
-	  int count1 = specpdl_depth ();
-	  record_unwind_protect (unreadpure, Qnil);
-	  val = read_list (readcharfun, ')', -1, 1);
-	  unbind_to (count1);
-	}
+      unreadchar (readcharfun, c);
+      Vread_objects = Qnil;
+      if (NILP (Vload_read_function))
+	val = read0 (readcharfun);
       else
-#else /* No "defun hack" -- Emacs 19 uses read-time syntax for bytecodes */
-	{
-	  unreadchar (readcharfun, c);
-	  Vread_objects = Qnil;
-	  if (NILP (Vload_read_function))
-	    val = read0 (readcharfun);
-	  else
-	    val = call1 (Vload_read_function, readcharfun);
-	}
-#endif
+	val = call1 (Vload_read_function, readcharfun);
       val = (*evalfun) (val);
       if (printflag)
 	{
@@ -2845,14 +2804,6 @@
 	}
     }
 
-#if 0 /* FSFmacs defun hack, or something ... */
-  if (NILP (tail) && defun_hack && EQ (elt, Qdefun) && !read_pure)
-    {
-      record_unwind_protect (unreadpure, Qzero);
-      read_pure = 1;
-    }
-#endif
-
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
   if (s->length == 1 && s->allow_dotted_lists && EQ (XCAR (s->head), Qfset))
     {
@@ -2875,10 +2826,20 @@
 }
 
 
-#if 0 /* FSFmacs defun hack */
-/* -1 for allow_dotted_lists means allow_dotted_lists and check
-   for starting with defun and make structure pure. */
-#endif
+/* allow_dotted_lists means that something like (foo bar . baz)
+   is acceptable.  If -1, means check for starting with defun
+   and make structure pure. (not implemented, probably for very
+   good reasons)
+
+   If check_for_doc_references, look for (#$ . INT) doc references
+   in the list and record if load_force_doc_strings is non-zero.
+   (Such doc references will be destroyed during the loadup phase
+   by replacing with Qzero, because Snarf-documentation will fill
+   them in again.)
+
+   WARNING: If you set this, you sure as hell better not call
+   free_list() on the returned list here.
+   */
 
 static Lisp_Object
 read_list (Lisp_Object readcharfun,
@@ -2997,12 +2958,7 @@
   tem = s.head;
   len = XINT (Flength (tem));
 
-#if 0 /* FSFmacs defun hack */
-  if (read_pure)
-    s.head = make_pure_vector (len, Qnil);
-  else
-#endif
-    s.head = make_vector (len, Qnil);
+  s.head = make_vector (len, Qnil);
 
   for (i = 0, p = &(XVECTOR_DATA (s.head)[0]);
        i < len;
--- a/src/lrecord.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/lrecord.h	Sun Apr 14 12:43:31 2002 +0000
@@ -336,17 +336,25 @@
    structures, whenever the structure size is given, rather than being
    defaulted by specifying 0 for the size.)
 
-   A struct_description is used for describing nested "structures".
-   (Again a misnomer, since it can be used for any blocks of memory,
-   not just structures.) It just contains a size for the memory block,
-   a pointer to an lrecord_description, and (for unions only) a union
-   constant, described below.  The size can be 0 (#### not yet
-   implemented!), in which case the size will be determined from the
-   largest offset logically referenced (i.e. last offset mentioned +
-   size of that object).  This is useful for stretchy arrays.
+   A struct_description is used for describing nested "structures".  (Again
+   a misnomer, since it can be used for any blocks of memory, not just
+   structures.) It just contains a size for the memory block, a pointer to
+   an lrecord_description, and (for unions only) a union constant,
+   described below.  The size can be 0, in which case the size will be
+   determined from the largest offset logically referenced (i.e. last
+   offset mentioned + size of that object).  This is useful for stretchy
+   arrays.
 
    Some example descriptions :
 
+   struct Lisp_String
+   {
+     struct lrecord_header lheader;
+     Bytecount size;
+     Intbyte *data;
+     Lisp_Object plist;
+   };
+
    static const struct lrecord_description cons_description[] = {
      { XD_LISP_OBJECT, offsetof (Lisp_Cons, car) },
      { XD_LISP_OBJECT, offsetof (Lisp_Cons, cdr) },
@@ -355,16 +363,100 @@
 
    Which means "two lisp objects starting at the 'car' and 'cdr' elements"
 
-  static const struct lrecord_description string_description[] = {
-    { XD_BYTECOUNT,       offsetof (Lisp_String, size) },
-    { XD_OPAQUE_DATA_PTR, offsetof (Lisp_String, data), XD_INDIRECT(0, 1) },
-    { XD_LISP_OBJECT,     offsetof (Lisp_String, plist) },
-    { XD_END }
-  };
-  "A pointer to string data at 'data', the size of the pointed array being the value
-   of the size variable plus 1, and one lisp object at 'plist'"
+   static const struct lrecord_description string_description[] = {
+     { XD_BYTECOUNT,       offsetof (Lisp_String, size) },
+     { XD_OPAQUE_DATA_PTR, offsetof (Lisp_String, data), XD_INDIRECT(0, 1) },
+     { XD_LISP_OBJECT,     offsetof (Lisp_String, plist) },
+     { XD_END }
+   };
+
+   "A pointer to string data at 'data', the size of the pointed array being
+   the value of the size variable plus 1, and one lisp object at 'plist'"
+
+   If your object has a pointer to an array of Lisp_Objects in it, something
+   like this:
+
+   struct Lisp_Foo
+   {
+     ...;
+     int count;
+     Lisp_Object *objects;
+     ...;
+   }
+
+   You'd use XD_STRUCT_PTR, something like:
+
+   static const struct lrecord_description lo_description_1[] = {
+     { XD_LISP_OBJECT, 0 },
+     { XD_END }
+   };
+
+   static const struct struct_description lo_description = {
+     sizeof (Lisp_Object),
+     lo_description_1
+   };
+
+   static const struct lrecord_description foo_description[] = {
+     ...
+     { XD_INT,		offsetof (Lisp_Foo, count) },
+     { XD_STRUCT_PTR,	offsetof (Lisp_Foo, objects),
+       XD_INDIRECT (0, 0), &lo_description },
+     ...
+   };
+
+
+   Another example of XD_STRUCT_PTR:
 
-  The existing types :
+   typedef struct hentry
+   {
+     Lisp_Object key;
+     Lisp_Object value;
+   } hentry;
+   
+   struct Lisp_Hash_Table
+   {
+     struct lcrecord_header header;
+     Elemcount size;
+     Elemcount count;
+     Elemcount rehash_count;
+     double rehash_size;
+     double rehash_threshold;
+     Elemcount golden_ratio;
+     hash_table_hash_function_t hash_function;
+     hash_table_test_function_t test_function;
+     hentry *hentries;
+     enum hash_table_weakness weakness;
+     Lisp_Object next_weak;     // Used to chain together all of the weak
+   			        // hash tables.  Don't mark through this.
+   };
+
+   static const struct lrecord_description hentry_description_1[] = {
+     { XD_LISP_OBJECT, offsetof (hentry, key) },
+     { XD_LISP_OBJECT, offsetof (hentry, value) },
+     { XD_END }
+   };
+   
+   static const struct struct_description hentry_description = {
+     sizeof (hentry),
+     hentry_description_1
+   };
+   
+   const struct lrecord_description hash_table_description[] = {
+     { XD_ELEMCOUNT,     offsetof (Lisp_Hash_Table, size) },
+     { XD_STRUCT_PTR, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT(0, 1),
+	 &hentry_description },
+     { XD_LO_LINK,    offsetof (Lisp_Hash_Table, next_weak) },
+     { XD_END }
+   };
+
+   Note that we don't need to declare all the elements in the structure, just
+   the ones that need to be relocated (Lisp_Objects and structures) or that
+   need to be referenced as counts for relocated objects.
+
+
+   The existing types :
+
+
     XD_LISP_OBJECT
   A Lisp object.  This is also the type to use for pointers to other lrecords.
 
--- a/src/lstream.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/lstream.c	Sun Apr 14 12:43:31 2002 +0000
@@ -208,7 +208,12 @@
    note the non-parallelism in who should set this mode on the stream: The
    *CALLER* sets character mode on read streams it creates; the *STREAM
    ITSELF* sets character mode on write streams, typically at creation
-   time. */
+   time.
+
+   (However, if a read stream always generates internal-format data, then
+   the callers will almost always want character mode, and it's allowed to
+   set this on behalf of the caller, as long as a flag can be provided at
+   creation time to disable this behavior.) */
 
 void
 Lstream_set_character_mode (Lstream *lstr)
@@ -232,12 +237,12 @@
    object hanging around anywhere where they might be used!  When streams
    are chained together, be VERY CAREFUL of the order in which you delete
    them! (e.g. if the streams are in a singly-linked list, delete the head
-   first; this will close, and may send data down to the rest.  Then
+   first; this will close (but check the documentation, e.g. of
+   make_coding_input_stream()), and may send data down to the rest.  Then
    proceed to the rest, one by one.  If the chains are in a doubly-linked
    list, close all the streams first (again, from the head to the tail),
    disconnect the back links, then delete starting from the head.  In
-   general, it's a good idea to close everything before deleting
-   anything.
+   general, it's a good idea to close everything before deleting anything.
 
    NOTE: DO NOT CALL DURING GARBAGE COLLECTION (e.g. in a finalizer).  You
    will be aborted.  See free_managed_lcrecord(). */
@@ -599,8 +604,9 @@
    any data at other times, particularly if SIZE is too small.  this needs
    to be fixed!). -1 means an error occurred and no bytes were read. */
 
-Bytecount
-Lstream_read (Lstream *lstr, void *data, Bytecount size)
+static Bytecount
+Lstream_read_1 (Lstream *lstr, void *data, Bytecount size,
+		int override_no_partial_chars)
 {
   unsigned char *p = (unsigned char *) data;
   Bytecount off = 0;
@@ -662,7 +668,8 @@
 	}
     }
 
-  if (lstr->flags & LSTREAM_FL_NO_PARTIAL_CHARS)
+  if ((lstr->flags & LSTREAM_FL_NO_PARTIAL_CHARS) &&
+      !override_no_partial_chars)
     {
       /* It's quite possible for us to get passed an incomplete
 	 character at the end.  We need to spit back that
@@ -678,6 +685,13 @@
   return off == 0 && error_occurred ? -1 : off;
 }
 
+Bytecount
+Lstream_read (Lstream *lstr, void *data, Bytecount size)
+{
+  return Lstream_read_1 (lstr, data, size, 0);
+}
+
+
 /* Push back SIZE bytes of DATA onto the input queue.  The next call
    to Lstream_read() with the same size will read the same bytes back.
    Note that this will be the case even if there is other pending
@@ -827,7 +841,7 @@
 Lstream_fgetc (Lstream *lstr)
 {
   unsigned char ch;
-  if (Lstream_read (lstr, &ch, 1) <= 0)
+  if (Lstream_read_1 (lstr, &ch, 1, 1) <= 0)
     return -1;
   return ch;
 }
@@ -1013,6 +1027,25 @@
   return wrap_lstream (lstr);
 }
 
+/* Flags:
+   
+   LSTR_CLOSING
+   If set, close the descriptor or FILE * when the stream is closed.
+
+   LSTR_ALLOW_QUIT
+   If set, allow quitting out of the actual I/O.
+
+   LSTR_PTY_FLUSHING
+   If set and filedesc_stream_set_pty_flushing() has been called
+   on the stream, do not send more than pty_max_bytes on a single
+   line without flushing the data out using the eof_char.
+
+   LSTR_BLOCKED_OK
+   If set, an EWOULDBLOCK error is not treated as an error but
+   simply causes the write function to return 0 as the number
+   of bytes written out.
+ */
+
 Lisp_Object
 make_filedesc_input_stream (int filedesc, int offset, int count, int flags)
 {
--- a/src/lstream.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/lstream.h	Sun Apr 14 12:43:31 2002 +0000
@@ -133,8 +133,8 @@
 {
   const char *name;
   Bytecount size; /* Number of additional bytes to be
-			      allocated with this stream.  Access this
-			      data using Lstream_data(). */
+		     allocated with this stream.  Access this
+		     data using Lstream_data(). */
   /* Read some data from the stream's end and store it into DATA, which
      can hold SIZE bytes.  Return the number of bytes read.  A return
      value of 0 means no bytes can be read at this time.  This may
@@ -154,7 +154,7 @@
      Lisp, thinks that it is bogus that the types and implementations
      of input and output streams are the same. */
   Bytecount (*reader) (Lstream *stream, unsigned char *data,
-				Bytecount size);
+		       Bytecount size);
   /* Send some data to the stream's end.  Data to be sent is in DATA
      and is SIZE bytes.  Return the number of bytes sent.  This
      function can send and return fewer bytes than is passed in; in
@@ -166,7 +166,7 @@
      non-blocking file descriptor and are getting EWOULDBLOCK errors.)
      This function can be NULL if the stream is input-only. */
   Bytecount (*writer) (Lstream *stream, const unsigned char *data,
-				Bytecount size);
+		       Bytecount size);
   /* Return non-zero if the last write operation on the stream resulted
      in an attempt to block (EWOULDBLOCK). If this method does not
      exists, the implementation returns 0 */
--- a/src/nt.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/nt.c	Sun Apr 14 12:43:31 2002 +0000
@@ -419,7 +419,7 @@
 }
 
 void
-init_environment (void)
+init_mswindows_environment (void)
 {
   /* Check for environment variables and use registry if they don't exist */
   /* Emacs 20.6 sets default values for these; not necessary here because
@@ -1747,92 +1747,6 @@
   return cwd;
 }
 
-void
-init_ntproc (void)
-{
-  /* Initial preparation for subprocess support: replace our standard
-     handles with non-inheritable versions. */
-  {
-    HANDLE parent;
-    HANDLE stdin_save =  INVALID_HANDLE_VALUE;
-    HANDLE stdout_save = INVALID_HANDLE_VALUE;
-    HANDLE stderr_save = INVALID_HANDLE_VALUE;
-
-    parent = GetCurrentProcess ();
-
-    /* ignore errors when duplicating and closing; typically the
-       handles will be invalid when running as a gui program. */
-    DuplicateHandle (parent, 
-		     GetStdHandle (STD_INPUT_HANDLE), 
-		     parent,
-		     &stdin_save, 
-		     0, 
-		     FALSE, 
-		     DUPLICATE_SAME_ACCESS);
-    
-    DuplicateHandle (parent,
-		     GetStdHandle (STD_OUTPUT_HANDLE),
-		     parent,
-		     &stdout_save,
-		     0,
-		     FALSE,
-		     DUPLICATE_SAME_ACCESS);
-    
-    DuplicateHandle (parent,
-		     GetStdHandle (STD_ERROR_HANDLE),
-		     parent,
-		     &stderr_save,
-		     0,
-		     FALSE,
-		     DUPLICATE_SAME_ACCESS);
-    
-    retry_fclose (stdin);
-    retry_fclose (stdout);
-    retry_fclose (stderr);
-
-    if (stdin_save != INVALID_HANDLE_VALUE)
-      _open_osfhandle ((long) stdin_save, O_TEXT);
-    else
-      _open ("nul", O_TEXT | O_NOINHERIT | O_RDONLY);
-    _fdopen (0, "r");
-
-    if (stdout_save != INVALID_HANDLE_VALUE)
-      _open_osfhandle ((long) stdout_save, O_TEXT);
-    else
-      _open ("nul", O_TEXT | O_NOINHERIT | O_WRONLY);
-    _fdopen (1, "w");
-
-    if (stderr_save != INVALID_HANDLE_VALUE)
-      _open_osfhandle ((long) stderr_save, O_TEXT);
-    else
-      _open ("nul", O_TEXT | O_NOINHERIT | O_WRONLY);
-    _fdopen (2, "w");
-  }
-
-  /* determine which drives are fixed, for get_cached_volume_information */
-  {
-    /* GetDriveType must have trailing backslash. */
-    Intbyte drive[] = "A:\\";
-
-    /* Loop over all possible drive letters */
-    while (*drive <= 'Z')
-    {
-      Extbyte *driveext;
-
-      C_STRING_TO_TSTR (drive, driveext);
-
-      /* Record if this drive letter refers to a fixed drive. */
-      fixed_drives[DRIVE_INDEX (*drive)] =
-	(qxeGetDriveType (driveext) == DRIVE_FIXED);
-
-      (*drive)++;
-    }
-
-    /* Reset the volume info cache.  */
-    volume_cache = NULL;
-  }
-}
-
 
 /*--------------------------------------------------------------------*/
 /*                        Memory-mapped files                         */
@@ -2125,6 +2039,96 @@
   return ret;
 }
 
+
+void
+init_nt (void)
+{
+  /* Initial preparation for subprocess support: replace our standard
+     handles with non-inheritable versions.
+
+     #### Do we still need this?  This is left over from the old process
+     support. */
+  {
+    HANDLE parent;
+    HANDLE stdin_save =  INVALID_HANDLE_VALUE;
+    HANDLE stdout_save = INVALID_HANDLE_VALUE;
+    HANDLE stderr_save = INVALID_HANDLE_VALUE;
+
+    parent = GetCurrentProcess ();
+
+    /* ignore errors when duplicating and closing; typically the
+       handles will be invalid when running as a gui program. */
+    DuplicateHandle (parent, 
+		     GetStdHandle (STD_INPUT_HANDLE), 
+		     parent,
+		     &stdin_save, 
+		     0, 
+		     FALSE, 
+		     DUPLICATE_SAME_ACCESS);
+    
+    DuplicateHandle (parent,
+		     GetStdHandle (STD_OUTPUT_HANDLE),
+		     parent,
+		     &stdout_save,
+		     0,
+		     FALSE,
+		     DUPLICATE_SAME_ACCESS);
+    
+    DuplicateHandle (parent,
+		     GetStdHandle (STD_ERROR_HANDLE),
+		     parent,
+		     &stderr_save,
+		     0,
+		     FALSE,
+		     DUPLICATE_SAME_ACCESS);
+    
+    retry_fclose (stdin);
+    retry_fclose (stdout);
+    retry_fclose (stderr);
+
+    if (stdin_save != INVALID_HANDLE_VALUE)
+      _open_osfhandle ((long) stdin_save, O_TEXT);
+    else
+      _open ("nul", O_TEXT | O_NOINHERIT | O_RDONLY);
+    _fdopen (0, "r");
+
+    if (stdout_save != INVALID_HANDLE_VALUE)
+      _open_osfhandle ((long) stdout_save, O_TEXT);
+    else
+      _open ("nul", O_TEXT | O_NOINHERIT | O_WRONLY);
+    _fdopen (1, "w");
+
+    if (stderr_save != INVALID_HANDLE_VALUE)
+      _open_osfhandle ((long) stderr_save, O_TEXT);
+    else
+      _open ("nul", O_TEXT | O_NOINHERIT | O_WRONLY);
+    _fdopen (2, "w");
+  }
+
+  /* determine which drives are fixed, for get_cached_volume_information */
+  {
+    /* GetDriveType must have trailing backslash. */
+    Intbyte drive[] = "A:\\";
+
+    /* Loop over all possible drive letters */
+    while (*drive <= 'Z')
+    {
+      Extbyte *driveext;
+
+      C_STRING_TO_TSTR (drive, driveext);
+
+      /* Record if this drive letter refers to a fixed drive. */
+      fixed_drives[DRIVE_INDEX (*drive)] =
+	(qxeGetDriveType (driveext) == DRIVE_FIXED);
+
+      (*drive)++;
+    }
+
+    /* Reset the volume info cache.  */
+    volume_cache = NULL;
+  }
+}
+
 void
 syms_of_nt (void)
 {
--- a/src/ntheap.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/ntheap.c	Sun Apr 14 12:43:31 2002 +0000
@@ -26,9 +26,12 @@
    incomplete synching, so beware.)
  */
 
+/* This file has been Mule-ized, Ben Wing, 4-13-02. */
+
 #include <config.h>
 #include "lisp.h"
 
+#include "sysdep.h"
 #include "syswindows.h"
 
 /* This gives us the page size and the size of the allocation unit on NT.  */
@@ -49,39 +52,39 @@
 }
 
 /* Round ADDRESS up to be aligned with ALIGN.  */
-unsigned char *
-round_to_next (unsigned char *address, unsigned long align)
+UChar_Binary *
+round_to_next (UChar_Binary *address, unsigned long align)
 {
   unsigned long tmp;
 
   tmp = (unsigned long) address;
   tmp = (tmp + align - 1) / align;
 
-  return (unsigned char *) (tmp * align);
+  return (UChar_Binary *) (tmp * align);
 }
 
 /* Info for keeping track of our heap.  */
-unsigned char *data_region_base = UNINIT_PTR;
-unsigned char *data_region_end = UNINIT_PTR;
-unsigned char *real_data_region_end = UNINIT_PTR;
+UChar_Binary *data_region_base = UNINIT_PTR;
+UChar_Binary *data_region_end = UNINIT_PTR;
+UChar_Binary *real_data_region_end = UNINIT_PTR;
 unsigned long  data_region_size = UNINIT_LONG;
 unsigned long  reserved_heap_size = UNINIT_LONG;
 
 /* The start of the data segment.  */
-unsigned char *
+UChar_Binary *
 get_data_start (void)
 {
   return data_region_base;
 }
 
 /* The end of the data segment.  */
-unsigned char *
+UChar_Binary *
 get_data_end (void)
 {
   return data_region_end;
 }
 
-static unsigned char *
+static UChar_Binary *
 allocate_heap (void)
 {
   /* The base address for our GNU malloc heap is chosen in conjunction
@@ -145,7 +148,7 @@
 		      PAGE_NOACCESS);
 #endif
 
-  return (unsigned char*) ptr;
+  return (UChar_Binary *) ptr;
 }
 
 
@@ -174,7 +177,7 @@
   if (size < 0) 
     {
       int new_size;
-      unsigned char *new_data_region_end;
+      UChar_Binary *new_data_region_end;
 
       size = -size;
 
@@ -185,7 +188,7 @@
       /* We can only decommit full pages, so allow for 
 	 partial deallocation [cga].  */
       new_data_region_end = (data_region_end - size);
-      new_data_region_end = (unsigned char *)
+      new_data_region_end = (UChar_Binary *)
 	((long) (new_data_region_end + syspage_mask) & ~syspage_mask);
       new_size = real_data_region_end - new_data_region_end;
       real_data_region_end = new_data_region_end;
@@ -214,19 +217,19 @@
 
       /* We really only commit full pages, so record where
 	 the real end of committed memory is [cga].  */
-      real_data_region_end = (unsigned char *)
+      real_data_region_end = (UChar_Binary *)
 	  ((long) (data_region_end + syspage_mask) & ~syspage_mask);
     }
   
   return result;
 }
 
-#if !defined (CANNOT_DUMP) && !defined(HEAP_IN_DATA) && !defined(PDUMP)
+#if !defined (CANNOT_DUMP) && !defined (HEAP_IN_DATA) && !defined (PDUMP)
 
 /* Recreate the heap from the data that was dumped to the executable.
    EXECUTABLE_PATH tells us where to find the executable.  */
 void
-recreate_heap (char *executable_path)
+recreate_heap (Extbyte *executable_path)
 {
   /* First reserve the upper part of our heap.  (We reserve first
 	 because there have been problems in the past where doing the
@@ -236,36 +239,43 @@
   void *tmp;
   MEMORY_BASIC_INFORMATION info;
   DWORD size;
-  unsigned char* base = get_heap_end ();
-  unsigned char* end  = base + get_reserved_heap_size () - get_committed_heap_size ();
+  UChar_Binary *base = get_heap_end ();
+  UChar_Binary *end  =
+    base + get_reserved_heap_size () - get_committed_heap_size ();
   VirtualQuery (base, &info, sizeof (info));
   if (info.State != MEM_FREE)
-	{
-	  /* Oops, something has already reserved or commited it, nothing we can do but exit */
-	  char buf[256];
-	  sprintf (buf,
-			   "XEmacs cannot start because the memory region required by the heap is not available.\n"
-			   "(BaseAddress = 0x%lx, AllocationBase = 0x%lx, Size = 0x%lx, State = %s, Type = %s)",
-			   info.BaseAddress, info.AllocationBase, info.RegionSize,
-			   info.State == MEM_COMMIT ? "COMMITED" : "RESERVED",
-			   info.Type == MEM_IMAGE ? "IMAGE" : info.Type == MEM_MAPPED ? "MAPPED" : "PRIVATE");
-	  MessageBoxA (NULL, buf, "XEmacs", MB_OK | MB_ICONSTOP);
-	  exit(1);
-	}
+    {
+      /* Oops, something has already reserved or commited it, nothing
+	 we can do but exit */
+      Extbyte buf[256];
+      sprintf (buf,
+	       "XEmacs cannot start because the memory region required "
+	       "by the heap is not available.\n"
+	       "(BaseAddress = 0x%lx, AllocationBase = 0x%lx, "
+	       "Size = 0x%lx, State = %s, Type = %s)",
+	       info.BaseAddress, info.AllocationBase, info.RegionSize,
+	       info.State == MEM_COMMIT ? "COMMITED" : "RESERVED",
+	       info.Type == MEM_IMAGE ? "IMAGE" :
+	       info.Type == MEM_MAPPED ? "MAPPED" : "PRIVATE");
+      MessageBoxA (NULL, buf, "XEmacs", MB_OK | MB_ICONSTOP);
+      exit(1);
+    }
 
   /* Now try and reserve as much as possible */
   size = min (info.RegionSize, (DWORD) (end - base));
   tmp = VirtualAlloc (base, size, MEM_RESERVE, PAGE_NOACCESS);
   if (!tmp)
-	{
-	  /* Can't reserve it, nothing we can do but exit */
-	  char buf[256];
-	  sprintf (buf,
-			   "XEmacs cannot start because it couldn't reserve space required for the heap.\n"
-			   "(VirtualAlloc at 0x%lx of 0x%lx failed (%d))", base, size, GetLastError());
-	  MessageBoxA (NULL, buf, "XEmacs", MB_OK | MB_ICONSTOP);
-	  exit (1);
-	}
+    {
+      /* Can't reserve it, nothing we can do but exit */
+      Extbyte buf[256];
+      sprintf (buf,
+	       "XEmacs cannot start because it couldn't reserve space "
+	       "required for the heap.\n"
+	       "(VirtualAlloc at 0x%lx of 0x%lx failed (%d))",
+	       base, size, GetLastError());
+      MessageBoxA (NULL, buf, "XEmacs", MB_OK | MB_ICONSTOP);
+      exit (1);
+    }
 
   /* We read in the data for the .bss section from the executable
      first and map in the heap from the executable second to prevent
--- a/src/ntproc.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/ntproc.c	Sun Apr 14 12:43:31 2002 +0000
@@ -1,1194 +0,0 @@
-/* Old process support under MS Windows, soon to die.
-   Copyright (C) 1992, 1995 Free Software Foundation, Inc.
-   Copyright (C) 2001 Ben Wing.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
-
-   Drew Bliss                   Oct 14, 1993
-     Adapted from alarm.c by Tim Fleehart */
-
-/* Adapted for XEmacs by David Hobley <david@spook-le0.cia.com.au> */
-/* Synced with FSF Emacs 19.34.6 by Marc Paquette <marcpa@cam.org>
-   (Note: Sync messages from Marc Paquette may indicate
-   incomplete synching, so beware.)
- */
-
-/* !!#### This piece of crap is not getting Mule-ized.  It will go away
-   as soon as my process-stderr patches go in and there are a few stream
-   device fixes, so my new call-process-written-using-start-process can
-   always work. */
-
-/* #### This ENTIRE file is only around because of callproc.c, which
-   in turn is only used in batch mode.
-
-   We only need two things to get rid of both this and callproc.c:
-
-   -- my `stderr-proc' ws, which adds support for a separate stderr
-      in asynch. subprocesses. (it's a feature in `old-call-process-internal'.)
-   -- a noninteractive event loop that supports processes.
-*/
-#include <config.h>
-#include "lisp.h"
-
-#include "buffer.h"
-#include "console-msw.h"
-#include "process.h"
-
-#ifdef HAVE_A_OUT_H
-#include <a.out.h>
-#endif
-#include "sysfile.h"
-#include "sysproc.h"
-#include "syssignal.h"
-#include "systime.h"
-#include "syswait.h"
-
-
-/* #### I'm not going to play with shit. */
-// #pragma warning (disable:4013 4024 4090)
-
-/* Control whether spawnve quotes arguments as necessary to ensure
-   correct parsing by child process.  Because not all uses of spawnve
-   are careful about constructing argv arrays, we make this behavior
-   conditional (off by default). */
-Lisp_Object Vwin32_quote_process_args;
-
-/* Control whether create_child causes the process' window to be
-   hidden.  The default is nil. */
-Lisp_Object Vwin32_start_process_show_window;
-
-/* Control whether create_child causes the process to inherit Emacs'
-   console window, or be given a new one of its own.  The default is
-   nil, to allow multiple DOS programs to run on Win95.  Having separate
-   consoles also allows Emacs to cleanly terminate process groups.  */
-Lisp_Object Vwin32_start_process_share_console;
-
-/* Time to sleep before reading from a subprocess output pipe - this
-   avoids the inefficiency of frequently reading small amounts of data.
-   This is primarily necessary for handling DOS processes on Windows 95,
-   but is useful for Win32 processes on both Win95 and NT as well.  */
-Lisp_Object Vwin32_pipe_read_delay;
-
-extern Lisp_Object Vlisp_EXEC_SUFFIXES;
-
-/* child_process.status values */
-enum {
-  STATUS_READ_ERROR = -1,
-  STATUS_READ_READY,
-  STATUS_READ_IN_PROGRESS,
-  STATUS_READ_FAILED,
-  STATUS_READ_SUCCEEDED,
-  STATUS_READ_ACKNOWLEDGED
-};
-
-/* This structure is used for both pipes and sockets; for
-   a socket, the process handle in pi is NULL. */
-typedef struct _child_process
-{
-  int                   fd;
-  int                   pid;
-  HANDLE                char_avail;
-  HANDLE                char_consumed;
-  HANDLE                thrd;
-  HWND                  hwnd;
-  PROCESS_INFORMATION   procinfo;
-  volatile int          status;
-  char                  chr;
-} child_process;
-
-#define MAX_CHILDREN  MAXDESC/2
-#define CHILD_ACTIVE(cp) ((cp)->char_avail != NULL)
-
-extern child_process * new_child (void);
-extern void delete_child (child_process *cp);
-
-/* parallel array of private info on file handles */
-typedef struct
-{
-  unsigned         flags;
-  HANDLE           hnd;
-  child_process *  cp;
-} filedesc;
-
-extern filedesc fd_info [];
-
-/* fd_info flag definitions */
-#define FILE_READ    0x0001
-#define FILE_WRITE   0x0002
-#define FILE_BINARY  0x0010
-#define FILE_LAST_CR            0x0020
-#define FILE_AT_EOF             0x0040
-#define FILE_SEND_SIGCHLD       0x0080
-#define FILE_PIPE    0x0100
-#define FILE_SOCKET  0x0200
-
-/* #### This is an evil dirty hack. We must get rid of it.
-   Word "munging" is not in XEmacs lexicon. - kkm */
-
-/* parallel array of private info on file handles */
-filedesc fd_info [ MAXDESC ];
-
-#ifdef DEBUG_XEMACS
-#define DebPrint(stuff) _DebPrint stuff
-#else
-#define DebPrint(stuff)
-#endif
-
-/* ------------------------------------------------------------------------- */
-
-#ifndef DEBUG_XEMACS
-__inline
-#endif
-void _DebPrint (const char *fmt, ...)
-{
-#ifdef DEBUG_XEMACS
-  char buf[1024];
-  va_list args;
-
-  va_start (args, fmt);
-  vsprintf (buf, fmt, args);
-  va_end (args);
-  OutputDebugStringA (buf);
-#endif
-}
-
-/* sys_signal moved to nt.c. It's now called mswindows_signal... */
-
-/* Child process management list.  */
-int child_proc_count = 0;
-child_process child_procs[ MAX_CHILDREN ];
-child_process *dead_child = NULL;
-
-DWORD WINAPI reader_thread (void *arg);
-
-/* Find an unused process slot.  */
-child_process *
-new_child (void)
-{
-  child_process *cp;
-  DWORD id;
-  
-  for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--)
-    if (!CHILD_ACTIVE (cp))
-      goto Initialize;
-  if (child_proc_count == MAX_CHILDREN)
-    return NULL;
-  cp = &child_procs[child_proc_count++];
-
- Initialize:
-  xzero (*cp);
-  cp->fd = -1;
-  cp->pid = -1;
-  if (cp->procinfo.hProcess)
-    CloseHandle(cp->procinfo.hProcess);
-  cp->procinfo.hProcess = NULL;
-  cp->status = STATUS_READ_ERROR;
-
-  /* use manual reset event so that select() will function properly */
-  cp->char_avail = CreateEventA (NULL, TRUE, FALSE, NULL);
-  if (cp->char_avail)
-    {
-      cp->char_consumed = CreateEventA (NULL, FALSE, FALSE, NULL);
-      if (cp->char_consumed)
-        {
-	  cp->thrd = CreateThread (NULL, 1024, reader_thread, cp, 0, &id);
-	  if (cp->thrd)
-	    return cp;
-	}
-    }
-  delete_child (cp);
-  return NULL;
-}
-
-void 
-delete_child (child_process *cp)
-{
-  int i;
-
-  /* Should not be deleting a child that is still needed. */
-  for (i = 0; i < MAXDESC; i++)
-    if (fd_info[i].cp == cp)
-      abort ();
-
-  if (!CHILD_ACTIVE (cp))
-    return;
-
-  /* reap thread if necessary */
-  if (cp->thrd)
-    {
-      DWORD rc;
-
-      if (GetExitCodeThread (cp->thrd, &rc) && rc == STILL_ACTIVE)
-        {
-	  /* let the thread exit cleanly if possible */
-	  cp->status = STATUS_READ_ERROR;
-	  SetEvent (cp->char_consumed);
-	  if (WaitForSingleObject (cp->thrd, 1000) != WAIT_OBJECT_0)
-	    {
-	      DebPrint (("delete_child.WaitForSingleObject (thread) failed "
-			 "with %lu for fd %ld\n", GetLastError (), cp->fd));
-	      TerminateThread (cp->thrd, 0);
-	    }
-	}
-      CloseHandle (cp->thrd);
-      cp->thrd = NULL;
-    }
-  if (cp->char_avail)
-    {
-      CloseHandle (cp->char_avail);
-      cp->char_avail = NULL;
-    }
-  if (cp->char_consumed)
-    {
-      CloseHandle (cp->char_consumed);
-      cp->char_consumed = NULL;
-    }
-
-  /* update child_proc_count (highest numbered slot in use plus one) */
-  if (cp == child_procs + child_proc_count - 1)
-    {
-      for (i = child_proc_count-1; i >= 0; i--)
-	if (CHILD_ACTIVE (&child_procs[i]))
-	  {
-	    child_proc_count = i + 1;
-	    break;
-	  }
-    }
-  if (i < 0)
-    child_proc_count = 0;
-}
-
-/* Find a child by pid.  */
-static child_process *
-find_child_pid (DWORD pid)
-{
-  child_process *cp;
-
-  for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--)
-    if (CHILD_ACTIVE (cp) && pid == (DWORD) cp->pid)
-      return cp;
-  return NULL;
-}
-
-/* Function to do blocking read of one byte, needed to implement
-   select.  It is only allowed on sockets and pipes. */
-static int
-_sys_read_ahead (int fd)
-{
-  child_process * cp;
-  int rc = 0;
-
-  if (fd < 0 || fd >= MAXDESC)
-    return STATUS_READ_ERROR;
-
-  cp = fd_info[fd].cp;
-
-  if (cp == NULL || cp->fd != fd || cp->status != STATUS_READ_READY)
-    return STATUS_READ_ERROR;
-
-  if ((fd_info[fd].flags & (FILE_PIPE | FILE_SOCKET)) == 0
-      || (fd_info[fd].flags & FILE_READ) == 0)
-    {
-      /* fd is not a pipe or socket */
-      abort ();
-    }
-  
-  cp->status = STATUS_READ_IN_PROGRESS;
-  
-  if (fd_info[fd].flags & FILE_PIPE)
-    {
-      rc = _read (fd, &cp->chr, sizeof (char));
-
-      /* Give subprocess time to buffer some more output for us before
-	 reporting that input is available; we need this because Win95
-	 connects DOS programs to pipes by making the pipe appear to be
-	 the normal console stdout - as a result most DOS programs will
-	 write to stdout without buffering, ie.  one character at a
-	 time.  Even some Win32 programs do this - "dir" in a command
-	 shell on NT is very slow if we don't do this. */
-      if (rc > 0)
-	{
-	  int wait = XINT (Vwin32_pipe_read_delay);
-
-	  if (wait > 0)
-	    Sleep (wait);
-	  else if (wait < 0)
-	    while (++wait <= 0)
-	      /* Yield remainder of our time slice, effectively giving a
-		 temporary priority boost to the child process. */
-	      Sleep (0);
-	}
-    }
-
-  if (rc == sizeof (char))
-    cp->status = STATUS_READ_SUCCEEDED;
-  else
-    cp->status = STATUS_READ_FAILED;
-
-  return cp->status;
-}
-
-/* Thread proc for child process and socket reader threads. Each thread
-   is normally blocked until woken by select() to check for input by
-   reading one char.  When the read completes, char_avail is signalled
-   to wake up the select emulator and the thread blocks itself again. */
-DWORD WINAPI 
-reader_thread (void *arg)
-{
-  child_process *cp;
-  
-  /* Our identity */
-  cp = (child_process *)arg;
-  
-  /* <matts@tibco.com> - I think the test below is wrong - we don't
-     want to wait for someone to signal char_consumed, as we haven't
-     read anything for them to consume yet! */
-
-  /*
-  if (cp == NULL ||
-      WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0)
-  */
-
-  if (cp == NULL)
-  {
-      return 1;
-  }
-
-  for (;;)
-    {
-      int rc;
-
-      rc = _sys_read_ahead (cp->fd);
-
-      /* The name char_avail is a misnomer - it really just means the
-	 read-ahead has completed, whether successfully or not. */
-      if (!SetEvent (cp->char_avail))
-        {
-	  DebPrint (("reader_thread.SetEvent failed with %lu for fd %ld\n",
-		     GetLastError (), cp->fd));
-	  return 1;
-	}
-
-      if (rc == STATUS_READ_ERROR)
-      {
-        /* We are finished, so clean up handles and set to NULL so
-           that CHILD_ACTIVE will see what is going on */
-        if (cp->char_avail) {
-          CloseHandle (cp->char_avail);
-          cp->char_avail = NULL;
-        }
-        if (cp->thrd) {
-          CloseHandle (cp->thrd);
-          cp->thrd = NULL;
-        }
-        if (cp->char_consumed) {
-          CloseHandle(cp->char_consumed);
-          cp->char_consumed = NULL;
-        }
-        if (cp->procinfo.hProcess)
-        {
-          CloseHandle (cp->procinfo.hProcess);
-          cp->procinfo.hProcess=NULL;
-        }
-        return 1;
-      }
-        
-      /* If the read died, the child has died so let the thread die */
-      if (rc == STATUS_READ_FAILED)
-	break;
-        
-      /* Wait until our input is acknowledged before reading again */
-      if (WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0)
-        {
-	  DebPrint (("reader_thread.WaitForSingleObject failed with "
-		     "%lu for fd %ld\n", GetLastError (), cp->fd));
-	  break;
-        }
-    }
-  /* We are finished, so clean up handles and set to NULL so that
-     CHILD_ACTIVE will see what is going on */
-  if (cp->char_avail) {
-    CloseHandle (cp->char_avail);
-    cp->char_avail = NULL;
-  }
-  if (cp->thrd) {
-    CloseHandle (cp->thrd);
-    cp->thrd = NULL;
-  }
-  if (cp->char_consumed) {
-    CloseHandle(cp->char_consumed);
-    cp->char_consumed = NULL;
-  }
-  if (cp->procinfo.hProcess)
-  {
-    CloseHandle (cp->procinfo.hProcess);
-    cp->procinfo.hProcess=NULL;
-  }
-  
-  return 0;
-}
-
-/* This must die. */
-static void
-unixtodos_filename (char *p)
-{
-  while (*p)
-    {
-      if (*p == '/')
-	*p = '\\';
-      p++;
-    }
-}
-
-/* To avoid Emacs changing directory, we just record here the directory
-   the new process should start in.  This is set just before calling
-   sys_spawnve, and is not generally valid at any other time.  */
-static const char * process_dir;
-
-static BOOL 
-create_child (const char *exe, char *cmdline, char *env,
-	      int * pPid, child_process *cp)
-{
-  STARTUPINFO start;
-  SECURITY_ATTRIBUTES sec_attrs;
-  SECURITY_DESCRIPTOR sec_desc;
-  char dir[ PATH_MAX ];
-  
-  if (cp == NULL) abort ();
-  
-  xzero (start);
-  start.cb = sizeof (start);
-  
-  if (NILP (Vwin32_start_process_show_window))
-  start.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
-  else
-    start.dwFlags = STARTF_USESTDHANDLES;
-  start.wShowWindow = SW_HIDE;
-
-  start.hStdInput = GetStdHandle (STD_INPUT_HANDLE);
-  start.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
-  start.hStdError = GetStdHandle (STD_ERROR_HANDLE);
-
-  /* Explicitly specify no security */
-  /* #### not supported under win98, but will go away */
-  if (!InitializeSecurityDescriptor (&sec_desc, SECURITY_DESCRIPTOR_REVISION))
-    goto EH_Fail;
-  /* #### not supported under win98, but will go away */
-  if (!SetSecurityDescriptorDacl (&sec_desc, TRUE, NULL, FALSE))
-    goto EH_Fail;
-  sec_attrs.nLength = sizeof (sec_attrs);
-  sec_attrs.lpSecurityDescriptor = &sec_desc;
-  sec_attrs.bInheritHandle = FALSE;
-  
-  strcpy (dir, process_dir);
-  unixtodos_filename (dir);
-  
-  if (!CreateProcessA (exe, cmdline, &sec_attrs, NULL, TRUE,
-		      (!NILP (Vwin32_start_process_share_console)
-		       ? CREATE_NEW_PROCESS_GROUP
-		       : CREATE_NEW_CONSOLE),
-		      env, dir,
-		      &start, &cp->procinfo))
-    goto EH_Fail;
-
-  cp->pid = (int) cp->procinfo.dwProcessId;
-
-  CloseHandle (cp->procinfo.hThread);
-  CloseHandle (cp->procinfo.hProcess);
-  cp->procinfo.hThread=NULL;
-  cp->procinfo.hProcess=NULL;
-
-  /* pid must fit in a Lisp_Int */
-
-
-  *pPid = cp->pid;
-  
-  return TRUE;
-  
- EH_Fail:
-  DebPrint (("create_child.CreateProcess failed: %ld\n", GetLastError()););
-  return FALSE;
-}
-
-void
-merge_and_sort_env (char **envp1, char **envp2, char **new_envp)
-{
-  char **optr, **nptr;
-  int num;
-
-  nptr = new_envp;
-  optr = envp1;
-  while (*optr)
-    *nptr++ = *optr++;
-  num = optr - envp1;
-
-  optr = envp2;
-  while (*optr)
-    *nptr++ = *optr++;
-  num += optr - envp2;
-
-  qsort (new_envp, num, sizeof (char*), mswindows_compare_env);
-
-  *nptr = NULL;
-}
-
-/* When a new child process is created we need to register it in our list,
-   so intercept spawn requests.  */
-int 
-spawnve_will_die_soon (int mode, const Intbyte *cmdname,
-		       const Intbyte * const *argv, const Intbyte *const *envp)
-{
-  Lisp_Object program, full;
-  char *cmdline, *env, *parg, **targ;
-  int arglen, numenv;
-  int pid;
-  child_process *cp;
-  int is_dos_app, is_cygnus_app;
-  int do_quoting = 0;
-  char escape_char = 0;
-  /* We pass our process ID to our children by setting up an environment
-     variable in their environment.  */
-  char ppid_env_var_buffer[64];
-  char *extra_env[] = {ppid_env_var_buffer, NULL};
-  struct gcpro gcpro1;
-    
-  /* We don't care about the other modes */
-  if (mode != _P_NOWAIT)
-    {
-      errno = EINVAL;
-      return -1;
-    }
-
-  /* Handle executable names without an executable suffix.  */
-  program = build_string (cmdname);
-  GCPRO1 (program);
-  if (NILP (Ffile_executable_p (program)))
-    {
-      full = Qnil;
-      locate_file (Vexec_path, program, Vlisp_EXEC_SUFFIXES, &full, 1);
-      if (NILP (full))
-	{
-	  UNGCPRO;
-	  errno = EINVAL;
-	  return -1;
-	}
-      TO_EXTERNAL_FORMAT (LISP_STRING, full,
-			  C_STRING_ALLOCA, cmdname,
-			  Qfile_name);
-    }
-  else
-    {
-      cmdname = (char*)alloca (strlen (argv[0]) + 1);
-      strcpy ((char*)cmdname, argv[0]);
-    }
-  UNGCPRO;
-
-  /* make sure argv[0] and cmdname are both in DOS format */
-  unixtodos_filename ((char*)cmdname);
-  /* #### KLUDGE */
-  ((const char**)argv)[0] = cmdname;
-
-  /* Determine whether program is a 16-bit DOS executable, or a Win32
-     executable that is implicitly linked to the Cygnus dll (implying it
-     was compiled with the Cygnus GNU toolchain and hence relies on
-     cygwin.dll to parse the command line - we use this to decide how to
-     escape quote chars in command line args that must be quoted). */
-  mswindows_executable_type (cmdname, &is_dos_app, &is_cygnus_app);
-
-  /* On Windows 95, if cmdname is a DOS app, we invoke a helper
-     application to start it by specifying the helper app as cmdname,
-     while leaving the real app name as argv[0].  */
-  if (is_dos_app)
-    {
-      cmdname = (char*) alloca (PATH_MAX);
-      if (egetenv ("CMDPROXY"))
-	strcpy ((char*)cmdname, egetenv ("CMDPROXY"));
-      else
-    {
-	  strcpy ((char*)cmdname, XSTRING_DATA (Vinvocation_directory));
-	  strcat ((char*)cmdname, "cmdproxy.exe");
-	}
-      unixtodos_filename ((char*)cmdname);
-    }
-  
-  /* we have to do some conjuring here to put argv and envp into the
-     form CreateProcess wants...  argv needs to be a space separated/null
-     terminated list of parameters, and envp is a null
-     separated/double-null terminated list of parameters.
-
-     Additionally, zero-length args and args containing whitespace or
-     quote chars need to be wrapped in double quotes - for this to work,
-     embedded quotes need to be escaped as well.  The aim is to ensure
-     the child process reconstructs the argv array we start with
-     exactly, so we treat quotes at the beginning and end of arguments
-     as embedded quotes.
-
-     The Win32 GNU-based library from Cygnus doubles quotes to escape
-     them, while MSVC uses backslash for escaping.  (Actually the MSVC
-     startup code does attempt to recognize doubled quotes and accept
-     them, but gets it wrong and ends up requiring three quotes to get a
-     single embedded quote!)  So by default we decide whether to use
-     quote or backslash as the escape character based on whether the
-     binary is apparently a Cygnus compiled app.
-
-     Note that using backslash to escape embedded quotes requires
-     additional special handling if an embedded quote is already
-     preceded by backslash, or if an arg requiring quoting ends with
-     backslash.  In such cases, the run of escape characters needs to be
-     doubled.  For consistency, we apply this special handling as long
-     as the escape character is not quote.
-   
-     Since we have no idea how large argv and envp are likely to be we
-     figure out list lengths on the fly and allocate them.  */
-  
-  if (!NILP (Vwin32_quote_process_args))
-    {
-      do_quoting = 1;
-      /* Override escape char by binding win32-quote-process-args to
-	 desired character, or use t for auto-selection.  */
-      if (INTP (Vwin32_quote_process_args))
-	escape_char = (char) XINT (Vwin32_quote_process_args);
-      else
-	escape_char = is_cygnus_app ? '"' : '\\';
-    }
-  
-  /* do argv...  */
-  arglen = 0;
-  targ = (char**)argv;
-  while (*targ)
-    {
-      char * p = *targ;
-      int need_quotes = 0;
-      int escape_char_run = 0;
-
-      if (*p == 0)
-	need_quotes = 1;
-      for ( ; *p; p++)
-	{
-	  if (*p == '"')
-	  {
-	      /* allow for embedded quotes to be escaped */
-	    arglen++;
-	      need_quotes = 1;
-	      /* handle the case where the embedded quote is already escaped */
-	      if (escape_char_run > 0)
-		{
-		  /* To preserve the arg exactly, we need to double the
-		     preceding escape characters (plus adding one to
-		     escape the quote character itself).  */
-		  arglen += escape_char_run;
-	  }
-	    }
-      else if (*p == ' ' || *p == '\t')
-	    {
-	      need_quotes = 1;
-	    }
-
-	  if (*p == escape_char && escape_char != '"')
-	    escape_char_run++;
-	  else
-	    escape_char_run = 0;
-	}
-      if (need_quotes)
-	{
-	arglen += 2;
-	  /* handle the case where the arg ends with an escape char - we
-	     must not let the enclosing quote be escaped.  */
-	  if (escape_char_run > 0)
-	    arglen += escape_char_run;
-	}
-      arglen += strlen (*targ++) + 1;
-    }
-  cmdline = (char*) alloca (arglen);
-  targ = (char**)argv;
-  parg = cmdline;
-  while (*targ)
-    {
-      char * p = *targ;
-      int need_quotes = 0;
-
-      if (*p == 0)
-	need_quotes = 1;
-
-      if (do_quoting)
-	{
-	  for ( ; *p; p++)
-	    if (*p == ' ' || *p == '\t' || *p == '"')
-	      need_quotes = 1;
-	}
-      if (need_quotes)
-	{
-	  int escape_char_run = 0;
-	  char * first;
-	  char * last;
-
-	  p = *targ;
-	  first = p;
-	  last = p + strlen (p) - 1;
-	  *parg++ = '"';
-#if 0
-	  /* This version does not escape quotes if they occur at the
-	     beginning or end of the arg - this could lead to incorrect
-	     behavior when the arg itself represents a command line
-	     containing quoted args.  I believe this was originally done
-	     as a hack to make some things work, before
-	     `win32-quote-process-args' was added.  */
-	  while (*p)
-	    {
-	      if (*p == '"' && p > first && p < last)
-		*parg++ = escape_char;	/* escape embedded quotes */
-	      *parg++ = *p++;
-	    }
-#else
-	  for ( ; *p; p++)
-	    {
-	      if (*p == '"')
-		{
-		  /* double preceding escape chars if any */
-		  while (escape_char_run > 0)
-		    {
-		      *parg++ = escape_char;
-		      escape_char_run--;
-		    }
-		  /* escape all quote chars, even at beginning or end */
-		  *parg++ = escape_char;
-		}
-	      *parg++ = *p;
-
-	      if (*p == escape_char && escape_char != '"')
-		escape_char_run++;
-	      else
-		escape_char_run = 0;
-	    }
-	  /* double escape chars before enclosing quote */
-	  while (escape_char_run > 0)
-	    {
-	      *parg++ = escape_char;
-	      escape_char_run--;
-	    }
-#endif
-	  *parg++ = '"';
-	}
-      else
-	{
-	  strcpy (parg, *targ);
-	  parg += strlen (*targ);
-	}
-      *parg++ = ' ';
-      targ++;
-    }
-  *--parg = '\0';
-  
-  /* and envp...  */
-  arglen = 1;
-  targ = (char**) envp;
-  numenv = 1; /* for end null */
-  while (*targ)
-    {
-      arglen += strlen (*targ++) + 1;
-      numenv++;
-    }
-  /* extra env vars... */
-  sprintf (ppid_env_var_buffer, "__PARENT_PROCESS_ID=%d", 
-	   GetCurrentProcessId ());
-  arglen += strlen (ppid_env_var_buffer) + 1;
-  numenv++;
-
-  /* merge env passed in and extra env into one, and sort it.  */
-  targ = (char **) alloca (numenv * sizeof (char*));
-  merge_and_sort_env ((char**) envp, extra_env, targ);
-
-  /* concatenate env entries.  */
-  env = (char*) alloca (arglen);
-  parg = env;
-  while (*targ)
-    {
-      strcpy (parg, *targ);
-      parg += strlen (*targ++);
-      *parg++ = '\0';
-    }
-  *parg++ = '\0';
-  *parg = '\0';
-
-  cp = new_child ();
-  if (cp == NULL)
-    {
-      errno = EAGAIN;
-      return -1;
-    }
-  
-  /* Now create the process.  */
-  if (!create_child (cmdname, cmdline, env, &pid, cp))
-    {
-      delete_child (cp);
-      errno = ENOEXEC;
-      return -1;
-    }
-
-  return pid;
-}
-
-/* Substitute for certain kill () operations */
-
-static BOOL CALLBACK
-find_child_console (HWND hwnd, child_process * cp)
-{
-  DWORD thread_id;
-  DWORD process_id;
-
-  thread_id = GetWindowThreadProcessId (hwnd, &process_id);
-  if (process_id == cp->procinfo.dwProcessId)
-    {
-      char window_class[32];
-
-      GetClassNameA (hwnd, window_class, sizeof (window_class));
-      if (strcmp (window_class,
-		  mswindows_windows9x_p
-		  ? "tty"
-		  : "ConsoleWindowClass") == 0)
-	{
-	  cp->hwnd = hwnd;
-	  return FALSE;
-	}
-    }
-  /* keep looking */
-  return TRUE;
-}
-
-int 
-kill_will_disappear_soon (int pid, int sig)
-{
-  child_process *cp;
-  HANDLE proc_hand;
-  int need_to_free = 0;
-  int rc = 0;
-  
-  /* Only handle signals that will result in the process dying */
-  if (sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP)
-    {
-      errno = EINVAL;
-      return -1;
-    }
-
-  cp = find_child_pid (pid);
-  if (cp == NULL)
-    {
-      proc_hand = OpenProcess (PROCESS_TERMINATE, 0, pid);
-      if (proc_hand == NULL)
-        {
-	  errno = EPERM;
-	  return -1;
-	}
-      need_to_free = 1;
-    }
-  else
-    {
-      proc_hand = cp->procinfo.hProcess;
-      pid = cp->procinfo.dwProcessId;
-
-      /* Try to locate console window for process. */
-      EnumWindows ((WNDENUMPROC)find_child_console, (LPARAM) cp);
-    }
-  
-  if (sig == SIGINT)
-    {
-      if (NILP (Vwin32_start_process_share_console) && cp && cp->hwnd)
-	{
-	  BYTE control_scan_code = (BYTE) MapVirtualKeyA (VK_CONTROL, 0);
-	  BYTE vk_break_code = VK_CANCEL;
-	  BYTE break_scan_code = (BYTE) MapVirtualKeyA (vk_break_code, 0);
-	  HWND foreground_window;
-
-	  if (break_scan_code == 0)
-	    {
-	      /* Fake Ctrl-C if we can't manage Ctrl-Break. */
-	      vk_break_code = 'C';
-	      break_scan_code = (BYTE) MapVirtualKeyA (vk_break_code, 0);
-	    }
-
-	  foreground_window = GetForegroundWindow ();
-	  if (foreground_window && SetForegroundWindow (cp->hwnd))
-	    {
-	      /* Generate keystrokes as if user had typed Ctrl-Break or Ctrl-C.  */
-	      keybd_event (VK_CONTROL, control_scan_code, 0, 0);
-	      keybd_event (vk_break_code, break_scan_code, 0, 0);
-	      keybd_event (vk_break_code, break_scan_code, KEYEVENTF_KEYUP, 0);
-	      keybd_event (VK_CONTROL, control_scan_code, KEYEVENTF_KEYUP, 0);
-
-	      /* Sleep for a bit to give time for Emacs frame to respond
-		 to focus change events (if Emacs was active app).  */
-	      Sleep (10);
-
-	      SetForegroundWindow (foreground_window);
-	    }
-	}
-      /* Ctrl-Break is NT equivalent of SIGINT.  */
-      else if (!GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, pid))
-        {
-	  DebPrint (("sys_kill.GenerateConsoleCtrlEvent return %d "
-		     "for pid %lu\n", GetLastError (), pid));
-	  errno = EINVAL;
-	  rc = -1;
-        }
-    }
-  else
-    {
-      if (NILP (Vwin32_start_process_share_console) && cp && cp->hwnd)
-	{
-#if 1
-	  if (mswindows_windows9x_p)
-	    {
-/*
-   Another possibility is to try terminating the VDM out-right by
-   calling the Shell VxD (id 0x17) V86 interface, function #4
-   "SHELL_Destroy_VM", ie.
-
-     mov edx,4
-     mov ebx,vm_handle
-     call shellapi
-
-   First need to determine the current VM handle, and then arrange for
-   the shellapi call to be made from the system vm (by using
-   Switch_VM_and_callback).
-
-   Could try to invoke DestroyVM through CallVxD.
-
-*/
-#if 0
-	      /* On Win95, posting WM_QUIT causes the 16-bit subsystem
-		 to hang when cmdproxy is used in conjunction with
-		 command.com for an interactive shell.  Posting
-		 WM_CLOSE pops up a dialog that, when Yes is selected,
-		 does the same thing.  TerminateProcess is also less
-		 than ideal in that subprocesses tend to stick around
-		 until the machine is shutdown, but at least it
-		 doesn't freeze the 16-bit subsystem.  */
-	      PostMessage (cp->hwnd, WM_QUIT, 0xff, 0);
-#endif
-	      if (!TerminateProcess (proc_hand, 0xff))
-		{
-		  DebPrint (("sys_kill.TerminateProcess returned %d "
-			     "for pid %lu\n", GetLastError (), pid));
-		  errno = EINVAL;
-		  rc = -1;
-		}
-	    }
-	  else
-#endif
-	    PostMessageA (cp->hwnd, WM_CLOSE, 0, 0);
-	}
-      /* Kill the process.  On Win32 this doesn't kill child processes
-	 so it doesn't work very well for shells which is why it's not
-	 used in every case.  */
-      else if (!TerminateProcess (proc_hand, 0xff))
-        {
-	  DebPrint (("sys_kill.TerminateProcess returned %d "
-		     "for pid %lu\n", GetLastError (), pid));
-	  errno = EINVAL;
-	  rc = -1;
-        }
-    }
-
-  if (need_to_free)
-    CloseHandle (proc_hand);
-
-  return rc;
-}
-
-/* From callproc.c  */
-extern Lisp_Object Vbinary_process_input;
-extern Lisp_Object Vbinary_process_output;
-
-/* Unix pipe() has only one arg */
-/* Will die as soon as callproc.c dies */
-int
-pipe_will_die_soon (int *phandles)
-{
-  int rc;
-  unsigned flags;
-
-  /* make pipe handles non-inheritable; when we spawn a child, we
-     replace the relevant handle with an inheritable one.  Also put
-     pipes into binary mode; we will do text mode translation ourselves
-     if required.  */
-  rc = _pipe (phandles, 0, _O_NOINHERIT | _O_BINARY);
-
-  if (rc == 0)
-    {
-      flags = FILE_PIPE | FILE_READ;
-      if (!NILP (Vbinary_process_output))
-	  flags |= FILE_BINARY;
-      fd_info[phandles[0]].flags = flags;
-
-      flags = FILE_PIPE | FILE_WRITE;
-      if (!NILP (Vbinary_process_input))
-	  flags |= FILE_BINARY;
-      fd_info[phandles[1]].flags = flags;
-    }
-
-  return rc;
-}
-
-/* The following two routines are used to manipulate stdin, stdout, and
-   stderr of our child processes.
-
-   Assuming that in, out, and err are *not* inheritable, we make them
-   stdin, stdout, and stderr of the child as follows:
-
-   - Save the parent's current standard handles.
-   - Set the std handles to inheritable duplicates of the ones being passed in.
-     (Note that _get_osfhandle() is an io.h procedure that retrieves the
-     NT file handle for a crt file descriptor.)
-   - Spawn the child, which inherits in, out, and err as stdin,
-     stdout, and stderr. (see Spawnve)
-   - Close the std handles passed to the child.
-   - Reset the parent's standard handles to the saved handles.
-     (see reset_standard_handles)
-   We assume that the caller closes in, out, and err after calling us.  */
-
-void
-prepare_standard_handles (int in, int out, int err, HANDLE handles[3])
-{
-  HANDLE parent;
-  HANDLE newstdin, newstdout, newstderr;
-
-  parent = GetCurrentProcess ();
-
-  handles[0] = GetStdHandle (STD_INPUT_HANDLE);
-  handles[1] = GetStdHandle (STD_OUTPUT_HANDLE);
-  handles[2] = GetStdHandle (STD_ERROR_HANDLE);
-
-  /* make inheritable copies of the new handles */
-  if (!DuplicateHandle (parent, 
-		       (HANDLE) _get_osfhandle (in),
-		       parent,
-		       &newstdin, 
-		       0, 
-		       TRUE, 
-		       DUPLICATE_SAME_ACCESS))
-    mswindows_report_process_error ("Duplicating input handle for child",
-				    Qunbound, GetLastError ());
-  
-  if (!DuplicateHandle (parent,
-		       (HANDLE) _get_osfhandle (out),
-		       parent,
-		       &newstdout,
-		       0,
-		       TRUE,
-		       DUPLICATE_SAME_ACCESS))
-    mswindows_report_process_error ("Duplicating output handle for child",
-				    Qunbound, GetLastError ());
-  
-  if (!DuplicateHandle (parent,
-		       (HANDLE) _get_osfhandle (err),
-		       parent,
-		       &newstderr,
-		       0,
-		       TRUE,
-		       DUPLICATE_SAME_ACCESS))
-    mswindows_report_process_error ("Duplicating error handle for child",
-				    Qunbound, GetLastError ());
-
-  /* and store them as our std handles */
-  if (!SetStdHandle (STD_INPUT_HANDLE, newstdin))
-    mswindows_report_process_error ("Changing stdin handle",
-				    Qunbound, GetLastError ());
-  
-  if (!SetStdHandle (STD_OUTPUT_HANDLE, newstdout))
-    mswindows_report_process_error ("Changing stdout handle",
-				    Qunbound, GetLastError ());
-
-  if (!SetStdHandle (STD_ERROR_HANDLE, newstderr))
-    mswindows_report_process_error ("Changing stderr handle",
-				    Qunbound, GetLastError ());
-}
-
-void
-reset_standard_handles (int in, int out, int err, HANDLE handles[3])
-{
-  /* close the duplicated handles passed to the child */
-  CloseHandle (GetStdHandle (STD_INPUT_HANDLE));
-  CloseHandle (GetStdHandle (STD_OUTPUT_HANDLE));
-  CloseHandle (GetStdHandle (STD_ERROR_HANDLE));
-
-  /* now restore parent's saved std handles */
-  SetStdHandle (STD_INPUT_HANDLE, handles[0]);
-  SetStdHandle (STD_OUTPUT_HANDLE, handles[1]);
-  SetStdHandle (STD_ERROR_HANDLE, handles[2]);
-}
-
-void
-set_process_dir (const char * dir)
-{
-  process_dir = dir;
-}
-
-
-void
-syms_of_ntproc (void)
-{
-}
-
-void
-vars_of_ntproc (void)
-{
-  DEFVAR_LISP ("win32-quote-process-args", &Vwin32_quote_process_args /*
-    Non-nil enables quoting of process arguments to ensure correct parsing.
-Because Windows does not directly pass argv arrays to child processes,
-programs have to reconstruct the argv array by parsing the command
-line string.  For an argument to contain a space, it must be enclosed
-in double quotes or it will be parsed as multiple arguments.
-
-If the value is a character, that character will be used to escape any
-quote characters that appear, otherwise a suitable escape character
-will be chosen based on the type of the program.
-*/ );
-  Vwin32_quote_process_args = Qt;
-
-  DEFVAR_LISP ("win32-start-process-show-window",
-	       &Vwin32_start_process_show_window /*
-    When nil, processes started via start-process hide their windows.
-When non-nil, they show their window in the method of their choice.
-*/ );
-  Vwin32_start_process_show_window = Qnil;
-
-  DEFVAR_LISP ("win32-start-process-share-console",
-	       &Vwin32_start_process_share_console /*
-    When nil, processes started via start-process are given a new console.
-When non-nil, they share the Emacs console; this has the limitation of
-allowing only one DOS subprocess to run at a time (whether started directly
-or indirectly by Emacs), and preventing Emacs from cleanly terminating the
-subprocess group, but may allow Emacs to interrupt a subprocess that doesn't
-otherwise respond to interrupts from Emacs.
-*/ );
-  Vwin32_start_process_share_console = Qt;
-
-  DEFVAR_LISP ("win32-pipe-read-delay", &Vwin32_pipe_read_delay /*
-    Forced delay before reading subprocess output.
-This is done to improve the buffering of subprocess output, by
-avoiding the inefficiency of frequently reading small amounts of data.
-
-If positive, the value is the number of milliseconds to sleep before
-reading the subprocess output.  If negative, the magnitude is the number
-of time slices to wait (effectively boosting the priority of the child
-process temporarily).  A value of zero disables waiting entirely.
-*/ );
-  Vwin32_pipe_read_delay = make_int (50);
-}
-
-/* end of ntproc.c */
--- a/src/process.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/process.c	Sun Apr 14 12:43:31 2002 +0000
@@ -21,18 +21,20 @@
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-/* This file has been Mule-ized except for `start-process-internal',
-   `open-network-stream-internal' and `open-multicast-group-internal'. */
+/* This file has been Mule-ized. */
 
 /* This file has been split into process.c and process-unix.c by
    Kirill M. Katsnelson <kkm@kis.ru>, so please bash him and not
-   the original author(s) */
+   the original author(s).
+
+   Non-synch-subprocess stuff (mostly process environment) moved from
+   callproc.c, 4-3-02, Ben Wing. */
 
 #include <config.h>
 
-#if !defined (NO_SUBPROCESSES)
-
-/* The entire file is within this conditional */
+#if defined (NO_SUBPROCESSES)
+#error "We don't support this anymore."
+#endif
 
 #include "lisp.h"
 
@@ -52,8 +54,8 @@
 
 #include "sysfile.h"
 #include "sysproc.h"
+#include "syssignal.h"
 #include "systime.h"
-#include "syssignal.h" /* Always include before systty.h */
 #include "systty.h"
 #include "syswait.h"
 
@@ -105,7 +107,6 @@
 /* List of process objects. */
 Lisp_Object Vprocess_list;
 
-extern Lisp_Object Vlisp_EXEC_SUFFIXES;
 Lisp_Object Vnull_device;
 
 /* Cons of coding systems used to initialize process I/O on a newly-
@@ -117,6 +118,18 @@
 
 Fixnum debug_process_io;
 
+Lisp_Object Vshell_file_name;
+
+/* The environment to pass to all subprocesses when they are started.
+   This is in the semi-bogus format of ("VAR=VAL" "VAR2=VAL2" ... )
+ */
+Lisp_Object Vprocess_environment;
+
+/* Make sure egetenv() not called too soon */
+int env_initted;
+
+Lisp_Object Vlisp_EXEC_SUFFIXES;
+
 
 
 static Lisp_Object
@@ -527,7 +540,6 @@
   p->coding_instream =
     make_coding_input_stream (XLSTREAM (p->pipe_instream), incode,
 			      CODING_DECODE, 0);
-  Lstream_set_character_mode (XLSTREAM (p->coding_instream));
   p->coding_outstream =
     make_coding_output_stream (XLSTREAM (p->pipe_outstream), outcode,
 			       CODING_ENCODE, 0);
@@ -583,7 +595,6 @@
        (int nargs, Lisp_Object *args))
 {
   /* This function can call lisp */
-  /* !!#### This function has not been Mule-ized */
   Lisp_Object buffer, name, program, process, current_dir;
   Lisp_Object tem;
   int speccount = specpdl_depth ();
@@ -665,8 +676,7 @@
   process = make_process_internal (name);
 
   XPROCESS (process)->buffer = buffer;
-  XPROCESS (process)->command = Flist (nargs - 2,
-				    args + 2);
+  XPROCESS (process)->command = Flist (nargs - 2, args + 2);
 
   /* Make the process marker point into the process buffer (if any).  */
   if (!NILP (buffer))
@@ -2048,20 +2058,6 @@
   return XPROCESS (process)->kill_without_query ? Qt : Qnil;
 }
 
-
-/* This is not named init_process in order to avoid a conflict with NS 3.3 */
-void
-init_xemacs_process (void)
-{
-  MAYBE_PROCMETH (init_process, ());
-
-  Vprocess_list = Qnil;
-
-  if (usid_to_process)
-    clrhash (usid_to_process);
-  else
-    usid_to_process = make_hash_table (32);
-}
 
 #if 0
 
@@ -2076,6 +2072,238 @@
 
 #endif /* 0 */
 
+
+static int
+getenv_internal (const Intbyte *var,
+		 Bytecount varlen,
+		 Intbyte **value,
+		 Bytecount *valuelen)
+{
+  Lisp_Object scan;
+
+  assert (env_initted);
+
+  for (scan = Vprocess_environment; CONSP (scan); scan = XCDR (scan))
+    {
+      Lisp_Object entry = XCAR (scan);
+
+      if (STRINGP (entry)
+	  && XSTRING_LENGTH (entry) > varlen
+	  && XSTRING_BYTE (entry, varlen) == '='
+#ifdef WIN32_NATIVE
+	  /* NT environment variables are case insensitive.  */
+	  && ! memicmp (XSTRING_DATA (entry), var, varlen)
+#else  /* not WIN32_NATIVE */
+	  && ! memcmp (XSTRING_DATA (entry), var, varlen)
+#endif /* not WIN32_NATIVE */
+	  )
+	{
+	  *value    = XSTRING_DATA   (entry) + (varlen + 1);
+	  *valuelen = XSTRING_LENGTH (entry) - (varlen + 1);
+	  return 1;
+	}
+    }
+
+  return 0;
+}
+
+static void
+putenv_internal (const Intbyte *var,
+		 Bytecount varlen,
+		 const Intbyte *value,
+		 Bytecount valuelen)
+{
+  Lisp_Object scan;
+
+  assert (env_initted);
+
+  for (scan = Vprocess_environment; CONSP (scan); scan = XCDR (scan))
+    {
+      Lisp_Object entry = XCAR (scan);
+
+      if (STRINGP (entry)
+	  && XSTRING_LENGTH (entry) > varlen
+	  && XSTRING_BYTE (entry, varlen) == '='
+#ifdef WIN32_NATIVE
+	  /* NT environment variables are case insensitive.  */
+	  && ! memicmp (XSTRING_DATA (entry), var, varlen)
+#else  /* not WIN32_NATIVE */
+	  && ! memcmp (XSTRING_DATA (entry), var, varlen)
+#endif /* not WIN32_NATIVE */
+	  )
+	{
+	  XCAR (scan) = concat3 (make_string (var, varlen),
+				 build_string ("="),
+				 make_string (value, valuelen));
+	  return;
+	}
+    }
+
+  Vprocess_environment = Fcons (concat3 (make_string (var, varlen),
+					 build_string ("="),
+					 make_string (value, valuelen)),
+				Vprocess_environment);
+}
+
+/* NOTE:
+
+   FSF has this as a Lisp function, as follows.  Generally moving things
+   out of C and into Lisp is a good idea, but in this case the Lisp
+   function is used so early in the startup sequence that it would be ugly
+   to rearrange the early dumped code to accommodate this.
+   
+(defun getenv (variable)
+  "Get the value of environment variable VARIABLE.
+VARIABLE should be a string.  Value is nil if VARIABLE is undefined in
+the environment.  Otherwise, value is a string.
+
+This function consults the variable `process-environment'
+for its value."
+  (interactive (list (read-envvar-name "Get environment variable: " t)))
+  (let ((value (getenv-internal variable)))
+    (when (interactive-p)
+      (message "%s" (if value value "Not set")))
+    value))
+*/
+
+DEFUN ("getenv", Fgetenv, 1, 2, "sEnvironment variable: \np", /*
+Return the value of environment variable VAR, as a string.
+VAR is a string, the name of the variable.
+When invoked interactively, prints the value in the echo area.
+*/
+       (var, interactivep))
+{
+  Intbyte *value;
+  Bytecount valuelen;
+  Lisp_Object v = Qnil;
+  struct gcpro gcpro1;
+
+  CHECK_STRING (var);
+  GCPRO1 (v);
+  if (getenv_internal (XSTRING_DATA (var), XSTRING_LENGTH (var),
+		       &value, &valuelen))
+    v = make_string (value, valuelen);
+  if (!NILP (interactivep))
+    {
+      if (NILP (v))
+	message ("%s not defined in environment", XSTRING_DATA (var));
+      else
+	/* #### Should use Fprin1_to_string or Fprin1 to handle string
+           containing quotes correctly.  */
+	message ("\"%s\"", value);
+    }
+  RETURN_UNGCPRO (v);
+}
+
+/* A version of getenv that consults Vprocess_environment, easily
+   callable from C.
+
+   (At init time, Vprocess_environment is initialized from the
+   environment, stored in the global variable environ. [Note that
+   at startup time, `environ' should be the same as the envp parameter
+   passed to main(); however, later calls to putenv() may change
+   `environ', making the envp parameter inaccurate.] Calls to getenv()
+   and putenv() consult and modify `environ'.  However, once
+   Vprocess_environment is initted, XEmacs C code should *NEVER* call
+   getenv() or putenv() directly, because (1) Lisp code that modifies
+   the environment only modifies Vprocess_environment, not `environ';
+   and (2) Vprocess_environment is in internal format but `environ'
+   is in some external format, and getenv()/putenv() are not Mule-
+   encapsulated.
+
+   WARNING: This value points into Lisp string data and thus will become
+   invalid after a GC. */
+
+Intbyte *
+egetenv (const CIntbyte *var)
+{
+  /* This cannot GC -- 7-28-00 ben */
+  Intbyte *value;
+  Bytecount valuelen;
+
+  if (getenv_internal ((const Intbyte *) var, strlen (var), &value, &valuelen))
+    return value;
+  else
+    return 0;
+}
+
+void
+eputenv (const CIntbyte *var, const CIntbyte *value)
+{
+  putenv_internal ((Intbyte *) var, strlen (var), (Intbyte *) value,
+		   strlen (value));
+}
+
+
+/* This is not named init_process in order to avoid a conflict with NS 3.3 */
+void
+init_xemacs_process (void)
+{
+  /* This function can GC */
+
+  MAYBE_PROCMETH (init_process, ());
+
+  Vprocess_list = Qnil;
+
+  if (usid_to_process)
+    clrhash (usid_to_process);
+  else
+    usid_to_process = make_hash_table (32);
+  
+  {
+    /* jwz: always initialize Vprocess_environment, so that egetenv()
+       works in temacs. */
+    char **envp;
+    Vprocess_environment = Qnil;
+    for (envp = environ; envp && *envp; envp++)
+      Vprocess_environment =
+	Fcons (build_ext_string (*envp, Qnative), Vprocess_environment);
+    /* This gets set back to 0 in disksave_object_finalization() */
+    env_initted = 1;
+  }
+
+  {
+    /* Initialize shell-file-name from environment variables or best guess. */
+#ifdef WIN32_NATIVE
+    const Intbyte *shell = egetenv ("SHELL");
+    if (!shell) shell = egetenv ("COMSPEC");
+    /* Should never happen! */
+    if (!shell) shell =
+      (Intbyte *) (GetVersion () & 0x80000000 ? "command" : "cmd");
+#else /* not WIN32_NATIVE */
+    const Intbyte *shell = egetenv ("SHELL");
+    if (!shell) shell = (Intbyte *) "/bin/sh";
+#endif
+
+#if 0 /* defined (WIN32_NATIVE) */
+    /* BAD BAD BAD.  We do not wanting to be passing an XEmacs-created
+       SHELL var down to some inferior Cygwin process, which might get
+       screwed up.
+	 
+       There are a few broken apps (eterm/term.el, eterm/tshell.el,
+       os-utils/terminal.el, texinfo/tex-mode.el) where this will
+       cause problems.  Those broken apps don't look at
+       shell-file-name, instead just at explicit-shell-file-name,
+       ESHELL and SHELL.  They are apparently attempting to borrow
+       what `M-x shell' uses, but that latter also looks at
+       shell-file-name.  What we want is for all of these apps to look
+       at shell-file-name, so that the user can change the value of
+       shell-file-name and everything will work out hunky-dorey.
+       */
+    
+    if (!egetenv ("SHELL"))
+      {
+	Intbyte *faux_var = alloca_array (Intbyte, 7 + qxestrlen (shell));
+	qxesprintf (faux_var, "SHELL=%s", shell);
+	Vprocess_environment = Fcons (build_intstring (faux_var),
+				      Vprocess_environment);
+      }
+#endif /* 0 */
+
+    Vshell_file_name = build_intstring (shell);
+  }
+}
+
 void
 syms_of_process (void)
 {
@@ -2144,6 +2372,7 @@
   DEFSUBR (Fset_process_output_coding_system);
   DEFSUBR (Fprocess_coding_system);
   DEFSUBR (Fset_process_coding_system);
+  DEFSUBR (Fgetenv);
 }
 
 void
@@ -2232,6 +2461,20 @@
 */ );
   network_stream_blocking_port_list = Qnil;
 #endif	/* PROCESS_IO_BLOCKING */
-}
+
+  /* This function can GC */
+  DEFVAR_LISP ("shell-file-name", &Vshell_file_name /*
+*File name to load inferior shells from.
+Initialized from the SHELL environment variable.
+*/ );
 
-#endif /* not NO_SUBPROCESSES */
+  DEFVAR_LISP ("process-environment", &Vprocess_environment /*
+List of environment variables for subprocesses to inherit.
+Each element should be a string of the form ENVVARNAME=VALUE.
+The environment which Emacs inherits is placed in this variable
+when Emacs starts.
+*/ );
+
+  Vlisp_EXEC_SUFFIXES = build_string (EXEC_SUFFIXES);
+  staticpro (&Vlisp_EXEC_SUFFIXES);
+}
--- a/src/process.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/process.h	Sun Apr 14 12:43:31 2002 +0000
@@ -1,5 +1,6 @@
 /* Definitions for asynchronous process control in XEmacs.
    Copyright (C) 1985, 1992, 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -110,11 +111,7 @@
 
 void deactivate_process (Lisp_Object proc);
 
-#ifdef WIN32_NATIVE
-int
-#else
 void
-#endif
 child_setup (int in, int out, int err,
 	     Intbyte **new_argv, Lisp_Object current_dir);
 
--- a/src/regex.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/regex.c	Sun Apr 14 12:43:31 2002 +0000
@@ -105,7 +105,7 @@
 Lisp_Object Vthe_lisp_rangetab;
 
 void
-complex_vars_of_regex (void)
+vars_of_regex (void)
 {
   Vthe_lisp_rangetab = Fmake_range_table ();
   staticpro (&Vthe_lisp_rangetab);
@@ -114,7 +114,7 @@
 #else /* not MULE */
 
 void
-complex_vars_of_regex (void)
+vars_of_regex (void)
 {
 }
 
--- a/src/scrollbar-msw.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/scrollbar-msw.c	Sun Apr 14 12:43:31 2002 +0000
@@ -489,11 +489,7 @@
 vars_of_scrollbar_mswindows (void)
 {
   Fprovide (intern ("mswindows-scrollbars"));
-}
 
-void
-complex_vars_of_scrollbar_mswindows (void)
-{
   staticpro (&Vmswindows_scrollbar_instance_table);
   Vmswindows_scrollbar_instance_table =
     make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
--- a/src/search.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/search.c	Sun Apr 14 12:43:31 2002 +0000
@@ -3106,11 +3106,7 @@
 occur and a back reference to one of them is directly followed by a digit.
 */ );
   warn_about_possibly_incompatible_back_references = 1;
-}
-
-void
-complex_vars_of_search (void)
-{
+
   Vskip_chars_range_table = Fmake_range_table ();
   staticpro (&Vskip_chars_range_table);
 }
--- a/src/symbols.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/symbols.c	Sun Apr 14 12:43:31 2002 +0000
@@ -197,6 +197,19 @@
   return intern_int ((Intbyte *) str);
 }
 
+Lisp_Object
+intern_converting_underscores_to_dashes (const CIntbyte *str)
+{
+  Bytecount len = strlen (str);
+  CIntbyte *tmp = alloca_extbytes (len + 1);
+  Bytecount i;
+  strcpy (tmp, str);
+  for (i = 0; i < len; i++)
+    if (tmp[i] == '_')
+      tmp[i] = '-';
+  return intern_int ((Intbyte *) tmp);
+}
+
 DEFUN ("intern", Fintern, 1, 2, 0, /*
 Return the canonical symbol whose name is STRING.
 If there is none, one is created by this function and returned.
--- a/src/symsinit.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/symsinit.h	Sun Apr 14 12:43:31 2002 +0000
@@ -35,8 +35,12 @@
 void init_win32_very_early (void);
 void init_mswindows_dde_very_early (void);
 
-/* Early Lisp-engine initialization (dump-time only for init,
-   dump-time and post-pdump-load-time for reinit). */
+/* Early Lisp-engine initialization -- dump-time only for init, dump-time
+   and post-pdump-load-time for reinit.  We call the reinit() routine
+   ourselves at post-pdump-load-time, but the init_() routine calls the
+   reinit() routine itself. (This is because sometimes the timing of when
+   to call the routine is tricky -- the init routine might need to do some
+   stuff, call the reinit() routine, and do some more stuff.) */
 
 void init_alloc_once_early (void);
 void reinit_alloc_once_early (void);
@@ -47,6 +51,18 @@
 void init_opaque_once_early (void);
 void init_elhash_once_early (void);
 void init_eistring_once_early (void);
+void reinit_eistring_once_early (void);
+
+/* Reset the Lisp engine.  Called both at dump-time, run-time and
+   run-temacs-time; at dump-time, it's called early, before any of the
+   vars() or complex_vars() routines.  Currently does almost nothing. */
+
+void init_alloc_early (void);
+
+/* Called somewhat randomly -- at dump-time, in the middle of the vars()
+   calls, and at run-time, just before the late initializations. */
+
+void init_eval_semi_early (void);
 
 /* Declare the built-in symbols and primitives (dump-time only). */
 
@@ -276,7 +292,6 @@
 void reinit_vars_of_buffer (void);
 void vars_of_bytecode (void);
 void vars_of_callint (void);
-void vars_of_callproc (void);
 void vars_of_chartab (void);
 void vars_of_cmdloop (void);
 void vars_of_cmds (void);
@@ -373,7 +388,6 @@
 void vars_of_mule_wnn (void);
 void reinit_vars_of_mule_wnn (void);
 void vars_of_nt (void);
-void vars_of_ntproc (void);
 void vars_of_objects (void);
 void reinit_vars_of_objects (void);
 void vars_of_objects_tty (void);
@@ -388,6 +402,7 @@
 void vars_of_profile (void);
 void vars_of_ralloc (void);
 void vars_of_redisplay (void);
+void vars_of_regex (void);
 void vars_of_scrollbar_x (void);
 void reinit_vars_of_scrollbar_x (void);
 void vars_of_scrollbar (void);
@@ -435,8 +450,6 @@
    #### The reinit_() functions should be called from emacs.c, not the
    corresponding complex_vars_of_(). */
 
-void complex_vars_of_regex (void);
-void complex_vars_of_search (void);
 void complex_vars_of_faces (void);
 void complex_vars_of_mule_charset (void);
 void complex_vars_of_file_coding (void);
@@ -447,7 +460,6 @@
 void complex_vars_of_alloc (void);
 void complex_vars_of_menubar (void);
 void complex_vars_of_scrollbar (void);
-void complex_vars_of_scrollbar_mswindows (void);
 void complex_vars_of_frame (void);
 void complex_vars_of_casetab (void);
 void complex_vars_of_syntax (void);
@@ -461,28 +473,19 @@
 void reinit_complex_vars_of_minibuf (void);
 void complex_vars_of_keymap (void);
 
-/* Reset the Lisp engine.  Called both at dump-time and run-time;
-   at dump-time, it's called early, before any of the vars() or
-   complex_vars() routines. */
-
-void init_alloc_early (void);
-void init_eval_early (void);
-
 /* Late initialization -- stuff pertaining only to interactive usage,
    I/O, or Lisp reading. (Dump-time and run-time, but the code itself
    may conditionalize on this by checking the `initialized' variable.) */
 
 void init_buffer_1 (void);
 void init_buffer_2 (void);
-void init_callproc (void);
 void init_console_stream (int reinit);
 void init_device_tty (void);
 void init_editfns (void);
-void init_environment (void);
 void init_event_Xt_late (void);
+void init_event_mswindows_late (void);
 void init_event_stream (void);
 void init_event_tty_late (void);
-void init_event_mswindows_late (void);
 void init_event_unixoid (void);
 void init_file_coding (void);
 void init_hpplay (void);
@@ -490,15 +493,15 @@
 void init_intl_win32 (void);
 void init_lread (void);
 void init_macros (void);
+void init_mswindows_environment (void);
 void init_mule_charset (void);
-void init_ntproc (void); /* #### delete me, please! */
-/* Not named init_process in order to avoid conflict with NS 3.3 */
-void init_xemacs_process (void);
+void init_nt (void);
 void init_postgresql_from_environment (void);
 void init_redisplay (void);
 void init_select_mswindows (void);
 void init_sunpro (void);
 void init_win32 (void);
+void init_xemacs_process (void);
 
 void syms_of_device_gtk (void);
 void syms_of_dialog_gtk (void);
--- a/src/sysdep.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/sysdep.c	Sun Apr 14 12:43:31 2002 +0000
@@ -198,11 +198,8 @@
 #endif /* NO_SUBPROCESSES */
 
 
-#ifdef WIN32_NATIVE
-void wait_for_termination (HANDLE pHandle)
-#else
-void wait_for_termination (int pid)
-#endif
+void
+wait_for_termination (int pid)
 {
   /* #### With the new improved SIGCHLD handling stuff, there is much
      less danger of race conditions and some of the comments below
@@ -313,48 +310,7 @@
      Since implementations may add their own error indicators on top,
      we ignore it by default.  */
 #elif defined (WIN32_NATIVE)
-  int ret = 0, status = 0;
-  if (pHandle == NULL)
-    {
-      warn_when_safe (Qprocess, Qwarning, "Cannot wait for unknown process to terminate");
-      return;
-    }
-  do
-    {
-      QUIT;
-      ret = WaitForSingleObject(pHandle, 100);
-    }
-  while (ret == WAIT_TIMEOUT);
-  if (ret == WAIT_FAILED)
-    {
-      warn_when_safe (Qprocess, Qwarning, "waiting for process failed");
-    }
-  if (ret == WAIT_ABANDONED)
-    {
-      warn_when_safe (Qprocess, Qwarning,
-		      "process to wait for has been abandoned");
-    }
-  if (ret == WAIT_OBJECT_0)
-    {
-      ret = GetExitCodeProcess(pHandle, &status);
-      if (ret)
-	{
-	  synch_process_alive = 0;
-	  synch_process_retcode = status;
-	}
-      else
-	{
-	  /* GetExitCodeProcess() didn't return a valid exit status,
-	     nothing to do.  APA */
-	  warn_when_safe (Qprocess, Qwarning,
-			  "failure to obtain process exit value");
-	}
-    }
-  if (pHandle != NULL && !CloseHandle(pHandle))
-    {
-      warn_when_safe (Qprocess, Qwarning,
-		      "failure to close unknown process");
-    }
+  /* not used */
 #elif defined (EMACS_BLOCK_SIGNAL) && !defined (BROKEN_WAIT_FOR_SIGNAL) && defined (SIGCHLD)
   while (1)
     {
@@ -925,9 +881,7 @@
   {
     struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
     int input_fd = CONSOLE_TTY_DATA (con)->infd;
-#if defined (WIN32_NATIVE)
-    DEVICE_TTY_DATA (d)->ospeed = 15;
-#elif defined (HAVE_TERMIOS)
+#ifdef HAVE_TERMIOS
     struct termios sg;
 
     sg.c_cflag = B9600;
@@ -1398,7 +1352,7 @@
   if (ioctl (fd, TCGETA, &settings->main) < 0)
     return -1;
 
-#elif !defined (WIN32_NATIVE)
+#else
   /* I give up - I hope you have the BSD ioctls.  */
   if (ioctl (fd, TIOCGETP, &settings->main) < 0)
     return -1;
@@ -1472,7 +1426,7 @@
   if (ioctl (fd, flushp ? TCSETAF : TCSETAW, &settings->main) < 0)
     return -1;
 
-#elif !defined (WIN32_NATIVE)
+#else
   /* I give up - I hope you have the BSD ioctls.  */
   if (ioctl (fd, (flushp) ? TIOCSETP : TIOCSETN, &settings->main) < 0)
     return -1;
@@ -1665,14 +1619,12 @@
   tty.main.c_iflag &= ~BRKINT;
 #endif /* AIX */
 #else /* if not HAVE_TERMIO */
-#if !defined (WIN32_NATIVE)
   con->tty_erase_char = make_char (tty.main.sg_erase);
   tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS);
   if (TTY_FLAGS (con).meta_key)
     tty.main.sg_flags |= ANYP;
   /* #### should we be using RAW mode here? */
   tty.main.sg_flags |= /* interrupt_input ? RAW : */ CBREAK;
-#endif /* not WIN32_NATIVE */
 #endif /* not HAVE_TERMIO */
 
   /* If going to use CBREAK mode, we must request C-g to interrupt
@@ -2229,8 +2181,6 @@
 extern void *minimum_address_seen; /* from xmalloc() */
 extern void *maximum_address_seen; /* from xmalloc() */
 
-extern EMACS_INT consing_since_gc;
-
 Bytecount
 total_data_usage (void)
 {
@@ -2241,20 +2191,7 @@
 #endif
   
 #if !defined (WIN32_NATIVE) && !defined (CYGWIN)
-  void *data_end;
-
-  static EMACS_INT last_consing_since_gc;
-  static void *last_sbrk;
-
-  /* Random hack to avoid calling sbrk constantly (every funcall).  #### Is
-     it worth it? */
-  if (!last_sbrk || !(consing_since_gc >= last_consing_since_gc &&
-		      (consing_since_gc - last_consing_since_gc) < 1000))
-    {
-      last_sbrk = sbrk (0);
-      last_consing_since_gc = consing_since_gc;
-    }
-  data_end = last_sbrk;
+  void *data_end = sbrk (0);
 #else
   void *data_end = maximum_address_seen;
 #endif
--- a/src/sysdep.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/sysdep.h	Sun Apr 14 12:43:31 2002 +0000
@@ -1,6 +1,6 @@
 /* System-dependent prototypes
    Copyright (C) 1985, 1993, 1994 Free Software Foundation, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2002 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -51,9 +51,7 @@
 
 /* Wait for subprocess with process id `pid' to terminate and
    make sure it will get eliminated (not remain forever as a zombie) */
-#ifndef WIN32_NATIVE
 void wait_for_termination (int pid);
-#endif
 
 /* flush any pending output
  * (may flush input as well; it does not matter the way we use it)
--- a/src/syssignal.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/syssignal.h	Sun Apr 14 12:43:31 2002 +0000
@@ -1,6 +1,7 @@
 /* syssignal.h - System-dependent definitions for signals.
    Copyright (C) 1992, 1993 Free Software Foundation, Inc.
-
+   Copyright (C) 1996 Ben Wing.
+   
 This file is part of XEmacs.
 
 XEmacs is free software; you can redistribute it and/or modify it
@@ -243,15 +244,11 @@
    Must do that using the killpg call.  */
 #ifdef HAVE_KILLPG
 #define EMACS_KILLPG(pid, signo) killpg (pid, signo)
-#else
-#ifdef WIN32_NATIVE
-/* Only needed in callproc.c, slated to go */
-int kill_will_disappear_soon (int pid, int sig);
-#define EMACS_KILLPG(pid, signo) kill_will_disappear_soon (pid, signo)
+#elif defined (WIN32_NATIVE)
+#define EMACS_KILLPG(pid, signo) should never be called
 #else
 #define EMACS_KILLPG(pid, signo) kill (-(pid), signo)
 #endif
-#endif
 
 #ifndef NSIG
 # define NSIG (SIGUSR2+1) /* guess how many elements are in sys_siglist... */
--- a/src/syswindows.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/syswindows.h	Sun Apr 14 12:43:31 2002 +0000
@@ -937,8 +937,8 @@
 #define get_nt_major_version()  	nt_major_version
 #define get_nt_minor_version()  	nt_minor_version
 
-extern unsigned char *get_data_start();
-extern unsigned char *get_data_end();
+unsigned char *get_data_start (void);
+unsigned char *get_data_end (void);
 extern unsigned long  data_region_size;
 extern unsigned long  reserved_heap_size;
 extern SYSTEM_INFO    sysinfo_cache;
@@ -950,27 +950,24 @@
 #define UNINIT_PTR ((unsigned char*) 0xF0A0F0A0)
 #define UNINIT_LONG (0xF0A0F0A0L)
 
-/* Emulation of Unix sbrk().  */
-extern void *sbrk (unsigned long size);
-
 /* Recreate the heap created during dumping.  */
-extern void recreate_heap (char *executable_path);
+void recreate_heap (Extbyte *executable_path);
 
 /* Round the heap to this size.  */
-extern void round_heap (unsigned long size);
+void round_heap (unsigned long size);
 
 /* Load in the dumped .bss section.  */
-extern void read_in_bss (char *name);
+void read_in_bss (Extbyte *name);
 
 /* Map in the dumped heap.  */
-extern void map_in_heap (char *name);
+void map_in_heap (Extbyte *name);
 
 /* Cache system info, e.g., the NT page size.  */
-extern void cache_system_info (void);
+void cache_system_info (void);
 
 /* Round ADDRESS up to be aligned with ALIGN.  */
-extern unsigned char *round_to_next (unsigned char *address, 
-				     unsigned long align);
+unsigned char *round_to_next (unsigned char *address, 
+			      unsigned long align);
 #endif /* WIN32_NATIVE */
 
 /* ------------------------- Misc prototypes ------------------------- */
@@ -997,36 +994,12 @@
 /* In process-nt.c */
 extern int mswindows_compare_env (const void *strp1, const void *strp2);
 
-/* in sysdep.c */
-#ifdef WIN32_NATIVE
-void wait_for_termination (HANDLE pid);
-#endif
-
 /* in win32.c */
+Extbyte *mswindows_get_module_file_name (void);
 void mswindows_output_last_error (char *frob);
 DECLARE_DOESNT_RETURN (mswindows_report_process_error (const char *string,
 						       Lisp_Object data,
 						       int errnum));
 Lisp_Object mswindows_lisp_error (int errnum);
 
-
-/*--------------------------------------------------------------------*/
-/*                        stuff in ntproc.c                           */
-/*                           DIE DIE DIE                              */
-/*--------------------------------------------------------------------*/
-
-/* Prepare our standard handles for proper inheritance by child processes.  */
-extern void prepare_standard_handles (int in, int out, 
-				      int err, HANDLE handles[4]);
-/* Reset our standard handles to their original state.  */
-extern void reset_standard_handles (int in, int out, 
-				    int err, HANDLE handles[4]);
-void set_process_dir (const char * dir);
-extern void init_ntproc (void);
-/* Will die as soon as callproc.c dies */
-int spawnve_will_die_soon (int mode, const Intbyte *cmdname,
-			   const Intbyte * const *argv,
-			   const Intbyte *const *envp);
-int pipe_will_die_soon (int *phandles);
-
 #endif /* INCLUDED_syswindows_h_ */
--- a/src/text.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/text.c	Sun Apr 14 12:43:31 2002 +0000
@@ -1388,11 +1388,7 @@
 inline static void
 update_entirely_ascii_p_flag (struct buffer *buf)
 {
-  buf->text->entirely_ascii_p =
-    (buf->text->mule_bufmin == 1 &&
-     buf->text->mule_bufmax == buf->text->bufz &&
-     !buf->text->mule_shifter &&
-     !buf->text->mule_three_p);
+  buf->text->entirely_ascii_p = buf->text->z == buf->text->bufz;
 }
 
 /* The next two functions are the actual meat behind the
@@ -1664,7 +1660,6 @@
   buf->text->mule_bufmax = bufmax;
   buf->text->mule_bytmin = bytmin;
   buf->text->mule_bytmax = bytmax;
-  update_entirely_ascii_p_flag (buf);
   
   if (add_to_cache)
     {
@@ -1942,7 +1937,6 @@
   buf->text->mule_bufmax = bufmax;
   buf->text->mule_bytmin = bytmin;
   buf->text->mule_bytmax = bytmax;
-  update_entirely_ascii_p_flag (buf);
 
   if (add_to_cache)
     {
@@ -3408,13 +3402,19 @@
 /************************************************************************/
 
 void
-init_eistring_once_early (void)
+reinit_eistring_once_early (void)
 {
   the_eistring_malloc_zero_init = the_eistring_zero_init;
   the_eistring_malloc_zero_init.mallocp_ = 1;
 }
 
 void
+init_eistring_once_early (void)
+{
+  reinit_eistring_once_early ();
+}
+
+void
 syms_of_text (void)
 {
   DEFSUBR (Fmake_char);
--- a/src/text.h	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/text.h	Sun Apr 14 12:43:31 2002 +0000
@@ -85,9 +85,9 @@
 
 #ifdef ERROR_CHECK_TEXT
 
-INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE_1 (int fb, const char *file,
-					     int line);
-INLINE_HEADER int
+INLINE_HEADER Bytecount REP_BYTES_BY_FIRST_BYTE_1 (int fb, const char *file,
+						   int line);
+INLINE_HEADER Bytecount
 REP_BYTES_BY_FIRST_BYTE_1 (int fb, const char *file, int line)
 {
   assert_at_line (fb < 0xA0, file, line);
@@ -323,10 +323,10 @@
    readable. */
 DECLARE_INLINE_HEADER (
 Bytecount
-validate_intbyte_string_backward (Intbyte *ptr, Bytecount n)
+validate_intbyte_string_backward (const Intbyte *ptr, Bytecount n)
 )
 {
-  Intbyte *ptr2;
+  const Intbyte *ptr2;
 
   if (n == 0)
     return n;
@@ -374,8 +374,10 @@
 /* -------------------------------------------------------------------- */
 
 #define simple_charptr_emchar(ptr)		((Emchar) (ptr)[0])
-#define simple_set_charptr_emchar(ptr, x)	((ptr)[0] = (Intbyte) (x), 1)
-#define simple_charptr_copy_char(src, dst)	((dst)[0] = *(src), 1)
+#define simple_set_charptr_emchar(ptr, x) \
+	((ptr)[0] = (Intbyte) (x), (Bytecount) 1)
+#define simple_charptr_copy_char(src, dst) \
+	((dst)[0] = *(src), (Bytecount) 1)
 
 #ifdef MULE
 
@@ -1347,7 +1349,7 @@
 					     Charcount n))
 {
   Intbyte *pos = eistr->data_ + bytepos;
-  int i;
+  Charcount i;
 
   text_checking_assert (bytepos >= 0 && bytepos <= eistr->bytelen_);
   text_checking_assert (n >= 0 && n <= eistr->charlen_);
@@ -1819,8 +1821,16 @@
   DFC_##sink_type##_USE_CONVERTED_DATA (sink);				   \
 } while (0)
 
+#ifdef __cplusplus
 
+/* Error if you try to use a union here: "member `struct {anonymous
+union}::{anonymous} {anonymous union}::data' with constructor not allowed
+in union" (Bytecount is a class) */
+
+typedef struct
+#else
 typedef union
+#endif
 {
   struct { const void *ptr; Bytecount len; } data;
   Lisp_Object lisp_object;
--- a/src/unexnt.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/unexnt.c	Sun Apr 14 12:43:31 2002 +0000
@@ -22,6 +22,8 @@
 
 /* Adapted for XEmacs by David Hobley <david@spook-le0.cia.com.au> */
 
+/* This file has been Mule-ized, Ben Wing, 4-13-02. */
+
 /* The linkers that come with MSVC >= 4.0 merge .bss into .data and reorder
  * uninitialised data so that the .data section looks like:
  *
@@ -118,6 +120,8 @@
 
   /* Cache system info, e.g., the NT page size.  */
   cache_system_info ();
+  /* Set OS type, so that tchar stuff below works */
+  init_win32_very_early ();
 
   /* If we're a dumped version of emacs then we need to recreate
      our heap and play tricks with our .bss section.  Do this before
@@ -126,9 +130,11 @@
      won't work.)  */
   if (heap_state == HEAP_UNLOADED) 
     {
-      char executable_path[PATH_MAX];
+      Extbyte executable_path[MAX_PATH * MAX_XETCHAR_SIZE];
 
-      if (GetModuleFileNameA (NULL, executable_path, PATH_MAX) == 0) 
+      /* Don't use mswindows_get_module_file_name() because it uses
+	 xmalloc() */
+      if (qxeGetModuleFileName (NULL, executable_path, MAX_PATH) == 0)
 	{
 	  exit (1);
 	}
@@ -137,10 +143,12 @@
 	 the renamed file still loads its heap from xemacs.exe --kkm */
 #if 0
       {
+	Extbyte *p;
+	
 	/* To allow profiling, make sure executable_path names the .exe
 	   file, not the file created by the profiler */
-	char *p = strrchr (executable_path, '\\');
-	strcpy (p+1, PATH_PROGNAME ".exe");
+	p = xetcsrchr (executable_path, '\\');
+	xetcscpy (p + 1, XETEXT (PATH_PROGNAME ".exe"));
       }
 #endif
 
@@ -168,29 +176,30 @@
 
 /* Dump out .data and .bss sections into a new executable.  */
 int
-unexec (char *new_name, char *old_name, unsigned int start_data,
+unexec (Intbyte *new_name, Intbyte *old_name, unsigned int start_data,
 	unsigned int start_bss, unsigned int entry_address)
 {
   file_data in_file, out_file;
-  char out_filename[PATH_MAX], in_filename[PATH_MAX];
+  Intbyte *out_filename = alloca_intbytes (qxestrlen (new_name) + 10);
+  Intbyte *in_filename = alloca_intbytes (qxestrlen (old_name) + 10);
   unsigned long size;
-  char *ptr;
+  Intbyte *ptr;
   HINSTANCE hImagehelp;
   
   /* Make sure that the input and output filenames have the
      ".exe" extension...patch them up if they don't.  */
-  strcpy (in_filename, old_name);
-  ptr = in_filename + strlen (in_filename) - 4;
-  if (strcmp (ptr, ".exe"))
-    strcat (in_filename, ".exe");
+  qxestrcpy (in_filename, old_name);
+  ptr = in_filename + qxestrlen (in_filename) - 4;
+  if (qxestrcmp (ptr, ".exe"))
+    qxestrcat (in_filename, ".exe");
 
-  strcpy (out_filename, new_name);
-  ptr = out_filename + strlen (out_filename) - 4;
-  if (strcmp (ptr, ".exe"))
-    strcat (out_filename, ".exe");
+  qxestrcpy (out_filename, new_name);
+  ptr = out_filename + qxestrlen (out_filename) - 4;
+  if (qxestrcmp (ptr, ".exe"))
+    qxestrcat (out_filename, ".exe");
 
-  printf ("Dumping from %s\n", in_filename);
-  printf ("          to %s\n", out_filename);
+  stdout_out ("Dumping from %s\n", in_filename);
+  stdout_out ("          to %s\n", out_filename);
 
   /* We need to round off our heap to NT's allocation unit (64KB).  */
   round_heap (get_allocation_unit ());
@@ -198,8 +207,8 @@
   /* Open the undumped executable file.  */
   if (!open_input_file (&in_file, in_filename))
     {
-      printf ("Failed to open %s (%d)...bailing.\n", 
-	      in_filename, GetLastError ());
+      stdout_out ("Failed to open %s (%d)...bailing.\n", 
+		  in_filename, GetLastError ());
       exit (1);
     }
 
@@ -209,12 +218,12 @@
   /* The size of the dumped executable is the size of the original
      executable plus the size of the heap and the size of the .bss section.  */
   heap_index_in_executable = (unsigned long)
-    round_to_next ((unsigned char *) in_file.size, get_allocation_unit ());
+    round_to_next ((UChar_Binary *) in_file.size, get_allocation_unit ());
   size = heap_index_in_executable + get_committed_heap_size () + bss_size;
   if (!open_output_file (&out_file, out_filename, size))
     {
-      printf ("Failed to open %s (%d)...bailing.\n", 
-	      out_filename, GetLastError ());
+      stdout_out ("Failed to open %s (%d)...bailing.\n", 
+		  out_filename, GetLastError ());
       exit (1);
     }
 
@@ -236,7 +245,8 @@
     pfnCheckSumMappedFile_t pfnCheckSumMappedFile;
 
     dos_header = (PIMAGE_DOS_HEADER) out_file.file_base;
-    nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew);
+    nt_header = (PIMAGE_NT_HEADERS) ((UChar_Binary *) dos_header +
+				     dos_header->e_lfanew);
 
     nt_header->OptionalHeader.CheckSum = 0;
 #if 0
@@ -276,21 +286,21 @@
 			    DWORD *p_bss_size)
 {
   int n, start, len;
-  char map_filename[PATH_MAX];
-  char buffer[256];
+  Intbyte *map_filename = alloca_intbytes (qxestrlen (p_infile->name) + 10);
+  Extbyte buffer[256];
   FILE *map;
 
   /* Overwrite the .exe extension on the executable file name with
      the .map extension.  */
-  strcpy (map_filename, p_infile->name);
-  n = strlen (map_filename) - 3;
-  strcpy (&map_filename[n], "map");
+  qxestrcpy (map_filename, p_infile->name);
+  n = qxestrlen (map_filename) - 3;
+  qxestrcpy (&map_filename[n], "map");
 
-  map = fopen (map_filename, "r");
+  map = qxe_fopen (map_filename, "r");
   if (!map)
     {
-      printf ("Failed to open map file %s, error %d...bailing out.\n",
-	      map_filename, GetLastError ());
+      stdout_out ("Failed to open map file %s, error %d...bailing out.\n",
+		  map_filename, GetLastError ());
       exit (-1);
     }
 
@@ -301,6 +311,7 @@
       n = sscanf (buffer, " %*d:%x %x", &start, &len);
       if (n != 2)
 	{
+	  /* printf with external data, stdout_out with internal */
 	  printf ("Failed to scan the .bss section line:\n%s", buffer);
 	  exit (-1);
 	}
@@ -318,29 +329,29 @@
   PIMAGE_DOS_HEADER dos_header;
   PIMAGE_NT_HEADERS nt_header;
   PIMAGE_SECTION_HEADER section, data_section;
-  unsigned char *ptr;
+  UChar_Binary *ptr;
   int i;
   
   dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base;
   if (dos_header->e_magic != IMAGE_DOS_SIGNATURE) 
     {
-      printf ("Unknown EXE header in %s...bailing.\n", p_infile->name);
+      stdout_out ("Unknown EXE header in %s...bailing.\n", p_infile->name);
       exit (1);
     }
   nt_header = (PIMAGE_NT_HEADERS) (((unsigned long) dos_header) + 
 				   dos_header->e_lfanew);
   if (nt_header == NULL) 
     {
-      printf ("Failed to find IMAGE_NT_HEADER in %s...bailing.\n", 
-	     p_infile->name);
+      stdout_out ("Failed to find IMAGE_NT_HEADER in %s...bailing.\n", 
+		  p_infile->name);
       exit (1);
     }
 
   /* Check the NT header signature ...  */
   if (nt_header->Signature != IMAGE_NT_SIGNATURE) 
     {
-      printf ("Invalid IMAGE_NT_SIGNATURE 0x%x in %s...bailing.\n",
-	      nt_header->Signature, p_infile->name);
+      stdout_out ("Invalid IMAGE_NT_SIGNATURE 0x%x in %s...bailing.\n",
+		  nt_header->Signature, p_infile->name);
     }
 
   /* Flip through the sections for .data and .bss ...  */
@@ -352,10 +363,10 @@
 	{
 	  extern int my_ebss;		/* From lastfile.c  */
 
-	  ptr = (char *) nt_header->OptionalHeader.ImageBase +
+	  ptr = (UChar_Binary *) nt_header->OptionalHeader.ImageBase +
 	    section->VirtualAddress;
 	  bss_start = ptr;
-	  bss_size = (char*)&my_ebss - (char*)bss_start;
+	  bss_size = (UChar_Binary*) &my_ebss - (UChar_Binary*) bss_start;
 	}
 
       if (!strcmp (section->Name, ".data")) 
@@ -363,11 +374,11 @@
       if (!strcmp (section->Name, "xdata"))
 #endif
 	{
-	  extern char my_edata[];	/* From lastfile.c  */
+	  extern Char_Binary my_edata[];	/* From lastfile.c  */
 
 	  /* The .data section.  */
 	  data_section = section;
-	  ptr = (char *) nt_header->OptionalHeader.ImageBase +
+	  ptr = (UChar_Binary *) nt_header->OptionalHeader.ImageBase +
 	    section->VirtualAddress;
 	  data_start_va = ptr;
 	  data_start_file = section->PointerToRawData;
@@ -382,8 +393,8 @@
 	  /* This code doesn't know how to grow the raw size of a section. */
 	  if (section->SizeOfRawData < section->Misc.VirtualSize)
 	    {
-	      printf ("The emacs data section is smaller than expected"
-		      "...bailing.\n");
+	      stdout_out ("The emacs data section is smaller than expected"
+			  "...bailing.\n");
 	      exit (1);
 	    }
 #endif
@@ -407,7 +418,7 @@
       get_bss_info_from_map_file (p_infile, &ptr, &bss_size);
       bss_start = ptr + nt_header->OptionalHeader.ImageBase
 	+ data_section->VirtualAddress;
-      bss_size = (char*)&my_ebss - (char*)bss_start;
+      bss_size = (UChar_Binary *) &my_ebss - (UChar_Binary *) bss_start;
     }
 #else
   bss_size = 0;
@@ -418,6 +429,7 @@
 /* The dump routines.  */
 
 #ifdef DEBUG_XEMACS
+/* printf with external data, stdout_out with internal */
 #define DUMP_MSG(x) printf x
 #else
 #define DUMP_MSG(x)
@@ -427,11 +439,11 @@
 copy_executable_and_dump_data_section (file_data *p_infile,
 				       file_data *p_outfile)
 {
-  unsigned char *data_file, *data_va;
+  UChar_Binary *data_file, *data_va;
   unsigned long size, index;
 
   /* Get a pointer to where the raw data should go in the executable file.  */
-  data_file = (char *) p_outfile->file_base + data_start_file;
+  data_file = (UChar_Binary *) p_outfile->file_base + data_start_file;
 
   /* Get a pointer to the raw data in our address space.  */
   data_va = data_start_va;
@@ -447,7 +459,8 @@
   DUMP_MSG (("Dumping data section...\n"));
   DUMP_MSG (("\t0x%08x Address in process.\n", data_va));
   DUMP_MSG (("\t0x%08x Offset in output file.\n", 
-	     (char*) data_file - (char *) p_outfile->file_base));
+	     (UChar_Binary *) data_file -
+	     (UChar_Binary *) p_outfile->file_base));
   DUMP_MSG (("\t0x%08x Size in bytes.\n", size));
   memcpy (data_file, data_va, size);
 
@@ -457,38 +470,38 @@
   DUMP_MSG (("\t0x%08x Offset in input file.\n", index));
   DUMP_MSG (("\t0x%08x Offset in output file.\n", index));
   DUMP_MSG (("\t0x%08x Size in bytes.\n", size));
-  memcpy ((char *) p_outfile->file_base + index, 
-	  (char *) p_infile->file_base + index, size);
+  memcpy ((UChar_Binary *) p_outfile->file_base + index, 
+	  (UChar_Binary *) p_infile->file_base + index, size);
 }
 
 static void
 dump_bss_and_heap (file_data *p_infile, file_data *p_outfile)
 {
-    unsigned char *heap_data;
-    unsigned long size, index;
+  UChar_Binary *heap_data;
+  unsigned long size, index;
 
-    DUMP_MSG (("Dumping heap onto end of executable...\n"));
+  DUMP_MSG (("Dumping heap onto end of executable...\n"));
 
-    index = heap_index_in_executable;
-    size = get_committed_heap_size ();
-    heap_data = get_heap_start ();
+  index = heap_index_in_executable;
+  size = get_committed_heap_size ();
+  heap_data = get_heap_start ();
 
-    DUMP_MSG (("\t0x%08x Heap start in process.\n", heap_data));
-    DUMP_MSG (("\t0x%08x Heap offset in executable.\n", index));
-    DUMP_MSG (("\t0x%08x Heap size in bytes.\n", size));
+  DUMP_MSG (("\t0x%08x Heap start in process.\n", heap_data));
+  DUMP_MSG (("\t0x%08x Heap offset in executable.\n", index));
+  DUMP_MSG (("\t0x%08x Heap size in bytes.\n", size));
 
-    memcpy ((PUCHAR) p_outfile->file_base + index, heap_data, size);
+  memcpy ((PUCHAR) p_outfile->file_base + index, heap_data, size);
 
 #ifndef DUMP_SEPARATE_SECTION
-    DUMP_MSG (("Dumping bss onto end of executable...\n"));
+  DUMP_MSG (("Dumping bss onto end of executable...\n"));
     
-    index += size;
-    size = bss_size;
+  index += size;
+  size = bss_size;
 
-    DUMP_MSG (("\t0x%08x BSS start in process.\n", bss_start));
-    DUMP_MSG (("\t0x%08x BSS offset in executable.\n", index));
-    DUMP_MSG (("\t0x%08x BSS size in bytes.\n", size));
-    memcpy ((char *) p_outfile->file_base + index, bss_start, size);
+  DUMP_MSG (("\t0x%08x BSS start in process.\n", bss_start));
+  DUMP_MSG (("\t0x%08x BSS offset in executable.\n", index));
+  DUMP_MSG (("\t0x%08x BSS size in bytes.\n", size));
+  memcpy ((UChar_Binary *) p_outfile->file_base + index, bss_start, size);
 #endif
 }
 
@@ -500,14 +513,14 @@
 /* Load the dumped .bss section into the .bss area of our address space.  */
 /* Already done if the .bss  was part of a separate emacs data section */
 void
-read_in_bss (char *filename)
+read_in_bss (Extbyte *filename)
 {
 #ifndef DUMP_SEPARATE_SECTION
   HANDLE file;
   unsigned long index, n_read;
 
-  file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
-		     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+  file = qxeCreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
+			OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
   if (file == INVALID_HANDLE_VALUE)
     abort ();
   
@@ -527,21 +540,21 @@
 
 /* Map the heap dumped into the executable file into our address space.  */
 void 
-map_in_heap (char *filename)
+map_in_heap (Extbyte *filename)
 {
   HANDLE file;
   HANDLE file_mapping;
   void  *file_base;
   unsigned long size, upper_size, n_read;
 
-  file = CreateFileA (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
-		      OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+  file = qxeCreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
+			OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
   if (file == INVALID_HANDLE_VALUE) 
     abort ();
 
   size = GetFileSize (file, &upper_size);
-  file_mapping = CreateFileMappingA (file, NULL, PAGE_WRITECOPY, 
-				     0, size, NULL);
+  file_mapping = qxeCreateFileMapping (file, NULL, PAGE_WRITECOPY, 
+				       0, size, NULL);
   if (!file_mapping) 
     abort ();
 
--- a/src/win32.c	Sat Apr 13 20:44:53 2002 +0000
+++ b/src/win32.c	Sun Apr 14 12:43:31 2002 +0000
@@ -131,6 +131,27 @@
   return eicpyout_malloc (newname, 0);
 }
 
+Extbyte *
+mswindows_get_module_file_name (void)
+{
+  Extbyte *path = NULL;
+  int bufsize = 4096;
+  int cchpathsize;
+  
+  while (1)
+    {
+      path = (Extbyte *) xrealloc (path, bufsize * XETCHAR_SIZE);
+      cchpathsize = qxeGetModuleFileName (NULL, path, bufsize);
+      if (!cchpathsize)
+	return 0;
+      if (cchpathsize + 1 <= bufsize)
+	break;
+      bufsize *= 2;
+    }
+
+  return path;
+}
+
 static void
 init_potentially_nonexistent_functions (void)
 {