changeset 288:e11d67e05968 r21-0b42

Import from CVS: tag r21-0b42
author cvs
date Mon, 13 Aug 2007 10:35:54 +0200
parents 13a0bd77a29d
children 6e6992ccc4b6
files CHANGES-beta ChangeLog configure configure.in etc/check_cygwin_setup.sh etc/sounds/README etc/sounds/Tuxedomoon.Jingle4.au etc/sounds/bark.au etc/sounds/bass-snap.au etc/sounds/boing.au etc/sounds/bong.au etc/sounds/click.au etc/sounds/clink.au etc/sounds/cuckoo.au etc/sounds/ding.au etc/sounds/drip.au etc/sounds/drum-beep.au etc/sounds/hammer.au etc/sounds/hype.au etc/sounds/im_so_happy.au etc/sounds/long-beep.au etc/sounds/low-smash.au etc/sounds/mellowbweep.au etc/sounds/monkey.au etc/sounds/piano-beep.au etc/sounds/quiet-beep.au etc/sounds/return.au etc/sounds/say-beep.au etc/sounds/slap.au etc/sounds/the-ping.au etc/sounds/whip.au etc/sounds/yeep.au lib-src/ChangeLog lib-src/getopt.c lib-src/make-docfile.c lib-src/movemail.c lib-src/wakeup.c lisp/ChangeLog lisp/dragdrop.el lisp/faces.el lisp/files.el lisp/frame.el lisp/lisp-mode.el lisp/menubar-items.el lisp/minibuf.el lisp/modeline.el lisp/mouse.el lisp/msw-faces.el lisp/msw-glyphs.el lisp/msw-init.el lisp/msw-select.el lisp/package-get-base.el lisp/package-get.el lisp/packages.el lisp/simple.el lisp/sound.el lisp/specifier.el lisp/startup.el lisp/toolbar-items.el lisp/winnt.el lisp/x-faces.el man/ChangeLog man/lispref/dragndrop.texi man/lispref/frames.texi nt/ChangeLog nt/inc/sys/dir.h nt/xemacs.mak src/ChangeLog src/alloc.c src/buffer.c src/buffer.h src/callproc.c src/cmdloop.c src/console-msw.h src/console.h src/dbxrc src/depend src/device-msw.c src/device-tty.c src/device-x.c src/dialog-msw.c src/dired-msw.c src/editfns.c src/emacs.c src/event-msw.c src/events.c src/events.h src/faces.c src/fileio.c src/floatfns.c src/frame-x.c src/gdbinit src/glyphs-msw.c src/glyphs-x.c src/glyphs.c src/glyphs.h src/gmalloc.c src/gui-x.c src/gui.c src/gui.h src/indent.c src/lisp.h src/lread.c src/make-src-depend src/menubar-msw.c src/msdos.c src/mule-mcpath.c src/nt.c src/nt.h src/ntplay.c src/ntproc.c src/objects-msw.c src/process-nt.c src/process-unix.c src/process.c src/procimpl.h src/realpath.c src/redisplay-msw.c src/s/cygwin32.h src/s/windowsnt.h src/scrollbar-msw.c src/scrollbar-x.c src/select-msw.c src/symsinit.h src/sysdep.c src/sysdep.h src/sysfile.h src/sysfloat.h src/toolbar-msw.c src/toolbar.h src/tooltalk.c src/unexalpha.c src/unexelfsgi.c src/window.c tests/Dnd/README tests/Dnd/dragtest.el tests/Dnd/droptest.el version.sh
diffstat 138 files changed, 4329 insertions(+), 2195 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 10:35:07 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 10:35:54 2007 +0200
@@ -1,4 +1,25 @@
 							-*- indented-text -*-
+to 21.0 beta42 "Somali"
+-- Sounds are no longer included in the core distribution
+-- Unexec fix for SGI from Olivier Galibert
+-- xbm support for MS Windows
+-- pixel function updates from Greg Klanderman
+-- Miscellaneous cygwin patches from Andy Piper
+-- Miscellaneous patches from Martin Buchholz
+-- New GIF lite readonly GIF support from Jareth Hein
+-- $HOME fixes for MS Windows from Darryl Okahata
+-- Miscellaneous changes from Kirill Katsnelson
+-- DnD update from Oliver Graf
+-- pixel function naming cleanup from Greg Klanderman
+-- specifier fixes from Hrvoje Niksic
+-- tooltalk crash fix from Gunnar Evermann
+-- various changes from Andy Piper
+-- toolbar button size and glyph patch from Andy Piper
+-- Miscellaneous changes from Hrvoje Niksic
+-- Miscellaneous changes from Martin Buchholz
+-- warnings cleanup from Kirill Katsnelson
+-- msw graphics patch from Andy Piper
+
 to 21.0 beta41 "San Clemente"
 -- MS Windows font charset support from Kirill Katsnelson
 -- Special glyph fixes from Kirill Katsnelson
--- a/ChangeLog	Mon Aug 13 10:35:07 2007 +0200
+++ b/ChangeLog	Mon Aug 13 10:35:54 2007 +0200
@@ -1,3 +1,37 @@
+1998-06-01  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 21.0-beta42 is released.
+
+	* etc/sounds: Removed, now in the sounds-au package.
+
+1998-05-29  Andy Piper  <andyp@parallax.co.uk>
+
+	* configure.in: don't use -O3 for cygwin.
+
+	* etc/check_cygwin_setup.sh: new file to check that cygwin is setup
+	correctly for XEmacs operation.
+
+1998-05-28  P. E. Jareth Hein  <jareth@camelot-soft.com>
+
+	* configure.in: Switch from giflib to gifreader for
+	our GIF image support (no other mods needed)
+
+1998-05-28  Oliver Graf <ograf@fga.de>
+
+	* configure.in: only one DnD protocol, CDE has priority over OffiX
+
+	* tests/Dnd/README: some changes reflecting recent modifications
+	* tests/Dnd/dragtest.el: removed
+	* tests/Dnd/droptest.el: cosmetics and comments
+
+1998-05-26  Oliver Graf <ograf@fga.de>
+
+	* tests/Dnd/droptest.el: adapted to CDE extensions
+
+1998-05-21  Andy Piper  <andyp@parallax.co.uk>
+
+	* configure.in: check for msw dialogs.
+
 1998-05-23  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 21.0-beta41 is released.
--- a/configure	Mon Aug 13 10:35:07 2007 +0200
+++ b/configure	Mon Aug 13 10:35:54 2007 +0200
@@ -2280,7 +2280,9 @@
 if test "$cflags_specified" = "no"; then
       if   test "$GCC" = "yes"; then
     CFLAGS="-g -O3 -Wall -Wno-switch"
-                elif test "$__sunpro_c" = "yes"; then
+                    test "$opsys $machine" = "cygwin32 intel386" && \
+      CFLAGS="-g -O2 -Wall -Wno-switch"
+  elif test "$__sunpro_c" = "yes"; then
     case "$opsys" in
       sol2    ) CFLAGS="-v -xO4" ;;
       sunos4* ) CFLAGS="-xO2";;
@@ -2355,7 +2357,7 @@
  fi
 
 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
-echo "configure:2359: checking for dynodump" >&5
+echo "configure:2361: checking for dynodump" >&5
 if test "$unexec" != "unexsol2.o"; then
   echo "$ac_t""no" 1>&6
 else
@@ -2455,7 +2457,7 @@
 
 if test "$add_runtime_path" = "yes"; then
       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
-echo "configure:2459: checking "for runtime libraries flag"" >&5
+echo "configure:2461: 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"
@@ -2473,14 +2475,14 @@
   done
 fi
     cat > conftest.$ac_ext <<EOF
-#line 2477 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:2484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+#line 2479 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   dash_r="$try_dash_r"
 else
@@ -2580,10 +2582,10 @@
 fi
 after_morecore_hook_exists=yes
 echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
-echo "configure:2584: checking for malloc_get_state" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2587 "configure"
+echo "configure:2586: checking for malloc_get_state" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2589 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_get_state(); below.  */
@@ -2606,7 +2608,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2612: \"$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
@@ -2626,10 +2628,10 @@
 fi
 
 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
-echo "configure:2630: checking for malloc_set_state" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2633 "configure"
+echo "configure:2632: checking for malloc_set_state" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2635 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_set_state(); below.  */
@@ -2652,7 +2654,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2658: \"$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
@@ -2672,16 +2674,16 @@
 fi
 
 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
-echo "configure:2676: checking whether __after_morecore_hook exists" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2678 "configure"
+echo "configure:2678: checking whether __after_morecore_hook exists" >&5
+cat > conftest.$ac_ext <<EOF
+#line 2680 "configure"
 #include "confdefs.h"
 extern void (* __after_morecore_hook)();
 int main() {
 __after_morecore_hook = 0
 ; return 0; }
 EOF
-if { (eval echo configure:2685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -2740,7 +2742,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:2744: checking for $ac_word" >&5
+echo "configure:2746: checking for $ac_word" >&5
 
 if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -2793,7 +2795,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:2797: checking for a BSD compatible install" >&5
+echo "configure:2799: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 
   IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
@@ -2844,7 +2846,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:2848: checking for $ac_word" >&5
+echo "configure:2850: checking for $ac_word" >&5
 
 if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -2875,15 +2877,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2879: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2882 "configure"
+echo "configure:2881: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2884 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2916,15 +2918,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2920: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2923 "configure"
+echo "configure:2922: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2925 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2957,15 +2959,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2961: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2964 "configure"
+echo "configure:2963: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2966 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2995,10 +2997,10 @@
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2999: checking for sys/wait.h that is POSIX.1 compatible" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3002 "configure"
+echo "configure:3001: checking for sys/wait.h that is POSIX.1 compatible" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3004 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -3014,7 +3016,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:3018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -3038,10 +3040,10 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3042: checking for ANSI C header files" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3045 "configure"
+echo "configure:3044: checking for ANSI C header files" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3047 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3049,7 +3051,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3066,7 +3068,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 3070 "configure"
+#line 3072 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -3084,7 +3086,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 3088 "configure"
+#line 3090 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -3102,7 +3104,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 3106 "configure"
+#line 3108 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3113,7 +3115,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:3117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   :
 else
@@ -3138,10 +3140,10 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3142: checking whether time.h and sys/time.h may both be included" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3145 "configure"
+echo "configure:3144: checking whether time.h and sys/time.h may both be included" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3147 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3150,7 +3152,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3174,10 +3176,10 @@
 fi
 
 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:3178: checking for sys_siglist declaration in signal.h or unistd.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3181 "configure"
+echo "configure:3180: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3183 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3189,7 +3191,7 @@
 char *msg = *(sys_siglist + 1);
 ; return 0; }
 EOF
-if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_siglist=yes
 else
@@ -3214,9 +3216,9 @@
 
 
 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
-echo "configure:3218: checking for struct utimbuf" >&5
-cat > conftest.$ac_ext <<EOF
-#line 3220 "configure"
+echo "configure:3220: checking for struct utimbuf" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3222 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3235,7 +3237,7 @@
 static struct utimbuf x; x.actime = x.modtime;
 ; return 0; }
 EOF
-if { (eval echo configure:3239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3241: \"$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
@@ -3255,10 +3257,10 @@
 rm -f conftest*
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3259: checking return type of signal handlers" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3262 "configure"
+echo "configure:3261: checking return type of signal handlers" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3264 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3275,7 +3277,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3297,10 +3299,10 @@
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3301: checking for size_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3304 "configure"
+echo "configure:3303: checking for size_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3306 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3331,10 +3333,10 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3335: checking for pid_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3338 "configure"
+echo "configure:3337: checking for pid_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3340 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3365,10 +3367,10 @@
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3369: checking for uid_t in sys/types.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3372 "configure"
+echo "configure:3371: checking for uid_t in sys/types.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3374 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3404,10 +3406,10 @@
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3408: checking for mode_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3411 "configure"
+echo "configure:3410: checking for mode_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3413 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3438,10 +3440,10 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3442: checking for off_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3445 "configure"
+echo "configure:3444: checking for off_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3447 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3473,9 +3475,9 @@
 
 
 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
-echo "configure:3477: checking for struct timeval" >&5
-cat > conftest.$ac_ext <<EOF
-#line 3479 "configure"
+echo "configure:3479: checking for struct timeval" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3481 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3491,7 +3493,7 @@
 static struct timeval x; x.tv_sec = x.tv_usec;
 ; return 0; }
 EOF
-if { (eval echo configure:3495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
   HAVE_TIMEVAL=yes
@@ -3513,10 +3515,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:3517: checking whether struct tm is in sys/time.h or time.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3520 "configure"
+echo "configure:3519: checking whether struct tm is in sys/time.h or time.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3522 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3524,7 +3526,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3548,10 +3550,10 @@
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3552: checking for tm_zone in struct tm" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3555 "configure"
+echo "configure:3554: checking for tm_zone in struct tm" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3557 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3559,7 +3561,7 @@
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3582,10 +3584,10 @@
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3586: checking for tzname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3589 "configure"
+echo "configure:3588: checking for tzname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3591 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3595,7 +3597,7 @@
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3621,10 +3623,10 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3625: checking for working const" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3628 "configure"
+echo "configure:3627: checking for working const" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3630 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3673,7 +3675,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3698,7 +3700,7 @@
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:3702: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:3704: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 
 cat > conftestmake <<\EOF
@@ -3723,12 +3725,12 @@
 
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3727: checking whether byte ordering is bigendian" >&5
+echo "configure:3729: 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 3732 "configure"
+#line 3734 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3739,11 +3741,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3745: \"$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 3747 "configure"
+#line 3749 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3754,7 +3756,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3771,7 +3773,7 @@
 rm -f conftest*
 if test $ac_cv_c_bigendian = unknown; then
 cat > conftest.$ac_ext <<EOF
-#line 3775 "configure"
+#line 3777 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3784,7 +3786,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 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:3790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_bigendian=no
 else
@@ -3810,10 +3812,10 @@
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:3814: checking size of short" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3817 "configure"
+echo "configure:3816: checking size of short" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3819 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3824,7 +3826,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -3851,10 +3853,10 @@
   exit 1
 fi
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3855: checking size of int" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3858 "configure"
+echo "configure:3857: checking size of int" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3860 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3865,7 +3867,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -3886,10 +3888,10 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3890: checking size of long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3893 "configure"
+echo "configure:3892: checking size of long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3895 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3900,7 +3902,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -3921,10 +3923,10 @@
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:3925: checking size of long long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3928 "configure"
+echo "configure:3927: checking size of long long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3930 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3935,7 +3937,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3941: \"$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
@@ -3956,10 +3958,10 @@
 
 
 echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:3960: checking size of void *" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3963 "configure"
+echo "configure:3962: checking size of void *" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3965 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3970,7 +3972,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3976: \"$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
@@ -3992,7 +3994,7 @@
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:3996: checking for long file names" >&5
+echo "configure:3998: 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:
@@ -4039,12 +4041,12 @@
 
 
 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:4043: checking for sin in -lm" >&5
+echo "configure:4045: 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 4048 "configure"
+#line 4050 "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
@@ -4055,7 +4057,7 @@
 sin()
 ; return 0; }
 EOF
-if { (eval echo configure:4059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4061: \"$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
@@ -4097,14 +4099,14 @@
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4101 "configure"
+#line 4103 "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:4108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4110: \"$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
@@ -4121,7 +4123,7 @@
 rm -f conftest*
 
 echo "checking type of mail spool file locking" 1>&6
-echo "configure:4125: checking type of mail spool file locking" >&5
+echo "configure:4127: 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
@@ -4145,12 +4147,12 @@
 
 
 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
-echo "configure:4149: checking for kstat_open in -lkstat" >&5
+echo "configure:4151: 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 4154 "configure"
+#line 4156 "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
@@ -4161,7 +4163,7 @@
 kstat_open()
 ; return 0; }
 EOF
-if { (eval echo configure:4165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4167: \"$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
@@ -4195,12 +4197,12 @@
 
 
 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
-echo "configure:4199: checking for kvm_read in -lkvm" >&5
+echo "configure:4201: 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 4204 "configure"
+#line 4206 "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
@@ -4211,7 +4213,7 @@
 kvm_read()
 ; return 0; }
 EOF
-if { (eval echo configure:4215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4217: \"$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
@@ -4246,12 +4248,12 @@
 case "$opsys" in decosf*)
   
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:4250: checking for cma_open in -lpthreads" >&5
+echo "configure:4252: 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 4255 "configure"
+#line 4257 "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
@@ -4262,7 +4264,7 @@
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:4266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4268: \"$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
@@ -4298,7 +4300,7 @@
 esac
 
 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
-echo "configure:4302: checking whether the -xildoff compiler flag is required" >&5
+echo "configure:4304: 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;
@@ -4309,7 +4311,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:4313: checking for \"-z ignore\" linker flag" >&5
+echo "configure:4315: 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 ;;
@@ -4319,7 +4321,7 @@
 
 
 echo "checking "for specified window system"" 1>&6
-echo "configure:4323: checking "for specified window system"" >&5
+echo "configure:4325: checking "for specified window system"" >&5
 
 if test "$with_x11" != "no"; then
     test "$x_includes $x_libraries" != "NONE NONE" && \
@@ -4352,7 +4354,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:4356: checking for X" >&5
+echo "configure:4358: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4412,12 +4414,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4416 "configure"
+#line 4418 "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:4421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4486,14 +4488,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4490 "configure"
+#line 4492 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4499: \"$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.
@@ -4602,17 +4604,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:4606: checking whether -R must be followed by a space" >&5
+echo "configure:4608: 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 4609 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:4616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+#line 4611 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4628,14 +4630,14 @@
       else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
 	cat > conftest.$ac_ext <<EOF
-#line 4632 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:4639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+#line 4634 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4671,12 +4673,12 @@
 else
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:4675: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:4677: 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 4680 "configure"
+#line 4682 "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
@@ -4687,7 +4689,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4693: \"$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
@@ -4711,12 +4713,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:4715: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:4717: 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 4720 "configure"
+#line 4722 "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
@@ -4727,7 +4729,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4733: \"$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
@@ -4756,10 +4758,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:4760: checking for gethostbyname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4763 "configure"
+echo "configure:4762: checking for gethostbyname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4765 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4782,7 +4784,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -4803,12 +4805,12 @@
     if test $ac_cv_func_gethostbyname = no; then
       
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4807: checking for gethostbyname in -lnsl" >&5
+echo "configure:4809: 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 4812 "configure"
+#line 4814 "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
@@ -4819,7 +4821,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4825: \"$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
@@ -4849,10 +4851,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:4853: checking for connect" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4856 "configure"
+echo "configure:4855: checking for connect" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4858 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4875,7 +4877,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -4898,12 +4900,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:4902: checking "$xe_msg_checking"" >&5
+echo "configure:4904: 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 4907 "configure"
+#line 4909 "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
@@ -4914,7 +4916,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:4918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4920: \"$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
@@ -4938,10 +4940,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:4942: checking for remove" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4945 "configure"
+echo "configure:4944: checking for remove" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4947 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -4964,7 +4966,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -4985,12 +4987,12 @@
     if test $ac_cv_func_remove = no; then
       
 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:4989: checking for remove in -lposix" >&5
+echo "configure:4991: 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 4994 "configure"
+#line 4996 "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
@@ -5001,7 +5003,7 @@
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:5005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5007: \"$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
@@ -5025,10 +5027,10 @@
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:5029: checking for shmat" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5032 "configure"
+echo "configure:5031: checking for shmat" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5034 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -5051,7 +5053,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -5072,12 +5074,12 @@
     if test $ac_cv_func_shmat = no; then
       
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:5076: checking for shmat in -lipc" >&5
+echo "configure:5078: 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 5081 "configure"
+#line 5083 "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
@@ -5088,7 +5090,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:5092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5094: \"$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
@@ -5122,12 +5124,12 @@
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   
 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:5126: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:5128: 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 5131 "configure"
+#line 5133 "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
@@ -5138,7 +5140,7 @@
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:5142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5144: \"$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
@@ -5305,7 +5307,7 @@
 
 
     echo "checking for X defines extracted by xmkmf" 1>&6
-echo "configure:5309: checking for X defines extracted by xmkmf" >&5
+echo "configure:5311: checking for X defines extracted by xmkmf" >&5
   rm -fr conftestdir
   if mkdir conftestdir; then
     cd conftestdir
@@ -5337,15 +5339,15 @@
 
     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
-echo "configure:5341: checking for X11/Intrinsic.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5344 "configure"
+echo "configure:5343: checking for X11/Intrinsic.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5346 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5369,12 +5371,12 @@
 
       
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:5373: checking for XOpenDisplay in -lX11" >&5
+echo "configure:5375: 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 5378 "configure"
+#line 5380 "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
@@ -5385,7 +5387,7 @@
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5391: \"$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
@@ -5410,12 +5412,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:5414: checking "$xe_msg_checking"" >&5
+echo "configure:5416: 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 5419 "configure"
+#line 5421 "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
@@ -5426,7 +5428,7 @@
 XGetFontProperty()
 ; return 0; }
 EOF
-if { (eval echo configure:5430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5432: \"$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
@@ -5453,12 +5455,12 @@
 
     
 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
-echo "configure:5457: checking for XShapeSelectInput in -lXext" >&5
+echo "configure:5459: 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 5462 "configure"
+#line 5464 "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
@@ -5469,7 +5471,7 @@
 XShapeSelectInput()
 ; return 0; }
 EOF
-if { (eval echo configure:5473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5475: \"$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
@@ -5492,12 +5494,12 @@
 
     
 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
-echo "configure:5496: checking for XtOpenDisplay in -lXt" >&5
+echo "configure:5498: 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 5501 "configure"
+#line 5503 "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
@@ -5508,7 +5510,7 @@
 XtOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5514: \"$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
@@ -5531,14 +5533,14 @@
 
 
   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
-echo "configure:5535: checking the version of X11 being used" >&5
+echo "configure:5537: checking the version of X11 being used" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5537 "configure"
+#line 5539 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
 EOF
-if { (eval echo configure:5542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:5544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest foobar; x11_release=$?
 else
@@ -5562,15 +5564,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5566: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5569 "configure"
+echo "configure:5568: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5571 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5601,7 +5603,7 @@
 
 
     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
-echo "configure:5605: checking for XFree86" >&5
+echo "configure:5607: checking for XFree86" >&5
   if test -d "/usr/X386/include" -o \
           -f "/etc/XF86Config"    -o \
 	  -f "/etc/X11/XF86Config" -o \
@@ -5621,12 +5623,12 @@
 
     test -z "$with_xmu" && { 
 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
-echo "configure:5625: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
+echo "configure:5627: 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 5630 "configure"
+#line 5632 "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
@@ -5637,7 +5639,7 @@
 XmuReadBitmapDataFromFile()
 ; return 0; }
 EOF
-if { (eval echo configure:5641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5643: \"$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
@@ -5676,19 +5678,19 @@
 
       
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:5680: checking for main in -lXbsd" >&5
+echo "configure:5682: 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 5685 "configure"
+#line 5687 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5694: \"$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
@@ -5725,22 +5727,22 @@
 fi 
 if test "$with_msw" != "no"; then
   echo "checking for MS-Windows" 1>&6
-echo "configure:5729: checking for MS-Windows" >&5
+echo "configure:5731: checking for MS-Windows" >&5
   
 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
-echo "configure:5732: checking for main in -lgdi32" >&5
+echo "configure:5734: 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 5737 "configure"
+#line 5739 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5746: \"$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
@@ -5785,7 +5787,10 @@
 	    && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"toolbar-msw.o\""
  fi
-	with_dialogs=msw
+	test "$with_dialogs"   != "no" && with_dialogs=msw \
+	    && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"dialog-msw.o\""
+ fi
     else
 	test "$with_scrollbars"   != "no" && extra_objs="$extra_objs scrollbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"scrollbar-msw.o\""
@@ -5796,14 +5801,17 @@
 	test "$with_toolbars"   != "no" && extra_objs="$extra_objs toolbar-msw.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"toolbar-msw.o\""
  fi
+	test "$with_dialogs"   != "no" && extra_objs="$extra_objs dialog-msw.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"dialog-msw.o\""
+ fi
     fi
         cat > conftest.$ac_ext <<EOF
-#line 5802 "configure"
+#line 5810 "configure"
 #include "confdefs.h"
 #include <fcntl.h>
     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
 EOF
-if { (eval echo configure:5807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MSG_SELECT
@@ -5881,7 +5889,7 @@
 esac
 
 echo "checking for session-management option" 1>&6
-echo "configure:5885: checking for session-management option" >&5;
+echo "configure:5893: checking for session-management option" >&5;
 if test "$with_session" != "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SESSION
@@ -5896,15 +5904,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:5900: checking for X11/Xauth.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5903 "configure"
+echo "configure:5908: checking for X11/Xauth.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5911 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5927,12 +5935,12 @@
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:5931: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:5939: 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 5936 "configure"
+#line 5944 "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
@@ -5943,7 +5951,7 @@
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:5947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5955: \"$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
@@ -5982,44 +5990,21 @@
 fi
 
 
-test "$window_system" != "x11" && with_offix=no
-if test "$with_xmu" != yes -a "$with_x11" = yes; then
-  echo "configure: warning: No OffiX without real Xmu support" 1>&2
-  with_offix=no
-fi
-if test "$with_dragndrop" = no; then
-  echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
-  with_offix=no
-fi
-test -z "$with_offix" && with_offix=yes
-if test "$with_offix" = "yes"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining HAVE_OFFIX_DND
-EOF
-cat >> confdefs.h <<\EOF
-#define HAVE_OFFIX_DND 1
-EOF
-}
-
-  dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
-  dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
-fi
-
 
 
 if test "$with_tooltalk" != "no" ; then
       for dir in "" "Tt/" "desktop/" ; do
     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
-echo "configure:6015: checking for ${dir}tt_c.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6018 "configure"
+echo "configure:6000: checking for ${dir}tt_c.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6003 "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:6023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6055,12 +6040,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:6059: checking "$xe_msg_checking"" >&5
+echo "configure:6044: 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 6064 "configure"
+#line 6049 "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
@@ -6071,7 +6056,7 @@
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:6075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6060: \"$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
@@ -6128,15 +6113,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:6132: checking for Dt/Dt.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6135 "configure"
+echo "configure:6117: checking for Dt/Dt.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6120 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6159,12 +6144,12 @@
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:6163: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:6148: 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 6168 "configure"
+#line 6153 "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
@@ -6175,7 +6160,7 @@
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:6179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6164: \"$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
@@ -6216,8 +6201,35 @@
   need_motif=yes    # CDE requires Motif
 fi
 
+test "$window_system" != "x11" && with_offix=no
+if test "$with_xmu" != yes -a "$with_x11" = yes; then
+  echo "configure: warning: No OffiX without real Xmu support" 1>&2
+  with_offix=no
+fi
+if test "$with_dragndrop" = no; then
+  echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2
+  with_offix=no
+fi
+if test "$with_cde" = yes; then
+  echo "configure: warning: CDE already found, disabling OffiX support" 1>&2
+  with_offix=no
+fi
+test -z "$with_offix" && with_offix=yes
+if test "$with_offix" = "yes"; then
+  { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_OFFIX_DND
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_OFFIX_DND 1
+EOF
+}
+
+  dnd_objs="$dnd_objs offix.o" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"offix.o\" to \$dnd_objs"; fi
+  dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
+fi
+
 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
-echo "configure:6221: checking if drag and drop API is needed" >&5
+echo "configure:6233: checking if drag and drop API is needed" >&5
 if test "$with_dragndrop" != "no" ; then
   if test -n "$dragndrop_proto" ; then
     with_dragndrop=yes
@@ -6238,18 +6250,18 @@
 fi
 
 echo "checking for LDAP" 1>&6
-echo "configure:6242: checking for LDAP" >&5
+echo "configure:6254: 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:6245: checking for ldap.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6248 "configure"
+echo "configure:6257: checking for ldap.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6260 "configure"
 #include "confdefs.h"
 #include <ldap.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6272,15 +6284,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:6276: checking for lber.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6279 "configure"
+echo "configure:6288: checking for lber.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6291 "configure"
 #include "confdefs.h"
 #include <lber.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6306,12 +6318,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:6310: checking "$xe_msg_checking"" >&5
+echo "configure:6322: 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 6315 "configure"
+#line 6327 "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
@@ -6322,7 +6334,7 @@
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:6326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6338: \"$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
@@ -6345,12 +6357,12 @@
  }
   test "$with_umich_ldap" = "no" && { 
 echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6
-echo "configure:6349: checking for ldap_set_option in -lldap10" >&5
+echo "configure:6361: 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 6354 "configure"
+#line 6366 "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
@@ -6361,7 +6373,7 @@
 ldap_set_option()
 ; return 0; }
 EOF
-if { (eval echo configure:6365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6377: \"$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
@@ -6425,14 +6437,14 @@
 
 if test "$window_system" != "none"; then
   echo "checking for graphics libraries" 1>&6
-echo "configure:6429: checking for graphics libraries" >&5
+echo "configure:6441: checking for graphics libraries" >&5
 
     if test -z "$with_xpm"; then
     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:6433: checking for Xpm - no older than 3.4f" >&5
+echo "configure:6445: checking for Xpm - no older than 3.4f" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 6436 "configure"
+#line 6448 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
     int main(int c, char **v) {
@@ -6440,7 +6452,7 @@
       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
       XpmIncludeVersion < 30406 ? 2 : 0 ;}
 EOF
-if { (eval echo configure:6444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:6456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest dummy_arg; xpm_status=$?;
       if test "$?" = "0"; then
@@ -6481,17 +6493,17 @@
 
     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
-echo "configure:6485: checking for \"FOR_MSW\" xpm" >&5
+echo "configure:6497: checking for \"FOR_MSW\" xpm" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 6488 "configure"
+#line 6500 "configure"
 #include "confdefs.h"
 
 int main() {
 XpmCreatePixmapFromData()
 ; return 0; }
 EOF
-if { (eval echo configure:6495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   xpm_for_msw=no
 else
@@ -6518,12 +6530,12 @@
       if test "$with_png $with_tiff" != "no no"; then
     
 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
-echo "configure:6522: checking for inflate in -lc" >&5
+echo "configure:6534: checking for inflate in -lc" >&5
 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 6527 "configure"
+#line 6539 "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
@@ -6534,7 +6546,7 @@
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:6538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6550: \"$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
@@ -6553,12 +6565,12 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
-echo "configure:6557: checking for inflate in -lz" >&5
+echo "configure:6569: checking for inflate in -lz" >&5
 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lz "
 cat > conftest.$ac_ext <<EOF
-#line 6562 "configure"
+#line 6574 "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
@@ -6569,7 +6581,7 @@
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:6573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6585: \"$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
@@ -6588,12 +6600,12 @@
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
-echo "configure:6592: checking for inflate in -lgz" >&5
+echo "configure:6604: checking for inflate in -lgz" >&5
 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgz "
 cat > conftest.$ac_ext <<EOF
-#line 6597 "configure"
+#line 6609 "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
@@ -6604,7 +6616,7 @@
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:6608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6620: \"$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
@@ -6632,19 +6644,19 @@
 
   fi
 
-    echo $ac_n "checking for giflib - no older than 3.1""... $ac_c" 1>&6
-echo "configure:6637: 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:6640: checking for gif_lib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6643 "configure"
-#include "confdefs.h"
-#include <gif_lib.h>
+    echo $ac_n "checking for gifreader""... $ac_c" 1>&6
+echo "configure:6649: checking for gifreader" >&5
+  test -z "$with_gif" && { ac_safe=`echo "gifrlib.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for gifrlib.h""... $ac_c" 1>&6
+echo "configure:6652: checking for gifrlib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6655 "configure"
+#include "confdefs.h"
+#include <gifrlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6666,13 +6678,13 @@
 fi
  }
   test -z "$with_gif" && { 
-echo $ac_n "checking for GetGifError in -lgif""... $ac_c" 1>&6
-echo "configure:6671: 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 6676 "configure"
+echo $ac_n "checking for GetGifError in -lgifreader""... $ac_c" 1>&6
+echo "configure:6683: checking for GetGifError in -lgifreader" >&5
+ac_lib_var=`echo gifreader'_'GetGifError | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lgifreader "
+cat > conftest.$ac_ext <<EOF
+#line 6688 "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
@@ -6683,7 +6695,7 @@
 GetGifError()
 ; return 0; }
 EOF
-if { (eval echo configure:6687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6699: \"$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
@@ -6714,20 +6726,20 @@
 EOF
 }
 
-    libs_x="-lgif $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgif\" to \$libs_x"; fi
+    libs_x="-lgifreader $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lgifreader\" to \$libs_x"; fi
   fi
 
     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
-echo "configure:6723: checking for jpeglib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6726 "configure"
+echo "configure:6735: checking for jpeglib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6738 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6750,12 +6762,12 @@
  }
   test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:6754: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:6766: 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 6759 "configure"
+#line 6771 "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
@@ -6766,7 +6778,7 @@
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:6770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6782: \"$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
@@ -6802,9 +6814,9 @@
 
     if test -z "$with_png"; then
     echo $ac_n "checking for png.h - no older than 0.96""... $ac_c" 1>&6
-echo "configure:6806: checking for png.h - no older than 0.96" >&5
+echo "configure:6818: checking for png.h - no older than 0.96" >&5
     cat > conftest.$ac_ext <<EOF
-#line 6808 "configure"
+#line 6820 "configure"
 #include "confdefs.h"
 #include <png.h>
 #if PNG_LIBPNG_VER >= 96
@@ -6824,10 +6836,10 @@
 
   fi
   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:6828: checking for pow" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6831 "configure"
+echo "configure:6840: checking for pow" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6843 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -6850,7 +6862,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -6871,12 +6883,12 @@
  }
   test -z "$with_png" && { 
 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
-echo "configure:6875: checking for png_read_image in -lpng" >&5
+echo "configure:6887: checking for png_read_image in -lpng" >&5
 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpng "
 cat > conftest.$ac_ext <<EOF
-#line 6880 "configure"
+#line 6892 "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
@@ -6887,7 +6899,7 @@
 png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:6891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6903: \"$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
@@ -6923,15 +6935,15 @@
 
     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
-echo "configure:6927: checking for tiffio.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6930 "configure"
+echo "configure:6939: checking for tiffio.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6942 "configure"
 #include "confdefs.h"
 #include <tiffio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6954,12 +6966,12 @@
  }
   test -z "$with_tiff" && { 
 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
-echo "configure:6958: checking for TIFFClientOpen in -ltiff" >&5
+echo "configure:6970: checking for TIFFClientOpen in -ltiff" >&5
 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltiff "
 cat > conftest.$ac_ext <<EOF
-#line 6963 "configure"
+#line 6975 "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
@@ -6970,7 +6982,7 @@
 TIFFClientOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:6974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6986: \"$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
@@ -7009,19 +7021,19 @@
 if test "$with_x11" = "yes"; then
 
   echo "checking for X11 graphics libraries" 1>&6
-echo "configure:7013: checking for X11 graphics libraries" >&5
+echo "configure:7025: checking for X11 graphics libraries" >&5
 
     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
-echo "configure:7017: checking for compface.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7020 "configure"
+echo "configure:7029: checking for compface.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7032 "configure"
 #include "confdefs.h"
 #include <compface.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7044,12 +7056,12 @@
  }
   test -z "$with_xface" && { 
 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:7048: checking for UnGenFace in -lcompface" >&5
+echo "configure:7060: 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 7053 "configure"
+#line 7065 "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
@@ -7060,7 +7072,7 @@
 UnGenFace()
 ; return 0; }
 EOF
-if { (eval echo configure:7064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7076: \"$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
@@ -7096,12 +7108,12 @@
 
     
 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
-echo "configure:7100: checking for XawScrollbarSetThumb in -lXaw" >&5
+echo "configure:7112: 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 7105 "configure"
+#line 7117 "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
@@ -7112,7 +7124,7 @@
 XawScrollbarSetThumb()
 ; return 0; }
 EOF
-if { (eval echo configure:7116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7128: \"$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
@@ -7136,15 +7148,15 @@
                     
     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:7140: checking for Xm/Xm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7143 "configure"
+echo "configure:7152: checking for Xm/Xm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7155 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7161,12 +7173,12 @@
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:7165: checking for XmStringFree in -lXm" >&5
+echo "configure:7177: 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 7170 "configure"
+#line 7182 "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
@@ -7177,7 +7189,7 @@
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:7181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7193: \"$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
@@ -7206,9 +7218,9 @@
 
   if test "$have_motif" = "yes"; then
         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
-echo "configure:7210: checking for Lesstif" >&5
+echo "configure:7222: checking for Lesstif" >&5
     cat > conftest.$ac_ext <<EOF
-#line 7212 "configure"
+#line 7224 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 #ifdef LESSTIF_VERSION
@@ -7492,7 +7504,7 @@
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:7496: checking for Mule-related features" >&5
+echo "configure:7508: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -7517,15 +7529,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7521: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7524 "configure"
+echo "configure:7533: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7536 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7556,12 +7568,12 @@
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:7560: checking for strerror in -lintl" >&5
+echo "configure:7572: 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 7565 "configure"
+#line 7577 "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
@@ -7572,7 +7584,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:7576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7588: \"$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
@@ -7605,19 +7617,19 @@
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:7609: checking for Mule input methods" >&5
+echo "configure:7621: checking for Mule input methods" >&5
         case "$with_xim" in "" | "yes" )
     echo "checking for XIM" 1>&6
-echo "configure:7612: checking for XIM" >&5
+echo "configure:7624: checking for XIM" >&5
         if test "$have_lesstif" = "yes"; then with_xim=xlib
     else 
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:7616: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:7628: 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 7621 "configure"
+#line 7633 "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
@@ -7628,7 +7640,7 @@
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:7632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7694,15 +7706,15 @@
 
     if test "$with_xfs" = "yes" ; then
     echo "checking for XFontSet" 1>&6
-echo "configure:7698: checking for XFontSet" >&5
+echo "configure:7710: checking for XFontSet" >&5
     
 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
-echo "configure:7701: checking for XmbDrawString in -lX11" >&5
+echo "configure:7713: 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 7706 "configure"
+#line 7718 "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
@@ -7713,7 +7725,7 @@
 XmbDrawString()
 ; return 0; }
 EOF
-if { (eval echo configure:7717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7729: \"$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
@@ -7753,15 +7765,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:7757: checking for wnn/jllib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7760 "configure"
+echo "configure:7769: checking for wnn/jllib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7772 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7786,10 +7798,10 @@
     for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7790: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7793 "configure"
+echo "configure:7802: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7805 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7812,7 +7824,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7841,12 +7853,12 @@
 
     test "$ac_cv_func_crypt" != "yes" && { 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:7845: checking for crypt in -lcrypt" >&5
+echo "configure:7857: 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 7850 "configure"
+#line 7862 "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
@@ -7857,7 +7869,7 @@
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:7861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7873: \"$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
@@ -7891,12 +7903,12 @@
   fi
     test -z "$with_wnn" && { 
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:7895: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:7907: 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 7900 "configure"
+#line 7912 "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
@@ -7907,7 +7919,7 @@
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:7911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7923: \"$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
@@ -7945,12 +7957,12 @@
     if test "$with_wnn6" != "no"; then
       
 echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6
-echo "configure:7949: checking for jl_fi_dic_list in -lwnn" >&5
+echo "configure:7961: 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 7954 "configure"
+#line 7966 "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
@@ -7961,7 +7973,7 @@
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:7965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7977: \"$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
@@ -7996,15 +8008,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:8000: checking for canna/jrkanji.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8003 "configure"
+echo "configure:8012: checking for canna/jrkanji.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8015 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8031,15 +8043,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:8035: checking for canna/jrkanji.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8038 "configure"
+echo "configure:8047: checking for canna/jrkanji.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8050 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8067,15 +8079,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:8071: checking for canna/RK.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8074 "configure"
+echo "configure:8083: checking for canna/RK.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8086 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8098,12 +8110,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:8102: checking for RkBgnBun in -lRKC" >&5
+echo "configure:8114: 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 8107 "configure"
+#line 8119 "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
@@ -8114,7 +8126,7 @@
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:8118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8130: \"$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
@@ -8137,12 +8149,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:8141: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:8153: 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 8146 "configure"
+#line 8158 "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
@@ -8153,7 +8165,7 @@
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:8157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8169: \"$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
@@ -8202,12 +8214,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:8206: checking for layout_object_getvalue in -li18n" >&5
+echo "configure:8218: 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 8211 "configure"
+#line 8223 "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
@@ -8218,7 +8230,7 @@
 layout_object_getvalue()
 ; return 0; }
 EOF
-if { (eval echo configure:8222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8234: \"$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
@@ -8304,10 +8316,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:8308: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8311 "configure"
+echo "configure:8320: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8323 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8330,7 +8342,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8367,10 +8379,10 @@
     for ac_func in realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8371: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8374 "configure"
+echo "configure:8383: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8386 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8393,7 +8405,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8426,16 +8438,16 @@
 esac
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:8430: checking whether netdb declares h_errno" >&5
-cat > conftest.$ac_ext <<EOF
-#line 8432 "configure"
+echo "configure:8442: checking whether netdb declares h_errno" >&5
+cat > conftest.$ac_ext <<EOF
+#line 8444 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:8439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8451: \"$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
@@ -8455,16 +8467,16 @@
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:8459: checking for sigsetjmp" >&5
-cat > conftest.$ac_ext <<EOF
-#line 8461 "configure"
+echo "configure:8471: checking for sigsetjmp" >&5
+cat > conftest.$ac_ext <<EOF
+#line 8473 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:8468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8480: \"$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
@@ -8484,11 +8496,11 @@
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:8488: checking whether localtime caches TZ" >&5
+echo "configure:8500: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 8492 "configure"
+#line 8504 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -8523,7 +8535,7 @@
   exit (0);
 }
 EOF
-if { (eval echo configure:8527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
@@ -8552,9 +8564,9 @@
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
-echo "configure:8556: checking whether gettimeofday accepts one or two arguments" >&5
-cat > conftest.$ac_ext <<EOF
-#line 8558 "configure"
+echo "configure:8568: checking whether gettimeofday accepts one or two arguments" >&5
+cat > conftest.$ac_ext <<EOF
+#line 8570 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -8576,7 +8588,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""two" 1>&6
 else
@@ -8598,19 +8610,19 @@
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:8602: checking for inline" >&5
+echo "configure:8614: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 8607 "configure"
+#line 8619 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:8614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -8660,17 +8672,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:8664: checking for working alloca.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8667 "configure"
+echo "configure:8676: checking for working alloca.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8679 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:8674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -8694,10 +8706,10 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8698: checking for alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8701 "configure"
+echo "configure:8710: checking for alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8713 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -8720,7 +8732,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:8724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -8759,10 +8771,10 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8763: checking whether alloca needs Cray hooks" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8766 "configure"
+echo "configure:8775: checking whether alloca needs Cray hooks" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8778 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -8786,10 +8798,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:8790: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8793 "configure"
+echo "configure:8802: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8805 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8812,7 +8824,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8842,10 +8854,10 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8846: checking stack direction for C alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8849 "configure"
+echo "configure:8858: checking stack direction for C alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8861 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -8864,7 +8876,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:8868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
@@ -8892,15 +8904,15 @@
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:8896: checking for vfork.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8899 "configure"
+echo "configure:8908: checking for vfork.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8911 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8928,10 +8940,10 @@
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:8932: checking for working vfork" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8935 "configure"
+echo "configure:8944: checking for working vfork" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8947 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -9026,7 +9038,7 @@
   }
 }
 EOF
-if { (eval echo configure:9030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:9042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_vfork_works=yes
 else
@@ -9051,10 +9063,10 @@
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:9055: checking for working strcoll" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9058 "configure"
+echo "configure:9067: checking for working strcoll" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9070 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -9064,7 +9076,7 @@
 	strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:9068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:9080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
@@ -9091,10 +9103,10 @@
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9095: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9098 "configure"
+echo "configure:9107: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9110 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9117,7 +9129,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9145,10 +9157,10 @@
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:9149: checking whether getpgrp takes no argument" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9152 "configure"
+echo "configure:9161: checking whether getpgrp takes no argument" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9164 "configure"
 #include "confdefs.h"
 
 /*
@@ -9203,7 +9215,7 @@
 }
 
 EOF
-if { (eval echo configure:9207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:9219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
@@ -9229,10 +9241,10 @@
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:9233: checking for working mmap" >&5
+echo "configure:9245: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 9236 "configure"
+#line 9248 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -9265,7 +9277,7 @@
   return 1;
 }
 EOF
-if { (eval echo configure:9269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:9281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   have_mmap=yes
 else
@@ -9299,15 +9311,15 @@
 
 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:9303: checking for termios.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9306 "configure"
+echo "configure:9315: checking for termios.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9318 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9350,15 +9362,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:9354: checking for termio.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9357 "configure"
+echo "configure:9366: checking for termio.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9369 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9390,10 +9402,10 @@
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:9394: checking for socket" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9397 "configure"
+echo "configure:9406: checking for socket" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9409 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -9416,7 +9428,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -9431,15 +9443,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:9435: checking for netinet/in.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9438 "configure"
+echo "configure:9447: checking for netinet/in.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9450 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9456,15 +9468,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:9460: checking for arpa/inet.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9463 "configure"
+echo "configure:9472: checking for arpa/inet.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9475 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9489,9 +9501,9 @@
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:9493: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:9505: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 9495 "configure"
+#line 9507 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9502,7 +9514,7 @@
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:9506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9518: \"$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
@@ -9520,9 +9532,9 @@
 fi
 rm -f conftest*
       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
-echo "configure:9524: checking "for ip_mreq struct in netinet/in.h"" >&5
+echo "configure:9536: checking "for ip_mreq struct in netinet/in.h"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 9526 "configure"
+#line 9538 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9532,7 +9544,7 @@
 static struct ip_mreq x;
 ; return 0; }
 EOF
-if { (eval echo configure:9536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9548: \"$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
@@ -9563,10 +9575,10 @@
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:9567: checking for msgget" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9570 "configure"
+echo "configure:9579: checking for msgget" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9582 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -9589,7 +9601,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -9604,15 +9616,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:9608: checking for sys/ipc.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9611 "configure"
+echo "configure:9620: checking for sys/ipc.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9623 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9629,15 +9641,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:9633: checking for sys/msg.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9636 "configure"
+echo "configure:9645: checking for sys/msg.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9648 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9675,15 +9687,15 @@
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:9679: checking for dirent.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9682 "configure"
+echo "configure:9691: checking for dirent.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9694 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9710,15 +9722,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:9714: checking for sys/dir.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9717 "configure"
+echo "configure:9726: checking for sys/dir.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9729 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9751,15 +9763,15 @@
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:9755: checking for nlist.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9758 "configure"
+echo "configure:9767: checking for nlist.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9770 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9789,7 +9801,7 @@
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:9793: checking "for sound support"" >&5
+echo "configure:9805: checking "for sound support"" >&5
 case "$with_sound" in
   native | both ) with_native_sound=yes;;
   nas    | no   ) with_native_sound=no;;
@@ -9800,15 +9812,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:9804: checking for multimedia/audio_device.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9807 "configure"
+echo "configure:9816: checking for multimedia/audio_device.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9819 "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:9812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9856,12 +9868,12 @@
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:9860: checking for ALopenport in -laudio" >&5
+echo "configure:9872: 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 9865 "configure"
+#line 9877 "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
@@ -9872,7 +9884,7 @@
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:9876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9888: \"$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
@@ -9903,12 +9915,12 @@
       if test -z "$native_sound_lib"; then
 	
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:9907: checking for AOpenAudio in -lAlib" >&5
+echo "configure:9919: 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 9912 "configure"
+#line 9924 "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
@@ -9919,7 +9931,7 @@
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:9923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9935: \"$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
@@ -9957,15 +9969,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:9961: checking for ${dir}/soundcard.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9964 "configure"
+echo "configure:9973: checking for ${dir}/soundcard.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9976 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10035,7 +10047,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 10039 "configure"
+#line 10051 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -10062,7 +10074,7 @@
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:10066: checking for TTY-related features" >&5
+echo "configure:10078: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -10078,12 +10090,12 @@
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:10082: checking for tgetent in -lncurses" >&5
+echo "configure:10094: 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 10087 "configure"
+#line 10099 "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
@@ -10094,7 +10106,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10110: \"$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
@@ -10127,15 +10139,15 @@
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:10131: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10134 "configure"
+echo "configure:10143: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10146 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10157,15 +10169,15 @@
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:10161: checking for ncurses/term.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10164 "configure"
+echo "configure:10173: checking for ncurses/term.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10176 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10195,15 +10207,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:10199: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10202 "configure"
+echo "configure:10211: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10214 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10238,12 +10250,12 @@
 	for lib in curses termlib termcap; do
 	  
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:10242: checking for tgetent in -l$lib" >&5
+echo "configure:10254: 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 10247 "configure"
+#line 10259 "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
@@ -10254,7 +10266,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10270: \"$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
@@ -10285,12 +10297,12 @@
       else
 	
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:10289: checking for tgetent in -lcurses" >&5
+echo "configure:10301: 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 10294 "configure"
+#line 10306 "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
@@ -10301,7 +10313,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10317: \"$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
@@ -10319,12 +10331,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:10323: checking for tgetent in -ltermcap" >&5
+echo "configure:10335: 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 10328 "configure"
+#line 10340 "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
@@ -10335,7 +10347,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:10339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10351: \"$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
@@ -10383,15 +10395,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:10387: checking for gpm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10390 "configure"
+echo "configure:10399: checking for gpm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10402 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10414,12 +10426,12 @@
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:10418: checking for Gpm_Open in -lgpm" >&5
+echo "configure:10430: 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 10423 "configure"
+#line 10435 "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
@@ -10430,7 +10442,7 @@
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:10434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10446: \"$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
@@ -10479,22 +10491,22 @@
 
 
 echo "checking for database support" 1>&6
-echo "configure:10483: checking for database support" >&5
+echo "configure:10495: 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:10490: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10493 "configure"
+echo "configure:10502: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10505 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10526,12 +10538,12 @@
   if test "$have_ndbm_h" = "yes"; then
     
 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:10530: checking for dbm_open in -lgdbm" >&5
+echo "configure:10542: 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 10535 "configure"
+#line 10547 "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
@@ -10542,7 +10554,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10558: \"$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
@@ -10565,10 +10577,10 @@
   fi
   if test "$with_database_gnudbm" != "yes"; then
     echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:10569: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10572 "configure"
+echo "configure:10581: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10584 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -10591,7 +10603,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -10627,10 +10639,10 @@
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:10631: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10634 "configure"
+echo "configure:10643: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10646 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -10653,7 +10665,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -10674,12 +10686,12 @@
   if test "$need_libdbm" != "no"; then
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:10678: checking for dbm_open in -ldbm" >&5
+echo "configure:10690: 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 10683 "configure"
+#line 10695 "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 +10702,7 @@
 dbm_open()
 ; 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:10706: \"$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
@@ -10727,10 +10739,10 @@
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:10731: checking for dbopen" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10734 "configure"
+echo "configure:10743: checking for dbopen" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10746 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -10753,7 +10765,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -10774,12 +10786,12 @@
   if test "$need_libdb" != "no"; then
     
 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:10778: checking for dbopen in -ldb" >&5
+echo "configure:10790: 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 10783 "configure"
+#line 10795 "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
@@ -10790,7 +10802,7 @@
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:10794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10806: \"$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
@@ -10814,7 +10826,7 @@
   if test "$with_database_berkdb" = "yes"; then
     for path in "db/db.h" "db.h"; do
 cat > conftest.$ac_ext <<EOF
-#line 10818 "configure"
+#line 10830 "configure"
 #include "confdefs.h"
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
@@ -10832,7 +10844,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_path="$path"; break
 else
@@ -10883,12 +10895,12 @@
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:10887: checking for SOCKSinit in -lsocks" >&5
+echo "configure:10899: 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 10892 "configure"
+#line 10904 "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
@@ -10899,7 +10911,7 @@
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:10903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:10915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10956,15 +10968,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10960: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 10963 "configure"
+echo "configure:10972: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10975 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10995,12 +11007,12 @@
 
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:10999: checking for dlopen in -ldl" >&5
+echo "configure:11011: 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 11004 "configure"
+#line 11016 "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
@@ -11011,7 +11023,7 @@
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11027: \"$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
@@ -11040,12 +11052,12 @@
  }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for _dlopen in -lc""... $ac_c" 1>&6
-echo "configure:11044: checking for _dlopen in -lc" >&5
+echo "configure:11056: 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 11049 "configure"
+#line 11061 "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
@@ -11056,7 +11068,7 @@
 _dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11072: \"$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
@@ -11085,12 +11097,12 @@
  }
 test -z "$with_shlib" && test ! -z "$have_dlfcn" && { 
 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
-echo "configure:11089: checking for dlopen in -lc" >&5
+echo "configure:11101: 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 11094 "configure"
+#line 11106 "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
@@ -11101,7 +11113,7 @@
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:11105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11117: \"$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
@@ -11130,12 +11142,12 @@
  }
 test -z "$with_shlib" && { 
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:11134: checking for shl_load in -ldld" >&5
+echo "configure:11146: 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 11139 "configure"
+#line 11151 "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
@@ -11146,7 +11158,7 @@
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:11150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11162: \"$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
@@ -11175,12 +11187,12 @@
  }
 test -z "$with_shlib" && { 
 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
-echo "configure:11179: checking for dld_init in -ldld" >&5
+echo "configure:11191: 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 11184 "configure"
+#line 11196 "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
@@ -11191,7 +11203,7 @@
 dld_init()
 ; return 0; }
 EOF
-if { (eval echo configure:11195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11207: \"$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
@@ -11241,7 +11253,7 @@
 dll_oflags="-o "
 
 echo $ac_n "checking how to build a shared library""... $ac_c" 1>&6
-echo "configure:11245: checking how to build a shared library" >&5
+echo "configure:11257: checking how to build a shared library" >&5
 case `uname -rs` in
 	UNIX_SV*|UNIX_System_V*)
 		dll_lflags="-G"
@@ -11332,10 +11344,10 @@
   for ac_func in dlerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11336: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 11339 "configure"
+echo "configure:11348: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 11351 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -11358,7 +11370,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:11362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:11374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -11394,11 +11406,11 @@
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 11398 "configure"
+#line 11410 "configure"
 #include "confdefs.h"
 int main(int c,char *v[]){return 0;}
 EOF
-if { (eval echo configure:11402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:11414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   :
 else
--- a/configure.in	Mon Aug 13 10:35:07 2007 +0200
+++ b/configure.in	Mon Aug 13 10:35:54 2007 +0200
@@ -1735,7 +1735,10 @@
     CFLAGS="-g -O3 -Wall -Wno-switch"
     dnl I'm not convinced this is a good idea any more. -sb
     dnl test "$opsys $machine" = "linux intel386" && \
-      dnl CFLAGS="$CFLAGS -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2"
+    dnl CFLAGS="$CFLAGS -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2"
+    dnl cygwin can't cope with -O3
+    test "$opsys $machine" = "cygwin32 intel386" && \
+      CFLAGS="-g -O2 -Wall -Wno-switch"
   elif test "$__sunpro_c" = "yes"; then
     case "$opsys" in
       sol2    ) CFLAGS="-v -xO4" ;;
@@ -2420,11 +2423,13 @@
 	    && XE_ADD_OBJS(menubar-msw.o)
 	test "$with_toolbars"   != "no" && with_toolbars=msw \
 	    && XE_ADD_OBJS(toolbar-msw.o)
-	with_dialogs=msw
+	test "$with_dialogs"   != "no" && with_dialogs=msw \
+	    && XE_ADD_OBJS(dialog-msw.o)
     else
 	test "$with_scrollbars"   != "no" && XE_ADD_OBJS(scrollbar-msw.o)
 	test "$with_menubars"   != "no" && XE_ADD_OBJS(menubar-msw.o)
 	test "$with_toolbars"   != "no" && XE_ADD_OBJS(toolbar-msw.o)
+	test "$with_dialogs"   != "no" && XE_ADD_OBJS(dialog-msw.o)
     fi
     dnl check for our special version of select 	
     AC_TRY_RUN([#include <fcntl.h>
@@ -2519,25 +2524,6 @@
 fi
 AC_SUBST(libs_xauth)
 
-dnl Always compile OffiX unless --without-offix is given, no
-dnl X11 support is compiled in, no standard Xmu is avaiable,
-dnl or dragndrop support is disabled
-test "$window_system" != "x11" && with_offix=no
-if test "$with_xmu" != yes -a "$with_x11" = yes; then
-  AC_MSG_WARN([No OffiX without real Xmu support])
-  with_offix=no
-fi
-if test "$with_dragndrop" = no; then
-  AC_MSG_WARN([No OffiX without generic Drag'n'Drop support])
-  with_offix=no
-fi
-test -z "$with_offix" && with_offix=yes
-if test "$with_offix" = "yes"; then
-  AC_DEFINE(HAVE_OFFIX_DND)
-  XE_APPEND(offix.o, dnd_objs)
-  XE_APPEND(OffiX, dragndrop_proto)
-fi
-
 dnl This one is for the static initializeds variables in
 dnl offix.c, so that the thing is dumped after lastfile.o
 AC_SUBST(dnd_objs)
@@ -2592,6 +2578,29 @@
   need_motif=yes    # CDE requires Motif
 fi
 
+dnl Always compile OffiX unless --without-offix is given, no
+dnl X11 support is compiled in, no standard Xmu is avaiable,
+dnl or dragndrop support is disabled
+test "$window_system" != "x11" && with_offix=no
+if test "$with_xmu" != yes -a "$with_x11" = yes; then
+  AC_MSG_WARN([No OffiX without real Xmu support])
+  with_offix=no
+fi
+if test "$with_dragndrop" = no; then
+  AC_MSG_WARN([No OffiX without generic Drag'n'Drop support])
+  with_offix=no
+fi
+if test "$with_cde" = yes; then
+  AC_MSG_WARN([CDE already found, disabling OffiX support])
+  with_offix=no
+fi
+test -z "$with_offix" && with_offix=yes
+if test "$with_offix" = "yes"; then
+  AC_DEFINE(HAVE_OFFIX_DND)
+  XE_APPEND(offix.o, dnd_objs)
+  XE_APPEND(OffiX, dragndrop_proto)
+fi
+
 dnl Autodetect Drag'n'Drop support
 dnl always included if CDE, Offix, or MSWindows are defined
 AC_MSG_CHECKING(if drag and drop API is needed)
@@ -2693,13 +2702,13 @@
   fi
 
   dnl Autodetect GIFlib
-  AC_MSG_CHECKING(for giflib - no older than 3.1)
-  test -z "$with_gif" && { AC_CHECK_HEADER(gif_lib.h,        ,with_gif=no) }
-  test -z "$with_gif" && { AC_CHECK_LIB(gif, GetGifError,[:] ,with_gif=no) }
+  AC_MSG_CHECKING(for gifreader)
+  test -z "$with_gif" && { AC_CHECK_HEADER(gifrlib.h,        ,with_gif=no) }
+  test -z "$with_gif" && { AC_CHECK_LIB(gifreader, GetGifError,[:] ,with_gif=no) }
   test -z "$with_gif" && with_gif=yes
   if test "$with_gif" = "yes"; then
     AC_DEFINE(HAVE_GIF)
-    XE_PREPEND(-lgif, libs_x)
+    XE_PREPEND(-lgifreader, libs_x)
   fi
 
   dnl autodetect JPEG
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/check_cygwin_setup.sh	Mon Aug 13 10:35:54 2007 +0200
@@ -0,0 +1,178 @@
+#! bash
+
+yorn()
+{
+	echo -n " [y/n] "
+	read YN junk
+	if [ "$YN" = "n" ]
+	then
+		return -1;
+	else
+		return 0;
+	fi
+}
+
+echo -n "checking for cygwin..."
+
+if ! uname -v
+then
+    echo "couldn't find uname please add cygwin to your path."
+    exit -1
+fi
+
+OSversion="`uname -v | sed 's/^\(.\).*$/\1/'`"
+
+shell=`type sh | sed 's/sh is //'`
+distdir=`dirname $shell`
+
+echo "cygwin installed in $distdir"
+
+echo "checking paths ..."
+
+if [ ! -d "/bin" ]; then
+    echo "You don't have /bin would like to mount cygwin as /bin ?"
+    if yorn; then
+	mkdir /bin
+	mount -b /bin $distdir
+    fi
+elif [ "$distdir" != "/bin" ]; then
+    echo "Warning: you have /bin but it's not the cygwin installation."
+fi
+
+if [ ! -d "/tmp" ]; then
+    echo -n "You don't have /tmp - create it?"
+    if yorn; then
+	mkdir /tmp
+    fi
+else
+    echo "you have /tmp"
+fi
+
+if [ ! -d "/etc" ]; then
+    echo -n "You don't have /etc - create it?"
+    if yorn; then
+	mkdir /etc
+    fi
+else
+    echo "you have /etc"
+fi
+
+if [ -d "/etc" ]
+then
+    if [ ! -f "/etc/termcap" ]; then
+	echo -n "You don't have /etc/termcap - create it?"
+	if yorn; then
+	    if [ ! -f "$distdir/../etc/termcap" ]
+	    then
+		distdir=`mount | grep "$distdir" | sed -e "s/ .*$//"`
+		echo "Retrieving termcap from $distdir/../etc"
+	    fi
+	    if [ -f "$distdir/../etc/termcap" ]
+	    then 
+		cp "$distdir/../etc/termcap" /etc
+	    else
+		echo "Error: can't find termcap file"
+	    fi
+	fi
+    else
+	echo "you have /etc/termcap"
+    fi
+
+    if [ ! -f "/etc/passwd" ]; then
+	echo -n "You don't have /etc/passwd - create it?"
+	if yorn; then
+	    if [ "$OS" = "Windows_NT" ]
+	    then
+		echo -n "Running on NT, create domain or local password file [d/l] "
+		read DL junk
+		if [ "$DL" = "d" ]
+		then
+		    mkpasswd -d > /etc/passwd
+		else
+		    mkpasswd -l > /etc/passwd
+		fi
+	    else
+		echo "Please enter your userid e.g. andyp"
+		read userid junk
+		echo "Please enter your user name e.g. Andy Piper"
+		read username junk
+		echo "Administrator::500:513:::/bin/sh" > /etc/passwd
+		echo "$userid::1000:513:$username::/bin/sh" >> /etc/passwd
+	    fi
+	fi
+    else
+	echo "you have /etc/passwd"
+	userid=`id | sed -e "s/[^(]*(\([^)]*\)).*/\1/"`
+    fi
+
+    echo "userid is $userid"
+
+    if [ ! -f "/etc/group" ]; then
+	echo -n "You don't have /etc/group - create it?"
+	if yorn; then
+	    if [ "$OS" = "Windows_NT" ]
+	    then
+		echo -n "Running on NT, create domain or local group file [d/l] "
+		read DL junk
+		if [ "$DL" = "d" ]
+		then
+		    mkgroup -d > /etc/group
+		else
+		    mkgroup -l > /etc/group
+		fi
+	    else
+		echo "None::513:" > /etc/group
+		echo "Everyone::0:" >> /etc/group
+	    fi
+	fi
+    else
+	echo "you have /etc/group"
+    fi
+
+    if [ ! -f "/etc/hosts" ]; then
+	echo -n "You don't have /etc/hosts - create it?"
+	if yorn; then
+	    mname=`uname -n`
+	    echo "Machine name is $mname"
+	    echo -n "Please enter your ip address "
+	    read mipaddr junk
+	    echo "$mname $mipaddr" > /etc/hosts
+	    echo "localhost 127.0.0.1" >> /etc/hosts
+	fi
+    else
+	echo "you have /etc/hosts"
+    fi
+else
+    echo "Can't create /etc files because /etc does not exist"
+fi
+
+echo "checking environment ..."
+
+if [ "$HOME" = "" ]; then
+    echo -n "HOME is not set, rectify?"
+    if yorn; then
+	echo "please enter your home path [/winnt/profiles/$userid]"
+	read HOME junk
+	if [ "$HOME" = "" ]; then
+	    HOME="/winnt/profiles/$userid"
+	fi
+	echo "HOME=$HOME; export HOME" >> $HOME/.bashrc
+    fi
+else 
+    echo "HOME is $HOME"
+fi
+
+if [ "$TERM" != "ansi" -a "$TERM" != "linux" ]; then
+    echo -n "TERM is not set to linux or ansi, rectify?"
+    if yorn; then
+	echo "TERM=linux; export TERM" >> $HOME/.bashrc
+    fi
+else 
+    echo "TERM is $TERM"
+fi
+
+if echo $CYGWIN32 | grep tty; then
+    echo "CYGWIN32 is $CYGWIN32"
+else 
+    echo "CYGWIN32 does not contain \"tty\" terminal may be deficient"
+fi
--- a/etc/sounds/README	Mon Aug 13 10:35:07 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-This directory contains some mu-law encoded SunOS 4.1 sound files.  
-
-You can only play sound files if you are running on display 0 of the
-console of a machine with native sound support or running a NetAudio
-server and XEmacs has the necessary sound support compiled in.
-
-You can use these sounds to replace the default beep.  See the
-documentation of the `sound-alist' variable, and the functions
-`load-default-sounds' and `load-sound-file' from lisp/prim/sound.el.
Binary file etc/sounds/Tuxedomoon.Jingle4.au has changed
Binary file etc/sounds/bark.au has changed
Binary file etc/sounds/bass-snap.au has changed
Binary file etc/sounds/boing.au has changed
Binary file etc/sounds/bong.au has changed
Binary file etc/sounds/click.au has changed
Binary file etc/sounds/clink.au has changed
Binary file etc/sounds/cuckoo.au has changed
Binary file etc/sounds/ding.au has changed
Binary file etc/sounds/drip.au has changed
Binary file etc/sounds/drum-beep.au has changed
Binary file etc/sounds/hammer.au has changed
Binary file etc/sounds/hype.au has changed
Binary file etc/sounds/im_so_happy.au has changed
Binary file etc/sounds/long-beep.au has changed
Binary file etc/sounds/low-smash.au has changed
Binary file etc/sounds/mellowbweep.au has changed
Binary file etc/sounds/monkey.au has changed
Binary file etc/sounds/piano-beep.au has changed
Binary file etc/sounds/quiet-beep.au has changed
Binary file etc/sounds/return.au has changed
Binary file etc/sounds/say-beep.au has changed
Binary file etc/sounds/slap.au has changed
Binary file etc/sounds/the-ping.au has changed
Binary file etc/sounds/whip.au has changed
Binary file etc/sounds/yeep.au has changed
--- a/lib-src/ChangeLog	Mon Aug 13 10:35:07 2007 +0200
+++ b/lib-src/ChangeLog	Mon Aug 13 10:35:54 2007 +0200
@@ -1,3 +1,19 @@
+1998-05-31  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* wakeup.c (sleep): Added NT preprocessor quirkfest.
+	(main): Exit when fflush() fails on stdout.
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* getopt.c: Undefine getpid before redefinition.
+
+	* make-docfile.c: Added <io.h> when compiling on NT
+
+	* movemail.c: Ditto.
+	(main): Declare some auto variables only when DISABLE_DIRECT_ACCESS
+	is undefined, so they are actually used, to supress compilation
+	warnings.
+
 1998-05-16  SL Baur  <steve@altair.xemacs.org>
 
 	* etags.c (C_entries): Avoid short circuiting comparisons on
--- a/lib-src/getopt.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/lib-src/getopt.c	Mon Aug 13 10:35:54 2007 +0200
@@ -76,6 +76,7 @@
 #if defined (WIN32) && !defined (__CYGWIN32__)
 /* It's not Unix, really.  See?  Capital letters.  */
 #include <windows.h>
+#undef getpid
 #define getpid() GetCurrentProcessId()
 #endif
 
--- a/lib-src/make-docfile.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/lib-src/make-docfile.c	Mon Aug 13 10:35:54 2007 +0200
@@ -56,9 +56,10 @@
 #include <fcntl.h>
 #endif /* MSDOS */
 #ifdef WINDOWSNT
-#include <stdlib.h>
+#include <direct.h>
 #include <fcntl.h>
-#include <direct.h>
+#include <io.h>
+#include <stdlib.h>
 #endif /* WINDOWSNT */
 
 #if defined(DOS_NT) || defined(__CYGWIN32__)
--- a/lib-src/movemail.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/lib-src/movemail.c	Mon Aug 13 10:35:54 2007 +0200
@@ -95,6 +95,7 @@
    client or something other than Samba, the locking call might work
    properly - make sure it does before you enable this! */
 #define DISABLE_DIRECT_ACCESS
+#include <io.h>
 #endif /* WINDOWSNT */
 
 #if defined (HAVE_UNISTD_H) || defined (USG)
@@ -154,9 +155,11 @@
 main (int argc, char *argv[])
 {
   char *inname, *outname;
+#ifndef DISABLE_DIRECT_ACCESS
   int indesc, outdesc;
   int nread;
   int status;
+#endif
 
 #ifndef MAIL_USE_SYSTEM_LOCK
   struct stat st;
--- a/lib-src/wakeup.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/lib-src/wakeup.c	Mon Aug 13 10:35:54 2007 +0200
@@ -10,6 +10,15 @@
 #include <stdio.h>
 #include <sys/types.h>
 
+#ifdef WINDOWSNT
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef sleep
+#define sleep(t) Sleep ((t) * 1000)
+#define getppid() (0)
+#undef HAVE_SYS_TIME_H
+#endif /* WINDOWSNT */
+
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
 #include <time.h>
@@ -35,7 +44,9 @@
       if (getppid () == 1)
 	return 0;
       printf ("Wake up!\n");
-      fflush (stdout);
+      /* If fflush fails, then our stdout pipe is broken. */
+      if (fflush (stdout) != 0)
+	return 0;
       /* If using a period of 60, produce the output when the minute
 	 changes. */
       if (period == 60)
--- a/lisp/ChangeLog	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/ChangeLog	Mon Aug 13 10:35:54 2007 +0200
@@ -1,3 +1,119 @@
+1998-06-01  SL Baur  <steve@altair.xemacs.org>
+
+	* sound.el (default-sound-directory): Use `locate-data-directory'
+	to find the sounds directory.
+
+1998-05-29  Andy Piper  <andyp@parallax.co.uk>
+
+	* sound.el: default sound-ext to .wav under mswindows, .au
+	otherwise. load-default sounds without extensions.
+
+1998-05-27  Bjrn Torkelsson  <torkel@hpc2n.umu.se>
+
+	* menubar-items.el (default-menubar): Dim out "Submit Bug Report"
+	if send-pr is not bound.
+
+1998-06-01  Andy Piper  <andyp@parallax.co.uk>
+
+	* files.el: grok idl files in auto-mode-alist.
+1998-06-01  Jeff Miller  <jmiller@smart.net>
+
+	* minibuf.el (exact-minibuffer-completion-p): check for nil before
+	calling `upcase'.
+
+1998-05-30  Andy Piper  <andyp@parallax.co.uk>
+
+	* msw-glyphs.el: add xbm to the list of image types supported.
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* msw-init.el (init-post-mswindows-win): Load InfoDock toolbar
+	instead of XEmacs one when dumping InfoDock.
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* obsolete.el (has-modeline-p): Added obsolete alias `has-modeline-p'
+ 	for `modeline-visible-p'
+
+	* winnt.el (nt-quote-process-args): Fix for duplicating argv[0].
+
+1998-05-29  Andy Piper  <andyp@parallax.co.uk>
+
+	* msw-select.el (mswindows-cut-copy-clear-clipboard): deleted
+	since it's not used anymore. doc string fixes.
+
+	* package-get.el (package-get-file-installed-p): new function. use
+	instead of file-installed-p which is in an external package.
+
+1998-05-28  Oliver Graf <ograf@fga.de>
+
+	* dragdrop.el (dragdrop-drop-url-default): dropped pop-to-buffer in
+	favor of select-window/switch-to-buffer
+
+Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
+
+	* startup.el: changed (getenv "HOME") to (user-home-directory)
+
+1998-05-25  Oliver Graf <ograf@fga.de>
+
+	* frame.el (cde-start-drag) moved to dragdrop.el
+	(offix-start-drag-region) moved to dragdrop.el
+	(offix-start-drag) moved to dragdrop.el
+	* dragdrop.el (cde-start-drag) moved from frame.el
+	(offix-start-drag-region) moved from frame.el
+	(offix-start-drag) moved from frame.el
+	(cde-start-drag-region) cde drag regions
+	* mouse.el (mouse-drag-or-yank) will now call cde-start-drag-region
+
+1998-05-26  Oliver Graf <ograf@fga.de>
+
+	* dragdrop.el: created dragdrop-drag prototypes
+	(cde-start-drag-region) fixed typo
+
+1998-05-28  SL Baur  <steve@altair.xemacs.org>
+
+	* simple.el (after-init-hook): Remove reader macro.
+
+	* packages.el (packages-hardcoded-lisp): Get rid of reader
+	macros.  Update DOC string.
+
+1998-05-25  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* mouse.el (drag-window-divider): Ditto.
+
+	* modeline.el (mouse-drag-modeline): Use it.
+
+	* lisp-mode.el (let-specifier): Specify indentation.
+
+	* specifier.el (let-specifier): Renamed from
+	`with-specifier-instance'.
+
+1998-05-27  Andy Piper  <andyp@parallax.co.uk>
+
+	* x-faces.el:
+	* faces.el: move definition of xpm-color-symbols from x-faces.el
+	to faces. Predicate x-get-resource on the presence of x.
+
+	* msw-faces.el: set 3d-object face rather than modeline. Specifiy
+	faces as specfier defaults.
+
+	* package-get.el: don't use package-admin-add-single-file-package.
+
+1998-05-25  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* toolbar-items.el: Fixup tooltips.
+	(toolbar-gnus): Don't use obsolete variable
+	toolbar-news-frame-properties.
+	(toolbar-news-reader): Default to `gnus' instead of
+	`not-configured'.
+
+	* files.el (auto-mode-alist): Correctly recognize `.emacs' under
+	Windows.
+
+1998-05-25  Andy Piper  <andyp@parallax.co.uk>
+
+	* package-get.el: rename -installedp -> -installed-p.
+
 1998-05-23  Kirill M. Katsnelson  <kkm@kis.ru>
 
 	* glyphs.el (init-glyphs): Created `border-glyph' face, with no
@@ -89,6 +205,12 @@
 
 1998-05-18  Kirill M. Katsnelson  <kkm@kis.ru>
 
+	* winnt.el: Removed evil (setq completion-ignore-case t)
+	clause, one more overlookef fsfism.
+	(nt-quote-args-functions-alist): End sentences with double space.
+
+1998-05-18  Kirill M. Katsnelson  <kkm@kis.ru>
+
 	* window-xemacs.el (push-window-configuration): Remove kludgery of
 	recaching default-toolbar specifier.
 	(pop-window-configuration): Ditto.
@@ -248,7 +370,7 @@
 	* keymap.el (kbd): Define here; handle string constants and
 	others...
 
-1998-05-15  Christian Nybø <chr@mediascience.no>
+1998-05-15  Christian Nyb <chr@mediascience.no>
 
 	* simple.el (zap-up-to-char): New function.  Behaves like `zap-to-char'
 	in Emacs 18.
--- a/lisp/dragdrop.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/dragdrop.el	Mon Aug 13 10:35:54 2007 +0200
@@ -37,7 +37,7 @@
 ;; I think this is a better name for the custom group
 ;; looks better in the menu and the group display as dragdrop
 ;; Anyway: is dragdrop- a good prefix for all this?
-;; What if someone type drop<TAB> into the minibuffer?
+;; What if someone trys drop<TAB> in the minibuffer?
 (defgroup drag-n-drop nil
   "Window system-independent drag'n'drop support."
   :group 'editing)
@@ -83,11 +83,6 @@
 		  (sexp :tag "Arg" :value nil)))
   :value '(nil t t))
 
-;; button and widget selectors are still "shaky":
-;; button may be a number or t (or nil?), t means "Ignore"
-;; mods may be t or nil or a list of mod-syms, t means "Ignore"
-;; but this seems to be a porblem for the widget, well perhaps I find
-;; a solution...
 (defcustom dragdrop-drop-functions '((dragdrop-drop-url-default t t)
 				     (dragdrop-drop-mime-default t t))
   "This is the standart drop function search list.
@@ -119,6 +114,9 @@
 (defvar dragdrop-drop-log-buffer nil
   "Buffer to log drops in debug mode.")
 
+;;
+;; Drop API
+;;
 (defun dragdrop-drop-dispatch (object)
   "This function identifies DROP type misc-user-events.
 It calls functions which will handle the drag."
@@ -231,14 +229,16 @@
   (cond ((eq (car object) 'dragdrop-URL)
 	 (let ((data (cdr object))
 	       (frame (event-channel event))
-	       (x pop-up-windows))
+	       (x pop-up-windows)
+	       (window (event-window event)))
 	   (setq pop-up-windows nil)
 	   (while (not (eq data ()))
 	     (cond ((dragdrop-is-some-url "file" (car data))
 		    ;; if it is some file, pop it to a buffer
-		    (pop-to-buffer (find-file-noselect
-				    (substring (car data) 5))
-				   nil frame))
+		    (cond (window
+			   (select-window window)))
+		    (switch-to-buffer (find-file-noselect
+				       (substring (car data) 5))))
 		   ;; to-do: open ftp URLs with efs...
 		   (t 
 		    ;; some other URL, try to fire up some browser for it
@@ -339,4 +339,84 @@
 	 (string= method (substring url 0 (length method))))
 	(t nil)))
 
+;;
+;; Drag API
+;;
+(defun dragdrop-drag (event object)
+  "The generic drag function.
+Tries to do the best with object in the selected protocol.
+Object must comply to the standart drag'n'drop object 
+format."
+  (error "Not implemented"))
+
+(defun dragdrop-drag-region (event begin end)
+  "Drag a region.
+This function uses special data types if the low-level
+protocol requires it. It does so by calling
+dragdrop-drag-pure-text."
+  (dragdrop-drag-pure-text event
+			   (buffer-substring-no-properties begin end)))
+
+(defun dragdrop-drag-pure-text (event text)
+  "Drag text-only data.
+Takes care of special low-level protocol data types.
+Text must be a list of strings."
+  (error "Not implemented"))
+
+(defun dragdrop-drag-pure-file (event file)
+  "Drag filepath-only data.
+Takes care of special low-level protocol data types.
+file must be a list of strings."
+  (error "Not implemented"))
+
+;;
+;; The following ones come from frame.el but the better belong here
+;; until changed
+;;
+(defun cde-start-drag (event type data)
+  "Implement the CDE drag operation.
+Calls the internal function cde-start-drag-internal to do the actual work."
+  (interactive "_eXX")
+  (if (featurep 'cde)
+      ;; Avoid build-time doc string warning by calling the function
+      ;; in the following roundabout way:
+      (funcall (intern "cde-start-drag-internal")
+	       event type data)
+    (error "CDE functionality not compiled in.")))
+
+(defun cde-start-drag-region (event begin end)
+  "Implement the CDE drag operation for a region.
+Calls the internal function CDE-start-drag-internal to do the actual work.
+This always does buffer transfers."
+  ;; Oliver Graf <ograf@fga.de>
+  (interactive "_er")
+  (if (featurep 'cde)
+      (funcall (intern "cde-start-drag-internal")
+	       event nil (list (buffer-substring-no-properties begin end)))
+    (error "CDE functionality not compiled in.")))
+
+;; the OffiX drag stuff will soon move also (perhaps mouse.el)
+;; if the drag event is done
+(defun offix-start-drag (event data &optional type)
+  "Implement the OffiX drag operation.
+Calls the internal function offix-start-drag-internal to do the actual work.
+If type is not given, DndText is assumed."
+  ;; Oliver Graf <ograf@fga.de>
+  (interactive "esi")
+  (if (featurep 'offix)
+      (funcall (intern "offix-start-drag-internal") event data type)
+    (error "OffiX functionality not compiled in.")))
+
+(defun offix-start-drag-region (event begin end)
+  "Implement the OffiX drag operation for a region.
+Calls the internal function offix-start-drag-internal to do the actual work.
+This always assumes DndText as type."
+  ;; Oliver Graf <ograf@fga.de>
+  (interactive "_er")
+  (if (featurep 'offix)
+      (funcall (intern "offix-start-drag-internal")
+	       event (buffer-substring-no-properties begin end))
+    (error "OffiX functionality not compiled in.")))
+
+
 ;;; dragdrop.el ends here
--- a/lisp/faces.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/faces.el	Mon Aug 13 10:35:54 2007 +0200
@@ -1661,6 +1661,32 @@
 		       ((mswindows default color) . "green"))
 		     'global)
 
+;; Define some logical color names to be used when reading the pixmap files.
+(if (featurep 'xpm)
+    (setq xpm-color-symbols
+	  (list
+	   (purecopy '("foreground" (face-foreground 'default)))
+	   (purecopy '("background" (face-background 'default)))
+	   (purecopy '("backgroundToolBarColor"
+		       (or
+			(and 
+			 (featurep 'x)
+			 (or 
+			  (x-get-resource "backgroundToolBarColor"
+					  "BackgroundToolBarColor" 'string)
+			  (x-get-resource "background" "Background" 'string)))
+			"Gray80")))
+	   (purecopy '("foregroundToolBarColor"
+		       (or
+			(and 
+			 (featurep 'x)
+			 (or
+			  (x-get-resource "foregroundToolBarColor"
+					  "ForegroundToolBarColor" 'string)
+			  (x-get-resource "foreground" "Foreground" 'string)))
+			"Black")))
+	   )))
+
 (when (featurep 'tty)
   (set-face-highlight-p 'bold                    t 'global '(default tty))
   (set-face-underline-p 'italic                  t 'global '(default tty))
--- a/lisp/files.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/files.el	Mon Aug 13 10:35:54 2007 +0200
@@ -1139,6 +1139,7 @@
     ("\\.\\([CH]\\|cc\\|hh\\)\\'" . c++-mode)
     ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode)
     ("\\.java\\'" . java-mode)
+    ("\\.idl\\'" . idl-mode)
     ("\\.f\\(or\\)?\\'" . fortran-mode)
     ("\\.F\\(OR\\)?\\'" . fortran-mode)
     ("\\.[fF]90\\'" . f90-mode)
@@ -1160,6 +1161,7 @@
     ("\\.m\\([mes]\\|an\\)\\'" . nroff-mode)
     ("\\.icn\\'" . icon-mode)
     ("\\.\\([ckz]?sh\\|shar\\)\\'" . sh-mode)
+    ;; #### Unix-specific!
     ("/\\.\\(bash_\\|z\\)?\\(profile\\|login\||logout\\)\\'" . sh-mode)
     ("/\\.\\([ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode)
     ("/\\.\\([kz]shenv\\|xsession\\)\\'" . sh-mode)
@@ -1178,9 +1180,9 @@
     ("\\.prolog\\'" . prolog-mode)
     ("\\.tar\\'" . tar-mode)
     ("\\.\\(arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode)
-    ;; Mailer puts message to be edited in
-    ;; /tmp/Re.... or Message
-    ("^/tmp/Re" . text-mode)
+    ;; Mailer puts message to be edited in /tmp/Re.... or Message
+    ;; #### Unix-specific!
+    ("\\`/tmp/Re" . text-mode)
     ("/Message[0-9]*\\'" . text-mode)
     ("/drafts/[0-9]+\\'" . mh-letter-mode)
     ;; some news reader is reported to use this
@@ -1193,18 +1195,16 @@
     ("\\.htm?l?3\\'" . html3-mode)
     ("\\.\\(sgml?\\|dtd\\)\\'" . sgml-mode)
     ("\\.c?ps\\'" . postscript-mode)
-    ;; .emacs following a directory delimiter
-    ;; in either Unix or VMS syntax.
-    ("[]>:/]\\..*emacs\\'" . emacs-lisp-mode)
-    ;; _emacs following a directory delimiter
-    ;; in MsDos syntax
-    ("[:/]_emacs\\'" . emacs-lisp-mode)
+    ;; .emacs following a directory delimiter in either Unix or
+    ;; Windows syntax.
+    ("[/\\][._].*emacs\\'" . emacs-lisp-mode)
     ("\\.m4\\'" . autoconf-mode)
     ("configure\\.in\\'" . autoconf-mode)
     ("\\.ml\\'" . lisp-mode)
     ("\\.ma?k\\'" . makefile-mode)
     ("[Mm]akefile\\(\\.\\|\\'\\)" . makefile-mode)
     ("\\.X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-mode)
+    ;; #### The following three are Unix-specific (but do we care?)
     ("/app-defaults/" . xrdb-mode)
     ("\\.[^/]*wm\\'" . winmgr-mode)
     ("\\.[^/]*wm2?rc" . winmgr-mode)
--- a/lisp/frame.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/frame.el	Mon Aug 13 10:35:54 2007 +0200
@@ -835,41 +835,6 @@
 (or deselect-frame-hook
     (add-hook 'deselect-frame-hook 'default-deselect-frame-hook))
 
-(defun cde-start-drag (begin end)
-  "Implement the CDE drag operation.
-Calls the internal function cde-start-drag-internal to do the actual work."
-  (interactive "_r")
-  (if (featurep 'cde)
-      ;; Avoid build-time doc string warning by calling the function
-      ;; in the following roundabout way:
-      (funcall (intern "cde-start-drag-internal")
-	       (buffer-substring-no-properties begin end))
-    (error "CDE functionality not compiled in.")))
-
-;; the OffiX drag stuff will soon move also (perhaps mouse.el)
-;; if the drag event is done
-(defun offix-start-drag (event data &optional type)
-  "Implement the OffiX drag operation.
-Calls the internal function offix-start-drag-internal to do the actual work.
-If type is not given, DndText is assumed."
-  ;; Oliver Graf <ograf@fga.de>
-  (interactive "esi")
-  (if (featurep 'offix)
-      (funcall (intern "offix-start-drag-internal") event data type)
-    (error "OffiX functionality not compiled in.")))
-
-(defun offix-start-drag-region (event begin end)
-  "Implement the OffiX drag operation for a region.
-Calls the internal function offix-start-drag-internal to do the actual work.
-This always assumes DndText as type."
-  ;; Oliver Graf <ograf@fga.de>
-  (interactive "_er")
-  (if (featurep 'offix)
-      (funcall (intern "offix-start-drag-internal")
-	       event (buffer-substring-no-properties begin end))
-    (error "OffiX functionality not compiled in.")))
-
-
 
 ;;; Application-specific frame-management
 
--- a/lisp/lisp-mode.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/lisp-mode.el	Mon Aug 13 10:35:54 2007 +0200
@@ -753,11 +753,11 @@
 (put 'save-selected-window 'lisp-indent-function 0)
 (put 'save-selected-frame 'lisp-indent-function 0)
 (put 'with-selected-frame 'lisp-indent-function 1)
-(put 'with-specifier-instance 'lisp-indent-function 3)
 (put 'save-restriction 'lisp-indent-function 0)
 (put 'save-match-data 'lisp-indent-function 0)
 (put 'let 'lisp-indent-function 1)
 (put 'let* 'lisp-indent-function 1)
+(put 'let-specifier 'lisp-indent-function 1)
 (put 'while 'lisp-indent-function 1)
 (put 'if 'lisp-indent-function 2)
 (put 'catch 'lisp-indent-function 1)
--- a/lisp/menubar-items.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/menubar-items.el	Mon Aug 13 10:35:54 2007 +0200
@@ -926,7 +926,8 @@
        ["No Warranty" describe-no-warranty]
        ["XEmacs License" describe-copying]
        ["The Latest Version" describe-distribution])
-      ["Submit Bug Report" send-pr]))))
+      ["Submit Bug Report" send-pr
+       :active (fboundp 'send-pr)]))))
 
 
 (defun maybe-add-init-button ()
--- a/lisp/minibuf.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/minibuf.el	Mon Aug 13 10:35:54 2007 +0200
@@ -650,7 +650,7 @@
                  (setq tem (car (car tail)))
                  (if (or (equal tem buffer-string)
                          (equal tem s)
-                         (equal (upcase tem) s))
+                        (if tem (equal (upcase tem) s)))
                      (setq s 'win
                            tail nil)    ;exit
                      (setq tail (cdr tail))))
--- a/lisp/modeline.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/modeline.el	Mon Aug 13 10:35:54 2007 +0200
@@ -65,9 +65,10 @@
   (or (event-over-modeline-p event)
       (error "not over a modeline"))
   ;; Give the modeline a "pressed" look.  --hniksic
-  (with-specifier-instance modeline-shadow-thickness
-      (- (specifier-instance modeline-shadow-thickness (event-window event)))
-      (event-window event)
+  (let-specifier ((modeline-shadow-thickness
+		   (- (specifier-instance modeline-shadow-thickness
+					  (event-window event)))
+		   (event-window event)))
     (let ((done nil)
 	  (depress-line (event-y event))
 	  (start-event-frame (event-frame event))
--- a/lisp/mouse.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/mouse.el	Mon Aug 13 10:35:54 2007 +0200
@@ -190,9 +190,9 @@
 				      (extent-end-position zmacs-region-extent)))
 	    ((featurep 'cde)
 	     ;; should also work with CDE
-	     (cde-start-drag
-	      (extent-start-position zmacs-region-extent)
-	      (extent-end-position zmacs-region-extent)))
+	     (cde-start-drag-region event
+				    (extent-start-position zmacs-region-extent)
+				    (extent-end-position zmacs-region-extent)))
 	    (t (error "No offix or CDE support compiled in")))
     ;; no drag, call region-funct
     (and (not mouse-yank-at-point)
@@ -1417,11 +1417,10 @@
   (if (not (specifier-instance vertical-divider-draggable-p
 			       (event-window event)))
       (error "Not over a window!"))
-  (with-specifier-instance
-      vertical-divider-shadow-thickness
-      (- (specifier-instance vertical-divider-shadow-thickness
-			     (event-window event)))
-      (event-window event)
+  (let-specifier ((vertical-divider-shadow-thickness
+		   (- (specifier-instance vertical-divider-shadow-thickness
+					  (event-window event)))
+		   (event-window event)))
     (let* ((window (event-window event))
 	   (frame (event-channel event))
 	   (last-timestamp (event-timestamp event))
@@ -1501,8 +1500,7 @@
 					      (setq new-right-ok new)))))
 				    (window-list) old-edges-all-windows)
 			   all-that-bad))
-		     (set-window-configuration backup-conf))))
-	  )))))
+		     (set-window-configuration backup-conf)))))))))
 
 (setq vertical-divider-map (make-keymap))
 (define-key vertical-divider-map 'button1 'drag-window-divider)
--- a/lisp/msw-faces.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/msw-faces.el	Mon Aug 13 10:35:54 2007 +0200
@@ -32,15 +32,13 @@
 ;;; ensure that the default face has some reasonable fallbacks if nothing
 ;;; else is specified.
 (defun mswindows-init-device-faces (device)
-  (or (face-font 'default 'global)
-      (set-face-font 'default "Courier New:Regular:10")
-      'global)
-  (or (face-foreground 'default 'global)
-      (set-face-foreground 'default "black" 'global 'mswindows))
-  (or (face-background 'default 'global)
-      (set-face-background 'default "white" 'global 'mswindows))
-  (or (face-background 'modeline 'global)
-      (set-face-background 'modeline "grey75" 'global 'mswindows))
+  (set-face-font 'default 
+		 '((mswindows default) . "Courier New:Regular:10") 'global)
+  ;; 3d objects
+  (set-face-foreground '3d-object '((mswindows default) . "Black") 'global)
+  (set-face-background '3d-object '((mswindows default) . "Gray75") 'global)
+  (set-face-foreground 'default '((mswindows default) . "black") 'global)
+  (set-face-background 'default '((mswindows default) . "white") 'global)
   )
 
 
--- a/lisp/msw-glyphs.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/msw-glyphs.el	Mon Aug 13 10:35:54 2007 +0200
@@ -42,6 +42,7 @@
    `(("\\.bmp\\'" [bmp :file nil] 2)
      ("\\`BM" [bmp :data nil] 2)
      ,@(if (featurep 'xpm) '(("\\.xpm\\'" [xpm :file nil] 2)))
+     ("\\.xbm\\'" [xbm :file nil] 2)
      ,@(if (featurep 'xpm) '(("\\`/\\* XPM \\*/" [xpm :data nil] 2)))
      ,@(if (featurep 'gif) '(("\\.gif\\'" [gif :file nil] 2)
 			     ("\\`GIF8[79]" [gif :data nil] 2)))
--- a/lisp/msw-init.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/msw-init.el	Mon Aug 13 10:35:54 2007 +0200
@@ -43,11 +43,10 @@
 (defun init-post-mswindows-win (console)
   "Initialize mswindows GUI at startup (post).  Don't call this."
   (unless mswindows-post-win-initted
-    ;; We can't load this until after the initial device is created
-    ;; because the icon initialization needs to access the display to get
-    ;; any toolbar-related color resources.
-    (if (and (featurep 'xpm) (featurep 'toolbar))
-        (init-x-toolbar))
+    (if (featurep 'toolbar)
+	(if (featurep 'infodock)
+	    (require 'id-x-toolbar)
+	  (init-x-toolbar)))
     (add-hook 'zmacs-deactivate-region-hook
 	      (lambda ()
 		(if (console-on-window-system-p)
--- a/lisp/msw-select.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/msw-select.el	Mon Aug 13 10:35:54 2007 +0200
@@ -53,37 +53,12 @@
   "Paste the given string to the mswindows clipboard."
   (mswindows-set-clipboard string))
 
-(defun mswindows-cut-copy-clear-clipboard (mode)
-  "Don't use this function.
-Use mswindows-cut-clipboard, mswindows-copy-clipboard or
-mswindows-clear-clipboard instead."
-  (or (memq mode '(cut copy clear)) (error "unkown mode %S" mode))
-  (setq last-command nil)
-  (let ((s (mark-marker)) (e (point-marker)))
-    (if s
-	(progn
-	  (if mouse-track-rectangle-p
-	      (progn
-		(setq killed-rectangle (extract-rectangle s e))
-		(kill-new (mapconcat 'identity killed-rectangle "\n")))
-	    (copy-region-as-kill s e))
-	  (if (memq mode '(cut copy))	  
-	      (mswindows-set-clipboard (car kill-ring)))
-	  (if (memq mode '(cut clear))
-	      (if mouse-track-rectangle-p
-		  (delete-rectangle s e)
-		(delete-region s e))
-;; mswindows apps normally leave the selection active but that feels weird here
-;;	    (setq zmacs-region-stays t)
-	    ))
-      (error "there is no selection to cut or copy"))))
-
 (defvar mswindows-selection-owned-p nil
   "Whether we have a selection or not. 
 MS-Windows has no concept of ownership; don't use this.")
 
 (defun mswindows-own-selection (data &optional type)
-  "Make an MS Windows selection of type TYPE and value DATA.
+  "Make an MS-Windows selection of type TYPE and value DATA.
 The argument TYPE is ignored, and DATA specifies the contents.  
 DATA may be a string,
 a symbol, an integer (or a cons of two integers or list of two integers).
--- a/lisp/package-get-base.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/package-get-base.el	Mon Aug 13 10:35:54 2007 +0200
@@ -1,38 +1,38 @@
 (setq package-get-base
 '((eudc
   (standards-version 1.0
-   version "1.06"
-   author-version "1.06"
-   date "1998-05-03"
-   build-date "1998-05-04"
+   version "1.07"
+   author-version "1.07"
+   date "1998-05-21"
+   build-date "1998-05-27"
    maintainer "Oscar Figueiredo <Oscar.Figueiredo@epfl.ch>"
    distribution stable
    priority low
    category "comm"
    dump nil
-   description "Emacs Unified Directory Client."
-   filename "eudc-1.06-pkg.tar.gz"
-   md5sum "aff14f51353f6ad31f28f10104bb4996"
-   size 40382
+   description "Emacs Unified Directory Client (LDAP, PH)."
+   filename "eudc-1.07-pkg.tar.gz"
+   md5sum "53131f9b5b7ae01038e579b4b55dc844"
+   size 40751
    provides (eudc eudc-ldap eudc-ph)
    requires (fsf-compat xemacs-base)
    type regular
 ))
 (footnote
   (standards-version 1.0
-   version "1.02"
-   author-version "0.18"
-   date "1998-01-24"
-   build-date "1998-04-04"
+   version "1.03"
+   author-version "0.18x"
+   date "1998-06-01"
+   build-date "1998-06-01"
    maintainer "SL Baur <steve@xemacs.org>"
    distribution stable
    priority low
    category "comm"
    dump nil
    description "Footnoting in mail message editing modes."
-   filename "footnote-1.02-pkg.tar.gz"
-   md5sum "145e79418bac020596e7bc66654aab4f"
-   size 18065
+   filename "footnote-1.03-pkg.tar.gz"
+   md5sum "bea3aa23b37988f690fa56ba8cc11e92"
+   size 18199
    provides (footnote)
    requires (mail-lib xemacs-base)
    type regular
@@ -58,19 +58,19 @@
 ))
 (gnus
   (standards-version 1.0
-   version "1.15"
-   author-version "5.6.9"
-   date "1998-04-06"
-   build-date "1998-05-02"
+   version "1.16"
+   author-version "5.6.10"
+   date "1998-06-01"
+   build-date "1998-06-01"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
    category "comm"
    dump nil
    description "The Gnus Newsreader and Mailreader."
-   filename "gnus-1.15-pkg.tar.gz"
-   md5sum "fd8b38887e680fd04748e6eaf490628e"
-   size 1657321
+   filename "gnus-1.16-pkg.tar.gz"
+   md5sum "e78088ca22f5566ba7d9b7075ed70cff"
+   size 1658207
    provides (gnus message)
    requires (gnus w3 mh-e mailcrypt rmail mail-lib xemacs-base)
    type regular
@@ -115,42 +115,23 @@
 ))
 (net-utils
   (standards-version 1.0
-   version "1.05"
-   author-version "21.0b36"
-   date "1998-04-05"
-   build-date "1998-04-17"
+   version "1.06"
+   author-version "21.0b42"
+   date "1998-05-18"
+   build-date "1998-06-01"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "comm"
    dump nil
    description "Miscellaneous Networking Utilities."
-   filename "net-utils-1.05-pkg.tar.gz"
-   md5sum "8a4368d99ccdc3ccc468dcd557cf8f54"
-   size 82006
+   filename "net-utils-1.06-pkg.tar.gz"
+   md5sum "fe144ff7f6ef3582ed7dd9bd64d316c2"
+   size 83496
    provides (ilisp-browse-cltl2 emacsbug feedmail metamail net-utils rcompile shadowfile webjump webster-www)
    requires (w3 efs mail-lib xemacs-base)
    type single
 ))
-(ph
-  (standards-version 1.0
-   version "1.02"
-   author-version "2.6"
-   date "1998-01-24"
-   build-date "1998-04-04"
-   maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
-   distribution stable
-   priority low
-   category "comm"
-   dump nil
-   description "LDAP support."
-   filename "ph-1.02-pkg.tar.gz"
-   md5sum "83a6feef756065a093450fa000d2724a"
-   size 27567
-   provides (ph)
-   requires (xemacs-base)
-   type regular
-))
 (rmail
   (standards-version 1.0
    version "1.02"
@@ -267,19 +248,19 @@
 ))
 (games
   (standards-version 1.0
-   version "1.03"
-   author-version "1.0"
+   version "1.04"
+   author-version "1.02"
    date "1998-04-07"
-   build-date "1998-04-17"
+   build-date "1998-06-01"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "games"
    dump nil
    description "Tetris, Sokoban, and Snake."
-   filename "games-1.03-pkg.tar.gz"
-   md5sum "5fe869c517652083641cbdcae80defa2"
-   size 29340
+   filename "games-1.04-pkg.tar.gz"
+   md5sum "05d820825de83a3b717cca756a12fd8c"
+   size 31208
    provides (gamegrid snake tetris sokoban)
    requires (xemacs-base)
    type regular
@@ -438,19 +419,19 @@
 ))
 (mail-lib
   (standards-version 1.0
-   version "1.14"
-   author-version "21.0b40"
-   date "1998-05-10"
-   build-date "1998-05-15"
+   version "1.15"
+   author-version "21.0b42"
+   date "1998-06-01"
+   build-date "1998-06-01"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority medium
    category "libs"
    dump nil
    description "Fundamental lisp files for providing email support."
-   filename "mail-lib-1.14-pkg.tar.gz"
-   md5sum "929ca9e3b14577139704a67bb019c996"
-   size 120134
+   filename "mail-lib-1.15-pkg.tar.gz"
+   md5sum "15eab095de71085ea3dbd0c05cac7494"
+   size 120187
    provides (browse-url highlight-headers mail-abbrevs mail-extr mail-utils reporter rfc822 rmail-mini rmailout sendmail smtpmail)
    requires (xemacs-base)
    type regular
@@ -514,19 +495,19 @@
 ))
 (edict
   (standards-version 1.0
-   version "1.01"
-   author-version "0.9.7"
-   date "1998-03-13"
-   build-date "1998-05-06"
+   version "1.02"
+   author-version "0.9.8"
+   date "1998-06-01"
+   build-date "1998-06-01"
    maintainer "Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>"
    distribution mule
    priority high
    category "mule"
    dump t
    description "Lisp Interface to EDICT, Kanji Dictionary"
-   filename "edict-1.01-pkg.tar.gz"
-   md5sum "45881df2e316f5fb38bed46f46c9992e"
-   size 144862
+   filename "edict-1.02-pkg.tar.gz"
+   md5sum "0169ee34db577ac5555765b90f09ac4c"
+   size 94768
    provides ()
    requires (mule-base xemacs-base)
    type regular
@@ -666,19 +647,19 @@
 ))
 (edit-utils
   (standards-version 1.0
-   version "1.22"
-   author-version "21.0b40"
-   date "1998-05-12"
-   build-date "1998-05-15"
+   version "1.23"
+   author-version "21.0b42"
+   date "1998-05-29"
+   build-date "1998-06-01"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority high
    category "oa"
    dump nil
    description "Miscellaneous editor extensions, you probably need this."
-   filename "edit-utils-1.22-pkg.tar.gz"
-   md5sum "2b3de19afb781c06a69cfe340bda8c70"
-   size 572566
+   filename "edit-utils-1.23-pkg.tar.gz"
+   md5sum "c443222618ef92d748e1f8f365cf0665"
+   size 583389
    provides (abbrevlist atomic-extents avoid backup-dir balloon-help big-menubar blink-cursor blink-paren bookmark compare-w completion dabbrev desktop detached-minibuf edit-toolbar fast-lock file-part floating-toolbar flow-ctrl foldout func-menu hippie-exp icomplete id-select info-look iswitchb lazy-lock lazy-shot live-icon man mic-paren paren popper mode-motion+ outl-mouse page-ext blink-paren paren permanent-buffers recent-files redo reportmail rsz-minibuf saveconfsavehist saveplace scroll-in-place tempo toolbar-utils tree-menu uniquify where-was-i-db)
    requires (xemacs-base)
    type single
@@ -1065,19 +1046,19 @@
 ))
 (debug
   (standards-version 1.0
-   version "1.02"
-   author-version "21.0b38"
-   date "1998-04-24"
-   build-date "1998-04-26"
+   version "1.03"
+   author-version "21.0b42"
+   date "1998-06-01"
+   build-date "1998-06-01"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution contrib
    priority low
    category "prog"
    dump nil
    description "GUD, gdb, dbx debugging support."
-   filename "debug-1.02-pkg.tar.gz"
-   md5sum "953ac508318ffcdcf3a81643499dda33"
-   size 87609
+   filename "debug-1.03-pkg.tar.gz"
+   md5sum "8714c8ed2dd221501b2ec9818c773d29"
+   size 90336
    provides ()
    requires (xemacs-base)
    type regular
@@ -1122,19 +1103,19 @@
 ))
 (jde
   (standards-version 1.0
-   version "1.0"
-   author-version "2.0"
+   version "1.01"
+   author-version "2.01"
    date "1998-04-19"
-   build-date "1998-05-06"
+   build-date "1998-06-01"
    maintainer "Andy Piper <andyp@parallax.co.uk>"
    distribution stable
    priority medium
    category "prog"
    dump nil
    description "Java language and development support."
-   filename "jde-1.0-pkg.tar.gz"
-   md5sum "f17436f90709e197ea7937d75b8ede15"
-   size 112195
+   filename "jde-1.01-pkg.tar.gz"
+   md5sum "e8c52579687f2fcafc045937f9f01781"
+   size 115790
    provides (jde)
    requires (cc-mode debug speedbar edit-utils mail-lib xemacs-base)
    type regular
@@ -1236,19 +1217,19 @@
 ))
 (vc
   (standards-version 1.0
-   version "1.08"
-   author-version "21.0b40"
-   date "1998-05-14"
-   build-date "1998-05-15"
+   version "1.09"
+   author-version "21.0b42"
+   date "1998-05-30"
+   build-date "1998-06-01"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "prog"
    dump t
    description "Version Control for Free systems."
-   filename "vc-1.08-pkg.tar.gz"
-   md5sum "10b3a769fce6d64e7662b3d4629bff30"
-   size 83873
+   filename "vc-1.09-pkg.tar.gz"
+   md5sum "233d46c01ab9e5052395cf730420f41d"
+   size 83688
    provides (vc)
    requires (dired xemacs-base)
    type regular
@@ -1407,19 +1388,19 @@
 ))
 (viper
   (standards-version 1.0
-   version "1.07"
-   author-version "3.02"
+   version "1.08"
+   author-version "3.03"
    date "1998-02-25"
-   build-date "1998-05-15"
+   build-date "1998-06-01"
    maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>"
    distribution stable
    priority low
    category "wp"
    dump nil
    description "VI emulation support."
-   filename "viper-1.07-pkg.tar.gz"
-   md5sum "7f8fc245699c2036b62789d455196654"
-   size 260876
+   filename "viper-1.08-pkg.tar.gz"
+   md5sum "f36b7e49bda79a19d7beeeeb6092bedd"
+   size 261090
    provides (viper)
    requires (xemacs-base)
    type regular
--- a/lisp/package-get.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/package-get.el	Mon Aug 13 10:35:54 2007 +0200
@@ -267,11 +267,8 @@
 	    (error "Package %s does not match md5 checksum" filename)))
       (message "Retrieved package %s" filename) (sit-for 0)
       (let ((status
-	     (if (eq (package-get-info-prop this-package 'type) 'single)
-					 (package-admin-add-single-file-package filename
-		  (package-get-staging-dir filename))
-	       (package-admin-add-binary-package
-		(package-get-staging-dir filename)))))
+	     (package-admin-add-binary-package
+	      (package-get-staging-dir filename))))
 	(when (not (= status 0))
 	  (message "Package failed.")
 	  (switch-to-buffer package-admin-temp-buffer)))
@@ -421,7 +418,7 @@
 	    t)
 	  package-get-base))
 
-(defun package-get-ever-installedp (pkg &optional notused)
+(defun package-get-ever-installed-p (pkg &optional notused)
   (string-match "-package$" (symbol-name pkg))
   (custom-initialize-set 
    pkg 
@@ -430,6 +427,22 @@
 	(intern (substring (symbol-name pkg) 0 (match-beginning 0))))
        t)))
 
+(defun package-get-file-installed-p (file &optional paths)
+  "Return absolute-path of FILE if FILE exists in PATHS.
+If PATHS is omitted, `load-path' is used."
+  (if (null paths)
+      (setq paths load-path)
+    )
+  (catch 'tag
+    (let (path)
+      (while paths
+	(setq path (expand-file-name file (car paths)))
+	(if (file-exists-p path)
+	    (throw 'tag path)
+	  )
+	(setq paths (cdr paths))
+	))))
+
 (defun package-get-create-custom ()
   "Creates a package customization file package-get-custom.el.
 Entries in the customization file are retrieved from package-get-base.el."
@@ -437,9 +450,11 @@
   ;; Load a fresh copy
   (load "package-get-base.el")
   (let ((custom-buffer (find-file-noselect 
-			(or (file-installed-p "package-get-custom.el")
+			(or (package-get-file-installed-p 
+			     "package-get-custom.el")
 			    (concat (file-name-directory 
-				     (file-installed-p "package-get-base.el"))
+				     (package-get-file-installed-p 
+				      "package-get-base.el"))
 				    "package-get-custom.el"))))
 	(pkg-groups nil))
 
@@ -463,7 +478,7 @@
 			 "-package nil \n"
 			 "  \"" (plist-get (car (cdr pkg)) 'description) "\"\n"
 			 "  :group '" category "-packages\n"
-			 "  :initialize 'package-get-ever-installedp\n"
+			 "  :initialize 'package-get-ever-installed-p\n"
 			 "  :type 'boolean)\n\n") custom-buffer)))
 	      package-get-base) custom-buffer)
   )
@@ -472,8 +487,8 @@
 (provide 'package-get)
 
 ;; potentially update the custom dependencies every time we load this
-(let ((custom-file (file-installed-p "package-get-custom.el"))
-      (package-file (file-installed-p "package-get-base.el")))
+(let ((custom-file (package-get-file-installed-p "package-get-custom.el"))
+      (package-file (package-get-file-installed-p "package-get-base.el")))
   ;; update custom file if it doesn't exist
   (if (or (not custom-file)
 	  (and (< (car (nth 5 (file-attributes custom-file)))
--- a/lisp/packages.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/packages.el	Mon Aug 13 10:35:54 2007 +0200
@@ -140,10 +140,11 @@
 
 (defvar packages-hardcoded-lisp
   '(
-    #+infodock "id-vers"
-    #+infodock "easymenu-id-xemacs"
+    ;; Nothing at this time
     )
-  "Lisp packages that are always dumped with XEmacs")
+  "Lisp packages that are always dumped with XEmacs.
+This includes every package that is loaded directly by a package listed
+in dumped-lisp.el and is not itself listed.")
 
 (defvar packages-useful-lisp
   '("bytecomp"
--- a/lisp/simple.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/simple.el	Mon Aug 13 10:35:54 2007 +0200
@@ -3937,7 +3937,7 @@
     (setq before-init-deferred-warnings
 	  (cdr before-init-deferred-warnings))))
 
-#-infodock (add-hook 'after-init-hook 'after-init-display-warnings)
+(add-hook 'after-init-hook 'after-init-display-warnings)
 
 (defun display-warning (class message &optional level)
   "Display a warning message.
--- a/lisp/sound.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/sound.el	Mon Aug 13 10:35:54 2007 +0200
@@ -83,13 +83,13 @@
 				       (integer :tag "Duration"))))))
 
 (defcustom sound-load-alist
-  '((load-sound-file "drum-beep.au"	'drum)
-    (load-sound-file "quiet-beep.au"	'quiet)
-    (load-sound-file "bass-snap.au"	'bass 80)
-    (load-sound-file "whip.au"		'whip 70)
-    (load-sound-file "cuckoo.au"		'cuckoo)
-    (load-sound-file "yeep.au"		'yeep)
-    (load-sound-file "hype.au"		'hype 100)
+  '((load-sound-file "drum-beep"	'drum)
+    (load-sound-file "quiet-beep"	'quiet)
+    (load-sound-file "bass-snap"	'bass 80)
+    (load-sound-file "whip"		'whip 70)
+    (load-sound-file "cuckoo"		'cuckoo)
+    (load-sound-file "yeep"		'yeep)
+    (load-sound-file "hype"		'hype 100)
     )
   "A list of calls to load-sound-file to be processed by load-default-sounds.
 
@@ -99,20 +99,22 @@
   :type '(repeat  (sexp :tag "Sound")
 		  ))
 
-(defcustom default-sound-directory (file-name-as-directory
-				    (concat data-directory "sounds"))
+(defcustom default-sound-directory (locate-data-directory "sounds")
   "Default directory to load a sound file from."
   :group 'sound
   :type 'directory
   )
 
-(defcustom sound-ext ""
+(defcustom sound-ext (if (or (eq system-type 'cygwin32)
+			     (eq system-type 'windows-nt))
+			 ".wav" ".au")
   "Filename extensions to complete sound file name with. If more than one
    extension is used, they should be separated by \":\". "
   :group 'sound
   :type 'string)
 
 (defcustom default-sound-directory-list ( list default-sound-directory )
+
   "List of directories which to search for sound files"
   :group 'sound
   :type '(repeat directory )
--- a/lisp/specifier.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/specifier.el	Mon Aug 13 10:35:54 2007 +0200
@@ -411,9 +411,9 @@
 ;; expects.)
 ;;
 ;; This macro might perhaps be made simpler, with an addition to
-;; `remove-specifier'.  Example (modulo gensyms for clarity):
+;; `remove-specifier'.  Example (simplified for clarity):
 ;;
-;; (defmacro with-specifier-instance (specifier value domain &rest body)
+;; (defmacro let-specifier (specifier value domain &rest body)
 ;;   `(unwind-protect
 ;;        (progn
 ;;	    (add-spec-to-specifier ,specifier ,value ,domain nil 'prepend)
@@ -430,26 +430,62 @@
 ;; The following version remembers the old speclist and returns it
 ;; later.  It's probably less error-prone anyway.
 
-(defmacro with-specifier-instance (specifier value domain &rest body)
-  "Evaluate forms in BODY with SPECIFIER instantiating to VALUE in DOMAIN.
-The value returned is the value of the last form in BODY.
+(defmacro let-specifier (specifier-list &rest body)
+  "(let-specifier SPECIFIER-LIST BODY): bind specifiers and evaluate BODY.
+The value of the last form in BODY is returned.
+Each element of SPECIFIER-LIST should be a list of
+\(SPECIFIER VALUE DOMAIN).  VALUE and DOMAIN may be omitted, and default
+to nil.  The elements of SPECIFIER-LIST are evaluated sequentially.
+
 For meaning of DOMAIN, see `specifier-instance'."
-  (let ((specvar (gensym "wsi-"))
-	(valvar (gensym "wsi-"))
-	(domvar (gensym "wsi-"))
-	(oldvar (gensym "wsi-")))
-    ;; Remember the arguments to prevent multiple evaluation.
-    `(let* ((,specvar ,specifier)
-	    (,valvar ,value)
-	    (,domvar ,domain)
-	    (,oldvar (specifier-spec-list ,specvar ,domvar)))
+  ;; Error-checking
+  (dolist (listel specifier-list)
+    (or (and (consp listel)
+	     (<= (length listel) 3))
+	(signal 'error (list "Should be a 3-element list" listel))))
+  ;; Set up fresh symbols to avoid name clashes.
+  (let* ((specvarlist (mapcar #'(lambda (ignored) (gensym "specifier-"))
+			      specifier-list))
+	 (valvarlist (mapcar #'(lambda (ignored) (gensym "value-"))
+			     specifier-list))
+	 (domvarlist (mapcar #'(lambda (ignored) (gensym "domain-"))
+			     specifier-list))
+	 (oldvarlist (mapcar #'(lambda (ignored) (gensym "old-"))
+			     specifier-list)))
+    ;; Bind the appropriate variables.
+    `(let* (,@(mapcar* (lambda (symbol listel)
+			 (list symbol (nth 0 listel)))
+		       specvarlist specifier-list)
+	      ,@(mapcar* (lambda (symbol listel)
+			   (list symbol (nth 1 listel)))
+			 valvarlist specifier-list)
+	      ,@(mapcar* (lambda (symbol listel)
+			   (list symbol (nth 2 listel)))
+			 domvarlist specifier-list)
+	      ,@(mapcar* (lambda (symbol specifier domain)
+			   (list symbol `(specifier-spec-list
+					  ,specifier ,domain)))
+			 oldvarlist specvarlist domvarlist))
        (unwind-protect
 	   (progn
-	     (add-spec-to-specifier ,specvar ,valvar ,domvar nil 'prepend)
+	     ,@(mapcar* (lambda (specifier value domain)
+			  `(add-spec-to-specifier
+			    ,specifier ,value ,domain
+			    nil 'prepend))
+			specvarlist valvarlist domvarlist)
 	     ,@body)
-	 (remove-specifier ,specvar ,domvar nil t)
-	 (add-spec-list-to-specifier ,specvar ,oldvar)))))
+	 ,@(apply
+	    #'nconc
+	    ;; Reverse the unwinding order for marginal safety gain.
+	    (nreverse
+	     (mapcar*
+	      (lambda (specifier domain oldvalue)
+		`((remove-specifier ,specifier ,domain)
+		  (add-spec-list-to-specifier ,specifier ,oldvalue)))
+	      specvarlist domvarlist oldvarlist)))))))
 
+;; (cl-prettyexpand '(let-specifier ((modeline-shadow-thickness 0 (selected-window)) (fubar 0 baz)) (sit-for 1)))
+
 (define-specifier-tag 'win 'device-on-window-system-p)
 
 ;; Add tags for device types that don't have support compiled
--- a/lisp/startup.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/startup.el	Mon Aug 13 10:35:54 2007 +0200
@@ -365,7 +365,7 @@
     (setq command-line-processed t)
     ;; Canonicalize HOME (PWD is canonicalized by init_buffer in buffer.c)
     (unless (eq system-type 'vax-vms)
-      (let ((value (getenv "HOME")))
+      (let ((value (user-home-directory)))
 	(if (and value
 		 (< (length value) (length default-directory))
 		 (equal (file-attributes default-directory)
--- a/lisp/toolbar-items.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/toolbar-items.el	Mon Aug 13 10:35:54 2007 +0200
@@ -39,12 +39,20 @@
 
 ;; Suppress warning message from bytecompiler
 (eval-when-compile
-  (defvar pending-delete-mode))
+  (defvar pending-delete-mode)
+  ;; #### The compiler still warns about missing
+  ;; `pending-delete-pre-hook'.  Any way to get rid of the warning?
+  )
 
 (defgroup toolbar nil
   "Configure XEmacs Toolbar functions and properties"
   :group 'environment)
 
+;; #### The following function is slightly obnoxious as it stands.  I
+;; think it should print a message like "Toolbar not configured; press
+;; me again to configure it", and when the button is pressed again
+;; (within a reasonable period of time), `customize-variable' should
+;; be invoked for the appropriate variable.
 
 (defun toolbar-not-configured ()
   (interactive)
@@ -330,7 +338,7 @@
 		       (symbol :tag "Reader") (sexp :tag "Start with")))
   :group 'toolbar)
 
-(defcustom toolbar-news-reader 'not-configured
+(defcustom toolbar-news-reader 'gnus
   "*News reader toolbar will invoke.
 The legal values are the keys from `toolbar-news-command-alist', which should
  be used to add new news readers.
@@ -372,7 +380,7 @@
   (if (not toolbar-news-use-separate-frame)
       (gnus)
     (unless (frame-live-p toolbar-news-frame)
-      (setq toolbar-news-frame (make-frame toolbar-news-frame-properties))
+      (setq toolbar-news-frame (make-frame toolbar-news-frame-plist))
       (add-hook 'gnus-exit-gnus-hook
 		(lambda ()
 		  (when (frame-live-p toolbar-news-frame)
@@ -449,6 +457,9 @@
   (mapcar
    (lambda (cons)
      (let ((prefix (expand-file-name (cdr cons)  icon-dir)))
+       ;; #### This should use a better mechanism for finding the
+       ;; glyphs, allowing for formats other than x[pb]m.  Look at
+       ;; `widget-glyph-find' for an example how it might be done.
        (set (car cons)
 	    (if (featurep 'xpm)
 		(toolbar-make-button-list
@@ -461,17 +472,15 @@
 	      (toolbar-make-button-list
 	       (concat prefix "-up.xbm")
 	       (concat prefix "-dn.xbm")
-	       (concat prefix "-xx.xbm")
-	       )))))
-   icon-list  )
-  )
+	       (concat prefix "-xx.xbm"))))))
+   icon-list))
 
 (defvar toolbar-vector-open 
   [toolbar-file-icon            toolbar-open	t       "Open a file"]
   "Define the vector for the \"Open\" toolbar button")
 
 (defvar toolbar-vector-dired
-  [toolbar-folder-icon	        toolbar-dired	t	"View directory"]
+  [toolbar-folder-icon	        toolbar-dired	t	"Edit a directory"]
   "Define the vector for the \"Dired\" toolbar button")
 
 (defvar toolbar-vector-save
@@ -499,31 +508,31 @@
   "Define the vector for the \"Undo\" toolbar button")
 
 (defvar toolbar-vector-spell
-  [toolbar-spell-icon		toolbar-ispell	t	"Spellcheck"]
+  [toolbar-spell-icon		toolbar-ispell	t	"Check spelling"]
   "Define the vector for the \"Spell\" toolbar button")
 
 (defvar toolbar-vector-replace
-  [toolbar-replace-icon	        toolbar-replace	t	"Replace text"]  
+  [toolbar-replace-icon	        toolbar-replace	t	"Search & Replace"]  
   "Define the vector for the \"Replace\" toolbar button")
 
 (defvar toolbar-vector-mail
-  [toolbar-mail-icon		toolbar-mail	t	"Mail"]
+  [toolbar-mail-icon		toolbar-mail	t	"Read mail"]
   "Define the vector for the \"Mail\" toolbar button")
 
 (defvar toolbar-vector-info
-  [toolbar-info-icon		toolbar-info	t	"Information"]
+  [toolbar-info-icon		toolbar-info	t	"Info documentation"]
   "Define the vector for the \"Info\" toolbar button")
 
 (defvar toolbar-vector-compile
-  [toolbar-compile-icon	        toolbar-compile	t	"Compile"]
+  [toolbar-compile-icon	        toolbar-compile	t	"Start a compilation"]
   "Define the vector for the \"Compile\" toolbar button")
 
 (defvar toolbar-vector-debug
-  [toolbar-debug-icon		toolbar-debug	t	"Debug"]
+  [toolbar-debug-icon		toolbar-debug	t	"Start a debugger"]
   "Define the vector for the \"Debug\" toolbar button")
 
 (defvar toolbar-vector-news
-  [toolbar-news-icon		toolbar-news	t	"News"]
+  [toolbar-news-icon		toolbar-news	t	"Read news"]
   "Define the vector for the \"News\" toolbar button")
 
 (defvar initial-toolbar-spec
--- a/lisp/winnt.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/winnt.el	Mon Aug 13 10:35:54 2007 +0200
@@ -132,6 +132,6 @@
       (if (string-match (car assoc) fname)
 	  (setq return-me (funcall (cdr assoc) (cdr args)))))
     (or return-me
-	(nt-quote-args-verbatim args))))
+	(nt-quote-args-verbatim (cdr args)))))
 
 ;;; winnt.el ends here
--- a/lisp/x-faces.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/lisp/x-faces.el	Mon Aug 13 10:35:54 2007 +0200
@@ -362,26 +362,6 @@
 (make-obsolete 'x-make-face-unitalic 'make-face-unitalic)
 
 
-;; Define some logical color names to be used when reading the pixmap files.
-(if (featurep 'xpm)
-    (setq xpm-color-symbols
-	  (list
-	   (purecopy '("foreground" (face-foreground 'default)))
-	   (purecopy '("background" (face-background 'default)))
-	   (purecopy '("backgroundToolBarColor"
-		       (or
-			(x-get-resource "backgroundToolBarColor"
-					"BackgroundToolBarColor" 'string)
-			(x-get-resource "background" "Background" 'string)
-			"Gray80")))
-	   (purecopy '("foregroundToolBarColor"
-		       (or
-			(x-get-resource "foregroundToolBarColor"
-					"ForegroundToolBarColor" 'string)
-			(x-get-resource "foreground" "Foreground" 'string)
-			"Black")))
-	   )))
-
 ;;; internal routines
 
 ;;; x-init-face-from-resources is responsible for initializing a
--- a/man/ChangeLog	Mon Aug 13 10:35:07 2007 +0200
+++ b/man/ChangeLog	Mon Aug 13 10:35:54 2007 +0200
@@ -1,7 +1,20 @@
+1998-05-28  Oliver Graf <ograf@fga.de>
+
+	* lispref/dragndrop.texi: a warning, and a bit more text this time
+
+1998-05-26  Oliver Graf <ograf@fga.de>
+
+	* lispref/dragndrop.texi: only small changes
+
 1998-05-15  Christian Nybø <chr@mediascience.no>
 
 	* xemacs/killing.texi: Properly document `zap-to-char'.
 
+1998-05-13  Greg Klanderman  <greg@alphatech.com>
+
+	* lispref/frames.texi (Input Focus): cleanup select-frame
+	documentation. 
+
 1998-05-10  Oliver Graf <ograf@fga.de>
 
 	* lispref/dragndrop.texi: new section for the DnD API
--- a/man/lispref/dragndrop.texi	Mon Aug 13 10:35:07 2007 +0200
+++ b/man/lispref/dragndrop.texi	Mon Aug 13 10:35:54 2007 +0200
@@ -8,11 +8,20 @@
 @chapter Drag'n'Drop
 @cindex drag'n'drop
 
+@emph{WARNING}: the Drag'n'Drop API is still under development and the
+interface may change!
+
   Drag'n'drop is a way to transfer information between multiple applications.
 To do this serveral GUIs define their own protocols. Examples are OffiX, CDE,
 Motif, KDE, MSWindows, GNOME, and many more. To catch all these protocols,
 XEmacs provides a generic API.
 
+One prime idea behind the API is to use a data interface that is
+transparent for all systems. The author thinks that this is best
+archived by using URL and MIME data, cause any internet enabled system
+must support these for email already. XEmacs also already provides
+powerful interfaces to support these types of data (tm and w3).
+
 @menu
 * Supported Protocols:: Which low-level protocols are supported.
 * Drop Interface::      How XEmacs handles a drop from another application.
@@ -29,6 +38,7 @@
 * OffiX DND::           A generic X based protocol.
 * CDE dt::              Common Desktop Environment used on suns.
 * MSWindows OLE::       Mr. Gates way of live.
+* Loose ends::          The other protocols.
 @end menu
 
 @node OffiX DND
@@ -42,6 +52,10 @@
 OffiX is supported if 'offix is member of the variable dragdrop-protocols, or
 the feature 'offix is defined.
 
+Unfortunately it uses it's own data types. Examples are: File, Files,
+Exe, Link, URL, MIME. The API tries to choose the right type for the data that 
+is dragged from XEmacs (well, not yet...).
+
 XEmacs supports both MIME and URL drags and drops using this API. No application 
 interaction is possible while dragging is in progress.
 
@@ -51,21 +65,48 @@
 @subsection CDE dt
 @cindex CDE dt
 
-to be written
+CDE stands for Common Desktop Environment. It is based on the Motif
+widget library. It's drag'n'drop protocol is also an abstraction of the
+Motif protocol (so it might be possible, that XEmacs will also support
+the Motif protocol soon).
+
+CDE has three different types: file, buffer, and text. XEmacs only uses
+file and buffer drags. The API will disallow full URL drags, only file
+method URLs are passed through.
+
+Buffer drags are always converted to plain text.
 
 @node MSWindows OLE
 @subsection MSWindows OLE
 @cindex MSWindows OLE
 
-to be written
+Only allows file drags and drops.
+
+@node Loose ends
+@subsection Loose ends
+
+The following protocols will be supported soon: Xdnd, Motif, Xde (if I
+get some specs).
+
+In particular Xdnd will be one of the protocols that can benefit from
+the XEmacs API, cause it also uses MIME types to encode dragged data.
 
 @node Drop Interface
 @section Drop Interface
 @cindex drop
+@cindex Drop API
 
-This describes the drop API (under construction)
+For each activated low-level protocol, a internal routine will catch
+incoming drops and convert them to a dragdrop-drop type
+misc-user-event.
+
+This misc-user-event has its function argument set to
+dragdrop-drop-dispatch and the object contains the data of the drop
+(converted to URL/MIME specific data).
 
 @node Drag Interface
 @section Drag Interface
+@cindex drag
+@cindex Drag API
 
 This describes the drag API (not implemented yet).
--- a/man/lispref/frames.texi	Mon Aug 13 10:35:07 2007 +0200
+++ b/man/lispref/frames.texi	Mon Aug 13 10:35:54 2007 +0200
@@ -680,9 +680,7 @@
 Also note that when the variable @code{focus-follows-mouse} is non-nil,
 the frame selection is temporary and is reverted when the current
 command terminates, much like the buffer selected by @code{set-buffer}.
-In order to effect a permanent focus change in this case, bind
-@code{focus-follows-mouse} to nil, select the frame you want, and do a
-@code{(sit-for 0)} within the scope of the binding.
+In order to effect a permanent focus change use @code{focus-frame}.
 
 @ignore (FSF Emacs)
 XEmacs cooperates with the X server and the window managers by arranging
--- a/nt/ChangeLog	Mon Aug 13 10:35:07 2007 +0200
+++ b/nt/ChangeLog	Mon Aug 13 10:35:54 2007 +0200
@@ -1,3 +1,29 @@
+1998-05-31  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* xemacs.mak: Added lib-src/wakeup.exe
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* xemacs.mak: Added rules for hexl.exe, movemail.exe, mmencode.exe
+	sorted-doc.exe, etags.exe
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* xemacs.mak: Support building InfoDock, with INFODOCK=1 macro
+	in the command line.
+
+1998-05-26  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* inc/sys/dir.h: Removed #ifndef WINDOWSNT around the code which
+	should be compiled in (sic!).
+	Removed 'extern' before function prototypes.
+
+1998-05-20  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* xemacs.mak: Unified -nologo compiler switch handling and lib-src 
+	programs build (only make-docfile currently, adding other tools
+	soon). 
+
 1998-05-23  Kirill M. Katsnelson  <kkm@kis.ru>
 
 	* xemacs.mak: Added HAVE_DIALOGS macro, and dialog-*.* files to
--- a/nt/inc/sys/dir.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/nt/inc/sys/dir.h	Mon Aug 13 10:35:54 2007 +0200
@@ -65,13 +65,11 @@
 	char	dd_buf[DIRBLKSIZ];	/* directory block */
 	}	DIR;			/* stream data from opendir() */
 
-#ifndef WINDOWSNT
-extern DIR *opendir (CONST char *filename);
-extern int closedir (DIR *dirp);
-extern struct direct *readdir (DIR *dirp);
-extern struct direct *readdirver (DIR *dirp);
-extern long telldir (DIR *dirp);
-extern void seekdir (DIR *dirp, long loc);
+DIR *opendir (CONST char *filename);
+void closedir (DIR *dirp);
+struct direct *readdir (DIR *dirp);
+struct direct *readdirver (DIR *dirp);
+long telldir (DIR *dirp);
+void seekdir (DIR *dirp, long loc);
 
 #define rewinddir( dirp )	seekdir( dirp, 0L )
-#endif
--- a/nt/xemacs.mak	Mon Aug 13 10:35:07 2007 +0200
+++ b/nt/xemacs.mak	Mon Aug 13 10:35:54 2007 +0200
@@ -66,11 +66,18 @@
 !if !defined(USE_INDEXED_LRECORD_IMPLEMENTATION)
 USE_INDEXED_LRECORD_IMPLEMENTATION=0
 !endif
+!if !defined(INFODOCK)
+INFODOCK=0
+!endif
 
 #
 # Conf error checks
 #
 CONFIG_ERROR=0
+!if $(INFODOCK) && !exist("..\..\Infodock.rules")
+!message Cannot build InfoDock without InfoDock sources
+CONFIG_ERROR=1
+!endif
 !if !$(HAVE_MSW) && !$(HAVE_X)
 !message Please specify at least one HAVE_MSW=1 and/or HAVE_X=1
 CONFIG_ERROR=1
@@ -114,6 +121,9 @@
 !if [set CONF_REPORT_ALREADY_PRINTED=1]
 !endif
 !message ------------------------------------------------
+!if $(INFODOCK)
+!message Building InfoDock.
+!endif
 !if $(HAVE_MSW)
 !message Compiling in support for native GUI.
 !endif
@@ -161,9 +171,9 @@
 VERBOSECC=0
 !endif
 !if $(VERBOSECC)
-CCV=$(CC)
+CCV=$(CC) -nologo
 !else
-CCV=@$(CC)
+CCV=@$(CC) -nologo
 !endif
 
 !if $(DEBUG_XEMACS)
@@ -228,11 +238,36 @@
 
 !include "..\version.sh"
 
+# Hard-coded paths
+
+!if $(INFODOCK)
+PATH_PREFIX=../..
+!else
+PATH_PREFIX=..
+!endif
+
+PATH_DEFINES=-DPATH_PREFIX=\"$(PATH_PREFIX)\"
+
+# Program name and version
+
+!if $(INFODOCK)
+INFODOCK_VERSION_STRING=$(infodock_major_version).$(infodock_minor_version).$(infodock_build_version)
+PROGRAM_DEFINES=-DINFODOCK 					\
+	-DPATH_VERSION=\"$(INFODOCK_VERSION_STRING)\"		\
+	-DPATH_PROGNAME=\"infodock\" 				\
+	-DINFODOCK_MAJOR_VERSION=$(infodock_major_version)	\
+	-DINFODOCK_MINOR_VERSION=$(infodock_minor_version)	\
+	-DINFODOCK_BUILD_VERSION=$(infodock_build_version)
+!else
 !if defined(emacs_beta_version)
 XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version)-b$(emacs_beta_version)
 !else
 XEMACS_VERSION_STRING=$(emacs_major_version).$(emacs_minor_version)
 !endif
+PROGRAM_DEFINES=						\
+	-DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\"		\
+	-DPATH_PROGNAME=\"xemacs\"
+!endif
 
 # Generic variables
 
@@ -241,8 +276,7 @@
 DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \
 	$(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \
 	-DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \
-	-DHAVE_CONFIG_H -DPATH_PROGNAME=\"xemacs\" \
-	-DPATH_VERSION=\"$(XEMACS_VERSION_STRING)\"
+	-DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
 
 OUTDIR=obj
 
@@ -273,11 +307,38 @@
 
 #------------------------------------------------------------------------------
 
+# lib-src programs
+
+LIB_SRC = $(XEMACS)\lib-src
+LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32 -DWINDOWSNT
+
+# Inferred rule
+{$(LIB_SRC)}.c{$(LIB_SRC)}.exe :
+	@cd $(LIB_SRC)
+	$(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) -O2 -W3 -Fe$@ $**
+	@cd $(XEMACS)\nt
+
+# Individual dependencies
+ETAGS_DEPS = $(LIB_SRC)/getopt.c $(LIB_SRC)/getopt1.c $(LIB_SRC)/../src/regex.c
+$(LIB_SRC)/etags.exe : $(LIB_SRC)/etags.c $(ETAGS_DEPS)
+#### ootags???
+
+LIB_SRC_TOOLS = \
+	$(LIB_SRC)/make-docfile.exe	\
+	$(LIB_SRC)/hexl.exe		\
+	$(LIB_SRC)/movemail.exe		\
+	$(LIB_SRC)/mmencode.exe		\
+	$(LIB_SRC)/sorted-doc.exe	\
+	$(LIB_SRC)/wakeup.exe		\
+	$(LIB_SRC)/etags.exe		
+
 # LASTFILE Library
 
+#------------------------------------------------------------------------------
+
 LASTFILE=$(OUTDIR)\lastfile.lib
 LASTFILE_SRC=$(XEMACS)\src
-LASTFILE_FLAGS=-nologo $(WARN_CPP_FLAGS) $(OPT) $(INCLUDES) -Fo$@ -c
+LASTFILE_FLAGS=$(WARN_CPP_FLAGS) $(OPT) $(INCLUDES) -Fo$@ -c
 LASTFILE_OBJS= \
 	$(OUTDIR)\lastfile.obj
 
@@ -295,7 +356,7 @@
 
 LWLIB=$(OUTDIR)\lwlib.lib
 LWLIB_SRC=$(XEMACS)\lwlib
-LWLIB_FLAGS=-nologo $(WARN_CPP_FLAGS) $(OPT) $(INCLUDES) $(DEFINES) \
+LWLIB_FLAGS=$(WARN_CPP_FLAGS) $(OPT) $(INCLUDES) $(DEFINES) \
  -DNEED_ATHENA -DNEED_LUCID \
  -D_WINDOWS -DMENUBARS_LUCID -DSCROLLBARS_LUCID -DDIALOGS_ATHENA \
  -Fo$@ -c
@@ -335,16 +396,6 @@
 !endif
 #------------------------------------------------------------------------------
 
-# lib-src programs
-
-LIB_SRC=$(XEMACS)\lib-src
-LIB_SRC_FLAGS=$(INCLUDES) $(DEFINES) -ML
-LIB_SRC_LIBS= kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
- advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib libc.lib
-LIB_SRC_LFLAGS=-nologo $(LIB_SRC_LIBS) -base:0x1000000\
- -subsystem:console -pdb:none $(DEBUG_FLAGS) -machine:I386\
- -nodefaultlib -out:$@
-
 DOC=$(LIB_SRC)\DOC
 DOC_SRC1=\
  $(XEMACS)\src\abbrev.c \
@@ -365,7 +416,6 @@
  $(XEMACS)\src\data.c \
  $(XEMACS)\src\device.c
 DOC_SRC2=\
-# $(XEMACS)\src\dialog.c \
  $(XEMACS)\src\dired.c \
  $(XEMACS)\src\doc.c \
  $(XEMACS)\src\doprnt.c \
@@ -499,30 +549,6 @@
  $(XEMACS)\src\debug.c
 !endif
 
-MAKE_DOCFILE=$(LIB_SRC)\make-docfile.exe
-
-$(MAKE_DOCFILE): $(OUTDIR)\make-docfile.obj
-	link.exe -out:$@ $(LIB_SRC_LFLAGS) $** $(LIB_SRC_LIBS)
-
-$(OUTDIR)\make-docfile.obj:	$(LIB_SRC)\make-docfile.c
-	 $(CCV) -nologo $(LIB_SRC_FLAGS) -c $** -Fo$@
-
-RUNEMACS=$(XEMACS)\src\runemacs.exe
-
-$(RUNEMACS): $(OUTDIR)\runemacs.obj
-	link.exe -nologo -out:$@ -subsystem:windows -entry:WinMainCRTStartup \
-	-pdb:none -release -incremental:no $** \
-	kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
-	advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib libc.lib
-
-$(OUTDIR)\runemacs.obj:	$(XEMACS)\nt\runemacs.c
-	$(CCV) -nologo -ML $(WARN_CPP_FLAGS) $(OPT) -c \
-	-D_DEBUG -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN \
-	-D_X86_ -Demacs -DHAVE_CONFIG_H \
-	$** -Fo$@
-
-SUPPORT_PROGS=$(MAKE_DOCFILE) $(RUNEMACS)
-
 #------------------------------------------------------------------------------
 
 # TEMACS Executable
@@ -543,10 +569,9 @@
  -DEMACS_MINOR_VERSION=$(emacs_minor_version) \
  -DEMACS_BETA_VERSION=$(emacs_beta_version) \
  -DXEMACS_CODENAME=\"$(xemacs_codename)\" \
- -DPATH_PREFIX=\"$(XEMACS)\" \
  -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\"
 
-TEMACS_FLAGS=-nologo -ML $(WARN_CPP_FALGS) $(OPT) -c $(TEMACS_CPP_FLAGS)
+TEMACS_FLAGS=-ML $(WARN_CPP_FALGS) $(OPT) -c $(TEMACS_CPP_FLAGS)
 
 !if $(HAVE_X)
 TEMACS_X_OBJS=\
@@ -628,7 +653,6 @@
 	$(OUTDIR)\console.obj \
 	$(OUTDIR)\data.obj \
 	$(OUTDIR)\device.obj \
-#	$(OUTDIR)\dialog.obj \
 	$(OUTDIR)\dired.obj \
 	$(OUTDIR)\doc.obj \
 	$(OUTDIR)\doprnt.obj \
@@ -778,7 +802,7 @@
 #------------------------------------------------------------------------------
 
 # use this rule to build the complete system
-all:	$(OUTDIR)\nul $(LASTFILE) $(LWLIB) $(SUPPORT_PROGS) \
+all:	$(OUTDIR)\nul $(LASTFILE) $(LWLIB) $(LIB_SRC_TOOLS) \
 	$(TEMACS) $(TEMACS_BROWSE) update-elc $(DOC) dump-xemacs
 
 temacs: $(TEMACS)
--- a/src/ChangeLog	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/ChangeLog	Mon Aug 13 10:35:54 2007 +0200
@@ -1,3 +1,368 @@
+1998-05-29  Andy Piper  <andyp@parallax.co.uk>
+
+	* ntplay.c (play_sound_data_1) new function. convert alloca data
+	to malloc if necessary.
+	(play_sound_file): if the file is not in our path then convert to
+	data and play.
+
+1998-06-01  SL Baur  <steve@altair.xemacs.org>
+
+	* mule-mcpath.c (mc_chdir): Reverse parameters in call to memcpy.
+	* msdos.c (Frecent_doskeys): Ditto.
+
+	* unexalpha.c (unexec): Reverse parameters in call to memcpy.
+	Suggested by Reggie Perry <perry@zso.dec.com>
+
+	* buffer.h: Eliminate size in declaration.
+
+1998-06-01  Olivier Galibert  <galibert@pobox.com>
+
+	* unexelfsgi.c (unexec): Cleanup n/nn and remove useless kludge.
+
+1998-06-01  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* gui.c (gui_item_init): Changed the default value for config member
+	from Qunbound to Qnil.
+
+1998-06-01  Greg Klanderman  <greg@alphatech.com>
+
+	* indent.c (vmotion_pixels): Don't #define abs().
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* s/windowsnt.h: Defined popen and pclose to be _popen and _pclose
+	respectively.
+
+1998-05-30  Andy Piper  <andyp@parallax.co.uk>
+
+	* glyphs.h: add xbm declarations.
+
+	* console.h: add xbm_instantiate_method device method.
+
+	* glyphs.c (check_valid_xbm_inline) (xbm_validate)
+	(bitmap_to_lisp_data) (xbm_mask_file_munging) (xbm_normalize)
+	(xbm_possible_dest_types): moved here from glyphs-x.c. use
+	locate_pixmap_file device method and read_bitmap_data_from_file
+	instead of XmuReadBitmapDataFromFile.
+	(xbm_instatntiate): make a device method.
+
+	* glyphs-x.c: see glyphs.c changes. (read_bitmap_data_from_file)
+	new function that just calls XmuReadBitmapDataFromFile.
+	(x_xbm_instatntiate): device method from xbm_instantiate.
+
+	* glyphs-msw.c (read_bitmap_data) (NextInt)
+	(read_bitmap_data_from_file): new functions copied from Xmu
+	sources. 
+	(xbm_create_bitmap_from_data) from Ben <ben@666.com> convert
+	inline data to an mswindows bitmap.
+	(init_image_instance_from_xbm_inline) (xbm_instantiate_1)
+	(mswindows_xbm_instantiate): mswindows-ized versions of the X
+	functions.
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* window.c (specifier_vars_of_window): Renamed `has_modeline-p' to
+	`modeline-visible-p'.
+	Declared specifier lisp variables at the beginning oh the file
+	as static.
+
+	* procimpl.h (struct process_methods): Changed semantics of
+	create_process method so it accepts lisp strings instead of
+	char pointers.
+
+	* process.c (Fstart_process_internal): Moved building of
+	unix style argv from here to process-unix.c, ...
+
+	* process-unix.c (unix_create_process): ... right here.
+
+	* process-nt.c (nt_create_process): Changed this function to
+	support new semantics, so avoided a GC problem.
+
+	* events.c (Fmake_event): Document misc-user events properties.
+	(Fmake_event): Do not allow arbitrary objects for channel property
+	of misc-user events.
+	(Fmake_event): Change misc-user event validation: it is function
+	which is required, not button.
+
+	* event-msw.c (mswindows_user_event_p): Recognize misc user events as
+	user events.
+	(mswindows_enqueue_misc_user_event): Added function.
+	(mswindows_bump_queue): Removed function.
+	(mswindows_enqueue_magic_event): Support NULL HWND parameter.
+	(mswindows_wnd_proc, WM_CLOSE): Use mswindows_enqueue_misc_user_event().
+	(mswindows_wnd_proc, WM_EXITSIZEMOVE): Ditto.
+	(emacs_mswindows_handle_magic_event): Handle XM_BUMPQUEUE, by doing
+	really nothing, which is my personal favorite thing.
+
+	* console-msw.h: Removed prototype for mswindows_bump_queue().
+	Added prototype for mswindows_enqueue_misc_user_event().
+
+	* menubar-msw.c (mswindows_handle_wm_command): Use
+	mswindows_enqueue_misc_user_event(). 
+
+	* toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto.
+
+	* dialog-msw.c (dialog_proc): Ditto.
+
+	* scrollbar-msw.c (mswindows_handle_scrollbar_event): Ditto.
+	 (mswindows_handle_scrollbar_event): Use frame, not window, for misc
+	user events channel.
+
+1998-05-29  Greg Klanderman  <greg@alphatech.com>
+
+	* window.c (Fwindow_displayed_text_pixel_height): was relying on
+	incorrect semantics of vmotion_pixels which has been fixed.  don't 
+	use it anymore as it can't easily be used.
+
+	* indent.c (vmotion_pixels): fix off by one bug moving up.  also
+	the motion was reported incorrectly if you tried to go past end of 
+	buffer.
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* toolbar.h: Removed misleading commentary, as Martin suggested.
+
+1998-05-30  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* lisp.h: Extern Qactivate_menubar_hook.
+
+	* menubar-msw.c (unsafe_handle_wm_initmenu_1): Pass correct value to
+	run_hook ().
+
+1998-05-29  Andy Piper  <andyp@parallax.co.uk>
+
+	* glyphs-msw.c: use BPLINE macro.
+
+	* select-msw.c (mswindows-selection-exists-p)
+	(mswindows-delete-selection): doc string fixes.
+
+	* toolbar-msw.c (mswindows_output_toolbar): make disabled buttons
+	unpressable. warning elimination.
+
+1998-05-28  Martin Buchholz  <martin@xemacs.org>
+
+	* alloc.c (dbg_constants): 
+	* dbxrc:
+	* gdbinit:
+	Remove toolbar_data debugging code, since that lrecord has
+	also been removed. 
+
+Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
+
+	* alloc.c: zap cached value of (user-home-directory), so that
+	  it's not undumped.
+
+	* buffer.c: From init_buffer(), separated out code that
+	  determined the initial directory for the *scratch* buffer, and
+	  put them into a function called "init_initial_directory()".
+	  The initial directory is now available as a global "char *"
+	  called initial_directory.
+
+	* buffer.h: Added extern entries for initial_directory[] and
+	  init_initial_directory().
+
+	* editfns.c: added new elisp function "user-home-directory",
+	which basically returns getenv("HOME"), but attempts to use
+	other values if $HOME isn't set.This may have to be tweaked in
+	the future as, under Unix, "/" is used if $HOME isn't set (this
+	probably should be set to the current directory).  To support
+	this, a new C function, "get_home_directory()", now exists,
+	which returns the "home directory", as a "char *" string.
+
+	* emacs.c: Rearrange NT initialization order so that
+	environment/registry variables will be properly entered into
+	Vprocess_enviroment.
+
+	* fileio.c: replaced egetenv("HOME") with calls to the new
+	  get_home_directory().
+
+	* lisp.h: Added function prototypes for uncache_home_directory() 
+	  and get_home_directory(), along with lisp prototypes for
+	  Fuser_home_directory() and friends.
+
+	* nt.c: replaced getenv("HOME") with calls to the new
+	  get_home_directory().
+
+	* sysfile.h: for WINDOWSNT, #include <direct.h>, to suppress
+	  warnings about getcwd(), etc. not having prototypes.
+
+1998-05-28  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* process-nt.c (send_signal): Emulate SIGHUP.
+	(validate_signal_number): Ditto.
+
+	* event-msw.c (mswindows_wnd_proc, WM_KEYDOWN): Unconditionally
+	remove MOD_SHIFT from ASCII characters.
+	(mswindows_wnd_proc, WM_KEYDOWN): Do not activate the menubar when 
+	F10 is pressed.
+
+1998-05-24  Oliver Graf <ograf@fga.de>
+
+	* frame-x.c (cde-start-drag-internal): added filename and multi-
+	data transfers
+	(x_cde_convert_callback) dito
+
+1998-05-26  Oliver Graf <ograf@fga.de>
+
+	* frame-x.c: include event-mod.h also with CDE
+	(x_cde_convert_callback) made the thing working
+	(cde-start-drag-internal) also debugging
+
+1998-05-15  Greg Klanderman  <greg@alphatech.com>
+
+	* window.c (Fwindow_displayed_text_pixel_height): New function.
+	(syms_of_window): DEFSUBR it.
+
+	* indent.c (Fvertical_motion_pixels): New function - request
+	movement in pixels.
+	(vmotion_pixels): helper.
+	(syms_of_indent): DEFSUBR.
+	* lisp.h: declaration for vmotion_pixels().
+
+	* indent.c (Fvertical_motion): Add optional third argument PIXELS, 
+	to request returning motion in pixels.
+	(Fvertical_motion_pixels): Remove, functionality merged into
+	Fvertical_motion. 
+ 	* window.c (window_scroll): call Fvertical_motion with 3 arguments.
+	(Fmove_to_window_line): ditto.
+	* lisp.h: Change declaration for Fvertical_motion.
+
+	* window.c: rename window-text-pixel-{height,width,edges} to
+	window-text-area-pixel-*.
+
+1998-05-26  Gunnar Evermann  <Gunnar.Evermann@nats.informatik.uni-hamburg.de>
+
+	* tooltalk.c (vars_of_tooltalk) added staticpro for
+	Tooltalk_Message_plist_str and Tooltalk_Pattern_plist_str
+
+1998-05-27  Andy Piper  <andyp@parallax.co.uk>
+		
+	* faces.c: create a new 3d_object_face, make modeline and
+	vertical_divider faces fallback to this rather than the default.
+
+1998-05-21  Andy Piper  <andyp@parallax.co.uk>
+
+	* s/cygwin32.h: define charsets for cygwin.
+
+1998-05-25  Andy Piper  <andyp@parallax.co.uk>
+
+	* toolbar-msw.c (mswindows_output_toolbar): fix up button sizes
+	and coordinates. resize bitmaps if we have already settled on a
+	different size.
+
+	* glyphs-msw.c (xpm_to_eimage): add ';' for mswindows compiler.
+
+1998-05-25  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto.
+
+	* menubar-msw.c (mswindows_handle_wm_command): Ditto.
+
+	* gui.h: Ditto.
+
+	* gui-x.c (popup_selection_callback): Ditto.
+
+	* dialog-msw.c (dialog_proc): get_callback -> get_gui_callback.
+
+	* gui.c (get_callback): Renamed to get_gui_callback.
+
+1998-05-17  Martin Buchholz  <martin@xemacs.org>
+
+	* glyphs.h: order rearrangement.
+
+	* device-tty.c (tty_asynch_device_change): Warning suppression.
+	* device-x.c (x_device_system_metrics): Warning suppression.
+	Make Doc strings consistent with coding standards.
+
+1998-05-24  Martin Buchholz  <martin@xemacs.org>
+
+	* general.c: multiple definition of `Qicon'.  general.c seems
+	  like a good home for Qicon.
+
+1998-05-20  Kirill M. Katsnelson  <kkm@kis.ru>
+
+	* This patch is to fix compilation warnings under Windows.
+
+	* s/windowsnt.h: Encapsulate getpid with sys_getpid.
+	Added prototypes for FSF inherited functions, with which XEmacs is 
+	sprinkled thoroughly.
+	Removed some #if 0 code. Bracketed some more definitions, probably 
+	related to Visual C versions prior to 4 (we do not support them).
+
+	* sysfloat.h (logb): Finally, get logb() prototyped.
+
+	* sysfile.h: Added Windows specific includes.
+	Removed old Windows specific code bracketed with #if 0.
+
+	* sysdep.h: Added prototype for xrealpath().
+
+	* sysdep.c (sys_getpid): Added function, to support '95 negative pids.
+
+	* symsinit.h: Added prototypes for syms_of_dired_mswindows,
+	vars_of_dired_mswindows and init_ntproc (Grrr).
+
+	* realpath.c: Added Windows specific include files.
+	(xrealpath): Conditionalized declaration of some auto variables on 
+	S_IFLNK, to avoid warnings.
+
+	* ntproc.c: Disabled some compiler warnings. This file is going to 
+	die, so I have not cleaned it up much.
+	(set_process_dir): Const parameter.
+	(Fwin32_short_file_name): Down CHECK_* macros to one argument.
+	(Fwin32_long_file_name): Ditto.
+	(Fwin32_set_process_priority): Ditto. Why didn't I remove these
+	three functions?
+
+	* nt.h: Added prototypes for set_process_dir and convert_time.
+
+	* nt.c: More include files.
+	(getpwnam): Consted char* argument.
+	(get_emacs_configuration): Const return value.
+	(opendir): Const argument.
+	(stat): Casted converstion long->short.
+	(stat): Removed ad hoc and questionable support for non-MSC compile.
+	(sys_pipe): Removed unused auto variable.
+	(_sys_read_ahead): Removed calls to DebPrint.
+	(sys_read): Ditto, in 2 places.
+	(term_ntproc): Added unused int parameter to signal handler, to
+	avoid a warning when compiling a call to signal().
+	(msw_sigset): Properly return old signandler or NULL instead of void.
+
+	* floatfns.c (Flogb): Casted arguments to unary minus to signed.
+
+	* gmalloc.c (morecore): Ditto.
+	(_free_internal): Ditto.
+
+	* lread.c (parse_integer): Ditto.
+
+	* dired-msw.c: Added several include files.
+
+	* cmdloop.c (Fcommand_loop_1): Added Microsoft C to the Big List
+	of Compilers to Shut Up.
+
+	* callproc.c: Added #includes to suppress warnings under Windows.
+	(init_callproc): Removed #if0'ed code and unused variables.
+
+1998-05-25  Andy Piper  <andyp@parallax.co.uk>
+
+	* device-msw.c (mswindows_device_system_metrics): do planes in a
+	way consistent with X.
+
+	* glyphs-msw.c (mswindows_initialize_image_instance_mask): don't
+	use SetPixel, use DIBits functions.
+	(xpm_to_eimage): frob colors more closely like xpm deos.
+
+	* toolbar-msw.c: only resize bitmaps when shrinking. Adjust look
+	to be closer to X version.
+
+	* event-msw.c: use tooltip string directly.
+
+	* redisplay-msw.c: reinstate Kirill's bg pixmap change.
+
+	* objects-msw.c: frob rgb colors that only Kyle uses.
+
+	* dialog-msw.c (button_width): INLINE -> inline.
+
 1998-05-23  SL Baur  <steve@altair.xemacs.org>
 
 	* getloadavg.c (getloadavg): Fix typo.
@@ -136,6 +501,17 @@
 
 1998-05-18  Kirill M. Katsnelson  <kkm@kis.ru>
 
+	* objects-msw.c (mswindows_initialize_font_instance): Use ANSI
+	charset when creating font. 
+	(mswindows_initialize_color_instance): Do not create brush along
+	with a color.
+	(mswindows_finalize_color_instance): Do not delete it then.
+
+	* objects-msw.h (struct mswindows_color_instance_data): Removed
+	brush slot, and corresponding accessor macro.
+
+1998-05-18  Kirill M. Katsnelson  <kkm@kis.ru>
+
 	* toolbar.c: Removed toolbar_data lrecord implementation.
 	(mark_frame_toolbar_buttons_dirty): Replase usage of toolbar_data
 	with toolbar_buttons (via FRAME_TOOLBAR_BUTTONS).
--- a/src/alloc.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/alloc.c	Mon Aug 13 10:35:54 2007 +0200
@@ -693,7 +693,6 @@
 #endif
 #ifndef HAVE_TOOLBARS
   lrecord_toolbar_button   = 208,
-  lrecord_toolbar_data     = 209,
 #endif
 #ifndef HAVE_TOOLTALK
   lrecord_tooltalk_message = 210,
@@ -4315,6 +4314,8 @@
   Vexec_path = Qnil;
   Vload_path = Qnil;
   /* Vdump_load_path = Qnil; */
+  uncache_home_directory();
+
 #if defined(LOADHIST) && !(defined(LOADHIST_DUMPED) || \
 			   defined(LOADHIST_BUILTIN))
   Vload_history = Qnil;
--- a/src/buffer.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/buffer.c	Mon Aug 13 10:35:54 2007 +0200
@@ -123,6 +123,11 @@
    buffers and as a reset-value when local-vars are killed.  */
 struct buffer buffer_local_flags;
 
+/* This is the initial (startup) directory, as used for the *scratch* buffer.
+   We're making this a global to make others aware of the startup directory.
+ */
+char initial_directory[MAXPATHLEN+1];
+
 /* This structure holds the names of symbols whose values may be
    buffer-local.  It is indexed and accessed in the same way as the above. */
 static Lisp_Object Vbuffer_local_symbols;
@@ -2744,17 +2749,15 @@
 }
 
 void
-init_buffer (void)
+init_initial_directory (void)
 {
   /* This function can GC */
-  char buf[MAXPATHLEN+1];
+
   char *pwd;
   struct stat dotstat, pwdstat;
   int rc;
 
-  buf[0] = 0;
-
-  Fset_buffer (Fget_buffer_create (QSscratch));
+  initial_directory[0] = 0;
 
   /* If PWD is accurate, use it instead of calling getcwd.  This is faster
      when PWD is right, and may avoid a fatal error.  */
@@ -2764,17 +2767,17 @@
       && dotstat.st_ino == pwdstat.st_ino
       && dotstat.st_dev == pwdstat.st_dev
       && (int) strlen (pwd) < MAXPATHLEN)
-    strcpy (buf, pwd);
-  else if (getcwd (buf, MAXPATHLEN) == NULL)
+    strcpy (initial_directory, pwd);
+  else if (getcwd (initial_directory, MAXPATHLEN) == NULL)
     fatal ("`getcwd' failed: %s\n", strerror (errno));
 
   /* Maybe this should really use some standard subroutine
      whose definition is filename syntax dependent.  */
-  rc = strlen (buf);
-  if (!(IS_DIRECTORY_SEP (buf[rc - 1])))
+  rc = strlen (initial_directory);
+  if (!(IS_DIRECTORY_SEP (initial_directory[rc - 1])))
     {
-      buf[rc] = DIRECTORY_SEP;
-      buf[rc + 1] = '\0';
+      initial_directory[rc] = DIRECTORY_SEP;
+      initial_directory[rc + 1] = '\0';
     }
   /* XEmacs change: store buffer's default directory
      using prefered (i.e. as defined at compile-time)
@@ -2785,9 +2788,18 @@
        else unixtodos_filename (s); \
   } while (0)
 
-  CORRECT_DIR_SEPS(buf);
+  CORRECT_DIR_SEPS(initial_directory);
 #endif
-  current_buffer->directory = build_string (buf);
+}
+
+void
+init_buffer (void)
+{
+  /* This function can GC */
+
+  Fset_buffer (Fget_buffer_create (QSscratch));
+
+  current_buffer->directory = build_string (initial_directory);
 
 #if 0 /* FSFmacs */
   /* #### is this correct? */
--- a/src/buffer.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/buffer.h	Mon Aug 13 10:35:54 2007 +0200
@@ -1521,6 +1521,12 @@
 
 extern struct buffer *current_buffer;
 
+/* This is the initial (startup) directory, as used for the *scratch* buffer.
+   We're making this a global to make others aware of the startup directory.
+ */
+extern char initial_directory[];
+extern void init_initial_directory (void);   /* initialize initial_directory */
+
 EXFUN (Fbuffer_disable_undo, 1);
 EXFUN (Fbuffer_modified_p, 1);
 EXFUN (Fbuffer_name, 1);
--- a/src/callproc.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/callproc.c	Mon Aug 13 10:35:54 2007 +0200
@@ -44,6 +44,8 @@
 
 #ifdef WINDOWSNT
 #define _P_NOWAIT 1	/* from process.h */
+#include <windows.h>
+#include "nt.h"
 #endif
 
 #ifdef DOS_NT
@@ -825,6 +827,8 @@
       if (NILP (v))
 	message ("%s not defined in environment", XSTRING_DATA (var));
       else
+	/* #### Should use Fprin1_to_string or Fprin1 to handle string
+           containing quotes correctly.  */
 	message ("\"%s\"", value);
     }
   RETURN_UNGCPRO (v);
@@ -869,35 +873,25 @@
   ** If NT then we look at COMSPEC for the shell program.
   */
   sh = egetenv ("COMSPEC");
-  {
-    char *tem;
-    /*
-    ** If COMSPEC has been set, then convert the
-    ** DOS formatted name into a UNIX format. Then
-    ** create a LISP object.
-    */
-    if (sh)
-      {
-#if 0 /* This breaks everything -kkm */
-	tem = (char *) alloca (strlen (sh) + 1);
-	dostounix_filename (strcpy (tem, sh));
-	Vshell_file_name = build_string (tem);
-#else
-	Vshell_file_name = build_string (sh);
-#endif
-      }
-    /*
-    ** Odd, no COMSPEC, so let's default to our
-    ** best guess for NT.
-    */
-    else
-      {
-	Vshell_file_name = build_string ("\\WINNT\\system32\\cmd.exe");
-      }
-  }
+  /*
+  ** If COMSPEC has been set, then convert the
+  ** DOS formatted name into a UNIX format. Then
+  ** create a LISP object.
+  */
+  if (sh)
+    Vshell_file_name = build_string (sh);
+  /*
+  ** Odd, no COMSPEC, so let's default to our
+  ** best guess for NT.
+  */
+  else
+    Vshell_file_name = build_string ("\\WINNT\\system32\\cmd.exe");
+
 #else /* not WINDOWSNT */
+
   sh = (char *) egetenv ("SHELL");
   Vshell_file_name = build_string (sh ? sh : "/bin/sh");
+
 #endif
 }
 
--- a/src/cmdloop.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/cmdloop.c	Mon Aug 13 10:35:54 2007 +0200
@@ -580,7 +580,11 @@
 
       if (!was_locked)
 	any_console_state ();
-#if defined (__SUNPRO_C) || defined (__SUNPRO_CC) || (defined (DEC_ALPHA) && defined (OSF1))
+#if (defined (_MSC_VER) 			\
+     || defined (__SUNPRO_C)			\
+     || defined (__SUNPRO_CC)			\
+     || (defined (DEC_ALPHA)			\
+	 && defined (OSF1)))
       if (0) return Qnil; /* Shut up compiler */
 #endif
     }
--- a/src/console-msw.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/console-msw.h	Mon Aug 13 10:35:54 2007 +0200
@@ -211,7 +211,9 @@
 					  HSZ hszTopic, HSZ hszItem, HDDEDATA hdata,
 					  DWORD dwData1, DWORD dwData2);
 
-void mswindows_bump_queue (void);
+void mswindows_enqueue_misc_user_event (Lisp_Object channel,
+					Lisp_Object function,
+					Lisp_Object object);
 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),
--- a/src/console.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/console.h	Mon Aug 13 10:35:54 2007 +0200
@@ -224,6 +224,14 @@
 				 Lisp_Object pointer_bg,
 				 int dest_mask, Lisp_Object domain);
 #endif
+#ifdef HAVE_WINDOW_SYSTEM
+    /* which is more tacky - this or #defines in glyphs.c? */
+  void (*xbm_instantiate_method)(Lisp_Object image_instance, 
+				 Lisp_Object instantiator,
+				 Lisp_Object pointer_fg, 
+				 Lisp_Object pointer_bg,
+				 int dest_mask, Lisp_Object domain);
+#endif
   Lisp_Object image_conversion_list;
 
 #ifdef HAVE_TOOLBARS
--- a/src/dbxrc	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/dbxrc	Mon Aug 13 10:35:54 2007 +0200
@@ -284,8 +284,6 @@
     pstruct symbol_value_varalias
   elif lrecord_type_p toolbar_button; then
     pstruct toolbar_button
-  elif lrecord_type_p toolbar_data; then
-    pstruct toolbar_data
   elif lrecord_type_p tooltalk_message; then
     pstruct Lisp_Tooltalk_Message
   elif lrecord_type_p tooltalk_pattern; then
--- a/src/depend	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/depend	Mon Aug 13 10:35:54 2007 +0200
@@ -5,49 +5,49 @@
 #else
 LISP_UNION_H=lisp-disunion.h
 #endif
-LISP_H = lisp.h config.h lrecord.h symeval.h symsinit.h $(LISP_UNION_H)
+LISP_H = lisp.h config.h $(LISP_UNION_H)
 #ifdef HAVE_MS_WINDOWS
-console-msw.o: $(LISP_H) conslots.h console-msw.h console.h events.h opaque.h systime.h
-device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h mule-charset.h scrollbar.h specifier.h sysdep.h systime.h toolbar.h
-dialog-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h frame.h frameslots.h gui.h mule-charset.h opaque.h scrollbar.h specifier.h toolbar.h
-dired-msw.o: $(LISP_H) buffer.h bufslots.h msdos.h mule-charset.h ndir.h nt.h regex.h sysdir.h sysfile.h
-event-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h dragdrop.h events-mod.h events.h frame.h frameslots.h lstream.h menubar-msw.h msdos.h mule-charset.h nt.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h systime.h syswait.h toolbar.h
-frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
-glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h imgproc.h insdel.h lstream.h msdos.h mule-charset.h nt.h objects-msw.h objects.h opaque.h scrollbar.h specifier.h sysfile.h toolbar.h
-menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h gui.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
-objects-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h hash.h insdel.h mule-charset.h objects-msw.h objects.h specifier.h
-redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h toolbar.h window.h winslots.h
-scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
-select-msw.o: $(LISP_H) conslots.h console-msw.h console.h
-toolbar-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+console-msw.o: $(LISP_H) conslots.h console-msw.h console.h events.h lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h systime.h
+device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h
+dialog-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h frame.h frameslots.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
+dired-msw.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h nt.h regex.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h systime.h
+event-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h dragdrop.h events-mod.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h menubar-msw.h mule-charset.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h systime.h syswait.h toolbar.h
+frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-msw.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h
+menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+objects-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h specifier.h symeval.h symsinit.h
+redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h window.h winslots.h
+scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+select-msw.o: $(LISP_H) conslots.h console-msw.h console.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+toolbar-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 #endif
 #ifdef HAVE_X_WINDOWS
-balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h xintrinsic.h
-console-x.o: $(LISP_H) conslots.h console-x.h console.h process.h redisplay.h xintrinsic.h
-device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h msdos.h mule-charset.h nt.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h
-dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
-glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h conslots.h console-x.h console.h device.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h imgproc.h insdel.h lstream.h msdos.h mule-charset.h nt.h objects-x.h objects.h opaque.h scrollbar.h specifier.h sysfile.h toolbar.h xintrinsic.h xmu.h
-gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h gui-x.h gui.h mule-charset.h opaque.h scrollbar.h specifier.h toolbar.h xintrinsic.h
-input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-objects-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h insdel.h mule-charset.h objects-x.h objects.h specifier.h xintrinsic.h
-redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
-scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h redisplay.h scrollbar-x.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h
-toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
+balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h xintrinsic.h
+console-x.o: $(LISP_H) conslots.h console-x.h console.h lisp-disunion.h lisp-union.h lrecord.h process.h redisplay.h symeval.h symsinit.h xintrinsic.h
+device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h
+dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
+glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h conslots.h console-x.h console.h device.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h xintrinsic.h xmu.h
+gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h
+input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+objects-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h specifier.h symeval.h symsinit.h xintrinsic.h
+redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
+scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsManager.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h
+toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
 #endif
 #ifdef HAVE_DATABASE
-database.o: $(LISP_H) database.h msdos.h nt.h sysfile.h
+database.o: $(LISP_H) database.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
 #endif
 #ifdef MULE
-mule-canna.o: $(LISP_H) buffer.h bufslots.h file-coding.h mule-charset.h
-mule-ccl.o: $(LISP_H) buffer.h bufslots.h file-coding.h mule-ccl.h mule-charset.h
-mule-charset.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h lstream.h mule-charset.h
-mule-coding.o: $(LISP_H) buffer.h bufslots.h elhash.h insdel.h lstream.h mule-ccl.h mule-charset.h mule-coding.h
-mule-mcpath.o: $(LISP_H) buffer.h bufslots.h msdos.h mule-charset.h nt.h sysfile.h
-mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h mule-charset.h redisplay.h scrollbar.h sysdep.h window.h winslots.h
-mule.o: $(LISP_H) regex.h
+mule-canna.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
+mule-ccl.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h symeval.h symsinit.h
+mule-charset.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h
+mule-coding.o: $(LISP_H) buffer.h bufslots.h elhash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-ccl.h mule-charset.h mule-coding.h symeval.h symsinit.h
+mule-mcpath.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h
+mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h window.h winslots.h
+mule.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h regex.h symeval.h symsinit.h
 #endif
 #ifdef EXTERNAL_WIDGET
 ExternalClient-Xlib.o: extw-Xlib.h
@@ -56,145 +56,145 @@
 extw-Xlib.o: config.h extw-Xlib.h
 extw-Xt.o: config.h extw-Xlib.h extw-Xt.h
 #endif
-EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
+EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
 EmacsManager.o: EmacsManager.h EmacsManagerP.h config.h xintrinsicp.h xmmanagerp.h
 EmacsShell-sub.o: EmacsShell.h EmacsShellP.h config.h xintrinsic.h xintrinsicp.h
 EmacsShell.o: EmacsShell.h ExternalShell.h config.h xintrinsicp.h
-abbrev.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h redisplay.h scrollbar.h syntax.h window.h winslots.h
-alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h device.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h msdos.h mule-charset.h nt.h puresize.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h toolbar.h window.h winslots.h
+abbrev.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h window.h winslots.h
+alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h device.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h puresize.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h systime.h toolbar.h window.h winslots.h
 alloca.o: config.h
 balloon_help.o: balloon_help.h config.h xintrinsic.h
-blocktype.o: $(LISP_H) blocktype.h
-buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h insdel.h msdos.h mule-charset.h nt.h process.h redisplay.h scrollbar.h specifier.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h
-bytecode.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h syntax.h
-callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h events.h insdel.h mule-charset.h redisplay.h scrollbar.h systime.h window.h winslots.h
-callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lstream.h msdos.h mule-charset.h nt.h paths.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h
-casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h syntax.h
-casetab.o: $(LISP_H) buffer.h bufslots.h mule-charset.h opaque.h
-chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h mule-charset.h syntax.h
-cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h
-cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
-cmds.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h syntax.h
-console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h msdos.h nt.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
-console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h gpmevent.h lstream.h msdos.h mule-charset.h nt.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h
-console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
-data.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h mule-charset.h sysfloat.h syssignal.h
-debug.o: $(LISP_H) bytecode.h debug.h
-device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h
-device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h
-dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h scrollbar.h specifier.h toolbar.h
-dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h msdos.h mule-charset.h ndir.h nt.h opaque.h regex.h sysdir.h sysfile.h
-dll.o: $(LISP_H) buffer.h bufslots.h mule-charset.h sysdll.h
-doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h msdos.h mule-charset.h nt.h sysfile.h
-doprnt.o: $(LISP_H) buffer.h bufslots.h lstream.h mule-charset.h
-dragdrop.o: $(LISP_H) dragdrop.h
-dynarr.o: $(LISP_H)
+blocktype.o: $(LISP_H) blocktype.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h
+bytecode.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h events.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h systime.h window.h winslots.h
+callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h nt.h paths.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h
+casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+casetab.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h
+chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h
+cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+cmds.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h gpmevent.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h
+console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+data.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfloat.h syssignal.h
+debug.o: $(LISP_H) bytecode.h debug.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h
+device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h
+dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
+dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h opaque.h regex.h symeval.h symsinit.h sysdir.h sysfile.h
+dll.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysdll.h
+doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h
+doprnt.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h
+dragdrop.o: $(LISP_H) dragdrop.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+dynarr.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 ecrt0.o: config.h
-editfns.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h insdel.h line-number.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syspwd.h systime.h toolbar.h window.h winslots.h
-eldap.o: $(LISP_H) eldap.h opaque.h sysdep.h
-elhash.o: $(LISP_H) bytecode.h elhash.h hash.h
-emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h msdos.h mule-charset.h nt.h paths.h process.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h
-eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h mule-charset.h opaque.h
-event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h xintrinsic.h xintrinsicp.h
-event-stream.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h gui-x.h insdel.h keymap.h lstream.h macros.h msdos.h mule-charset.h nt.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h process.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h
-event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h gpmevent.h lstream.h msdos.h mule-charset.h nt.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h
-events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h
-extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h hash.h insdel.h keymap.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h toolbar.h
-faces.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h hash.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
-file-coding.o: $(LISP_H) buffer.h bufslots.h elhash.h file-coding.h insdel.h lstream.h mule-ccl.h mule-charset.h
-fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h insdel.h lstream.h msdos.h mule-charset.h ndir.h nt.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h
-filelock.o: $(LISP_H) buffer.h bufslots.h msdos.h mule-charset.h ndir.h nt.h paths.h sysdir.h sysfile.h syspwd.h syssignal.h
-filemode.o: $(LISP_H) msdos.h nt.h sysfile.h
-floatfns.o: $(LISP_H) sysfloat.h syssignal.h
-fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h mule-charset.h scrollbar.h specifier.h systime.h toolbar.h
-font-lock.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h mule-charset.h syntax.h
-frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h
-frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h menubar.h msdos.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h toolbar.h window.h winslots.h
-free-hook.o: $(LISP_H) hash.h
-general.o: $(LISP_H)
-getloadavg.o: $(LISP_H) msdos.h nt.h sysfile.h
-glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h imgproc.h insdel.h lstream.h msdos.h mule-charset.h nt.h objects.h opaque.h scrollbar.h specifier.h sysfile.h toolbar.h
-glyphs.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h insdel.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+editfns.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syspwd.h systime.h toolbar.h window.h winslots.h
+eldap.o: $(LISP_H) eldap.h lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h sysdep.h
+elhash.o: $(LISP_H) bytecode.h elhash.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h paths.h process.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h
+eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h
+event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h toolbar.h xintrinsic.h xintrinsicp.h
+event-stream.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h blocktype.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h gui-x.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h macros.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h process.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h
+event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h gpmevent.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h
+events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h
+extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h hash.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
+faces.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h hash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+file-coding.o: $(LISP_H) buffer.h bufslots.h elhash.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-ccl.h mule-charset.h symeval.h symsinit.h
+fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h ndir.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h
+filelock.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h paths.h symeval.h symsinit.h sysdir.h sysfile.h syspwd.h syssignal.h
+filemode.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
+floatfns.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfloat.h syssignal.h
+fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h
+font-lock.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h
+frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar.h msdos.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h window.h winslots.h
+free-hook.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+general.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+getloadavg.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
+glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h
+glyphs.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 gmalloc.o: config.h getpagesize.h
-gpmevent.o: $(LISP_H) conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h sysdep.h syssignal.h systime.h systty.h
-gui.o: $(LISP_H) bytecode.h gui.h
-hash.o: $(LISP_H) elhash.h hash.h
-hftctl.o: $(LISP_H)
-hpplay.o: $(LISP_H)
-imgproc.o: $(LISP_H) imgproc.h
-indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
-inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h keymap.h lstream.h mule-charset.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h systime.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h
-input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h scrollbar.h specifier.h toolbar.h xintrinsic.h
-insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h insdel.h line-number.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h
-intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h
-keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h insdel.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
-libsst.o: $(LISP_H) libsst.h
-line-number.o: $(LISP_H) buffer.h bufslots.h insdel.h line-number.h mule-charset.h
-linuxplay.o: $(LISP_H) msdos.h nt.h sysfile.h syssignal.h
-lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h file-coding.h insdel.h lstream.h msdos.h mule-charset.h nt.h opaque.h paths.h sysfile.h sysfloat.h
-lstream.o: $(LISP_H) buffer.h bufslots.h insdel.h lstream.h msdos.h mule-charset.h nt.h sysfile.h
-macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h keymap.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
+gpmevent.o: $(LISP_H) conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h
+gui.o: $(LISP_H) bytecode.h gui.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+hash.o: $(LISP_H) elhash.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+hftctl.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+hpplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+imgproc.o: $(LISP_H) imgproc.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h systime.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h
+input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h
+insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
+intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+libsst.o: $(LISP_H) libsst.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+line-number.o: $(LISP_H) buffer.h bufslots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
+linuxplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h syssignal.h
+lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h paths.h symeval.h symsinit.h sysfile.h sysfloat.h
+lstream.o: $(LISP_H) buffer.h bufslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h sysfile.h
+macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h keymap.h lisp-disunion.h lisp-union.h lrecord.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
 malloc.o: config.h getpagesize.h
-marker.o: $(LISP_H) buffer.h bufslots.h mule-charset.h
-md5.o: $(LISP_H) buffer.h bufslots.h file-coding.h lstream.h mule-charset.h
-menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h gui.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
-minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
-msdos.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h msdos.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
-nas.o: $(LISP_H) syssignal.h
-nt.o: $(LISP_H) nt.h ntheap.h sysproc.h syssignal.h systime.h
-ntheap.o: $(LISP_H) ntheap.h
+marker.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
+md5.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h
+menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+msdos.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h msdos.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+nas.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.h
+nt.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nt.h ntheap.h symeval.h symsinit.h sysproc.h syssignal.h systime.h
+ntheap.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h ntheap.h symeval.h symsinit.h
 ntplay.o: config.h
-ntproc.o: $(LISP_H) nt.h ntheap.h process.h sysproc.h syssignal.h systime.h syswait.h
-objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h mule-charset.h objects-tty.h objects.h specifier.h syssignal.h systty.h
-objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+ntproc.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nt.h ntheap.h process.h symeval.h symsinit.h sysproc.h syssignal.h systime.h syswait.h
+objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-tty.h objects.h specifier.h symeval.h symsinit.h syssignal.h systty.h
+objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h
-opaque.o: $(LISP_H) opaque.h
-print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h insdel.h lstream.h msdos.h mule-charset.h nt.h scrollbar.h specifier.h sysfile.h syssignal.h systty.h toolbar.h
-process-nt.o: $(LISP_H) hash.h lstream.h mule-charset.h process.h procimpl.h sysdep.h
-process-unix.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lstream.h msdos.h mule-charset.h nt.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
-process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lstream.h msdos.h mule-charset.h nt.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
-profile.o: $(LISP_H) backtrace.h bytecode.h hash.h syssignal.h systime.h
-pure.o: $(LISP_H) puresize-adjust.h puresize.h
-ralloc.o: $(LISP_H) getpagesize.h
-rangetab.o: $(LISP_H) rangetab.h
+opaque.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h
+print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syssignal.h systty.h toolbar.h
+process-nt.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h procimpl.h symeval.h symsinit.h sysdep.h
+process-unix.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+profile.o: $(LISP_H) backtrace.h bytecode.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.h systime.h
+pure.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h puresize-adjust.h puresize.h symeval.h symsinit.h
+ralloc.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+rangetab.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h rangetab.h symeval.h symsinit.h
 realpath.o: config.h
-redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h faces.h frame.h frameslots.h glyphs.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h toolbar.h window.h winslots.h
-redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
-redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h window.h winslots.h
-regex.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h regex.h syntax.h
-scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
-search.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h opaque.h regex.h syntax.h
-sgiplay.o: $(LISP_H) libst.h
-sheap.o: $(LISP_H) sheap-adjust.h
-signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h
-sound.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h mule-charset.h redisplay.h sysdep.h xintrinsic.h
-specifier.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h faces.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h toolbar.h window.h winslots.h
+redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h window.h winslots.h
+regex.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h regex.h symeval.h symsinit.h syntax.h
+scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+search.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h regex.h symeval.h symsinit.h syntax.h
+sgiplay.o: $(LISP_H) libst.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+sheap.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h sheap-adjust.h symeval.h symsinit.h
+signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h
+sound.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h symeval.h symsinit.h sysdep.h xintrinsic.h
+specifier.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
 strcat.o: config.h
 strcmp.o: config.h
 strcpy.o: config.h
-strftime.o: $(LISP_H)
+strftime.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 sunOS-fix.o: config.h
-sunplay.o: $(LISP_H) sysdep.h syssignal.h
-sunpro.o: $(LISP_H)
-symbols.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h elhash.h mule-charset.h
-syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h syntax.h
-sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h msdos.h mule-charset.h ndir.h nt.h ntheap.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+sunplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysdep.h syssignal.h
+sunpro.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+symbols.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
+syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
+sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h ntheap.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
 sysdll.o: config.h sysdll.h
-termcap.o: $(LISP_H) conslots.h console.h device.h
+termcap.o: $(LISP_H) conslots.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 terminfo.o: config.h
-toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
-tooltalk.o: $(LISP_H) buffer.h bufslots.h elhash.h mule-charset.h process.h tooltalk.h
+toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+tooltalk.o: $(LISP_H) buffer.h bufslots.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h process.h symeval.h symsinit.h tooltalk.h
 tparam.o: config.h
-undo.o: $(LISP_H) buffer.h bufslots.h extents.h mule-charset.h
-unexaix.o: $(LISP_H) getpagesize.h
+undo.o: $(LISP_H) buffer.h bufslots.h extents.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
+unexaix.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 unexalpha.o: config.h
 unexapollo.o: config.h
 unexconvex.o: config.h getpagesize.h
-unexcw.o: config.h msdos.h nt.h sysfile.h
-unexec.o: $(LISP_H) getpagesize.h
+unexcw.o: config.h sysfile.h
+unexec.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 unexelf.o: config.h
-unexelfsgi.o: $(LISP_H)
+unexelfsgi.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
 unexenix.o: config.h
 unexfreebsd.o: config.h
 unexhp9k3.o: config.h sysdep.h
@@ -202,9 +202,9 @@
 unexmips.o: config.h getpagesize.h
 unexnt.o: ntheap.h
 unexsunos4.o: config.h
-vm-limit.o: $(LISP_H) mem-limits.h
-widget.o: $(LISP_H) buffer.h bufslots.h insdel.h mule-charset.h
-window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
-xgccache.o: $(LISP_H) hash.h xgccache.h
+vm-limit.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h mem-limits.h symeval.h symsinit.h
+widget.o: $(LISP_H) buffer.h bufslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
+window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+xgccache.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h xgccache.h
 xmu.o: config.h
-xselect.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h mule-charset.h objects-x.h objects.h opaque.h scrollbar.h specifier.h systime.h toolbar.h xintrinsic.h
+xselect.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h xintrinsic.h
--- a/src/device-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/device-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -105,6 +105,7 @@
      take over */
   wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
   wc.lpszMenuName = NULL;
+
   wc.lpszClassName = XEMACS_CLASS;
   wc.hIconSm = LoadImage (GetModuleHandle (NULL), XEMACS_CLASS,
 			  IMAGE_ICON, 16, 16, 0);
@@ -192,7 +193,10 @@
 		    make_int (DEVICE_MSWINDOWS_VERTSIZE(d)));
       break;
     case DM_num_bit_planes:
-      return make_int (DEVICE_MSWINDOWS_PLANES(d));
+      /* this is what X means by bitplanes therefore we ought to be
+         consistent. num planes is always 1 under mswindows and
+         therefore useless */
+      return make_int (DEVICE_MSWINDOWS_BITSPIXEL(d));
       break;
     case DM_num_color_cells:
       return make_int (DEVICE_MSWINDOWS_CELLS(d));
--- a/src/device-tty.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/device-tty.c	Mon Aug 13 10:35:54 2007 +0200
@@ -190,11 +190,9 @@
     case DM_size_device:
       return Fcons (make_int (CONSOLE_TTY_DATA (con)->width),
 		    make_int (CONSOLE_TTY_DATA (con)->height));
-      break;
+    default: /* No such device metric property for TTY devices */
+      return Qunbound;
     }
-
-  /* Do not know such property */
-  return Qunbound;
 }
 
 /************************************************************************/
--- a/src/device-x.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/device-x.c	Mon Aug 13 10:35:54 2007 +0200
@@ -1365,7 +1365,7 @@
 }
 
 DEFUN ("x-display-visual-class", Fx_display_visual_class, 0, 1, 0, /*
-Return the visual class of the X display `device' is using.
+Return the visual class of the X display DEVICE is using.
 This can be altered from the default at startup using the XResource "EmacsVisual".
 The returned value will be one of the symbols `static-gray', `gray-scale',
 `static-color', `pseudo-color', `true-color', or `direct-color'.
@@ -1388,7 +1388,7 @@
 }
 
 DEFUN ("x-display-visual-depth", Fx_display_visual_depth, 0, 1, 0, /*
-Return the bitplane depth of the visual the X display `device' is using.
+Return the bitplane depth of the visual the X display DEVICE is using.
 */
        (device))
 {
@@ -1406,25 +1406,21 @@
     case DM_size_device:
       return Fcons (make_int (DisplayWidth (dpy, DefaultScreen (dpy))),
 		    make_int (DisplayHeight (dpy, DefaultScreen (dpy))));
-      break;
     case DM_size_device_mm:
       return Fcons (make_int (DisplayWidthMM (dpy, DefaultScreen (dpy))),
 		    make_int (DisplayHeightMM (dpy, DefaultScreen (dpy))));
-      break;
     case DM_num_bit_planes:
       return make_int (DisplayPlanes (dpy, DefaultScreen (dpy)));
-      break;
     case DM_num_color_cells:
       return make_int (DisplayCells (dpy, DefaultScreen (dpy)));
-      break;
+    default: /* No such device metric property for X devices  */
+      return Qunbound;
     }
-
-  /* Do not know such property */
-  return Qunbound;
 }
 
 DEFUN ("x-server-vendor", Fx_server_vendor, 0, 1, 0, /*
-Return the vendor ID string of the X server `device' on.
+Return the vendor ID string of the X server DEVICE is on.
+Return the empty string if the vendor ID string cannot be determined.
 */
        (device))
 {
@@ -1435,7 +1431,7 @@
 }
 
 DEFUN ("x-server-version", Fx_server_version, 0, 1, 0, /*
-Return the version numbers of the X server `device' is on.
+Return the version numbers of the X server DEVICE is on.
 The returned value is a list of three integers: the major and minor
 version numbers of the X Protocol in use, and the vendor-specific release
 number.  See also `x-server-vendor'.
@@ -1739,7 +1735,7 @@
   Vx_initial_argv_list = Qnil;
 
   DEFVAR_BOOL ("x-seppuku-on-epipe", &x_seppuku_on_epipe /*
-When non-nil terminate XEmacs immediately on SIGPIPE from the X server.
+When non-nil, terminate XEmacs immediately on SIGPIPE from the X server.
 XEmacs doesn't terminate properly on some systems.
 When this variable is non-nil, XEmacs will commit immediate suicide
 when it gets a sigpipe from the X Server.
--- a/src/dialog-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/dialog-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -142,9 +142,9 @@
 	assert (w_param >= ID_ITEM_BIAS 
 		&& w_param < XVECTOR_LENGTH (XCDR (data)) + ID_ITEM_BIAS);
 	
-	get_callback (XVECTOR_DATA (XCDR (data)) [w_param - ID_ITEM_BIAS],
-		      &fn, &arg);
-	enqueue_misc_user_event (XCAR (data), fn, arg);
+	get_gui_callback (XVECTOR_DATA (XCDR (data)) [w_param - ID_ITEM_BIAS],
+			  &fn, &arg);
+	mswindows_enqueue_misc_user_event (XCAR (data), fn, arg);
 
 	DestroyWindow (hwnd);
       }
@@ -174,7 +174,7 @@
 }
 
 /* Given button TEXT, return button width in DLU */
-static INLINE unsigned int
+static inline unsigned int
 button_width (Lisp_Object text)
 {
   unsigned int width = X_DLU_PER_CHAR * XSTRING_CHAR_LENGTH (text);
--- a/src/dired-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/dired-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -75,11 +75,16 @@
 #include "buffer.h"
 #include "regex.h"
 
+#include "sysdir.h"
 #include "sysfile.h"
-#include "sysdir.h"
+#include "sysproc.h"
 
 #include <windows.h>
 #include <limits.h>
+#include <time.h>
+
+#include <winsock.h>		/* To make nt.h happy */
+#include "nt.h"		/* For prototypes */
 
 #if ROUND_FILE_SIZES > 0
 #include <math.h>		/* for floor() */
--- a/src/editfns.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/editfns.c	Mon Aug 13 10:35:54 2007 +0200
@@ -70,6 +70,8 @@
 
 Lisp_Object Qpoint, Qmark, Qregion_beginning, Qregion_end;
 
+Lisp_Object Quser_files_and_directories;
+
 /* This holds the value of `environ' produced by the previous
    call to Fset_time_zone_rule, or 0 if Fset_time_zone_rule
    has never been called.  */
@@ -770,6 +772,103 @@
   return tem;
 }
 
+static char *cached_home_directory;
+
+void
+uncache_home_directory (void)
+{
+  cached_home_directory = NULL;	/* in some cases, this may cause the leaking
+				   of a few bytes */
+}
+
+char *
+get_home_directory (void)
+{
+  int output_home_warning = 0;
+
+  if (cached_home_directory == NULL)
+    {
+      if ((cached_home_directory = getenv("HOME")) == NULL)
+	{
+#if defined(WINDOWSNT) && !defined(__CYGWIN32__)
+	  char	*homedrive, *homepath;
+ 
+	  if ((homedrive = getenv("HOMEDRIVE")) != NULL &&
+	      (homepath = getenv("HOMEPATH")) != NULL)
+	    {
+	      cached_home_directory =
+		(char *) xmalloc(strlen(homedrive) + strlen(homepath) + 1);
+	      sprintf(cached_home_directory, "%s%s", homedrive, homepath);
+	    }
+	  else
+	    {
+# if 1
+	      /*
+	       * Use the current directory.
+	       * This preserves the existing XEmacs behavior, but is different
+	       * from NT Emacs.
+	       */
+	      if (initial_directory[0] != '\0')
+		{
+		  cached_home_directory = initial_directory;
+		}
+	      else
+		{
+		  /* This will probably give the wrong value */
+		  cached_home_directory = getcwd (NULL, 0);
+		}
+# else
+	      /*
+	       * This is NT Emacs behavior
+	       */
+	      cached_home_directory = "C:\\";
+	      output_home_warning = 1;
+# endif
+	    }
+#else	/* !WINDOWSNT */
+	  /*
+	   * Unix, typically.
+	   * Using "/" isn't quite right, but what should we do?
+	   * We probably should try to extract pw_dir from /etc/passwd,
+	   * before falling back to this.
+	   */
+	  cached_home_directory = "/";
+	  output_home_warning = 1;
+#endif	/* !WINDOWSNT */
+	}
+      if (initialized && output_home_warning)
+	{
+	  warn_when_safe(Quser_files_and_directories, Qwarning, "\n"
+"	Xemacs was unable to determine a good value for the user's $HOME\n"
+"	directory, and will be using the value:\n"
+"		%s\n"
+"	This is probably incorrect.",
+			 cached_home_directory
+			 );
+	}
+    }
+  return (cached_home_directory);
+}
+
+DEFUN ("user-home-directory", Fuser_home_directory, 0, 0, 0, /*
+Return the user's home directory, as a string.
+*/
+       ())
+{
+  Lisp_Object directory;
+  char *path;
+
+  directory = Qnil;
+  path = get_home_directory ();
+  if (path != NULL)
+    {
+      directory =
+	Fexpand_file_name (Fsubstitute_in_file_name (build_string (path)),
+			   Qnil);
+    }
+  return (directory);
+}
+
 DEFUN ("system-name", Fsystem_name, 0, 0, 0, /*
 Return the name of the machine you are running on, as a string.
 */
@@ -2116,6 +2215,7 @@
   defsymbol (&Qregion_beginning, "region-beginning");
   defsymbol (&Qregion_end, "region-end");
   defsymbol (&Qformat, "format");
+  defsymbol (&Quser_files_and_directories, "user-files-and-directories");
 
   DEFSUBR (Fchar_equal);
   DEFSUBR (Fchar_Equal);
@@ -2157,6 +2257,7 @@
   DEFSUBR (Fuser_uid);
   DEFSUBR (Fuser_real_uid);
   DEFSUBR (Fuser_full_name);
+  DEFSUBR (Fuser_home_directory);
   DEFSUBR (Femacs_pid);
   DEFSUBR (Fcurrent_time);
   DEFSUBR (Fcurrent_process_time);
--- a/src/emacs.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/emacs.c	Mon Aug 13 10:35:54 2007 +0200
@@ -1572,6 +1572,17 @@
      of this stuff involves querying the current environment and needs
      to be done both at dump time and at run time. */
 
+  init_initial_directory();		/* get the directory to use for the
+					   "*scratch*" buffer, etc. */
+
+#ifdef WINDOWSNT
+  /*
+   * For Win32, call init_environment() now, so that environment/registry
+   * variables will be properly entered into Vprocess_envonment.
+   */
+  init_environment();
+#endif
+
   init_callproc ();	/* Set up the process environment (so that egetenv
 			   works), the basic directory variables
 			   (exec-directory and so on), and stuff
@@ -1586,10 +1597,9 @@
   init_environment (argc, argv, skip_args);
 #endif
   init_cmdargs (argc, argv, skip_args);	/* Create list Vcommand_line_args */
-  init_buffer (); /* Init default directory of *scratch* buffer */
+  init_buffer ();	/* Set default directory of *scratch* buffer */
 
 #ifdef WINDOWSNT
-  init_environment();
   init_ntproc();
 #endif
 
--- a/src/event-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/event-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -839,7 +839,8 @@
 {
   return (sevt->event_type == key_press_event
 	  || sevt->event_type == button_press_event
-	  || sevt->event_type == button_release_event);
+	  || sevt->event_type == button_release_event
+	  || sevt->event_type == misc_user_event);
 }
 
 /* 
@@ -859,16 +860,25 @@
   PostMessage (NULL, XM_BUMPQUEUE, 0, 0);
 }
 
+/*
+ * Add a misc-user event to the dispatch queue.
+ *
+ * Stuff it into our own dispatch queue, so we have something
+ * to return from next_event callback.
+ */
 void
-mswindows_bump_queue (void)
+mswindows_enqueue_misc_user_event (Lisp_Object channel, Lisp_Object function,
+				   Lisp_Object object)
 {
-  /* Bump queue, by putting in an empty event */
-  Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
-  struct Lisp_Event* event = XEVENT (emacs_event);
+  Lisp_Object event = Fmake_event (Qnil, Qnil);
+  struct Lisp_Event* e = XEVENT (event);
 
-  event->event_type = empty_event;
+  e->event_type = misc_user_event;
+  e->channel = channel;
+  e->event.misc.function = function;
+  e->event.misc.object = object;
 
-  mswindows_enqueue_dispatch_event (emacs_event);
+  mswindows_enqueue_dispatch_event (event);
 }
 
 static void
@@ -877,7 +887,7 @@
   Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
   struct Lisp_Event* event = XEVENT (emacs_event);
 
-  event->channel = mswindows_find_frame (hwnd);
+  event->channel = hwnd ? mswindows_find_frame (hwnd) : Qnil;
   event->timestamp = GetMessageTime();
   event->event_type = magic_event;
   EVENT_MSWINDOWS_MAGIC_TYPE (event) = message;
@@ -1321,7 +1331,7 @@
                          that a cycle of the command loop will
                          occur. */
 		      drain_signal_event_pipe ();
-		      mswindows_bump_queue();
+		      mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE);
 		    }
 		}
 	    }
@@ -1382,7 +1392,7 @@
 	    kick_status_notify ();
 	    /* Have to return something: there may be no accompanying
 	       process event */
-	    mswindows_bump_queue ();
+	    mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE);
 	  }
       }
 #endif
@@ -1559,8 +1569,7 @@
 
   case WM_CLOSE:
     fobj = mswindows_find_frame (hwnd);
-    enqueue_misc_user_event (fobj, Qeval, list3 (Qdelete_frame, fobj, Qt));
-    mswindows_bump_queue ();
+    mswindows_enqueue_misc_user_event (fobj, Qeval, list3 (Qdelete_frame, fobj, Qt));
     break;
 
   case WM_KEYDOWN:
@@ -1584,6 +1593,9 @@
 	  MSG msg = { hwnd, message, wParam, lParam, GetMessageTime(), (GetMessagePos()) };
 	  memcpy (keymap_orig, keymap, 256);
 
+	  /* Remove shift modifier from an ascii character */
+	  mods &= ~MOD_SHIFT;
+
 	  /* Clear control and alt modifiers out of the keymap */
 	  keymap [VK_RCONTROL] = 0;
 	  keymap [VK_LMENU] = 0;
@@ -1602,14 +1614,8 @@
 	  while (PeekMessage (&msg, hwnd, WM_CHAR, WM_CHAR, PM_REMOVE)
 		 || PeekMessage (&msg, hwnd, WM_SYSCHAR, WM_SYSCHAR, PM_REMOVE))
 	    {
+	      int mods1 = mods;
 	      WPARAM ch = msg.wParam;
-	      /* CH is a character code for the key: 
-		 'C' for Shift+C and Ctrl+Shift+C
-		 'c' for c and Ctrl+c */
-
-	      /* XEmacs doesn't seem to like Shift on non-alpha keys */
-	      if (!IsCharAlpha ((TCHAR)ch))
-		mods &= ~MOD_SHIFT;
 
 	      /* If a quit char with no modifiers other than control and
 		 shift, then mark it with a fake modifier, which is removed
@@ -1620,16 +1626,19 @@
 		   || (quit_ch >= ' ' && !(mods & MOD_CONTROL) && quit_ch == ch))
 		  && ((mods  & ~(MOD_CONTROL | MOD_SHIFT)) == 0))
 		{
-		  mods |= FAKE_MOD_QUIT;
+		  mods1 |= FAKE_MOD_QUIT;
 		  ++mswindows_quit_chars_count;
 		}
 
-	      mswindows_enqueue_keypress_event (hwnd, make_char(ch), mods);
+	      mswindows_enqueue_keypress_event (hwnd, make_char(ch), mods1);
 	    } /* while */
 	  SetKeyboardState (keymap_orig);
 	} /* else */
     }
-    goto defproc;
+    /* F10 causes menu activation by default. We do not want this */
+    if (wParam != VK_F10)
+      goto defproc;
+    break;
 
   case WM_MBUTTONDOWN:
   case WM_MBUTTONUP:
@@ -1832,8 +1841,9 @@
 
 	  if (!NILP(btext))
 	    {
-	      strncpy (tttext->szText, XSTRING_DATA (btext), XSTRING_LENGTH(btext)+1);
-	      tttext->lpszText=tttext->szText;
+	      /* I think this is safe since the text will only go away
+                 when the toolbar does...*/
+	      tttext->lpszText=XSTRING_DATA (btext);
 	    }
 #if 0
 	  tttext->uFlags |= TTF_DI_SETITEM;
@@ -2005,7 +2015,7 @@
     msframe  = FRAME_MSWINDOWS_DATA (XFRAME (mswindows_find_frame (hwnd)));
     msframe->sizing = 0;
     /* Queue noop event */
-    mswindows_bump_queue ();
+    mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE);
     return 0;
 
 #ifdef HAVE_SCROLLBARS
@@ -2407,40 +2417,43 @@
 emacs_mswindows_handle_magic_event (struct Lisp_Event *emacs_event)
 {
   switch (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event))
-  {
-  case WM_SETFOCUS:
-  case WM_KILLFOCUS:
     {
-      Lisp_Object frame = EVENT_CHANNEL (emacs_event);
-      struct frame *f = XFRAME (frame);
-      int in_p = (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event) == WM_SETFOCUS);
-      Lisp_Object conser;
+    case XM_BUMPQUEUE:
+      break;
+    
+    case WM_SETFOCUS:
+    case WM_KILLFOCUS:
+      {
+	Lisp_Object frame = EVENT_CHANNEL (emacs_event);
+	struct frame *f = XFRAME (frame);
+	int in_p = (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event) == WM_SETFOCUS);
+	Lisp_Object conser;
 
-      /* struct gcpro gcpro1; */
+	/* struct gcpro gcpro1; */
 
-      /* Clear sticky modifiers here (if we had any) */
+	/* Clear sticky modifiers here (if we had any) */
 
-      conser = Fcons (frame, Fcons (FRAME_DEVICE (f), in_p ? Qt : Qnil));
-      /* GCPRO1 (conser); XXX Not necessary? */
-      emacs_handle_focus_change_preliminary (conser);
-      /* Under X the stuff up to here is done in the X event handler.
-	 I Don't know why */
-      emacs_handle_focus_change_final (conser);
-      /* UNGCPRO; */
+	conser = Fcons (frame, Fcons (FRAME_DEVICE (f), in_p ? Qt : Qnil));
+	/* GCPRO1 (conser); XXX Not necessary? */
+	emacs_handle_focus_change_preliminary (conser);
+	/* Under X the stuff up to here is done in the X event handler.
+	   I Don't know why */
+	emacs_handle_focus_change_final (conser);
+	/* UNGCPRO; */
 
-    }
-    break;
+      }
+      break;
 
-  case XM_MAPFRAME:
-  case XM_UNMAPFRAME:
-    {
-      Lisp_Object frame = EVENT_CHANNEL (emacs_event);
-      va_run_hook_with_args (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event) 
-			      == XM_MAPFRAME ?
-			      Qmap_frame_hook : Qunmap_frame_hook, 
-			      1, frame);
-    }
-    break;
+    case XM_MAPFRAME:
+    case XM_UNMAPFRAME:
+      {
+	Lisp_Object frame = EVENT_CHANNEL (emacs_event);
+	va_run_hook_with_args (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event) 
+			       == XM_MAPFRAME ?
+			       Qmap_frame_hook : Qunmap_frame_hook, 
+			       1, frame);
+      }
+      break;
 			    
       /* #### What about Enter & Leave */
 #if 0
@@ -2448,9 +2461,9 @@
 			     Qmouse_leave_frame_hook, 1, frame);
 #endif
 
-  default:
-    assert(0);
-  }
+    default:
+      assert(0);
+    }
 }
 
 static HANDLE
--- a/src/events.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/events.c	Mon Aug 13 10:35:54 2007 +0200
@@ -384,7 +384,7 @@
 Return a new event of type TYPE, with properties described by PLIST.
 
 TYPE is a symbol, either `empty', `key-press', `button-press',
- `button-release', or `motion'.  If TYPE is nil, it
+ `button-release', `misc-user' or `motion'.  If TYPE is nil, it
  defaults to `empty'.
 
 PLIST is a property list, the properties being compatible to those
@@ -392,11 +392,10 @@
  allowed:
 
  channel	-- The event channel, a frame or a console.  For
-		   button-press, button-release, motion events,
-		   this must be a frame.  For key-press
-		   events, it must be a console.  If channel is
-		   unspecified, it will be set to the selected frame
-		   or selected console, as appropriate.
+		   button-press, button-release, misc-user and motion events,
+		   this must be a frame.  For key-press events, it must be
+                   a console.  If channel is unspecified, it will be set to
+                   the selected frame or selected console, as appropriate.
  key		-- The event key, a symbol or character.  Allowed only for
 		   keypress events.
  button		-- The event button, integer 1, 2 or 3.  Allowed for
@@ -404,6 +403,9 @@
  modifiers	-- The event modifiers, a list of modifier symbols.  Allowed
 		   for key-press, button-press, button-release, motion and
 		   misc-user events.
+ function       -- Function. Allowed for misc-user events only.
+ object         -- An object, function's parameter. Allowed for misc-user
+                   events only.
  x		-- The event X coordinate, an integer.  This is relative
 		   to the left of CHANNEL's root window.  Allowed for
 		   motion, button-press, button-release and misc-user events.
@@ -501,7 +503,7 @@
 	      if (!CONSOLEP (value))
 		value = wrong_type_argument (Qconsolep, value);
 	    }
-	  else if (e->event_type != misc_user_event)
+	  else
 	    {
 	      if (!FRAMEP (value))
 		value = wrong_type_argument (Qframep, value);
@@ -671,8 +673,8 @@
 	       ? "buton-press" : "button-release");
       break;
     case misc_user_event:
-      if (!e->event.misc.button)
-	error ("Undefined button for misc-user event");
+      if (NILP (e->event.misc.function))
+	error ("Undefined function for misc-user event");
       break;
     default:
       break;
--- a/src/events.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/events.h	Mon Aug 13 10:35:54 2007 +0200
@@ -160,10 +160,7 @@
 			   command builder) will get affected.
 			-- for timer, process, magic-eval, and eval events,
 			   channel will be nil.
-			-- for scrollbar misc-user events, channel
-			   will be a window.
-			-- for menubar misc-user events, channel
-			   will be a frame.
+			-- for misc-user events, channel will be a frame.
 			-- for magic events, channel will be a frame
 			   (usually) or a device.
 
--- a/src/faces.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/faces.c	Mon Aug 13 10:35:54 2007 +0200
@@ -54,13 +54,13 @@
 /* These faces are used directly internally.  We use these variables
    to be able to reference them directly and save the overhead of
    calling Ffind_face. */
-Lisp_Object Vdefault_face, Vmodeline_face;
+Lisp_Object Vdefault_face, Vmodeline_face, V3d_object_face;
 Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face;
 Lisp_Object Vpointer_face;
 Lisp_Object Vvertical_divider_face;
 
 /* Qdefault, Qhighlight defined in general.c */
-Lisp_Object Qmodeline, Qleft_margin, Qright_margin, Qtext_cursor;
+Lisp_Object Qmodeline, Q3d_object, Qleft_margin, Qright_margin, Qtext_cursor;
 Lisp_Object Qvertical_divider;
 
 /* In the old implementation Vface_list was a list of the face names,
@@ -1752,6 +1752,7 @@
 {
   /* Qdefault defined in general.c */
   defsymbol (&Qmodeline, "modeline");
+  defsymbol (&Q3d_object, "3d-object");
   defsymbol (&Qleft_margin, "left-margin");
   defsymbol (&Qright_margin, "right-margin");
   defsymbol (&Qtext_cursor, "text-cursor");
@@ -1804,6 +1805,8 @@
 
   staticpro (&Vdefault_face);
   Vdefault_face = Qnil;
+  staticpro (&V3d_object_face);
+  V3d_object_face = Qnil;
   staticpro (&Vmodeline_face);
   Vmodeline_face = Qnil;
 
@@ -1934,11 +1937,25 @@
   set_specifier_fallback (Fget (Vdefault_face, Qreverse, Qnil),
 			 list1 (Fcons (Qnil, Qnil)));
 
+  /* mustn't inherit bg pixmaps from the default face */
+  V3d_object_face = Fmake_face (Q3d_object, build_string ("3d object face"),
+				Qnil);
+
   /* Now create the other faces that redisplay needs to refer to
      directly.  We could create them in Lisp but it's simpler this
      way since we need to get them anyway. */
   Vmodeline_face = Fmake_face (Qmodeline, build_string ("modeline face"),
 			       Qnil);
+
+  /* modeline-face should not inherit colors from the default face. */
+  set_specifier_fallback (Fget (Vmodeline_face, Qforeground, Qunbound),
+			  Fget (V3d_object_face, Qforeground, Qunbound));
+  set_specifier_fallback (Fget (Vmodeline_face, Qbackground, Qunbound),
+			  Fget (V3d_object_face, Qbackground, Qunbound));
+  set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap,
+				Qnil),
+			  Fget (V3d_object_face, Qbackground_pixmap, Qunbound));
+
   Vvertical_divider_face = Fmake_face (Qvertical_divider,
 				       build_string ("vertical divider face"),
 				       Qnil);
@@ -1946,12 +1963,12 @@
      Perhaps there must be a 3d-object-face to supply default foreground,
      background and pixmap. */
   set_specifier_fallback (Fget (Vvertical_divider_face, Qforeground, Qunbound),
-			  Fget (Vmodeline_face, Qforeground, Qunbound));
+			  Fget (V3d_object_face, Qforeground, Qunbound));
   set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground, Qunbound),
-			  Fget (Vmodeline_face, Qbackground, Qunbound));
+			  Fget (V3d_object_face, Qbackground, Qunbound));
   set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground_pixmap,
 				Qunbound),
-			  Fget (Vdefault_face, Qbackground_pixmap, Qunbound));
+			  Fget (V3d_object_face, Qbackground_pixmap, Qunbound));
 
   Vleft_margin_face = Fmake_face (Qleft_margin,
 				  build_string ("left margin face"),
--- a/src/fileio.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/fileio.c	Mon Aug 13 10:35:54 2007 +0200
@@ -988,7 +988,7 @@
       if (IS_DIRECTORY_SEP (nm[1])
 	  || nm[1] == 0)	/* ~ by itself */
 	{
-	  if (!(newdir = (Bufbyte *) egetenv ("HOME")))
+	  if (!(newdir = (Bufbyte *) get_home_directory()))
 	    newdir = (Bufbyte *) "";
 	  nm++;
 #ifdef WINDOWSNT
@@ -1015,7 +1015,7 @@
 	     "c:/").  The variable o has "~foo", so we can use the
 	     length of that string to offset nm.  August Hill, 31 Aug
 	     1998.  */
-	  newdir = (Bufbyte *) egetenv ("HOME");
+	  newdir = (Bufbyte *) get_home_directory();
 	  dostounix_filename (newdir);
 	  nm += strlen(o) + 1;
 #else  /* not WINDOWSNT */
--- a/src/floatfns.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/floatfns.c	Mon Aug 13 10:35:54 2007 +0200
@@ -694,7 +694,7 @@
   double f = extract_float (arg);
 
   if (f == 0.0)
-    return (make_int (- (((EMACS_UINT) 1) << (VALBITS - 1)))); /* most-negative-fixnum */
+    return make_int (- (int)((((EMACS_UINT) 1) << (VALBITS - 1)))); /* most-negative-fixnum */
 #ifdef HAVE_LOGB
   {
     Lisp_Object val;
--- a/src/frame-x.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/frame-x.c	Mon Aug 13 10:35:54 2007 +0200
@@ -57,6 +57,8 @@
 
 #ifdef HAVE_OFFIX_DND
 #include "offix.h"
+#endif
+#if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE)
 #include "events-mod.h"
 #endif
 
@@ -990,22 +992,37 @@
   DtDndConvertCallbackStruct *convertInfo =
     (DtDndConvertCallbackStruct *) callData;
   char *textdata = (char *) clientData;
+  char *textptr = NULL;
+  int i;
 
   if(convertInfo == NULL)
     {
       return;
     }
 
-  if((convertInfo->dragData->protocol != DtDND_BUFFER_TRANSFER) ||
+  if((convertInfo->dragData->protocol != DtDND_BUFFER_TRANSFER
+      && convertInfo->dragData->protocol != DtDND_FILENAME_TRANSFER) ||
      (convertInfo->reason != DtCR_DND_CONVERT_DATA))
     {
       return;
     }
 
-  convertInfo->dragData->data.buffers[0].bp = XtNewString(textdata);
-  convertInfo->dragData->data.buffers[0].size = strlen(textdata);
-  convertInfo->dragData->data.buffers[0].name = NULL;
-  convertInfo->dragData->numItems = 1;
+  for (textptr=textdata, i=0;
+       i<convertInfo->dragData->numItems;
+       textptr+=strlen(textptr)+1, i++)
+    {
+      if (convertInfo->dragData->protocol == DtDND_BUFFER_TRANSFER)
+	{
+	  convertInfo->dragData->data.buffers[i].bp = XtNewString(textptr);
+	  convertInfo->dragData->data.buffers[i].size = strlen(textptr);
+	  convertInfo->dragData->data.buffers[i].name = NULL;
+	}
+      else
+	{
+	  convertInfo->dragData->data.files[i] = XtNewString(textptr);
+	}
+    }
+
   convertInfo->status = DtDND_SUCCESS;
 }
 
@@ -1025,66 +1042,132 @@
   return arg;
 }
 
-DEFUN ("cde-start-drag-internal", Fcde_start_drag_internal, 1, 1, 0, /*
+DEFUN ("cde-start-drag-internal", Fcde_start_drag_internal, 3, 3, 0, /*
 Start a CDE drag from a buffer.
+First argument is the event that started the drag (must be a
+button-press-event),
+second arg defines if the data should be treated as a buffer or
+a filename transfer (set to nil for buffer transfer),
+and the third argument is a list of data strings.
+WARNING: can only handle plain/text and file: transfers!
 */
-       (text))
+       (event, dragtype, dragdata))
 {
-  if (STRINGP (text))
+  if (EVENTP (event))
     {
       struct frame *f = decode_x_frame (Fselected_frame (Qnil));
-      XEvent event;
-      Widget Wuh = FRAME_X_TEXT_WIDGET (f);
+      XEvent x_event;
+      Widget wid = FRAME_X_TEXT_WIDGET (f);
+      Display *display = XtDisplayOfObject (wid);
+      struct device *d    = get_device_from_display (display);
+      struct x_device *xd = DEVICE_X_DATA (d);
+      unsigned int modifier = 0, state = 0;
       char *Ctext;
-      Display *display = XtDisplayOfObject (Wuh);
-      Window root_window, child_window;
-      int root_x, root_y, win_x, win_y;
-      unsigned int keys_and_buttons;
-
-      if (XQueryPointer (display, RootWindow (display, DefaultScreen (display)),
-			 &root_window, &child_window, &root_x, &root_y,
-			 &win_x, &win_y, &keys_and_buttons) == False)
-	  return Qnil;
-
-      Ctext = xstrdup ((char *) XSTRING_DATA (text));
+      int numItems = 0, textlen = 0, pos = 0;
+      struct Lisp_Event *lisp_event = XEVENT(event);
+      Lisp_Object item = Qnil;
+      struct gcpro gcpro1;
+
+      /* only drag if this is really a press */
+      if (EVENT_TYPE(lisp_event) != button_press_event
+	  || !LISTP(dragdata))
+	return Qnil;
+
+      GCPRO1 (item);
 
       /*
-       * Eek - XEmacs doesn't keep the old X event around so we have to
-       * build a dummy event.  This is a truly gross hack.
+       * not so cross hack that converts a emacs event back to a XEvent
        */
 
-      event.xbutton.type = ButtonPress;
-      event.xbutton.send_event = False;
-      event.xbutton.display = XtDisplayOfObject(Wuh);
-      event.xbutton.window = XtWindowOfObject(Wuh);
-      event.xbutton.root = XRootWindow(event.xkey.display, 0);
-      event.xbutton.subwindow = 0;
-      event.xbutton.time = 0;
-      event.xbutton.x = win_x;
-      event.xbutton.y = win_y;
-      event.xbutton.x_root = root_x;
-      event.xbutton.y_root = root_y;
-      event.xbutton.state = 0;
-      event.xbutton.button = 1;
-      event.xkey.same_screen = True;
-
-      dnd_convert_cb_rec[0].callback = x_cde_convert_callback;
-      dnd_convert_cb_rec[0].closure  = (XtPointer) Ctext;
-      dnd_convert_cb_rec[1].callback = NULL;
-      dnd_convert_cb_rec[1].closure  = NULL;
-
-      dnd_destroy_cb_rec[0].callback = x_cde_destroy_callback;
-      dnd_destroy_cb_rec[0].closure  = (XtPointer) Ctext;
-      dnd_destroy_cb_rec[1].callback = NULL;
-      dnd_destroy_cb_rec[1].closure  = NULL;
-
-      CurrentDragWidget =
-	DtDndDragStart (Wuh, &event, DtDND_BUFFER_TRANSFER, 1, XmDROP_COPY,
-			dnd_convert_cb_rec,
-			dnd_destroy_cb_rec,
-			NULL, 0);
-      return Qt;
+      x_event.xbutton.type = ButtonPress;
+      x_event.xbutton.send_event = False;
+      x_event.xbutton.display = XtDisplayOfObject(wid);
+      x_event.xbutton.window = XtWindowOfObject(wid);
+      x_event.xbutton.root = XRootWindow(x_event.xkey.display, 0);
+      x_event.xbutton.subwindow = 0;
+      x_event.xbutton.time = lisp_event->timestamp;
+      x_event.xbutton.x = lisp_event->event.button.x;
+      x_event.xbutton.y = lisp_event->event.button.y;
+      x_event.xbutton.x_root = lisp_event->event.button.x; /* this is wrong */
+      x_event.xbutton.y_root = lisp_event->event.button.y;
+
+      modifier = lisp_event->event.button.modifiers;
+      if (modifier & MOD_SHIFT)   state |= ShiftMask;
+      if (modifier & MOD_CONTROL) state |= ControlMask;
+      if (modifier & MOD_META)    state |= xd->MetaMask;
+      if (modifier & MOD_SUPER)   state |= xd->SuperMask;
+      if (modifier & MOD_HYPER)   state |= xd->HyperMask;
+      if (modifier & MOD_ALT)     state |= xd->AltMask;
+      state |= Button1Mask << (lisp_event->event.button.button-1);
+
+      x_event.xbutton.state = state;
+      x_event.xbutton.button = lisp_event->event.button.button;
+      x_event.xkey.same_screen = True;
+
+      /* convert data strings into a big string */
+      item = dragdata;
+      while (!NILP (item))
+	{
+	  if (!STRINGP (XCAR (item)))
+	    {
+	      numItems=0;
+	      break;
+	    }
+	  textlen += XSTRING_LENGTH (XCAR (item)) + 1;
+	  numItems++;
+	  item = XCDR (item);
+	}
+	
+      if (numItems)
+	{
+	  /*
+	   * concatenate all strings given to one large string, with
+	   * \0 as separator. List is ended by \0.
+	   */
+	  Ctext = (char *)xmalloc (textlen+1);
+	  Ctext[0] = 0;
+	  
+	  item = dragdata;
+	  while (!NILP (item))
+	    {
+	      if (!STRINGP (XCAR (item)))
+		{
+		  numItems=0;
+		  xfree(Ctext);
+		  Ctext=NULL;
+		  break;
+		}
+	      strcpy (Ctext+pos, (CONST char *)XSTRING_DATA (XCAR (item)));
+	      pos += XSTRING_LENGTH (XCAR (item)) + 1;
+	      item = XCDR (item);
+	    }
+	  Ctext[pos] = 0;
+	  
+	  dnd_convert_cb_rec[0].callback = x_cde_convert_callback;
+	  dnd_convert_cb_rec[0].closure  = (XtPointer) Ctext;
+	  dnd_convert_cb_rec[1].callback = NULL;
+	  dnd_convert_cb_rec[1].closure  = NULL;
+	  
+	  dnd_destroy_cb_rec[0].callback = x_cde_destroy_callback;
+	  dnd_destroy_cb_rec[0].closure  = (XtPointer) Ctext;
+	  dnd_destroy_cb_rec[1].callback = NULL;
+	  dnd_destroy_cb_rec[1].closure  = NULL;
+
+	  CurrentDragWidget =
+	    DtDndDragStart (wid, &x_event,
+			    (NILP(dragtype)?DtDND_BUFFER_TRANSFER:DtDND_FILENAME_TRANSFER),
+			    numItems,
+			    XmDROP_COPY,
+			    dnd_convert_cb_rec,
+			    dnd_destroy_cb_rec,
+			    NULL, 0);
+	}
+
+      UNGCPRO;
+	  
+      return numItems?Qt:Qnil;
     }
+
   return Qnil;
 }
 
@@ -1178,11 +1261,11 @@
 #ifdef HAVE_OFFIX_DND
 
 DEFUN ("offix-start-drag-internal", Foffix_start_drag_internal, 2, 3, 0, /*
+Start a OffiX drag from a buffer.
 First arg is the event that started the drag,
 second arg should be some string, and the third
 is the type of the data (this should be an int).
 The type defaults to DndText (4).
-Start a OffiX drag from a buffer.
 */
        (event, data, dtyp))
 {
@@ -1250,9 +1333,7 @@
 	}
 
       /*
-       * Eek - XEmacs doesn't keep the old X event around so we have to
-       * build a dummy event.  This is a truly gross hack. (from CDE)
-       * but it works...
+       * not so cross hack that converts a emacs event back to a XEvent
        */
 
       x_event.xbutton.type = ButtonPress;
--- a/src/gdbinit	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/gdbinit	Mon Aug 13 10:35:54 2007 +0200
@@ -345,9 +345,6 @@
   if $imp == lrecord_toolbar_button
     pstruct toolbar_button
   else
-  if $imp == lrecord_toolbar_data
-    pstruct toolbar_data
-  else
   if $imp == lrecord_tooltalk_message
     pstruct Lisp_Tooltalk_Message
   else
@@ -416,7 +413,6 @@
   end
   end
   end
-  end
 end
 
 document pobj
--- a/src/glyphs-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/glyphs-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -43,6 +43,9 @@
 #ifdef FILE_CODING
 #include "file-coding.h"
 #endif
+#include <stdio.h>
+#include <ctype.h>
+
 
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (bmp);
 Lisp_Object Qbmp;
@@ -62,6 +65,8 @@
 
 COLORREF mswindows_string_to_color (CONST char *name);
 
+#define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3)))
+
 /************************************************************************/
 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/
 /* proper display 							*/
@@ -81,7 +86,7 @@
 
   if (DEVICE_MSWINDOWS_BITSPIXEL (d) > 0)
     {
-      int bpline=(int)(~3UL & (unsigned long)((width*3) +3));
+      int bpline = BPLINE(width * 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
@@ -126,7 +131,7 @@
     {
       int rd,gr,bl;
       quant_table *qtable;
-      int bpline= (int)(~3UL & (unsigned long)(width +3));
+      int bpline = BPLINE (width * 3);
       /* 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);
@@ -250,7 +255,7 @@
 {
   Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
   struct device *d = XDEVICE (device);
-  struct frame *f = XFRAME (DEVICE_SELECTED_FRAME (d));
+  struct frame *f;
   void* bmp_buf=0;
   int type;
   HBITMAP bitmap;
@@ -262,6 +267,8 @@
   if (NILP (DEVICE_SELECTED_FRAME (d)))
     signal_simple_error ("No selected frame on mswindows device", device);
 
+  f = XFRAME (DEVICE_SELECTED_FRAME (d));
+  
   if (dest_mask & IMAGE_COLOR_PIXMAP_MASK)
     type = IMAGE_COLOR_PIXMAP;
   else if (dest_mask & IMAGE_POINTER_MASK)
@@ -269,7 +276,7 @@
   else 
     incompatible_image_types (instantiator, dest_mask,
 			      IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK);
-  hdc = FRAME_MSWINDOWS_DC (f);
+  hdc = FRAME_MSWINDOWS_CDC (f);
 
   bitmap=CreateDIBSection (hdc,  
 			  bmp_info,
@@ -371,14 +378,18 @@
   HBITMAP mask;
   HGDIOBJ old = NULL;
   HDC hcdc = FRAME_MSWINDOWS_CDC (f);
+  unsigned char* dibits;
   BITMAPINFO* bmp_info = 
     xmalloc_and_zero (sizeof(BITMAPINFO) + sizeof(RGBQUAD));
   int i, j;
   int height = IMAGE_INSTANCE_PIXMAP_HEIGHT (image);
   
-  void* and_bits;
-  int bpline= (int)(~3UL & (unsigned long)
-		    (((IMAGE_INSTANCE_PIXMAP_WIDTH (image)+7)/8) +3));
+  void* and_bits; 
+  int maskbpline = BPLINE (((IMAGE_INSTANCE_PIXMAP_WIDTH (image)+7)/8));
+  int bpline = BPLINE (IMAGE_INSTANCE_PIXMAP_WIDTH (image) * 3); 
+
+  if (!bmp_info)
+    return;
 
   bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image);
   bmp_info->bmiHeader.biHeight = height;
@@ -388,7 +399,7 @@
   bmp_info->bmiHeader.biCompression=BI_RGB; 
   bmp_info->bmiHeader.biClrUsed = 2; 
   bmp_info->bmiHeader.biClrImportant = 2; 
-  bmp_info->bmiHeader.biSizeImage = height * bpline; 
+  bmp_info->bmiHeader.biSizeImage = height * maskbpline; 
   bmp_info->bmiColors[0].rgbRed = 0;
   bmp_info->bmiColors[0].rgbGreen = 0;
   bmp_info->bmiColors[0].rgbBlue = 0;
@@ -408,26 +419,64 @@
       return;
     }
 
-  xfree (bmp_info);
   old = SelectObject (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (image));
-  
+  /* build up an in-memory set of bits to mess with */
+  xzero (*bmp_info);
+
+  bmp_info->bmiHeader.biWidth=IMAGE_INSTANCE_PIXMAP_WIDTH (image);
+  bmp_info->bmiHeader.biHeight = -height;
+  bmp_info->bmiHeader.biPlanes=1;
+  bmp_info->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+  bmp_info->bmiHeader.biBitCount=24; 
+  bmp_info->bmiHeader.biCompression=BI_RGB; 
+  bmp_info->bmiHeader.biClrUsed = 0; 
+  bmp_info->bmiHeader.biClrImportant = 0; 
+  bmp_info->bmiHeader.biSizeImage = height * bpline;
+
+  dibits = xmalloc_and_zero (bpline * height);
+  if (GetDIBits (hcdc,
+		 IMAGE_INSTANCE_MSWINDOWS_BITMAP (image),
+		 0,
+		 height,
+		 dibits,
+		 bmp_info,
+		 DIB_RGB_COLORS) <= 0)
+    {
+      xfree (bmp_info);
+      return;
+    }
+
+  /* now set the colored bits in the mask and transparent ones to
+     black in the original */
   for(i=0; i<IMAGE_INSTANCE_PIXMAP_WIDTH (image); i++)     
     { 
       for(j=0; j<height; j++)         
 	{ 
-	  if( GetPixel( hcdc, i, j ) == transparent_color )
+	  unsigned char* idx = &dibits[j * bpline + i * 3];
+
+	  if( RGB (idx[2], idx[1], idx[0]) == transparent_color )
 	    { 
-	      SetPixel( hcdc, i, j, RGB (0,0,0));  
-	      set_mono_pixel( and_bits, bpline, height, i, j, TRUE );
+	      idx[0] = idx[1] = idx[2] = 0;
+	      set_mono_pixel( and_bits, maskbpline, height, i, j, TRUE );
 	    }
 	  else             
 	    { 
-	      set_mono_pixel( and_bits, bpline, height, i, j, FALSE );
+	      set_mono_pixel( and_bits, maskbpline, height, i, j, FALSE );
             }
 	}
     }
 
-  GdiFlush();
+  SetDIBits (hcdc,
+	     IMAGE_INSTANCE_MSWINDOWS_BITMAP (image),
+	     0,
+	     height,
+	     dibits,
+	     bmp_info,
+	     DIB_RGB_COLORS);
+
+  xfree (bmp_info);
+  xfree (dibits);
+  
   SelectObject(hcdc, old);
 
   IMAGE_INSTANCE_MSWINDOWS_MASK (image) = mask;
@@ -663,8 +712,7 @@
   
   *width = xpmimage.width;
   *height = xpmimage.height;
-  maskbpline = (int)(~3UL & (unsigned long)
-		     (((~7UL & (unsigned long)(*width + 7)) / 8) + 3));
+  maskbpline = BPLINE (((~7UL & (unsigned long)(*width + 7)) / 8));
   
   *data = xnew_array_and_zero (unsigned char, *width * *height * 3);
 
@@ -687,46 +735,60 @@
 
   for (i=0; i<xpmimage.ncolors; i++)
     {
-				/* pick up symbolic colors */
-      if (xpmimage.colorTable[i].c_color == 0 
-	  &&
-	  xpmimage.colorTable[i].symbolic != 0)
+      /* goto alert!!!! */
+      /* pick up symbolic colors in preference */
+      if (xpmimage.colorTable[i].symbolic)
 	{
-	  if (!color_symbols)
+	  if (!strcasecmp (xpmimage.colorTable[i].symbolic,"BgColor")
+	      ||
+	      !strcasecmp (xpmimage.colorTable[i].symbolic,"None"))
 	    {
-	      xfree (*data);
-	      xfree (colortbl);
-	      XpmFreeXpmImage (&xpmimage);
-	      XpmFreeXpmInfo (&xpminfo);
-	      return 0;
+	      *transp=TRUE;
+	      colortbl[i]=transparent_color; 
+	      transp_idx=i;
+	      goto label_found_color;
 	    }
-	  for (j = 0; j<nsymbols; j++)
+	  else if (color_symbols)
 	    {
-	      if (!strcmp (xpmimage.colorTable[i].symbolic,
-			   color_symbols[j].name ))
+	      for (j = 0; j<nsymbols; j++)
 		{
-		  colortbl[i]=color_symbols[j].color;		  
+		  if (!strcmp (xpmimage.colorTable[i].symbolic,
+			       color_symbols[j].name ))
+		    {
+		      colortbl[i]=color_symbols[j].color;
+		      goto label_found_color;
+		    }
 		}
 	    }
+	  else if (xpmimage.colorTable[i].c_color == 0)
+	    {
+	      goto label_no_color;
+	    }
 	}
-				/* pick up transparencies */
-      else if (!strcasecmp (xpmimage.colorTable[i].c_color,"None")
-	       ||
-	       (xpmimage.colorTable[i].symbolic
-		&&
-		(!strcasecmp (xpmimage.colorTable[i].symbolic,"BgColor")
-		 ||
-		 !strcasecmp (xpmimage.colorTable[i].symbolic,"None"))))
+      /* pick up transparencies */
+      if (!strcasecmp (xpmimage.colorTable[i].c_color,"None"))
 	{
 	  *transp=TRUE;
 	  colortbl[i]=transparent_color; 
 	  transp_idx=i;
+	  goto label_found_color;
 	}
-      else
+      /* finally pick up a normal color spec */
+      if (xpmimage.colorTable[i].c_color)
 	{
 	  colortbl[i]=
 	    mswindows_string_to_color (xpmimage.colorTable[i].c_color);
+	  goto label_found_color;
 	}
+      
+    label_no_color:
+      xfree (*data);
+      xfree (colortbl);
+      XpmFreeXpmImage (&xpmimage);
+      XpmFreeXpmInfo (&xpminfo);
+      return 0;
+      
+    label_found_color:;
     }
 
   /* convert the image */
@@ -1179,6 +1241,483 @@
     CHECK_INT (data);
 }
 
+/**********************************************************************
+ *                             XBM                                    *
+ **********************************************************************/
+#ifndef HAVE_X_WINDOWS
+/* $XConsortium: RdBitF.c,v 1.10 94/04/17 20:16:13 kaleb Exp $ */
+
+/*
+
+Copyright (c) 1988  X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+*/
+
+/*
+ * This file contains miscellaneous utility routines and is not part of the
+ * Xlib standard.
+ *
+ * Public entry points:
+ *
+ *     XmuReadBitmapData		read data from FILE descriptor
+ *     XmuReadBitmapDataFromFile	read X10 or X11 format bitmap files
+ *					and return data
+ *
+ * Note that this file and ../X/XRdBitF.c look very similar....  Keep them
+ * that way (but don't use common source code so that people can have one 
+ * without the other).
+ */
+
+
+/*
+ * Based on an optimized version provided by Jim Becker, Auguest 5, 1988.
+ */
+#ifndef BitmapSuccess
+#define BitmapSuccess           0
+#define BitmapOpenFailed        1
+#define BitmapFileInvalid       2
+#define BitmapNoMemory          3
+#endif
+#define MAX_SIZE 255
+
+/* shared data for the image read/parse logic */
+static short hexTable[256];		/* conversion value */
+static int initialized = FALSE;	/* easier to fill in at run time */
+
+/*
+ *	Table index for the hex values. Initialized once, first time.
+ *	Used for translation value or delimiter significance lookup.
+ */
+static void initHexTable()
+{
+    /*
+     * We build the table at run time for several reasons:
+     *
+     *     1.  portable to non-ASCII machines.
+     *     2.  still reentrant since we set the init flag after setting table.
+     *     3.  easier to extend.
+     *     4.  less prone to bugs.
+     */
+    hexTable['0'] = 0;	hexTable['1'] = 1;
+    hexTable['2'] = 2;	hexTable['3'] = 3;
+    hexTable['4'] = 4;	hexTable['5'] = 5;
+    hexTable['6'] = 6;	hexTable['7'] = 7;
+    hexTable['8'] = 8;	hexTable['9'] = 9;
+    hexTable['A'] = 10;	hexTable['B'] = 11;
+    hexTable['C'] = 12;	hexTable['D'] = 13;
+    hexTable['E'] = 14;	hexTable['F'] = 15;
+    hexTable['a'] = 10;	hexTable['b'] = 11;
+    hexTable['c'] = 12;	hexTable['d'] = 13;
+    hexTable['e'] = 14;	hexTable['f'] = 15;
+
+    /* delimiters of significance are flagged w/ negative value */
+    hexTable[' '] = -1;	hexTable[','] = -1;
+    hexTable['}'] = -1;	hexTable['\n'] = -1;
+    hexTable['\t'] = -1;
+	
+    initialized = TRUE;
+}
+
+/*
+ *	read next hex value in the input stream, return -1 if EOF
+ */
+static int NextInt ( FILE *fstream )
+{
+    int	ch;
+    int	value = 0;
+    int gotone = 0;
+    int done = 0;
+    
+    /* loop, accumulate hex value until find delimiter  */
+    /* skip any initial delimiters found in read stream */
+
+    while (!done) {
+	ch = getc(fstream);
+	if (ch == EOF) {
+	    value	= -1;
+	    done++;
+	} else {
+	    /* trim high bits, check type and accumulate */
+	    ch &= 0xff;
+	    if (isascii(ch) && isxdigit(ch)) {
+		value = (value << 4) + hexTable[ch];
+		gotone++;
+	    } else if ((hexTable[ch]) < 0 && gotone)
+	      done++;
+	}
+    }
+    return value;
+}
+
+
+/*
+ * The data returned by the following routine is always in left-most byte
+ * first and left-most bit first.  If it doesn't return BitmapSuccess then
+ * its arguments won't have been touched.  This routine should look as much
+ * like the Xlib routine XReadBitmapfile as possible.
+ */
+int read_bitmap_data (fstream, width, height, datap, x_hot, y_hot)
+    FILE *fstream;			/* handle on file  */
+    unsigned int *width, *height;	/* RETURNED */
+    unsigned char **datap;		/* RETURNED */
+    int *x_hot, *y_hot;			/* RETURNED */
+{
+    unsigned char *data = NULL;		/* working variable */
+    char line[MAX_SIZE];		/* input line from file */
+    int size;				/* number of bytes of data */
+    char name_and_type[MAX_SIZE];	/* an input line */
+    char *type;				/* for parsing */
+    int value;				/* from an input line */
+    int version10p;			/* boolean, old format */
+    int padding;			/* to handle alignment */
+    int bytes_per_line;			/* per scanline of data */
+    unsigned int ww = 0;		/* width */
+    unsigned int hh = 0;		/* height */
+    int hx = -1;			/* x hotspot */
+    int hy = -1;			/* y hotspot */
+
+#define Xmalloc(size) malloc(size)
+
+    /* first time initialization */
+    if (initialized == FALSE) initHexTable();
+
+    /* error cleanup and return macro	*/
+#define	RETURN(code) { if (data) free (data); return code; }
+
+    while (fgets(line, MAX_SIZE, fstream)) {
+	if (strlen(line) == MAX_SIZE-1) {
+	    RETURN (BitmapFileInvalid);
+	}
+	if (sscanf(line,"#define %s %d",name_and_type,&value) == 2) {
+	    if (!(type = strrchr(name_and_type, '_')))
+	      type = name_and_type;
+	    else
+	      type++;
+
+	    if (!strcmp("width", type))
+	      ww = (unsigned int) value;
+	    if (!strcmp("height", type))
+	      hh = (unsigned int) value;
+	    if (!strcmp("hot", type)) {
+		if (type-- == name_and_type || type-- == name_and_type)
+		  continue;
+		if (!strcmp("x_hot", type))
+		  hx = value;
+		if (!strcmp("y_hot", type))
+		  hy = value;
+	    }
+	    continue;
+	}
+    
+	if (sscanf(line, "static short %s = {", name_and_type) == 1)
+	  version10p = 1;
+	else if (sscanf(line,"static unsigned char %s = {",name_and_type) == 1)
+	  version10p = 0;
+	else if (sscanf(line, "static char %s = {", name_and_type) == 1)
+	  version10p = 0;
+	else
+	  continue;
+
+	if (!(type = strrchr(name_and_type, '_')))
+	  type = name_and_type;
+	else
+	  type++;
+
+	if (strcmp("bits[]", type))
+	  continue;
+    
+	if (!ww || !hh)
+	  RETURN (BitmapFileInvalid);
+
+	if ((ww % 16) && ((ww % 16) < 9) && version10p)
+	  padding = 1;
+	else
+	  padding = 0;
+
+	bytes_per_line = (ww+7)/8 + padding;
+
+	size = bytes_per_line * hh;
+	data = (unsigned char *) Xmalloc ((unsigned int) size);
+	if (!data) 
+	  RETURN (BitmapNoMemory);
+
+	if (version10p) {
+	    unsigned char *ptr;
+	    int bytes;
+
+	    for (bytes=0, ptr=data; bytes<size; (bytes += 2)) {
+		if ((value = NextInt(fstream)) < 0)
+		  RETURN (BitmapFileInvalid);
+		*(ptr++) = value;
+		if (!padding || ((bytes+2) % bytes_per_line))
+		  *(ptr++) = value >> 8;
+	    }
+	} else {
+	    unsigned char *ptr;
+	    int bytes;
+
+	    for (bytes=0, ptr=data; bytes<size; bytes++, ptr++) {
+		if ((value = NextInt(fstream)) < 0) 
+		  RETURN (BitmapFileInvalid);
+		*ptr=value;
+	    }
+	}
+	break;
+    }					/* end while */
+
+    if (data == NULL) {
+	RETURN (BitmapFileInvalid);
+    }
+
+    *datap = data;
+    data = NULL;
+    *width = ww;
+    *height = hh;
+    if (x_hot) *x_hot = hx;
+    if (y_hot) *y_hot = hy;
+
+    RETURN (BitmapSuccess);
+}
+
+
+int read_bitmap_data_from_file (CONST char *filename, unsigned int *width, 
+				unsigned int *height, unsigned char **datap,
+				int *x_hot, int *y_hot)
+{
+    FILE *fstream;
+    int status;
+
+    if ((fstream = fopen (filename, "r")) == NULL) {
+	return BitmapOpenFailed;
+    }
+    status = read_bitmap_data (fstream, width, height, datap, x_hot, y_hot);
+    fclose (fstream);
+    return status;
+}
+#endif /* HAVE_X_WINDOWS */
+
+/* this table flips four bits around. */
+static int flip_table[] =
+{
+  0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15
+};
+
+/* the bitmap data comes in the following format: Widths are padded to
+   a multiple of 8.  Scan lines are stored in increasing byte order
+   from left to right, little-endian within a byte.  0 = white, 1 =
+   black.  It must be converted to the following format: Widths are
+   padded to a multiple of 16.  Scan lines are stored in increasing
+   byte order from left to right, big-endian within a byte.  0 =
+   black, 1 = white.  */
+static HBITMAP
+xbm_create_bitmap_from_data (char *data,
+			     unsigned int width, unsigned int height)
+{
+  int old_width = (width + 7)/8;
+  int new_width = 2*((width + 15)/16);
+  unsigned char *offset;
+  unsigned char *new_data, *new_offset;
+  unsigned int i;
+  int j;
+  HBITMAP hb;
+
+  new_data = (unsigned char *) xmalloc (height*new_width);
+  for (i=0; i<height; i++)
+    {
+      offset = data + i*old_width;
+      new_offset = new_data + i*new_width;
+      new_offset[new_width - 1] = 0; /* there may be an extra byte
+                                        that needs to be padded */
+      for (j=0; j<old_width; j++)
+	{
+	  int byte = offset[j];
+	  new_offset[j] = ~ (unsigned char)
+	    ((flip_table[byte & 0xf] << 4) + flip_table[byte >> 4]);
+	}
+    }
+  hb = CreateBitmap (width, height, 1, 1, new_data);
+  xfree (new_data);
+
+  return hb;
+}
+
+/* Given inline data for a mono pixmap, initialize the given
+   image instance accordingly. */
+
+static void
+init_image_instance_from_xbm_inline (struct Lisp_Image_Instance *ii,
+				     int width, int height,
+				     /* Note that data is in ext-format! */
+				     CONST char *bits,
+				     Lisp_Object instantiator,
+				     Lisp_Object pointer_fg,
+				     Lisp_Object pointer_bg,
+				     int dest_mask,
+				     HBITMAP mask,
+				     Lisp_Object mask_filename)
+{
+  Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
+  Lisp_Object foreground = find_keyword_in_vector (instantiator, Q_foreground);
+  Lisp_Object background = find_keyword_in_vector (instantiator, Q_background);
+  enum image_instance_type type;
+
+  if (!DEVICE_MSWINDOWS_P (XDEVICE (device)))
+    signal_simple_error ("Not an MS-Windows device", device);
+
+  if ((dest_mask & IMAGE_MONO_PIXMAP_MASK) &&
+      (dest_mask & IMAGE_COLOR_PIXMAP_MASK))
+    {
+      if (!NILP (foreground) || !NILP (background))
+	type = IMAGE_COLOR_PIXMAP;
+      else
+	type = IMAGE_MONO_PIXMAP;
+    }
+  else if (dest_mask & IMAGE_MONO_PIXMAP_MASK)
+    type = IMAGE_MONO_PIXMAP;
+  else if (dest_mask & IMAGE_COLOR_PIXMAP_MASK)
+    type = IMAGE_COLOR_PIXMAP;
+  else if (dest_mask & IMAGE_POINTER_MASK)
+    type = IMAGE_POINTER;
+  else
+    incompatible_image_types (instantiator, dest_mask,
+			      IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK
+			      | IMAGE_POINTER_MASK);
+
+  mswindows_initialize_dibitmap_image_instance (ii, type);
+  IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = width;
+  IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = height;
+  IMAGE_INSTANCE_PIXMAP_FILENAME (ii) =
+    find_keyword_in_vector (instantiator, Q_file);
+  XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii), 0);
+  XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii), 0);
+  IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = 1;
+  IMAGE_INSTANCE_MSWINDOWS_MASK (ii) = mask;
+  IMAGE_INSTANCE_MSWINDOWS_BITMAP (ii) =
+    xbm_create_bitmap_from_data ((Extbyte *) bits, width, height);
+
+  switch (type)
+    {
+    case IMAGE_MONO_PIXMAP:
+      break;
+
+    case IMAGE_COLOR_PIXMAP:
+      {
+	unsigned long fg = PALETTERGB (0,0,0);
+	unsigned long bg = PALETTERGB (255,255,255);
+
+	if (!NILP (foreground) && !COLOR_INSTANCEP (foreground))
+	  foreground =
+	    Fmake_color_instance (foreground, device,
+				  encode_error_behavior_flag (ERROR_ME));
+
+	if (COLOR_INSTANCEP (foreground))
+	  fg = COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (foreground));
+
+	if (!NILP (background) && !COLOR_INSTANCEP (background))
+	  background =
+	    Fmake_color_instance (background, device,
+				  encode_error_behavior_flag (ERROR_ME));
+
+	if (COLOR_INSTANCEP (background))
+	  bg = COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (background));
+
+	IMAGE_INSTANCE_PIXMAP_FG (ii) = foreground;
+	IMAGE_INSTANCE_PIXMAP_BG (ii) = background;
+      }
+      break;
+
+    case IMAGE_POINTER:
+      {
+	if (NILP (foreground))
+	  foreground = pointer_fg;
+	if (NILP (background))
+	  background = pointer_bg;
+
+	IMAGE_INSTANCE_PIXMAP_FG (ii) = foreground;
+	IMAGE_INSTANCE_PIXMAP_BG (ii) = background;
+	IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) =
+	  find_keyword_in_vector (instantiator, Q_hotspot_x);
+	IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) =
+	  find_keyword_in_vector (instantiator, Q_hotspot_y);
+      }
+      break;
+
+    default:
+      abort ();
+    }
+}
+
+static void
+xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
+		   Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+		   int dest_mask, int width, int height,
+		   /* Note that data is in ext-format! */
+		   CONST char *bits)
+{
+  Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data);
+  Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file);
+  struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  HBITMAP mask = 0;
+  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 =
+	xbm_create_bitmap_from_data ( (unsigned char *)
+				      gcc_may_you_rot_in_hell,
+				      XINT (XCAR (mask_data)),
+				      XINT (XCAR (XCDR (mask_data))));
+    }
+
+  init_image_instance_from_xbm_inline (ii, width, height, bits,
+				       instantiator, pointer_fg, pointer_bg,
+				       dest_mask, mask, mask_file);
+}
+
+/* Instantiate method for XBM's. */
+
+static void
+mswindows_xbm_instantiate (Lisp_Object image_instance, 
+			   Lisp_Object instantiator,
+			   Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+			   int dest_mask, Lisp_Object domain)
+{
+  Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
+  CONST char *gcc_go_home;
+
+  assert (!NILP (data));
+
+  GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (data))),
+				   gcc_go_home);
+
+  xbm_instantiate_1 (image_instance, instantiator, pointer_fg,
+		     pointer_bg, dest_mask, XINT (XCAR (data)),
+		     XINT (XCAR (XCDR (data))), gcc_go_home);
+}
+
 
 /************************************************************************/
 /*                      image instance methods                          */
@@ -1315,6 +1854,7 @@
 #ifdef HAVE_XPM
   CONSOLE_HAS_METHOD (mswindows, xpm_instantiate);
 #endif
+  CONSOLE_HAS_METHOD (mswindows, xbm_instantiate);
 }
 
 void
--- a/src/glyphs-x.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/glyphs-x.c	Mon Aug 13 10:35:54 2007 +0200
@@ -93,12 +93,6 @@
 
 #define LISP_DEVICE_TO_X_SCREEN(dev) XDefaultScreenOfDisplay (DEVICE_X_DISPLAY (XDEVICE (dev)))
 
-DEFINE_IMAGE_INSTANTIATOR_FORMAT (xbm);
-Lisp_Object Qxbm;
-
-Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y;
-Lisp_Object Q_foreground, Q_background;
-
 #ifdef HAVE_XFACE
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (xface);
 Lisp_Object Qxface;
@@ -853,212 +847,12 @@
     }
 }
 
-
-/**********************************************************************
- *                             XBM                                    *
- **********************************************************************/
-
-/* Check if DATA represents a valid inline XBM spec (i.e. a list
-   of (width height bits), with checking done on the dimensions).
-   If not, signal an error. */
-
-static void
-check_valid_xbm_inline (Lisp_Object data)
-{
-  Lisp_Object width, height, bits;
-
-  if (!CONSP (data) ||
-      !CONSP (XCDR (data)) ||
-      !CONSP (XCDR (XCDR (data))) ||
-      !NILP (XCDR (XCDR (XCDR (data)))))
-    signal_simple_error ("Must be list of 3 elements", data);
-
-  width  = XCAR (data);
-  height = XCAR (XCDR (data));
-  bits   = XCAR (XCDR (XCDR (data)));
-
-  CHECK_STRING (bits);
-
-  if (!NATNUMP (width))
-    signal_simple_error ("Width must be a natural number", width);
-
-  if (!NATNUMP (height))
-    signal_simple_error ("Height must be a natural number", height);
-
-  if (((XINT (width) * XINT (height)) / 8) > XSTRING_CHAR_LENGTH (bits))
-    signal_simple_error ("data is too short for width and height",
-			 vector3 (width, height, bits));
-}
-
-/* Validate method for XBM's. */
-
-static void
-xbm_validate (Lisp_Object instantiator)
-{
-  file_or_data_must_be_present (instantiator);
-}
-
-/* Given a filename that is supposed to contain XBM data, return
-   the inline representation of it as (width height bits).  Return
-   the hotspot through XHOT and YHOT, if those pointers are not 0.
-   If there is no hotspot, XHOT and YHOT will contain -1.
-
-   If the function fails:
-
-   -- if OK_IF_DATA_INVALID is set and the data was invalid,
-      return Qt.
-   -- maybe return an error, or return Qnil.
- */
-
-
-static Lisp_Object
-bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot,
-		     int ok_if_data_invalid)
+int read_bitmap_data_from_file (CONST char *filename, unsigned int *width, 
+				unsigned int *height, unsigned char **datap,
+				int *x_hot, int *y_hot)
 {
-  unsigned int w, h;
-  Extbyte *data;
-  int result;
-  CONST char *filename_ext;
-
-  GET_C_STRING_FILENAME_DATA_ALLOCA (name, filename_ext);
-  result = XmuReadBitmapDataFromFile (filename_ext, &w, &h, &data, xhot, yhot);
-
-  if (result == BitmapSuccess)
-    {
-      Lisp_Object retval;
-      int len = (w + 7) / 8 * h;
-
-      retval = list3 (make_int (w), make_int (h),
-		      make_ext_string (data, len, FORMAT_BINARY));
-      XFree ((char *) data);
-      return retval;
-    }
-
-  switch (result)
-    {
-    case BitmapOpenFailed:
-      {
-	/* should never happen */
-	signal_double_file_error ("Opening bitmap file",
-				  "no such file or directory",
-				  name);
-      }
-    case BitmapFileInvalid:
-      {
-	if (ok_if_data_invalid)
-	  return Qt;
-	signal_double_file_error ("Reading bitmap file",
-				  "invalid data in file",
-				  name);
-      }
-    case BitmapNoMemory:
-      {
-	signal_double_file_error ("Reading bitmap file",
-				  "out of memory",
-				  name);
-      }
-    default:
-      {
-	signal_double_file_error_2 ("Reading bitmap file",
-				    "unknown error code",
-				    make_int (result), name);
-      }
-    }
-
-  return Qnil; /* not reached */
-}
-
-static Lisp_Object
-xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file,
-		       Lisp_Object mask_file)
-{
-  /* This is unclean but it's fairly standard -- a number of the
-     bitmaps in /usr/include/X11/bitmaps use it -- so we support
-     it. */
-  if (NILP (mask_file)
-      /* don't override explicitly specified mask data. */
-      && NILP (assq_no_quit (Q_mask_data, alist))
-      && !NILP (file))
-    {
-      mask_file =
-	locate_pixmap_file (concat2 (file, build_string ("Mask")));
-      if (NILP (mask_file))
-	mask_file =
-	  locate_pixmap_file (concat2 (file, build_string ("msk")));
-    }
-
-  if (!NILP (mask_file))
-    {
-      Lisp_Object mask_data =
-	bitmap_to_lisp_data (mask_file, 0, 0, 0);
-      alist = remassq_no_quit (Q_mask_file, alist);
-      /* there can't be a :mask-data at this point. */
-      alist = Fcons (Fcons (Q_mask_file, mask_file),
-		     Fcons (Fcons (Q_mask_data, mask_data), alist));
-    }
-
-  return alist;
-}
-
-/* Normalize method for XBM's. */
-
-static Lisp_Object
-xbm_normalize (Lisp_Object inst, Lisp_Object console_type)
-{
-  Lisp_Object file = Qnil, mask_file = Qnil;
-  struct gcpro gcpro1, gcpro2, gcpro3;
-  Lisp_Object alist = Qnil;
-
-  GCPRO3 (file, mask_file, alist);
-
-  /* Now, convert any file data into inline data for both the regular
-     data and the mask data.  At the end of this, `data' will contain
-     the inline data (if any) or Qnil, and `file' will contain
-     the name this data was derived from (if known) or Qnil.
-     Likewise for `mask_file' and `mask_data'.
-
-     Note that if we cannot generate any regular inline data, we
-     skip out. */
-
-  file = potential_pixmap_file_instantiator (inst, Q_file, Q_data,
-					     console_type);
-  mask_file = potential_pixmap_file_instantiator (inst, Q_mask_file,
-						  Q_mask_data, console_type);
-
-  if (CONSP (file)) /* failure locating filename */
-    signal_double_file_error ("Opening bitmap file",
-			      "no such file or directory",
-			      Fcar (file));
-
-  if (NILP (file) && NILP (mask_file)) /* no conversion necessary */
-    RETURN_UNGCPRO (inst);
-
-  alist = tagged_vector_to_alist (inst);
-
-  if (!NILP (file))
-    {
-      int xhot, yhot;
-      Lisp_Object data = bitmap_to_lisp_data (file, &xhot, &yhot, 0);
-      alist = remassq_no_quit (Q_file, alist);
-      /* there can't be a :data at this point. */
-      alist = Fcons (Fcons (Q_file, file),
-		     Fcons (Fcons (Q_data, data), alist));
-
-      if (xhot != -1 && NILP (assq_no_quit (Q_hotspot_x, alist)))
-	alist = Fcons (Fcons (Q_hotspot_x, make_int (xhot)),
-		       alist);
-      if (yhot != -1 && NILP (assq_no_quit (Q_hotspot_y, alist)))
-	alist = Fcons (Fcons (Q_hotspot_y, make_int (yhot)),
-		       alist);
-    }
-
-  alist = xbm_mask_file_munging (alist, file, mask_file);
-
-  {
-    Lisp_Object result = alist_to_tagged_vector (Qxbm, alist);
-    free_alist (alist);
-    RETURN_UNGCPRO (result);
-  }
+  return XmuReadBitmapDataFromFile (filename, width, height, 
+				    datap, x_hot, y_hot);
 }
 
 /* Given inline data for a mono pixmap, create and return the
@@ -1214,15 +1008,6 @@
       abort ();
     }
 }
-
-static int
-xbm_possible_dest_types (void)
-{
-  return
-    IMAGE_MONO_PIXMAP_MASK  |
-    IMAGE_COLOR_PIXMAP_MASK |
-    IMAGE_POINTER_MASK;
-}
 
 static void
 xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
@@ -1247,7 +1032,7 @@
 				XINT (XCAR (XCDR (mask_data))),
 				(CONST unsigned char *)
 				gcc_may_you_rot_in_hell);
-}
+    }
 
   init_image_instance_from_xbm_inline (ii, width, height, bits,
 				       instantiator, pointer_fg, pointer_bg,
@@ -1257,9 +1042,9 @@
 /* Instantiate method for XBM's. */
 
 static void
-xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
-		  Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-		  int dest_mask, Lisp_Object domain)
+x_xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
+		   Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+		   int dest_mask, Lisp_Object domain)
 {
   Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
   CONST char *gcc_go_home;
@@ -3554,7 +3339,7 @@
 		   Fcons (Fcons (Q_data, data), alist));
   }
 
-  alist = xbm_mask_file_munging (alist, file, mask_file);
+  alist = xbm_mask_file_munging (alist, file, mask_file, console_type);
 
   {
     Lisp_Object result = alist_to_tagged_vector (Qxface, alist);
@@ -3708,7 +3493,7 @@
 	    alist = Fcons (Fcons (Q_hotspot_y, make_int (yhot)),
 			   alist);
 
-	  alist = xbm_mask_file_munging (alist, filename, Qnil);
+	  alist = xbm_mask_file_munging (alist, filename, Qnil, console_type);
 
 	  {
 	    Lisp_Object result = alist_to_tagged_vector (Qxbm, alist);
@@ -4335,13 +4120,6 @@
   DEFSUBR (Fresize_subwindow);
   DEFSUBR (Fforce_subwindow_map);
 #endif
-
-  defkeyword (&Q_mask_file, ":mask-file");
-  defkeyword (&Q_mask_data, ":mask-data");
-  defkeyword (&Q_hotspot_x, ":hotspot-x");
-  defkeyword (&Q_hotspot_y, ":hotspot-y");
-  defkeyword (&Q_foreground, ":foreground");
-  defkeyword (&Q_background, ":background");
 }
 
 void
@@ -4359,29 +4137,12 @@
 #ifdef HAVE_XPM
   CONSOLE_HAS_METHOD (x, xpm_instantiate);
 #endif
+  CONSOLE_HAS_METHOD (x, xbm_instantiate);
 }
 
 void
 image_instantiator_format_create_glyphs_x (void)
 {
-  /* image-instantiator types */
-
-  INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xbm, "xbm");
-
-  IIFORMAT_HAS_METHOD (xbm, validate);
-  IIFORMAT_HAS_METHOD (xbm, normalize);
-  IIFORMAT_HAS_METHOD (xbm, possible_dest_types);
-  IIFORMAT_HAS_METHOD (xbm, instantiate);
-
-
-  IIFORMAT_VALID_KEYWORD (xbm, Q_data, check_valid_xbm_inline);
-  IIFORMAT_VALID_KEYWORD (xbm, Q_file, check_valid_string);
-  IIFORMAT_VALID_KEYWORD (xbm, Q_mask_data, check_valid_xbm_inline);
-  IIFORMAT_VALID_KEYWORD (xbm, Q_mask_file, check_valid_string);
-  IIFORMAT_VALID_KEYWORD (xbm, Q_hotspot_x, check_valid_int);
-  IIFORMAT_VALID_KEYWORD (xbm, Q_hotspot_y, check_valid_int);
-  IIFORMAT_VALID_KEYWORD (xbm, Q_foreground, check_valid_string);
-  IIFORMAT_VALID_KEYWORD (xbm, Q_background, check_valid_string);
 
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (cursor_font, "cursor-font");
 
--- a/src/glyphs.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/glyphs.c	Mon Aug 13 10:35:54 2007 +0200
@@ -55,7 +55,6 @@
 Lisp_Object Qconst_glyph_variable;
 Lisp_Object Qmono_pixmap, Qcolor_pixmap, Qsubwindow;
 Lisp_Object Q_file, Q_data, Q_face;
-Lisp_Object Qicon;
 Lisp_Object Qformatted_string;
 
 Lisp_Object Vcurrent_display_table;
@@ -72,8 +71,19 @@
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (string);
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (formatted_string);
 
-Lisp_Object x_locate_pixmap_file (Lisp_Object name);
-Lisp_Object mswindows_locate_pixmap_file (Lisp_Object name);
+#ifdef HAVE_WINDOW_SYSTEM
+DEFINE_IMAGE_INSTANTIATOR_FORMAT (xbm);
+Lisp_Object Qxbm;
+
+Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y;
+Lisp_Object Q_foreground, Q_background;
+#ifndef BitmapSuccess
+#define BitmapSuccess           0
+#define BitmapOpenFailed        1
+#define BitmapFileInvalid       2
+#define BitmapNoMemory          3
+#endif
+#endif
 
 #ifdef HAVE_XPM
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (xpm);
@@ -1533,6 +1543,243 @@
 }
 
 
+#ifdef HAVE_WINDOW_SYSTEM
+/**********************************************************************
+ *                             XBM                                    *
+ **********************************************************************/
+
+/* Check if DATA represents a valid inline XBM spec (i.e. a list
+   of (width height bits), with checking done on the dimensions).
+   If not, signal an error. */
+
+static void
+check_valid_xbm_inline (Lisp_Object data)
+{
+  Lisp_Object width, height, bits;
+
+  if (!CONSP (data) ||
+      !CONSP (XCDR (data)) ||
+      !CONSP (XCDR (XCDR (data))) ||
+      !NILP (XCDR (XCDR (XCDR (data)))))
+    signal_simple_error ("Must be list of 3 elements", data);
+
+  width  = XCAR (data);
+  height = XCAR (XCDR (data));
+  bits   = XCAR (XCDR (XCDR (data)));
+
+  CHECK_STRING (bits);
+
+  if (!NATNUMP (width))
+    signal_simple_error ("Width must be a natural number", width);
+
+  if (!NATNUMP (height))
+    signal_simple_error ("Height must be a natural number", height);
+
+  if (((XINT (width) * XINT (height)) / 8) > XSTRING_CHAR_LENGTH (bits))
+    signal_simple_error ("data is too short for width and height",
+			 vector3 (width, height, bits));
+}
+
+/* Validate method for XBM's. */
+
+static void
+xbm_validate (Lisp_Object instantiator)
+{
+  file_or_data_must_be_present (instantiator);
+}
+
+/* Given a filename that is supposed to contain XBM data, return
+   the inline representation of it as (width height bits).  Return
+   the hotspot through XHOT and YHOT, if those pointers are not 0.
+   If there is no hotspot, XHOT and YHOT will contain -1.
+
+   If the function fails:
+
+   -- if OK_IF_DATA_INVALID is set and the data was invalid,
+      return Qt.
+   -- maybe return an error, or return Qnil.
+ */
+
+
+Lisp_Object
+bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot,
+		     int ok_if_data_invalid)
+{
+  unsigned int w, h;
+  Extbyte *data;
+  int result;
+  CONST char *filename_ext;
+
+  GET_C_STRING_FILENAME_DATA_ALLOCA (name, filename_ext);
+  result = read_bitmap_data_from_file (filename_ext, &w, &h, 
+				       &data, xhot, yhot);
+
+  if (result == BitmapSuccess)
+    {
+      Lisp_Object retval;
+      int len = (w + 7) / 8 * h;
+
+      retval = list3 (make_int (w), make_int (h),
+		      make_ext_string (data, len, FORMAT_BINARY));
+      XFree ((char *) data);
+      return retval;
+    }
+
+  switch (result)
+    {
+    case BitmapOpenFailed:
+      {
+	/* should never happen */
+	signal_double_file_error ("Opening bitmap file",
+				  "no such file or directory",
+				  name);
+      }
+    case BitmapFileInvalid:
+      {
+	if (ok_if_data_invalid)
+	  return Qt;
+	signal_double_file_error ("Reading bitmap file",
+				  "invalid data in file",
+				  name);
+      }
+    case BitmapNoMemory:
+      {
+	signal_double_file_error ("Reading bitmap file",
+				  "out of memory",
+				  name);
+      }
+    default:
+      {
+	signal_double_file_error_2 ("Reading bitmap file",
+				    "unknown error code",
+				    make_int (result), name);
+      }
+    }
+
+  return Qnil; /* not reached */
+}
+
+Lisp_Object
+xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file,
+		       Lisp_Object mask_file, Lisp_Object console_type)
+{
+  /* This is unclean but it's fairly standard -- a number of the
+     bitmaps in /usr/include/X11/bitmaps use it -- so we support
+     it. */
+  if (NILP (mask_file)
+      /* don't override explicitly specified mask data. */
+      && NILP (assq_no_quit (Q_mask_data, alist))
+      && !NILP (file))
+    {
+      mask_file = MAYBE_LISP_CONTYPE_METH
+	(decode_console_type(console_type, ERROR_ME), 
+	 locate_pixmap_file, (concat2 (file, build_string ("Mask"))));
+      if (NILP (mask_file))
+	mask_file = MAYBE_LISP_CONTYPE_METH
+	  (decode_console_type(console_type, ERROR_ME), 
+	   locate_pixmap_file, (concat2 (file, build_string ("msk"))));
+    }
+
+  if (!NILP (mask_file))
+    {
+      Lisp_Object mask_data =
+	bitmap_to_lisp_data (mask_file, 0, 0, 0);
+      alist = remassq_no_quit (Q_mask_file, alist);
+      /* there can't be a :mask-data at this point. */
+      alist = Fcons (Fcons (Q_mask_file, mask_file),
+		     Fcons (Fcons (Q_mask_data, mask_data), alist));
+    }
+
+  return alist;
+}
+
+/* Normalize method for XBM's. */
+
+static Lisp_Object
+xbm_normalize (Lisp_Object inst, Lisp_Object console_type)
+{
+  Lisp_Object file = Qnil, mask_file = Qnil;
+  struct gcpro gcpro1, gcpro2, gcpro3;
+  Lisp_Object alist = Qnil;
+
+  GCPRO3 (file, mask_file, alist);
+
+  /* Now, convert any file data into inline data for both the regular
+     data and the mask data.  At the end of this, `data' will contain
+     the inline data (if any) or Qnil, and `file' will contain
+     the name this data was derived from (if known) or Qnil.
+     Likewise for `mask_file' and `mask_data'.
+
+     Note that if we cannot generate any regular inline data, we
+     skip out. */
+
+  file = potential_pixmap_file_instantiator (inst, Q_file, Q_data,
+					     console_type);
+  mask_file = potential_pixmap_file_instantiator (inst, Q_mask_file,
+						  Q_mask_data, console_type);
+
+  if (CONSP (file)) /* failure locating filename */
+    signal_double_file_error ("Opening bitmap file",
+			      "no such file or directory",
+			      Fcar (file));
+
+  if (NILP (file) && NILP (mask_file)) /* no conversion necessary */
+    RETURN_UNGCPRO (inst);
+
+  alist = tagged_vector_to_alist (inst);
+
+  if (!NILP (file))
+    {
+      int xhot, yhot;
+      Lisp_Object data = bitmap_to_lisp_data (file, &xhot, &yhot, 0);
+      alist = remassq_no_quit (Q_file, alist);
+      /* there can't be a :data at this point. */
+      alist = Fcons (Fcons (Q_file, file),
+		     Fcons (Fcons (Q_data, data), alist));
+
+      if (xhot != -1 && NILP (assq_no_quit (Q_hotspot_x, alist)))
+	alist = Fcons (Fcons (Q_hotspot_x, make_int (xhot)),
+		       alist);
+      if (yhot != -1 && NILP (assq_no_quit (Q_hotspot_y, alist)))
+	alist = Fcons (Fcons (Q_hotspot_y, make_int (yhot)),
+		       alist);
+    }
+
+  alist = xbm_mask_file_munging (alist, file, mask_file, console_type);
+
+  {
+    Lisp_Object result = alist_to_tagged_vector (Qxbm, alist);
+    free_alist (alist);
+    RETURN_UNGCPRO (result);
+  }
+}
+
+
+static int
+xbm_possible_dest_types (void)
+{
+  return
+    IMAGE_MONO_PIXMAP_MASK  |
+    IMAGE_COLOR_PIXMAP_MASK |
+    IMAGE_POINTER_MASK;
+}
+
+static void
+xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
+		 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+		 int dest_mask, Lisp_Object domain)
+{
+  Lisp_Object device= IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (image_instance));
+
+  MAYBE_DEVMETH (XDEVICE (device), 
+		 xbm_instantiate,
+		 (image_instance, instantiator, pointer_fg, 
+		  pointer_bg, dest_mask, domain));
+}
+
+#endif
+
+
 #ifdef HAVE_XPM
 
 /**********************************************************************
@@ -3000,7 +3247,14 @@
 #ifdef HAVE_XPM
   defkeyword (&Q_color_symbols, ":color-symbols");
 #endif
-
+#ifdef HAVE_WINDOW_SYSTEM
+  defkeyword (&Q_mask_file, ":mask-file");
+  defkeyword (&Q_mask_data, ":mask-data");
+  defkeyword (&Q_hotspot_x, ":hotspot-x");
+  defkeyword (&Q_hotspot_y, ":hotspot-y");
+  defkeyword (&Q_foreground, ":foreground");
+  defkeyword (&Q_background, ":background");
+#endif
   /* image specifiers */
 
   DEFSUBR (Fimage_specifier_p);
@@ -3067,7 +3321,6 @@
 
   /* Qbuffer defined in general.c. */
   /* Qpointer defined above */
-  defsymbol (&Qicon, "icon");
 
   /* Errors */
   deferror (&Qimage_conversion_error,
@@ -3132,6 +3385,24 @@
 
   IIFORMAT_VALID_KEYWORD (formatted_string, Q_data, check_valid_string);
 
+#ifdef HAVE_WINDOW_SYSTEM
+  INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xbm, "xbm");
+
+  IIFORMAT_HAS_METHOD (xbm, validate);
+  IIFORMAT_HAS_METHOD (xbm, normalize);
+  IIFORMAT_HAS_METHOD (xbm, possible_dest_types);
+  IIFORMAT_HAS_METHOD (xbm, instantiate);
+
+  IIFORMAT_VALID_KEYWORD (xbm, Q_data, check_valid_xbm_inline);
+  IIFORMAT_VALID_KEYWORD (xbm, Q_file, check_valid_string);
+  IIFORMAT_VALID_KEYWORD (xbm, Q_mask_data, check_valid_xbm_inline);
+  IIFORMAT_VALID_KEYWORD (xbm, Q_mask_file, check_valid_string);
+  IIFORMAT_VALID_KEYWORD (xbm, Q_hotspot_x, check_valid_int);
+  IIFORMAT_VALID_KEYWORD (xbm, Q_hotspot_y, check_valid_int);
+  IIFORMAT_VALID_KEYWORD (xbm, Q_foreground, check_valid_string);
+  IIFORMAT_VALID_KEYWORD (xbm, Q_background, check_valid_string);
+#endif /* HAVE_WINDOW_SYSTEM */
+
 #ifdef HAVE_XPM
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xpm, "xpm");
 
--- a/src/glyphs.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/glyphs.h	Mon Aug 13 10:35:54 2007 +0200
@@ -26,16 +26,6 @@
 
 #include "specifier.h"
 
-extern Lisp_Object Qxpm;
-#ifdef HAVE_XPM
-extern Lisp_Object Q_color_symbols;
-Lisp_Object evaluate_xpm_color_symbols (void);
-Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid);
-#endif
-
-DOESNT_RETURN signal_image_error (CONST char *, Lisp_Object);
-DOESNT_RETURN signal_image_error_2 (CONST char *, Lisp_Object, Lisp_Object);
-
 /************************************************************************/
 /*			Image Instantiators				*/
 /************************************************************************/
@@ -207,6 +197,8 @@
 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
                                                  int given_dest_mask,
                                                  int desired_dest_mask));
+DECLARE_DOESNT_RETURN (signal_image_error (CONST char *, Lisp_Object));
+DECLARE_DOESNT_RETURN (signal_image_error_2 (CONST char *, Lisp_Object, Lisp_Object));
 
 /************************************************************************/
 /*			Image Specifier Object				*/
@@ -404,6 +396,21 @@
 #define XIMAGE_INSTANCE_PIXMAP_BG(i) \
   IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i))
 
+#ifdef HAVE_XPM
+Lisp_Object evaluate_xpm_color_symbols (void);
+Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid);
+#endif /* HAVE_XPM */
+#ifdef HAVE_WINDOW_SYSTEM
+Lisp_Object bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot,
+				 int ok_if_data_invalid);
+int read_bitmap_data_from_file (CONST char *filename, unsigned int *width, 
+				unsigned int *height, unsigned char **datap,
+				int *x_hot, int *y_hot);
+Lisp_Object xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file,
+				   Lisp_Object mask_file, 
+				   Lisp_Object console_type);
+#endif
+
 /************************************************************************/
 /*				Glyph Object				*/
 /************************************************************************/
@@ -472,7 +479,11 @@
 #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g))
 #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g))
 
-extern Lisp_Object Q_data, Q_file, Qconst_glyph_variable;
+extern Lisp_Object Qxpm;
+extern Lisp_Object Q_data, Q_file, Q_color_symbols, Qconst_glyph_variable;
+extern Lisp_Object Qxbm;
+extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y;
+extern Lisp_Object Q_foreground, Q_background;
 extern Lisp_Object Qimage_conversion_error;
 extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph;
 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph;
--- a/src/gmalloc.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/gmalloc.c	Mon Aug 13 10:35:54 2007 +0200
@@ -500,7 +500,7 @@
       newinfo = (malloc_info *) align (newsize * sizeof (malloc_info));
       if (newinfo == NULL)
 	{
-	  (*__morecore) (-size);
+	  (*__morecore) (-(int)size);
 	  return NULL;
 	}
       memcpy (newinfo, _heapinfo, heapsize * sizeof (malloc_info));
@@ -842,7 +842,7 @@
 	{
 	  __malloc_size_t bytes = blocks * BLOCKSIZE;
 	  _heaplimit -= blocks;
-	  (*__morecore) (-bytes);
+	  (*__morecore) (-(int)bytes);
 	  _heapinfo[_heapinfo[block].free.prev].free.next
 	    = _heapinfo[block].free.next;
 	  _heapinfo[_heapinfo[block].free.next].free.prev
--- a/src/gui-x.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/gui-x.c	Mon Aug 13 10:35:54 2007 +0200
@@ -259,7 +259,7 @@
       arg = Qmenu_no_selection_hook;
     }
   else
-    get_callback (data, &fn, &arg);
+    get_gui_callback (data, &fn, &arg);
 
   /* This is the timestamp used for asserting focus so we need to get an
      up-to-date value event if no events has been dispatched to emacs
--- a/src/gui.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/gui.c	Mon Aug 13 10:35:54 2007 +0200
@@ -67,7 +67,7 @@
 /* Massage DATA to find the correct function and argument.  Used by
    popup_selection_callback() and the msw code. */
 void
-get_callback (Lisp_Object data, Lisp_Object *fn, Lisp_Object *arg)
+get_gui_callback (Lisp_Object data, Lisp_Object *fn, Lisp_Object *arg)
 {
   if (SYMBOLP (data)
       || (COMPILED_FUNCTIONP (data)
@@ -107,7 +107,7 @@
   pgui_item->suffix   = Qnil;
   pgui_item->active   = Qt;
   pgui_item->included = Qt;
-  pgui_item->config   = Qunbound;
+  pgui_item->config   = Qnil;
   pgui_item->filter   = Qnil;
   pgui_item->style    = Qnil;
   pgui_item->selected = Qnil;
--- a/src/gui.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/gui.h	Mon Aug 13 10:35:54 2007 +0200
@@ -29,7 +29,7 @@
 
 #ifdef HAVE_POPUPS
 int separator_string_p (CONST char *s);
-void get_callback (Lisp_Object, Lisp_Object *, Lisp_Object *);
+void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *);
 
 extern int popup_up_p;
 
--- a/src/indent.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/indent.c	Mon Aug 13 10:35:54 2007 +0200
@@ -649,8 +649,7 @@
   return vmotion_1 (w, orig, vtarget, ret_vpos, NULL);
 }
 
-/* Helper for Fvertical_motion and Fvertical_motion_pixels.
- * Share as much code as possible so these stay synched.
+/* Helper for Fvertical_motion.
  */
 static
 Lisp_Object vertical_motion_1 (Lisp_Object lines, Lisp_Object window,
@@ -692,7 +691,7 @@
   return make_int (value);
 }
 
-DEFUN ("vertical-motion", Fvertical_motion, 1, 2, 0, /*
+DEFUN ("vertical-motion", Fvertical_motion, 1, 3, 0, /*
 Move to start of frame line LINES lines down.
 If LINES is negative, this is moving up.
 Optional second argument is WINDOW to move in,
@@ -700,33 +699,171 @@
 
 Sets point to position found; this may be start of line
 or just the start of a continuation line.
-Returns number of lines moved; may be closer to zero than LINES
-if beginning or end of buffer was reached.
+If optional third argument PIXELS is nil, returns number
+of lines moved; may be closer to zero than LINES if beginning
+or end of buffer was reached.  If PIXELS is non-nil, the
+vertical pixel height of the motion which took place is
+returned instead of the actual number of lines moved.  A
+motion of zero lines returns the height of the current line.
 
 Note that `vertical-motion' sets WINDOW's buffer's point, not
 WINDOW's point. (This differs from FSF Emacs, which buggily always
 sets current buffer's point, regardless of WINDOW.)
 */
-       (lines, window))
+       (lines, window, pixels))
 {
-  return vertical_motion_1 (lines, window, /* pixels = */ 0);
+  return vertical_motion_1 (lines, window, !NILP (pixels));
 }
 
-DEFUN ("vertical-motion-pixels", Fvertical_motion_pixels, 1, 2, 0, /*
-Move to start of frame line LINES lines down.
-If LINES is negative, this is moving up.
+/*
+ * Like vmotion() but requested and returned movement is in pixels.
+ * HOW specifies the stopping condition.  Positive means move at least
+ * PIXELS.  Negative means at most.  Zero means as close as possible.
+ */
+Bufpos
+vmotion_pixels (Lisp_Object window, Bufpos start, int pixels, int how,
+                int *motion)
+{
+  struct window *w;
+  Bufpos eobuf, bobuf;
+  int defheight;
+  int needed;
+  int line, next;
+  int remain, abspix, dirn;
+  int elt, nelt;
+  int i;
+  line_start_cache_dynarr *cache;
+  int previous = -1;
+  int lines;
+
+  if (NILP (window))
+    window = Fselected_window (Qnil);
+
+  CHECK_WINDOW (window);
+  w = XWINDOW (window);
+
+  eobuf = BUF_ZV (XBUFFER (w->buffer));
+  bobuf = BUF_BEGV (XBUFFER (w->buffer));
+
+  default_face_height_and_width (window, &defheight, NULL);
+
+  /* guess num lines needed in line start cache + a few extra */
+  abspix = abs (pixels);
+  needed = (abspix + defheight-1)/defheight + 3;
+
+  dirn = (pixels >= 0) ? 1 : -1;
+
+  while (1)
+    {
+      elt = point_in_line_start_cache (w, start, needed);
+      assert (elt >= 0); /* in the cache */
+
+      cache = w->line_start_cache;
+      nelt  = Dynarr_length (cache);
+
+      *motion = 0;
+
+      if (pixels == 0)
+        /* No vertical motion requested so we just return the position
+           of the beginning of the current display line. */
+        return Dynarr_atp (cache, elt)->start;
+
+      if ((dirn < 0 && elt == 0      &&
+           Dynarr_atp (cache, elt)->start <= bobuf) ||
+          (dirn > 0 && elt == nelt-1 &&
+           Dynarr_atp (cache, elt)->end   >= eobuf))
+        return Dynarr_atp (cache, elt)->start;
+
+      remain = abspix;
+      for (i = elt; (dirn > 0) ? (i < nelt) : (i > 0); i += dirn)
+        {
+          /* cache line we're considering moving over */
+          int ii = (dirn > 0) ? i : i-1;
+
+          if (remain < 0)
+            return Dynarr_atp (cache, i)->start;
+
+          line = Dynarr_atp (cache, ii)->height;
+          next = remain - line;
+
+          /* is stopping condition satisfied? */
+          if ((how >  0  &&  remain <= 0)  ||       /* at least */
+              (how <  0  &&  next < 0)     ||       /* at most */
+              (how == 0  &&  remain <= abs (next))) /* closest */
+            return Dynarr_atp (cache, i)->start;
+
+          /* moving down and nowhere left to go? */
+          if (dirn > 0 && Dynarr_atp (cache, ii)->end >= eobuf)
+            return Dynarr_atp (cache, ii)->start;
+
+          /* take the step */
+          remain   = next;
+          *motion += dirn * line;
+
+          /* moving up and nowhere left to go? */
+          if (dirn < 0 && Dynarr_atp (cache, ii)->start <= bobuf)
+            return Dynarr_atp (cache, ii)->start;
+        }
+
+      /* get here => need more cache lines.  try again. */
+      assert (abs (*motion) > previous); /* progress? */
+      previous = abs (*motion);
+
+      lines   = (pixels < 0) ? elt : (nelt - elt);
+      needed += (remain*lines + abspix-1)/abspix + 3;
+    }
+
+  RETURN_NOT_REACHED(0)	/* shut up compiler */
+}
+
+DEFUN ("vertical-motion-pixels", Fvertical_motion_pixels, 1, 3, 0, /*
+Move to start of frame line PIXELS vertical pixels down.
+If PIXELS is negative, this is moving up.
+The actual vertical motion in pixels is returned.
+
 Optional second argument is WINDOW to move in,
 the default is the selected window.
 
-This function is identical in behavior to `vertical-motion'
-except that the vertical pixel height of the motion which
-took place is returned instead of the actual number of lines
-moved.  A motion of zero lines returns the height of the
-current line.
+Optional third argument HOW specifies when to stop.  A value
+less than zero indicates that the motion should be no more
+than PIXELS.  A value greater than zero indicates that the
+motion should be at least PIXELS.  Any other value indicates
+that the motion should be as close as possible to PIXELS.
 */
-       (lines, window))
+       (pixels, window, how))
 {
-  return vertical_motion_1 (lines, window, /* pixels = */ 1);
+  Bufpos bufpos;
+  Bufpos orig;
+  int selected;
+  int motion;
+  int howto;
+  struct window *w;
+
+  if (NILP (window))
+    window = Fselected_window (Qnil);
+
+  CHECK_WINDOW (window);
+  CHECK_INT (pixels);
+
+  selected = (EQ (window, Fselected_window (Qnil)));
+
+  w = XWINDOW (window);
+
+  orig = selected ? BUF_PT (XBUFFER (w->buffer))
+                  : marker_position (w->pointm[CURRENT_DISP]);
+
+  howto = INTP (how) ? XINT (how) : 0;
+
+  bufpos = vmotion_pixels (window, orig, XINT (pixels), howto, &motion);
+
+  if (selected) 
+    BUF_SET_PT (XBUFFER (w->buffer), bufpos);
+  else
+    set_marker_restricted (w->pointm[CURRENT_DISP],
+			   make_int(bufpos),
+			   w->buffer);
+
+  return make_int (motion);
 }
 
 
--- a/src/lisp.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/lisp.h	Mon Aug 13 10:35:54 2007 +0200
@@ -2040,6 +2040,8 @@
 					Bytecount, int, ...);
 
 /* Defined in editfns.c */
+void uncache_home_directory (void);
+char *get_home_directory (void);
 Bufpos bufpos_clip_to_bounds (Bufpos, Bufpos, Bufpos);
 Bytind bytind_clip_to_bounds (Bytind, Bytind, Bytind);
 void buffer_insert1 (struct buffer *, Lisp_Object);
@@ -2275,6 +2277,7 @@
 int current_column (struct buffer *);
 void invalidate_current_column (void);
 Bufpos vmotion (struct window *, Bufpos, int, int *);
+Bufpos vmotion_pixels (Lisp_Object, Bufpos, int, int, int *);
 
 /* Defined in keymap.c */
 void where_is_to_char (Lisp_Object, char *);
@@ -2694,14 +2697,16 @@
 EXFUN (Fupcase_initials, 2);
 EXFUN (Fupcase_initials_region, 3);
 EXFUN (Fupcase_region, 3);
+EXFUN (Fuser_home_directory, 0);
 EXFUN (Fuser_login_name, 1);
 EXFUN (Fvector, MANY);
 EXFUN (Fverify_visited_file_modtime, 1);
-EXFUN (Fvertical_motion, 2);
+EXFUN (Fvertical_motion, 3);
 EXFUN (Fwiden, 1);
 
 
-extern Lisp_Object Q_style, Qactually_requested, Qafter, Qall, Qand;
+extern Lisp_Object Q_style, Qactually_requested, Qactivate_menubar_hook;
+extern Lisp_Object Qafter, Qall, Qand;
 extern Lisp_Object Qarith_error, Qarrayp, Qassoc, Qat, Qautodetect, Qautoload;
 extern Lisp_Object Qbackground, Qbackground_pixmap, Qbad_variable, Qbefore;
 extern Lisp_Object Qbeginning_of_buffer, Qbig5, Qbinary, Qbitmap, Qbitp, Qblinking;
@@ -2764,7 +2769,8 @@
 extern Lisp_Object Qtext, Qtext_image_instance_p, Qtimeout, Qtimestamp;
 extern Lisp_Object Qtoolbar, Qtop, Qtop_level, Qtrue_list_p, Qtty, Qtype;
 extern Lisp_Object Qunbound, Qundecided, Qundefined, Qunderflow_error;
-extern Lisp_Object Qunderline, Qunimplemented, Qvalue_assoc, Qvalues;
+extern Lisp_Object Qunderline, Qunimplemented, Quser_files_and_directories;
+extern Lisp_Object Qvalue_assoc, Qvalues;
 extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvector;
 extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning, Qwidth, Qwindow;
 extern Lisp_Object Qwindow_live_p, Qwindow_system, Qwrong_number_of_arguments;
--- a/src/lread.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/lread.c	Mon Aug 13 10:35:54 2007 +0200
@@ -1898,7 +1898,7 @@
     }
 
   {
-    EMACS_INT int_result = negativland ? -num : num;
+    EMACS_INT int_result = negativland ? - (EMACS_INT) num : (EMACS_INT) num;
     Lisp_Object result = make_int (int_result);
     if (num && ((XINT (result) < 0) != negativland))
       goto overflow;
--- a/src/make-src-depend	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/make-src-depend	Mon Aug 13 10:35:54 2007 +0200
@@ -89,7 +89,7 @@
 #endif
 ";
 
-my @LISP_H = ('lisp.h', 'config.h', sort keys %{$uses{'lisp.h'}});
+my @LISP_H = ('lisp.h', 'config.h');
 #@LISP_H = grep (! /lisp-(dis)?union\.h/, @LISP_H);
 print "LISP_H = @{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H)\n";
 
--- a/src/menubar-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/menubar-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -594,7 +594,7 @@
 
   /* We simply ignore return value. In any case, we construct the bar
      on the fly */
-  run_hook (Vactivate_menubar_hook);
+  run_hook (Qactivate_menubar_hook);
 
   update_frame_menubar_maybe (f);
 
@@ -631,15 +631,9 @@
   menu_cleanup (f);
 
   /* Ok, this is our one. Enqueue it. */
-  get_callback (data, &fn, &arg);
-
+  get_gui_callback (data, &fn, &arg);
   XSETFRAME (frame, f);
-  enqueue_misc_user_event (frame, fn, arg);
-
-  /* Needs good bump also, for WM_COMMAND may have been dispatched from
-     mswindows_need_event, which will block again despite new command
-     event has arrived */
-  mswindows_bump_queue ();
+  mswindows_enqueue_misc_user_event (frame, fn, arg);
 
   UNGCPRO; /* data */
   return Qt;
--- a/src/msdos.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/msdos.c	Mon Aug 13 10:35:54 2007 +0200
@@ -1140,11 +1140,11 @@
   else
     {
       val = Fvector (NUM_RECENT_DOSKEYS, keys);
-      memcpy (keys + recent_doskeys_index,
-	      XVECTOR_DATA (val),
+      memcpy (XVECTOR_DATA (val),
+	      keys + recent_doskeys_index,
 	      (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object));
-      memcpy (keys,
-	      XVECTOR_DATA (val) + NUM_RECENT_DOSKEYS - recent_doskeys_index,
+      memcpy (XVECTOR_DATA (val) + NUM_RECENT_DOSKEYS - recent_doskeys_index,
+	      keys,
 	      recent_doskeys_index * sizeof (Lisp_Object));
       return val;
     }
--- a/src/mule-mcpath.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/mule-mcpath.c	Mon Aug 13 10:35:54 2007 +0200
@@ -195,7 +195,7 @@
       {
 	if (path != buffer)	/* It is not good to modify original path. */
 	  {
-	    memcpy (path, buffer, len - 1); /* no need to copy last /. */
+	    memcpy (buffer, path, len - 1); /* no need to copy last /. */
 	    path = buffer;
 	  }
 	path[len - 1] = 0;
--- a/src/nt.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/nt.c	Mon Aug 13 10:35:54 2007 +0200
@@ -33,6 +33,7 @@
 #include <fcntl.h>
 #include <ctype.h>
 #include <signal.h>
+#include <direct.h>
 
 /* must include CRT headers *before* config.h */
 /* ### I don't believe it - martin */
@@ -83,6 +84,8 @@
 #endif
 extern Lisp_Object Vmswindows_get_true_file_attributes;
 
+extern char *get_home_directory(void);
+
 static char startup_dir[ MAXPATHLEN ];
 
 /* Get the current working directory.  */
@@ -174,7 +177,7 @@
 }
 
 struct passwd *
-getpwnam (char *name)
+getpwnam (const char *name)
 {
   struct passwd *pw;
   
@@ -267,13 +270,18 @@
     }
 
   /* Ensure HOME and SHELL are defined. */
+#if 0
+  /*
+   * With XEmacs, setting $HOME is deprecated.
+   */
   if (getenv ("HOME") == NULL)
     putenv ("HOME=c:/");
+#endif
   if (getenv ("SHELL") == NULL)
     putenv ((GetVersion () & 0x80000000) ? "SHELL=command" : "SHELL=cmd");
 
   /* Set dir and shell from environment variables. */
-  strcpy (the_passwd.pw_dir, getenv ("HOME"));
+  strcpy (the_passwd.pw_dir, get_home_directory());
   strcpy (the_passwd.pw_shell, getenv ("SHELL"));
 
   if (token)
@@ -690,7 +698,7 @@
 
 static char configuration_buffer[32];
 
-char *
+const char *
 get_emacs_configuration (void)
 {
   char *arch, *oem, *os;
@@ -1122,7 +1130,7 @@
 static WIN32_FIND_DATA dir_find_data;
 
 DIR *
-opendir (char *filename)
+opendir (const char *filename)
 {
   DIR *dirp;
 
@@ -1724,7 +1732,7 @@
 	    default:
 	      buf->st_mode = _S_IFCHR;
 	    }
-	  buf->st_nlink = info.nNumberOfLinks;
+	  buf->st_nlink = (short) info.nNumberOfLinks;
 	  /* Might as well use file index to fake inode values, but this
 	     is not guaranteed to be unique unless we keep a handle open
 	     all the time (even then there are situations where it is
@@ -1759,11 +1767,8 @@
     }
 #endif
 
-  /* MSVC defines _ino_t to be short; other libc's might not.  */
-  if (sizeof (buf->st_ino) == 2)
-    buf->st_ino = fake_inode ^ (fake_inode >> 16);
-  else
-    buf->st_ino = fake_inode;
+  /* #### MSVC defines _ino_t to be short; other libc's might not.  */
+  buf->st_ino = (unsigned short) (fake_inode ^ (fake_inode >> 16));
 
   /* consider files to belong to current user */
   buf->st_uid = the_passwd.pw_uid;
@@ -1906,7 +1911,6 @@
 {
   int rc;
   unsigned flags;
-  child_process * cp;
 
   /* make pipe handles non-inheritable; when we spawn a child, we
      replace the relevant handle with an inheritable one.  Also put
@@ -1952,7 +1956,7 @@
   if ((fd_info[fd].flags & (FILE_PIPE | FILE_SOCKET)) == 0
       || (fd_info[fd].flags & FILE_READ) == 0)
     {
-      DebPrint (("_sys_read_ahead: internal error: fd %d is not a pipe or socket!\n", fd));
+      /* fd is not a pipe or socket */
       abort ();
     }
   
@@ -2047,7 +2051,6 @@
 
 	    case STATUS_READ_READY:
 	    case STATUS_READ_IN_PROGRESS:
-	      DebPrint (("sys_read called when read is in progress\n"));
 	      errno = EWOULDBLOCK;
 	      return -1;
 
@@ -2063,7 +2066,6 @@
 	      break;
 
 	    default:
-	      DebPrint (("sys_read: bad status %d\n", current_status));
 	      errno = EBADF;
 	      return -1;
 	    }
@@ -2170,7 +2172,7 @@
 
 
 void
-term_ntproc ()
+term_ntproc (int unused)
 {
 }
 
@@ -2314,19 +2316,20 @@
 {
   /* We delegate some signals to the system function */
   if (nsig == SIGFPE || nsig == SIGABRT || nsig == SIGINT)
-    {
-      signal (nsig, handler);
-      return;
-    }
+    return signal (nsig, handler);
 
   if (nsig < 0 || nsig > SIG_MAX)
     {
       errno = EINVAL;
-      return;
+      return NULL;
     }
 
   /* Store handler ptr */
-  signal_handlers[nsig] = handler;
+  {
+    msw_sighandler old_handler = signal_handlers[nsig];
+    signal_handlers[nsig] = handler;
+    return old_handler;
+  }
 }
   
 int msw_sighold (int nsig)
--- a/src/nt.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/nt.h	Mon Aug 13 10:35:54 2007 +0200
@@ -141,6 +141,9 @@
 /* Return the string resource associated with KEY of type TYPE.  */
 extern LPBYTE nt_get_resource (char * key, LPDWORD type);
 
+void set_process_dir (const char * dir);
+time_t convert_time (FILETIME ft);
+
 extern void init_ntproc ();
 extern void term_ntproc ();
 
--- a/src/ntplay.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/ntplay.c	Mon Aug 13 10:35:54 2007 +0200
@@ -22,36 +22,80 @@
 #undef CONST
 #include <config.h>
 #include <stdio.h>
+#include "sysfile.h"
+#include "lisp.h"
 
 #ifdef __CYGWIN32__
 extern BOOL WINAPI PlaySound(LPCSTR,HMODULE,DWORD);
 #endif
+static void play_sound_data_1 (unsigned char *data, int length,
+			       int volume, int convert);
 
-void play_sound_file (char *sound_file, int volume);
 void play_sound_file (char *sound_file, int volume)
 {
   DWORD flags = SND_ASYNC | SND_NODEFAULT | SND_FILENAME;
-  char* dst=0;
-#ifdef __CYGWIN32__
-  CYGWIN_WIN32_PATH(sound_file, dst);
-  sound_file=dst;
-#endif
-  if (PlaySound(sound_file, NULL, flags)==FALSE)
+  OFSTRUCT ofs;
+  Lisp_Object fname = Ffile_name_nondirectory (build_string (sound_file));
+
+  CHECK_STRING (fname);
+  if (OpenFile (XSTRING_DATA (fname), &ofs, OF_EXIST) < 0)
     {
-      perror(sound_file);
+      /* file isn't in the path so read it as data */
+      int size;
+      unsigned char* data;
+      int ofd = open (sound_file, O_RDONLY | OPEN_BINARY, 0);
+      
+      if (ofd <0)
+	return;
+
+      size = lseek (ofd, 0, SEEK_END);
+      data = xmalloc (size);
+      lseek (ofd, 0, SEEK_SET);
+      
+      if (!data)
+	{
+	  close (ofd);
+	  return;
+	}
+
+      if (read (ofd, data, size) != size)
+	{
+	  close (ofd);
+	  xfree (data);
+	  return;
+	}
+      
+      play_sound_data_1 (data, size, 100, FALSE);
+      
+      xfree (data);
+      close (ofd);
     }
+  else 
+    PlaySound (XSTRING_DATA (fname), NULL, flags);
+}
+
+/* mswindows can't cope with playing a sound from alloca space so we
+   have to convert if necessary */
+static void play_sound_data_1 (unsigned char *data, int length, int volume,
+			       int convert_to_malloc)
+{
+  DWORD flags = SND_ASYNC | SND_MEMORY | SND_NODEFAULT;
+  unsigned char* sound_data;
+  if (convert_to_malloc)
+    {
+      sound_data = xmalloc (length);
+      memcpy (sound_data, data, length);
+    }
+  else
+    sound_data = data;
+
+  PlaySound(sound_data, NULL, flags);
+  if (convert_to_malloc)
+    xfree (sound_data);
   return;
 }
 
-/* Call "linux_play_data_or_file" with the appropriate parameters for
-   playing pre-loaded data */
-void play_sound_data (unsigned char *data, int length, int volume);
 void play_sound_data (unsigned char *data, int length, int volume)
 {
-  DWORD flags = SND_ASYNC | SND_MEMORY | SND_NODEFAULT;
-  if (PlaySound(data, NULL, flags)==FALSE)
-    {
-      perror("couldn't play sound file");
-    }
-  return;
+  play_sound_data_1 (data, length, volume, TRUE);
 }
--- a/src/ntproc.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/ntproc.c	Mon Aug 13 10:35:54 2007 +0200
@@ -53,6 +53,9 @@
 #include "process.h"
 /*#include "w32term.h"*/ /* From 19.34.6: sync in ? --marcpa */
 
+/* #### I'm not going to play with shit. */
+#pragma warning (disable:4013 4024 4090)
+
 /* Control whether spawnve quotes arguments as necessary to ensure
    correct parsing by child process.  Because not all uses of spawnve
    are careful about constructing argv arrays, we make this behaviour
@@ -272,7 +275,7 @@
 /* To avoid Emacs changing directory, we just record here the directory
    the new process should start in.  This is set just before calling
    sys_spawnve, and is not generally valid at any other time.  */
-static char * process_dir;
+static const char * process_dir;
 
 static BOOL 
 create_child (char *exe, char *cmdline, char *env,
@@ -1215,7 +1218,7 @@
 }
 
 void
-set_process_dir (char * dir)
+set_process_dir (const char * dir)
 {
   process_dir = dir;
 }
@@ -1238,7 +1241,7 @@
 {
   char shortname[MAX_PATH];
 
-  CHECK_STRING (filename, 0);
+  CHECK_STRING (filename);
 
   /* first expand it.  */
   filename = Fexpand_file_name (filename, Qnil);
@@ -1262,7 +1265,7 @@
 {
   char longname[ MAX_PATH ];
 
-  CHECK_STRING (filename, 0);
+  CHECK_STRING (filename);
 
   /* first expand it.  */
   filename = Fexpand_file_name (filename, Qnil);
@@ -1290,7 +1293,7 @@
   DWORD  priority_class = NORMAL_PRIORITY_CLASS;
   Lisp_Object result = Qnil;
 
-  CHECK_SYMBOL (priority, 0);
+  CHECK_SYMBOL (priority);
 
   if (!NILP (process))
     {
@@ -1470,6 +1473,7 @@
 }
 
 
+void
 syms_of_ntproc ()
 {
   Qhigh = intern ("high");
--- a/src/objects-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/objects-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -775,14 +775,25 @@
     {
       unsigned int r,g,b;
 
-      if (sscanf(name, "rgb:%04x/%04x/%04x", &r, &g, &b) <0)
+      if (sscanf(name, "rgb:%04x/%04x/%04x", &r, &g, &b) == 3)
+	{
+	  int len = strlen (name);
+	  if (len == 18)
+	    {
+	      r /= 257;
+	      g /= 257;
+	      b /= 257;
+	    }
+	  else if (len == 15)
+	    {
+	      r /= 17;
+	      g /= 17;
+	      b /= 17;
+	    }
+	  return (PALETTERGB (r, g, b));
+	}
+      else 
 	return -1;
-
-      r /= 257;
-      g /= 257;
-      b /= 257;
-
-      return (PALETTERGB (r, g, b));
     }
   else if (*name)	/* Can't be an empty string */
     {
--- a/src/process-nt.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/process-nt.c	Mon Aug 13 10:35:54 2007 +0200
@@ -220,7 +220,7 @@
 /*
  * We handle the following signals:
  *
- * SIGKILL, SIGTERM, SIGQUIT - These three translate to ExitProcess
+ * SIGKILL, SIGTERM, SIGQUIT, SIGHUP - These four translate to ExitProcess
  *    executed by the remote process
  * SIGINT - The remote process is sent CTRL_BREAK_EVENT
  */
@@ -311,6 +311,7 @@
     case SIGKILL:
     case SIGTERM:
     case SIGQUIT:
+    case SIGHUP:
       {
 	sigkill_data d;
 	d.adr_ExitProcess = GetProcAddress (h_kernel, "ExitProcess");
@@ -366,7 +367,8 @@
 validate_signal_number (int signo)
 {
   if (signo != SIGKILL && signo != SIGTERM
-      && signo != SIGQUIT && signo != SIGINT)
+      && signo != SIGQUIT && signo != SIGINT
+      && signo != SIGHUP)
     signal_simple_error ("Signal number not supported", make_int (signo));
 }
   
@@ -417,15 +419,16 @@
 /* #### This function completely ignores Vprocess_environment */
 
 static void
-signal_cannot_launch (char* image_file, DWORD err)
+signal_cannot_launch (Lisp_Object image_file, DWORD err)
 {
   mswindows_set_errno (err);
-  error ("Starting \"%s\": %s", image_file, strerror (errno));
+  error ("Starting \"%S\": %s", image_file, strerror (errno));
 }
 
 static int
 nt_create_process (struct Lisp_Process *p,
-		   char **argv, CONST char *current_dir)
+		   Lisp_Object *argv, int nargv,
+		   Lisp_Object program, Lisp_Object cur_dir)
 {
   HANDLE hmyshove, hmyslurp, hprocin, hprocout;
   LPTSTR command_line;
@@ -435,9 +438,10 @@
   {
     /* SHGetFileInfo tends to return ERROR_FILE_NOT_FOUND on most
        errors. This leads to bogus error message. */
-    DWORD image_type = SHGetFileInfo (argv[0], 0, NULL, 0, SHGFI_EXETYPE);
+    DWORD image_type = SHGetFileInfo ((char *)XSTRING_DATA (program), 0,NULL,
+				      0, SHGFI_EXETYPE);
     if (image_type == 0)
-      signal_cannot_launch (argv[0], (GetLastError () == ERROR_FILE_NOT_FOUND
+      signal_cannot_launch (program, (GetLastError () == ERROR_FILE_NOT_FOUND
 				      ? ERROR_BAD_FORMAT : GetLastError ()));
     windowed = HIWORD (image_type) != 0;
   }
@@ -475,15 +479,16 @@
   /* Convert an argv vector into Win32 style command line by a call to
      lisp function `nt-quote-process-args' which see (in winnt.el)*/
   {
-    char** thisarg;
+    int i;
     Lisp_Object args_or_ret = Qnil;
     struct gcpro gcpro1;
-    
+
     GCPRO1 (args_or_ret);
 
-    for (thisarg = argv; *thisarg; ++thisarg)
-      args_or_ret = Fcons (build_string (*thisarg), args_or_ret);
+    for (i = 0; i < nargv; ++i)
+      args_or_ret = Fcons (*argv++, args_or_ret);
     args_or_ret = Fnreverse (args_or_ret);
+    args_or_ret = Fcons (program, args_or_ret);
 
     args_or_ret = call1 (Qnt_quote_process_args, args_or_ret);
 
@@ -491,9 +496,9 @@
       /* Luser wrote his/her own clever version */
       error ("Bogus return value from `nt-quote-process-args'");
 
-    command_line = alloca_array (char, (strlen (argv[0])
+    command_line = alloca_array (char, (XSTRING_LENGTH (program)
 					+ XSTRING_LENGTH (args_or_ret) + 2));
-    strcpy (command_line, argv[0]);
+    strcpy (command_line, XSTRING_DATA (program));
     strcat (command_line, " ");
     strcat (command_line, XSTRING_DATA (args_or_ret));
 
@@ -520,7 +525,7 @@
     err = (CreateProcess (NULL, command_line, NULL, NULL, TRUE,
 			  CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP
 			  | CREATE_SUSPENDED,
-			  NULL, current_dir, &si, &pi)
+			  NULL, (char *) XSTRING_DATA (cur_dir), &si, &pi)
 	   ? 0 : GetLastError ());
 
     if (do_io)
@@ -538,7 +543,7 @@
 	    CloseHandle (hmyshove);
 	    CloseHandle (hmyslurp);
 	  }
-	signal_cannot_launch (argv[0], GetLastError ());
+	signal_cannot_launch (program, GetLastError ());
       }
 
     /* The process started successfully */
@@ -945,4 +950,3 @@
 vars_of_process_nt (void)
 {
 }
-
--- a/src/process-unix.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/process-unix.c	Mon Aug 13 10:35:54 2007 +0200
@@ -715,7 +715,8 @@
 
 static int
 unix_create_process (struct Lisp_Process *p,
-		     char **new_argv, CONST char *current_dir)
+		     Lisp_Object *argv, int nargv,
+		     Lisp_Object program, Lisp_Object cur_dir)
 {
   /* This function rewritten by wing@666.com. */
 
@@ -724,11 +725,26 @@
   volatile int forkin, forkout;
   volatile int pty_flag = 0;
   char **env;
+  char **new_argv;
+  char *current_dir;
+  int i;
 
   env = environ;
 
   inchannel = outchannel = forkin = forkout = -1;
 
+  /* Nothing below here GCs so our string pointers shouldn't move. */
+  new_argv = alloca_array (char *, nargv + 2);
+  new_argv[0] = (char *) XSTRING_DATA (program);
+  for (i = 0; i < nargv; i++)
+    {
+      Lisp_Object tem = argv[i];
+      CHECK_STRING (tem);
+      new_argv[i + 1] = (char *) XSTRING_DATA (tem);
+    }
+  new_argv[i + 1] = 0;
+  current_dir = (char *) XSTRING_DATA (cur_dir);
+
 #ifdef HAVE_PTYS
   if (!NILP (Vprocess_connection_type))
     {
--- a/src/process.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/process.c	Mon Aug 13 10:35:54 2007 +0200
@@ -495,8 +495,8 @@
 }
 
 static void
-create_process (Lisp_Object process,
-                char **new_argv, CONST char *current_dir)
+create_process (Lisp_Object process, Lisp_Object *argv, int nargv,
+		Lisp_Object program, Lisp_Object cur_dir)
 {
   struct Lisp_Process *p = XPROCESS (process);
   int pid;
@@ -506,7 +506,7 @@
   p->status_symbol = Qrun;
   p->exit_code = 0;
 
-  pid = PROCMETH (create_process, (p, new_argv, current_dir));
+  pid = PROCMETH (create_process, (p, argv, nargv, program, cur_dir));
 
   p->pid = make_int (pid);
   if (!NILP(p->pipe_instream))
@@ -549,8 +549,6 @@
   Lisp_Object tem;
   int speccount = specpdl_depth ();
   struct gcpro gcpro1, gcpro2, gcpro3;
-  char **new_argv;
-  int i;
 
   name = args[0];
   buffer = args[1];
@@ -607,17 +605,6 @@
 	error ("Specified program for new process is a directory");
     }
 
-  /* Nothing below here GCs so our string pointers shouldn't move. */
-  new_argv = alloca_array (char *, nargs - 1);
-  new_argv[0] = (char *) XSTRING_DATA (program);
-  for (i = 3; i < nargs; i++)
-    {
-      tem = args[i];
-      CHECK_STRING (tem);
-      new_argv[i - 2] = (char *) XSTRING_DATA (tem);
-    }
-  new_argv[i - 2] = 0;
-
   proc = make_process_internal (name);
 
   XPROCESS (proc)->buffer = buffer;
@@ -635,7 +622,7 @@
      itself; it's all taken care of here.  */
   record_unwind_protect (start_process_unwind, proc);
 
-  create_process (proc, new_argv, (char *) XSTRING_DATA (current_dir));
+  create_process (proc, args + 3, nargs - 3, program, current_dir);
 
   UNGCPRO;
   return unbind_to (speccount, proc);
--- a/src/procimpl.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/procimpl.h	Mon Aug 13 10:35:54 2007 +0200
@@ -46,7 +46,8 @@
   void (*init_process_io_handles) (struct Lisp_Process *p,
 				   void* in, void* out, int flags);
   int  (*create_process) (struct Lisp_Process *p,
-			  char **new_argv, CONST char *current_dir);
+			  Lisp_Object *argv, int nargv,
+			  Lisp_Object program, Lisp_Object cur_dir);
   int  (*tooltalk_connection_p) (struct Lisp_Process *p);
 #ifdef HAVE_SOCKETS
   void (*open_network_stream) (Lisp_Object name, Lisp_Object host,
--- a/src/realpath.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/realpath.c	Mon Aug 13 10:35:54 2007 +0200
@@ -42,6 +42,10 @@
 extern int errno;
 #endif
 
+#ifdef WINDOWSNT
+#include <direct.h>
+#endif
+
 #include <sys/stat.h>			/* for S_IFLNK */
 
 #ifndef PATH_MAX
@@ -67,11 +71,13 @@
 #endif
 {
   char copy_path[PATH_MAX];
-  char link_path[PATH_MAX];
   char *new_path = resolved_path;
   char *max_path;
   int readlinks = 0;
+#ifdef S_IFLNK
+  char link_path[PATH_MAX];
   int n;
+#endif
 
   /* Make a copy of the source path since we may need to modify it. */
   strcpy(copy_path, path);
--- a/src/redisplay-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/redisplay-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -1393,20 +1393,9 @@
       mswindows_update_dc (FRAME_MSWINDOWS_DC (f),
 			   Qnil, fcolor, bcolor, background_pixmap);
 
-      if (XIMAGE_INSTANCE_PIXMAP_DEPTH (background_pixmap) == 0)
-	{
-	  /* is this expensive? - I haven't seen it used as yet. */
-	  HBRUSH brush = CreateSolidBrush 
-	    (COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (bcolor)));
-	  FillRect (FRAME_MSWINDOWS_DC(f), &rect, brush);
-	  DeleteObject (brush);
-	}
-      else
-	{
-	  mswindows_output_dibitmap_region 
-	    ( f, XIMAGE_INSTANCE (background_pixmap),
-	      x, y, 0, 0, 0, 0, width, height, 0, TRUE);
-	}
+      mswindows_output_dibitmap_region 
+	( f, XIMAGE_INSTANCE (background_pixmap),
+	  x, y, 0, 0, 0, 0, width, height, 0, TRUE);
     }
   else
     {
--- a/src/s/cygwin32.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/s/cygwin32.h	Mon Aug 13 10:35:54 2007 +0200
@@ -133,6 +133,8 @@
 #define SND_NODEFAULT		2
 #define SND_MEMORY		4
 #define SND_FILENAME		0x2000L
+#define JOHAB_CHARSET 		130
+#define MAC_CHARSET 		77
 
 #define TEXT_START -1
 #define TEXT_END -1
--- a/src/s/windowsnt.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/s/windowsnt.h	Mon Aug 13 10:35:54 2007 +0200
@@ -122,11 +122,6 @@
    your system and must be used only through an encapsulation
    (Which you should place, by convention, in sysdep.c).  */
 
-#if 0
-/* Define this to be the separator between path elements */
-#define DIRECTORY_SEP XINT (Vdirectory_sep_char)
-#endif
-
 /* XEmacs file I/O for DOS text files requires FILE_CODING */
 #define FILE_CODING
 
@@ -252,6 +247,10 @@
 int kill (int pid, int sig);
 
 /* map to MSVC names */
+#define popen     _popen
+#define pclose    _pclose
+
+#if 0
 #define chdir     _chdir
 #define execlp    _execlp
 #define execvp    _execvp
@@ -267,8 +266,6 @@
 #define logb      _logb
 #define _longjmp  longjmp
 #define lseek     _lseek
-#define popen     _popen
-#define pclose    _pclose
 #define putw      _putw
 #define umask     _umask
 /* #define utime     _utime */
@@ -282,11 +279,33 @@
 #define abort	win32_abort
 #endif
 
+#endif /* 0 */
+
+/* Encapsulation of system calls */
+#ifndef DONT_ENCAPSULATE
+#define getpid sys_getpid
+int getpid (void);
+#endif
+
 /* Random global functions called everywhere. Implemented in nt.c */
+/* #### Most of these are FSFisms and must be avoided */
+/* #### All of these are FSFisms and must be avoided */
 void dostounix_filename (char *p);
 void unixtodos_filename (char *p);
+int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
+
 char *getwd (char *dir);
 
+void *sbrk (unsigned long increment);
+
+struct passwd;
+struct passwd *getpwuid (int uid);
+struct passwd *getpwnam (const char *name);
+int getuid ();
+int geteuid ();
+int getgid (void);
+int getegid ();
+
 /* Setitimer is emulated */
 #define HAVE_SETITIMER
 
@@ -310,6 +329,7 @@
 #define getdefdir(_drv, _buf)   _getdcwd (_drv, _buf, MAXPATHLEN)
 
 #define EMACS_CONFIGURATION 	get_emacs_configuration ()
+const char *get_emacs_configuration (void);
 #define EMACS_CONFIG_OPTIONS	"NT"	/* Not very meaningful yet.  */
 
 #if 0 /* they do. -kkm */
@@ -341,14 +361,6 @@
 /* Define process implementation */
 #define HAVE_WIN32_PROCESSES
 
-#if 0
-/* Emacs takes care of ensuring that these are defined.  */
-#ifdef max
-#undef max
-#undef min
-#endif
-#endif
-
 /* We need a little extra space, see ../../lisp/loadup.el */
 #define SYSTEM_PURESIZE_EXTRA 15000
 
--- a/src/scrollbar-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/scrollbar-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -166,14 +166,15 @@
 mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos)
 {
   struct frame *f;
-  Lisp_Object win;
+  Lisp_Object win, frame;
   struct scrollbar_instance *sb;
   SCROLLINFO scrollinfo;
   int vert = GetWindowLong (hwnd, GWL_STYLE) & SBS_VERT;
 
   sb = (struct scrollbar_instance *)GetWindowLong (hwnd, GWL_USERDATA);
   win = real_window (sb->mirror, 1);
-  f = XFRAME (XWINDOW (win)->frame);
+  frame = XWINDOW (win)->frame;
+  f = XFRAME (frame);
 
   inhibit_slider_size_change = code == SB_THUMBTRACK;
 
@@ -184,39 +185,36 @@
   switch (code)
     {
     case SB_LINEDOWN:
-      enqueue_misc_user_event(win,
-			      vert ? Qscrollbar_line_down : Qscrollbar_char_right,
-			      win);
+      mswindows_enqueue_misc_user_event
+	(frame, vert ? Qscrollbar_line_down : Qscrollbar_char_right, win);
       break;
 	  
     case SB_LINEUP:
-      enqueue_misc_user_event(win,
-			      vert ? Qscrollbar_line_up : Qscrollbar_char_left,
-			      win);
+      mswindows_enqueue_misc_user_event
+	(frame, vert ? Qscrollbar_line_up : Qscrollbar_char_left, win);
       break;
 	  
     case SB_PAGEDOWN:
-      enqueue_misc_user_event(win,
-			      vert ? Qscrollbar_page_down : Qscrollbar_page_right,
-			      vert ? Fcons (win, Qnil) : win);
+      mswindows_enqueue_misc_user_event
+	(win, vert ? Qscrollbar_page_down : Qscrollbar_page_right,
+	 vert ? Fcons (win, Qnil) : win);
       break;
 
     case SB_PAGEUP:
-      enqueue_misc_user_event(win,
-			      vert ? Qscrollbar_page_up : Qscrollbar_page_left,
-			      vert ? Fcons (win, Qnil) : win);
+      mswindows_enqueue_misc_user_event
+	(frame,
+	 vert ? Qscrollbar_page_up : Qscrollbar_page_left,
+	 vert ? Fcons (win, Qnil) : win);
       break;
 	  
     case SB_BOTTOM:
-      enqueue_misc_user_event(win,
-			      vert ? Qscrollbar_to_bottom : Qscrollbar_to_right,
-			      win);
+      mswindows_enqueue_misc_user_event
+	(frame, vert ? Qscrollbar_to_bottom : Qscrollbar_to_right, win);
       break;
 
     case SB_TOP:
-      enqueue_misc_user_event(win,
-			      vert ? Qscrollbar_to_top : Qscrollbar_to_left,
-			      win);
+      mswindows_enqueue_misc_user_event
+	(frame, vert ? Qscrollbar_to_top : Qscrollbar_to_left, win);
       break;
 
     case SB_THUMBTRACK:
@@ -224,10 +222,10 @@
       scrollinfo.cbSize = sizeof(SCROLLINFO);
       scrollinfo.fMask = SIF_TRACKPOS;
       GetScrollInfo (hwnd, SB_CTL, &scrollinfo);
-      enqueue_misc_user_event (win,
-			       (vert ? Qscrollbar_vertical_drag
-				: Qscrollbar_horizontal_drag),
-			       Fcons (win, make_int (scrollinfo.nTrackPos)));
+      mswindows_enqueue_misc_user_event
+	(frame,
+	 vert ? Qscrollbar_vertical_drag : Qscrollbar_horizontal_drag,
+	 Fcons (win, make_int (scrollinfo.nTrackPos)));
       break;
     }
 }
--- a/src/scrollbar-x.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/scrollbar-x.c	Mon Aug 13 10:35:54 2007 +0200
@@ -400,7 +400,7 @@
   scroll_event *data = (scroll_event *) client_data;
   struct device *d = get_device_from_display (XtDisplay (widget));
   struct frame *f = x_any_window_to_frame (d, XtWindow (widget));
-  Lisp_Object win;
+  Lisp_Object win, frame;
   struct scrollbar_instance *instance;
   struct window_mirror *mirror;
 
@@ -413,6 +413,7 @@
   if (NILP (win))
     return;
   instance = mirror->scrollbar_vertical_instance;
+  frame = WINDOW_FRAME (XWINDOW (win));
 
   /* It seems that this is necessary whenever signal_special_Xt_user_event()
      is called.  #### Why??? */
@@ -421,11 +422,11 @@
   switch (data->action)
     {
     case SCROLLBAR_LINE_UP:
-      signal_special_Xt_user_event (win, Qscrollbar_line_up, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_line_up, win);
       break;
 
     case SCROLLBAR_LINE_DOWN:
-      signal_special_Xt_user_event (win, Qscrollbar_line_down, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_line_down, win);
       break;
 
       /* The Athena scrollbar paging behavior is that of xterms.
@@ -442,11 +443,11 @@
 
 	if (line > -1.0)
 	  line = -1.0;
-	signal_special_Xt_user_event (win, Qscrollbar_page_up,
+	signal_special_Xt_user_event (frame, Qscrollbar_page_up,
 				      Fcons (win, make_int ((int) line)));
       }
 #else
-      signal_special_Xt_user_event (win, Qscrollbar_page_up,
+      signal_special_Xt_user_event (frame, Qscrollbar_page_up,
 				    Fcons (win, Qnil));
 #endif
       break;
@@ -465,23 +466,23 @@
 	  {
 	    if (line < 1.0)
 	      line = 1.0;
-	    signal_special_Xt_user_event (win, Qscrollbar_page_down,
+	    signal_special_Xt_user_event (frame, Qscrollbar_page_down,
 					  Fcons (win,
 						 make_int ((int) line)));
 	  }
       }
 #else
-      signal_special_Xt_user_event (win, Qscrollbar_page_down,
+      signal_special_Xt_user_event (frame, Qscrollbar_page_down,
 				    Fcons (win, Qnil));
 #endif
       break;
 
     case SCROLLBAR_TOP:
-      signal_special_Xt_user_event (win, Qscrollbar_to_top, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_to_top, win);
       break;
 
     case SCROLLBAR_BOTTOM:
-      signal_special_Xt_user_event (win, Qscrollbar_to_bottom, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_to_bottom, win);
       break;
 
 
@@ -583,7 +584,7 @@
 	if (value < SCROLLBAR_X_POS_DATA (instance).minimum)
 	  value = SCROLLBAR_X_POS_DATA (instance).minimum;
 
-	signal_special_Xt_user_event (win, Qscrollbar_vertical_drag,
+	signal_special_Xt_user_event (frame, Qscrollbar_vertical_drag,
 				      Fcons (win, make_int (value)));
       }
       break;
@@ -603,7 +604,7 @@
   scroll_event *data = (scroll_event *) client_data;
   struct device *d = get_device_from_display (XtDisplay (widget));
   struct frame *f = x_any_window_to_frame (d, XtWindow (widget));
-  Lisp_Object win;
+  Lisp_Object win, frame;
   struct window_mirror *mirror;
 
   if (!f)
@@ -614,6 +615,7 @@
 
   if (NILP (win))
     return;
+  frame = WINDOW_FRAME (XWINDOW (win));
 
   /* It seems that this is necessary whenever signal_special_Xt_user_event()
      is called.  #### Why??? */
@@ -622,22 +624,22 @@
   switch (data->action)
     {
     case SCROLLBAR_LINE_UP:
-      signal_special_Xt_user_event (win, Qscrollbar_char_left, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_char_left, win);
       break;
     case SCROLLBAR_LINE_DOWN:
-      signal_special_Xt_user_event (win, Qscrollbar_char_right, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_char_right, win);
       break;
     case SCROLLBAR_PAGE_UP:
-      signal_special_Xt_user_event (win, Qscrollbar_page_left, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_page_left, win);
       break;
     case SCROLLBAR_PAGE_DOWN:
-      signal_special_Xt_user_event (win, Qscrollbar_page_right, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_page_right, win);
       break;
     case SCROLLBAR_TOP:
-      signal_special_Xt_user_event (win, Qscrollbar_to_left, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_to_left, win);
       break;
     case SCROLLBAR_BOTTOM:
-      signal_special_Xt_user_event (win, Qscrollbar_to_right, win);
+      signal_special_Xt_user_event (frame, Qscrollbar_to_right, win);
       break;
     case SCROLLBAR_CHANGE:
       inhibit_slider_size_change = 0;
@@ -647,11 +649,11 @@
       /* #### Fix the damn toolkit code so they all work the same way.
          Lucid is the one mostly wrong.*/
 #if defined (LWLIB_SCROLLBARS_LUCID) || defined (LWLIB_SCROLLBARS_ATHENA3D)
-      signal_special_Xt_user_event (win, Qscrollbar_horizontal_drag,
+      signal_special_Xt_user_event (frame, Qscrollbar_horizontal_drag,
 				    (Fcons
 				     (win, make_int (data->slider_value))));
 #else
-      signal_special_Xt_user_event (win, Qscrollbar_horizontal_drag,
+      signal_special_Xt_user_event (frame, Qscrollbar_horizontal_drag,
 				    (Fcons
 				     (win,
 				      make_int (data->slider_value - 1))));
--- a/src/select-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/select-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -145,7 +145,7 @@
 }
 
 DEFUN ("mswindows-selection-exists-p", Fmswindows_selection_exists_p, 0, 0, 0, /*
-Whether there is an mswindows selection.
+Whether there is an MS-Windows selection.
 */
        ())
 {
@@ -153,7 +153,7 @@
 }
 
 DEFUN ("mswindows-delete-selection", Fmswindows_delete_selection, 0, 0, 0, /*
-Whether there is an mswindows selection.
+Remove the current MS-Windows selection from the clipboard.
 */
        ())
 {
--- a/src/symsinit.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/symsinit.h	Mon Aug 13 10:35:54 2007 +0200
@@ -67,6 +67,7 @@
 void syms_of_dialog_x (void);
 void syms_of_dialog (void);
 void syms_of_dired (void);
+void syms_of_dired_mswindows (void);
 void syms_of_dll (void);
 void syms_of_doc (void);
 void syms_of_dragdrop (void);
@@ -235,6 +236,7 @@
 void vars_of_dialog_x (void);
 void vars_of_dialog_mswindows (void);
 void vars_of_dired (void);
+void vars_of_dired_mswindows (void);
 void vars_of_doc (void);
 void vars_of_dragdrop (void);
 void vars_of_editfns (void);
@@ -369,6 +371,7 @@
 void init_hpplay (void);
 void init_lread (void);
 void init_macros (void);
+void init_ntproc (void); /* #### delete me, please! */
 /* Not named init_process in order to avoid conflict with NS 3.3 */
 void init_xemacs_process (void);
 void init_redisplay (void);
--- a/src/sysdep.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/sysdep.c	Mon Aug 13 10:35:54 2007 +0200
@@ -37,6 +37,9 @@
    This is not true though with visual c though. The trick below works with
    VC4.2b and with VC5.0. It assumes that VC is installed in a kind of
    standard way, so include files get to what/ever/path/include.
+
+   Unfortunately, this must go before lisp.h, since process.h defines abort()
+   which will conflict with the macro defined in lisp.h
 */
 #include <../include/process.h>
 #endif /* WINDOWSNT */
@@ -564,6 +567,14 @@
     }
 }
 
+#ifdef WINDOWSNT
+int
+sys_getpid (void)
+{
+  return abs (getpid ());
+}
+#endif /* WINDOWSNT */
+
 /* Fork a subshell.  */
 static void
 sys_subshell (void)
--- a/src/sysdep.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/sysdep.h	Mon Aug 13 10:35:54 2007 +0200
@@ -174,6 +174,8 @@
 
 #ifdef HAVE_REALPATH
 #define xrealpath realpath
+#else
+char *xrealpath(CONST char *path, char resolved_path []);
 #endif
 
 #endif /* _XEMACS_SYSDEP_H_ */
--- a/src/sysfile.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/sysfile.h	Mon Aug 13 10:35:54 2007 +0200
@@ -52,23 +52,9 @@
 
 #ifdef WINDOWSNT
 #include <io.h>
+#include <direct.h>
 #endif
 
-#if 0
-#ifdef WINDOWSNT
-#include <windows.h>
-#include <stdlib.h>	/* for proper declaration of environ */
-#include <fcntl.h>
-#include "nt.h"
-#define _P_NOWAIT 1	/* from process.h */
-#endif
-#endif
-
-#ifdef MSDOS
-#include <dos.h>
-#include "msdos.h"
-#endif /* MSDOS */
-
 #ifndef O_RDONLY
 #define O_RDONLY 0
 #endif
--- a/src/sysfloat.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/sysfloat.h	Mon Aug 13 10:35:54 2007 +0200
@@ -44,6 +44,12 @@
 
 #include <math.h>
 
+#ifdef WINDOWSNT
+/* A quirky way to obtain logb prototype */
+#include <float.h>
+#define logb _logb
+#endif
+
 #ifdef HAVE_MATHERR
 /* Work around symbol conflict on Linux/glibc */
 #ifndef DOMAIN
--- a/src/toolbar-msw.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/toolbar-msw.c	Mon Aug 13 10:35:54 2007 +0200
@@ -49,8 +49,14 @@
 #ifndef TB_SETIMAGELIST
 #define TB_SETIMAGELIST (WM_USER + 48)
 #define TB_GETIMAGELIST (WM_USER + 49)
+#define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
+#define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
+#endif
+#ifndef TB_SETPADDING
 #define TB_SETPADDING   (WM_USER + 87)
 #endif
+#define MSWINDOWS_BUTTON_SHADOW_THICKNESS 2
+#define MSWINDOWS_BLANK_SIZE 5
 
 #define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag)			\
   do {									\
@@ -129,14 +135,18 @@
 mswindows_output_toolbar (struct frame *f, enum toolbar_pos pos)
 {
   int x, y, bar_width, bar_height, vert;
-  int width=-1, height=-1, bmwidth=-1, bmheight=-1;
+  int width=-1, height=-1, bmwidth=0, bmheight=0, maxbmwidth, maxbmheight;
+  int style_3d=0;
   int border_width = FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos);
-  Lisp_Object button, window, glyph, instance;
+  Lisp_Object button, glyph, instance;
+  Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+
   int nbuttons=0;
   int shadow_thickness = 2;	/* get this from somewhere else? */
   int window_frame_width = 3;
+  int padding = (border_width + shadow_thickness) * 2;
   unsigned int checksum=0;
-  struct window *w;
+  struct window *w = XWINDOW (window);
   TBBUTTON* button_tbl, *tbbutton;
   HIMAGELIST ilist=NULL;
   HWND toolbarwnd=NULL;
@@ -146,23 +156,32 @@
   if (x==1)
     x=0;
 
-  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
-  w = XWINDOW (window);
-
   toolbarwnd = TOOLBAR_HANDLE (f,pos);
   
   /* set button sizes based on bar size */
   if (vert)
     {
-      width = height = bar_width
-	- (window_frame_width + shadow_thickness) * 2; 
-      bmwidth = bmheight = width - (border_width + shadow_thickness) * 2;
+      if (style_3d)
+	{
+	  width = height = bar_width
+	    - (window_frame_width + shadow_thickness) * 2; 
+	}
+      else 
+	width = height = bar_width;
+
+      maxbmwidth = maxbmheight = width - padding;
     }
   else
     {
-      height = width = bar_height 
-	- (window_frame_width + shadow_thickness) * 2; 
-      bmwidth = bmheight = width - (border_width + shadow_thickness) * 2; 
+      if (style_3d)
+	{
+	  height = width = bar_height 
+	    - (window_frame_width + shadow_thickness) * 2; 
+	}
+      else 
+	width = height = bar_height;
+
+      maxbmwidth = maxbmheight = width - padding;
     }
 
   button = FRAME_TOOLBAR_BUTTONS (f, pos);
@@ -200,88 +219,139 @@
 	{
 	  struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
 	  HBITMAP bitmap=NULL, mask=NULL;
-	  
-	  tbbutton->idCommand = allocate_toolbar_item_id (f, tb, pos);
-	  tbbutton->fsState=tb->enabled ? TBSTATE_ENABLED 
-	    : TBSTATE_INDETERMINATE;
-	  tbbutton->fsStyle=tb->blank ? TBSTYLE_SEP : TBSTYLE_BUTTON;
-	  tbbutton->dwData=0; 
-	  tbbutton->iString=0;
-	  
-	  /* note that I am not doing the button size here. This is
-             because it is slightly out of my control and the main
-             place they are used is in redisplay for getting events
-             over toolbar buttons. Since the right way to do help echo
-             is with tooltips I'm not going to bother with the extra
-             work involved. */
-	  
-	  /* mess with the button image */
-	  glyph = get_toolbar_button_glyph (w, tb);
-	  
-	  if (GLYPHP (glyph))
-	    instance = glyph_image_instance (glyph, window, ERROR_ME_NOT, 1);
-	  else
-	    instance = Qnil;
-	  
-	  if (IMAGE_INSTANCEP (instance))
+	  bitmap=mask=NULL;
+
+	  if (tb->blank)
+	    tbbutton->fsStyle = TBSTYLE_SEP;
+	  else 
 	    {
-	      struct Lisp_Image_Instance* p = XIMAGE_INSTANCE (instance);
+	      tbbutton->idCommand = allocate_toolbar_item_id (f, tb, pos);
+	      /* currently we output the toolbar again with disabled
+		 buttons it might be good to use the ms disabled code
+		 instead but that means another image list, so we'll stick
+		 with the emacs model. */
+	      tbbutton->fsState = tb->enabled ? TBSTATE_ENABLED :
+		TBSTATE_INDETERMINATE;
+	      tbbutton->fsStyle = TBSTYLE_BUTTON;
+	      tbbutton->dwData=0; 
+	      tbbutton->iString=0;
 	      
-	      if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
+	      /* mess with the button image */
+	      glyph = get_toolbar_button_glyph (w, tb);
+	      
+	      if (GLYPHP (glyph))
+		instance = glyph_image_instance (glyph, window, 
+						 ERROR_ME_NOT, 1);
+	      else
+		instance = Qnil;
+	      
+	      if (IMAGE_INSTANCEP (instance))
 		{
-		  /* we are going to honour the toolbar settings and
-		     resize the bitmaps accordingly */
+		  struct Lisp_Image_Instance* p = XIMAGE_INSTANCE (instance);
 		  
-		  if (IMAGE_INSTANCE_PIXMAP_WIDTH (p) != bmwidth
-		      ||
-		      IMAGE_INSTANCE_PIXMAP_HEIGHT (p) != bmheight)
+		  if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
 		    {
-		      if (! (bitmap = mswindows_create_resized_bitmap 
-			     (p, f, bmwidth, bmheight)))
+		      /* we are going to honour the toolbar settings
+			 and resize the bitmaps accordingly if they are
+			 too big.  If they are too small we leave them
+			 and pad the difference - unless a different size
+			 crops up in the middle, at which point we *have*
+			 to resize since the ImageList won't cope.*/
+		      
+		      if ((bmwidth 
+			   && 
+			   IMAGE_INSTANCE_PIXMAP_WIDTH (p) != bmwidth)
+			  ||
+			  (bmheight 
+			   && 
+			   IMAGE_INSTANCE_PIXMAP_HEIGHT (p) != bmheight)
+			  ||
+			  IMAGE_INSTANCE_PIXMAP_WIDTH (p) > maxbmwidth
+			  ||
+			  IMAGE_INSTANCE_PIXMAP_HEIGHT (p) > maxbmheight)
+			{
+			  if (!bmheight)
+			    bmheight = min (maxbmheight, 
+					    IMAGE_INSTANCE_PIXMAP_HEIGHT (p));
+			  if (!bmwidth)
+			    bmwidth = min (maxbmwidth,
+					   IMAGE_INSTANCE_PIXMAP_WIDTH (p));
+		      
+			  if (! (bitmap = mswindows_create_resized_bitmap 
+				 (p, f, bmwidth, bmheight)))
+			    {
+			      xfree (button_tbl);
+			      if (ilist) ImageList_Destroy (ilist);
+			      signal_simple_error ("couldn't resize pixmap", 
+						   instance);
+			    }
+			  /* we don't care if the mask fails */
+			  mask = mswindows_create_resized_mask 
+			    (p, f, bmwidth, bmheight);
+			}
+		      else 
+			{
+			  if (!bmwidth)
+			    bmwidth = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
+			  if (!bmheight)
+			    bmheight = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
+			}
+	      
+		      /* need to build an image list for the bitmaps */
+		      if (!ilist && !(ilist = ImageList_Create 
+				      ( bmwidth, bmheight,
+					ILC_COLOR24, nbuttons, nbuttons * 2 )))
+			{
+			  xfree (button_tbl);
+			  signal_simple_error ("couldn't create image list",
+					       instance);
+			}
+		  
+		      /* add a bitmap to the list */
+		      if ((tbbutton->iBitmap =
+			   ImageList_Add 
+			   (ilist,
+			    bitmap ? bitmap 
+			    : IMAGE_INSTANCE_MSWINDOWS_BITMAP (p),
+			    mask ? mask 
+			    : IMAGE_INSTANCE_MSWINDOWS_MASK (p))) < 0)
 			{
 			  xfree (button_tbl);
 			  if (ilist) ImageList_Destroy (ilist);
-			  signal_simple_error ("couldn't resize pixmap", 
-					       instance);
+			  signal_simple_error 
+			    ("couldn't add image to image list", instance);
 			}
-		      /* we don't care if the mask fails */
-		      mask = mswindows_create_resized_mask 
-			(p, f, bmwidth, bmheight);
-		    }
-		  else 
-		    {
-		      bmwidth = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
-		      bmheight = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
+		      /* we're done with these now */
+		      DeleteObject (bitmap);
+		      DeleteObject (mask);
 		    }
-	      
-		  /* need to build an image list for the bitmaps */
-		  if (!ilist && !(ilist = ImageList_Create 
-				  ( bmwidth, bmheight,
-				    ILC_COLOR24, nbuttons, nbuttons * 2 )))
-		    {
-		      xfree (button_tbl);
-		      signal_simple_error ("couldn't create image list",
-					   instance);
-		    }
-		  
-		  /* add a bitmap to the list */
-		  if ((tbbutton->iBitmap =
-		       ImageList_Add (ilist, bitmap, mask)) < 0)
-		    {
-		      xfree (button_tbl);
-		      if (ilist) ImageList_Destroy (ilist);
-		      signal_simple_error ("image list creation failed", 
-					   instance);
-		    }
-		  /* we're done with these now */
-		  DeleteObject (bitmap);
-		  DeleteObject (mask);
 		}
+
+	      Fputhash (make_int (tbbutton->idCommand), 
+			button, FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f));
 	    }
 
-	  Fputhash (make_int (tbbutton->idCommand), 
-		    button, FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f));
-      
+	  /* now fix up the button size */
+	  tb->x = x;
+	  tb->y = y;
+	  tb->vertical = vert;
+	  tb->border_width = border_width;
+	  tb->width = width + MSWINDOWS_BUTTON_SHADOW_THICKNESS * 2;
+	  tb->height = height + MSWINDOWS_BUTTON_SHADOW_THICKNESS * 2;
+
+	  if (tb->blank)
+	    {
+	      if (vert)
+		tb->height = MSWINDOWS_BLANK_SIZE;
+	      else
+		tb->width = MSWINDOWS_BLANK_SIZE;
+	    }
+	  
+	  if (vert)							
+	    y += tb->height;
+	  else
+	    x += tb->width;
+	  /* move on to the next button */
 	  tbbutton++;
 	  button = tb->next;
 	}
@@ -295,8 +365,9 @@
 	   CreateWindowEx ( WS_EX_WINDOWEDGE,
 			    TOOLBARCLASSNAME,
 			    NULL,
-			    WS_CHILD | WS_VISIBLE | WS_DLGFRAME
-			    | TBSTYLE_TOOLTIPS | CCS_NORESIZE
+			    WS_CHILD | WS_VISIBLE 
+			    | (style_3d ? WS_DLGFRAME : 0)
+			    | TBSTYLE_TOOLTIPS | CCS_NORESIZE 
 			    | CCS_NOPARENTALIGN | CCS_NODIVIDER,
 			    x, y, bar_width, bar_height,
 			    FRAME_MSWINDOWS_HANDLE (f),
@@ -309,10 +380,6 @@
 	  error ("couldn't create toolbar");
 	}
 
-#if 0
-      SendMessage (toolbarwnd, TB_SETPADDING,
-		   0, MAKELPARAM(border_width, border_width));
-#endif
       /* finally populate with images */
       if (SendMessage (toolbarwnd, TB_BUTTONSTRUCTSIZE,
 		       (WPARAM)sizeof(TBBUTTON), (LPARAM)0) == -1) 
@@ -321,6 +388,15 @@
 	  error ("couldn't set button structure size");
 	}
 
+      if (vert)
+	height = min (bmheight + padding, height);
+      else
+	width = min (bmwidth + padding, width);
+	
+      /* pad the buttons */
+      SendMessage (toolbarwnd, TB_SETPADDING,
+		   0, MAKELPARAM(width - bmwidth, height - bmheight));
+
       /* set the size of buttons */
       SendMessage (toolbarwnd, TB_SETBUTTONSIZE, 0, 
 		   (LPARAM)MAKELONG (width, height));
@@ -357,7 +433,10 @@
 
       /* finally populate with images */
       if (SendMessage (toolbarwnd, TB_SETIMAGELIST, 0,
-		       (LPARAM)ilist) == -1) 
+		       (LPARAM)ilist) < 0
+	  ||
+	  SendMessage (toolbarwnd, TB_SETDISABLEDIMAGELIST, 0,
+		       (LPARAM)ilist) < 0)
 	{
 	  mswindows_clear_toolbar (f, pos, 0);
 	  error ("couldn't add image list to toolbar");
@@ -377,7 +456,7 @@
 {
   int bar_x, bar_y, bar_width, bar_height, vert;
   HWND toolbarwnd = TOOLBAR_HANDLE(f,pos);
-  
+
   if (toolbarwnd)
     {
       get_toolbar_coords (f, pos, &bar_x, &bar_y, &bar_width, &bar_height,
@@ -389,23 +468,24 @@
       switch (pos)
 	{
 	case TOP_TOOLBAR:
-	  bar_x -= 2; bar_y--;
-	  bar_width++; bar_height++;
+	  bar_x--; bar_y-=2;
+	  bar_width+=3; bar_height+=3;
 	  break;
 	case LEFT_TOOLBAR:
-	  bar_x -= 2; bar_y--;
-	  bar_width++; bar_height++;
+	  bar_x--; bar_y-=2;
+	  bar_height++; bar_width++;
 	  break;
 	case BOTTOM_TOOLBAR:
-	  bar_x--;
-	  bar_width++;
+	  bar_y-=2; 
+	  bar_width+=4; bar_height+=4;
 	  break;
 	case RIGHT_TOOLBAR:
-	  bar_y--;
+	  bar_y-=2; bar_x++;
+	  bar_width++; bar_height++;
 	  break;
 	}
       SetWindowPos (toolbarwnd, NULL, bar_x, bar_y, 
-		    bar_width + 1, bar_height + 1, SWP_NOZORDER);
+		    bar_width, bar_height, SWP_NOZORDER);
     }
 }
 
@@ -522,18 +602,12 @@
     return Qnil;
 
   /* Ok, this is our one. Enqueue it. */
-  get_callback (data, &fn, &arg);
-
+  get_gui_callback (data, &fn, &arg);
   XSETFRAME (frame, f);
-  enqueue_misc_user_event (frame, fn, arg);
+  mswindows_enqueue_misc_user_event (frame, fn, arg);
 
-  /* Needs good bump also, for WM_COMMAND may have been dispatched from
-     mswindows_need_event, which will block again despite new command
-     event has arrived */
-  mswindows_bump_queue ();
   return Qt;
 }
-
 
 /************************************************************************/
 /*                            initialization                            */
--- a/src/toolbar.h	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/toolbar.h	Mon Aug 13 10:35:54 2007 +0200
@@ -36,9 +36,6 @@
 #define DEVICE_SUPPORTS_TOOLBARS_P(d)		\
   (HAS_DEVMETH_P ((d), output_frame_toolbars))
 
-/* These are chained together through toolbar_buttons in struct
-   toolbar_data.  These don't need to be an lrecord either, but again,
-   it makes marking easier. */
 struct toolbar_button
 {
   struct lcrecord_header header;
--- a/src/tooltalk.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/tooltalk.c	Mon Aug 13 10:35:54 2007 +0200
@@ -1421,6 +1421,9 @@
   Tooltalk_Message_plist_str = build_string ("Tooltalk Message plist");
   Tooltalk_Pattern_plist_str = build_string ("Tooltalk Pattern p plist");
 
+  staticpro(&Tooltalk_Message_plist_str);
+  staticpro(&Tooltalk_Pattern_plist_str);
+
 #define MAKE_CONSTANT(name) do { \
     defsymbol (&Q_ ## name, #name); \
     Fset (Q_ ## name, make_int (name)); \
--- a/src/unexalpha.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/unexalpha.c	Mon Aug 13 10:35:54 2007 +0200
@@ -302,7 +302,7 @@
    * Construct new symbol table header
    */
 
-  memcpy (oldptr + nhdr.fhdr.f_symptr, buffer, cbHDRR);
+  memcpy (buffer, oldptr + nhdr.fhdr.f_symptr, cbHDRR);
 
 #define symhdr ((pHDRR)buffer)
   newsyms = nhdr.aout.tsize + nhdr.aout.dsize;
@@ -394,7 +394,7 @@
       if (!strcmp(s,"_edata"))
 	{
 	  found++;
-          memcpy (x, &n_edata, cbEXTR);
+          memcpy (&n_edata, x, cbEXTR);
 	  n_edata.asym.value = Brk;
 	  SEEK (new, newsyms + cbHDRR + i,
 		"seeking to symbol _edata in %s", new_name);
@@ -404,7 +404,7 @@
       else if (!strcmp(s,"_end"))
 	{
 	  found++;
-          memcpy (x, &n_end, cbEXTR);
+          memcpy (&n_end, x, cbEXTR);
 	  n_end.asym.value = Brk;
 	  SEEK (new, newsyms + cbHDRR + i,
 		"seeking to symbol _end in %s", new_name);
--- a/src/unexelfsgi.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/unexelfsgi.c	Mon Aug 13 10:35:54 2007 +0200
@@ -869,7 +869,7 @@
 	  /* Let the new bss section address alignment be the same as the
 	     section address alignment followed the old bss section, so 
 	     this section will be placed in exactly the same place.  */
-	  NEW_SECTION_H (nn).sh_addralign = OLD_SECTION_H (nn).sh_addralign;
+	  NEW_SECTION_H (nn).sh_addralign = OLD_SECTION_H (n).sh_addralign;
 	  NEW_SECTION_H (nn).sh_size = 0;
 	}
       else			/* n > old_bss_index */
@@ -894,7 +894,7 @@
 	PATCH_INDEX (NEW_SECTION_H (nn).sh_info);
       
       /* Fix the type and alignment for the .sbss section */
-      if ((old_sbss_index != -1) && !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sbss"))
+      if ((old_sbss_index != -1) && !strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".sbss"))
 	{
 	  NEW_SECTION_H (nn).sh_type = SHT_PROGBITS;
 	  NEW_SECTION_H (nn).sh_offset = round_up (NEW_SECTION_H (nn).sh_offset,
@@ -909,10 +909,10 @@
       /* Write out the sections. .data, .data1 and .sbss (and data2, called
 	 ".data" in the strings table) get copied from the current process
 	 instead of the old file.  */
-      if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data")
-	  || !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data1")
-	  || !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".got")
-	  || !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sbss"))
+      if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".data")
+	  || !strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".data1")
+	  || !strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".got")
+	  || !strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".sbss"))
 	src = (caddr_t) OLD_SECTION_H (n).sh_addr;
       else
 	src = old_base + OLD_SECTION_H (n).sh_offset;
@@ -993,15 +993,6 @@
 	}
     }
 
-  /* Kludge around the stupid 5.3 run time loader which always
-     zero-fills the .sbss section no matter what. */
-
-  if (old_sbss_index != -1)
-    strcpy (new_base
-	    + NEW_SECTION_H (new_file_h->e_shstrndx).sh_offset
-	    + NEW_SECTION_H (old_sbss_index).sh_name,
-	    ".zbzz");
-
   /* Close the files and make the new file executable.  */
 
   if (close (old_file))
--- a/src/window.c	Mon Aug 13 10:35:07 2007 +0200
+++ b/src/window.c	Mon Aug 13 10:35:54 2007 +0200
@@ -1307,7 +1307,8 @@
   return make_int (decode_window (window)->pixel_height);
 }
 
-DEFUN ("window-text-pixel-height", Fwindow_text_pixel_height, 0, 1, 0, /*
+DEFUN ("window-text-area-pixel-height",
+       Fwindow_text_area_pixel_height, 0, 1, 0, /*
 Return the height in pixels of the text-displaying portion of WINDOW.
 Unlike `window-pixel-height', the space occupied by the modeline and
 horizontal scrollbar, if any, is not counted.
@@ -1319,6 +1320,69 @@
   return make_int (WINDOW_TEXT_HEIGHT (w));
 }
 
+DEFUN ("window-displayed-text-pixel-height",
+       Fwindow_displayed_text_pixel_height, 0, 2, 0, /*
+Return the height in pixels of the text displayed in WINDOW.
+Unlike `window-text-area-pixel-height', any blank space below the
+end of the buffer is not included.  If optional argument NOCLIPPED
+is non-nil, do not include space occupied by clipped lines.
+*/
+     (window, noclipped))
+{
+  struct window *w;
+  Bufpos start, eobuf;
+  int defheight;
+  int hlimit, height, prev_height = -1;
+  int line;
+  int elt, nelt, i;
+  int needed;
+  line_start_cache_dynarr *cache;
+
+  if (NILP (window))
+    window = Fselected_window (Qnil);
+
+  CHECK_WINDOW (window);
+  w = XWINDOW (window);
+
+  start  = marker_position (w->start[CURRENT_DISP]);
+  hlimit = WINDOW_TEXT_HEIGHT (w);
+  eobuf  = BUF_ZV (XBUFFER (w->buffer));
+
+  default_face_height_and_width (window, &defheight, NULL);
+
+  /* guess lines needed in line start cache + a few extra */
+  needed = (hlimit + defheight-1) / defheight + 3;
+
+  while (1) {
+    elt = point_in_line_start_cache (w, start, needed);
+    assert (elt >= 0); /* in the cache */
+
+    cache = w->line_start_cache;
+    nelt  = Dynarr_length (cache);
+
+    height = 0;
+    for (i = elt; i < nelt; i++) {
+      line = Dynarr_atp (cache, i)->height;
+
+      if (height + line > hlimit)
+        return make_int (!NILP (noclipped) ? height : hlimit);
+
+      height += line;
+
+      if (height == hlimit || Dynarr_atp (cache, i)->end >= eobuf)
+        return make_int (height);
+    }
+
+    /* get here => need more cache lines.  try again. */
+    assert(height > prev_height); /* progress? */
+    prev_height = height;
+
+    needed += ((hlimit - height)*(nelt - elt) + height-1)/height + 3;
+  }
+
+  RETURN_NOT_REACHED(make_int (0))        /* shut up compiler */
+}
+
 DEFUN ("window-width", Fwindow_width, 0, 1, 0, /*
 Return the number of display columns in WINDOW.
 This is the width that is usable columns available for text in WINDOW.
@@ -1336,7 +1400,8 @@
   return make_int (decode_window (window)->pixel_width);
 }
 
-DEFUN ("window-text-pixel-width", Fwindow_text_pixel_width, 0, 1, 0, /*
+DEFUN ("window-text-area-pixel-width",
+       Fwindow_text_area_pixel_width, 0, 1, 0, /*
 Return the width in pixels of the text-displaying portion of WINDOW.
 Unlike `window-pixel-width', the space occupied by the vertical
 scrollbar or divider, if any, is not counted.  
@@ -1458,7 +1523,8 @@
 		make_int (top + w->pixel_height));
 }
 
-DEFUN ("window-text-pixel-edges", Fwindow_text_pixel_edges, 0, 1, 0, /*
+DEFUN ("window-text-area-pixel-edges",
+       Fwindow_text_area_pixel_edges, 0, 1, 0, /*
 Return a list of the pixel edge coordinates of the text area of WINDOW.
 Returns the list \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at the
 top left corner of the window.
@@ -3895,7 +3961,8 @@
   tem = Fpos_visible_in_window_p (point, window);
   if (NILP (tem))
     {
-      Fvertical_motion (make_int (-window_char_height (w, 0) / 2), window);
+      Fvertical_motion (make_int (-window_char_height (w, 0) / 2),
+                        window, Qnil);
       Fset_marker (w->start[CURRENT_DISP], point, w->buffer);
       w->start_at_line_beg = beginning_of_line_p (b, XINT (point));
       MARK_WINDOWS_CHANGED (w);
@@ -4317,7 +4384,7 @@
     }
 
   if (selected)
-    return Fvertical_motion (arg, window);
+    return Fvertical_motion (arg, window, Qnil);
   else
     {
       int vpos;
@@ -5388,8 +5455,9 @@
   DEFSUBR (Fwindow_width);
   DEFSUBR (Fwindow_pixel_height);
   DEFSUBR (Fwindow_pixel_width);
-  DEFSUBR (Fwindow_text_pixel_height);
-  DEFSUBR (Fwindow_text_pixel_width);
+  DEFSUBR (Fwindow_text_area_pixel_height);
+  DEFSUBR (Fwindow_displayed_text_pixel_height);
+  DEFSUBR (Fwindow_text_area_pixel_width);
   DEFSUBR (Fwindow_hscroll);
 #ifdef MODELINE_IS_SCROLLABLE
   DEFSUBR (Fmodeline_hscroll);
@@ -5401,7 +5469,7 @@
 #endif
   DEFSUBR (Fset_window_hscroll);
   DEFSUBR (Fwindow_pixel_edges);
-  DEFSUBR (Fwindow_text_pixel_edges);
+  DEFSUBR (Fwindow_text_area_pixel_edges);
   DEFSUBR (Fwindow_point);
   DEFSUBR (Fwindow_start);
   DEFSUBR (Fwindow_end);
--- a/tests/Dnd/README	Mon Aug 13 10:35:07 2007 +0200
+++ b/tests/Dnd/README	Mon Aug 13 10:35:54 2007 +0200
@@ -4,11 +4,7 @@
 Drag'n'Drop code.
 
 Currently only drops are of interest. The internal
-functions only work for OffiX and MSWindows. CDE
-is broken with this.
-
-The OffiX functions in mouse.el also work no longer,
-because drops are now misc-user-events.
+functions should work for OffiX, CDE, and MSWindows.
 
 The misc-user-event now also responds as a button-x-event
 to the event-* query functions.
@@ -18,10 +14,6 @@
 you can access the actual misc-user-event through the
 current-mouse-event variable.
 
-dragtest.el works theoretically, but it needs to be
-adapted to some new scheme fitting the drop code (droptest.el
-has it's own dragsources).
-
 Short description of the object part of a drop misc-user-event:
 ( TYPE . DATA )
 TYPE is either the symbol dragdrop_MIME
--- a/tests/Dnd/dragtest.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/tests/Dnd/dragtest.el	Mon Aug 13 10:35:54 2007 +0200
@@ -1,25 +0,0 @@
-;; a simple test of the drag functions
-;;
-;; it still uses the old way, but it will work to test
-;; the drop functions using droptest.el
-;;
-
-(defun text-drag (event)
-  (interactive "@e")
-  (offix-start-drag event "That's a test"))
-
-(defun file-drag (event)
-  (interactive "@e")
-  (offix-start-drag event "/tmp/printcap" 2))
-
-(defun url-drag (event)
-  (interactive "@e")
-  (offix-start-drag event "http://www.xemacs.org/" 8))
-
-(defun files-drag (event)
-  (interactive "@e")
-  (offix-start-drag event '("/tmp/dragtest" "/tmp/droptest" "/tmp/printcap") 3))
-
-(define-key global-map [button1] 'text-drag)
-(define-key global-map [button2] 'files-drag)
-(define-key global-map [button3] 'url-drag)
--- a/tests/Dnd/droptest.el	Mon Aug 13 10:35:07 2007 +0200
+++ b/tests/Dnd/droptest.el	Mon Aug 13 10:35:54 2007 +0200
@@ -4,18 +4,23 @@
 
 (defun dnd-drop-message (event object text)
   (message "Dropped %s with :%s" text object)
+  ;; signal that we have done something with the data
   t)
 
 (defun do-nothing (event object)
+  ;; signal that the data is still unprocessed
   nil)
 
 (defun start-drag (event what &optional typ)
+  ;; short drag interface, until the real one is implemented
   (cond ((featurep 'offix)
 	 (if (numberp typ)
 	     (offix-start-drag event what typ)
 	   (offix-start-drag event what)))
 	((featurep 'cde)
-	 (funcall (intern "cde-start-drag-internal") what))
+	 (if (not typ)
+	     (funcall (intern "cde-start-drag-internal") event nil (list what))
+	   (funcall (intern "cde-start-drag-internal") event t what)))
 	(t display-message 'error "no valid drag protocols implemented")))
 
 (defun make-drop-targets ()
@@ -62,7 +67,16 @@
     (set-buffer buf)
     (pop-to-buffer buf)
     (erase-buffer buf)
-    (insert "Try to drag data from one of the upper extents to one\nof the lower extents. Make sure that your minibuffer is big\ncause it is used to display the data.\n\nYou may also try to select some of this text and drag it with button2.")
+    (insert "Try to drag data from one of the upper extents to one\nof the lower extents. Make sure that your minibuffer is big\ncause it is used to display the data.\n\nYou may also try to select some of this text and drag it with button2.\n\nTo ")
+    (setq s (point))
+    (insert "EXIT")
+    (setq e (point))
+    (insert " this demo, press 'q'.")
+    (setq ext (make-extent s e))
+    (setq kmap (make-keymap))
+    (define-key kmap [button1] 'end-dnd-demo)
+    (set-extent-property ext 'keymap kmap)
+    (set-extent-property ext 'mouse-face 'highlight)
     (newline 2)
     (setq s (point))
     (insert "[ TEXT DRAG TEST ]")
@@ -79,7 +93,9 @@
     (setq ext (make-extent s e))
     (set-extent-property ext 'mouse-face 'isearch)
     (setq kmap (make-keymap))
-    (define-key kmap [button1] 'file-drag)
+    (if (featurep 'cde)
+	(define-key kmap [button1] 'cde-file-drag)
+      (define-key kmap [button1] 'file-drag))
     (set-extent-property ext 'keymap kmap)
     (insert "    ")
     (setq s (point))
@@ -97,7 +113,9 @@
     (setq ext (make-extent s e))
     (set-extent-property ext 'mouse-face 'isearch)
     (setq kmap (make-keymap))
-    (define-key kmap [button1] 'url-drag)
+    (if (featurep 'cde)
+	(define-key kmap [button1] 'cde-file-drag)
+      (define-key kmap [button1] 'url-drag))
     (set-extent-property ext 'keymap kmap)
     (newline 3)))
     
@@ -109,6 +127,10 @@
   (interactive "@e")
   (start-drag event "/tmp/printcap" 2))
 
+(defun cde-file-drag (event)
+  (interactive "@e")
+  (start-drag event '("/tmp/printcap") t))
+
 (defun url-drag (event)
   (interactive "@e")
   (start-drag event "http://www.xemacs.org/" 8))
@@ -118,8 +140,22 @@
   (start-drag event '("/tmp/dragtest" "/tmp/droptest" "/tmp/printcap") 3))
 
 (setq dragdrop-drop-functions '((do-nothing t t)
+				;; CDE does not have any button info...
+				(dnd-drop-message 0 t "cde-drop somewhere else")
 				(dnd-drop-message 2 t "region somewhere else")
 				(dnd-drop-message 1 t "drag-source somewhere else")
 				(do-nothing t t)))
+
 (make-drag-starters)
 (make-drop-targets)
+
+(defun end-dnd-demo ()
+  (interactive)
+  (global-set-key [button2] button2-func)
+  (bury-buffer))
+
+(setq lmap (make-keymap))
+(use-local-map lmap)
+(local-set-key [q] 'end-dnd-demo)
+(setq button2-func (lookup-key global-map [button2]))
+(global-unset-key [button2])
--- a/version.sh	Mon Aug 13 10:35:07 2007 +0200
+++ b/version.sh	Mon Aug 13 10:35:54 2007 +0200
@@ -1,8 +1,8 @@
 #!/bin/sh
 emacs_major_version=21
 emacs_minor_version=0
-emacs_beta_version=41
-xemacs_codename="San Clemente"
+emacs_beta_version=42
+xemacs_codename="Somali"
 infodock_major_version=3
 infodock_minor_version=90
-infodock_build_version=7
+infodock_build_version=8