changeset 269:b2472a1930f2 r20-5b33

Import from CVS: tag r20-5b33
author cvs
date Mon, 13 Aug 2007 10:27:19 +0200
parents 6ced69ccd85f
children 8a65e71a4a53
files CHANGES-beta ChangeLog INSTALL Makefile.in configure configure.in configure.usage lib-src/config.values.in lisp/ChangeLog lisp/faces.el lisp/find-paths.el lisp/finder.el lisp/info.el lisp/make-docfile.el lisp/packages.el lisp/setup-paths.el lisp/startup.el lisp/x-faces.el man/ChangeLog man/xemacs/frame.texi nt/ChangeLog nt/xemacs.mak src/ChangeLog src/Makefile.in.in src/console-msw.h src/console.h src/device-msw.c src/device.c src/device.h src/emacs.c src/event-msw.c src/events.c src/faces.c src/faces.h src/frame-msw.c src/frame-x.c src/frame.c src/frame.h src/free-hook.c src/glyphs-msw.c src/glyphs-msw.h src/glyphs-x.c src/glyphs-x.h src/glyphs.c src/glyphs.h src/gui.h src/imgproc.c src/imgproc.h src/menubar-msw.c src/menubar.c src/objects-x.c src/redisplay-msw.c src/redisplay-output.c src/redisplay-x.c src/redisplay.c src/redisplay.h src/s/hpux11-shr.h src/s/hpux11.h src/scrollbar-msw.c src/sheap.c src/unexcw.c version.sh
diffstat 62 files changed, 3072 insertions(+), 1924 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 10:26:31 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 10:27:19 2007 +0200
@@ -1,4 +1,12 @@
 							-*- indented-text -*-
+to 21.0 beta33 "Nigerian Dwarf"
+-- Various MS Windows patches from Kirill Katsnelson, Andy Piper and
+   Jonathon Harris
+-- Startup fixes from Michael Sperber
+-- Various fixes from Hrvoje Niksic
+-- Various fixes from Kyle Jones
+-- miscellaneous bug fixes
+
 to 21.0 beta32 "Nachi"
 -- NT image support from Andy Piper
 -- Various fixes from Hrvoje Niksic
--- a/ChangeLog	Mon Aug 13 10:26:31 2007 +0200
+++ b/ChangeLog	Mon Aug 13 10:27:19 2007 +0200
@@ -1,3 +1,27 @@
+1998-03-24  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta33 is released.
+
+1998-03-26  Didier Verna <verna@inf.enst.fr>
+
+	* configure.in, Makefile.in: Removed infopath_user_defined---we
+	always want to propagate it.
+
+	* configure.usage: Synched with configure.in.
+
+1998-03-25  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* configure.usage, INSTALL: Synched with the new path layout.
+
+	* Makefile.in (src/paths.h): Replaced packagepath with
+	package_path to make configure happy.
+
+	* configure.in: Made default setting for packagepath conform to
+	what packages.el builds at run-time: XEmacs-version-specific paths
+	before site-specific ones.
+	Added default setting for pkgdir.
+	Changed --packagepath back to --package-path.
+
 1998-03-24  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 21.0-beta32 is released.
--- a/INSTALL	Mon Aug 13 10:26:31 2007 +0200
+++ b/INSTALL	Mon Aug 13 10:27:19 2007 +0200
@@ -68,19 +68,22 @@
 to the --site-runtime-libraries option.
 
 
-3) Decide what Initial Lisp you need with XEmacs.  XEmacs is distributed
-separately from most of its runtime environment.  This is done to make it
-easier for administrators to tune an installation for what the local users
-need.  See the file etc/PACKAGES for an overview of what is available and
-which packages need to be installed prior to building XEmacs.  At this
-point you only need a minimum to get started at which point you may install
-what you wish without further changes to the XEmacs binary.  A sample
-minimum configuration for a Linux system using Mule and Wnn6 from OMRON
-corporation would be the packages `mule-base' and `egg-its'.  By default,
-packages will be searched for in the directory $prefix/lib/xemacs/packages.
-This may be changed by specifying a different value with the --package-path
-configuration option.  Multiple directories may be specified.
+3) Decide what Initial Lisp you need with XEmacs.  XEmacs is
+distributed separately from most of its runtime environment.  This is
+done to make it easier for administrators to tune an installation for
+what the local users need.  See the file etc/PACKAGES for an overview
+of what is available and which packages need to be installed prior to
+building XEmacs.  At this point you only need a minimum to get started
+at which point you may install what you wish without further changes
+to the XEmacs binary.  A sample minimum configuration for a Linux
+system using Mule and Wnn6 from OMRON corporation would be the
+packages `mule-base' and `egg-its'.  By default, packages will be
+searched for in the path
 
+~/.xemacs::$prefix/lib/xemacs-${version}/mule-packages:$prefix/lib/xemacs/mule-packages:$prefix/lib/xemacs-${version}/packages:$prefix/lib/xemacs/packages
+
+This may be changed by specifying a different value with the
+--package-path configuration option.
 
 4) In the top level directory of the XEmacs distribution, run the
    program `configure' as follows:
--- a/Makefile.in	Mon Aug 13 10:26:31 2007 +0200
+++ b/Makefile.in	Mon Aug 13 10:27:19 2007 +0200
@@ -153,11 +153,11 @@
 lispdir_user_defined=@lispdir_user_defined@
 
 ## Where packages are found.
-packagepath=@packagepath@
+package_path=@package_path@
 
 ## This is set to 'yes' if the user specified the --package_path
 ## at configuration time.
-packagepath_user_defined=@packagepath_user_defined@
+package_path_user_defined=@package_path_user_defined@
 
 
 ## Directory XEmacs should search for lisp files specific
@@ -311,9 +311,9 @@
 	   then echo    '#define PATH_LOADSEARCH "${lispdir}"'; \
 	   else echo '/* #define PATH_LOADSEARCH "${lispdir}" */'; \
 	 fi; \
-	 if test "${packagepath_user_defined}" = "yes"; \
-	   then echo    '#define PATH_PACKAGEPATH "${packagepath}"'; \
-	   else echo '/* #define PATH_PACKAGEPATH "${packagepath}" */'; \
+	 if test "${package_path_user_defined}" = "yes"; \
+	   then echo    '#define PATH_PACKAGEPATH "${package_path}"'; \
+	   else echo '/* #define PATH_PACKAGEPATH "${package_path}" */'; \
 	 fi; \
 	 if test "${sitelispdir_user_defined}" = "yes"; \
 	   then echo    '#define PATH_SITE "${sitelispdir}"'; \
@@ -335,10 +335,8 @@
 	   then echo    '#define PATH_INFO "${infodir}"'; \
 	   else echo '/* #define PATH_INFO "${infodir}" */'; \
 	fi; \
-	 if test "${infopath_user_defined}" = "yes"; \
-	   then echo    '#define PATH_INFOPATH "${infopath}"'; \
-	   else echo '/* #define PATH_INFOPATH "${infopath}" */'; \
-	fi; ) >> src/paths.h.tmp; \
+	echo    '#define PATH_INFOPATH "${infopath}"'; \
+	) >> src/paths.h.tmp; \
 	sh ${srcdir}/move-if-change src/paths.h.tmp src/paths.h
 
 ## We have to force the building of Emacs.ad.h as well in order to get it
--- a/configure	Mon Aug 13 10:26:31 2007 +0200
+++ b/configure	Mon Aug 13 10:27:19 2007 +0200
@@ -220,20 +220,20 @@
 infodir='${datadir}/xemacs-${version}/info'
 infodir_user_defined='no'
 infopath='/usr/local/lib/texmf/doc/info:/usr/local/lib/texmf/info:/usr/lib/texmf/doc/info:/usr/lib/texmf/info:/usr/local/info:/usr/info'
-infopath_user_defined='no'
 lispdir='${datadir}/xemacs-${version}/lisp'
 lispdir_user_defined='no'
 sitelispdir='${datadir}/xemacs/site-lisp'
 sitelispdir_user_defined='no'
-packagepath='~/.xemacs::${datadir}/xemacs/mule-packages:${datadir}/xemacs-${version}/mule-packages:${datadir}/xemacs/packages:${datadir}/xemacs-${version}/packages'
-packagepath_user_defined='no'
+pkgdir='${datadir}/xemacs-${version}/lisp'
+package_path='~/.xemacs::${datadir}/xemacs-${version}/mule-packages:${datadir}/xemacs/mule-packages:${datadir}/xemacs-${version}/packages:${datadir}/xemacs/packages'
+package_path_user_defined='no'
 etcdir='${datadir}/xemacs-${version}/etc'
 etcdir_user_defined='no'
 lockdir='${statedir}/xemacs/lock'
 lockdir_user_defined='no'
 archlibdir='${libdir}/xemacs-${version}/${configuration}'
 archlibdir_user_defined='no'
-with_site_lisp='yes'
+with_site_lisp='no'
 with_menubars=''
 with_scrollbars=''
 with_dialogs=''
@@ -303,6 +303,7 @@
             case "$opt" in
 
       	run_in_place	| \
+        with_site_lisp  | \
 	with_x		| \
 	with_x11	| \
 	with_msw	| \
@@ -535,7 +536,7 @@
 				
 		prefix | exec_prefix | bindir | datadir | statedir | libdir | \
 	mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
-	archlibdir | sitelispdir | docdir | packagepath )	
+	archlibdir | sitelispdir | docdir | package_path )	
 	   	   if test "$valomitted" = "yes"; then
 	     if test "$#" = 0; then
 		 (echo "$progname: Usage error:"
@@ -551,8 +552,7 @@
              sitelispdir ) sitelispdir_user_defined=yes ;;
              etcdir  )  etcdir_user_defined=yes ;;
              infodir ) infodir_user_defined=yes ;;
-             infopath ) infopath_user_defined=yes ;;
-             packagepath ) packagepath_user_defined=yes ;;
+             package_path ) package_path_user_defined=yes ;;
              datadir ) lispdir_user_defined=yes etcdir_user_defined=yes ;;
              statedir | lockdir ) lockdir_user_defined=yes ;;
              exec_prefix | libdir | archlibdir ) archlibdir_user_defined=yes ;;
@@ -595,7 +595,6 @@
 done
 
 
-
 eval set x "$quoted_arguments"; shift
 
 test "$extra_verbose" = "yes" && verbose=yes
@@ -647,7 +646,7 @@
 
 if test -z "$configuration"; then
   echo $ac_n "checking "host system type"""... $ac_c" 1>&6
-echo "configure:651: checking "host system type"" >&5
+echo "configure:650: checking "host system type"" >&5
     if configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess | \
     sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` ; then
     echo "$ac_t""$configuration" 1>&6
@@ -661,7 +660,7 @@
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:665: checking whether ln -s works" >&5
+echo "configure:664: checking whether ln -s works" >&5
 
 rm -f conftestdata
 if ln -s X conftestdata 2>/dev/null
@@ -838,7 +837,7 @@
 
 
 echo "checking "the configuration name"" 1>&6
-echo "configure:842: checking "the configuration name"" >&5
+echo "configure:841: checking "the configuration name"" >&5
 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'`
 if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else
   exit $?
@@ -999,6 +998,7 @@
       *-hp-hpux8*  )  opsys=hpux8  ;;
       *-hp-hpux9*  )  opsys=hpux9  ;;
       *-hp-hpux10* )  opsys=hpux10 ;;
+      *-hp-hpux11* )  opsys=hpux11 ;;
       *            )  opsys=hpux   ;;
     esac
 
@@ -1006,7 +1006,8 @@
    echo "    xemacs will be linked with \"strcat.o\""
  fi ;; esac
 
-    if test "$opsys" = "hpux10"; then ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
+    if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
+	ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
 
     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
@@ -1295,7 +1296,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1299: checking for $ac_word" >&5
+echo "configure:1300: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1321,7 +1322,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1325: checking for $ac_word" >&5
+echo "configure:1326: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1366,7 +1367,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1370: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1371: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1378,11 +1379,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1382 "configure"
+#line 1383 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1402,19 +1403,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1406: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1407: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1411: checking whether we are using GNU C" >&5
+echo "configure:1412: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1428,7 +1429,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1432: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1433: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1457,7 +1458,7 @@
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1461: checking for $ac_word" >&5
+echo "configure:1462: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1483,7 +1484,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1487: checking for $ac_word" >&5
+echo "configure:1488: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1528,7 +1529,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1532: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1533: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1540,11 +1541,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1544 "configure"
+#line 1545 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1564,19 +1565,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1568: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1569: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1573: checking whether we are using GNU C" >&5
+echo "configure:1574: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1590,7 +1591,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1594: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1595: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1619,7 +1620,7 @@
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1623: checking for $ac_word" >&5
+echo "configure:1624: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1645,7 +1646,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1649: checking for $ac_word" >&5
+echo "configure:1650: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1690,7 +1691,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1702,11 +1703,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1706 "configure"
+#line 1707 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1726,19 +1727,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1731: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1735: checking whether we are using GNU C" >&5
+echo "configure:1736: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1752,7 +1753,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1756: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1757: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1785,7 +1786,7 @@
 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1789: checking how to run the C preprocessor" >&5
+echo "configure:1790: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1798,13 +1799,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1802 "configure"
+#line 1803 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1815,13 +1816,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1819 "configure"
+#line 1820 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1844,9 +1845,9 @@
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:1848: checking for AIX" >&5
-cat > conftest.$ac_ext <<EOF
-#line 1850 "configure"
+echo "configure:1849: checking for AIX" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1851 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -1873,9 +1874,9 @@
 
 
 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
-echo "configure:1877: checking for GNU libc" >&5
-cat > conftest.$ac_ext <<EOF
-#line 1879 "configure"
+echo "configure:1878: checking for GNU libc" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1880 "configure"
 #include "confdefs.h"
 #include <features.h>
 int main() {
@@ -1887,7 +1888,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1891: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   have_glibc=yes
 else
@@ -1900,9 +1901,9 @@
 echo "$ac_t""$have_glibc" 1>&6
 
 echo $ac_n "checking whether we are using SunPro C""... $ac_c" 1>&6
-echo "configure:1904: checking whether we are using SunPro C" >&5
-cat > conftest.$ac_ext <<EOF
-#line 1906 "configure"
+echo "configure:1905: checking whether we are using SunPro C" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1907 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1913,7 +1914,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   __sunpro_c=yes
 else
@@ -2189,7 +2190,7 @@
  fi
 
 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
-echo "configure:2193: checking for dynodump" >&5
+echo "configure:2194: checking for dynodump" >&5
 if test "$unexec" != "unexsol2.o"; then
   echo "$ac_t""no" 1>&6
 else
@@ -2287,19 +2288,19 @@
 
 if test "$add_runtime_path" = "yes"; then
       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
-echo "configure:2291: checking "for runtime libraries flag"" >&5
+echo "configure:2292: checking "for runtime libraries flag"" >&5
   dash_r=""
   for try_dash_r in "-R" "-R " "-rpath "; do
     xe_check_libs="${try_dash_r}/no/such/file-or-directory"
     cat > conftest.$ac_ext <<EOF
-#line 2296 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+#line 2297 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   dash_r="$try_dash_r"
 else
@@ -2386,10 +2387,10 @@
 fi
 after_morecore_hook_exists=yes
 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
-echo "configure:2390: checking for malloc_get_state" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2393 "configure"
+echo "configure:2391: checking for malloc_get_state" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2394 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_get_state(); below.  */
@@ -2412,7 +2413,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_get_state=yes"
 else
@@ -2432,10 +2433,10 @@
 fi
 
 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
-echo "configure:2436: checking for malloc_set_state" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2439 "configure"
+echo "configure:2437: checking for malloc_set_state" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2440 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_set_state(); below.  */
@@ -2458,7 +2459,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_set_state=yes"
 else
@@ -2478,16 +2479,16 @@
 fi
 
 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
-echo "configure:2482: checking whether __after_morecore_hook exists" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2484 "configure"
+echo "configure:2483: checking whether __after_morecore_hook exists" >&5
+cat > conftest.$ac_ext <<EOF
+#line 2485 "configure"
 #include "confdefs.h"
 extern void (* __after_morecore_hook)();
 int main() {
 __after_morecore_hook = 0
 ; return 0; }
 EOF
-if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2554,7 +2555,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2558: checking for $ac_word" >&5
+echo "configure:2559: checking for $ac_word" >&5
 
 if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -2607,7 +2608,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2611: checking for a BSD compatible install" >&5
+echo "configure:2612: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 
   IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
@@ -2658,7 +2659,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2662: checking for $ac_word" >&5
+echo "configure:2663: checking for $ac_word" >&5
 
 if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -2689,15 +2690,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2693: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2696 "configure"
+echo "configure:2694: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2697 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2730,15 +2731,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2734: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2737 "configure"
+echo "configure:2735: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2738 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2771,15 +2772,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2775: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2778 "configure"
+echo "configure:2776: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2779 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2809,10 +2810,10 @@
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2813: checking for sys/wait.h that is POSIX.1 compatible" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2816 "configure"
+echo "configure:2814: checking for sys/wait.h that is POSIX.1 compatible" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2817 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -2828,7 +2829,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:2832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2852,10 +2853,10 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2856: checking for ANSI C header files" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2859 "configure"
+echo "configure:2857: checking for ANSI C header files" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2860 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2863,7 +2864,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2880,7 +2881,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2884 "configure"
+#line 2885 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2898,7 +2899,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2902 "configure"
+#line 2903 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2916,7 +2917,7 @@
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 cat > conftest.$ac_ext <<EOF
-#line 2920 "configure"
+#line 2921 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2927,7 +2928,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   :
 else
@@ -2952,10 +2953,10 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2956: checking whether time.h and sys/time.h may both be included" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2959 "configure"
+echo "configure:2957: checking whether time.h and sys/time.h may both be included" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2960 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2964,7 +2965,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2988,10 +2989,10 @@
 fi
 
 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:2992: checking for sys_siglist declaration in signal.h or unistd.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2995 "configure"
+echo "configure:2993: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2996 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3003,7 +3004,7 @@
 char *msg = *(sys_siglist + 1);
 ; return 0; }
 EOF
