changeset 4996:c17c857e20bf

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 03 Feb 2010 20:18:53 +0000
parents 5274591ce707 (diff) 8431b52e43b1 (current diff)
children 8800b5350a13
files lisp/ChangeLog lisp/bytecomp.el lisp/cl-extra.el lisp/cl-macs.el lisp/obsolete.el src/ChangeLog src/data.c src/fns.c src/lisp.h
diffstat 159 files changed, 5215 insertions(+), 4014 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 31 18:29:48 2010 +0000
+++ b/ChangeLog	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,9 @@
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* configure:
+	* configure.ac (TAB):
+	USE_XFT* -> HAVE_XFT*.
+
 2010-01-14  Ben Wing  <ben@xemacs.org>
 
 	* PROBLEMS:
--- a/configure	Sun Jan 31 18:29:48 2010 +0000
+++ b/configure	Wed Feb 03 20:18:53 2010 +0000
@@ -1,12 +1,14 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for XEmacs 21.5.
+# Generated by GNU Autoconf 2.65 for XEmacs 21.5.
 #
 # Report bugs to <xemacs-beta@xemacs.org>.
 #
+#
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
-# Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+#
 #
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
@@ -573,7 +575,8 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-exec 7<&0 </dev/null 6>&1
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -1986,7 +1989,7 @@
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   YACC        The `Yet Another C Compiler' implementation to use. Defaults to
@@ -2063,7 +2066,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 XEmacs configure 21.5
-generated by GNU Autoconf 2.64
+generated by GNU Autoconf 2.65
 
 Copyright (C) 2009 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -2156,7 +2159,7 @@
 	ac_retval=1
 fi
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
 
@@ -2193,7 +2196,7 @@
     ac_retval=1
 fi
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
 
@@ -2328,7 +2331,7 @@
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
 
@@ -2405,7 +2408,7 @@
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
@@ -2800,7 +2803,7 @@
 
   fi
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_compute_int
 cat >config.log <<_ACEOF
@@ -2808,7 +2811,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by XEmacs $as_me 21.5, which was
-generated by GNU Autoconf 2.64.  Invocation command line was
+generated by GNU Autoconf 2.65.  Invocation command line was
 
   $ $0 $@
 
@@ -3061,7 +3064,7 @@
 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
   test "x$ac_site_file" = xNONE && continue
-  if test -r "$ac_site_file"; then
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
@@ -3070,9 +3073,9 @@
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
 $as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
@@ -6295,32 +6298,30 @@
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
-  fi
+  fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
 
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
+
+int
+main ()
+{
 
   ;
   return 0;
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
@@ -6382,10 +6383,10 @@
 else
   ac_file=''
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
 if test -z "$ac_file"; then :
-  $as_echo "$as_me: failed program was:" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
@@ -6393,51 +6394,18 @@
 { as_fn_set_status 77
 as_fn_error "C compiler cannot create executables
 See \`config.log' for more details." "$LINENO" 5; }; }
-fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
 
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
 $as_echo_n "checking for suffix of executables... " >&6; }
 if { { ac_try="$ac_link"
@@ -6470,13 +6438,72 @@
 as_fn_error "cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." "$LINENO" 5; }
 fi
-rm -f conftest$ac_cv_exeext
+rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
 $as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
 if test "${ac_cv_objext+set}" = set; then :
@@ -7535,8 +7562,8 @@
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
-  fi
+  fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
@@ -8083,8 +8110,8 @@
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
-  fi
+  fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
@@ -8631,8 +8658,8 @@
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
-  fi
+  fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
@@ -13641,7 +13668,7 @@
             with_fontconfig=yes
       $as_echo "#define HAVE_FONTCONFIG 1" >>confdefs.h
 
-      $as_echo "#define USE_XFT 1" >>confdefs.h
+      $as_echo "#define HAVE_XFT 1" >>confdefs.h
 
                   unset xft_includes_found
     fi
@@ -16608,11 +16635,11 @@
 test "$with_widgets"    = "motif"  && $as_echo "#define LWLIB_WIDGETS_MOTIF 1" >>confdefs.h
 
 
-test "$with_xft_menubars" = "yes"  && $as_echo "#define USE_XFT_MENUBARS 1" >>confdefs.h
-
-test "$with_xft_tabs" = "yes"  && $as_echo "#define USE_XFT_TABS 1" >>confdefs.h
-
-test "$with_xft_gauges" = "yes"  && $as_echo "#define USE_XFT_GAUGES 1" >>confdefs.h
+test "$with_xft_menubars" = "yes"  && $as_echo "#define HAVE_XFT_MENUBARS 1" >>confdefs.h
+
+test "$with_xft_tabs" = "yes"  && $as_echo "#define HAVE_XFT_TABS 1" >>confdefs.h
+
+test "$with_xft_gauges" = "yes"  && $as_echo "#define HAVE_XFT_GAUGES 1" >>confdefs.h
 
 
 
@@ -21531,7 +21558,7 @@
 # values after options handling.
 ac_log="
 This file was extended by XEmacs $as_me 21.5, which was
-generated by GNU Autoconf 2.64.  Invocation command line was
+generated by GNU Autoconf 2.65.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -21571,6 +21598,7 @@
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
   -q, --quiet, --silent
                    do not print progress messages
   -d, --debug      don't remove temporary files
@@ -21593,10 +21621,11 @@
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 XEmacs config.status 21.5
-configured by $0, generated by GNU Autoconf 2.64,
-  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.65,
+  with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2009 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
@@ -21632,6 +21661,8 @@
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
@@ -21826,7 +21857,7 @@
 t delim
 :nl
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more1
 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
 p
@@ -21840,7 +21871,7 @@
 t nl
 :delim
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more2
 s/["\\]/\\&/g; s/^/"/; s/$/"/
 p
--- a/configure.ac	Sun Jan 31 18:29:48 2010 +0000
+++ b/configure.ac	Wed Feb 03 20:18:53 2010 +0000
@@ -3163,9 +3163,9 @@
       dnl #### detect fontconfig properly!!!!
       with_fontconfig=yes
       AC_DEFINE(HAVE_FONTCONFIG)
-      AC_DEFINE(USE_XFT)
+      AC_DEFINE(HAVE_XFT)
       dnl Due to interactions with other libraries, must postpone AC_DEFINE
-      dnl of USE_XFT_MENUBARS, USE_XFT_TABS, and USE_XFT_GAUGES.
+      dnl of HAVE_XFT_MENUBARS, HAVE_XFT_TABS, and HAVE_XFT_GAUGES.
       unset xft_includes_found
     fi
   fi
@@ -4122,9 +4122,9 @@
 test "$with_dialogs"    = "motif"  && AC_DEFINE(LWLIB_DIALOGS_MOTIF)
 test "$with_widgets"    = "motif"  && AC_DEFINE(LWLIB_WIDGETS_MOTIF)
 
-test "$with_xft_menubars" = "yes"  && AC_DEFINE(USE_XFT_MENUBARS)
-test "$with_xft_tabs" = "yes"  && AC_DEFINE(USE_XFT_TABS)
-test "$with_xft_gauges" = "yes"  && AC_DEFINE(USE_XFT_GAUGES)
+test "$with_xft_menubars" = "yes"  && AC_DEFINE(HAVE_XFT_MENUBARS)
+test "$with_xft_tabs" = "yes"  && AC_DEFINE(HAVE_XFT_TABS)
+test "$with_xft_gauges" = "yes"  && AC_DEFINE(HAVE_XFT_GAUGES)
 
 dnl ----------------------
 dnl Mule-dependent options
--- a/lib-src/ChangeLog	Sun Jan 31 18:29:48 2010 +0000
+++ b/lib-src/ChangeLog	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,7 @@
+2010-02-01  Vin Shelton  <acs@xemacs.org>
+
+	* make-mswin-unicode.pl: Add description of override.
+
 2010-01-30  Ben Wing  <ben@xemacs.org>
 
 	* make-mswin-unicode.pl:
--- a/lib-src/make-mswin-unicode.pl	Sun Jan 31 18:29:48 2010 +0000
+++ b/lib-src/make-mswin-unicode.pl	Wed Feb 03 20:18:53 2010 +0000
@@ -63,6 +63,8 @@
 yes indicates a function to be automatically Unicode-encapsulated.
    (All parameters either need no special processing or are LPTSTR or
    LPCTSTR.)
+override indidates a function where the prototype can be overridden
+   due to errors in Cygwin or Visual Studio.
 soon indicates a function that should be automatically Unicode-encapsulated,
    but we're not ready to process it yet.
 no indicates a function we don't support (it will be #defined to cause
--- a/lisp/ChangeLog	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/ChangeLog	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,72 @@
+2010-02-03  Aidan Kehoe  <kehoea@parhasard.net>
+
+	Delete a couple of XEmacs-specific functions that duplicate CL
+	functions.
+
+	* find-paths.el (paths-filter, paths-uniq-append):
+	Remove #'paths-filter, a reimplementation of #'remove-if-not, and
+	#'paths-uniq-append, a reimplementation of #'union with test
+	#'equal.
+	(paths-decode-directory-path): Don't use #'path-filter here.
+	* packages.el (packages-package-hierarchy-directory-names):
+	Don't use #'path-filter here.
+	(packages-find-installation-package-directories):
+	Use #'union, not #'paths-uniq-append here.
+	* setup-paths.el (paths-find-invocation-roots)
+	(paths-find-emacs-roots, paths-construct-info-path)
+	(paths-construct-info-path):
+	Replace #'paths-filter with #'remove-if-not, #'paths-uniq-append
+	with #'union. 
+
+2010-02-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* loadhist.el (symbol-file):
+	If #'built-in-symbol-file returns a Lisp file name, and
+	source-lisp is readable, construct a full pathname to include
+	that. Otherwise use lisp-directory, as we used to.
+	* loadup.el:
+	Delete load-history entries for those files in
+	preloaded-file-list; unloading the associated features makes very
+	little sense, and the symbol file information can be had from DOC.
+
+2010-02-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el (equalp):
+	Remove special treatment for an #'equalp with a single character
+	constant argument, it was incorrect (it used #'downcase instead of
+	#'canoncase).
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* cl-extra.el:
+	* cl-extra.el (cl-string-vector-equalp): Removed.
+	* cl-extra.el (cl-bit-vector-vector-equalp): Removed.
+	* cl-extra.el (cl-vector-array-equalp): Removed.
+	* cl-extra.el (cl-hash-table-contents-equalp): Removed.
+	* cl-extra.el (equalp): Removed.
+	* cl-extra.el (cl-mapcar-many):
+	Comment out the whole `equalp' implementation for the moment;
+	remove once we're sure the C implementation works.
+	
+	* cl-macs.el:
+	* cl-macs.el (equalp):
+	Simplify the compiler-macro for `equalp' -- once it's in C,
+	we don't need to try so hard to expand it.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* obsolete.el:
+	* loadhist.el (symbol-file):
+	* help.el (describe-function-1):
+	* bytecomp.el: (byte-compile-save-current-buffer):
+	* byte-optimize.el (byte-optimize-form-code-walker):
+	* subr.el (subr-arity):
+	Change "special form" to "special operator" in these files, it's
+	the more logical term.
+
+	* subr.el (special-form-p): Provide this alias for
+	#'special-operator-p. 
+
 2010-01-30  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* loadup.el:
@@ -10,14 +79,6 @@
 2010-01-29  Ben Wing  <ben@xemacs.org>
 
 	* mule/cyrillic.el (for):
-
-2010-01-29  Ben Wing  <ben@xemacs.org>
-
-	* mule/cyrillic.el (for):
-
-2010-01-29  Ben Wing  <ben@xemacs.org>
-
-	* mule/cyrillic.el (for):
 	Upper and lowercase mappings were reversed for some old-Cyrillic
 	chars.
 
--- a/lisp/byte-optimize.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/byte-optimize.el	Wed Feb 03 20:18:53 2010 +0000
@@ -370,8 +370,8 @@
 (defun byte-optimize-form-code-walker (form for-effect)
   ;;
   ;; For normal function calls, We can just mapcar the optimizer the cdr.  But
-  ;; we need to have special knowledge of the syntax of the special forms
-  ;; like let and defun (that's why they're special forms :-).  (Actually,
+  ;; we need to have special knowledge of the syntax of the special operators
+  ;; like let and defun (that's why they're special operators :-).  (Actually,
   ;; the important aspect is that they are subrs that don't evaluate all of
   ;; their args.)
   ;;
--- a/lisp/bytecomp.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/bytecomp.el	Wed Feb 03 20:18:53 2010 +0000
@@ -4072,7 +4072,7 @@
 	       (car form)))
 	  (cdr form))))
 
-;;; other tricky macro-like special-forms
+;;; other tricky macro-like special-operators
 
 (byte-defop-compiler-1 catch)
 (byte-defop-compiler-1 unwind-protect)
@@ -4167,7 +4167,7 @@
 
 (defun byte-compile-save-current-buffer (form)
   (if (byte-compile-version-cond byte-compile-emacs19-compatibility)
-      ;; `save-current-buffer' special form is not available in XEmacs 19.
+      ;; `save-current-buffer' special operator is not available in XEmacs 19.
       (byte-compile-form
        `(let ((_byte_compiler_save_buffer_emulation_closure_ (current-buffer)))
 	  (unwind-protect
--- a/lisp/cl-extra.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/cl-extra.el	Wed Feb 03 20:18:53 2010 +0000
@@ -100,130 +100,130 @@
 	(t (error "Can't coerce %s to type %s" x type))))
 
 
-;;; Predicates.
-
-;; I'd actually prefer not to have this inline, the space
-;; vs. amount-it's-called trade-off isn't reasonable, but that would
-;; introduce bytecode problems with the compiler macro in cl-macs.el.
-(defsubst cl-string-vector-equalp (cl-string cl-vector)
-  "Helper function for `equalp', which see."
-;  (check-argument-type #'stringp cl-string)
-;  (check-argument-type #'vector cl-vector)
-  (let ((cl-i (length cl-string))
-	cl-char cl-other)
-    (when (= cl-i (length cl-vector))
-      (while (and (>= (setq cl-i (1- cl-i)) 0)
-		  (or (eq (setq cl-char (aref cl-string cl-i))
-			  (setq cl-other (aref cl-vector cl-i)))
-		      (and (characterp cl-other) ; Note we want to call this
-						 ; as rarely as possible, it
-						 ; doesn't have a bytecode.
-			   (eq (downcase cl-char) (downcase cl-other))))))
-      (< cl-i 0))))
-
-;; See comment on cl-string-vector-equalp above.
-(defsubst cl-bit-vector-vector-equalp (cl-bit-vector cl-vector)
-  "Helper function for `equalp', which see."
-;  (check-argument-type #'bit-vector-p cl-bit-vector)
-;  (check-argument-type #'vectorp cl-vector)
-  (let ((cl-i (length cl-bit-vector))
-	cl-other)
-    (when (= cl-i (length cl-vector))
-      (while (and (>= (setq cl-i (1- cl-i)) 0)
-		  (numberp (setq cl-other (aref cl-vector cl-i)))
-		  ;; Differs from clisp here.
-		  (= (aref cl-bit-vector cl-i) cl-other)))
-      (< cl-i 0))))
-
-;; These two helper functions call equalp recursively, the two above have no
-;; need to.
-(defsubst cl-vector-array-equalp (cl-vector cl-array)
-  "Helper function for `equalp', which see."
-;  (check-argument-type #'vector cl-vector)
-;  (check-argument-type #'arrayp cl-array)
-  (let ((cl-i (length cl-vector)))
-    (when (= cl-i (length cl-array))
-      (while (and (>= (setq cl-i (1- cl-i)) 0)
-		  (equalp (aref cl-vector cl-i) (aref cl-array cl-i))))
-      (< cl-i 0))))
-
-(defsubst cl-hash-table-contents-equalp (cl-hash-table-1 cl-hash-table-2)
-  "Helper function for `equalp', which see."
-  (symbol-macrolet
-      ;; If someone has gone and fished the uninterned symbol out of this
-      ;; function's constants vector, and subsequently stored it as a value
-      ;; in a hash table, it's their own damn fault when
-      ;; `cl-hash-table-contents-equalp' gives the wrong answer.
-      ((equalp-default '#:equalp-default))
-    (loop
-      for x-key being the hash-key in cl-hash-table-1
-      using (hash-value x-value)
-      with y-value = nil
-      always (and (not (eq equalp-default
-			   (setq y-value (gethash x-key cl-hash-table-2
-						  equalp-default))))
-		  (equalp y-value x-value)))))
-
-(defun equalp (x y)
-  "Return t if two Lisp objects have similar structures and contents.
-
-This is like `equal', except that it accepts numerically equal
-numbers of different types (float, integer, bignum, bigfloat), and also
-compares strings and characters case-insensitively.
-
-Arrays (that is, strings, bit-vectors, and vectors) of the same length and
-with contents that are `equalp' are themselves `equalp'.
-
-Two hash tables are `equalp' if they have the same test (see
-`hash-table-test'), if they have the same number of entries, and if, for
-each entry in one hash table, its key is equivalent to a key in the other
-hash table using the hash table test, and its value is `equalp' to the other
-hash table's value for that key."
-  (cond ((eq x y))
-	((stringp x)
-	 (if (stringp y)
-	     (eq t (compare-strings x nil nil y nil nil t))
-	   (if (vectorp y)
-	       (cl-string-vector-equalp x y)
-	     ;; bit-vectors and strings are only equalp if they're
-	     ;; zero-length:
-	     (and (equal "" x) (equal #* y)))))
-	((numberp x)
-	 (and (numberp y) (= x y)))
-	((consp x)
-	 (while (and (consp x) (consp y) (equalp (car x) (car y)))
-	   (setq x (cdr x) y (cdr y)))
-	 (and (not (consp x)) (equalp x y)))
-	(t
-	 ;; From here on, the type tests don't (yet) have bytecodes.
-	 (let ((x-type (type-of x)))
-	   (cond ((eq 'vector x-type)
-		  (if (stringp y)
-		      (cl-string-vector-equalp y x)
-		    (if (vectorp y)
-			(cl-vector-array-equalp x y)
-		      (if (bit-vector-p y)
-			  (cl-bit-vector-vector-equalp y x)))))
-		 ((eq 'character x-type)
-		  (and (characterp y)
-		       ;; If the characters are actually identical, the
-		       ;; first eq test will have caught them above; we only
-		       ;; need to check them case-insensitively here.
-		       (eq (downcase x) (downcase y))))
-		 ((eq 'hash-table x-type)
-		  (and (hash-table-p y)
-		       (eq (hash-table-test x) (hash-table-test y))
-		       (= (hash-table-count x) (hash-table-count y))
-		       (cl-hash-table-contents-equalp x y)))
-		 ((eq 'bit-vector x-type)
-		  (if (bit-vector-p y)
-		      (equal x y)
-		    (if (vectorp y)
-			(cl-bit-vector-vector-equalp x y)
-		      ;; bit-vectors and strings are only equalp if they're
-		      ;; zero-length:
-		      (and (equal "" y) (equal #* x)))))
-		 (t (equal x y)))))))
+;;;;; Predicates.
+;;
+;;;; I'd actually prefer not to have this inline, the space
+;;;; vs. amount-it's-called trade-off isn't reasonable, but that would
+;;;; introduce bytecode problems with the compiler macro in cl-macs.el.
+;;(defsubst cl-string-vector-equalp (cl-string cl-vector)
+;;  "Helper function for `equalp', which see."
+;;;  (check-argument-type #'stringp cl-string)
+;;;  (check-argument-type #'vector cl-vector)
+;;  (let ((cl-i (length cl-string))
+;;	cl-char cl-other)
+;;    (when (= cl-i (length cl-vector))
+;;      (while (and (>= (setq cl-i (1- cl-i)) 0)
+;;		  (or (eq (setq cl-char (aref cl-string cl-i))
+;;			  (setq cl-other (aref cl-vector cl-i)))
+;;		      (and (characterp cl-other) ; Note we want to call this
+;;						 ; as rarely as possible, it
+;;						 ; doesn't have a bytecode.
+;;			   (eq (downcase cl-char) (downcase cl-other))))))
+;;      (< cl-i 0))))
+;;
+;;;; See comment on cl-string-vector-equalp above.
+;;(defsubst cl-bit-vector-vector-equalp (cl-bit-vector cl-vector)
+;;  "Helper function for `equalp', which see."
+;;;  (check-argument-type #'bit-vector-p cl-bit-vector)
+;;;  (check-argument-type #'vectorp cl-vector)
+;;  (let ((cl-i (length cl-bit-vector))
+;;	cl-other)
+;;    (when (= cl-i (length cl-vector))
+;;      (while (and (>= (setq cl-i (1- cl-i)) 0)
+;;		  (numberp (setq cl-other (aref cl-vector cl-i)))
+;;		  ;; Differs from clisp here.
+;;		  (= (aref cl-bit-vector cl-i) cl-other)))
+;;      (< cl-i 0))))
+;;
+;;;; These two helper functions call equalp recursively, the two above have no
+;;;; need to.
+;;(defsubst cl-vector-array-equalp (cl-vector cl-array)
+;;  "Helper function for `equalp', which see."
+;;;  (check-argument-type #'vector cl-vector)
+;;;  (check-argument-type #'arrayp cl-array)
+;;  (let ((cl-i (length cl-vector)))
+;;    (when (= cl-i (length cl-array))
+;;      (while (and (>= (setq cl-i (1- cl-i)) 0)
+;;		  (equalp (aref cl-vector cl-i) (aref cl-array cl-i))))
+;;      (< cl-i 0))))
+;;
+;;(defsubst cl-hash-table-contents-equalp (cl-hash-table-1 cl-hash-table-2)
+;;  "Helper function for `equalp', which see."
+;;  (symbol-macrolet
+;;      ;; If someone has gone and fished the uninterned symbol out of this
+;;      ;; function's constants vector, and subsequently stored it as a value
+;;      ;; in a hash table, it's their own damn fault when
+;;      ;; `cl-hash-table-contents-equalp' gives the wrong answer.
+;;      ((equalp-default '#:equalp-default))
+;;    (loop
+;;      for x-key being the hash-key in cl-hash-table-1
+;;      using (hash-value x-value)
+;;      with y-value = nil
+;;      always (and (not (eq equalp-default
+;;			   (setq y-value (gethash x-key cl-hash-table-2
+;;						  equalp-default))))
+;;		  (equalp y-value x-value)))))
+;;
+;;(defun equalp (x y)
+;;  "Return t if two Lisp objects have similar structures and contents.
+;;
+;;This is like `equal', except that it accepts numerically equal
+;;numbers of different types (float, integer, bignum, bigfloat), and also
+;;compares strings and characters case-insensitively.
+;;
+;;Arrays (that is, strings, bit-vectors, and vectors) of the same length and
+;;with contents that are `equalp' are themselves `equalp'.
+;;
+;;Two hash tables are `equalp' if they have the same test (see
+;;`hash-table-test'), if they have the same number of entries, and if, for
+;;each entry in one hash table, its key is equivalent to a key in the other
+;;hash table using the hash table test, and its value is `equalp' to the other
+;;hash table's value for that key."
+;;  (cond ((eq x y))
+;;	((stringp x)
+;;	 (if (stringp y)
+;;	     (eq t (compare-strings x nil nil y nil nil t))
+;;	   (if (vectorp y)
+;;	       (cl-string-vector-equalp x y)
+;;	     ;; bit-vectors and strings are only equalp if they're
+;;	     ;; zero-length:
+;;	     (and (equal "" x) (equal #* y)))))
+;;	((numberp x)
+;;	 (and (numberp y) (= x y)))
+;;	((consp x)
+;;	 (while (and (consp x) (consp y) (equalp (car x) (car y)))
+;;	   (setq x (cdr x) y (cdr y)))
+;;	 (and (not (consp x)) (equalp x y)))
+;;	(t
+;;	 ;; From here on, the type tests don't (yet) have bytecodes.
+;;	 (let ((x-type (type-of x)))
+;;	   (cond ((eq 'vector x-type)
+;;		  (if (stringp y)
+;;		      (cl-string-vector-equalp y x)
+;;		    (if (vectorp y)
+;;			(cl-vector-array-equalp x y)
+;;		      (if (bit-vector-p y)
+;;			  (cl-bit-vector-vector-equalp y x)))))
+;;		 ((eq 'character x-type)
+;;		  (and (characterp y)
+;;		       ;; If the characters are actually identical, the
+;;		       ;; first eq test will have caught them above; we only
+;;		       ;; need to check them case-insensitively here.
+;;		       (eq (downcase x) (downcase y))))
+;;		 ((eq 'hash-table x-type)
+;;		  (and (hash-table-p y)
+;;		       (eq (hash-table-test x) (hash-table-test y))
+;;		       (= (hash-table-count x) (hash-table-count y))
+;;		       (cl-hash-table-contents-equalp x y)))
+;;		 ((eq 'bit-vector x-type)
+;;		  (if (bit-vector-p y)
+;;		      (equal x y)
+;;		    (if (vectorp y)
+;;			(cl-bit-vector-vector-equalp x y)
+;;		      ;; bit-vectors and strings are only equalp if they're
+;;		      ;; zero-length:
+;;		      (and (equal "" y) (equal #* x)))))
+;;		 (t (equal x y)))))))
 
 ;; XEmacs; #'map, #'mapc, #'mapl, #'maplist, #'mapcon are now in C, together
 ;; with #'map-into, which was never in this file.
--- a/lisp/cl-macs.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/cl-macs.el	Wed Feb 03 20:18:53 2010 +0000
@@ -1,7 +1,7 @@
 ;;; cl-macs.el --- Common Lisp extensions for XEmacs Lisp (part four)
 
 ;; Copyright (C) 1993, 2003, 2004 Free Software Foundation, Inc.
-;; Copyright (C) 2002 Ben Wing.
+;; Copyright (C) 2002, 2010 Ben Wing.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Version: 2.02
@@ -3345,6 +3345,21 @@
       (regexp-quote string)
     form))
 
+;; NOTE: `equalp' is now a primitive, although as of yet it still doesn't
+;; have a byte-compiler opcode for it.  The compiler-macro for `equalp' used
+;; to try and remove as much as possible of the logic of the Lisp `equalp' as
+;; possible whenever one of the arguments is a constant, boiling things down
+;; to a few if-statements and some calls to various no-longer-defined
+;; helper functions.  Besides the fact that the helper functions aren't
+;; defined, there's little point in doing any of that expansion, since it will
+;; end up executing in Lisp what would otherwise be done in C by a direct
+;; call to `equalp'.  The only exception is when the reduction is quite
+;; simple and is to functions that do have op-codes; that may gain something.
+;; However, if `equalp' becomes an opcode itself, consider removing everything
+;; here except maybe when the call can directly be reduced to `equal' or `eq'.
+;;
+;; --ben
+
 (define-compiler-macro equalp (&whole form x y) 
   "Expand calls to `equalp' where X or Y is a constant expression.
 
@@ -3360,8 +3375,6 @@
   ;; constant here.
   (let* ((equalp-sym (eval-when-compile (gensym)))
 	(let-form '(progn))
-	(check-bit-vector t)
-	(check-string t)
 	(original-y y)
 	equalp-temp checked)
   (macrolet
@@ -3386,76 +3399,152 @@
 	    ((member x '("" #* []))
 	     ;; No need to protect against multiple evaluation here:
 	     `(and (member ,original-y '("" #* [])) t))
-	    ((stringp x)
-	     `(,@let-form
-	       (if (stringp ,y)
-		   (eq t (compare-strings ,x nil nil
-					  ,y nil nil t))
-		 (if (vectorp ,y) 
-		     (cl-string-vector-equalp ,x ,y)))))
-	    ((bit-vector-p x)
-	     `(,@let-form
-	       (if (bit-vector-p ,y)
-		   ;; No need to call equalp on each element here:
-		   (equal ,x ,y)
-		 (if (vectorp ,y) 
-		     (cl-bit-vector-vector-equalp ,x ,y)))))
-	    (t
-	     (loop
-	       for elt across x
-	       ;; We may not need to check the other argument if it's a
-	       ;; string or bit vector, depending on the contents of x:
-	       always (progn
-			(unless (characterp elt) (setq check-string nil))
-			(unless (and (numberp elt) (or (= elt 0) (= elt 1)))
-			  (setq check-bit-vector nil))
-			(or check-string check-bit-vector)))
-	     `(,@let-form
-	       (cond
-		,@(if check-string
-		      `(((stringp ,y) 
-			 (cl-string-vector-equalp ,y ,x))))
-		,@(if check-bit-vector 
-		      `(((bit-vector-p ,y)
-			 (cl-bit-vector-vector-equalp ,y ,x))))
-		((vectorp ,y)
-		 (cl-vector-array-equalp ,x ,y)))))))
-	  ((unordered-check (and (characterp x) (not (cl-const-expr-p y))))
-	   `(,@let-form
-	     (or (eq ,x ,y)
-		  ;; eq has a bytecode, char-equal doesn't.
-		 (and (characterp ,y)
-		      (eq (downcase ,x) (downcase ,y))))))
+	    (t form)))
 	  ((unordered-check (and (numberp x) (not (cl-const-expr-p y))))
 	   `(,@let-form
 	     (and (numberp ,y)
 		  (= ,x ,y))))
 	  ((unordered-check (and (hash-table-p x) (not (cl-const-expr-p y))))
-	   ;; Hash tables; follow the CL spec.
-	   `(,@let-form
-	     (and (hash-table-p ,y)
-		  (eq ',(hash-table-test x) (hash-table-test ,y))
-		  (= ,(hash-table-count x) (hash-table-count ,y))
-		  (cl-hash-table-contents-equalp ,x ,y))))
+	   form)
 	  ((unordered-check
 	    ;; Symbols; eq. 
 	    (and (not (cl-const-expr-p y))
 		 (or (memq x '(nil t))
 		     (and (eq (car-safe x) 'quote) (symbolp (second x))))))
 	   (cons 'eq (cdr form)))
-	  ((unordered-check
-	    ;; Compare conses at runtime, there's no real upside to
-	    ;; unrolling the function -> they fall through to the next
-	    ;; clause in this function.
-	    (and (cl-const-expr-p x) (not (consp x))
-		 (not (cl-const-expr-p y))))
-	   ;; All other types; use equal.
-	   (cons 'equal (cdr form)))
+
+	  ;; This clause is wrong -- e.g. when comparing a constant char-table
+	  ;; against a non-constant expression that evaluates to a char-table,
+	  ;; or some for range tables or certain other types, `equalp' is
+	  ;; not the same as `equal'.  We could insert the known list of
+	  ;; types with special `equalp' property, but it's fragile and may
+	  ;; not be much of an optimization, esp. since these types don't
+	  ;; occur that often are often big.
+	  ;;((unordered-check
+	  ;;  ;; Compare conses at runtime, there's no real upside to
+	  ;;  ;; unrolling the function -> they fall through to the next
+	  ;;  ;; clause in this function.
+	  ;;  (and (cl-const-expr-p x) (not (consp x))
+	  ;;       (not (cl-const-expr-p y))))
+	  ;; ;; All other types; use equal.
+	  ;; (cons 'equal (cdr form)))
+	  
 	  ;; Neither side is a constant expression, do all our evaluation at
 	  ;; runtime (or both are, and equalp will be called from
 	  ;; byte-optimize.el).
 	  (t form)))))
 
+;;(define-compiler-macro equalp (&whole form x y) 
+;;  "Expand calls to `equalp' where X or Y is a constant expression.
+;;
+;;Much of the processing that `equalp' does is dependent on the types of both
+;;of its arguments, and with type information for one of them, we can
+;;eliminate much of the body of the function at compile time.
+;;
+;;Where both X and Y are constant expressions, `equalp' is evaluated at
+;;compile time by byte-optimize.el--this compiler macro passes FORM through to
+;;the byte optimizer in those cases."
+;;  ;; Cases where both arguments are constant are handled in
+;;  ;; byte-optimize.el, we only need to handle those cases where one is
+;;  ;; constant here.
+;;  (let* ((equalp-sym (eval-when-compile (gensym)))
+;;	(let-form '(progn))
+;;	(check-bit-vector t)
+;;	(check-string t)
+;;	(original-y y)
+;;	equalp-temp checked)
+;;  (macrolet
+;;      ((unordered-check (check)
+;;	 `(prog1
+;;	     (setq checked
+;;		   (or ,check
+;;		       (prog1 ,(sublis '((x . y) (y . x)) check :test #'eq)
+;;			 (setq equalp-temp x x y y equalp-temp))))
+;;	   (when checked
+;;	     (unless (symbolp y)
+;;	       (setq let-form `(let ((,equalp-sym ,y))) y equalp-sym))))))
+;;    ;; In the bodies of the below clauses, x is always a constant expression
+;;    ;; of the type we're interested in, and y is always a symbol that refers
+;;    ;; to the result non-constant side of the comparison. 
+;;    (cond ((unordered-check (and (arrayp x) (not (cl-const-expr-p y))))
+;;	   ;; Strings and other arrays. A vector containing the same
+;;	   ;; character elements as a given string is equalp to that string;
+;;	   ;; a bit-vector can only be equalp to a string if both are
+;;	   ;; zero-length.
+;;	   (cond
+;;	    ((member x '("" #* []))
+;;	     ;; No need to protect against multiple evaluation here:
+;;	     `(and (member ,original-y '("" #* [])) t))
+;;	    ((stringp x)
+;;	     `(,@let-form
+;;	       (if (stringp ,y)
+;;		   (eq t (compare-strings ,x nil nil
+;;					  ,y nil nil t))
+;;		 (if (vectorp ,y) 
+;;		     (cl-string-vector-equalp ,x ,y)))))
+;;	    ((bit-vector-p x)
+;;	     `(,@let-form
+;;	       (if (bit-vector-p ,y)
+;;		   ;; No need to call equalp on each element here:
+;;		   (equal ,x ,y)
+;;		 (if (vectorp ,y) 
+;;		     (cl-bit-vector-vector-equalp ,x ,y)))))
+;;	    (t
+;;	     (loop
+;;	       for elt across x
+;;	       ;; We may not need to check the other argument if it's a
+;;	       ;; string or bit vector, depending on the contents of x:
+;;	       always (progn
+;;			(unless (characterp elt) (setq check-string nil))
+;;			(unless (and (numberp elt) (or (= elt 0) (= elt 1)))
+;;			  (setq check-bit-vector nil))
+;;			(or check-string check-bit-vector)))
+;;	     `(,@let-form
+;;	       (cond
+;;		,@(if check-string
+;;		      `(((stringp ,y) 
+;;			 (cl-string-vector-equalp ,y ,x))))
+;;		,@(if check-bit-vector 
+;;		      `(((bit-vector-p ,y)
+;;			 (cl-bit-vector-vector-equalp ,y ,x))))
+;;		((vectorp ,y)
+;;		 (cl-vector-array-equalp ,x ,y)))))))
+;;	  ((unordered-check (and (characterp x) (not (cl-const-expr-p y))))
+;;	   `(,@let-form
+;;	     (or (eq ,x ,y)
+;;		  ;; eq has a bytecode, char-equal doesn't.
+;;		 (and (characterp ,y)
+;;		      (eq (downcase ,x) (downcase ,y))))))
+;;	  ((unordered-check (and (numberp x) (not (cl-const-expr-p y))))
+;;	   `(,@let-form
+;;	     (and (numberp ,y)
+;;		  (= ,x ,y))))
+;;	  ((unordered-check (and (hash-table-p x) (not (cl-const-expr-p y))))
+;;	   ;; Hash tables; follow the CL spec.
+;;	   `(,@let-form
+;;	     (and (hash-table-p ,y)
+;;		  (eq ',(hash-table-test x) (hash-table-test ,y))
+;;		  (= ,(hash-table-count x) (hash-table-count ,y))
+;;		  (cl-hash-table-contents-equalp ,x ,y))))
+;;	  ((unordered-check
+;;	    ;; Symbols; eq. 
+;;	    (and (not (cl-const-expr-p y))
+;;		 (or (memq x '(nil t))
+;;		     (and (eq (car-safe x) 'quote) (symbolp (second x))))))
+;;	   (cons 'eq (cdr form)))
+;;	  ((unordered-check
+;;	    ;; Compare conses at runtime, there's no real upside to
+;;	    ;; unrolling the function -> they fall through to the next
+;;	    ;; clause in this function.
+;;	    (and (cl-const-expr-p x) (not (consp x))
+;;		 (not (cl-const-expr-p y))))
+;;	   ;; All other types; use equal.
+;;	   (cons 'equal (cdr form)))
+;;	  ;; Neither side is a constant expression, do all our evaluation at
+;;	  ;; runtime (or both are, and equalp will be called from
+;;	  ;; byte-optimize.el).
+;;	  (t form)))))
+
 (mapc
  #'(lambda (y)
      (put (car y) 'side-effect-free t)
--- a/lisp/find-paths.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/find-paths.el	Wed Feb 03 20:18:53 2010 +0000
@@ -352,25 +352,6 @@
       (setq directories (cdr directories)))
     (reverse reverse-directories)))
 
-(defun paths-uniq-append (list-1 list-2)
-  "Append LIST-1 and LIST-2, omitting EQUAL duplicates."
-  (let ((reverse-survivors '()))
-    (while list-2
-      (if (null (member (car list-2) list-1))
-	  (setq reverse-survivors (cons (car list-2) reverse-survivors)))
-      (setq list-2 (cdr list-2)))
-    (append list-1
-	    (reverse reverse-survivors))))
-
-(defun paths-filter (predicate list)
-  "Delete all matches of PREDICATE from LIST."
-  (let ((reverse-result '()))
-    (while list
-      (if (funcall predicate (car list))
-	  (setq reverse-result (cons (car list) reverse-result)))
-      (setq list (cdr list)))
-    (nreverse reverse-result)))
-
 (defun paths-decode-directory-path (string &optional drop-empties)
   "Split STRING at path separators into a directory list.
 Non-\"\" components are converted into directory form.
@@ -384,9 +365,7 @@
 			(file-name-as-directory component)))
 		  components)))
     (if drop-empties
-	(paths-filter #'(lambda (component)
-			  (null (string-equal "" component)))
-		      directories)
+        (delete "" directories)
       directories)))
 
 ;;; find-paths.el ends here
--- a/lisp/help.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/help.el	Wed Feb 03 20:18:53 2010 +0000
@@ -1414,8 +1414,8 @@
       (cond ((or (stringp def) (vectorp def))
              (princ "a keyboard macro.")
 	     (setq kbd-macro-p t))
-            ((special-form-p fndef)
-             (funcall int "built-in special form" nil 'neither))
+            ((special-operator-p fndef)
+             (funcall int "built-in special operator" nil 'neither))
             ((subrp fndef)
              (funcall int "built-in" nil macrop))
             ((compiled-function-p fndef)
--- a/lisp/loadhist.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/loadhist.el	Wed Feb 03 20:18:53 2010 +0000
@@ -46,7 +46,7 @@
 This is a file name, or nil if the source was a buffer with no associated file.
 
 If TYPE is nil or omitted, any kind of definition is acceptable.
-If TYPE is `defun', then function, subr, special form or macro definitions
+If TYPE is `defun', then function, subr, special operator or macro definitions
 are acceptable.
 If TYPE is `defvar', then variable definitions are acceptable.
 
@@ -90,7 +90,10 @@
         ;; This is a bit heuristic, but shouldn't realistically be a
         ;; problem:
         (if (string-match "\.elc?$" built-in-file)
-            (concat lisp-directory built-in-file)
+            (concat (if (file-readable-p source-lisp)
+			source-lisp
+		      lisp-directory)
+		    built-in-file)
           (concat source-directory "/src/" built-in-file))))))
 
 (defun feature-symbols (feature)
--- a/lisp/loadup.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/loadup.el	Wed Feb 03 20:18:53 2010 +0000
@@ -218,8 +218,12 @@
 ;; See also "site-load" above.
 (when (stringp site-start-file)
   (load "site-init" t))
-;; Add information from this file to the load history:
-(setq load-history (cons (nreverse current-load-list) load-history)
+
+;; Add information from this file to the load history. Delete information
+;; for those files in preloaded-file-list; the symbol file information can
+;; be taken from DOC, and #'unload-feature makes very little sense for
+;; dumped functionality.
+(setq load-history (cons (nreverse current-load-list) (last load-history))
       ;; Clear current-load-list; this (and adding information to
       ;; load-history) is normally done in lread.c after reading the
       ;; entirety of a file, something which never happens for loadup.el.
@@ -227,12 +231,6 @@
 ;; Make the path to this file look a little nicer: 
 (setcar (car load-history) (file-truename (caar load-history)))
 
-;; Make #'find-function behave better with dumped files.
-(let ((source-lisp (concat "^" (regexp-quote source-lisp))))
-  (mapc
-   #'(lambda (elt) (setcar elt (replace-in-string (car elt) source-lisp "")))
-   load-history))
-
 (garbage-collect)
 
 ;;; At this point, we're ready to resume undo recording for scratch.
--- a/lisp/obsolete.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/obsolete.el	Wed Feb 03 20:18:53 2010 +0000
@@ -398,7 +398,7 @@
 
 (make-obsolete 'function-called-at-point 'function-at-point)
 
-;; As of 21.5, #'throw is a special form. This makes bytecode using it
+;; As of 21.5, #'throw is a special operator. This makes bytecode using it
 ;; compiled for 21.4 fail; making this function available works around that.
 (defun obsolete-throw (tag value)
   "Ugly compatibility hack.
--- a/lisp/packages.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/packages.el	Wed Feb 03 20:18:53 2010 +0000
@@ -106,11 +106,10 @@
   "Returns a list package hierarchy directory names.
 These are the valid immediate directory names of package
 directories, directories with higher priority first"
-  (paths-filter #'(lambda (x) x)
-		`("site-packages"
-		  ,(when (featurep 'infodock) "infodock-packages")
-		  ,(when (featurep 'mule) "mule-packages")
-		  "xemacs-packages")))
+  (delq nil `("site-packages"
+              ,(when (featurep 'infodock) "infodock-packages")
+              ,(when (featurep 'mule) "mule-packages")
+              "xemacs-packages")))
 
 (defun package-get-key-1 (info key)
   "Locate keyword `key' in list."
@@ -386,8 +385,8 @@
 (defun packages-find-installation-package-directories (roots)
   "Find the package directories in the XEmacs installation.
 ROOTS is a list of installation roots."
-  (paths-uniq-append (paths-find-version-directories roots (list "") nil nil nil t)
-		     (paths-find-site-directories roots (list "") nil)))
+  (union (paths-find-version-directories roots (list "") nil nil nil t)
+         (paths-find-site-directories roots (list "") nil) :test #'equal))
 
 (defun packages-find-package-hierarchies (package-directories &optional envvar default)
   "Find package hierarchies in a list of package directories.
--- a/lisp/setup-paths.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/setup-paths.el	Wed Feb 03 20:18:53 2010 +0000
@@ -127,8 +127,7 @@
 	 (maybe-root-2 (file-name-as-directory
 			(paths-construct-path '(".." "..") executable-directory))))
 
-    (paths-filter root-p
-		  (list maybe-root-1 maybe-root-2))))
+    (delete-if-not root-p (list maybe-root-1 maybe-root-2))))
 
 (defun paths-find-emacs-roots (invocation-directory
 			       invocation-name
@@ -143,17 +142,17 @@
 				       invocation-name
 				       root-p))
 	 (potential-installation-roots
-	  (paths-uniq-append
+	  (union
 	   (and configure-exec-prefix-directory
 		(list (file-name-as-directory
 		       configure-exec-prefix-directory)))
 	   (and configure-prefix-directory
 		(list (file-name-as-directory
-		       configure-prefix-directory)))))
+		       configure-prefix-directory)))
+           :test #'equal))
 	 (installation-roots
-	  (paths-filter root-p potential-installation-roots)))
-    (paths-uniq-append invocation-roots
-		       installation-roots)))
+	  (remove-if-not root-p potential-installation-roots)))
+    (union invocation-roots installation-roots :test #'equal)))
 
 (defun paths-find-site-lisp-directory (roots)
   "Find the site Lisp directory of the XEmacs hierarchy.
@@ -261,7 +260,7 @@
 LAST-PACKAGE-HIERARCHIES are lists of package hierarchy roots,
 respectively."
   (let ((info-path-envval (getenv "INFOPATH")))
-    (paths-uniq-append
+    (union
      (append
       (let ((info-directory
 	     (paths-find-version-directory roots (list "info")
@@ -275,9 +274,11 @@
       (and info-path-envval
 	   (paths-decode-directory-path info-path-envval 'drop-empties)))
      (and (null info-path-envval)
-	  (paths-uniq-append
+	  (union
 	   (paths-directories-which-exist configure-info-path)
-	   (paths-directories-which-exist paths-default-info-directories))))))
+	   (paths-directories-which-exist paths-default-info-directories)
+           :test #'equal))
+     :test #'equal)))
 
 (defun paths-find-doc-directory (roots)
   "Find the documentation directory.
--- a/lisp/subr.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/lisp/subr.el	Wed Feb 03 20:18:53 2010 +0000
@@ -218,6 +218,7 @@
 (define-function 'remove-directory 'delete-directory)
 (define-function 'set-match-data 'store-match-data)
 (define-function 'send-string-to-terminal 'external-debugging-output)
+(define-function 'special-form-p 'special-operator-p)
 
 ;; XEmacs:
 (defun local-variable-if-set-p (sym buffer)
@@ -1763,14 +1764,14 @@
 SUBR must be a built-in function (not just a symbol that refers to one).
 The returned value is a pair (MIN . MAX).  MIN is the minimum number
 of args.  MAX is the maximum number or the symbol `many', for a
-function with `&rest' args, or `unevalled' for a special form.
+function with `&rest' args, or `unevalled' for a special operator.
 
-See also `special-form-p', `subr-min-args', `subr-max-args',
+See also `special-operator-p', `subr-min-args', `subr-max-args',
 `function-allows-args'. "
   (check-argument-type #'subrp subr)
   (cons (subr-min-args subr)
         (cond
-         ((special-form-p subr)
+         ((special-operator-p subr)
           'unevalled)
          ((null (subr-max-args subr))
           'many)
--- a/lwlib/ChangeLog	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/ChangeLog	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,34 @@
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* lwlib-colors.c:
+	* lwlib-colors.h:
+	* lwlib-fonts.c:
+	* lwlib-fonts.h:
+	* xlwmenu.c:
+	* xlwmenu.c (xlwMenuResources):
+	* xlwmenu.c (x_xft_text_width):
+	* xlwmenu.c (label_button_draw):
+	* xlwmenu.c (push_button_size):
+	* xlwmenu.c (push_button_draw):
+	* xlwmenu.c (make_drawing_gcs):
+	* xlwmenu.c (extract_font_extents):
+	* xlwmenu.c (default_font_of_font_list):
+	* xlwmenu.c (XlwMenuInitialize):
+	* xlwmenu.c (XlwMenuDestroy):
+	* xlwmenu.c (XlwMenuSetValues):
+	* xlwmenuP.h:
+	* xlwmenuP.h (_XlwMenu_part):
+	* xlwtabs.c:
+	* xlwtabs.c (TabsInit):
+	* xlwtabs.c (TabsDestroy):
+	* xlwtabs.c (TabsSetValues):
+	* xlwtabs.c (DrawTab):
+	* xlwtabs.c (TabWidth):
+	* xlwtabs.c (TabsAllocFgGC):
+	* xlwtabs.c (TabsAllocGreyGC):
+	* xlwtabsP.h:
+	USE_XFT* -> HAVE_XFT*.
+
 2010-01-28  Jerry James  <james@xemacs.org>
 
 	* lwlib-internal.h: Add copyright and license boilerplate text
--- a/lwlib/lwlib-colors.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/lwlib-colors.c	Wed Feb 03 20:18:53 2010 +0000
@@ -328,7 +328,7 @@
 #endif
 
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 
 XftColor
 xft_convert_color (Display *dpy, Colormap cmap, Visual *visual, int c, int dim)
@@ -356,6 +356,6 @@
   return result;
 }
 
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 /* end of lwlib-colors.c */
--- a/lwlib/lwlib-colors.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/lwlib-colors.h	Wed Feb 03 20:18:53 2010 +0000
@@ -39,7 +39,7 @@
 int x_allocate_nearest_color (Display *display, Colormap screen_colormap,
 			      Visual *visual, XColor *color_def);
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #define _XFT_NO_COMPAT_
 /* shut up GCC */
 #define face_index face_index_arg
@@ -54,6 +54,6 @@
 
 XftColor xft_convert_color (Display *dpy, Colormap cmap, Visual *visual,
 			    int c, int dim);
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 #endif /* INCLUDED_lwlib_colors_h_ */
--- a/lwlib/lwlib-fonts.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/lwlib-fonts.c	Wed Feb 03 20:18:53 2010 +0000
@@ -45,7 +45,7 @@
  * code for handling Xft
  */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 
 /* helper function to correctly open Xft/core fonts by name
    #### Can't we use FcParseName here?
@@ -112,6 +112,6 @@
   return res;
 }
 
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 /* End of lwlib-fonts.c */
--- a/lwlib/lwlib-fonts.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/lwlib-fonts.h	Wed Feb 03 20:18:53 2010 +0000
@@ -29,7 +29,7 @@
 
 /* get headers */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #define _XFT_NO_COMPAT_
 /* shut up GCC */
 #define face_index face_index_arg
@@ -41,11 +41,11 @@
 #if XFT_MAJOR < 2
 #error Xft versions < 2 not supported
 #endif
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 /* Xt name macros */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #ifndef XtNxftFont
 #define XtNxftFont "xftFont"
 #define XtCXftFont "XftFont"
@@ -54,16 +54,16 @@
 #define XtNfcFontName "fcFontName"
 #define XtCFcFontName "FcFontName"
 #endif
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 /* code 'n' stuff */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #define FCSTRLEN 512
 
 /* non-Lisp prototypes */
 /* #### change this back to _open_name */
 XftFont *xft_open_font_by_name (Display *dpy, char *name);
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 #endif /* INCLUDED_lwlib_fonts_h_ */
--- a/lwlib/xlwmenu.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/xlwmenu.c	Wed Feb 03 20:18:53 2010 +0000
@@ -46,7 +46,7 @@
 #endif /* XmVersion < 1.2 */
 #endif
 
-/* #### we may want to turn off USE_XFT here if !USE_XFT_MENUBARS
+/* #### we may want to turn off HAVE_XFT here if !HAVE_XFT_MENUBARS
    In fact, maybe that's the right interface overall? */
 #include "lwlib-fonts.h"
 #include "lwlib-colors.h"
@@ -98,7 +98,7 @@
 #define pmres(name,cls,member) \
   Xt_RESOURCE (name, cls, XtRPixmap, Pixmap, offset(member), XtRImmediate, None)
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   /* There are three font list resources, so that we can accept either of
      the resources *fontList: or *font:, and so that we can tell the
      difference between them being specified, and being defaulted to a
@@ -113,7 +113,7 @@
 #else
   fontres (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, font,
 	   "XtDefaultFont"),
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   fontres (XtNfcFontName, XtCFcFontName, XtRString, String, fcFontName,
 	   "sans-serif-12:bold"),
   /* #### This needs to be fixed to give a proper type and converter for
@@ -191,7 +191,7 @@
 static void Drag  (Widget w, XEvent *ev, String *params, Cardinal *num_params);
 static void Select(Widget w, XEvent *ev, String *params, Cardinal *num_params);
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 static XFontStruct *default_font_of_font_list (XmFontList);
 #endif
 
@@ -330,14 +330,14 @@
 /* Size code */
 static int
 string_width (XlwMenuWidget mw,
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	      XmString s
 #else
 	      char *s
 #endif
 	      )
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   Dimension width, height;
   XmStringExtent (mw->menu.font_list, s, &width, &height);
   return width;
@@ -347,7 +347,7 @@
   XmbTextExtents (mw->menu.font_set, s, strlen (s), &ri, &rl);
   return rl.width;
 # else
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XGlyphInfo glyphinfo;
   XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) s,
 		   strlen (s), &glyphinfo);
@@ -384,21 +384,21 @@
 
 static int
 string_width_u (XlwMenuWidget mw,
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	      XmString string
 #else
 	      char *string
 #endif
 	      )
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   Dimension width, height;
   XmString newstring;
 #else
 # ifdef USE_XFONTSET
   XRectangle ri, rl;
 # else /* ! USE_XFONTSET */
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XGlyphInfo glyphinfo;
 #else
   XCharStruct xcs;
@@ -411,7 +411,7 @@
   char *chars;
   int i, j;
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   chars = "";
   if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars))
     chars = "";
@@ -428,7 +428,7 @@
 	    newchars[j++] = chars[i];
   newchars[j] = '\0';
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   newstring = XmStringLtoRCreate (newchars, XmFONTLIST_DEFAULT_TAG);
   XmStringExtent (mw->menu.font_list, newstring, &width, &height);
   XmStringFree (newstring);
@@ -439,7 +439,7 @@
   XmbTextExtents (mw->menu.font_set, newchars, j, &ri, &rl);
   return rl.width;
 # else /* ! USE_XFONTSET */
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) newchars,
 		   j, &glyphinfo);
   return glyphinfo.xOff;
@@ -613,7 +613,7 @@
   return result;
 }
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 
 static XmString
 resource_widget_value (XlwMenuWidget mw, widget_value *val)
@@ -764,7 +764,7 @@
 #define MINL(x,y) ((((unsigned long) (x)) < ((unsigned long) (y))) \
 		   ? ((unsigned long) (x)) : ((unsigned long) (y)))
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 static int
 x_xft_text_width (Display *dpy, XftFont *xft_font, char *run, int len)
 {
@@ -782,20 +782,20 @@
 string_draw (XlwMenuWidget mw,
 	     Window window,
 	     int x, int y,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	     XftColor *color,
 	     XftColor *colorBg,
 #else
 	     GC gc,
 #endif
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	     XmString string
 #else
 	     char *string
 #endif
 )
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   XmStringDraw (XtDisplay (mw), window,
 		mw->menu.font_list,
 		string, gc,
@@ -805,7 +805,7 @@
 		0, /* ???? layout_direction */
 		0);
 #else
-# ifdef USE_XFT_MENUBARS
+# ifdef HAVE_XFT_MENUBARS
   Display *display = XtDisplay (mw);
   Visual *visual = DefaultVisualOfScreen (XtScreen (mw));
   Colormap cmap = mw->core.colormap;
@@ -828,7 +828,7 @@
   XDrawString (XtDisplay (mw), window, gc,
 	       x, y + mw->menu.font_ascent, string, strlen (string));
 #  endif /* USE_XFONTSET */
-# endif /* USE_XFT_MENUBARS */
+# endif /* HAVE_XFT_MENUBARS */
 #endif /* NEED_MOTIF */
 }
 
@@ -837,7 +837,7 @@
 	XlwMenuWidget mw,
 	Window window,
 	int x, int y,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	XftColor *color,
 	XftColor *colorBg,
 #else
@@ -848,7 +848,7 @@
 	int end
 )
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	Dimension width, height;
 	XmString newstring;
 	int c;
@@ -885,7 +885,7 @@
 		mw->menu.font_set, &string[start], end - start, &ri, &rl);
 	return rl.width;
 # else
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	if (end <= start)
 		return 0;
 	else
@@ -937,12 +937,12 @@
 string_draw_u (XlwMenuWidget mw,
 	       Window window,
 	       int x, int y,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	       XftColor *color, XftColor *colorBg, GC gc,
 #else
 	       GC gc,
 #endif
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	       XmString string
 #else
 	       char *string
@@ -952,7 +952,7 @@
   int i, s = 0;
   char *chars;
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   chars = "";
   if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars))
     chars = "";
@@ -963,7 +963,7 @@
       if (chars[i] == '%' && chars[i+1] == '_') {
 	  int w;
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  x += string_draw_range (mw, window, x, y, color, colorBg, chars, s, i);
 	  w = string_draw_range (mw, window, x, y, color, colorBg, chars, i+2, i+3);
 #else
@@ -980,19 +980,19 @@
 	  i += 2;
       }
   }
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   x += string_draw_range (mw, window, x, y, color, colorBg, chars, s, i);
 #else
   x += string_draw_range (mw, window, x, y, gc, chars, s, i);
 #endif
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   XtFree (chars);
 #endif
 }
 
 static void /* XXX */
 binding_draw (XlwMenuWidget mw, Window w, int x, int y,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	      XftColor *color,
 	      XftColor *colorBg,
 #else
@@ -1000,12 +1000,12 @@
 #endif
 	      char *value)
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   XmString xm_value = XmStringCreateLtoR(value, XmSTRING_DEFAULT_CHARSET);
   string_draw (mw, w, x, y, gc, xm_value);
   XmStringFree (xm_value);
 #else
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   string_draw (mw, w, x, y, color, colorBg, value);
 #else
   string_draw (mw, w, x, y, gc, value);
@@ -1652,7 +1652,7 @@
   int y_offset = mw->menu.shadow_thickness + mw->menu.vertical_margin;
   GC gc;
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XftColor color, colorBg;
   Display *display = XtDisplay (mw);
   Colormap cmap = mw->core.colormap;
@@ -1667,7 +1667,7 @@
 
   if (highlighted && (in_menubar || val->contents)) 
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       pixel = mw->menu.highlight_foreground;
       pixelBg = mw->core.background_pixel;
 #endif
@@ -1675,7 +1675,7 @@
     }
   else if (in_menubar || val->contents)
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       pixel = mw->menu.foreground;
       pixelBg = mw->core.background_pixel;
 #endif
@@ -1683,13 +1683,13 @@
     }
   else
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       pixel = mw->menu.title_foreground;
       pixelBg = mw->core.background_pixel;
 #endif
       gc = mw->menu.title_gc;
     }
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   color = xft_convert_color (display, cmap, visual, pixel, 0);
   colorBg = xft_convert_color (display, cmap, visual, pixelBg, 0);
 #endif
@@ -1698,7 +1698,7 @@
   string_draw_u (mw,    /* XXX */
 		 window,
 		 x + label_offset, y + y_offset,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 		 &color, &colorBg, gc,
 #else
 	       gc,
@@ -1724,7 +1724,7 @@
   if (!in_menubar && val->key)
     {
       int w;
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
       XmString key = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET);
       w = string_width (mw, key);
       XmStringFree (key);
@@ -1753,7 +1753,7 @@
   shadow_type type;
   Boolean menu_pb = in_menubar && (menu_item_type (val) == BUTTON_TYPE);
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XftColor color, colorBg;
   Display *display = XtDisplay (mw);
   Colormap cmap = mw->core.colormap;
@@ -1771,7 +1771,7 @@
     {
       if (val->enabled)
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       pixel = mw->menu.highlight_foreground;
       pixelBg = mw->core.background_pixel;
 #endif
@@ -1779,7 +1779,7 @@
     }
       else
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       dim = 1;
       pixel = mw->menu.foreground;
       pixelBg = mw->core.background_pixel;
@@ -1791,7 +1791,7 @@
     {
       if (val->enabled)
 	{
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  pixel = mw->menu.button_foreground;
 	  pixelBg = mw->core.background_pixel;
 #endif
@@ -1799,7 +1799,7 @@
 	}
       else
 	{
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  dim = 1;
 	  pixel = mw->menu.button_foreground;
 	  pixelBg = mw->core.background_pixel;
@@ -1811,7 +1811,7 @@
     {
       if (val->enabled)
 	{
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  pixel = mw->menu.foreground;
 	  pixelBg = mw->core.background_pixel;
 #endif
@@ -1819,7 +1819,7 @@
 	}
       else
 	{
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  dim = 1;
 	  pixel = mw->menu.foreground;
 	  pixelBg = mw->core.background_pixel;
@@ -1828,7 +1828,7 @@
 	}
     }
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   color = xft_convert_color (display, cmap, visual, pixel, dim);
   colorBg = xft_convert_color (display, cmap, visual, pixelBg, 0);
 #endif
@@ -1836,7 +1836,7 @@
   string_draw_u (mw,
 		 window,
 		 x + label_offset, y + y_offset,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 		 &color, &colorBg, gc,
 #else
 		 gc,
@@ -1855,7 +1855,7 @@
       binding_draw (mw, window,
 		    x + binding_offset + mw->menu.column_spacing,
 		    y + y_offset, 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 		    &color, &colorBg,
 #else
 		    gc,
@@ -2806,16 +2806,16 @@
 make_drawing_gcs (XlwMenuWidget mw)
 {
   XGCValues xgcv;
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   unsigned long flags = (GCForeground | GCBackground);
 #else
   unsigned long flags = (GCFont | GCForeground | GCBackground);
 #endif
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   xgcv.font = default_font_of_font_list (mw->menu.font_list)->fid;
 #else
-#ifndef USE_XFT_MENUBARS
+#ifndef HAVE_XFT_MENUBARS
   xgcv.font = mw->menu.font->fid;
 #endif
 #endif
@@ -3064,7 +3064,7 @@
 static void
 extract_font_extents (XlwMenuWidget mw)
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   /* Find the maximal ascent/descent of the fonts in the font list
      so that all menu items can be the same height... */
   mw->menu.font_ascent  = 0;
@@ -3149,7 +3149,7 @@
           mw->menu.font_descent = font->descent;
   }
 # else /* ! USE_XFONTSET */
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   mw->menu.font_ascent  = mw->menu.renderFont->ascent;
   mw->menu.font_descent = mw->menu.renderFont->descent;
 #else
@@ -3160,7 +3160,7 @@
 #endif /* NEED_MOTIF */
 }
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 static XFontStruct *
 default_font_of_font_list (XmFontList font_list)
 {
@@ -3230,7 +3230,7 @@
     XCreatePixmapFromBitmapData (display, window, (char *) gray_bits,
 				 gray_width, gray_height, 1, 0, 1);
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   /* #### Even if it's a kludge!!!, we should consider doing the same for
      X Font Sets. */
   /* The menu.font_list slot came from the *fontList resource (Motif standard.)
@@ -3252,7 +3252,7 @@
     mw->menu.font_list = mw->menu.fallback_font_list;
 #endif
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   /* #### kludge for name change */
   if (!mw->menu.fcFontName)
     mw->menu.fcFontName = mw->menu.xftFontName;
@@ -3363,7 +3363,7 @@
   XFreePixmap (XtDisplay (mw), mw->menu.gray_pixmap);
   mw->menu.gray_pixmap = (Pixmap) -1;
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XftFontClose (XtDisplay (mw), mw->menu.renderFont);
 #endif
 
@@ -3409,12 +3409,12 @@
   if (newmw->core.background_pixel != oldmw->core.background_pixel
       || newmw->menu.foreground != oldmw->menu.foreground
       /* For the XEditResource protocol, which may want to change the font. */
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
       || newmw->menu.font_list          != oldmw->menu.font_list
       || newmw->menu.font_list_2        != oldmw->menu.font_list_2
       || newmw->menu.fallback_font_list != oldmw->menu.fallback_font_list
 #else
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       || newmw->menu.renderFont != oldmw->menu.renderFont
 #else
       || newmw->menu.font != oldmw->menu.font
--- a/lwlib/xlwmenuP.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/xlwmenuP.h	Wed Feb 03 20:18:53 2010 +0000
@@ -4,7 +4,7 @@
 #include "xlwmenu.h"
 #include <X11/CoreP.h>
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 #include <X11/Xft/Xft.h>
 #endif
 
@@ -27,13 +27,13 @@
 {
   /* slots set by the resources */
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   XmFontList	font_list;
   XmFontList	font_list_2;
   XmFontList	fallback_font_list;
 #else
   XFontStruct *	font;
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   String fcFontName;
   String xftFontName;
   XftFont *renderFont;
@@ -57,7 +57,7 @@
   Pixel 	top_shadow_color;
   Pixel 	bottom_shadow_color;
   Pixel 	select_color;
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 #endif
   Pixmap	top_shadow_pixmap;
   Pixmap	bottom_shadow_pixmap;
--- a/lwlib/xlwtabs.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/xlwtabs.c	Wed Feb 03 20:18:53 2010 +0000
@@ -152,7 +152,7 @@
        selectInsensitive,  XtRImmediate, True),
   res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, 
        font,  XtRString, XtDefaultFont),
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
   /* #### Maybe use "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1" here?
      or XtDefaultFont? */
   res (XtNfcFontName, XtCFcFontName, XtRString, String,
@@ -430,7 +430,7 @@
 
 static int debug_tabs = 0;	/* increase for more verbosity */
 
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 /* #### duplicated from xlwmenu.c -- CLEAN THIS SHIT UP!
    Undeclared so define at top. */
 #define MINL(x,y) ((((unsigned long) (x)) < ((unsigned long) (y))) \
@@ -484,7 +484,7 @@
      */
     newTw->tabs.tab_height = 2 * newTw->tabs.internalHeight + SHADWID ;
 
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
     /* #### kludge for name change */
     if (!newTw->tabs.fcFontName)
       newTw->tabs.fcFontName = newTw->tabs.xftFontName;
@@ -501,11 +501,11 @@
       newTw->tabs.tab_height += newTw->tabs.renderFont->ascent +
 				newTw->tabs.renderFont->descent;
 #endif /* XFT_USE_HEIGHT_NOT_ASCENT_DESCENT */
-#else  /* ! USE_XFT_TABS */
+#else  /* ! HAVE_XFT_TABS */
     if (newTw->tabs.font != NULL)
       newTw->tabs.tab_height += newTw->tabs.font->max_bounds.ascent +
 				newTw->tabs.font->max_bounds.descent;
-#endif /* ! USE_XFT_TABS */
+#endif /* ! HAVE_XFT_TABS */
 
     /* if size not explicitly set, set it to our preferred size now. */
 
@@ -579,9 +579,9 @@
 TabsDestroy(Widget w)
 {
 	TabsWidget tw = (TabsWidget) w;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	XftFontClose (XtDisplay (w), tw->tabs.renderFont);
-#endif /* ! USE_XFT_TABS */
+#endif /* ! HAVE_XFT_TABS */
 	TabsFreeGCs (tw) ;
 }
 
@@ -684,7 +684,7 @@
 	int	i ;
 
 	if(
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
             tw->tabs.renderFont != curtw->tabs.renderFont  ||
 #else
 	    tw->tabs.font != curtw->tabs.font  ||
@@ -694,7 +694,7 @@
 	{
 	  tw->tabs.tab_height = 2 * tw->tabs.internalHeight + SHADWID;
 
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  if (tw->tabs.renderFont != NULL)
 #if XFT_USE_HEIGHT_NOT_ASCENT_DESCENT
 	    tw->tabs.tab_height += tw->tabs.renderFont->height;
@@ -702,11 +702,11 @@
 	    tw->tabs.tab_height += tw->tabs.renderFont->ascent +
 				   tw->tabs.renderFont->descent;
 #endif /* XFT_USE_HEIGHT_NOT_ASCENT_DESCENT */
-#else  /* ! USE_XFT_TABS */
+#else  /* ! HAVE_XFT_TABS */
 	  if (tw->tabs.font != NULL)
 	    tw->tabs.tab_height += tw->tabs.font->max_bounds.ascent +
 				   tw->tabs.font->max_bounds.descent;
-#endif /* ! USE_XFT_TABS */
+#endif /* ! HAVE_XFT_TABS */
 
 	  /* Tab size has changed.  Resize all tabs and request a new size */
 	  for(i=0, childP=tw->composite.children;
@@ -723,7 +723,7 @@
 
 	if( tw->core.background_pixel != curtw->core.background_pixel ||
 	    tw->core.background_pixmap != curtw->core.background_pixmap ||
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	    tw->tabs.renderFont != curtw->tabs.renderFont
 #else
 	    tw->tabs.font != curtw->tabs.font
@@ -1644,7 +1644,7 @@
 	  Window	win = XtWindow((Widget)tw) ;
 	  String	lbl = tab->tabs.label != NULL ?
 			      tab->tabs.label : XtName(child) ;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  XftColor color;
 	  XftColor colorBG;
 	  Colormap cmap = tw->core.colormap;
@@ -1662,7 +1662,7 @@
 	  if (XtIsSensitive(child))
 	  {
 	    gc = tw->tabs.foregroundGC;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	    color = xft_convert_color (dpy, cmap, visual,
 				       tab->tabs.foreground, 0);
 #else
@@ -1684,7 +1684,7 @@
 	      tab->tabs.greyAlloc = True;
 	    }
 	    gc = tw->tabs.greyGC;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	    color = xft_convert_color (dpy, cmap, visual, tab->tabs.grey, 0);
 #else
 	    XSetForeground(dpy, gc, tab->tabs.grey);
@@ -1709,14 +1709,14 @@
 	  }
 
 	  if (lbl != NULL &&
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      tw->tabs.renderFont != NULL
 #else
 	      tw->tabs.font != NULL
 #endif
 	      )
 	    {
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      XftDraw *xftDraw = XftDrawCreate (dpy, win, visual, cmap);
 	      XftFont *renderFont = tw->tabs.renderFont;
 	      XGlyphInfo glyphinfo;
@@ -1984,7 +1984,7 @@
 	TabsWidget	tw = (TabsWidget)XtParent(w) ;
 	String		lbl = tab->tabs.label != NULL ?
 				tab->tabs.label : XtName(w);
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	XftFont		*font = tw->tabs.renderFont;
 #else
 	XFontStruct	*font = tw->tabs.font;
@@ -2003,7 +2003,7 @@
 
 	if( lbl != NULL && font != NULL )
 	{
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  tab->tabs.width += x_xft_text_width (XtDisplay(tw), font,
 					       (FcChar8 *) lbl,
 					       (int)strlen(lbl)) + iw;
@@ -2444,7 +2444,7 @@
 
 	values.background = tw->core.background_pixel;
 	values.font =
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  None;
 #else
 	  tw->tabs.font->fid;
@@ -2454,13 +2454,13 @@
 
 	tw->tabs.foregroundGC =
 	  XtAllocateGC(w, w->core.depth,
-#ifndef USE_XFT_TABS
+#ifndef HAVE_XFT_TABS
 		       GCFont|
 #endif
 		       GCBackground|GCLineStyle,
 		       &values,
 		       GCForeground,
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 		       GCFont|
 #endif
 		       GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
@@ -2475,7 +2475,7 @@
 
 	values.background = tw->core.background_pixel;
 	values.font =
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  None;
 #else
 	  tw->tabs.font->fid;
@@ -2488,12 +2488,12 @@
 
 	  tw->tabs.greyGC =
 	    XtAllocateGC(w, w->core.depth,
-#ifndef USE_XFT_TABS
+#ifndef HAVE_XFT_TABS
 	      GCFont|
 #endif
 	      GCBackground|GCStipple|GCFillStyle, &values,
 	      GCForeground,
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      GCFont|
 #endif
 	      GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
@@ -2503,14 +2503,14 @@
 	{
 	  tw->tabs.greyGC =
 	    XtAllocateGC(w, w->core.depth,
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      0L,
 #else
 	      GCFont,
 #endif
 	      &values,
 	      GCForeground,
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      GCFont|
 #endif
 	      GCBackground|GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
--- a/lwlib/xlwtabsP.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/lwlib/xlwtabsP.h	Wed Feb 03 20:18:53 2010 +0000
@@ -41,7 +41,7 @@
 #endif
 
 #include "xlwtabs.h"
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 #include <X11/Xft/Xft.h>
 #endif
 
@@ -73,7 +73,7 @@
 typedef struct {
     /* resources */
     XFontStruct	*font ;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
     XftFont	*renderFont;
     String	fcFontName;
     String	xftFontName;
--- a/man/ChangeLog	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/ChangeLog	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,69 @@
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* internals/internals.texi (Top):
+	* internals/internals.texi (Evaluation; Stack Frames; Bindings):
+	* internals/internals.texi (Ben's README):
+	* internals/internals.texi (Consoles; Devices; Frames; Windows):
+	* internals/internals.texi (Window Hierarchy):
+	* internals/internals.texi (The Window Object):
+	* internals/internals.texi (Modules for the Basic Displayable Lisp Objects):
+	* internals/internals.texi (Window-System Support):
+	* internals/internals.texi (Creating a Window-System Type):
+	* internals/internals.texi (Discussion -- Garbage Collection):
+	Update the part at the top about how to maintain the file with
+	more tips.
+
+	Add a chapter on "window-system support" describing in a general
+	way how the support for different window systems/device types
+	works, including the separation between device-independent and
+	device-dependent parts, device methods, the specific device types
+	and the "xlike" pseudo-type.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* xemacs/programs.texi (Defuns): 
+	* lispref/variables.texi (Local Variables, Defining Variables)
+	(Setting Variables, Default Value):
+	* lispref/symbols.texi (Definitions): 
+	* lispref/searching.texi (Saving Match Data): 
+	* lispref/positions.texi (Excursions, Narrowing):
+	* lispref/objects.texi (Primitive Function Type): 
+	* lispref/macros.texi (Defining Macros, Backquote): 
+	* lispref/lispref.texi (Top): 
+	* lispref/intro.texi (A Sample Function Description):
+	* lispref/help.texi (Help Functions):
+	* lispref/functions.texi (What Is a Function, Simple Lambda)
+	(Defining Functions, Calling Functions, Anonymous Functions):
+	* lispref/frames.texi (Input Focus):
+	* lispref/eval.texi (Forms, Function Indirection)
+	(Special Operators, Quoting):
+	* lispref/edebug-inc.texi (Instrumenting)
+	(Specification Examples):
+	* lispref/debugging.texi (Internals of Debugger):
+	* lispref/control.texi (Control Structures, Sequencing):
+	(Conditionals, Combining Conditions, Iteration):
+	(Catch and Throw, Handling Errors):
+	* lispref/commands.texi (Defining Commands, Using Interactive):
+	Terminology change; special operator -> special form. 
+
+	Don't attempt to change this in texinfo.texi or cl.texi, which use
+	macros I don't understand.
+
+	* lispref/macros.texi (Defining Macros): Give an anonymous macro
+	example here. 
+	* lispref/positions.texi (Excursions):
+	Correct some documentation that called a couple of macros special
+	forms.
+	* lispref/searching.texi (Saving Match Data):
+	Drop some documentation of how to write code that works with Emacs
+	18.
+	* lispref/specifiers.texi (Adding Specifications):
+	Correct this; #'let-specifier is a macro, not a special operator.
+	* lispref/windows.texi (Window Configurations)
+	(Selecting Windows): 
+	Correct this, #'save-selected-window and #'save-window-excursion
+	are macros, not special operators.
+
 2010-01-28  Jerry James  <loganjerry@gmail.com>
 
 	* external-widget.texi: Add copyright and license boilerplate text
--- a/man/cl.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/cl.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -680,7 +680,7 @@
 (compile load eval) @dots{})}.
 @end defspec
 
-Emacs 19 includes two special forms related to @code{eval-when}.
+Emacs 19 includes two special operators related to @code{eval-when}.
 One of these, @code{eval-when-compile}, is not quite equivalent to
 any @code{eval-when} construct and is described below.  This package
 defines a version of @code{eval-when-compile} for the benefit of
@@ -990,7 +990,7 @@
 assignments are done in parallel rather than sequentially.
 
 @defspec psetq [symbol form]@dots{}
-This special form (actually a macro) is used to assign to several
+This macro is used to assign to several
 variables simultaneously.  Given only one @var{symbol} and @var{form},
 it has the same effect as @code{setq}.  Given several @var{symbol}
 and @var{form} pairs, it evaluates all the @var{form}s in advance
--- a/man/internals/internals.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/internals/internals.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -129,13 +129,37 @@
 @end ifinfo
 
 @ignore
-Don't update this by hand!!!!!!
-Use C-u C-c C-u m (aka C-u M-x texinfo-master-list).
-NOTE: This command does not include the Index:: menu entry.
+Tips for maintaining this file:
+
+1. Updating the forward, back and up pointers in a @@node line:
+---------------------------------------------------------------
+
+Don't do it by hand!
+
+Use C-c C-u C-e (aka M-x texinfo-every-node-update).
+
+2. Updating the menus:
+----------------------
+
+This section describes how to update the menus at the end of chapters,
+sections with subsections, etc., and the master menu near the top of
+the file:
+
+Don't do it by hand!
+
+Use C-u C-c C-u m (aka C-u M-x texinfo-master-menu).
+N
+OTE: This command does not include the Index:: menu entry.
 You must add it by hand.
 
-Here are some useful Lisp routines for quickly Texinfo-izing text that
-has been formatted into ASCII lists and tables.
+3. Converting plain text into Texinfo:
+--------------------------------------
+
+3a. Here are some useful Lisp routines for quickly Texinfo-izing text
+    that has been formatted into ASCII lists and tables.
+
+Note: to define these routines, put point after the end of the definition
+and type C-x C-e.
 
 (defun list-to-texinfo (b e)
   "Convert the selected region from an ASCII list to a Texinfo list."
@@ -249,8 +273,8 @@
     (beginning-of-line)
     (insert "@end table\n")))
 
-A useful Lisp routine for adding markup based on conventions used in plain
-text files; see doc string below.
+3b. A useful Lisp routine for adding markup based on conventions used
+    in plain text files; see doc string below.
 
 (defun convert-text-to-texinfo (&optional no-narrow)
   "Convert text to Texinfo.
@@ -259,10 +283,10 @@
 in text: @code{} surrounded by ` and ' or followed by a (); @strong{}
 surrounded by *'s; @file{} something that looks like a file name."
   (interactive)
-  (if (region-active-p)
+  (if (and (not no-narrow) (region-active-p))
       (save-restriction
 	(narrow-to-region (region-beginning) (region-end))
-	(convert-comments-to-texinfo t))
+	(convert-text-to-texinfo t))
     (let ((p (point))
 	  (case-replace nil))
       (query-replace-regexp "`\\([^']+\\)'\\([^']\\)" "@code{\\1}\\2" nil)
@@ -274,31 +298,38 @@
       (query-replace-regexp "\\(\\(\\s_\\|\\sw\\)+\\.[A-Za-z]+\\)\\([^A-Za-z.}]\\)" "@file{\\1}\\3" nil)
       )))
 
-Macro the generate the "Future Work" section from a title; put
-point at beginning.
+4. Adding new sections:
+-----------------------
+
+NOTE: These are in the form of macros. #### FIXME Convert them to
+proper functions.  To edit these macros, define them and then use
+M-x edit-kbd-macro.
+
+Macro to generate the "Future Work" section from a title; put
+point at the beginning of the title.
 
 (defalias 'make-future (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @section SPC <f4> <home> <up> <C-right> <right> Future SPC Work SPC - - SPC <home> <down> <C-right> <right> Future SPC Work SPC - - SPC <end> RET @cindex SPC future SPC work, SPC <f4> C-r , RET C-x C-x M-l RET @cindex SPC <f4> <home> <C-right> <S-end> M-l , SPC future SPC work RET"))
+"<S-end> M-w <home> @node SPC <end> RET @section SPC C-y <home> <up> <C-right> <right> Future SPC Work SPC - - SPC <home> <down> <C-right> <right> Future SPC Work SPC - - SPC <end> RET @cindex SPC future SPC work, SPC C-y C-r , RET C-x C-x M-l RET @cindex SPC C-y <home> <C-right> <S-end> M-l , SPC future SPC work RET"))
 
 Similar but generates a "Discussion" section.
 
 (defalias 'make-discussion (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @section SPC <f4> <home> <up> <C-right> <right> Discussion SPC - - SPC <home> <down> <C-right> <right> Discussion SPC - - SPC <end> RET @cindex SPC discussion, SPC <f4> C-r , RET C-x C-x M-l RET @cindex SPC <f4> <home> <C-right> <S-end> M-l , SPC discussion RET"))
+"<S-end> M-w <home> @node SPC <end> RET @section SPC C-y <home> <up> <C-right> <right> Discussion SPC - - SPC <home> <down> <C-right> <right> Discussion SPC - - SPC <end> RET @cindex SPC discussion, SPC C-y C-r , RET C-x C-x M-l RET @cindex SPC C-y <home> <C-right> <S-end> M-l , SPC discussion RET"))
 
 Similar but generates an "Old Future Work" section.
 
 (defalias 'make-old-future (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @section SPC <f4> <home> <up> <C-right> <right> Old SPC Future SPC Work SPC - - SPC <home> <down> <C-right> <right> Old SPC Future SPC Work SPC - - SPC <end> RET @cindex SPC old SPC future SPC work, SPC <f4> C-r , RET C-x C-x M-l RET @cindex SPC <f4> <home> <C-right> <S-end> M-l , SPC old SPC future SPC work RET"))
+"<S-end> M-w <home> @node SPC <end> RET @section SPC C-y <home> <up> <C-right> <right> Old SPC Future SPC Work SPC - - SPC <home> <down> <C-right> <right> Old SPC Future SPC Work SPC - - SPC <end> RET @cindex SPC old SPC future SPC work, SPC C-y C-r , RET C-x C-x M-l RET @cindex SPC C-y <home> <C-right> <S-end> M-l , SPC old SPC future SPC work RET"))
 
 Similar but generates a general section.
 
 (defalias 'make-section (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @section SPC <f4> RET @cindex SPC C-SPC C-g <f4> C-x C-x M-l <home> <down>"))
+"<S-end> M-w <home> @node SPC <end> RET @section SPC C-y RET @cindex SPC C-SPC C-g C-y C-x C-x M-l <home> <down>"))
 
 Similar but generates a general subsection.
 
 (defalias 'make-subsection (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @subsection SPC <f4> RET @cindex SPC C-SPC C-g <f4> C-x C-x M-l <home> <down>"))
+"<S-end> M-w <home> @node SPC <end> RET @subsection SPC C-y RET @cindex SPC C-SPC C-g C-y C-x C-x M-l <home> <down>"))
 @end ignore
 
 @menu
@@ -328,6 +359,7 @@
 * Text::                        
 * Multilingual Support::        
 * Consoles; Devices; Frames; Windows::  
+* Window-System Support::       
 * The Redisplay Mechanism::     
 * Extents::                     
 * Faces::                       
@@ -451,7 +483,7 @@
 
 * Evaluation::                  
 * Dynamic Binding; The specbinding Stack; Unwind-Protects::  
-* Simple Special Forms::        
+* Simple Special Operators::    
 * Catch and Throw::             
 * Error Trapping::              
 
@@ -558,9 +590,12 @@
 * Point::                       
 * Window Hierarchy::            
 * The Window Object::           
-* Creating a New Console/Device/Frame Type::  
 * Modules for the Basic Displayable Lisp Objects::  
 
+Window-System Support
+
+* Creating a Window-System Type::  
+
 The Redisplay Mechanism
 
 * Critical Redisplay Sections::  
@@ -740,8 +775,8 @@
 
 Discussion -- Garbage Collection
 
-* Discussion -- KKCC::
-* Discussion -- Incremental Collector::
+* Discussion -- KKCC::          
+* Discussion -- Incremental Collector::  
 * Discussion -- Pure Space::    
 * Discussion -- Hashtable-Based Marking and Cleanup::  
 * Discussion -- The Anti-Cons::  
@@ -3518,7 +3553,7 @@
 This module contains all of the functions to handle the flow of control.
 This includes the mechanisms of defining functions, calling functions,
 traversing stack frames, and binding variables; the control primitives
-and other special forms such as @code{while}, @code{if}, @code{eval},
+and other special operators such as @code{while}, @code{if}, @code{eval},
 @code{let}, @code{and}, @code{or}, @code{progn}, etc.; handling of
 non-local exits, unwind-protects, and exception handlers; entering the
 debugger; methods for the subr Lisp object type; etc.  It does
@@ -5323,7 +5358,7 @@
 C macros.  The only way to really understand how to write new C code is
 to read the source, but we can explain some things here.
 
-An example of a special form is the definition of @code{prog1}, from
+An example of a special operator is the definition of @code{prog1}, from
 @file{eval.c}.  (An ordinary function would have the same general
 appearance.)
 
@@ -5404,7 +5439,7 @@
 @item max_args
 This is the maximum number of arguments that the function accepts, if
 there is a fixed maximum.  Alternatively, it can be @code{UNEVALLED},
-indicating a special form that receives unevaluated arguments, or
+indicating a special operator that receives unevaluated arguments, or
 @code{MANY}, indicating an unlimited number of evaluated arguments (the
 C equivalent of @code{&rest}).  Both @code{UNEVALLED} and @code{MANY}
 are macros.  If @var{max_args} is a number, it may not be less than
@@ -5457,7 +5492,7 @@
 or errors.
 
 A Lisp function with @w{@var{max_args} = @code{UNEVALLED}} is a
-@w{@dfn{special form}}; its arguments are not evaluated.  Instead it
+@w{@dfn{special operator}}; its arguments are not evaluated.  Instead it
 receives one argument of type @code{Lisp_Object}, a (Lisp) list of the
 unevaluated arguments, conventionally named @code{(args)}.
 
@@ -8954,7 +8989,7 @@
 @menu
 * Evaluation::                  
 * Dynamic Binding; The specbinding Stack; Unwind-Protects::  
-* Simple Special Forms::        
+* Simple Special Operators::    
 * Catch and Throw::             
 * Error Trapping::              
 @end menu
@@ -9090,7 +9125,7 @@
 an array).  @code{apply1()} uses @code{Fapply()} while the others use
 @code{Ffuncall()} to do the real work.
 
-@node Dynamic Binding; The specbinding Stack; Unwind-Protects, Simple Special Forms, Evaluation, Evaluation; Stack Frames; Bindings
+@node Dynamic Binding; The specbinding Stack; Unwind-Protects, Simple Special Operators, Evaluation, Evaluation; Stack Frames; Bindings
 @section Dynamic Binding; The specbinding Stack; Unwind-Protects
 @cindex dynamic binding; the specbinding stack; unwind-protects
 @cindex binding; the specbinding stack; unwind-protects, dynamic
@@ -9148,9 +9183,10 @@
 the symbol's value).
 @end enumerate
 
-@node Simple Special Forms, Catch and Throw, Dynamic Binding; The specbinding Stack; Unwind-Protects, Evaluation; Stack Frames; Bindings
-@section Simple Special Forms
-@cindex special forms, simple
+@node Simple Special Operators, Catch and Throw, Dynamic Binding; The specbinding Stack; Unwind-Protects, Evaluation; Stack Frames; Bindings
+@section Simple Special Operators
+@cindex special operators, simple
+@cindex special forms
 
 @code{or}, @code{and}, @code{if}, @code{cond}, @code{progn},
 @code{prog1}, @code{prog2}, @code{setq}, @code{quote}, @code{function},
@@ -9166,7 +9202,7 @@
 compiler knows how to convert calls to these functions directly into
 byte code.
 
-@node Catch and Throw, Error Trapping, Simple Special Forms, Evaluation; Stack Frames; Bindings
+@node Catch and Throw, Error Trapping, Simple Special Operators, Evaluation; Stack Frames; Bindings
 @section Catch and Throw
 @cindex catch and throw
 @cindex throw, catch and
@@ -17140,7 +17176,7 @@
 
 
 
-@node Consoles; Devices; Frames; Windows, The Redisplay Mechanism, Multilingual Support, Top
+@node Consoles; Devices; Frames; Windows, Window-System Support, Multilingual Support, Top
 @chapter Consoles; Devices; Frames; Windows
 @cindex consoles; devices; frames; windows
 @cindex devices; frames; windows, consoles;
@@ -17152,7 +17188,6 @@
 * Point::                       
 * Window Hierarchy::            
 * The Window Object::           
-* Creating a New Console/Device/Frame Type::  
 * Modules for the Basic Displayable Lisp Objects::  
 @end menu
 
@@ -17322,7 +17357,7 @@
 artifact that should be fixed.)
 @end enumerate
 
-@node The Window Object, Creating a New Console/Device/Frame Type, Window Hierarchy, Consoles; Devices; Frames; Windows
+@node The Window Object, Modules for the Basic Displayable Lisp Objects, Window Hierarchy, Consoles; Devices; Frames; Windows
 @section The Window Object
 @cindex window object, the
 @cindex object, the window
@@ -17430,143 +17465,7 @@
 @end table
 
 
-@node Creating a New Console/Device/Frame Type, Modules for the Basic Displayable Lisp Objects, The Window Object, Consoles; Devices; Frames; Windows
-@section Creating a New Console, Device, or Frame Type
-@cindex creating a new console type
-@cindex console type, creating a new
-@cindex creating a new device type
-@cindex device type, creating a new
-@cindex creating a new frame type
-@cindex frame type, creating a new
-
-Unfortunately, at the present time, only the console abstraction is at
-all well-maintained.  Device and frame internals are referred to from
-many places in the redisplay and console code.  The best that can be
-done therefore is to create a whole new console type, even though much
-code will be shared.  (Ben Wing has complained about the code
-duplication in the GTK+ v1 console, and probably would not be happy with
-the unpublished Qt console or Andrew Choi's Carbon console, but it's
-hard to see how those consoles could have been done better without
-fixing the abstractions in the X (actually Xt), MS Windows, and tty
-consoles as well as doing a complete refactoring of the console, device,
-and frame code.)
-
-What is desireable is sharing console, device, and frame methods across
-platforms in a more general way, reducing the amount of duplicated code
-by pulling it back into the redisplay engine proper or the Lisp modules
-as appropriate.  For example, we should be able to use
-@samp{make-frame-on-device} to share a single X connection among GTK, X,
-and Xft frames.  Xft is partially implemented, but GTK would be much
-harder (impossible?) because it has its own event loop.  (Xft shares the
-Xt event loop with the X console.)
-
-The way all methods get added to the console type is uncool.  A console
-should be a composite, which indicates a collection of I/O resources
-``used together.''  It should indicate where operations that change
-``focus'' search for targets, @emph{i.e.}, by default new frames are
-created on the selected device of the console where the input that
-invoked the command was received, @samp{pop-to-buffer-other-window} only
-considers existing windows on the same device of the same console,
-@emph{etc.}  But it should be possible to assemble consoles out of
-component input channels, imaging devices, and multimedia (audio)
-channels.
-
-The following notes may provide some guidance to those who wish to
-create new console types (@emph{i.e.}, port the redisplay code to a new
-platform).  They are based on an unsuccessful attempt to refactor the
-Xft code into a new console type while sharing most routines with the X
-console.  (For clarification or suggestions, feel free to write
-@email{stephen@@xemacs.org,Stephen Turnbull}.)
-
-The first thing to realize is that the naming of many modules obscures
-their relationship to the console abstraction.  For example, the
-@file{objects-@var{console-type}}, @file{redisplay-@var{console-type}},
-and @file{glyphs-@var{console-type}} series of modules have nothing to
-do with Lisp objects and little to do with redisplay, respectively.
-Rather they implement abstractions used for rendering on each console
-type, such as fonts and colors (@file{objects}) and string and graphics
-drawing primitives (@file{redisplay}).  These modules are conceptually
-part of the console implementations, not part of redisplay or Lisp.
-
-Public methods of a console are implemented as C functions declared
-@code{static}, following a rigid naming convention:
-@samp{@var{console-type}_@var{method-name}}.  Methods are bound to the
-console type in the @samp{console_type_create_@var{file}} functions for
-each console component (console, device, and frame) using the
-@samp{CONSOLE_HAS_METHOD} family of macros.  Methods for displaying
-images are bound using the @samp{IIFORMAT_HAS_DEVMETHOD} family of
-macros.  Methods are invoked using the @samp{CONMETH}, @samp{DEVMETH},
-and @samp{FRAMEMETH} families of macros, which look up the relevant
-methods in the object's table of methods.
-
-@strong{N.B.} All of the object tables are actually references to
-console method tables.  To create a variant of an existing console,
-there is a @samp{CONSOLE_INHERITS_METHOD} constructor, but this actually
-constructs the name of the parent's method pointer and stores in the
-derived console type's method table.  Of course this is time-efficient,
-and since there are few console types it is a neglible waste of space.
-However in practice this may have contributed to breaking the various
-abstractions, and the variant console must be coded in the same file as
-the parent (because the methods are static).  Another minor symptom of
-the incompleteness of the abstraction is the fact that the API for
-inheritance of device methods for image formats is named
-@samp{IIFORMAT_HAS_SHARED_METHOD}, although the semantics are identical.
-
-One problem encountered in attempting to create an Xft console type as a
-derivative of the X console type was that there is no support for such
-union types in the consistency-checking code, whether for the
-fundamental Lisp consistency checks (the @samp{CHECK_SOMETHING} family
-of macros) or for the error-checking variants of many functions.  These
-APIs all simply check for the apparent console type, which is a single
-symbol (or enumerator).
-
-To create a new console with mostly new methods, it's probably best to
-copy all of the @file{@var{function}-@var{console-type}} files from a
-similar console (or several, if the new console type seems like a
-combination of several existing console types), renaming the files by
-substituting @var{new-console-type} for @var{console-type}.  Then
-proceed in the obvious way by renaming methods from
-@samp{@var{console-type}_@var{method-name}} to
-@samp{@var{new-console-type}_@var{method-name}}, and implementing them.
-
-Once you've done that, then the fun starts.  Insert the initialization
-functions (@samp{syms_of_@var{file}}, @samp{vars_of_@var{file}},
-@samp{console_type_create_@var{file}}, @emph{etc.}) in @samp{main_1} in
-@file{emacs.c}.
-
-Add a device creation function @samp{make-@var{console-type}-device} in
-@file{device.el}.  Add the device type to the calls to
-@samp{Face-frob-property} in @file{faces.el}, as well as calls to the
-device initializer functions for devices and frames, and ``additional
-frobbing'' in that file.
-
-You may wish to add an option to force the initial frame to that device
-type to @file{emacs.c}.  Don't forget to document it in the command help
-function in @file{startup.el}.
-
-You may need to add support for your console type in
-@samp{init_event_stream} in @file{event-stream.c}.
-
-If your console has a different UI for fonts or colors, or adds new
-capability, you may need to add a @file{@var{console-type}-faces.el}
-file, or add code to the @file{@var{parent-type}-faces.el} file, to
-support new font or color capability.  Probably initialization code in
-@file{faces.c} will be needed too.
-
-A check for the console type is probably needed in @samp{init_redisplay}
-in @file{redisplay.c}.
-
-Ditto for the @file{@var{console-type}-init.el} file.
-
-Don't forget that Emacs windows are console-dependent, too.  At least a
-@samp{WINDOW_@var{console-type}_P}-checking macro should be added in
-@file{window-impl.h}.
-
-Note that this project failed; there are probably many other details to
-be implemented that I didn't get to.  But don't let that stop you!
-
-
-@node Modules for the Basic Displayable Lisp Objects,  , Creating a New Console/Device/Frame Type, Consoles; Devices; Frames; Windows
+@node Modules for the Basic Displayable Lisp Objects,  , The Window Object, Consoles; Devices; Frames; Windows
 @section Modules for the Basic Displayable Lisp Objects
 @cindex modules for the basic displayable Lisp objects
 @cindex displayable Lisp objects, modules for the basic
@@ -17717,7 +17616,190 @@
 types such as scrollbars.
 
 
-@node The Redisplay Mechanism, Extents, Consoles; Devices; Frames; Windows, Top
+@node Window-System Support, The Redisplay Mechanism, Consoles; Devices; Frames; Windows, Top
+@chapter Window-System Support
+@cindex window-system support
+@cindex window systems
+@cindex X
+@cindex X Windows
+@cindex Windows
+@cindex Microsoft Windows
+@cindex MS-Windows
+@cindex GTK
+@cindex Gnome
+
+XEmacs defines the concept of a ``device type'', which approximately
+corresponds to a window-system type, and separates out display-related
+code into device-independent and device-dependent sections.
+Generally, the device-independent code will go into a generally-named
+file such as @file{redisplay.c}, while the device-dependent code goes
+into @file{redisplay-x.c}, @file{redisplay-gtk.c},
+@file{redisplay-msw.c}, etc.  Device-dependent methods are called
+using the @code{DEVMETH} macro.
+
+The following device types are defined:
+
+@table @asis
+@item X-Windows (@code{x})
+This supports rendering through @code{Xlib}, widget support through
+@code{Xt}, and event-handling through @code{Xt}.
+@item Microsoft Windows (@code{msw})
+@item GTK/Gnome (@code{gtk})
+@item TTY's (@code{tty})
+This is used for TTY connections (e.g. running inside of an @code{xterm} or
+Windows console window).
+@item Stream devices (@code{stream})
+This is used for ``stream'' devices, of which there is only one -- the
+initial stdio device used when XEmacs is running noninteractively.
+@end table
+
+In addition, there is a pseudo-device-type `xlike', which is used for
+abstracting X and GTK code that is very similar.
+
+@menu
+* Creating a Window-System Type::  
+@end menu
+
+@node Creating a Window-System Type,  , Window-System Support, Window-System Support
+@section Creating a Window-System Type
+@cindex creating a new window-system type
+@cindex window-system types, creating
+@cindex creating a new console type
+@cindex console types, creating
+@cindex creating a new device type
+@cindex device types, creating
+@cindex creating a new frame type
+@cindex frame types, creating
+
+Unfortunately, at the present time, only the console abstraction is
+really well-maintained.  Device and frame internals are referred to
+from many places in the redisplay and console code.  The best that can
+be done therefore is to create a whole new console type, even though
+much code will be shared.  (Ben Wing has complained about the code
+duplication in the GTK+ v1 console, and probably would not be happy
+with the unpublished Qt console or Andrew Choi's Carbon console, but
+it's hard to see how those consoles could have been done better
+without fixing the abstractions in the X (actually Xt), MS Windows,
+and tty consoles as well as doing a complete refactoring of the
+console, device, and frame code.)
+
+What is desireable is sharing console, device, and frame methods across
+platforms in a more general way, reducing the amount of duplicated code
+by pulling it back into the redisplay engine proper or the Lisp modules
+as appropriate.  For example, we should be able to use
+@samp{make-frame-on-device} to share a single X connection among GTK, X,
+and Xft frames.  Xft is partially implemented, but GTK would be much
+harder (impossible?) because it has its own event loop.  (Xft shares the
+Xt event loop with the X console.)
+
+The way all methods get added to the console type is uncool.  A console
+should be a composite, which indicates a collection of I/O resources
+``used together.''  It should indicate where operations that change
+``focus'' search for targets, @emph{i.e.}, by default new frames are
+created on the selected device of the console where the input that
+invoked the command was received, @samp{pop-to-buffer-other-window} only
+considers existing windows on the same device of the same console,
+@emph{etc.}  But it should be possible to assemble consoles out of
+component input channels, imaging devices, and multimedia (audio)
+channels.
+
+The following notes may provide some guidance to those who wish to
+create new console types (@emph{i.e.}, port the redisplay code to a new
+platform).  They are based on an unsuccessful attempt to refactor the
+Xft code into a new console type while sharing most routines with the X
+console.  (For clarification or suggestions, feel free to write
+@email{stephen@@xemacs.org,Stephen Turnbull}.)
+
+The first thing to realize is that the naming of many modules obscures
+their relationship to the console abstraction.  For example, the
+@file{objects-@var{console-type}}, @file{redisplay-@var{console-type}},
+and @file{glyphs-@var{console-type}} series of modules have nothing to
+do with Lisp objects and little to do with redisplay, respectively.
+Rather they implement abstractions used for rendering on each console
+type, such as fonts and colors (@file{objects}) and string and graphics
+drawing primitives (@file{redisplay}).  These modules are conceptually
+part of the console implementations, not part of redisplay or Lisp.
+
+Public methods of a console are implemented as C functions declared
+@code{static}, following a rigid naming convention:
+@samp{@var{console-type}_@var{method-name}}.  Methods are bound to the
+console type in the @samp{console_type_create_@var{file}} functions for
+each console component (console, device, and frame) using the
+@samp{CONSOLE_HAS_METHOD} family of macros.  Methods for displaying
+images are bound using the @samp{IIFORMAT_HAS_DEVMETHOD} family of
+macros.  Methods are invoked using the @samp{CONMETH}, @samp{DEVMETH},
+and @samp{FRAMEMETH} families of macros, which look up the relevant
+methods in the object's table of methods.
+
+@strong{N.B.} All of the object tables are actually references to
+console method tables.  To create a variant of an existing console,
+there is a @samp{CONSOLE_INHERITS_METHOD} constructor, but this actually
+constructs the name of the parent's method pointer and stores in the
+derived console type's method table.  Of course this is time-efficient,
+and since there are few console types it is a neglible waste of space.
+However in practice this may have contributed to breaking the various
+abstractions, and the variant console must be coded in the same file as
+the parent (because the methods are static).  Another minor symptom of
+the incompleteness of the abstraction is the fact that the API for
+inheritance of device methods for image formats is named
+@samp{IIFORMAT_HAS_SHARED_METHOD}, although the semantics are identical.
+
+One problem encountered in attempting to create an Xft console type as a
+derivative of the X console type was that there is no support for such
+union types in the consistency-checking code, whether for the
+fundamental Lisp consistency checks (the @samp{CHECK_SOMETHING} family
+of macros) or for the error-checking variants of many functions.  These
+APIs all simply check for the apparent console type, which is a single
+symbol (or enumerator).
+
+To create a new console with mostly new methods, it's probably best to
+copy all of the @file{@var{function}-@var{console-type}} files from a
+similar console (or several, if the new console type seems like a
+combination of several existing console types), renaming the files by
+substituting @var{new-console-type} for @var{console-type}.  Then
+proceed in the obvious way by renaming methods from
+@samp{@var{console-type}_@var{method-name}} to
+@samp{@var{new-console-type}_@var{method-name}}, and implementing them.
+
+Once you've done that, then the fun starts.  Insert the initialization
+functions (@samp{syms_of_@var{file}}, @samp{vars_of_@var{file}},
+@samp{console_type_create_@var{file}}, @emph{etc.}) in @samp{main_1} in
+@file{emacs.c}.
+
+Add a device creation function @samp{make-@var{console-type}-device} in
+@file{device.el}.  Add the device type to the calls to
+@samp{Face-frob-property} in @file{faces.el}, as well as calls to the
+device initializer functions for devices and frames, and ``additional
+frobbing'' in that file.
+
+You may wish to add an option to force the initial frame to that device
+type to @file{emacs.c}.  Don't forget to document it in the command help
+function in @file{startup.el}.
+
+You may need to add support for your console type in
+@samp{init_event_stream} in @file{event-stream.c}.
+
+If your console has a different UI for fonts or colors, or adds new
+capability, you may need to add a @file{@var{console-type}-faces.el}
+file, or add code to the @file{@var{parent-type}-faces.el} file, to
+support new font or color capability.  Probably initialization code in
+@file{faces.c} will be needed too.
+
+A check for the console type is probably needed in @samp{init_redisplay}
+in @file{redisplay.c}.
+
+Ditto for the @file{@var{console-type}-init.el} file.
+
+Don't forget that Emacs windows are console-dependent, too.  At least a
+@samp{WINDOW_@var{console-type}_P}-checking macro should be added in
+@file{window-impl.h}.
+
+Note that this project failed; there are probably many other details to
+be implemented that I didn't get to.  But don't let that stop you!
+
+
+
+@node The Redisplay Mechanism, Extents, Window-System Support, Top
 @chapter The Redisplay Mechanism
 @cindex redisplay mechanism, the
 
@@ -28401,8 +28483,8 @@
 @cindex garbage collection, discussion
 
 @menu
-* Discussion -- KKCC::
-* Discussion -- Incremental Collector::
+* Discussion -- KKCC::          
+* Discussion -- Incremental Collector::  
 * Discussion -- Pure Space::    
 * Discussion -- Hashtable-Based Marking and Cleanup::  
 * Discussion -- The Anti-Cons::  
--- a/man/lispref/commands.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/commands.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -102,8 +102,8 @@
 @cindex interactive function
 
   A Lisp function becomes a command when its body contains, at top
-level, a form that calls the special form @code{interactive}.  This
-form does nothing when actually executed, but its presence serves as a
+level, a form that calls the special operator @code{interactive}.  This
+operator does nothing when actually executed, but its presence serves as a
 flag to indicate that interactive calling is permitted.  Its argument
 controls the reading of arguments for an interactive call.
 
@@ -122,7 +122,7 @@
 
 @defspec interactive arg-descriptor
 @cindex argument descriptors
-This special form declares that the function in which it appears is a
+This special operator declares that the function in which it appears is a
 command, and that it may therefore be called interactively (via
 @kbd{M-x} or by entering a key sequence bound to it).  The argument
 @var{arg-descriptor} declares how to compute the arguments to the
--- a/man/lispref/control.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/control.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -5,14 +5,14 @@
 @setfilename ../../info/control.info
 @node Control Structures, Variables, Evaluation, Top
 @chapter Control Structures
-@cindex special forms for control structures
+@cindex special operators for control structures
 @cindex control structures
 
   A Lisp program consists of expressions or @dfn{forms} (@pxref{Forms}).
 We control the order of execution of the forms by enclosing them in
-@dfn{control structures}.  Control structures are special forms which
-control when, whether, or how many times to execute the forms they
-contain.
+@dfn{control structures}.  Control structures are special operators which
+control when, whether, or how many times to execute the subforms of
+their containing forms.
 
   The simplest order of execution is sequential execution: first form
 @var{a}, then form @var{b}, and so on.  This is what happens when you
@@ -29,9 +29,9 @@
   XEmacs Lisp provides several kinds of control structure, including
 other varieties of sequencing, conditionals, iteration, and (controlled)
 jumps---all discussed below.  The built-in control structures are
-special forms since their subforms are not necessarily evaluated or not
-evaluated sequentially.  You can use macros to define your own control
-structure constructs (@pxref{Macros}).
+special operators since their enclosing forms' subforms are not
+necessarily evaluated or not evaluated sequentially.  You can use macros
+to define your own control structure constructs (@pxref{Macros}).
 
 @menu
 * Sequencing::             Evaluation in textual order.
@@ -77,7 +77,7 @@
 @code{or}, or in the @var{then}-part of an @code{if}.
 
 @defspec progn forms@dots{}
-This special form evaluates all of the @var{forms}, in textual
+This special operator evaluates all of the @var{forms}, in textual
 order, returning the result of the final form.
 
 @example
@@ -97,7 +97,7 @@
 a different value:
 
 @defspec prog1 form1 forms@dots{}
-This special form evaluates @var{form1} and all of the @var{forms}, in
+This special operator evaluates @var{form1} and all of the @var{forms}, in
 textual order, returning the result of @var{form1}.
 
 @example
@@ -121,7 +121,7 @@
 @end defspec
 
 @defspec prog2 form1 form2 forms@dots{}
-This special form evaluates @var{form1}, @var{form2}, and all of the
+This special operator evaluates @var{form1}, @var{form2}, and all of the
 following @var{forms}, in textual order, returning the result of
 @var{form2}.
 
@@ -157,7 +157,7 @@
 If @var{condition} has the value @code{nil}, and no @var{else-forms} are
 given, @code{if} returns @code{nil}.
 
-@code{if} is a special form because the branch that is not selected is
+@code{if} is a special operator because the branch that is not selected is
 never evaluated---it is ignored.  Thus, in the example below,
 @code{true} is not printed because @code{print} is never called.
 
@@ -269,7 +269,7 @@
 @end defun
 
 @defspec and conditions@dots{}
-The @code{and} special form tests whether all the @var{conditions} are
+The @code{and} special operator tests whether all the @var{conditions} are
 true.  It works by evaluating the @var{conditions} one by one in the
 order written.
 
@@ -323,7 +323,7 @@
 @end defspec
 
 @defspec or conditions@dots{}
-The @code{or} special form tests whether at least one of the
+The @code{or} special operator tests whether at least one of the
 @var{conditions} is true.  It works by evaluating all the
 @var{conditions} one by one in the order written.
 
@@ -379,7 +379,7 @@
   Iteration means executing part of a program repetitively.  For
 example, you might want to repeat some computation once for each element
 of a list, or once for each integer from 0 to @var{n}.  You can do this
-in XEmacs Lisp with the special form @code{while}:
+in XEmacs Lisp with the special operator @code{while}:
 
 @defspec while condition forms@dots{}
 @code{while} first evaluates @var{condition}.  If the result is
@@ -488,7 +488,7 @@
 the narrowing status saved by @code{save-restriction} and the window
 selection saved by @code{save-window-excursion} (@pxref{Window
 Configurations}).  It also runs any cleanups established with the
-@code{unwind-protect} special form when it exits that form
+@code{unwind-protect} special operator when it exits that form
 (@pxref{Cleanups}).
 
   The @code{throw} need not appear lexically within the @code{catch}
@@ -957,7 +957,7 @@
   The usual effect of signaling an error is to terminate the command
 that is running and return immediately to the XEmacs editor command loop.
 You can arrange to trap errors occurring in a part of your program by
-establishing an error handler, with the special form
+establishing an error handler, with the special operator
 @code{condition-case}.  A simple example looks like this:
 
 @example
@@ -1029,7 +1029,7 @@
 @code{catch} signals an error that can be handled).
 
 @defspec condition-case var protected-form handlers@dots{}
-This special form establishes the error handlers @var{handlers} around
+This special operator establishes the error handlers @var{handlers} around
 the execution of @var{protected-form}.  If @var{protected-form} executes
 without error, the value it returns becomes the value of the
 @code{condition-case} form; in this case, the @code{condition-case} has
--- a/man/lispref/debugging.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/debugging.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -529,7 +529,7 @@
 @samp{backtrace-output}.  Each line of the backtrace represents one
 function call.  The line shows the values of the function's arguments if
 they are all known.  If they are still being computed, the line says so.
-The arguments of special forms are elided.
+The arguments of special operators are elided.
 
 @smallexample
 @group
--- a/man/lispref/edebug-inc.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/edebug-inc.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -203,13 +203,13 @@
 instrumenting it.  Also see the command @kbd{i} (@ref{Jumping}) which
 steps into the callee.
 
-@cindex special forms (Edebug)
+@cindex special operators (Edebug)
 @cindex interactive commands (Edebug)
 @cindex anonymous lambda expressions (Edebug)
 @cindex Common Lisp (Edebug)
 @pindex cl.el (Edebug)
 @pindex cl-specs.el
-  Edebug knows how to instrument all the standard special forms, an
+  Edebug knows how to instrument all the standard special operators, an
 interactive form with an expression argument, anonymous lambda
 expressions, and other defining forms.  (Specifications for macros
 defined by @file{cl.el} (version 2.03) are provided in
@@ -1497,7 +1497,7 @@
 Here we provide several examples of Edebug specifications to show
 many of its capabilities.
 
-A @code{let} special form has a sequence of bindings and a body.  Each
+A @code{let} special operator has a sequence of bindings and a body.  Each
 of the bindings is either a symbol or a sublist with a symbol and
 optional value.  In the specification below, notice the @code{gate}
 inside of the sublist to prevent backtracking.
--- a/man/lispref/eval.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/eval.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -252,8 +252,9 @@
 			      we find the real function via the symbol.
 * Function Forms::          Forms that call functions.
 * Macro Forms::             Forms that call macros.
-* Special Forms::           ``Special forms'' are idiosyncratic primitives,
+* Special Operators::       ``Special operators'' are idiosyncratic primitives,
                               most of them extremely important.
+                              Also known as special forms.
 * Autoloading::             Functions set up to load files
                               containing their real definitions.
 @end menu
@@ -354,7 +355,7 @@
 call, or a special form, according to its first element.  These three
 kinds of forms are evaluated in different ways, described below.  The
 remaining list elements constitute the @dfn{arguments} for the function,
-macro, or special form.
+macro, or special operator.
 
   The first step in evaluating a nonempty list is to examine its first
 element.  This element alone determines what kind of form the list is
@@ -387,7 +388,7 @@
 @cindex invalid function
   More precisely, we should now have a Lisp function (a lambda
 expression), a byte-code function, a primitive function, a Lisp macro, a
-special form, or an autoload object.  Each of these types is a case
+special operator, or an autoload object.  Each of these types is a case
 described in one of the following sections.  If the object is not one of
 these types, the error @code{invalid-function} is signaled.
 
@@ -531,20 +532,22 @@
 
 @xref{Macros}, for a complete description of XEmacs Lisp macros.
 
-@node Special Forms
-@subsection Special Forms
-@cindex special form evaluation
+@node Special Operators
+@subsection Special Operators
+@cindex special operator evaluation
+@cindex special form
 
-  A @dfn{special form} is a primitive function specially marked so that
-its arguments are not all evaluated.  Most special forms define control
+  A @dfn{special operator} (historically, and less logically, a
+@dfn{special form}) is a primitive function specially marked so that
+its arguments are not all evaluated.  Most special operators define control
 structures or perform variable bindings---things which functions cannot
 do.
 
-  Each special form has its own rules for which arguments are evaluated
+  Each special operator has its own rules for which arguments are evaluated
 and which are used without evaluation.  Whether a particular argument is
 evaluated may depend on the results of evaluating other arguments.
 
-  Here is a list, in alphabetical order, of all of the special forms in
+  Here is a list, in alphabetical order, of all of the special operators in
 XEmacs Lisp with a reference to where each is described.
 
 @table @code
@@ -627,17 +630,16 @@
 @pxref{Temporary Displays}
 @end table
 
-@cindex CL note---special forms compared
+@cindex CL note---special operators compared
 @quotation
-@b{Common Lisp note:} here are some comparisons of special forms in
+@b{Common Lisp note:} here are some comparisons of special operators in
 XEmacs Lisp and Common Lisp.  @code{setq}, @code{if}, and
-@code{catch} are special forms in both XEmacs Lisp and Common Lisp.
-@code{defun} is a special form in XEmacs Lisp, but a macro in Common
-Lisp.  @code{save-excursion} is a special form in XEmacs Lisp, but
-doesn't exist in Common Lisp.  @code{throw} is a special form in
-Common Lisp (because it must be able to throw multiple values), but it
-is a function in XEmacs Lisp (which doesn't have multiple
-values).@refill
+@code{catch} are special operators in both XEmacs Lisp and Common Lisp.
+@code{defun} is a special operator in XEmacs Lisp, but a macro in Common
+Lisp.  @code{save-excursion} is a special operator in XEmacs Lisp, but
+doesn't exist in Common Lisp.  @code{throw} is a special operator in
+both Common Lisp and XEmacs Lisp (because it must be able to throw
+multiple values).@refill
 @end quotation
 
 @node Autoloading
@@ -654,14 +656,14 @@
 @section Quoting
 @cindex quoting
 
-  The special form @code{quote} returns its single argument, as written,
+  The special operator @code{quote} returns its single argument, as written,
 without evaluating it.  This provides a way to include constant symbols
 and lists, which are not self-evaluating objects, in a program.  (It is
 not necessary to quote self-evaluating objects such as numbers, strings,
 and vectors.)
 
 @defspec quote object
-This special form returns @var{object}, without evaluating it.
+This special operator returns @var{object}, without evaluating it.
 @end defspec
 
 @cindex @samp{'} for quoting
--- a/man/lispref/frames.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/frames.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -786,13 +786,13 @@
 @end defun
 
 @defspec save-selected-frame forms@dots{}
-This special form records the selected frame, executes @var{forms} in
+This special operator records the selected frame, executes @var{forms} in
 sequence, then restores the earlier selected frame.  The value returned
 is the value of the last form.
 @end defspec
 
 @defspec with-selected-frame frame forms@dots{}
-This special form records the selected frame, then selects @var{frame}
+This special operator records the selected frame, then selects @var{frame}
 and executes @var{forms} in sequence.  After the last form is finished,
 the earlier selected frame is restored.  The value returned is the value
 of the last form.
--- a/man/lispref/functions.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/functions.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -42,7 +42,7 @@
 @cindex function
 In XEmacs Lisp, a @dfn{function} is anything that can be applied to
 arguments in a Lisp program.  In some cases, we use it more
-specifically to mean a function written in Lisp.  Special forms and
+specifically to mean a function written in Lisp.  Special operators and
 macros are not functions.
 
 @item command
@@ -84,7 +84,7 @@
 @cindex built-in function
 A @dfn{primitive} is a function callable from Lisp that is written in C,
 such as @code{car} or @code{append}.  These functions are also called
-@dfn{built-in} functions or @dfn{subrs}.  (Special forms are also
+@dfn{built-in} functions or @dfn{subrs}.  (Special operators are also
 considered primitives.)
 
 Usually the reason that a function is a primitives is because it is
@@ -101,11 +101,11 @@
 @xref{Lambda Expressions}.
 @end ifinfo
 
-@item special form
-A @dfn{special form} is a primitive that is like a function but does not
+@item special operator
+A @dfn{special operator} is a primitive that is like a function but does not
 evaluate all of its arguments in the usual way.  It may evaluate only
 some of the arguments, or may evaluate them in an unusual order, or
-several times.  Many special forms are described in @ref{Control
+several times.  Many special operators are described in @ref{Control
 Structures}.
 
 @item macro
@@ -114,7 +114,7 @@
 differs from a function in that it translates a Lisp expression that you
 write into an equivalent expression to be evaluated instead of the
 original expression.  Macros enable Lisp programmers to do the sorts of
-things that special forms can do.  @xref{Macros}, for how to define and
+things that special operators can do.  @xref{Macros}, for how to define and
 use macros.
 
 @item compiled function
@@ -267,14 +267,14 @@
 
   It is not often useful to write a lambda expression as the @sc{car} of
 a form in this way.  You can get the same result, of making local
-variables and giving them values, using the special form @code{let}
+variables and giving them values, using the special operator @code{let}
 (@pxref{Local Variables}).  And @code{let} is clearer and easier to use.
 In practice, lambda expressions are either stored as the function
 definitions of symbols, to produce named functions, or passed as
 arguments to other functions (@pxref{Anonymous Functions}).
 
   However, calls to explicit lambda expressions were very useful in the
-old days of Lisp, before the special form @code{let} was invented.  At
+old days of Lisp, before the special operator @code{let} was invented.  At
 that time, they were the only way to bind and initialize local
 variables.
 
@@ -472,7 +472,7 @@
 
   We usually give a name to a function when it is first created.  This
 is called @dfn{defining a function}, and it is done with the
-@code{defun} special form.
+@code{defun} special operator.
 
 @defspec defun name argument-list body-forms
 @code{defun} is the usual way to define new Lisp functions.  It
@@ -547,7 +547,7 @@
 
 @defun define-function name definition
 @defunx defalias name definition
-These equivalent special forms define the symbol @var{name} as a
+These equivalent primitives define the symbol @var{name} as a
 function, with definition @var{definition} (which can be any valid Lisp
 function).
 
@@ -601,7 +601,7 @@
 place where the arguments have already been evaluated.
 
 The argument @var{function} must be either a Lisp function or a
-primitive function.  Special forms and macros are not allowed, because
+primitive function.  Special operators and macros are not allowed, because
 they make sense only when given the ``unevaluated'' argument
 expressions.  @code{funcall} cannot provide these because, as we saw
 above, it never knows them in the first place.
@@ -637,7 +637,7 @@
 
 @code{apply} returns the result of calling @var{function}.  As with
 @code{funcall}, @var{function} must either be a Lisp function or a
-primitive function; special forms and macros do not make sense in
+primitive function; special operators and macros do not make sense in
 @code{apply}.
 
 @example
@@ -830,12 +830,12 @@
 @end example
 
 @noindent
-In such cases, we usually use the special form @code{function} instead
+In such cases, we usually use the special operator @code{function} instead
 of simple quotation to quote the anonymous function.
 
 @defspec function function-object
 @cindex function quoting
-This special form returns @var{function-object} without evaluating it.
+This special operator returns @var{function-object} without evaluating it.
 In this, it is equivalent to @code{quote}.  However, it serves as a
 note to the XEmacs Lisp compiler that @var{function-object} is intended
 to be used only as a function, and therefore can safely be compiled.
--- a/man/lispref/help.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/help.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -555,8 +555,8 @@
 Otherwise it calls @code{message} to display it in the echo area.
 
 This function expects to be called inside a
-@code{with-output-to-temp-buffer} special form, and expects
-@code{standard-output} to have the value bound by that special form.
+@code{with-output-to-temp-buffer} form, and expects
+@code{standard-output} to have the value bound by that special operator.
 For an example of its use, see the long example in @ref{Accessing
 Documentation}.
 @end defun
--- a/man/lispref/intro.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/intro.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -720,7 +720,7 @@
 @cindex function descriptions
 @cindex command descriptions
 @cindex macro descriptions
-@cindex special form descriptions
+@cindex special operator descriptions
 
   In a function description, the name of the function being described
 appears first.  It is followed on the same line by a list of parameters.
@@ -773,13 +773,13 @@
   @xref{Lambda Expressions}, for a more complete description of optional
 and rest arguments.
 
-  Command, macro, and special form descriptions have the same format,
+  Command, macro, and special operator descriptions have the same format,
 but the word `Function' is replaced by `Command', `Macro', or `Special
 Form', respectively.  Commands are simply functions that may be called
 interactively; macros process their arguments differently from functions
 (the arguments are not evaluated), but are presented the same way.
 
-  Special form descriptions use a more complex notation to specify
+  Special operator descriptions use a more complex notation to specify
 optional and repeated parameters because they can break the argument
 list down into separate arguments in more complicated ways.
 @samp{@code{@r{[}@var{optional-arg}@r{]}}} means that @var{optional-arg} is
@@ -788,7 +788,7 @@
 additional levels of list structure.  Here is an example:
 
 @defspec count-loop (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{}
-This imaginary special form implements a loop that executes the
+This imaginary special operator implements a loop that executes the
 @var{body} forms and then increments the variable @var{var} on each
 iteration.  On the first iteration, the variable has the value
 @var{from}; on subsequent iterations, it is incremented by 1 (or by
@@ -812,7 +812,7 @@
     (setq done t)))
 @end example
 
-In this special form, the arguments @var{from} and @var{to} are
+With this special operator, the arguments @var{from} and @var{to} are
 optional, but must both be present or both absent.  If they are present,
 @var{inc} may optionally be specified as well.  These arguments are
 grouped with the argument @var{var} into a list, to distinguish them
--- a/man/lispref/lispref.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/lispref.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -408,7 +408,7 @@
 * Classifying Lists::       How to distinguish various sorts of list forms.
 * Function Forms::          Forms that call functions.
 * Macro Forms::             Forms that call macros.
-* Special Forms::           ``Special forms'' are idiosyncratic primitives,
+* Special Operators::       ``Special operators'' are idiosyncratic primitives,
                               most of them extremely important.
 * Autoloading::             Functions set up to load files
                               containing their real definitions.
--- a/man/lispref/macros.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/macros.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -178,10 +178,39 @@
 from the macro call.
 
   It is possible to use an anonymous Lisp macro just like an anonymous
-function, but this is never done, because it does not make sense to pass
-an anonymous macro to functionals such as @code{mapcar}.  In practice,
-all Lisp macros have names, and they are usually defined with the
-special form @code{defmacro}.
+function.  It doesn't make sense to pass an anonymous macro to
+functionals such as @code{mapcar}, and it is usually more readable to
+use @code{macrolet} to make a local macro definition, and call that.
+But if, for whatever reason, @code{macrolet} is not available, code
+like the following may be useful:
+
+@example
+((macro . (lambda (&rest arguments)
+	    (let (res)
+	      (while (consp arguments)
+		(setq res (cons (cons 'put
+				      (cons (list 'quote (car arguments))
+					    '((quote my-property) t)))
+				res)
+		      arguments (cdr arguments)))
+	      (cons 'progn res))))
+ + - = floor ceiling round)
+@end example
+
+This expands to: 
+
+@example
+(progn
+  (put 'round 'my-property t)
+  (put 'ceiling 'my-property t)
+  (put 'floor 'my-property t)
+  (put '= 'my-property t)
+  (put '- 'my-property t)
+  (put '+ 'my-property t))
+@end example
+
+In practice, almost all Lisp macros have names, and they are usually
+defined with the special operator @code{defmacro}.
 
 @defspec defmacro name argument-list body-forms@dots{}
 @code{defmacro} defines the symbol @var{name} as a macro that looks
@@ -214,7 +243,7 @@
 
   Backquote allows you to quote a list, but selectively evaluate
 elements of that list.  In the simplest case, it is identical to the
-special form @code{quote} (@pxref{Quoting}).  For example, these
+special operator @code{quote} (@pxref{Quoting}).  For example, these
 two forms yield identical results:
 
 @example
--- a/man/lispref/objects.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/objects.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -1217,15 +1217,15 @@
 
 @node Primitive Function Type
 @subsection Primitive Function Type
-@cindex special forms
+@cindex special operators
 
   A @dfn{primitive function} is a function callable from Lisp but
 written in the C programming language.  Primitive functions are also
 called @dfn{subrs} or @dfn{built-in functions}.  (The word ``subr'' is
 derived from ``subroutine''.)  Most primitive functions evaluate all
 their arguments when they are called.  A primitive function that does
-not evaluate all its arguments is called a @dfn{special form}
-(@pxref{Special Forms}).@refill
+not evaluate all its arguments is called a @dfn{special operator}
+(@pxref{Special Operators}).@refill
 
   It does not matter to the caller of a function whether the function is
 primitive.  However, this does matter if you try to substitute a
--- a/man/lispref/positions.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/positions.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -758,7 +758,7 @@
   It is often useful to move point ``temporarily'' within a localized
 portion of the program, or to switch buffers temporarily.  This is
 called an @dfn{excursion}, and it is done with the @code{save-excursion}
-special form.  This construct saves the current buffer and its values of
+special operator.  This construct saves the current buffer and its values of
 point and the mark so they can be restored after the completion of the
 excursion.
 
@@ -770,13 +770,13 @@
 @cindex mark excursion
 @cindex point excursion
 @cindex current buffer excursion
-The @code{save-excursion} special form saves the identity of the current
+The @code{save-excursion} special operator saves the identity of the current
 buffer and the values of point and the mark in it, evaluates
 @var{forms}, and finally restores the buffer and its saved values of
 point and the mark.  All three saved values are restored even in case of
 an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}).
 
-The @code{save-excursion} special form is the standard way to switch
+The @code{save-excursion} special operator is the standard way to switch
 buffers or move point within one part of a program and avoid affecting
 the rest of the program.  It is used more than 500 times in the Lisp
 sources of XEmacs.
@@ -813,24 +813,24 @@
 @end defspec
 
 @defspec save-current-buffer forms@dots{}
-This special form is similar to @code{save-excursion} but it only
+This special operator is similar to @code{save-excursion} but it only
 saves and restores the current buffer.  Beginning with XEmacs 20.3,
 @code{save-current-buffer} is a primitive.
 @end defspec
 
 @defspec with-current-buffer buffer forms@dots{}
-This special form evaluates @var{forms} with @var{buffer} as the current
+This macro evaluates @var{forms} with @var{buffer} as the current
 buffer.  It returns the value of the last form.
 @end defspec
 
 @defspec with-temp-file filename forms@dots{}
-This special form creates a new buffer, evaluates @var{forms} there, and
+This macro creates a new buffer, evaluates @var{forms} there, and
 writes the buffer to @var{filename}.  It returns the value of the last form
 evaluated.
 @end defspec
 
 @defspec save-selected-window forms@dots{}
-This special form is similar to @code{save-excursion} but it saves and
+This macro is similar to @code{save-excursion} but it saves and
 restores the selected window and nothing else.
 @end defspec
 
@@ -894,7 +894,7 @@
 @end deffn
 
 @defspec save-restriction body@dots{}
-This special form saves the current bounds of the accessible portion,
+This special operator saves the current bounds of the accessible portion,
 evaluates the @var{body} forms, and finally restores the saved bounds,
 thus restoring the same state of narrowing (or absence thereof) formerly
 in effect.  The state of narrowing is restored even in the event of an
@@ -922,7 +922,7 @@
 value were outside the limits of the temporary narrowing, this would
 fail to restore it accurately.
 
-The @code{save-restriction} special form records the values of the
+The @code{save-restriction} special operator records the values of the
 beginning and end of the accessible portion as distances from the
 beginning and end of the buffer.  In other words, it records the amount
 of inaccessible text before and after the accessible portion.
--- a/man/lispref/searching.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/searching.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -1459,23 +1459,10 @@
   You can save and restore the match data with @code{save-match-data}:
 
 @defspec save-match-data body@dots{}
-This special form executes @var{body}, saving and restoring the match
+This special operator executes @var{body}, saving and restoring the match
 data around it.
 @end defspec
 
-  You can use @code{set-match-data} together with @code{match-data} to
-imitate the effect of the special form @code{save-match-data}.  This is
-useful for writing code that can run in Emacs 18.  Here is how:
-
-@example
-@group
-(let ((data (match-data)))
-  (unwind-protect
-      @dots{}   ; @r{May change the original match data.}
-    (set-match-data data)))
-@end group
-@end example
-
   Emacs automatically saves and restores the match data when it runs
 process filter functions (@pxref{Filter Functions}) and process
 sentinels (@pxref{Sentinels}).
--- a/man/lispref/specifiers.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/specifiers.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -876,7 +876,7 @@
 @end defun
 
 @defspec let-specifier specifier-list &rest body
-This special form temporarily adds specifications to specifiers,
+This macro temporarily adds specifications to specifiers,
 evaluates forms in @var{body} and restores the specifiers to their
 previous states.  The specifiers and their temporary specifications are
 listed in @var{specifier-list}.
@@ -892,11 +892,10 @@
 @var{locale}.  @var{locale}, @var{tag-set} and @var{how-to-add} have the
 same meaning as in @code{add-spec-to-specifier}.
 
-This special form is implemented as a macro; the code resulting from
-macro expansion will add specifications to specifiers using
-@code{add-spec-to-specifier}.  After forms in @var{body} are evaluated,
-the temporary specifications are removed and old specifier spec-lists
-are restored.
+The code resulting from macro expansion will add specifications to
+specifiers using @code{add-spec-to-specifier}.  After forms in
+@var{body} are evaluated, the temporary specifications are removed and
+old specifier spec-lists are restored.
 
 @var{locale}, @var{tag-set} and @var{how-to-add} may be omitted, and
 default to @code{nil}.  The value of the last form in @var{body} is
--- a/man/lispref/symbols.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/symbols.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -132,7 +132,7 @@
 @section Defining Symbols
 @cindex definition of a symbol
 
-  A @dfn{definition} in Lisp is a special form that announces your
+  A @dfn{definition} in Lisp is a special operator that announces your
 intention to use a certain symbol in a particular way.  In XEmacs Lisp,
 you can define a symbol as a variable, or define it as a function (or
 macro), or both independently.
@@ -143,7 +143,7 @@
 supply an initial value for the variable, plus documentation for the
 variable.
 
-  @code{defvar} and @code{defconst} are special forms that define a
+  @code{defvar} and @code{defconst} are special operators that define a
 symbol as a global variable.  They are documented in detail in
 @ref{Defining Variables}.
 
--- a/man/lispref/variables.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/variables.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -128,7 +128,7 @@
 
   For example, when a function is called, its argument variables receive
 new local values that last until the function exits.  The @code{let}
-special form explicitly establishes new local values for specified
+special operator explicitly establishes new local values for specified
 variables; these last until exit from the @code{let} form.
 
 @cindex shadowing of variables
@@ -144,7 +144,7 @@
 speak of a @dfn{local binding} of the variable as well as a local value.
 
   The local binding is a conceptual place that holds a local value.
-Entry to a function, or a special form such as @code{let}, creates the
+Entry to a function, or a special operator such as @code{let}, creates the
 local binding; exit from the function or from the @code{let} removes the
 local binding.  As long as the local binding lasts, the variable's value
 is stored within it.  Use of @code{setq} or @code{set} while there is a
@@ -165,11 +165,11 @@
 Ordinary evaluation of a symbol always returns the value of its current
 binding.
 
-  The special forms @code{let} and @code{let*} exist to create
+  The special operators @code{let} and @code{let*} exist to create
 local bindings.
 
 @defspec let (bindings@dots{}) forms@dots{}
-This special form binds variables according to @var{bindings} and then
+This special operator binds variables according to @var{bindings} and then
 evaluates all of the @var{forms} in textual order.  The @code{let}-form
 returns the value of the last form in @var{forms}.
 
@@ -199,7 +199,7 @@
 @end defspec
 
 @defspec let* (bindings@dots{}) forms@dots{}
-This special form is like @code{let}, but it binds each variable right
+This special operator is like @code{let}, but it binds each variable right
 after computing its local value, before computing the local value for
 the next variable.  Therefore, an expression in @var{bindings} can
 reasonably refer to the preceding symbols bound in this @code{let*}
@@ -376,7 +376,7 @@
 @cindex variable definition
 
   You may announce your intention to use a symbol as a global variable
-with a @dfn{variable definition}: a special form, either @code{defconst}
+with a @dfn{variable definition}: a special operator, either @code{defconst}
 or @code{defvar}.
 
   In XEmacs Lisp, definitions serve three purposes.  First, they inform
@@ -404,7 +404,7 @@
 this reason, user options must be defined with @code{defvar}.
 
 @defspec defvar symbol [value [doc-string]]
-This special form defines @var{symbol} as a value and initializes it.
+This special operator defines @var{symbol} as a value and initializes it.
 The definition informs a person reading your code that @var{symbol} is
 used as a variable that programs are likely to set or change.  It is
 also used for all user option variables except in the preloaded parts of
@@ -475,7 +475,7 @@
 @end group
 @end example
 
-Here is an equivalent expression for the @code{defvar} special form:
+Here is an equivalent expression for the @code{defvar} special operator:
 
 @example
 @group
@@ -494,7 +494,7 @@
 @end defspec
 
 @defspec defconst symbol [value [doc-string]]
-This special form defines @var{symbol} as a value and initializes it.
+This special operator defines @var{symbol} as a value and initializes it.
 It informs a person reading your code that @var{symbol} has a global
 value, established here, that will not normally be changed or locally
 bound by the execution of the program.  The user, however, may be
@@ -553,7 +553,7 @@
   @strong{Warning:} If the @code{defconst} and @code{defvar} special
 forms are used while the variable has a local binding, they set the
 local binding's value; the global binding is not changed.  This is not
-what we really want.  To prevent it, use these special forms at top
+what we really want.  To prevent it, use these special operators at top
 level in a file, where normally no local binding is in effect, and make
 sure to load the file before making a local binding for the variable.
 
@@ -616,7 +616,7 @@
 run time, use the function @code{set}.
 
 @defspec setq [symbol form]@dots{}
-This special form is the most common method of changing a variable's
+This special operator is the most common method of changing a variable's
 value.  Each @var{symbol} is given a new value, which is the result of
 evaluating the corresponding @var{form}.  The most-local existing
 binding of the symbol is changed.
@@ -1232,7 +1232,7 @@
 this variable.
 
 @c Emacs 19 feature
-  The special forms @code{defvar} and @code{defconst} also set the
+  The special operators @code{defvar} and @code{defconst} also set the
 default value (if they set the variable at all), rather than any local
 value.
 
--- a/man/lispref/windows.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/lispref/windows.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -443,7 +443,7 @@
 @end defun
 
 @defspec save-selected-window forms@dots{}
-This special form records the selected window, executes @var{forms} in
+This macro records the selected window, executes @var{forms} in
 sequence, then restores the earlier selected window.  It does not save
 or restore anything about the sizes, arrangement or contents of windows;
 therefore, if the @var{forms} change them, the changes are permanent.
@@ -1955,7 +1955,7 @@
 @end defun
 
 @defspec save-window-excursion forms@dots{}
-This special form records the window configuration, executes @var{forms}
+This macro records the window configuration, executes @var{forms}
 in sequence, then restores the earlier window configuration.  The window
 configuration includes the value of point and the portion of the buffer
 that is visible.  It also includes the choice of selected window.
--- a/man/xemacs-faq.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/xemacs-faq.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -7781,12 +7781,10 @@
 
 @emph{Interpreted} code, on the other hand, must expand these macros
 every time they are executed.  For this reason it is strongly
-recommended that code making heavy use of macros be compiled.  (The
-features labelled @dfn{Special Form} instead of @dfn{Function} in this
-manual are macros.)  A loop using @code{incf} a hundred times will
-execute considerably faster if compiled, and will also garbage-collect
-less because the macro expansion will not have to be generated, used,
-and thrown away a hundred times.
+recommended that code making heavy use of macros be compiled. A loop
+using @code{incf} a hundred times will execute considerably faster if
+compiled, and will also garbage-collect less because the macro expansion
+will not have to be generated, used, and thrown away a hundred times.
 
 You can find out how a macro expands by using the @code{cl-prettyexpand}
 function.
@@ -8585,7 +8583,7 @@
 @strong{Frame focus changes}: @code{focus-follows-mouse} works like FSF,
 prevents any attempt to permanently change the selected frame; new
 function @code{focus-frame} sets the window system focus a frame; new
-special forms @code{save-selected-frame} and @code{with-selected-frame}.
+macros @code{save-selected-frame} and @code{with-selected-frame}.
 
 @item
 @strong{Window function changes}: @code{select-window} now has optional
--- a/man/xemacs/programs.texi	Sun Jan 31 18:29:48 2010 +0000
+++ b/man/xemacs/programs.texi	Wed Feb 03 20:18:53 2010 +0000
@@ -271,7 +271,7 @@
 
   In Emacs, a parenthetical grouping at the top level in the buffer is
 called a @dfn{defun}.  The name derives from the fact that most
-top-level lists in Lisp are instances of the special form
+top-level lists in Lisp are instances of the special operator
 @code{defun}, but Emacs calls any top-level parenthetical
 grouping counts a defun regardless of its contents or
 the programming language.  For example, in C, the body of a
--- a/nt/ChangeLog	Sun Jan 31 18:29:48 2010 +0000
+++ b/nt/ChangeLog	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,9 @@
+2010-02-03  Jerry James  <james@xemacs.org>
+
+	* xemacs.rc: Add license and copyright boilerplate text for Jonathan
+	Harris.
+	* xpm.mak: Ditto.
+
 2010-01-28  Jerry James  <james@xemacs.org>
 
 	* compface.mak: Add license and copyright boilerplate text based
--- a/nt/ad2c.sed	Sun Jan 31 18:29:48 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/^!/d
-/^$/d
-s/\\/\\\\/g
-s/\\$//g
-s/"/\\"/g
-s/^/(String) "/
-: test
-/\\$/b slash
-s/$/",/
-p
-d
-: slash
-n
-/^!/d
-/^$/d
-s/"/\\"/g
-s/\\\\/\\/g
-s/\\n/\\\\n/g
-s/\\t/\\\\t/g
-s/\\f/\\\\f/g
-s/\\b/\\\\b/g
-b test
--- a/nt/x11.patch	Sun Jan 31 18:29:48 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-*** X11.def.old	Thu Apr 10 07:29:27 1997
---- X11.def	Wed Jul 02 22:20:16 1997
-***************
-*** 5,15 ****
-  VERSION 6.1
-  EXPORTS
-   _Xdebug_p=_Xdebug CONSTANT
--  _XCreateMutex_fn_p=_XCreateMutex_fn CONSTANT
--  _XFreeMutex_fn_p=_XFreeMutex_fn CONSTANT
--  _XLockMutex_fn_p=_XLockMutex_fn CONSTANT
--  _XUnlockMutex_fn_p=_XUnlockMutex_fn CONSTANT
--  _Xglobal_lock_p=_Xglobal_lock CONSTANT
-   XActivateScreenSaver
-   XAddConnectionWatch
-   XAddExtension
---- 5,10 ----
-***************
-*** 623,630 ****
-   _XUnregisterFilter
-   _XUnregisterInternalConnection
-   _XVIDtoVisual
--  _Xthread_init
--  _Xthread_waiter
-   XkbIgnoreExtension
-   XkbOpenDisplay
-   XkbQueryExtension
---- 618,623 ----
--- a/nt/xemacs.mak	Sun Jan 31 18:29:48 2010 +0000
+++ b/nt/xemacs.mak	Wed Feb 03 20:18:53 2010 +0000
@@ -1033,9 +1033,6 @@
 	set COPYCMD=$(COPYCMD)
 	@copy $(SRC)\config.h.in $(SRC)\config.h
 
-#$(SRC)\Emacs.ad.h: $(SRCROOT)\etc\Emacs.ad
-#	!"sed -f ad2c.sed < $(SRCROOT)\etc\Emacs.ad > $(SRC)\Emacs.ad.h"
-
 #$(SRC)\paths.h: $(SRC)\paths.h.in
 #	!"cd $(SRC); cp paths.h.in paths.h"
 
--- a/nt/xemacs.rc	Sun Jan 31 18:29:48 2010 +0000
+++ b/nt/xemacs.rc	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,22 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
 #ifdef INCLUDE_DUMP
 101    DUMP      "xemacs.dmp"
 #endif
--- a/nt/xpm.mak	Sun Jan 31 18:29:48 2010 +0000
+++ b/nt/xpm.mak	Wed Feb 03 20:18:53 2010 +0000
@@ -1,6 +1,25 @@
 #
 # XPM Makefile for Microsoft NMAKE without X libraries
 #
+# Copyright (C) 1997 Free Software Foundation, Inc.
+#
+# This file is part of XEmacs.
+#
+# XEmacs is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option) any
+# later version.
+#
+# XEmacs is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
 !if !defined(DEBUG)
 !if defined(DEBUG_XEMACS)
 DEBUG=$(DEBUG_XEMACS)
--- a/src/ChangeLog	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/ChangeLog	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,510 @@
+2010-02-03  Jerry James  <james@xemacs.org>
+
+	* s/mach-bsd4-3.h: Add historical copyright and license information,
+	unearthed by Ben Wing.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* bytecode.c:
+	Fix minor compile problem.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defsymbol_nodump):
+	* symbols.c (defsymbol):
+	* symbols.c (defkeyword):
+	* symeval.h (DEFVAR_SYMVAL_FWD_OBJECT):
+	Temporarily back out staticpro-related changes in symbols.c and
+	symeval.h to fix compile problems, will put back when `latest-fix'
+	workspace gets merged in.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c (Fmake_byte_code):
+	* lread.c:
+	* lread.c (readevalloop):
+	* lread.c (Fread):
+	* lread.c (Fread_from_string):
+	* lread.c (read_list_conser):
+	* lread.c (read_list):
+	* lread.c (vars_of_lread):
+	Remove the old kludgy stuff bracketed by `#ifdef
+	COMPILED_FUNCTION_ANNOTATION_HACK_OLD_WAY'.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c (Fmake_byte_code):
+	* bytecode.h:
+	* lisp.h:
+	* lread.c:
+	* lread.c (readevalloop):
+	* lread.c (Fread):
+	* lread.c (Fread_from_string):
+	* lread.c (read_list_conser):
+	* lread.c (read_list):
+	* lread.c (vars_of_lread):
+	* symbols.c:
+	* symbols.c (Fdefine_function):
+	Turn on the "compiled-function annotation hack".  Implement it
+	properly by hooking into Fdefalias().  Note in the docstring to
+	`defalias' that we do this.  Remove some old broken code and
+	change code that implemented the old kludgy way of hooking into
+	the Lisp reader into bracketed by `#ifdef
+	COMPILED_FUNCTION_ANNOTATION_HACK_OLD_WAY', which is not enabled.
+
+	Also enable byte-code metering when DEBUG_XEMACS -- this is a form
+	of profiling for computing histograms of which sequences of two
+	bytecodes are used most often.
+	
+	* bytecode-ops.h:
+	* bytecode-ops.h (OPCODE):
+	New file.  Extract out all the opcodes and declare them using
+	OPCODE(), a bit like frame slots and such.  This way the file can
+	be included multiple times if necessary to iterate multiple times
+	over the byte opcodes.
+	
+	* bytecode.c:
+	* bytecode.c (NUM_REMEMBERED_BYTE_OPS):
+	* bytecode.c (OPCODE):
+	* bytecode.c (assert_failed_with_remembered_ops):
+	* bytecode.c (READ_UINT_2):
+	* bytecode.c (READ_INT_1):
+	* bytecode.c (READ_INT_2):
+	* bytecode.c (PEEK_INT_1):
+	* bytecode.c (PEEK_INT_2):
+	* bytecode.c (JUMP_RELATIVE):
+	* bytecode.c (JUMP_NEXT):
+	* bytecode.c (PUSH):
+	* bytecode.c (POP_WITH_MULTIPLE_VALUES):
+	* bytecode.c (DISCARD):
+	* bytecode.c (UNUSED):
+	* bytecode.c (optimize_byte_code):
+	* bytecode.c (optimize_compiled_function):
+	* bytecode.c (Fbyte_code):
+	* bytecode.c (vars_of_bytecode):
+	* bytecode.c (init_opcode_table_multi_op):
+	* bytecode.c (reinit_vars_of_bytecode):
+	* emacs.c (main_1):
+	* eval.c (funcall_compiled_function):
+	* symsinit.h:
+	Any time we change either the instruction pointer or the stack
+	pointer, assert that we're going to move it to a valid location.
+	This should catch failures right when they occur rather than
+	sometime later.  This requires that we pass in another couple of
+	parameters into some functions (only with error-checking enabled,
+	see below).
+
+	Also keep track, using a circular queue, of the last 100 byte
+	opcodes seen, and when we hit an assert failure during byte-code
+	execution, output the contents of the queue in a nice readable
+	fashion.  This requires that bytecode-ops.h be included a second
+	time so that a table mapping opcodes to the name of their operation
+	can be constructed.  This table is constructed in new function
+	reinit_vars_of_bytecode().
+
+	Everything in the last two paras happens only when
+	ERROR_CHECK_BYTE_CODE.
+
+	Add some longish comments describing how the arrays that hold the
+	stack and instructions, and the pointers used to access them, work.
+	
+	* gc.c:
+	Import some code from my `latest-fix' workspace to mark the
+	staticpro's in order from lowest to highest, rather than highest to
+	lowest, so it's easier to debug when something goes wrong.
+	
+	* lisp.h (abort_with_message): Renamed from abort_with_msg().
+	
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defsymbol_nodump):
+	* symbols.c (defsymbol):
+	* symbols.c (defkeyword):
+	* symeval.h (DEFVAR_SYMVAL_FWD_OBJECT):
+	Make the various calls to staticpro() instead call staticpro_1(),
+	passing in the name of the C var being staticpro'ed, so that it
+	shows up in staticpro_names.  Otherwise staticpro_names just has
+	1000+ copies of the word `location'.
+
+2010-02-02  Ben Wing  <ben@xemacs.org>
+
+	* bytecode.c (execute_rare_opcode):
+	* lisp.h (abort_with_msg): New.
+	When aborting due to unknown opcode, output more descriptive msg.
+
+2010-02-01  Vin Shelton  <acs@xemacs.org>
+
+	* intl-encap-win32.c: Added description of override keyword.
+	Fix 2nd arg to CreateMDIWindowW.
+
+	* intl-auto-encap-win32.c:
+	* intl-auto-encap-win32.h: Fix 2nd arg to qxeCreateMDIWindow.
+
+2010-02-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fns.c (internal_equalp):
+	Use bytecode_arithcompare, which takes two args, instead of
+	passing a stack pointer to Feqlsign.
+	Use CANONCASE(), not DOWNCASE(), for case-insensitive character
+	comparison.
+	Correct a comment here.
+	* casefiddle.c (casify_object): New operation in this function,
+	CASE_CANONICALIZE.
+	(Fcanoncase): New function, used for case-insensitive comparison.
+	* lisp.h:
+	Make Fcanoncase, bytecode_arithcompare visible here.
+	* bytecode.c (bytecode_arithcompare):
+	Make this visible to other files.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in:
+	* Makefile.in.in (x_objs):
+	* Makefile.in.in (gtk_gui_objs):
+	* console-xlike-inc.h:
+	* depend:
+	* device-x.c:
+	* emacs.c:
+	* gccache-gtk.h:
+	* gccache-gtk.h (gc_cache_lookup):
+	* gccache-x.c:
+	* gccache-x.c (GCCACHE_HASH):
+	* gccache-x.h:
+	* toolbar-gtk.c:
+	* toolbar-gtk.c (gtk_initialize_frame_toolbars):
+	* toolbar-x.c:
+	* toolbar-x.c (x_initialize_frame_toolbars):
+	* toolbar-xlike.c:
+	* toolbar-xlike.c (xlike_draw_blank_toolbar_button):
+	* toolbar-xlike.c (xlike_output_toolbar_button):
+	* toolbar-xlike.c (xlike_get_button_size):
+	* toolbar-xlike.c (XLIKE_OUTPUT_BUTTONS_LOOP):
+	* toolbar-xlike.c (xlike_output_toolbar):
+	* toolbar-xlike.c (xlike_clear_toolbar):
+	* toolbar-xlike.c (xlike_output_frame_toolbars):
+	* toolbar-xlike.c (xlike_clear_frame_toolbars):
+	* toolbar-xlike.c (xlike_redraw_exposed_toolbar):
+	* toolbar-xlike.c (xlike_redraw_exposed_toolbars):
+	* toolbar-xlike.c (xlike_redraw_frame_toolbars):
+	* toolbar-xlike.h:
+	* toolbar-xlike.h (xlike_clear_frame_toolbars):
+	Rename some files to make them consistent with general naming rules:
+	
+	xgccache.c -> gccache-x.c
+	xgccache.h -> gccache-x.h
+	toolbar-common.c -> toolbar-xlike.c
+	toolbar-common.h -> toolbar-xlike.h
+
+	Fix include-file references.  Also change the names of functions
+	in now-named toolbar-xlike.c to be xlike_foo() instead of common_foo().
+
+	Add a longish comment in console-xlike-inc.h describing the "xlike"
+	system, how it works and what the various files are used for.
+	
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in:
+	* compiler.h:
+	* config.h.in:
+	* console-x-impl.h:
+	* console-x-impl.h (struct x_frame):
+	* console-x-impl.h (FRAME_X_TOTALLY_VISIBLE_P):
+	* console-x.h:
+	* console-xlike-inc.h:
+	* emacs.c (main_1):
+	* faces.c (complex_vars_of_faces):
+	* font-mgr.h:
+	* frame-x.c (x_delete_frame):
+	* frame-x.c (x_update_frame_external_traits):
+	* glyphs-x.c (update_widget_face):
+	* inline.c:
+	* objects-x-impl.h:
+	* objects-x-impl.h (struct x_color_instance_data):
+	* objects-x-impl.h (struct x_font_instance_data):
+	* objects-x.c:
+	* objects-x.c (x_initialize_color_instance):
+	* objects-x.c (x_initialize_font_instance):
+	* objects-x.c (x_print_font_instance):
+	* objects-x.c (x_finalize_font_instance):
+	* objects-x.c (x_font_instance_truename):
+	* objects-x.c (vars_of_objects_x):
+	* objects-x.h:
+	USE_XFT* -> HAVE_XFT*.  But in objects-xlike-inc.c and
+	redisplay-xlike-inc.c, continue to use USE_XFT, and define
+	it appropriately in console-xlike-inc.h when both HAVE_XFT
+	and THIS_IS_X -- even if HAVE_XFT, we don't want to enable
+	XFT code when included in a *-gtk.c file.
+
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* objects-gtk-impl.h:
+	* objects-gtk-impl.h (XCOLOR_INSTANCE_GTK_COLOR):
+	* objects-gtk-impl.h (XFONT_INSTANCE_GTK_FONT):
+	* objects-x-impl.h (XCOLOR_INSTANCE_X_COLOR):
+	* objects-x-impl.h (XFONT_INSTANCE_X_FONT):
+	Define XCOLOR_INSTANCE_X_COLOR, XCOLOR_INSTANCE_GTK_COLOR,
+	XFONT_INSTANCE_X_FONT, XFONT_INSTANCE_GTK_FONT for convenience
+	purposes.  Fixes compile bug in redisplay-xlike-inc.c.
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* compiler.h:
+	Create a USED() macro to force unused-var warnings to go away,
+	in certain cases where it's inconvenient to do otherwise (e.g.
+	when THIS_IS_GTK in redisplay-xlike-inc.c).
+	
+	* console-x.h:
+	Remove unneeded decls, make some static.
+
+	* redisplay-xlike-inc.c:
+	* console-xlike-inc.h: New file.  Include defns from
+	redisplay-xlike-inc.c that may be useful in other XLIKE files.
+	Correct the handling of colors and font-style setting functions
+	in the xlike defns.  Lots of fixes in the GTK-specific defns.
+	
+	* depend: Regenerate.
+	
+	* event-xlike-inc.c:
+	* event-xlike-inc.c (USE_UNICODE_MAP):
+	* event-xlike-inc.c (endif):
+	* gccache-gtk.c:
+	* gtk-glue.c (xemacs_list_to_gtklist):
+	* gtk-glue.c (xemacs_gtklist_to_list):
+	* gtk-glue.c (FROB):
+	* gtk-glue.c (face_to_gc):
+	* gtk-glue.c (face_to_style):
+	* gtk-glue.c (gdk_event_to_emacs_event):
+	* gtk-xemacs.h (struct _GtkXEmacs):
+	* gtk-xemacs.h (struct _GtkXEmacsClass):
+	* objects-xlike-inc.c:
+	Cosmetic, comment fixes.
+	
+	* glyphs.c (pixmap_to_lisp_data):
+	Unused var fixes.
+	
+
+	* gtk-glue.c:
+	* gccache-gtk.c:
+	* gtk-xemacs.c:
+	* gtk-xemacs.h:
+	* objects-xlike-inc.c:
+	* ui-gtk.c:
+	* ui-gtk.h:
+	* xgccache.c:
+	* xgccache.c (GC_CACHE_SIZE):
+	* xgccache.h:
+	Misc include-file fixes.
+	
+	* objects-xlike-inc.c (XFUN):
+	* objects-xlike-inc.c (xlistfonts_checking_charset):
+	Combine some ifdeffed stuff using defs in console-xlike-inc.h.
+	
+	* redisplay-gtk.c:
+	* redisplay-gtk.c (THIS_IS_GTK):
+	* redisplay-gtk.c (XLIKE_bevel_area):
+	* redisplay-gtk.c (XLIKE_ring_bell):
+	* redisplay-gtk.c (gdk_draw_text_image):
+	Fix numerous compile problems.  Delete gtk_output_shadows(),
+	which mostly duplicates generic bevel_modeline().  Fix up
+	gtk_bevel_modeline() into XLIKE_bevel_area() and make use of
+	the style var properly to set the appropriate GTK constant.
+	
+	* redisplay-x.c:
+	* redisplay-x.c (XLIKE_window_output_begin):
+	* redisplay-x.c (XLIKE_window_output_end):
+	* redisplay-x.c (XLIKE_bevel_area):
+	* redisplay-x.c (x_output_shadows):
+	* redisplay-x.c (XLIKE_ring_bell):
+	Make x_output_shadows be static.  Change the defn of various
+	functions to look like XLIKE_foo() so it matches the calling
+	convention elsewhere.
+	
+	* redisplay-xlike-inc.c:
+	* redisplay-xlike-inc.c (NEED_GCCACHE_H):
+	* redisplay-xlike-inc.c (XLIKE_text_width):
+	* redisplay-xlike-inc.c (XLIKE_get_gc):
+	* redisplay-xlike-inc.c (XLIKE_text_width_single_run):
+	* redisplay-xlike-inc.c (XFT_FROB_LISP_COLOR):
+	* redisplay-xlike-inc.c (XLIKE_output_xlike_pixmap):
+	* redisplay-xlike-inc.c (XLIKE_output_pixmap):
+	* redisplay-xlike-inc.c (XLIKE_output_vertical_divider):
+	* redisplay-xlike-inc.c (XLIKE_flash):
+	Lots of header fixes.  Lots of stuff moved to console-xlike-inc.h.
+	Use XFUN() to generate function names instead of directly
+	calling XLIKE_PASTE().  Remove unnecessary prototypes.
+	Unify calls to text_width funs.  Make XLIKE_get_gc non-static
+	since it's called from gtk.  Change the color-function calls
+	and fill-style-setting calls to match the changes in
+	console-xlike-inc.h.  Use USED() to avoid some warnings.
+	
+	* symsinit.h:
+	Sort the prototypes, and add a fun `sort-symsinit' in a comment
+	that does the sorting (using sort-regexp-fields).
+	
+	* symsinit.h (init_number):
+	
+	
+	* sysgtk.h: New file, wraps the various GTK headers.
+	* sysgdkx.h: New file, wraps <gtk/gdkx.h>.  Keep this separate to
+	* event-gtk.h: Delete.  Combine stuff into console-gtk.h.
+	help isolate X-specific code from GTK.
+
+	* device-gtk.c:
+	* event-gtk.c:
+	* console-gtk.h:
+	* frame-gtk.c:
+	* gccache-gtk.c:
+	* gccache-gtk.h:
+	* glyphs-gtk.c (gtk_colorize_image_instance):
+	* glyphs-gtk.h:
+	* gtk-xemacs.h:
+	* objects-gtk.c:
+	* objects-gtk.c (MAX_FONT_COUNT):
+	* ui-gtk.h:
+	Use sysgtk.h or sysgdkx.h instead of directly including GTK
+	headers.  Don't include event-gtk.h.
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* abbrev.c (abbrev_match_mapper):
+	* buffer.h (CANON_TABLE_OF):
+	* buffer.h:
+	* editfns.c (Fchar_equal):
+	* minibuf.c (scmp_1):
+	* text.c (qxestrcasecmp_i18n):
+	* text.c (qxestrncasecmp_i18n):
+	* text.c (qxetextcasecmp):
+	* text.c (qxetextcasecmp_matching):
+	Create new macro CANONCASE that converts to a canonical mapping
+	and use it to do caseless comparisons instead of DOWNCASE.
+	
+	* alloc.c:
+	* alloc.c (cons_equal):
+	* alloc.c (vector_equal):
+	* alloc.c (string_equal):
+	* bytecode.c (compiled_function_equal):
+	* chartab.c (char_table_entry_equal):
+	* chartab.c (char_table_equal):
+	* data.c (weak_list_equal):
+	* data.c (weak_box_equal):
+	* data.c (ephemeron_equal):
+	* device-msw.c (equal_devmode):
+	* elhash.c (hash_table_equal):
+	* events.c (event_equal):
+	* extents.c (properties_equal):
+	* extents.c (extent_equal):
+	* faces.c:
+	* faces.c (face_equal):
+	* faces.c (face_hash):
+	* floatfns.c (float_equal):
+	* fns.c:
+	* fns.c (bit_vector_equal):
+	* fns.c (plists_differ):
+	* fns.c (Fplists_eq):
+	* fns.c (Fplists_equal):
+	* fns.c (Flax_plists_eq):
+	* fns.c (Flax_plists_equal):
+	* fns.c (internal_equal):
+	* fns.c (internal_equalp):
+	* fns.c (internal_equal_0):
+	* fns.c (syms_of_fns):
+	* glyphs.c (image_instance_equal):
+	* glyphs.c (glyph_equal):
+	* glyphs.c (glyph_hash):
+	* gui.c (gui_item_equal):
+	* lisp.h:
+	* lrecord.h (struct lrecord_implementation):
+	* marker.c (marker_equal):
+	* number.c (bignum_equal):
+	* number.c (ratio_equal):
+	* number.c (bigfloat_equal):
+	* objects.c (color_instance_equal):
+	* objects.c (font_instance_equal):
+	* opaque.c (equal_opaque):
+	* opaque.c (equal_opaque_ptr):
+	* rangetab.c (range_table_equal):
+	* specifier.c (specifier_equal):
+	Add a `foldcase' param to the equal() method and use it to implement
+	`equalp' comparisons.  Also add to plists_differ(), although we
+	don't currently use it here.
+
+	Rewrite internal_equalp().  Implement cross-type vector comparisons.
+	Don't implement our own handling of numeric promotion -- just use
+	the `=' primitive.
+
+	Add internal_equal_0(), which takes a `foldcase' param and calls
+	either internal_equal() or internal_equalp().
+	
+	* buffer.h:
+	When given a 0 for buffer (which is the norm when functions don't
+	have a specific buffer available), use the current buffer's table,
+	not `standard-case-table'; otherwise the current settings are
+	ignored.
+	
+	* casetab.c:
+	* casetab.c (set_case_table):
+	When handling old-style vectors of 256 in `set-case-table' don't
+	overwrite the existing table!  Instead create a new table and
+	populate.
+	
+	* device-msw.c (sync_printer_with_devmode):
+	* lisp.h:
+	* text.c (lisp_strcasecmp_ascii):
+	Rename lisp_strcasecmp to lisp_strcasecmp_ascii and use
+	lisp_strcasecmp_i18n for caseless comparisons in some places.
+	
+	* elhash.c:
+	Delete unused lisp_string_hash and lisp_string_equal().
+	
+	* events.h:
+	* keymap-buttons.h:
+	* keymap.h:
+	* keymap.c (keymap_lookup_directly):
+	* keymap.c (keymap_store):
+	* keymap.c (FROB):
+	* keymap.c (key_desc_list_to_event):
+	* keymap.c (describe_map_mapper):
+	* keymap.c (INCLUDE_BUTTON_ZERO):
+	New file keymap-buttons.h; use to handle buttons 1-26 in place of
+	duplicating code 26 times.
+	
+	* frame-gtk.c (allocate_gtk_frame_struct):
+	* frame-msw.c (mswindows_init_frame_1):
+	Fix some comments about internal_equal() in redisplay that don't
+	apply any more.
+	
+	* keymap-slots.h:
+	* keymap.c:
+	New file keymap-slots.h.  Use it to notate the slots in a keymap
+	structure, similar to frameslots.h or coding-system-slots.h.
+	
+	* keymap.c (MARKED_SLOT):
+	* keymap.c (keymap_equal):
+	* keymap.c (keymap_hash):
+	Implement.
+	
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* syntax.c:
+	* syntax.c (scan_lists):
+	* syntax.c (syms_of_syntax):
+	Declare `scan-error' as a type of `syntax-error'.  In `scan-lists'
+	et al., don't signal a syntax error but instead a `scan-error', and
+	pass a couple of integer arguments, for GNU compatibility.  Fixes
+	problems with typing double-quote in texinfo.el.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* symbols.c (Fspecial_operator_p, syms_of_symbols):
+	* eval.c (print_subr, Finteractive_p, Ffuncall)
+	(Ffunction_min_args, Ffunction_max_args, vars_of_eval):
+	* editfns.c:
+	* data.c (Fsubr_max_args):
+	* doc.c (Fbuilt_in_symbol_file):
+	Change "special form" to "special operator" in our sources.
+
 2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* search.c (search_buffer): 
--- a/src/Makefile.in.in	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/Makefile.in.in	Wed Feb 03 20:18:53 2010 +0000
@@ -132,13 +132,13 @@
 
 #ifdef HAVE_X_WINDOWS
 x_objs=console-x.o device-x.o event-Xt.o frame-x.o \
- glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o intl-x.o
-#ifdef USE_XFT
+ glyphs-x.o objects-x.o redisplay-x.o select-x.o gccache-x.o intl-x.o
+#ifdef HAVE_XFT
 x_objs += font-mgr.o
 #endif
 x_gui_objs=$(gui_objs:.o=-x.o)
 #ifdef HAVE_TOOLBARS
-x_gui_objs += toolbar-common.o
+x_gui_objs += toolbar-xlike.o
 #endif
 #endif
 
@@ -159,7 +159,7 @@
  gtk-xemacs.o ui-gtk.o
 gtk_gui_objs=$(gui_objs:.o=-gtk.o)
 #ifdef HAVE_TOOLBARS
-gtk_gui_objs += toolbar-common.o
+gtk_gui_objs += toolbar-xlike.o
 #endif
 #endif
 
--- a/src/abbrev.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/abbrev.c	Wed Feb 03 20:18:53 2010 +0000
@@ -131,10 +131,10 @@
 
     for (idx = 0; idx < abbrev_length; idx++)
       {
-	if (DOWNCASE (closure->buf,
+	if (CANONCASE (closure->buf,
 		      BUF_FETCH_CHAR (closure->buf,
 				      closure->point - abbrev_length + idx))
-	    != DOWNCASE (closure->buf, itext_ichar (ptr)))
+	    != CANONCASE (closure->buf, itext_ichar (ptr)))
 	  {
 	    break;
 	  }
--- a/src/alloc.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/alloc.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1223,15 +1223,15 @@
 }
 
 static int
-cons_equal (Lisp_Object ob1, Lisp_Object ob2, int depth)
+cons_equal (Lisp_Object ob1, Lisp_Object ob2, int depth, int foldcase)
 {
   depth++;
-  while (internal_equal (XCAR (ob1), XCAR (ob2), depth))
+  while (internal_equal_0 (XCAR (ob1), XCAR (ob2), depth, foldcase))
     {
       ob1 = XCDR (ob1);
       ob2 = XCDR (ob2);
       if (! CONSP (ob1) || ! CONSP (ob2))
-	return internal_equal (ob1, ob2, depth);
+	return internal_equal_0 (ob1, ob2, depth, foldcase);
     }
   return 0;
 }
@@ -1547,7 +1547,7 @@
 }
 
 static int
-vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   int len = XVECTOR_LENGTH (obj1);
   if (len != XVECTOR_LENGTH (obj2))
@@ -1557,7 +1557,7 @@
     Lisp_Object *ptr1 = XVECTOR_DATA (obj1);
     Lisp_Object *ptr2 = XVECTOR_DATA (obj2);
     while (len--)
-      if (!internal_equal (*ptr1++, *ptr2++, depth + 1))
+      if (!internal_equal_0 (*ptr1++, *ptr2++, depth + 1, foldcase))
 	return 0;
   }
   return 1;
@@ -1930,19 +1930,7 @@
   f->stack_depth = (unsigned short) XINT (stack_depth);
 
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  if (!NILP (Vcurrent_compiled_function_annotation))
-    f->annotated = Fcopy (Vcurrent_compiled_function_annotation);
-  else if (!NILP (Vload_file_name_internal_the_purecopy))
-    f->annotated = Vload_file_name_internal_the_purecopy;
-  else if (!NILP (Vload_file_name_internal))
-    {
-      struct gcpro gcpro1;
-      GCPRO1 (fun);		/* don't let fun get reaped */
-      Vload_file_name_internal_the_purecopy =
-	Ffile_name_nondirectory (Vload_file_name_internal);
-      f->annotated = Vload_file_name_internal_the_purecopy;
-      UNGCPRO;
-    }
+  f->annotated = Vload_file_name_internal;
 #endif /* COMPILED_FUNCTION_ANNOTATION_HACK */
 
   /* doc_string may be nil, string, int, or a cons (string . int).
@@ -2251,11 +2239,15 @@
 }
 
 static int
-string_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+string_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	      int foldcase)
 {
   Bytecount len;
-  return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) &&
-	  !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len));
+  if (foldcase)
+    return !lisp_strcasecmp_i18n (obj1, obj2);
+  else
+    return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) &&
+	    !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len));
 }
 
 static const struct memory_description string_description[] = {
--- a/src/buffer.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/buffer.h	Wed Feb 03 20:18:53 2010 +0000
@@ -1188,7 +1188,10 @@
 BUFFER_CASE_TABLE (struct buffer *buf)
 )
 {
-  return buf ? buf->case_table : Vstandard_case_table;
+  return buf ? buf->case_table : current_buffer->case_table;
+  /* When buf=0, was Vstandard_case_table, but this sucks.  If I set a
+     different case table in this buffer, operations that use a case table
+     by default should use the current one. */
 }
 
 /* Macros used below. */
@@ -1196,6 +1199,8 @@
   TRT_TABLE_OF (XCASE_TABLE_DOWNCASE (BUFFER_CASE_TABLE (buf)), c)
 #define UPCASE_TABLE_OF(buf, c)		\
   TRT_TABLE_OF (XCASE_TABLE_UPCASE (BUFFER_CASE_TABLE (buf)), c)
+#define CANON_TABLE_OF(buf, c)	\
+  TRT_TABLE_OF (XCASE_TABLE_CANON (BUFFER_CASE_TABLE (buf)), c)
 
 /* 1 if CH is upper case.  */
 
@@ -1246,4 +1251,9 @@
 
 #define DOWNCASE(buf, ch) DOWNCASE_TABLE_OF (buf, ch)
 
+/* Convert a character to a canonical representation, so that case-independent
+   comparisons will work. */
+
+#define CANONCASE(buf, ch) CANON_TABLE_OF (buf, ch)
+
 #endif /* INCLUDED_buffer_h_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/bytecode-ops.h	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,185 @@
+/* Execution of byte code produced by bytecomp.el.
+   Implementation of compiled-function objects.
+   Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2002, 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Mule 2.0, FSF 19.30. */
+
+/* There is more than one place in bytecode.c that may want to do something
+   with the list of all the opcodes.  To handle this, we extract them into
+   a separate file that can get included after defining OPCODE(sym, val)
+   appropriately.  No need to undefine OPCODE; that happens automatically.
+*/
+
+  OPCODE (varref,  			010)
+  OPCODE (varset,  			020)
+  OPCODE (varbind, 			030)
+  OPCODE (call,    			040)
+  OPCODE (unbind,  			050)
+
+  OPCODE (nth,     			070)
+  OPCODE (symbolp, 			071)
+  OPCODE (consp,   			072)
+  OPCODE (stringp, 			073)
+  OPCODE (listp,   			074)
+  OPCODE (old_eq,  			075)
+  OPCODE (old_memq, 			076)
+  OPCODE (not,    			077)
+  OPCODE (car,    			0100)
+  OPCODE (cdr, 	  			0101)
+  OPCODE (cons,   			0102)
+  OPCODE (list1,  			0103)
+  OPCODE (list2,  			0104)
+  OPCODE (list3,  			0105)
+  OPCODE (list4,  			0106)
+  OPCODE (length, 			0107)
+  OPCODE (aref,   			0110)
+  OPCODE (aset,   			0111)
+  OPCODE (symbol_value, 		0112)
+  OPCODE (symbol_function, 		0113)
+  OPCODE (set,    			0114)
+  OPCODE (fset,   			0115)
+  OPCODE (get,    			0116)
+  OPCODE (substring, 			0117)
+  OPCODE (concat2, 			0120)
+  OPCODE (concat3, 			0121)
+  OPCODE (concat4, 			0122)
+  OPCODE (sub1, 			0123)
+  OPCODE (add1, 			0124)
+  OPCODE (eqlsign, 			0125)
+  OPCODE (gtr, 				0126)
+  OPCODE (lss, 				0127)
+  OPCODE (leq, 				0130)
+  OPCODE (geq, 				0131)
+  OPCODE (diff, 			0132)
+  OPCODE (negate, 			0133)
+  OPCODE (plus, 			0134)
+  OPCODE (max, 				0135)
+  OPCODE (min, 				0136)
+  OPCODE (mult, 			0137)
+
+  OPCODE (point, 			0140)
+  OPCODE (eq, 				0141) /* was Bmark, but no longer
+						 generated as of v18 */
+  OPCODE (goto_char, 			0142)
+  OPCODE (insert, 			0143)
+  OPCODE (point_max, 			0144)
+  OPCODE (point_min, 			0145)
+  OPCODE (char_after, 			0146)
+  OPCODE (following_char, 		0147)
+  OPCODE (preceding_char, 		0150)
+  OPCODE (current_column, 		0151)
+  OPCODE (indent_to, 			0152)
+  OPCODE (equal, 			0153) /* was Bscan_buffer, but no
+						 longer generated as of
+						 v18 */
+  OPCODE (eolp, 			0154)
+  OPCODE (eobp, 			0155)
+  OPCODE (bolp, 			0156)
+  OPCODE (bobp, 			0157)
+  OPCODE (current_buffer, 		0160)
+  OPCODE (set_buffer, 			0161)
+  OPCODE (save_current_buffer, 		0162) /* was Bread_char, but no
+						 longer generated as of
+						 v19 */
+  OPCODE (memq, 			0163) /* was Bset_mark, but no
+						 longer generated as of
+						 v18 */
+  OPCODE (interactive_p, 		0164) /* Needed since interactive-p
+						 takes unevalled args */
+  OPCODE (forward_char, 		0165)
+  OPCODE (forward_word, 		0166)
+  OPCODE (skip_chars_forward, 		0167)
+  OPCODE (skip_chars_backward, 		0170)
+  OPCODE (forward_line, 		0171)
+  OPCODE (char_syntax, 			0172)
+  OPCODE (buffer_substring, 		0173)
+  OPCODE (delete_region, 		0174)
+  OPCODE (narrow_to_region, 		0175)
+  OPCODE (widen, 			0176)
+  OPCODE (end_of_line, 			0177)
+
+  OPCODE (constant2, 			0201)
+  OPCODE (goto, 			0202)
+  OPCODE (gotoifnil, 			0203)
+  OPCODE (gotoifnonnil, 		0204)
+  OPCODE (gotoifnilelsepop, 		0205)
+  OPCODE (gotoifnonnilelsepop, 		0206)
+  OPCODE (return, 			0207)
+  OPCODE (discard, 			0210)
+  OPCODE (dup, 				0211)
+
+  OPCODE (save_excursion, 		0212)
+  OPCODE (save_window_excursion,	0213)
+  OPCODE (save_restriction, 		0214)
+  OPCODE (catch, 			0215)
+
+  OPCODE (unwind_protect, 		0216)
+  OPCODE (condition_case, 		0217)
+  OPCODE (temp_output_buffer_setup, 	0220)
+  OPCODE (temp_output_buffer_show,  	0221)
+
+  OPCODE (unbind_all,			0222)
+
+  OPCODE (set_marker,			0223)
+  OPCODE (match_beginning,		0224)
+  OPCODE (match_end,			0225)
+  OPCODE (upcase,			0226)
+  OPCODE (downcase,			0227)
+
+  OPCODE (string_equal, 		0230)
+  OPCODE (string_lessp,     		0231)
+  OPCODE (old_equal, 	 		0232)
+  OPCODE (nthcdr, 	 		0233)
+  OPCODE (elt, 		 		0234)
+  OPCODE (old_member, 	 		0235)
+  OPCODE (old_assq, 	 		0236)
+  OPCODE (nreverse, 	 		0237)
+  OPCODE (setcar, 	 		0240)
+  OPCODE (setcdr, 	 		0241)
+  OPCODE (car_safe, 	 		0242)
+  OPCODE (cdr_safe, 	 		0243)
+  OPCODE (nconc, 	 		0244)
+  OPCODE (quo, 		 		0245)
+  OPCODE (rem, 		 		0246)
+  OPCODE (numberp, 	 		0247)
+  OPCODE (fixnump, 	 		0250) /* Was Bintegerp. */
+
+  OPCODE (Rgoto, 			0252)
+  OPCODE (Rgotoifnil, 			0253)
+  OPCODE (Rgotoifnonnil, 		0254)
+  OPCODE (Rgotoifnilelsepop, 		0255)
+  OPCODE (Rgotoifnonnilelsepop, 	0256)
+
+  OPCODE (listN, 			0257)
+  OPCODE (concatN, 			0260)
+  OPCODE (insertN, 			0261)
+
+  OPCODE (bind_multiple_value_limits,   0262) /* New in 21.5. */
+  OPCODE (multiple_value_list_internal, 0263) /* New in 21.5. */
+  OPCODE (multiple_value_call,          0264) /* New in 21.5. */
+  OPCODE (throw,                        0265) /* New in 21.5. */
+
+  OPCODE (member, 			0266) /* new in v20 */
+  OPCODE (assq, 			0267) /* new in v20 */
+
+  OPCODE (constant,			0300)
+
+#undef OPCODE
--- a/src/bytecode.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/bytecode.c	Wed Feb 03 20:18:53 2010 +0000
@@ -58,6 +58,8 @@
 #include "syntax.h"
 #include "window.h"
 
+#define NUM_REMEMBERED_BYTE_OPS 100
+
 #ifdef NEW_GC
 static Lisp_Object
 make_compiled_function_args (int totalargs)
@@ -101,169 +103,104 @@
 
 Lisp_Object Qbyte_code, Qcompiled_functionp, Qinvalid_byte_code;
 
+
 enum Opcode /* Byte codes */
 {
-  Bvarref  		= 010,
-  Bvarset  		= 020,
-  Bvarbind 		= 030,
-  Bcall    		= 040,
-  Bunbind  		= 050,
-
-  Bnth     		= 070,
-  Bsymbolp 		= 071,
-  Bconsp   		= 072,
-  Bstringp 		= 073,
-  Blistp   		= 074,
-  Bold_eq  		= 075,
-  Bold_memq 		= 076,
-  Bnot    		= 077,
-  Bcar    		= 0100,
-  Bcdr 	  		= 0101,
-  Bcons   		= 0102,
-  Blist1  		= 0103,
-  Blist2  		= 0104,
-  Blist3  		= 0105,
-  Blist4  		= 0106,
-  Blength 		= 0107,
-  Baref   		= 0110,
-  Baset   		= 0111,
-  Bsymbol_value 	= 0112,
-  Bsymbol_function 	= 0113,
-  Bset    		= 0114,
-  Bfset   		= 0115,
-  Bget    		= 0116,
-  Bsubstring 		= 0117,
-  Bconcat2 		= 0120,
-  Bconcat3 		= 0121,
-  Bconcat4 		= 0122,
-  Bsub1 		= 0123,
-  Badd1 		= 0124,
-  Beqlsign 		= 0125,
-  Bgtr 			= 0126,
-  Blss 			= 0127,
-  Bleq 			= 0130,
-  Bgeq 			= 0131,
-  Bdiff 		= 0132,
-  Bnegate 		= 0133,
-  Bplus 		= 0134,
-  Bmax 			= 0135,
-  Bmin 			= 0136,
-  Bmult 		= 0137,
-
-  Bpoint 		= 0140,
-  Beq 			= 0141, /* was Bmark,
-				   but no longer generated as of v18 */
-  Bgoto_char 		= 0142,
-  Binsert 		= 0143,
-  Bpoint_max 		= 0144,
-  Bpoint_min 		= 0145,
-  Bchar_after 		= 0146,
-  Bfollowing_char 	= 0147,
-  Bpreceding_char 	= 0150,
-  Bcurrent_column 	= 0151,
-  Bindent_to 		= 0152,
-  Bequal 		= 0153, /* was Bscan_buffer,
-				   but no longer generated as of v18 */
-  Beolp 		= 0154,
-  Beobp 		= 0155,
-  Bbolp 		= 0156,
-  Bbobp 		= 0157,
-  Bcurrent_buffer 	= 0160,
-  Bset_buffer 		= 0161,
-  Bsave_current_buffer 	= 0162, /* was Bread_char,
-				   but no longer generated as of v19 */
-  Bmemq 		= 0163, /* was Bset_mark,
-				   but no longer generated as of v18 */
-  Binteractive_p 	= 0164, /* Needed since interactive-p takes
-				   unevalled args */
-  Bforward_char 	= 0165,
-  Bforward_word 	= 0166,
-  Bskip_chars_forward 	= 0167,
-  Bskip_chars_backward 	= 0170,
-  Bforward_line 	= 0171,
-  Bchar_syntax 		= 0172,
-  Bbuffer_substring 	= 0173,
-  Bdelete_region 	= 0174,
-  Bnarrow_to_region 	= 0175,
-  Bwiden 		= 0176,
-  Bend_of_line 		= 0177,
-
-  Bconstant2 		= 0201,
-  Bgoto 		= 0202,
-  Bgotoifnil 		= 0203,
-  Bgotoifnonnil 	= 0204,
-  Bgotoifnilelsepop 	= 0205,
-  Bgotoifnonnilelsepop 	= 0206,
-  Breturn 		= 0207,
-  Bdiscard 		= 0210,
-  Bdup 			= 0211,
-
-  Bsave_excursion 	= 0212,
-  Bsave_window_excursion= 0213,
-  Bsave_restriction 	= 0214,
-  Bcatch 		= 0215,
-
-  Bunwind_protect 	= 0216,
-  Bcondition_case 	= 0217,
-  Btemp_output_buffer_setup = 0220,
-  Btemp_output_buffer_show  = 0221,
-
-  Bunbind_all 		= 0222,
-
-  Bset_marker 		= 0223,
-  Bmatch_beginning 	= 0224,
-  Bmatch_end 		= 0225,
-  Bupcase 		= 0226,
-  Bdowncase 		= 0227,
-
-  Bstring_equal 	= 0230,
-  Bstring_lessp     	= 0231,
-  Bold_equal 	 	= 0232,
-  Bnthcdr 	 	= 0233,
-  Belt 		 	= 0234,
-  Bold_member 	 	= 0235,
-  Bold_assq 	 	= 0236,
-  Bnreverse 	 	= 0237,
-  Bsetcar 	 	= 0240,
-  Bsetcdr 	 	= 0241,
-  Bcar_safe 	 	= 0242,
-  Bcdr_safe 	 	= 0243,
-  Bnconc 	 	= 0244,
-  Bquo 		 	= 0245,
-  Brem 		 	= 0246,
-  Bnumberp 	 	= 0247,
-  Bfixnump 	 	= 0250,	/* Was Bintegerp. */
-
-  BRgoto 		= 0252,
-  BRgotoifnil 		= 0253,
-  BRgotoifnonnil 	= 0254,
-  BRgotoifnilelsepop 	= 0255,
-  BRgotoifnonnilelsepop = 0256,
-
-  BlistN 		= 0257,
-  BconcatN 		= 0260,
-  BinsertN 		= 0261,
-
-  Bbind_multiple_value_limits   = 0262,         /* New in 21.5. */
-  Bmultiple_value_list_internal = 0263,         /* New in 21.5. */
-  Bmultiple_value_call          = 0264,         /* New in 21.5. */
-  Bthrow                        = 0265,         /* New in 21.5. */
-
-  Bmember 		= 0266, /* new in v20 */
-  Bassq 		= 0267, /* new in v20 */
-
-  Bconstant 		= 0300
+#define OPCODE(sym, val) B##sym = val,
+#include "bytecode-ops.h"
 };
 typedef enum Opcode Opcode;
-
 
 Lisp_Object * execute_rare_opcode (Lisp_Object *stack_ptr,
+#ifdef ERROR_CHECK_BYTE_CODE
+				   Lisp_Object *stack_beg,
+				   Lisp_Object *stack_end,
+#endif /* ERROR_CHECK_BYTE_CODE */
 				   const Opbyte *program_ptr,
 				   Opcode opcode);
 
-/* Define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
-   This isn't defined in FSF Emacs and isn't defined in XEmacs v19. */
-/* #define BYTE_CODE_METER */
+#ifndef ERROR_CHECK_BYTE_CODE
+
+# define bytecode_assert(x) disabled_assert (x)
+# define bytecode_assert_with_message(x, msg) disabled_assert(x)
+# define bytecode_abort_with_message(msg) abort_with_message (msg)
+
+#else /* ERROR_CHECK_BYTE_CODE */
+
+# define bytecode_assert(x) \
+  ((x) ? (void) 0 : assert_failed_with_remembered_ops (__FILE__, __LINE__, #x))
+# define bytecode_assert_with_message(x, msg) \
+  ((x) ? (void) 0 : assert_failed_with_remembered_ops (__FILE__, __LINE__, msg))
+# define bytecode_abort_with_message(msg) \
+  assert_failed_with_remembered_ops (__FILE__, __LINE__, msg)
+
+/* Table mapping opcodes to their names.  This handles opcodes like
+   Bvarref+7, but it doesn't list any of the Bconstant+N opcodes; those
+   are handled specially. */
+Ascbyte *opcode_name_table[256];
+
+/* Circular queue remembering the most recent operations. */
+Opcode remembered_ops[NUM_REMEMBERED_BYTE_OPS];
+int remembered_op_next_pos, num_remembered;
+
+static void
+remember_operation (Opcode op)
+{
+  remembered_ops[remembered_op_next_pos] = op;
+  remembered_op_next_pos =
+    (remembered_op_next_pos + 1) % NUM_REMEMBERED_BYTE_OPS;
+  if (num_remembered < NUM_REMEMBERED_BYTE_OPS)
+    num_remembered++;
+}
+
+static void
+assert_failed_with_remembered_ops (const Ascbyte *file, int line,
+				   Ascbyte *msg_to_abort_with)
+{
+  Ascbyte *msg =
+    alloca_array (Ascbyte,
+		  NUM_REMEMBERED_BYTE_OPS*50 + strlen (msg_to_abort_with));
+  int i;
+
+  if (msg_to_abort_with)
+    strcpy (msg, msg_to_abort_with);
+  strcat (msg, "\n\nRecent bytecodes, oldest first:\n\n");
+
+  for (i = 0; i < num_remembered; i++)
+    {
+      Ascbyte msg2[50];
+      int pos;
+      Opcode op;
+
+      sprintf (msg2, "%5d:  ", i - num_remembered + 1);
+      strcat (msg, msg2);
+      pos = (remembered_op_next_pos + NUM_REMEMBERED_BYTE_OPS +
+	     i - num_remembered) % NUM_REMEMBERED_BYTE_OPS;
+      op = remembered_ops[pos];
+      if (op >= Bconstant)
+	{
+	  sprintf (msg2, "constant+%d", op - Bconstant);
+	  strcat (msg, msg2);
+	}
+      else
+	{
+	  Ascbyte *opname = opcode_name_table[op];
+	  if (!opname)
+	    {
+	      stderr_out ("Internal error! NULL pointer in opcode_name_table, opcode %d\n", op);
+	      strcat (msg, "NULL");
+	    }
+	  else
+	    strcat (msg, opname);
+	}
+      sprintf (msg2, " (%d)\n", op);
+      strcat (msg, msg2);
+    }
+
+  assert_failed (file, line, msg);
+}
+
+#endif /* ERROR_CHECK_BYTE_CODE */
 
 
 #ifdef BYTE_CODE_METER
@@ -330,7 +267,7 @@
 
 /* We have our own two-argument versions of various arithmetic ops.
    Only two-argument arithmetic operations have their own byte codes. */
-static int
+int
 bytecode_arithcompare (Lisp_Object obj1, Lisp_Object obj2)
 {
 #ifdef WITH_NUMBER_TYPES
@@ -619,72 +556,127 @@
 }
 
 
+
+/*********************** The instruction array *********************/
+
+/* Check that there are at least LEN elements left in the end of the
+   instruction array before fetching them.  Note that we allow for
+   PROGRAM_PTR == PROGRAM_END after the fetch -- that means there are
+   no more elements to fetch next time around, but we might exit before
+   next time comes.
+
+   When checking the destination if jumps, however, we don't allow
+   PROGRAM_PTR to equal PROGRAM_END, since we will always be fetching
+   another instruction after the jump. */
+
+#define CHECK_OPCODE_SPACE(len) \
+  bytecode_assert (program_ptr + len <= program_end)
+
 /* Read next uint8 from the instruction stream. */
-#define READ_UINT_1 ((unsigned int) (unsigned char) *program_ptr++)
+#define READ_UINT_1 \
+  (CHECK_OPCODE_SPACE (1), (unsigned int) (unsigned char) *program_ptr++)
 
 /* Read next uint16 from the instruction stream. */
 #define READ_UINT_2						\
-  (program_ptr += 2,						\
+  (CHECK_OPCODE_SPACE (2),					\
+   program_ptr += 2,						\
    (((unsigned int) (unsigned char) program_ptr[-1]) * 256 +	\
     ((unsigned int) (unsigned char) program_ptr[-2])))
 
 /* Read next int8 from the instruction stream. */
-#define READ_INT_1 ((int) (signed char) *program_ptr++)
+#define READ_INT_1 \
+  (CHECK_OPCODE_SPACE (1), (int) (signed char) *program_ptr++)
 
 /* Read next int16 from the instruction stream. */
 #define READ_INT_2					\
-  (program_ptr += 2,					\
+  (CHECK_OPCODE_SPACE (2),				\
+   program_ptr += 2,					\
    (((int) (  signed char) program_ptr[-1]) * 256 +	\
     ((int) (unsigned char) program_ptr[-2])))
 
 /* Read next int8 from instruction stream; don't advance program_pointer */
-#define PEEK_INT_1 ((int) (signed char) program_ptr[0])
+#define PEEK_INT_1 \
+  (CHECK_OPCODE_SPACE (1), (int) (signed char) program_ptr[0])
 
 /* Read next int16 from instruction stream; don't advance program_pointer */
 #define PEEK_INT_2					\
-  ((((int) (  signed char) program_ptr[1]) * 256) |	\
+  (CHECK_OPCODE_SPACE (2),				\
+   (((int) (  signed char) program_ptr[1]) * 256) |	\
     ((int) (unsigned char) program_ptr[0]))
 
 /* Do relative jumps from the current location.
    We only do a QUIT if we jump backwards, for efficiency.
    No infloops without backward jumps! */
-#define JUMP_RELATIVE(jump) do {	\
-  int JR_jump = (jump);			\
-  if (JR_jump < 0) QUIT;		\
-  program_ptr += JR_jump;		\
+#define JUMP_RELATIVE(jump) do {					\
+  int _JR_jump = (jump);						\
+  if (_JR_jump < 0) QUIT;						\
+  /* Check that where we're going to is in range.  Note that we don't use \
+     CHECK_OPCODE_SPACE() -- that only checks the end, and it allows	\
+     program_ptr == program_end, which we don't allow. */		\
+  bytecode_assert (program_ptr + _JR_jump >= program &&			\
+		   program_ptr + _JR_jump < program_end);		\
+  program_ptr += _JR_jump;						\
 } while (0)
 
 #define JUMP  JUMP_RELATIVE (PEEK_INT_2)
 #define JUMPR JUMP_RELATIVE (PEEK_INT_1)
 
-#define JUMP_NEXT  ((void) (program_ptr += 2))
-#define JUMPR_NEXT ((void) (program_ptr += 1))
+#define JUMP_NEXT  (CHECK_OPCODE_SPACE (2), (void) (program_ptr += 2))
+#define JUMPR_NEXT (CHECK_OPCODE_SPACE (1), (void) (program_ptr += 1))
+
+/*********************** The stack array *********************/
+
+/* NOTE: The stack array doesn't work quite like you'd expect.
+
+   STACK_PTR points to the value on the top of the stack.  Popping a value
+   fetches the value from the STACK_PTR and then decrements it.  Pushing a
+   value first increments it, then writes the new value.  STACK_PTR -
+   STACK_BEG is the number of elements on the stack.
+
+   This means that when STACK_PTR == STACK_BEG, the stack is empty, and
+   the space at STACK_BEG is never written to -- the first push will write
+   into the space directly after STACK_BEG.  This is why the call to
+   alloca_array() below has a count of `stack_depth + 1', and why
+   we GCPRO1 (stack_ptr[1]) -- the value at stack_ptr[0] is unused and
+   uninitialized.
+
+   Also, STACK_END actually points to the last usable storage location,
+   and does not point past the end, like you'd expect. */
+
+#define CHECK_STACKPTR_OFFSET(len) \
+  bytecode_assert (stack_ptr + (len) >= stack_beg && \
+                   stack_ptr + (len) <= stack_end)
 
 /* Push x onto the execution stack. */
-#define PUSH(x) (*++stack_ptr = (x))
+#define PUSH(x) (CHECK_STACKPTR_OFFSET (1), *++stack_ptr = (x))
 
 /* Pop a value, which may be multiple, off the execution stack. */
-#define POP_WITH_MULTIPLE_VALUES (*stack_ptr--)
+#define POP_WITH_MULTIPLE_VALUES (CHECK_STACKPTR_OFFSET (-1), *stack_ptr--)
 
 /* Pop a value off the execution stack, treating multiple values as single. */
 #define POP (IGNORE_MULTIPLE_VALUES (POP_WITH_MULTIPLE_VALUES))
 
-#define DISCARD_PRESERVING_MULTIPLE_VALUES(n) (stack_ptr -= (n))
+/* ..._UNSAFE() means it evaluates its argument more than once. */
+#define DISCARD_PRESERVING_MULTIPLE_VALUES_UNSAFE(n) \
+  (CHECK_STACKPTR_OFFSET (-(n)), stack_ptr -= (n))
 
 /* Discard n values from the execution stack.  */
 #define DISCARD(n) do {                                         \
+    int _discard_n = (n);					\
     if (1 != multiple_value_current_limit)                      \
       {                                                         \
-        int i, en = n;                                          \
-        for (i = 0; i < en; i++)                                \
+        int i;							\
+        for (i = 0; i < _discard_n; i++)			\
           {                                                     \
+	    CHECK_STACKPTR_OFFSET (-1);				\
             *stack_ptr = ignore_multiple_values (*stack_ptr);   \
             stack_ptr--;                                        \
           }                                                     \
       }                                                         \
     else                                                        \
       {                                                         \
-        stack_ptr -= (n);                                       \
+	CHECK_STACKPTR_OFFSET (-_discard_n);			\
+        stack_ptr -= _discard_n;				\
       }                                                         \
   } while (0)
 
@@ -705,6 +697,7 @@
 /* See comment before the big switch in execute_optimized_program(). */
 #define GCPRO_STACK  (gcpro1.nvars = stack_ptr - stack_beg)
 
+
 /* The actual interpreter for byte code.
    This function has been seriously optimized for performance.
    Don't change the constructs unless you are willing to do
@@ -713,18 +706,25 @@
 
 Lisp_Object
 execute_optimized_program (const Opbyte *program,
+#ifdef ERROR_CHECK_BYTE_CODE
+			   Elemcount program_length,
+#endif
 			   int stack_depth,
 			   Lisp_Object *constants_data)
 {
   /* This function can GC */
   REGISTER const Opbyte *program_ptr = (Opbyte *) program;
+#ifdef ERROR_CHECK_BYTE_CODE
+  const Opbyte *program_end = program_ptr + program_length;
+#endif
+  /* See comment above explaining the `+ 1' */
   Lisp_Object *stack_beg = alloca_array (Lisp_Object, stack_depth + 1);
   REGISTER Lisp_Object *stack_ptr = stack_beg;
   int speccount = specpdl_depth ();
   struct gcpro gcpro1;
 
 #ifdef BYTE_CODE_METER
-  Opcode this_opcode = 0;
+  Opcode this_opcode = (Opcode) 0;
   Opcode prev_opcode;
 #endif
 
@@ -759,13 +759,22 @@
      return from the interpreter do we need to finalize the struct gcpro
      itself, and that's done at case Breturn.
   */
+
+  /* See comment above explaining the `[1]' */
   GCPRO1 (stack_ptr[1]);
 
   while (1)
     {
       REGISTER Opcode opcode = (Opcode) READ_UINT_1;
 
+#ifdef ERROR_CHECK_BYTE_CODE
+      remember_operation (opcode);
+#endif
+
       GCPRO_STACK;		/* Get nvars right before maybe signaling. */
+      /* #### NOTE: This code should probably never get triggered, since we
+	 now catch the problems earlier, farther down, before we ever set
+	 a bad value for STACK_PTR. */
 #ifdef ERROR_CHECK_BYTE_CODE
       if (stack_ptr > stack_end)
 	stack_overflow ("byte code stack overflow", Qunbound);
@@ -790,7 +799,13 @@
 	    {
 	      /* We're not sure what these do, so better safe than sorry. */
 	      /* GCPRO_STACK; */
-	      stack_ptr = execute_rare_opcode (stack_ptr, program_ptr, opcode);
+	      stack_ptr = execute_rare_opcode (stack_ptr,
+#ifdef ERROR_CHECK_BYTE_CODE
+					       stack_beg,
+					       stack_end,
+#endif /* ERROR_CHECK_BYTE_CODE */
+					       program_ptr, opcode);
+	      CHECK_STACKPTR_OFFSET (0);
 	    }
 	  break;
 
@@ -1438,6 +1453,10 @@
    Don't make this function static, since then the compiler might inline it. */
 Lisp_Object *
 execute_rare_opcode (Lisp_Object *stack_ptr,
+#ifdef ERROR_CHECK_BYTE_CODE
+		     Lisp_Object *stack_beg,
+		     Lisp_Object *stack_end,
+#endif /* ERROR_CHECK_BYTE_CODE */
 		     const Opbyte *UNUSED (program_ptr),
 		     Opcode opcode)
 {
@@ -1445,7 +1464,7 @@
 
   switch (opcode)
     {
-
+      
     case Bsave_excursion:
       record_unwind_protect (save_excursion_restore,
 			     save_excursion_save ());
@@ -1714,7 +1733,7 @@
     case Bmultiple_value_call:
       {
         n = XINT (POP);
-        DISCARD_PRESERVING_MULTIPLE_VALUES (n - 1);
+        DISCARD_PRESERVING_MULTIPLE_VALUES_UNSAFE (n - 1);
         /* Discard multiple values for the first (function) argument: */
         TOP_LVALUE = TOP;
         TOP_LVALUE = multiple_value_call (n, TOP_ADDRESS);
@@ -1723,7 +1742,7 @@
 
     case Bmultiple_value_list_internal:
       {
-        DISCARD_PRESERVING_MULTIPLE_VALUES (3);
+        DISCARD_PRESERVING_MULTIPLE_VALUES_UNSAFE (3);
         TOP_LVALUE = multiple_value_list_internal (4, TOP_ADDRESS);
         break;
       }
@@ -1738,7 +1757,11 @@
       }
 
     default:
-      ABORT();
+      {
+	Ascbyte msg[100];
+	sprintf (msg, "Unknown opcode %d", opcode);
+	bytecode_abort_with_message (msg);
+      }
       break;
     }
   return stack_ptr;
@@ -1862,8 +1885,8 @@
 		    Lisp_Object constants,
 		    /* out */
 		    Opbyte * const program,
-		    int * const program_length,
-		    int * const varbind_count)
+		    Elemcount * const program_length,
+		    Elemcount * const varbind_count)
 {
   Bytecount instructions_length = XSTRING_LENGTH (instructions);
   Elemcount comfy_size = (Elemcount) (2 * instructions_length);
@@ -2127,8 +2150,8 @@
 optimize_compiled_function (Lisp_Object compiled_function)
 {
   Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (compiled_function);
-  int program_length;
-  int varbind_count;
+  Elemcount program_length;
+  Elemcount varbind_count;
   Opbyte *program;
 
   {
@@ -2299,7 +2322,8 @@
 }
 
 static int
-compiled_function_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+compiled_function_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+			 int UNUSED (foldcase))
 {
   Lisp_Compiled_Function *f1 = XCOMPILED_FUNCTION (obj1);
   Lisp_Compiled_Function *f2 = XCOMPILED_FUNCTION (obj2);
@@ -2699,8 +2723,8 @@
        (instructions, constants, stack_depth))
 {
   /* This function can GC */
-  int varbind_count;
-  int program_length;
+  Elemcount varbind_count;
+  Elemcount program_length;
   Opbyte *program;
 
   CHECK_STRING (instructions);
@@ -2715,6 +2739,9 @@
 		      &program_length, &varbind_count);
   SPECPDL_RESERVE (varbind_count);
   return execute_optimized_program (program,
+#ifdef ERROR_CHECK_BYTE_CODE
+				    program_length,
+#endif
 				    XINT (stack_depth),
 				    XVECTOR_DATA (constants));
 }
@@ -2757,7 +2784,6 @@
 vars_of_bytecode (void)
 {
 #ifdef BYTE_CODE_METER
-
   DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter /*
 A vector of vectors which holds a histogram of byte code usage.
 \(aref (aref byte-code-meter 0) CODE) indicates how many times the byte
@@ -2782,3 +2808,57 @@
   }
 #endif /* BYTE_CODE_METER */
 }
+
+#ifdef ERROR_CHECK_BYTE_CODE
+
+/* Initialize the opcodes in the table that correspond to a base opcode
+   plus an offset (except for Bconstant). */
+
+static void
+init_opcode_table_multi_op (Opcode op)
+{
+  Ascbyte *basename = opcode_name_table[op];
+  Ascbyte temp[300];
+  int i;
+
+  for (i = 1; i < 7; i++)
+    {
+      assert (!opcode_name_table[op + i]);
+      sprintf (temp, "%s+%d", basename, i);
+      opcode_name_table[op + i] = xstrdup (temp);
+    }
+}
+
+#endif /* ERROR_CHECK_BYTE_CODE */
+
+void
+reinit_vars_of_bytecode (void)
+{
+#ifdef ERROR_CHECK_BYTE_CODE
+  int i;
+
+#define OPCODE(sym, val) opcode_name_table[val] = xstrdup (#sym);
+#include "bytecode-ops.h"
+
+  for (i = 0; i < countof (opcode_name_table); i++)
+    {
+      int j;
+      Ascbyte *name = opcode_name_table[i];
+      if (name)
+	{
+	  Bytecount len = strlen (name);
+	  /* Prettify the name by converting underscores to hyphens, similar
+	     to what happens with DEFSYMBOL. */
+	  for (j = 0; j < len; j++)
+	    if (name[j] == '_')
+	      name[j] = '-';
+	}
+    }
+
+  init_opcode_table_multi_op (Bvarref);
+  init_opcode_table_multi_op (Bvarset);
+  init_opcode_table_multi_op (Bvarbind);
+  init_opcode_table_multi_op (Bcall);
+  init_opcode_table_multi_op (Bunbind);
+#endif /* ERROR_CHECK_BYTE_CODE */
+}
--- a/src/bytecode.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/bytecode.h	Wed Feb 03 20:18:53 2010 +0000
@@ -67,8 +67,19 @@
 #define COMPILED_INTERACTIVE	5
 #define COMPILED_DOMAIN		6
 
-/* It doesn't make sense to have this and also have load-history */
-/* #define COMPILED_FUNCTION_ANNOTATION_HACK */
+/* Someone claims: [[ It doesn't make sense to have this and also have
+   load-history ]] But in fact they are quite different things.  Perhaps
+   we should turn this on only when DEBUG_XEMACS but there's no speed
+   harm at all, so no reason not to do it always. */
+#define COMPILED_FUNCTION_ANNOTATION_HACK
+
+#ifdef DEBUG_XEMACS
+/* Define BYTE_CODE_METER to enable generation of a byte-op usage
+   histogram.  This isn't defined in FSF Emacs and isn't defined in XEmacs
+   v19.  But this is precisely the thing to turn on when DEBUG_XEMACS.  It
+   may lead to a slight speed penalty but nothing major. */
+#define BYTE_CODE_METER
+#endif
 
 struct Lisp_Compiled_Function
 {
@@ -131,6 +142,9 @@
 
 typedef unsigned char Opbyte;
 Lisp_Object execute_optimized_program (const Opbyte *program,
+#ifdef ERROR_CHECK_BYTE_CODE
+				       Elemcount program_length,
+#endif
 				       int stack_depth,
 				       Lisp_Object *constants_data);
 
--- a/src/casefiddle.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/casefiddle.c	Wed Feb 03 20:18:53 2010 +0000
@@ -28,7 +28,8 @@
 #include "insdel.h"
 #include "syntax.h"
 
-enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP};
+enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP,
+                  CASE_CANONICALIZE};
 
 static Lisp_Object
 casify_object (enum case_action flag, Lisp_Object string_or_char,
@@ -43,7 +44,19 @@
       Ichar c;
       CHECK_CHAR_COERCE_INT (string_or_char);
       c = XCHAR (string_or_char);
-      c = (flag == CASE_DOWN) ? DOWNCASE (buf, c) : UPCASE (buf, c);
+      if (flag == CASE_DOWN)
+	{
+	  c = DOWNCASE (buf, c);
+	}
+      else if (flag == CASE_UP)
+	{
+	  c = UPCASE (buf, c);
+	}
+      else
+	{
+	  c = CANONCASE (buf, c);
+	}
+
       return make_char (c);
     }
 
@@ -68,6 +81,9 @@
 	    case CASE_DOWN:
 	      c = DOWNCASE (buf, c);
 	      break;
+	    case CASE_CANONICALIZE:
+	      c = CANONCASE (buf, c);
+	      break;
 	    case CASE_CAPITALIZE:
 	    case CASE_CAPITALIZE_UP:
 	      wordp_prev = wordp;
@@ -119,6 +135,23 @@
   return casify_object (CASE_DOWN, string_or_char, buffer);
 }
 
+DEFUN ("canoncase", Fcanoncase, 1, 2, 0, /*
+Convert STRING-OR-CHAR to its canonical lowercase form and return that.
+
+STRING-OR-CHAR may be a character or string.  The result has the same type.
+STRING-OR-CHAR is not altered--the value is a copy.
+
+Optional second arg BUFFER specifies which buffer's case tables to use,
+and defaults to the current buffer.
+
+For any N characters that are equivalent in case-insensitive searching,
+their canonical lowercase character will be the same.
+*/
+       (string_or_char, buffer))
+{
+  return casify_object (CASE_CANONICALIZE, string_or_char, buffer);
+}
+
 DEFUN ("capitalize", Fcapitalize, 1, 2, 0, /*
 Convert STRING-OR-CHAR to capitalized form and return that.
 This means that each word's first character is upper case
@@ -331,6 +364,7 @@
 {
   DEFSUBR (Fupcase);
   DEFSUBR (Fdowncase);
+  DEFSUBR (Fcanoncase);
   DEFSUBR (Fcapitalize);
   DEFSUBR (Fupcase_initials);
   DEFSUBR (Fupcase_region);
--- a/src/casetab.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/casetab.c	Wed Feb 03 20:18:53 2010 +0000
@@ -404,24 +404,20 @@
   /* This function can GC */
   struct buffer *buf =
     standard ? XBUFFER (Vbuffer_defaults) : current_buffer;
+  Lisp_Object casetab;
 
   check_case_table (table);
 
   if (CASE_TABLEP (table))
-    {
-      if (standard)
-	Vstandard_case_table = table;
-
-      buf->case_table = table;
-    }
+    casetab = table;
   else
     {
       /* For backward compatibility. */
       Lisp_Object down, up, canon, eqv, tail = table;
-      Lisp_Object casetab =
-	standard ? Vstandard_case_table :  buf->case_table;
       struct chartab_range range;
 
+      casetab = Fmake_case_table ();
+
       range.type = CHARTAB_RANGE_ALL;
 
       Freset_char_table (XCASE_TABLE_DOWNCASE (casetab));
@@ -467,6 +463,12 @@
 	convert_old_style_syntax_string (XCASE_TABLE_CANON (casetab), eqv);
     }
 
+
+  if (standard)
+    Vstandard_case_table = casetab;
+
+  buf->case_table = casetab;
+
   return buf->case_table;
 }
 
--- a/src/chartab.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/chartab.c	Wed Feb 03 20:18:53 2010 +0000
@@ -112,14 +112,16 @@
 }
 
 static int
-char_table_entry_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+char_table_entry_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+			int foldcase)
 {
   Lisp_Char_Table_Entry *cte1 = XCHAR_TABLE_ENTRY (obj1);
   Lisp_Char_Table_Entry *cte2 = XCHAR_TABLE_ENTRY (obj2);
   int i;
 
   for (i = 0; i < 96; i++)
-    if (!internal_equal (cte1->level2[i], cte2->level2[i], depth + 1))
+    if (!internal_equal_0 (cte1->level2[i], cte2->level2[i], depth + 1,
+			   foldcase))
       return 0;
 
   return 1;
@@ -344,7 +346,7 @@
 }
 
 static int
-char_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+char_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   Lisp_Char_Table *ct1 = XCHAR_TABLE (obj1);
   Lisp_Char_Table *ct2 = XCHAR_TABLE (obj2);
@@ -354,16 +356,16 @@
     return 0;
 
   for (i = 0; i < NUM_ASCII_CHARS; i++)
-    if (!internal_equal (ct1->ascii[i], ct2->ascii[i], depth + 1))
+    if (!internal_equal_0 (ct1->ascii[i], ct2->ascii[i], depth + 1, foldcase))
       return 0;
 
 #ifdef MULE
   for (i = 0; i < NUM_LEADING_BYTES; i++)
-    if (!internal_equal (ct1->level1[i], ct2->level1[i], depth + 1))
+    if (!internal_equal_0 (ct1->level1[i], ct2->level1[i], depth + 1, foldcase))
       return 0;
 #endif /* MULE */
 
-  return internal_equal (ct1->default_, ct2->default_, depth + 1);
+  return internal_equal_0 (ct1->default_, ct2->default_, depth + 1, foldcase);
 }
 
 static Hashcode
--- a/src/compiler.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/compiler.h	Wed Feb 03 20:18:53 2010 +0000
@@ -238,13 +238,20 @@
 # else
 #  define USED_IF_MULE(decl) UNUSED (decl)
 # endif
-# ifdef USE_XFT
+# ifdef HAVE_XFT
 #  define USED_IF_XFT(decl) decl
 # else
 #  define USED_IF_XFT(decl) UNUSED (decl)
 # endif
 #endif /* UNUSED */
 
+/* Declaration that variable or expression X is "used" to defeat
+   "unused variable" warnings.  DON'T DO THIS FOR PARAMETERS IF IT ALL
+   POSSIBLE.  Use an UNUSED() or USED_IF_*() declaration on the parameter
+   instead.  Don't do this for unused local variables that should really
+   just be deleted. */
+#define USED(x) ((void) (x))
+
 #ifdef DEBUG_XEMACS
 # define REGISTER
 # define register
--- a/src/config.h.in	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/config.h.in	Wed Feb 03 20:18:53 2010 +0000
@@ -217,11 +217,11 @@
 #undef HAVE_FCCONFIGSETRESCANINTERVAL
 
 /* Compile with support for Xft? */
-#undef USE_XFT
+#undef HAVE_XFT
 /* Per-widget stuff will go away? */
-#undef USE_XFT_MENUBARS
-#undef USE_XFT_TABS
-#undef USE_XFT_GAUGES
+#undef HAVE_XFT_MENUBARS
+#undef HAVE_XFT_TABS
+#undef HAVE_XFT_GAUGES
 
 /* Defines for building X applications */
 #ifdef HAVE_X_WINDOWS
--- a/src/console-gtk.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/console-gtk.h	Wed Feb 03 20:18:53 2010 +0000
@@ -36,7 +36,7 @@
 #ifdef HAVE_GTK
 
 #include "console.h"
-#include <gtk/gtk.h>
+#include "sysgtk.h"
 
 /* Variables associated with the X display frame this emacs is using. */
 
@@ -64,8 +64,6 @@
 		      int start_pixpos, int width, face_index findex,
 		      int cursor, int cursor_start, int cursor_width,
 		      int cursor_height);
-void gtk_output_shadows (struct frame *f, int x, int y, int width,
-		       int height, int shadow_thickness);
 GdkGC *gtk_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
 		   Lisp_Object bg_pmap, Lisp_Object lwidth);
 
@@ -99,5 +97,17 @@
 extern void ungcpro_popup_callbacks (GUI_ID id);
 extern Lisp_Object get_gcpro_popup_callbacks (GUI_ID id);
 
+int gtk_event_to_emacs_event (struct frame *frame,
+			      GdkEvent *gdk_event,
+			      struct Lisp_Event *emacs_event);
+
+gint emacs_gtk_key_event_handler(GtkWidget *widget, GdkEventKey *event);
+gint emacs_gtk_button_event_handler(GtkWidget *widget, GdkEventButton *event);
+gint emacs_gtk_motion_event_handler (GtkWidget *widget, GdkEventMotion *event);
+
+gboolean emacs_shell_event_handler (GtkWidget *wid /* unused */,
+				    GdkEvent *event,
+				    gpointer closure);
+
 #endif /* HAVE_GTK */
 #endif /* _XEMACS_DEVICE_X_H_ */
--- a/src/console-x-impl.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/console-x-impl.h	Wed Feb 03 20:18:53 2010 +0000
@@ -316,7 +316,7 @@
 #endif /* XIM_XLIB */
 #endif /* HAVE_XIM */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   /* The Xft Drawable wrapper for this device.
      #### Should this be per-device, or per-frame? */
   /* This is persistent to take advantage of the ability of Xft's glyph
@@ -386,7 +386,7 @@
 
 #define FRAME_X_GEOM_FREE_ME_PLEASE(f) (FRAME_X_DATA (f)->geom_free_me_please)
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #define FRAME_X_XFTDRAW(f)   (FRAME_X_DATA (f)->xftDraw)
 #endif
 
--- a/src/console-x.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/console-x.h	Wed Feb 03 20:18:53 2010 +0000
@@ -51,7 +51,7 @@
 #include <X11/xpm.h>
 #endif
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 /* shut up GCC */
 #define face_index face_index_arg
 #define glyph_index glyph_index_arg
@@ -137,15 +137,6 @@
 		      int start_pixpos, int width, face_index findex,
 		      int cursor, int cursor_start, int cursor_width,
 		      int cursor_height);
-void x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p,
-			int x, int y, int xoffset, int yoffset,
-			int width, int height,
-			unsigned long fg, unsigned long bg,
-			GC override_gc);
-void x_output_shadows (struct frame *f, int x, int y, int width,
-		       int height, GC top_shadow_gc,
-		       GC bottom_shadow_gc, GC background_gc,
-		       int shadow_thickness, int edges);
 void x_generate_shadow_pixels (struct frame *f,
 			       unsigned long *top_shadow,
 			       unsigned long *bottom_shadow,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/console-xlike-inc.h	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,333 @@
+/* Definitions for use in *-xlike-inc.c files.
+   Copyright (C) 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+#ifndef INCLUDED_console_xlike_inc_h_
+#define INCLUDED_console_xlike_inc_h_
+
+/* X and GTK are quite similar, since GTK based its structure on Xlib.
+   However, there are many small differences.  Creating two separate
+   versions of the code, as Bill Perry did originally, is easier to code
+   but hard to maintain and leads to bit rot.  On the other hand, trying to
+   abstract out into device methods, as is done generally for different
+   window systems, gets very hairy very quickly because the differences are
+   on the level of individual library functions, constants and types, of
+   which there are large number.  Abstracting them into device methods
+   would lead to a large number of very small functions and very
+   hard-to-read code.
+
+   Instead, we handle the situation by the following:
+
+   (1) In cases where there are lots of individual differences, we have
+   only one copy, placed in a file called *-xlike-inc.c
+   (e.g. redisplay-xlike-inc.c), and conditionalize using ifdefs.  Because
+   we can compile with both X and GTK at once, we include this file inside
+   of the appropriate device-specific file (e.g. redisplay-gtk.c or
+   redisplay-x.c).  The `inc' in *-xlike-inc.c indicates that this is a
+   file meant to be included in another file, despite the fact that it is a
+   .c file.
+
+   To signal which variety of "xlike" we are compiling for, either
+   THIS_IS_X or THIS_IS_GTK needs to be defined, prior to including the
+   *-xlike-inc.c file.
+
+   (2) For code that is identical in both versions, or where it's possible
+   to have only one copy at runtime through some other means, we name
+   the file *-xlike.c.  This is a normal file, not included in some other
+   file.  An example of "other means" is toolbar-xlike.c, where all
+   functions are passed a frame or device, and it's possible to do run-time
+   conditionalization based on the device type. (This isn't currently the
+   case but will be soon once the related changes from my `hg-fixup'
+   workspace are checked in. --ben) */
+
+
+/* About the representation of color below:
+
+   X has two ways of representing a color: (a) as an unsigned long
+   representing a color pixel value, i.e. the actual value stored in memory
+   or a file at a particular pixel location to indicate that the pixel
+   takes on a specific color; and (b) an XColor structure, which
+   encapsulates both the RGB components of a color and the associated color
+   pixel value.
+
+   We call the former type XLIKE_PIXEL and the latter XLIKE_COLOR, along
+   with routines to convert from one to the other.  Differences between the
+   two in specific functions and structures should be abstracted using the
+   XLIKE_FOO() routines, e.g. XLIKE_SET_GC_COLOR(). */
+
+#if defined (THIS_IS_X) && defined (THIS_IS_GTK)
+#error "Exactly one of THIS_IS_X and THIS_IS_GTK may be defined."
+#endif
+
+#if !defined (THIS_IS_X) && !defined (THIS_IS_GTK)
+#error "Either THIS_IS_X or THIS_IS_GTK must be defined."
+#endif
+
+#ifdef THIS_IS_X
+#  include "console-x-impl.h"
+#  ifdef NEED_GCCACHE_H
+#    include "gccache-x.h"
+#  endif
+#  ifdef NEED_GLYPHS_H
+#    include "glyphs-x.h"
+#  endif
+#  ifdef NEED_OBJECTS_IMPL_H
+#    include "objects-x-impl.h"
+#  endif
+#else /* THIS_IS_GTK */
+#  include "console-gtk-impl.h"
+#  ifdef NEED_GCCACHE_H
+#    include "gccache-gtk.h"
+#  endif
+#  ifdef NEED_GLYPHS_H
+#    include "glyphs-gtk.h"
+#  endif
+#  ifdef NEED_OBJECTS_IMPL_H
+#    include "objects-gtk-impl.h"
+#  endif
+#endif /* THIS_IS_GTK */
+
+/* Just because we have XFT support doesn't mean we should use it.
+   In particular, the xlike routines are used by both X and GTK code,
+   but XFT stuff is X-specific.  HAVE_XFT will still be defined when
+   the GTK flavor is active, but we don't want to trigger the XFT code
+   in this case.  We could just undefine HAVE_XFT but I'd rather make
+   it clearer that something else is going on. --ben */
+
+#if defined (THIS_IS_X) && defined (HAVE_XFT)
+#define USE_XFT
+#define USE_XFT_MENUBARS
+#define USE_XFT_TABS
+#define USE_XFT_GAUGES
+#endif
+
+/***************************************************************************/
+/*                           Common definitions                            */
+/***************************************************************************/
+
+#define XLIKE_PASTE_1(a,b) a##_##b
+#define XLIKE_PASTE(a,b) XLIKE_PASTE_1(a,b)
+#define XFUN(name) XLIKE_PASTE (XLIKE_NAME, name)
+
+#define XLIKE_CONSOLE_HAS_METHOD_1(xlike, name) CONSOLE_HAS_METHOD (xlike, name)
+#define XLIKE_CONSOLE_HAS_METHOD(name) \
+  XLIKE_CONSOLE_HAS_METHOD_1 (XLIKE_NAME, name)
+
+#define XCOLOR_INSTANCE_XLIKE_COLOR(x) \
+  COLOR_INSTANCE_XLIKE_COLOR (XCOLOR_INSTANCE (x))
+
+#ifdef THIS_IS_X
+
+/***************************************************************************/
+/*               Definitions implementing X flavor of XLIKE                */
+/***************************************************************************/
+
+#define XLIKE_NAME x
+#define USED_IF_X(var) var
+#define USED_IF_GTK(var) UNUSED (var)
+
+/* types */
+typedef Display * XLIKE_DISPLAY;
+typedef Window XLIKE_WINDOW;
+typedef GC XLIKE_GC;
+typedef XRectangle XLIKE_RECTANGLE;
+typedef XGCValues XLIKE_GCVALUES;
+typedef XColor XLIKE_COLOR;
+typedef unsigned long XLIKE_PIXEL;
+
+/* constants */
+#define XLIKE_NONE None
+#define XLIKE_FALSE False
+
+#define XLIKE_GC_BACKGROUND GCBackground
+#define XLIKE_GC_CLIP_MASK GCClipMask
+#define XLIKE_GC_CLIP_X_ORIGIN GCClipXOrigin
+#define XLIKE_GC_CLIP_Y_ORIGIN GCClipYOrigin
+#define XLIKE_GC_EXPOSURES GCGraphicsExposures
+#define XLIKE_GC_FILL GCFillStyle
+#define XLIKE_GC_FONT GCFont
+#define XLIKE_GC_FOREGROUND GCForeground
+#define XLIKE_GC_FUNCTION GCFunction
+#define XLIKE_GC_LINE_WIDTH GCLineWidth
+#define XLIKE_GC_STIPPLE GCStipple
+#define XLIKE_GC_TILE GCTile
+
+#define XLIKE_GX_COPY GXcopy
+#define XLIKE_GX_XOR GXxor
+
+#define XLIKE_FILL_STIPPLED FillStippled
+#define XLIKE_FILL_OPAQUE_STIPPLED FillOpaqueStippled
+#define XLIKE_FILL_TILED FillTiled
+#define XLIKE_FILL_SOLID FillSolid
+
+/* functions */
+#define GET_XLIKE_DISPLAY(d) DEVICE_X_DISPLAY (d)
+#define GET_XLIKE_X_DISPLAY(d) DEVICE_X_DISPLAY (d)
+#define GET_XLIKE_WINDOW(w) XtWindow (FRAME_X_TEXT_WIDGET (f))
+#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
+  XFillRectangle (dpy, x_win, gc, x, y, width, height)
+#define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
+  XDrawRectangle (dpy, x_win, gc, x, y, width, height)
+#define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2) \
+  XDrawLine (dpy, x_win, gc, x1, y1, x2, y2)
+#define XLIKE_TEXT_WIDTH(fi, ptr, len) XTextWidth (fi, (char *) ptr, len)
+#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) XTextWidth16 (fi, (XChar2b *) ptr, len)
+
+#define XLIKE_DISPLAY_LINE_HEIGHT(dl) DISPLAY_LINE_HEIGHT (dl)
+#define XLIKE_DISPLAY_LINE_YPOS(dl) DISPLAY_LINE_YPOS (dl)
+#define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) ((dl)->top_clip)
+#define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect)		\
+  /* #### why not Unsorted? */						\
+  XSetClipRectangles (dpy, gc, xorig, yorig, prect, 1, YXBanded)
+#define XLIKE_CLEAR_CLIP_MASK(dpy, gc)		\
+do						\
+  {						\
+    XSetClipMask (dpy, gc, None);		\
+    XSetClipOrigin (dpy, gc, 0, 0);		\
+  }						\
+while (0)
+#define XLIKE_FLUSH(dpy) XSync (dpy, False)
+#define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \
+  XClearArea (dpy, win, x, y, width, height, False)
+ 
+#define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_X_MASK
+#define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_X_PIXMAP
+#define COLOR_INSTANCE_XLIKE_COLOR COLOR_INSTANCE_X_COLOR
+#define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_X_FONT
+#define DEVICE_XLIKE_GC_CACHE DEVICE_X_GC_CACHE
+#define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_X_GRAY_PIXMAP
+#define XLIKE_SET_GC_FILL(gc, style) ((gc).fill_style = (style))
+#define XLIKE_COLOR_TO_PIXEL(c) ((c).pixel)
+#define XLIKE_SET_GC_COLOR(lval, rval) ((lval) = (rval).pixel)
+#define XLIKE_SET_GC_PIXEL(lval, rval) ((lval) = (rval))
+#define XLIKE_FONT_NUM(val) ((val)->fid)
+
+/************ End X flavor of XLIKE **********/
+
+
+#else /* THIS_IS_GTK */
+
+/***************************************************************************/
+/*              Definitions implementing GTK flavor of XLIKE               */
+/***************************************************************************/
+
+#define XLIKE_NAME gtk
+#define USED_IF_X(var) UNUSED (var)
+#define USED_IF_GTK(var) var
+
+/*types */
+typedef void * XLIKE_DISPLAY;
+typedef GdkWindow * XLIKE_WINDOW;
+typedef GdkGC * XLIKE_GC;
+typedef GdkRectangle XLIKE_RECTANGLE;
+typedef GdkGCValues XLIKE_GCVALUES;
+typedef GdkColor XLIKE_COLOR;
+typedef gulong   XLIKE_PIXEL;
+
+/* constants */
+#define XLIKE_NONE 0
+#define XLIKE_FALSE FALSE
+
+#define XLIKE_GC_BACKGROUND GDK_GC_BACKGROUND
+#define XLIKE_GC_CLIP_MASK GDK_GC_CLIP_MASK
+#define XLIKE_GC_CLIP_X_ORIGIN GDK_GC_CLIP_X_ORIGIN
+#define XLIKE_GC_CLIP_Y_ORIGIN GDK_GC_CLIP_Y_ORIGIN
+#define XLIKE_GC_EXPOSURES GDK_GC_EXPOSURES
+#define XLIKE_GC_FILL GDK_GC_FILL
+#define XLIKE_GC_FONT GDK_GC_FONT
+#define XLIKE_GC_FOREGROUND GDK_GC_FOREGROUND
+#define XLIKE_GC_FUNCTION GDK_GC_FUNCTION
+#define XLIKE_GC_LINE_WIDTH GDK_GC_LINE_WIDTH
+#define XLIKE_GC_STIPPLE GDK_GC_STIPPLE
+#define XLIKE_GC_TILE GDK_GC_TILE
+
+#define XLIKE_GX_COPY GDK_COPY
+#define XLIKE_GX_XOR GDK_XOR
+
+#define XLIKE_FILL_STIPPLED GDK_STIPPLED
+#define XLIKE_FILL_OPAQUE_STIPPLED GDK_OPAQUE_STIPPLED
+#define XLIKE_FILL_TILED GDK_TILED
+#define XLIKE_FILL_SOLID GDK_SOLID
+
+/* functions */
+
+/* Avoid unused-variable warning involving D */
+#define GET_XLIKE_DISPLAY(d) (USED (d), NULL)
+#define GET_XLIKE_X_DISPLAY(d) (USED (d), GDK_DISPLAY ())
+#define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
+#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height)	\
+  (USED (dpy), gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE,	\
+                                   x, y, width, height))
+#define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height)	\
+  (USED (dpy), gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, FALSE,	\
+                                   x, y, width, height))
+#define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2)			\
+  (USED (dpy), gdk_draw_line (GDK_DRAWABLE (x_win), gc, x1, y1, x2, y2))
+#define XLIKE_TEXT_WIDTH(fi, ptr, len) \
+  gdk_text_width (fi, (char *) ptr, len)
+#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) \
+  gdk_text_width_wc (fi, (GdkWChar *) ptr, len)
+
+/* FIXME: This is totally bogus.  It removes dl->top_clip from the
+   equations.  If there is a bug involving this, fix it properly!
+   Or just ensure that top_clip is 0. */
+#define XLIKE_DISPLAY_LINE_HEIGHT(dl) \
+  ((dl)->ascent + (dl)->descent - (dl)->clip)
+#define XLIKE_DISPLAY_LINE_YPOS(dl) ((dl)->ypos - (dl)->ascent)
+#define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) (0)
+#define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect)	\
+do								\
+  {								\
+    USED (dpy);							\
+    gdk_gc_set_clip_rectangle (gc, prect);			\
+    gdk_gc_set_clip_origin (gc, xorig, yorig);			\
+  }								\
+while (0)
+#define XLIKE_CLEAR_CLIP_MASK(dpy, gc)		\
+do						\
+  {						\
+    USED (dpy);					\
+    gdk_gc_set_clip_rectangle (gc, NULL);	\
+    gdk_gc_set_clip_origin (gc, 0, 0);		\
+  }						\
+while (0)
+#define XLIKE_FLUSH(dpy) gdk_flush ()
+#define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \
+  (USED (dpy), gdk_window_clear_area (win, x, y, width, height))
+
+#define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_GTK_MASK
+#define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_GTK_PIXMAP
+#define COLOR_INSTANCE_XLIKE_COLOR(ci) (*COLOR_INSTANCE_GTK_COLOR (ci))
+#define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_GTK_FONT
+#define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_GTK_GRAY_PIXMAP
+#define DEVICE_XLIKE_GC_CACHE DEVICE_GTK_GC_CACHE
+#define XLIKE_SET_GC_FILL(gc, style) ((gc).fill = (style))
+#define XLIKE_COLOR_TO_PIXEL(c) ((c).pixel)
+#define XLIKE_SET_GC_COLOR(lval, rval) ((lval) = (rval))
+#define XLIKE_SET_GC_PIXEL(lval, rval) ((lval).pixel = (rval))
+#define XLIKE_FONT_NUM(val) (val)
+
+/************ End GTK flavor of XLIKE **********/
+
+#endif /* (not) THIS_IS_X */
+
+
+#endif /* INCLUDED_console_xlike_inc_h_ */
--- a/src/data.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/data.c	Wed Feb 03 20:18:53 2010 +0000
@@ -335,7 +335,7 @@
 
 DEFUN ("subr-max-args", Fsubr_max_args, 1, 1, 0, /*
 Return maximum number of args built-in function SUBR may be called with,
-or nil if it takes an arbitrary number of arguments or is a special form.
+or nil if it takes an arbitrary number of arguments or is a special operator.
 */
        (subr))
 {
@@ -2621,13 +2621,13 @@
 }
 
 static int
-weak_list_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+weak_list_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   struct weak_list *w1 = XWEAK_LIST (obj1);
   struct weak_list *w2 = XWEAK_LIST (obj2);
 
   return ((w1->type == w2->type) &&
-	  internal_equal (w1->list, w2->list, depth + 1));
+	  internal_equal_0 (w1->list, w2->list, depth + 1, foldcase));
 }
 
 static Hashcode
@@ -3097,12 +3097,12 @@
 }
 
 static int
-weak_box_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+weak_box_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   struct weak_box *wb1 = XWEAK_BOX (obj1);
   struct weak_box *wb2 = XWEAK_BOX (obj2);
 
-  return (internal_equal (wb1->value, wb2->value, depth + 1));
+  return (internal_equal_0 (wb1->value, wb2->value, depth + 1, foldcase));
 }
 
 static Hashcode
@@ -3323,10 +3323,11 @@
 }
 
 static int
-ephemeron_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+ephemeron_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   return
-    internal_equal (XEPHEMERON_REF (obj1), XEPHEMERON_REF(obj2), depth + 1);
+    internal_equal_0 (XEPHEMERON_REF (obj1), XEPHEMERON_REF(obj2), depth + 1,
+		      foldcase);
 }
 
 static Hashcode
--- a/src/depend	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/depend	Wed Feb 03 20:18:53 2010 +0000
@@ -15,25 +15,26 @@
 #endif
 
 #if defined(HAVE_MS_WINDOWS)
-console-msw.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h
-device-msw.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-msw.h objects.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h systime.h syswindows.h text.h vdb.h
+console-msw.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h
+device-msw.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-msw.h objects.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h systime.h syswindows.h text.h vdb.h
 dialog-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 dired-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console-msw.h console.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h regex.h symeval.h symsinit.h syntax.h sysdir.h sysfile.h sysfloat.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h
-event-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream-impl.h console-stream.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-frame-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+event-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream-impl.h console-stream.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+frame-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 glyphs-msw.o: $(CONFIG_H) $(LISP_H) charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h dumper.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-gui-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-menubar-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+gui-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+menubar-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 objects-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h dumper.h elhash.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h specifier.h symeval.h symsinit.h syswindows.h text.h vdb.h
-redisplay-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h debug.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h gutter.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-scrollbar-msw.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+redisplay-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h debug.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h gutter.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+scrollbar-msw.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 select-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h select.h specifier.h symeval.h symsinit.h syswindows.h text.h vdb.h
 toolbar-msw.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h dumper.h elhash.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syswindows.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
 #endif
 #if defined(HAVE_XLIKE)
 event-xlike-inc.o: 
-objects-xlike-inc.o: 
-redisplay-xlike-inc.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+objects-xlike-inc.o: $(LWLIB_SRCDIR)/lwlib.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h gccache-gtk.h gccache-x.h glyphs-gtk.h glyphs-x.h glyphs.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysgtk.h window-impl.h window.h winslots.h xintrinsic.h
+redisplay-xlike-inc.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+toolbar-xlike.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h toolbar-xlike.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 #endif
 #if defined(HAVE_X_WINDOWS)
 EmacsFrame.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
@@ -43,51 +44,51 @@
 balloon-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h balloon_help.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
 balloon_help.o: $(CONFIG_H) balloon_help.h compiler.h xintrinsic.h
 console-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
-device-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h
-dialog-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h xintrinsic.h
-frame-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+device-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-x.h general-slots.h glyphs-x.h glyphs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h
+dialog-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h xintrinsic.h
+frame-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gutter.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+gccache-x.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h gccache-x.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 glyphs-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h
-gui-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h
+gui-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h glyphs.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h
 intl-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h compiler.h console-x.h console.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
-menubar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
-objects-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h elhash.h font-mgr.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects-xlike-inc.c objects.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
-redisplay-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay-xlike-inc.c redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+menubar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+objects-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h device-impl.h device.h devslots.h dumper.h elhash.h font-mgr.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects-xlike-inc.c objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+redisplay-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay-xlike-inc.c redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
 scrollbar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 select-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h xintrinsic.h xmotif.h
-toolbar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar-common.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
-xgccache.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h xgccache.h
+toolbar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar-xlike.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
 #endif
 #if defined(HAVE_TTY)
 console-tty.o: $(CONFIG_H) $(LISP_H) charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h dumper.h elhash.h faces.h file-coding.h frame.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systty.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-device-tty.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h syswindows.h text.h vdb.h
-event-tty.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h text.h vdb.h
-frame-tty.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h systime.h systty.h text.h vdb.h
+device-tty.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h syswindows.h text.h vdb.h
+event-tty.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h text.h vdb.h
+frame-tty.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h systime.h systty.h text.h vdb.h
 objects-tty.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h specifier.h symeval.h symsinit.h systty.h text.h vdb.h
-redisplay-tty.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h text.h vdb.h window-impl.h window.h winslots.h
+redisplay-tty.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h text.h vdb.h window-impl.h window.h winslots.h
 #endif
 #if defined(HAVE_GTK)
-console-gtk.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h
-device-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h general-slots.h glyphs-gtk.h glyphs.h gtk-xemacs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-dialog-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h events.h frame.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
+console-gtk.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h
+device-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h general-slots.h glyphs-gtk.h glyphs.h gtk-xemacs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysgdkx.h sysgtk.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+dialog-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h events.h frame.h gc.h general-slots.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h systime.h text.h vdb.h window.h
 emacs-marshals.o: hash.h
 emacs-widget-accessors.o: 
-event-gtk.o: $(CONFIG_H) $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h event-gtk.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gtk-xemacs.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h window.h
-frame-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h gtk-xemacs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
-gccache-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h gccache-gtk.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
+event-gtk.o: $(CONFIG_H) $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gtk-xemacs.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgdkx.h sysgtk.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h window.h
+frame-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h gtk-xemacs.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysgdkx.h sysgtk.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
+gccache-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h gccache-gtk.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysgtk.h text.h vdb.h
 glade.o: bytecode.h
-glyphs-gtk.o: $(CONFIG_H) $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysfile.h systime.h syswindows.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
-gtk-glue.o: objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h
-gtk-xemacs.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h event-gtk.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gtk-xemacs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-gui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h
-menubar-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
-native-gtk-toolbar.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h console-gtk.h console.h dumper.h faces.h frame.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
-objects-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-xlike-inc.c objects.h specifier.h symeval.h symsinit.h text.h vdb.h
-redisplay-gtk.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay-xlike-inc.c redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
-scrollbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-select-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h select-common.h select.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h
-toolbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h text.h toolbar-common.h vdb.h
+glyphs-gtk.o: $(CONFIG_H) $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysfile.h sysgdkx.h sysgtk.h systime.h syswindows.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
+gtk-glue.o: console-gtk.h console.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h sysgtk.h
+gtk-xemacs.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gtk-xemacs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h
+gui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h
+menubar-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysgtk.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
+native-gtk-toolbar.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h console-gtk.h console.h dumper.h faces.h frame.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
+objects-gtk.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h device-impl.h device.h devslots.h dumper.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects-xlike-inc.c objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgdkx.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+redisplay-gtk.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay-xlike-inc.c redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgdkx.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+scrollbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h
+select-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h select-common.h select.h specifier.h symeval.h symsinit.h sysgtk.h systime.h text.h vdb.h
+toolbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h sysgtk.h text.h toolbar-xlike.h vdb.h
 ui-byhand.o: gui.h
-ui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device.h dumper.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h gc.h general-slots.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h systime.h text.h ui-byhand.c ui-gtk.h vdb.h window-impl.h window.h winslots.h
+ui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device.h dumper.h elhash.h emacs-marshals.c emacs-widget-accessors.c events.h faces.h gc.h general-slots.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysgtk.h systime.h text.h ui-byhand.c ui-gtk.h vdb.h window-impl.h window.h winslots.h
 #endif
 #if defined(HAVE_DATABASE)
 database.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h database.h dumper.h file-coding.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
@@ -106,56 +107,56 @@
 extw-Xt.o: $(CONFIG_H) compiler.h extw-Xlib.h extw-Xt.h
 #endif
 abbrev.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h text.h vdb.h window.h
-alloc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+alloc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 alloca.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 alsaplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 blocktype.o: $(CONFIG_H) $(LISP_H) blocktype.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 buffer.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h select.h specifier.h symeval.h symsinit.h syntax.h sysdir.h sysfile.h syswindows.h text.h vdb.h window.h
 bytecode.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h text.h vdb.h window.h
-callint.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h events.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h
+callint.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h events.h gc.h general-slots.h insdel.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h
 casefiddle.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
 casetab.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h symeval.h symsinit.h text.h vdb.h
 chartab.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
 cm.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h systty.h text.h vdb.h
-cmdloop.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-msw.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window.h
+cmdloop.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-msw.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window.h
 cmds.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h extents.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
-console-stream.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h systty.h syswindows.h text.h vdb.h window.h
-console.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h systty.h text.h vdb.h window.h
+console-stream.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h systty.h syswindows.h text.h vdb.h window.h
+console.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h systty.h text.h vdb.h window.h
 data.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfloat.h syssignal.h text.h vdb.h
 debug.o: $(CONFIG_H) $(LISP_H) bytecode.h compiler.h debug.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-device.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h text.h toolbar.h vdb.h window.h
+device.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h text.h toolbar.h vdb.h window.h
 dialog.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h
 dired.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h elhash.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h opaque.h regex.h symeval.h symsinit.h syntax.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h syswindows.h text.h vdb.h
-doc.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
+doc.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 doprnt.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 dragdrop.o: $(CONFIG_H) $(LISP_H) compiler.h dragdrop.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 dump-data.o: $(CONFIG_H) $(LISP_H) compiler.h dump-data.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 dumper.o: $(CONFIG_H) $(LISP_H) coding-system-slots.h compiler.h console-stream.h console.h dump-data.h dumper.h elhash.h file-coding.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 dynarr.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 ecrt0.o: $(CONFIG_H)
-editfns.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h window.h
+editfns.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap-buttons.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h window.h
 elhash.o: $(CONFIG_H) $(LISP_H) bytecode.h compiler.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h symeval.h symsinit.h text.h vdb.h
 emacs.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h console-msw.h console.h dump-data.h dumper.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h paths.h process.h redisplay.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h text.h vdb.h
 emodules.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h dumper.h emodules.h file-coding.h frame.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdll.h text.h vdb.h window.h
 esd.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 eval.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console.h device.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window.h
-event-Xt.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-tty.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h
-event-stream.o: $(CONFIG_H) $(LISP_H) backtrace.h blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h insdel.h intl-auto-encap-win32.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h macros.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-event-unixoid.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h text.h vdb.h
-events.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h events.h extents.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h systty.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
-extents.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h debug.h device.h dumper.h elhash.h extents-impl.h extents.h faces.h frame.h gc.h general-slots.h glyphs.h gutter.h insdel.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
+event-Xt.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-tty.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h
+event-stream.o: $(CONFIG_H) $(LISP_H) backtrace.h blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h insdel.h intl-auto-encap-win32.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h macros.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+event-unixoid.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h text.h vdb.h
+events.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h events.h extents.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h systty.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
+extents.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h debug.h device.h dumper.h elhash.h extents-impl.h extents.h faces.h frame.h gc.h general-slots.h glyphs.h gutter.h insdel.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 faces.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h extents-impl.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 file-coding.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h elhash.h extents.h file-coding.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h rangetab.h symeval.h symsinit.h text.h vdb.h
-fileio.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h device.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h profile.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+fileio.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h device.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h profile.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 filelock.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h paths.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h
 filemode.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 floatfns.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfloat.h syssignal.h text.h vdb.h
-fns.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h console.h device.h dumper.h events.h extents.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h redisplay.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
+fns.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h console.h device.h dumper.h events.h extents.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h redisplay.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
 font-lock.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
 font-mgr.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h font-mgr.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
-frame.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
+frame.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h gutter.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
 free-hook.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-gc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+gc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 general.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 getloadavg.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 glyphs-eimage.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
@@ -163,22 +164,22 @@
 glyphs-widget.o: $(CONFIG_H) $(LISP_H) bytecode.h charset.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame.h gc.h general-slots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 glyphs.o: $(CONFIG_H) $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 gmalloc.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h getpagesize.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysdep.h text.h vdb.h
-gpmevent.o: $(CONFIG_H) $(LISP_H) commands.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h gpmevent.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h
+gpmevent.o: $(CONFIG_H) $(LISP_H) commands.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h gpmevent.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h
 gui.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h dumper.h elhash.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h redisplay.h symeval.h symsinit.h text.h vdb.h
 gutter.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 hash.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 hpplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h text.h vdb.h
 imgproc.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h imgproc.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 indent.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h device.h dumper.h extents.h faces.h frame.h gc.h general-slots.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-inline.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk.h console-impl.h console-msw.h console.h database.h device-impl.h device.h devslots.h dumper.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h font-mgr.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gui.h intl-auto-encap-win32.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdll.h sysfile.h systime.h syswindows.h text.h toolbar.h tooltalk.h ui-gtk.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+inline.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk.h console-impl.h console-msw.h console.h database.h device-impl.h device.h devslots.h dumper.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h font-mgr.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gui.h intl-auto-encap-win32.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdll.h sysfile.h sysgtk.h systime.h syswindows.h text.h toolbar.h tooltalk.h ui-gtk.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 input-method-motif.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h xmotif.h
-input-method-xlib.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+input-method-xlib.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 insdel.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h device.h dumper.h extents.h frame.h gc.h general-slots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h symeval.h symsinit.h text.h vdb.h
 intl-auto-encap-win32.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syswindows.h text.h vdb.h
 intl-encap-win32.o: $(CONFIG_H) $(LISP_H) compiler.h console-msw.h console.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syswindows.h text.h vdb.h
 intl-win32.o: $(CONFIG_H) $(LISP_H) charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 intl.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-keymap.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h dumper.h elhash.h events.h extents.h frame.h gc.h general-slots.h insdel.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
+keymap.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h dumper.h elhash.h events.h extents.h frame.h gc.h general-slots.h insdel.h keymap-buttons.h keymap-slots.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
 lastfile.o: $(CONFIG_H)
 libinterface.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h libinterface.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 libsst.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h libsst.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
@@ -186,12 +187,12 @@
 linuxplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syssignal.h systty.h syswindows.h text.h vdb.h
 lread.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h elhash.h file-coding.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h profile.h symeval.h symsinit.h sysfile.h sysfloat.h syswindows.h text.h vdb.h
 lstream.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
-macros.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h macros.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
+macros.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h macros.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
 marker.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 mc-alloc.o: $(CONFIG_H) $(LISP_H) blocktype.h compiler.h dumper.h gc.h general-slots.h getpagesize.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 md5.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-menubar.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-minibuf.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-stream.h console.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h
+menubar.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
+minibuf.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-stream.h console.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h insdel.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h
 miscplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syssignal.h syswindows.h text.h vdb.h
 nas.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysdep.h syssignal.h text.h vdb.h
 nt.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h
@@ -203,22 +204,22 @@
 objects.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h elhash.h faces.h frame.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systty.h text.h vdb.h window-impl.h window.h winslots.h
 opaque.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h symeval.h symsinit.h text.h vdb.h
 print.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h extents.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h specifier.h symeval.h symsinit.h sysfile.h systty.h syswindows.h text.h vdb.h
-process-nt.o: $(CONFIG_H) $(LISP_H) compiler.h console-msw.h console.h dumper.h events.h gc.h general-slots.h hash.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process-slots.h process.h procimpl.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
-process-unix.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h hash.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
-process.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h console.h device.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h hash.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
+process-nt.o: $(CONFIG_H) $(LISP_H) compiler.h console-msw.h console.h dumper.h events.h gc.h general-slots.h hash.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process-slots.h process.h procimpl.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
+process-unix.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h hash.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
+process.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h console.h device.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h hash.h insdel.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
 profile.o: $(CONFIG_H) $(LISP_H) backtrace.h bytecode.h compiler.h dumper.h elhash.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h profile.h symeval.h symsinit.h syssignal.h systime.h text.h vdb.h
 ralloc.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h getpagesize.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 rangetab.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h rangetab.h symeval.h symsinit.h text.h vdb.h
 realpath.o: $(CONFIG_H) $(LISP_H) backtrace.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h profile.h symeval.h symsinit.h sysdir.h sysfile.h syswindows.h text.h vdb.h
 redisplay-output.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-redisplay.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console-tty.h console.h debug.h device-impl.h device.h devslots.h dumper.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h gutter.h insdel.h intl-auto-encap-win32.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h systime.h systty.h syswindows.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
+redisplay.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console-tty.h console.h debug.h device-impl.h device.h devslots.h dumper.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h gutter.h insdel.h intl-auto-encap-win32.h keymap-buttons.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h systime.h systty.h syswindows.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
 regex.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h regex.h symeval.h symsinit.h syntax.h text.h vdb.h
 scrollbar.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 search.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h regex.h symeval.h symsinit.h syntax.h text.h vdb.h
 select.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h extents.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h opaque.h redisplay.h select.h specifier.h symeval.h symsinit.h text.h vdb.h
 sgiplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h libst.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
 sheap.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sheap-adjust.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
-signal.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h syswindows.h text.h vdb.h
+signal.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h syswindows.h text.h vdb.h
 sound.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h sound.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h xintrinsic.h
 specifier.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 strcat.o: $(CONFIG_H)
@@ -227,13 +228,12 @@
 sunpro.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 symbols.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h specifier.h symeval.h symsinit.h text.h vdb.h
 syntax.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h extents.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
-sysdep.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
+sysdep.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
 sysdll.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysdll.h sysfile.h syswindows.h text.h vdb.h
 termcap.o: $(CONFIG_H) $(LISP_H) compiler.h console.h device.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 terminfo.o: $(CONFIG_H)
 tests.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h elhash.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h symeval.h symsinit.h text.h vdb.h
 text.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h profile.h symeval.h symsinit.h text.h vdb.h
-toolbar-common.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar-common.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 toolbar.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
 tooltalk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h symeval.h symsinit.h syssignal.h text.h tooltalk.h vdb.h
 tparam.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
--- a/src/device-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/device-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -746,7 +746,8 @@
   Qgtk_seen_characters = Qnil;
 }
 
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
+
 static void
 gtk_device_init_x_specific_cruft (struct device *d)
 {
--- a/src/device-msw.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/device-msw.c	Wed Feb 03 20:18:53 2010 +0000
@@ -658,7 +658,7 @@
 {
   /* Change connection if the device changed */
   if (!NILP (devname)
-      && lisp_strcasecmp (devname, DEVICE_MSPRINTER_NAME (d)) != 0)
+      && lisp_strcasecmp_i18n (devname, DEVICE_MSPRINTER_NAME (d)) != 0)
     {
       Lisp_Object new_connection = devname;
 
@@ -1181,7 +1181,8 @@
 }
 
 static int
-equal_devmode (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+equal_devmode (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	       int UNUSED (foldcase))
 {
   Lisp_Devmode *dm1 = XDEVMODE (obj1);
   Lisp_Devmode *dm2 = XDEVMODE (obj2);
@@ -1194,7 +1195,7 @@
     return 0;
   if (NILP (dm1->printer_name) || NILP (dm2->printer_name))
     return 1;
-  return lisp_strcasecmp (dm1->printer_name, dm2->printer_name) == 0;
+  return lisp_strcasecmp_i18n (dm1->printer_name, dm2->printer_name) == 0;
 }
 
 static Hashcode
--- a/src/device-x.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/device-x.c	Wed Feb 03 20:18:53 2010 +0000
@@ -53,7 +53,7 @@
 #include <X11/CoreP.h>		/* Numerous places access the fields of
 				   a core widget directly.  We could
 				   use XtGetValues(), but ... */
-#include "xgccache.h"
+#include "gccache-x.h"
 #include <X11/Shell.h>
 #include <X11/Xmu/Error.h>
 
--- a/src/doc.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/doc.c	Wed Feb 03 20:18:53 2010 +0000
@@ -504,7 +504,7 @@
 Don't use this.  Use the more general `symbol-file' (q.v.) instead. 
 
 If TYPE is nil or omitted, any kind of definition is acceptable. 
-If TYPE is `defun', then function, subr, special form or macro definitions
+If TYPE is `defun', then function, subr, special operator or macro definitions
 are acceptable.
 If TYPE is `defvar', then variable definitions are acceptable.
 */
--- a/src/editfns.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/editfns.c	Wed Feb 03 20:18:53 2010 +0000
@@ -2131,8 +2131,8 @@
 Execute BODY, saving and restoring current buffer's restrictions.
 The buffer's restrictions make parts of the beginning and end invisible.
 \(They are set up with `narrow-to-region' and eliminated with `widen'.)
-This special form, `save-restriction', saves the current buffer's restrictions
-when it is entered, and restores them when it is exited.
+This special operator, `save-restriction', saves the current buffer's
+restrictions when it is entered, and restores them when it is exited.
 So any `narrow-to-region' within BODY lasts only until the end of the form.
 The old restrictions settings are restored
 even in case of abnormal exit (throw or error).
@@ -2258,7 +2258,7 @@
   x2 = XCHAR (character2);
 
   return (!NILP (b->case_fold_search)
-	  ? DOWNCASE (b, x1) == DOWNCASE (b, x2)
+	  ? CANONCASE (b, x1) == CANONCASE (b, x2)
 	  : x1 == x2)
     ? Qt : Qnil;
 }
--- a/src/elhash.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/elhash.c	Wed Feb 03 20:18:53 2010 +0000
@@ -184,25 +184,6 @@
 }
 
 
-#if 0 /* I don't think these are needed any more.
-	 If using the general lisp_object_equal_*() functions
-	 causes efficiency problems, these can be resurrected. --ben */
-/* equality and hash functions for Lisp strings */
-int
-lisp_string_equal (Lisp_Object str1, Lisp_Object str2)
-{
-  /* This is wrong anyway.  You can't use strcmp() on Lisp strings,
-     because they can contain zero characters.  */
-  return !strcmp ((char *) XSTRING_DATA (str1), (char *) XSTRING_DATA (str2));
-}
-
-static Hashcode
-lisp_string_hash (Lisp_Object obj)
-{
-  return hash_string (XSTRING_DATA (str), XSTRING_LENGTH (str));
-}
-
-#endif /* 0 */
 
 static int
 lisp_object_eql_equal (Lisp_Object obj1, Lisp_Object obj2)
@@ -263,7 +244,8 @@
    the same result -- if the keys are not equal according to the test
    function, then Fgethash() in hash_table_equal_mapper() will fail.  */
 static int
-hash_table_equal (Lisp_Object hash_table1, Lisp_Object hash_table2, int depth)
+hash_table_equal (Lisp_Object hash_table1, Lisp_Object hash_table2, int depth,
+		  int foldcase)
 {
   Lisp_Hash_Table *ht1 = XHASH_TABLE (hash_table1);
   Lisp_Hash_Table *ht2 = XHASH_TABLE (hash_table2);
@@ -282,7 +264,7 @@
       {
 	Lisp_Object value_in_other = Fgethash (e->key, hash_table2, Qunbound);
 	if (UNBOUNDP (value_in_other) ||
-	    !internal_equal (e->value, value_in_other, depth))
+	    !internal_equal_0 (e->value, value_in_other, depth, foldcase))
 	  return 0;		/* Give up */
       }
 
--- a/src/emacs.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/emacs.c	Wed Feb 03 20:18:53 2010 +0000
@@ -391,7 +391,7 @@
      sysdep.c (maybe; wait_for_termination)
      unexec.c
      unicode.c
-     xgccache.c (a bit)
+     gccache-x.c (a bit)
 
      #### review .h files; write a perl program to look for long comments
      throughout the files, ignoring stuff inside of DEFUN's.
@@ -1641,7 +1641,7 @@
 #endif
 #endif /* HAVE_XIM */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       syms_of_font_mgr();
 #endif
 
@@ -2224,7 +2224,7 @@
       vars_of_gui_x ();
 #endif
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       vars_of_font_mgr ();
 #endif
 
@@ -2295,6 +2295,7 @@
       /* Now do additional vars_of_*() initialization that happens both
 	 at dump time and after pdump load. */
       reinit_vars_of_buffer ();
+      reinit_vars_of_bytecode ();
       reinit_vars_of_console ();
 #ifdef DEBUG_XEMACS
       reinit_vars_of_debug ();
@@ -2354,7 +2355,7 @@
 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS)
       reinit_vars_of_gui_x ();
 #endif
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       reinit_vars_of_font_mgr ();
 #endif
 #endif /* HAVE_X_WINDOWS */
@@ -2427,7 +2428,7 @@
 	 quite soon, e.g. in complex_vars_of_glyphs_x(). */
       inhibit_non_essential_conversion_operations = 0;
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       /* This uses coding systems.  Must be done before faces are init'ed. */
       /* not in xft reloaded #3 */
       complex_vars_of_font_mgr ();
--- a/src/eval.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/eval.c	Wed Feb 03 20:18:53 2010 +0000
@@ -427,7 +427,7 @@
 {
   Lisp_Subr *subr = XSUBR (obj);
   const CIbyte *header =
-    (subr->max_args == UNEVALLED) ? "#<special-form " : "#<subr ";
+    (subr->max_args == UNEVALLED) ? "#<special-operator " : "#<subr ";
   const CIbyte *name = subr_name (subr);
   const CIbyte *trailer = subr->prompt ? " (interactive)>" : ">";
 
@@ -823,7 +823,7 @@
 /*		       The basic special forms				*/
 /************************************************************************/
 
-/* Except for Fprogn(), the basic special forms below are only called
+/* Except for Fprogn(), the basic special operators below are only called
    from interpreted code.  The byte compiler turns them into bytecodes. */
 
 DEFUN ("or", For, 0, UNEVALLED, 0, /*
@@ -3302,7 +3302,7 @@
     btp = btp->next;
 
   /* If this isn't a byte-compiled function, then we may now be
-     looking at several frames for special forms.  Skip past them.  */
+     looking at several frames for special operators.  Skip past them.  */
   while (btp &&
 	 btp->nargs == UNEVALLED)
     btp = btp->next;
@@ -3620,6 +3620,10 @@
   {
     Lisp_Object value =
       execute_optimized_program ((Opbyte *) XOPAQUE_DATA (f->instructions),
+#ifdef ERROR_CHECK_BYTE_CODE
+				 XOPAQUE_SIZE (f->instructions) /
+				 sizeof (Opbyte),
+#endif
 				 f->stack_depth,
 				 XVECTOR_DATA (f->constants));
 
@@ -4060,7 +4064,7 @@
 	  val = SUBR_FUNCTION (subr, MANY) (fun_nargs, fun_args);
 	  PROFILE_EXIT_FUNCTION ();
 	}
-      else if (max_args == UNEVALLED) /* Can't funcall a special form */
+      else if (max_args == UNEVALLED) /* Can't funcall a special operator */
 	{
           /* Ugh, ugh, ugh. */
           if (EQ (fun, XSYMBOL_FUNCTION (Qthrow)))
@@ -4243,7 +4247,7 @@
 DEFUN ("function-min-args", Ffunction_min_args, 1, 1, 0, /*
 Return the minimum number of arguments a function may be called with.
 The function may be any form that can be passed to `funcall',
-any special form, or any macro.
+any special operator, or any macro.
 
 To check if a function can be called with a specified number of
 arguments, use `function-allows-args'.
@@ -4256,9 +4260,9 @@
 DEFUN ("function-max-args", Ffunction_max_args, 1, 1, 0, /*
 Return the maximum number of arguments a function may be called with.
 The function may be any form that can be passed to `funcall',
-any special form, or any macro.
+any special operator, or any macro.
 If the function takes an arbitrary number of arguments or is
-a built-in special form, nil is returned.
+a built-in special operator, nil is returned.
 
 To check if a function can be called with a specified number of
 arguments, use `function-allows-args'.
@@ -4415,7 +4419,7 @@
    A multiple value object is returned by #'values if:
 
    -- The number of arguments to #'values is not one, and: 
-   -- Some special form in the call stack is prepared to handle more than
+   -- Some special operator in the call stack is prepared to handle more than
    one multiple value.
    
    The return value of #'values-list is analogous to that of #'values.
@@ -4430,7 +4434,7 @@
    objects should be converted to heap allocation at that point.
 
    The specific multiple values saved and returned depend on how many
-   multiple-values special forms in the stack are interested in; for
+   multiple-values special operators in the stack are interested in; for
    example, if #'multiple-value-call is somewhere in the call stack, all
    values passed to #'values will be saved and returned.  If an expansion of
    #'multiple-value-setq with 10 SYMS is the only part of the call stack
@@ -7158,8 +7162,8 @@
 
 DEFUN ("backtrace-frame", Fbacktrace_frame, 1, 1, 0, /*
 Return the function and arguments NFRAMES up from current execution point.
-If that frame has not evaluated the arguments yet (or is a special form),
-the value is (nil FUNCTION ARG-FORMS...).
+If that frame has not evaluated the arguments yet (or involves a special
+operator), the value is (nil FUNCTION ARG-FORMS...).
 If that frame has evaluated its arguments and called its function already,
 the value is (t FUNCTION ARG-VALUES...).
 A &rest arg is represented as the tail of the list ARG-VALUES.
@@ -7527,7 +7531,7 @@
 The exclusive upper bound on the number of multiple values. 
 
 This applies to `values', `values-list', `multiple-value-bind' and related
-macros and special forms.
+macros and special operators.
 */);
   Vmultiple_values_limit = EMACS_INT_MAX > INT_MAX ? INT_MAX : EMACS_INT_MAX;
 
--- a/src/event-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/event-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -49,11 +49,11 @@
 
 #include "gtk-xemacs.h"
 
+#include "sysgdkx.h"
+
 #include "systime.h"
 #include "sysproc.h" /* for MAXDESC */
 
-#include <gdk/gdkkeysyms.h>
-
 #ifdef HAVE_DRAGNDROP
 #include "dragdrop.h"
 #endif
@@ -62,10 +62,6 @@
 # include "menubar.h"
 #endif
 
-#include <gdk/gdkx.h>
-
-#include "event-gtk.h"
-
 static struct event_stream *gtk_event_stream;
 
 #ifdef WIN32_ANY
@@ -1582,8 +1578,6 @@
 /*                      input pending / C-g checking                    */
 /************************************************************************/
 
-#include <gdk/gdkx.h>
-
 static void
 emacs_gtk_drain_queue (void)
 
@@ -1692,7 +1686,7 @@
 /* This is down at the bottom of the file so I can avoid polluting the
    generic code with this X specific CRAP! */
 
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 #include <X11/keysym.h>
 /* #### BILL!!! Fix this please! */
 
--- a/src/event-gtk.h	Sun Jan 31 18:29:48 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/* Header file for miscellaneous event functions for GTK.
-   Copyright (C) 2002 William Perry.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-#ifndef __EVENT_GTK_H__
-#define __EVENT_GTK_H__
-
-int gtk_event_to_emacs_event (struct frame *frame,
-			      GdkEvent *gdk_event,
-			      struct Lisp_Event *emacs_event);
-
-gint emacs_gtk_key_event_handler(GtkWidget *widget, GdkEventKey *event);
-gint emacs_gtk_button_event_handler(GtkWidget *widget, GdkEventButton *event);
-gint emacs_gtk_motion_event_handler (GtkWidget *widget, GdkEventMotion *event);
-
-gboolean emacs_shell_event_handler (GtkWidget *wid /* unused */,
-				    GdkEvent *event,
-				    gpointer closure);
-
-#endif /* __EVENT-GTK_H__ */
--- a/src/event-xlike-inc.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/event-xlike-inc.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1,4 +1,4 @@
-/* Shared event code between X and GTK -- include file.
+/* Common code between X and GTK -- event-related.
    Copyright (C) 1991-5, 1997 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
    Copyright (C) 1996, 2001, 2002, 2003 Ben Wing.
@@ -22,10 +22,11 @@
 
 /* Synched up with: Not in FSF. */
 
-/* For some code it's reasonable to have only one copy and conditionalize
-   at run-time.  For other code it isn't. #### Perhaps all code should be
-   included here, not in event-xlike.c.  However, event-xlike.c is always
-   X-specific, whereas the following code isn't, in the GTK case. */
+/* Before including this file, you need to define either THIS_IS_X or
+   THIS_IS_GTK.  */
+
+/* See comment at top of redisplay-xlike-inc.c for an explanation of
+   how this file works. */
 
 static int
 #ifdef THIS_IS_GTK
@@ -160,7 +161,7 @@
   return 0;
 }
 
-#if defined(THIS_IS_X) || !defined(__GDK_KEYS_H__)
+#if defined (THIS_IS_X) || !defined (__GDK_KEYS_H__)
 
 /* Use an appropriate map to Unicode within x_keysym_to_character. Arguments
    are evaluated multiple times.
@@ -169,11 +170,11 @@
 
 #define USE_UNICODE_MAP(keysym, map)					\
   if (keysym >= FIRST_KNOWN_##map					\
-      && (keysym < (FIRST_KNOWN_##map + countof(map)))			\
+      && (keysym < (FIRST_KNOWN_##map + countof (map)))			\
       && map[keysym - FIRST_KNOWN_##map ]) do				\
     {									\
       keysym -= FIRST_KNOWN_##map ;					\
-      return Funicode_to_char(make_int(map[keysym]), Qnil);		\
+      return Funicode_to_char (make_int (map[keysym]), Qnil);		\
     } while (0)
 
 /* Maps to Unicode for X11 KeySyms, where we don't have a direct internal
@@ -588,10 +589,10 @@
 
 #ifndef THIS_IS_GTK
 static Lisp_Object
-x_keysym_to_character(KeySym keysym)
+x_keysym_to_character (KeySym keysym)
 #else
 Lisp_Object
-gtk_keysym_to_character(guint keysym)
+gtk_keysym_to_character (guint keysym)
 #endif
 {
   Lisp_Object charset = Qzero;
@@ -604,7 +605,7 @@
      #x01000000-#x01000100. */
 
   if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
-    return Funicode_to_char (make_int(keysym & 0xffffff), Qnil);
+    return Funicode_to_char (make_int (keysym & 0xffffff), Qnil);
 
   if ((keysym & 0xff) < 0xa0)
     return Qnil;
@@ -642,7 +643,7 @@
       break;
     case 6: /* Cyrillic */
       {
-	USE_UNICODE_MAP(keysym, CYRILLIC);
+	USE_UNICODE_MAP (keysym, CYRILLIC);
 	break;
       }
     case 7: /* Greek */
@@ -665,16 +666,16 @@
 	break;
       }
     case 8: 
-      USE_UNICODE_MAP(keysym, TECHNICAL);
+      USE_UNICODE_MAP (keysym, TECHNICAL);
       break;
     case 9: 
-      USE_UNICODE_MAP(keysym, SPECIAL);
+      USE_UNICODE_MAP (keysym, SPECIAL);
       break;
     case 10:
-      USE_UNICODE_MAP(keysym, PUBLISHING);
+      USE_UNICODE_MAP (keysym, PUBLISHING);
       break;
     case 11:
-      USE_UNICODE_MAP(keysym, APL);
+      USE_UNICODE_MAP (keysym, APL);
       break;
     case 12: /* Hebrew */
       USE_CHARSET (charset, HEBREW_ISO8859_8);
@@ -698,7 +699,7 @@
     case 32: /* Currency. The lower sixteen bits of these keysyms happily
 		correspond exactly to the Unicode code points of the
 		associated characters */
-      return Funicode_to_char(make_int(keysym & 0xffff), Qnil);
+      return Funicode_to_char (make_int (keysym & 0xffff), Qnil);
       break;
     default:
       break;
@@ -722,4 +723,4 @@
 #endif
 }
 
-#endif /* defined(THIS_IS_X) || !defined(__GDK_KEYS_H__) */
+#endif /* defined (THIS_IS_X) || !defined (__GDK_KEYS_H__) */
--- a/src/events.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/events.c	Wed Feb 03 20:18:53 2010 +0000
@@ -396,7 +396,8 @@
 }
 
 static int
-event_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+event_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	     int UNUSED (foldcase))
 {
   Lisp_Event *e1 = XEVENT (obj1);
   Lisp_Event *e2 = XEVENT (obj2);
--- a/src/events.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/events.h	Wed Feb 03 20:18:53 2010 +0000
@@ -910,38 +910,18 @@
 
 /* The modifiers XEmacs knows about; these appear in key and button events. */
 
-#define XEMACS_MOD_CONTROL      (1<<0)
-#define XEMACS_MOD_META         (1<<1)
-#define XEMACS_MOD_SUPER        (1<<2)
-#define XEMACS_MOD_HYPER        (1<<3)
-#define XEMACS_MOD_ALT          (1<<4)
-#define XEMACS_MOD_SHIFT        (1<<5)  /* not used for dual-case characters */
-#define XEMACS_MOD_BUTTON1      (1<<6)
-#define XEMACS_MOD_BUTTON2      (1<<7)
-#define XEMACS_MOD_BUTTON3      (1<<8)
-#define XEMACS_MOD_BUTTON4      (1<<9)
-#define XEMACS_MOD_BUTTON5      (1<<10)
-#define XEMACS_MOD_BUTTON6      (1<<11)
-#define XEMACS_MOD_BUTTON7      (1<<12)
-#define XEMACS_MOD_BUTTON8      (1<<13)
-#define XEMACS_MOD_BUTTON9      (1<<14)
-#define XEMACS_MOD_BUTTON10     (1<<15)
-#define XEMACS_MOD_BUTTON11     (1<<16)
-#define XEMACS_MOD_BUTTON12     (1<<17)
-#define XEMACS_MOD_BUTTON13     (1<<18)
-#define XEMACS_MOD_BUTTON14     (1<<19)
-#define XEMACS_MOD_BUTTON15     (1<<20)
-#define XEMACS_MOD_BUTTON16     (1<<21)
-#define XEMACS_MOD_BUTTON17     (1<<22)
-#define XEMACS_MOD_BUTTON18     (1<<23)
-#define XEMACS_MOD_BUTTON19     (1<<24)
-#define XEMACS_MOD_BUTTON20     (1<<25)
-#define XEMACS_MOD_BUTTON21     (1<<26)
-#define XEMACS_MOD_BUTTON22     (1<<27)
-#define XEMACS_MOD_BUTTON23     (1<<28)
-#define XEMACS_MOD_BUTTON24     (1<<29)
-#define XEMACS_MOD_BUTTON25     (1<<30)
-#define XEMACS_MOD_BUTTON26     (1<<31)
+enum event_modifiers
+  {
+    XEMACS_MOD_CONTROL  = (1<<0),
+    XEMACS_MOD_META     = (1<<1),
+    XEMACS_MOD_SUPER    = (1<<2),
+    XEMACS_MOD_HYPER    = (1<<3),
+    XEMACS_MOD_ALT      = (1<<4),
+    XEMACS_MOD_SHIFT    = (1<<5)  /* not used for dual-case characters */,
+#define FROB(num)				\
+    XEMACS_MOD_BUTTON##num  = (1<<(num+5)),
+#include "keymap-buttons.h"
+  };
    
 /* Note: under X Windows, XEMACS_MOD_ALT is generated by the Alt key
    if there are both Alt and Meta keys.  If there are no Meta keys,
--- a/src/extents.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/extents.c	Wed Feb 03 20:18:53 2010 +0000
@@ -3410,11 +3410,12 @@
   /* compare the random elements of the plists. */
   return !plists_differ (extent_no_chase_plist (e1),
 			 extent_no_chase_plist (e2),
-			 0, 0, depth + 1);
+			 0, 0, depth + 1, 0);
 }
 
 static int
-extent_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+extent_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+	      int UNUSED (foldcase))
 {
   struct extent *e1 = XEXTENT (obj1);
   struct extent *e2 = XEXTENT (obj2);
--- a/src/faces.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/faces.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1,7 +1,7 @@
 /* "Face" primitives
    Copyright (C) 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2001, 2002 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2010 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
 
 This file is part of XEmacs.
@@ -148,7 +148,8 @@
    This isn't concerned with "unspecified" attributes, that's what
    #'face-differs-from-default-p is for. */
 static int
-face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+	    int UNUSED (foldcase))
 {
   Lisp_Face *f1 = XFACE (obj1);
   Lisp_Face *f2 = XFACE (obj2);
@@ -168,7 +169,7 @@
      internal_equal (f1->blinking,	     f2->blinking,	    depth) &&
      internal_equal (f1->reverse,	     f2->reverse,	    depth) &&
 
-     ! plists_differ (f1->plist, f2->plist, 0, 0, depth + 1));
+     ! plists_differ (f1->plist, f2->plist, 0, 0, depth + 1, 0));
 }
 
 static Hashcode
@@ -2271,12 +2272,12 @@
     Lisp_Object device_symbol = Qx;
 #endif
 
-#if defined (USE_XFT) || defined (MULE)
+#if defined (HAVE_XFT) || defined (MULE)
     const Ascbyte **fontptr;
 
     const Ascbyte *fonts[] =
     {
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       /************** Xft fonts *************/
 
       /* Note that fontconfig can search for several font families in one
@@ -2301,7 +2302,7 @@
       "-*-*-medium-r-*-*-*-170-*-*-c-*-*-*",
 #endif
     };
-#endif /* defined (USE_XFT) || defined (MULE) */
+#endif /* defined (HAVE_XFT) || defined (MULE) */
 
 #ifdef MULE
 
@@ -2332,13 +2333,13 @@
 
 #endif /* MULE */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
     for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--)
       inst_list = Fcons (Fcons (list1 (device_symbol),
 				build_string (*fontptr)),
 			 inst_list);
 
-#else /* !USE_XFT */
+#else /* !HAVE_XFT */
     inst_list =
       Fcons
       (Fcons
@@ -2419,7 +2420,7 @@
 	build_string ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")),
        inst_list);
 
-#endif /* !USE_XFT */
+#endif /* !HAVE_XFT */
 
 #endif /* HAVE_X_WINDOWS || HAVE_GTK */
 
--- a/src/floatfns.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/floatfns.c	Wed Feb 03 20:18:53 2010 +0000
@@ -176,7 +176,8 @@
 }
 
 static int
-float_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+float_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	     int UNUSED (foldcase))
 {
   return (extract_float (obj1) == extract_float (obj2));
 }
--- a/src/fns.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/fns.c	Wed Feb 03 20:18:53 2010 +0000
@@ -96,7 +96,8 @@
 }
 
 static int
-bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+		  int UNUSED (foldcase))
 {
   Lisp_Bit_Vector *v1 = XBIT_VECTOR (obj1);
   Lisp_Bit_Vector *v2 = XBIT_VECTOR (obj2);
@@ -1985,7 +1986,7 @@
  */
 int
 plists_differ (Lisp_Object a, Lisp_Object b, int nil_means_not_present,
-	       int laxp, int depth)
+	       int laxp, int depth, int foldcase)
 {
   int eqp = (depth == -1);	/* -1 as depth means use eq, not equal. */
   int la, lb, m, i, fill;
@@ -2029,12 +2030,13 @@
       if (nil_means_not_present && NILP (v)) continue;
       for (i = 0; i < fill; i++)
 	{
-	  if (!laxp ? EQ (k, keys [i]) : internal_equal (k, keys [i], depth))
+	  if (!laxp ? EQ (k, keys [i]) :
+	      internal_equal_0 (k, keys [i], depth, foldcase))
 	    {
 	      if (eqp
 		  /* We narrowly escaped being Ebolified here. */
 		  ? !EQ_WITH_EBOLA_NOTICE (v, vals [i])
-		  : !internal_equal (v, vals [i], depth))
+		  : !internal_equal_0 (v, vals [i], depth, foldcase))
 		/* a property in B has a different value than in A */
 		goto MISMATCH;
 	      flags [i] = 1;
@@ -2070,7 +2072,7 @@
 */
        (a, b, nil_means_not_present))
 {
-  return (plists_differ (a, b, !NILP (nil_means_not_present), 0, -1)
+  return (plists_differ (a, b, !NILP (nil_means_not_present), 0, -1, 0)
 	  ? Qnil : Qt);
 }
 
@@ -2087,7 +2089,7 @@
 */
        (a, b, nil_means_not_present))
 {
-  return (plists_differ (a, b, !NILP (nil_means_not_present), 0, 1)
+  return (plists_differ (a, b, !NILP (nil_means_not_present), 0, 1, 0)
 	  ? Qnil : Qt);
 }
 
@@ -2107,7 +2109,7 @@
 */
        (a, b, nil_means_not_present))
 {
-  return (plists_differ (a, b, !NILP (nil_means_not_present), 1, -1)
+  return (plists_differ (a, b, !NILP (nil_means_not_present), 1, -1, 0)
 	  ? Qnil : Qt);
 }
 
@@ -2126,7 +2128,7 @@
 */
        (a, b, nil_means_not_present))
 {
-  return (plists_differ (a, b, !NILP (nil_means_not_present), 1, 1)
+  return (plists_differ (a, b, !NILP (nil_means_not_present), 1, 1, 0)
 	  ? Qnil : Qt);
 }
 
@@ -2848,49 +2850,78 @@
 
       return (imp1 == imp2) &&
 	/* EQ-ness of the objects was noticed above */
-	(imp1->equal && (imp1->equal) (obj1, obj2, depth));
+	(imp1->equal && (imp1->equal) (obj1, obj2, depth, 0));
     }
 
   return 0;
 }
 
+enum array_type
+  {
+    ARRAY_NONE = 0,
+    ARRAY_STRING,
+    ARRAY_VECTOR,
+    ARRAY_BIT_VECTOR
+  };
+
+static enum array_type
+array_type (Lisp_Object obj)
+{
+  if (STRINGP (obj))
+    return ARRAY_STRING;
+  if (VECTORP (obj))
+    return ARRAY_VECTOR;
+  if (BIT_VECTORP (obj))
+    return ARRAY_BIT_VECTOR;
+  return ARRAY_NONE;
+}
+
 int
 internal_equalp (Lisp_Object obj1, Lisp_Object obj2, int depth)
 {
   if (depth > 200)
     stack_overflow ("Stack overflow in equalp", Qunbound);
   QUIT;
+
+  /* 1. Objects that are `eq' are equal.  This will catch the common case
+     of two equal fixnums or the same object seen twice. */
   if (EQ_WITH_EBOLA_NOTICE (obj1, obj2))
     return 1;
-#ifdef WITH_NUMBER_TYPES
+
+  /* 2. If both numbers, compare with `='. */
   if (NUMBERP (obj1) && NUMBERP (obj2))
     {
-      switch (promote_args (&obj1, &obj2))
-	{
-	case FIXNUM_T:
-	  return XREALINT (obj1) == XREALINT (obj2);
-#ifdef HAVE_BIGNUM
-	case BIGNUM_T:
-	  return bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2));
-#endif
-#ifdef HAVE_RATIO
-	case RATIO_T:
-	  return ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2));
-#endif
-	case FLOAT_T:
-	  return XFLOAT_DATA (obj1) == XFLOAT_DATA (obj2);
-#ifdef HAVE_BIGFLOAT
-	case BIGFLOAT_T:
-	  return bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2));
-#endif
-	}
+      return (0 == bytecode_arithcompare (obj1, obj2));
     }
-#else
-  if ((INTP (obj1) && FLOATP (obj2)) || (FLOATP (obj1) && INTP (obj2)))
-    return extract_float (obj1) == extract_float (obj2);
-#endif
+
+  /* 3. If characters, compare case-insensitively. */
   if (CHARP (obj1) && CHARP (obj2))
-    return DOWNCASE (0, XCHAR (obj1)) == DOWNCASE (0, XCHAR (obj2));
+    return CANONCASE (0, XCHAR (obj1)) == CANONCASE (0, XCHAR (obj2));
+
+  /* 4. If arrays of different types, compare their lengths, and
+        then compare element-by-element. */
+  {
+    enum array_type artype1, artype2;
+    artype1 = array_type (obj1);
+    artype2 = array_type (obj2);
+    if (artype1 != artype2 && artype1 && artype2)
+      {
+	EMACS_INT i;
+	EMACS_INT l1 = XINT (Flength (obj1));
+	EMACS_INT l2 = XINT (Flength (obj2));
+	/* Both arrays, but of different lengths */
+	if (l1 != l2)
+	  return 0;
+	for (i = 0; i < l1; i++)
+	  if (!internal_equalp (Faref (obj1, make_int (i)),
+				Faref (obj2, make_int (i)), depth + 1))
+	    return 0;
+	return 1;
+      }
+  }
+  /* 5. Else, they must be the same type.  If so, call the equal() method,
+        telling it to fold case.  For objects that care about case-folding
+	their contents, the equal() method will call internal_equal_0(). */
   if (XTYPE (obj1) != XTYPE (obj2))
     return 0;
   if (LRECORDP (obj1))
@@ -2899,16 +2930,23 @@
 	*imp1 = XRECORD_LHEADER_IMPLEMENTATION (obj1),
 	*imp2 = XRECORD_LHEADER_IMPLEMENTATION (obj2);
 
-      /* #### not yet implemented properly, needs another flag to specify
-	 equalp-ness */
       return (imp1 == imp2) &&
 	/* EQ-ness of the objects was noticed above */
-	(imp1->equal && (imp1->equal) (obj1, obj2, depth));
+	(imp1->equal && (imp1->equal) (obj1, obj2, depth, 1));
     }
 
   return 0;
 }
 
+int
+internal_equal_0 (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
+{
+  if (foldcase)
+    return internal_equalp (obj1, obj2, depth);
+  else
+    return internal_equal (obj1, obj2, depth);
+}
+
 /* Note that we may be calling sub-objects that will use
    internal_equal() (instead of internal_old_equal()).  Oh well.
    We will get an Ebola note if there's any possibility of confusion,
@@ -2941,6 +2979,37 @@
   return internal_equal (object1, object2, 0) ? Qt : Qnil;
 }
 
+DEFUN ("equalp", Fequalp, 2, 2, 0, /*
+Return t if two Lisp objects have similar structure and contents.
+
+This is like `equal', except that it accepts numerically equal
+numbers of different types (float, integer, bignum, bigfloat), and also
+compares strings and characters case-insensitively.
+
+Type objects that are arrays (that is, strings, bit-vectors, and vectors)
+of the same length and with contents that are `equalp' are themselves
+`equalp', regardless of whether the two objects have the same type.
+
+Other objects whose primary purpose is as containers of other objects are
+`equalp' if they would otherwise be equal (same length, type, etc.) and
+their contents are `equalp'.  This goes for conses, weak lists,
+weak boxes, ephemerons, specifiers, hash tables, char tables and range
+tables.  However, objects that happen to contain other objects but are not
+primarily designed for this purpose (e.g. compiled functions, events or
+display-related objects such as glyphs, faces or extents) are currently
+compared using `equalp' the same way as using `equal'.
+
+More specifically, two hash tables are `equalp' if they have the same test
+(see `hash-table-test'), the same number of entries, and the same value for
+`hash-table-weakness', and if, for each entry in one hash table, its key is
+equivalent to a key in the other hash table using the hash table test, and
+its value is `equalp' to the other hash table's value for that key.
+*/
+       (object1, object2))
+{
+  return internal_equalp (object1, object2, 0) ? Qt : Qnil;
+}
+
 DEFUN ("old-equal", Fold_equal, 2, 2, 0, /*
 Return t if two Lisp objects have similar structure and contents.
 They must have the same data type.
@@ -4559,6 +4628,7 @@
   DEFSUBR (Fremprop);
   DEFSUBR (Fobject_plist);
   DEFSUBR (Fequal);
+  DEFSUBR (Fequalp);
   DEFSUBR (Fold_equal);
   DEFSUBR (Ffillarray);
   DEFSUBR (Fnconc);
--- a/src/font-mgr.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/font-mgr.h	Wed Feb 03 20:18:53 2010 +0000
@@ -89,7 +89,7 @@
 
 #endif /* FONTCONFIG_EXPOSE_CONFIG */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 
 #ifndef HAVE_FCCONFIGGETRESCANINTERVAL
 /* Older fontconfig versions misspell this function name. */
@@ -164,8 +164,8 @@
     DEBUG_XFT2 (level, "checking if %s handles %s\n", font, lang);	\
   } while (0)
 
-#else /* USE_XFT */
+#else /* HAVE_XFT */
 
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 #endif /* INCLUDED_font_mgr_h_ */
--- a/src/frame-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/frame-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -61,7 +61,7 @@
 #define STUPID_X_SPECIFIC_GTK_STUFF
 
 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 #endif
 
 /* Default properties to use when creating frames.  */
@@ -988,9 +988,11 @@
     FRAME_GTK_LISP_WIDGETS (f)[i] = Qnil;
 
   /*
-    Hashtables of callback data for glyphs on the frame.  Make them EQ because
-    we only use ints as keys.  Otherwise we run into stickiness in redisplay
-    because internal_equal() can QUIT.  See enter_redisplay_critical_section().
+    Hashtables of callback data for glyphs on the frame.  [[ Make them EQ
+    because we only use ints as keys.  Otherwise we run into stickiness in
+    redisplay because internal_equal() can QUIT.  See
+    enter_redisplay_critical_section() ]] -- probably not true any more,
+    now that we have internal_equal_trapping_problems(). --ben
 */
   FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE (f) =
     make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ);
--- a/src/frame-msw.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/frame-msw.c	Wed Feb 03 20:18:53 2010 +0000
@@ -195,10 +195,11 @@
   FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f) = 
     make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
 #endif
-  /* hashtable of instantiated glyphs on the frame.  Make them EQ because
+  /* hashtable of instantiated glyphs on the frame. [[ Make them EQ because
      we only use ints as keys.  Otherwise we run into stickiness in
      redisplay because internal_equal() can QUIT.  See
-     enter_redisplay_critical_section(). */
+     enter_redisplay_critical_section(). ]] -- probably not true any more,
+    now that we have internal_equal_trapping_problems(). --ben */
   FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f) =
     make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ);
   FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f) =
--- a/src/frame-x.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/frame-x.c	Wed Feb 03 20:18:53 2010 +0000
@@ -2606,7 +2606,7 @@
   DtDndDropUnregister (FRAME_X_TEXT_WIDGET (f));
 #endif /* HAVE_CDE */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   /* If we have an XftDraw structure, we need to free it here.
      We can't ever have an XftDraw without a Display, so we are safe
      to free it in here, and we avoid too much playing around with the 
@@ -2713,7 +2713,7 @@
        {
 	 if (0)
 	   ;
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 	 else if (FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font)))
 	   {
 	     Xt_SET_ARG (al[ac], XtNxftFont,
--- a/src/gc.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/gc.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1624,8 +1624,9 @@
 
   { /* staticpro() */
     Lisp_Object **p = Dynarr_begin (staticpros);
+    Elemcount len = Dynarr_length (staticpros);
     Elemcount count;
-    for (count = Dynarr_length (staticpros); count; count--, p++)
+    for (count = 0; count < len; count++, p++)
       /* Need to check if the pointer in the staticpro array is not
 	 NULL. A gc can occur after variable is added to the staticpro
 	 array and _before_ it is correctly initialized. In this case
@@ -1636,8 +1637,9 @@
 
   { /* staticpro_nodump() */
     Lisp_Object **p = Dynarr_begin (staticpros_nodump);
+    Elemcount len = Dynarr_length (staticpros_nodump);
     Elemcount count;
-    for (count = Dynarr_length (staticpros_nodump); count; count--, p++)
+    for (count = 0; count < len; count++, p++)
       /* Need to check if the pointer in the staticpro array is not
 	 NULL. A gc can occur after variable is added to the staticpro
 	 array and _before_ it is correctly initialized. In this case
@@ -1649,9 +1651,10 @@
 #ifdef NEW_GC
   { /* mcpro () */
     Lisp_Object *p = Dynarr_begin (mcpros);
+    Elemcount len = Dynarr_length (mcpros);
     Elemcount count;
-    for (count = Dynarr_length (mcpros); count; count--)
-      mark_object (*p++);
+    for (count = 0; count < len; count++, p++)
+      mark_object (*p);
   }
 #endif /* NEW_GC */
 
--- a/src/gccache-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/gccache-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -21,7 +21,7 @@
 
 /* Synched up with: Not in FSF. */
 
-/* Emacs uses a lot of different display attributes; for example, assume
+/* XEmacs uses a lot of different display attributes; for example, assume
    that only four fonts are in use (normal, bold, italic, and bold-italic).
    Then assume that one stipple or background is used for text selections,
    and another is used for highlighting mousable regions.  That makes 16
@@ -53,19 +53,15 @@
  */
 
 #include <config.h>
-#include <gtk/gtk.h>
 #include "lisp.h"
+#include "hash.h"
+
 #include "gccache-gtk.h"
 
 #define GC_CACHE_SIZE 100
 
 #define GCCACHE_HASH
 
-#ifdef GCCACHE_HASH
-#include "lisp.h"
-#include "hash.h"
-#endif
-
 struct gcv_and_mask {
 	GdkGCValues gcv;
 	unsigned long mask; /* contains a GdkGCValuesMask bitmask. */
--- a/src/gccache-gtk.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/gccache-gtk.h	Wed Feb 03 20:18:53 2010 +0000
@@ -1,4 +1,4 @@
-/* Efficient caching of X GCs (graphics contexts).
+/* Efficient caching of GTK GCs (graphics contexts).
    Copyright (C) 1993 Free Software Foundation, Inc.
 
 
@@ -27,9 +27,11 @@
 #ifndef _GCCACHE_GTK_H_
 #define _GCCACHE_GTK_H_
 
+#include "sysgtk.h"
+
 struct gc_cache;
 struct gc_cache *make_gc_cache (GtkWidget *);
 void free_gc_cache (struct gc_cache *cache);
 GdkGC *gc_cache_lookup (struct gc_cache *, GdkGCValues *, unsigned long mask);
 
-#endif /* _XGCCACHE_H_ */
+#endif /* _GCCACHE_GTK_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gccache-x.c	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,362 @@
+/* Efficient caching of X GCs (graphics contexts).
+   Copyright (C) 1993 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+/* Emacs uses a lot of different display attributes; for example, assume
+   that only four fonts are in use (normal, bold, italic, and bold-italic).
+   Then assume that one stipple or background is used for text selections,
+   and another is used for highlighting mousable regions.  That makes 16
+   GCs already.  Add in the fact that another GC may be needed to display
+   the text cursor in any of those regions, and you've got 32.  Add in
+   more fonts, and it keeps increasing exponentially.
+
+   We used to keep these GCs in a cache of merged (fully qualified) faces.
+   However, a lot of other code in xterm.c used XChangeGC of existing GCs,
+   which is kind of slow and kind of random.  Also, managing the face cache
+   was tricky because it was hard to know when a face was no longer visible
+   on the frame -- we had to mark all frames as garbaged whenever a face
+   was changed, which caused an unpleasant amount of flicker (since faces are
+   created/destroyed (= changed) whenever a frame is created/destroyed.
+
+   So this code maintains a cache at the GC level instead of at the face
+   level.  There is an upper limit on the size of the cache, after which we
+   will stop creating GCs and start reusing them (reusing the least-recently-
+   used ones first).  So if faces get changed, their GCs will eventually be
+   recycled.  Also more sharing of GCs is possible.
+
+   This code uses hash tables.  It could be that, if the cache size is small
+   enough, a linear search might be faster; but I doubt it, since we need
+   `equal' comparisons, not `eq', and I expect that the optimal cache size
+   will be ~100.
+
+   Written by jwz, 14 jun 93
+ */
+
+#include <config.h>
+#include "lisp.h"
+#include "hash.h"
+
+#include "gccache-x.h"
+
+#define GC_CACHE_SIZE 100
+
+#define GCCACHE_HASH
+
+struct gcv_and_mask {
+  XGCValues gcv;
+  unsigned long mask;
+};
+
+struct gc_cache_cell {
+  GC gc;
+  struct gcv_and_mask gcvm;
+  struct gc_cache_cell *prev, *next;
+};
+
+struct gc_cache {
+  Display *dpy;		/* used only as arg to XCreateGC/XFreeGC */
+  Window window;	/* used only as arg to XCreateGC */
+  int size;
+  struct gc_cache_cell *head;
+  struct gc_cache_cell *tail;
+#ifdef GCCACHE_HASH
+  struct hash_table *table;
+#endif
+
+  int create_count;
+  int delete_count;
+};
+
+#ifdef GCCACHE_HASH
+static Hashcode
+gc_cache_hash (const void *arg)
+{
+  const struct gcv_and_mask *gcvm = (const struct gcv_and_mask *) arg;
+  unsigned long *longs = (unsigned long *) &gcvm->gcv;
+  Hashcode hash = gcvm->mask;
+  int i;
+  /* This could look at the mask and only use the used slots in the
+     hash code.  That would win in that we wouldn't have to initialize
+     every slot of the gcv when calling gc_cache_lookup.  But we need
+     the hash function to be as fast as possible; some timings should
+     be done. */
+  for (i = 0; i < (int) (sizeof (XGCValues) / sizeof (unsigned long)); i++)
+    hash = (hash << 1) ^ *longs++;
+  return hash;
+}
+
+#endif /* GCCACHE_HASH */
+
+static int
+gc_cache_eql (const void *arg1, const void *arg2)
+{
+  /* See comment in gc_cache_hash */
+  return !memcmp (arg1, arg2, sizeof (struct gcv_and_mask));
+}
+
+struct gc_cache *
+make_gc_cache (Display *dpy, Window window)
+{
+  struct gc_cache *cache = xnew (struct gc_cache);
+  cache->dpy = dpy;
+  cache->window = window;
+  cache->size = 0;
+  cache->head = cache->tail = 0;
+  cache->create_count = cache->delete_count = 0;
+#ifdef GCCACHE_HASH
+  cache->table =
+    make_general_hash_table (GC_CACHE_SIZE, gc_cache_hash, gc_cache_eql);
+#endif
+  return cache;
+}
+
+void
+free_gc_cache (struct gc_cache *cache)
+{
+  struct gc_cache_cell *rest, *next;
+  rest = cache->head;
+  while (rest)
+    {
+      XFreeGC (cache->dpy, rest->gc);
+      next = rest->next;
+      xfree (rest, struct gc_cache_cell *);
+      rest = next;
+    }
+#ifdef GCCACHE_HASH
+  free_hash_table (cache->table);
+#endif
+  xfree (cache, struct gc_cache *);
+}
+
+GC
+gc_cache_lookup (struct gc_cache *cache, XGCValues *gcv, unsigned long mask)
+{
+  struct gc_cache_cell *cell, *next, *prev;
+  struct gcv_and_mask gcvm;
+
+#ifdef DEBUG_XEMACS
+  (void) describe_gc_cache (cache, DGCCFLAG_DISABLE);
+#endif
+
+  if ((!!cache->head) != (!!cache->tail)) ABORT ();
+  if (cache->head && (cache->head->prev || cache->tail->next)) ABORT ();
+
+  gcvm.mask = mask;
+  gcvm.gcv = *gcv;	/* this copies... */
+
+#ifdef GCCACHE_HASH
+
+  /* The intermediate cast fools gcc into not outputting strict-aliasing
+     complaints */
+  if (gethash (&gcvm, cache->table, (const void **) (void *) &cell))
+
+#else /* !GCCACHE_HASH */
+
+  cell = cache->tail;	/* start at the end (most recently used) */
+  while (cell)
+    {
+      if (gc_cache_eql (&gcvm, &cell->gcvm))
+	break;
+      else
+	cell = cell->prev;
+    }
+
+  /* #### This whole file needs some serious overhauling. */
+  if (!(mask | GCTile) && cell->gc->values.tile)
+    cell = 0;
+  else if (!(mask | GCStipple) && cell->gc->values.stipple)
+    cell = 0;
+
+  if (cell)
+
+#endif /* !GCCACHE_HASH */
+
+    {
+      /* Found a cell.  Move this cell to the end of the list, so that it
+	 will be less likely to be collected than a cell that was accessed
+	 less recently.
+       */
+#if 0
+      debug_out ("Returning cached GC: %08lx\n", XE_GCONTEXT(cell));
+#endif
+      if (cell == cache->tail)
+	return cell->gc;
+
+      next = cell->next;
+      prev = cell->prev;
+      if (prev) prev->next = next;
+      if (next) next->prev = prev;
+      if (cache->head == cell) cache->head = next;
+      cell->next = 0;
+      cell->prev = cache->tail;
+      cache->tail->next = cell;
+      cache->tail = cell;
+      if (cache->head == cell) ABORT ();
+      if (cell->next) ABORT ();
+      if (cache->head->prev) ABORT ();
+      if (cache->tail->next) ABORT ();
+      return cell->gc;
+    }
+
+  /* else, cache miss. */
+
+  if (cache->size == GC_CACHE_SIZE)
+    /* Reuse the first cell on the list (least-recently-used).
+       Remove it from the list, and unhash it from the table.
+     */
+    {
+      cell = cache->head;
+      cache->head = cell->next;
+      cache->head->prev = 0;
+      if (cache->tail == cell) cache->tail = 0; /* only one */
+#if 0
+      debug_out ("Cache full, freeing GC: %08lx\n  ", XE_GCONTEXT(cell));
+#endif
+      XFreeGC (cache->dpy, cell->gc);
+      cache->delete_count++;
+#ifdef GCCACHE_HASH
+      remhash (&cell->gcvm, cache->table);
+#endif
+    }
+  else if (cache->size > GC_CACHE_SIZE)
+    ABORT ();
+  else
+    {
+      /* Allocate a new cell (don't put it in the list or table yet). */
+      cell = xnew (struct gc_cache_cell);
+      cache->size++;
+    }
+
+  /* Now we've got a cell (new or reused).  Fill it in. */
+  memcpy (&cell->gcvm.gcv, gcv, sizeof (XGCValues));
+  cell->gcvm.mask = mask;
+
+  /* Put the cell on the end of the list. */
+  cell->next = 0;
+  cell->prev = cache->tail;
+  if (cache->tail) cache->tail->next = cell;
+  cache->tail = cell;
+  if (! cache->head) cache->head = cell;
+
+  cache->create_count++;
+#ifdef GCCACHE_HASH
+  /* Hash it in the table */
+  puthash (&cell->gcvm, cell, cache->table);
+#endif
+
+  /* Now make and return the GC. */
+  cell->gc = XCreateGC (cache->dpy, cache->window, mask, gcv);
+
+  /* debug */
+  assert (cell->gc == gc_cache_lookup (cache, gcv, mask));
+
+#if 0
+  debug_out ("Returning new GC: %08lx\n  ", XE_GCONTEXT(cell));
+#endif
+  return cell->gc;
+}
+
+
+#ifdef DEBUG_XEMACS
+
+/* FLAGS
+   The flags argument is a bitwise or of any of the following:
+
+   DGCCFLAG_SUMMARY		Summary statistics for cache
+   DGCCFLAG_LIST_CELLS		If summary is being printed, print cell IDs too.
+   DGCCFLAG_CELL_DETAILS	If cell IDs are being printed, additionally
+				print the internal fields used and values.
+
+   DGCCFLAG_DEFAULT		A predefined combination giving whatever the
+				maintainers are currently interested in seeing.
+*/
+void
+describe_gc_cache (struct gc_cache *cache, int flags)
+{
+  int count = 0;
+  struct gc_cache_cell *cell = cache->head;
+
+  if (! flags & DGCCFLAG_SUMMARY) return;
+
+  stderr_out ("\nsize:    %d", cache->size);
+  stderr_out ("\ncreated: %d", cache->create_count);
+  stderr_out ("\ndeleted: %d", cache->delete_count);
+
+  if (flags & DGCCFLAG_LIST_CELLS)
+    while (cell)
+      {
+	struct gc_cache_cell *cell2;
+	int i = 0;
+	stderr_out ("\n%d:\t0x%lx  GC: 0x%08lx  hash: 0x%08lx\n",
+		    count, (long) cell, (long) XE_GCONTEXT(cell),
+		    gc_cache_hash (&cell->gcvm));
+
+	for (cell2 = cache->head; cell2; cell2 = cell2->next, i++)
+	  if (count != i &&
+	      gc_cache_hash (&cell->gcvm) == gc_cache_hash (&cell2->gcvm))
+	    stderr_out ("\tHASH COLLISION with cell %d\n", i);
+	stderr_out ("\tmask:       %8lx\n", cell->gcvm.mask);
+
+	if (flags & DGCCFLAG_CELL_DETAILS)
+	  {
+#define FROB(field) do {						\
+  if ((int)cell->gcvm.gcv.field != (~0))				\
+    stderr_out ("\t%-12s%8x\n", #field ":", (int)cell->gcvm.gcv.field);	\
+} while (0)
+	    FROB (function);
+	    FROB (plane_mask);
+	    FROB (foreground);
+	    FROB (background);
+	    FROB (line_width);
+	    FROB (line_style);
+	    FROB (cap_style);
+	    FROB (join_style);
+	    FROB (fill_style);
+	    FROB (fill_rule);
+	    FROB (arc_mode);
+	    FROB (tile);
+	    FROB (stipple);
+	    FROB (ts_x_origin);
+	    FROB (ts_y_origin);
+	    FROB (font);
+	    FROB (subwindow_mode);
+	    FROB (graphics_exposures);
+	    FROB (clip_x_origin);
+	    FROB (clip_y_origin);
+	    FROB (clip_mask);
+	    FROB (dash_offset);
+#undef FROB
+	  }
+
+	count++;
+	if (cell->next && cell == cache->tail)
+	  stderr_out ("\nERROR!  tail is here!\n\n");
+	else if (!cell->next && cell != cache->tail)
+	  stderr_out ("\nERROR!  tail is not at the end\n\n");
+	cell = cell->next;
+      }	/* while (cell) */
+
+  if (count != cache->size)
+    stderr_out ("\nERROR!  count should be %d\n\n", cache->size);
+}
+
+#endif /* DEBUG_XEMACS */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gccache-x.h	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,50 @@
+/* Efficient caching of X GCs (graphics contexts).
+   Copyright (C) 1993 Free Software Foundation, Inc.
+
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+/* Written by jwz, 14 jun 93 */
+
+#ifndef INCLUDED_gccache_x_h_
+#define INCLUDED_gccache_x_h_
+
+#include <X11/Xlib.h>
+
+struct gc_cache;
+struct gc_cache *make_gc_cache (Display *, Window);
+void free_gc_cache (struct gc_cache *cache);
+GC gc_cache_lookup (struct gc_cache *, XGCValues *, unsigned long mask);
+
+#define XE_GCONTEXT(cell) (XGContextFromGC(cell->gc))
+
+#ifdef DEBUG_XEMACS
+
+void describe_gc_cache (struct gc_cache *cache, int flags);
+
+#define DGCCFLAG_DISABLE		0
+#define DGCCFLAG_SUMMARY		1 << 0
+#define DGCCFLAG_LIST_CELLS		1 << 1
+#define DGCCFLAG_CELL_DETAILS		1 << 2
+/* A combination of the flags above. */
+#define DGCCFLAG_DEFAULT		DGCCFLAG_SUMMARY | DGCCFLAG_LIST_CELLS
+#endif
+
+#endif /* INCLUDED_gccache_x_h_ */
--- a/src/glyphs-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/glyphs-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -2955,7 +2955,7 @@
 }
 
 /* X specific crap */
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 /* #### Should remove all this X specific stuff when GTK/GDK matures a
    bit more and provides an abstraction for it. */
 static int
--- a/src/glyphs-gtk.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/glyphs-gtk.h	Wed Feb 03 20:18:53 2010 +0000
@@ -28,11 +28,10 @@
 #define _XEMACS_GLYPHS_GTK_H_
 
 #include "glyphs.h"
+#include "sysgtk.h"
 
 #ifdef HAVE_GTK
 
-#include <gtk/gtk.h>
-
 /****************************************************************************
  *                         Image-Instance Object                            *
  ****************************************************************************/
--- a/src/glyphs-x.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/glyphs-x.c	Wed Feb 03 20:18:53 2010 +0000
@@ -2376,7 +2376,7 @@
 					 face,
 					 domain));
     XFontStruct *fs = FONT_INSTANCE_X_FONT (fi);
-#ifdef USE_XFT
+#ifdef HAVE_XFT
     XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
 
     if (rf)
@@ -2395,7 +2395,7 @@
 	lw_add_widget_value_arg (wv, XtNfont, (XtArgVal) fs);
       }
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
     /* #### sanity check, should wrap in appropriate ERROR_CHECK macro */
     if (!rf && !fs)
       warn_when_safe_lispobj
--- a/src/glyphs.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/glyphs.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1133,7 +1133,8 @@
 }
 
 static int
-image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		      int UNUSED (foldcase))
 {
   Lisp_Image_Instance *i1 = XIMAGE_INSTANCE (obj1);
   Lisp_Image_Instance *i2 = XIMAGE_INSTANCE (obj2);
@@ -2935,7 +2936,7 @@
 #ifdef HAVE_GTK
 /* Gtk has to be gratuitously different, eh? */
 Lisp_Object
-pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid)
+pixmap_to_lisp_data (Lisp_Object name, int UNUSED (ok_if_data_invalid))
 {
   return (make_string_from_file (name));
 }
@@ -3706,7 +3707,8 @@
    This isn't concerned with "unspecified" attributes, that's what
    #'glyph-differs-from-default-p is for. */
 static int
-glyph_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+glyph_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+	     int UNUSED (foldcase))
 {
   Lisp_Glyph *g1 = XGLYPH (obj1);
   Lisp_Glyph *g2 = XGLYPH (obj2);
@@ -3717,7 +3719,7 @@
 	  internal_equal (g1->contrib_p, g2->contrib_p, depth) &&
 	  internal_equal (g1->baseline,  g2->baseline,  depth) &&
 	  internal_equal (g1->face,      g2->face,      depth) &&
-	  !plists_differ (g1->plist,     g2->plist, 0, 0, depth + 1));
+	  !plists_differ (g1->plist,     g2->plist, 0, 0, depth + 1, 0));
 }
 
 static Hashcode
--- a/src/gtk-glue.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/gtk-glue.c	Wed Feb 03 20:18:53 2010 +0000
@@ -25,6 +25,7 @@
 GtkType GTK_TYPE_OBJECT_LIST = 0;
 GtkType GTK_TYPE_GDK_GC = 0;
 
+#include "console-gtk.h"
 #include "objects-gtk-impl.h"
 
 static GtkType
@@ -86,7 +87,7 @@
 	  temp = XCDR (temp);
 	}
 
-      GTK_VALUE_POINTER(*arg) = strings;
+      GTK_VALUE_POINTER (*arg) = strings;
     }
   else if (arg->type == GTK_TYPE_OBJECT_LIST)
     {
@@ -107,11 +108,11 @@
 	  temp = XCDR (temp);
 	}
 
-      GTK_VALUE_POINTER(*arg) = objects;
+      GTK_VALUE_POINTER (*arg) = objects;
     }
   else
     {
-      ABORT();
+      ABORT ();
     }
 }
 
@@ -148,7 +149,7 @@
 	}
       else
 	{
-	  ABORT();
+	  ABORT ();
 	}
     }
   return (rval);
@@ -182,41 +183,42 @@
 	temp = XCDR (temp);					\
       }								\
 								\
-    GTK_VALUE_POINTER(*arg) = array;				\
+    GTK_VALUE_POINTER (*arg) = array;				\
   } while (0);
   
   if (arg->type == GTK_TYPE_STRING_ARRAY)
     {
-      FROB(gchar *, CHECK_STRING, (gchar*) XSTRING_DATA);
+      FROB (gchar *, CHECK_STRING, (gchar*) XSTRING_DATA);
     }
   else if (arg->type == GTK_TYPE_FLOAT_ARRAY)
     {
-      FROB(gfloat, CHECK_FLOAT, extract_float);
+      FROB (gfloat, CHECK_FLOAT, extract_float);
     }
   else if (arg->type == GTK_TYPE_INT_ARRAY)
     {
-      FROB(gint, CHECK_INT, XINT);
+      FROB (gint, CHECK_INT, XINT);
     }
   else
     {
-      ABORT();
+      ABORT ();
     }
 #undef FROB
 }
 
-extern GdkGC *gtk_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
-			  Lisp_Object bg_pmap, Lisp_Object lwidth);
-
 static GdkGC *
 face_to_gc (Lisp_Object face)
 {
   Lisp_Object device = Fselected_device (Qnil);
 
   return (gtk_get_gc (XDEVICE (device),
-		      Fspecifier_instance (Fget (face, Qfont, Qnil), device, Qnil, Qnil),
-		      Fspecifier_instance (Fget (face, Qforeground, Qnil), device, Qnil, Qnil),
-		      Fspecifier_instance (Fget (face, Qbackground, Qnil), device, Qnil, Qnil),
-		      Fspecifier_instance (Fget (face, Qbackground_pixmap, Qnil), device, Qnil, Qnil),
+		      Fspecifier_instance (Fget (face, Qfont, Qnil),
+					   device, Qnil, Qnil),
+		      Fspecifier_instance (Fget (face, Qforeground, Qnil),
+					   device, Qnil, Qnil),
+		      Fspecifier_instance (Fget (face, Qbackground, Qnil),
+					   device, Qnil, Qnil),
+		      Fspecifier_instance (Fget (face, Qbackground_pixmap,
+						 Qnil), device, Qnil, Qnil),
 		      Qnil));
 }
 
@@ -227,17 +229,24 @@
   GtkStyle *style = gtk_style_new ();
   int i;
 
-  Lisp_Object font = Fspecifier_instance (Fget (face, Qfont, Qnil), device, Qnil, Qnil);
-  Lisp_Object fg = Fspecifier_instance (Fget (face, Qforeground, Qnil), device, Qnil, Qnil);
-  Lisp_Object bg = Fspecifier_instance (Fget (face, Qbackground, Qnil), device, Qnil, Qnil);
-  Lisp_Object pm = Fspecifier_instance (Fget (face, Qbackground_pixmap, Qnil), device, Qnil, Qnil);
+  Lisp_Object font = Fspecifier_instance (Fget (face, Qfont, Qnil),
+					  device, Qnil, Qnil);
+  Lisp_Object fg = Fspecifier_instance (Fget (face, Qforeground, Qnil),
+					device, Qnil, Qnil);
+  Lisp_Object bg = Fspecifier_instance (Fget (face, Qbackground, Qnil),
+					device, Qnil, Qnil);
+  Lisp_Object pm = Fspecifier_instance (Fget (face, Qbackground_pixmap,
+					      Qnil), device, Qnil, Qnil);
 
-  for (i = 0; i < 5; i++) style->fg[i] = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (fg));
-  for (i = 0; i < 5; i++) style->bg[i] = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (bg));
+  for (i = 0; i < 5; i++)
+    style->fg[i] = *COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (fg));
+  for (i = 0; i < 5; i++)
+    style->bg[i] = *COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (bg));
 
   if (IMAGE_INSTANCEP (pm))
     {
-      for (i = 0; i < 5; i++) style->bg_pixmap[i] = XIMAGE_INSTANCE_GTK_PIXMAP (pm);
+      for (i = 0; i < 5; i++)
+	style->bg_pixmap[i] = XIMAGE_INSTANCE_GTK_PIXMAP (pm);
     }
 
   style->font = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font));
@@ -246,7 +255,7 @@
 }
 
 static Lisp_Object
-gdk_event_to_emacs_event(GdkEvent *ev)
+gdk_event_to_emacs_event (GdkEvent *ev)
 {
   Lisp_Object event = Qnil;
 
--- a/src/gtk-xemacs.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/gtk-xemacs.c	Wed Feb 03 20:18:53 2010 +0000
@@ -21,22 +21,21 @@
 ** along with XEmacs; see the file COPYING.  If not, write to
 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 ** Boston, MA 02111-1301, USA.  */
-*/
 
 #include <config.h>
 
 #include "lisp.h"
-#include "console-gtk.h"
-#include "objects-gtk.h"
-#include "gtk-xemacs.h"
+
 #include "device.h"
+#include "faces.h"
 #include "glyphs.h"
 #include "window.h"
-#include "faces.h"
-#include "event-gtk.h"
+
 #include "frame-impl.h"
 #include "console-gtk-impl.h"
 #include "device-impl.h"
+#include "gtk-xemacs.h"
+#include "objects-gtk.h"
 
 extern Lisp_Object Vmodeline_face;
 extern Lisp_Object Vscrollbar_on_left_p;
--- a/src/gtk-xemacs.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/gtk-xemacs.h	Wed Feb 03 20:18:53 2010 +0000
@@ -21,16 +21,10 @@
 ** along with XEmacs; see the file COPYING.  If not, write to
 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 ** Boston, MA 02111-1301, USA.  */
-*/
 
 #ifndef __GTK_XEMACS_H__
 #define __GTK_XEMACS_H__
 
-#include <config.h>
-#include "frame.h"
-#include <gdk/gdk.h>
-#include <gtk/gtkfixed.h>
-
 BEGIN_C_DECLS
 
 #define GTK_XEMACS(obj)			GTK_CHECK_CAST (obj, gtk_xemacs_get_type (), GtkXEmacs)
@@ -38,22 +32,22 @@
 #define GTK_IS_XEMACS(obj)		GTK_CHECK_TYPE (obj, gtk_xemacs_get_type ())
 #define GTK_XEMACS_FRAME(obj)	GTK_XEMACS (obj)->f
 
-	typedef struct _GtkXEmacs GtkXEmacs;
-	typedef struct _GtkXEmacsClass GtkXEmacsClass;
+typedef struct _GtkXEmacs GtkXEmacs;
+typedef struct _GtkXEmacsClass GtkXEmacsClass;
 
-	struct _GtkXEmacs
-	{
-		GtkFixed fixed;
-		struct frame *f;
-	};
+struct _GtkXEmacs
+{
+  GtkFixed fixed;
+  struct frame *f;
+};
 
-	struct _GtkXEmacsClass
-	{
-		GtkFixedClass parent_class;
-	};
+struct _GtkXEmacsClass
+{
+  GtkFixedClass parent_class;
+};
 
-	guint gtk_xemacs_get_type (void);
-	GtkWidget *gtk_xemacs_new (struct frame *f);
+guint gtk_xemacs_get_type (void);
+GtkWidget *gtk_xemacs_new (struct frame *f);
 
 END_C_DECLS
 
--- a/src/gui.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/gui.c	Wed Feb 03 20:18:53 2010 +0000
@@ -678,7 +678,8 @@
 }
 
 static int
-gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		int UNUSED (foldcase))
 {
   Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
   Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
--- a/src/inline.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/inline.c	Wed Feb 03 20:18:53 2010 +0000
@@ -101,7 +101,7 @@
 
 #ifdef HAVE_X_WINDOWS
 #include "glyphs-x.h"
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #include "font-mgr.h"
 #endif
 #endif
--- a/src/intl-auto-encap-win32.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/intl-auto-encap-win32.c	Wed Feb 03 20:18:53 2010 +0000
@@ -947,16 +947,16 @@
          Header file claims:
            WINUSERAPI HWND WINAPI CreateMDIWindow(LPCWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM)
          Overridden with:
-           HWND CreateMDIWindow(LPWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM)
+           HWND CreateMDIWindow(LPWSTR,LPWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM)
          Differences in return-type qualifiers, e.g. WINAPI, are not important.
  */
 HWND
-qxeCreateMDIWindow (Extbyte * arg1, const Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10)
-{
-  if (XEUNICODE_P)
-    return CreateMDIWindowW ((LPWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
-  else
-    return CreateMDIWindowA ((LPSTR) arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+qxeCreateMDIWindow (Extbyte * arg1, Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10)
+{
+  if (XEUNICODE_P)
+    return CreateMDIWindowW ((LPWSTR) arg1, (LPWSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+  else
+    return CreateMDIWindowA ((LPSTR) arg1, (LPSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
 }
 
 HWND
--- a/src/intl-auto-encap-win32.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/intl-auto-encap-win32.h	Wed Feb 03 20:18:53 2010 +0000
@@ -661,7 +661,7 @@
 #undef CreateMDIWindow
 #define CreateMDIWindow error_use_qxeCreateMDIWindow_or_CreateMDIWindowA_and_CreateMDIWindowW
 #endif
-HWND qxeCreateMDIWindow (Extbyte * arg1, const Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10);
+HWND qxeCreateMDIWindow (Extbyte * arg1, Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef CreateWindowEx
--- a/src/intl-encap-win32.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/intl-encap-win32.c	Wed Feb 03 20:18:53 2010 +0000
@@ -51,6 +51,8 @@
 yes indicates a function to be automatically Unicode-encapsulated.
    (All parameters either need no special processing or are LPTSTR or
    LPCTSTR.)
+override indidates a function where the prototype can be overridden
+   due to errors in Cygwin or Visual Studio.
 soon indicates a function that should be automatically Unicode-encapsulated,
    but we're not ready to process it yet.
 no indicates a function we don't support (it will be #defined to cause
@@ -429,7 +431,7 @@
 yes DlgDirSelectComboBoxEx
 yes DefFrameProc
 no DefMDIChildProc return value is conditionalized on _MAC, messes up parser
-override HWND CreateMDIWindowW(LPWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM); error arg 1, VS6 prototype, missing const
+override HWND CreateMDIWindowW(LPWSTR,LPWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM); error arg 1, VS6 prototype, missing const
 yes WinHelp
 no ChangeDisplaySettings split-sized LPDEVMODE
 no ChangeDisplaySettingsEx split-sized LPDEVMODE; NT 5.0/Win98+ only
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/keymap-buttons.h	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,62 @@
+/* Include file for iterating over all buttons.
+   Copyright (C) 1985, 1991-1995 Free Software Foundation, Inc.
+   Copyright (C) 1995 Board of Trustees, University of Illinois.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF.  Split out of keymap.c. */
+
+/* To use this, define FROB to do something with the button number.  No
+   need to undefine, it happens automatically at the end of this file.  If
+   you want button 0 included, define INCLUDE_BUTTON_ZERO (also undefined
+   automatically). */
+
+#ifdef INCLUDE_BUTTON_ZERO
+FROB(0)
+#endif
+FROB(1)
+FROB(2)
+FROB(3)
+FROB(4)
+FROB(5)
+FROB(6)
+FROB(7)
+FROB(8)
+FROB(9)
+FROB(10)
+FROB(11)
+FROB(12)
+FROB(13)
+FROB(14)
+FROB(15)
+FROB(16)
+FROB(17)
+FROB(18)
+FROB(19)
+FROB(20)
+FROB(21)
+FROB(22)
+FROB(23)
+FROB(24)
+FROB(25)
+FROB(26)
+
+#undef FROB
+#undef INCLUDE_BUTTON_ZERO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/keymap-slots.h	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,62 @@
+/* Definitions of marked slots in keymaps.
+   Copyright (C) 1985, 1991-1995 Free Software Foundation, Inc.
+   Copyright (C) 1995 Board of Trustees, University of Illinois.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF.  Split out of keymap.c. */
+
+/* We define the Lisp_Objects in the keymap structure in a separate
+   file because there are numerous places we want to iterate over them,
+   such as when defining them in the structure, initializing them, or
+   marking them.
+
+   To use, define MARKED_SLOT before including this file.  No need to
+   undefine; that happens automatically.
+
+   MARKED_SLOT_NOCOMPARE is used to indicate a slot that should not be
+   compared in the equal() method or hashed in the hash() method --
+   basically, a slot used for caching, debugging, etc. instead of for
+   defining a property of the keymap.
+*/
+
+#ifndef MARKED_SLOT_NOCOMPARE
+#define MARKED_SLOT_NOCOMPARE MARKED_SLOT
+#endif
+
+  MARKED_SLOT (parents)		 /* Keymaps to be searched after this one.
+				    An ordered list */
+  MARKED_SLOT (prompt)           /* Qnil or a string to print in the minibuffer
+                                    when reading from this keymap */
+  MARKED_SLOT (table)		 /* The contents of this keymap */
+  MARKED_SLOT_NOCOMPARE (inverse_table)	 /* The inverse mapping of the above */
+  MARKED_SLOT (default_binding)  /* Use this if no other binding is found
+                                    (this overrides parent maps and the
+                                    normal global-map lookup). */
+  MARKED_SLOT_NOCOMPARE (sub_maps_cache) /* Cache of directly inferior
+					    keymaps; This holds an alist,
+					    of the key and the maps, or the
+					    modifier bit and the map.  If
+					    this is the symbol t, then the
+					    cache needs to be recomputed. */
+  MARKED_SLOT_NOCOMPARE (name)           /* Just for debugging convenience */
+
+#undef MARKED_SLOT
+#undef MARKED_SLOT_NOCOMPARE
--- a/src/keymap.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/keymap.c	Wed Feb 03 20:18:53 2010 +0000
@@ -149,21 +149,8 @@
 struct Lisp_Keymap
 {
   struct LCRECORD_HEADER header;
-  Lisp_Object parents;		/* Keymaps to be searched after this one.
-				   An ordered list */
-  Lisp_Object prompt;           /* Qnil or a string to print in the minibuffer
-                                   when reading from this keymap */
-  Lisp_Object table;		/* The contents of this keymap */
-  Lisp_Object inverse_table;	/* The inverse mapping of the above */
-  Lisp_Object default_binding;  /* Use this if no other binding is found
-                                   (this overrides parent maps and the
-                                   normal global-map lookup). */
-  Lisp_Object sub_maps_cache;	/* Cache of directly inferior keymaps;
-				   This holds an alist, of the key and the
-				   maps, or the modifier bit and the map.
-				   If this is the symbol t, then the cache
-				   needs to be recomputed. */
-  Lisp_Object name;             /* Just for debugging convenience */
+#define MARKED_SLOT(x) Lisp_Object x;
+#include "keymap-slots.h"
 };
 
 #define MAKE_MODIFIER_HASH_KEY(modifier) make_int (modifier)
@@ -217,49 +204,20 @@
 static Lisp_Object keymap_submaps (Lisp_Object keymap);
 
 Lisp_Object Qcontrol, Qctrl, Qmeta, Qsuper, Qhyper, Qalt, Qshift;
-Lisp_Object Qbutton0;
-Lisp_Object Qbutton1, Qbutton2, Qbutton3, Qbutton4, Qbutton5;
-Lisp_Object Qbutton6, Qbutton7, Qbutton8, Qbutton9, Qbutton10;
-Lisp_Object Qbutton11, Qbutton12, Qbutton13, Qbutton14, Qbutton15;
-Lisp_Object Qbutton16, Qbutton17, Qbutton18, Qbutton19, Qbutton20;
-Lisp_Object Qbutton21, Qbutton22, Qbutton23, Qbutton24, Qbutton25;
-Lisp_Object Qbutton26;
-Lisp_Object Qbutton0up;
-Lisp_Object Qbutton1up, Qbutton2up, Qbutton3up, Qbutton4up, Qbutton5up;
-Lisp_Object Qbutton6up, Qbutton7up, Qbutton8up, Qbutton9up, Qbutton10up;
-Lisp_Object Qbutton11up, Qbutton12up, Qbutton13up, Qbutton14up, Qbutton15up;
-Lisp_Object Qbutton16up, Qbutton17up, Qbutton18up, Qbutton19up, Qbutton20up;
-Lisp_Object Qbutton21up, Qbutton22up, Qbutton23up, Qbutton24up, Qbutton25up;
-Lisp_Object Qbutton26up;
+
+#define INCLUDE_BUTTON_ZERO
+#define FROB(num)				\
+Lisp_Object Qbutton##num;			\
+Lisp_Object Qbutton##num##up;
+#include "keymap-buttons.h"
 
 Lisp_Object Qmenu_selection;
+
 /* Emacs compatibility */
-Lisp_Object Qdown_mouse_1, Qmouse_1;
-Lisp_Object Qdown_mouse_2, Qmouse_2;
-Lisp_Object Qdown_mouse_3, Qmouse_3;
-Lisp_Object Qdown_mouse_4, Qmouse_4;
-Lisp_Object Qdown_mouse_5, Qmouse_5;
-Lisp_Object Qdown_mouse_6, Qmouse_6;
-Lisp_Object Qdown_mouse_7, Qmouse_7;
-Lisp_Object Qdown_mouse_8, Qmouse_8;  
-Lisp_Object Qdown_mouse_9, Qmouse_9;  
-Lisp_Object Qdown_mouse_10, Qmouse_10;
-Lisp_Object Qdown_mouse_11, Qmouse_11;
-Lisp_Object Qdown_mouse_12, Qmouse_12;
-Lisp_Object Qdown_mouse_13, Qmouse_13;
-Lisp_Object Qdown_mouse_14, Qmouse_14;
-Lisp_Object Qdown_mouse_15, Qmouse_15;
-Lisp_Object Qdown_mouse_16, Qmouse_16;
-Lisp_Object Qdown_mouse_17, Qmouse_17;
-Lisp_Object Qdown_mouse_18, Qmouse_18;
-Lisp_Object Qdown_mouse_19, Qmouse_19;
-Lisp_Object Qdown_mouse_20, Qmouse_20;
-Lisp_Object Qdown_mouse_21, Qmouse_21;
-Lisp_Object Qdown_mouse_22, Qmouse_22;
-Lisp_Object Qdown_mouse_23, Qmouse_23;
-Lisp_Object Qdown_mouse_24, Qmouse_24;
-Lisp_Object Qdown_mouse_25, Qmouse_25;
-Lisp_Object Qdown_mouse_26, Qmouse_26;
+#define FROB(num)				\
+Lisp_Object Qmouse_##num;			\
+Lisp_Object Qdown_mouse_##num;
+#include "keymap-buttons.h"
 
 /* Kludge kludge kludge */
 Lisp_Object QLFD, QTAB, QRET, QESC, QDEL, QSPC, QBS;
@@ -269,17 +227,54 @@
 /*                     The keymap Lisp object                           */
 /************************************************************************/
 
+/* Keymaps are equal if Faces are equal if all of their display attributes are equal.  We
+   don't compare names or doc-strings, because that would make equal
+   be eq.
+
+   This isn't concerned with "unspecified" attributes, that's what
+   #'face-differs-from-default-p is for. */
+static int
+keymap_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+	      int UNUSED (foldcase))
+{
+  Lisp_Keymap *k1 = XKEYMAP (obj1);
+  Lisp_Keymap *k2 = XKEYMAP (obj2);
+
+  depth++;
+
+  return
+    (
+#define MARKED_SLOT(x) \
+     internal_equal (k1->x, k2->x, depth) &&
+#define MARKED_SLOT_NOCOMPARE(x)
+#include "keymap-slots.h"
+     1
+     );
+}
+
+static Hashcode
+keymap_hash (Lisp_Object obj, int depth)
+{
+  Lisp_Keymap *k = XKEYMAP (obj);
+  Hashcode hash = 0xCAFEBABE; /* why not? */
+
+  depth++;
+
+#define MARKED_SLOT(x) \
+  hash = HASH2 (hash, internal_hash (k->x, depth));
+#define MARKED_SLOT_NOCOMPARE(x)
+#include "keymap-slots.h"
+
+  return hash;
+}
+
 static Lisp_Object
 mark_keymap (Lisp_Object obj)
 {
   Lisp_Keymap *keymap = XKEYMAP (obj);
-  mark_object (keymap->parents);
-  mark_object (keymap->prompt);
-  mark_object (keymap->inverse_table);
-  mark_object (keymap->sub_maps_cache);
-  mark_object (keymap->default_binding);
-  mark_object (keymap->name);
-  return keymap->table;
+#define MARKED_SLOT(x) mark_object (keymap->x);
+#include "keymap-slots.h"
+  return Qnil;
 }
 
 static void
@@ -300,20 +295,15 @@
 }
 
 static const struct memory_description keymap_description[] = {
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, parents) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, prompt) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, table) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, inverse_table) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, default_binding) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, sub_maps_cache) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, name) },
+#define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (Lisp_Keymap, x) },
+#include "keymap-slots.h"
   { XD_END }
 };
 
-/* No need for keymap_equal #### Why not? */
 DEFINE_LRECORD_IMPLEMENTATION ("keymap", keymap,
 			       1, /*dumpable-flag*/
-                               mark_keymap, print_keymap, 0, 0, 0,
+                               mark_keymap, print_keymap, 0,
+			       keymap_equal, keymap_hash,
 			       keymap_description,
 			       Lisp_Keymap);
 
@@ -496,15 +486,10 @@
 {
   Lisp_Keymap *k;
 
-  modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3
-		 | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5 | XEMACS_MOD_BUTTON6
-                 | XEMACS_MOD_BUTTON7 | XEMACS_MOD_BUTTON8 | XEMACS_MOD_BUTTON9
-                 | XEMACS_MOD_BUTTON10 | XEMACS_MOD_BUTTON11 | XEMACS_MOD_BUTTON12
-                 | XEMACS_MOD_BUTTON13 | XEMACS_MOD_BUTTON14 | XEMACS_MOD_BUTTON15
-                 | XEMACS_MOD_BUTTON16 | XEMACS_MOD_BUTTON17 | XEMACS_MOD_BUTTON18
-                 | XEMACS_MOD_BUTTON19 | XEMACS_MOD_BUTTON20 | XEMACS_MOD_BUTTON21
-                 | XEMACS_MOD_BUTTON22 | XEMACS_MOD_BUTTON23 | XEMACS_MOD_BUTTON24
-                 | XEMACS_MOD_BUTTON25 | XEMACS_MOD_BUTTON26);
+  modifiers &= ~(
+#define FROB(num) XEMACS_MOD_BUTTON##num |
+#include "keymap-buttons.h"
+                 0);
   if ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER
 		     | XEMACS_MOD_HYPER | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT))
       != 0)
@@ -684,15 +669,10 @@
   int modifiers = KEY_DATA_MODIFIERS (key);
   Lisp_Keymap *k = XKEYMAP (keymap);
 
-  modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3
-		 | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5 | XEMACS_MOD_BUTTON6
-                 | XEMACS_MOD_BUTTON7 | XEMACS_MOD_BUTTON8 | XEMACS_MOD_BUTTON9
-                 | XEMACS_MOD_BUTTON10 | XEMACS_MOD_BUTTON11 | XEMACS_MOD_BUTTON12
-                 | XEMACS_MOD_BUTTON13 | XEMACS_MOD_BUTTON14 | XEMACS_MOD_BUTTON15
-                 | XEMACS_MOD_BUTTON16 | XEMACS_MOD_BUTTON17 | XEMACS_MOD_BUTTON18
-                 | XEMACS_MOD_BUTTON19 | XEMACS_MOD_BUTTON20 | XEMACS_MOD_BUTTON21
-                 | XEMACS_MOD_BUTTON22 | XEMACS_MOD_BUTTON23 | XEMACS_MOD_BUTTON24
-                 | XEMACS_MOD_BUTTON25 | XEMACS_MOD_BUTTON26);
+  modifiers &= ~(
+#define FROB(num) XEMACS_MOD_BUTTON##num |
+#include "keymap-buttons.h"
+                 0);
   assert ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META
 			 | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER
 			 | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) == 0);
@@ -803,13 +783,8 @@
 
   result = wrap_keymap (keymap);
 
-  keymap->parents         = Qnil;
-  keymap->prompt          = Qnil;
-  keymap->table           = Qnil;
-  keymap->inverse_table   = Qnil;
-  keymap->default_binding = Qnil;
-  keymap->sub_maps_cache  = Qnil; /* No possible submaps */
-  keymap->name            = Qnil;
+#define MARKED_SLOT(x) keymap->x = Qnil;
+#include "keymap-slots.h"
 
   if (size != 0) /* hack for copy-keymap */
     {
@@ -1406,110 +1381,12 @@
       else if (EQ (*keysym, QBS))
 	*keysym = QKbackspace;
       /* Emacs compatibility */
-      else if (EQ(*keysym, Qdown_mouse_1))
-        *keysym = Qbutton1;
-      else if (EQ(*keysym, Qdown_mouse_2))
-	*keysym = Qbutton2;
-      else if (EQ(*keysym, Qdown_mouse_3))
-	*keysym = Qbutton3;
-      else if (EQ(*keysym, Qdown_mouse_4))
-	*keysym = Qbutton4;
-      else if (EQ(*keysym, Qdown_mouse_5))
-	*keysym = Qbutton5;
-      else if (EQ(*keysym, Qdown_mouse_6))
-	*keysym = Qbutton6;
-      else if (EQ(*keysym, Qdown_mouse_7))
-	*keysym = Qbutton7;
-      else if (EQ(*keysym, Qdown_mouse_8))
-        *keysym = Qbutton8;
-      else if (EQ(*keysym, Qdown_mouse_9))
-        *keysym = Qbutton9;
-      else if (EQ(*keysym, Qdown_mouse_10))
-        *keysym = Qbutton10;
-      else if (EQ(*keysym, Qdown_mouse_11))
-        *keysym = Qbutton11;
-      else if (EQ(*keysym, Qdown_mouse_12))
-        *keysym = Qbutton12;
-      else if (EQ(*keysym, Qdown_mouse_13))
-        *keysym = Qbutton13;
-      else if (EQ(*keysym, Qdown_mouse_14))
-        *keysym = Qbutton14;
-      else if (EQ(*keysym, Qdown_mouse_15))
-        *keysym = Qbutton15;
-      else if (EQ(*keysym, Qdown_mouse_16))
-        *keysym = Qbutton16;
-      else if (EQ(*keysym, Qdown_mouse_17))
-        *keysym = Qbutton17;
-      else if (EQ(*keysym, Qdown_mouse_18))
-        *keysym = Qbutton18;
-      else if (EQ(*keysym, Qdown_mouse_19))
-        *keysym = Qbutton19;
-      else if (EQ(*keysym, Qdown_mouse_20))
-        *keysym = Qbutton20;
-      else if (EQ(*keysym, Qdown_mouse_21))
-        *keysym = Qbutton21;
-      else if (EQ(*keysym, Qdown_mouse_22))
-        *keysym = Qbutton22;
-      else if (EQ(*keysym, Qdown_mouse_23))
-        *keysym = Qbutton23;
-      else if (EQ(*keysym, Qdown_mouse_24))
-        *keysym = Qbutton24;
-      else if (EQ(*keysym, Qdown_mouse_25))
-        *keysym = Qbutton25;
-      else if (EQ(*keysym, Qdown_mouse_26))
-        *keysym = Qbutton26;
-      else if (EQ(*keysym, Qmouse_1))
-	*keysym = Qbutton1up;
-      else if (EQ(*keysym, Qmouse_2))
-	*keysym = Qbutton2up;
-      else if (EQ(*keysym, Qmouse_3))
-	*keysym = Qbutton3up;
-      else if (EQ(*keysym, Qmouse_4))
-	*keysym = Qbutton4up;
-      else if (EQ(*keysym, Qmouse_5))
-	*keysym = Qbutton5up;
-      else if (EQ(*keysym, Qmouse_6))
-	*keysym = Qbutton6up;
-      else if (EQ(*keysym, Qmouse_7))
-	*keysym = Qbutton7up;
-      else if (EQ(*keysym, Qmouse_8))
-        *keysym = Qbutton8up;
-      else if (EQ(*keysym, Qmouse_9))
-        *keysym = Qbutton9up;
-      else if (EQ(*keysym, Qmouse_10))
-        *keysym = Qbutton10up;
-      else if (EQ(*keysym, Qmouse_11))
-        *keysym = Qbutton11up;
-      else if (EQ(*keysym, Qmouse_12))
-        *keysym = Qbutton12up;
-      else if (EQ(*keysym, Qmouse_13))
-        *keysym = Qbutton13up;
-      else if (EQ(*keysym, Qmouse_14))
-        *keysym = Qbutton14up;
-      else if (EQ(*keysym, Qmouse_15))
-        *keysym = Qbutton15up;
-      else if (EQ(*keysym, Qmouse_16))
-        *keysym = Qbutton16up;
-      else if (EQ(*keysym, Qmouse_17))
-        *keysym = Qbutton17up;
-      else if (EQ(*keysym, Qmouse_18))
-        *keysym = Qbutton18up;
-      else if (EQ(*keysym, Qmouse_19))
-        *keysym = Qbutton19up;
-      else if (EQ(*keysym, Qmouse_20))
-        *keysym = Qbutton20up;
-      else if (EQ(*keysym, Qmouse_21))
-        *keysym = Qbutton21up;
-      else if (EQ(*keysym, Qmouse_22))
-        *keysym = Qbutton22up;
-      else if (EQ(*keysym, Qmouse_23))
-        *keysym = Qbutton23up;
-      else if (EQ(*keysym, Qmouse_24))
-        *keysym = Qbutton24up;
-      else if (EQ(*keysym, Qmouse_25))
-        *keysym = Qbutton25up;
-      else if (EQ(*keysym, Qmouse_26))
-        *keysym = Qbutton26up;
+#define FROB(num)				\
+      else if (EQ(*keysym, Qdown_mouse_##num))	\
+        *keysym = Qbutton##num;			\
+      else if (EQ(*keysym, Qmouse_##num))	\
+	*keysym = Qbutton##num##up;
+#include "keymap-buttons.h"
     }
 }
 
@@ -1552,89 +1429,20 @@
 	    int down = (XEVENT_TYPE (spec) == button_press_event);
 	    switch (XEVENT_BUTTON_BUTTON (spec))
 	      {
-	      case 1:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton1 : Qbutton1up)); 
-		break;
-	      case 2:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton2 : Qbutton2up)); 
-		break;
-	      case 3:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton3 : Qbutton3up)); 
-		break;
-	      case 4:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton4 : Qbutton4up)); 
-		break;
-	      case 5:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton5 : Qbutton5up)); 
-		break;
-	      case 6:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton6 : Qbutton6up)); 
-		break;
-	      case 7:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton7 : Qbutton7up)); 
+#define FROB(num)						\
+	      case num:						\
+		SET_KEY_DATA_KEYSYM (returned_value,		\
+		                     (down ? Qbutton##num :	\
+				      Qbutton##num##up));	\
 		break;
-              case 8:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton8 : Qbutton8up));
-                 break;
-              case 9:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton9 : Qbutton9up));
-                 break;
-              case 10:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton10 : Qbutton10up));
-                 break;
-              case 11:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton11 : Qbutton11up));
-                 break;
-              case 12:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton12 : Qbutton12up));
-                 break;
-              case 13:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton13 : Qbutton13up));
-                 break;
-              case 14:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton14 : Qbutton14up));
-                 break;
-              case 15:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton15 : Qbutton15up));
-                 break;
-              case 16:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton16 : Qbutton16up));
-                 break;
-              case 17:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton17 : Qbutton17up));
-                 break;
-              case 18:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton18 : Qbutton18up));
-                 break;
-              case 19:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton19 : Qbutton19up));
-                 break;
-              case 20:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton20 : Qbutton20up));
-                 break;
-              case 21:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton21 : Qbutton21up));
-                 break;
-              case 22:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton22 : Qbutton22up));
-                 break;
-              case 23:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton23 : Qbutton23up));
-                 break;
-              case 24:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton24 : Qbutton24up));
-                 break;
-              case 25:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton25 : Qbutton25up));
-                 break;
-              case 26:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton26 : Qbutton26up));
-                 break;
+#include "keymap-buttons.h"
 	      default:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton0 : Qbutton0up)); 
+		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton0 :
+						      Qbutton0up)); 
 		break;
 	      }
-	    SET_KEY_DATA_MODIFIERS (returned_value, XEVENT_BUTTON_MODIFIERS (spec));
+	    SET_KEY_DATA_MODIFIERS (returned_value,
+				    XEVENT_BUTTON_MODIFIERS (spec));
 	    break;
 	  }
 	default:
@@ -1722,33 +1530,13 @@
 
   define_key_parser (list, &raw_key);
 
-  if (EQ (raw_key.keysym, Qbutton0) || EQ (raw_key.keysym, Qbutton0up) ||
-      EQ (raw_key.keysym, Qbutton1) || EQ (raw_key.keysym, Qbutton1up) ||
-      EQ (raw_key.keysym, Qbutton2) || EQ (raw_key.keysym, Qbutton2up) ||
-      EQ (raw_key.keysym, Qbutton3) || EQ (raw_key.keysym, Qbutton3up) ||
-      EQ (raw_key.keysym, Qbutton4) || EQ (raw_key.keysym, Qbutton4up) ||
-      EQ (raw_key.keysym, Qbutton5) || EQ (raw_key.keysym, Qbutton5up) ||
-      EQ (raw_key.keysym, Qbutton6) || EQ (raw_key.keysym, Qbutton6up) ||
-      EQ (raw_key.keysym, Qbutton7) || EQ (raw_key.keysym, Qbutton7up) ||
-      EQ (raw_key.keysym, Qbutton8) || EQ (raw_key.keysym, Qbutton8up) ||
-      EQ (raw_key.keysym, Qbutton9) || EQ (raw_key.keysym, Qbutton9up) ||
-      EQ (raw_key.keysym, Qbutton10) || EQ (raw_key.keysym, Qbutton10up) ||
-      EQ (raw_key.keysym, Qbutton11) || EQ (raw_key.keysym, Qbutton11up) ||
-      EQ (raw_key.keysym, Qbutton12) || EQ (raw_key.keysym, Qbutton12up) ||
-      EQ (raw_key.keysym, Qbutton13) || EQ (raw_key.keysym, Qbutton13up) ||
-      EQ (raw_key.keysym, Qbutton14) || EQ (raw_key.keysym, Qbutton14up) ||
-      EQ (raw_key.keysym, Qbutton15) || EQ (raw_key.keysym, Qbutton15up) ||
-      EQ (raw_key.keysym, Qbutton16) || EQ (raw_key.keysym, Qbutton16up) ||
-      EQ (raw_key.keysym, Qbutton17) || EQ (raw_key.keysym, Qbutton17up) ||
-      EQ (raw_key.keysym, Qbutton18) || EQ (raw_key.keysym, Qbutton18up) ||
-      EQ (raw_key.keysym, Qbutton19) || EQ (raw_key.keysym, Qbutton19up) ||
-      EQ (raw_key.keysym, Qbutton20) || EQ (raw_key.keysym, Qbutton20up) ||
-      EQ (raw_key.keysym, Qbutton21) || EQ (raw_key.keysym, Qbutton21up) ||
-      EQ (raw_key.keysym, Qbutton22) || EQ (raw_key.keysym, Qbutton22up) ||
-      EQ (raw_key.keysym, Qbutton23) || EQ (raw_key.keysym, Qbutton23up) ||
-      EQ (raw_key.keysym, Qbutton24) || EQ (raw_key.keysym, Qbutton24up) ||
-      EQ (raw_key.keysym, Qbutton25) || EQ (raw_key.keysym, Qbutton25up) ||
-      EQ (raw_key.keysym, Qbutton26) || EQ (raw_key.keysym, Qbutton26up))
+  if (
+#define INCLUDE_BUTTON_ZERO
+#define FROB(num)				\
+      EQ (raw_key.keysym, Qbutton##num) ||	\
+      EQ (raw_key.keysym, Qbutton##num##up) ||
+#include "keymap-buttons.h"
+      0)
     invalid_operation ("Mouse-clicks can't appear in saved keyboard macros",
 		       Qunbound);
 
@@ -4252,60 +4040,12 @@
   /* If we're only supposed to display mouse bindings and this isn't one,
      then bug out. */
   if (closure->mice_only_p &&
-      (! (EQ (keysym, Qbutton0) ||
-	  EQ (keysym, Qbutton1) ||
-	  EQ (keysym, Qbutton2) ||
-	  EQ (keysym, Qbutton3) ||
-	  EQ (keysym, Qbutton4) ||
-	  EQ (keysym, Qbutton5) ||
-	  EQ (keysym, Qbutton6) ||
-	  EQ (keysym, Qbutton7) ||
-          EQ (keysym, Qbutton8) ||
-          EQ (keysym, Qbutton9) ||
-          EQ (keysym, Qbutton10) ||
-          EQ (keysym, Qbutton11) ||
-          EQ (keysym, Qbutton12) ||
-          EQ (keysym, Qbutton13) ||
-          EQ (keysym, Qbutton14) ||
-          EQ (keysym, Qbutton15) ||
-          EQ (keysym, Qbutton16) ||
-          EQ (keysym, Qbutton17) ||
-          EQ (keysym, Qbutton18) ||
-          EQ (keysym, Qbutton19) ||
-          EQ (keysym, Qbutton20) ||
-          EQ (keysym, Qbutton21) ||
-          EQ (keysym, Qbutton22) ||
-          EQ (keysym, Qbutton23) ||
-          EQ (keysym, Qbutton24) ||
-          EQ (keysym, Qbutton25) ||
-          EQ (keysym, Qbutton26) ||
-	  EQ (keysym, Qbutton0up) ||
-	  EQ (keysym, Qbutton1up) ||
-	  EQ (keysym, Qbutton2up) ||
-	  EQ (keysym, Qbutton3up) ||
-	  EQ (keysym, Qbutton4up) ||
-	  EQ (keysym, Qbutton5up) ||
-          EQ (keysym, Qbutton6up) ||
-          EQ (keysym, Qbutton7up) ||
-          EQ (keysym, Qbutton8up) ||
-          EQ (keysym, Qbutton9up) ||
-          EQ (keysym, Qbutton10up) ||
-          EQ (keysym, Qbutton11up) ||
-          EQ (keysym, Qbutton12up) ||
-          EQ (keysym, Qbutton13up) ||
-          EQ (keysym, Qbutton14up) ||
-          EQ (keysym, Qbutton15up) ||
-          EQ (keysym, Qbutton16up) ||
-          EQ (keysym, Qbutton17up) ||
-          EQ (keysym, Qbutton18up) ||
-          EQ (keysym, Qbutton19up) ||
-          EQ (keysym, Qbutton20up) ||
-          EQ (keysym, Qbutton21up) ||
-          EQ (keysym, Qbutton22up) ||
-          EQ (keysym, Qbutton23up) ||
-          EQ (keysym, Qbutton24up) ||
-          EQ (keysym, Qbutton25up) ||
-          EQ (keysym, Qbutton26up))))
+      (! (
+#define INCLUDE_BUTTON_ZERO
+#define FROB(num) EQ (keysym, Qbutton##num) || \
+                  EQ (keysym, Qbutton##num##up) ||
+#include "keymap-buttons.h"
+	  0)))
     return;
 
   /* If this command in this map is shadowed by some other map, ignore it. */
@@ -4609,112 +4349,15 @@
   DEFSYMBOL (Qhyper);
   DEFSYMBOL (Qalt);
   DEFSYMBOL (Qshift);
-  DEFSYMBOL (Qbutton0);
-  DEFSYMBOL (Qbutton1);
-  DEFSYMBOL (Qbutton2);
-  DEFSYMBOL (Qbutton3);
-  DEFSYMBOL (Qbutton4);
-  DEFSYMBOL (Qbutton5);
-  DEFSYMBOL (Qbutton6);
-  DEFSYMBOL (Qbutton7);
-  DEFSYMBOL (Qbutton8);
-  DEFSYMBOL (Qbutton9);
-  DEFSYMBOL (Qbutton10);
-  DEFSYMBOL (Qbutton11);
-  DEFSYMBOL (Qbutton12);
-  DEFSYMBOL (Qbutton13);
-  DEFSYMBOL (Qbutton14);
-  DEFSYMBOL (Qbutton15);
-  DEFSYMBOL (Qbutton16);
-  DEFSYMBOL (Qbutton17);
-  DEFSYMBOL (Qbutton18);
-  DEFSYMBOL (Qbutton19);
-  DEFSYMBOL (Qbutton20);
-  DEFSYMBOL (Qbutton21);
-  DEFSYMBOL (Qbutton22);
-  DEFSYMBOL (Qbutton23);
-  DEFSYMBOL (Qbutton24);
-  DEFSYMBOL (Qbutton25);
-  DEFSYMBOL (Qbutton26);
-  DEFSYMBOL (Qbutton0up);
-  DEFSYMBOL (Qbutton1up);
-  DEFSYMBOL (Qbutton2up);
-  DEFSYMBOL (Qbutton3up);
-  DEFSYMBOL (Qbutton4up);
-  DEFSYMBOL (Qbutton5up);
-  DEFSYMBOL (Qbutton6up);
-  DEFSYMBOL (Qbutton7up);
-  DEFSYMBOL (Qbutton8up);
-  DEFSYMBOL (Qbutton9up);
-  DEFSYMBOL (Qbutton10up);
-  DEFSYMBOL (Qbutton11up);
-  DEFSYMBOL (Qbutton12up);
-  DEFSYMBOL (Qbutton13up);
-  DEFSYMBOL (Qbutton14up);
-  DEFSYMBOL (Qbutton15up);
-  DEFSYMBOL (Qbutton16up);
-  DEFSYMBOL (Qbutton17up);
-  DEFSYMBOL (Qbutton18up);
-  DEFSYMBOL (Qbutton19up);
-  DEFSYMBOL (Qbutton20up);
-  DEFSYMBOL (Qbutton21up);
-  DEFSYMBOL (Qbutton22up);
-  DEFSYMBOL (Qbutton23up);
-  DEFSYMBOL (Qbutton24up);
-  DEFSYMBOL (Qbutton25up);
-  DEFSYMBOL (Qbutton26up);
-  DEFSYMBOL (Qmouse_1);
-  DEFSYMBOL (Qmouse_2);
-  DEFSYMBOL (Qmouse_3);
-  DEFSYMBOL (Qmouse_4);
-  DEFSYMBOL (Qmouse_5);
-  DEFSYMBOL (Qmouse_6);
-  DEFSYMBOL (Qmouse_7);
-  DEFSYMBOL (Qmouse_8);
-  DEFSYMBOL (Qmouse_9);
-  DEFSYMBOL (Qmouse_10);
-  DEFSYMBOL (Qmouse_11);
-  DEFSYMBOL (Qmouse_12);
-  DEFSYMBOL (Qmouse_13);
-  DEFSYMBOL (Qmouse_14);
-  DEFSYMBOL (Qmouse_15);
-  DEFSYMBOL (Qmouse_16);
-  DEFSYMBOL (Qmouse_17);
-  DEFSYMBOL (Qmouse_18);
-  DEFSYMBOL (Qmouse_19);
-  DEFSYMBOL (Qmouse_20);
-  DEFSYMBOL (Qmouse_21);
-  DEFSYMBOL (Qmouse_22);
-  DEFSYMBOL (Qmouse_23);
-  DEFSYMBOL (Qmouse_24);
-  DEFSYMBOL (Qmouse_25);
-  DEFSYMBOL (Qmouse_26);
-  DEFSYMBOL (Qdown_mouse_1);
-  DEFSYMBOL (Qdown_mouse_2);
-  DEFSYMBOL (Qdown_mouse_3);
-  DEFSYMBOL (Qdown_mouse_4);
-  DEFSYMBOL (Qdown_mouse_5);
-  DEFSYMBOL (Qdown_mouse_6);
-  DEFSYMBOL (Qdown_mouse_7);
-  DEFSYMBOL (Qdown_mouse_8);
-  DEFSYMBOL (Qdown_mouse_9);
-  DEFSYMBOL (Qdown_mouse_10);
-  DEFSYMBOL (Qdown_mouse_11);
-  DEFSYMBOL (Qdown_mouse_12);
-  DEFSYMBOL (Qdown_mouse_13);
-  DEFSYMBOL (Qdown_mouse_14);
-  DEFSYMBOL (Qdown_mouse_15);
-  DEFSYMBOL (Qdown_mouse_16);
-  DEFSYMBOL (Qdown_mouse_17);
-  DEFSYMBOL (Qdown_mouse_18);
-  DEFSYMBOL (Qdown_mouse_19);
-  DEFSYMBOL (Qdown_mouse_20);
-  DEFSYMBOL (Qdown_mouse_21);
-  DEFSYMBOL (Qdown_mouse_22);
-  DEFSYMBOL (Qdown_mouse_23);
-  DEFSYMBOL (Qdown_mouse_24);
-  DEFSYMBOL (Qdown_mouse_25);
-  DEFSYMBOL (Qdown_mouse_26);
+#define INCLUDE_BUTTON_ZERO
+#define FROB(num)				\
+  DEFSYMBOL (Qbutton##num);			\
+  DEFSYMBOL (Qbutton##num##up);
+#include "keymap-buttons.h"
+#define FROB(num)				\
+  DEFSYMBOL (Qmouse_##num);			\
+  DEFSYMBOL (Qdown_mouse_##num);
+#include "keymap-buttons.h"
   DEFSYMBOL (Qmenu_selection);
   DEFSYMBOL (QLFD);
   DEFSYMBOL (QTAB);
--- a/src/keymap.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/keymap.h	Wed Feb 03 20:18:53 2010 +0000
@@ -39,12 +39,10 @@
 EXFUN (Fwhere_is_internal, 5);
 
 extern Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qshift, Qsuper;
-extern Lisp_Object Qbutton1, Qbutton2, Qbutton3, Qbutton4, Qbutton5;
-extern Lisp_Object Qbutton6, Qbutton7, Qbutton8, Qbutton9, Qbutton10;
-extern Lisp_Object Qbutton11, Qbutton12, Qbutton13, Qbutton14, Qbutton15;
-extern Lisp_Object Qbutton16, Qbutton17, Qbutton18, Qbutton19, Qbutton20;
-extern Lisp_Object Qbutton21, Qbutton22, Qbutton23, Qbutton24, Qbutton25;
-extern Lisp_Object Qbutton26;
+
+#define FROB(num)				\
+extern Lisp_Object Qbutton##num;
+#include "keymap-buttons.h"
 extern Lisp_Object Vmeta_prefix_char;
 
 Lisp_Object get_keymap (Lisp_Object object, int errorp, int autoload);
--- a/src/lisp.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/lisp.h	Wed Feb 03 20:18:53 2010 +0000
@@ -1253,7 +1253,8 @@
 /* Highly dubious kludge */
 /*   (thanks, Jamie, I feel better now -- ben) */
 MODULE_API void assert_failed (const Ascbyte *, int, const Ascbyte *);
-#define ABORT() (assert_failed (__FILE__, __LINE__, "ABORT()"))
+#define ABORT() assert_failed (__FILE__, __LINE__, "ABORT()")
+#define abort_with_message(msg) assert_failed (__FILE__, __LINE__, msg)
 
 /* This used to be ((void) (0)) but that triggers lots of unused variable
    warnings.  It's pointless to force all that code to be rewritten, with
@@ -4415,6 +4416,7 @@
 
 /* Defined in casefiddle.c */
 EXFUN (Fdowncase, 2);
+EXFUN (Fcanoncase, 2);
 EXFUN (Fupcase, 2);
 EXFUN (Fupcase_initials, 2);
 EXFUN (Fupcase_initials_region, 3);
@@ -5074,6 +5076,8 @@
 EXFUN (Felt, 2);
 MODULE_API EXFUN (Fequal, 2);
 MODULE_API EXFUN (Fget, 3);
+MODULE_API EXFUN (Feqlsign, MANY);
+MODULE_API EXFUN (Fequalp, 2);
 EXFUN (Flast, 2);
 EXFUN (Flax_plist_get, 3);
 EXFUN (Flax_plist_remprop, 2);
@@ -5119,7 +5123,7 @@
 Lisp_Object remassq_no_quit (Lisp_Object, Lisp_Object);
 Lisp_Object remrassq_no_quit (Lisp_Object, Lisp_Object);
 
-int plists_differ (Lisp_Object, Lisp_Object, int, int, int);
+int plists_differ (Lisp_Object, Lisp_Object, int, int, int, int);
 Lisp_Object internal_plist_get (Lisp_Object, Lisp_Object);
 void internal_plist_put (Lisp_Object *, Lisp_Object, Lisp_Object);
 int internal_remprop (Lisp_Object *, Lisp_Object);
@@ -5137,12 +5141,14 @@
 				      int depth);
 int internal_equal (Lisp_Object, Lisp_Object, int);
 int internal_equalp (Lisp_Object obj1, Lisp_Object obj2, int depth);
+int internal_equal_0 (Lisp_Object, Lisp_Object, int, int);
 Lisp_Object concat2 (Lisp_Object, Lisp_Object);
 Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object);
 Lisp_Object vconcat2 (Lisp_Object, Lisp_Object);
 Lisp_Object vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object);
 Lisp_Object nconc2 (Lisp_Object, Lisp_Object);
 Lisp_Object bytecode_nconc2 (Lisp_Object *);
+int bytecode_arithcompare (Lisp_Object obj1, Lisp_Object obj2);
 void check_losing_bytecode (const char *, Lisp_Object);
 
 Lisp_Object add_suffix_to_symbol (Lisp_Object symbol,
@@ -5804,7 +5810,7 @@
 int qxestrcasecmp_ascii (const Ibyte *s1, const Ascbyte *s2);
 int qxestrcasecmp_i18n (const Ibyte *s1, const Ibyte *s2);
 int ascii_strcasecmp (const Ascbyte *s1, const Ascbyte *s2);
-int lisp_strcasecmp (Lisp_Object s1, Lisp_Object s2);
+int lisp_strcasecmp_ascii (Lisp_Object s1, Lisp_Object s2);
 int lisp_strcasecmp_i18n (Lisp_Object s1, Lisp_Object s2);
 int qxestrncasecmp (const Ibyte *s1, const Ibyte *s2, Bytecount len);
 int qxestrncasecmp_ascii (const Ibyte *s1, const Ascbyte *s2,
@@ -6030,7 +6036,7 @@
 extern Lisp_Object Vcommand_line_args, Vconfigure_info_directory;
 extern Lisp_Object Vconfigure_site_directory, Vconfigure_site_module_directory;
 extern Lisp_Object Vconsole_list, Vcontrolling_terminal;
-extern Lisp_Object Vcurrent_compiled_function_annotation, Vcurrent_load_list;
+extern Lisp_Object Vcurrent_load_list;
 extern Lisp_Object Vcurrent_mouse_event, Vcurrent_prefix_arg, Vdata_directory;
 extern Lisp_Object Vdirectory_sep_char, Vdisabled_command_hook;
 extern Lisp_Object Vdoc_directory, Vinternal_doc_file_name;
--- a/src/lread.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/lread.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1,7 +1,7 @@
 /* Lisp parsing and input streams.
    Copyright (C) 1985-1989, 1992-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Tinker Systems.
-   Copyright (C) 1996, 2001, 2002, 2003 Ben Wing.
+   Copyright (C) 1996, 2001, 2002, 2003, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -148,10 +148,6 @@
 /* A resizing-buffer stream used to temporarily hold data while reading */
 static Lisp_Object Vread_buffer_stream;
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-Lisp_Object Vcurrent_compiled_function_annotation;
-#endif
-
 static int load_byte_code_version;
 
 /* An array describing all known built-in structure types */
@@ -1451,9 +1447,6 @@
 
   internal_bind_lisp_object (&Vcurrent_load_list, Qnil);
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = Qnil;
-#endif
   GCPRO2 (val, sourcename);
 
   LOADHIST_ATTACH (sourcename);
@@ -1619,9 +1612,6 @@
 
   Vread_objects = Qnil;
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = Qnil;
-#endif
   if (EQ (stream, Qread_char))
     {
       Lisp_Object val = call1 (Qread_from_minibuffer,
@@ -1648,9 +1638,6 @@
   Lisp_Object lispstream = Qnil;
   struct gcpro gcpro1;
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = Qnil;
-#endif
   GCPRO1 (lispstream);
   CHECK_STRING (string);
   get_string_range_byte (string, start, end, &startval, &endval,
@@ -3009,16 +2996,6 @@
 	}
     }
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  if (s->length == 1 && s->allow_dotted_lists && EQ (XCAR (s->head), Qfset))
-    {
-      if (CONSP (elt) && EQ (XCAR (elt), Qquote) && CONSP (XCDR (elt)))
-	Vcurrent_compiled_function_annotation = XCAR (XCDR (elt));
-      else
-	Vcurrent_compiled_function_annotation = elt;
-    }
-#endif
-
   elt = Fcons (elt, Qnil);
   if (!NILP (s->tail))
     XCDR (s->tail) = elt;
@@ -3054,10 +3031,6 @@
 {
   struct read_list_state s;
   struct gcpro gcpro1, gcpro2;
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Lisp_Object old_compiled_function_annotation =
-    Vcurrent_compiled_function_annotation;
-#endif
 
   s.head = Qnil;
   s.tail = Qnil;
@@ -3067,9 +3040,6 @@
   GCPRO2 (s.head, s.tail);
 
   sequence_reader (readcharfun, terminator, &s, read_list_conser);
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = old_compiled_function_annotation;
-#endif
 
   if ((purify_flag || load_force_doc_strings) && check_for_doc_references)
     {
@@ -3477,11 +3447,6 @@
   Vload_file_name_internal = Qnil;
   staticpro (&Vload_file_name_internal);
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = Qnil;
-  staticpro (&Vcurrent_compiled_function_annotation);
-#endif
-
   /* So that early-early stuff will work */
   Ffset (Qload,	Qload_internal);
 
--- a/src/lrecord.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/lrecord.h	Wed Feb 03 20:18:53 2010 +0000
@@ -381,7 +381,8 @@
   void (*finalizer) (void *header, int for_disksave);
 
   /* This can be NULL, meaning compare objects with EQ(). */
-  int (*equal) (Lisp_Object obj1, Lisp_Object obj2, int depth);
+  int (*equal) (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		int foldcase);
 
   /* `hash' generates hash values for use with hash tables that have
      `equal' as their test function.  This can be NULL, meaning use
--- a/src/marker.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/marker.c	Wed Feb 03 20:18:53 2010 +0000
@@ -77,7 +77,8 @@
 }
 
 static int
-marker_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+marker_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	      int UNUSED (foldcase))
 {
   Lisp_Marker *marker1 = XMARKER (obj1);
   Lisp_Marker *marker2 = XMARKER (obj2);
--- a/src/minibuf.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/minibuf.c	Wed Feb 03 20:18:53 2010 +0000
@@ -218,8 +218,8 @@
     {
       while (l)
         {
-          Ichar c1 = DOWNCASE (0, itext_ichar (s1));
-          Ichar c2 = DOWNCASE (0, itext_ichar (s2));
+          Ichar c1 = CANONCASE (0, itext_ichar (s1));
+          Ichar c2 = CANONCASE (0, itext_ichar (s2));
 
           if (c1 == c2)
             {
--- a/src/number.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/number.c	Wed Feb 03 20:18:53 2010 +0000
@@ -74,7 +74,8 @@
 #endif
 
 static int
-bignum_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+bignum_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	      int UNUSED (foldcase))
 {
   return bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2));
 }
@@ -166,7 +167,8 @@
 #endif
 
 static int
-ratio_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+ratio_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	     int UNUSED (foldcase))
 {
   return ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2));
 }
@@ -270,7 +272,8 @@
 #endif
 
 static int
-bigfloat_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+bigfloat_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+		int UNUSED (foldcase))
 {
   return bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2));
 }
--- a/src/objects-gtk-impl.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/objects-gtk-impl.h	Wed Feb 03 20:18:53 2010 +0000
@@ -43,6 +43,7 @@
 
 #define GTK_COLOR_INSTANCE_DATA(c) ((struct gtk_color_instance_data *) (c)->data)
 #define COLOR_INSTANCE_GTK_COLOR(c) (GTK_COLOR_INSTANCE_DATA (c)->color)
+#define XCOLOR_INSTANCE_GTK_COLOR(c) COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (c))
 #define COLOR_INSTANCE_GTK_DEALLOC(c) (GTK_COLOR_INSTANCE_DATA (c)->dealloc_on_gc)
 
 /*****************************************************************************
@@ -57,6 +58,7 @@
 
 #define GTK_FONT_INSTANCE_DATA(f) ((struct gtk_font_instance_data *) (f)->data)
 #define FONT_INSTANCE_GTK_FONT(f) (GTK_FONT_INSTANCE_DATA (f)->font)
+#define XFONT_INSTANCE_GTK_FONT(c) FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (c))
 
 #endif /* HAVE_GTK */
 #endif /* _XEMACS_OBJECTS_GTK_IMPL_H_ */
--- a/src/objects-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/objects-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -39,7 +39,7 @@
 #include "objects-gtk-impl.h"
 
 /* sigh */
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 
 /* XListFonts doesn't allocate memory unconditionally based on this. (For
    XFree86 in 2005, at least. */
--- a/src/objects-x-impl.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/objects-x-impl.h	Wed Feb 03 20:18:53 2010 +0000
@@ -29,7 +29,7 @@
 
 #include "objects-impl.h"
 #include "objects-x.h"
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 /* for resource name definitions, etc */
 #include "../lwlib/lwlib-fonts.h"
 #endif
@@ -45,7 +45,7 @@
   XColor color;
   /* Yes, it looks crazy to have both the XColor and the XftColor, but
      pragmatically both are used. */
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   XftColor xftColor;
 #endif
   char dealloc_on_gc;
@@ -53,7 +53,8 @@
 
 #define X_COLOR_INSTANCE_DATA(c) ((struct x_color_instance_data *) (c)->data)
 #define COLOR_INSTANCE_X_COLOR(c) (X_COLOR_INSTANCE_DATA (c)->color)
-#ifdef USE_XFT
+#define XCOLOR_INSTANCE_X_COLOR(c) COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (c))
+#ifdef HAVE_XFT
 #define COLOR_INSTANCE_X_XFTCOLOR(c) (X_COLOR_INSTANCE_DATA (c)->xftColor)
 #endif
 #define COLOR_INSTANCE_X_DEALLOC(c) (X_COLOR_INSTANCE_DATA (c)->dealloc_on_gc)
@@ -69,7 +70,7 @@
      pragmatically both are used (lwlib delegates labels to the widget sets,
      which internally use XFontStructs). */
   XFontStruct * font;
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   XftFont *xftFont;
 #endif
 
@@ -77,7 +78,8 @@
 
 #define X_FONT_INSTANCE_DATA(f) ((struct x_font_instance_data *) (f)->data)
 #define FONT_INSTANCE_X_FONT(f) (X_FONT_INSTANCE_DATA (f)->font)
-#ifdef USE_XFT
+#define XFONT_INSTANCE_X_FONT(c) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (c))
+#ifdef HAVE_XFT
 #define FONT_INSTANCE_X_XFTFONT(f) (X_FONT_INSTANCE_DATA (f)->xftFont)
 #endif
 
--- a/src/objects-x.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/objects-x.c	Wed Feb 03 20:18:53 2010 +0000
@@ -39,7 +39,7 @@
 #include "objects-x-impl.h"
 #include "elhash.h"
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #include "font-mgr.h"
 #endif
 
@@ -92,7 +92,7 @@
 			     Lisp_Object device, Error_Behavior errb)
 {
   XColor color;
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   XftColor xftColor;
 #endif
   int result;
@@ -111,7 +111,7 @@
     COLOR_INSTANCE_X_DEALLOC (c) = 1;
   COLOR_INSTANCE_X_COLOR (c) = color;
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   xftColor.pixel = color.pixel;
   xftColor.color.red = color.red;
   xftColor.color.green = color.green;
@@ -218,13 +218,13 @@
   Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device));
   Extbyte *extname;
   XFontStruct *fs = NULL;	/* _F_ont _S_truct */
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   XftFont *rf = NULL;		/* _R_ender _F_ont (X Render extension) */
 #else
 #define rf (0)
 #endif
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   DEBUG_XFT1 (2, "attempting to initialize font spec %s\n",
 	      XSTRING_DATA(f->name));
   /* #### serialize (optimize) these later... */
@@ -272,7 +272,7 @@
      fear that the finalize method may get fucked. */
   f->data = xnew (struct x_font_instance_data);
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   FONT_INSTANCE_X_XFTFONT (f) = rf;
   if (rf)
     /* Have an Xft font, initialize font info from it. */
@@ -379,7 +379,7 @@
 			    !fs->all_chars_exist));
     }
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   if (debug_xft > 0)
     {
       int n = 3, d = 5;
@@ -411,7 +411,7 @@
       write_fmt_string (printcharfun, " font id: 0x%lx,",
 			(unsigned long) FONT_INSTANCE_X_FONT (f)->fid);
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   /* #### What should we do here?  For now, print the address. */
   if (FONT_INSTANCE_X_XFTFONT (f))
     write_fmt_string (printcharfun, " xft font: 0x%lx",
@@ -423,7 +423,7 @@
 x_finalize_font_instance (Lisp_Font_Instance *f)
 {
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   DEBUG_XFT1 (0, "finalizing %s\n", (STRINGP (f->name)
 				   ? (char *) XSTRING_DATA (f->name)
 				   : "(unnamed font)"));
@@ -437,7 +437,7 @@
 
 	  if (FONT_INSTANCE_X_FONT (f))
 	    XFreeFont (dpy, FONT_INSTANCE_X_FONT (f));
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 	  if (FONT_INSTANCE_X_XFTFONT (f))
 	    XftFontClose (dpy, FONT_INSTANCE_X_XFTFONT (f));
 #endif
@@ -752,7 +752,7 @@
      and otherwise only return when we return something desperate that
      doesn't get stored for future use. */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   /* First, try an Xft font. */
   if (NILP (FONT_INSTANCE_TRUENAME (f)) && FONT_INSTANCE_X_XFTFONT (f))
     {
@@ -779,7 +779,7 @@
 	  /* used to return Qnil here */
 	}
     }
-#endif	/* USE_XFT */
+#endif	/* HAVE_XFT */
 
   /* OK, fall back to core font. */
   if (NILP (FONT_INSTANCE_TRUENAME (f))
@@ -961,7 +961,7 @@
 */ );
   x_handle_non_fully_specified_fonts = 0;
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   Fprovide (intern ("xft-fonts"));
 #endif
 }
--- a/src/objects-x.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/objects-x.h	Wed Feb 03 20:18:53 2010 +0000
@@ -32,7 +32,7 @@
 
 #ifdef HAVE_X_WINDOWS
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 EXFUN (Ffc_font_real_pattern, 2);
 #endif
 
--- a/src/objects-xlike-inc.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/objects-xlike-inc.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1,4 +1,4 @@
-/* Shared object code between X and GTK -- include file.
+/* Common code between X and GTK -- fonts and colors.
    Copyright (C) 1991-5, 1997 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
    Copyright (C) 1996, 2001, 2002, 2003 Ben Wing.
@@ -22,10 +22,18 @@
 
 /* Synched up with: Not in FSF. */
 
+/* Before including this file, you need to define either THIS_IS_X or
+   THIS_IS_GTK. */
+
+/* See comment at top of console-xlike-inc.h for an explanation of
+   how this file works. */
+
 /* Pango is ready for prime-time now, as far as I understand it. The GTK
    people should be using that. Oh well. (Aidan Kehoe, Sat Nov 4 12:41:12
    CET 2006) */
 
+#include "console-xlike-inc.h"
+
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
 
 #ifdef DEBUG_XEMACS
@@ -78,19 +86,11 @@
 }
 
 static int
-#ifdef THIS_IS_GTK
-gtk_font_spec_matches_charset (struct device * USED_IF_XFT (d),
-			       Lisp_Object charset,
-			       const Ibyte *nonreloc, Lisp_Object reloc,
-			       Bytecount offset, Bytecount length,
-			       enum font_specifier_matchspec_stages stage)
-#else
-x_font_spec_matches_charset (struct device * USED_IF_XFT (d),
-			     Lisp_Object charset,
-			     const Ibyte *nonreloc, Lisp_Object reloc,
-			     Bytecount offset, Bytecount length,
-			     enum font_specifier_matchspec_stages stage)
-#endif
+XFUN (font_spec_matches_charset) (struct device * USED_IF_XFT (d),
+				  Lisp_Object charset,
+				  const Ibyte *nonreloc, Lisp_Object reloc,
+				  Bytecount offset, Bytecount length,
+				  enum font_specifier_matchspec_stages stage)
 {
   Lisp_Object registries = Qnil;
   long i, registries_len;
@@ -198,12 +198,7 @@
   int count = 0, i;
   DECLARE_EISTRING(ei_single_result);
 
-  names = XListFonts (
-#ifdef THIS_IS_GTK
-		      GDK_DISPLAY (),
-#else
-		      DEVICE_X_DISPLAY (XDEVICE (device)),
-#endif
+  names = XListFonts (GET_XLIKE_DISPLAY (XDEVICE (device)),
 		      xlfd, MAX_FONT_COUNT, &count);
 
   for (i = 0; i < count; ++i)
@@ -664,14 +659,9 @@
 /* find a font spec that matches font spec FONT and also matches
    (the registry of) CHARSET. */
 static Lisp_Object
-#ifdef THIS_IS_GTK
-gtk_find_charset_font (Lisp_Object device, Lisp_Object font,
-		       Lisp_Object charset,
-		       enum font_specifier_matchspec_stages stage)
-#else
-x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset,
-		     enum font_specifier_matchspec_stages stage)
-#endif
+XFUN (find_charset_font) (Lisp_Object device, Lisp_Object font,
+			  Lisp_Object charset,
+			  enum font_specifier_matchspec_stages stage)
 {
   Lisp_Object result = Qnil, registries = Qnil;
   int j, hyphen_count, registries_len = 0;
--- a/src/objects.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/objects.c	Wed Feb 03 20:18:53 2010 +0000
@@ -124,7 +124,8 @@
 }
 
 static int
-color_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+color_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		      int UNUSED (foldcase))
 {
   Lisp_Color_Instance *c1 = XCOLOR_INSTANCE (obj1);
   Lisp_Color_Instance *c2 = XCOLOR_INSTANCE (obj2);
@@ -347,7 +348,8 @@
    this means the `equal' could cause XListFonts to be run the first time.
  */
 static int
-font_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+font_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		     int UNUSED (foldcase))
 {
   /* #### should this be moved into a device method? */
   return internal_equal (font_instance_truename_internal
--- a/src/opaque.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/opaque.c	Wed Feb 03 20:18:53 2010 +0000
@@ -93,7 +93,8 @@
 /* This will not work correctly for opaques with subobjects! */
 
 static int
-equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	      int UNUSED (foldcase))
 {
   Bytecount size;
   return ((size = XOPAQUE_SIZE (obj1)) == XOPAQUE_SIZE (obj2) &&
@@ -138,7 +139,8 @@
 }
 
 static int
-equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+		  int UNUSED (foldcase))
 {
   return (XOPAQUE_PTR (obj1)->ptr == XOPAQUE_PTR (obj2)->ptr);
 }
--- a/src/rangetab.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/rangetab.c	Wed Feb 03 20:18:53 2010 +0000
@@ -137,7 +137,7 @@
 }
 
 static int
-range_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+range_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   Lisp_Range_Table *rt1 = XRANGE_TABLE (obj1);
   Lisp_Range_Table *rt2 = XRANGE_TABLE (obj2);
@@ -153,7 +153,7 @@
 
       if (rte1->first != rte2->first
 	  || rte1->last != rte2->last
-	  || !internal_equal (rte1->val, rte2->val, depth + 1))
+	  || !internal_equal_0 (rte1->val, rte2->val, depth + 1, foldcase))
 	return 0;
     }
 
--- a/src/redisplay-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/redisplay-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -23,75 +23,50 @@
 
 /* Synched up with:  Not in FSF. */
 
+#define THIS_IS_GTK
 #include "redisplay-xlike-inc.c"
 
 /*****************************************************************************
- gtk_bevel_modeline
+ Draw a shadow around the given area using the standard theme engine routines.
+ ****************************************************************************/
 
- Draw a 3d border around the modeline on window W.
- ****************************************************************************/
 static void
-gtk_bevel_modeline (struct window *w, struct display_line *dl)
+XLIKE_bevel_area (struct window *w, face_index UNUSED (findex),
+		  int x, int y, int width, int height,
+		  int shadow_thickness, int UNUSED (edges),
+		  enum edge_style style)
 {
   struct frame *f = XFRAME (w->frame);
-  int shadow_thickness = MODELINE_SHADOW_THICKNESS (w);
-  int x,y, width, height;
-
-  x = WINDOW_MODELINE_LEFT (w);
-  width = WINDOW_MODELINE_RIGHT (w) - x;
-  y = dl->ypos - dl->ascent - shadow_thickness;
-  height = dl->ascent + dl->descent + 2 * shadow_thickness;
-
-  gtk_output_shadows (f, x, y, width, height, shadow_thickness);
-}
-
-/*****************************************************************************
- gtk_output_shadows
+  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
+  GtkStyle *gstyle = FRAME_GTK_TEXT_WIDGET (f)->style;
+  GtkShadowType stype;
 
- Draw a shadow around the given area using the standard theme engine routines.
- ****************************************************************************/
-void
-gtk_output_shadows (struct frame *f, int x, int y, int width, int height,
-		    int shadow_thickness)
-{
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-  GtkStyle *style = FRAME_GTK_TEXT_WIDGET (f)->style;
-  GtkShadowType stype = GTK_SHADOW_OUT;
-
-  if (shadow_thickness < 0)
-  {
-      stype = GTK_SHADOW_IN;
-  }
-  else if (shadow_thickness == 0)
-  {
-      stype = GTK_SHADOW_NONE;
-  }
+  if (shadow_thickness == 0)
+    stype = GTK_SHADOW_NONE;
+  else
+    switch (style)
+      {
+      case EDGE_BEVEL_IN: style = GTK_SHADOW_IN; break;
+      case EDGE_BEVEL_OUT: style = GTK_SHADOW_OUT; break;
+      case EDGE_ETCHED_IN: style = GTK_SHADOW_ETCHED_IN; break;
+      case EDGE_ETCHED_OUT: style = GTK_SHADOW_ETCHED_OUT; break;
+      default: ABORT (); style = GTK_SHADOW_OUT;
+      }
 
   /* Do we want to have some magic constants to set
      GTK_SHADOW_ETCHED_IN or GTK_SHADOW_ETCHED_OUT? */
 
-  gtk_paint_shadow (style, x_win, GTK_STATE_NORMAL, stype, NULL,
+  gtk_paint_shadow (gstyle, x_win, GTK_STATE_NORMAL, stype, NULL,
 		    FRAME_GTK_TEXT_WIDGET (f), "modeline",
 		    x, y, width, height);
 }
 
-static void
-gtk_bevel_area (struct window *w, face_index UNUSED (findex),
-		int x, int y, int width, int height,
-		int shadow_thickness, int UNUSED (edges),
-		enum edge_style UNUSED (style))
-{
-  struct frame *f = XFRAME (w->frame);
-
-  gtk_output_shadows (f, x, y, width, height, shadow_thickness);
-}
-
 
 
 /* Make audible bell.  */
 static void
-gtk_ring_bell (struct device *UNUSED (d), int volume, int UNUSED (pitch),
-	       int UNUSED (duration))
+XLIKE_ring_bell (struct device *UNUSED (d), int volume, int UNUSED (pitch),
+		 int UNUSED (duration))
 {
   /* Gdk does not allow us to control the duration / pitch / volume */
   if (volume > 0)
@@ -106,16 +81,16 @@
    single $#!%@ing piece of text, which I do NOT want to do. */
 #define USE_X_SPECIFIC_DRAW_ROUTINES 1
 
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 
-static
-void gdk_draw_text_image (GdkDrawable *drawable,
-			  GdkFont     *font,
-			  GdkGC       *gc,
-			  gint         x,
-			  gint         y,
-			  const gchar *text,
-			  gint         text_length)
+static void
+gdk_draw_text_image (GdkDrawable *drawable,
+		     GdkFont     *font,
+		     GdkGC       *gc,
+		     gint         x,
+		     gint         y,
+		     const gchar *text,
+		     gint         text_length)
 {
 #if !USE_X_SPECIFIC_DRAW_ROUTINES
   int width = gdk_text_measure (font, text, text_length);
--- a/src/redisplay-x.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/redisplay-x.c	Wed Feb 03 20:18:53 2010 +0000
@@ -32,8 +32,12 @@
 int x_interline_space; /* #### this needs to be implemented, but per-font */
 
 #define THIS_IS_X
+#include "redisplay-xlike-inc.c"
 
-#include "redisplay-xlike-inc.c"
+static void x_output_shadows (struct frame *f, int x, int y, int width,
+			      int height, GC top_shadow_gc,
+			      GC bottom_shadow_gc, GC background_gc,
+			      int shadow_thickness, int edges);
 
 /*****************************************************************************
  x_window_output_begin
@@ -41,7 +45,7 @@
  Perform any necessary initialization prior to an update.
  ****************************************************************************/
 static void
-x_window_output_begin (struct window *UNUSED (w))
+XLIKE_window_output_begin (struct window *UNUSED (w))
 {
 }
 
@@ -51,7 +55,7 @@
  Perform any necessary flushing of queues when an update has completed.
  ****************************************************************************/
 static void
-x_window_output_end (struct window *w)
+XLIKE_window_output_end (struct window *w)
 {
   if (!(check_if_pending_expose_event (WINDOW_XDEVICE (w))))
     XFlush (DEVICE_X_DISPLAY (WINDOW_XDEVICE (w)));
@@ -63,9 +67,9 @@
  Draw shadows for the given area in the given face.
  ****************************************************************************/
 static void
-x_bevel_area (struct window *w, face_index findex,
-	      int x, int y, int width, int height,
-	      int shadow_thickness, int edges, enum edge_style style)
+XLIKE_bevel_area (struct window *w, face_index findex,
+		  int x, int y, int width, int height,
+		  int shadow_thickness, int edges, enum edge_style style)
 {
   struct frame *f = XFRAME (w->frame);
   struct device *d = XDEVICE (f->device);
@@ -188,7 +192,7 @@
  Draw a shadow around the given area using the given GC's.  It is the
  callers responsibility to set the GC's appropriately.
  ****************************************************************************/
-void
+static void
 x_output_shadows (struct frame *f, int x, int y, int width, int height,
 		  GC top_shadow_gc, GC bottom_shadow_gc,
 		  GC UNUSED (background_gc), int shadow_thickness, int edges)
@@ -338,7 +342,7 @@
 /* Make audible bell.  */
 
 static void
-x_ring_bell (struct device *d, int volume, int pitch, int duration)
+XLIKE_ring_bell (struct device *d, int volume, int pitch, int duration)
 {
   Display *display = DEVICE_X_DISPLAY (d);
 
--- a/src/redisplay-xlike-inc.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/redisplay-xlike-inc.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1,4 +1,4 @@
-/* Common code between X and GTK.
+/* Common code between X and GTK -- redisplay-related.
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1994 Lucid, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
@@ -29,6 +29,9 @@
 
 /* Lots of work done by Ben Wing for Mule */
 
+/* Before including this file, you need to define either THIS_IS_X or
+   THIS_IS_GTK.  See comments in console-xlike-inc.h. */
+
 #include <config.h>
 #include "lisp.h"
 
@@ -48,288 +51,46 @@
 #endif
 #include "charset.h"
 
-#ifdef THIS_IS_X
-#include "console-x-impl.h"
-#include "glyphs-x.h"
-#include "objects-x-impl.h"
-#include "xgccache.h"
-#else /* THIS_IS_GTK */
-#include "console-gtk-impl.h"
-#include "gccache-gtk.h"
-#include "glyphs-gtk.h"
-#include "objects-gtk-impl.h"
-#endif /* THIS_IS_GTK */
-
-#include "EmacsFrame.h"
-#include "EmacsFrameP.h"
+#define NEED_GCCACHE_H
+#define NEED_GLYPHS_H
+#define NEED_OBJECTS_IMPL_H
+#include "console-xlike-inc.h"
 
 #include "sysproc.h" /* for select() */
 
 #ifdef THIS_IS_X
+#include "EmacsFrame.h"
+#include "EmacsFrameP.h"
+
 #include <X11/bitmaps/gray>
 #endif /* THIS_IS_X */
 
 #define EOL_CURSOR_WIDTH	5
 
-/* About some of the types below:
-
-   X has two ways of representing a color: (a) as an unsigned long
-   representing a color pixel value, i.e. the actual value stored in memory
-   or a file at a particular pixel location to indicate that the pixel
-   takes on a specific color; and (b) an XColor structure, which
-   encapsulates both the RGB components of a color and the associated color
-   pixel value.
-
-   We call the former type XLIKE_PIXCOLOR and the latter XLIKE_COLOR.
-   GTK uses the same GdkColor structure for both, and normally passes in
-   a pointer.  We provide routines to handle the two logical color types.  */
-
-#ifdef THIS_IS_X
-
-/***************************************************************************/
-/*               Definitions implementing X flavor of XLIKE                */
-/***************************************************************************/
-
-#define XLIKE_NAME x
-#define USED_IF_X(var) var
-
-/* types */
-#define XLIKE_DISPLAY Display *
-#define XLIKE_WINDOW Window
-#define XLIKE_GC GC
-#define XLIKE_RECTANGLE XRectangle
-#define XLIKE_GCVALUES XGCValues
-#define XLIKE_COLOR XColor
-#define XLIKE_PIXCOLOR unsigned long
-
-/* constants */
-#define XLIKE_NONE None
-#define XLIKE_FALSE False
-
-#define XLIKE_GC_BACKGROUND GCBackground
-#define XLIKE_GC_CLIP_MASK GCClipMask
-#define XLIKE_GC_CLIP_X_ORIGIN GCClipXOrigin
-#define XLIKE_GC_CLIP_Y_ORIGIN GCClipYOrigin
-#define XLIKE_GC_EXPOSURES GCGraphicsExposures
-#define XLIKE_GC_FILL GCFillStyle
-#define XLIKE_GC_FONT GCFont
-#define XLIKE_GC_FOREGROUND GCForeground
-#define XLIKE_GC_FUNCTION GCFunction
-#define XLIKE_GC_LINE_WIDTH GCLineWidth
-#define XLIKE_GC_STIPPLE GCStipple
-#define XLIKE_GC_TILE GCTile
-
-#define XLIKE_GX_COPY GXcopy
-#define XLIKE_GX_XOR GXxor
-
-#define XLIKE_FILL_MEMBER fill_style
-#define XLIKE_FILL_STIPPLED FillStippled
-#define XLIKE_FILL_OPAQUE_STIPPLED FillOpaqueStippled
-#define XLIKE_FILL_TILED FillTiled
-#define XLIKE_FILL_SOLID FillSolid
-
-/* functions */
-#define GET_XLIKE_DISPLAY(d) DEVICE_X_DISPLAY (d)
-#define GET_XLIKE_WINDOW(w) XtWindow (FRAME_X_TEXT_WIDGET (f))
-#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
-  XFillRectangle (dpy, x_win, gc, x, y, width, height)
-#define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
-  XDrawRectangle (dpy, x_win, gc, x, y, width, height)
-#define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2) \
-  XDrawLine (dpy, x_win, gc, x1, y1, x2, y2)
-#define XLIKE_OUTPUT_XLIKE_PIXMAP x_output_x_pixmap
-
-#define XLIKE_DISPLAY_LINE_HEIGHT(dl) DISPLAY_LINE_HEIGHT (dl)
-#define XLIKE_DISPLAY_LINE_YPOS(dl) DISPLAY_LINE_YPOS (dl)
-#define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) ((dl)->top_clip)
-#define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect)		\
-  /* #### why not Unsorted? */						\
-  XSetClipRectangles (dpy, gc, xorig, yorig, prect, 1, YXBanded)
-#define XLIKE_CLEAR_CLIP_MASK(dpy, gc)		\
-do						\
-  {						\
-    XSetClipMask (dpy, gc, None);		\
-    XSetClipOrigin (dpy, gc, 0, 0);		\
-  }						\
-while (0)
-#define XLIKE_FLUSH(dpy) XSync (dpy, False)
-#define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \
-  XClearArea (dpy, win, x, y, width, height, False)
- 
-#define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_X_MASK
-#define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_X_PIXMAP
-#define COLOR_INSTANCE_XLIKE_COLOR COLOR_INSTANCE_X_COLOR
-#define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_X_FONT
-#define DEVICE_XLIKE_GC_CACHE DEVICE_X_GC_CACHE
-#define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_X_GRAY_PIXMAP
-#define XLIKE_COLOR_TO_PIXCOLOR(ci) ((ci).pixel)
-#define XLIKE_SET_PIXCOLOR_COPY(lval, rval) ((lval) = (rval))
-#define XLIKE_SET_PIXCOLOR_NUM(lval, rval) ((lval) = (rval))
-#define XLIKE_FONT_NUM(val) ((val)->fid)
-
-#define XLIKE_OUTPUT_XLIKE_PIXMAP x_output_x_pixmap
-
-/************ End X flavor of XLIKE **********/
-
-
-
-
-#else /* THIS_IS_GTK */
-
-/***************************************************************************/
-/*              Definitions implementing GTK flavor of XLIKE               */
-/***************************************************************************/
-
-#define XLIKE_NAME gtk
-#define USED_IF_X(var) UNUSED (var)
-
-/*types */
-#define XLIKE_DISPLAY void *
-#define XLIKE_WINDOW GdkWindow *
-#define XLIKE_GC GdkGC *
-#define XLIKE_RECTANGLE GdkRectangle
-#define XLIKE_GCVALUES GdkGCValues
-#define XLIKE_COLOR GdkColor *
-#define XLIKE_PIXCOLOR GdkColor *
-
-/* constants */
-#define XLIKE_NONE 0
-#define XLIKE_FALSE FALSE
-
-#define XLIKE_GC_BACKGROUND GDK_GC_BACKGROUND
-#define XLIKE_GC_CLIP_MASK GDK_GC_CLIP_MASK
-#define XLIKE_GC_CLIP_X_ORIGIN GDK_GC_CLIP_X_ORIGIN
-#define XLIKE_GC_CLIP_Y_ORIGIN GDK_GC_CLIP_Y_ORIGIN
-#define XLIKE_GC_EXPOSURES GDK_GC_EXPOSURES
-#define XLIKE_GC_FILL GDK_GC_FILL
-#define XLIKE_GC_FONT GDK_GC_FONT
-#define XLIKE_GC_FOREGROUND GDK_GC_FOREGROUND
-#define XLIKE_GC_FUNCTION GDK_GC_FUNCTION
-#define XLIKE_GC_LINE_WIDTH GDK_GC_LINE_WIDTH
-#define XLIKE_GC_STIPPLE GDK_GC_STIPPLE
-#define XLIKE_GC_TILE GDK_GC_TILE
-
-#define XLIKE_GX_COPY GDK_COPY
-#define XLIKE_GX_XOR GDK_XOR
-
-#define XLIKE_FILL_MEMBER fill
-#define XLIKE_FILL_STIPPLED GDK_STIPPLED
-#define XLIKE_FILL_OPAQUE_STIPPLED GDK_OPAQUE_STIPPLED
-#define XLIKE_FILL_TILED GDK_TILED
-#define XLIKE_FILL_SOLID GDK_SOLID
-
-/* functions */
-
-#define GET_XLIKE_DISPLAY(d) NULL
-#define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
-#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
-  gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, x, y, width, height)
-#define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
-  gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, FALSE, x, y, width, height)
-#define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2) \
-  gdk_draw_line (GDK_DRAWABLE (x_win), gc, x1, y1, x2, y2)
-#define XLIKE_OUTPUT_XLIKE_PIXMAP gtk_output_gdk_pixmap
-
-/* FIXME: This is totally bogus.  It removes dl->top_clip from the
-   equations.  If there is a bug involving this, fix it properly!
-   Or just ensure that top_clip is 0. */
-#define XLIKE_DISPLAY_LINE_HEIGHT(dl) \
-  ((dl)->ascent + ((dl)->descent - (dl)->clip)
-#define XLIKE_DISPLAY_LINE_YPOS(dl) ((dl)->ypos - (dl)->ascent)
-#define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) ((0)
-#define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect)	\
-do								\
-  {								\
-    gdk_gc_set_clip_rectangle (gc, prect);			\
-    gdk_gc_set_clip_origin (gc, xorig, yorig);			\
-  }								\
-while (0)
-#define XLIKE_CLEAR_CLIP_MASK(dpy, gc)		\
-do						\
-  {						\
-    gdk_gc_set_clip_rectangle (gc, NULL);	\
-    gdk_gc_set_clip_origin (gc, 0, 0);		\
-  }						\
-while (0)
-#define XLIKE_FLUSH(dpy) gdk_flush ()
-#define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \
-  gdk_window_clear_area (win, x, y, width, height)
-
-#define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_GTK_MASK
-#define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_GTK_PIXMAP
-#define COLOR_INSTANCE_XLIKE_COLOR COLOR_INSTANCE_GTK_COLOR
-#define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_GTK_FONT
-#define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_GTK_GRAY_PIXMAP
-#define DEVICE_XLIKE_GC_CACHE DEVICE_GTK_GC_CACHE
-#define XLIKE_COLOR_TO_PIXCOLOR(ci) (ci)
-#define XLIKE_SET_PIXCOLOR_COPY(lval, rval) ((lval) = *(rval))
-#define XLIKE_SET_PIXCOLOR_NUM(lval, rval) ((lval).pixel = (rval))
-#define XLIKE_FONT_NUM(val) (val)
-
-#define XLIKE_OUTPUT_XLIKE_PIXMAP gtk_output_gdk_pixmap
-
-static void gtk_output_pixmap (struct window *w,
-			       Lisp_Object image_instance,
-			       struct display_box *db,
-			       struct display_glyph_area *dga,
-			       face_index findex,
-			       int cursor_start,
-			       int cursor_width,
-			       int cursor_height,
-			       int bgpixmap);
-static void gtk_clear_region (Lisp_Object locale, struct device* d,
-			      struct frame* f, face_index findex, int x, int y,
-			      int width, int height, Lisp_Object fcolor,
-			      Lisp_Object bcolor,
-			      Lisp_Object background_pixmap);
-static void gtk_bevel_modeline (struct window *w, struct display_line *dl);
-
-#if 0
-static void __describe_gc (GdkGC *);
-#endif
-
-/************ End GTK flavor of XLIKE **********/
-
-#endif /* (not) THIS_IS_X */
-
-
-
-/***************************************************************************/
-/*                           Common definitions                            */
-/***************************************************************************/
-
-#define XCOLOR_INSTANCE_XLIKE_COLOR(x) \
-  COLOR_INSTANCE_XLIKE_COLOR (XCOLOR_INSTANCE (x))
-
-#define XLIKE_PASTE_1(a,b) a##_##b
-#define XLIKE_PASTE(a,b) XLIKE_PASTE_1(a,b)
-#define XLIKE_CONSOLE_HAS_METHOD_1(xlike, name) CONSOLE_HAS_METHOD (xlike, name)
-#define XLIKE_CONSOLE_HAS_METHOD(name) \
-  XLIKE_CONSOLE_HAS_METHOD_1 (XLIKE_NAME, name)
-
 /* Device methods */
 
-#define XLIKE_text_width XLIKE_PASTE (XLIKE_NAME, text_width)
-#define XLIKE_output_display_block XLIKE_PASTE (XLIKE_NAME, output_display_block)
-#define XLIKE_divider_height XLIKE_PASTE (XLIKE_NAME, divider_height)
-#define XLIKE_eol_cursor_width XLIKE_PASTE (XLIKE_NAME, eol_cursor_width)
-#define XLIKE_output_vertical_divider XLIKE_PASTE (XLIKE_NAME, output_vertical_divider)
-#define XLIKE_clear_region XLIKE_PASTE (XLIKE_NAME, clear_region)
-#define XLIKE_clear_frame XLIKE_PASTE (XLIKE_NAME, clear_frame)
-#define XLIKE_flash XLIKE_PASTE (XLIKE_NAME, flash)
-#define XLIKE_ring_bell XLIKE_PASTE (XLIKE_NAME, ring_bell)
-#define XLIKE_bevel_area XLIKE_PASTE (XLIKE_NAME, bevel_area)
-#define XLIKE_output_string XLIKE_PASTE (XLIKE_NAME, output_string)
-#define XLIKE_output_pixmap XLIKE_PASTE (XLIKE_NAME, output_pixmap)
-#define XLIKE_window_output_begin XLIKE_PASTE (XLIKE_NAME, window_output_begin)
-#define XLIKE_window_output_end XLIKE_PASTE (XLIKE_NAME, window_output_end)
+#define XLIKE_text_width XFUN (text_width)
+#define XLIKE_output_display_block XFUN (output_display_block)
+#define XLIKE_divider_height XFUN (divider_height)
+#define XLIKE_eol_cursor_width XFUN (eol_cursor_width)
+#define XLIKE_output_vertical_divider XFUN (output_vertical_divider)
+#define XLIKE_clear_region XFUN (clear_region)
+#define XLIKE_clear_frame XFUN (clear_frame)
+#define XLIKE_flash XFUN (flash)
+#define XLIKE_ring_bell XFUN (ring_bell)
+#define XLIKE_bevel_area XFUN (bevel_area)
+#define XLIKE_output_string XFUN (output_string)
+#define XLIKE_output_pixmap XFUN (output_pixmap)
+#define XLIKE_output_xlike_pixmap XFUN (output_xlike_pixmap)
+#define XLIKE_window_output_begin XFUN (window_output_begin)
+#define XLIKE_window_output_end XFUN (window_output_end)
 
 /* Miscellaneous split functions */
 
 #define console_type_create_redisplay_XLIKE XLIKE_PASTE (console_type_create_redisplay, XLIKE_NAME)
-#define XLIKE_get_gc XLIKE_PASTE (XLIKE_NAME, get_gc)
-#define XLIKE_output_blank XLIKE_PASTE (XLIKE_NAME, output_blank)
-#define XLIKE_text_width_single_run XLIKE_PASTE (XLIKE_NAME, text_width_single_run)
+#define XLIKE_get_gc XFUN (get_gc)
+#define XLIKE_output_blank XFUN (output_blank)
+#define XLIKE_text_width_single_run XFUN (text_width_single_run)
 
 static void XLIKE_output_blank (struct window *w, struct display_line *dl,
 				struct rune *rb, int start_pixpos,
@@ -337,16 +98,10 @@
 static void XLIKE_output_horizontal_line (struct window *w,
 					  struct display_line *dl,
 					  struct rune *rb);
-
-static void XLIKE_output_vertical_divider (struct window *w, int clear);
-
 static void XLIKE_output_eol_cursor (struct window *w,
 				     struct display_line *dl,
 				     int xpos, face_index findex);
-static void XLIKE_clear_frame (struct frame *f);
 static void XLIKE_clear_frame_windows (Lisp_Object window);
-static void XLIKE_window_output_begin (struct window *w);
-static void XLIKE_window_output_end (struct window *w);
 static void XLIKE_bevel_area (struct window *w, face_index findex,
 			      int x, int y, int width, int height,
 			      int shadow_thickness, int edges,
@@ -354,6 +109,12 @@
 static void XLIKE_ring_bell (struct device *d, int volume, int pitch,
 			     int duration);
 
+#ifdef THIS_IS_X
+static void XLIKE_window_output_begin (struct window *UNUSED (w));
+static void XLIKE_window_output_end (struct window *w);
+#endif /* THIS_IS_X */
+
+
 /****************************************************************************/
 /*                                                                          */
 /*                           Separate textual runs                          */
@@ -735,24 +496,14 @@
     {
       if (run->dimension == 2)
 	{	
-#ifdef THIS_IS_X
-	  return XTextWidth16 (FONT_INSTANCE_X_FONT (fi),
-			       (XChar2b *) run->ptr, run->len);
-#else /* THIS_IS_GTK */
 	  /* stderr_out ("Measuring wide characters\n"); */
-	  return gdk_text_width_wc (FONT_INSTANCE_GTK_FONT (fi),
-				    (GdkWChar *) run->ptr, run->len);
-#endif /* THIS_IS_GTK */
+	  return XLIKE_TEXT_WIDTH_WIDE (FONT_INSTANCE_XLIKE_FONT (fi),
+					run->ptr, run->len);
 	}
       else
 	{
-#ifdef THIS_IS_X
-	  return XTextWidth (FONT_INSTANCE_X_FONT (fi),
-			     (char *) run->ptr, run->len);
-#else /* THIS_IS_GTK */
-	  return gdk_text_width (FONT_INSTANCE_GTK_FONT (fi),
-				 (char *) run->ptr, run->len);
-#endif /* THIS_IS_GTK */
+	  return XLIKE_TEXT_WIDTH (FONT_INSTANCE_XLIKE_FONT (fi),
+				   run->ptr, run->len);
 	}
     }
   else
@@ -760,6 +511,7 @@
   return 0;			/* shut up GCC */
 }
 
+
 /*
    XLIKE_text_width
 
@@ -768,10 +520,10 @@
    */
 
 /* #### Break me out into a separate header */
-int XLIKE_text_width (struct frame *USED_IF_X (f), struct face_cachel *cachel,
+int XLIKE_text_width (struct frame *f, struct face_cachel *cachel,
 		      const Ichar *str, Charcount len);
 int
-XLIKE_text_width (struct frame *USED_IF_X (f), struct face_cachel *cachel,
+XLIKE_text_width (struct frame *f, struct face_cachel *cachel,
 		  const Ichar *str, Charcount len)
 {
   /* !!#### Needs review */
@@ -1060,12 +812,18 @@
   Dynarr_free (buf);
 }
 
+/* Called as gtk_get_gc from gtk-glue.c */
+
+XLIKE_GC XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, 
+		       Lisp_Object bg, Lisp_Object bg_pmap,
+		       Lisp_Object lwidth);
+
 /*****************************************************************************
  XLIKE_get_gc
 
  Given a number of parameters return a GC with those properties.
  ****************************************************************************/
-static XLIKE_GC
+XLIKE_GC
 XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, 
 	      Lisp_Object bg, Lisp_Object bg_pmap, Lisp_Object lwidth)
 {
@@ -1079,7 +837,7 @@
   gcv.clip_mask = XLIKE_NONE;
   gcv.clip_x_origin = 0;
   gcv.clip_y_origin = 0;
-  gcv.XLIKE_FILL_MEMBER = XLIKE_FILL_SOLID;
+  XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_SOLID);
   mask = XLIKE_GC_EXPOSURES | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN;
   mask |= XLIKE_GC_FILL;
 
@@ -1109,22 +867,18 @@
   if (!NILP (fg))
     {
       if (COLOR_INSTANCEP (fg))
-	XLIKE_SET_PIXCOLOR_COPY
-	  (gcv.foreground,
-	   XLIKE_COLOR_TO_PIXCOLOR (XCOLOR_INSTANCE_XLIKE_COLOR (fg)));
+	XLIKE_SET_GC_COLOR (gcv.foreground, XCOLOR_INSTANCE_XLIKE_COLOR (fg));
       else
-	XLIKE_SET_PIXCOLOR_NUM (gcv.foreground, XINT (fg));
+	XLIKE_SET_GC_PIXEL (gcv.foreground, XINT (fg));
       mask |= XLIKE_GC_FOREGROUND;
     }
 
   if (!NILP (bg))
     {
       if (COLOR_INSTANCEP (bg))
-	XLIKE_SET_PIXCOLOR_COPY
-	  (gcv.background,
-	   XLIKE_COLOR_TO_PIXCOLOR (XCOLOR_INSTANCE_XLIKE_COLOR (bg)));
+	XLIKE_SET_GC_COLOR (gcv.background, XCOLOR_INSTANCE_XLIKE_COLOR (bg));
       else
-	XLIKE_SET_PIXCOLOR_NUM (gcv.background, XINT (bg));
+	XLIKE_SET_GC_PIXEL (gcv.background, XINT (bg));
       mask |= XLIKE_GC_BACKGROUND;
     }
 
@@ -1134,7 +888,7 @@
     {
       assert (DEVICE_XLIKE_GRAY_PIXMAP (d) != XLIKE_NONE);
 
-      gcv.XLIKE_FILL_MEMBER = XLIKE_FILL_STIPPLED;
+      XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_STIPPLED);
       gcv.stipple = DEVICE_XLIKE_GRAY_PIXMAP (d);
       mask |= (XLIKE_GC_FILL | XLIKE_GC_STIPPLE);
     }
@@ -1143,13 +897,13 @@
     {
       if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0)
 	{
-	  gcv.XLIKE_FILL_MEMBER = XLIKE_FILL_OPAQUE_STIPPLED;
+	  XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_OPAQUE_STIPPLED);
 	  gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap);
 	  mask |= (XLIKE_GC_STIPPLE | XLIKE_GC_FILL);
 	}
       else
 	{
-	  gcv.XLIKE_FILL_MEMBER = XLIKE_FILL_TILED;
+	  XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_TILED);
 	  gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap);
 	  mask |= (XLIKE_GC_TILE | XLIKE_GC_FILL);
 	}
@@ -1264,10 +1018,9 @@
   /* #### This will probably cause asserts when passed a Lisp integer for a
      color.  See ca. line 759 this file.
      #### Maybe xft_convert_color should take an XColor, not a pixel. */
-#define XFT_FROB_LISP_COLOR(color, dim) \
-  xft_convert_color (dpy, cmap, visual, \
-		     COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)).pixel, \
-		     (dim))
+#define XFT_FROB_LISP_COLOR(color, dim)					\
+  xft_convert_color (dpy, cmap, visual,					\
+		     XCOLOR_INSTANCE_X_COLOR (color).pixel, (dim))
 #endif /* USE_XFT */
 
   if (width < 0)
@@ -1850,11 +1603,11 @@
 #endif /* THIS_IS_GTK */
 
 
-void
-XLIKE_OUTPUT_XLIKE_PIXMAP (struct frame *f, Lisp_Image_Instance *p, int x,
+static void
+XLIKE_output_xlike_pixmap (struct frame *f, Lisp_Image_Instance *p, int x,
 			   int y, int xoffset, int yoffset,
 			   int width, int height,
-			   XLIKE_PIXCOLOR fg, XLIKE_PIXCOLOR bg,
+			   XLIKE_COLOR fg, XLIKE_COLOR bg,
 			   XLIKE_GC override_gc)
 {
   struct device *d = XDEVICE (f->device);
@@ -1868,8 +1621,8 @@
     {
       memset (&gcv, ~0, sizeof (gcv));
       gcv.graphics_exposures = XLIKE_FALSE;
-      XLIKE_SET_PIXCOLOR_COPY (gcv.foreground, fg);
-      XLIKE_SET_PIXCOLOR_COPY (gcv.background, bg);
+      XLIKE_SET_GC_COLOR (gcv.foreground, fg);
+      XLIKE_SET_GC_COLOR (gcv.background, bg);
       pixmap_mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES;
 
       if (IMAGE_INSTANCE_XLIKE_MASK (p))
@@ -1916,6 +1669,7 @@
 		 yoffset, width,
 		 height, x, y);
 #else /* THIS_IS_GTK */
+      USED (dpy);
       gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc,
 		       IMAGE_INSTANCE_GTK_PIXMAP (p),
 		       xoffset, yoffset, x, y, width, height);
@@ -1928,6 +1682,7 @@
 		  (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc,
 		  xoffset, yoffset, width, height, x, y, 1L);
 #else /* THIS_IS_GTK */
+      USED (dpy);
       our_draw_bitmap (GDK_DRAWABLE (x_win), gc,
 		       IMAGE_INSTANCE_GTK_PIXMAP (p),
 		       xoffset, yoffset, x, y, width, height);
@@ -1957,11 +1712,10 @@
     tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
     tmp_bcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel);
 
-    XLIKE_OUTPUT_XLIKE_PIXMAP (f, p, db->xpos, db->ypos,
+    XLIKE_output_xlike_pixmap (f, p, db->xpos, db->ypos,
 			       dga->xoffset, dga->yoffset,
 			       dga->width, dga->height,
-			       XLIKE_COLOR_TO_PIXCOLOR (tmp_fcolor),
-			       XLIKE_COLOR_TO_PIXCOLOR (tmp_bcolor), 0);
+			       tmp_fcolor, tmp_bcolor, 0);
   }
 
   /* Draw a cursor over top of the pixmap. */
@@ -2008,9 +1762,7 @@
   Lisp_Object tmp_pixel;
   XLIKE_GCVALUES gcv;
   XLIKE_GC background_gc;
-#ifdef THIS_IS_X
   enum edge_style style;
-#endif /* THIS_IS_X */
   unsigned long mask;
   int x, y1, y2, width, shadow_thickness, spacing, line_width;
   face_index div_face =
@@ -2029,9 +1781,7 @@
   tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face);
 
   /* First, get the GC's. */
-  XLIKE_SET_PIXCOLOR_COPY
-    (gcv.background,
-     XLIKE_COLOR_TO_PIXCOLOR (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel)));
+  XLIKE_SET_GC_COLOR (gcv.background, XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
   gcv.foreground = gcv.background;
   gcv.graphics_exposures = XLIKE_FALSE;
   mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES;
@@ -2044,6 +1794,7 @@
   if (clear)
     XClearArea (dpy, x_win, x, y1, width, y2 - y1, False);
 #else /* THIS_IS_GTK */
+  USED (dpy);
   /* if (clear) */
   gdk_draw_rectangle (GDK_DRAWABLE (x_win), background_gc, TRUE,
 		      x, y1, width, y2 - y1);
@@ -2055,9 +1806,8 @@
   XLIKE_FILL_RECTANGLE (dpy, x_win, background_gc,
 			x + spacing + shadow_thickness, y1,
 			line_width, y2 - y1);
+#endif /* not THIS_IS_GTK */
 
-  /* This code not formerly present in GTK version, maybe the omittal
-     is intentional? */
   if (shadow_thickness < 0)
     {
       shadow_thickness = -shadow_thickness;
@@ -2067,18 +1817,11 @@
     {
       style = EDGE_BEVEL_OUT;
     }
-#endif /* not THIS_IS_GTK */
 
   /* Draw the shadows around the divider line */
-#ifdef THIS_IS_X
-  x_bevel_area (w, div_face, x + spacing, y1,
-		width - 2 * spacing, y2 - y1,
-		shadow_thickness, EDGE_ALL, style);
-#else /* THIS_IS_GTK */
-  gtk_output_shadows (f, x + spacing, y1, 
-		      width - 2 * spacing, y2 - y1,
-		      shadow_thickness);
-#endif /* THIS_IS_GTK */
+  XLIKE_bevel_area (w, div_face, x + spacing, y1,
+		    width - 2 * spacing, y2 - y1,
+		    shadow_thickness, EDGE_ALL, style);
 }
 
 /*****************************************************************************
@@ -2430,7 +2173,7 @@
   XLIKE_WINDOW win = GET_XLIKE_WINDOW (f);
   XLIKE_GC gc = NULL;
   XLIKE_GCVALUES gcv;
-  XLIKE_COLOR tmp_fcolor, tmp_bcolor;
+  XLIKE_PIXEL tmp_fcolor, tmp_bcolor;
   Lisp_Object tmp_pixel, frame;
   struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f));
   int flash_height;
@@ -2438,14 +2181,11 @@
   frame = wrap_frame (f);
 
   tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
-  XLIKE_SET_PIXCOLOR_COPY (tmp_fcolor,
-			   XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
+  tmp_fcolor = XLIKE_COLOR_TO_PIXEL (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
   tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame);
-  XLIKE_SET_PIXCOLOR_COPY (tmp_bcolor,
-			   XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
+  tmp_bcolor = XLIKE_COLOR_TO_PIXEL (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
   memset (&gcv, ~0, sizeof (gcv)); /* initialize all slots to ~0 */
-  XLIKE_SET_PIXCOLOR_NUM (gcv.foreground,
-			  (tmp_fcolor.pixel ^ tmp_bcolor.pixel));
+  XLIKE_SET_GC_PIXEL (gcv.foreground, tmp_fcolor ^ tmp_bcolor);
   gcv.function = XLIKE_GX_XOR;
   gcv.graphics_exposures = XLIKE_FALSE;
   gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (XDEVICE (f->device)), &gcv,
--- a/src/s/mach-bsd4-3.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/s/mach-bsd4-3.h	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,23 @@
+/* Definitions file for XEmacs running on Mach (BSD 4.3)
+   Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
 /* Synched up with: FSF 19.31. */
 
 /* I don't care if this doesn't do more than including bsd4-3.h;
--- a/src/specifier.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/specifier.c	Wed Feb 03 20:18:53 2010 +0000
@@ -311,7 +311,7 @@
 #endif /* not NEW_GC */
 
 static int
-specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   Lisp_Specifier *s1 = XSPECIFIER (obj1);
   Lisp_Specifier *s2 = XSPECIFIER (obj2);
@@ -325,12 +325,12 @@
   depth++;
   retval =
     (s1->methods == s2->methods &&
-     internal_equal (s1->global_specs, s2->global_specs, depth) &&
-     internal_equal (s1->device_specs, s2->device_specs, depth) &&
-     internal_equal (s1->frame_specs,  s2->frame_specs,  depth) &&
-     internal_equal (s1->window_specs, s2->window_specs, depth) &&
-     internal_equal (s1->buffer_specs, s2->buffer_specs, depth) &&
-     internal_equal (s1->fallback,     s2->fallback,     depth));
+     internal_equal_0 (s1->global_specs, s2->global_specs, depth, foldcase) &&
+     internal_equal_0 (s1->device_specs, s2->device_specs, depth, foldcase) &&
+     internal_equal_0 (s1->frame_specs,  s2->frame_specs,  depth, foldcase) &&
+     internal_equal_0 (s1->window_specs, s2->window_specs, depth, foldcase) &&
+     internal_equal_0 (s1->buffer_specs, s2->buffer_specs, depth, foldcase) &&
+     internal_equal_0 (s1->fallback,     s2->fallback,     depth, foldcase));
 
   if (retval && HAS_SPECMETH_P (s1, equal))
     retval = SPECMETH (s1, equal, (obj1, obj2, depth - 1));
--- a/src/symbols.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/symbols.c	Wed Feb 03 20:18:53 2010 +0000
@@ -54,6 +54,8 @@
 #include <config.h>
 #include "lisp.h"
 
+#include "bytecode.h"		/* for COMPILED_FUNCTION_ANNOTATION_HACK,
+				   defined in bytecode.h and used here. */
 #include "buffer.h"		/* for Vbuffer_defaults */
 #include "console-impl.h"
 #include "elhash.h"
@@ -716,12 +718,19 @@
 DEFUN ("define-function", Fdefine_function, 2, 2, 0, /*
 Set SYMBOL's function definition to NEWDEF, and return NEWDEF.
 Associates the function with the current load file, if any.
+If NEWDEF is a compiled-function object, stores the function name in
+the `annotated' slot of the compiled-function (retrievable using
+`compiled-function-annotation').
 */
        (symbol, newdef))
 {
   /* This function can GC */
   Ffset (symbol, newdef);
   LOADHIST_ATTACH (Fcons (Qdefun, symbol));
+#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
+  if (COMPILED_FUNCTIONP (newdef))
+    XCOMPILED_FUNCTION (newdef)->annotated = symbol;
+#endif /* COMPILED_FUNCTION_ANNOTATION_HACK */
   return newdef;
 }
 
@@ -738,13 +747,13 @@
   return make_string ((const Ibyte *)name, strlen (name));
 }
 
-DEFUN ("special-form-p", Fspecial_form_p, 1, 1, 0, /*
-Return whether SUBR is a special form.
-
-A special form is a built-in function (a subr, that is a function
+DEFUN ("special-operator-p", Fspecial_operator_p, 1, 1, 0, /*
+Return whether SUBR is a special operator.
+
+A special operator is a built-in function (a subr, that is a function
 implemented in C, not Lisp) which does not necessarily evaluate all its
 arguments.  Much of the basic XEmacs Lisp syntax is implemented by means of
-special forms; examples are `let', `condition-case', `defun', `setq' and so
+special operators; examples are `let', `condition-case', `setq', and so
 on.
 
 If you intend to write a Lisp function that does not necessarily evaluate
@@ -3899,7 +3908,7 @@
   DEFSUBR (Fdefine_function);
   Ffset (intern ("defalias"), intern ("define-function"));
   DEFSUBR (Fsubr_name);
-  DEFSUBR (Fspecial_form_p);
+  DEFSUBR (Fspecial_operator_p);
   DEFSUBR (Fsetplist);
   DEFSUBR (Fsymbol_value_in_buffer);
   DEFSUBR (Fsymbol_value_in_console);
--- a/src/symsinit.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/symsinit.h	Wed Feb 03 20:18:53 2010 +0000
@@ -1,6 +1,6 @@
 /* Various initialization function prototypes.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 2001, 2002 Ben Wing.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -21,6 +21,9 @@
 
 /* Synched up with: Not in FSF. */
 
+/* There is no need to put ifdefs around the prototypes here.  Extra
+prototypes won't hurt anything. */
+
 #ifndef INCLUDED_symsinit_h_
 #define INCLUDED_symsinit_h_
 
@@ -31,10 +34,10 @@
 void init_data_very_early (void);
 void init_floatfns_very_early (void);
 void init_free_hook (void);
+void init_mswindows_dde_very_early (void);
 void init_process_times_very_early (void);
 void init_ralloc (void);
 void init_signals_very_early (void);
-void init_mswindows_dde_very_early (void);
 
 /* Early Lisp-engine initialization -- dump-time only for init, dump-time
    and post-pdump-load-time for reinit.  We call the reinit() routine
@@ -43,16 +46,16 @@
    to call the routine is tricky -- the init routine might need to do some
    stuff, call the reinit() routine, and do some more stuff.) */
 
+void reinit_alloc_early (void);
 void init_alloc_once_early (void);
-void reinit_alloc_early (void);
-void init_symbols_once_early (void);
-void reinit_symbols_early (void);
+void reinit_eistring_early (void);
+void init_eistring_once_early (void);
+void init_elhash_once_early (void);
 void init_errors_once_early (void);
 void reinit_opaque_early (void);
 void init_opaque_once_early (void);
-void init_elhash_once_early (void);
-void init_eistring_once_early (void);
-void reinit_eistring_early (void);
+void reinit_symbols_early (void);
+void init_symbols_once_early (void);
 
 /* Reset the Lisp engine.  Called both at dump-time, run-time and
    run-temacs-time; at dump-time, it's called early, before any of the
@@ -73,6 +76,7 @@
 void syms_of_buffer (void);
 void syms_of_bytecode (void);
 void syms_of_callint (void);
+EXTERN_C void syms_of_canna_api (void);
 void syms_of_casefiddle (void);
 void syms_of_casetab (void);
 void syms_of_chartab (void);
@@ -85,10 +89,12 @@
 void syms_of_database (void);
 void syms_of_debug (void);
 void syms_of_device (void);
+void syms_of_device_gtk (void);
 void syms_of_device_mswindows (void);
 void syms_of_device_tty (void);
 void syms_of_device_x (void);
 void syms_of_dialog (void);
+void syms_of_dialog_gtk (void);
 void syms_of_dialog_mswindows (void);
 void syms_of_dialog_x (void);
 void syms_of_dired (void);
@@ -101,6 +107,7 @@
 void syms_of_emacs (void);
 void syms_of_eval (void);
 void syms_of_event_Xt (void);
+void syms_of_event_gtk (void);
 void syms_of_event_mswindows (void);
 void syms_of_event_stream (void);
 void syms_of_events (void);
@@ -111,10 +118,10 @@
 void syms_of_filelock (void);
 void syms_of_floatfns (void);
 void syms_of_fns (void);
-#ifdef USE_C_FONT_LOCK
 void syms_of_font_lock (void);
-#endif /* USE_C_FONT_LOCK */
+void syms_of_font_mgr (void);
 void syms_of_frame (void);
+void syms_of_frame_gtk (void);
 void syms_of_frame_mswindows (void);
 void syms_of_frame_tty (void);
 void syms_of_frame_x (void);
@@ -122,12 +129,14 @@
 void syms_of_general (void);
 void syms_of_glyphs (void);
 void syms_of_glyphs_eimage (void);
+void syms_of_glyphs_gtk (void);
 void syms_of_glyphs_mswindows (void);
 void syms_of_glyphs_shared (void);
 void syms_of_glyphs_widget (void);
 void syms_of_glyphs_x (void);
 void syms_of_gpmevent (void);
 void syms_of_gui (void);
+void syms_of_gui_gtk (void);
 void syms_of_gui_mswindows (void);
 void syms_of_gui_x (void);
 void syms_of_gutter (void);
@@ -140,16 +149,14 @@
 void syms_of_lread (void);
 void syms_of_macros (void);
 void syms_of_marker (void);
-#ifdef NEW_GC
 void syms_of_mc_alloc (void);
-#endif /* NEW_GC */
 void syms_of_md5 (void);
 void syms_of_menubar (void);
+void syms_of_menubar_gtk (void);
 void syms_of_menubar_mswindows (void);
 void syms_of_menubar_x (void);
 void syms_of_minibuf (void);
 void syms_of_module (void);
-EXTERN_C void syms_of_canna_api (void);
 void syms_of_mule_ccl (void);
 void syms_of_mule_charset (void);
 void syms_of_mule_coding (void);
@@ -157,10 +164,10 @@
 void syms_of_nt (void);
 void syms_of_number (void);
 void syms_of_objects (void);
+void syms_of_objects_gtk (void);
 void syms_of_objects_mswindows (void);
 void syms_of_objects_tty (void);
 void syms_of_objects_x (void);
-void syms_of_font_mgr (void);
 EXTERN_C void syms_of_postgresql (void);
 void syms_of_print (void);
 void syms_of_process (void);
@@ -173,6 +180,7 @@
 void syms_of_scrollbar_mswindows(void);
 void syms_of_search (void);
 void syms_of_select (void);
+void syms_of_select_gtk (void);
 void syms_of_select_mswindows (void);
 void syms_of_select_x (void);
 void syms_of_signal (void);
@@ -185,9 +193,12 @@
 void syms_of_text (void);
 void syms_of_toolbar (void);
 void syms_of_tooltalk (void);
+void syms_of_ui_byhand (void);
+void syms_of_ui_gtk (void);
 void syms_of_undo (void);
 void syms_of_unicode (void);
 void syms_of_widget (void);
+void syms_of_widget_accessors (void);
 void syms_of_win32 (void);
 void syms_of_window (void);
 
@@ -195,49 +206,61 @@
    post-pdump-load-time only for reinit_). */
 
 void console_type_create (void);
-void console_type_create_stream (void);
-void reinit_console_type_create_stream (void);
-void console_type_create_tty (void);
-void reinit_console_type_create_tty (void);
+void console_type_create_device_gtk (void);
+void console_type_create_device_mswindows (void);
 void console_type_create_device_tty (void);
-void console_type_create_frame_tty (void);
-void console_type_create_objects_tty (void);
-void console_type_create_redisplay_tty (void);
-void console_type_create_x (void);
-void reinit_console_type_create_x (void);
 void console_type_create_device_x (void);
 void reinit_console_type_create_device_x (void);
+void console_type_create_dialog_gtk (void);
+void console_type_create_dialog_mswindows (void);
+void console_type_create_dialog_x (void);
+void console_type_create_frame_gtk (void);
+void console_type_create_frame_mswindows (void);
+void console_type_create_frame_tty (void);
 void console_type_create_frame_x (void);
+void console_type_create_glyphs_gtk (void);
+void console_type_create_glyphs_mswindows (void);
 void console_type_create_glyphs_x (void);
+void console_type_create_gtk (void);
+void reinit_console_type_create_gtk (void);
+void console_type_create_menubar_gtk (void);
+void console_type_create_menubar_mswindows (void);
 void console_type_create_menubar_x (void);
-void console_type_create_objects_x (void);
-void console_type_create_redisplay_x (void);
-void console_type_create_scrollbar_x (void);
-void console_type_create_select_x (void);
-void console_type_create_toolbar_x (void);
-void console_type_create_dialog_x (void);
 void console_type_create_mswindows (void);
 void reinit_console_type_create_mswindows (void);
-void console_type_create_device_mswindows (void);
-void console_type_create_frame_mswindows (void);
-void console_type_create_menubar_mswindows (void);
+void console_type_create_objects_gtk (void);
 void console_type_create_objects_mswindows (void);
+void console_type_create_objects_tty (void);
+void console_type_create_objects_x (void);
+void console_type_create_redisplay_gtk (void);
 void console_type_create_redisplay_mswindows (void);
+void console_type_create_redisplay_tty (void);
+void console_type_create_redisplay_x (void);
+void console_type_create_scrollbar_gtk (void);
 void console_type_create_scrollbar_mswindows (void);
+void console_type_create_scrollbar_x (void);
+void console_type_create_select_gtk (void);
+void console_type_create_select_mswindows (void);
+void console_type_create_select_x (void);
+void console_type_create_stream (void);
+void reinit_console_type_create_stream (void);
+void console_type_create_toolbar_gtk (void);
 void console_type_create_toolbar_mswindows (void);
-void console_type_create_glyphs_mswindows (void);
-void console_type_create_dialog_mswindows (void);
-void console_type_create_select_mswindows (void);
+void console_type_create_toolbar_x (void);
+void console_type_create_tty (void);
+void reinit_console_type_create_tty (void);
+void console_type_create_x (void);
+void reinit_console_type_create_x (void);
 
 /* Initialize the specifier types (dump-time only for specifier_type_(),
    post-pdump-load-time only for reinit_). */
 
 void specifier_type_create (void);
 void reinit_specifier_type_create (void);
+void specifier_type_create_gutter (void);
+void reinit_specifier_type_create_gutter (void);
 void specifier_type_create_image (void);
 void reinit_specifier_type_create_image (void);
-void specifier_type_create_gutter (void);
-void reinit_specifier_type_create_gutter (void);
 void specifier_type_create_objects (void);
 void reinit_specifier_type_create_objects (void);
 void specifier_type_create_toolbar (void);
@@ -248,36 +271,37 @@
 
 void coding_system_type_create (void);
 void reinit_coding_system_type_create (void);
-void coding_system_type_create_unicode (void);
-void reinit_coding_system_type_create_unicode (void);
 void coding_system_type_create_intl_win32 (void);
 void reinit_coding_system_type_create_intl_win32 (void);
 void coding_system_type_create_mule_coding (void);
 void reinit_coding_system_type_create_mule_coding (void);
+void coding_system_type_create_unicode (void);
+void reinit_coding_system_type_create_unicode (void);
 
 /* Initialize the structure types (dump-time only). */
 
 void structure_type_create (void);
 void structure_type_create_chartab (void);
 void structure_type_create_faces (void);
+void structure_type_create_hash_table (void);
 void structure_type_create_rangetab (void);
-void structure_type_create_hash_table (void);
 
 /* Initialize the image instantiator types (dump-time only). */
 
 void image_instantiator_format_create (void);
 void image_instantiator_format_create_glyphs_eimage (void);
+void image_instantiator_format_create_glyphs_gtk (void);
+void image_instantiator_format_create_glyphs_mswindows (void);
+void image_instantiator_format_create_glyphs_tty (void);
 void image_instantiator_format_create_glyphs_widget (void);
 void image_instantiator_format_create_glyphs_x (void);
-void image_instantiator_format_create_glyphs_mswindows (void);
-void image_instantiator_format_create_glyphs_tty (void);
 
 /* Initialize the lstream types (dump-time only). */
 
 void lstream_type_create (void);
 void lstream_type_create_file_coding (void);
+void lstream_type_create_mswindows_selectable (void);
 void lstream_type_create_print (void);
-void lstream_type_create_mswindows_selectable (void);
 
 /* Initialize process types */
 
@@ -288,6 +312,18 @@
 
 void init_provide_once (void);
 
+/* Lisp interactive function to sort groups of initialization functions by
+   name, ignoring any reinit_ or init_ at the beginning.  Put the cursor
+   after the last right paren, type C-x C-e, then select some text and
+   M-x sort-symsinit.
+
+   (defun sort-symsinit (start end)
+     (interactive "r")
+     (sort-regexp-fields nil "^.*?void \\(?:re\\)?\\(init_\\)?\\([A-Za-z0-9_]+\\).*$" "\\2"
+			 start end))
+
+*/
+
 /* Initialize most variables (dump-time for vars_, dump-time and
    post-pdump-load-time for reinit_vars). */
 
@@ -297,14 +333,17 @@
 void vars_of_buffer (void);
 void reinit_vars_of_buffer (void);
 void vars_of_bytecode (void);
+void reinit_vars_of_bytecode (void);
 void vars_of_callint (void);
+EXTERN_C void vars_of_canna_api (void);
 void vars_of_chartab (void);
 void vars_of_cmdloop (void);
 void vars_of_cmds (void);
 void vars_of_console (void);
 void reinit_vars_of_console (void);
+void vars_of_console_gtk (void);
+void vars_of_console_mswindows (void);
 void vars_of_console_stream (void);
-void vars_of_console_mswindows (void);
 void vars_of_console_tty (void);
 void vars_of_console_x (void);
 void vars_of_data (void);
@@ -313,28 +352,33 @@
 void reinit_vars_of_debug (void);
 void vars_of_device (void);
 void reinit_vars_of_device (void);
+void vars_of_device_gtk (void);
 void vars_of_device_mswindows (void);
 void vars_of_device_x (void);
 void reinit_vars_of_device_x (void);
 void vars_of_dialog (void);
+void vars_of_dialog_gtk (void);
+void vars_of_dialog_mswindows (void);
 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);
+EXTERN_C void vars_of_eldap (void);
 void vars_of_emacs (void);
 void vars_of_eval (void);
 void reinit_vars_of_eval (void);
+void vars_of_event_Xt (void);
+void reinit_vars_of_event_Xt (void);
+void vars_of_event_gtk (void);
+void reinit_vars_of_event_gtk (void);
+void vars_of_event_mswindows (void);
+void reinit_vars_of_event_mswindows (void);
 void vars_of_event_stream (void);
 void reinit_vars_of_event_stream (void);
 void vars_of_event_tty (void);
 void reinit_vars_of_event_tty (void);
-void vars_of_event_mswindows (void);
-void reinit_vars_of_event_mswindows (void);
-void vars_of_event_Xt (void);
-void reinit_vars_of_event_Xt (void);
 void vars_of_events (void);
 void reinit_vars_of_events (void);
 void vars_of_extents (void);
@@ -343,33 +387,39 @@
 void vars_of_file_coding (void);
 void reinit_vars_of_file_coding (void);
 void vars_of_fileio (void);
+#ifdef USE_C_FONT_LOCK
 void reinit_vars_of_fileio (void);
 void vars_of_filelock (void);
+#endif /* USE_C_FONT_LOCK */
 void vars_of_floatfns (void);
 void vars_of_fns (void);
-#ifdef USE_C_FONT_LOCK
 void vars_of_font_lock (void);
 void reinit_vars_of_font_lock (void);
-#endif /* USE_C_FONT_LOCK */
-void vars_of_frame_tty (void);
+void vars_of_font_mgr (void);
+void reinit_vars_of_font_mgr (void);
+void vars_of_frame (void);
+void vars_of_frame_gtk (void);
 void vars_of_frame_mswindows (void);
 void reinit_vars_of_frame_mswindows (void);
+void vars_of_frame_tty (void);
 void vars_of_frame_x (void);
-void vars_of_frame (void);
-void vars_of_glyphs_x (void);
+void vars_of_glyphs (void);
+void reinit_vars_of_glyphs (void);
 void vars_of_glyphs_eimage (void);
+void vars_of_glyphs_gtk (void);
+void vars_of_glyphs_mswindows (void);
 void vars_of_glyphs_widget (void);
 void reinit_vars_of_glyphs_widget (void);
-void vars_of_glyphs_mswindows (void);
-void vars_of_glyphs (void);
-void reinit_vars_of_glyphs (void);
+void vars_of_glyphs_x (void);
+void vars_of_gpmevent (void);
+void vars_of_gui (void);
+void vars_of_gui_gtk (void);
 void vars_of_gui_x (void);
 void reinit_vars_of_gui_x (void);
-void vars_of_gui (void);
 void vars_of_gutter (void);
+void vars_of_indent (void);
 void vars_of_input_method_motif (void);
 void vars_of_input_method_xlib (void);
-void vars_of_indent (void);
 void vars_of_insdel (void);
 void reinit_vars_of_insdel (void);
 void vars_of_intl (void);
@@ -381,15 +431,16 @@
 void reinit_vars_of_lstream (void);
 void vars_of_macros (void);
 void vars_of_md5 (void);
+void vars_of_menubar (void);
+void vars_of_menubar_gtk (void);
+void reinit_vars_of_menubar_gtk (void);
+void vars_of_menubar_mswindows (void);
 void vars_of_menubar_x (void);
 void reinit_vars_of_menubar_x (void);
-void vars_of_menubar (void);
-void vars_of_menubar_mswindows (void);
 void vars_of_minibuf (void);
 void reinit_vars_of_minibuf (void);
 void vars_of_module (void);
 void reinit_vars_of_module (void);
-EXTERN_C void vars_of_canna_api (void);
 void vars_of_mule_ccl(void);
 void vars_of_mule_charset (void);
 void vars_of_mule_coding (void);
@@ -399,14 +450,14 @@
 void vars_of_nt (void);
 void vars_of_number (void);
 void reinit_vars_of_number (void);
+void reinit_vars_of_object_mswindows (void);
 void vars_of_objects (void);
-void vars_of_font_mgr (void);
-void reinit_vars_of_font_mgr (void);
 void reinit_vars_of_objects (void);
-void vars_of_objects_tty (void);
+void vars_of_objects_gtk (void);
 void vars_of_objects_mswindows (void);
-void reinit_vars_of_object_mswindows (void);
+void vars_of_objects_tty (void);
 void vars_of_objects_x (void);
+EXTERN_C void vars_of_postgresql (void);
 void vars_of_print (void);
 void reinit_vars_of_print (void);
 void vars_of_process (void);
@@ -417,14 +468,18 @@
 void vars_of_realpath (void);
 void vars_of_redisplay (void);
 void vars_of_regex (void);
+void vars_of_scrollbar (void);
+void vars_of_scrollbar_gtk (void);
+void vars_of_scrollbar_mswindows (void);
 void vars_of_scrollbar_x (void);
 void reinit_vars_of_scrollbar_x (void);
-void vars_of_scrollbar (void);
-void vars_of_scrollbar_mswindows (void);
 void vars_of_search (void);
 void reinit_vars_of_search (void);
 void vars_of_select (void);
+void vars_of_select_gtk (void);
 void vars_of_select_mswindows (void);
+void vars_of_select_x (void);
+void reinit_vars_of_select_x (void);
 void vars_of_sound (void);
 void vars_of_specifier (void);
 void vars_of_sunpro (void);
@@ -435,17 +490,13 @@
 void reinit_vars_of_text (void);
 void vars_of_toolbar (void);
 void vars_of_tooltalk (void);
+void vars_of_ui_gtk (void);
 void vars_of_undo (void);
 void reinit_vars_of_undo (void);
 void vars_of_unicode (void);
+void vars_of_win32 (void);
 void vars_of_window (void);
 void reinit_vars_of_window (void);
-void vars_of_win32 (void);
-void vars_of_select_x (void);
-void reinit_vars_of_select_x (void);
-EXTERN_C void vars_of_eldap (void);
-EXTERN_C void vars_of_postgresql (void);
-void vars_of_gpmevent (void);
 
 /* Initialize specifier variables (dump-time only). */
 
@@ -466,28 +517,29 @@
 
 void complex_vars_of_alloc (void);
 void complex_vars_of_buffer (void);
+void reinit_complex_vars_of_buffer_runtime_only (void);
 void complex_vars_of_casetab (void);
 void complex_vars_of_chartab (void);
 void complex_vars_of_console (void);
+void reinit_complex_vars_of_console_runtime_only (void);
 void complex_vars_of_emacs (void);
 void complex_vars_of_faces (void);
 void complex_vars_of_file_coding (void);
 void complex_vars_of_font_mgr (void);
 void complex_vars_of_frame (void);
 void complex_vars_of_glyphs (void);
+void complex_vars_of_glyphs_gtk (void);
 void complex_vars_of_glyphs_mswindows (void);
 void complex_vars_of_glyphs_x (void);
 void complex_vars_of_intl_win32 (void);
 void complex_vars_of_keymap (void);
 void complex_vars_of_menubar (void);
 void complex_vars_of_minibuf (void);
+void reinit_complex_vars_of_minibuf (void);
 void complex_vars_of_mule_charset (void);
 void complex_vars_of_scrollbar (void);
 void complex_vars_of_syntax (void);
 void complex_vars_of_unicode (void);
-void reinit_complex_vars_of_buffer_runtime_only (void);
-void reinit_complex_vars_of_console_runtime_only (void);
-void reinit_complex_vars_of_minibuf (void);
 
 /* Late initialization -- stuff pertaining only to interactive usage,
    I/O, or Lisp reading. (Dump-time and run-time, but the code itself
@@ -499,6 +551,7 @@
 void init_device_tty (void);
 void init_editfns (void);
 void init_event_Xt_late (void);
+void init_event_gtk_late (void);
 void init_event_mswindows_late (void);
 void init_event_stream (void);
 void init_event_tty_late (void);
@@ -518,47 +571,6 @@
 void init_win32 (void);
 void init_xemacs_process (void);
 
-void syms_of_device_gtk (void);
-void syms_of_dialog_gtk (void);
-void syms_of_event_gtk (void);
-void syms_of_frame_gtk (void);
-void syms_of_glyphs_gtk (void);
-void syms_of_gui_gtk (void);
-void syms_of_menubar_gtk (void);
-void syms_of_objects_gtk (void);
-void syms_of_select_gtk (void);
-void syms_of_ui_gtk (void);
-void syms_of_widget_accessors (void);
-void syms_of_ui_byhand (void);
-void console_type_create_gtk (void);
-void reinit_console_type_create_gtk (void);
-void console_type_create_device_gtk (void);
-void console_type_create_frame_gtk (void);
-void console_type_create_glyphs_gtk (void);
-void console_type_create_menubar_gtk (void);
-void console_type_create_objects_gtk (void);
-void console_type_create_redisplay_gtk (void);
-void console_type_create_scrollbar_gtk (void);
-void console_type_create_toolbar_gtk (void);
-void console_type_create_dialog_gtk (void);
-void image_instantiator_format_create_glyphs_gtk (void);
-void vars_of_device_gtk (void);
-void vars_of_dialog_gtk (void);
-void vars_of_event_gtk (void);
-void reinit_vars_of_event_gtk (void);
-void vars_of_frame_gtk (void);
-void vars_of_glyphs_gtk (void);
-void vars_of_gui_gtk (void);
-void vars_of_menubar_gtk (void);
-void reinit_vars_of_menubar_gtk (void);
-void vars_of_objects_gtk (void);
-void vars_of_scrollbar_gtk (void);
-void vars_of_select_gtk (void);
-void vars_of_ui_gtk (void);
-void complex_vars_of_glyphs_gtk (void);
-void init_event_gtk_late (void);
-void console_type_create_select_gtk (void);
-
 /* Enhanced number initialization: must be done only at runtime due to complex
    interactions with the supporting libraries. */
 void init_number (void);
--- a/src/syntax.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/syntax.c	Wed Feb 03 20:18:53 2010 +0000
@@ -69,6 +69,8 @@
 /* A value that is guaranteed not be in a syntax table. */
 Lisp_Object Vbogus_syntax_table_value;
 
+Lisp_Object Qscan_error;
+
 static void syntax_cache_table_was_changed (struct buffer *buf);
 
 /* This is the internal form of the parse state used in parse-partial-sexp.  */
@@ -1353,6 +1355,7 @@
   int syncode;
   int min_depth = depth;    /* Err out if depth gets less than this. */
   struct syntax_cache *scache;
+  Charbpos last_good = from;
   
   if (depth > 0) min_depth = 0;
 
@@ -1370,6 +1373,8 @@
 	  c = BUF_FETCH_CHAR (buf, from);
 	  syncode = SYNTAX_CODE_FROM_CACHE (scache, c);
 	  code = SYNTAX_FROM_CODE (syncode);
+	  if (depth == min_depth)
+	    last_good = from;
 	  from++;
 
 	  /* a 1-char comment start sequence */
@@ -1483,8 +1488,9 @@
 	      {
 		if (noerror)
 		  return Qnil;
-		syntax_error ("Containing expression ends prematurely",
-			      Qunbound);
+		signal_error_2 (Qscan_error,
+				"Containing expression ends prematurely",
+				make_int (last_good), make_int (from));
 	      }
 	    break;
 
@@ -1656,8 +1662,9 @@
 	      {
 		if (noerror)
 		  return Qnil;
-		syntax_error ("Containing expression ends prematurely",
-			      Qunbound);
+		signal_error_2 (Qscan_error,
+				"Containing expression ends prematurely",
+				make_int (last_good), make_int (from));
 	      }
 	    break;
 
@@ -1727,7 +1734,8 @@
 
 lose:
   if (!noerror)
-    syntax_error ("Unbalanced parentheses", Qunbound);
+    signal_error_2 (Qscan_error, "Unbalanced parentheses",
+		    make_int (last_good), make_int (from));
   return Qnil;
 }
 
@@ -2418,6 +2426,8 @@
   DEFSUBR (Fscan_sexps);
   DEFSUBR (Fbackward_prefix_chars);
   DEFSUBR (Fparse_partial_sexp);
+
+  DEFERROR_STANDARD (Qscan_error, Qsyntax_error);
 }
 
 void
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sysgdkx.h	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,36 @@
+/* Basic wrapper file around gdk/gdkx.h.
+
+   Copyright (C) 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+/* Authorship:
+
+   Ben Wing, 1-28-10 extracted out of console-gtk.h and various other
+   files.  We have a separate file rather than just putting it together
+   with sysgtk.h because Bill wanted to keep the X-specific stuff isolated.
+*/
+
+#ifndef INCLUDED_sysgdkx_h_
+#define INCLUDED_sysgdkx_h_
+
+#include <gdk/gdkx.h>
+
+#endif /* INCLUDED_sysgdkx_h_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sysgtk.h	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,38 @@
+/* Basic include file for GTK/GDK includes.
+
+   Copyright (C) 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+/* Authorship:
+
+   Ben Wing, 1-28-10 extracted out of console-gtk.h and various other
+   files.
+*/
+
+#ifndef INCLUDED_sysgtk_h_
+#define INCLUDED_sysgtk_h_
+
+#include <gtk/gtk.h>
+#include <gtk/gtkfixed.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkkeysyms.h>
+
+#endif /* INCLUDED_sysgtk_h_ */
--- a/src/text.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/text.c	Wed Feb 03 20:18:53 2010 +0000
@@ -1422,15 +1422,15 @@
 {
   while (*s1 && *s2)
     {
-      if (DOWNCASE (0, itext_ichar (s1)) !=
-	  DOWNCASE (0, itext_ichar (s2)))
+      if (CANONCASE (0, itext_ichar (s1)) !=
+	  CANONCASE (0, itext_ichar (s2)))
 	break;
       INC_IBYTEPTR (s1);
       INC_IBYTEPTR (s2);
     }
 
-  return (DOWNCASE (0, itext_ichar (s1)) -
-	  DOWNCASE (0, itext_ichar (s2)));
+  return (CANONCASE (0, itext_ichar (s1)) -
+	  CANONCASE (0, itext_ichar (s2)));
 }
 
 /* The only difference between these next two and
@@ -1481,8 +1481,8 @@
   while (len_from_s1 > 0)
     {
       const Ibyte *old_s1 = s1;
-      int diff = (DOWNCASE (0, itext_ichar (s1)) -
-		  DOWNCASE (0, itext_ichar (s2)));
+      int diff = (CANONCASE (0, itext_ichar (s1)) -
+		  CANONCASE (0, itext_ichar (s2)));
       if (diff != 0)
 	return diff;
       if (!*s1)
@@ -1604,8 +1604,8 @@
     {
       const Ibyte *old_s1 = s1;
       const Ibyte *old_s2 = s2;
-      int diff = (DOWNCASE (0, itext_ichar (s1)) -
-		  DOWNCASE (0, itext_ichar (s2)));
+      int diff = (CANONCASE (0, itext_ichar (s1)) -
+		  CANONCASE (0, itext_ichar (s2)));
       if (diff != 0)
 	return diff;
       INC_IBYTEPTR (s1);
@@ -1631,8 +1631,8 @@
     {
       const Ibyte *old_s1 = s1;
       const Ibyte *old_s2 = s2;
-      int diff = (DOWNCASE (0, itext_ichar (s1)) -
-		  DOWNCASE (0, itext_ichar (s2)));
+      int diff = (CANONCASE (0, itext_ichar (s1)) -
+		  CANONCASE (0, itext_ichar (s2)));
       if (diff != 0)
 	return diff;
       INC_IBYTEPTR (s1);
@@ -1647,7 +1647,7 @@
 }
 
 int
-lisp_strcasecmp (Lisp_Object s1, Lisp_Object s2)
+lisp_strcasecmp_ascii (Lisp_Object s1, Lisp_Object s2)
 {
   Ibyte *cm = strcasecmp_charmap;
   Ibyte *p1 = XSTRING_DATA (s1);
--- a/src/toolbar-common.c	Sun Jan 31 18:29:48 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,730 +0,0 @@
-/* toolbar implementation -- "Generic" (X or GTK) redisplay interface.
-   Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996, 2002 Ben Wing.
-   Copyright (C) 1996 Chuck Thompson.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-/* Synched up with: Not in FSF. */
-
-#include <config.h>
-#include "lisp.h"
-
-#include "device-impl.h"
-#include "faces.h"
-#include "frame-impl.h"
-#include "glyphs.h"
-#include "toolbar.h"
-#include "window.h"
-
-/* This is used when we need to draw the toolbars ourselves -- on X or GTK.
-   On MS Windows, we use the built-in toolbar controls. */
-
-/* Only a very few things need to differ based on the toolkit used.
-**
-** Some of the routines used assert(FRAME_yyy_P(f)) checks, this is
-** now abstracted into __INTERNAL_APPROPRIATENESS_CHECK().  When we
-** add new window systems that use this code, we should either add a
-** new case here, or just remove the checks completely.
-**
-** At least for X & GTK redraw_frame_toolbars() might end up getting
-** called before we are completely initialized.  To avoid this, we use
-** the __INTERNAL_MAPPED_P(f) macro, that should return 0 if we should
-** not draw the toolbars yet.  When we add new window systems that use
-** this code, we should add a new case here, if they need it.
-**
-** When clearing the toolbar, it is nice to flush the drawing queue.
-** Use __INTERNAL_FLUSH to do this.  It is passed a device.
-*/
-#if defined(HAVE_GTK)
-#include "console-gtk-impl.h"
-#define __INTERNAL_MAPPED_P(f) GTK_WIDGET_REALIZED (FRAME_GTK_TEXT_WIDGET (f))
-#define __INTERNAL_FLUSH(d) gdk_flush()
-#define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_GTK_P (f))
-#elif defined(HAVE_X_WINDOWS)
-#include "console-x-impl.h"
-#define __INTERNAL_MAPPED_P(f) XtIsRealized (FRAME_X_SHELL_WIDGET (f))
-#define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_X_P (f))
-#define __INTERNAL_FLUSH(d) XFlush (DEVICE_X_DISPLAY (d))
-#else
-#define __INTERNAL_MAPPED_P(f) ABORT()
-#define __INTERNAL_APPROPRIATENESS_CHECK(f) ABORT()
-#define __INTERNAL_FLUSH(f) ABORT()
-#endif
-
-#include "toolbar-common.h"
-
-extern Lisp_Object Vtoolbar_shadow_thickness;
-
-static void __prepare_button_area (struct frame *f,
-				   struct toolbar_button *tb)
-{
-  int sx = tb->x;
-  int sy = tb->y;
-  int swidth = tb->width;
-  int sheight = tb->height;
-  int border_width = tb->border_width;
-  int x_adj, width_adj, y_adj, height_adj;
-  struct device *d = XDEVICE (f->device);
-  Lisp_Object  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
-  struct window *w = XWINDOW (window);
-  int shadow_thickness;
-  int def_shadow_thickness = XINT (Fspecifier_instance(Vtoolbar_shadow_thickness, window, Qnil, Qnil));
-  face_index toolbar_findex;
-
-  if (tb->vertical)
-    {
-      x_adj = border_width;
-      width_adj = - 2 * border_width;
-      y_adj = height_adj = 0;
-    }
-  else
-    {
-      x_adj = width_adj = 0;
-      y_adj = border_width;
-      height_adj = - 2 * border_width;
-    }
-
-  toolbar_findex = get_builtin_face_cache_index (w, Vtoolbar_face);
-
-  /* Blank toolbar buttons that should be 3d will have EQ(tb->up_glyph, Qt)
-  ** Blank toolbar buttons that should be flat will have NILP (tb->up_glyph)
-  **
-  ** Real toolbar buttons will check tb->enabled && tb->down
-  */
-  if (EQ (Qt, tb->up_glyph))
-    {
-      shadow_thickness = def_shadow_thickness;
-    }
-  else if (NILP (tb->up_glyph))
-    {
-      shadow_thickness = 0;
-    }
-  else
-    {
-      if (tb->enabled)
-	{
-	  if (tb->down)
-	    shadow_thickness = -def_shadow_thickness;
-	  else
-	    shadow_thickness = def_shadow_thickness;
-	}
-      else
-	{
-	  shadow_thickness = 0;
-	}
-    }
-  
-  /* Blank the entire area. */
-  redisplay_clear_region (window, toolbar_findex,
-			  sx + x_adj, sy + y_adj,
-			  swidth + width_adj,
-			  sheight + height_adj);
-
-  /* Draw the outline. */
-  if (shadow_thickness)
-    {
-      MAYBE_DEVMETH (d, bevel_area,
-		     (w, toolbar_findex, sx + x_adj,
-		      sy + y_adj, swidth + width_adj,
-		      sheight + height_adj, abs(shadow_thickness),
-		      EDGE_ALL, (shadow_thickness < 0) ? EDGE_BEVEL_IN
-						       : EDGE_BEVEL_OUT));
-    }
-
-  /* Handle the borders... */
-  redisplay_clear_region (window, toolbar_findex,
-			  sx, sy,
-			  (tb->vertical ? border_width : swidth),
-			  (tb->vertical ? sheight : border_width));
-  redisplay_clear_region (window, toolbar_findex,
-			  (tb->vertical ? sx + swidth : sx),
-			  (tb->vertical ? sy : sy + sheight),
-			  (tb->vertical ? border_width : swidth),
-			  (tb->vertical ? sheight : border_width));
-}
-
-#define common_draw_blank_toolbar_button(f,tb) __prepare_button_area (f,tb)
-
-void
-common_output_toolbar_button (struct frame *f, Lisp_Object button)
-{
-  int shadow_thickness = 2;
-  int x_adj, y_adj, width_adj, height_adj;
-  struct device *d = XDEVICE (f->device);
-  Lisp_Object instance, window, glyph;
-  struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
-  struct Lisp_Image_Instance *p;
-  struct window *w;
-  int vertical = tb->vertical;
-  int border_width = tb->border_width;
-  face_index button_findex;
-
-  if (vertical)
-    {
-      x_adj = border_width;
-      width_adj = - 2 * border_width;
-      y_adj = 0;
-      height_adj = 0;
-    }
-  else
-    {
-      x_adj = 0;
-      width_adj = 0;
-      y_adj = border_width;
-      height_adj = - 2 * border_width;
-    }
-
-  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
-  w = XWINDOW (window);
-
-  glyph = get_toolbar_button_glyph (w, tb);
-
-  if (tb->enabled)
-    {
-      if (tb->down)
-	{
-	  shadow_thickness = -2;
-	}
-      else
-	{
-	  shadow_thickness = 2;
-	}
-    }
-  else
-    {
-      shadow_thickness = 0;
-    }
-
-  /* #### It is currently possible for users to trash us by directly
-     changing the toolbar glyphs.  Avoid crashing in that case. */
-  if (GLYPHP (glyph))
-    {
-      /* WARNING: this interface may change */
-      Lisp_Object face_list[2] = { XGLYPH_FACE (glyph), Vtoolbar_face };
-
-      button_findex = merge_face_list_to_cache_index (w, face_list, 2);
-      instance = glyph_image_instance (glyph, window, ERROR_ME_DEBUG_WARN, 1);
-    }
-  else
-    {
-      button_findex = get_builtin_face_cache_index (w, Vtoolbar_face);
-      instance = Qnil;
-    }
-
-  __prepare_button_area (f, tb);
-
-  if (IMAGE_INSTANCEP (instance))
-    {
-      int width = tb->width + width_adj - shadow_thickness * 2;
-      int height = tb->height + height_adj - shadow_thickness * 2;
-      int x_offset = x_adj + shadow_thickness;
-      int y_offset = y_adj + shadow_thickness;
-
-      p = XIMAGE_INSTANCE (instance);
-
-      if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
-	{
-	  struct display_box db;
-	  struct display_glyph_area dga;
-
-	  if (width > (int) IMAGE_INSTANCE_PIXMAP_WIDTH (p))
-	    {
-	      x_offset += ((int) (width - IMAGE_INSTANCE_PIXMAP_WIDTH (p))
-			   / 2);
-	      width = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
-	    }
-	  if (height > (int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
-	    {
-	      y_offset += ((int) (height - IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
-			   / 2);
-	      height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
-	    }
-
-	  /* Draw exactly in the area specified... */
-	  db.xpos = tb->x + x_offset;
-	  db.ypos = tb->y + y_offset;
-	  db.width = width;
-	  db.height = height;
-
-	  /* Display the whole glyph */
-	  dga.xoffset = 0;
-	  dga.yoffset = 0;
-	  dga.width = width;
-	  dga.height = height;
-	  
-	  redisplay_output_pixmap (w, instance,
-				   &db, &dga, 
-				   button_findex, 0, 0, 0, 0);
-	}
-      else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_TEXT)
-	{
-	  /* #### We need to make the face used configurable. */
-	  struct face_cachel *cachel =
-	    WINDOW_FACE_CACHEL (w, DEFAULT_INDEX);
-	  struct display_line dl;
-	  Lisp_Object string = IMAGE_INSTANCE_TEXT_STRING (p);
-	  unsigned char charsets[NUM_LEADING_BYTES];
-	  Ichar_dynarr *buf;
-	  struct font_metric_info fm;
-
-	  /* This could be true if we were called via the Expose event
-             handler.  Mark the button as dirty and return
-             immediately. */
-	  if (f->window_face_cache_reset)
-	    {
-	      tb->dirty = 1;
-	      MARK_TOOLBAR_CHANGED;
-	      return;
-	    }
-	  buf = Dynarr_new (Ichar);
-	  convert_ibyte_string_into_ichar_dynarr
-	    (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
-	  find_charsets_in_ichar_string (charsets, Dynarr_atp (buf, 0),
-					  Dynarr_length (buf));
-	  ensure_face_cachel_complete (cachel, window, charsets);
-	  face_cachel_charset_font_metric_info (cachel, charsets, &fm);
-
-	  dl.ascent = fm.ascent;
-	  dl.descent = fm.descent;
-	  dl.ypos = tb->y + y_offset + fm.ascent;
-
-	  if (fm.ascent + fm.descent <= height)
-	    {
-	      dl.ypos += (height - fm.ascent - fm.descent) / 2;
-	      dl.clip = 0;
-	    }
-	  else
-	    {
-	      dl.clip = fm.ascent + fm.descent - height;
-	    }
-
-	  MAYBE_DEVMETH (d, output_string,
-			 (w, &dl, buf, tb->x + x_offset, 0, 0, width,
-			  button_findex, 0, 0, 0, 0));
-	  Dynarr_free (buf);
-	}
-
-      /* We silently ignore the image if it isn't a pixmap or text. */
-    }
-
-  tb->dirty = 0;
-}
-
-static int
-common_get_button_size (struct frame *f, Lisp_Object window,
-			struct toolbar_button *tb, int vert, int pos)
-{
-  int shadow_thickness = 2;
-  int size;
-
-  if (tb->blank)
-    {
-      if (!NILP (tb->down_glyph))
-	size = XINT (tb->down_glyph);
-      else
-	size = DEFAULT_TOOLBAR_BLANK_SIZE;
-    }
-  else
-    {
-      struct window *w = XWINDOW (window);
-      Lisp_Object glyph = get_toolbar_button_glyph (w, tb);
-
-      /* Unless, of course, the user has done something stupid like
-         change the glyph out from under us.  Use a blank placeholder
-         in that case. */
-      if (NILP (glyph))
-	return XINT (f->toolbar_size[pos]);
-
-      if (vert)
-	size = glyph_height (glyph, window);
-      else
-	size = glyph_width (glyph, window);
-    }
-
-  if (!size)
-    {
-      /* If the glyph doesn't have a size we'll insert a blank
-         placeholder instead. */
-      return XINT (f->toolbar_size[pos]);
-    }
-
-  size += shadow_thickness * 2;
-
-  return (size);
-}
-
-#define COMMON_OUTPUT_BUTTONS_LOOP(left)				\
-  do {									\
-    while (!NILP (button))						\
-      {									\
-	struct toolbar_button *tb = XTOOLBAR_BUTTON (button);		\
-	int size, height, width;					\
-									\
-	if (left && tb->pushright)					\
-	  break;							\
-									\
-        size = common_get_button_size (f, window, tb, vert, pos);	\
-									\
-	if (vert)							\
-	  {								\
-	    width = bar_width;						\
-	    if (y + size > max_pixpos)					\
-	      height = max_pixpos - y;					\
-	    else							\
-	      height = size;						\
-	  }								\
-	else								\
-	  {								\
-	    if (x + size > max_pixpos)					\
-	      width = max_pixpos - x;					\
-	    else							\
-	      width = size;						\
-	    height = bar_height;					\
-	  }								\
-									\
-	if (tb->x != x							\
-	    || tb->y != y						\
-	    || tb->width != width					\
-	    || tb->height != height					\
-	    || tb->dirty						\
-	    || f->clear) /* This is clearly necessary. */		\
-	  {								\
-	    if (width && height)					\
-	      {								\
-		tb->x = x;						\
-		tb->y = y;						\
-		tb->width = width;					\
-		tb->height = height;					\
-	        tb->border_width = border_width;			\
-	        tb->vertical = vert;					\
-									\
-                if (tb->blank || NILP (tb->up_glyph))			\
-		  {							\
-		    common_draw_blank_toolbar_button (f, tb);		\
-		  }							\
-	        else							\
-		  common_output_toolbar_button (f, button);		\
-	      }								\
-	  }								\
-									\
-	if (vert)							\
-	  y += height;							\
-	else								\
-	  x += width;							\
-									\
-	if ((vert && y == max_pixpos) || (!vert && x == max_pixpos))	\
-	  button = Qnil;						\
-	else								\
-	  button = tb->next;						\
-      }									\
-  } while (0)
-
-#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag)			\
-  do {									\
-    switch (pos)							\
-      {									\
-      case TOP_TOOLBAR:							\
-	(frame)->top_toolbar_was_visible = flag;			\
-	break;								\
-      case BOTTOM_TOOLBAR:						\
-	(frame)->bottom_toolbar_was_visible = flag;			\
-	break;								\
-      case LEFT_TOOLBAR:						\
-	(frame)->left_toolbar_was_visible = flag;			\
-	break;								\
-      case RIGHT_TOOLBAR:						\
-	(frame)->right_toolbar_was_visible = flag;			\
-	break;								\
-      default:								\
-	ABORT ();							\
-      }									\
-  } while (0)
-
-static void
-common_output_toolbar (struct frame *f, enum toolbar_pos pos)
-{
-  int x, y, bar_width, bar_height, vert;
-  int max_pixpos, right_size, right_start, blank_size;
-  int border_width = FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos);
-  Lisp_Object button, window;
-  face_index toolbar_findex;
-
-  get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 1);
-  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
-  toolbar_findex = get_builtin_face_cache_index (XWINDOW (window), Vtoolbar_face);
-
-  /* Do the border */
-  redisplay_clear_region (window, toolbar_findex,
-			  x, y,
-			  (vert ? bar_width : border_width),
-			  (vert ? border_width : bar_height));
-  redisplay_clear_region (window, toolbar_findex,
-			  (vert ? x : x + bar_width - border_width),
-			  (vert ? y + bar_height - border_width : y),
-			  (vert ? bar_width : border_width),
-			  (vert ? border_width : bar_height));
-
-  if (vert)
-    {
-      max_pixpos = y + bar_height - border_width;
-      y += border_width;
-    }
-  else
-    {
-      max_pixpos = x + bar_width - border_width;
-      x += border_width;
-    }
-
-  button = FRAME_TOOLBAR_BUTTONS (f, pos);
-  right_size = 0;
-
-  /* First loop over all of the buttons to determine how much room we
-     need for left hand and right hand buttons.  This loop will also
-     make sure that all instances are instantiated so when we actually
-     output them they will come up immediately. */
-  while (!NILP (button))
-    {
-      struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
-      int size = common_get_button_size (f, window, tb, vert, pos);
-
-      if (tb->pushright)
-	right_size += size;
-
-      button = tb->next;
-    }
-
-  button = FRAME_TOOLBAR_BUTTONS (f, pos);
-
-  /* Loop over the left buttons, updating and outputting them. */
-  COMMON_OUTPUT_BUTTONS_LOOP (1);
-
-  /* Now determine where the right buttons start. */
-  right_start = max_pixpos - right_size;
-  if (right_start < (vert ? y : x))
-    right_start = (vert ? y : x);
-
-  /* Output the blank which goes from the end of the left buttons to
-     the start of the right. */
-  blank_size = right_start - (vert ? y : x);
-  if (blank_size)
-    {
-      int height, width;
-
-      if (vert)
-	{
-	  width = bar_width;
-	  height = blank_size;
-	}
-      else
-	{
-	  width = blank_size;
-	  height = bar_height;
-	}
-
-      /*
-       * Use a 3D pushright separator only if there isn't a toolbar
-       * border.  A flat separator meshes with the border and looks
-       * better.
-       */
-      if (1)
-	{
-	  struct toolbar_button tb;
-
-	  tb.x = x;
-	  tb.y = y;
-	  tb.width = width;
-	  tb.height = height;
-	  tb.border_width = border_width;
-	  tb.vertical = vert;
-	  tb.enabled = 1;
-	  tb.up_glyph = border_width ? Qt : Qnil;
-
-	  __prepare_button_area (f, &tb);
-	}
-
-      if (vert)
-	y += height;
-      else
-	x += width;
-    }
-
-  /* Loop over the right buttons, updating and outputting them. */
-  COMMON_OUTPUT_BUTTONS_LOOP (0);
-
-  if (!vert)
-    {
-      Lisp_Object frame = wrap_frame (f);
-
-      redisplay_clear_region (frame,
-			      DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1,
-			      bar_height);
-    }
-
-  SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
-  __INTERNAL_FLUSH (XDEVICE (f->device));
-}
-
-static void
-common_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change)
-{
-  Lisp_Object frame;
-  int x, y, width, height, vert;
-
-  get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 1);
-  frame = wrap_frame (f);
-
-  /* The thickness_change parameter is used by the toolbar resize routines
-     to clear any excess toolbar if the size shrinks. */
-  if (thickness_change < 0)
-    {
-      if (pos == LEFT_TOOLBAR || pos == RIGHT_TOOLBAR)
-	{
-	  x = x + width + thickness_change;
-	  width = -thickness_change;
-	}
-      else
-	{
-	  y = y + height + thickness_change;
-	  height = -thickness_change;
-	}
-    }
-
-  SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0);
-
-  redisplay_clear_region (frame, DEFAULT_INDEX, x, y, width, height);
-
-  __INTERNAL_FLUSH (XDEVICE (f->device));
-}
-
-void
-common_output_frame_toolbars (struct frame *f)
-{
-  __INTERNAL_APPROPRIATENESS_CHECK(f);
-
-  if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
-    common_output_toolbar (f, TOP_TOOLBAR);
-
-  if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
-    common_output_toolbar (f, BOTTOM_TOOLBAR);
-
-  if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
-    common_output_toolbar (f, LEFT_TOOLBAR);
-
-  if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
-    common_output_toolbar (f, RIGHT_TOOLBAR);
-}
-
-void
-common_clear_frame_toolbars (struct frame *f)
-{
-  __INTERNAL_APPROPRIATENESS_CHECK(f);
-
-  if (f->top_toolbar_was_visible
-      && !FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
-    common_clear_toolbar (f, TOP_TOOLBAR, 0);
-  if (f->bottom_toolbar_was_visible
-      && !FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
-    common_clear_toolbar (f, BOTTOM_TOOLBAR, 0);
-  if (f->left_toolbar_was_visible 
-      && !FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
-    common_clear_toolbar (f, LEFT_TOOLBAR, 0);
-  if (f->right_toolbar_was_visible 
-       && !FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
-    common_clear_toolbar (f, RIGHT_TOOLBAR, 0);
-}
-
-static void
-common_redraw_exposed_toolbar (struct frame *f, enum toolbar_pos pos, int x, int y,
-			    int width, int height)
-{
-  int bar_x, bar_y, bar_width, bar_height, vert;
-  Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos);
-
-  get_toolbar_coords (f, pos, &bar_x, &bar_y, &bar_width, &bar_height,
-		      &vert, 1);
-
-  if (((y + height) < bar_y) || (y > (bar_y + bar_height)))
-    return;
-  if (((x + width) < bar_x) || (x > (bar_x + bar_width)))
-    return;
-
-  while (!NILP (button))
-    {
-      struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
-
-      if (vert)
-	{
-	  if (((tb->y + tb->height) > y) && (tb->y < (y + height)))
-	    tb->dirty = 1;
-
-	  /* If this is true we have gone past the exposed region. */
-	  if (tb->y > (y + height))
-	    break;
-	}
-      else
-	{
-	  if (((tb->x + tb->width) > x) && (tb->x < (x + width)))
-	    tb->dirty = 1;
-
-	  /* If this is true we have gone past the exposed region. */
-	  if (tb->x > (x + width))
-	    break;
-	}
-
-      button = tb->next;
-    }
-
-  /* Even if none of the buttons is in the area, the blank region at
-     the very least must be because the first thing we did is verify
-     that some portion of the toolbar is in the exposed region. */
-  common_output_toolbar (f, pos);
-}
-
-void
-common_redraw_exposed_toolbars (struct frame *f, int x, int y, int width,
-				int height)
-{
-  __INTERNAL_APPROPRIATENESS_CHECK(f);
-
-  if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
-    common_redraw_exposed_toolbar (f, TOP_TOOLBAR, x, y, width, height);
-
-  if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
-    common_redraw_exposed_toolbar (f, BOTTOM_TOOLBAR, x, y, width, height);
-
-  if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
-    common_redraw_exposed_toolbar (f, LEFT_TOOLBAR, x, y, width, height);
-
-  if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
-    common_redraw_exposed_toolbar (f, RIGHT_TOOLBAR, x, y, width, height);
-}
-
-void
-common_redraw_frame_toolbars (struct frame *f)
-{
-  /* There are certain startup paths that lead to update_EmacsFrame in
-     faces.c being called before a new frame is fully initialized.  In
-     particular before we have actually mapped it.  That routine can
-     call this one.  So, we need to make sure that the frame is
-     actually ready before we try and draw all over it. */
-  if (__INTERNAL_MAPPED_P(f))
-    common_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f),
-				    FRAME_PIXHEIGHT (f));
-}
--- a/src/toolbar-common.h	Sun Jan 31 18:29:48 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-/* toolbar-common.h
-**
-** Description: 
-**
-** Created by: William M. Perry
-** Copyright (c) 2001 Free Software Foundation
-**
-*/
-
-#ifndef __TOOLBAR_COMMON_H__
-#define __TOOLBAR_COMMON_H__
-
-extern void common_output_frame_toolbars (struct frame *f);
-extern void common_redraw_exposed_toolbars (struct frame *f,
-					    int x, int y,
-					    int width, int height);
-extern void common_redraw_frame_toolbars (struct frame *f);
-extern void common_output_toolbar_button (struct frame *f, Lisp_Object button);
-extern void common_clear_frame_toolbars (struct frame *f);
-
-#endif /* __TOOLBAR_COMMON_H__ */
--- a/src/toolbar-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/toolbar-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -28,19 +28,19 @@
 
 #include "frame.h"
 
-#include "toolbar-common.h"
+#include "toolbar-xlike.h"
 
 #include "console-gtk-impl.h"
 
-/* We should really create a 'common' console type and fill it with
+/* We should really create a 'xlike' console type and fill it with
 ** all the shared code.  We would then just use
-** CONSOLE_INHERITS_METHOD(x,common,blah)
+** CONSOLE_INHERITS_METHOD(x,xlike,blah)
 */
-#define gtk_output_frame_toolbars common_output_frame_toolbars
-#define gtk_output_toolbar_button common_output_toolbar_button
-#define gtk_redraw_exposed_toolbars common_redraw_exposed_toolbars
-#define gtk_redraw_frame_toolbars common_redraw_frame_toolbars
-#define gtk_clear_frame_toolbars common_clear_frame_toolbars
+#define gtk_output_frame_toolbars xlike_output_frame_toolbars
+#define gtk_output_toolbar_button xlike_output_toolbar_button
+#define gtk_redraw_exposed_toolbars xlike_redraw_exposed_toolbars
+#define gtk_redraw_frame_toolbars xlike_redraw_frame_toolbars
+#define gtk_clear_frame_toolbars xlike_clear_frame_toolbars
 
 
 static void
--- a/src/toolbar-x.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/toolbar-x.c	Wed Feb 03 20:18:53 2010 +0000
@@ -33,7 +33,7 @@
 #include "toolbar.h"
 #include "window.h"
 
-#include "toolbar-common.h"
+#include "toolbar-xlike.h"
 
 #include "console-x-impl.h"
 #include "glyphs-x.h"
@@ -42,15 +42,15 @@
 #include "EmacsFrame.h"
 #include "EmacsFrameP.h"
 
-/* We should really create a 'common' console type and fill it with
+/* We should really create a 'xlike' console type and fill it with
 ** all the shared code.  We would then just use
-** CONSOLE_INHERITS_METHOD(x,common,blah)
+** CONSOLE_INHERITS_METHOD(x,xlike,blah)
 */
-#define x_output_frame_toolbars common_output_frame_toolbars
-#define x_output_toolbar_button common_output_toolbar_button
-#define x_redraw_exposed_toolbars common_redraw_exposed_toolbars
-#define x_redraw_frame_toolbars common_redraw_frame_toolbars
-#define x_clear_frame_toolbars common_clear_frame_toolbars
+#define x_output_frame_toolbars xlike_output_frame_toolbars
+#define x_output_toolbar_button xlike_output_toolbar_button
+#define x_redraw_exposed_toolbars xlike_redraw_exposed_toolbars
+#define x_redraw_frame_toolbars xlike_redraw_frame_toolbars
+#define x_clear_frame_toolbars xlike_clear_frame_toolbars
 
 static void
 x_initialize_frame_toolbars (struct frame *f)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/toolbar-xlike.c	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,730 @@
+/* toolbar implementation -- "Generic" (X or GTK) redisplay interface.
+   Copyright (C) 1995 Board of Trustees, University of Illinois.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 1995, 1996, 2002, 2010 Ben Wing.
+   Copyright (C) 1996 Chuck Thompson.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+#include <config.h>
+#include "lisp.h"
+
+#include "device-impl.h"
+#include "faces.h"
+#include "frame-impl.h"
+#include "glyphs.h"
+#include "toolbar.h"
+#include "window.h"
+
+/* This is used when we need to draw the toolbars ourselves -- on X or GTK.
+   On MS Windows, we use the built-in toolbar controls. */
+
+/* Only a very few things need to differ based on the toolkit used.
+**
+** Some of the routines used assert(FRAME_yyy_P(f)) checks, this is
+** now abstracted into __INTERNAL_APPROPRIATENESS_CHECK().  When we
+** add new window systems that use this code, we should either add a
+** new case here, or just remove the checks completely.
+**
+** At least for X & GTK redraw_frame_toolbars() might end up getting
+** called before we are completely initialized.  To avoid this, we use
+** the __INTERNAL_MAPPED_P(f) macro, that should return 0 if we should
+** not draw the toolbars yet.  When we add new window systems that use
+** this code, we should add a new case here, if they need it.
+**
+** When clearing the toolbar, it is nice to flush the drawing queue.
+** Use __INTERNAL_FLUSH to do this.  It is passed a device.
+*/
+#if defined(HAVE_GTK)
+#include "console-gtk-impl.h"
+#define __INTERNAL_MAPPED_P(f) GTK_WIDGET_REALIZED (FRAME_GTK_TEXT_WIDGET (f))
+#define __INTERNAL_FLUSH(d) gdk_flush()
+#define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_GTK_P (f))
+#elif defined(HAVE_X_WINDOWS)
+#include "console-x-impl.h"
+#define __INTERNAL_MAPPED_P(f) XtIsRealized (FRAME_X_SHELL_WIDGET (f))
+#define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_X_P (f))
+#define __INTERNAL_FLUSH(d) XFlush (DEVICE_X_DISPLAY (d))
+#else
+#define __INTERNAL_MAPPED_P(f) ABORT()
+#define __INTERNAL_APPROPRIATENESS_CHECK(f) ABORT()
+#define __INTERNAL_FLUSH(f) ABORT()
+#endif
+
+#include "toolbar-xlike.h"
+
+extern Lisp_Object Vtoolbar_shadow_thickness;
+
+static void __prepare_button_area (struct frame *f,
+				   struct toolbar_button *tb)
+{
+  int sx = tb->x;
+  int sy = tb->y;
+  int swidth = tb->width;
+  int sheight = tb->height;
+  int border_width = tb->border_width;
+  int x_adj, width_adj, y_adj, height_adj;
+  struct device *d = XDEVICE (f->device);
+  Lisp_Object  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+  struct window *w = XWINDOW (window);
+  int shadow_thickness;
+  int def_shadow_thickness = XINT (Fspecifier_instance(Vtoolbar_shadow_thickness, window, Qnil, Qnil));
+  face_index toolbar_findex;
+
+  if (tb->vertical)
+    {
+      x_adj = border_width;
+      width_adj = - 2 * border_width;
+      y_adj = height_adj = 0;
+    }
+  else
+    {
+      x_adj = width_adj = 0;
+      y_adj = border_width;
+      height_adj = - 2 * border_width;
+    }
+
+  toolbar_findex = get_builtin_face_cache_index (w, Vtoolbar_face);
+
+  /* Blank toolbar buttons that should be 3d will have EQ(tb->up_glyph, Qt)
+  ** Blank toolbar buttons that should be flat will have NILP (tb->up_glyph)
+  **
+  ** Real toolbar buttons will check tb->enabled && tb->down
+  */
+  if (EQ (Qt, tb->up_glyph))
+    {
+      shadow_thickness = def_shadow_thickness;
+    }
+  else if (NILP (tb->up_glyph))
+    {
+      shadow_thickness = 0;
+    }
+  else
+    {
+      if (tb->enabled)
+	{
+	  if (tb->down)
+	    shadow_thickness = -def_shadow_thickness;
+	  else
+	    shadow_thickness = def_shadow_thickness;
+	}
+      else
+	{
+	  shadow_thickness = 0;
+	}
+    }
+  
+  /* Blank the entire area. */
+  redisplay_clear_region (window, toolbar_findex,
+			  sx + x_adj, sy + y_adj,
+			  swidth + width_adj,
+			  sheight + height_adj);
+
+  /* Draw the outline. */
+  if (shadow_thickness)
+    {
+      MAYBE_DEVMETH (d, bevel_area,
+		     (w, toolbar_findex, sx + x_adj,
+		      sy + y_adj, swidth + width_adj,
+		      sheight + height_adj, abs(shadow_thickness),
+		      EDGE_ALL, (shadow_thickness < 0) ? EDGE_BEVEL_IN
+						       : EDGE_BEVEL_OUT));
+    }
+
+  /* Handle the borders... */
+  redisplay_clear_region (window, toolbar_findex,
+			  sx, sy,
+			  (tb->vertical ? border_width : swidth),
+			  (tb->vertical ? sheight : border_width));
+  redisplay_clear_region (window, toolbar_findex,
+			  (tb->vertical ? sx + swidth : sx),
+			  (tb->vertical ? sy : sy + sheight),
+			  (tb->vertical ? border_width : swidth),
+			  (tb->vertical ? sheight : border_width));
+}
+
+#define xlike_draw_blank_toolbar_button(f,tb) __prepare_button_area (f,tb)
+
+void
+xlike_output_toolbar_button (struct frame *f, Lisp_Object button)
+{
+  int shadow_thickness = 2;
+  int x_adj, y_adj, width_adj, height_adj;
+  struct device *d = XDEVICE (f->device);
+  Lisp_Object instance, window, glyph;
+  struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+  struct Lisp_Image_Instance *p;
+  struct window *w;
+  int vertical = tb->vertical;
+  int border_width = tb->border_width;
+  face_index button_findex;
+
+  if (vertical)
+    {
+      x_adj = border_width;
+      width_adj = - 2 * border_width;
+      y_adj = 0;
+      height_adj = 0;
+    }
+  else
+    {
+      x_adj = 0;
+      width_adj = 0;
+      y_adj = border_width;
+      height_adj = - 2 * border_width;
+    }
+
+  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+  w = XWINDOW (window);
+
+  glyph = get_toolbar_button_glyph (w, tb);
+
+  if (tb->enabled)
+    {
+      if (tb->down)
+	{
+	  shadow_thickness = -2;
+	}
+      else
+	{
+	  shadow_thickness = 2;
+	}
+    }
+  else
+    {
+      shadow_thickness = 0;
+    }
+
+  /* #### It is currently possible for users to trash us by directly
+     changing the toolbar glyphs.  Avoid crashing in that case. */
+  if (GLYPHP (glyph))
+    {
+      /* WARNING: this interface may change */
+      Lisp_Object face_list[2] = { XGLYPH_FACE (glyph), Vtoolbar_face };
+
+      button_findex = merge_face_list_to_cache_index (w, face_list, 2);
+      instance = glyph_image_instance (glyph, window, ERROR_ME_DEBUG_WARN, 1);
+    }
+  else
+    {
+      button_findex = get_builtin_face_cache_index (w, Vtoolbar_face);
+      instance = Qnil;
+    }
+
+  __prepare_button_area (f, tb);
+
+  if (IMAGE_INSTANCEP (instance))
+    {
+      int width = tb->width + width_adj - shadow_thickness * 2;
+      int height = tb->height + height_adj - shadow_thickness * 2;
+      int x_offset = x_adj + shadow_thickness;
+      int y_offset = y_adj + shadow_thickness;
+
+      p = XIMAGE_INSTANCE (instance);
+
+      if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
+	{
+	  struct display_box db;
+	  struct display_glyph_area dga;
+
+	  if (width > (int) IMAGE_INSTANCE_PIXMAP_WIDTH (p))
+	    {
+	      x_offset += ((int) (width - IMAGE_INSTANCE_PIXMAP_WIDTH (p))
+			   / 2);
+	      width = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
+	    }
+	  if (height > (int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
+	    {
+	      y_offset += ((int) (height - IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
+			   / 2);
+	      height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
+	    }
+
+	  /* Draw exactly in the area specified... */
+	  db.xpos = tb->x + x_offset;
+	  db.ypos = tb->y + y_offset;
+	  db.width = width;
+	  db.height = height;
+
+	  /* Display the whole glyph */
+	  dga.xoffset = 0;
+	  dga.yoffset = 0;
+	  dga.width = width;
+	  dga.height = height;
+	  
+	  redisplay_output_pixmap (w, instance,
+				   &db, &dga, 
+				   button_findex, 0, 0, 0, 0);
+	}
+      else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_TEXT)
+	{
+	  /* #### We need to make the face used configurable. */
+	  struct face_cachel *cachel =
+	    WINDOW_FACE_CACHEL (w, DEFAULT_INDEX);
+	  struct display_line dl;
+	  Lisp_Object string = IMAGE_INSTANCE_TEXT_STRING (p);
+	  unsigned char charsets[NUM_LEADING_BYTES];
+	  Ichar_dynarr *buf;
+	  struct font_metric_info fm;
+
+	  /* This could be true if we were called via the Expose event
+             handler.  Mark the button as dirty and return
+             immediately. */
+	  if (f->window_face_cache_reset)
+	    {
+	      tb->dirty = 1;
+	      MARK_TOOLBAR_CHANGED;
+	      return;
+	    }
+	  buf = Dynarr_new (Ichar);
+	  convert_ibyte_string_into_ichar_dynarr
+	    (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
+	  find_charsets_in_ichar_string (charsets, Dynarr_atp (buf, 0),
+					  Dynarr_length (buf));
+	  ensure_face_cachel_complete (cachel, window, charsets);
+	  face_cachel_charset_font_metric_info (cachel, charsets, &fm);
+
+	  dl.ascent = fm.ascent;
+	  dl.descent = fm.descent;
+	  dl.ypos = tb->y + y_offset + fm.ascent;
+
+	  if (fm.ascent + fm.descent <= height)
+	    {
+	      dl.ypos += (height - fm.ascent - fm.descent) / 2;
+	      dl.clip = 0;
+	    }
+	  else
+	    {
+	      dl.clip = fm.ascent + fm.descent - height;
+	    }
+
+	  MAYBE_DEVMETH (d, output_string,
+			 (w, &dl, buf, tb->x + x_offset, 0, 0, width,
+			  button_findex, 0, 0, 0, 0));
+	  Dynarr_free (buf);
+	}
+
+      /* We silently ignore the image if it isn't a pixmap or text. */
+    }
+
+  tb->dirty = 0;
+}
+
+static int
+xlike_get_button_size (struct frame *f, Lisp_Object window,
+			struct toolbar_button *tb, int vert, int pos)
+{
+  int shadow_thickness = 2;
+  int size;
+
+  if (tb->blank)
+    {
+      if (!NILP (tb->down_glyph))
+	size = XINT (tb->down_glyph);
+      else
+	size = DEFAULT_TOOLBAR_BLANK_SIZE;
+    }
+  else
+    {
+      struct window *w = XWINDOW (window);
+      Lisp_Object glyph = get_toolbar_button_glyph (w, tb);
+
+      /* Unless, of course, the user has done something stupid like
+         change the glyph out from under us.  Use a blank placeholder
+         in that case. */
+      if (NILP (glyph))
+	return XINT (f->toolbar_size[pos]);
+
+      if (vert)
+	size = glyph_height (glyph, window);
+      else
+	size = glyph_width (glyph, window);
+    }
+
+  if (!size)
+    {
+      /* If the glyph doesn't have a size we'll insert a blank
+         placeholder instead. */
+      return XINT (f->toolbar_size[pos]);
+    }
+
+  size += shadow_thickness * 2;
+
+  return (size);
+}
+
+#define XLIKE_OUTPUT_BUTTONS_LOOP(left)				\
+  do {									\
+    while (!NILP (button))						\
+      {									\
+	struct toolbar_button *tb = XTOOLBAR_BUTTON (button);		\
+	int size, height, width;					\
+									\
+	if (left && tb->pushright)					\
+	  break;							\
+									\
+        size = xlike_get_button_size (f, window, tb, vert, pos);	\
+									\
+	if (vert)							\
+	  {								\
+	    width = bar_width;						\
+	    if (y + size > max_pixpos)					\
+	      height = max_pixpos - y;					\
+	    else							\
+	      height = size;						\
+	  }								\
+	else								\
+	  {								\
+	    if (x + size > max_pixpos)					\
+	      width = max_pixpos - x;					\
+	    else							\
+	      width = size;						\
+	    height = bar_height;					\
+	  }								\
+									\
+	if (tb->x != x							\
+	    || tb->y != y						\
+	    || tb->width != width					\
+	    || tb->height != height					\
+	    || tb->dirty						\
+	    || f->clear) /* This is clearly necessary. */		\
+	  {								\
+	    if (width && height)					\
+	      {								\
+		tb->x = x;						\
+		tb->y = y;						\
+		tb->width = width;					\
+		tb->height = height;					\
+	        tb->border_width = border_width;			\
+	        tb->vertical = vert;					\
+									\
+                if (tb->blank || NILP (tb->up_glyph))			\
+		  {							\
+		    xlike_draw_blank_toolbar_button (f, tb);		\
+		  }							\
+	        else							\
+		  xlike_output_toolbar_button (f, button);		\
+	      }								\
+	  }								\
+									\
+	if (vert)							\
+	  y += height;							\
+	else								\
+	  x += width;							\
+									\
+	if ((vert && y == max_pixpos) || (!vert && x == max_pixpos))	\
+	  button = Qnil;						\
+	else								\
+	  button = tb->next;						\
+      }									\
+  } while (0)
+
+#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag)			\
+  do {									\
+    switch (pos)							\
+      {									\
+      case TOP_TOOLBAR:							\
+	(frame)->top_toolbar_was_visible = flag;			\
+	break;								\
+      case BOTTOM_TOOLBAR:						\
+	(frame)->bottom_toolbar_was_visible = flag;			\
+	break;								\
+      case LEFT_TOOLBAR:						\
+	(frame)->left_toolbar_was_visible = flag;			\
+	break;								\
+      case RIGHT_TOOLBAR:						\
+	(frame)->right_toolbar_was_visible = flag;			\
+	break;								\
+      default:								\
+	ABORT ();							\
+      }									\
+  } while (0)
+
+static void
+xlike_output_toolbar (struct frame *f, enum toolbar_pos pos)
+{
+  int x, y, bar_width, bar_height, vert;
+  int max_pixpos, right_size, right_start, blank_size;
+  int border_width = FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos);
+  Lisp_Object button, window;
+  face_index toolbar_findex;
+
+  get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 1);
+  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+  toolbar_findex = get_builtin_face_cache_index (XWINDOW (window), Vtoolbar_face);
+
+  /* Do the border */
+  redisplay_clear_region (window, toolbar_findex,
+			  x, y,
+			  (vert ? bar_width : border_width),
+			  (vert ? border_width : bar_height));
+  redisplay_clear_region (window, toolbar_findex,
+			  (vert ? x : x + bar_width - border_width),
+			  (vert ? y + bar_height - border_width : y),
+			  (vert ? bar_width : border_width),
+			  (vert ? border_width : bar_height));
+
+  if (vert)
+    {
+      max_pixpos = y + bar_height - border_width;
+      y += border_width;
+    }
+  else
+    {
+      max_pixpos = x + bar_width - border_width;
+      x += border_width;
+    }
+
+  button = FRAME_TOOLBAR_BUTTONS (f, pos);
+  right_size = 0;
+
+  /* First loop over all of the buttons to determine how much room we
+     need for left hand and right hand buttons.  This loop will also
+     make sure that all instances are instantiated so when we actually
+     output them they will come up immediately. */
+  while (!NILP (button))
+    {
+      struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+      int size = xlike_get_button_size (f, window, tb, vert, pos);
+
+      if (tb->pushright)
+	right_size += size;
+
+      button = tb->next;
+    }
+
+  button = FRAME_TOOLBAR_BUTTONS (f, pos);
+
+  /* Loop over the left buttons, updating and outputting them. */
+  XLIKE_OUTPUT_BUTTONS_LOOP (1);
+
+  /* Now determine where the right buttons start. */
+  right_start = max_pixpos - right_size;
+  if (right_start < (vert ? y : x))
+    right_start = (vert ? y : x);
+
+  /* Output the blank which goes from the end of the left buttons to
+     the start of the right. */
+  blank_size = right_start - (vert ? y : x);
+  if (blank_size)
+    {
+      int height, width;
+
+      if (vert)
+	{
+	  width = bar_width;
+	  height = blank_size;
+	}
+      else
+	{
+	  width = blank_size;
+	  height = bar_height;
+	}
+
+      /*
+       * Use a 3D pushright separator only if there isn't a toolbar
+       * border.  A flat separator meshes with the border and looks
+       * better.
+       */
+      if (1)
+	{
+	  struct toolbar_button tb;
+
+	  tb.x = x;
+	  tb.y = y;
+	  tb.width = width;
+	  tb.height = height;
+	  tb.border_width = border_width;
+	  tb.vertical = vert;
+	  tb.enabled = 1;
+	  tb.up_glyph = border_width ? Qt : Qnil;
+
+	  __prepare_button_area (f, &tb);
+	}
+
+      if (vert)
+	y += height;
+      else
+	x += width;
+    }
+
+  /* Loop over the right buttons, updating and outputting them. */
+  XLIKE_OUTPUT_BUTTONS_LOOP (0);
+
+  if (!vert)
+    {
+      Lisp_Object frame = wrap_frame (f);
+
+      redisplay_clear_region (frame,
+			      DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1,
+			      bar_height);
+    }
+
+  SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
+  __INTERNAL_FLUSH (XDEVICE (f->device));
+}
+
+static void
+xlike_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change)
+{
+  Lisp_Object frame;
+  int x, y, width, height, vert;
+
+  get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 1);
+  frame = wrap_frame (f);
+
+  /* The thickness_change parameter is used by the toolbar resize routines
+     to clear any excess toolbar if the size shrinks. */
+  if (thickness_change < 0)
+    {
+      if (pos == LEFT_TOOLBAR || pos == RIGHT_TOOLBAR)
+	{
+	  x = x + width + thickness_change;
+	  width = -thickness_change;
+	}
+      else
+	{
+	  y = y + height + thickness_change;
+	  height = -thickness_change;
+	}
+    }
+
+  SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0);
+
+  redisplay_clear_region (frame, DEFAULT_INDEX, x, y, width, height);
+
+  __INTERNAL_FLUSH (XDEVICE (f->device));
+}
+
+void
+xlike_output_frame_toolbars (struct frame *f)
+{
+  __INTERNAL_APPROPRIATENESS_CHECK(f);
+
+  if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
+    xlike_output_toolbar (f, TOP_TOOLBAR);
+
+  if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
+    xlike_output_toolbar (f, BOTTOM_TOOLBAR);
+
+  if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
+    xlike_output_toolbar (f, LEFT_TOOLBAR);
+
+  if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
+    xlike_output_toolbar (f, RIGHT_TOOLBAR);
+}
+
+void
+xlike_clear_frame_toolbars (struct frame *f)
+{
+  __INTERNAL_APPROPRIATENESS_CHECK(f);
+
+  if (f->top_toolbar_was_visible
+      && !FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
+    xlike_clear_toolbar (f, TOP_TOOLBAR, 0);
+  if (f->bottom_toolbar_was_visible
+      && !FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
+    xlike_clear_toolbar (f, BOTTOM_TOOLBAR, 0);
+  if (f->left_toolbar_was_visible 
+      && !FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
+    xlike_clear_toolbar (f, LEFT_TOOLBAR, 0);
+  if (f->right_toolbar_was_visible 
+       && !FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
+    xlike_clear_toolbar (f, RIGHT_TOOLBAR, 0);
+}
+
+static void
+xlike_redraw_exposed_toolbar (struct frame *f, enum toolbar_pos pos, int x, int y,
+			    int width, int height)
+{
+  int bar_x, bar_y, bar_width, bar_height, vert;
+  Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos);
+
+  get_toolbar_coords (f, pos, &bar_x, &bar_y, &bar_width, &bar_height,
+		      &vert, 1);
+
+  if (((y + height) < bar_y) || (y > (bar_y + bar_height)))
+    return;
+  if (((x + width) < bar_x) || (x > (bar_x + bar_width)))
+    return;
+
+  while (!NILP (button))
+    {
+      struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+
+      if (vert)
+	{
+	  if (((tb->y + tb->height) > y) && (tb->y < (y + height)))
+	    tb->dirty = 1;
+
+	  /* If this is true we have gone past the exposed region. */
+	  if (tb->y > (y + height))
+	    break;
+	}
+      else
+	{
+	  if (((tb->x + tb->width) > x) && (tb->x < (x + width)))
+	    tb->dirty = 1;
+
+	  /* If this is true we have gone past the exposed region. */
+	  if (tb->x > (x + width))
+	    break;
+	}
+
+      button = tb->next;
+    }
+
+  /* Even if none of the buttons is in the area, the blank region at
+     the very least must be because the first thing we did is verify
+     that some portion of the toolbar is in the exposed region. */
+  xlike_output_toolbar (f, pos);
+}
+
+void
+xlike_redraw_exposed_toolbars (struct frame *f, int x, int y, int width,
+				int height)
+{
+  __INTERNAL_APPROPRIATENESS_CHECK(f);
+
+  if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
+    xlike_redraw_exposed_toolbar (f, TOP_TOOLBAR, x, y, width, height);
+
+  if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
+    xlike_redraw_exposed_toolbar (f, BOTTOM_TOOLBAR, x, y, width, height);
+
+  if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
+    xlike_redraw_exposed_toolbar (f, LEFT_TOOLBAR, x, y, width, height);
+
+  if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
+    xlike_redraw_exposed_toolbar (f, RIGHT_TOOLBAR, x, y, width, height);
+}
+
+void
+xlike_redraw_frame_toolbars (struct frame *f)
+{
+  /* There are certain startup paths that lead to update_EmacsFrame in
+     faces.c being called before a new frame is fully initialized.  In
+     particular before we have actually mapped it.  That routine can
+     call this one.  So, we need to make sure that the frame is
+     actually ready before we try and draw all over it. */
+  if (__INTERNAL_MAPPED_P(f))
+    xlike_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f),
+				    FRAME_PIXHEIGHT (f));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/toolbar-xlike.h	Wed Feb 03 20:18:53 2010 +0000
@@ -0,0 +1,21 @@
+/* toolbar-xlike.h
+**
+** Description: 
+**
+** Created by: William M. Perry
+** Copyright (c) 2001 Free Software Foundation
+**
+*/
+
+#ifndef __TOOLBAR_XLIKE_H__
+#define __TOOLBAR_XLIKE_H__
+
+extern void xlike_output_frame_toolbars (struct frame *f);
+extern void xlike_redraw_exposed_toolbars (struct frame *f,
+					    int x, int y,
+					    int width, int height);
+extern void xlike_redraw_frame_toolbars (struct frame *f);
+extern void xlike_output_toolbar_button (struct frame *f, Lisp_Object button);
+extern void xlike_clear_frame_toolbars (struct frame *f);
+
+#endif /* __TOOLBAR_XLIKE_H__ */
--- a/src/ui-gtk.c	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/ui-gtk.c	Wed Feb 03 20:18:53 2010 +0000
@@ -21,24 +21,23 @@
 ** along with XEmacs; see the file COPYING.  If not, write to
 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 ** Boston, MA 02111-1301, USA.  */
-*/
 
 #include <config.h>
 #include "lisp.h"
 
 #include "buffer.h"
-#include "console-gtk-impl.h"
 #include "device.h"
 #include "elhash.h"
-#include "event-gtk.h"
 #include "events.h"
 #include "faces.h"
+#include "hash.h"
+#include "sysdll.h"
+#include "window.h"
+
+#include "console-gtk-impl.h"
 #include "glyphs-gtk.h"
-#include "hash.h"
 #include "objects-gtk.h"
-#include "sysdll.h"
 #include "ui-gtk.h"
-#include "window.h"
 
 /* XEmacs specific GTK types */
 #include "gtk-glue.c"
--- a/src/ui-gtk.h	Sun Jan 31 18:29:48 2010 +0000
+++ b/src/ui-gtk.h	Wed Feb 03 20:18:53 2010 +0000
@@ -21,15 +21,14 @@
 ** along with XEmacs; see the file COPYING.  If not, write to
 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 ** Boston, MA 02111-1301, USA.  */
-*/
 
 #ifndef __UI_GTK_H__
 #define __UI_GTK_H__
 
 /* Encapsulate a foreign function call */
-#include <gtk/gtk.h>
+
+#include "sysgtk.h"
 #include "sysdll.h"
-#include "lrecord.h"
 
 typedef void (*ffi_actual_function) (void);
 typedef void (*ffi_marshalling_function) (ffi_actual_function, GtkArg *);
--- a/src/xgccache.c	Sun Jan 31 18:29:48 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,367 +0,0 @@
-/* Efficient caching of X GCs (graphics contexts).
-   Copyright (C) 1993 Free Software Foundation, Inc.
-   Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-/* Synched up with: Not in FSF. */
-
-/* Emacs uses a lot of different display attributes; for example, assume
-   that only four fonts are in use (normal, bold, italic, and bold-italic).
-   Then assume that one stipple or background is used for text selections,
-   and another is used for highlighting mousable regions.  That makes 16
-   GCs already.  Add in the fact that another GC may be needed to display
-   the text cursor in any of those regions, and you've got 32.  Add in
-   more fonts, and it keeps increasing exponentially.
-
-   We used to keep these GCs in a cache of merged (fully qualified) faces.
-   However, a lot of other code in xterm.c used XChangeGC of existing GCs,
-   which is kind of slow and kind of random.  Also, managing the face cache
-   was tricky because it was hard to know when a face was no longer visible
-   on the frame -- we had to mark all frames as garbaged whenever a face
-   was changed, which caused an unpleasant amount of flicker (since faces are
-   created/destroyed (= changed) whenever a frame is created/destroyed.
-
-   So this code maintains a cache at the GC level instead of at the face
-   level.  There is an upper limit on the size of the cache, after which we
-   will stop creating GCs and start reusing them (reusing the least-recently-
-   used ones first).  So if faces get changed, their GCs will eventually be
-   recycled.  Also more sharing of GCs is possible.
-
-   This code uses hash tables.  It could be that, if the cache size is small
-   enough, a linear search might be faster; but I doubt it, since we need
-   `equal' comparisons, not `eq', and I expect that the optimal cache size
-   will be ~100.
-
-   Written by jwz, 14 jun 93
- */
-
-#include <config.h>
-#include <X11/Xlib.h>
-#include "xgccache.h"
-
-
-#define GC_CACHE_SIZE 100
-
-#define GCCACHE_HASH
-
-
-#ifdef GCCACHE_HASH
-#include "lisp.h"
-#include "hash.h"
-#endif
-
-struct gcv_and_mask {
-  XGCValues gcv;
-  unsigned long mask;
-};
-
-struct gc_cache_cell {
-  GC gc;
-  struct gcv_and_mask gcvm;
-  struct gc_cache_cell *prev, *next;
-};
-
-struct gc_cache {
-  Display *dpy;		/* used only as arg to XCreateGC/XFreeGC */
-  Window window;	/* used only as arg to XCreateGC */
-  int size;
-  struct gc_cache_cell *head;
-  struct gc_cache_cell *tail;
-#ifdef GCCACHE_HASH
-  struct hash_table *table;
-#endif
-
-  int create_count;
-  int delete_count;
-};
-
-#ifdef GCCACHE_HASH
-static Hashcode
-gc_cache_hash (const void *arg)
-{
-  const struct gcv_and_mask *gcvm = (const struct gcv_and_mask *) arg;
-  unsigned long *longs = (unsigned long *) &gcvm->gcv;
-  Hashcode hash = gcvm->mask;
-  int i;
-  /* This could look at the mask and only use the used slots in the
-     hash code.  That would win in that we wouldn't have to initialize
-     every slot of the gcv when calling gc_cache_lookup.  But we need
-     the hash function to be as fast as possible; some timings should
-     be done. */
-  for (i = 0; i < (int) (sizeof (XGCValues) / sizeof (unsigned long)); i++)
-    hash = (hash << 1) ^ *longs++;
-  return hash;
-}
-
-#endif /* GCCACHE_HASH */
-
-static int
-gc_cache_eql (const void *arg1, const void *arg2)
-{
-  /* See comment in gc_cache_hash */
-  return !memcmp (arg1, arg2, sizeof (struct gcv_and_mask));
-}
-
-struct gc_cache *
-make_gc_cache (Display *dpy, Window window)
-{
-  struct gc_cache *cache = xnew (struct gc_cache);
-  cache->dpy = dpy;
-  cache->window = window;
-  cache->size = 0;
-  cache->head = cache->tail = 0;
-  cache->create_count = cache->delete_count = 0;
-#ifdef GCCACHE_HASH
-  cache->table =
-    make_general_hash_table (GC_CACHE_SIZE, gc_cache_hash, gc_cache_eql);
-#endif
-  return cache;
-}
-
-void
-free_gc_cache (struct gc_cache *cache)
-{
-  struct gc_cache_cell *rest, *next;
-  rest = cache->head;
-  while (rest)
-    {
-      XFreeGC (cache->dpy, rest->gc);
-      next = rest->next;
-      xfree (rest, struct gc_cache_cell *);
-      rest = next;
-    }
-#ifdef GCCACHE_HASH
-  free_hash_table (cache->table);
-#endif
-  xfree (cache, struct gc_cache *);
-}
-
-GC
-gc_cache_lookup (struct gc_cache *cache, XGCValues *gcv, unsigned long mask)
-{
-  struct gc_cache_cell *cell, *next, *prev;
-  struct gcv_and_mask gcvm;
-
-#ifdef DEBUG_XEMACS
-  (void) describe_gc_cache (cache, DGCCFLAG_DISABLE);
-#endif
-
-  if ((!!cache->head) != (!!cache->tail)) ABORT ();
-  if (cache->head && (cache->head->prev || cache->tail->next)) ABORT ();
-
-  gcvm.mask = mask;
-  gcvm.gcv = *gcv;	/* this copies... */
-
-#ifdef GCCACHE_HASH
-
-  /* The intermediate cast fools gcc into not outputting strict-aliasing
-     complaints */
-  if (gethash (&gcvm, cache->table, (const void **) (void *) &cell))
-
-#else /* !GCCACHE_HASH */
-
-  cell = cache->tail;	/* start at the end (most recently used) */
-  while (cell)
-    {
-      if (gc_cache_eql (&gcvm, &cell->gcvm))
-	break;
-      else
-	cell = cell->prev;
-    }
-
-  /* #### This whole file needs some serious overhauling. */
-  if (!(mask | GCTile) && cell->gc->values.tile)
-    cell = 0;
-  else if (!(mask | GCStipple) && cell->gc->values.stipple)
-    cell = 0;
-
-  if (cell)
-
-#endif /* !GCCACHE_HASH */
-
-    {
-      /* Found a cell.  Move this cell to the end of the list, so that it
-	 will be less likely to be collected than a cell that was accessed
-	 less recently.
-       */
-#if 0
-      debug_out ("Returning cached GC: %08lx\n", XE_GCONTEXT(cell));
-#endif
-      if (cell == cache->tail)
-	return cell->gc;
-
-      next = cell->next;
-      prev = cell->prev;
-      if (prev) prev->next = next;
-      if (next) next->prev = prev;
-      if (cache->head == cell) cache->head = next;
-      cell->next = 0;
-      cell->prev = cache->tail;
-      cache->tail->next = cell;
-      cache->tail = cell;
-      if (cache->head == cell) ABORT ();
-      if (cell->next) ABORT ();
-      if (cache->head->prev) ABORT ();
-      if (cache->tail->next) ABORT ();
-      return cell->gc;
-    }
-
-  /* else, cache miss. */
-
-  if (cache->size == GC_CACHE_SIZE)
-    /* Reuse the first cell on the list (least-recently-used).
-       Remove it from the list, and unhash it from the table.
-     */
-    {
-      cell = cache->head;
-      cache->head = cell->next;
-      cache->head->prev = 0;
-      if (cache->tail == cell) cache->tail = 0; /* only one */
-#if 0
-      debug_out ("Cache full, freeing GC: %08lx\n  ", XE_GCONTEXT(cell));
-#endif
-      XFreeGC (cache->dpy, cell->gc);
-      cache->delete_count++;
-#ifdef GCCACHE_HASH
-      remhash (&cell->gcvm, cache->table);
-#endif
-    }
-  else if (cache->size > GC_CACHE_SIZE)
-    ABORT ();
-  else
-    {
-      /* Allocate a new cell (don't put it in the list or table yet). */
-      cell = xnew (struct gc_cache_cell);
-      cache->size++;
-    }
-
-  /* Now we've got a cell (new or reused).  Fill it in. */
-  memcpy (&cell->gcvm.gcv, gcv, sizeof (XGCValues));
-  cell->gcvm.mask = mask;
-
-  /* Put the cell on the end of the list. */
-  cell->next = 0;
-  cell->prev = cache->tail;
-  if (cache->tail) cache->tail->next = cell;
-  cache->tail = cell;
-  if (! cache->head) cache->head = cell;
-
-  cache->create_count++;
-#ifdef GCCACHE_HASH
-  /* Hash it in the table */
-  puthash (&cell->gcvm, cell, cache->table);
-#endif
-
-  /* Now make and return the GC. */
-  cell->gc = XCreateGC (cache->dpy, cache->window, mask, gcv);
-
-  /* debug */
-  assert (cell->gc == gc_cache_lookup (cache, gcv, mask));
-
-#if 0
-  debug_out ("Returning new GC: %08lx\n  ", XE_GCONTEXT(cell));
-#endif
-  return cell->gc;
-}
-
-
-#ifdef DEBUG_XEMACS
-
-/* FLAGS
-   The flags argument is a bitwise or of any of the following:
-
-   DGCCFLAG_SUMMARY		Summary statistics for cache
-   DGCCFLAG_LIST_CELLS		If summary is being printed, print cell IDs too.
-   DGCCFLAG_CELL_DETAILS	If cell IDs are being printed, additionally
-				print the internal fields used and values.
-
-   DGCCFLAG_DEFAULT		A predefined combination giving whatever the
-				maintainers are currently interested in seeing.
-*/
-void
-describe_gc_cache (struct gc_cache *cache, int flags)
-{
-  int count = 0;
-  struct gc_cache_cell *cell = cache->head;
-
-  if (! flags & DGCCFLAG_SUMMARY) return;
-
-  stderr_out ("\nsize:    %d", cache->size);
-  stderr_out ("\ncreated: %d", cache->create_count);
-  stderr_out ("\ndeleted: %d", cache->delete_count);
-
-  if (flags & DGCCFLAG_LIST_CELLS)
-    while (cell)
-      {
-	struct gc_cache_cell *cell2;
-	int i = 0;
-	stderr_out ("\n%d:\t0x%lx  GC: 0x%08lx  hash: 0x%08lx\n",
-		    count, (long) cell, (long) XE_GCONTEXT(cell),
-		    gc_cache_hash (&cell->gcvm));
-
-	for (cell2 = cache->head; cell2; cell2 = cell2->next, i++)
-	  if (count != i &&
-	      gc_cache_hash (&cell->gcvm) == gc_cache_hash (&cell2->gcvm))
-	    stderr_out ("\tHASH COLLISION with cell %d\n", i);
-	stderr_out ("\tmask:       %8lx\n", cell->gcvm.mask);
-
-	if (flags & DGCCFLAG_CELL_DETAILS)
-	  {
-#define FROB(field) do {						\
-  if ((int)cell->gcvm.gcv.field != (~0))				\
-    stderr_out ("\t%-12s%8x\n", #field ":", (int)cell->gcvm.gcv.field);	\
-} while (0)
-	    FROB (function);
-	    FROB (plane_mask);
-	    FROB (foreground);
-	    FROB (background);
-	    FROB (line_width);
-	    FROB (line_style);
-	    FROB (cap_style);
-	    FROB (join_style);
-	    FROB (fill_style);
-	    FROB (fill_rule);
-	    FROB (arc_mode);
-	    FROB (tile);
-	    FROB (stipple);
-	    FROB (ts_x_origin);
-	    FROB (ts_y_origin);
-	    FROB (font);
-	    FROB (subwindow_mode);
-	    FROB (graphics_exposures);
-	    FROB (clip_x_origin);
-	    FROB (clip_y_origin);
-	    FROB (clip_mask);
-	    FROB (dash_offset);
-#undef FROB
-	  }
-
-	count++;
-	if (cell->next && cell == cache->tail)
-	  stderr_out ("\nERROR!  tail is here!\n\n");
-	else if (!cell->next && cell != cache->tail)
-	  stderr_out ("\nERROR!  tail is not at the end\n\n");
-	cell = cell->next;
-      }	/* while (cell) */
-
-  if (count != cache->size)
-    stderr_out ("\nERROR!  count should be %d\n\n", cache->size);
-}
-
-#endif /* DEBUG_XEMACS */
--- a/src/xgccache.h	Sun Jan 31 18:29:48 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/* Efficient caching of X GCs (graphics contexts).
-   Copyright (C) 1993 Free Software Foundation, Inc.
-
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-/* Synched up with: Not in FSF. */
-
-/* Written by jwz, 14 jun 93 */
-
-#ifndef INCLUDED_xgccache_h_
-#define INCLUDED_xgccache_h_
-
-struct gc_cache;
-struct gc_cache *make_gc_cache (Display *, Window);
-void free_gc_cache (struct gc_cache *cache);
-GC gc_cache_lookup (struct gc_cache *, XGCValues *, unsigned long mask);
-
-#define XE_GCONTEXT(cell) (XGContextFromGC(cell->gc))
-
-#ifdef DEBUG_XEMACS
-
-void describe_gc_cache (struct gc_cache *cache, int flags);
-
-#define DGCCFLAG_DISABLE		0
-#define DGCCFLAG_SUMMARY		1 << 0
-#define DGCCFLAG_LIST_CELLS		1 << 1
-#define DGCCFLAG_CELL_DETAILS		1 << 2
-/* A combination of the flags above. */
-#define DGCCFLAG_DEFAULT		DGCCFLAG_SUMMARY | DGCCFLAG_LIST_CELLS
-#endif
-
-#endif /* INCLUDED_xgccache_h_ */
--- a/tests/ChangeLog	Sun Jan 31 18:29:48 2010 +0000
+++ b/tests/ChangeLog	Wed Feb 03 20:18:53 2010 +0000
@@ -1,3 +1,34 @@
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* automated/case-tests.el:
+	* automated/case-tests.el (uni-mappings):
+	* automated/search-tests.el:
+	Delete old pristine-case-table code.  Rewrite the Unicode torture
+	test to take into account whether overlapping mappings exist for
+	more than one character, and not doing the upcase/downcase
+	comparisons in such cases.
+	
+	* automated/lisp-tests.el (foo):
+	* automated/lisp-tests.el (string-variable):
+	* automated/lisp-tests.el (featurep):
+	Replace Assert (equal ... with Assert-equal; same for other types
+	of equality.  Replace some awkward equivalents of Assert-equalp
+	with Assert-equalp.  Add lots of equalp tests.
+	
+	* automated/case-tests.el:
+	* automated/regexp-tests.el:
+	* automated/search-tests.el:
+	Fix up the comments at the top of the files.  Move rules about where
+	to put tests into case-tests.el.
+	
+	* automated/test-harness.el:
+	* automated/test-harness.el (test-harness-aborted-summary-template): New.
+	* automated/test-harness.el (test-harness-from-buffer):
+	* automated/test-harness.el (batch-test-emacs):
+	Fix Assert-test-not.  Create Assert-not-equal and variants.
+	Delete the doc strings from all these convenience functions to avoid
+	excessive repetition; instead use one copy in a comment.
+
 2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* automated/search-tests.el:
--- a/tests/automated/case-tests.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/tests/automated/case-tests.el	Wed Feb 03 20:18:53 2010 +0000
@@ -29,28 +29,30 @@
 
 ;;; Commentary:
 
-;; Test case-table related functionality.
+;; Test case-table related functionality.  See test-harness.el for
+;; instructions on how to run these tests.
 
 ;; NOTE NOTE NOTE: See also:
 ;;
 ;; (1) regexp-tests.el, for case-related regexp searching.
 ;; (2) search-tests.el, for case-related non-regexp searching.
-
-;; NOTE NOTE NOTE: There is some domain overlap among regexp-tests.el,
-;; search-tests.el and case-tests.el.  See search-tests.el.
-;;
-
-;; Ben thinks this is unnecessary.  See comment in search-tests.el.
+;; (3) lisp-tests.el, for case-related comparisons with `equalp'.
 
-;;(defvar pristine-case-table nil
-;;  "The standard case table, without manipulation from case-tests.el")
+;; NOTE NOTE NOTE: There is some domain overlap among case-tests.el,
+;; lisp-tests.el, regexp-tests.el, and search-tests.el.  The current rule
+;; for what goes where is:
 ;;
-;;(setq pristine-case-table (or
-;;			   ;; This is the compiled run; we've retained
-;;			   ;; it from the interpreted run.
-;;			   pristine-case-table 
-;;			   ;; This is the interpreted run; set it.
-;;			   (copy-case-table (standard-case-table))))
+;; (1) Anything regexp-related goes in regexp-tests.el, including searches.
+;; (2) Non-regexp searches go in search-tests.el.  This includes case-folding
+;;     searches in the situation where the test tests both folding and
+;;     non-folding behavior.
+;; (3) Anything else that involves case-testing but in an ancillary manner
+;;     goes into whichever primary area it is involved in (e.g. searches for
+;;     search-tests.el, Lisp primitives in lisp-tests.el).  But if it is
+;;     primarily case-related and happens to involve other areas in an
+;;     ancillary manner, it goes into case-tests.el.  This includes, for
+;;     example, the Unicode case map torture tests.
+
 
 (Assert (case-table-p (standard-case-table)))
 ;; Old case table test.
@@ -1442,60 +1444,113 @@
 	  (?\U00010426 ?\U0001044E) ;; DESERET CAPITAL LETTER OI
 	  (?\U00010427 ?\U0001044F) ;; DESERET CAPITAL LETTER EW
 	  ))
-       (uni-casetab (loop
-		      with case-table = (make-case-table)
-		      for (uc lc) in uni-mappings
-		      do (put-case-table-pair uc lc case-table)
-		      finally return case-table))
-       ;; All lowercase
-       (lower (with-output-to-string
-		(loop for (uc lc) in uni-mappings do (princ lc))))
-       ;; All uppercase
-       (upper (with-output-to-string
-		(loop for (uc lc) in uni-mappings do (princ lc))))
-       ;; For each pair, lower followed by upper
-       (lowerupper (with-output-to-string
-		     (loop for (uc lc) in uni-mappings
-		       do (princ lc) (princ uc))))
-       ;; For each pair, upper followed by lower
-       (upperlower (with-output-to-string
-		     (loop for (uc lc) in uni-mappings
-		       do (princ uc) (princ lc))))
-       )
-  (with-case-table uni-casetab
-    (Assert-equalp lower upper)
-    (Assert-equalp lowerupper upperlower)
-    (Assert-equal lower (downcase upper))
-    (Assert-equal upper (upcase lower))
-    (Assert-equal (downcase lower) (downcase (downcase lower)))
-    (Assert-equal (upcase lowerupper) (upcase upperlower))
-    (Assert-equal (downcase lowerupper) (downcase upperlower))
-    (with-temp-buffer
-      (set-case-table uni-casetab)
-      (loop for (str1 str2) in `((,lower ,upper)
-				 (,lowerupper ,upperlower)
-				 (,upper ,lower)
-				 (,upperlower ,lowerupper))
-	do
-	(erase-buffer)
-	(Assert= (point-min) 1)
-	(Assert= (point) 1)
-	(insert str1)
-	(let ((point (point))
-	      (case-fold-search t))
-	  (Assert= (length str1) (1- point))
-	  (goto-char (point-min))
-	  (Assert-eql (search-forward str2 nil t) point)))
-      (loop for (uc lc) in uni-mappings do
-	(loop for (ch1 ch2) in `((,uc ,lc)
-				 (,lc ,uc))
+       ;; a table to track mappings that overlap with some other mapping
+       (multi-hash (make-hash-table))
+       (uni-casetab
+	(loop
+	  with case-table = (make-case-table)
+	  for (uc lc) in uni-mappings do
+	  ;; see if there are existing mappings for either char of the new
+	  ;; mapping pair.
+	  (let* ((curucval (get-case-table 'downcase uc case-table))
+		 (curlcval (get-case-table 'upcase lc case-table))
+		 (curucval (and (not (eq curucval uc)) curucval))
+		 (curlcval (and (not (eq curlcval lc)) curlcval))
+		 )
+	    ;; if so, flag both the existing and new mapping pair as having
+	    ;; an overlapping mapping. 
+	    (when (or curucval curlcval)
+	      (loop for ch in (list curucval curlcval uc lc) do
+		(puthash ch t multi-hash)))
+
+	    ;; finally, make the new mapping.
+	    (put-case-table-pair uc lc case-table))
+	  finally return case-table)))
+  (flet ((ismulti (uc lc)
+	   (or (gethash uc multi-hash) (gethash lc multi-hash))))
+    (let (
+	  ;; All lowercase
+	  (lowermulti (with-output-to-string
+			(loop for (uc lc) in uni-mappings do (princ lc))))
+	  ;; All uppercase
+	  (uppermulti (with-output-to-string
+			(loop for (uc lc) in uni-mappings do (princ uc))))
+	  ;; For each pair, lower followed by upper
+	  (loweruppermulti (with-output-to-string
+			     (loop for (uc lc) in uni-mappings
+			       do (princ lc) (princ uc))))
+	  ;; For each pair, upper followed by lower
+	  (upperlowermulti (with-output-to-string
+			     (loop for (uc lc) in uni-mappings
+			       do (princ uc) (princ lc))))
+	  ;; All lowercase, no complex mappings
+	  (lower (with-output-to-string
+		   (loop for (uc lc) in uni-mappings do
+		     (unless (ismulti uc lc) (princ lc)))))
+	  ;; All uppercase, no complex mappings
+	  (upper (with-output-to-string
+		   (loop for (uc lc) in uni-mappings do
+		     (unless (ismulti uc lc) (princ uc)))))
+	  ;; For each pair, lower followed by upper, no complex mappings
+	  (lowerupper (with-output-to-string
+			(loop for (uc lc) in uni-mappings do
+			  (unless (ismulti uc lc) (princ lc) (princ uc)))))
+	  ;; For each pair, upper followed by lower, no complex mappings
+	  (upperlower (with-output-to-string
+			(loop for (uc lc) in uni-mappings do
+			  (unless (ismulti uc lc) (princ uc) (princ lc)))))
+	  )
+      (with-case-table
+	uni-casetab
+	;; Comparison with `equalp' uses a canonical mapping internally and
+	;; so should be able to handle multi-mappings.  Just comparing
+	;; using downcase and upcase, however, won't necessarily work in
+	;; the presence of such mappings -- that's what the internal canon
+	;; and eqv tables are for.
+	(Assert-equalp lowermulti uppermulti)
+	(Assert-equalp loweruppermulti upperlowermulti)
+	(Assert-equal lower (downcase upper))
+	(Assert-equal upper (upcase lower))
+	(Assert-equal (downcase lower) (downcase (downcase lower)))
+	(Assert-equal (upcase lowerupper) (upcase upperlower))
+	(Assert-equal (downcase lowerupper) (downcase upperlower))
+	;; Individually -- we include multi-mappings since we're using
+	;; `equalp'.
+	(loop
+	  for (uc lc) in uni-mappings do
+	  (Assert-equalp uc lc)
+	  (Assert-equalp (string uc) (string lc)))
+	)
+
+      ;; Here we include multi-mappings -- searching should be able to
+      ;; handle it.
+      (with-temp-buffer
+	(set-case-table uni-casetab)
+	(loop for (str1 str2) in `((,lowermulti ,uppermulti)
+				   (,loweruppermulti ,upperlowermulti)
+				   (,uppermulti ,lowermulti)
+				   (,upperlowermulti ,loweruppermulti))
 	  do
 	  (erase-buffer)
-	  (insert ?0)
-	  (insert ch1)
-	  (insert ?1)
-	  (goto-char (point-min))
-	  (Assert-eql (search-forward (char-to-string ch2) nil t) 3
-		      (format "Case-folded searching doesn't equate %s and %s"
-			      (char-as-unicode-escape ch1)
-			      (char-as-unicode-escape ch2))))))))
+	  (Assert= (point-min) 1)
+	  (Assert= (point) 1)
+	  (insert str1)
+	  (let ((point (point))
+		(case-fold-search t))
+	    (Assert= (length str1) (1- point))
+	    (goto-char (point-min))
+	    (Assert-eql (search-forward str2 nil t) point)))
+	(loop for (uc lc) in uni-mappings do
+	  (loop for (ch1 ch2) in `((,uc ,lc)
+				   (,lc ,uc))
+	    do
+	    (erase-buffer)
+	    (insert ?0)
+	    (insert ch1)
+	    (insert ?1)
+	    (goto-char (point-min))
+	    (Assert-eql (search-forward (char-to-string ch2) nil t) 3
+			(format "Case-folded searching doesn't equate %s and %s"
+				(char-as-unicode-escape ch1)
+				(char-as-unicode-escape ch2))))))
+      )))
--- a/tests/automated/lisp-tests.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/tests/automated/lisp-tests.el	Wed Feb 03 20:18:53 2010 +0000
@@ -1957,35 +1957,28 @@
 		 (foo-zero 400 (1+ most-positive-fixnum)))))
    "Checking multiple values are discarded correctly when forced")
   (Check-Error setting-constant (setq multiple-values-limit 20))
-  (Assert
-   (equal '(-1 1)
-	  (multiple-value-list (floor -3 4)))
+  (Assert-equal '(-1 1)
+	  (multiple-value-list (floor -3 4))
    "Checking #'multiple-value-list gives a sane result")
   (let ((ey 40000)
 	(bee "this is a string")
 	(cee #s(hash-table size 256 data (969 ?\xF9))))
-    (Assert
-     (equal
-      (multiple-value-list (values ey bee cee))
-      (multiple-value-list (values-list (list ey bee cee))))
+    (Assert-equal
+     (multiple-value-list (values ey bee cee))
+     (multiple-value-list (values-list (list ey bee cee)))
      "Checking that #'values and #'values-list are correctly related")
-    (Assert
-     (equal
-      (multiple-value-list (values-list (list ey bee cee)))
-      (multiple-value-list (apply #'values (list ey bee cee))))
+    (Assert-equal
+     (multiple-value-list (values-list (list ey bee cee)))
+     (multiple-value-list (apply #'values (list ey bee cee)))
      "Checking #'values-list and #'apply with #values are correctly related"))
-  (Assert
-   (= (multiple-value-call #'+ (floor 5 3) (floor 19 4)) 10)
+  (Assert= (multiple-value-call #'+ (floor 5 3) (floor 19 4)) 10
    "Checking #'multiple-value-call gives reasonable results.")
-  (Assert
-   (= (multiple-value-call (values '+ '*) (floor 5 3) (floor 19 4)) 10)
+  (Assert= (multiple-value-call (values '+ '*) (floor 5 3) (floor 19 4)) 10
    "Checking #'multiple-value-call correct when first arg multiple.")
-  (Assert
-   (= 1 (length (multiple-value-list (prog1 (floor pi) "hi there"))))
+  (Assert= 1 (length (multiple-value-list (prog1 (floor pi) "hi there")))
    "Checking #'prog1 does not pass back multiple values")
-  (Assert
-   (= 2 (length (multiple-value-list
-		 (multiple-value-prog1 (floor pi) "hi there"))))
+  (Assert= 2 (length (multiple-value-list
+		 (multiple-value-prog1 (floor pi) "hi there")))
    "Checking #'multiple-value-prog1 passes back multiple values")
   (multiple-value-bind (floored remainder this-is-nil)
       (floor pi 1.0)
@@ -2003,75 +1996,59 @@
     (Assert-eql 2.0 ey "Checking ey set correctly")
     (Assert-eql bee (- e 2.0) "Checking bee set correctly")
     (Assert (null cee) "Checking cee set to nil correctly"))
-  (Assert
-   (= 3 (length (multiple-value-list (eval '(values nil t pi)))))
+  (Assert= 3 (length (multiple-value-list (eval '(values nil t pi))))
    "Checking #'eval passes back multiple values")
-  (Assert
-   (= 2 (length (multiple-value-list (apply #'floor '(5 3)))))
+  (Assert= 2 (length (multiple-value-list (apply #'floor '(5 3))))
    "Checking #'apply passes back multiple values")
-  (Assert 
-   (= 2 (length (multiple-value-list (funcall #'floor 5 3))))
+  (Assert= 2 (length (multiple-value-list (funcall #'floor 5 3)))
    "Checking #'funcall passes back multiple values")
-  (Assert 
-   (equal '(1 2) (multiple-value-list 
-		  (multiple-value-call #'floor (values 5 3))))
+  (Assert-equal '(1 2) (multiple-value-list 
+		  (multiple-value-call #'floor (values 5 3)))
    "Checking #'multiple-value-call passes back multiple values correctly")
-  (Assert
-   (= 1 (length (multiple-value-list
-		 (and (multiple-value-function-returning-nil) t))))
+  (Assert= 1 (length (multiple-value-list
+		 (and (multiple-value-function-returning-nil) t)))
    "Checking multiple values from non-trailing forms discarded by #'and")
-  (Assert
-   (= 5 (length (multiple-value-list 
-		 (and t (multiple-value-function-returning-nil)))))
+  (Assert= 5 (length (multiple-value-list 
+		 (and t (multiple-value-function-returning-nil))))
    "Checking multiple values from final forms not discarded by #'and")
-  (Assert
-   (= 1 (length (multiple-value-list
-		 (or (multiple-value-function-returning-t) t))))
+  (Assert= 1 (length (multiple-value-list
+		 (or (multiple-value-function-returning-t) t)))
    "Checking multiple values from non-trailing forms discarded by #'and")
-  (Assert
-   (= 5 (length (multiple-value-list 
-		 (or nil (multiple-value-function-returning-t)))))
+  (Assert= 5 (length (multiple-value-list 
+		 (or nil (multiple-value-function-returning-t))))
    "Checking multiple values from final forms not discarded by #'and")
-  (Assert
-   (= 1 (length (multiple-value-list
-		 (cond ((multiple-value-function-returning-t))))))
+  (Assert= 1 (length (multiple-value-list
+		 (cond ((multiple-value-function-returning-t)))))
    "Checking cond doesn't pass back multiple values in tests.")
-  (Assert
-   (equal (list nil pi e radians-to-degrees degrees-to-radians)
+  (Assert-equal (list nil pi e radians-to-degrees degrees-to-radians)
 	  (multiple-value-list
-	   (cond (t (multiple-value-function-returning-nil)))))
+	   (cond (t (multiple-value-function-returning-nil))))
    "Checking cond passes back multiple values in clauses.")
-  (Assert
-   (= 1 (length (multiple-value-list
-		 (prog1 (multiple-value-function-returning-nil)))))
+  (Assert= 1 (length (multiple-value-list
+		 (prog1 (multiple-value-function-returning-nil))))
    "Checking prog1 discards multiple values correctly.")
-  (Assert
-   (= 5 (length (multiple-value-list
+  (Assert= 5 (length (multiple-value-list
 		 (multiple-value-prog1
-		  (multiple-value-function-returning-nil)))))
+		  (multiple-value-function-returning-nil))))
    "Checking multiple-value-prog1 passes back multiple values correctly.")
-  (Assert
-   (equal (list t pi e degrees-to-radians radians-to-degrees)
+  (Assert-equal (list t pi e degrees-to-radians radians-to-degrees)
 	  (multiple-value-list
-	   (catch 'VoN61Lo4Y (function-throwing-multiple-values)))))
-  (Assert
-   (equal (list t pi e degrees-to-radians radians-to-degrees)
+	   (catch 'VoN61Lo4Y (function-throwing-multiple-values))))
+  (Assert-equal (list t pi e degrees-to-radians radians-to-degrees)
 	  (multiple-value-list
 	   (loop
 	     for eye in `(a b c d ,e f g ,nil ,pi)
 	     do (when (null eye)
-		  (return (multiple-value-function-returning-t))))))
+		  (return (multiple-value-function-returning-t)))))
    "Checking #'loop passes back multiple values correctly.")
   (Assert
    (null (or))
    "Checking #'or behaves correctly with zero arguments.")
-  (Assert
-   (eq t (and))
+  (Assert-eq t (and)
    "Checking #'and behaves correctly with zero arguments.")
-  (Assert
-   (= (* 3.0 (- pi 3.0))
+  (Assert= (* 3.0 (- pi 3.0))
       (letf (((values three one-four-one-five-nine) (floor pi)))
-        (* three one-four-one-five-nine)))
+        (* three one-four-one-five-nine))
    "checking letf handles #'values in a basic sense"))
 
 ;; #'equalp tests.
@@ -2079,66 +2056,105 @@
       (eacute-character ?\u00E9)
       (Eacute-character ?\u00c9)
       (+base-chars+ (loop
-		       with res = (make-string 96 ?\x20)
-		       for int-char from #x20 to #x7f
-		       for char being each element in-ref res
-		       do (setf char (int-to-char int-char))
-		       finally return res)))
+		      with res = (make-string 96 ?\x20)
+		      for int-char from #x20 to #x7f
+		      for char being each element in-ref res
+		      do (setf char (int-to-char int-char))
+		      finally return res)))
+  (let ((equal-lists
+	 '((111111111111111111111111111111111111111111111111111
+	    111111111111111111111111111111111111111111111111111.0)
+	   (0 0.0 0.000 -0 -0.0 -0.000 #b0 0/5 -0/5)
+	   (21845 #b101010101010101 #x5555)
+	   (1.5 1.500000000000000000000000000000000000000000000000000000000
+		3/2)
+	   (-55 -110/2)
+	   ;; Can't use this, these values aren't `='.
+	   ;;(-12345678901234567890123457890123457890123457890123457890123457890
+	   ;; -12345678901234567890123457890123457890123457890123457890123457890.0)
+	   )))
+    (loop for li in equal-lists do
+      (loop for (x . tail) on li do
+	(loop for y in tail do
+	  (Assert-equalp x y)
+	  (Assert-equalp y x)))))
+
+  (let ((diff-list
+	 `(0 1 2 3 1000 5000000000 5555555555555555555555555555555555555
+	   -1 -2 -3 -1000 -5000000000 -5555555555555555555555555555555555555
+	   1/2 1/3 2/3 8/2 355/113 (/ 3/2 0.2) (/ 3/2 0.7)
+	   55555555555555555555555555555555555555555/2718281828459045
+	   0.111111111111111111111111111111111111111111111111111111111111111
+	   1e+300 1e+301 -1e+300 -1e+301)))
+    (loop for (x . tail) on diff-list do
+      (loop for y in tail do
+	(Assert-not-equalp x y)
+	(Assert-not-equalp y x))))
+
   (Assert-equalp "hi there" "Hi There"
-	  "checking equalp isn't case-sensitive")
+		 "checking equalp isn't case-sensitive")
   (Assert-equalp 99 99.0
-	  "checking equalp compares numerical values of different types")
+		 "checking equalp compares numerical values of different types")
   (Assert (null (equalp 99 ?c))
 	  "checking equalp does not convert characters to numbers")
   ;; Fixed in Hg d0ea57eb3de4.
   (Assert (null (equalp "hi there" [hi there]))
 	  "checking equalp doesn't error with string and non-string")
-  (Assert-eq t (equalp "ABCDEEFGH\u00CDJ" string-variable)
-	  "checking #'equalp is case-insensitive with an upcased constant") 
-  (Assert-eq t (equalp "abcdeefgh\xedj" string-variable)
-	  "checking #'equalp is case-insensitive with a downcased constant")
-  (Assert-eq t (equalp string-variable string-variable)
-	  "checking #'equalp works when handed the same string twice")
-  (Assert-eq t (equalp string-variable "aBcDeeFgH\u00Edj")
-	  "check #'equalp is case-insensitive with a variable-cased constant")
-  (Assert-eq t (equalp "" (bit-vector)) 
-	  "check empty string and empty bit-vector are #'equalp.")
-  (Assert-eq t (equalp (string) (bit-vector)) 
-	  "check empty string and empty bit-vector are #'equalp, no constants")
-  (Assert-eq t (equalp "hi there" (vector ?h ?i ?\  ?t ?h ?e ?r ?e))
-	  "check string and vector with same contents #'equalp")
-  (Assert-eq t (equalp (string ?h ?i ?\  ?t ?h ?e ?r ?e)
-			(vector ?h ?i ?\  ?t ?h ?e ?r ?e))
-	  "check string and vector with same contents #'equalp, no constants")
-  (Assert-eq t (equalp [?h ?i ?\  ?t ?h ?e ?r ?e]
-			(string ?h ?i ?\  ?t ?h ?e ?r ?e))
-	  "check string and vector with same contents #'equalp, vector constant")
-  (Assert-eq t (equalp [0 1.0 0.0 0 1]
-			(bit-vector 0 1 0 0 1))
-	  "check vector and bit-vector with same contents #'equalp,\
+  (Assert-equalp "ABCDEEFGH\u00CDJ" string-variable
+		 "checking #'equalp is case-insensitive with an upcased constant") 
+  (Assert-equalp "abcdeefgh\xedj" string-variable
+		 "checking #'equalp is case-insensitive with a downcased constant")
+  (Assert-equalp string-variable string-variable
+		 "checking #'equalp works when handed the same string twice")
+  (Assert-equalp string-variable "aBcDeeFgH\u00Edj"
+		 "check #'equalp is case-insensitive with a variable-cased constant")
+  (Assert-equalp "" (bit-vector) 
+		 "check empty string and empty bit-vector are #'equalp.")
+  (Assert-equalp (string) (bit-vector) 
+		 "check empty string and empty bit-vector are #'equalp, no constants")
+  (Assert-equalp "hi there" (vector ?h ?i ?\  ?t ?h ?e ?r ?e)
+		 "check string and vector with same contents #'equalp")
+  (Assert-equalp (string ?h ?i ?\  ?t ?h ?e ?r ?e)
+		 (vector ?h ?i ?\  ?t ?h ?e ?r ?e)
+	     "check string and vector with same contents #'equalp, no constants")
+  (Assert-equalp [?h ?i ?\  ?t ?h ?e ?r ?e]
+		 (string ?h ?i ?\  ?t ?h ?e ?r ?e)
+	     "check string and vector with same contents #'equalp, vector constant")
+  (Assert-equalp [0 1.0 0.0 0 1]
+		 (bit-vector 0 1 0 0 1)
+	     "check vector and bit-vector with same contents #'equalp,\
+ vector constant")
+  (Assert-not-equalp [0 2 0.0 0 1]
+		     (bit-vector 0 1 0 0 1)
+	     "check vector and bit-vector with different contents not #'equalp,\
  vector constant")
-  (Assert-eq t (equalp #*01001
-			(vector 0 1.0 0.0 0 1))
-	  "check vector and bit-vector with same contents #'equalp,\
+  (Assert-equalp #*01001
+		 (vector 0 1.0 0.0 0 1)
+	     "check vector and bit-vector with same contents #'equalp,\
  bit-vector constant")
-  (Assert-eq t (equalp ?\u00E9 Eacute-character)
-	  "checking characters are case-insensitive, one constant")
-  (Assert-eq nil (equalp ?\u00E9 (aref (format "%c" ?a) 0))
-	  "checking distinct characters are not equalp, one constant")
-  (Assert-eq t (equalp t (and))
-	  "checking symbols are correctly #'equalp")
-  (Assert-eq nil (equalp t (or nil '#:t))
-	  "checking distinct symbols with the same name are not #'equalp")
-  (Assert-eq t (equalp #s(char-table type generic data (?\u0080 "hi-there"))
-			(let ((aragh (make-char-table 'generic)))
-			  (put-char-table ?\u0080 "hi-there" aragh)
-			  aragh))
-	  "checking #'equalp succeeds correctly, char-tables")
-  (Assert-eq nil (equalp #s(char-table type generic data (?\u0080 "hi-there"))
-			  (let ((aragh (make-char-table 'generic)))
-			    (put-char-table ?\u0080 "HI-THERE" aragh)
-			    aragh))
-	  "checking #'equalp fails correctly, char-tables"))
+  (Assert-equalp ?\u00E9 Eacute-character
+		 "checking characters are case-insensitive, one constant")
+  (Assert-not-equalp ?\u00E9 (aref (format "%c" ?a) 0)
+		     "checking distinct characters are not equalp, one constant")
+  (Assert-equalp t (and)
+		 "checking symbols are correctly #'equalp")
+  (Assert-not-equalp t (or nil '#:t)
+		     "checking distinct symbols with the same name are not #'equalp")
+  (Assert-equalp #s(char-table type generic data (?\u0080 "hi-there"))
+		 (let ((aragh (make-char-table 'generic)))
+		   (put-char-table ?\u0080 "hi-there" aragh)
+		   aragh)
+		 "checking #'equalp succeeds correctly, char-tables")
+  (Assert-equalp #s(char-table type generic data (?\u0080 "hi-there"))
+		 (let ((aragh (make-char-table 'generic)))
+		   (put-char-table ?\u0080 "HI-THERE" aragh)
+		   aragh)
+		 "checking #'equalp succeeds correctly, char-tables")
+  (Assert-not-equalp #s(char-table type generic data (?\u0080 "hi-there"))
+		     (let ((aragh (make-char-table 'generic)))
+		       (put-char-table ?\u0080 "hi there" aragh)
+		       aragh)
+	     "checking #'equalp fails correctly, char-tables"))
 
 ;; There are more tests available for equalp here: 
 ;;
@@ -2199,10 +2215,8 @@
        (rassoc* (1- most-negative-fixnum) assoc*-list)
        (rassoc* (1- most-negative-fixnum) assoc*-list :test #'eql)
        "checking #'rassoc* correct if #'eql not explicitly specified")
-      (Assert-eq
-       (eql (1+most-positive-fixnum) (1+ most-positive-fixnum))
-       t
-       "checking #'eql handles a bignum literal properly.")
+      (Assert-eql (1+most-positive-fixnum) (1+ most-positive-fixnum)
+		  "checking #'eql handles a bignum literal properly.")
       (Assert-eq 
        (member* (1+most-positive-fixnum) member*-list)
        (member* (1+ most-positive-fixnum) member*-list :test #'equal)
--- a/tests/automated/regexp-tests.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/tests/automated/regexp-tests.el	Wed Feb 03 20:18:53 2010 +0000
@@ -30,9 +30,8 @@
 
 ;; Test regular expressions.
 
-;; NOTE NOTE NOTE: There is some domain overlap among regexp-tests.el,
-;; search-tests.el and case-tests.el.  See search-tests.el.
-;;
+;; NOTE NOTE NOTE: There is some domain overlap among case-tests.el,
+;; regexp-tests.el and search-tests.el.  See case-tests.el.
 
 (Check-Error-Message error "Trailing backslash"
 		     (string-match "\\" "a"))
--- a/tests/automated/search-tests.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/tests/automated/search-tests.el	Wed Feb 03 20:18:53 2010 +0000
@@ -38,17 +38,8 @@
 ;; (1) regexp-tests.el, for regexp searching.
 ;; (2) case-tests.el, for some case-related searches.
 
-;; NOTE NOTE NOTE: There is some domain overlap among regexp-tests.el,
-;; search-tests.el and case-tests.el.  The current rule for what goes where
-;; is:
-;;
-;; (1) Anything regexp-related goes in regexp-tests.el, including searches.
-;; (2) Non-regexp searches go in search-tests.el.  This includes case-folding
-;;     searches in the situation where the test tests both folding and
-;;     non-folding behavior.
-;; (3) If it tests specifically case-folding search behavior, it may go in
-;;     case-tets.el, especially if it is testing something non-search-related
-;;     at the same time (e.g. the Unicode case map torture tests).
+;; NOTE NOTE NOTE: There is some domain overlap among case-tests.el,
+;; regexp-tests.el and search-tests.el.  See case-tests.el.
 
 (with-temp-buffer
   (insert "Test Buffer")
@@ -195,9 +186,6 @@
  (let ((debug-xemacs-searches 1)
        newcase)
    (with-temp-buffer
-     ;;#### Ben thinks this is unnecessary.  with-temp-buffer creates
-     ;;a new buffer, which automatically inherits the standard case table.
-     ;;(set-case-table pristine-case-table)
      (insert "\n\nDer beruehmte deutsche Fleiss\n\n")
      (goto-char (point-min))
      (Assert (search-forward "Fleiss"))
--- a/tests/automated/test-harness.el	Sun Jan 31 18:29:48 2010 +0000
+++ b/tests/automated/test-harness.el	Wed Feb 03 20:18:53 2010 +0000
@@ -115,6 +115,12 @@
 	  (length "byte-compiler-tests.el:")) ; use the longest file name
   "Format for \"No tests\" lines printed after a file is run.")
 
+(defconst test-harness-aborted-summary-template
+  (format "%%-%ds          %%%dd tests completed (aborted)."
+	  (length "byte-compiler-tests.el:") ; use the longest file name
+	  5)
+  "Format for summary lines printed after a test run on a file was aborted.")
+
 ;;;###autoload
 (defun test-emacs-test-file (filename)
   "Test a file of Lisp code named FILENAME.
@@ -338,7 +344,7 @@
 DESCRIPTION describes the assertion; by default, the unevalated comparison
 expressions are given.  FAILING-CASE and DESCRIPTION are useful when Assert
 is used in a loop."
-	(let* ((assertion `(,test ,testval ,expected))
+	(let* ((assertion `(not (,test ,testval ,expected)))
 	       (failmsg `(format "%S shouldn't be `%s' to %S but is"
 			  ,testval ',test ,expected))
 	       (failmsg2 (if failing-case `(concat 
@@ -347,71 +353,52 @@
 			  failmsg)))
 	  `(Assert ,assertion ,failmsg2 ,description)))
 
-      (defmacro Assert-eq (testval expected &optional failing-case description)
-	"Test passes if TESTVAL is 'eq' to EXPECTED.
-Optional FAILING-CASE describes the particular failure; any value given
-here will be concatenated with a phrase describing the expected and actual
-values of the comparison.  Optional DESCRIPTION describes the assertion; by
-default, the unevalated comparison expressions are given.  FAILING-CASE and
-DESCRIPTION are useful when Assert is used in a loop."
+      ;; Specific versions of `Assert-test'.  These are just convenience
+      ;; functions, functioning identically to `Assert-test', and duplicating
+      ;; the doc string for each would be too annoying.
+      (defmacro Assert-eq (testval expected &optional failing-case
+			   description)
 	`(Assert-test eq ,testval ,expected ,failing-case ,description))
-
-      (defmacro Assert-eql (testval expected &optional failing-case description)
-	"Test passes if TESTVAL is 'eql' to EXPECTED.
-Optional FAILING-CASE describes the particular failure; any value given
-here will be concatenated with a phrase describing the expected and actual
-values of the comparison.  Optional DESCRIPTION describes the assertion; by
-default, the unevalated comparison expressions are given.  FAILING-CASE and
-DESCRIPTION are useful when Assert is used in a loop."
+      (defmacro Assert-eql (testval expected &optional failing-case
+			    description)
 	`(Assert-test eql ,testval ,expected ,failing-case ,description))
-
       (defmacro Assert-equal (testval expected &optional failing-case
 			      description)
-	"Test passes if TESTVAL is 'equal' to EXPECTED.
-Optional FAILING-CASE describes the particular failure; any value given
-here will be concatenated with a phrase describing the expected and actual
-values of the comparison.  Optional DESCRIPTION describes the assertion; by
-default, the unevalated comparison expressions are given.  FAILING-CASE and
-DESCRIPTION are useful when Assert is used in a loop."
 	`(Assert-test equal ,testval ,expected ,failing-case ,description))
-
       (defmacro Assert-equalp (testval expected &optional failing-case
 			      description)
-	"Test passes if TESTVAL is 'equalp' to EXPECTED.
-Optional FAILING-CASE describes the particular failure; any value given
-here will be concatenated with a phrase describing the expected and actual
-values of the comparison.  Optional DESCRIPTION describes the assertion; by
-default, the unevalated comparison expressions are given.  FAILING-CASE and
-DESCRIPTION are useful when Assert is used in a loop."
 	`(Assert-test equalp ,testval ,expected ,failing-case ,description))
-
       (defmacro Assert-string= (testval expected &optional failing-case
 			      description)
-	"Test passes if TESTVAL is 'string=' to EXPECTED.
-Optional FAILING-CASE describes the particular failure; any value given
-here will be concatenated with a phrase describing the expected and actual
-values of the comparison.  Optional DESCRIPTION describes the assertion; by
-default, the unevalated comparison expressions are given.  FAILING-CASE and
-DESCRIPTION are useful when Assert is used in a loop."
 	`(Assert-test string= ,testval ,expected ,failing-case ,description))
+      (defmacro Assert= (testval expected &optional failing-case
+			 description)
+	`(Assert-test = ,testval ,expected ,failing-case ,description))
+      (defmacro Assert<= (testval expected &optional failing-case
+			  description)
+	`(Assert-test <= ,testval ,expected ,failing-case ,description))
 
-      (defmacro Assert= (testval expected &optional failing-case description)
-	"Test passes if TESTVAL is '=' to EXPECTED.
-Optional FAILING-CASE describes the particular failure; any value given
-here will be concatenated with a phrase describing the expected and actual
-values of the comparison.  Optional DESCRIPTION describes the assertion; by
-default, the unevalated comparison expressions are given.  FAILING-CASE and
-DESCRIPTION are useful when Assert is used in a loop."
-	`(Assert-test = ,testval ,expected ,failing-case ,description))
-
-      (defmacro Assert<= (testval expected &optional failing-case description)
-	"Test passes if TESTVAL is '<=' to EXPECTED.
-Optional FAILING-CASE describes the particular failure; any value given
-here will be concatenated with a phrase describing the expected and actual
-values of the comparison.  Optional DESCRIPTION describes the assertion; by
-default, the unevalated comparison expressions are given.  FAILING-CASE and
-DESCRIPTION are useful when Assert is used in a loop."
-	`(Assert-test <= ,testval ,expected ,failing-case ,description))
+      ;; Specific versions of `Assert-test-not'.  These are just convenience
+      ;; functions, functioning identically to `Assert-test-not', and
+      ;; duplicating the doc string for each would be too annoying.
+      (defmacro Assert-not-eq (testval expected &optional failing-case
+			       description)
+	`(Assert-test-not eq ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not-eql (testval expected &optional failing-case
+				description)
+	`(Assert-test-not eql ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not-equal (testval expected &optional failing-case
+				  description)
+	`(Assert-test-not equal ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not-equalp (testval expected &optional failing-case
+				   description)
+	`(Assert-test-not equalp ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not-string= (testval expected &optional failing-case
+				    description)
+	`(Assert-test-not string= ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not= (testval expected &optional failing-case
+			     description)
+	`(Assert-test-not = ,testval ,expected ,failing-case ,description))
 
       (defmacro Check-Error (expected-error &rest body)
 	(let ((quoted-body (if (= 1 (length body))
@@ -517,7 +504,7 @@
 	 (princ (format "Unexpected error %S while executing interpreted code\n"
 		error-info))
 	 (message "Unexpected error %S while executing interpreted code." error-info)
-	 (message "Test suite execution aborted." error-info)
+	 (message "Test suite execution aborted.")
 	 ))
       (princ "\nTesting Compiled Lisp\n\n")
       (let (code
@@ -538,7 +525,7 @@
 	   (princ (format "Unexpected error %S while executing byte-compiled code\n"
 			  error-info))
 	   (message "Unexpected error %S while executing byte-compiled code." error-info)
-	   (message "Test suite execution aborted." error-info)
+	   (message "Test suite execution aborted.")
 	   )))
       (princ (format "\nSUMMARY for %s:\n" filename))
       (princ (format "\t%5d passes\n" passes))
@@ -555,12 +542,16 @@
 		       other-failures))
 	     (basename (file-name-nondirectory filename))
 	     (summary-msg
-	      (if (> total 0)
-		  (format test-harness-file-summary-template
-			  (concat basename ":")
-			  passes total (/ (* 100 passes) total))
-		(format test-harness-null-summary-template
-			(concat basename ":"))))
+	      (cond ((> unexpected-test-file-failures 0)
+		     (format test-harness-aborted-summary-template
+			     (concat basename ":") total))
+		    ((> total 0)
+		     (format test-harness-file-summary-template
+			     (concat basename ":")
+			     passes total (/ (* 100 passes) total)))
+		    (t
+		     (format test-harness-null-summary-template
+			     (concat basename ":")))))
 	     (reasons ""))
 	(maphash (lambda (key value)
 		   (setq reasons
@@ -700,14 +691,19 @@
 		 (basename (file-name-nondirectory (first head)))
 		 (nsucc (second head))
 		 (ntest (third head)))
-	    (if (> ntest 0)
-		(message test-harness-file-summary-template
-			 (concat basename ":")
-			 nsucc
-			 ntest
-			 (/ (* 100 nsucc) ntest))
-	      (message test-harness-null-summary-template
-		       (concat basename ":")))
+	    (cond ((member (first head) unexpected-test-suite-failure-files)
+		   (message test-harness-aborted-summary-template
+			    (concat basename ":")
+			    ntest))
+		  ((> ntest 0)
+		   (message test-harness-file-summary-template
+			    (concat basename ":")
+			    nsucc
+			    ntest
+			    (/ (* 100 nsucc) ntest)))
+		  (t
+		   (message test-harness-null-summary-template
+			    (concat basename ":"))))
 	    (setq results (cdr results)))))
       (when (> unexpected-test-suite-failures 0)
 	(message "\n***** There %s %d unexpected test suite %s in %s:"