-if { (eval echo configure:3007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_siglist=yes
 else
@@ -3028,9 +3029,9 @@
 
 
 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
-echo "configure:3032: checking for struct utimbuf" >&5
-cat > conftest.$ac_ext <<EOF
-#line 3034 "configure"
+echo "configure:3033: checking for struct utimbuf" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3035 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3049,7 +3050,7 @@
 static struct utimbuf x; x.actime = x.modtime;
 ; return 0; }
 EOF
-if { (eval echo configure:3053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3054: \"$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
@@ -3069,10 +3070,10 @@
 rm -f conftest*
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3073: checking return type of signal handlers" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3076 "configure"
+echo "configure:3074: checking return type of signal handlers" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3077 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3089,7 +3090,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3111,10 +3112,10 @@
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3115: checking for size_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3118 "configure"
+echo "configure:3116: checking for size_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3119 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3145,10 +3146,10 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3149: checking for pid_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3152 "configure"
+echo "configure:3150: checking for pid_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3153 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3179,10 +3180,10 @@
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3183: checking for uid_t in sys/types.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3186 "configure"
+echo "configure:3184: checking for uid_t in sys/types.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3187 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3218,10 +3219,10 @@
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3222: checking for mode_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3225 "configure"
+echo "configure:3223: checking for mode_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3226 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3252,10 +3253,10 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3256: checking for off_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3259 "configure"
+echo "configure:3257: checking for off_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3260 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3287,9 +3288,9 @@
 
 
 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
-echo "configure:3291: checking for struct timeval" >&5
-cat > conftest.$ac_ext <<EOF
-#line 3293 "configure"
+echo "configure:3292: checking for struct timeval" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3294 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3305,7 +3306,7 @@
 static struct timeval x; x.tv_sec = x.tv_usec;
 ; return 0; }
 EOF
-if { (eval echo configure:3309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
   HAVE_TIMEVAL=yes
@@ -3327,10 +3328,10 @@
 rm -f conftest*
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3331: checking whether struct tm is in sys/time.h or time.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3334 "configure"
+echo "configure:3332: checking whether struct tm is in sys/time.h or time.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3335 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3338,7 +3339,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3362,10 +3363,10 @@
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3366: checking for tm_zone in struct tm" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3369 "configure"
+echo "configure:3367: checking for tm_zone in struct tm" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3370 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3373,7 +3374,7 @@
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3396,10 +3397,10 @@
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3400: checking for tzname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3403 "configure"
+echo "configure:3401: checking for tzname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3404 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3409,7 +3410,7 @@
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3435,10 +3436,10 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3439: checking for working const" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3442 "configure"
+echo "configure:3440: checking for working const" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3443 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3487,7 +3488,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3512,7 +3513,7 @@
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:3516: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:3517: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 
 cat > conftestmake <<\EOF
@@ -3537,12 +3538,12 @@
 
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3541: checking whether byte ordering is bigendian" >&5
+echo "configure:3542: checking whether byte ordering is bigendian" >&5
 
 ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3546 "configure"
+#line 3547 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3553,11 +3554,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3561 "configure"
+#line 3562 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3568,7 +3569,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3585,7 +3586,7 @@
 rm -f conftest*
 if test $ac_cv_c_bigendian = unknown; then
 cat > conftest.$ac_ext <<EOF
-#line 3589 "configure"
+#line 3590 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3598,7 +3599,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_bigendian=no
 else
@@ -3624,10 +3625,10 @@
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:3628: checking size of short" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3631 "configure"
+echo "configure:3629: checking size of short" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3632 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3638,7 +3639,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -3665,10 +3666,10 @@
   exit 1
 fi
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3669: checking size of int" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3672 "configure"
+echo "configure:3670: checking size of int" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3673 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3679,7 +3680,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -3700,10 +3701,10 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3704: checking size of long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3707 "configure"
+echo "configure:3705: checking size of long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3708 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3714,7 +3715,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -3735,10 +3736,10 @@
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:3739: checking size of long long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3742 "configure"
+echo "configure:3740: checking size of long long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3743 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3749,7 +3750,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3754: \"$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
@@ -3770,10 +3771,10 @@
 
 
 echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:3774: checking size of void *" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3777 "configure"
+echo "configure:3775: checking size of void *" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3778 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3784,7 +3785,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3789: \"$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
@@ -3806,7 +3807,7 @@
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:3810: checking for long file names" >&5
+echo "configure:3811: 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:
@@ -3853,12 +3854,12 @@
 
 
 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:3857: checking for sin in -lm" >&5
+echo "configure:3858: 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 3862 "configure"
+#line 3863 "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
@@ -3869,7 +3870,7 @@
 sin()
 ; return 0; }
 EOF
-if { (eval echo configure:3873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3911,14 +3912,14 @@
 
 
 cat > conftest.$ac_ext <<EOF
-#line 3915 "configure"
+#line 3916 "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:3922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_INVERSE_HYPERBOLIC
@@ -3935,7 +3936,7 @@
 rm -f conftest*
 
 echo "checking type of mail spool file locking" 1>&6
-echo "configure:3939: checking type of mail spool file locking" >&5
+echo "configure:3940: checking type of mail spool file locking" >&5
 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
@@ -3959,12 +3960,12 @@
 
 
 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
-echo "configure:3963: checking for kstat_open in -lkstat" >&5
+echo "configure:3964: 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 3968 "configure"
+#line 3969 "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
@@ -3975,7 +3976,7 @@
 kstat_open()
 ; return 0; }
 EOF
-if { (eval echo configure:3979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4009,12 +4010,12 @@
 
 
 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
-echo "configure:4013: checking for kvm_read in -lkvm" >&5
+echo "configure:4014: 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 4018 "configure"
+#line 4019 "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
@@ -4025,7 +4026,7 @@
 kvm_read()
 ; return 0; }
 EOF
-if { (eval echo configure:4029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4059,12 +4060,12 @@
 
 
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:4063: checking for cma_open in -lpthreads" >&5
+echo "configure:4064: 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 4068 "configure"
+#line 4069 "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
@@ -4075,7 +4076,7 @@
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:4079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4111,7 +4112,7 @@
 fi
 
 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
-echo "configure:4115: checking whether the -xildoff compiler flag is required" >&5
+echo "configure:4116: 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;
@@ -4122,7 +4123,7 @@
 
 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
-echo "configure:4126: checking for \"-z ignore\" linker flag" >&5
+echo "configure:4127: 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 ;;
@@ -4132,7 +4133,7 @@
 
 
 echo "checking "for specified window system"" 1>&6
-echo "configure:4136: checking "for specified window system"" >&5
+echo "configure:4137: checking "for specified window system"" >&5
 
 if test "$with_x11" != "no"; then
     test "$x_includes $x_libraries" != "NONE NONE" && \
@@ -4162,7 +4163,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:4166: checking for X" >&5
+echo "configure:4167: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4222,12 +4223,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4226 "configure"
+#line 4227 "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:4231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4296,14 +4297,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4300 "configure"
+#line 4301 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -4412,17 +4413,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:4416: checking whether -R must be followed by a space" >&5
+echo "configure:4417: 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 4419 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:4426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+#line 4420 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4438,14 +4439,14 @@
       else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
 	cat > conftest.$ac_ext <<EOF
-#line 4442 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+#line 4443 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4481,12 +4482,12 @@
 else
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:4485: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:4486: 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 4490 "configure"
+#line 4491 "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
@@ -4497,7 +4498,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4521,12 +4522,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:4525: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:4526: 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 4530 "configure"
+#line 4531 "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
@@ -4537,7 +4538,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4566,10 +4567,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:4570: checking for gethostbyname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4573 "configure"
+echo "configure:4571: checking for gethostbyname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4574 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4592,7 +4593,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -4613,12 +4614,12 @@
     if test $ac_cv_func_gethostbyname = no; then
       
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4617: checking for gethostbyname in -lnsl" >&5
+echo "configure:4618: 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 4622 "configure"
+#line 4623 "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
@@ -4629,7 +4630,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4659,10 +4660,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:4663: checking for connect" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4666 "configure"
+echo "configure:4664: checking for connect" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4667 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4685,7 +4686,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -4708,12 +4709,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:4712: checking "$xe_msg_checking"" >&5
+echo "configure:4713: 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 4717 "configure"
+#line 4718 "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
@@ -4724,7 +4725,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4748,10 +4749,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:4752: checking for remove" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4755 "configure"
+echo "configure:4753: checking for remove" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4756 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -4774,7 +4775,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -4795,12 +4796,12 @@
     if test $ac_cv_func_remove = no; then
       
 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:4799: checking for remove in -lposix" >&5
+echo "configure:4800: 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 4804 "configure"
+#line 4805 "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
@@ -4811,7 +4812,7 @@
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:4815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4835,10 +4836,10 @@
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:4839: checking for shmat" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4842 "configure"
+echo "configure:4840: checking for shmat" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4843 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -4861,7 +4862,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -4882,12 +4883,12 @@
     if test $ac_cv_func_shmat = no; then
       
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:4886: checking for shmat in -lipc" >&5
+echo "configure:4887: 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 4891 "configure"
+#line 4892 "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
@@ -4898,7 +4899,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:4902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4932,12 +4933,12 @@
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   
 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:4936: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:4937: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lICE "
 cat > conftest.$ac_ext <<EOF
-#line 4941 "configure"
+#line 4942 "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
@@ -4948,7 +4949,7 @@
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:4952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5102,7 +5103,7 @@
 
 
     echo "checking for X defines extracted by xmkmf" 1>&6
-echo "configure:5106: checking for X defines extracted by xmkmf" >&5
+echo "configure:5107: checking for X defines extracted by xmkmf" >&5
   rm -fr conftestdir
   if mkdir conftestdir; then
     cd conftestdir
@@ -5134,15 +5135,15 @@
 
     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
-echo "configure:5138: checking for X11/Intrinsic.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5141 "configure"
+echo "configure:5139: checking for X11/Intrinsic.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5142 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5166,12 +5167,12 @@
 
       
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:5170: checking for XOpenDisplay in -lX11" >&5
+echo "configure:5171: 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 5175 "configure"
+#line 5176 "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
@@ -5182,7 +5183,7 @@
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5207,12 +5208,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:5211: checking "$xe_msg_checking"" >&5
+echo "configure:5212: 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 5216 "configure"
+#line 5217 "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
@@ -5223,7 +5224,7 @@
 XGetFontProperty()
 ; return 0; }
 EOF
-if { (eval echo configure:5227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5250,12 +5251,12 @@
 
     
 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
-echo "configure:5254: checking for XShapeSelectInput in -lXext" >&5
+echo "configure:5255: 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 5259 "configure"
+#line 5260 "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
@@ -5266,7 +5267,7 @@
 XShapeSelectInput()
 ; return 0; }
 EOF
-if { (eval echo configure:5270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5289,12 +5290,12 @@
 
     
 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
-echo "configure:5293: checking for XtOpenDisplay in -lXt" >&5
+echo "configure:5294: 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 5298 "configure"
+#line 5299 "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
@@ -5305,7 +5306,7 @@
 XtOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5328,14 +5329,14 @@
 
 
   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
-echo "configure:5332: checking the version of X11 being used" >&5
+echo "configure:5333: checking the version of X11 being used" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5334 "configure"
+#line 5335 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
     main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; }
 EOF
-if { (eval echo configure:5339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:5340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest foobar; x11_release=$?
 else
@@ -5359,15 +5360,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5363: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5366 "configure"
+echo "configure:5364: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5367 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5398,7 +5399,7 @@
 
 
     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
-echo "configure:5402: checking for XFree86" >&5
+echo "configure:5403: checking for XFree86" >&5
   if test -d "/usr/X386/include" -o \
           -f "/etc/XF86Config"    -o \
 	  -f "/etc/X11/XF86Config" -o \
@@ -5418,12 +5419,12 @@
 
     test -z "$with_xmu" && { 
 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
-echo "configure:5422: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
+echo "configure:5423: 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 5427 "configure"
+#line 5428 "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
@@ -5434,7 +5435,7 @@
 XmuReadBitmapDataFromFile()
 ; return 0; }
 EOF
-if { (eval echo configure:5438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5473,19 +5474,19 @@
 
       
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:5477: checking for main in -lXbsd" >&5
+echo "configure:5478: 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 5482 "configure"
+#line 5483 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5513,22 +5514,22 @@
 fi 
 if test "$with_msw" != "no"; then
   echo "checking for MS-Windows" 1>&6
-echo "configure:5517: checking for MS-Windows" >&5
+echo "configure:5518: checking for MS-Windows" >&5
   
 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
-echo "configure:5520: checking for main in -lgdi32" >&5
+echo "configure:5521: 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 5525 "configure"
+#line 5526 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5619,7 +5620,7 @@
 esac
 
 echo "checking for session-management option" 1>&6
-echo "configure:5623: checking for session-management option" >&5;
+echo "configure:5624: checking for session-management option" >&5;
 if test "$with_session" != "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SESSION
@@ -5634,15 +5635,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:5638: checking for X11/Xauth.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5641 "configure"
+echo "configure:5639: checking for X11/Xauth.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5642 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5665,12 +5666,12 @@
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:5669: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:5670: 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 5674 "configure"
+#line 5675 "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
@@ -5681,7 +5682,7 @@
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:5685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5745,15 +5746,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:5749: checking for ${dir}tt_c.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5752 "configure"
+echo "configure:5750: checking for ${dir}tt_c.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5753 "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:5757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5782,12 +5783,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:5786: checking "$xe_msg_checking"" >&5
+echo "configure:5787: 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 5791 "configure"
+#line 5792 "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
@@ -5798,7 +5799,7 @@
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:5802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5847,15 +5848,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:5851: checking for Dt/Dt.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5854 "configure"
+echo "configure:5852: checking for Dt/Dt.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5855 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5878,12 +5879,12 @@
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:5882: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:5883: 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 5887 "configure"
+#line 5888 "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
@@ -5894,7 +5895,7 @@
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:5898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5931,18 +5932,18 @@
 fi
 
 echo "checking for LDAP" 1>&6
-echo "configure:5935: checking for LDAP" >&5
+echo "configure:5936: 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:5938: checking for ldap.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5941 "configure"
+echo "configure:5939: checking for ldap.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5942 "configure"
 #include "confdefs.h"
 #include <ldap.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5965,15 +5966,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:5969: checking for lber.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5972 "configure"
+echo "configure:5970: checking for lber.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5973 "configure"
 #include "confdefs.h"
 #include <lber.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5998,12 +5999,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:6002: checking "$xe_msg_checking"" >&5
+echo "configure:6003: 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 6007 "configure"
+#line 6008 "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
@@ -6014,7 +6015,7 @@
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:6018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6037,12 +6038,12 @@
  }
 test \( -z "$with_ldap" -o "$with_ldap" = "yes" \) -a  "$with_umich_ldap" = "no" && { 
 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
-echo "configure:6041: checking for ldap_set_option in -lldap10" >&5
+echo "configure:6042: checking for ldap_set_option in -lldap10" >&5
 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap10 "
 cat > conftest.$ac_ext <<EOF
-#line 6046 "configure"
+#line 6047 "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
@@ -6053,7 +6054,7 @@
 ldap_set_option()
 ; return 0; }
 EOF
-if { (eval echo configure:6057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6137,13 +6138,13 @@
 if test "$with_x11" = "yes"; then
 
   echo "checking for X11 graphics libraries" 1>&6
-echo "configure:6141: checking for X11 graphics libraries" >&5
+echo "configure:6142: checking for X11 graphics libraries" >&5
 
     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:6144: checking for Xpm - no older than 3.4f" >&5
+echo "configure:6145: checking for Xpm - no older than 3.4f" >&5
   xe_check_libs=-lXpm
   test -z "$with_xpm" && { cat > conftest.$ac_ext <<EOF
-#line 6147 "configure"
+#line 6148 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
   int main(int c, char **v) {
@@ -6153,7 +6154,7 @@
 		  0 ;
   }
 EOF
-if { (eval echo configure:6157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:6158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest foobar; xpm_status=$?;
     if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi;
@@ -6191,15 +6192,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:6195: checking for compface.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6198 "configure"
+echo "configure:6196: checking for compface.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6199 "configure"
 #include "confdefs.h"
 #include <compface.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6222,12 +6223,12 @@
  }
   test -z "$with_xface" && { 
 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:6226: checking for UnGenFace in -lcompface" >&5
+echo "configure:6227: 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 6231 "configure"
+#line 6232 "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
@@ -6238,7 +6239,7 @@
 UnGenFace()
 ; return 0; }
 EOF
-if { (eval echo configure:6242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6273,18 +6274,18 @@
   fi
 
     echo $ac_n "checking for giflib - no older than 3.1""... $ac_c" 1>&6
-echo "configure:6277: checking for giflib - no older than 3.1" >&5
+echo "configure:6278: checking for giflib - no older than 3.1" >&5
   test -z "$with_gif" && { ac_safe=`echo "gif_lib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for gif_lib.h""... $ac_c" 1>&6
-echo "configure:6280: checking for gif_lib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6283 "configure"
+echo "configure:6281: checking for gif_lib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6284 "configure"
 #include "confdefs.h"
 #include <gif_lib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6307,12 +6308,12 @@
  }
   test -z "$with_gif" && { 
 echo $ac_n "checking for GetGifError in -lgif""... $ac_c" 1>&6
-echo "configure:6311: checking for GetGifError in -lgif" >&5
+echo "configure:6312: checking for GetGifError in -lgif" >&5
 ac_lib_var=`echo gif'_'GetGifError | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgif "
 cat > conftest.$ac_ext <<EOF
-#line 6316 "configure"
+#line 6317 "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
@@ -6323,7 +6324,7 @@
 GetGifError()
 ; return 0; }
 EOF
-if { (eval echo configure:6327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6359,15 +6360,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:6363: checking for jpeglib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6366 "configure"
+echo "configure:6364: checking for jpeglib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6367 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6390,12 +6391,12 @@
  }
   test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:6394: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:6395: 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 6399 "configure"
+#line 6400 "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
@@ -6406,7 +6407,7 @@
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:6410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6442,15 +6443,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:6446: checking for png.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6449 "configure"
+echo "configure:6447: checking for png.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6450 "configure"
 #include "confdefs.h"
 #include <png.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6472,10 +6473,10 @@
 fi
  }
   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:6476: checking for pow" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6479 "configure"
+echo "configure:6477: checking for pow" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6480 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -6498,7 +6499,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -6523,12 +6524,12 @@
 xe_msg_checking="for png_set_strip_alpha in -lpng"
 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:6527: checking "$xe_msg_checking"" >&5
+echo "configure:6528: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo png'_'png_set_strip_alpha | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpng $extra_libs"
 cat > conftest.$ac_ext <<EOF
-#line 6532 "configure"
+#line 6533 "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
@@ -6539,7 +6540,7 @@
 png_set_strip_alpha()
 ; return 0; }
 EOF
-if { (eval echo configure:6543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6581,12 +6582,12 @@
 xe_msg_checking="for TIFFReadScanline in -ltiff"
 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:6585: checking "$xe_msg_checking"" >&5
+echo "configure:6586: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo tiff'_'TIFFReadScanline | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltiff $extra_libs"
 cat > conftest.$ac_ext <<EOF
-#line 6590 "configure"
+#line 6591 "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
@@ -6597,7 +6598,7 @@
 TIFFReadScanline()
 ; return 0; }
 EOF
-if { (eval echo configure:6601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6635,12 +6636,12 @@
     
     
 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
-echo "configure:6639: checking for XawScrollbarSetThumb in -lXaw" >&5
+echo "configure:6640: checking for XawScrollbarSetThumb in -lXaw" >&5
 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXaw "
 cat > conftest.$ac_ext <<EOF
-#line 6644 "configure"
+#line 6645 "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
@@ -6651,7 +6652,7 @@
 XawScrollbarSetThumb()
 ; return 0; }
 EOF
-if { (eval echo configure:6655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6675,15 +6676,15 @@
                     
     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:6679: checking for Xm/Xm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6682 "configure"
+echo "configure:6680: checking for Xm/Xm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6683 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6700,12 +6701,12 @@
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:6704: checking for XmStringFree in -lXm" >&5
+echo "configure:6705: 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 6709 "configure"
+#line 6710 "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
@@ -6716,7 +6717,7 @@
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7007,7 +7008,7 @@
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:7011: checking for Mule-related features" >&5
+echo "configure:7012: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -7032,15 +7033,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7036: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7039 "configure"
+echo "configure:7037: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7040 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7071,12 +7072,12 @@
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:7075: checking for strerror in -lintl" >&5
+echo "configure:7076: 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 7080 "configure"
+#line 7081 "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
@@ -7087,7 +7088,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:7091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7120,19 +7121,19 @@
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:7124: checking for Mule input methods" >&5
+echo "configure:7125: checking for Mule input methods" >&5
       test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no
   case "$with_xim" in "" | "yes" )
     echo "checking for XIM" 1>&6
-echo "configure:7128: checking for XIM" >&5
+echo "configure:7129: checking for XIM" >&5
     
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:7131: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:7132: 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 7136 "configure"
+#line 7137 "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
@@ -7143,7 +7144,7 @@
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:7147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7208,15 +7209,15 @@
 
     if test "$with_xfs" = "yes" ; then
     echo "checking for XFontSet" 1>&6
-echo "configure:7212: checking for XFontSet" >&5
+echo "configure:7213: checking for XFontSet" >&5
     
 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
-echo "configure:7215: checking for XmbDrawString in -lX11" >&5
+echo "configure:7216: 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 7220 "configure"
+#line 7221 "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
@@ -7227,7 +7228,7 @@
 XmbDrawString()
 ; return 0; }
 EOF
-if { (eval echo configure:7231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7267,15 +7268,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:7271: checking for wnn/jllib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7274 "configure"
+echo "configure:7272: checking for wnn/jllib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7275 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7300,10 +7301,10 @@
     for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7304: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7307 "configure"
+echo "configure:7305: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7308 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7326,7 +7327,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7355,12 +7356,12 @@
 
     test "$ac_cv_func_crypt" != "yes" && { 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:7359: checking for crypt in -lcrypt" >&5
+echo "configure:7360: 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 7364 "configure"
+#line 7365 "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
@@ -7371,7 +7372,7 @@
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:7375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7405,12 +7406,12 @@
   fi
     test -z "$with_wnn" && { 
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:7409: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:7410: 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 7414 "configure"
+#line 7415 "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
@@ -7421,7 +7422,7 @@
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:7425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7458,12 +7459,12 @@
  fi
     
 echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6
-echo "configure:7462: checking for jl_fi_dic_list in -lwnn" >&5
+echo "configure:7463: checking for jl_fi_dic_list in -lwnn" >&5
 ac_lib_var=`echo wnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn "
 cat > conftest.$ac_ext <<EOF
-#line 7467 "configure"
+#line 7468 "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
@@ -7474,7 +7475,7 @@
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:7478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7508,15 +7509,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:7512: checking for canna/jrkanji.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7515 "configure"
+echo "configure:7513: checking for canna/jrkanji.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7516 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7543,15 +7544,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:7547: checking for canna/jrkanji.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7550 "configure"
+echo "configure:7548: checking for canna/jrkanji.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7551 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7579,15 +7580,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:7583: checking for canna/RK.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7586 "configure"
+echo "configure:7584: checking for canna/RK.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7587 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7610,12 +7611,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:7614: checking for RkBgnBun in -lRKC" >&5
+echo "configure:7615: 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 7619 "configure"
+#line 7620 "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
@@ -7626,7 +7627,7 @@
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:7630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7649,12 +7650,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:7653: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:7654: 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 7658 "configure"
+#line 7659 "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
@@ -7665,7 +7666,7 @@
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:7669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7714,12 +7715,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:7718: checking for layout_object_getvalue in -li18n" >&5
+echo "configure:7719: 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 7723 "configure"
+#line 7724 "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
@@ -7730,7 +7731,7 @@
 layout_object_getvalue()
 ; return 0; }
 EOF
-if { (eval echo configure:7734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7803,10 +7804,10 @@
 for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7807: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7810 "configure"
+echo "configure:7808: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7811 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7829,7 +7830,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7866,10 +7867,10 @@
     for ac_func in realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7870: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7873 "configure"
+echo "configure:7871: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7874 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7892,7 +7893,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7925,16 +7926,16 @@
 esac
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:7929: checking whether netdb declares h_errno" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7931 "configure"
+echo "configure:7930: checking whether netdb declares h_errno" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7932 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:7938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -7954,16 +7955,16 @@
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:7958: checking for sigsetjmp" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7960 "configure"
+echo "configure:7959: checking for sigsetjmp" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7961 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:7967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7968: \"$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
@@ -7983,11 +7984,11 @@
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:7987: checking whether localtime caches TZ" >&5
+echo "configure:7988: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 7991 "configure"
+#line 7992 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -8022,7 +8023,7 @@
   exit (0);
 }
 EOF
-if { (eval echo configure:8026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
@@ -8051,9 +8052,9 @@
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday cannot accept two arguments""... $ac_c" 1>&6
-echo "configure:8055: checking whether gettimeofday cannot accept two arguments" >&5
-cat > conftest.$ac_ext <<EOF
-#line 8057 "configure"
+echo "configure:8056: checking whether gettimeofday cannot accept two arguments" >&5
+cat > conftest.$ac_ext <<EOF
+#line 8058 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -8075,7 +8076,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
 else
@@ -8097,19 +8098,19 @@
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:8101: checking for inline" >&5
+echo "configure:8102: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 8106 "configure"
+#line 8107 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:8113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -8159,17 +8160,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:8163: checking for working alloca.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8166 "configure"
+echo "configure:8164: checking for working alloca.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8167 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:8173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -8193,10 +8194,10 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8197: checking for alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8200 "configure"
+echo "configure:8198: checking for alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8201 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -8219,7 +8220,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:8223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -8258,10 +8259,10 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8262: checking whether alloca needs Cray hooks" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8265 "configure"
+echo "configure:8263: checking whether alloca needs Cray hooks" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8266 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -8285,10 +8286,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:8289: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8292 "configure"
+echo "configure:8290: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8293 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8311,7 +8312,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8341,10 +8342,10 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8345: checking stack direction for C alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8348 "configure"
+echo "configure:8346: checking stack direction for C alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8349 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -8363,7 +8364,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:8367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
@@ -8391,15 +8392,15 @@
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:8395: checking for vfork.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8398 "configure"
+echo "configure:8396: checking for vfork.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8399 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8427,10 +8428,10 @@
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:8431: checking for working vfork" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8434 "configure"
+echo "configure:8432: checking for working vfork" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8435 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -8525,7 +8526,7 @@
   }
 }
 EOF
-if { (eval echo configure:8529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_vfork_works=yes
 else
@@ -8550,10 +8551,10 @@
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:8554: checking for working strcoll" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8557 "configure"
+echo "configure:8555: checking for working strcoll" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8558 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -8563,7 +8564,7 @@
 	strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:8567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
@@ -8590,10 +8591,10 @@
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8594: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8597 "configure"
+echo "configure:8595: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8598 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8616,7 +8617,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8644,10 +8645,10 @@
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:8648: checking whether getpgrp takes no argument" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8651 "configure"
+echo "configure:8649: checking whether getpgrp takes no argument" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8652 "configure"
 #include "confdefs.h"
 
 /*
@@ -8702,7 +8703,7 @@
 }
 
 EOF
-if { (eval echo configure:8706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
@@ -8728,10 +8729,10 @@
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:8732: checking for working mmap" >&5
+echo "configure:8733: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 8735 "configure"
+#line 8736 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -8764,7 +8765,7 @@
   return 1;
 }
 EOF
-if { (eval echo configure:8768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   have_mmap=yes
 else
@@ -8798,15 +8799,15 @@
 
 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:8802: checking for termios.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8805 "configure"
+echo "configure:8803: checking for termios.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8806 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8849,15 +8850,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:8853: checking for termio.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8856 "configure"
+echo "configure:8854: checking for termio.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8857 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8889,10 +8890,10 @@
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:8893: checking for socket" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8896 "configure"
+echo "configure:8894: checking for socket" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8897 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -8915,7 +8916,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -8930,15 +8931,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:8934: checking for netinet/in.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8937 "configure"
+echo "configure:8935: checking for netinet/in.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8938 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8955,15 +8956,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:8959: checking for arpa/inet.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8962 "configure"
+echo "configure:8960: checking for arpa/inet.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8963 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8988,9 +8989,9 @@
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:8992: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:8993: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 8994 "configure"
+#line 8995 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9001,7 +9002,7 @@
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:9005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SOCKADDR_SUN_LEN
@@ -9019,9 +9020,9 @@
 fi
 rm -f conftest*
       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
-echo "configure:9023: checking "for ip_mreq struct in netinet/in.h"" >&5
+echo "configure:9024: checking "for ip_mreq struct in netinet/in.h"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 9025 "configure"
+#line 9026 "configure"
 #include "confdefs.h"
 
 #include <netinet/in.h>
@@ -9030,7 +9031,7 @@
 static struct ip_mreq x;
 ; return 0; }
 EOF
-if { (eval echo configure:9034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MULTICAST
@@ -9061,10 +9062,10 @@
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:9065: checking for msgget" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9068 "configure"
+echo "configure:9066: checking for msgget" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9069 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -9087,7 +9088,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -9102,15 +9103,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:9106: checking for sys/ipc.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9109 "configure"
+echo "configure:9107: checking for sys/ipc.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9110 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9127,15 +9128,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:9131: checking for sys/msg.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9134 "configure"
+echo "configure:9132: checking for sys/msg.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9135 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9173,15 +9174,15 @@
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:9177: checking for dirent.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9180 "configure"
+echo "configure:9178: checking for dirent.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9181 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9208,15 +9209,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:9212: checking for sys/dir.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9215 "configure"
+echo "configure:9213: checking for sys/dir.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9216 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9249,15 +9250,15 @@
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:9253: checking for nlist.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9256 "configure"
+echo "configure:9254: checking for nlist.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9257 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9287,7 +9288,7 @@
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:9291: checking "for sound support"" >&5
+echo "configure:9292: checking "for sound support"" >&5
 case "$with_sound" in
   native | both ) with_native_sound=yes;;
   nas    | no   ) with_native_sound=no;;
@@ -9298,15 +9299,15 @@
     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:9302: checking for multimedia/audio_device.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9305 "configure"
+echo "configure:9303: checking for multimedia/audio_device.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9306 "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:9310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9354,12 +9355,12 @@
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:9358: checking for ALopenport in -laudio" >&5
+echo "configure:9359: 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 9363 "configure"
+#line 9364 "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
@@ -9370,7 +9371,7 @@
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:9374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9401,12 +9402,12 @@
       if test -z "$native_sound_lib"; then
 	
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:9405: checking for AOpenAudio in -lAlib" >&5
+echo "configure:9406: 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 9410 "configure"
+#line 9411 "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
@@ -9417,7 +9418,7 @@
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:9421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9455,15 +9456,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:9459: checking for ${dir}/soundcard.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9462 "configure"
+echo "configure:9460: checking for ${dir}/soundcard.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9463 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9467: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9533,7 +9534,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 9537 "configure"
+#line 9538 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -9560,7 +9561,7 @@
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:9564: checking for TTY-related features" >&5
+echo "configure:9565: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -9576,12 +9577,12 @@
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:9580: checking for tgetent in -lncurses" >&5
+echo "configure:9581: 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 9585 "configure"
+#line 9586 "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
@@ -9592,7 +9593,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9625,15 +9626,15 @@
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:9629: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9632 "configure"
+echo "configure:9630: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9633 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9655,15 +9656,15 @@
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:9659: checking for ncurses/term.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9662 "configure"
+echo "configure:9660: checking for ncurses/term.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9663 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9693,15 +9694,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:9697: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9700 "configure"
+echo "configure:9698: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9701 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9736,12 +9737,12 @@
 	for lib in curses termlib termcap; do
 	  
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:9740: checking for tgetent in -l$lib" >&5
+echo "configure:9741: 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 9745 "configure"
+#line 9746 "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
@@ -9752,7 +9753,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9783,12 +9784,12 @@
       else
 	
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:9787: checking for tgetent in -lcurses" >&5
+echo "configure:9788: 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 9792 "configure"
+#line 9793 "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
@@ -9799,7 +9800,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9817,12 +9818,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:9821: checking for tgetent in -ltermcap" >&5
+echo "configure:9822: 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 9826 "configure"
+#line 9827 "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
@@ -9833,7 +9834,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9881,15 +9882,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:9885: checking for gpm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9888 "configure"
+echo "configure:9886: checking for gpm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9889 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9912,12 +9913,12 @@
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:9916: checking for Gpm_Open in -lgpm" >&5
+echo "configure:9917: 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 9921 "configure"
+#line 9922 "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
@@ -9928,7 +9929,7 @@
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:9932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9977,22 +9978,22 @@
 
 
 echo "checking for database support" 1>&6
-echo "configure:9981: checking for database support" >&5
+echo "configure:9982: checking for database support" >&5
 
 if test "$with_database_gnudbm" != "no"; then
   for ac_hdr in ndbm.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9988: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9991 "configure"
+echo "configure:9989: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9992 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10024,12 +10025,12 @@
   if test "$have_ndbm_h" = "yes"; then
     
 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:10028: checking for dbm_open in -lgdbm" >&5
+echo "configure:10029: 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 10033 "configure"
+#line 10034 "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
@@ -10040,7 +10041,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10063,10 +10064,10 @@
   fi
   if test "$with_database_gnudbm" != "yes"; then
     echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:10067: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10070 "configure"
+echo "configure:10068: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10071 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -10089,7 +10090,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -10125,10 +10126,10 @@
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:10129: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10132 "configure"
+echo "configure:10130: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10133 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -10151,7 +10152,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -10172,12 +10173,12 @@
   if test "$need_libdbm" != "no"; then
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:10176: checking for dbm_open in -ldbm" >&5
+echo "configure:10177: 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 10181 "configure"
+#line 10182 "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
@@ -10188,7 +10189,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10225,10 +10226,10 @@
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:10229: checking for dbopen" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10232 "configure"
+echo "configure:10230: checking for dbopen" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10233 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -10251,7 +10252,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -10272,12 +10273,12 @@
   if test "$need_libdb" != "no"; then
     
 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:10276: checking for dbopen in -ldb" >&5
+echo "configure:10277: checking for dbopen in -ldb" >&5
 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldb "
 cat > conftest.$ac_ext <<EOF
-#line 10281 "configure"
+#line 10282 "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
@@ -10288,7 +10289,7 @@
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:10292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10312,7 +10313,7 @@
   if test "$with_database_berkdb" = "yes"; then
     for path in "db/db.h" "db.h"; do
 cat > conftest.$ac_ext <<EOF
-#line 10316 "configure"
+#line 10317 "configure"
 #include "confdefs.h"
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
@@ -10330,7 +10331,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_path="$path"; break
 else
@@ -10382,12 +10383,12 @@
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:10386: checking for SOCKSinit in -lsocks" >&5
+echo "configure:10387: 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 10391 "configure"
+#line 10392 "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
@@ -10398,7 +10399,7 @@
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:10402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10455,15 +10456,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10459: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10462 "configure"
+echo "configure:10460: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10463 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10467: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10494,12 +10495,12 @@
 
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:10498: checking for dlopen in -ldl" >&5
+echo "configure:10499: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldl "
 cat > conftest.$ac_ext <<EOF
-#line 10503 "configure"
+#line 10504 "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
@@ -10510,7 +10511,7 @@
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:10514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10539,12 +10540,12 @@
  }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
-echo "configure:10543: checking for _dlopen in -lc" >&5
+echo "configure:10544: checking for _dlopen in -lc" >&5
 ac_lib_var=`echo c'_'_dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 10548 "configure"
+#line 10549 "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
@@ -10555,7 +10556,7 @@
 _dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:10559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10584,12 +10585,12 @@
  }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
-echo "configure:10588: checking for dlopen in -lc" >&5
+echo "configure:10589: checking for dlopen in -lc" >&5
 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 10593 "configure"
+#line 10594 "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
@@ -10600,7 +10601,7 @@
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:10604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10629,12 +10630,12 @@
  }
 test -z "$with_shlib" && { 
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:10633: checking for shl_load in -ldld" >&5
+echo "configure:10634: 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 10638 "configure"
+#line 10639 "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
@@ -10645,7 +10646,7 @@
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:10649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10674,12 +10675,12 @@
  }
 test -z "$with_shlib" && { 
 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
-echo "configure:10678: checking for dld_init in -ldld" >&5
+echo "configure:10679: 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 10683 "configure"
+#line 10684 "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
@@ -10690,7 +10691,7 @@
 dld_init()
 ; return 0; }
 EOF
-if { (eval echo configure:10694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10740,7 +10741,7 @@
 dll_oflags="-o "
 
 echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6
-echo "configure:10744: checking how to build a shared library" >&5
+echo "configure:10745: checking how to build a shared library" >&5
 case `uname -rs` in
 	UNIX_SV*|UNIX_System_V*)
 		dll_lflags="-G"
@@ -11008,7 +11009,6 @@
 
 
 
-
 RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'"
 
 
@@ -11521,9 +11521,8 @@
 s%@statedir@%$statedir%g
 s%@infodir_user_defined@%$infodir_user_defined%g
 s%@infopath@%$infopath%g
-s%@infopath_user_defined@%$infopath_user_defined%g
-s%@packagepath@%$packagepath%g
-s%@packagepath_user_defined@%$packagepath_user_defined%g
+s%@package_path@%$package_path%g
+s%@package_path_user_defined@%$package_path_user_defined%g
 s%@lispdir@%$lispdir%g
 s%@lispdir_user_defined@%$lispdir_user_defined%g
 s%@sitelispdir@%$sitelispdir%g
--- a/configure.in	Mon Aug 13 10:26:31 2007 +0200
+++ b/configure.in	Mon Aug 13 10:27:19 2007 +0200
@@ -329,20 +329,20 @@
 dnl are dropped from the list at runtime, so it is safe to add
 dnl directories to this list that you don't have at home.
 infopath='/usr/local/lib/texmf/doc/info:/usr/local/lib/texmf/info:/usr/lib/texmf/doc/info:/usr/lib/texmf/info:/usr/local/info:/usr/info'
-infopath_user_defined='no'
 lispdir='${datadir}/xemacs-${version}/lisp'
 lispdir_user_defined='no'
 sitelispdir='${datadir}/xemacs/site-lisp'
 sitelispdir_user_defined='no'
-packagepath='~/.xemacs::${datadir}/xemacs/mule-packages:${datadir}/xemacs-${version}/mule-packages:${datadir}/xemacs/packages:${datadir}/xemacs-${version}/packages'
-packagepath_user_defined='no'
+pkgdir='${datadir}/xemacs-${version}/lisp'
+package_path='~/.xemacs::${datadir}/xemacs-${version}/mule-packages:${datadir}/xemacs/mule-packages:${datadir}/xemacs-${version}/packages:${datadir}/xemacs/packages'
+package_path_user_defined='no'
 etcdir='${datadir}/xemacs-${version}/etc'
 etcdir_user_defined='no'
 lockdir='${statedir}/xemacs/lock'
 lockdir_user_defined='no'
 archlibdir='${libdir}/xemacs-${version}/${configuration}'
 archlibdir_user_defined='no'
-with_site_lisp='yes'
+with_site_lisp='no'
 with_menubars=''
 with_scrollbars=''
 with_dialogs=''
@@ -448,6 +448,7 @@
 
       dnl Process (many) boolean options
 	run_in_place	| \
+        with_site_lisp  | \
 	with_x		| \
 	with_x11	| \
 	with_msw	| \
@@ -683,7 +684,7 @@
 	dnl Has the user specified one of the path options?
 	prefix | exec_prefix | bindir | datadir | statedir | libdir | \
 	mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \
-	archlibdir | sitelispdir | docdir | packagepath )	
+	archlibdir | sitelispdir | docdir | package_path )	
 	   dnl If the value was omitted, get it from the next argument.
 	   if test "$valomitted" = "yes"; then
 	     if test "$#" = 0; then
@@ -702,8 +703,7 @@
              sitelispdir ) sitelispdir_user_defined=yes ;;
              etcdir  )  etcdir_user_defined=yes ;;
              infodir ) infodir_user_defined=yes ;;
-             infopath ) infopath_user_defined=yes ;;
-             packagepath ) packagepath_user_defined=yes ;;
+             package_path ) package_path_user_defined=yes ;;
              datadir ) lispdir_user_defined=yes etcdir_user_defined=yes ;;
              statedir | lockdir ) lockdir_user_defined=yes ;;
              exec_prefix | libdir | archlibdir ) archlibdir_user_defined=yes ;;
@@ -750,11 +750,6 @@
 dnl Finish options processing
 dnl -------------------------
 
-dnl Personal settings shouldn't affect the configuration process.
-dnl if test "$infopath_user_defined" = "no" -a -n "$INFOPATH" ; then
-dnl   infopath="$INFOPATH"
-dnl fi
-
 dnl Get the arguments back.  See the diatribe on Shell Magic above.
 eval set x "$quoted_arguments"; shift
 
@@ -1140,13 +1135,15 @@
       *-hp-hpux8*  )  opsys=hpux8  ;;
       *-hp-hpux9*  )  opsys=hpux9  ;;
       *-hp-hpux10* )  opsys=hpux10 ;;
+      *-hp-hpux11* )  opsys=hpux11 ;;
       *            )  opsys=hpux   ;;
     esac
 
     dnl HP has a broken "strcat"
     case "$opsys" in hpux9 | hpux10 ) XE_ADD_OBJS(strcat.o) ;; esac
 
-    if test "$opsys" = "hpux10"; then ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
+    if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \
+	ansi_flag="-Ae"; else ansi_flag="-Aa"; fi
     NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E"
 
     case "$canonical" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac
@@ -3408,9 +3405,8 @@
 AC_SUBST(infodir)
 AC_SUBST(infodir_user_defined)
 AC_SUBST(infopath)
-AC_SUBST(infopath_user_defined)
-AC_SUBST(packagepath)
-AC_SUBST(packagepath_user_defined)
+AC_SUBST(package_path)
+AC_SUBST(package_path_user_defined)
 AC_SUBST(lispdir)
 AC_SUBST(lispdir_user_defined)
 AC_SUBST(sitelispdir)
--- a/configure.usage	Mon Aug 13 10:26:31 2007 +0200
+++ b/configure.usage	Mon Aug 13 10:27:19 2007 +0200
@@ -124,23 +124,21 @@
 --mail-locking=TYPE (*)	Specify the locking to be used by movemail to prevent
 			concurrent updates of mail spool files. Valid types
 			are `lockf', `flock', and `file'.
+--with-site-lisp        Allow for a site-lisp directory in the XEmacs hierarchy 
+			searched before the installation packages.
 --package-path=PATH     Directories to search for packages to dump with xemacs.
-                        Defaults to `/usr/local/lib/xemacs/packages:~/.xemacs'.
+                        Defaults to
+   `~/.xemacs::/usr/local/lib/xemacs-${version}/mule-packages:/usr/local/lib/xemacs/mule-packages:/usr/local/lib/xemacs-${version}/packages:/usr/local/lib/xemacs/packages'.
+	                Components before the double colon (::) will not
+                        be seen at dump time.  They will also show up
+                        as the first thing in the various paths.
 --infodir=DIR		Directory to install the XEmacs Info manuals and dir in.
     Defaults to: `'.
 --infopath=PATH		Directories to search for Info documents, info dir
-			and localdir files.  This is used to initialize
-			`Info-default-directory-list' at dump time.
-			Directories on this path that do not exist in the
-			filesystem will be dropped by the startup code at
-			runtime, so it is safe to specify directories that do
-			not exist in the compilation environment, or that won't
-			exist in the runtime environment. The "dir"
-			file in the first existing directory in this list will
-			become the (dir)Top node of the Info tree.
+			and localdir files in case run-time searching
+                        for them fails.
     Defaults to the value of:
-    `/usr/local/info:/usr/info:/usr/local/lib/texmf/doc/info:/usr/lib/texmf/doc/
-info'.
+    `/usr/local/lib/texmf/doc/info:/usr/local/lib/texmf/info:/usr/lib/texmf/doc/info:/usr/lib/texmf/info:/usr/local/info:/usr/info'.
 
 Internationalization options:
 
@@ -205,11 +203,11 @@
 --with-system-malloc	Force use of the system malloc, rather than GNU malloc.
 --with-debug-malloc	Use the debugging malloc package.
 
-You may also specify any of the `path' variables found in
-Makefile.in, including --bindir, --libdir, --lispdir, --datadir, and
-so on.  Note that we recommend against explicitly setting any of these
-variables.  See the INSTALL file for a complete list plus the reasons
-we advise not changing them.
+You may also specify any of the `path' variables found in Makefile.in,
+including --bindir, --libdir, --lispdir, --sitelispdir, --datadir,
+--infodir, --mandir and so on.  Note that we recommend against
+explicitly setting any of these variables.  See the INSTALL file for a
+complete list plus the reasons we advise not changing them.
 
 If successful, configure leaves its status in config.status.  If
 unsuccessful after disturbing the status quo, it removes config.status.
--- a/lib-src/config.values.in	Mon Aug 13 10:26:31 2007 +0200
+++ b/lib-src/config.values.in	Mon Aug 13 10:27:19 2007 +0200
@@ -67,7 +67,6 @@
 infodir "@infodir@"
 infodir_user_defined "@infodir_user_defined@"
 infopath "@infopath@"
-infopath_user_defined "@infopath_user_defined@"
 internal_makefile_list "@internal_makefile_list@"
 ld "@ld@"
 ld_dynamic_link_flags "@ld_dynamic_link_flags@"
@@ -93,8 +92,8 @@
 native_sound_lib "@native_sound_lib@"
 oldincludedir "@oldincludedir@"
 opsysfile "@opsysfile@"
-packagepath "@packagepath@"
-packagepath_user_defined "@packagepath_user_defined@"
+package_path "@package_path@"
+package_path_user_defined "@package_path_user_defined@"
 pkgdir "@pkgdir@"
 prefix "@prefix@"
 program_transform_name "@program_transform_name@"
--- a/lisp/ChangeLog	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/ChangeLog	Mon Aug 13 10:27:19 2007 +0200
@@ -1,3 +1,67 @@
+1998-03-27  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* x-faces.el: Global X resources should override
+	  specs for all device classes (color, grayscale, mono);
+	  code currently doesn't override any of them.  Fixed by
+	  calling remove-specifier with '(x default) as the tag
+	  set and allowing inexact matches.
+
+1998-03-27  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* faces.el: Separated face intializations based on
+	  device classes into device type specific (tag set,
+	  instantiator) pairs.
+
+1998-03-09  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* wid-edit.el (widget-choice-action): Remember user's explicit
+	choice.
+	(widget-choice-value-create): Respect it.
+	From Richard Stallman <rms@gnu.org>
+
+1998-03-26  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* setup-paths.el (paths-construct-info-path): Always append
+	existing directories from configure-time info path.
+
+	* startup.el (startup-setup-paths): Renamed misnamed info-path to
+	Info-directory-list.
+
+	* info.el: Removed Info-default-directory-list which was broken by
+	design.
+	Removed bogus initialization of Info-directory-list---startup.el
+	can do a much better job.
+	Added autoload of Info-directory-list.
+
+	* setup-paths.el (paths-construct-load-path): Fixed a bug pointed
+	out by Martin Buchholz <martin@xemacs.org>: EMACSLOADPATH used to
+	be exclusive; now it's merely given precedence, just like in the
+	old days.
+
+1998-03-25  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* find-paths.el (paths-find-architecture-directory): Fix bug with
+	finding; it used to default too early.
+
+1998-03-25  Martin Buchholz <martin@xemacs.org>
+
+	* packages.el (packages-split-path): Fix a bug; it used to fail
+	for paths that weren't split.
+
+1998-03-26  SL Baur  <steve@altair.xemacs.org>
+
+	* finder.el (finder-compile-keywords): trap on errors.
+
+1998-03-24  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* x-faces.el (remove-specifier-specs-matching-tag-set-cdrs): Pass
+	  fourth argument of t so that only the specs exactly
+	  matching the tag lists are removed.
+
+1998-03-25  SL Baur  <steve@altair.xemacs.org>
+
+	* make-docfile.el: Don't discard the BOOTSTRAPLOADPATH.
+
 1998-03-23  SL Baur  <steve@altair.xemacs.org>
 
 	* minibuf.el (mouse-read-file-name-1): If a default directory was
--- a/lisp/faces.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/faces.el	Mon Aug 13 10:27:19 2007 +0200
@@ -1582,46 +1582,77 @@
 ;; the first non-stream device.
 
 (set-face-background 'text-cursor
-		     '(((default x) . "Red3")
-		       ((default mswindows) . "Red3"))
+		     '(((x default) . "Red3")
+		       ((mswindows default) . "Red3"))
 		     'global)
 
-;; some older servers don't recognize "darkseagreen2"
+;; some older X servers don't recognize "darkseagreen2"
 (set-face-background 'highlight
-		     '(((default color) . "darkseagreen2")
-		       ((default color) . "green")
-		       ((default grayscale) . "gray53"))
+		     '(((x default color) . "darkseagreen2")
+		       ((x default color) . "green")
+		       ((x default grayscale) . "gray53")
+		       ((mswindows default color) . "darkseagreen2")
+		       ((mswindows default color) . "green")
+		       ((mswindows default grayscale) . "gray53"))
 		     'global)
-(set-face-background-pixmap 'highlight "gray1" 'global '(default mono))
-
-(set-face-background 'zmacs-region "gray65" 'global '(default color))
-(set-face-background 'zmacs-region "gray65" 'global '(default grayscale))
-(set-face-background-pixmap 'zmacs-region "gray3" 'global '(default mono))
+(set-face-background-pixmap 'highlight
+			    '(((x default mono) . "gray1")
+			      ((mswindows default mono) . "gray1"))
+			    'global)
 
-(set-face-background 'list-mode-item-selected "gray68" 'global
-		     '(default color))
-(set-face-background 'list-mode-item-selected "gray68" 'global
-		     '(default grayscale))
+(set-face-background 'zmacs-region
+		     '(((x default color) . "gray65")
+		       ((x default grayscale) . "gray65")
+		       ((mswindows default color) . "gray65")
+		       ((mswindows default grayscale) . "gray65"))
+		     'global)
+(set-face-background-pixmap 'zmacs-region
+			    '(((x default mono) . "gray3")
+			      ((mswindows default mono) . "gray3"))
+			    'global)
+
 (set-face-background 'list-mode-item-selected
-		     [default foreground] 'global '(default mono))
+		     '(((x default color) . "gray68")
+		       ((x default grayscale) . "gray68")
+		       ((x default mono) . [default foreground])
+		       ((mswindows default color) . "gray68")
+		       ((mswindows default grayscale) . "gray68")
+		       ((mswindows default mono) . [default foreground]))
+		     'global)
 (set-face-foreground 'list-mode-item-selected
-		     [default background] 'global '(default mono))
+		     '(((x default mono) . [default background])
+		       ((mswindows default mono) . [default background]))
+		     'global)
 
-(set-face-background 'primary-selection "gray65" 'global '(default color))
-(set-face-background 'primary-selection "gray65" 'global '(default grayscale))
-(set-face-background-pixmap 'primary-selection "gray3" 'global '(default mono))
+(set-face-background 'primary-selection
+		     '(((x default color) . "gray65")
+		       ((x default grayscale) . "gray65")
+		       ((mswindows default color) . "gray65")
+		       ((mswindows default grayscale) . "gray65"))
+		     'global)
+(set-face-background-pixmap 'primary-selection
+			    '(((x default mono) . "gray3")
+			      ((mswindows default mono) . "gray3"))
+			    'global)
 
 (set-face-background 'secondary-selection
-		     '(((default color) . "paleturquoise")
-		       ((default color) . "green")
-		       ((default grayscale) . "gray53"))
+		     '(((x default color) . "paleturquoise")
+		       ((x default color) . "green")
+		       ((x default grayscale) . "gray53")
+		       ((mswindows default color) . "paleturquoise")
+		       ((mswindows default color) . "green")
+		       ((mswindows default grayscale) . "gray53"))
 		     'global)
-(set-face-background-pixmap 'secondary-selection "gray1" 'global
-			    '(default mono))
+(set-face-background-pixmap 'secondary-selection
+			    '(((x default mono) . "gray1")
+			      ((mswindows default mono) . "gray1"))
+			    'global)
 
 (set-face-background 'isearch
-		     '(((default color) . "paleturquoise")
-		       ((default color) . "green"))
+		     '(((x default color) . "paleturquoise")
+		       ((x default color) . "green")
+		       ((mswindows default color) . "paleturquoise")
+		       ((mswindows default color) . "green"))
 		     'global)
 
 (when (featurep 'tty)
--- a/lisp/find-paths.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/find-paths.el	Mon Aug 13 10:27:19 2007 +0200
@@ -157,12 +157,12 @@
    ;; from more to less specific
    (paths-find-version-directory roots
 				 (concat base system-configuration)
-				 envvar default)
+				 envvar)
+   (paths-find-version-directory roots
+				 base
+				 envvar)
    (paths-find-version-directory roots
 				 system-configuration
-				 envvar default)
-   (paths-find-version-directory roots
-				 base
 				 envvar default)))
   
 (defvar paths-path-emacs-version nil
--- a/lisp/finder.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/finder.el	Mon Aug 13 10:27:19 2007 +0200
@@ -179,8 +179,10 @@
 		      (buffer-disable-undo (current-buffer))
 		      (erase-buffer)
 		      (insert-file-contents (expand-file-name f d))
-		      (setq summary  (lm-synopsis)
-			    keywords (lm-keywords)))
+		      (condition-case err
+			  (setq summary  (lm-synopsis)
+				keywords (lm-keywords))
+			(t (message "finder: error processing %s %S" f err))))
 		    (if (not summary)
 			nil
 		      (insert (format "    (\"%s\"\n        " f))
--- a/lisp/info.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/info.el	Mon Aug 13 10:27:19 2007 +0200
@@ -259,8 +259,6 @@
 ;; Modified 5/9/1993 by Dave Gillespie:
 ;;
 ;; Merged in various things from FSF's latest Emacs 19 info.el.
-;; Notably:  Added Info-default-directory-list.
-
 
 ;; Modified 6/2/1993 by Dave Gillespie:
 ;;
@@ -375,19 +373,6 @@
   :type 'boolean
   :group 'info)
 
-(defvar Info-default-directory-list nil
-  "*List of directories to search for Info documents, and `dir' or `localdir' files.
-The value of `Info-default-directory-list' will be initialized to a
-reasonable default by the startup code, and usually doesn't need to be
-changed in your personal configuration, though you may do so if you
-like, and this is where to do that.
-
-The first directory on this list must contain a `dir' file like the one
-supplied with XEmacs, which will be used as the (dir)Top node.
-
-For more information, see the documentation to the variables:
-`Info-additional-search-directory-list' and `Info-directory-list'.")
-
 (defcustom Info-additional-search-directory-list nil
   "*List of additional directories to search for Info documentation
 files.  These directories are not searched for merging the `dir'
@@ -400,18 +385,14 @@
   "The filename of the XEmacs info for
 `Info-goto-emacs-command-node' (`\\<help-mode-map>\\[Info-goto-emacs-command-node]')")
 
-(defvar Info-directory-list
-  (let ((path (getenv "INFOPATH")))
-    (if path
-	(split-string path path-separator)
-      Info-default-directory-list))
+;;;###autoload
+(defvar Info-directory-list nil
   "List of directories to search for Info documentation files.
 
-The default is to use the environment variable INFOPATH if it exists,
-else to use `Info-default-directory-list'.  The first directory in
-this list, the \"dir\" file there will become the (dir)Top node of the
-Info documentation tree.  If you wish to modify the info search path,
-use `M-x customize-variable, Info-default-directory-list' to do so.")
+The first directory in this list, the \"dir\" file there will become
+the (dir)Top node of the Info documentation tree.  If you wish to
+modify the info search path, use `M-x customize-variable,
+Info-directory-list' to do so.")
 
 (defcustom Info-localdir-heading-regexp
     "^Locally installed XEmacs Packages:?"
@@ -832,8 +813,8 @@
       ;; If it doesn't work, fix it.
       (setq buffer (car buffers)
 	    ;; reverse it since they are pushed down from the top. the
-	    ;; `Info-default-directory-list'/INFOPATH can be specified
-	    ;; in natural order this way.
+	    ;; `Info-directory-list can be specified in natural order
+	    ;; this way.
 	    others (nreverse (cdr buffers)))
 
       ;; Insert the entire original dir file as a start; note that we've
--- a/lisp/make-docfile.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/make-docfile.el	Mon Aug 13 10:27:19 2007 +0200
@@ -79,14 +79,6 @@
 
 (setq load-path (decode-path-internal (getenv "EMACSBOOTSTRAPLOADPATH")))
 
-(let ((temp-path (expand-file-name "." (car load-path))))
-  (setq load-path (nconc (mapcar
-			  #'(lambda (i) (concat i "/"))
-			  (directory-files temp-path t "^[^-.]"
-					   nil 'dirs-only))
-			 (cons (file-name-as-directory temp-path)
-			       load-path))))
-
 ;; Then process the autoloads
 (setq autoload-file-name "auto-autoloads.elc")
 (setq source-directory (concat default-directory "../lisp"))
@@ -96,6 +88,10 @@
 (load "setup-paths.el")
 (load "dump-paths.el")
 
+(setq
+ load-path
+ (nconc load-path (decode-path-internal (getenv "EMACSBOOTSTRAPLOADPATH"))))
+
 (let (preloaded-file-list)
   (load (concat default-directory "../lisp/dumped-lisp.el"))
 
--- a/lisp/packages.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/packages.el	Mon Aug 13 10:27:19 2007 +0200
@@ -336,13 +336,13 @@
 (defun packages-split-path (path)
   "Split PATH at NIL, return pair with two components.
 The second component is shared with PATH."
-  (let ((reverse-early '()))
+  (let ((reverse-tail '()))
     (while (and path (null (null (car path))))
-      (setq reverse-early (cons (car path) reverse-early))
+      (setq reverse-tail (cons (car path) reverse-tail))
       (setq path (cdr path)))
     (if (null path)
-	(cons nil path)
-      (cons (reverse reverse-early) (cdr path)))))
+	(cons nil (nreverse reverse-tail))
+      (cons (nreverse reverse-tail) (cdr path)))))
 
 (defun packages-find-packages (package-path &optional inhibit)
   "Search for all packages in PACKAGE-PATH.
--- a/lisp/setup-paths.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/setup-paths.el	Mon Aug 13 10:27:19 2007 +0200
@@ -54,22 +54,23 @@
   (roots early-package-load-path late-package-load-path
 	 &optional inhibit-site-lisp)
   "Construct the load path."
-  (let ((envvar-value (getenv "EMACSLOADPATH")))
-    (if envvar-value
-	(decode-path-internal envvar-value)
-      (let* ((site-lisp-directory
-	      (and (null inhibit-site-lisp)
-		   (paths-find-site-lisp-directory roots)))
-	     (site-lisp-load-path
-	      (and site-lisp-directory
-		   (paths-find-recursive-load-path (list site-lisp-directory))))
-	     (lisp-directory (paths-find-lisp-directory roots))
-	     (lisp-load-path
-	      (paths-find-recursive-load-path (list lisp-directory))))
-	(append early-package-load-path
-		site-lisp-load-path
-		late-package-load-path
-		lisp-load-path)))))
+  (let* ((envvar-value (getenv "EMACSLOADPATH"))
+	 (env-load-path (and envvar-value
+			     (decode-path-internal envvar-value)))
+	 (site-lisp-directory
+	  (and (null inhibit-site-lisp)
+	       (paths-find-site-lisp-directory roots)))
+	 (site-lisp-load-path
+	  (and site-lisp-directory
+	       (paths-find-recursive-load-path (list site-lisp-directory))))
+	 (lisp-directory (paths-find-lisp-directory roots))
+	 (lisp-load-path
+	  (paths-find-recursive-load-path (list lisp-directory))))
+    (append env-load-path
+	    early-package-load-path
+	    site-lisp-load-path
+	    late-package-load-path
+	    lisp-load-path)))
 
 (defun paths-construct-info-path (roots early-packages late-packages)
   "Construct the info path."
@@ -79,15 +80,13 @@
    (let ((info-directory
 	  (paths-find-version-directory roots "info"
 					nil
-					(append
-					 (and configure-info-directory
-					      (list configure-info-directory))
-					 configure-info-path))))
+					configure-info-directory)))
      (and info-directory
 	  (list info-directory)))
    (let ((info-path-envval (getenv "INFOPATH")))
      (if info-path-envval
-	 (decode-path-internal info-path-envval)))))
+	 (decode-path-internal info-path-envval)
+       (paths-directories-which-exist configure-info-path)))))
 
 (defun paths-find-doc-directory (roots)
   "Find the documentation directory."
--- a/lisp/startup.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/startup.el	Mon Aug 13 10:27:19 2007 +0200
@@ -1027,7 +1027,8 @@
 					     late-package-load-path
 					     inhibit-site-lisp))
 
-  (setq info-path (paths-construct-info-path roots early-packages late-packages))
+  (setq Info-directory-list
+	(paths-construct-info-path roots early-packages late-packages))
 
   (if (boundp 'lock-directory)
       (progn
--- a/lisp/x-faces.el	Mon Aug 13 10:26:31 2007 +0200
+++ b/lisp/x-faces.el	Mon Aug 13 10:27:19 2007 +0200
@@ -518,67 +518,95 @@
     ;; done when the instancing actually happens, but I'm not
     ;; sure how it should actually be dealt with.
     (when fn
-      ;; Always use the x-tag-set to remove specs, since we don't
-      ;; know whether the predumped face was initialized with an
-      ;; 'x tag or not.
-      (remove-specifier-specs-matching-tag-set-cdrs (face-font face)
-						    locale
-						    x-tag-set)
+      (if device-class
+	  ;; Always use the x-tag-set to remove specs, since we don't
+	  ;; know whether the predumped face was initialized with an
+	  ;; 'x tag or not.
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-font face)
+							locale
+							x-tag-set)
+	;; If there's no device class then we're initializing
+	;; globally.  This means we should override global
+	;; defaults for all X device classes.
+	(remove-specifier (face-font face) locale x-tag-set nil))
       (set-face-font face fn locale nil append))
     ;; Kludge-o-rooni.  Set the foreground and background resources for
     ;; X devices only -- otherwise things tend to get all messed up
     ;; if you start up an X frame and then later create a TTY frame.
     (when fg
-      (remove-specifier-specs-matching-tag-set-cdrs (face-foreground face)
-						    locale
-						    x-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-foreground face)
+							locale
+							x-tag-set)
+	(remove-specifier (face-foreground face) locale x-tag-set nil))
       (set-face-foreground face fg locale 'x append))
     (when bg
-      (remove-specifier-specs-matching-tag-set-cdrs (face-background face)
-						    locale
-						    x-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-background face)
+							locale
+							x-tag-set)
+	(remove-specifier (face-background face) locale x-tag-set nil))
       (set-face-background face bg locale 'x append))
     (when bgp
-      (remove-specifier-specs-matching-tag-set-cdrs (face-background-pixmap
-						     face)
-						    locale
-						    x-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-background-pixmap
+							 face)
+							locale
+							x-tag-set)
+	(remove-specifier (face-background-pixmap face) locale x-tag-set nil))
       (set-face-background-pixmap face bgp locale nil append))
     (when ulp
-      (remove-specifier-specs-matching-tag-set-cdrs (face-property
-						     face 'underline)
-						    locale
-						    tty-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
+							 face 'underline)
+							locale
+							tty-tag-set)
+	(remove-specifier (face-propery face 'underline) locale
+			  tty-tag-set nil))
       (set-face-underline-p face ulp locale nil append))
     (when stp
-      (remove-specifier-specs-matching-tag-set-cdrs (face-property
-						     face 'strikethru)
-						    locale
-						    tty-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
+							 face 'strikethru)
+							locale
+							tty-tag-set)
+	(remove-specifier (face-propery face 'strikethru)
+			  locale tty-tag-set nil))
       (set-face-strikethru-p face stp locale nil append))
     (when hp
-      (remove-specifier-specs-matching-tag-set-cdrs (face-property
-						     face 'highlight)
-						    locale
-						    tty-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
+							 face 'highlight)
+							locale
+							tty-tag-set)
+	(remove-specifier (face-propery face 'highlight)
+			  locale tty-tag-set nil))
       (set-face-highlight-p face hp locale nil append))
     (when dp
-      (remove-specifier-specs-matching-tag-set-cdrs (face-property
-						     face 'dim)
-						    locale
-						    tty-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
+							 face 'dim)
+							locale
+							tty-tag-set)
+	(remove-specifier (face-property face 'dim) locale tty-tag-set nil))
       (set-face-dim-p face dp locale nil append))
     (when bp
-      (remove-specifier-specs-matching-tag-set-cdrs (face-property
-						     face 'blinking)
-						    locale
-						    tty-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
+							 face 'blinking)
+							locale
+							tty-tag-set)
+	(remove-specifier (face-propery face 'blinking) locale
+			  tty-tag-set nil))
       (set-face-blinking-p face bp locale nil append))
     (when rp
-      (remove-specifier-specs-matching-tag-set-cdrs (face-property
-						     face 'reverse)
-						    locale
-						    tty-tag-set)
+      (if device-class
+	  (remove-specifier-specs-matching-tag-set-cdrs (face-property
+							 face 'reverse)
+							locale
+							tty-tag-set)
+	(remove-specifier (face-property face 'reverse) locale
+			  tty-tag-set nil))
       (set-face-reverse-p face rp locale nil append))
     ))
 
@@ -587,7 +615,7 @@
 
 (defun remove-specifier-specs-matching-tag-set-cdrs (specifier locale tag-set)
   (while tag-set
-    (remove-specifier specifier locale tag-set)
+    (remove-specifier specifier locale tag-set t)
     (setq tag-set (cdr tag-set))))
 
 ;;; x-init-global-faces is responsible for ensuring that the
--- a/man/ChangeLog	Mon Aug 13 10:26:31 2007 +0200
+++ b/man/ChangeLog	Mon Aug 13 10:27:19 2007 +0200
@@ -1,3 +1,7 @@
+1998-03-27  Stephen Turnbull  <turnbull@sk.tsukuba.ac.jp>
+
+	* xemacs/frame.texi: Document cursor appearance at end of line.
+
 1998-03-14  Hrvoje Niksic  <hniksic@srce.hr>
 
 	* internals/internals.texi (GCPROing): Explain when it is
--- a/man/xemacs/frame.texi	Mon Aug 13 10:26:31 2007 +0200
+++ b/man/xemacs/frame.texi	Mon Aug 13 10:27:19 2007 +0200
@@ -86,9 +86,14 @@
 
   While the cursor appears to point @var{at} a character, you should
 think of point as @var{between} two characters: it points @var{before}
-the character on which the cursor appears.  Sometimes people speak
-of ``the cursor'' when they mean ``point,'' or speak of commands that
-move point as ``cursor motion'' commands.
+the character on which the cursor appears.  The exception is at the
+end of the line, where the cursor appears after the last character of
+the line.  Where the display is capable, the cursor at the end of the
+line will appear differently from a cursor over whitespace at the end
+of the line.  (In an X Windows frame, the end-of-line cursor is half
+the width of a within-line cursor.)  Sometimes people speak of ``the
+cursor'' when they mean ``point,'' or speak of commands that move
+point as ``cursor motion'' commands.
 
  Each XEmacs frame has only one cursor.  When output is in progress, the cursor
 must appear where the typing is being done.  This does not mean that
--- a/nt/ChangeLog	Mon Aug 13 10:26:31 2007 +0200
+++ b/nt/ChangeLog	Mon Aug 13 10:27:19 2007 +0200
@@ -1,3 +1,8 @@
+1998-03-25  jhar@tardis.ed.ac.uk
+
+	* xemacs.mak: Adds glyphs-msw.c and imgproc.c and reflects
+	alterations to package_path in nt/xemacs.mak.
+
 1998-03-24  Kirill M. Katsnelson  <kkm@kis.ru>
 
 	* xemacs.mak (dump-xemacs): Replaced use of `touch' with `echo'.
--- a/nt/xemacs.mak	Mon Aug 13 10:26:31 2007 +0200
+++ b/nt/xemacs.mak	Mon Aug 13 10:27:19 2007 +0200
@@ -1,6 +1,6 @@
 XEMACS=..
 LISP=$(XEMACS)\lisp
-PACKAGE_PATH="~/.xemacs;f:/src/xemacs/packages"
+PATH_PACKAGEPATH="~/.xemacs;;d:/src/xemacs/packages"
 HAVE_X=0
 HAVE_MSW=1
 
@@ -220,6 +220,7 @@
  $(XEMACS)\src\gmalloc.c \
  $(XEMACS)\src\gui.c  \
  $(XEMACS)\src\hash.c \
+ $(XEMACS)\src\imgproc.c \
  $(XEMACS)\src\indent.c \
  $(XEMACS)\src\inline.c \
  $(XEMACS)\src\insdel.c \
@@ -298,6 +299,7 @@
  $(XEMACS)\src\device-msw.c  \
  $(XEMACS)\src\event-msw.c  \
  $(XEMACS)\src\frame-msw.c \
+ $(XEMACS)\src\glyphs-msw.c \
  $(XEMACS)\src\menubar-msw.c \
  $(XEMACS)\src\objects-msw.c \
  $(XEMACS)\src\redisplay-msw.c \
@@ -365,7 +367,7 @@
  -DEMACS_BETA_VERSION=$(emacs_beta_version) \
  -DXEMACS_CODENAME=\"$(xemacs_codename)\" \
  -DPATH_PREFIX=\"$(XEMACS)\" \
- -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
+ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\"
 
 TEMACS_FLAGS=-nologo -ML $(WARN_CPP_FALGS) $(OPT) -c $(TEMACS_CPP_FLAGS)
 
@@ -400,6 +402,7 @@
 	$(OUTDIR)\device-msw.obj \
 	$(OUTDIR)\event-msw.obj \
 	$(OUTDIR)\frame-msw.obj \
+	$(OUTDIR)\glyphs-msw.obj \
 	$(OUTDIR)\menubar-msw.obj \
 	$(OUTDIR)\objects-msw.obj \
 	$(OUTDIR)\redisplay-msw.obj \
@@ -474,6 +477,7 @@
 	$(OUTDIR)\gui.obj \
 	$(OUTDIR)\hash.obj \
 	$(OUTDIR)\indent.obj \
+	$(OUTDIR)\imgproc.obj \
 	$(OUTDIR)\inline.obj \
 	$(OUTDIR)\insdel.obj \
 	$(OUTDIR)\intl.obj \
@@ -562,7 +566,7 @@
 
 $(DOC): $(LIB_SRC)\make-docfile.exe
 	-del $(DOC)
-	!$(TEMACS) -batch -l make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages
+	!$(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages
 	!$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC1)
 	!$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC2)
 	!$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC3)
@@ -577,7 +581,8 @@
 	copy Installation.el $(LISP)
 
 update-elc: $(LISP)\Installation.el
-	!$(TEMACS) -batch -l update-elc.el
+	set EMACSBOOTSTRAPLOADPATH=$(LISP)
+	!$(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\update-elc.el
 
 rebuild: $(TEMACS_DIR)\puresize-adjust.h
         !nmake -nologo -f xemacs.mak dump-xemacs
@@ -585,11 +590,12 @@
 # This rule dumps xemacs and then checks to see if a rebuild is required due
 # to changing PURESPACE requirements.
 dump-xemacs: $(TEMACS)
-        !echo >rebuild
-        cd $(TEMACS_DIR)
-        !$(TEMACS) -batch -l loadup.el dump
-        cd $(XEMACS)\nt
-        !nmake -nologo -f xemacs.mak rebuild
+	!echo >rebuild
+	cd $(TEMACS_DIR)
+	set EMACSBOOTSTRAPLOADPATH=$(LISP)
+	!$(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\loadup.el dump
+	cd $(XEMACS)\nt
+	!nmake -nologo -f xemacs.mak rebuild
 
 #------------------------------------------------------------------------------
 
--- a/src/ChangeLog	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/ChangeLog	Mon Aug 13 10:27:19 2007 +0200
@@ -1,3 +1,283 @@
+Sat Mar 28 10:16:29 1998  Andy Piper  <andyp@parallax.co.uk>
+
+	* Makefile.in.in: fix fastdump target
+
+	* console-msw.h: add memory dc to frame.
+
+	* frame-msw.c: manage memory dc on frame creation/deleteion
+
+	* frame.h: mess with toolbar macros so that xemacs doesn't die
+	in redisplay with a triple build.
+
+	* g;yphs-msw.c: GNUize the code. Fix 24bpp display and make the
+	default.
+
+	* glyphs-msw.h: remove memory dc from image attributes.
+
+	* redisplay-msw.c: fix redisplay to use new frame memory dc.
+
+	* sheap.c: bump initial sheap yet again to allow byyte
+	recompilation.
+
+	* unexcw.c: fix section parsing for multiple idata and rdata
+	sections.
+
+1998-03-27  SL Baur  <steve@altair.xemacs.org>
+
+	* emacs.c: Enabled free-hook.c code if
+	LOSING_GCC_DESTRUCTOR_FREE_BUG is defined.
+
+1998-03-28  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* Fixed display bug where changes to builtin glyphs like
+	  Vcontrol_arrow_glyph would not be propagated
+	  immediately to the display.
+
+	* device.h: Added glyphs_changed field to device
+	   struct.  Created MARK_DEVICE_GLYPHS_CHANGED macro.
+
+	* frame.h: Added glyphs_changed field to frame
+	   struct.  Created MARK_FRAME_GLYPHS_CHANGED macro.
+
+	* redisplay.h: Declared glyph_changed and
+	   glyph_changed_set variables, mimicking clip_changed
+	   and clip_changed_set.  New macro MARK_GLYPHS_CHANGED.
+
+	* redisplay.c: Defined glyph_changed and
+	   glyph_changed_set variables, mimicking
+	   clip_changed and clip_changed_set.
+
+	   (redisplay_window): Reset the window's glyph cache is 
+	   f->glyphs_changed is non-zero.  Call regenerate_window 
+	   if f->glyphs_changed is non-zero.
+
+	   (redisplay_frame): Clear f->glyphs_changed after
+	   successful redisplay of all windows on frame.
+
+	   (redisplay_device): Redisplay frame if f->glyphs_changed
+	   is non-zero.  Clear d->glyphs_changed after successful
+	   redisplay of all frames on device
+
+	   (redisplay_without_hooks): Redisplay devices if
+	   glyphs_changed is non-zero.  Redisplay an individual
+	   device if d->glyphs_changed is non-zero.  Clear
+	   glyphs_changed after successful redisplay of all
+	   devices.
+
+	   (redisplay_glyphs_changed): Dropped use of
+	   MARK_CLIP_CHANGED.  Call MARK_FRAME_GLYPHS_CHANGED for
+	   all affected frames.  For locales that are not device
+	   related, mark all frames.
+
+	* redisplay-output.c (compare_display_blocks):
+	   Output the whole display block if f->glyphs_changed is 
+	   non-nil.
+
+1998-03-27  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* callproc.c (Fcall_process_internal): In the case where 
+	  fd_error and fd1 are the same don't close that
+	  descriptor twice.
+
+1998-03-27  SL Baur  <steve@altair.xemacs.org>
+
+	* frame-x.c (x_update_frame_external_traits): Need a Lisp_Object
+	frame as well as a struct frame.
+
+1998-03-27  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* emacs.c (main_1): Reinstated PATH searching for invocation data.
+
+1998-03-26  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* menubar.c (Fmenu_find_real_submenu): See the entry for gui.h.
+
+	* menubar-msw.c (populate_menu_add_item): Used GCPRO_GUI_ITEM
+	macro to aviod warnings, in 2 places.
+	(populate_or_checksum_helper): Ditto
+	(populate_or_checksum_helper): Added placeholder for menu right
+	flash customization.
+
+	* gui.h (GCPRO_GUI_ITEM): Code which warning-free GC protects a
+	GUI_ITEM structure moved into this macro from menubar.c
+
+	* frame-x.c (x_update_frame_external_traits): Moved part of the
+	former update_EmacsFrame() here.
+	(console_type_create_frame_x): Declared the above method.
+
+	* frame-msw.c (mswindows_set_frame_properties): Do not try to
+	resize the frame if called from Fmake_frame the first time
+	(potential race	condition).
+	(mswindows_init_frame_1): Fixed support for popup frames.
+	(mswindows_delete_frame): Fixed memory leak.
+	(mswindows_get_frame_parent): Implemented.
+	(mswindows_update_frame_external_traits): Moved part of the former 
+	update_EmacsFrame() here.
+	(console_type_create_frame_mswindows): Declare get_frame_parent
+	and update_frame_external_traits methods.
+
+	* faces.c (update_EmacsFrame): Converted into a device method
+	`update_frame_external_traits'.
+
+	* event-msw.c (mswindows_wnd_proc, WM_SIZE): Rewrote to avoid
+	relying on an assumption on when Windows calls this handler.
+	(mswindows_find_frame): Return the frame being created if the
+	windows does not yet have associated frame object
+	(mswindows_find_frame): Casted long to Lisp_Object properly.
+
+	* device.c (window_system_pixelated_geometry): Changed to call the 
+	device_implementation_flags device method.
+
+	* device-msw.c (mswindows_device_implementation_flags):
+	Implemented. 
+	(console_type_create_device_mswindows): Declared the above.
+
+	* console.h (struct console_methods): Added
+	device_implementation_flags_method and
+	update_frame_external_traits_method. 
+	Defined flags retuned by device_implementation_flags_method.
+
+	* console-msw.h (struct mswindows_frame): Added charheight and
+	charwidth fields.
+	Added macros for referring to these two, Rvalue.
+	Moved Windows-specific macros from frame.h here.
+	(typedef struct XEMACS_RECT_WH): Added.
+	Declared global variables.
+	
+1998-03-19  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* console-msw.h: Added prototypes for
+	mswindows_protect_modal_loop() and
+	mswindows_unmodalize_signal_maybe().
+
+	* scrollbar-msw.c (mswindows_update_scrollbar_instance_status):
+	Removed redundant call to set_frame_size method.
+
+	* frame.c (Fframe_property): For a window system with pixel-based
+	geometry, convert passed char-based metrics to pixels.
+	(Fframe_properties): Ditto.
+	(Fset_frame_height): Ditto.
+	(Fset_frame_width): Ditto.
+	(Fset_frame_size): Ditto.
+	(frame_conversion_internal): Added a parameter, controlling
+	whether the function uses real char metrics or 1 when geometry is
+	pixel-based.
+	Allow NULL for output int* params.
+	(pixel_to_char_size): frame_conversion_internal() is called with
+	indication to fake font size to 1.
+	(char_to_pixel_size): Ditto.
+	(round_size_to_char): Ditto.
+	(pixel_to_real_char_size): 
+	(char_to_real_pixel_size): 
+	(round_size_to_real_char): New three counterparts of the above
+	metioned functions, which always use real character metrics.
+	(change_frame_size_1): Use real character metrics when computing
+	minibuffer height.
+
+	* frame.h: Prototypes for pixel_to_real_char_size(),
+	char_to_real_pixel_size(), round_size_to_real_char().
+
+	* frame-msw.c (mswindows_init_frame_1): Rewritten to support
+	system-default new window width and height.
+	(mswindows_init_frame_2): Commented out, unused.
+	(mswindows_after_init_frame): Added frame method.
+	(mswindows_set_frame_size): Reworked to support pixel base
+	geometry. 
+	(mswindows_set_frame_position): Cahnged to use SetWindowPos.
+	(mswindows_lower_frame): Ditto.
+	(mswindows_set_frame_properties): Fixed to perform correct
+	calculation, and to support pixel geometry.
+	(console_type_create_frame_mswindows): init_frame_2 removed,
+	after_init_frame added.
+
+	* faces.c (default_face_height_and_width_1): Added.
+	(update_EmacsFrame): Changed method of notifying mswindwows frame, 
+	so modeline border gets redrawn.
+
+	* faces.h: Prototype for default_face_height_and_width_1().
+
+	* event-msw.c (mswindows_wnd_proc, WM_SIZE): Redisplay after
+	maximize/restore window.
+	(mswindows_wnd_proc, WM_WINDOWPOSCHANGING): Do not round size to
+	char if window is maximized.
+	Use real char metrics for rounding.
+	Call DefWindowProc to process WM_GETMINMAXINFO
+	(mswindows_set_chord_timer): Changed chord timeout from 1/2 to 1/3 
+	system double click time
+
+	* device.c (domain_device_type): New function.
+	(window_system_pixelated_geometry): New function. 
+	(Fdomain_device_type): New function, lisp interface to
+	domain_device_type(). 
+	(syms_of_device): DEFSUBRed the above.
+
+	* device.h: Ptorotypes for domain_device_type() and
+	window_system_pixelated_geometry().
+
+	* menubar-msw.c (mswindows_update_frame_menubars): Call
+	update_frame_menubar_maybe always.
+
+1998-03-27  SL Baur  <steve@altair.xemacs.org>
+
+	* s/hpux11.h:
+	* s/hpux11-shr.h: New files.
+	From Marcus Thiessel <marcus_thiessel@hp.com>
+
+	* Makefile.in.in: temporarily comment -lmcheck support.
+	Suggested by Marcus Thiessel <marcus_thiessel@hp.com>
+
+1998-03-26  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* emacs.c (vars_of_emacs): Fixed bug: Now respects configure
+	setting of inhibit-site-lisp.
+	(main_1): inhibit-site-lisp is now exclusively
+	configure-initialized.
+
+1998-03-27  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): Don't feed
+	error_with_frob() with LispObjects.
+
+1998-03-26  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* redisplay-msw.c (mswindows_output_cursor): Added parameters for
+	character under cursor, and a flag indicating whether the cursir
+	is over an image. Draw bar cursor always over an image glyph.
+	Callers are changed accross the file.
+	Honor the value of window::text_cursor_visible_p.
+	(mswindows_output_pixmap): Cursor drawing code #if0ed.
+	(mswindows_output_display_block): Call to output cursor after
+	drawind an image.
+
+1998-03-27  P. E. Jareth Hein  <jareth@camelot-soft.com>
+
+	* glyphs-x.c: 
+	* imgproc.c:
+	* imgproc.h:
+	* glyphs-x.h: Added in a colormap variable in the X specific image
+	struct to handle IMAGE_POINTER images which must be allocated in the
+	default colormap of the screen.  Also reformated the code to follow
+	coding standards.
+
+	* glyphs.h:
+	* glyphs.c: 
+	* glyphs-x.c: added image-conversion-error type
+
+	* objects-x.c (allocate_nearest_color): Corrected a minor bug involving
+	setting the values into XColor.
+
+1998-03-25  P. E. Jareth Hein  <jareth@camelot-soft.com>
+
+	* free-hook.c (check_realloc): Handle the degerate case of realloc with
+	a NULL value acting the same as malloc.
+
+1998-03-24  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* redisplay-x.c (x_output_eol_cursor): Use x_clear_region
+	  instead of XClearArea to erase the cursor so that background
+	  pixmaps are handled properly.  New fourth parameter findex
+	  added so that it can be passed to x_clear_region.
+
 1998-03-25  Kirill M. Katsnelson  <kkm@kis.ru>
 
 	* process.c (Fprocess_send_eof): Close output stream before
@@ -82,13 +362,6 @@
 
 1998-03-09  Hrvoje Niksic  <hniksic@srce.hr>
 
-	* wid-edit.el (widget-choice-action): Remember user's explicit
-	choice.
-	(widget-choice-value-create): Respect it.
-	From Richard Stallman <rms@gnu.org>
-
-1998-03-09  Hrvoje Niksic  <hniksic@srce.hr>
-
 	* lread.c (read_atom): Ditto.
 
 	* symbols.c (reject_constant_symbols): Do the keyword stunts only
--- a/src/Makefile.in.in	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/Makefile.in.in	Mon Aug 13 10:27:19 2007 +0200
@@ -70,7 +70,7 @@
 start_flags=@start_flags@
 LD=@ld@
 lib_gcc=@lib_gcc@
-#libmcheck=@libmcheck@
+##libmcheck=@libmcheck@
 
 #define NOT_C_CODE
 #include "config.h"
@@ -328,7 +328,7 @@
 
 fastdump: temacs 
 	@$(RM) xemacs && touch SATISFIED
-	-$(DUMPENV) ./temacs -batch -l loadup.el dump
+	-$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
 	@if test -f xemacs;        then if test -f SATISFIED; then \
 		./xemacs -batch -vanilla -f list-load-path-shadows; fi; \
 		$(RM) SATISFIED; exit 0; fi; \
--- a/src/console-msw.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/console-msw.h	Mon Aug 13 10:27:19 2007 +0200
@@ -111,6 +111,9 @@
   /* DC for this win32 window */
   HDC hdc;
 
+  /* compatibke DC for bitmap operations */
+  HDC cdc;
+
   /* Time of last click event, for button 2 emul */
   DWORD last_click_time;
 
@@ -123,6 +126,10 @@
   /* Menu checksum. See menubar-msw.c */
   unsigned int menu_checksum;
 
+  /* Real character width and height of the frame.
+     FRAME_{HEIGHT,WIDTH} do not work for pixel geometry! */
+  int charheight, charwidth;
+
   /* Misc flags */
   int button2_need_lbutton : 1;
   int button2_need_rbutton : 1;
@@ -138,6 +145,13 @@
 #define FRAME_MSWINDOWS_DC(f)		  (FRAME_MSWINDOWS_DATA (f)->hdc)
 #define FRAME_MSWINDOWS_MENU_HASHTABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hashtable)
 #define FRAME_MSWINDOWS_MENU_CHECKSUM(f)  (FRAME_MSWINDOWS_DATA (f)->menu_checksum)
+#define MSWINDOWS_FRAME_CHARWIDTH(f)	  (FRAME_MSWINDOWS_DATA (f)->charwidth)
+#define MSWINDOWS_FRAME_CHARHEIGHT(f)	  (FRAME_MSWINDOWS_DATA (f)->charheight)
+
+/* Frame check and validation macros */
+#define FRAME_MSWINDOWS_P(frm) CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm))
+#define CHECK_MSWINDOWS_FRAME(z) CHECK_FRAME_TYPE (z, mswindows)
+#define CONCHECK_MSWINDOWS_FRAME(z) CONCHECK_FRAME_TYPE (z, mswindows)
 
 /* win32 window LONG indices */
 #define XWL_FRAMEOBJ	0
@@ -182,5 +196,20 @@
 void mswindows_enqueue_magic_event (HWND hwnd, UINT message);
 Lisp_Object mswindows_cancel_dispatch_event (struct Lisp_Event* event);
 Lisp_Object mswindows_pump_outstanding_events (void);
+Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun) (Lisp_Object barg),
+					  Lisp_Object barg);
+void mswindows_unmodalize_signal_maybe (void);
+
+/* #### This wants to go to lisp.h */
+typedef struct
+{
+  int left;
+  int top;
+  int width;
+  int height;
+} XEMACS_RECT_WH;
+
+extern XEMACS_RECT_WH mswindows_frame_target_rect;
+extern Lisp_Object mswindows_frame_being_created;
 
 #endif /* _XEMACS_CONSOLE_MSW_H_ */
--- a/src/console.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/console.h	Mon Aug 13 10:27:19 2007 +0200
@@ -76,6 +76,7 @@
   int (*device_mm_height_method) (struct device *);
   int (*device_bitplanes_method) (struct device *);
   int (*device_color_cells_method) (struct device *);
+  unsigned int (*device_implementation_flags_method) ();
 
   /* frame methods */
   Lisp_Object *device_specific_frame_props;
@@ -111,6 +112,7 @@
   void (*set_frame_icon_method) (struct frame *f);
   void (*popup_menu_method) (Lisp_Object menu, Lisp_Object event);
   Lisp_Object (*get_frame_parent_method) (struct frame *f);
+  void (*update_frame_external_traits_method) (struct frame *f, Lisp_Object name);
 
   /* redisplay methods */
   int (*left_margin_width_method) (struct window *);
@@ -254,6 +256,13 @@
 #endif
 };
 
+/*
+ * Constants returned by device_implementation_flags_method
+ */
+/* Set when device uses pixel-based geometry */
+#define XDEVIMPF_PIXEL_GEOMETRY	  0x00000001L
+
+
 #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name)
 #define CONSOLE_TYPE(c) ((c)->conmeths->symbol)
 #define CONMETH_TYPE(meths) ((meths)->symbol)
--- a/src/device-msw.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/device-msw.c	Mon Aug 13 10:27:19 2007 +0200
@@ -57,7 +57,6 @@
 
 Lisp_Object Qinit_pre_mswindows_win, Qinit_post_mswindows_win;
 
-
 static void
 mswindows_init_device (struct device *d, Lisp_Object props)
 {
@@ -166,6 +165,11 @@
   return(DEVICE_MSWINDOWS_CELLS(d));
 }
 
+static unsigned int
+mswindows_device_implementation_flags (void)
+{
+  return XDEVIMPF_PIXEL_GEOMETRY;
+}
 
 /************************************************************************/
 /*                            initialization                            */
@@ -204,6 +208,7 @@
   CONSOLE_HAS_METHOD (mswindows, device_mm_height);
   CONSOLE_HAS_METHOD (mswindows, device_bitplanes);
   CONSOLE_HAS_METHOD (mswindows, device_color_cells);
+  CONSOLE_HAS_METHOD (mswindows, device_implementation_flags);
 }
 
 void
--- a/src/device.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/device.c	Mon Aug 13 10:27:19 2007 +0200
@@ -965,6 +965,64 @@
   return make_int (DEVICE_BAUD_RATE (decode_device (device)));
 }
 
+Lisp_Object
+domain_device_type (Lisp_Object domain)
+{
+  /* This cannot GC */
+  assert (WINDOWP (domain) || FRAMEP (domain)
+	  || DEVICEP (domain) || CONSOLEP (domain));
+
+  if (WINDOWP (domain))
+    {
+      if (!WINDOW_LIVE_P (XWINDOW (domain)))
+	return Qdead;
+      domain = WINDOW_FRAME (XWINDOW (domain));
+    }
+  if (FRAMEP (domain))
+    {
+      if (!FRAME_LIVE_P (XFRAME (domain)))
+	return Qdead;
+      domain = FRAME_DEVICE (XFRAME (domain));
+    }
+  if (DEVICEP (domain))
+    {
+      if (!DEVICE_LIVE_P (XDEVICE (domain)))
+	return Qdead;
+      domain = DEVICE_CONSOLE (XDEVICE (domain));
+    }
+  return CONSOLE_TYPE (XCONSOLE (domain));
+}
+
+/*
+ * Determine whether window system bases window geometry on character
+ * or pixel counts.
+ * Return non-zero for pixel-based geometry, zero for character-based.
+ */
+int
+window_system_pixelated_geometry (Lisp_Object domain)
+{
+  /* This cannot GC */
+  Lisp_Object winsy = domain_device_type (domain);
+  struct console_methods *meth = decode_console_type (winsy, ERROR_ME_NOT);
+  assert (meth);
+  return (MAYBE_INT_CONTYPE_METH (meth, device_implementation_flags, ())
+	  & XDEVIMPF_PIXEL_GEOMETRY);
+}
+
+DEFUN ("domain-device-type", Fdomain_device_type, 0, 1, 0, /*
+Return the device type symbol for a DOMAIN, e.g. 'x or 'tty.
+DOMAIN can be either a window, frame, device or console.
+*/
+       (domain))
+{
+  if (!WINDOWP (domain) && !FRAMEP (domain)
+      && !DEVICEP (domain) && !CONSOLEP (domain))
+    signal_simple_error
+      ("Domain must be either a window, frame, device or console", domain);
+
+  return domain_device_type (domain);
+}
+
 void
 handle_asynch_device_change (void)
 {
@@ -1052,6 +1110,7 @@
   DEFSUBR (Fdevice_color_cells);
   DEFSUBR (Fset_device_baud_rate);
   DEFSUBR (Fdevice_baud_rate);
+  DEFSUBR (Fdomain_device_type);
 
   defsymbol (&Qdevicep, "devicep");
   defsymbol (&Qdevice_live_p, "device-live-p");
--- a/src/device.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/device.h	Mon Aug 13 10:27:19 2007 +0200
@@ -166,6 +166,7 @@
   unsigned int extents_changed :1;
   unsigned int faces_changed :1;
   unsigned int frame_changed :1;
+  unsigned int glyphs_changed :1;
   unsigned int icon_changed :1;
   unsigned int menubar_changed :1;
   unsigned int modeline_changed :1;
@@ -336,6 +337,10 @@
   faces_changed = 1;							\
   (d)->faces_changed = 1; } while (0)
 
+#define MARK_DEVICE_GLYPHS_CHANGED(d) do {				\
+  glyphs_changed = 1;							\
+  (d)->glyphs_changed = 1; } while (0)
+
 #define MARK_DEVICE_TOOLBARS_CHANGED(d) do {				\
   toolbar_changed = 1;							\
   (d)->toolbar_changed = 1; } while (0)
@@ -395,5 +400,7 @@
 void io_error_delete_device (Lisp_Object device);
 Lisp_Object find_nonminibuffer_frame_not_on_device (Lisp_Object device);
 void set_device_selected_frame (struct device *d, Lisp_Object frame);
+Lisp_Object domain_device_type (Lisp_Object domain);
+int window_system_pixelated_geometry (Lisp_Object domain);
 
 #endif /* _XEMACS_DEVICE_H_ */
--- a/src/emacs.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/emacs.c	Mon Aug 13 10:27:19 2007 +0200
@@ -104,6 +104,9 @@
 Lisp_Object Vemacs_beta_version;
 Lisp_Object Vxemacs_codename;
 
+/* The path under which XEmacs was invoked. */
+Lisp_Object Vinvocation_path;
+
 /* The name under which XEmacs was invoked, with any leading directory
    names discarded.  */
 Lisp_Object Vinvocation_name;
@@ -539,11 +542,16 @@
       printf ("malloc jumpstart failed!\n");
 #endif /* NeXT */
 
+  /*
 #if defined (GNU_MALLOC) && \
     defined (ERROR_CHECK_MALLOC) && \
     !defined (HAVE_LIBMCHECK)
-  /* Prior to XEmacs 21, this was `#if 0'ed out.  I'm putting it back in
-     because it provides extremely valuable debugging code. -slb */
+  */
+#if defined(LOSING_GCC_DESTRUCTOR_FREE_BUG)
+  /* Prior to XEmacs 21, this was `#if 0'ed out.  */
+  /* I'm enabling this because it is the only reliable way I've found to */
+  /* prevent a very annoying problem where GCC will attempt to free(3) */
+  /* memory at exit() and cause a coredump. */
   init_free_hook ();
 #endif
 
@@ -685,7 +693,6 @@
     {
       /* Inhibit everything */
       inhibit_package_init = 1;
-      inhibit_site_lisp = 1;
       inhibit_update_autoloads = 1;
       inhibit_update_dumped_lisp = 1;
       skip_args--;
@@ -992,10 +999,13 @@
       syms_of_btl ();
 #endif
 
+      /*
 #if defined (GNU_MALLOC) && \
     defined (ERROR_CHECK_MALLOC) && \
     !defined (HAVE_LIBMCHECK)
+      */
       /* Prior to XEmacs 21, this was `#if 0'ed out. -slb */
+#if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG)
       syms_of_free_hook ();
 #endif
 
@@ -1568,13 +1578,19 @@
     Vinvocation_directory = Vinvocation_name;
 
     if (!NILP (Ffile_name_directory (Vinvocation_name)))
-      /* invocation-name includes a directory component -- presumably it
-         is relative to cwd, not $PATH */
-      Vinvocation_directory = Fexpand_file_name (Vinvocation_name,
-					   Qnil);
+      {
+	/* invocation-name includes a directory component -- presumably it
+	   is relative to cwd, not $PATH */
+	Vinvocation_directory = Fexpand_file_name (Vinvocation_name,
+						   Qnil);
+	Vinvocation_path = Qnil;
+      }
     else
-      locate_file (Vexec_path, Vinvocation_name, EXEC_SUFFIXES,
-		   &Vinvocation_directory, X_OK);
+      {
+	Vinvocation_path = decode_env_path ("PATH", NULL);
+	locate_file (Vinvocation_path, Vinvocation_name, EXEC_SUFFIXES,
+		     &Vinvocation_directory, X_OK);
+      }
 
     if (NILP (Vinvocation_directory))
       Vinvocation_directory = Vinvocation_name;
@@ -2553,6 +2569,12 @@
 The value is simply the program name if that directory's name is not known.
 */ );
 
+  DEFVAR_LISP ("invocation-path", &Vinvocation_path /*
+The path in which the XEmacs executable was found, to run it.
+The value is simply the value of environment variable PATH on startup
+if XEmacs was found there.
+*/ );
+
 #if 0 /* FSFmacs */
   xxDEFVAR_LISP ("installation-directory", &Vinstallation_directory,
     "A directory within which to look for the `lib-src' and `etc' directories.\n"
@@ -2631,6 +2653,9 @@
   DEFVAR_BOOL ("inhibit-site-lisp", &inhibit_site_lisp /*
 Set to non-nil when the site-lisp should not be searched at startup.
 */ );
+#ifdef INHIBIT_SITE_LISP
+  inhibit_site_lisp = 1;
+#endif
 
   DEFVAR_BOOL ("inhibit-update-dumped-lisp", &inhibit_update_dumped_lisp /*
 Set to non-nil when modified dumped lisp should not be reloaded at startup.
--- a/src/event-msw.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/event-msw.c	Mon Aug 13 10:27:19 2007 +0200
@@ -999,25 +999,70 @@
       if (wParam==SIZE_MINIMIZED)
 	{
 	  /* Iconified */
-	  FRAME_VISIBLE_P (frame) = 0;
+          FRAME_VISIBLE_P (frame) = 0;
 	  mswindows_enqueue_magic_event (hwnd, XM_UNMAPFRAME);
-	  Fframe_iconified_p (fobj);
 	}
       else
 	{
-	  int was_visible = FRAME_VISIBLE_P (frame);
-	  if (!msframe->sizing && !was_visible)
-	    mswindows_enqueue_magic_event (hwnd, XM_MAPFRAME);
-	  
 	  GetClientRect(hwnd, &rect);
-      	  FRAME_VISIBLE_P(frame) = 1;
 	  FRAME_PIXWIDTH(frame) = rect.right;
 	  FRAME_PIXHEIGHT(frame) = rect.bottom;
+
+	  pixel_to_real_char_size (frame, rect.right, rect.bottom,
+				   &MSWINDOWS_FRAME_CHARWIDTH (frame),
+				   &MSWINDOWS_FRAME_CHARHEIGHT (frame));
+
 	  pixel_to_char_size (frame, rect.right, rect.bottom, &columns, &rows);
 	  change_frame_size (frame, rows, columns, 1);
 
-	  if (msframe->sizing && mswindows_dynamic_frame_resize)
-	    redisplay ();
+	  /* If we are inside frame creation, we have to apply geometric
+	     properties now. */
+	  if (mswindows_frame_target_rect.left >= 0
+	      || mswindows_frame_target_rect.top >= 0
+	      || mswindows_frame_target_rect.width >= 0
+	      || mswindows_frame_target_rect.height >= 0)
+	    {
+	      /* Yes, we have to size again */
+	      XEMACS_RECT_WH geom;
+	      
+	      geom.left = mswindows_frame_target_rect.left;
+	      geom.top = mswindows_frame_target_rect.top;
+	      char_to_real_pixel_size (frame,
+				       mswindows_frame_target_rect.width,
+				       mswindows_frame_target_rect.height,
+				       &geom.width, &geom.height);
+	      if (mswindows_frame_target_rect.width < 0)
+		geom.width = -1;
+	      if (mswindows_frame_target_rect.height < 0)
+		geom.height = -1;
+
+	      /* Reset to we do not get here again */
+	      mswindows_frame_target_rect.left = -1;
+	      mswindows_frame_target_rect.top = -1;
+	      mswindows_frame_target_rect.width = -1;
+	      mswindows_frame_target_rect.height = -1;
+
+	      /* Size the rectangle to the actual size */
+	      GetWindowRect (hwnd, &rect);
+	      SetWindowPos
+		(hwnd, NULL,
+		 geom.left >= 0 ? geom.left : rect.left,
+		 geom.top >= 0 ? geom.top : rect.top,
+		 geom.width >= 0 ? geom.width : rect.right - rect.left,
+		 geom.height >= 0 ? geom.height : rect.bottom - rect.top,
+		 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING
+		 | ((geom.left >= 0 || geom.top >= 0) ? 0 : SWP_NOMOVE)
+		 | ((geom.width >= 0 || geom.height >= 0) ? 0 : SWP_NOSIZE));
+	    }
+	  else
+	    {
+	      if (!msframe->sizing && !FRAME_VISIBLE_P (frame))
+		mswindows_enqueue_magic_event (hwnd, XM_MAPFRAME);
+	      FRAME_VISIBLE_P (frame) = 1;
+	      
+	      if (!msframe->sizing || mswindows_dynamic_frame_resize)
+		redisplay ();
+	    }
 	}
     }
     break;
@@ -1035,7 +1080,9 @@
       GetWindowPlacement(hwnd, &wpl);
 
       /* Only interested if size is changing and we're not being iconified */
-      if ((wpl.showCmd != SW_SHOWMINIMIZED) && !(wp->flags & SWP_NOSIZE))
+      if (wpl.showCmd != SW_SHOWMINIMIZED
+	  && wpl.showCmd != SW_SHOWMAXIMIZED
+	  && !(wp->flags & SWP_NOSIZE))
       {
 	RECT ncsize = { 0, 0, 0, 0 };
 	int pixwidth, pixheight;
@@ -1043,10 +1090,10 @@
  			    GetMenu(hwnd) != NULL,
 			    GetWindowLong (hwnd, GWL_EXSTYLE));
 
-	round_size_to_char (XFRAME (mswindows_find_frame (hwnd)),
-			    wp->cx - (ncsize.right - ncsize.left),
-			    wp->cy - (ncsize.bottom - ncsize.top),
-			    &pixwidth, &pixheight);
+	round_size_to_real_char (XFRAME (mswindows_find_frame (hwnd)),
+				 wp->cx - (ncsize.right - ncsize.left),
+				 wp->cy - (ncsize.bottom - ncsize.top),
+				 &pixwidth, &pixheight);
 
 	/* Convert client sizes to window sizes */
 	pixwidth += (ncsize.right - ncsize.left);
@@ -1068,8 +1115,10 @@
 	wp->cx = pixwidth;
 	wp->cy = pixheight;
       }
+      /* DefWindowProc sends useful WM_GETMINMAXINFO message, and adjusts
+	 window position if the user tries to track window too small */
     }
-    break;
+    goto defproc;
 
   case WM_ENTERSIZEMOVE:
     msframe  = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd)));
@@ -1145,10 +1194,8 @@
       /* O Toolbar Implementor, this place may have something for you!;*/
 #endif
 
-      /* Bite me - a spurious command. No abort(), for safety */
-      /* #### Perhaps, this message should be changed */
-      error ("Cannot decode command. Tell kkm he's a parallelogramm, if you know"
-	     " what does that mean!");
+      /* Bite me - a spurious command. This cannot happen. */
+      error ("XEMACS BUG: Cannot decode command message");
     }
   break;
 
@@ -1228,10 +1275,9 @@
 {
   int interval;
 
-  /* We get half system threshold as it seems to
-     long before drag-selection is shown */
+  /* We get one third half system double click threshold */
   if (mswindows_button2_chord_time <= 0)
-    interval = GetDoubleClickTime () / 2;
+    interval = GetDoubleClickTime () / 3;
   else
     interval = mswindows_button2_chord_time;
 
@@ -1402,10 +1448,20 @@
 static Lisp_Object
 mswindows_find_frame (HWND hwnd)
 {
-  return (Lisp_Object) GetWindowLong (hwnd, XWL_FRAMEOBJ);
+  LONG l = GetWindowLong (hwnd, XWL_FRAMEOBJ);
+  Lisp_Object f;
+  if (l == 0)
+    {
+      /* We are in progress of frame creation. Return the frame
+	 being created, as it still not remembered in the window
+	 extra storage. */
+      assert (!NILP (mswindows_frame_being_created));
+      return mswindows_frame_being_created;
+    }
+  VOID_TO_LISP (f, l);
+  return f;
 }
 
-
 
 /************************************************************************/
 /*                            methods                                   */
--- a/src/events.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/events.c	Mon Aug 13 10:27:19 2007 +0200
@@ -505,11 +505,13 @@
   plist = Fcopy_sequence (plist);
   Fcanonicalize_plist (plist, Qnil);
 
-#define WRONG_EVENT_TYPE_FOR_PROPERTY(prop)					\
-  error_with_frob (type, "Invalid event type for `%s' property", keyword)
+#define WRONG_EVENT_TYPE_FOR_PROPERTY(prop)				\
+  error_with_frob (type, "Invalid event type for `%s' property",	\
+		   string_data (symbol_name (XSYMBOL (keyword))))
 
   EXTERNAL_PROPERTY_LIST_LOOP (tail, keyword, value, plist)
     {
+      CHECK_SYMBOL (keyword);
       if (EQ (keyword, Qchannel))
 	{
 	  if (e->event_type == key_press_event)
--- a/src/faces.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/faces.c	Mon Aug 13 10:27:19 2007 +0200
@@ -41,12 +41,6 @@
 #include "specifier.h"
 #include "window.h"
 
-#ifdef HAVE_X_WINDOWS
-#include "console-x.h"
-#include "objects-x.h"
-#include "EmacsFrame.h"
-#endif /* HAVE_X_WINDOWS */
-
 /* Qfont, Qdoc_string, Qface defined in general.c */
 Lisp_Object Qfacep;
 Lisp_Object Qforeground, Qbackground, Qdisplay_table;
@@ -729,6 +723,21 @@
   default_face_font_info (domain, 0, 0, height, width, 0);
 }
 
+void
+default_face_height_and_width_1 (Lisp_Object domain,
+				 int *height, int *width)
+{
+  if (window_system_pixelated_geometry (domain))
+    {
+      if (height)
+	*height = 1;
+      if (width)
+	*width = 1;
+    }
+  else
+    default_face_height_and_width (domain, height, width);
+}
+
 DEFUN ("face-list", Fface_list, 0, 1, 0, /*
 Return a list of the names of all defined faces.
 If TEMPORARY is nil, only the permanent faces are included.
@@ -1578,96 +1587,11 @@
  interface functions
  ****************************************************************************/
 
-/* #### This function should be converted into appropriate device methods. */
 static void
 update_EmacsFrame (Lisp_Object frame, Lisp_Object name)
 {
   struct frame *frm = XFRAME (frame);
-
-#ifdef HAVE_X_WINDOWS
-  if (FRAME_X_P (frm))
-     {
-       Arg av[10];
-       int ac = 0;
-
-       if (EQ (name, Qforeground))
-	 {
-	   Lisp_Object color = FACE_FOREGROUND (Vdefault_face, frame);
-	   XColor fgc;
-
-	   if (!EQ (color, Vthe_null_color_instance))
-	     {
-	       fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
-	       XtSetArg (av[ac], XtNforeground, (void *) fgc.pixel); ac++;
-	     }
-	 }
-       else if (EQ (name, Qbackground))
-	 {
-	   Lisp_Object color = FACE_BACKGROUND (Vdefault_face, frame);
-	   XColor bgc;
-
-	   if (!EQ (color, Vthe_null_color_instance))
-	     {
-	       bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
-	       XtSetArg (av[ac], XtNbackground, (void *) bgc.pixel); ac++;
-	     }
-
-	   /* Really crappy way to force the modeline shadows to be
-              redrawn.  But effective. */
-	   MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (frm);
-	   MARK_FRAME_CHANGED (frm);
-	 }
-       else if (EQ (name, Qfont))
-	 {
-	   Lisp_Object font = FACE_FONT (Vdefault_face, frame, Vcharset_ascii);
-
-	   if (!EQ (font, Vthe_null_font_instance))
-	     XtSetArg (av[ac], XtNfont,
-		       (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
-	   ac++;
-	 }
-       else
-	 abort ();
-
-       XtSetValues (FRAME_X_TEXT_WIDGET (frm), av, ac);
-
-#ifdef HAVE_TOOLBARS
-       /* Setting the background clears the entire frame area
-          including the toolbar so we force an immediate redraw of
-          it. */
-       if (EQ (name, Qbackground))
-	 MAYBE_DEVMETH (XDEVICE (frm->device), redraw_frame_toolbars, (frm));
-#endif /* HAVE_TOOLBARS */
-
-       /* The intent of this code is to cause the frame size in
-	  characters to remain the same when the font changes, at the
-	  expense of changing the frame size in pixels.  It's not
-	  totally clear that this is the right thing to do, but it's
-	  not clearly wrong either.  */
-       if (EQ (name, Qfont))
-	 {
-	   EmacsFrameRecomputeCellSize (FRAME_X_TEXT_WIDGET (frm));
-	   Fset_frame_size (frame,
-			    make_int (frm->width),
-			    make_int (frm->height),
-			    Qnil);
-	 }
-     }
-#endif /* HAVE_X_WINDOWS */
-#ifdef HAVE_MS_WINDOWS
-  if (CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm)))
-    {
-      /* Cause the frame size in characters to remain the same when the font
-       * changes, at the expense of changing the frame size in pixels. */
-      if (EQ (name, Qfont))
-	{
-	  Fset_frame_size (frame,
-			   make_int (frm->width),
-			   make_int (frm->height),
-			   Qnil);
-	}
-    }
-#endif /* HAVE_MS_WINDOWS */
+  MAYBE_FRAMEMETH (frm, update_frame_external_traits, (frm, name));
 }
 
 static void
--- a/src/faces.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/faces.h	Mon Aug 13 10:27:19 2007 +0200
@@ -271,6 +271,8 @@
 			     int *proportional_p);
 void default_face_height_and_width (Lisp_Object domain,
 				    int *height, int *width);
+void default_face_height_and_width_1 (Lisp_Object domain,
+				      int *height, int *width);
 
 extern Lisp_Object Qforeground, Qbackground, Qfont, Qdisplay_table;
 extern Lisp_Object Qbackground_pixmap, Qunderline, Qhighlight, Qdim;
--- a/src/frame-msw.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/frame-msw.c	Mon Aug 13 10:27:19 2007 +0200
@@ -31,18 +31,27 @@
 #include <config.h>
 #include "lisp.h"
 
+#include "buffer.h"
 #include "console-msw.h"
-
-#include "buffer.h"
+#include "events.h"
 #include "faces.h"
 #include "frame.h"
-#include "events.h"
+#include "redisplay.h"
 
-#define MSWINDOWS_FRAME_STYLE WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_OVERLAPPEDWINDOW
-#define MSWINDOWS_POPUP_STYLE WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_CAPTION|WS_POPUP
+#define MSWINDOWS_FRAME_STYLE (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW)
+#define MSWINDOWS_POPUP_STYLE (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP \
+			       | WS_CAPTION | WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX)
 
 #define MSWINDOWS_FRAME_EXSTYLE WS_EX_OVERLAPPEDWINDOW
-#define MSWINDOWS_POPUP_EXSTYLE WS_EX_OVERLAPPEDWINDOW
+#define MSWINDOWS_POPUP_EXSTYLE WS_EX_PALETTEWINDOW
+
+/* Default popup left top corner offset from the same
+   corner of the parent frame, in pixel */
+#define POPUP_OFFSET 30
+
+/* Default popup size, in characters */
+#define POPUP_WIDTH 30
+#define POPUP_HEIGHT 10
 
 #ifdef HAVE_MENUBARS
 #define ADJR_MENUFLAG TRUE
@@ -52,26 +61,58 @@
 
 /* Default properties to use when creating frames.  */
 Lisp_Object Vdefault_mswindows_frame_plist;
+
 /* Lisp_Object Qname, Qheight, Qwidth, Qinitially_unmapped, Qpopup, Qtop, Qleft; */
 Lisp_Object Qinitially_unmapped, Qpopup;
 
+/* This does not need to be GC protected, as it holds a
+   frame Lisp_Object already protected by Fmake_frame */
+Lisp_Object mswindows_frame_being_created;
+
+/* Geometry, in characters, as specified by proplist during frame
+   creation. Memebers are set to -1 for unspecified */
+XEMACS_RECT_WH mswindows_frame_target_rect;
+
 static void
 mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
 {
   Lisp_Object device = FRAME_DEVICE (f);
   Lisp_Object initially_unmapped;
   Lisp_Object name, height, width, popup, top, left;
-  Lisp_Object frame_obj;
+  Lisp_Object frame_obj = Qnil;
   RECT rect;
+  XEMACS_RECT_WH rect_default;
   DWORD style, exstyle;
+  HWND hwnd, hwnd_parent;
 
+  /* Pick up relevant properties */
   initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil);
   name = Fplist_get (props, Qname, Qnil);
-  height = Fplist_get (props, Qheight, Qnil);
-  width = Fplist_get (props, Qwidth, Qnil);
+  
   popup = Fplist_get (props, Qpopup, Qnil);
+  if (EQ (popup, Qt))
+    popup = Fselected_frame (Qnil);
+
+  left = Fplist_get (props, Qleft, Qnil);
+  if (!NILP (left))
+    CHECK_INT (left);
+
   top = Fplist_get (props, Qtop, Qnil);
-  left = Fplist_get (props, Qleft, Qnil);
+  if (!NILP (top))
+    CHECK_INT (top);
+
+  width = Fplist_get (props, Qwidth, Qnil);
+  if (!NILP (width))
+    CHECK_INT (width);
+
+  height = Fplist_get (props, Qheight, Qnil);
+  if (!NILP (height))
+    CHECK_INT (height);
+
+  mswindows_frame_target_rect.left = NILP (left) ? -1 : abs (XINT (left));
+  mswindows_frame_target_rect.top = NILP (top) ? -1 : abs (XINT (top));
+  mswindows_frame_target_rect.width = NILP (width) ? -1 : abs (XINT (width));
+  mswindows_frame_target_rect.height = NILP (height) ? -1 : abs (XINT (height));
 
   /* These shouldn't be here, but the window is created too early.
      The initialization of scrollbar resources is done between
@@ -80,17 +121,8 @@
   f->scrollbar_height = make_int (15);
 
   f->frame_data = xnew_and_zero (struct mswindows_frame);
-  FRAME_WIDTH (f) = INTP(width) ? XINT(width) : 80;
-  FRAME_HEIGHT (f) = INTP(height) ? XINT(height) : 30;
-  char_to_pixel_size (f, FRAME_WIDTH(f), FRAME_HEIGHT (f),
-		      &FRAME_PIXWIDTH (f), &FRAME_PIXHEIGHT (f));
 
-  style = (NILP(popup)) ? MSWINDOWS_FRAME_STYLE : MSWINDOWS_POPUP_STYLE;
-  exstyle = (NILP(popup)) ? MSWINDOWS_FRAME_EXSTYLE : MSWINDOWS_POPUP_EXSTYLE;
-  rect.left = rect.top = 0;
-  rect.right = FRAME_PIXWIDTH (f);
-  rect.bottom = FRAME_PIXHEIGHT (f);
-
+  /* Misc frame stuff */
   FRAME_MSWINDOWS_DATA(f)->button2_need_lbutton = 0;
   FRAME_MSWINDOWS_DATA(f)->button2_need_rbutton = 0;
   FRAME_MSWINDOWS_DATA(f)->button2_is_down = 0;
@@ -100,41 +132,105 @@
 
   FRAME_MSWINDOWS_MENU_HASHTABLE(f) = Qnil;
 
+  /* Will initialize these in WM_SIZE handler. We cannot do it now,
+     because we do not know what is CW_USEDEFAULT height and width */
+  FRAME_WIDTH (f) = 0;
+  FRAME_HEIGHT (f) = 0;
+  FRAME_PIXWIDTH (f) = 0;
+  FRAME_PIXHEIGHT (f) = 0;
+
+  if (NILP (popup))
+    {
+      style = MSWINDOWS_FRAME_STYLE;
+      exstyle = MSWINDOWS_FRAME_EXSTYLE;
+      hwnd_parent = NULL;
+
+      /* We always create am overlapped frame with default size,
+	 and later adjust only requested geometry parameters. */
+      rect_default.left = rect_default.top = CW_USEDEFAULT;
+      rect_default.width = rect_default.height = CW_USEDEFAULT;
+    }
+  else
+    {
+      style = MSWINDOWS_POPUP_STYLE;
+      exstyle = MSWINDOWS_POPUP_EXSTYLE;
+
+      CHECK_MSWINDOWS_FRAME (popup);
+      hwnd_parent = FRAME_MSWINDOWS_HANDLE (XFRAME (popup));
+      assert (IsWindow (hwnd_parent));
+
+      /* We cannot use CW_USEDEFAULT when creating a popup window.
+	 So by default, we offset the new popup 30 pixels right
+	 and down from its parent, and give it size of 30x10 characters.
+	 These dimensions look adequate on both high and low res monitors */
+      GetWindowRect (hwnd_parent, &rect);
+      rect_default.left = rect.left + POPUP_OFFSET;
+      rect_default.top = rect.top + POPUP_OFFSET;
+      char_to_real_pixel_size (f, POPUP_WIDTH, POPUP_HEIGHT,
+			       &rect_default.width, &rect_default.height);
+    }
+
   AdjustWindowRectEx(&rect, style, ADJR_MENUFLAG, exstyle);
 
-  FRAME_MSWINDOWS_HANDLE(f) =
-    CreateWindowEx (exstyle,
-		    XEMACS_CLASS,
-		    STRINGP(f->name) ? XSTRING_DATA(f->name) :
-		    	(STRINGP(name) ? XSTRING_DATA(name) : XEMACS_CLASS),
-		    style,
-		    INTP(left) ? XINT(left) : CW_USEDEFAULT,
-		    INTP(top) ? XINT(top) : CW_USEDEFAULT,
-		    rect.right-rect.left, rect.bottom-rect.top,
-		    NULL, NULL, NULL, NULL);
   XSETFRAME (frame_obj, f);
-  SetWindowLong (FRAME_MSWINDOWS_HANDLE(f), XWL_FRAMEOBJ, (LONG)frame_obj);
-  FRAME_MSWINDOWS_DC(f) = GetDC(FRAME_MSWINDOWS_HANDLE(f));
-  SetTextAlign(FRAME_MSWINDOWS_DC(f), TA_BASELINE|TA_LEFT|TA_NOUPDATECP);
+
+  mswindows_frame_being_created = frame_obj;
+
+  hwnd = CreateWindowEx (exstyle,
+			 XEMACS_CLASS,
+			 STRINGP(f->name) ? XSTRING_DATA(f->name) :
+		    	   (STRINGP(name) ? XSTRING_DATA(name) : XEMACS_CLASS),
+			 style,
+			 rect_default.left, rect_default.top,
+			 rect_default.width, rect_default.height,
+			 hwnd_parent, NULL, NULL, NULL);
+
+  mswindows_frame_being_created = Qnil;
+
+  if (hwnd == NULL)
+    error ("System call to create frame failed");
+			   
+  FRAME_MSWINDOWS_HANDLE(f) = hwnd;
+
+  SetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)LISP_TO_VOID(frame_obj));
+  FRAME_MSWINDOWS_DC(f) = GetDC (hwnd);
+  FRAME_MSWINDOWS_CDC(f) = CreateCompatibleDC (FRAME_MSWINDOWS_CDC(f));
+  SetTextAlign (FRAME_MSWINDOWS_DC(f), TA_BASELINE | TA_LEFT | TA_NOUPDATECP);
 }
 
-/* Called just before frame's properties are set, size is 10x10 or something */
+#if 0 /* #### unused */
 static void
 mswindows_init_frame_2 (struct frame *f, Lisp_Object props)
 {
 }
+#endif
 
 /* Called after frame's properties are set */
 static void
 mswindows_init_frame_3 (struct frame *f)
 {
-  /* Don't do this earlier or we get a WM_PAINT before the frame is ready*/
+  /* Don't do this earlier or we get a WM_PAINT before the frame is ready */
   ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
   SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
   DragAcceptFiles (FRAME_MSWINDOWS_HANDLE(f), TRUE);
 }
 
 static void
+mswindows_after_init_frame (struct frame *f, int first_on_device,
+		            int first_on_console)
+{
+  /* Windows, unlike X, is very synchronous. After the initial
+     frame is created, it will never be displayed, except for 
+     hollow border, unless we start pumping messages. Load progress
+     messages show in the bottom of the hollow frame, which is ugly.
+     We redipsplay the initial frame here, so modeline and root window
+     backgorund show.
+  */
+  if (first_on_console)
+    redisplay ();
+}
+
+static void
 mswindows_mark_frame (struct frame *f, void (*markobj) (Lisp_Object))
 {
   ((markobj) (FRAME_MSWINDOWS_MENU_HASHTABLE (f)));
@@ -143,7 +239,7 @@
 static void
 mswindows_focus_on_frame (struct frame *f)
 {
-    SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
+  SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
 }
 
 static void
@@ -151,37 +247,41 @@
 {
   if (f->frame_data)
     {
+      DeleteDC(FRAME_MSWINDOWS_CDC(f));
       ReleaseDC(FRAME_MSWINDOWS_HANDLE(f), FRAME_MSWINDOWS_DC(f));
       DestroyWindow(FRAME_MSWINDOWS_HANDLE(f));
+      xfree (f->frame_data);
     }
+  f->frame_data = 0;
 }
 
 static void
 mswindows_set_frame_size (struct frame *f, int cols, int rows)
 {
-  RECT rect1, rect2;
-  
-  GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rect1);
-  rect2.left = rect2.top = 0;
-  char_to_pixel_size (f, cols, rows, &rect2.right, &rect2.bottom);
+  RECT rect;
+  rect.left = rect.top = 0;
+  rect.right = cols;
+  rect.bottom = rows;
 
-  AdjustWindowRectEx (&rect2,
+  AdjustWindowRectEx (&rect,
 		      GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_STYLE),
 		      GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL,
 		      GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE));
-		    
-  MoveWindow (FRAME_MSWINDOWS_HANDLE(f), rect1.left, rect1.top,
- 	      rect2.right-rect2.left, rect2.bottom-rect2.top, TRUE);
+
+  if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) || IsZoomed (FRAME_MSWINDOWS_HANDLE(f)))
+    ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
+
+  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, 
+		0, 0, rect.right-rect.left, rect.bottom-rect.top,
+		SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOMOVE);
 }
 
 static void
 mswindows_set_frame_position (struct frame *f, int xoff, int yoff)
 {
-  RECT rect;
-
-  GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rect);
-  MoveWindow (FRAME_MSWINDOWS_HANDLE(f), xoff, yoff,
-	      rect.right-rect.left, rect.bottom-rect.top, TRUE);
+  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, 
+		xoff, yoff, 0, 0,
+		SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOSIZE);
 }
 
 static void
@@ -234,11 +334,8 @@
 static void
 mswindows_lower_frame (struct frame *f)
 {
-  RECT rect;
-  
-  GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rect);
-  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), HWND_BOTTOM, rect.top, rect.left,
-		rect.right-rect.left, rect.bottom-rect.top, 0);
+  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), HWND_BOTTOM, 0, 0, 0, 0,
+		SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING);
 }
 
 static void
@@ -308,19 +405,24 @@
 	}
     }
 
-  /* Now we've extracted the properties, apply them */
-  if (width_specified_p || height_specified_p || x_specified_p || y_specified_p)
+  /* Now we've extracted the properties, apply them.
+     Do not apply geometric properties during frame creation. This
+     is excessive anyways, and this loses becuase WM_SIZE has not
+     been sent yet, so frame width and height fields are not initialized
+  */ 
+  if (f->init_finished
+      && (width_specified_p || height_specified_p || x_specified_p || y_specified_p))
     {
-      Lisp_Object frame;
+      Lisp_Object frame = Qnil;
       RECT rect;
       int pixel_width, pixel_height;
       XSETFRAME (frame, f);
 
+      char_to_real_pixel_size (f, width, height, &pixel_width, &pixel_height);
       if (!width_specified_p)
-	width = FRAME_WIDTH (f);
+	pixel_width = FRAME_PIXWIDTH (f);
       if (!height_specified_p)
-	height = FRAME_HEIGHT (f);
-      char_to_pixel_size (f, width, height, &pixel_width, &pixel_height);
+	pixel_height = FRAME_PIXHEIGHT (f);
 
       GetWindowRect (FRAME_MSWINDOWS_HANDLE(f), &rect);
       if (!x_specified_p)
@@ -328,24 +430,85 @@
       if (!y_specified_p)
 	y = rect.top;
 
+      rect.left = rect.top = 0;
+      rect.right = pixel_width;
+      rect.bottom = pixel_height;
       AdjustWindowRectEx (&rect,
 			  GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_STYLE),
 			  GetMenu (FRAME_MSWINDOWS_HANDLE(f)) != NULL,
 			  GetWindowLong (FRAME_MSWINDOWS_HANDLE(f), GWL_EXSTYLE));
+      
 
-      MoveWindow (FRAME_MSWINDOWS_HANDLE(f), x, y, pixel_width, pixel_height,
-		  (width_specified_p || height_specified_p));
+      if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) || IsZoomed (FRAME_MSWINDOWS_HANDLE(f)))
+	ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
+
+      SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, 
+		    x, y, rect.right - rect.left, rect.bottom - rect.top,
+		    SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING
+		    | ((width_specified_p || height_specified_p) ? 0 : SWP_NOSIZE)
+		    | ((x_specified_p || y_specified_p) ? 0 : SWP_NOMOVE));
     }
 }
 
+static Lisp_Object
+mswindows_get_frame_parent (struct frame *f)
+{
+  HWND hwnd = FRAME_MSWINDOWS_HANDLE(f);
+  hwnd = GetParent (hwnd);
+  if (hwnd)
+    {
+      Lisp_Object parent;
+      VOID_TO_LISP (parent, GetWindowLong (hwnd, XWL_FRAMEOBJ));
+      assert (FRAME_MSWINDOWS_P (XFRAME (parent)));
+      return parent;
+    }
+  else
+    return Qnil;
+}
+
+static void
+mswindows_update_frame_external_traits (struct frame* frm, Lisp_Object name)
+{
+  if (EQ (name, Qfont))
+    {
+      /* We resize the frame along with the font if user preference
+	 of MS style compliance is turned off, and if font size has
+	 really changed
+      */
+      /* #### Frame gets resized after font here */
+      if (1)
+	{
+	  int new_char_height, new_char_width;
+          pixel_to_real_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm),
+				   &new_char_width, &new_char_height);
+	  if (new_char_width != MSWINDOWS_FRAME_CHARWIDTH (frm)
+	      || new_char_height != MSWINDOWS_FRAME_CHARHEIGHT (frm))
+	    {
+	      Lisp_Object frame;
+	      XSETFRAME (frame, frm);
+	      Fset_frame_size (frame, MSWINDOWS_FRAME_CHARWIDTH (frm),
+			       MSWINDOWS_FRAME_CHARHEIGHT (frm), Qnil);
+	    }
+	}
+
+      /* This resizes minibuffer and redraws modeline. */
+      {
+        int width, height;
+	pixel_to_char_size (frm, FRAME_PIXWIDTH(frm), FRAME_PIXHEIGHT(frm),
+			    &width, &height);
+	change_frame_size (frm, height, width, 1);
+      }
+   }
+}
 
 void
 console_type_create_frame_mswindows (void)
 {
   /* frame methods */
   CONSOLE_HAS_METHOD (mswindows, init_frame_1);
-  CONSOLE_HAS_METHOD (mswindows, init_frame_2);
+/*  CONSOLE_HAS_METHOD (mswindows, init_frame_2); */
   CONSOLE_HAS_METHOD (mswindows, init_frame_3);
+  CONSOLE_HAS_METHOD (mswindows, after_init_frame);
   CONSOLE_HAS_METHOD (mswindows, mark_frame);
   CONSOLE_HAS_METHOD (mswindows, focus_on_frame);
   CONSOLE_HAS_METHOD (mswindows, delete_frame);
@@ -369,7 +532,8 @@
   CONSOLE_HAS_METHOD (mswindows, frame_iconified_p);
 /*  CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); */
 /*  CONSOLE_HAS_METHOD (mswindows, set_frame_icon); */
-/*  CONSOLE_HAS_METHOD (mswindows, get_frame_parent); */
+  CONSOLE_HAS_METHOD (mswindows, get_frame_parent);
+  CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits);
 }
 
 void
@@ -389,6 +553,9 @@
 void
 vars_of_frame_mswindows (void)
 {
+  mswindows_frame_being_created = Qnil;
+  staticpro (&mswindows_frame_being_created);
+
   DEFVAR_LISP ("default-mswindows-frame-plist", &Vdefault_mswindows_frame_plist /*
 Plist of default frame-creation properties for mswindows frames.
 These override what is specified in `default-frame-plist', but are
--- a/src/frame-x.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/frame-x.c	Mon Aug 13 10:27:19 2007 +0200
@@ -2558,6 +2558,79 @@
   f->frame_data = 0;
 }
 
+static void
+x_update_frame_external_traits (struct frame* frm, Lisp_Object name)
+{
+  Arg av[10];
+  int ac = 0;
+  Lisp_Object frame = Qnil;
+
+  XSETFRAME(frame, frm);
+
+  if (EQ (name, Qforeground))
+   {
+     Lisp_Object color = FACE_FOREGROUND (Vdefault_face, frame);
+     XColor fgc;
+
+     if (!EQ (color, Vthe_null_color_instance))
+       {
+	 fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
+	 XtSetArg (av[ac], XtNforeground, (void *) fgc.pixel); ac++;
+       }
+   }
+  else if (EQ (name, Qbackground))
+   {
+     Lisp_Object color = FACE_BACKGROUND (Vdefault_face, frame);
+     XColor bgc;
+
+     if (!EQ (color, Vthe_null_color_instance))
+       {
+	 bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
+	 XtSetArg (av[ac], XtNbackground, (void *) bgc.pixel); ac++;
+       }
+
+     /* Really crappy way to force the modeline shadows to be
+	redrawn.  But effective. */
+     MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (frm);
+     MARK_FRAME_CHANGED (frm);
+   }
+  else if (EQ (name, Qfont))
+   {
+     Lisp_Object font = FACE_FONT (Vdefault_face, frame, Vcharset_ascii);
+
+     if (!EQ (font, Vthe_null_font_instance))
+       XtSetArg (av[ac], XtNfont,
+		 (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
+     ac++;
+   }
+  else
+   abort ();
+
+  XtSetValues (FRAME_X_TEXT_WIDGET (frm), av, ac);
+
+  #ifdef HAVE_TOOLBARS
+  /* Setting the background clears the entire frame area
+    including the toolbar so we force an immediate redraw of
+    it. */
+  if (EQ (name, Qbackground))
+    MAYBE_DEVMETH (XDEVICE (frm->device), redraw_frame_toolbars, (frm));
+  #endif /* HAVE_TOOLBARS */
+
+  /* The intent of this code is to cause the frame size in
+    characters to remain the same when the font changes, at the
+    expense of changing the frame size in pixels.  It's not
+    totally clear that this is the right thing to do, but it's
+    not clearly wrong either.  */
+  if (EQ (name, Qfont))
+   {
+     EmacsFrameRecomputeCellSize (FRAME_X_TEXT_WIDGET (frm));
+     Fset_frame_size (frame,
+		      make_int (frm->width),
+		      make_int (frm->height),
+		      Qnil);
+   }
+}
+
 
 /************************************************************************/
 /*                            initialization                            */
@@ -2610,6 +2683,7 @@
   CONSOLE_HAS_METHOD (x, set_frame_pointer);
   CONSOLE_HAS_METHOD (x, set_frame_icon);
   CONSOLE_HAS_METHOD (x, get_frame_parent);
+  CONSOLE_HAS_METHOD (x, update_frame_external_traits);
 }
 
 void
--- a/src/frame.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/frame.c	Mon Aug 13 10:27:19 2007 +0200
@@ -2297,6 +2297,7 @@
        (frame, property, default_))
 {
   struct frame *f = decode_frame (frame);
+  int width, height;
 
   XSETFRAME (frame, f);
 
@@ -2309,8 +2310,20 @@
 } while (0)
 
   FROB (Qname, f->name);
-  FROB (Qheight, make_int (FRAME_HEIGHT (f)));
-  FROB (Qwidth,  make_int (FRAME_WIDTH  (f)));
+
+  if (window_system_pixelated_geometry (frame))
+    {
+      pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
+			       &width, &height);
+    }
+  else
+    {
+      height = FRAME_HEIGHT (f);
+      width = FRAME_WIDTH (f);
+    }
+  FROB (Qheight, make_int (height));
+  FROB (Qwidth,  make_int (width));
+
   /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P.
      This is over-the-top bogosity, because it's inconsistent with
      the semantics of `minibuffer' when passed to `make-frame'.
@@ -2365,9 +2378,12 @@
   struct frame *f = decode_frame (frame);
   Lisp_Object result = Qnil;
   struct gcpro gcpro1;
+  int width, height;
 
   GCPRO1 (result);
 
+  XSETFRAME (frame, f);
+
 #define FROB(propprop, value)				\
 do {							\
   Lisp_Object temtem = (value);				\
@@ -2377,8 +2393,20 @@
 } while (0)
 
   FROB (Qname, f->name);
-  FROB (Qheight, make_int (FRAME_HEIGHT (f)));
-  FROB (Qwidth,  make_int (FRAME_WIDTH  (f)));
+
+  if (window_system_pixelated_geometry (frame))
+    {
+      pixel_to_real_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
+			       &width, &height);
+    }
+  else
+    {
+      height = FRAME_HEIGHT (f);
+      width = FRAME_WIDTH (f);
+    }
+  FROB (Qheight, make_int (height));
+  FROB (Qwidth,  make_int (width));
+
  /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P.
      This is over-the-top bogosity, because it's inconsistent with
      the semantics of `minibuffer' when passed to `make-frame'.
@@ -2467,11 +2495,22 @@
        (frame, rows, pretend))
 {
   struct frame *f = decode_frame (frame);
+  int height, width;
   XSETFRAME (frame, f);
   CHECK_INT (rows);
 
-  internal_set_frame_size (f, FRAME_WIDTH (f), XINT (rows),
-			   !NILP (pretend));
+  if (window_system_pixelated_geometry (frame))
+    {
+      char_to_real_pixel_size (f, 0, XINT (rows), 0, &height);
+      width = FRAME_PIXWIDTH (f);
+    }
+  else
+    {
+      height = XINT (rows);
+      width = FRAME_WIDTH (f);
+    }
+
+  internal_set_frame_size (f, width, height, !NILP (pretend));
   return frame;
 }
 
@@ -2483,11 +2522,22 @@
        (frame, cols, pretend))
 {
   struct frame *f = decode_frame (frame);
+  int width, height;
   XSETFRAME (frame, f);
   CHECK_INT (cols);
 
-  internal_set_frame_size (f, XINT (cols), FRAME_HEIGHT (f),
-			    !NILP (pretend));
+  if (window_system_pixelated_geometry (frame))
+    {
+      char_to_real_pixel_size (f, XINT (cols), 0, &width, 0);
+      height = FRAME_PIXHEIGHT (f);
+    }
+  else
+    {
+      width = XINT (cols);
+      height = FRAME_HEIGHT (f);
+    }
+
+  internal_set_frame_size (f, width, height, !NILP (pretend));
   return frame;
 }
 
@@ -2499,11 +2549,20 @@
        (frame, cols, rows, pretend))
 {
   struct frame *f = decode_frame (frame);
+  int height, width;
   XSETFRAME (frame, f);
   CHECK_INT (cols);
   CHECK_INT (rows);
 
-  internal_set_frame_size (f, XINT (cols), XINT (rows), !NILP (pretend));
+  if (window_system_pixelated_geometry (frame))
+    char_to_real_pixel_size (f, XINT (cols), XINT (rows), &width, &height);
+  else
+    {
+      height = XINT (rows);
+      width = XINT (cols);
+    }
+
+  internal_set_frame_size (f, width, height, !NILP (pretend));
   return frame;
 }
 
@@ -2533,7 +2592,8 @@
 static void
 frame_conversion_internal (struct frame *f, int pixel_to_char,
 			   int *pixel_width, int *pixel_height,
-			   int *char_width, int *char_height)
+			   int *char_width, int *char_height,
+			   int real_face)
 {
   int cpw;
   int cph;
@@ -2542,7 +2602,11 @@
   Lisp_Object frame, window;
 
   XSETFRAME (frame, f);
-  default_face_height_and_width (frame, &cph, &cpw);
+  if (real_face)
+    default_face_height_and_width (frame, &cph, &cpw);
+  else
+    default_face_height_and_width_1 (frame, &cph, &cpw);
+
   window = FRAME_SELECTED_WINDOW (f);
 
   egw = max (glyph_width (Vcontinuation_glyph, Vdefault_face, 0, window),
@@ -2560,13 +2624,17 @@
 
   if (pixel_to_char)
     {
-      *char_width = 1 + ((*pixel_width - egw) - bdr - obw) / cpw;
-      *char_height = (*pixel_height - bdr - obh) / cph;
+      if (char_width)
+	*char_width = 1 + ((*pixel_width - egw) - bdr - obw) / cpw;
+      if (char_height)
+	*char_height = (*pixel_height - bdr - obh) / cph;
     }
   else
     {
-      *pixel_width = (*char_width - 1) * cpw + egw + bdr + obw;
-      *pixel_height = *char_height * cph + bdr + obh;
+      if (pixel_width)
+	*pixel_width = (*char_width - 1) * cpw + egw + bdr + obw;
+      if (pixel_height)
+	*pixel_height = *char_height * cph + bdr + obh;
     }
 }
 
@@ -2586,7 +2654,7 @@
 		    int *char_width, int *char_height)
 {
   frame_conversion_internal (f, 1, &pixel_width, &pixel_height, char_width,
-			     char_height);
+			     char_height, 0);
 }
 
 /* Given a character size, this returns the minimum number of pixels
@@ -2602,7 +2670,7 @@
 		    int *pixel_width, int *pixel_height)
 {
   frame_conversion_internal (f, 0, pixel_width, pixel_height, &char_width,
-			     &char_height);
+			     &char_height, 0);
 }
 
 /* Given a pixel size, rounds DOWN to the smallest size in pixels necessary
@@ -2618,6 +2686,34 @@
   char_to_pixel_size (f, char_width, char_height, out_width, out_height);
 }
 
+/* Versions of the above which always account for real font metrics.
+ */
+void
+pixel_to_real_char_size (struct frame *f, int pixel_width, int pixel_height,
+			 int *char_width, int *char_height)
+{
+  frame_conversion_internal (f, 1, &pixel_width, &pixel_height, char_width,
+			     char_height, 1);
+}
+
+void
+char_to_real_pixel_size (struct frame *f, int char_width, int char_height,
+			 int *pixel_width, int *pixel_height)
+{
+  frame_conversion_internal (f, 0, pixel_width, pixel_height, &char_width,
+			     &char_height, 1);
+}
+
+void
+round_size_to_real_char (struct frame *f, int in_width, int in_height,
+			 int *out_width, int *out_height)
+{
+  int char_width;
+  int char_height;
+  pixel_to_real_char_size (f, in_width, in_height, &char_width, &char_height);
+  char_to_real_pixel_size (f, char_width, char_height, out_width, out_height);
+}
+
 /* Change the frame height and/or width.  Values may be given as zero to
    indicate no change is to take place. */
 static void
@@ -2625,7 +2721,7 @@
 {
   Lisp_Object frame;
   int new_pixheight, new_pixwidth;
-  int font_height, font_width;
+  int font_height, real_font_height, font_width;
 
   /* #### Chuck -- shouldn't we be checking to see if the frame
      is being "changed" to its existing size, and do nothing if so? */
@@ -2638,7 +2734,8 @@
 
   XSETFRAME (frame, f);
 
-  default_face_height_and_width (frame, &font_height, &font_width);
+  default_face_height_and_width (frame, &real_font_height, 0);
+  default_face_height_and_width_1 (frame, &font_height, &font_width);
 
   /* This size-change overrides any pending one for this frame.  */
   FRAME_NEW_HEIGHT (f) = 0;
@@ -2711,9 +2808,9 @@
 	  int old_minibuf_height =
 	    XWINDOW(FRAME_MINIBUF_WINDOW(f))->pixel_height;
 	  int minibuf_height =
-	    f->init_finished && (old_minibuf_height % font_height) == 0 ?
-	    max(old_minibuf_height, font_height) :
-	    font_height;
+	    f->init_finished && (old_minibuf_height % real_font_height) == 0 ?
+	    max(old_minibuf_height, real_font_height) :
+	    real_font_height;
 	  set_window_pixheight (FRAME_ROOT_WINDOW (f),
 				/* - font_height for minibuffer */
 				new_pixheight - minibuf_height, 0);
--- a/src/frame.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/frame.h	Mon Aug 13 10:27:19 2007 +0200
@@ -169,6 +169,7 @@
   unsigned int extents_changed :1;
   unsigned int faces_changed :1;
   unsigned int frame_changed :1;
+  unsigned int glyphs_changed :1;
   unsigned int icon_changed :1;
   unsigned int menubar_changed :1;
   unsigned int modeline_changed :1;
@@ -276,6 +277,14 @@
   else									\
     faces_changed = 1; } while (0)
 
+#define MARK_FRAME_GLYPHS_CHANGED(f) do {				\
+  (f)->glyphs_changed = 1;						\
+  (f)->modiff++;							\
+  if (!NILP ((f)->device))						\
+    MARK_DEVICE_GLYPHS_CHANGED (XDEVICE ((f)->device));			\
+  else									\
+    glyphs_changed = 1; } while (0)
+
 #define MARK_FRAME_TOOLBARS_CHANGED(f) do {				\
   (f)->toolbar_changed = 1;						\
   (f)->modiff++;							\
@@ -405,10 +414,10 @@
 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) \
   (!NILP((f)->toolbar_data[pos]) && !NILP ((f)->toolbar_visible_p[pos]))
 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) \
-  (!NILP ((f)->toolbar_data[pos]) ? \
+  (!NILP ((f)->toolbar_data[pos]) && INTP((f)->toolbar_size[pos]) ? \
    (XINT ((f)->toolbar_size[pos])) : 0)
 #define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \
-  (!NILP ((f)->toolbar_data[pos]) ? \
+  (!NILP ((f)->toolbar_data[pos]) && INTP((f)->toolbar_border_width[pos]) ? \
    (XINT ((f)->toolbar_border_width[pos])) : 0)
 #else
 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) 0
@@ -453,9 +462,16 @@
   (HAS_DEVMETH_P (XDEVICE (FRAME_DEVICE (f)), initialize_frame_toolbars) \
    && !NILP (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_visible_p[pos]))
 #define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \
-  (XINT (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos]))
+     ((INTP (XWINDOW \
+	     (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos])) ? \
+      (XINT (XWINDOW \
+	     (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos])) \
+      : 0)
 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) \
-  (XINT (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos]))
+     ((INTP (XWINDOW \
+	     (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) ? \
+      (XINT (XWINDOW \
+	     (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) : 0)
 #define FRAME_REAL_TOOLBAR(f, pos) \
   (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar[pos])
 #else
@@ -586,6 +602,12 @@
 			 int *pixel_width, int *pixel_height);
 void round_size_to_char (struct frame *f, int in_width, int in_height,
 			 int *out_width, int *out_height);
+void pixel_to_real_char_size (struct frame *f, int pixel_width, int pixel_height,
+			 int *char_width, int *char_height);
+void char_to_real_pixel_size (struct frame *f, int char_width, int char_height,
+			 int *pixel_width, int *pixel_height);
+void round_size_to_real_char (struct frame *f, int in_width, int in_height,
+			      int *out_width, int *out_height);
 void change_frame_size (struct frame *frame,
 			int newlength, int newwidth,
 			int delay);
--- a/src/free-hook.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/free-hook.c	Mon Aug 13 10:27:19 2007 +0200
@@ -226,7 +226,7 @@
 	{
 	/* This can only happen if you try to free something that didn't
 	   come from malloc */
-#if 1
+#if !defined(__linux__)
 	  /* I originally wrote:  "There's really no need to drop core."
 	     I have seen the error of my ways. -slb */
 	  if (strict_free_check)
@@ -243,7 +243,7 @@
       if (size < 0)
 	{
 	  /* This happens when you free twice */
-#if 1
+#if !defined(__linux__)
 	  /* See above comment. */
 	  if (strict_free_check)
 	    {
@@ -352,12 +352,13 @@
   unsigned long old_size;
   void *result = malloc (size);
 
+  if (!ptr) return result;
   present = (EMACS_INT) gethash (ptr, pointer_table, (void **) &old_size);
   if (!present)
     {
     /* This can only happen by reallocing a pointer that didn't
        come from malloc. */
-#if 1
+#if !defined(__linux__)
       /* see comment in check_free(). */
       abort ();
 #endif
--- a/src/glyphs-msw.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/glyphs-msw.c	Mon Aug 13 10:27:19 2007 +0200
@@ -54,25 +54,27 @@
 mswindows_initialize_dibitmap_image_instance (struct Lisp_Image_Instance *ii,
 					    enum image_instance_type type);
 
-COLORREF mswindows_string_to_color(CONST char *name);
+COLORREF mswindows_string_to_color (CONST char *name);
 
 /************************************************************************/
 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/
 /* proper display 							*/
 /************************************************************************/
-BITMAPINFO* EImage2DIBitmap(Lisp_Object device, int width, int height,
+BITMAPINFO* EImage2DIBitmap (Lisp_Object device, int width, int height,
 			    unsigned char *pic,
 			    int *bit_count,
 			    unsigned char** bmp_data)
 {
   struct device *d = XDEVICE (device);
-  int i;
+  int i,j;
   RGBQUAD* colortbl;
   int		ncolors;
   BITMAPINFO*	bmp_info;
+  unsigned char *ip, *dp;
 
-  if (DEVICE_MSWINDOWS_BITSPIXEL(d) > 16)
+  if (DEVICE_MSWINDOWS_BITSPIXEL (d) > 0)
     {
+      int bpline=(int)(~3UL & (unsigned long)((width*3) +3));
       /* FIXME: we can do this because 24bpp implies no colour table, once
        * we start paletizing this is no longer true. The X versions of
        * this function quantises to 256 colours or bit masks down to a
@@ -80,7 +82,7 @@
        * don't see much point trying to optimise down to the best
        * structure - unless it has memory / color allocation implications
        * .... */
-      bmp_info=xnew_and_zero(BITMAPINFO);
+      bmp_info=xnew_and_zero (BITMAPINFO);
       
       if (!bmp_info)
 	{
@@ -117,7 +119,7 @@
       int bpline= (int)(~3UL & (unsigned long)(width +3));
       /* Quantize the image and get a histogram while we're at it.
 	 Do this first to save memory */
-      qtable = EImage_build_quantable(pic, width, height, 256);
+      qtable = build_EImage_quantable(pic, width, height, 256);
       if (qtable == NULL) return NULL;
 
       /* use our quantize table to allocate the colors */
@@ -143,8 +145,8 @@
 
       if (!*bmp_data)
 	{
-	  xfree(qtable);
-	  xfree(bmp_info);
+	  xfree (qtable);
+	  xfree (bmp_info);
 	  return NULL;
 	}
       
@@ -165,18 +167,18 @@
 	  rd = *ip++;
 	  gr = *ip++;
 	  bl = *ip++;
-	  *dp++ = QUANT_GET_COLOR(qtable,rd,gr,bl);
+	  *dp++ = QUANT_GET_COLOR (qtable,rd,gr,bl);
 	}
       }
-      xfree(qtable);
+      xfree (qtable);
     } 
   /* fix up the standard stuff */
   bmp_info->bmiHeader.biWidth=width;
   bmp_info->bmiHeader.biHeight=height;
   bmp_info->bmiHeader.biPlanes=1;
   bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
-  bmp_info->bmiHeader.biXPelsPerMeter=3779; /* unless you know better */
-  bmp_info->bmiHeader.biYPelsPerMeter=3779; 
+  bmp_info->bmiHeader.biXPelsPerMeter=0; /* unless you know better */
+  bmp_info->bmiHeader.biYPelsPerMeter=0; 
 
   return bmp_info;
 }
@@ -192,12 +194,11 @@
 
   /* Check non-absolute pathnames with a directory component relative to
      the search path; that's the way Xt does it. */
-  /* #### Unix-specific */
-  if (XSTRING_BYTE (name, 0) == '/' ||
+  if (IS_DIRECTORY_SEP(XSTRING_BYTE (name, 0)) ||
       (XSTRING_BYTE (name, 0) == '.' &&
-       (XSTRING_BYTE (name, 1) == '/' ||
+       (IS_DIRECTORY_SEP(XSTRING_BYTE (name, 1)) ||
 	(XSTRING_BYTE (name, 1) == '.' &&
-	 (XSTRING_BYTE (name, 2) == '/')))))
+	 (IS_DIRECTORY_SEP(XSTRING_BYTE (name, 2)))))))
     {
       if (!NILP (Ffile_readable_p (name)))
 	return name;
@@ -205,7 +206,7 @@
 	return Qnil;
     }
 
-  if (!NILP(Vmswindows_bitmap_file_path))
+  if (!NILP (Vmswindows_bitmap_file_path))
   {
     Lisp_Object found;
     if (locate_file (Vmswindows_bitmap_file_path, name, "", &found, R_OK) < 0)
@@ -248,7 +249,7 @@
 
   if (!NILP (file) && NILP (data))
     {
-      Lisp_Object retval = locate_pixmap_file (file);
+      Lisp_Object retval = locate_pixmap_file(file);
       if (!NILP (retval))
 	return retval;
       else
@@ -322,10 +323,10 @@
 {
   Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
   struct device *d = XDEVICE (device);
-  struct frame *f = XFRAME (DEVICE_SELECTED_FRAME(d));
+  struct frame *f = XFRAME (DEVICE_SELECTED_FRAME (d));
   void* bmp_buf=0;
   HBITMAP bitmap;
-  HDC hdc, cdc;
+  HDC hdc;
 
   if (!DEVICE_MSWINDOWS_P (d))
     signal_simple_error ("Not an mswindows device", device);
@@ -338,7 +339,7 @@
 			      IMAGE_COLOR_PIXMAP_MASK);
   hdc = FRAME_MSWINDOWS_DC (f);
 
-  bitmap=CreateDIBSection(hdc,  
+  bitmap=CreateDIBSection (hdc,  
 			  bmp_info,
 			  DIB_RGB_COLORS,
 			  &bmp_buf, 
@@ -348,10 +349,7 @@
     signal_simple_error ("Unable to create bitmap", instantiator);
 
   /* copy in the actual bitmap */
-  memcpy(bmp_buf, bmp_data, bmp_bits);
-
-  /* create a memory dc */
-  cdc = CreateCompatibleDC(hdc);
+  memcpy (bmp_buf, bmp_data, bmp_bits);
 
   mswindows_initialize_dibitmap_image_instance (ii, IMAGE_COLOR_PIXMAP);
 
@@ -359,7 +357,6 @@
     find_keyword_in_vector (instantiator, Q_file);
 
   IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) = bitmap;
-  IMAGE_INSTANCE_MSWINDOWS_DC (ii) = cdc;
   IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = bmp_info->bmiHeader.biWidth;
   IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = bmp_info->bmiHeader.biHeight;
   IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = bmp_info->bmiHeader.biBitCount;
@@ -370,7 +367,7 @@
  **********************************************************************/
 
 #ifdef HAVE_XPM
-static int xpm_to_eimage(Lisp_Object image, CONST Extbyte *buffer,
+static int xpm_to_eimage (Lisp_Object image, CONST Extbyte *buffer,
 			 unsigned char** data,
 			 int* width, int* height,
 			 COLORREF bg)
@@ -386,10 +383,10 @@
   memset (&xpmimage, 0, sizeof (xpmimage));
   memset (&xpminfo, 0, sizeof (xpmimage));
   
-  result = XpmCreateXpmImageFromBuffer((char*)buffer,
+  result = XpmCreateXpmImageFromBuffer ((char*)buffer,
 				       &xpmimage,
 				       &xpminfo);
-  switch(result)
+  switch (result)
     {
     case XpmSuccess:
       break;
@@ -416,8 +413,8 @@
   *data = xnew_array_and_zero (unsigned char, *width * *height * 3);
   if (!*data)
     {
-      XpmFreeXpmImage(&xpmimage);
-      XpmFreeXpmInfo(&xpminfo);
+      XpmFreeXpmImage (&xpmimage);
+      XpmFreeXpmInfo (&xpminfo);
       return 0;
     }
 
@@ -425,23 +422,23 @@
   colortbl = xnew_array_and_zero (COLORREF, xpmimage.ncolors);
   if (!colortbl)
     {
-      xfree(*data);
-      XpmFreeXpmImage(&xpmimage);
-      XpmFreeXpmInfo(&xpminfo);
+      xfree (*data);
+      XpmFreeXpmImage (&xpmimage);
+      XpmFreeXpmInfo (&xpminfo);
       return 0;
     }
 
   for (i=0; i<xpmimage.ncolors; i++)
     {
 				/* pick up transparencies */
-      if (!strcmp(xpmimage.colorTable[i].c_color,"None"))
+      if (!strcmp (xpmimage.colorTable[i].c_color,"None"))
 	{
 	  colortbl[i]=bg;
 	}
       else
 	{
 	  colortbl[i]=
-	    mswindows_string_to_color(xpmimage.colorTable[i].c_color);
+	    mswindows_string_to_color (xpmimage.colorTable[i].c_color);
 	}
     }
 
@@ -453,14 +450,14 @@
       color = colortbl[*sptr++];
 
       /* split out the 0x02bbggrr colorref into an rgb triple */
-      *dptr++=GetRValue(color); /* red */
-      *dptr++=GetGValue(color); /* green */
-      *dptr++=GetBValue(color); /* blue */
+      *dptr++=GetRValue (color); /* red */
+      *dptr++=GetGValue (color); /* green */
+      *dptr++=GetBValue (color); /* blue */
     }
 
-  XpmFreeXpmImage(&xpmimage);
-  XpmFreeXpmInfo(&xpminfo);
-  xfree(colortbl);
+  XpmFreeXpmImage (&xpmimage);
+  XpmFreeXpmInfo (&xpminfo);
+  xfree (colortbl);
   return TRUE;
 }
 
@@ -493,10 +490,10 @@
   /* this is a hack but MaskBlt and TransparentBlt are not supported
      on most windows variants */
   bkcolor = COLOR_INSTANCE_MSWINDOWS_COLOR 
-    (XCOLOR_INSTANCE (FACE_BACKGROUND(Vdefault_face, domain)));
+    (XCOLOR_INSTANCE (FACE_BACKGROUND (Vdefault_face, domain)));
 
   /* convert to an eimage to make processing easier */
-  if (!xpm_to_eimage(image_instance, bytes, &eimage, &width, &height,
+  if (!xpm_to_eimage (image_instance, bytes, &eimage, &width, &height,
 		     bkcolor))
     {
       signal_simple_error ("XPM to EImage conversion failed", 
@@ -504,20 +501,21 @@
     }
   
   /* build a bitmap from the eimage */
-  if (!(bmp_info=EImage2DIBitmap(device, width, height, eimage,
+  if (!(bmp_info=EImage2DIBitmap (device, width, height, eimage,
 				 &bmp_bits, &bmp_data)))
     {
+      xfree (eimage);
       signal_simple_error ("XPM to EImage conversion failed",
 			   image_instance);
     }
-  xfree(eimage);
+  xfree (eimage);
 
   /* Now create the pixmap and set up the image instance */
   init_image_instance_from_dibitmap (ii, bmp_info, dest_mask,
 				     bmp_data, bmp_bits, instantiator);
 
-  xfree(bmp_info);
-  xfree(bmp_data);
+  xfree (bmp_info);
+  xfree (bmp_data);
 }
 #endif /* HAVE_XPM */
 
@@ -620,12 +618,9 @@
 
   if (DEVICE_LIVE_P (XDEVICE (p->device)))
     {
-      if (IMAGE_INSTANCE_MSWINDOWS_DC (p))
-	DeleteDC(IMAGE_INSTANCE_MSWINDOWS_DC (p));
       if (IMAGE_INSTANCE_MSWINDOWS_BITMAP (p))
-	DeleteObject(IMAGE_INSTANCE_MSWINDOWS_BITMAP (p));
+	DeleteObject (IMAGE_INSTANCE_MSWINDOWS_BITMAP (p));
       IMAGE_INSTANCE_MSWINDOWS_BITMAP (p) = 0;
-      IMAGE_INSTANCE_MSWINDOWS_DC (p) = 0;
     }
 
   xfree (p->data);
--- a/src/glyphs-msw.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/glyphs-msw.h	Mon Aug 13 10:27:19 2007 +0200
@@ -38,7 +38,6 @@
 struct mswindows_image_instance_data
 {
   HBITMAP bitmap;
-  HDC	dc;
 };
 
 #define MSWINDOWS_IMAGE_INSTANCE_DATA(i) \
@@ -46,14 +45,10 @@
 
 #define IMAGE_INSTANCE_MSWINDOWS_BITMAP(i) \
 (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->bitmap)
-#define IMAGE_INSTANCE_MSWINDOWS_DC(i) \
-     (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->dc)
 #define IMAGE_INSTANCE_MSWINDOWS_MASK(i) 0
 
 #define XIMAGE_INSTANCE_MSWINDOWS_BITMAP(i) \
   IMAGE_INSTANCE_MSWINDOWS_BITMAP (XIMAGE_INSTANCE (i))
-#define XIMAGE_INSTANCE_MSWINDOWS_DC(i) \
-  IMAGE_INSTANCE_MSWINDOWS_DC (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_MSWINDOWS_MASK(i) \
   IMAGE_INSTANCE_MSWINDOWS_MASK (XIMAGE_INSTANCE (i))
 
--- a/src/glyphs-x.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/glyphs-x.c	Mon Aug 13 10:27:19 2007 +0200
@@ -149,13 +149,27 @@
 /************************************************************************/
 /*                      image instance methods                          */
 /************************************************************************/
+DOESNT_RETURN
+signal_image_error(CONST char *reason, Lisp_Object frob)
+{
+  signal_error (Qimage_conversion_error, list2 (build_translated_string (reason), frob));
+}
+
+DOESNT_RETURN
+signal_image_error_2 (CONST char *reason,
+                       Lisp_Object frob0, Lisp_Object frob1)
+{
+  signal_error (Qimage_conversion_error, list3 (build_translated_string (reason), frob0,
+			       frob1));
+}
 
 /************************************************************************/
 /* convert from a series of RGB triples to an XImage formated for the   */
 /* proper display 							*/
 /************************************************************************/
-XImage *EImage2XImage(Lisp_Object device, int width, int height, unsigned char *pic,
-		      unsigned long **pixtbl, int *pixcount, int *npixels)
+XImage *
+convert_EImage_to_XImage(Lisp_Object device, int width, int height, unsigned char *pic,
+	      unsigned long **pixtbl, int *pixcount, int *npixels)
 {
   Display *dpy;
   Colormap cmap;
@@ -175,12 +189,13 @@
   vis = DEVICE_X_VISUAL (XDEVICE(device));
   depth = DEVICE_X_DEPTH(XDEVICE(device));
 
-  if (vis->class == PseudoColor) {
-    /* Quantize the image and get a histogram while we're at it.
-       Do this first to save memory */
-    qtable = EImage_build_quantable(pic, width, height, 256);
-    if (qtable == NULL) return NULL;
-  }
+  if (vis->class == PseudoColor)
+    {
+      /* Quantize the image and get a histogram while we're at it.
+	 Do this first to save memory */
+      qtable = build_EImage_quantable(pic, width, height, 256);
+      if (qtable == NULL) return NULL;
+    }
 
   bitmap_pad = ((depth > 16) ? 32 :
 		(depth >  8) ? 16 :
@@ -193,117 +208,130 @@
   if (!outimg) return NULL;
 
   data = (unsigned char *) xmalloc (outimg->bytes_per_line * height);
-  if (!data) {
-    XDestroyImage(outimg);
-    return NULL;
-  }
+  if (!data)
+    {
+      XDestroyImage(outimg);
+      return NULL;
+    }
   outimg->data = data;
   
-  if (vis->class == PseudoColor) {
-    unsigned long pixarray[256];
-    int n;
-    /* use our quantize table to allocate the colors */
-    *pixcount = 32;
-    *pixtbl = xnew_array (unsigned long, *pixcount);
-    *npixels = 0;
-
-    /* ### should implement a sort by popularity to assure proper allocation */
-    n = *npixels;
-    for (i = 0; i < qtable->num_active_colors; i++) {
-	XColor color;
-	int res;
+  if (vis->class == PseudoColor)
+    {
+      unsigned long pixarray[256];
+      int n;
+      /* use our quantize table to allocate the colors */
+      *pixcount = 32;
+      *pixtbl = xnew_array (unsigned long, *pixcount);
+      *npixels = 0;
+
+      /* ### should implement a sort by popularity to assure proper allocation */
+      n = *npixels;
+      for (i = 0; i < qtable->num_active_colors; i++)
+	{
+	  XColor color;
+	  int res;
 	
-	color.red = qtable->rm[i] ? qtable->rm[i] << 8 : 0;
-	color.green = qtable->gm[i] ? qtable->gm[i] << 8 : 0;
-	color.blue = qtable->bm[i] ? qtable->bm[i] << 8 : 0;
-	color.flags = DoRed | DoGreen | DoBlue;
-	res = allocate_nearest_color (dpy, cmap, vis, &color);
-	if (res > 0 && res < 3)
-	  {
-	    DO_REALLOC(*pixtbl, *pixcount, n+1, unsigned long);
-	    (*pixtbl)[n] = color.pixel;
-	    n++;
-	  }
-	pixarray[i] = color.pixel;
-    }
-    *npixels = n;
-    ip = pic;
-    for (i = 0; i < height; i++) {
-      dp = data + (i * outimg->bytes_per_line);
-      for (j = 0; j < width; j++) {
-	rd = *ip++;
-	gr = *ip++;
-	bl = *ip++;
-	conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)];
+	  color.red = qtable->rm[i] ? qtable->rm[i] << 8 : 0;
+	  color.green = qtable->gm[i] ? qtable->gm[i] << 8 : 0;
+	  color.blue = qtable->bm[i] ? qtable->bm[i] << 8 : 0;
+	  color.flags = DoRed | DoGreen | DoBlue;
+	  res = allocate_nearest_color (dpy, cmap, vis, &color);
+	  if (res > 0 && res < 3)
+	    {
+	      DO_REALLOC(*pixtbl, *pixcount, n+1, unsigned long);
+	      (*pixtbl)[n] = color.pixel;
+	      n++;
+	    }
+	  pixarray[i] = color.pixel;
+	}
+      *npixels = n;
+      ip = pic;
+      for (i = 0; i < height; i++)
+	{
+	  dp = data + (i * outimg->bytes_per_line);
+	  for (j = 0; j < width; j++)
+	    {
+	      rd = *ip++;
+	      gr = *ip++;
+	      bl = *ip++;
+	      conv.val = pixarray[QUANT_GET_COLOR(qtable,rd,gr,bl)];
 #ifdef WORDS_BIGENDIAN
-	for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
+	      for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
 #else
-	for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
+	      for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
 #endif
-      }
-    }
-    xfree(qtable);
-  } else {
-    unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk;
-    junk = vis->red_mask;
-    rshift = 0;
-    while ((junk & 0x1) == 0) {
-      junk = junk >> 1;
-      rshift ++;
-    }
-    rbits = 0;
-    while (junk != 0) {
-      junk = junk >> 1;
-      rbits++;
-    }
-    junk = vis->green_mask;
-    gshift = 0;
-    while ((junk & 0x1) == 0) {
-      junk = junk >> 1;
-      gshift ++;
-    }
-    gbits = 0;
-    while (junk != 0) {
-      junk = junk >> 1;
-      gbits++;
-    }
-    junk = vis->blue_mask;
-    bshift = 0;
-    while ((junk & 0x1) == 0) {
-      junk = junk >> 1;
-      bshift ++;
-    }
-    bbits = 0;
-    while (junk != 0) {
-      junk = junk >> 1;
-      bbits++;
-    }
-    ip = pic;
-    for (i = 0; i < height; i++) {
-      dp = data + (i * outimg->bytes_per_line);
-      for (j = 0; j < width; j++) {
-	if (rbits > 8)
-	  rd = *ip++ << (rbits - 8);
-	else
-	  rd = *ip++ >> (8 - rbits);
-	if (gbits > 8)
-	  gr = *ip++ << (gbits - 8);
-	else
-	  gr = *ip++ >> (8 - gbits);
-	if (bbits > 8)
-	  bl = *ip++ << (bbits - 8);
-	else
-	  bl = *ip++ >> (8 - bbits);
-
-	conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift);
+	    }
+	}
+      xfree(qtable);
+    } else {
+      unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk;
+      junk = vis->red_mask;
+      rshift = 0;
+      while ((junk & 0x1) == 0)
+	{
+	  junk = junk >> 1;
+	  rshift ++;
+	}
+      rbits = 0;
+      while (junk != 0)
+	{
+	  junk = junk >> 1;
+	  rbits++;
+	}
+      junk = vis->green_mask;
+      gshift = 0;
+      while ((junk & 0x1) == 0)
+	{
+	  junk = junk >> 1;
+	  gshift ++;
+	}
+      gbits = 0;
+      while (junk != 0)
+	{
+	  junk = junk >> 1;
+	  gbits++;
+	}
+      junk = vis->blue_mask;
+      bshift = 0;
+      while ((junk & 0x1) == 0)
+	{
+	  junk = junk >> 1;
+	  bshift ++;
+	}
+      bbits = 0;
+      while (junk != 0)
+	{
+	  junk = junk >> 1;
+	  bbits++;
+	}
+      ip = pic;
+      for (i = 0; i < height; i++)
+	{
+	  dp = data + (i * outimg->bytes_per_line);
+	  for (j = 0; j < width; j++)
+	    {
+	      if (rbits > 8)
+		rd = *ip++ << (rbits - 8);
+	      else
+		rd = *ip++ >> (8 - rbits);
+	      if (gbits > 8)
+		gr = *ip++ << (gbits - 8);
+	      else
+		gr = *ip++ >> (8 - gbits);
+	      if (bbits > 8)
+		bl = *ip++ << (bbits - 8);
+	      else
+		bl = *ip++ >> (8 - bbits);
+
+	      conv.val = (rd << rshift) | (gr << gshift) | (bl << bshift);
 #ifdef WORDS_BIGENDIAN
-	for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
+	      for (q = 4-byte_cnt; q < 4; q++) *dp++ = conv.cp[q];
 #else
-	for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
+	      for (q = 0; q < byte_cnt; q++) *dp++ = conv.cp[q];
 #endif
-      }
-    }
-  }  
+	    }
+	}
+    }  
   return outimg;
 }
 
@@ -366,7 +394,7 @@
       if (IMAGE_INSTANCE_X_NPIXELS (p) != 0)
 	{
 	  XFreeColors (dpy,
-		       DEVICE_X_COLORMAP (XDEVICE(p->device)),
+		       IMAGE_INSTANCE_X_COLORMAP (p),
 		       IMAGE_INSTANCE_X_PIXELS (p),
 		       IMAGE_INSTANCE_X_NPIXELS (p), 0);
 	  IMAGE_INSTANCE_X_NPIXELS (p) = 0;
@@ -391,7 +419,8 @@
     case IMAGE_MONO_PIXMAP:
     case IMAGE_COLOR_PIXMAP:
     case IMAGE_POINTER:
-      if (IMAGE_INSTANCE_X_NPIXELS (p1) != IMAGE_INSTANCE_X_NPIXELS (p2))
+      if (IMAGE_INSTANCE_X_COLORMAP (p1) != IMAGE_INSTANCE_X_COLORMAP (p2) ||
+	  IMAGE_INSTANCE_X_NPIXELS (p1) != IMAGE_INSTANCE_X_NPIXELS (p2))
 	return 0;
 #if HAVE_SUBWINDOWS
     case IMAGE_SUBWINDOW:
@@ -677,27 +706,28 @@
 #endif
 
   /* Get the data while doing the conversion */
-  while (1) {
-    int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf));
-    if (!size_in_bytes)
-      break;
-    /* It does seem the flushes are necessary... */
+  while (1)
+    {
+      int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf));
+      if (!size_in_bytes)
+	break;
+      /* It does seem the flushes are necessary... */
 #ifdef FILE_CODING
-    Lstream_write (costr, tempbuf, size_in_bytes);
-    Lstream_flush (costr);
+      Lstream_write (costr, tempbuf, size_in_bytes);
+      Lstream_flush (costr);
 #else
-    Lstream_write (ostr, tempbuf, size_in_bytes);
+      Lstream_write (ostr, tempbuf, size_in_bytes);
 #endif
-    Lstream_flush (ostr);
-    if (fwrite ((unsigned char *)Dynarr_atp(conversion_out_dynarr, 0),
-		Dynarr_length(conversion_out_dynarr), 1, tmpfil) != 1)
-      {
-	fubar = 1;
-	break;
-      }
-    /* reset the dynarr */
-    Lstream_rewind(ostr);
-  }
+      Lstream_flush (ostr);
+      if (fwrite ((unsigned char *)Dynarr_atp(conversion_out_dynarr, 0),
+		  Dynarr_length(conversion_out_dynarr), 1, tmpfil) != 1)
+	{
+	  fubar = 1;
+	  break;
+	}
+      /* reset the dynarr */
+      Lstream_rewind(ostr);
+    }
   
   if (fclose (tmpfil) != 0)
     fubar = 1;
@@ -824,6 +854,7 @@
 init_image_instance_from_x_image (struct Lisp_Image_Instance *ii,
 				  XImage *ximage,
 				  int dest_mask,
+				  Colormap cmap,
 				  unsigned long *pixels,
 				  int npixels,
 				  Lisp_Object instantiator)
@@ -871,6 +902,7 @@
   IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = ximage->width;
   IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = ximage->height;
   IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = ximage->depth;
+  IMAGE_INSTANCE_X_COLORMAP (ii) = cmap;
   IMAGE_INSTANCE_X_PIXELS (ii) = pixels;
   IMAGE_INSTANCE_X_NPIXELS (ii) = npixels;
 }
@@ -1261,7 +1293,7 @@
   CONST char *gcc_may_you_rot_in_hell;
 
   if (!NILP (mask_data))
-{
+    {
       GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (mask_data))),
 				       gcc_may_you_rot_in_hell);
       mask =
@@ -1381,7 +1413,7 @@
       {
 	if (ok_if_data_invalid)
 	  return Qt;
-	signal_simple_error ("invalid XPM data in file", name);
+	signal_image_error ("invalid XPM data in file", name);
       }
     case XpmNoMemory:
       {
@@ -1647,7 +1679,7 @@
 			      | IMAGE_POINTER_MASK);
   force_mono = (type != IMAGE_COLOR_PIXMAP);
 
-#if 0
+#if 1
   /* Although I haven't found it documented yet, it appears that pointers are
      always colored via the default window colormap... Sigh.  However, with
      the current color structure, this will blow the doors off as things aren't set up
@@ -1719,7 +1751,7 @@
     case XpmFileInvalid:
       {
 	xpm_free (&xpmattrs);
-	signal_simple_error ("invalid XPM data", data);
+	signal_image_error ("invalid XPM data", data);
       }
     case XpmColorFailed:
     case XpmColorError:
@@ -1778,6 +1810,7 @@
 
     IMAGE_INSTANCE_X_PIXMAP (ii) = pixmap;
     IMAGE_INSTANCE_X_MASK (ii) = mask;
+    IMAGE_INSTANCE_X_COLORMAP (ii) = cmap;
     IMAGE_INSTANCE_X_PIXELS (ii) = pixels;
     IMAGE_INSTANCE_X_NPIXELS (ii) = npixels;
     IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = w;
@@ -2074,7 +2107,8 @@
 #else
 METHODDEF void
 #endif
-our_init_source (j_decompress_ptr cinfo) {
+our_init_source (j_decompress_ptr cinfo)
+{
 }
 
 #if defined(JPEG_LIB_VERSION) && (JPEG_LIB_VERSION >= 61)
@@ -2082,7 +2116,8 @@
 #else
 METHODDEF boolean
 #endif
-our_fill_input_buffer (j_decompress_ptr cinfo) {
+our_fill_input_buffer (j_decompress_ptr cinfo)
+{
   /* Insert a fake EOI marker */
   struct jpeg_source_mgr *src = (struct jpeg_source_mgr *) cinfo->src;
   static JOCTET buffer[2];
@@ -2100,17 +2135,20 @@
 #else
 METHODDEF void
 #endif
-our_skip_input_data (j_decompress_ptr cinfo, long num_bytes) {
+our_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
+{
   struct jpeg_source_mgr *src = NULL;
 
   src = (struct jpeg_source_mgr *) cinfo->src;
 
-  if (!src) {
-    return;
-  } else if (num_bytes > src->bytes_in_buffer) {
-    ERREXIT(cinfo, JERR_INPUT_EOF);
-    /*NOTREACHED*/
-  }
+  if (!src)
+    {
+      return;
+    } else if (num_bytes > src->bytes_in_buffer)
+      {
+	ERREXIT(cinfo, JERR_INPUT_EOF);
+	/*NOTREACHED*/
+      }
 
   src->bytes_in_buffer -= num_bytes;
   src->next_input_byte += num_bytes;
@@ -2121,7 +2159,8 @@
 #else
 METHODDEF void
 #endif
-our_term_source (j_decompress_ptr cinfo) {
+our_term_source (j_decompress_ptr cinfo)
+{
 }
 
 typedef struct {
@@ -2133,13 +2172,14 @@
 {
   struct jpeg_source_mgr *src = NULL;
 
-  if (cinfo->src == NULL) {	/* first time for this JPEG object? */
-    cinfo->src = (struct jpeg_source_mgr *)
-      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
-				  sizeof(our_jpeg_source_mgr));
-    src = (struct jpeg_source_mgr *) cinfo->src;
-    src->next_input_byte = data;
-  }
+  if (cinfo->src == NULL)
+    {	/* first time for this JPEG object? */
+      cinfo->src = (struct jpeg_source_mgr *)
+	(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+				    sizeof(our_jpeg_source_mgr));
+      src = (struct jpeg_source_mgr *) cinfo->src;
+      src->next_input_byte = data;
+    }
   src = (struct jpeg_source_mgr *) cinfo->src;
   src->init_source = our_init_source;
   src->fill_input_buffer = our_fill_input_buffer;
@@ -2267,8 +2307,8 @@
 	(*cinfo.err->format_message) ((j_common_ptr) &cinfo, buffer);
 	errstring = build_string (buffer);
 
-	signal_simple_error_2 ("JPEG decoding error",
-			       errstring, instantiator);
+	signal_image_error_2 ("JPEG decoding error",
+			      errstring, instantiator);
       }
     }
 
@@ -2344,39 +2384,40 @@
   /* At this point we know the size of the image and the colormap. */
 
   /* Step 5.33: Allocate the colors */
-  if (vis->class == PseudoColor) {
-    int i;
-    unwind.pixcount = 32;
-    unwind.pixels = xnew_array (unsigned long, unwind.pixcount);
-    unwind.npixels = 0;
-
-    /* Allocate pixels for the various colors. */
-    for (i = 0; i < cinfo.actual_number_of_colors; i++)
-      {
-	XColor color;
-	int ri, gi, bi, res;
-
-	ri = 0;
-	gi = cinfo.out_color_components > 1 ? 1 : 0;
-	bi = cinfo.out_color_components > 2 ? 2 : 0;
-
-	/* Ok... apparently, an entry of cinfo.colormap can be NULL if
-	   there are no bits of that color in the image.  How incredibly
-	   gross.  Wouldn't it be nice to have exceptions!? */
-	color.red = cinfo.colormap[ri] ? cinfo.colormap[ri][i] << 8 : 0;
-	color.green = cinfo.colormap[gi] ? cinfo.colormap[gi][i] << 8 : 0;
-	color.blue = cinfo.colormap[bi] ? cinfo.colormap[bi][i] << 8 : 0;
-	color.flags = DoRed | DoGreen | DoBlue;
-
-	res = allocate_nearest_color (dpy, cmap, vis, &color);
-	if (res > 0 && res < 3)
-	  {
-	    DO_REALLOC(unwind.pixels, unwind.pixcount, unwind.npixels+1, unsigned long);
-	    unwind.pixels[unwind.npixels] = color.pixel;
-	    unwind.npixels++;
-	  }
-      }
-  }
+  if (vis->class == PseudoColor)
+    {
+      int i;
+      unwind.pixcount = 32;
+      unwind.pixels = xnew_array (unsigned long, unwind.pixcount);
+      unwind.npixels = 0;
+
+      /* Allocate pixels for the various colors. */
+      for (i = 0; i < cinfo.actual_number_of_colors; i++)
+	{
+	  XColor color;
+	  int ri, gi, bi, res;
+
+	  ri = 0;
+	  gi = cinfo.out_color_components > 1 ? 1 : 0;
+	  bi = cinfo.out_color_components > 2 ? 2 : 0;
+
+	  /* Ok... apparently, an entry of cinfo.colormap can be NULL if
+	     there are no bits of that color in the image.  How incredibly
+	     gross.  Wouldn't it be nice to have exceptions!? */
+	  color.red = cinfo.colormap[ri] ? cinfo.colormap[ri][i] << 8 : 0;
+	  color.green = cinfo.colormap[gi] ? cinfo.colormap[gi][i] << 8 : 0;
+	  color.blue = cinfo.colormap[bi] ? cinfo.colormap[bi][i] << 8 : 0;
+	  color.flags = DoRed | DoGreen | DoBlue;
+
+	  res = allocate_nearest_color (dpy, cmap, vis, &color);
+	  if (res > 0 && res < 3)
+	    {
+	      DO_REALLOC(unwind.pixels, unwind.pixcount, unwind.npixels+1, unsigned long);
+	      unwind.pixels[unwind.npixels] = color.pixel;
+	      unwind.npixels++;
+	    }
+	}
+    }
 
   /* Step 5.66: Create the image */
   {
@@ -2396,7 +2437,7 @@
 				  bitmap_pad, 0);
 
     if (!unwind.ximage)
-      signal_simple_error ("Unable to create X image struct", instantiator);
+      signal_image_error ("Unable to create X image struct", instantiator);
 
     /* now that bytes_per_line must have been set properly alloc data */
     unwind.ximage->data =
@@ -2464,7 +2505,7 @@
 
     unwind.eimage = (unsigned char*) xmalloc (cinfo.output_width * cinfo.output_height * 3);
     if (!unwind.eimage)
-      signal_simple_error("Unable to allocate enough memory for image", instantiator);
+      signal_image_error("Unable to allocate enough memory for image", instantiator);
 
     {
       JSAMPARRAY row_buffer;	/* Output row buffer */
@@ -2497,28 +2538,29 @@
 	   */
 	  (void) jpeg_read_scanlines (&cinfo, row_buffer, 1);
 	  jp = row_buffer[0];
-	  for (i = 0; i < cinfo.output_width; i++) {
-	    int clr;
+	  for (i = 0; i < cinfo.output_width; i++)
+	    {
+	      int clr;
 #if (BITS_IN_JSAMPLE == 8)
-	    for (clr = 0; clr < 3; clr++)
-	      *op++ = (unsigned char)*jp++;
+	      for (clr = 0; clr < 3; clr++)
+		*op++ = (unsigned char)*jp++;
 #else /* other option is 12 */
-	    for (clr = 0; clr < 3; clr++)
-	      *op++ = (unsigned char)(*jp++ >> 4);
+	      for (clr = 0; clr < 3; clr++)
+		*op++ = (unsigned char)(*jp++ >> 4);
 #endif
-	  }
+	    }
 	}
-      unwind.ximage = EImage2XImage (device, cinfo.output_width, cinfo.output_height, unwind.eimage,
+      unwind.ximage = convert_EImage_to_XImage (device, cinfo.output_width, cinfo.output_height, unwind.eimage,
 				     &unwind.pixels, &unwind.pixcount, &unwind.npixels);
       if (!unwind.ximage)
-	signal_simple_error("JPEG conversion failed", instantiator);
+	signal_image_error("JPEG conversion failed", instantiator);
     }
   }
   
 #endif
   /* Step 6.5: Create the pixmap and set up the image instance */
   init_image_instance_from_x_image (ii, unwind.ximage, dest_mask,
-				    unwind.pixels, unwind.npixels,
+				    cmap, unwind.pixels, unwind.npixels,
 				    instantiator);
 
   /* Step 7: Finish decompression */
@@ -2633,7 +2675,8 @@
   int index;			/* Where are we?  */
 } gif_memory_storage;
 
-static size_t gif_read_from_memory(GifByteType *buf, size_t size, VoidPtr data)
+static size_t
+gif_read_from_memory(GifByteType *buf, size_t size, VoidPtr data)
 {
   gif_memory_storage *mem = (gif_memory_storage*)data;
 
@@ -2644,7 +2687,8 @@
   return size;
 }
 
-static int gif_memory_close(VoidPtr data)
+static int
+gif_memory_close(VoidPtr data)
 {
   return 0;
 }
@@ -2656,7 +2700,8 @@
   jmp_buf setjmp_buffer;	/* for return to caller */
 };
 
-static void gif_error_func(CONST char *err_str, VoidPtr error_ptr)
+static void
+gif_error_func(CONST char *err_str, VoidPtr error_ptr)
 {
   struct gif_error_struct *error_data = (struct gif_error_struct*)error_ptr;
 
@@ -2706,16 +2751,17 @@
     assert (!NILP (data));
 
     if (!(unwind.giffile = GifSetup()))
-      signal_simple_error ("Insufficent memory to instantiate GIF image", instantiator);
+      signal_image_error ("Insufficent memory to instantiate GIF image", instantiator);
 
     /* set up error facilities */
-    if (setjmp(gif_err.setjmp_buffer)) {
-      /* An error was signaled. No clean up is needed, as unwind handles that
-	 for us.  Just pass the error along. */
-      Lisp_Object errstring;
-      errstring = build_string (gif_err.err_str);
-      signal_simple_error_2 ("GIF decoding error", errstring, instantiator);
-    }
+    if (setjmp(gif_err.setjmp_buffer))
+      {
+	/* An error was signaled. No clean up is needed, as unwind handles that
+	   for us.  Just pass the error along. */
+	Lisp_Object errstring;
+	errstring = build_string (gif_err.err_str);
+	signal_image_error_2 ("GIF decoding error", errstring, instantiator);
+      }
     GifSetErrorFunc(unwind.giffile, (Gif_error_func)gif_error_func, (VoidPtr)&gif_err);
     
 #ifdef USE_TEMP_FILES_FOR_GIF_IMAGES
@@ -2795,7 +2841,7 @@
 				  bitmap_pad, 0);
 
     if (!unwind.ximage)
-      signal_simple_error ("Unable to create X image struct", instantiator);
+      signal_image_error ("Unable to create X image struct", instantiator);
 
     /* now that bytes_per_line must have been set properly alloc data */
     unwind.ximage->data =
@@ -2819,7 +2865,7 @@
 	|| unwind.giffile->SavedImages[0].ImageDesc.Width != width
 	|| unwind.giffile->SavedImages[0].ImageDesc.Left != 0
 	|| unwind.giffile->SavedImages[0].ImageDesc.Top != 0)
-      signal_simple_error ("First image in GIF file is not full size",
+      signal_image_error ("First image in GIF file is not full size",
 			   instantiator);
 
     interlace = unwind.giffile->SavedImages[0].ImageDesc.Interlace;
@@ -2856,7 +2902,7 @@
 
     unwind.eimage = (unsigned char*) xmalloc (width * height * 3);
     if (!unwind.eimage)
-      signal_simple_error("Unable to allocate enough memory for image", instantiator);
+      signal_image_error("Unable to allocate enough memory for image", instantiator);
 
     /* write the data in EImage format (8bit RGB triples) */
 
@@ -2868,7 +2914,7 @@
 	|| unwind.giffile->SavedImages[0].ImageDesc.Width != width
 	|| unwind.giffile->SavedImages[0].ImageDesc.Left != 0
 	|| unwind.giffile->SavedImages[0].ImageDesc.Top != 0)
-      signal_simple_error ("First image in GIF file is not full size",
+      signal_image_error ("First image in GIF file is not full size",
 			   instantiator);
 
     interlace = unwind.giffile->SavedImages[0].ImageDesc.Interlace;
@@ -2880,23 +2926,24 @@
 	if (interlace && row >= height)
 	  row = InterlacedOffset[++pass];
 	eip = unwind.eimage + (row * width * 3);
-	for (j = 0; j < width; j++) {
-	  unsigned char pixel = unwind.giffile->SavedImages[0].RasterBits[(i * width) + j];
-	  *eip++ = cmo->Colors[pixel].Red;
-	  *eip++ = cmo->Colors[pixel].Green;
-	  *eip++ = cmo->Colors[pixel].Blue;
-	}
+	for (j = 0; j < width; j++)
+	  {
+	    unsigned char pixel = unwind.giffile->SavedImages[0].RasterBits[(i * width) + j];
+	    *eip++ = cmo->Colors[pixel].Red;
+	    *eip++ = cmo->Colors[pixel].Green;
+	    *eip++ = cmo->Colors[pixel].Blue;
+	  }
 	row += interlace ? InterlacedJumps[pass] : 1;
       }
-    unwind.ximage = EImage2XImage (device, width, height, unwind.eimage,
+    unwind.ximage = convert_EImage_to_XImage (device, width, height, unwind.eimage,
 				   &unwind.pixels, &unwind.pixcount, &unwind.npixels);
     if (!unwind.ximage)
-      signal_simple_error("GIF conversion failed", instantiator);
+      signal_image_error("GIF conversion failed", instantiator);
   }
 #endif
   /* 4. Now create the pixmap and set up the image instance */
   init_image_instance_from_x_image (ii, unwind.ximage, dest_mask,
-				    unwind.pixels, unwind.npixels,
+				    cmap, unwind.pixels, unwind.npixels,
 				    instantiator);
   /* Now that we've succeeded, we don't want the pixels
      freed right now.  They're kept around in the image instance
@@ -2941,15 +2988,16 @@
   int index;			/* Where are we?  */
 };
 
-static void png_read_from_memory(png_structp png_ptr, png_bytep data,
-				 png_size_t length)
+static void
+png_read_from_memory(png_structp png_ptr, png_bytep data,
+		     png_size_t length)
 {
    struct png_memory_storage *tbr =
      (struct png_memory_storage *) png_get_io_ptr (png_ptr);
 
    if (length > (tbr->len - tbr->index))
      png_error (png_ptr, (png_const_charp) "Read Error");
-   memcpy(data,tbr->bytes + tbr->index,length);
+   memcpy (data,tbr->bytes + tbr->index,length);
    tbr->index = tbr->index + length;
 }
 #endif /* !USE_TEMP_FILES_FOR_PNG_IMAGES */
@@ -2968,13 +3016,15 @@
    go away when the lisp engine is threaded! */
 static struct png_error_struct png_err_stct;
 
-static void png_error_func(png_structp png_ptr, png_const_charp message)
+static void
+png_error_func(png_structp png_ptr, png_const_charp message)
 {
   png_err_stct.err_str = message;
   longjmp (png_err_stct.setjmp_buffer, 1);
 }
 
-static void png_warning_func(png_structp png_ptr, png_const_charp message)
+static void
+png_warning_func(png_structp png_ptr, png_const_charp message)
 {
   warn_when_safe (Qpng, Qinfo, "%s", message);
 }
@@ -3055,15 +3105,15 @@
   vis = DEVICE_X_VISUAL (XDEVICE(device));
 
   /* Initialize all PNG structures */
-  png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, (void*)&png_err_stct,
-				   png_error_func, png_warning_func);
+  png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, (void*)&png_err_stct,
+				    png_error_func, png_warning_func);
   if (!png_ptr)
-    signal_simple_error("Error obtaining memory for png_read", instantiator);
-  info_ptr = png_create_info_struct(png_ptr);
+    signal_image_error ("Error obtaining memory for png_read", instantiator);
+  info_ptr = png_create_info_struct (png_ptr);
   if (!info_ptr)
     {
-      png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
-      signal_simple_error("Error obtaining memory for png_read", instantiator);
+      png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
+      signal_image_error ("Error obtaining memory for png_read", instantiator);
     }
   
   memset (&unwind, 0, sizeof (unwind));
@@ -3087,7 +3137,7 @@
   if (setjmp (png_err_stct.setjmp_buffer))
     {
       /* Something blew up: just display the error (cleanup happens in the unwind) */
-      signal_simple_error_2 ("Error decoding PNG",
+      signal_image_error_2 ("Error decoding PNG",
 			     build_string(png_err_stct.err_str),
 			     instantiator);
     }
@@ -3107,7 +3157,7 @@
     tbr.bytes = bytes;
     tbr.len = len;
     tbr.index = 0;
-    png_set_read_fn(png_ptr,(void *) &tbr, png_read_from_memory);
+    png_set_read_fn (png_ptr,(void *) &tbr, png_read_from_memory);
   }
 
   png_read_info (png_ptr, info_ptr);
@@ -3262,7 +3312,7 @@
 				  bitmap_pad, 0);
 
     if (!unwind.ximage)
-      signal_simple_error ("Unable to create X image struct",
+      signal_image_error ("Unable to create X image struct",
 			   instantiator);
 
     /* now that bytes_per_line must have been set properly alloc data */
@@ -3302,29 +3352,31 @@
        of image*/
     /* convert palatte images to full RGB */
     if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
-      png_set_expand(png_ptr);
+      png_set_expand (png_ptr);
     /* send grayscale images to RGB too */
     if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
         info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
-      png_set_gray_to_rgb(png_ptr);
+      png_set_gray_to_rgb (png_ptr);
     /* we can't handle alpha values */
     if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
-      png_set_strip_alpha(png_ptr);
+      png_set_strip_alpha (png_ptr);
     /* rip out any transparancy layers/colors */
-    if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
-        png_set_expand(png_ptr);
-	png_set_strip_alpha(png_ptr);
-    }
+    if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS))
+      {
+        png_set_expand (png_ptr);
+	png_set_strip_alpha (png_ptr);
+      }
     /* tell libpng to strip 16 bit depth files down to 8 bits */
     if (info_ptr->bit_depth == 16)
       png_set_strip_16 (png_ptr);
     /* if the image is < 8 bits, pad it out */
-    if (info_ptr->bit_depth < 8) {
-      if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
-	png_set_expand(png_ptr);
-      else
-	png_set_packing (png_ptr);
-    }
+    if (info_ptr->bit_depth < 8)
+      {
+	if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
+	  png_set_expand (png_ptr);
+	else
+	  png_set_packing (png_ptr);
+      }
 
 #if 1 /* tests? or permanent? */
     {
@@ -3337,12 +3389,12 @@
       my_background.green = 0x7fff;
       my_background.blue = 0x7fff;
 
-      if (png_get_bKGD(png_ptr, info_ptr, &image_background))
-	png_set_background(png_ptr, image_background,
-			   PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
+      if (png_get_bKGD (png_ptr, info_ptr, &image_background))
+	png_set_background (png_ptr, image_background,
+			    PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
       else 
-	png_set_background(png_ptr, &my_background,
-			   PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
+	png_set_background (png_ptr, &my_background,
+			    PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
     }
 #endif
     png_read_image (png_ptr, row_pointers);
@@ -3373,15 +3425,15 @@
 #endif
 
     xfree (row_pointers);
-    unwind.ximage = EImage2XImage (device, width, height, unwind.eimage,
+    unwind.ximage = convert_EImage_to_XImage (device, width, height, unwind.eimage,
 				   &unwind.pixels, &unwind.pixcount, &unwind.npixels);
     if (!unwind.ximage)
-      signal_simple_error("PNG conversion failed", instantiator);
+      signal_image_error ("PNG conversion failed", instantiator);
   }
 #endif
 
   init_image_instance_from_x_image (ii, unwind.ximage, dest_mask,
-				    unwind.pixels, unwind.npixels,
+				    cmap, unwind.pixels, unwind.npixels,
 				    instantiator);
 
   /* This will clean up everything else. */
@@ -3443,7 +3495,7 @@
       TIFFClose(data->tiff);
     }
   if (data->eimage)
-    xfree(data->eimage);
+    xfree (data->eimage);
   if (data->npixels > 0)
     XFreeColors (data->dpy, data->cmap, data->pixels, data->npixels, 0L);
   if (data->pixcount)
@@ -3468,7 +3520,8 @@
   int index;			/* Where are we?  */
 } tiff_memory_storage;
 
-static size_t tiff_memory_read(thandle_t data, tdata_t buf, tsize_t size)
+static size_t
+tiff_memory_read(thandle_t data, tdata_t buf, tsize_t size)
 {
   tiff_memory_storage *mem = (tiff_memory_storage*)data;
 
@@ -3510,22 +3563,26 @@
   return newidx;
 }
 
-static int tiff_memory_close(thandle_t data)
+static int
+tiff_memory_close(thandle_t data)
 {
   return 0;
 }
 
-static int tiff_map_noop(thandle_t data, tdata_t* pbase, toff_t* psize)
+static int
+tiff_map_noop(thandle_t data, tdata_t* pbase, toff_t* psize)
 {
   return 0;
 }
 
-static void tiff_unmap_noop(thandle_t data, tdata_t pbase, toff_t psize)
+static void
+tiff_unmap_noop(thandle_t data, tdata_t pbase, toff_t psize)
 {
   return;
 }
 
-static toff_t tiff_memory_size(thandle_t data)
+static toff_t
+tiff_memory_size(thandle_t data)
 {
   tiff_memory_storage *mem = (tiff_memory_storage*)data;
   return mem->len;
@@ -3547,23 +3604,25 @@
    before XEmacs gets threads! */
 static struct tiff_error_struct tiff_err_data;
 
-static void tiff_error_func(CONST char *module, CONST char *fmt, ...)
+static void
+tiff_error_func(CONST char *module, CONST char *fmt, ...)
 {
   va_list vargs;
 
   va_start (vargs, fmt);
 #if HAVE_VSNPRINTF
-  vsnprintf(tiff_err_data.err_str, 255, fmt, vargs);
+  vsnprintf (tiff_err_data.err_str, 255, fmt, vargs);
 #else
   /* pray this doesn't overflow... */
-  vsprintf(tiff_err_data.err_str, fmt, vargs);
+  vsprintf (tiff_err_data.err_str, fmt, vargs);
 #endif
-  va_end(vargs);
+  va_end (vargs);
   /* return to setjmp point */
   longjmp (tiff_err_data.setjmp_buffer, 1);
 }
 
-static void tiff_warning_func(CONST char *module, CONST char *fmt, ...)
+static void
+tiff_warning_func(CONST char *module, CONST char *fmt, ...)
 {
   va_list vargs;
 #if HAVE_VSNPRINTF
@@ -3574,11 +3633,11 @@
 
   va_start (vargs, fmt);
 #if HAVE_VSNPRINTF
-  vsnprintf(warn_str, 255, fmt, vargs);
+  vsnprintf (warn_str, 255, fmt, vargs);
 #else
-  vsprintf(warn_str, fmt, vargs);
+  vsprintf (warn_str, fmt, vargs);
 #endif
-  va_end(vargs);
+  va_end (vargs);
   warn_when_safe (Qtiff, Qinfo, "%s - %s",
 		  module, warn_str);
 }
@@ -3611,15 +3670,16 @@
   record_unwind_protect (tiff_instantiate_unwind, make_opaque_ptr (&unwind));
   
   /* set up error facilities */
-  if (setjmp(tiff_err_data.setjmp_buffer)) {
-  /* An error was signaled. No clean up is needed, as unwind handles that
-     for us.  Just pass the error along. */
-    signal_simple_error_2 ("TIFF decoding error",
-			   build_string(tiff_err_data.err_str),
-			   instantiator);
-  }
-  TIFFSetErrorHandler((TIFFErrorHandler)tiff_error_func);
-  TIFFSetWarningHandler((TIFFErrorHandler)tiff_warning_func);
+  if (setjmp (tiff_err_data.setjmp_buffer))
+    {
+      /* An error was signaled. No clean up is needed, as unwind handles that
+	 for us.  Just pass the error along. */
+      signal_image_error_2 ("TIFF decoding error",
+			    build_string(tiff_err_data.err_str),
+			    instantiator);
+    }
+  TIFFSetErrorHandler ((TIFFErrorHandler)tiff_error_func);
+  TIFFSetWarningHandler ((TIFFErrorHandler)tiff_warning_func);
   {
     Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
     Extbyte *bytes;
@@ -3638,52 +3698,56 @@
     mem_struct.len = len;
     mem_struct.index = 0;
 
-    unwind.tiff = TIFFClientOpen("memfile", "r", &mem_struct,
-				 (TIFFReadWriteProc)tiff_memory_read,
-				 (TIFFReadWriteProc)tiff_memory_write,
-				 tiff_memory_seek, tiff_memory_close, tiff_memory_size,
-				 tiff_map_noop, tiff_unmap_noop);
+    unwind.tiff = TIFFClientOpen ("memfile", "r", &mem_struct,
+				  (TIFFReadWriteProc)tiff_memory_read,
+				  (TIFFReadWriteProc)tiff_memory_write,
+				  tiff_memory_seek, tiff_memory_close, tiff_memory_size,
+				  tiff_map_noop, tiff_unmap_noop);
     if (!unwind.tiff)
-      signal_simple_error ("Insufficent memory to instantiate TIFF image", instantiator);
-
-    TIFFGetField(unwind.tiff, TIFFTAG_IMAGEWIDTH, &width);
-    TIFFGetField(unwind.tiff, TIFFTAG_IMAGELENGTH, &height);
-    unwind.eimage = xmalloc(width * height * 3);
+      signal_image_error ("Insufficent memory to instantiate TIFF image", instantiator);
+
+    TIFFGetField (unwind.tiff, TIFFTAG_IMAGEWIDTH, &width);
+    TIFFGetField (unwind.tiff, TIFFTAG_IMAGELENGTH, &height);
+    unwind.eimage = xmalloc (width * height * 3);
 
     /* ### This is little more than proof-of-concept/function testing.
        It needs to be reimplimented via scanline reads for both memory
        compactness. */
-    raster = (uint32*) _TIFFmalloc(width * height * sizeof (uint32));
-    if (raster != NULL) {
-  int i,j;
-      uint32 *rp;
-      ep = unwind.eimage;
-      rp = raster;
-      if (TIFFReadRGBAImage(unwind.tiff, width, height, raster, 0)) {
-	for (i = height - 1;  i >= 0; i--) {
-	  /* This is to get around weirdness in the libtiff library where properly
-	     made TIFFs will come out upside down.  libtiff bug or jhod-brainlock? */
-	  rp = raster + (i * width);
-	  for (j = 0; j < width; j++) {
-	    *ep++ = (unsigned char)TIFFGetR(*rp);
-	    *ep++ = (unsigned char)TIFFGetG(*rp);
-	    *ep++ = (unsigned char)TIFFGetB(*rp);
-	    rp++;
+    raster = (uint32*) _TIFFmalloc (width * height * sizeof (uint32));
+    if (raster != NULL)
+      {
+	int i,j;
+	uint32 *rp;
+	ep = unwind.eimage;
+	rp = raster;
+	if (TIFFReadRGBAImage (unwind.tiff, width, height, raster, 0))
+	  {
+	    for (i = height - 1;  i >= 0; i--)
+	      {
+		/* This is to get around weirdness in the libtiff library where properly
+		   made TIFFs will come out upside down.  libtiff bug or jhod-brainlock? */
+		rp = raster + (i * width);
+		for (j = 0; j < width; j++)
+		  {
+		    *ep++ = (unsigned char)TIFFGetR(*rp);
+		    *ep++ = (unsigned char)TIFFGetG(*rp);
+		    *ep++ = (unsigned char)TIFFGetB(*rp);
+		    rp++;
+		  }
+	      }
 	  }
-	}
-      }
-      _TIFFfree(raster);
-    } else
-      signal_simple_error ("Unable to allocate memory for TIFFReadRGBA", instantiator);
-
-    unwind.ximage = EImage2XImage (device, width, height, unwind.eimage,
+	_TIFFfree (raster);
+      } else
+	signal_image_error ("Unable to allocate memory for TIFFReadRGBA", instantiator);
+
+    unwind.ximage = convert_EImage_to_XImage (device, width, height, unwind.eimage,
 				   &unwind.pixels, &unwind.pixcount, &unwind.npixels);
     if (!unwind.ximage)
-      signal_simple_error("TIFF conversion failed", instantiator);    
+      signal_image_error ("TIFF conversion failed", instantiator);    
   }
   /* Now create the pixmap and set up the image instance */
   init_image_instance_from_x_image (ii, unwind.ximage, dest_mask,
-				    unwind.pixels, unwind.npixels,
+				    cmap, unwind.pixels, unwind.npixels,
 				    instantiator);
   /* Now that we've succeeded, we don't want the pixels
      freed right now.  They're kept around in the image instance
--- a/src/glyphs-x.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/glyphs-x.h	Mon Aug 13 10:27:19 2007 +0200
@@ -46,6 +46,7 @@
   /* If depth>0, then that means that other colors were allocated when
      this pixmap was loaded.  These are they; we need to free them when
      finalizing the image instance. */
+  Colormap colormap;
   unsigned long *pixels;
   int npixels;
 
@@ -58,6 +59,7 @@
 #define IMAGE_INSTANCE_X_PIXMAP(i) (X_IMAGE_INSTANCE_DATA (i)->pixmap)
 #define IMAGE_INSTANCE_X_MASK(i) (X_IMAGE_INSTANCE_DATA (i)->mask)
 #define IMAGE_INSTANCE_X_CURSOR(i) (X_IMAGE_INSTANCE_DATA (i)->cursor)
+#define IMAGE_INSTANCE_X_COLORMAP(i) (X_IMAGE_INSTANCE_DATA (i)->colormap)
 #define IMAGE_INSTANCE_X_PIXELS(i) (X_IMAGE_INSTANCE_DATA (i)->pixels)
 #define IMAGE_INSTANCE_X_NPIXELS(i) (X_IMAGE_INSTANCE_DATA (i)->npixels)
 
--- a/src/glyphs.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/glyphs.c	Mon Aug 13 10:27:19 2007 +0200
@@ -38,6 +38,8 @@
 #include "redisplay.h"
 #include "window.h"
 
+Lisp_Object Qimage_conversion_error;
+
 Lisp_Object Qglyphp, Qcontrib_p, Qbaseline;
 
 Lisp_Object Qbuffer_glyph_p, Qpointer_glyph_p, Qicon_glyph_p;
@@ -2758,6 +2760,12 @@
   /* Qbuffer defined in general.c. */
   /* Qpointer defined above */
   defsymbol (&Qicon, "icon");
+
+  /* Errors */
+  deferror (&Qimage_conversion_error,
+	    "image-conversion-error",
+	    "image-conversion error", Qio_error);
+
 }
 
 void
--- a/src/glyphs.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/glyphs.h	Mon Aug 13 10:27:19 2007 +0200
@@ -186,6 +186,8 @@
 		entry);							\
   } while (0)
 
+extern Lisp_Object Qimage_conversion_error;
+
 extern Lisp_Object Q_data, Q_file;
 
 void add_entry_to_image_instantiator_format_list (Lisp_Object symbol,
--- a/src/gui.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/gui.h	Mon Aug 13 10:27:19 2007 +0200
@@ -50,6 +50,21 @@
 #define GUI_ITEM_GCPRO_COUNT \
   (slot_offset(struct gui_item, GUI_ITEM_LAST_GCPROED) / sizeof(Lisp_Object) + 1)
 
+/*
+ * gui_item is a struct containing a bunch of Lisp_Object
+ * members.  We need to GC-protect all the member slots.
+ * Rather than build a long chain of individual gcpro structs
+ * that protect the slots individually, we protect all the
+ * member slots by pretending the struct is an array.  ANSI C
+ * requires tihs hack to work, ugly though it is.
+ */
+#define GCPRO_GUI_ITEM(pgui_item)					\
+	do {								\
+	  Lisp_Object *gui_item_array = (Lisp_Object *) pgui_item;	\
+	  GCPRO1 (gui_item_array[0]);					\
+	  gcpro1.nvars = GUI_ITEM_GCPRO_COUNT;				\
+	} while (0);
+
 void gui_item_init (struct gui_item *pgui_item);
 void gui_item_add_keyval_pair (struct gui_item *pgui_item,
 			       Lisp_Object key, Lisp_Object val);
--- a/src/imgproc.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/imgproc.c	Mon Aug 13 10:27:19 2007 +0200
@@ -44,8 +44,9 @@
 #include "lisp.h"
 #include "imgproc.h"
 
-static void get_histogram(quant_table *qt, unsigned char *pic,
-			  int width, int height, Colorbox* box)
+static void
+get_histogram(quant_table *qt, unsigned char *pic,
+	      int width, int height, Colorbox* box)
 {
   register unsigned char *inptr;
   register int red, green, blue;
@@ -55,32 +56,29 @@
   box->rmax = box->gmax = box->bmax = -1;
   box->total = width * height;
 
-  {
- register int *ptr = &(qt->histogram[0][0][0]);
-  for (i = B_LEN*B_LEN*B_LEN; i-- > 0;)
-    *ptr++ = 0;
-  }
   inptr = pic;
-  for (i = 0; i < height; i++) {
-    for (j = width; j-- > 0;) {
-      red = *inptr++ >> COLOR_SHIFT;
-      green = *inptr++ >> COLOR_SHIFT;
-      blue = *inptr++ >> COLOR_SHIFT;
-      if (red < box->rmin)
-	box->rmin = red;
-      if (red > box->rmax)
-	box->rmax = red;
-      if (green < box->gmin)
-	box->gmin = green;
-      if (green > box->gmax)
-	box->gmax = green;
-      if (blue < box->bmin)
-	box->bmin = blue;
-      if (blue > box->bmax)
-	box->bmax = blue;
-      qt->histogram[red][green][blue]++;
+  for (i = 0; i < height; i++)
+    {
+      for (j = width; j-- > 0;)
+	{
+	  red = *inptr++ >> COLOR_SHIFT;
+	  green = *inptr++ >> COLOR_SHIFT;
+	  blue = *inptr++ >> COLOR_SHIFT;
+	  if (red < box->rmin)
+	    box->rmin = red;
+	  if (red > box->rmax)
+	    box->rmax = red;
+	  if (green < box->gmin)
+	    box->gmin = green;
+	  if (green > box->gmax)
+	    box->gmax = green;
+	  if (blue < box->bmin)
+	    box->bmin = blue;
+	  if (blue > box->bmax)
+	    box->bmax = blue;
+	  qt->histogram[red][green][blue]++;
+	}
     }
-  }
 }
 
 static Colorbox *
@@ -103,81 +101,98 @@
 {
   register int *histp, ir, ig, ib;
 
-  if (box->rmax > box->rmin) {
-    for (ir = box->rmin; ir <= box->rmax; ++ir)
-      for (ig = box->gmin; ig <= box->gmax; ++ig) {
-	histp = &(qt->histogram[ir][ig][box->bmin]);
-	for (ib = box->bmin; ib <= box->bmax; ++ib)
-	  if (*histp++ != 0) {
-	    box->rmin = ir;
-	    goto have_rmin;
+  if (box->rmax > box->rmin)
+    {
+      for (ir = box->rmin; ir <= box->rmax; ++ir)
+	for (ig = box->gmin; ig <= box->gmax; ++ig)
+	  {
+	    histp = &(qt->histogram[ir][ig][box->bmin]);
+	    for (ib = box->bmin; ib <= box->bmax; ++ib)
+	      if (*histp++ != 0)
+		{
+		  box->rmin = ir;
+		  goto have_rmin;
+		}
 	  }
-      }
-  have_rmin:
-    if (box->rmax > box->rmin)
-      for (ir = box->rmax; ir >= box->rmin; --ir)
-	for (ig = box->gmin; ig <= box->gmax; ++ig) {
-	  histp = &(qt->histogram[ir][ig][box->bmin]);
-	  ib = box->bmin;
-	  for (; ib <= box->bmax; ++ib)
-	    if (*histp++ != 0) {
-	      box->rmax = ir;
-	      goto have_rmax;
+    have_rmin:
+      if (box->rmax > box->rmin)
+	for (ir = box->rmax; ir >= box->rmin; --ir)
+	  for (ig = box->gmin; ig <= box->gmax; ++ig)
+	    {
+	      histp = &(qt->histogram[ir][ig][box->bmin]);
+	      ib = box->bmin;
+	      for (; ib <= box->bmax; ++ib)
+		if (*histp++ != 0)
+		  {
+		    box->rmax = ir;
+		    goto have_rmax;
+		  }
 	    }
-	}
-  }
+    }
  have_rmax:
-  if (box->gmax > box->gmin) {
-    for (ig = box->gmin; ig <= box->gmax; ++ig)
-      for (ir = box->rmin; ir <= box->rmax; ++ir) {
-	histp = &(qt->histogram[ir][ig][box->bmin]);
-	for (ib = box->bmin; ib <= box->bmax; ++ib)
-	  if (*histp++ != 0) {
-	    box->gmin = ig;
-	    goto have_gmin;
+  if (box->gmax > box->gmin)
+    {
+      for (ig = box->gmin; ig <= box->gmax; ++ig)
+	for (ir = box->rmin; ir <= box->rmax; ++ir)
+	  {
+	    histp = &(qt->histogram[ir][ig][box->bmin]);
+	    for (ib = box->bmin; ib <= box->bmax; ++ib)
+	      if (*histp++ != 0)
+		{
+		  box->gmin = ig;
+		  goto have_gmin;
+		}
 	  }
-      }
-  have_gmin:
-    if (box->gmax > box->gmin)
-      for (ig = box->gmax; ig >= box->gmin; --ig)
-	for (ir = box->rmin; ir <= box->rmax; ++ir) {
-	  histp = &(qt->histogram[ir][ig][box->bmin]);
-	  ib = box->bmin;
-	  for (; ib <= box->bmax; ++ib)
-	    if (*histp++ != 0) {
-	      box->gmax = ig;
-	      goto have_gmax;
+    have_gmin:
+      if (box->gmax > box->gmin)
+	for (ig = box->gmax; ig >= box->gmin; --ig)
+	  for (ir = box->rmin; ir <= box->rmax; ++ir)
+	    {
+	      histp = &(qt->histogram[ir][ig][box->bmin]);
+	      ib = box->bmin;
+	      for (; ib <= box->bmax; ++ib)
+		if (*histp++ != 0)
+		  {
+		    box->gmax = ig;
+		    goto have_gmax;
+		  }
 	    }
-	}
-  }
+    }
  have_gmax:
-  if (box->bmax > box->bmin) {
-    for (ib = box->bmin; ib <= box->bmax; ++ib)
-      for (ir = box->rmin; ir <= box->rmax; ++ir) {
-	histp = &(qt->histogram[ir][box->gmin][ib]);
-	for (ig = box->gmin; ig <= box->gmax; ++ig) {
-	  if (*histp != 0) {
-	    box->bmin = ib;
-	    goto have_bmin;
+  if (box->bmax > box->bmin)
+    {
+      for (ib = box->bmin; ib <= box->bmax; ++ib)
+	for (ir = box->rmin; ir <= box->rmax; ++ir)
+	  {
+	    histp = &(qt->histogram[ir][box->gmin][ib]);
+	    for (ig = box->gmin; ig <= box->gmax; ++ig)
+	      {
+		if (*histp != 0)
+		  {
+		    box->bmin = ib;
+		    goto have_bmin;
+		  }
+		histp += B_LEN;
+	      }
 	  }
-	  histp += B_LEN;
-	}
-      }
-  have_bmin:
-    if (box->bmax > box->bmin)
-      for (ib = box->bmax; ib >= box->bmin; --ib)
-	for (ir = box->rmin; ir <= box->rmax; ++ir) {
-	  histp = &(qt->histogram[ir][box->gmin][ib]);
-	  ig = box->gmin;
-	  for (; ig <= box->gmax; ++ig) {
-	    if (*histp != 0) {
-	      box->bmax = ib;
-	      goto have_bmax;
+    have_bmin:
+      if (box->bmax > box->bmin)
+	for (ib = box->bmax; ib >= box->bmin; --ib)
+	  for (ir = box->rmin; ir <= box->rmax; ++ir)
+	    {
+	      histp = &(qt->histogram[ir][box->gmin][ib]);
+	      ig = box->gmin;
+	      for (; ig <= box->gmax; ++ig)
+		{
+		  if (*histp != 0)
+		    {
+		      box->bmax = ib;
+		      goto have_bmax;
+		    }
+		  histp += B_LEN;
+		}
 	    }
-	    histp += B_LEN;
-	  }
-	}
-  }
+    }
  have_bmax:
   ;
 }
@@ -207,52 +222,60 @@
   else
     axis = BLUE;
   /* get histogram along longest axis */
-  switch (axis) {
-  case RED:
-    histp = &hist2[ptr->rmin];
-    for (ir = ptr->rmin; ir <= ptr->rmax; ++ir) {
-      *histp = 0;
-      for (ig = ptr->gmin; ig <= ptr->gmax; ++ig) {
-	iptr = &(qt->histogram[ir][ig][ptr->bmin]);
-	for (ib = ptr->bmin; ib <= ptr->bmax; ++ib)
-	  *histp += *iptr++;
-      }
-      histp++;
+  switch (axis)
+    {
+    case RED:
+      histp = &hist2[ptr->rmin];
+      for (ir = ptr->rmin; ir <= ptr->rmax; ++ir)
+	{
+	  *histp = 0;
+	  for (ig = ptr->gmin; ig <= ptr->gmax; ++ig)
+	    {
+	      iptr = &(qt->histogram[ir][ig][ptr->bmin]);
+	      for (ib = ptr->bmin; ib <= ptr->bmax; ++ib)
+		*histp += *iptr++;
+	    }
+	  histp++;
+	}
+      first = ptr->rmin;
+      last = ptr->rmax;
+      break;
+    case GREEN:
+      histp = &hist2[ptr->gmin];
+      for (ig = ptr->gmin; ig <= ptr->gmax; ++ig)
+	{
+	  *histp = 0;
+	  for (ir = ptr->rmin; ir <= ptr->rmax; ++ir)
+	    {
+	      iptr = &(qt->histogram[ir][ig][ptr->bmin]);
+	      for (ib = ptr->bmin; ib <= ptr->bmax; ++ib)
+		*histp += *iptr++;
+	    }
+	  histp++;
+	}
+      first = ptr->gmin;
+      last = ptr->gmax;
+      break;
+    case BLUE:
+      histp = &hist2[ptr->bmin];
+      for (ib = ptr->bmin; ib <= ptr->bmax; ++ib)
+	{
+	  *histp = 0;
+	  for (ir = ptr->rmin; ir <= ptr->rmax; ++ir)
+	    {
+	      iptr = &(qt->histogram[ir][ptr->gmin][ib]);
+	      for (ig = ptr->gmin; ig <= ptr->gmax; ++ig)
+		{
+		  *histp += *iptr;
+		  iptr += B_LEN;
+		}
+	    }
+	  histp++;
+	}
+      first = ptr->bmin;
+      last = ptr->bmax;
+      break;
     }
-    first = ptr->rmin;
-    last = ptr->rmax;
-    break;
-  case GREEN:
-    histp = &hist2[ptr->gmin];
-    for (ig = ptr->gmin; ig <= ptr->gmax; ++ig) {
-      *histp = 0;
-      for (ir = ptr->rmin; ir <= ptr->rmax; ++ir) {
-	iptr = &(qt->histogram[ir][ig][ptr->bmin]);
-	for (ib = ptr->bmin; ib <= ptr->bmax; ++ib)
-	  *histp += *iptr++;
-      }
-      histp++;
-    }
-    first = ptr->gmin;
-    last = ptr->gmax;
-    break;
-  case BLUE:
-    histp = &hist2[ptr->bmin];
-    for (ib = ptr->bmin; ib <= ptr->bmax; ++ib) {
-      *histp = 0;
-      for (ir = ptr->rmin; ir <= ptr->rmax; ++ir) {
-	iptr = &(qt->histogram[ir][ptr->gmin][ib]);
-	for (ig = ptr->gmin; ig <= ptr->gmax; ++ig) {
-	  *histp += *iptr;
-	  iptr += B_LEN;
-	}
-      }
-      histp++;
-    }
-    first = ptr->bmin;
-    last = ptr->bmax;
-    break;
-  }
   /* find median point */
   sum2 = ptr->total / 2;
   histp = &hist2[first];
@@ -286,22 +309,23 @@
   new->gmax = ptr->gmax;
   new->bmin = ptr->bmin;
   new->bmax = ptr->bmax;
-  switch (axis) {
-  case RED:
-    new->rmax = i-1;
-    ptr->rmin = i;
-    break;
-  case GREEN:
-    new->gmax = i-1;
-    ptr->gmin = i;
-    break;
-  case BLUE:
-    new->bmax = i-1;
-    ptr->bmin = i;
-    break;
-  }
-  shrinkbox(qt, new);
-  shrinkbox(qt, ptr);
+  switch (axis)
+    {
+    case RED:
+      new->rmax = i-1;
+      ptr->rmin = i;
+      break;
+    case GREEN:
+      new->gmax = i-1;
+      ptr->gmin = i;
+      break;
+    case BLUE:
+      new->bmax = i-1;
+      ptr->bmin = i;
+      break;
+    }
+  shrinkbox (qt, new);
+  shrinkbox (qt, ptr);
 }
 
 
@@ -325,71 +349,76 @@
    *	   it, find distance of centermost point to furthest corner
    */
   mindist = 99999999;
-  for (i = 0; i < num_colors; ++i) {
-    if (qt->rm[i]>>(COLOR_DEPTH-C_DEPTH) != ir  ||
-	qt->gm[i]>>(COLOR_DEPTH-C_DEPTH) != ig  ||
-	qt->bm[i]>>(COLOR_DEPTH-C_DEPTH) != ib)
-      continue;
-    ptr->entries[ptr->num_ents][0] = i;
-    ptr->entries[ptr->num_ents][1] = 0;
-    ++ptr->num_ents;
-    tmp = qt->rm[i] - red;
-    if (tmp < (MAX_COLOR/C_LEN/2))
-      tmp = MAX_COLOR/C_LEN-1 - tmp;
-    dist = tmp*tmp;
-    tmp = qt->gm[i] - green;
-    if (tmp < (MAX_COLOR/C_LEN/2))
-      tmp = MAX_COLOR/C_LEN-1 - tmp;
-    dist += tmp*tmp;
-    tmp = qt->bm[i] - blue;
-    if (tmp < (MAX_COLOR/C_LEN/2))
-      tmp = MAX_COLOR/C_LEN-1 - tmp;
-    dist += tmp*tmp;
-    if (dist < mindist)
-      mindist = dist;
-  }
+  for (i = 0; i < num_colors; ++i)
+    {
+      if (qt->rm[i]>>(COLOR_DEPTH-C_DEPTH) != ir  ||
+	  qt->gm[i]>>(COLOR_DEPTH-C_DEPTH) != ig  ||
+	  qt->bm[i]>>(COLOR_DEPTH-C_DEPTH) != ib)
+	continue;
+      ptr->entries[ptr->num_ents][0] = i;
+      ptr->entries[ptr->num_ents][1] = 0;
+      ++ptr->num_ents;
+      tmp = qt->rm[i] - red;
+      if (tmp < (MAX_COLOR/C_LEN/2))
+	tmp = MAX_COLOR/C_LEN-1 - tmp;
+      dist = tmp*tmp;
+      tmp = qt->gm[i] - green;
+      if (tmp < (MAX_COLOR/C_LEN/2))
+	tmp = MAX_COLOR/C_LEN-1 - tmp;
+      dist += tmp*tmp;
+      tmp = qt->bm[i] - blue;
+      if (tmp < (MAX_COLOR/C_LEN/2))
+	tmp = MAX_COLOR/C_LEN-1 - tmp;
+      dist += tmp*tmp;
+      if (dist < mindist)
+	mindist = dist;
+    }
 
   /*
    * Step 3: find all points within that distance to cell.
    */
-  for (i = 0; i < num_colors; ++i) {
-    if (qt->rm[i] >> (COLOR_DEPTH-C_DEPTH) == ir  &&
-	qt->gm[i] >> (COLOR_DEPTH-C_DEPTH) == ig  &&
-	qt->bm[i] >> (COLOR_DEPTH-C_DEPTH) == ib)
-      continue;
-    dist = 0;
-    if ((tmp = red - qt->rm[i]) > 0 ||
-	(tmp = qt->rm[i] - (red + MAX_COLOR/C_LEN-1)) > 0 )
-      dist += tmp*tmp;
-    if ((tmp = green - qt->gm[i]) > 0 ||
-	(tmp = qt->gm[i] - (green + MAX_COLOR/C_LEN-1)) > 0 )
-      dist += tmp*tmp;
-    if ((tmp = blue - qt->bm[i]) > 0 ||
-	(tmp = qt->bm[i] - (blue + MAX_COLOR/C_LEN-1)) > 0 )
-      dist += tmp*tmp;
-    if (dist < mindist) {
-      ptr->entries[ptr->num_ents][0] = i;
-      ptr->entries[ptr->num_ents][1] = dist;
-      ++ptr->num_ents;
+  for (i = 0; i < num_colors; ++i)
+    {
+      if (qt->rm[i] >> (COLOR_DEPTH-C_DEPTH) == ir  &&
+	  qt->gm[i] >> (COLOR_DEPTH-C_DEPTH) == ig  &&
+	  qt->bm[i] >> (COLOR_DEPTH-C_DEPTH) == ib)
+	continue;
+      dist = 0;
+      if ((tmp = red - qt->rm[i]) > 0 ||
+	  (tmp = qt->rm[i] - (red + MAX_COLOR/C_LEN-1)) > 0 )
+	dist += tmp*tmp;
+      if ((tmp = green - qt->gm[i]) > 0 ||
+	  (tmp = qt->gm[i] - (green + MAX_COLOR/C_LEN-1)) > 0 )
+	dist += tmp*tmp;
+      if ((tmp = blue - qt->bm[i]) > 0 ||
+	  (tmp = qt->bm[i] - (blue + MAX_COLOR/C_LEN-1)) > 0 )
+	dist += tmp*tmp;
+      if (dist < mindist)
+	{
+	  ptr->entries[ptr->num_ents][0] = i;
+	  ptr->entries[ptr->num_ents][1] = dist;
+	  ++ptr->num_ents;
+	}
     }
-  }
 
   /*
    * Sort color cells by distance, use cheap exchange sort
    */
-  for (n = ptr->num_ents - 1; n > 0; n = next_n) {
-    next_n = 0;
-    for (i = 0; i < n; ++i)
-      if (ptr->entries[i][1] > ptr->entries[i+1][1]) {
-	tmp = ptr->entries[i][0];
-	ptr->entries[i][0] = ptr->entries[i+1][0];
-	ptr->entries[i+1][0] = tmp;
-	tmp = ptr->entries[i][1];
-	ptr->entries[i][1] = ptr->entries[i+1][1];
-	ptr->entries[i+1][1] = tmp;
-	next_n = i;
-      }
-  }
+  for (n = ptr->num_ents - 1; n > 0; n = next_n)
+    {
+      next_n = 0;
+      for (i = 0; i < n; ++i)
+	if (ptr->entries[i][1] > ptr->entries[i+1][1])
+	  {
+	    tmp = ptr->entries[i][0];
+	    ptr->entries[i][0] = ptr->entries[i+1][0];
+	    ptr->entries[i+1][0] = tmp;
+	    tmp = ptr->entries[i][1];
+	    ptr->entries[i][1] = ptr->entries[i+1][1];
+	    ptr->entries[i+1][1] = tmp;
+	    next_n = i;
+	  }
+    }
   return (ptr);
 }
 
@@ -403,48 +432,53 @@
 
   for (ir = 0; ir < B_LEN; ++ir)
     for (ig = 0; ig < B_LEN; ++ig)
-      for (ib = 0; ib < B_LEN; ++ib, histp++) {
-	if (*histp == 0) {
-	  *histp = -1;
-	  continue;
+      for (ib = 0; ib < B_LEN; ++ib, histp++)
+	{
+	  if (*histp == 0)
+	    {
+	      *histp = -1;
+	      continue;
+	    }
+	  cell = *(qt->ColorCells +
+		   (((ir>>(B_DEPTH-C_DEPTH)) << C_DEPTH*2) +
+		    ((ig>>(B_DEPTH-C_DEPTH)) << C_DEPTH) +
+		    (ib>>(B_DEPTH-C_DEPTH))));
+	  if (cell == NULL )
+	    cell = create_colorcell (qt, num_colors,
+				     ir << COLOR_SHIFT,
+				     ig << COLOR_SHIFT,
+				     ib << COLOR_SHIFT);
+	  if (cell == NULL) /* memory exhausted! punt! */
+	    return -1;
+	  dist = 9999999;
+	  for (i = 0; i < cell->num_ents &&
+		 dist > cell->entries[i][1]; ++i)
+	    {
+	      j = cell->entries[i][0];
+	      d2 = qt->rm[j] - (ir << COLOR_SHIFT);
+	      d2 *= d2;
+	      tmp = qt->gm[j] - (ig << COLOR_SHIFT);
+	      d2 += tmp*tmp;
+	      tmp = qt->bm[j] - (ib << COLOR_SHIFT);
+	      d2 += tmp*tmp;
+	      if (d2 < dist)
+		{
+		  dist = d2;
+		  *histp = j;
+		}
+	    }
 	}
-	cell = *(qt->ColorCells +
-		 (((ir>>(B_DEPTH-C_DEPTH)) << C_DEPTH*2) +
-		  ((ig>>(B_DEPTH-C_DEPTH)) << C_DEPTH) +
-		  (ib>>(B_DEPTH-C_DEPTH))));
-	if (cell == NULL )
-	  cell = create_colorcell(qt, num_colors,
-				  ir << COLOR_SHIFT,
-				  ig << COLOR_SHIFT,
-				  ib << COLOR_SHIFT);
-	if (cell == NULL) /* memory exhausted! punt! */
-	  return -1;
-	dist = 9999999;
-	for (i = 0; i < cell->num_ents &&
-	       dist > cell->entries[i][1]; ++i) {
-	  j = cell->entries[i][0];
-	  d2 = qt->rm[j] - (ir << COLOR_SHIFT);
-	  d2 *= d2;
-	  tmp = qt->gm[j] - (ig << COLOR_SHIFT);
-	  d2 += tmp*tmp;
-	  tmp = qt->bm[j] - (ib << COLOR_SHIFT);
-	  d2 += tmp*tmp;
-	  if (d2 < dist) {
-	    dist = d2;
-	    *histp = j;
-	  }
-	}
-      }
   return 0;
 }
 
-quant_table *EImage_build_quantable(unsigned char *eimage, int width, int height, int num_colors)
+quant_table *
+build_EImage_quantable(unsigned char *eimage, int width, int height, int num_colors)
 {
   quant_table *qt;
   Colorbox *box_list, *ptr;
   int i,res;
 
-  qt = (quant_table*)xmalloc(sizeof(quant_table));
+  qt = (quant_table*)xmalloc_and_zero (sizeof(quant_table));
   if (qt == NULL) return NULL;
 
   assert (num_colors < 257 && num_colors > 2);
@@ -452,13 +486,14 @@
    * STEP 1:  create empty boxes
    */
   qt->usedboxes = NULL;
-  box_list = qt->freeboxes = (Colorbox *)xmalloc(num_colors*sizeof (Colorbox));
+  box_list = qt->freeboxes = (Colorbox *)xmalloc (num_colors*sizeof (Colorbox));
   qt->freeboxes[0].next = &(qt->freeboxes[1]);
   qt->freeboxes[0].prev = NULL;
-  for (i = 1; i < num_colors-1; ++i) {
-    qt->freeboxes[i].next = &(qt->freeboxes[i+1]);
-    qt->freeboxes[i].prev = &(qt->freeboxes[i-1]);
-  }
+  for (i = 1; i < num_colors-1; ++i)
+    {
+      qt->freeboxes[i].next = &(qt->freeboxes[i+1]);
+      qt->freeboxes[i].prev = &(qt->freeboxes[i-1]);
+    }
   qt->freeboxes[num_colors-1].next = NULL;
   qt->freeboxes[num_colors-1].prev = &(qt->freeboxes[num_colors-2]);
 
@@ -473,54 +508,57 @@
   qt->usedboxes = ptr;
   if (ptr->next)
     ptr->next->prev = ptr;
-  get_histogram(qt, eimage, width, height, ptr);
+  get_histogram (qt, eimage, width, height, ptr);
 
   /*
    * STEP 3: continually subdivide boxes until no more free
    * boxes remain or until all colors assigned.
    */
-  while (qt->freeboxes != NULL) {
-    ptr = largest_box(qt);
-    if (ptr != NULL)
-      splitbox(qt, ptr);
-    else
-      qt->freeboxes = NULL;
-  }
+  while (qt->freeboxes != NULL)
+    {
+      ptr = largest_box(qt);
+      if (ptr != NULL)
+	splitbox (qt, ptr);
+      else
+	qt->freeboxes = NULL;
+    }
 
   /*
    * STEP 4: assign colors to all boxes
    */
-  for (i = 0, ptr = qt->usedboxes; ptr != NULL; ++i, ptr = ptr->next) {
-    qt->rm[i] = ((ptr->rmin + ptr->rmax) << COLOR_SHIFT) / 2;
-    qt->gm[i] = ((ptr->gmin + ptr->gmax) << COLOR_SHIFT) / 2;
-    qt->bm[i] = ((ptr->bmin + ptr->bmax) << COLOR_SHIFT) / 2;
-    qt->um[i] = ptr->total;
-  }
+  for (i = 0, ptr = qt->usedboxes; ptr != NULL; ++i, ptr = ptr->next)
+    {
+      qt->rm[i] = ((ptr->rmin + ptr->rmax) << COLOR_SHIFT) / 2;
+      qt->gm[i] = ((ptr->gmin + ptr->gmax) << COLOR_SHIFT) / 2;
+      qt->bm[i] = ((ptr->bmin + ptr->bmax) << COLOR_SHIFT) / 2;
+      qt->um[i] = ptr->total;
+    }
   qt->num_active_colors = i;
 
   /* We're done with the boxes now */
-  xfree(box_list);
+  xfree (box_list);
   qt->freeboxes = qt->usedboxes = NULL;
 
   /*
    * STEP 5: scan histogram and map all values to closest color
    */
   /* 5a: create cell list as described in Heckbert */
-  qt->ColorCells = (C_cell **)xmalloc(C_LEN*C_LEN*C_LEN*sizeof (C_cell*));
-  memset(qt->ColorCells, 0, C_LEN*C_LEN*C_LEN*sizeof (C_cell*));
+  qt->ColorCells = (C_cell **)xmalloc_and_zero (C_LEN*C_LEN*C_LEN*sizeof (C_cell*));
   /* 5b: create mapping from truncated pixel space to color
      table entries */
-  res = map_colortable(qt, num_colors);
+  res = map_colortable (qt, num_colors);
 
   /* 5c: done with ColorCells */
-  for (i = 0; i < C_LEN*C_LEN*C_LEN; i++) if (qt->ColorCells[i]) xfree(qt->ColorCells[i]);
-  xfree(qt->ColorCells);
+  for (i = 0; i < C_LEN*C_LEN*C_LEN; i++)
+    if (qt->ColorCells[i]) xfree (qt->ColorCells[i]);
+  xfree (qt->ColorCells);
   
-  if (res) {
-    /* we failed in memory allocation, so clean up an leave */
-    xfree(qt);
-    return NULL;
-  }
+  if (res)
+    {
+      /* we failed in memory allocation, so clean up an leave */
+      xfree(qt);
+      return NULL;
+    }
   
   return qt;
 }
--- a/src/imgproc.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/imgproc.h	Mon Aug 13 10:27:19 2007 +0200
@@ -59,4 +59,4 @@
 
 #define QUANT_GET_COLOR(qt,r,g,b) (qt->histogram[r>>COLOR_SHIFT][g>>COLOR_SHIFT][b>>COLOR_SHIFT])
 
-quant_table *EImage_build_quantable(unsigned char *eimage, int width, int height, int num_colors);
+quant_table *build_EImage_quantable(unsigned char *eimage, int width, int height, int num_colors);
--- a/src/menubar-msw.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/menubar-msw.c	Mon Aug 13 10:27:19 2007 +0200
@@ -92,6 +92,9 @@
 #include "opaque.h"
 #include "window.h"
 
+/* #### */
+#define REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH 0
+
 #define EMPTY_ITEM_ID ((UINT)LISP_TO_VOID (Qunbound))
 #define EMPTY_ITEM_NAME "(empty)"
 
@@ -250,8 +253,7 @@
       struct gcpro gcpro1;
 
       gui_item_init (&gui_item);
-      GCPRO1 (gui_item);
-      gcpro1.nvars = GUI_ITEM_GCPRO_COUNT;
+      GCPRO_GUI_ITEM (&gui_item);
 
       menu_parse_submenu_keywords (item, &gui_item);
 
@@ -299,8 +301,7 @@
       struct gcpro gcpro1;
 
       gui_item_init (&gui_item);
-      GCPRO1 (gui_item);
-      gcpro1.nvars = GUI_ITEM_GCPRO_COUNT;
+      GCPRO_GUI_ITEM (&gui_item);
 
       gui_parse_item_keywords (item, &gui_item);
 
@@ -362,12 +363,16 @@
   Lisp_Object item_desc;
   int deep_p, flush_right;
   struct gcpro gcpro1;
-  unsigned long checksum = 0;
+  unsigned long checksum;
   struct gui_item gui_item;
 
   gui_item_init (&gui_item);
-  GCPRO1 (gui_item);
-  gcpro1.nvars = GUI_ITEM_GCPRO_COUNT;
+  GCPRO_GUI_ITEM (&gui_item);
+
+  /* We are sometimes called with the menubar unchanged, and with changed
+     right flush. We have to update the menubar in ths case,
+     so account for the compliance setting in the hash value */
+  checksum = REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH;
 
   /* Will initially contain only "(empty)" */
   if (populate_p)
@@ -393,7 +398,8 @@
     {
       if (NILP (XCAR (item_desc)))
 	{
-	  if (bar_p)
+	  /* Do not flush right menubar items when MS style compiant */
+	  if (bar_p && !REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIHGT_FLUSH)
 	    flush_right = 1;
 	  if (!populate_p)
 	    checksum = HASH2 (checksum, Qnil);
@@ -702,13 +708,7 @@
 static void
 mswindows_update_frame_menubars (struct frame* f)
 {
-  /* #### KLUDGE. menubar.c calls us when the following
-     condition is true:
-	(f->menubar_changed || f->windows_changed)
-     Is that much really necessary?
-     */
-  if (f->menubar_changed)
-    update_frame_menubar_maybe (f);
+  update_frame_menubar_maybe (f);
 }
 
 static void
--- a/src/menubar.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/menubar.c	Mon Aug 13 10:27:19 2007 +0200
@@ -151,23 +151,11 @@
        (desc, path))
 {
   Lisp_Object path_entry, submenu_desc, submenu;
-  Lisp_Object *gui_item_array;
   struct gcpro gcpro1;
   struct gui_item gui_item;
 
   gui_item_init (&gui_item);
-
-  /*
-   * gui_item is a struct containing a bunch of Lisp_Object
-   * members.  We need to GC-protect all the member slots.
-   * Rather than build a long chain of individual gcpro structs
-   * that protect the slots individually, we protect all the
-   * member slots by pretending the struct is an array.  ANSI C
-   * requires tihs hack to work, ugly though it is.
-   */
-  gui_item_array = (Lisp_Object *) &gui_item;
-  GCPRO1 (gui_item_array[0]);
-  gcpro1.nvars = GUI_ITEM_GCPRO_COUNT;
+  GCPRO_GUI_ITEM (&gui_item);
   
   EXTERNAL_LIST_LOOP (path_entry, path)
     {
--- a/src/objects-x.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/objects-x.c	Mon Aug 13 10:27:19 2007 +0200
@@ -114,13 +114,26 @@
 	    status = 1;
 	  else
   	    {
+  	      int rd, gr, bl;	
 	      /* ### JH: I'm punting here, knowing that doing this will at
 		 least draw the color correctly.  However, unless we convert
 		 all of the functions that allocate colors (graphics
 		 libraries, etc) to use this function doing this is very
 		 likely to cause problems later... */
-	      color_def->pixel = (color_def->red << rshift) | (color_def->green << gshift) |
-				   (color_def->blue << bshift);
+
+	      if (rbits > 8)
+		rd = color_def->red << (rbits - 8);
+	      else
+		rd = color_def->red >> (8 - rbits);
+	      if (gbits > 8)
+		gr = color_def->green << (gbits - 8);
+	      else
+		gr = color_def->green >> (8 - gbits);
+	      if (bbits > 8)
+		bl = color_def->blue << (bbits - 8);
+	      else
+		bl = color_def->blue >> (8 - bbits);
+	      color_def->pixel = (rd << rshift) | (gr << gshift) | (bl << bshift);
 	      status = 3;
 	    }
 	}
@@ -180,10 +193,12 @@
 	  color_def->red = cells[nearest].red;
 	  color_def->green = cells[nearest].green;
 	  color_def->blue = cells[nearest].blue;
-	  if (XAllocColor (display, colormap, color_def) != 0)
+	  if (XAllocColor (display, colormap, color_def) != 0) {
 	    status = 2;
-	  else
+	  } else {
 	    status = 0; /* JH: how does this happen??? DOES this happen??? */
+	    fprintf(stderr,"allocate_nearest_color returned 0!!!\n");
+	  }
 	}
     }
   return status;
--- a/src/redisplay-msw.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/redisplay-msw.c	Mon Aug 13 10:27:19 2007 +0200
@@ -313,7 +313,7 @@
  ****************************************************************************/
 static void
 mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos,
-		   int width, struct rune *rb)
+			 int width, face_index findex, Emchar ch, int image_p)
 {
   struct frame *f = XFRAME (w->frame);
   struct device *d = XDEVICE (f->device);
@@ -321,7 +321,6 @@
   Lisp_Object font = Qnil;
   int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
   HDC hdc = FRAME_MSWINDOWS_DC (f);
-  int real_char_p = (rb->type == RUNE_CHAR && rb->object.chr.ch != '\n');
   unsigned int face_index=0;
   char *p_char = NULL;
   int n_char = 0;
@@ -329,15 +328,16 @@
 		dl->ypos - dl->ascent,
 		xpos + width,
 		dl->ypos + dl->descent - dl->clip};
-
   Lisp_Object bar = symbol_value_in_buffer (Qbar_cursor,
 					    WINDOW_BUFFER (w));
-  int bar_p = !NILP (bar);
+  int bar_p = image_p || !NILP (bar);
+  int cursor_p = !NILP (w->text_cursor_visible_p);
+  int real_char_p = ch != 0;
 
   if (real_char_p)
     {
       /* Use the font from the underlying character */
-      cachel = WINDOW_FACE_CACHEL (w, rb->findex);
+      cachel = WINDOW_FACE_CACHEL (w, findex);
 
       /* XXX MULE: Need to know the charset! */
       font = FACE_CACHEL_FONT (cachel, Vcharset_ascii);
@@ -345,21 +345,29 @@
 
   if ((focus || bar_p) && real_char_p)
     {
-      p_char = (char*) &rb->object.chr.ch;
+      p_char = (char*) &ch;
       n_char = 1;
     }
 
-  /* Use cursor fg/bg for block cursor, or character fg/bg for the bar.
-     Output nothing at eol if bar cursor */
-  face_index = get_builtin_face_cache_index (w, Vtext_cursor_face);
-  cachel = WINDOW_FACE_CACHEL (w, (bar_p ? rb->findex : face_index));
-  mswindows_update_dc (hdc, font, cachel->foreground,
-		       cachel->background, Qnil);
-  ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE|ETO_CLIPPED, &rect, p_char, n_char, NULL);
+  if (!image_p)
+    {
+      /* Use cursor fg/bg for block cursor, or character fg/bg for the bar
+	 or when we need to erase the cursor. Output nothing at eol if bar
+	 cursor */
+      face_index = get_builtin_face_cache_index (w, Vtext_cursor_face);
+      cachel = WINDOW_FACE_CACHEL (w, ((!cursor_p || bar_p)
+				       ? findex : face_index));
+      mswindows_update_dc (hdc, font, cachel->foreground,
+			   cachel->background, Qnil);
+      ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE|ETO_CLIPPED, &rect, p_char, n_char, NULL);
+    }
+
+  if (!cursor_p)
+    return;
 
   if (focus && bar_p)
     {
-      rect.right = rect.left + (EQ (bar, Qt) ? 1 : 2);
+      rect.right = rect.left + (EQ (bar, Qt) ? 1 : min (2, width));
       face_index = get_builtin_face_cache_index (w, Vtext_cursor_face);
       cachel = WINDOW_FACE_CACHEL (w, face_index);
       mswindows_update_dc (hdc, Qnil, Qnil, cachel->background, Qnil);
@@ -374,12 +382,12 @@
 
       if (real_char_p)
 	{
-	  p_char = (char*) &rb->object.chr.ch;
+	  p_char = (char*) &ch;
 	  n_char = 1;
 	}
 
       face_index = get_builtin_face_cache_index (w, Vdefault_face);
-      cachel = WINDOW_FACE_CACHEL (w, (real_char_p ? rb->findex : face_index));
+      cachel = WINDOW_FACE_CACHEL (w, (real_char_p ? findex : face_index));
       mswindows_update_dc (hdc, Qnil, cachel->foreground,
 			   cachel->background, Qnil);
       ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE | ETO_CLIPPED,
@@ -514,16 +522,16 @@
     }
 
   /* Select the bitmaps into the compatible DC. */
-  if ((old=SelectObject(IMAGE_INSTANCE_MSWINDOWS_DC(p),
+  if ((old=SelectObject(FRAME_MSWINDOWS_CDC(f),
 			IMAGE_INSTANCE_MSWINDOWS_BITMAP(p))))
     {
       BitBlt(hdc, 
 	     x,y,
 	     width, height, 
-	     IMAGE_INSTANCE_MSWINDOWS_DC(p),
+	     FRAME_MSWINDOWS_CDC(f),
 	     0,0, 
 	     SRCCOPY);                  
-      SelectObject(IMAGE_INSTANCE_MSWINDOWS_DC(p),old);
+      SelectObject(FRAME_MSWINDOWS_CDC(f),old);
     }
   else
     {
@@ -652,6 +660,7 @@
 			       pwidth, pheight, pixmap_offset);
   }
 
+#if 0
   /* Draw a cursor over top of the pixmap. */
   if (cursor_width && cursor_height && (cursor_start >= xpos)
       && !NILP (w->text_cursor_visible_p)
@@ -684,6 +693,7 @@
 		     cursor_height);
 	}
     }
+#endif
 }
 
 #ifdef HAVE_SCROLLBARS
@@ -1052,12 +1062,14 @@
 		{
 		  if (rb->object.chr.ch == '\n')
 		    {
-		      mswindows_output_cursor (w, dl, xpos, cursor_width, rb);
+		      mswindows_output_cursor (w, dl, xpos, cursor_width,
+					       findex, 0, 0);
 		    }
 		  else
 		    {
 		      Dynarr_add (buf, rb->object.chr.ch);
-		      mswindows_output_cursor (w, dl, xpos, cursor_width, rb);
+		      mswindows_output_cursor (w, dl, xpos, cursor_width,
+					       findex, rb->object.chr.ch, 0);
 		      Dynarr_reset (buf);
 		    }
 
@@ -1092,7 +1104,7 @@
 		}
 
 	      if (rb->cursor_type == CURSOR_ON)
-		mswindows_output_cursor (w, dl, xpos, cursor_width, rb);
+		mswindows_output_cursor (w, dl, xpos, cursor_width, rb->findex, 0, 0);
 
 	      elt++;
 	      if (elt < end)
@@ -1125,7 +1137,8 @@
 			(XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
 
 		      if (rb->cursor_type == CURSOR_ON)
-			mswindows_output_cursor (w, dl, xpos, cursor_width, rb);
+			mswindows_output_cursor (w, dl, xpos, cursor_width,
+						 findex, Dynarr_at (buf, 0), 0);
 		      else /* #### redisplay-x passes -1 as the width: why ? */
 			mswindows_output_string (w, dl, buf, xpos,
 					   rb->object.dglyph.xoffset,
@@ -1140,6 +1153,9 @@
 				     rb->object.dglyph.xoffset, start_pixpos,
 				     rb->width, findex, cursor_start,
 				     cursor_width, cursor_height);
+		    if (rb->cursor_type == CURSOR_ON)
+		      mswindows_output_cursor (w, dl, xpos, cursor_width,
+					       findex, 0, 1);
 		    break;
 
 		  case IMAGE_POINTER:
@@ -1176,7 +1192,6 @@
     mswindows_bevel_modeline (w, dl);
 
   Dynarr_free (buf);
-  
 }
 
 
--- a/src/redisplay-output.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/redisplay-output.c	Mon Aug 13 10:27:19 2007 +0200
@@ -354,6 +354,7 @@
 
   if (f->windows_structure_changed ||
       f->faces_changed ||
+      f->glyphs_changed ||
       cdl->ypos != ddl->ypos ||
       cdl->ascent != ddl->ascent ||
       cdl->descent != ddl->descent ||
--- a/src/redisplay-x.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/redisplay-x.c	Mon Aug 13 10:27:19 2007 +0200
@@ -86,7 +86,7 @@
 static void x_clear_region (Lisp_Object window, face_index findex, int x,
 			    int y, int width, int height);
 static void x_output_eol_cursor (struct window *w, struct display_line *dl,
-				 int xpos);
+				 int xpos, face_index findex);
 static void x_clear_frame (struct frame *f);
 static void x_clear_frame_windows (Lisp_Object window);
 static void x_bevel_modeline (struct window *w, struct display_line *dl);
@@ -418,7 +418,7 @@
 		{
 		  if (rb->object.chr.ch == '\n')
 		    {
-		      x_output_eol_cursor (w, dl, xpos);
+		      x_output_eol_cursor (w, dl, xpos, findex);
 		    }
 		  else
 		    {
@@ -2059,10 +2059,12 @@
  narrower than the normal cursor.
  ****************************************************************************/
 static void
-x_output_eol_cursor (struct window *w, struct display_line *dl, int xpos)
+x_output_eol_cursor (struct window *w, struct display_line *dl, int xpos,
+		     face_index findex)
 {
   struct frame *f = XFRAME (w->frame);
   struct device *d = XDEVICE (f->device);
+  Lisp_Object window;
 
   Display *dpy = DEVICE_X_DISPLAY (d);
   Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
@@ -2081,7 +2083,8 @@
   int cursor_height, cursor_y;
   int defheight, defascent;
 
-  XClearArea (dpy, x_win, x, y, width, height, False);
+  XSETWINDOW (window, w);
+  x_clear_region (window, findex, x, y, width, height);
 
   if (NILP (w->text_cursor_visible_p))
     return;
--- a/src/redisplay.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/redisplay.c	Mon Aug 13 10:27:19 2007 +0200
@@ -419,6 +419,12 @@
 /* Nonzero means some frames have been marked as garbaged */
 int frame_changed;
 
+/* non-zero if any of the builtin display glyphs (continuation,
+   hscroll, control-arrow, etc) is in need of updating
+   somewhere. */
+int glyphs_changed;
+int glyphs_changed_set;
+
 /* This variable is 1 if the icon has to be updated.
  It is set to 1 when `frame-icon-glyph' changes. */
 int icon_changed;
@@ -426,8 +432,7 @@
 
 /* This variable is 1 if the menubar widget has to be updated.
  It is set to 1 by set-menubar-dirty-flag and cleared when the widget
- has been indapted. */
-/* indapted???? */
+ has been updated. */
 int menubar_changed;
 int menubar_changed_set;
 
@@ -5590,7 +5595,8 @@
 
   /* Ditto the glyph cache elements. */
   if ((!echo_active && b != window_display_buffer (w))
-      || !Dynarr_length (w->glyph_cachels))
+      || !Dynarr_length (w->glyph_cachels)
+      || f->glyphs_changed)
     reset_glyph_cachels (w);
   else
     mark_glyph_cachels_as_not_updated (w);
@@ -5668,6 +5674,7 @@
 	  && !f->clip_changed
 	  && !f->extents_changed
 	  && !f->faces_changed
+	  && !f->glyphs_changed
 	  && !f->point_changed
 	  && !f->windows_structure_changed)
 	{
@@ -5687,6 +5694,7 @@
 	      && !f->clip_changed
 	      && !f->extents_changed
 	      && !f->faces_changed
+	      && !f->glyphs_changed
 	      && !f->windows_structure_changed)
 	    {
 	      if (point_visible (w, pointm, CURRENT_DISP)
@@ -5743,6 +5751,7 @@
   else if (!w->windows_changed
 	   && !f->clip_changed
 	   && !f->faces_changed
+	   && !f->glyphs_changed
 	   && !f->windows_structure_changed
 	   && !f->frame_changed
 	   && !truncation_changed
@@ -6006,6 +6015,7 @@
   f->extents_changed  = 0;
   f->faces_changed    = 0;
   f->frame_changed    = 0;
+  f->glyphs_changed   = 0;
   f->icon_changed     = 0;
   f->menubar_changed  = 0;
   f->modeline_changed = 0;
@@ -6069,7 +6079,8 @@
 	  f->faces_changed    || f->frame_changed || f->menubar_changed ||
 	  f->modeline_changed || f->point_changed || f->size_changed    ||
 	  f->toolbar_changed  || f->windows_changed ||
-	  f->windows_structure_changed)
+	  f->windows_structure_changed ||
+	  f->glyphs_changed)
 	{
 	  preempted = redisplay_frame (f, 0);
 	}
@@ -6103,7 +6114,8 @@
 	      f->faces_changed    || f->frame_changed || f->menubar_changed ||
 	      f->modeline_changed || f->point_changed || f->size_changed    ||
 	      f->toolbar_changed  || f->windows_changed ||
-	      f->windows_structure_changed)
+	      f->windows_structure_changed ||
+	      f->glyphs_changed)
 	    {
 	      preempted = redisplay_frame (f, 0);
 	    }
@@ -6123,6 +6135,7 @@
   d->extents_changed  = 0;
   d->faces_changed    = 0;
   d->frame_changed    = 0;
+  d->glyphs_changed   = 0;
   d->icon_changed     = 0;
   d->menubar_changed  = 0;
   d->modeline_changed = 0;
@@ -6168,6 +6181,7 @@
       !faces_changed   && !frame_changed    && !icon_changed    &&
       !menubar_changed && !modeline_changed && !point_changed   &&
       !size_changed    && !toolbar_changed  && !windows_changed &&
+      !glyphs_changed  &&
       !windows_structure_changed && !disable_preemption &&
       preemption_count < max_preempts)
     goto done;
@@ -6181,7 +6195,8 @@
 	  d->faces_changed    || d->frame_changed    || d->icon_changed    ||
 	  d->menubar_changed  || d->modeline_changed || d->point_changed   ||
 	  d->size_changed     || d->toolbar_changed  || d->windows_changed ||
-	  d->windows_structure_changed)
+	  d->windows_structure_changed ||
+	  d->glyphs_changed)
 	{
 	  preempted = redisplay_device (d);
 
@@ -6204,6 +6219,7 @@
   clip_changed     = 0;
   extents_changed  = 0;
   frame_changed    = 0;
+  glyphs_changed   = 0;
   icon_changed     = 0;
   menubar_changed  = 0;
   modeline_changed = 0;
@@ -8580,7 +8596,43 @@
 redisplay_glyph_changed (Lisp_Object glyph, Lisp_Object property,
 			 Lisp_Object locale)
 {
-  MARK_CLIP_CHANGED;
+  if (WINDOWP (locale))
+    {
+      struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (locale)));
+      MARK_FRAME_GLYPHS_CHANGED (f);
+    }
+  else if (FRAMEP (locale))
+    {
+      struct frame *f = XFRAME (locale);
+      MARK_FRAME_GLYPHS_CHANGED (f);
+    }
+  else if (DEVICEP (locale))
+    {
+      Lisp_Object frmcons;
+      DEVICE_FRAME_LOOP (frmcons, XDEVICE (locale))
+	{
+	  struct frame *f = XFRAME (XCAR (frmcons));
+	  MARK_FRAME_GLYPHS_CHANGED (f);
+	}
+    }
+  else if (CONSOLEP (locale))
+    {
+      Lisp_Object frmcons, devcons;
+      CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, XCONSOLE (locale))
+	{
+	  struct frame *f = XFRAME (XCAR (frmcons));
+	  MARK_FRAME_GLYPHS_CHANGED (f);
+	}
+    }
+  else /* global or buffer */
+    {
+      Lisp_Object frmcons, devcons, concons;
+      FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
+	{
+	  struct frame *f = XFRAME (XCAR (frmcons));
+	  MARK_FRAME_GLYPHS_CHANGED (f);
+	}
+    }
 }
 
 static void
--- a/src/redisplay.h	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/redisplay.h	Mon Aug 13 10:27:19 2007 +0200
@@ -343,6 +343,12 @@
 /* Nonzero means one or more frames have been marked as garbaged */
 extern int frame_changed;
 
+/* True if any of the builtin display glyphs (continuation,
+   hscroll, control-arrow, etc) is in need of updating
+   somewhere. */
+extern int glyphs_changed;
+extern int glyphs_changed_set;
+
 /* True if an icon is in need of updating somewhere. */
 extern int icon_changed;
 extern int icon_changed_set;
@@ -409,6 +415,7 @@
 #define MARK_MODELINE_CHANGED MARK_TYPE_CHANGED (modeline)
 #define MARK_POINT_CHANGED MARK_TYPE_CHANGED (point)
 #define MARK_TOOLBAR_CHANGED MARK_TYPE_CHANGED (toolbar)
+#define MARK_GLYPHS_CHANGED MARK_TYPE_CHANGED (glyphs)
 
 /* Anytime a console, device or frame is added or deleted we need to reset
    these flags. */
@@ -422,6 +429,7 @@
     modeline_changed_set = 0;						\
     point_changed_set = 0;						\
     toolbar_changed_set = 0;						\
+    glyphs_changed_set = 0;						\
   } while (0)
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/hpux11-shr.h	Mon Aug 13 10:27:19 2007 +0200
@@ -0,0 +1,29 @@
+/* Synched up with: FSF 19.31. */
+
+/* For building XEmacs under HPUX 10.0 with dynamic libraries. */
+
+#define ORDINARY_LINK
+
+/* XEmacs change */
+/* Only support for hp9000s300 currently */
+#if !defined(__hp9000s300)
+#define HPUX_USE_SHLIBS
+#endif /* !hp9000s300 */
+
+/* XEmacs: */
+/* Don't tell the linker to link statically */
+#ifdef NOT_C_CODE
+#define START_FILES
+#define LINKER "$(CC)"
+#endif /* THIS IS YMAKEFILE */
+
+/* get call to brk() when rerunning XEmacs */
+#define RUN_TIME_REMAP
+
+#include "hpux11.h"
+
+/* We must turn off -g since it forces -static.  */
+#ifdef __GNUC__
+#undef C_DEBUG_SWITCH
+#define C_DEBUG_SWITCH
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/s/hpux11.h	Mon Aug 13 10:27:19 2007 +0200
@@ -0,0 +1,24 @@
+/* Synched up with: FSF 19.31. */
+
+/* System description file for hpux version 11.  */
+
+#include "hpux9-shr.h"
+
+/* We have to go this route, rather than hpux9's approach of renaming the
+   functions via macros.  The system's stdlib.h has fully prototyped
+   declarations, which yields a conflicting definition of srand48; it
+   tries to redeclare what was once srandom to be srand48.  So we go
+   with HAVE_LRAND48 being defined.  */
+#undef srandom
+#undef srand48
+#undef HAVE_RANDOM
+#define HPUX10
+#define HPUX11
+/* AlainF 20-Jul-1996 -- fixes for 10.10, untested for 10.0x */
+/* Fix kernel file name for 10.10 and later */
+#undef KERNEL_FILE
+#define KERNEL_FILE "/stand/vmunix"
+
+/* XEmacs: -lcurses includes a broken select() call on some 10.X systems. */
+/* #undef LIBS_TERMCAP */
+/* #define LIBS_TERMCAP "-ltermcap" */
--- a/src/scrollbar-msw.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/scrollbar-msw.c	Mon Aug 13 10:27:19 2007 +0200
@@ -153,14 +153,14 @@
 {
   struct frame *f = XFRAME (w->frame);
   
-  if (SCROLLBAR_MSW_SIZE (sb) != size) {
-    SCROLLBAR_MSW_SIZE (sb) = size;
-    ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL,
-		   SCROLLBAR_MSW_SIZE (sb));
-    SCROLLBAR_MSW_INFO(sb).fMask |= SIF_DISABLENOSCROLL;
-    SetScrollInfo(SCROLLBAR_MSW_HANDLE (sb), SB_CTL, &SCROLLBAR_MSW_INFO (sb), TRUE);
-    FRAMEMETH (f, set_frame_size, (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)));
-  }
+  if (SCROLLBAR_MSW_SIZE (sb) != size)
+    {
+      SCROLLBAR_MSW_SIZE (sb) = size;
+      ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL,
+		     SCROLLBAR_MSW_SIZE (sb));
+      SCROLLBAR_MSW_INFO(sb).fMask |= SIF_DISABLENOSCROLL;
+      SetScrollInfo(SCROLLBAR_MSW_HANDLE (sb), SB_CTL, &SCROLLBAR_MSW_INFO (sb), TRUE);
+    }
 }
 
 void
--- a/src/sheap.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/sheap.c	Mon Aug 13 10:27:19 2007 +0200
@@ -24,13 +24,8 @@
 #include <stddef.h>
 #include "sheap-adjust.h"
 
-#ifdef MULE
 #define STATIC_HEAP_BASE	0x600000
 #define STATIC_HEAP_SLOP	0x40000
-#else
-#define STATIC_HEAP_BASE	0x500000
-#define STATIC_HEAP_SLOP	0x40000
-#endif
 #define STATIC_HEAP_SIZE \
 (STATIC_HEAP_BASE + SHEAP_ADJUSTMENT + STATIC_HEAP_SLOP)
 #define BLOCKSIZE	(1<<12)
--- a/src/unexcw.c	Mon Aug 13 10:26:31 2007 +0200
+++ b/src/unexcw.c	Mon Aug 13 10:27:19 2007 +0200
@@ -69,7 +69,7 @@
 unsigned long  bss_size = UNINIT_LONG;
 FILHDR f_hdr;
 PEAOUTHDR f_ohdr;
-SCNHDR f_data, f_bss, f_text, f_idata;
+SCNHDR f_data, f_bss, f_text, f_nextdata;
 
 #define PERROR(arg) perror(arg);exit(-1) 
 #define CHECK_AOUT_POS(a) \
@@ -196,12 +196,12 @@
      than the one Emacs was dumped on).  */
   data_size = (unsigned long)my_edata - (unsigned long)data_start_va;
 
-  /* The .idata section.  */
-  if (read (a_out, &f_idata, sizeof (f_idata)) != sizeof (f_idata)
+  /* The following data section.  */
+  if (read (a_out, &f_nextdata, sizeof (f_nextdata)) != sizeof (f_nextdata)
       &&
-      strcmp (f_idata.s_name, ".rdata"))
+      strcmp (&f_nextdata.s_name[2], "data"))
     {
-      PERROR ("no .idata section");
+      PERROR ("no other data section");
     }
 }
 
@@ -239,10 +239,10 @@
   f_data.s_vaddr = f_bss.s_vaddr;
   f_data.s_paddr += new_bss_size;
 #if 0 
-  if (f_data.s_size + f_idata.s_size != f_ohdr.dsize)
+  if (f_data.s_size + f_nextdata.s_size != f_ohdr.dsize)
     {
       printf("section size doesn't tally with dsize %lx != %lx\n", 
-	     f_data.s_size + f_idata.s_size, f_ohdr.dsize);
+	     f_data.s_size + f_nextdata.s_size, f_ohdr.dsize);
     }
 #endif
   f_data.s_size += new_bss_size;
@@ -285,13 +285,13 @@
       PERROR("failed to write data header");
     }
 
-  printf("writing .idata header\n");
-  f_idata.s_scnptr += file_sz_change;
-  if (f_idata.s_lnnoptr != 0) f_idata.s_lnnoptr += file_sz_change;
-  if (f_idata.s_relptr != 0) f_idata.s_relptr += file_sz_change;
-  if (write(a_new, &f_idata, sizeof(f_idata)) != sizeof(f_idata))
+  printf("writing following data header\n");
+  f_nextdata.s_scnptr += file_sz_change;
+  if (f_nextdata.s_lnnoptr != 0) f_nextdata.s_lnnoptr += file_sz_change;
+  if (f_nextdata.s_relptr != 0) f_nextdata.s_relptr += file_sz_change;
+  if (write(a_new, &f_nextdata, sizeof(f_nextdata)) != sizeof(f_nextdata))
     {
-      PERROR("failed to write idata header");
+      PERROR("failed to write nextdata header");
     }
 
   /* copy other section headers adjusting the file offset */
@@ -361,21 +361,21 @@
   static_heap_dumped = 0;
   
   size = lseek(a_out, f_data_s_scnptr + data_size, SEEK_SET);
-  size = f_idata.s_scnptr - size;
+  size = f_nextdata.s_scnptr - size;
   dup_file_area(a_out, a_new, size);
 
-  //  lseek(a_out, f_idata.s_scnptr, SEEK_CUR);
-  CHECK_AOUT_POS(f_idata.s_scnptr);
-  /* now dump - idata don't need to do this cygwin ds is in .data! */
-  printf ("dumping .idata section... %lx bytes\n", f_idata.s_size);
+  //  lseek(a_out, f_nextdata.s_scnptr, SEEK_CUR);
+  CHECK_AOUT_POS(f_nextdata.s_scnptr);
+  /* now dump - nextdata don't need to do this cygwin ds is in .data! */
+  printf ("dumping following data section... %lx bytes\n", f_nextdata.s_size);
 
-  dup_file_area(a_out,a_new,f_idata.s_size);
+  dup_file_area(a_out,a_new,f_nextdata.s_size);
 
   /* write rest of file */
   printf ("writing rest of file\n");
   size = lseek(a_out, 0, SEEK_END);
-  size = size - (f_idata.s_scnptr + f_idata.s_size); /* length remaining in a_out */
-  lseek(a_out, f_idata.s_scnptr + f_idata.s_size, SEEK_SET);
+  size = size - (f_nextdata.s_scnptr + f_nextdata.s_size); /* length remaining in a_out */
+  lseek(a_out, f_nextdata.s_scnptr + f_nextdata.s_size, SEEK_SET);
 
   dup_file_area(a_out, a_new, size);
 }
--- a/version.sh	Mon Aug 13 10:26:31 2007 +0200
+++ b/version.sh	Mon Aug 13 10:27:19 2007 +0200
@@ -1,5 +1,5 @@
 #!/bin/sh
 emacs_major_version=21
 emacs_minor_version=0
-emacs_beta_version=32
-xemacs_codename="Nachi"
+emacs_beta_version=33
+xemacs_codename="Nigerian Dwarf"