changeset 4569:80e0588fb42f

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 28 Dec 2008 14:55:02 +0000
parents 7ca6d57ce12d (diff) 1d74a1d115ee (current diff)
children e6a7054a9c30
files lisp/ChangeLog src/ChangeLog src/file-coding.c src/file-coding.h tests/ChangeLog
diffstat 66 files changed, 1862 insertions(+), 1317 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Dec 28 14:46:24 2008 +0000
+++ b/ChangeLog	Sun Dec 28 14:55:02 2008 +0000
@@ -1,3 +1,33 @@
+2008-12-27  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* configure.ac: Vladimir Ivanovic's change of 2008-09-17 was
+	effective, but not correct. The original issue was that m4
+	stripped [], so "char *v[]" in configure.ac became "char *v" in
+	configure. His change to configure.ac rendered the declaration
+	"char **v[]", which is effective but confusing; this change
+	renders it "char **v".
+	* configure: Regenerate.
+
+2008-10-25  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* INSTALL: Give better pointers to package documentation.
+
+2008-10-25  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* configure.ac (xemacs_cc_cc_mismatch): Improve g++ detection.
+
+2008-09-17  Vladimir G. Ivanovic  <vladimir@acm.org>
+
+	* configure:    Fixed two typos in args of main: char *v -> char **v
+	* configure.ac: Fixed two typos in args of main: char *v -> char **v
+
+2008-08-03  Mats Lidell  <matsl@xemacs.org>
+
+	* configure.ac: Fix typo xft_gauge to xft_gauges
+
+	* configure.ac (XE_COMPLEX_ARG): Use different defaults for
+	with-xft and without-xft.
+
 2008-07-06  Ville Skyttä  <scop@xemacs.org>
 
 	* configure.ac (xe_fst):
--- a/INSTALL	Sun Dec 28 14:46:24 2008 +0000
+++ b/INSTALL	Sun Dec 28 14:55:02 2008 +0000
@@ -1,7 +1,7 @@
 XEmacs Installation Guide
 
 Copyright (c) 1994, 1995, 1996 Board of Trustees, University of Illinois
-Copyright (c) 1994-1999, 2003 Free Software Foundation, Inc.
+Copyright (c) 1994-1999, 2003, 2008 Free Software Foundation, Inc.
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the
@@ -61,11 +61,13 @@
 PACKAGE SYSTEM
 ==============
 
-The file README.packages contain information vital to have a fully
+The FAQ sections 1.7 and 2.1 contain information vital to have a fully
 working XEmacs.  It includes a description of available packages, and
 how to bootstrap XEmacs from a minimal or a complete set of packages.
 This information was not included in this file only because it is too
-large for this terse INSTALL.  Please read README.packages now!
+large for this terse INSTALL.  The FAQ is available in Texinfo format
+in man/xemacs-faq.texi, as an Info file once you build XEmacs, and
+online at http://www.xemacs.org/Documentation/21.5/html/xemacs-faq_1.html.
 
 ADD-ON LIBRARIES
 ================
@@ -794,8 +796,8 @@
 remove the files that `configure' created (so you can compile XEmacs
 for a different configuration), type `make distclean'.
 
-READ README.packages
-====================
+READ THE FAQ
+============
 
 Do it!
 
@@ -803,8 +805,8 @@
 ========
 
 The most common problem is that you forgot to read and follow the
-directions in README.packages.  You can not have a normal XEmacs
-without downloading some additional packages.
+directions for installing bootstrap packages in the FAQ.  You can not
+have a normal XEmacs without downloading some additional packages.
 
 See the file PROBLEMS in this directory for a list of various problems
 sometimes encountered, and what to do about them.  PROBLEMS is also
--- a/configure	Sun Dec 28 14:46:24 2008 +0000
+++ b/configure	Sun Dec 28 14:55:02 2008 +0000
@@ -1538,7 +1538,8 @@
                           `gauges'. Prefix component with `no' to disable its
                           use of Xft. Requires X11, Xft, Xrender, freetype,
                           and fontconfig support. Default is `noemacs,
-                          nomenubars, notabs, nogauges'.
+                          nomenubars, notabs, nogauges'. The default when
+                          selected is `emacs, nomenubars, notabs, nogauges'.
   --with-gtk              Support GTK on the X Window System. (EXPERIMENTAL)
   --with-gnome            Support GNOME on the X Window System. (EXPERIMENTAL)
   --with-msw              Support MS Windows as a window system (only under
@@ -2888,12 +2889,12 @@
 fi;
 
 _xft_notfirst=""
-_xft_emacs_default=no
+_xft_emacs_default=yes
 _xft_menubars_default=no
 _xft_tabs_default=no
 _xft_gauges_default=no
 _xft_types="emacs menubars tabs gauges"
-_xft_default="noemacs,nomenubars,notabs,nogauges"
+_xft_default="emacs,nomenubars,notabs,nogauges"
 
 # If --with-xft or --without-xft were given then copy the value to the
 # equivalent enable_xft variable.
@@ -2970,7 +2971,7 @@
     eval "enable_xft_$y=\$_xft_${y}_default"
     unset _xft_${y}_default
 done
-
+with_xft_emacs=no
 fi;
 # If --with-gtk or --without-gtk were given then copy the value to the
 # equivalent enable_gtk variable.
@@ -19011,7 +19012,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/Intrinsic.h>
-    int main(int c, char *v) { return c>1 ? XlibSpecificationRelease : 0; }
+    int main(int c, char **v) { return c>1 ? XlibSpecificationRelease : 0; }
 _ACEOF
 rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
@@ -27332,11 +27333,11 @@
     with_xft_tabs="no"
   fi
 fi
-if test "$with_xft_gauge" != "no" ; then
+if test "$with_xft_gauges" != "no" ; then
   if test "$with_xft_emacs" = "yes" -a "$enable_widgets" != "no" ; then
-    with_xft_gauge="yes"
-  else
-    with_xft_gauge="no"
+    with_xft_gauges="yes"
+  else
+    with_xft_gauges="no"
   fi
 fi
 
@@ -27528,8 +27529,8 @@
 #define USE_XFT_TABS 1
 _ACEOF
 
-test "$with_xft_gauge" = "yes"  && cat >>confdefs.h <<\_ACEOF
-#define USE_XFT_GAUGE 1
+test "$with_xft_gauges" = "yes"  && cat >>confdefs.h <<\_ACEOF
+#define USE_XFT_GAUGES 1
 _ACEOF
 
 
@@ -38856,7 +38857,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-int main(int c,char *v){return 0;}
+int main(int c,char **v){return 0;}
 _ACEOF
 rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
@@ -39582,7 +39583,7 @@
   echo "    - Using Xft to render antialiased fonts in tab controls."
   echo "      WARNING: This feature will be replaced with a face."
 fi
-if test "$with_xft_gauge" = "yes"; then
+if test "$with_xft_gauges" = "yes"; then
   echo "    - Using Xft to render antialiased fonts in progress bars."
   echo "      WARNING: This feature will be replaced with a face."
   echo "      WARNING: This feature not yet implemented; setting ignored."
--- a/configure.ac	Sun Dec 28 14:46:24 2008 +0000
+++ b/configure.ac	Sun Dec 28 14:55:02 2008 +0000
@@ -690,9 +690,10 @@
 		[Xft],
 		[`emacs' (buffers), `menubars', `tabs', and `gauges'],
 		[X11, Xft, Xrender, freetype, and fontconfig],
-		[`noemacs, nomenubars, notabs, nogauges'])],
-	[],[],
-	[XE_COMPLEX_OPTION([emacs],[no]),
+		[`noemacs, nomenubars, notabs, nogauges'.
+                 The default when selected is `emacs, nomenubars, notabs, nogauges'])],
+	[],[with_xft_emacs=no],
+	[XE_COMPLEX_OPTION([emacs],[yes]),
 	XE_COMPLEX_OPTION([menubars],[no]),
 	XE_COMPLEX_OPTION([tabs],[no]),
 	XE_COMPLEX_OPTION([gauges],[no])])
@@ -2238,18 +2239,25 @@
 
 dnl If we're specifying XEMACS_CC, it'd better be in the same family
 dnl as CC or the following flag calculations are bogus.
-dnl #### We may want to actually error and abort here, but I am not sure.
+dnl No error/abort; detection is too fragile.
+
+xemacs_cc_cc_mismatch=no
 if test "$CC" != "$XEMACS_CC"; then
-  if test "$XEMACS_CC" = "g++" -a "$GCC" != "yes"; then
-    AC_MSG_WARN([CC and g++ are mismatched; XE_CFLAGS may be wrong])
-    xemacs_cc_cc_mismatch=yes
-  elif test -n "$GCC" -a "$XEMACS_CC" != "g++"; then
-    AC_MSG_WARN([gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong])
-    xemacs_cc_cc_mismatch=yes
+  case "$XEMACS_CC" in
+  *g++* )
+    if test "$GCC" != "yes"; then
+      AC_MSG_WARN([CC and g++ are mismatched; XE_CFLAGS may be wrong])
+      xemacs_cc_cc_mismatch=yes ;;
+  esac
+  if test -n "$GCC"; then
+    case $XEMACS_CC in
+    *g++* )
+      ;;
+    * )
+      AC_MSG_WARN([gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong])
+      xemacs_cc_cc_mismatch=yes ;;
+    esac
   dnl #### Add other detectable mismatches here.
-  else
-    xemacs_cc_cc_mismatch=no
-  fi
 fi
 
 dnl Calculate optimization flags.  These will be off by default in beta
@@ -3426,7 +3434,7 @@
 
   AC_MSG_CHECKING(the version of X11 being used)
   AC_RUN_IFELSE([AC_LANG_SOURCE([#include <X11/Intrinsic.h>
-    int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }])],
+    int main(int c, char **v) { return c>1 ? XlibSpecificationRelease : 0; }])],
     [./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4])
   AC_MSG_RESULT(R${x11_release})
   AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release})
@@ -3540,7 +3548,7 @@
       AC_DEFINE(HAVE_FONTCONFIG)
       AC_DEFINE(USE_XFT)
       dnl Due to interactions with other libraries, must postpone AC_DEFINE
-      dnl of USE_XFT_MENUBARS, USE_XFT_TABS, and USE_XFT_GAUGE.
+      dnl of USE_XFT_MENUBARS, USE_XFT_TABS, and USE_XFT_GAUGES.
       unset xft_includes_found
     fi
   fi
@@ -4429,11 +4437,11 @@
   fi
 fi
 dnl this is not in xft reloaded #3
-if test "$with_xft_gauge" != "no" ; then
+if test "$with_xft_gauges" != "no" ; then
   if test "$with_xft_emacs" = "yes" -a "$enable_widgets" != "no" ; then
-    with_xft_gauge="yes"
+    with_xft_gauges="yes"
   else
-    with_xft_gauge="no"
+    with_xft_gauges="no"
   fi
 fi
 
@@ -4526,7 +4534,7 @@
 
 test "$with_xft_menubars" = "yes"  && AC_DEFINE(USE_XFT_MENUBARS)
 test "$with_xft_tabs" = "yes"  && AC_DEFINE(USE_XFT_TABS)
-test "$with_xft_gauge" = "yes"  && AC_DEFINE(USE_XFT_GAUGE)
+test "$with_xft_gauges" = "yes"  && AC_DEFINE(USE_XFT_GAUGES)
 
 dnl ----------------------
 dnl Mule-dependent options
@@ -5574,7 +5582,7 @@
 dnl One of the above link tests may have succeeded but caused resulting
 dnl executables to fail to run.  Also any tests using AC_RUN_IFELSE will
 dnl have reported incorrect results.
-AC_RUN_IFELSE([AC_LANG_SOURCE([int main(int c,char *v[]){return 0;}])],[:],[
+AC_RUN_IFELSE([AC_LANG_SOURCE([int main(int c,char **v){return 0;}])],[:],[
   echo ""
   echo "*** PANIC *** The C compiler can no longer build working executables."
   echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
@@ -6078,7 +6086,7 @@
   echo "    - Using Xft to render antialiased fonts in tab controls."
   echo "      WARNING: This feature will be replaced with a face."
 fi
-if test "$with_xft_gauge" = "yes"; then
+if test "$with_xft_gauges" = "yes"; then
   echo "    - Using Xft to render antialiased fonts in progress bars."
   echo "      WARNING: This feature will be replaced with a face."
   echo "      WARNING: This feature not yet implemented; setting ignored."
--- a/etc/ChangeLog	Sun Dec 28 14:46:24 2008 +0000
+++ b/etc/ChangeLog	Sun Dec 28 14:55:02 2008 +0000
@@ -1,3 +1,8 @@
+2008-08-10  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* HELLO: Add a coding cookie, now the UTF-8 sequences prevent the
+	file being recognised as ISO-2022-7 automatically.
+
 2008-08-05  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* HELLO: Encode the Arabic using UTF-8 sequences, not ISO-8859-6. 
--- a/etc/HELLO	Sun Dec 28 14:46:24 2008 +0000
+++ b/etc/HELLO	Sun Dec 28 14:55:02 2008 +0000
@@ -1,3 +1,5 @@
+-*- coding: iso-2022-7 -*-
+
 You need many fonts to read all.
 Please correct this incomplete list and add more!
 
--- a/lib-src/config.values.in	Sun Dec 28 14:46:24 2008 +0000
+++ b/lib-src/config.values.in	Sun Dec 28 14:55:02 2008 +0000
@@ -15,178 +15,6 @@
 ;;; Variables defined in configure by AC_SUBST follow:
 ;;; (These are used in Makefiles)
 
-ALLOCA "@ALLOCA@"
-ARCHLIBDIR "@ARCHLIBDIR@"
-ARCHLIBDIR_USER_DEFINED "@ARCHLIBDIR_USER_DEFINED@"
-CC "@CC@"
-CFLAGS "@CFLAGS@"
-CPP "@CPP@"
-CPPFLAGS "@CPPFLAGS@"
-DEFS "@DEFS@"
-DOCDIR "@DOCDIR@"
-DOCDIR_USER_DEFINED "@DOCDIR_USER_DEFINED@"
-EARLY_PACKAGE_DIRECTORIES "@EARLY_PACKAGE_DIRECTORIES@"
-EARLY_PACKAGE_DIRECTORIES_USER_DEFINED "@EARLY_PACKAGE_DIRECTORIES_USER_DEFINED@"
-ECHO_C "@ECHO_C@"
-ECHO_N "@ECHO_N@"
-ECHO_T "@ECHO_T@"
-EGREP "@EGREP@"
-ETCDIR "@ETCDIR@"
-ETCDIR_USER_DEFINED "@ETCDIR_USER_DEFINED@"
-EXEC_PREFIX "@EXEC_PREFIX@"
-EXEC_PREFIX_USER_DEFINED "@EXEC_PREFIX_USER_DEFINED@"
-EXEEXT "@EXEEXT@"
-GTK_CONFIG "@GTK_CONFIG@"
-INFODIR "@INFODIR@"
-INFODIR_USER_DEFINED "@INFODIR_USER_DEFINED@"
-INFOPATH "@INFOPATH@"
-INFOPATH_USER_DEFINED "@INFOPATH_USER_DEFINED@"
-INSTALL "@INSTALL@"
-INSTALLPATH "@INSTALLPATH@"
-INSTALL_ARCH_DEP_SUBDIR "@INSTALL_ARCH_DEP_SUBDIR@"
-INSTALL_DATA "@INSTALL_DATA@"
-INSTALL_PROGRAM "@INSTALL_PROGRAM@"
-INSTALL_SCRIPT "@INSTALL_SCRIPT@"
-LAST_PACKAGE_DIRECTORIES "@LAST_PACKAGE_DIRECTORIES@"
-LAST_PACKAGE_DIRECTORIES_USER_DEFINED "@LAST_PACKAGE_DIRECTORIES_USER_DEFINED@"
-LATE_PACKAGE_DIRECTORIES "@LATE_PACKAGE_DIRECTORIES@"
-LATE_PACKAGE_DIRECTORIES_USER_DEFINED "@LATE_PACKAGE_DIRECTORIES_USER_DEFINED@"
-LDFLAGS "@LDFLAGS@"
-LIBOBJS "@LIBOBJS@"
-LIBS "@LIBS@"
-LIBSTDCPP "@LIBSTDCPP@"
-LISPDIR "@LISPDIR@"
-LISPDIR_USER_DEFINED "@LISPDIR_USER_DEFINED@"
-LN_S "@LN_S@"
-LTLIBOBJS "@LTLIBOBJS@"
-MAKE_DOCFILE "@MAKE_DOCFILE@"
-MAKE_SUBDIR "@MAKE_SUBDIR@"
-MODARCHDIR "@MODARCHDIR@"
-MODCFLAGS "@MODCFLAGS@"
-MODULEDIR "@MODULEDIR@"
-MODULEDIR_USER_DEFINED "@MODULEDIR_USER_DEFINED@"
-MOD_CC "@MOD_CC@"
-MOD_INSTALL_PROGRAM "@MOD_INSTALL_PROGRAM@"
-OBJECT_TO_BUILD "@OBJECT_TO_BUILD@"
-OBJEXT "@OBJEXT@"
-PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
-PACKAGE_NAME "@PACKAGE_NAME@"
-PACKAGE_PATH "@PACKAGE_PATH@"
-PACKAGE_PATH_USER_DEFINED "@PACKAGE_PATH_USER_DEFINED@"
-PACKAGE_STRING "@PACKAGE_STRING@"
-PACKAGE_TARNAME "@PACKAGE_TARNAME@"
-PACKAGE_VERSION "@PACKAGE_VERSION@"
-PATH_SEPARATOR "@PATH_SEPARATOR@"
-PREFIX "@PREFIX@"
-PREFIX_USER_DEFINED "@PREFIX_USER_DEFINED@"
-PROGNAME "@PROGNAME@"
-RANLIB "@RANLIB@"
-RECURSIVE_MAKE_ARGS "@RECURSIVE_MAKE_ARGS@"
-SET_MAKE "@SET_MAKE@"
-SHELL "@SHELL@"
-SITELISPDIR "@SITELISPDIR@"
-SITELISPDIR_USER_DEFINED "@SITELISPDIR_USER_DEFINED@"
-SITEMODULEDIR "@SITEMODULEDIR@"
-SITEMODULEDIR_USER_DEFINED "@SITEMODULEDIR_USER_DEFINED@"
-SRC_SUBDIR_DEPS "@SRC_SUBDIR_DEPS@"
-SUBDIR_MAKEFILES "@SUBDIR_MAKEFILES@"
-XEMACS_CC "@XEMACS_CC@"
-XE_CFLAGS "@XE_CFLAGS@"
-X_CFLAGS "@X_CFLAGS@"
-X_EXTRA_LIBS "@X_EXTRA_LIBS@"
-X_LIBS "@X_LIBS@"
-X_PRE_LIBS "@X_PRE_LIBS@"
-YACC "@YACC@"
-abs_builddir "@abs_builddir@"
-abs_srcdir "@abs_srcdir@"
-abs_top_builddir "@abs_top_builddir@"
-abs_top_srcdir "@abs_top_srcdir@"
-ac_ct_CC "@ac_ct_CC@"
-ac_ct_RANLIB "@ac_ct_RANLIB@"
-archlibdir "@archlibdir@"
-bindir "@bindir@"
-bitmapdir "@bitmapdir@"
-blddir "@blddir@"
-build "@build@"
-build_alias "@build_alias@"
-build_cpu "@build_cpu@"
-build_os "@build_os@"
-build_vendor "@build_vendor@"
-builddir "@builddir@"
-c_switch_all "@c_switch_all@"
-c_switch_general "@c_switch_general@"
-c_switch_window_system "@c_switch_window_system@"
-canna_libs "@canna_libs@"
-configuration "@configuration@"
-configure_input "@configure_input@"
-datadir "@datadir@"
-datarootdir "@datarootdir@"
-dll_cflags "@dll_cflags@"
-dll_ld "@dll_ld@"
-dll_ldflags "@dll_ldflags@"
-dll_ldo "@dll_ldo@"
-dll_post "@dll_post@"
-dnd_objs "@dnd_objs@"
-docdir "@docdir@"
-dynodump_arch "@dynodump_arch@"
-early_packages "@early_packages@"
-etcdir "@etcdir@"
-exec_prefix "@exec_prefix@"
-extra_includes "@extra_includes@"
-extra_objs "@extra_objs@"
-have_esd_config "@have_esd_config@"
-host_alias "@host_alias@"
-includedir "@includedir@"
-infodir "@infodir@"
-infopath "@infopath@"
-install_pp "@install_pp@"
-inststaticdir "@inststaticdir@"
-instvardir "@instvardir@"
-internal_makefile_list "@internal_makefile_list@"
-last_packages "@last_packages@"
-late_packages "@late_packages@"
-ld "@ld@"
-ld_dynamic_link_flags "@ld_dynamic_link_flags@"
-ld_libs_all "@ld_libs_all@"
-ld_libs_general "@ld_libs_general@"
-ld_libs_window_system "@ld_libs_window_system@"
-ld_switch_all "@ld_switch_all@"
-ld_switch_general "@ld_switch_general@"
-ld_switch_shared "@ld_switch_shared@"
-ld_switch_window_system "@ld_switch_window_system@"
-ldap_libs "@ldap_libs@"
-lib_gcc "@lib_gcc@"
-libdir "@libdir@"
-libexecdir "@libexecdir@"
-libs_xauth "@libs_xauth@"
-lispdir "@lispdir@"
-localstatedir "@localstatedir@"
-lwlib_objs "@lwlib_objs@"
-machfile "@machfile@"
-mandir "@mandir@"
-moduledir "@moduledir@"
-native_sound_lib "@native_sound_lib@"
-oldincludedir "@oldincludedir@"
-opsysfile "@opsysfile@"
-package_path "@package_path@"
-postgresql_libs "@postgresql_libs@"
-prefix "@prefix@"
-program_transform_name "@program_transform_name@"
-sbindir "@sbindir@"
-sharedstatedir "@sharedstatedir@"
-sitelispdir "@sitelispdir@"
-sitemoduledir "@sitemoduledir@"
-sound_cflags "@sound_cflags@"
-srcdir "@srcdir@"
-start_files "@start_files@"
-start_flags "@start_flags@"
-statedir "@statedir@"
-sysconfdir "@sysconfdir@"
-target_alias "@target_alias@"
-top_builddir "@top_builddir@"
-top_srcdir "@top_srcdir@"
-version "@version@"
-with_modules "@with_modules@"
 
 ;;; Variables defined in configure by AC_DEFINE and AC_DEFINE_UNQUOTED follow:
 ;;; (These are used in C code)
--- a/lisp/ChangeLog	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/ChangeLog	Sun Dec 28 14:55:02 2008 +0000
@@ -51,9 +51,76 @@
 	* mule/mule-coding.el (escape-quoted): 
 	* mule/mule-coding.el (iso-2022-lock): 
 	Add safe-charsets properties for all these coding systems. 
+
+2008-12-22  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* loadhist.el (symbol-file): 
+	Add support for differentiating between variables and functions to
+	#'symbol-file. 
+	* help.el (describe-function-1): 
+	(describe-variable): 
+	Call #'symbol-function explicitly with a 'defun or 'defvar
+	argument, depending on whether we're looking for a variable or a
+	function. 
+	* cus-face.el (custom-declare-face): 
+	Record information about the face in the load history; code taken
+	from GNU, pre-GPLv3 revision 1.45.
+
+2008-10-29  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* bytecomp.el (byte-compile-file): Protect encoding from latin-unity.
+
+2008-10-28  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* version.el (xemacs-betaname): Fix docstring typo.  (Thanks, Ville!)
+
+2008-09-30  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* version.el (xemacs-betaname):
+	Document relation to other version variables.
+
+2008-09-27  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* subr.el (with-string-as-buffer-contents):
+	Document initial position of point.
+
+2008-08-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* window.el (only-window-p): New.
+	Check if WINDOW is the only window in some context, normally its
+	frame.
+	(one-window-p): 
+	Implemented this in terms of #'only-window-p, calling it on the
+	selected window. 
+	(window-buffer-height): Uncomment this, make it work. 
+	(count-screen-lines): Support a BUFFER argument. 
+	(fit-window-to-buffer): Uncomment this, correct its implementation
+	to work with XEmacs. 
+	* help.el (temp-buffer-resize-mode): New. Name taken from GNU,
+	implementation our own.
+	* (resize-temp-buffer-window): New. GNU-compatible alias for
+	#'shrink-window-if-larger-than-buffer.
+	* dumped-lisp.el (preloaded-file-list): Move easy-mmode before
+	help, now that the latter uses #'define-minor-mode.
+	* frame.el: Point to #'temp-buffer-resize-mode in a comment.
+	Some of this code is from GNU; help.el CVS version 1.327 of
+	2007-03-21, window.el CVS version 1.122, of 2007-06-24. Both these
+	are GPLV2 or later. 
+
+2008-08-27  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* subr.el (skip-chars-quote): 
+	Correct the implementation, following the docstring of
+	#'skip-char-forward more closely rather than the documentation of
+	character classes in the Lispref. 
+
+2008-08-23  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* custom.el: Move #'custom-variable-p to C, since it's now called
+	from #'user-variable-p. 
+
+2008-08-23  Aidan Kehoe  <kehoea@parhasard.net>
 	
-2008-08-09  Aidan Kehoe  <kehoea@parhasard.net>
-
 	* mule/mule-coding.el (make-8-bit-coding-system): 
 	* mule/general-late.el (posix-charset-to-coding-system-hash): 
 	Use #'skip-chars-quote as appropriate. 
--- a/lisp/bytecomp.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/bytecomp.el	Sun Dec 28 14:55:02 2008 +0000
@@ -1618,7 +1618,10 @@
 	(unless byte-compile-overwrite-file
 	  (ignore-file-errors (delete-file target-file)))
 	(if (file-writable-p target-file)
-	    (write-region 1 (point-max) target-file)
+	    ;; prevent generic hooks from changing our format, eg,
+	    ;; latin-unity is known to change the coding system!
+	    (let ((write-region-pre-hook nil))
+	      (write-region 1 (point-max) target-file))
 	  ;; This is just to give a better error message than write-region
 	  (signal 'file-error
 		  (list "Opening output file"
--- a/lisp/cus-face.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/cus-face.el	Sun Dec 28 14:55:02 2008 +0000
@@ -50,6 +50,9 @@
 		frames (cdr frames))
 	  (face-display-set face value frame '(custom)))
 	(init-face-from-resources face)))
+    ;; Don't record SPEC until we see it causes no errors.
+    (put face 'face-defface-spec spec)
+    (push (cons 'defface face) current-load-list)
     (when (and doc (null (face-doc-string face)))
       (set-face-doc-string face doc))
     (custom-handle-all-keywords face args 'custom-face)
--- a/lisp/custom.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/custom.el	Sun Dec 28 14:55:02 2008 +0000
@@ -514,11 +514,9 @@
   (put symbol 'custom-autoload t)
   (custom-add-load symbol load))
 
-;; This test is also in the C code of `user-variable-p'.
-(defun custom-variable-p (variable)
-  "Return non-nil if VARIABLE is a custom variable."
-  (or (get variable 'standard-value)
-      (get variable 'custom-autoload)))
+;; XEmacs; 
+;; #'custom-variable-p is in symbols.c, since it's called from
+;; #'user-variable-p.
 
 ;;; Loading files needed to customize a symbol.
 ;;; This is in custom.el because menu-bar.el needs it for toggle cmds.
--- a/lisp/dumped-lisp.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/dumped-lisp.el	Sun Dec 28 14:55:02 2008 +0000
@@ -95,7 +95,6 @@
        ;; (pureload "profile")
        "loadhist"		; Must be dumped before loaddefs is loaded
 				; Used by help. 
-       "help"
        ;; (pureload "hyper-apropos")  Soon...
        "files"
        "lib-complete"
@@ -110,7 +109,8 @@
        "register"
        "iso8859-1"		; This must be before any modes
 				; (sets standard syntax table.)
-       "easy-mmode"		; Added for 21.5.
+       "easy-mmode"		; Added for 21.5. Used by help.
+       "help"
        "easymenu"		; Added for 20.3.
        "lisp-mode"
        "text-mode"
--- a/lisp/frame.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/frame.el	Sun Dec 28 14:55:02 2008 +0000
@@ -1850,6 +1850,8 @@
   :type 'number
   :group 'frames)
 
+;; See also #'temp-buffer-resize-mode in help.el. 
+
 (defun show-temp-buffer-in-current-frame (buffer)
   "For use as the value of `temp-buffer-show-function':
 always displays the buffer in the selected frame, regardless of the behavior
--- a/lisp/help.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/help.el	Sun Dec 28 14:55:02 2008 +0000
@@ -1425,7 +1425,7 @@
              nil)))
     (princ "\n")
     (or file-name
-	(setq file-name (symbol-file function)))
+	(setq file-name (symbol-file function 'defun)))
     (when file-name
 	(princ "  -- loaded from \"")
 	(if (not (bufferp standard-output))
@@ -1651,7 +1651,7 @@
 	 (princ (built-in-variable-doc variable))
 	 (princ ".\n")
 	 (require 'hyper-apropos)
-	 (let ((file-name (symbol-file variable))
+	 (let ((file-name (symbol-file variable 'defvar))
 	       opoint e)
 	   (when file-name
 	       (princ "  -- loaded from \"")
@@ -1878,4 +1878,21 @@
             (find-variable (extent-property e 'find-variable-symbol)))
 	(mouse-track event)))))
 
+(define-minor-mode temp-buffer-resize-mode
+  "Toggle the mode which makes windows smaller for temporary buffers.
+With prefix argument ARG, turn the resizing of windows displaying temporary
+buffers on if ARG is positive or off otherwise.
+This makes the window the right height for its contents, but never
+less than `window-min-height' nor a higher proportion of its frame than
+`temp-buffer-max-height'. (Note the differing semantics of the latter
+versus GNU Emacs, where `temp-buffer-max-height' is an integer number of
+lines.)
+This applies to `help', `apropos' and `completion' buffers, and some others."
+    :global t :group 'help
+    ;; XEmacs; our implementation of this is very different. 
+    (setq temp-buffer-shrink-to-fit temp-buffer-resize-mode))
+
+;; GNU name for this function. 
+(defalias 'resize-temp-buffer-window 'shrink-window-if-larger-than-buffer)
+
 ;;; help.el ends here
--- a/lisp/loadhist.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/loadhist.el	Sun Dec 28 14:55:02 2008 +0000
@@ -48,11 +48,12 @@
 are acceptable.
 If TYPE is `defvar', then variable definitions are acceptable.
 
-#### For the moment the difference is not implemented for non-autoloaded
-Lisp symbols."
+`defface' specifies a face definition only, and for the moment, it won't
+return faces created with `make-face' or `copy-face', just those created
+with `defface' and `custom-declare-face'."
   (interactive "SFind source file for symbol: ") ; XEmacs
   (block look-up-symbol-file
-    (let (built-in-file autoload-cons)
+    (let (built-in-file autoload-cons symbol-details)
       (when (and 
              (eq 'autoload
                  (car-safe (setq autoload-cons
@@ -64,9 +65,25 @@
                     (memq (fifth autoload-cons) '(nil macro)))))
         (return-from look-up-symbol-file
           (locate-library (second autoload-cons))))
-      (dolist (entry load-history)
-        (when (memq sym (cdr entry))
-          (return-from look-up-symbol-file (car entry))))
+      (cond ((eq 'defvar type)
+             ;; Load history entries corresponding to variables are just
+             ;; symbols.
+             (dolist (entry load-history)
+               (when (memq sym (cdr entry))
+                 (return-from look-up-symbol-file (car entry)))))
+            ((not (null type))
+             ;; Non-variables have the type stored as the car of the entry. 
+             (dolist (entry load-history)
+               (when (and (setq symbol-details (rassq sym (cdr entry)))
+                          (eq type (car symbol-details)))
+                 (return-from look-up-symbol-file (car entry)))))
+            (t
+             ;; If TYPE hasn't been specified, we need to check both for
+             ;; variables and other symbols.
+             (dolist (entry load-history)
+               (when (or (memq sym (cdr entry))
+                         (rassq sym (cdr entry)))
+                 (return-from look-up-symbol-file (car entry))))))
       (setq built-in-file (built-in-symbol-file sym type))
       (if built-in-file (concat source-directory "/src/" built-in-file)))))
 
--- a/lisp/subr.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/subr.el	Sun Dec 28 14:55:02 2008 +0000
@@ -645,6 +645,7 @@
 ;; Moved from mule-coding.el.
 (defmacro with-string-as-buffer-contents (str &rest body)
   "With the contents of the current buffer being STR, run BODY.
+Point starts positioned to end of buffer.
 Returns the new contents of the buffer, as modified by BODY.
 The original current buffer is restored afterwards."
   `(with-temp-buffer
@@ -1730,17 +1731,15 @@
 Ranges and carets are not treated specially.  This implementation is
 in Lisp; do not use it in performance-critical code."
   (let ((list (delete-duplicates (string-to-list string) :test #'=)))
-    (when (equal list '((?- ?\[) (?\[ ?\-)))
-      (error 'invalid-argument
-	     "Cannot create `skip-chars-forward' arg from string"
-	     string))
-    (when (memq ?\] list)
-      (setq list (cons ?\] (delq ?\] list))))
-    (when (eq ?^ (car list))
-      (setq list (nconc (cdr list) '(?^))))
-    (when (memq ?- list)
-      (setq list (delq ?- list)
-	    list (nconc list (list (second list) ?- (second list) ?-))))
+    (when (/= 1 (length list)) ;; No quoting needed in a string of length 1.
+      (when (eq ?^ (car list))
+        (setq list (nconc (cdr list) '(?^))))
+      (when (memq ?\\ list)
+        (setq list (delq ?\\ list)
+              list (nconc (list ?\\ ?\\) list)))
+      (when (memq ?- list)
+        (setq list (delq ?- list)
+              list (nconc list '(?\\ ?-)))))
     (apply #'string list)))
 
 ;;; subr.el ends here
--- a/lisp/version.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/version.el	Sun Dec 28 14:55:02 2008 +0000
@@ -33,7 +33,9 @@
 (defconst xemacs-betaname
   (and emacs-beta-version (format "(beta%d)" emacs-beta-version))
   "Non-nil when this is a test (beta) version of XEmacs.
-Warning, this variable did not exist in XEmacs versions prior to 20.3")
+Warning, this variable did not exist in XEmacs versions prior to 20.3.
+Its value is derived from `emacs-beta-version'.  It is mutually exclusive
+with `emacs-patch-level'.")
 
 (defconst emacs-version
   (format "%d.%d %s%s%s%s%s"
--- a/lisp/window.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/lisp/window.el	Sun Dec 28 14:55:02 2008 +0000
@@ -33,16 +33,19 @@
 
 ;;;; Window tree functions.
 
-(defun one-window-p (&optional nomini which-frames which-devices)
-  "Return non-nil if the selected window is the only window (in its frame).
-Optional arg NOMINI non-nil means don't count the minibuffer
-even if it is active.
+;; XEmacs addition, to expose WINDOW. 
+(defun only-window-p (&optional window nomini which-frames which-devices)
+  "Return non-nil if WINDOW is the only window in some context, 
+normally its frame.  Optional arg NOMINI non-nil means don't count the
+minibuffer even if it is active.
 
-By default, only the windows in the selected frame are considered.
-The optional argument WHICH-FRAMES changes this behavior:
-WHICH-FRAMES nil or omitted means count only the selected frame,
+The optional argument WHICH-FRAMES changes the frames that are considered:
+
+WHICH-FRAMES nil or omitted means count only WINDOW's frame,
 plus the minibuffer it uses (which may be on another frame).
-WHICH-FRAMES = `visible' means include windows on all visible frames.
+\(But, for all values of WHICH-FRAMES, see the documentation for the
+WHICH-DEVICES argument.)
+WHICH-FRAMES = `visible' means include windows on all visible frames
 WHICH-FRAMES = 0 means include windows on all visible and iconified frames.
 WHICH-FRAMES = t means include windows on all frames including invisible frames.
 If WHICH-FRAMES is any other value, count only the selected frame.
@@ -56,12 +59,20 @@
 If a device type, search all devices of that type.
 If `window-system', search all devices on window-system consoles.
 Any other non-nil value means search all devices."
-  (let ((base-window (selected-window)))
-    (if (and nomini (eq base-window (minibuffer-window)))
+  (let ((base-window (or window (selected-window))))
+    (if (and nomini (eq base-window
+                        (minibuffer-window (window-frame base-window))))
 	(setq base-window (next-window base-window)))
     (eq base-window
 	(next-window base-window (if nomini 'arg) which-frames which-devices))))
 
+(defun one-window-p (&optional nomini which-frames which-devices)
+  "Return the result of calling `only-window-p' on the selected window. 
+
+See that function's documentation for the meaning of the NOMINI,
+WHICH-FRAMES and WHICH-DEVICES arguments."
+  (only-window-p (selected-window) nomini which-frames which-devices))
+
 (defun walk-windows (function &optional minibuf which-frames which-devices)
   "Cycle through all visible windows, calling FUNCTION for each one.
 FUNCTION is called with a window as argument.
@@ -351,24 +362,18 @@
   (interactive "p")
   (shrink-window arg t))
 
-; (defun window-buffer-height (window)
-;   "Return the height (in screen lines) of the buffer that WINDOW is displaying."
-;   (save-excursion
-;     (set-buffer (window-buffer window))
-;     (goto-char (point-min))
-;     (let ((ignore-final-newline
-;            ;; If buffer ends with a newline, ignore it when counting height
-;            ;; unless point is after it.
-;            (and (not (eobp)) (eq ?\n (char-after (1- (point-max)))))))
-;       (+ 1 (nth 2 (compute-motion (point-min)
-;                                   '(0 . 0)
-;                                   (- (point-max) (if ignore-final-newline 1 0))
-;                                   (cons 0 100000000)
-;                                   (window-width window)
-;                                   nil
-;                                   window))))))
-
-(defun count-screen-lines (&optional beg end count-final-newline window)
+(defun window-buffer-height (window)
+  "Return the height (in screen lines) of the buffer that WINDOW is displaying."
+  (with-current-buffer (window-buffer window)
+    (max 1
+	 (count-screen-lines (point-min) (point-max)
+			     ;; If buffer ends with a newline, ignore it when
+			     ;; counting height unless point is after it.
+			     (eobp)
+			     window))))
+;; XEmacs change; accept BUFFER. 
+(defun count-screen-lines (&optional beg end count-final-newline
+                           window buffer)
   "Return the number of screen lines in the region.
 The number of screen lines may be different from the number of actual lines,
 due to line breaking, display table, etc.
@@ -383,112 +388,120 @@
 parameters such as width, horizontal scrolling, and so on.  The default is
 to use the selected window's parameters.
 
-Like `vertical-motion', `count-screen-lines' always uses the current buffer,
-regardless of which buffer is displayed in WINDOW.  This makes possible to use
-`count-screen-lines' in any buffer, whether or not it is currently displayed
-in some window."
+Optional argument BUFFER is the buffer to check, and defaults to the current
+buffer.  See `vertical-motion' for some caveats on the differences between
+this behaviour and that of GNU Emacs."
   (unless beg
-    (setq beg (point-min)))
+    (setq beg (point-min buffer)))
   (unless end
-    (setq end (point-max)))
+    (setq end (point-max buffer)))
+  (unless buffer
+    (setq buffer (current-buffer)))
   (if (= beg end)
       0
     (save-excursion
       (save-restriction
-        (widen)
-        (narrow-to-region (min beg end)
-                          (if (and (not count-final-newline)
-                                   (= ?\n (char-before (max beg end))))
-                              (1- (max beg end))
-                            (max beg end)))
-        (goto-char (point-min))
-        (1+ (vertical-motion (buffer-size) window))))))
+        (let ((old-window-buffer (window-buffer window)))
+          (unwind-protect
+              (progn
+                (set-window-buffer window buffer)
+                (set-buffer buffer)
+                (widen)
+                (narrow-to-region (min beg end)
+                                  (if (and (not count-final-newline)
+                                           (= ?\n (char-before (max beg end))))
+                                      (1- (max beg end))
+                                    (max beg end)))
+                (goto-char (point-min))
+                (1+ (vertical-motion (buffer-size) window)))
+            (set-window-buffer window old-window-buffer)))))))
 
-; (defun fit-window-to-buffer (&optional window max-height min-height)
-;   "Make WINDOW the right size to display its contents exactly.
-; If WINDOW is omitted or nil, it defaults to the selected window.
-; If the optional argument MAX-HEIGHT is supplied, it is the maximum height
-;   the window is allowed to be, defaulting to the frame height.
-; If the optional argument MIN-HEIGHT is supplied, it is the minimum
-;   height the window is allowed to be, defaulting to `window-min-height'.
+(defun fit-window-to-buffer (&optional window max-height min-height)
+  "Make WINDOW the right height to display its contents exactly.
+If WINDOW is omitted or nil, it defaults to the selected window.
+If the optional argument MAX-HEIGHT is supplied, it is the maximum height
+  the window is allowed to be, defaulting to the frame height.
+If the optional argument MIN-HEIGHT is supplied, it is the minimum
+  height the window is allowed to be, defaulting to `window-min-height'.
 
-; The heights in MAX-HEIGHT and MIN-HEIGHT include the mode-line and/or
-; header-line."
-;   (interactive)
+The heights in MAX-HEIGHT and MIN-HEIGHT include the mode-line and/or
+header-line."
+  (interactive)
 
-;   (when (null window)
-;     (setq window (selected-window)))
-;   (when (null max-height)
-;     (setq max-height (frame-height (window-frame window))))
+  (when (null window)
+    (setq window (selected-window)))
+  (when (null max-height)
+    (setq max-height (frame-height (window-frame window))))
 
-;   (let* ((buf
-; 	  ;; Buffer that is displayed in WINDOW
-; 	  (window-buffer window))
-; 	 (window-height
-; 	  ;; The current height of WINDOW
-; 	  (window-height window))
-; 	 (desired-height
-; 	  ;; The height necessary to show the buffer displayed by WINDOW
-; 	  ;; (`count-screen-lines' always works on the current buffer).
-; 	  (with-current-buffer buf
-; 	    (+ (count-screen-lines)
-; 	       ;; If the buffer is empty, (count-screen-lines) is
-; 	       ;; zero.  But, even in that case, we need one text line
-; 	       ;; for cursor.
-; 	       (if (= (point-min) (point-max))
-; 		   1 0)
-; 	       ;; For non-minibuffers, count the mode-line, if any
-; 	       (if (and (not (window-minibuffer-p window))
-; 			mode-line-format)
-; 		   1 0)
-; 	       ;; Count the header-line, if any
-; 	       (if header-line-format 1 0))))
-; 	 (delta
-; 	  ;; Calculate how much the window height has to change to show
-; 	  ;; desired-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
-; 	  (- (max (min desired-height max-height)
-; 		  (or min-height window-min-height))
-; 	     window-height))
-; 	 ;; We do our own height checking, so avoid any restrictions due to
-; 	 ;; window-min-height.
-; 	 (window-min-height 1))
+  (let* ((buf
+	  ;; Buffer that is displayed in WINDOW
+	  (window-buffer window))
+	 (window-height
+	  ;; The current height of WINDOW
+	  (window-height window))
+	 (desired-height
+	  ;; The height necessary to show the buffer displayed by WINDOW
+	  ;; (`count-screen-lines' always works on the current buffer).
+          ;; XEmacs; it does in GNU, we provide a BUFFER argument, but we're
+          ;; not changing the implementation.
+	  (with-current-buffer buf
+	    (+ (count-screen-lines)
+	       ;; If the buffer is empty, (count-screen-lines) is
+	       ;; zero.  But, even in that case, we need one text line
+	       ;; for cursor.
+	       (if (= (point-min) (point-max))
+		   1 0)
+	       ;; For non-minibuffers, count the mode-line, if any
+	       (if (and (not (window-minibuffer-p window))
+			mode-line-format)
+		   1 0)
+	       ;; Count the header-line, if any
+               ;; XEmacs change; we don't have header-line-format. 
+	       ;; (if header-line-format 1 0))))
+	       (if (specifier-instance top-gutter) 1 0))))
+	 (delta
+	  ;; Calculate how much the window height has to change to show
+	  ;; desired-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
+	  (- (max (min desired-height max-height)
+		  (or min-height window-min-height))
+	     window-height)))
 
-;     ;; Don't try to redisplay with the cursor at the end
-;     ;; on its own line--that would force a scroll and spoil things.
-;     (when (with-current-buffer buf
-; 	    (and (eobp) (bolp) (not (bobp))))
-;       (set-window-point window (1- (window-point window))))
+    ;; Don't try to redisplay with the cursor at the end
+    ;; on its own line--that would force a scroll and spoil things.
+    (when (with-current-buffer buf
+	    (and (eobp) (bolp) (not (bobp))))
+      (set-window-point window (1- (window-point window))))
 
-;     (save-selected-window
-;       (select-window window)
-
-;       ;; Adjust WINDOW to the nominally correct size (which may actually
-;       ;; be slightly off because of variable height text, etc).
-;       (unless (zerop delta)
-; 	(enlarge-window delta))
+    ;; Adjust WINDOW to the nominally correct size (which may actually
+    ;; be slightly off because of variable height text, etc).
+    (unless (zerop delta)
+      (enlarge-window delta nil window))
 
-;       ;; Check if the last line is surely fully visible.  If not,
-;       ;; enlarge the window.
-;       (let ((end (with-current-buffer buf
-; 		   (save-excursion
-; 		     (goto-char (point-max))
-; 		     (when (and (bolp) (not (bobp)))
-; 		       ;; Don't include final newline
-; 		       (backward-char 1))
-; 		     (when truncate-lines
-; 		       ;; If line-wrapping is turned off, test the
-; 		       ;; beginning of the last line for visibility
-; 		       ;; instead of the end, as the end of the line
-; 		       ;; could be invisible by virtue of extending past
-; 		       ;; the edge of the window.
-; 		       (forward-line 0))
-; 		     (point)))))
-; 	(set-window-vscroll window 0)
-; 	(while (and (< desired-height max-height)
-; 		    (= desired-height (window-height window))
-; 		    (not (pos-visible-in-window-p end window)))
-; 	  (enlarge-window 1)
-; 	  (setq desired-height (1+ desired-height)))))))
+    ;; Check if the last line is surely fully visible.  If not,
+    ;; enlarge the window.
+    (let ((end (with-current-buffer buf
+                 (save-excursion
+                   (goto-char (point-max))
+                   (when (and (bolp) (not (bobp)))
+                     ;; Don't include final newline
+                     (backward-char 1))
+                   (when truncate-lines
+                     ;; If line-wrapping is turned off, test the
+                     ;; beginning of the last line for visibility
+                     ;; instead of the end, as the end of the line
+                     ;; could be invisible by virtue of extending past
+                     ;; the edge of the window.
+                     (forward-line 0))
+                   (point))))
+          ;; XEmacs change; bind window-pixel-vscroll-increment, we don't
+          ;; have #'set-window-vscroll.
+          (window-pixel-scroll-increment 0))
+      ; (set-window-vscroll window 0)
+      (while (and (< desired-height max-height)
+                  (= desired-height (window-height window))
+                  (not (pos-visible-in-window-p end window)))
+        (enlarge-window 1 nil window)
+        (setq desired-height (1+ desired-height))))))
 
 (defun shrink-window-if-larger-than-buffer (&optional window)
   "Shrink the WINDOW to be as small as possible to display its contents.
--- a/lwlib/ChangeLog	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/ChangeLog	Sun Dec 28 14:55:02 2008 +0000
@@ -1,3 +1,96 @@
+2008-11-02  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	G++ 4.3 complains a lot about implicit conversions of string
+	literals (const char *) to char *.  Shut it up.
+
+	* xt-wrappers.h: New file.
+	Contains wrappers for Xt functions and macros for C++
+	type-correctness and/or convenience.
+
+	* lwlib.h:
+	* lwlib-Xm.c:
+	* lwlib-Xaw.c:
+	#include xt-wrappers.h.
+
+	* xlwcheckbox.c:
+	* xlwgauge.c:
+	* xlwmenu.c:
+	* xlwradio.c:
+	* xlwscrollbar.c:
+	* xlwtabs.c:
+	#include xt-wrappers.h.
+	Cast class name to String.
+	Cast action names to String.
+	Rewrite resources to use Xt_RESOURCE.
+
+	* lwlib.h (lw_get_value_arg):
+	* lwlib.c (lw_get_value_arg):
+	Declare String argument const.
+
+	* lwlib-Xaw.c (xaw_actions):
+	Cast to string.
+
+	* lwlib-Xaw.c (xaw_update_scrollbar):
+	* lwlib-Xaw.c (xaw_update_one_widget):
+	* lwlib-Xaw.c (xaw_update_one_value):
+	* lwlib-Xaw.c (make_dialog):
+	* lwlib-Xaw.c (xaw_generic_callback):
+	* lwlib-Xaw.c (wm_delete_window):
+	* lwlib-Xaw.c (xaw_create_scrollbar):
+	* lwlib-Xaw.c (xaw_create_button):
+	* lwlib-Xaw.c (xaw_create_label):
+	* lwlib-Xaw.c (xaw_create_progress):
+	* lwlib-Xaw.c (xaw_create_text_field):
+	* lwlib-Xaw.c (xaw_creation_table):
+	* lwlib-Xlw.c (xlw_create_menubar):
+	* lwlib-Xlw.c (xlw_create_popup_menu):
+	* lwlib-Xlw.c (xlw_create_scrollbar):
+	* lwlib-Xlw.c (xlw_update_scrollbar):
+	* lwlib-Xlw.c (xlw_create_tab_control):
+	* lwlib-Xlw.c (build_tabs_in_widget):
+	* lwlib-Xlw.c (xlw_create_clip_window):
+	* lwlib-Xlw.c (xlw_update_one_widget):
+	* lwlib-Xm.c (xm_update_label):
+	* lwlib-Xm.c (xm_update_pushbutton):
+	* lwlib-Xm.c (xm_update_progress):
+	* lwlib-Xm.c (xm_update_toggle):
+	* lwlib-Xm.c (xm_update_radiobox):
+	* lwlib-Xm.c (make_menu_in_widget):
+	* lwlib-Xm.c (update_one_menu_entry):
+	* lwlib-Xm.c (xm_update_scrollbar):
+	* lwlib-Xm.c (xm_update_one_value):
+	* lwlib-Xm.c (make_dialog):
+	* lwlib-Xm.c (recenter_widget):
+	* lwlib-Xm.c (recycle_instance):
+	* lwlib-Xm.c (make_menubar):
+	* lwlib-Xm.c (make_scrollbar):
+	* lwlib-Xm.c (xm_create_button):
+	* lwlib-Xm.c (xm_create_progress):
+	* lwlib-Xm.c (xm_create_text_field):
+	* lwlib-Xm.c (xm_create_label):
+	* lwlib-Xm.c (xm_create_combo_box):
+	* lwlib-Xm.c (xm_popup_menu):
+	* lwlib-Xm.c (set_min_dialog_size):
+	* lwlib-Xm.c (do_call):
+	* lwlib-Xm.c (xm_generic_callback):
+	* xlwcheckbox.c (offset):
+	* xlwgauge.c (offset):
+	* xlwgauge.c (actionsList):
+	* xlwmenu.c (xlwMenuResources):
+	* xlwmenu.c (xlwMenuActionsList):
+	* xlwmenu.c (xlwMenuClassRec):
+	* xlwmenu.c (nameResource):
+	* xlwmenu.c (parameterize_string):
+	* xlwradio.c (actionsList):
+	* xlwscrollbar.c (offset):
+	* xlwscrollbar.c (actions):
+	Use Xt_SET_ARG, Xt_SET_VALUE, and Xt_GET_VALUE instead of raw Xt
+	equivalents.
+
+2008-10-26  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* lwlib-Xm.c (xm_update_progress): Set all values!
+
 2007-09-15  Jerry James  <james@xemacs.org>
 
 	* xlwmenu.c (XlwMenuDestroy): Release XftFont resources
--- a/lwlib/lwlib-Xaw.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/lwlib-Xaw.c	Sun Dec 28 14:55:02 2008 +0000
@@ -88,15 +88,15 @@
       Arg al [10];
 
       /* First size and position the scrollbar widget. */
-      XtSetArg (al [0], XtNx,      data->scrollbar_x);
-      XtSetArg (al [1], XtNy,      data->scrollbar_y);
-      XtSetArg (al [2], XtNwidth,  data->scrollbar_width);
-      XtSetArg (al [3], XtNheight, data->scrollbar_height);
+      Xt_SET_ARG (al [0], XtNx,      data->scrollbar_x);
+      Xt_SET_ARG (al [1], XtNy,      data->scrollbar_y);
+      Xt_SET_ARG (al [2], XtNwidth,  data->scrollbar_width);
+      Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height);
       XtSetValues (widget, al, 4);
 
       /* Now size the scrollbar's slider. */
-      XtSetArg (al [0], XtNtopOfThumb, &widget_topOfThumb);
-      XtSetArg (al [1], XtNshown, &widget_shown);
+      Xt_SET_ARG (al [0], XtNtopOfThumb, &widget_topOfThumb);
+      Xt_SET_ARG (al [1], XtNshown, &widget_shown);
       XtGetValues (widget, al, 2);
 
       new_shown = (double) data->slider_size /
@@ -142,47 +142,37 @@
 #endif
 #ifdef LWLIB_DIALOGS_ATHENA
   else if (XtIsSubclass (widget, dialogWidgetClass))
-      {
-	Arg al [1];
-	XtSetArg (al [0], XtNlabel, val->contents->value);
-	XtSetValues (widget, al, 1);
-      }
+    Xt_SET_VALUE (widget, XtNlabel, val->contents->value);
 #endif /* LWLIB_DIALOGS_ATHENA */
 #ifdef LWLIB_WIDGETS_ATHENA
   else if (XtClass (widget) == labelWidgetClass)
-      {
-	Arg al [1];
-	XtSetArg (al [0], XtNlabel, val->value);
-	XtSetValues (widget, al, 1);
-      }
+    Xt_SET_VALUE (widget, XtNlabel, val->value);
 #endif /* LWLIB_WIDGETS_ATHENA */
 #if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA)
   else if (XtIsSubclass (widget, commandWidgetClass))
     {
-      Dimension bw = 0;
       Arg al [3];
-      XtSetArg (al [0], XtNborderWidth, &bw);
-      XtGetValues (widget, al, 1);
 
 #ifndef LWLIB_DIALOGS_ATHENA3D
-      if (bw == 0)
-	/* Don't let buttons end up with 0 borderwidth, that's ugly...
-	   Yeah, all this should really be done through app-defaults files
-	   or fallback resources, but that's a whole different can of worms
-	   that I don't feel like opening right now.  Making Athena widgets
-	   not look like shit is just entirely too much work.
-	 */
-	{
-	  XtSetArg (al [0], XtNborderWidth, 1);
-	  XtSetValues (widget, al, 1);
+      {
+	Dimension bw = 0;
+	Xt_GET_VALUE (widget, XtNborderWidth, &bw);
+	if (bw == 0)
+	  /* Don't let buttons end up with 0 borderwidth, that's ugly...
+	     Yeah, all this should really be done through app-defaults files
+	     or fallback resources, but that's a whole different can of worms
+	     that I don't feel like opening right now.  Making Athena widgets
+	     not look like shit is just entirely too much work.
+	  */
+	  Xt_SET_VALUE (widget, XtNborderWidth, 1);
 	}
 #endif /* ! LWLIB_DIALOGS_ATHENA3D */
 
       lw_remove_accelerator_spec (val->value);
-      XtSetArg (al [0], XtNlabel,     val->value);
-      XtSetArg (al [1], XtNsensitive, val->enabled);
+      Xt_SET_ARG (al [0], XtNlabel,     val->value);
+      Xt_SET_ARG (al [1], XtNsensitive, val->enabled);
       /* Force centered button text.  See above. */
-      XtSetArg (al [2], XtNjustify, XtJustifyCenter);
+      Xt_SET_ARG (al [2], XtNjustify, XtJustifyCenter);
       XtSetValues (widget, al, 3);
 
       XtRemoveAllCallbacks (widget, XtNcallback);
@@ -190,10 +180,7 @@
 #ifdef LWLIB_WIDGETS_ATHENA
       /* set the selected state */
       if (XtIsSubclass (widget, toggleWidgetClass))
-	{
-	  XtSetArg (al [0], XtNstate, val->selected);
-	  XtSetValues (widget, al, 1);
-	}
+	Xt_SET_VALUE (widget, XtNstate, val->selected);
 #endif /* LWLIB_WIDGETS_ATHENA */
     }
 #endif /* LWLIB_DIALOGS_ATHENA */
@@ -219,19 +206,15 @@
   
   if (XtIsSubclass (widget, toggleWidgetClass))
     {
-      Arg al [1];
-      XtSetArg (al [0], XtNstate, &val->selected);
-      XtGetValues (widget, al, 1);
+      Xt_GET_VALUE (widget, XtNstate, &val->selected);
       val->edited = True;
     }
 #ifndef NEED_MOTIF
   else if (XtIsSubclass (widget, asciiTextWidgetClass))
     {
-      Arg al [2];
       String buf = 0;
-      XtSetArg (al [0], XtNstring, &buf);
-      XtGetValues (widget, al, 1);
 
+      Xt_GET_VALUE (widget, XtNstring, &buf);
       if (val->value)
 	{
 	  free (val->value);
@@ -339,7 +322,7 @@
 static XtActionProc wm_delete_window (Widget shell, XtPointer closure,
 				      XtPointer call_data);
 static XtActionsRec xaw_actions [] = {
-  {"lwlib_delete_dialog", (XtActionProc) wm_delete_window}
+  { (String) "lwlib_delete_dialog", (XtActionProc) wm_delete_window}
 };
 static Boolean actions_initted = False;
 
@@ -375,9 +358,9 @@
   override = XtParseTranslationTable (overrideTrans);
 
   ac = 0;
-  XtSetArg (av[ac], XtNtitle, shell_title);	ac++;
-  XtSetArg (av[ac], XtNallowShellResize, True); ac++;
-  XtSetArg (av[ac], XtNtransientFor, parent);	ac++;
+  Xt_SET_ARG (av[ac], XtNtitle, shell_title);		ac++;
+  Xt_SET_ARG (av[ac], XtNallowShellResize, True);	ac++;
+  Xt_SET_ARG (av[ac], XtNtransientFor, parent);		ac++;
   shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
 			      parent, av, ac);
   XtOverrideTranslations (shell, override);
@@ -390,12 +373,12 @@
   for (i = 0; i < left_buttons; i++)
     {
       ac = 0;
-      XtSetArg (av [ac], XtNfromHoriz, button);     ac++;
-      XtSetArg (av [ac], XtNleft,   XtChainLeft);   ac++;
-      XtSetArg (av [ac], XtNright,  XtChainLeft);   ac++;
-      XtSetArg (av [ac], XtNtop,    XtChainBottom); ac++;
-      XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
-      XtSetArg (av [ac], XtNresizable, True);       ac++;
+      Xt_SET_ARG (av [ac], XtNfromHoriz, button);	ac++;
+      Xt_SET_ARG (av [ac], XtNleft,   XtChainLeft);	ac++;
+      Xt_SET_ARG (av [ac], XtNright,  XtChainLeft);	ac++;
+      Xt_SET_ARG (av [ac], XtNtop,    XtChainBottom);	ac++;
+      Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom);	ac++;
+      Xt_SET_ARG (av [ac], XtNresizable, True);		ac++;
       sprintf (button_name, "button%d", ++bc);
       button = XtCreateManagedWidget (button_name, commandWidgetClass,
 				      dialog, av, ac);
@@ -410,18 +393,18 @@
 	 window) but I can't seem to make it do it.  
        */
       ac = 0;
-      XtSetArg (av [ac], XtNfromHoriz, button);	    ac++;
-/*  XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
-      XtSetArg (av [ac], XtNleft,   XtChainLeft);   ac++;
-      XtSetArg (av [ac], XtNright,  XtChainRight);  ac++;
-      XtSetArg (av [ac], XtNtop,    XtChainBottom); ac++;
-      XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
-      XtSetArg (av [ac], XtNlabel, ""); ac++;
-      XtSetArg (av [ac], XtNwidth, 30); ac++;	/* #### aaack!! */
-      XtSetArg (av [ac], XtNborderWidth, 0); ac++;
-      XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++;
-      XtSetArg (av [ac], XtNresizable, False); ac++;
-      XtSetArg (av [ac], XtNsensitive, False); ac++;
+      Xt_SET_ARG (av [ac], XtNfromHoriz, button);		ac++;
+/* Xt_SET_ARG (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
+      Xt_SET_ARG (av [ac], XtNleft,   XtChainLeft);		ac++;
+      Xt_SET_ARG (av [ac], XtNright,  XtChainRight);		ac++;
+      Xt_SET_ARG (av [ac], XtNtop,    XtChainBottom);		ac++;
+      Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom);		ac++;
+      Xt_SET_ARG (av [ac], XtNlabel, "");			ac++;
+      Xt_SET_ARG (av [ac], XtNwidth, 30); /* #### aaack!! */	ac++;
+      Xt_SET_ARG (av [ac], XtNborderWidth, 0);			ac++;
+      Xt_SET_ARG (av [ac], XtNshapeStyle, XmuShapeRectangle);	ac++;
+      Xt_SET_ARG (av [ac], XtNresizable, False);		ac++;
+      Xt_SET_ARG (av [ac], XtNsensitive, False);		ac++;
       button = XtCreateManagedWidget ("separator",
 				      /* labelWidgetClass, */
 				      /* This has to be Command to fake out
@@ -432,12 +415,12 @@
   for (i = 0; i < right_buttons; i++)
     {
       ac = 0;
-      XtSetArg (av [ac], XtNfromHoriz, button);	    ac++;
-      XtSetArg (av [ac], XtNleft,   XtChainRight);  ac++;
-      XtSetArg (av [ac], XtNright,  XtChainRight);  ac++;
-      XtSetArg (av [ac], XtNtop,    XtChainBottom); ac++;
-      XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
-      XtSetArg (av [ac], XtNresizable, True);	    ac++;
+      Xt_SET_ARG (av [ac], XtNfromHoriz, button);		ac++;
+      Xt_SET_ARG (av [ac], XtNleft, XtChainRight);		ac++;
+      Xt_SET_ARG (av [ac], XtNright,  XtChainRight);		ac++;
+      Xt_SET_ARG (av [ac], XtNtop,    XtChainBottom);		ac++;
+      Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom);		ac++;
+      Xt_SET_ARG (av [ac], XtNresizable, True);			ac++;
       sprintf (button_name, "button%d", ++bc);
       button = XtCreateManagedWidget (button_name, commandWidgetClass,
 				      dialog, av, ac);
@@ -525,13 +508,10 @@
   if (XtIsSubclass (widget, toggleWidgetClass))
     {
       Boolean check;
-      Arg al [1];
 
-      XtSetArg (al [0], XtNstate, &check);
-      XtGetValues (widget, al, 1);
+      Xt_GET_VALUE (widget, XtNstate, &check);
 
-      XtSetArg (al [0], XtNstate, !check);
-      XtSetValues (widget, al, 1);
+      Xt_SET_VALUE (widget, XtNstate, !check);
     }
 #endif /* LWLIB_WIDGETS_ATHENA */
   lw_internal_update_other_instances (widget, closure, call_data);
@@ -549,11 +529,7 @@
 
 #if 0
   user_data = NULL;
-  {
-    Arg al [1];
-    XtSetArg (al [0], XtNuserData, &user_data);
-    XtGetValues (widget, al, 1);
-  }
+  Xt_GET_VALUE (widget, XtNuserData, &user_data);
 #else
   /* Damn!  Athena doesn't give us a way to hang our own data on the
      buttons, so we have to go find it...  I guess this assumes that
@@ -594,11 +570,10 @@
   LWLIB_ID id;
   Widget *kids = 0;
   Widget widget;
-  Arg al [1];
+
   if (! XtIsSubclass (shell, shellWidgetClass))
     abort ();
-  XtSetArg (al [0], XtNchildren, &kids);
-  XtGetValues (shell, al, 1);
+  Xt_GET_VALUE (shell, XtNchildren, &kids);
   if (!kids || !*kids) abort ();
 
   for (widget = *kids;
@@ -697,11 +672,11 @@
      top-level aware of this so that people could have a border but so
      few people use the Athena scrollbar now that it really isn't
      worth the effort, at least not at the moment. */
-  XtSetArg (av [ac], XtNborderWidth, 0); ac++;
-  XtSetArg (av [ac], XtNorientation,
-	    vertical ? XtorientVertical : XtorientHorizontal); ac++;
-  XtSetArg (av [ac], "jumpProc",   jumpCallbacks);   ac++;
-  XtSetArg (av [ac], "scrollProc", scrollCallbacks); ac++;
+  Xt_SET_ARG (av [ac], XtNborderWidth, 0);				ac++;
+  Xt_SET_ARG (av [ac], XtNorientation,
+	      vertical ? XtorientVertical : XtorientHorizontal);	ac++;
+  Xt_SET_ARG (av [ac], "jumpProc",   jumpCallbacks);			ac++;
+  Xt_SET_ARG (av [ac], "scrollProc", scrollCallbacks);			ac++;
 
   return XtCreateWidget (instance->info->name, scrollbarWidgetClass,
 			 instance->parent, av, ac);
@@ -730,13 +705,13 @@
   Widget button = 0;
   widget_value* val = instance->info->val;
 
-  XtSetArg (al [ac], XtNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XtNmappedWhenManaged, FALSE);	ac++;
-  XtSetArg (al [ac], XtNjustify, XtJustifyCenter);		ac++;
+  Xt_SET_ARG (al [ac], XtNsensitive, val->enabled);		ac++;
+  Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE);		ac++;
+  Xt_SET_ARG (al [ac], XtNjustify, XtJustifyCenter);		ac++;
   /* The highlight doesn't appear to be dynamically set which makes it
      look ugly.  I think this may be a LessTif bug but for now we just
      get rid of it. */
-  XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
+  Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0);	ac++;
 
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
@@ -749,7 +724,7 @@
     {
       if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
 	{
-	  XtSetArg (al [ac], XtNstate, val->selected);	ac++;
+	  Xt_SET_ARG (al [ac], XtNstate, val->selected);	ac++;
 	  button = XtCreateWidget 
 	    (val->name, 
 	     val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass,
@@ -783,9 +758,9 @@
   int ac = 0;
   Widget label = 0;
 
-  XtSetArg (al [ac], XtNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XtNmappedWhenManaged, FALSE);	ac++;
-  XtSetArg (al [ac], XtNjustify, XtJustifyCenter);		ac++;
+  Xt_SET_ARG (al [ac], XtNsensitive, val->enabled);	ac++;
+  Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE);	ac++;
+  Xt_SET_ARG (al [ac], XtNjustify, XtJustifyCenter);	ac++;
 
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
@@ -868,20 +843,20 @@
 #if 0		/* This looks too awful, although more correct. */
   if (!val->call_data)
     {
-      XtSetArg (al [ac], XtNsensitive, False);		ac++;
+      Xt_SET_ARG (al [ac], XtNsensitive, False);		ac++;
     }
   else
     {
-      XtSetArg (al [ac], XtNsensitive, val->enabled);		ac++;
+      Xt_SET_ARG (al [ac], XtNsensitive, val->enabled);		ac++;
     }
 #else
-  XtSetArg (al [ac], XtNsensitive, True);		ac++;
+  Xt_SET_ARG (al [ac], XtNsensitive, True);			ac++;
 #endif
 
-  XtSetArg (al [ac], XtNmappedWhenManaged, FALSE);	ac++;
-  XtSetArg (al [ac], XtNorientation, XtorientHorizontal);	ac++;
-  XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
-  XtSetArg (al [ac], XtNntics, (Cardinal)10);ac++;
+  Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE);		ac++;
+  Xt_SET_ARG (al [ac], XtNorientation, XtorientHorizontal);	ac++;
+  Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0);	ac++;
+  Xt_SET_ARG (al [ac], XtNntics, (Cardinal)10);			ac++;
 
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
@@ -915,18 +890,18 @@
   Widget text = 0;
   widget_value* val = instance->info->val;
 
-  XtSetArg (al [ac], XtNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XtNmappedWhenManaged, FALSE);	ac++;
-  XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);	ac++;
-  XtSetArg (al [ac], XtNtype, XawAsciiString);		ac++;
-  XtSetArg (al [ac], XtNeditType, XawtextEdit);		ac++;
-  XtSetArg (al [ac], XtNuseStringInPlace, False);		ac++;
+  Xt_SET_ARG (al [ac], XtNsensitive, val->enabled);		ac++;
+  Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE);		ac++;
+  Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0);	ac++;
+  Xt_SET_ARG (al [ac], XtNtype, XawAsciiString);		ac++;
+  Xt_SET_ARG (al [ac], XtNeditType, XawtextEdit);		ac++;
+  Xt_SET_ARG (al [ac], XtNuseStringInPlace, False);		ac++;
 #if 0
-  XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE);	ac++;
+  Xt_SET_ARG (al [ac], XtNlength, TEXT_BUFFER_SIZE);		ac++;
 #endif
   if (val->value)
     {
-      XtSetArg (al [ac], XtNstring, val->value);		ac++;
+      Xt_SET_ARG (al [ac], XtNstring, val->value);		ac++;
     }
 
   /* add any args the user supplied for creation time */
@@ -956,8 +931,8 @@
 #endif
 #ifdef LWLIB_WIDGETS_ATHENA
   {"button",		xaw_create_button		},
-  { "label", 		xaw_create_label_field		},
-  {"text-field",		xaw_create_text_field		},
+  {"label", 		xaw_create_label_field		},
+  {"text-field",	xaw_create_text_field		},
   {"progress",		xaw_create_progress		},
 #endif
   {NULL, NULL}
--- a/lwlib/lwlib-Xlw.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/lwlib-Xlw.c	Sun Dec 28 14:55:02 2008 +0000
@@ -122,7 +122,7 @@
   Arg al [1];
   Widget widget;
   
-  XtSetArg (al [0], XtNmenu, instance->info->val);
+  Xt_SET_ARG (al [0], XtNmenu, instance->info->val);
   widget = XtCreateWidget (instance->info->name, xlwMenuWidgetClass,
 			   instance->parent, al, 1);
   XtAddCallback (widget, XtNopen,   pre_hook,  (XtPointer)instance);
@@ -139,8 +139,8 @@
   popup_shell = XtCreatePopupShell (instance->info->name,
 				    overrideShellWidgetClass,
 				    instance->parent, NULL, 0);
-  XtSetArg (al [0], XtNmenu, instance->info->val);
-  XtSetArg (al [1], XtNhorizontal, False);
+  Xt_SET_ARG (al [0], XtNmenu, instance->info->val);
+  Xt_SET_ARG (al [1], XtNhorizontal, False);
   widget = XtCreateManagedWidget ("popup", xlwMenuWidgetClass,
 				  popup_shell, al, 2);
   XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
@@ -234,20 +234,20 @@
 
   callbacks[0].closure  = (XtPointer) instance;
 
-  XtSetArg (al[ac], XmNminimum,       1); ac++;
-  XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++;
-  XtSetArg (al[ac], XmNincrement,     1); ac++;
-  XtSetArg (al[ac], XmNpageIncrement, 1); ac++;
-  XtSetArg (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++;
+  Xt_SET_ARG (al[ac], XmNminimum,       1); ac++;
+  Xt_SET_ARG (al[ac], XmNmaximum, INT_MAX); ac++;
+  Xt_SET_ARG (al[ac], XmNincrement,     1); ac++;
+  Xt_SET_ARG (al[ac], XmNpageIncrement, 1); ac++;
+  Xt_SET_ARG (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++;
 
-  XtSetArg (al[ac], XmNdecrementCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNdragCallback,		callbacks); ac++;
-  XtSetArg (al[ac], XmNincrementCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNpageDecrementCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNpageIncrementCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNtoBottomCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNtoTopCallback,		callbacks); ac++;
-  XtSetArg (al[ac], XmNvalueChangedCallback,	callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNdecrementCallback,	callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNdragCallback,		callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNincrementCallback,	callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNpageDecrementCallback,	callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNpageIncrementCallback,	callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNtoBottomCallback,	callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNtoTopCallback,		callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNvalueChangedCallback,	callbacks); ac++;
 
   return XtCreateWidget (instance->info->name, xlwScrollBarWidgetClass,
 			 instance->parent, al, ac);
@@ -278,15 +278,15 @@
       Arg al [4];
 
       /* First size and position the scrollbar widget. */
-      XtSetArg (al [0], XtNx,      data->scrollbar_x);
-      XtSetArg (al [1], XtNy,      data->scrollbar_y);
-      XtSetArg (al [2], XtNwidth,  data->scrollbar_width);
-      XtSetArg (al [3], XtNheight, data->scrollbar_height);
+      Xt_SET_ARG (al [0], XtNx,      data->scrollbar_x);
+      Xt_SET_ARG (al [1], XtNy,      data->scrollbar_y);
+      Xt_SET_ARG (al [2], XtNwidth,  data->scrollbar_width);
+      Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height);
       XtSetValues (widget, al, 4);
 
       /* Now size the scrollbar's slider. */
-      XtSetArg (al [0], XmNsliderSize, &widget_sliderSize);
-      XtSetArg (al [1], XmNvalue,      &widget_val);
+      Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize);
+      Xt_SET_ARG (al [1], XmNvalue,      &widget_val);
       XtGetValues (widget, al, 2);
 
       percent = (double) data->slider_size /
@@ -382,9 +382,9 @@
   Widget tab = 0;
   widget_value* val = instance->info->val;
 
-  XtSetArg (al [ac], XtNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XtNmappedWhenManaged, False);		ac++;
-  XtSetArg (al [ac], XtNorientation, XtorientHorizontal);	ac++;
+  Xt_SET_ARG (al [ac], XtNsensitive, val->enabled);		ac++;
+  Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False);		ac++;
+  Xt_SET_ARG (al [ac], XtNorientation, XtorientHorizontal);	ac++;
 
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
@@ -406,7 +406,7 @@
   Arg al[1];
 
   /* Children are always invisible, don't permit resizing. */
-  XtSetArg (al[0], XtNresizable, False);
+  Xt_SET_ARG (al[0], XtNresizable, False);
 
   for (cur = val; cur; cur = cur->next)
     {
@@ -479,8 +479,8 @@
   Widget clip = 0;
   widget_value* val = instance->info->val;
 
-  XtSetArg (al [ac], XtNmappedWhenManaged, False);	ac++;
-  XtSetArg (al [ac], XtNsensitive, True);		ac++;
+  Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False);	ac++;
+  Xt_SET_ARG (al [ac], XtNsensitive, True);		ac++;
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
 
@@ -557,13 +557,11 @@
   else if (class_ == xlwMenuWidgetClass)
     {
       XlwMenuWidget mw;
-      Arg al [1];
       if (XtIsShell (widget))
 	mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
       else
 	mw = (XlwMenuWidget)widget;
-      XtSetArg (al [0], XtNmenu, val);
-      XtSetValues (widget, al, 1); /* #### mw unused! */
+      Xt_SET_VALUE (widget, XtNmenu, val); /* #### mw unused! */
     }
 #endif
 #ifdef LWLIB_SCROLLBARS_LUCID
--- a/lwlib/lwlib-Xm.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/lwlib-Xm.c	Sun Dec 28 14:55:02 2008 +0000
@@ -216,8 +216,7 @@
   int type;
 
   /* Don't clobber pixmap types. */
-  XtSetArg (al [0], XmNlabelType, &type);
-  XtGetValues (widget, al, 1);
+  Xt_GET_VALUE (widget, XmNlabelType, &type);
 
   if (type == XmPIXMAP)
     return;
@@ -280,14 +279,14 @@
 	    }
 	}
 
-      XtSetArg (al [ac], XmNlabelString, built_string); ac++;
-      XtSetArg (al [ac], XmNlabelType, XmSTRING);	ac++;
+      Xt_SET_ARG (al [ac], XmNlabelString, built_string);	ac++;
+      Xt_SET_ARG (al [ac], XmNlabelType, XmSTRING);		ac++;
     }
 
   if (val->key)
     {
       key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET);
-      XtSetArg (al [ac], XmNacceleratorText, key_string); ac++;
+      Xt_SET_ARG (al [ac], XmNacceleratorText, key_string);	ac++;
     }
 
   if (ac)
@@ -342,9 +341,7 @@
 xm_update_pushbutton (widget_instance* instance, Widget widget,
 		      widget_value* UNUSED (val))
 {
-  Arg al [1];
-  XtSetArg (al [0], XmNalignment, XmALIGNMENT_CENTER);
-  XtSetValues (widget, al, 1);
+  Xt_SET_VALUE (widget, XmNalignment, XmALIGNMENT_CENTER);
   XtRemoveAllCallbacks (widget, XmNactivateCallback);
   XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance);
 }
@@ -360,24 +357,24 @@
   Dimension width = 0;
   if (!val->call_data)
     {
-      XtSetArg (al [ac], XmNeditable, False);		ac++;
+      Xt_SET_ARG (al [ac], XmNeditable, False);		ac++;
     }
   else
     {
-      XtSetArg (al [ac], XmNeditable, val->enabled);		ac++;
+      Xt_SET_ARG (al [ac], XmNeditable, val->enabled);	ac++;
     }
-  height = (Dimension)lw_get_value_arg (val, XtNheight);
-  width = (Dimension)lw_get_value_arg (val, XtNwidth);
+  height = (Dimension) lw_get_value_arg (val, XtNheight);
+  width  = (Dimension) lw_get_value_arg (val, XtNwidth);
   if (height > 0)
     {
-      XtSetArg (al [ac], XmNscaleHeight, height); ac++;
+      Xt_SET_ARG (al [ac], XmNscaleHeight, height);	ac++;
     }
   if (width > 0)
     {
-      XtSetArg (al [ac], XmNscaleWidth, width); ac++;
+      Xt_SET_ARG (al [ac], XmNscaleWidth, width);	ac++;
     }
 
-  XtSetValues (scale, al, 1);
+  XtSetValues (scale, al, ac);
 }
 #endif /* LWLIB_WIDGETS_MOTIF */
 
@@ -419,8 +416,8 @@
   XtRemoveAllCallbacks (widget, XmNvalueChangedCallback);
   XtAddCallback (widget, XmNvalueChangedCallback, xm_generic_callback,
 		 instance);
-  XtSetArg (al [0], XmNset, val->selected);
-  XtSetArg (al [1], XmNalignment, XmALIGNMENT_BEGINNING);
+  Xt_SET_ARG (al [0], XmNset, val->selected);
+  Xt_SET_ARG (al [1], XmNalignment, XmALIGNMENT_BEGINNING);
   XtSetValues (widget, al, 1);
 }
 
@@ -447,8 +444,8 @@
       if (toggle)
 	{
 	  Arg al [2];
-	  XtSetArg (al [0], XmNsensitive, cur->enabled);
-	  XtSetArg (al [1], XmNset, (!val->value && cur->selected ? cur->selected : False));
+	  Xt_SET_ARG (al [0], XmNsensitive, cur->enabled);
+	  Xt_SET_ARG (al [1], XmNset, (!val->value && cur->selected ? cur->selected : False));
 	  XtSetValues (toggle, al, 2);
 	}
     }
@@ -458,11 +455,7 @@
     {
       toggle = XtNameToWidget (widget, val->value);
       if (toggle)
-	{
-	  Arg al [1];
-	  XtSetArg (al [0], XmNset, True);
-	  XtSetValues (toggle, al, 1);
-	}
+	Xt_SET_VALUE (toggle, XmNset, True);
     }
 }
 
@@ -511,8 +504,7 @@
   children = (Widget*)XtMalloc (num_children * sizeof (Widget));
 
   /* tricky way to know if this RowColumn is a menubar or a pulldown... */
-  XtSetArg (al [0], XmNisHomogeneous, &menubar_p);
-  XtGetValues (widget, al, 1);
+  Xt_GET_VALUE (widget, XmNisHomogeneous, &menubar_p);
 
   /* add the unmap callback for popups and pulldowns */
   /*** this sounds bogus ***/
@@ -528,9 +520,9 @@
     {
       ac = 0;
       button = 0;
-      XtSetArg (al [ac], XmNsensitive, cur->enabled);		ac++;
-      XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
-      XtSetArg (al [ac], XmNuserData, cur->call_data);		ac++;
+      Xt_SET_ARG (al [ac], XmNsensitive, cur->enabled);			ac++;
+      Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
+      Xt_SET_ARG (al [ac], XmNuserData, cur->call_data);		ac++;
 
       switch (cur->type)
 	{
@@ -545,14 +537,14 @@
 	      /* #### - xlwmenu.h supports several types that motif does
 		 not.  Also, motif supports pixmaps w/ type NO_LINE and
 		 lwlib provides no way to access that functionality. --Stig */
-	      XtSetArg (al [ac], XmNseparatorType, cur->value), ac++;
+	      Xt_SET_ARG (al [ac], XmNseparatorType, cur->value);	ac++;
 	    }
 	  button = XmCreateSeparator (widget, "separator", al, ac);
 	  break;
 	case CASCADE_TYPE:
 	  menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
 	  make_menu_in_widget (instance, menu, cur->contents);
-	  XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
+	  Xt_SET_ARG (al [ac], XmNsubMenuId, menu);			ac++;
 	  button = XmCreateCascadeButton (widget, cur->name, al, ac);
 
 	  xm_safe_update_label (instance, button, cur);
@@ -567,10 +559,10 @@
 	    button = XmCreateLabel (widget, cur->name, al, ac);
 	  else if (cur->type == TOGGLE_TYPE || cur->type == RADIO_TYPE)
 	    {
-	      XtSetArg (al [ac], XmNindicatorType,
+	      Xt_SET_ARG (al [ac], XmNindicatorType,
 			(cur->type == TOGGLE_TYPE ?
-			 XmN_OF_MANY : XmONE_OF_MANY));    ac++;
-	      XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++;
+			 XmN_OF_MANY : XmONE_OF_MANY));			ac++;
+	      Xt_SET_ARG (al [ac], XmNvisibleWhenOff, True);		ac++;
 	      button = XmCreateToggleButtonGadget (widget, cur->name, al, ac);
 	    }
 	  else
@@ -597,11 +589,7 @@
      height if you don't manage them until after you set this and as a
      bonus the Help menu ends up where it is supposed to. */
   if (button)
-    {
-      ac = 0;
-      XtSetArg (al [ac], XmNmenuHelpWidget, button); ac++;
-      XtSetValues (widget, al, ac);
-    }
+    Xt_SET_VALUE (widget, XmNmenuHelpWidget, button);
 
   if (num_children)
     XtManageChildren (children, num_children);
@@ -623,8 +611,8 @@
 
   /* update the sensitivity and userdata */
   /* Common to all widget types */
-  XtSetArg (al [0], XmNsensitive, val->enabled);
-  XtSetArg (al [1], XmNuserData,  val->call_data);
+  Xt_SET_ARG (al [0], XmNsensitive, val->enabled);
+  Xt_SET_ARG (al [1], XmNuserData,  val->call_data);
   XtSetValues (widget, al, 2);
 
   /* update the menu button as a label. */
@@ -642,8 +630,7 @@
 
   /* update the pulldown/pullaside as needed */
   menu = NULL;
-  XtSetArg (al [0], XmNsubMenuId, &menu);
-  XtGetValues (widget, al, 1);
+  Xt_GET_VALUE (widget, XmNsubMenuId, &menu);
 
   contents = val->contents;
 
@@ -653,16 +640,12 @@
 	{
 	  menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
 	  make_menu_in_widget (instance, menu, contents);
-	  ac = 0;
-	  XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
-	  XtSetValues (widget, al, ac);
+	  Xt_SET_VALUE (widget, XmNsubMenuId, menu);
 	}
     }
   else if (!contents)
     {
-      ac = 0;
-      XtSetArg (al [ac], XmNsubMenuId, NULL); ac++;
-      XtSetValues (widget, al, ac);
+      Xt_SET_VALUE (widget, XmNsubMenuId, NULL);
       XtDestroyWidget (menu);
     }
   else if (deep_p && contents->change != NO_CHANGE)
@@ -772,15 +755,15 @@
       Arg al [4];
 
       /* First size and position the scrollbar widget. */
-      XtSetArg (al [0], XtNx,      data->scrollbar_x);
-      XtSetArg (al [1], XtNy,      data->scrollbar_y);
-      XtSetArg (al [2], XtNwidth,  data->scrollbar_width);
-      XtSetArg (al [3], XtNheight, data->scrollbar_height);
+      Xt_SET_ARG (al [0], XtNx,      data->scrollbar_x);
+      Xt_SET_ARG (al [1], XtNy,      data->scrollbar_y);
+      Xt_SET_ARG (al [2], XtNwidth,  data->scrollbar_width);
+      Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height);
       XtSetValues (widget, al, 4);
 
       /* Now size the scrollbar's slider. */
-      XtSetArg (al [0], XmNsliderSize, &widget_sliderSize);
-      XtSetArg (al [1], XmNvalue,      &widget_val);
+      Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize);
+      Xt_SET_ARG (al [1], XmNvalue,      &widget_val);
       XtGetValues (widget, al, 2);
 
       percent = (double) data->slider_size /
@@ -845,8 +828,8 @@
   val->edited = False;
 
   /* Common to all widget types */
-  XtSetArg (al [ac], XmNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XmNuserData,  val->call_data);	ac++;
+  Xt_SET_ARG (al [ac], XmNsensitive, val->enabled);	ac++;
+  Xt_SET_ARG (al [ac], XmNuserData,  val->call_data);	ac++;
   XtSetValues (widget, al, ac);
 
 #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF)
@@ -875,8 +858,7 @@
     {
       Boolean radiobox = 0;
 
-      XtSetArg (al [0], XmNradioBehavior, &radiobox);
-      XtGetValues (widget, al, 1);
+      Xt_GET_VALUE (widget, XmNradioBehavior, &radiobox);
 
       if (radiobox)
 	xm_update_radiobox (instance, widget, val);
@@ -938,9 +920,7 @@
 
   if (class_ == xmToggleButtonWidgetClass || class_ == xmToggleButtonGadgetClass)
     {
-      Arg al [1];
-      XtSetArg (al [0], XmNset, &val->selected);
-      XtGetValues (widget, al, 1);
+      Xt_GET_VALUE (widget, XmNset, &val->selected);
       val->edited = True;
     }
   else if (class_ == xmTextWidgetClass)
@@ -960,11 +940,8 @@
   else if (class_ == xmRowColumnWidgetClass)
     {
       Boolean radiobox = 0;
-      {
-	Arg al [1];
-	XtSetArg (al [0], XmNradioBehavior, &radiobox);
-	XtGetValues (widget, al, 1);
-      }
+
+      Xt_GET_VALUE (widget, XmNradioBehavior, &radiobox);
 
       if (radiobox)
 	{
@@ -974,10 +951,8 @@
 	    {
 	      int set = False;
 	      Widget toggle = radio->composite.children [i];
-	      Arg al [1];
 
-	      XtSetArg (al [0], XmNset, &set);
-	      XtGetValues (toggle, al, 1);
+	      Xt_GET_VALUE (toggle, XmNset, &set);
 	      if (set)
 		{
 		  if (val->value)
@@ -1130,42 +1105,42 @@
   if (pop_up_p)
     {
       ac = 0;
-      XtSetArg(al[ac], XmNtitle, shell_title);		ac++;
-      XtSetArg(al[ac], XtNallowShellResize, True);	ac++;
-      XtSetArg(al[ac], XmNdeleteResponse, XmUNMAP);	ac++;
+      Xt_SET_ARG(al[ac], XmNtitle, shell_title);		ac++;
+      Xt_SET_ARG(al[ac], XtNallowShellResize, True);		ac++;
+      Xt_SET_ARG(al[ac], XmNdeleteResponse, XmUNMAP);		ac++;
       result = XmCreateDialogShell (parent, "dialog", al, ac);
 
-      XtSetArg(al[ac], XmNautoUnmanage, FALSE);		ac++;
-/*      XtSetArg(al[ac], XmNautoUnmanage, TRUE); ac++; */ /* ####is this ok? */
-      XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+      Xt_SET_ARG(al[ac], XmNautoUnmanage, FALSE);		ac++;
+/*    Xt_SET_ARG(al[ac], XmNautoUnmanage, TRUE); ac++; */ /* ####is this ok? */
+      Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); 	ac++;
       form = XmCreateForm (result, (char *) shell_title, al, ac);
     }
   else
     {
       ac = 0;
-      XtSetArg(al[ac], XmNautoUnmanage, FALSE);		ac++;
-      XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+      Xt_SET_ARG(al[ac], XmNautoUnmanage, FALSE);		ac++;
+      Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP);	ac++;
       form = XmCreateForm (parent, (char *) shell_title, al, ac);
       result = form;
     }
 
   ac = 0;
-  XtSetArg(al[ac], XmNpacking, XmPACK_COLUMN);		ac++;
-  XtSetArg(al[ac], XmNorientation, XmVERTICAL);		ac++;
-  XtSetArg(al[ac], XmNnumColumns, left_buttons + right_buttons + 1); ac++;
-  XtSetArg(al[ac], XmNmarginWidth, 0);			ac++;
-  XtSetArg(al[ac], XmNmarginHeight, 0);			ac++;
-  XtSetArg(al[ac], XmNspacing, 13);			ac++;
-  XtSetArg(al[ac], XmNadjustLast, False);		ac++;
-  XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER);	ac++;
-  XtSetArg(al[ac], XmNisAligned, True);			ac++;
-  XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE);	ac++;
-  XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM);	ac++;
-  XtSetArg(al[ac], XmNbottomOffset, 13);		ac++;
-  XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM);	ac++;
-  XtSetArg(al[ac], XmNleftOffset, 13);			ac++;
-  XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
-  XtSetArg(al[ac], XmNrightOffset, 13);			ac++;
+  Xt_SET_ARG(al[ac], XmNpacking, XmPACK_COLUMN);		ac++;
+  Xt_SET_ARG(al[ac], XmNorientation, XmVERTICAL);		ac++;
+  Xt_SET_ARG(al[ac], XmNnumColumns, left_buttons + right_buttons + 1); ac++;
+  Xt_SET_ARG(al[ac], XmNmarginWidth, 0);			ac++;
+  Xt_SET_ARG(al[ac], XmNmarginHeight, 0);			ac++;
+  Xt_SET_ARG(al[ac], XmNspacing, 13);				ac++;
+  Xt_SET_ARG(al[ac], XmNadjustLast, False);			ac++;
+  Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_CENTER);		ac++;
+  Xt_SET_ARG(al[ac], XmNisAligned, True);			ac++;
+  Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE);		ac++;
+  Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_FORM);	ac++;
+  Xt_SET_ARG(al[ac], XmNbottomOffset, 13);			ac++;
+  Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM);		ac++;
+  Xt_SET_ARG(al[ac], XmNleftOffset, 13);			ac++;
+  Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
+  Xt_SET_ARG(al[ac], XmNrightOffset, 13);			ac++;
   row = XmCreateRowColumn (form, "row", al, ac);
 
   n_children = 0;
@@ -1176,10 +1151,10 @@
       ac = 0;
       if (i == 0)
 	{
-	  XtSetArg(al[ac], XmNhighlightThickness, 1); ac++;
-	  XtSetArg(al[ac], XmNshowAsDefault, TRUE);   ac++;
+	  Xt_SET_ARG(al[ac], XmNhighlightThickness, 1); 	ac++;
+	  Xt_SET_ARG(al[ac], XmNshowAsDefault, TRUE);   	ac++;
 	}
-      XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+      Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); 	ac++;
       children [n_children] = XmCreatePushButton (row, button_name, al, ac);
       DO_DND_KLUDGE (children [n_children]);
 
@@ -1187,7 +1162,7 @@
 	{
 	  button = children [n_children];
 	  ac = 0;
-	  XtSetArg(al[ac], XmNdefaultButton, button); ac++;
+	  Xt_SET_ARG(al[ac], XmNdefaultButton, button); 	ac++;
 	  XtSetValues (row, al, ac);
 
 #ifdef ARMANDACTIVATE_KLUDGE	/* See comment above */
@@ -1204,9 +1179,8 @@
 
   /* invisible separator button */
   ac = 0;
-  XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++;
-  children [n_children] = XmCreateLabel (row, "separator_button",
-					 al, ac);
+  Xt_SET_ARG (al[ac], XmNmappedWhenManaged, FALSE); 		ac++;
+  children [n_children] = XmCreateLabel (row, "separator_button", al, ac);
   DO_DND_KLUDGE (children [n_children]);
   n_children++;
 
@@ -1215,7 +1189,7 @@
       char button_name [16];
       sprintf (button_name, "button%d", left_buttons + i + 1);
       ac = 0;
-      XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+      Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); 	ac++;
       children [n_children] = XmCreatePushButton (row, button_name, al, ac);
       DO_DND_KLUDGE (children [n_children]);
       if (! button) button = children [n_children];
@@ -1225,53 +1199,53 @@
   XtManageChildren (children, n_children);
 
   ac = 0;
-  XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE);		ac++;
-  XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
-  XtSetArg(al[ac], XmNbottomOffset, 13);			ac++;
-  XtSetArg(al[ac], XmNbottomWidget, row);			ac++;
-  XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM);		ac++;
-  XtSetArg(al[ac], XmNleftOffset, 0);				ac++;
-  XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM);		ac++;
-  XtSetArg(al[ac], XmNrightOffset, 0);				ac++;
+  Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE);		ac++;
+  Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
+  Xt_SET_ARG(al[ac], XmNbottomOffset, 13);			ac++;
+  Xt_SET_ARG(al[ac], XmNbottomWidget, row);			ac++;
+  Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM);		ac++;
+  Xt_SET_ARG(al[ac], XmNleftOffset, 0);				ac++;
+  Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
+  Xt_SET_ARG(al[ac], XmNrightOffset, 0);			ac++;
   separator = XmCreateSeparator (form, "", al, ac);
 
   ac = 0;
-  XtSetArg(al[ac], XmNlabelType, XmPIXMAP);			ac++;
-  XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM);		ac++;
-  XtSetArg(al[ac], XmNtopOffset, 13);				ac++;
-  XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE);		ac++;
-  XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM);		ac++;
-  XtSetArg(al[ac], XmNleftOffset, 13);				ac++;
-  XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE);		ac++;
+  Xt_SET_ARG(al[ac], XmNlabelType, XmPIXMAP);			ac++;
+  Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_FORM);		ac++;
+  Xt_SET_ARG(al[ac], XmNtopOffset, 13);				ac++;
+  Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_NONE);	ac++;
+  Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM);		ac++;
+  Xt_SET_ARG(al[ac], XmNleftOffset, 13);			ac++;
+  Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_NONE);	ac++;
   icon = XmCreateLabel (form, (char *) icon_name, al, ac);
   DO_DND_KLUDGE (icon);
 
   ac = 0;
-  XtSetArg(al[ac], XmNmappedWhenManaged, FALSE);		ac++;
-  XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET);		ac++;
-  XtSetArg(al[ac], XmNtopOffset, 6);				ac++;
-  XtSetArg(al[ac], XmNtopWidget, icon);				ac++;
-  XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
-  XtSetArg(al[ac], XmNbottomOffset, 6);				ac++;
-  XtSetArg(al[ac], XmNbottomWidget, separator);			ac++;
-  XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE);		ac++;
-  XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE);		ac++;
+  Xt_SET_ARG(al[ac], XmNmappedWhenManaged, FALSE);		ac++;
+  Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_WIDGET);	ac++;
+  Xt_SET_ARG(al[ac], XmNtopOffset, 6);				ac++;
+  Xt_SET_ARG(al[ac], XmNtopWidget, icon);			ac++;
+  Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
+  Xt_SET_ARG(al[ac], XmNbottomOffset, 6);			ac++;
+  Xt_SET_ARG(al[ac], XmNbottomWidget, separator);		ac++;
+  Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_NONE);		ac++;
+  Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_NONE);	ac++;
   icon_separator = XmCreateLabel (form, "", al, ac);
   DO_DND_KLUDGE (icon_separator);
 
   if (text_input_slot)
     {
       ac = 0;
-      XtSetArg(al[ac], XmNcolumns, 50);				ac++;
-      XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE);	ac++;
-      XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
-      XtSetArg(al[ac], XmNbottomOffset, 13);			ac++;
-      XtSetArg(al[ac], XmNbottomWidget, separator);		ac++;
-      XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET);	ac++;
-      XtSetArg(al[ac], XmNleftOffset, 13);			ac++;
-      XtSetArg(al[ac], XmNleftWidget, icon); 			ac++;
-      XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
-      XtSetArg(al[ac], XmNrightOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNcolumns, 50);			ac++;
+      Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE);	ac++;
+      Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
+      Xt_SET_ARG(al[ac], XmNbottomOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNbottomWidget, separator);		ac++;
+      Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET);	ac++;
+      Xt_SET_ARG(al[ac], XmNleftOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNleftWidget, icon); 			ac++;
+      Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
+      Xt_SET_ARG(al[ac], XmNrightOffset, 13);			ac++;
       value = XmCreateTextField (form, "value", al, ac);
       DO_DND_KLUDGE (value);
     }
@@ -1279,19 +1253,19 @@
     {
       Widget radio_butt;
       ac = 0;
-      XtSetArg(al[ac], XmNmarginWidth, 0);			ac++;
-      XtSetArg(al[ac], XmNmarginHeight, 0);			ac++;
-      XtSetArg(al[ac], XmNspacing, 13);				ac++;
-      XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER);	ac++;
-      XtSetArg(al[ac], XmNorientation, XmHORIZONTAL);		ac++;
-      XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
-      XtSetArg(al[ac], XmNbottomOffset, 13);			ac++;
-      XtSetArg(al[ac], XmNbottomWidget, separator);		ac++;
-      XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET);	ac++;
-      XtSetArg(al[ac], XmNleftOffset, 13);			ac++;
-      XtSetArg(al[ac], XmNleftWidget, icon);			ac++;
-      XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
-      XtSetArg(al[ac], XmNrightOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNmarginWidth, 0);			ac++;
+      Xt_SET_ARG(al[ac], XmNmarginHeight, 0);			ac++;
+      Xt_SET_ARG(al[ac], XmNspacing, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_CENTER);	ac++;
+      Xt_SET_ARG(al[ac], XmNorientation, XmHORIZONTAL);		ac++;
+      Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
+      Xt_SET_ARG(al[ac], XmNbottomOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNbottomWidget, separator);		ac++;
+      Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET);	ac++;
+      Xt_SET_ARG(al[ac], XmNleftOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNleftWidget, icon);			ac++;
+      Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
+      Xt_SET_ARG(al[ac], XmNrightOffset, 13);			ac++;
       value = XmCreateRadioBox (form, "radiobutton1", al, ac);
       ac = 0;
       i = 0;
@@ -1306,16 +1280,16 @@
   else if (list)
     {
       ac = 0;
-      XtSetArg(al[ac], XmNvisibleItemCount, 5);			ac++;
-      XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE);	ac++;
-      XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
-      XtSetArg(al[ac], XmNbottomOffset, 13);			ac++;
-      XtSetArg(al[ac], XmNbottomWidget, separator);		ac++;
-      XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET);	ac++;
-      XtSetArg(al[ac], XmNleftOffset, 13);			ac++;
-      XtSetArg(al[ac], XmNleftWidget, icon);			ac++;
-      XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
-      XtSetArg(al[ac], XmNrightOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNvisibleItemCount, 5);		ac++;
+      Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE);	ac++;
+      Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
+      Xt_SET_ARG(al[ac], XmNbottomOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNbottomWidget, separator);		ac++;
+      Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET);	ac++;
+      Xt_SET_ARG(al[ac], XmNleftOffset, 13);			ac++;
+      Xt_SET_ARG(al[ac], XmNleftWidget, icon);			ac++;
+      Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
+      Xt_SET_ARG(al[ac], XmNrightOffset, 13);			ac++;
       value = XmCreateScrolledList (form, "list", al, ac);
 
       /* this is the easiest way I found to have the double click in the
@@ -1325,18 +1299,18 @@
   /* else add nothing; it's a separator */
 
   ac = 0;
-  XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
-  XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM);		ac++;
-  XtSetArg(al[ac], XmNtopOffset, 13);				ac++;
-  XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
-  XtSetArg(al[ac], XmNbottomOffset, 13);			ac++;
-  XtSetArg(al[ac], XmNbottomWidget,
-	   text_input_slot || radio_box || list ? value : separator); ac++;
-  XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET);		ac++;
-  XtSetArg(al[ac], XmNleftOffset, 13);				ac++;
-  XtSetArg(al[ac], XmNleftWidget, icon);			ac++;
-  XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM);		ac++;
-  XtSetArg(al[ac], XmNrightOffset, 13);				ac++;
+  Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
+  Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_FORM);		ac++;
+  Xt_SET_ARG(al[ac], XmNtopOffset, 13);				ac++;
+  Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);	ac++;
+  Xt_SET_ARG(al[ac], XmNbottomOffset, 13);			ac++;
+  Xt_SET_ARG(al[ac], XmNbottomWidget,
+	   text_input_slot || radio_box || list ? value : separator);	ac++;
+  Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET);	ac++;
+  Xt_SET_ARG(al[ac], XmNleftOffset, 13);			ac++;
+  Xt_SET_ARG(al[ac], XmNleftWidget, icon);			ac++;
+  Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM);	ac++;
+  Xt_SET_ARG(al[ac], XmNrightOffset, 13);			ac++;
   message = XmCreateLabel (form, "message", al, ac);
   DO_DND_KLUDGE (message);
 
@@ -1427,12 +1401,12 @@
   Position y;
   Arg al [2];
 
-  XtSetArg (al [0], XtNwidth,  &child_width);
-  XtSetArg (al [1], XtNheight, &child_height);
+  Xt_SET_ARG (al [0], XtNwidth,  &child_width);
+  Xt_SET_ARG (al [1], XtNheight, &child_height);
   XtGetValues (widget, al, 2);
 
-  XtSetArg (al [0], XtNwidth,  &parent_width);
-  XtSetArg (al [1], XtNheight, &parent_height);
+  Xt_SET_ARG (al [0], XtNwidth,  &parent_width);
+  Xt_SET_ARG (al [1], XtNheight, &parent_height);
   XtGetValues (parent, al, 2);
 
   x = (Position) ((parent_width  - child_width)  / 2);
@@ -1450,8 +1424,8 @@
   if (y < 0)
     y = 0;
 
-  XtSetArg (al [0], XtNx, x);
-  XtSetArg (al [1], XtNy, y);
+  Xt_SET_ARG (al [0], XtNx, x);
+  Xt_SET_ARG (al [1], XtNy, y);
   XtSetValues (widget, al, 2);
 }
 
@@ -1484,8 +1458,8 @@
       if (separator)
 	{
 	  Arg al [2];
-	  XtSetArg (al [0], XtNwidth,  5);
-	  XtSetArg (al [1], XtNheight, 5);
+	  Xt_SET_ARG (al [0], XtNwidth,  5);
+	  Xt_SET_ARG (al [1], XtNheight, 5);
 	  XtSetValues (separator, al, 2);
 	}
 
@@ -1581,8 +1555,8 @@
   Arg al[10];
   int ac = 0;
 
-  XtSetArg(al[ac], XmNmarginHeight, 0);	   ac++;
-  XtSetArg(al[ac], XmNshadowThickness, 3); ac++;
+  Xt_SET_ARG(al[ac], XmNmarginHeight, 0);	ac++;
+  Xt_SET_ARG(al[ac], XmNshadowThickness, 3);	ac++;
 
   return XmCreateMenuBar (instance->parent, instance->info->name, al, ac);
 }
@@ -1622,21 +1596,22 @@
 
   callbacks[0].closure  = (XtPointer) instance;
 
-  XtSetArg (al[ac], XmNminimum,       1); ac++;
-  XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++;
-  XtSetArg (al[ac], XmNincrement,     1); ac++;
-  XtSetArg (al[ac], XmNpageIncrement, 1); ac++;
-  XtSetArg (al[ac], XmNborderWidth,   0); ac++;
-  XtSetArg (al[ac], XmNorientation, vertical ? XmVERTICAL : XmHORIZONTAL); ac++;
+  Xt_SET_ARG (al[ac], XmNminimum,       1);			ac++;
+  Xt_SET_ARG (al[ac], XmNmaximum, INT_MAX);			ac++;
+  Xt_SET_ARG (al[ac], XmNincrement,     1);			ac++;
+  Xt_SET_ARG (al[ac], XmNpageIncrement, 1);			ac++;
+  Xt_SET_ARG (al[ac], XmNborderWidth,   0);			ac++;
+  Xt_SET_ARG (al[ac], XmNorientation,
+	      vertical ? XmVERTICAL : XmHORIZONTAL);		ac++;
 
-  XtSetArg (al[ac], XmNdecrementCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNdragCallback,		callbacks); ac++;
-  XtSetArg (al[ac], XmNincrementCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNpageDecrementCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNpageIncrementCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNtoBottomCallback,	callbacks); ac++;
-  XtSetArg (al[ac], XmNtoTopCallback,		callbacks); ac++;
-  XtSetArg (al[ac], XmNvalueChangedCallback,	callbacks); ac++;
+  Xt_SET_ARG (al[ac], XmNdecrementCallback,	callbacks);	ac++;
+  Xt_SET_ARG (al[ac], XmNdragCallback,		callbacks);	ac++;
+  Xt_SET_ARG (al[ac], XmNincrementCallback,	callbacks);	ac++;
+  Xt_SET_ARG (al[ac], XmNpageDecrementCallback,	callbacks);	ac++;
+  Xt_SET_ARG (al[ac], XmNpageIncrementCallback,	callbacks);	ac++;
+  Xt_SET_ARG (al[ac], XmNtoBottomCallback,	callbacks);	ac++;
+  Xt_SET_ARG (al[ac], XmNtoTopCallback,		callbacks);	ac++;
+  Xt_SET_ARG (al[ac], XmNvalueChangedCallback,	callbacks);	ac++;
 
   return XmCreateScrollBar (instance->parent, instance->info->name, al, ac);
 }
@@ -1665,14 +1640,14 @@
   Widget button = 0;
   widget_value* val = instance->info->val;
 
-  XtSetArg (al [ac], XmNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
-  XtSetArg (al [ac], XmNuserData, val->call_data);		ac++;
-  XtSetArg (al [ac], XmNmappedWhenManaged, FALSE);	ac++;
+  Xt_SET_ARG (al [ac], XmNsensitive, val->enabled);		ac++;
+  Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
+  Xt_SET_ARG (al [ac], XmNuserData, val->call_data);		ac++;
+  Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE);		ac++;
   /* The highlight doesn't appear to be dynamically set which makes it
      look ugly.  I think this may be a LessTif bug but for now we just
      get rid of it. */
-  XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+  Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0);	ac++;
 
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
@@ -1682,11 +1657,11 @@
 
   else if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
     {
-      XtSetArg (al [ac], XmNset, val->selected);	ac++;
-      XtSetArg (al [ac], XmNindicatorType,
+      Xt_SET_ARG (al [ac], XmNset, val->selected);		ac++;
+      Xt_SET_ARG (al [ac], XmNindicatorType,
 		(val->type == TOGGLE_TYPE ?
-		 XmN_OF_MANY : XmONE_OF_MANY));    ac++;
-      XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++;
+		 XmN_OF_MANY : XmONE_OF_MANY));			ac++;
+      Xt_SET_ARG (al [ac], XmNvisibleWhenOff, True);		ac++;
       button = XmCreateToggleButton (instance->parent, val->name, al, ac);
       XtRemoveAllCallbacks (button, XmNvalueChangedCallback);
       XtAddCallback (button, XmNvalueChangedCallback, xm_generic_callback,
@@ -1715,30 +1690,30 @@
   widget_value* val = instance->info->val;
   if (!val->call_data)
     {
-      XtSetArg (al [ac], XmNeditable, False);		ac++;
+      Xt_SET_ARG (al [ac], XmNeditable, False);			ac++;
     }
   else
     {
-      XtSetArg (al [ac], XmNeditable, val->enabled);		ac++;
+      Xt_SET_ARG (al [ac], XmNeditable, val->enabled);		ac++;
     }
-  XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
-  XtSetArg (al [ac], XmNuserData, val->call_data);		ac++;
-  XtSetArg (al [ac], XmNmappedWhenManaged, FALSE);	ac++;
-  XtSetArg (al [ac], XmNorientation, XmHORIZONTAL);	ac++;
+  Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
+  Xt_SET_ARG (al [ac], XmNuserData, val->call_data);		ac++;
+  Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE);		ac++;
+  Xt_SET_ARG (al [ac], XmNorientation, XmHORIZONTAL);		ac++;
   /* The highlight doesn't appear to be dynamically set which makes it
      look ugly.  I think this may be a LessTif bug but for now we just
      get rid of it. */
-  XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+  Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0);	ac++;
   
   height = (Dimension)lw_get_value_arg (val, XtNheight);
   width = (Dimension)lw_get_value_arg (val, XtNwidth);
   if (height > 0)
     {
-      XtSetArg (al [ac], XmNscaleHeight, height); ac++;
+      Xt_SET_ARG (al [ac], XmNscaleHeight, height);		ac++;
     }
   if (width > 0)
     {
-      XtSetArg (al [ac], XmNscaleWidth, width); ac++;
+      Xt_SET_ARG (al [ac], XmNscaleWidth, width);		ac++;
     }
 
   /* add any args the user supplied for creation time */
@@ -1762,14 +1737,14 @@
   Widget text = 0;
   widget_value* val = instance->info->val;
 
-  XtSetArg (al [ac], XmNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
-  XtSetArg (al [ac], XmNuserData, val->call_data);		ac++;
-  XtSetArg (al [ac], XmNmappedWhenManaged, FALSE);	ac++;
+  Xt_SET_ARG (al [ac], XmNsensitive, val->enabled);		ac++;
+  Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
+  Xt_SET_ARG (al [ac], XmNuserData, val->call_data);		ac++;
+  Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE);		ac++;
   /* The highlight doesn't appear to be dynamically set which makes it
      look ugly.  I think this may be a LessTif bug but for now we just
      get rid of it. */
-  XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+  Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0);	ac++;
 
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
@@ -1797,13 +1772,13 @@
   int ac = 0;
   Widget label = 0;
 
-  XtSetArg (al [ac], XmNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
-  XtSetArg (al [ac], XmNmappedWhenManaged, FALSE);	ac++;
+  Xt_SET_ARG (al [ac], XmNsensitive, val->enabled);		ac++;
+  Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
+  Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE);		ac++;
   /* The highlight doesn't appear to be dynamically set which makes it
      look ugly.  I think this may be a LessTif bug but for now we just
      get rid of it. */
-  XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+  Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0);	ac++;
 
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
@@ -1829,14 +1804,14 @@
   Widget combo = 0;
   widget_value* val = instance->info->val;
 
-  XtSetArg (al [ac], XmNsensitive, val->enabled);		ac++;
-  XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
-  XtSetArg (al [ac], XmNuserData, val->call_data);		ac++;
-  XtSetArg (al [ac], XmNmappedWhenManaged, FALSE);	ac++;
+  Xt_SET_ARG (al [ac], XmNsensitive, val->enabled);		ac++;
+  Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING);	ac++;
+  Xt_SET_ARG (al [ac], XmNuserData, val->call_data);		ac++;
+  Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE);		ac++;
   /* The highlight doesn't appear to be dynamically set which makes it
      look ugly.  I think this may be a LessTif bug but for now we just
      get rid of it. */
-  XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+  Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0);	ac++;
 
   /* add any args the user supplied for creation time */
   lw_add_value_args_to_args (val, al, &ac);
@@ -1944,7 +1919,7 @@
       if (trans)
 	{
 	  Arg al [1];
-	  XtSetArg (al [0], XmNmenuPost, trans);
+	  Xt_SET_ARG (al [0], XmNmenuPost, trans);
 	  XtSetValues (widget, al, 1);
 	}
       XmMenuPosition (widget, (XButtonPressedEvent *) event);
@@ -1963,12 +1938,12 @@
   short height;
   Arg al [2];
 
-  XtSetArg (al [0], XmNwidth,  &width);
-  XtSetArg (al [1], XmNheight, &height);
+  Xt_SET_ARG (al [0], XmNwidth,  &width);
+  Xt_SET_ARG (al [1], XmNheight, &height);
   XtGetValues (w, al, 2);
 
-  XtSetArg (al [0], XmNminWidth,  width);
-  XtSetArg (al [1], XmNminHeight, height);
+  Xt_SET_ARG (al [0], XmNminWidth,  width);
+  Xt_SET_ARG (al [1], XmNminHeight, height);
   XtSetValues (w, al, 2);
 }
 
@@ -2014,7 +1989,6 @@
   widget_instance* instance = (widget_instance*)closure;
   Widget instance_widget;
   LWLIB_ID id;
-  Arg al [1];
 
   if (!instance)
     return;
@@ -2027,8 +2001,7 @@
 
   id = instance->info->id;
   user_data = NULL;
-  XtSetArg(al [0], XmNuserData, &user_data);
-  XtGetValues (widget, al, 1);
+  Xt_GET_VALUE (widget, XmNuserData, &user_data);
   switch (type)
     {
     case pre_activate:
@@ -2080,13 +2053,9 @@
       || XtClass (widget) == xmToggleButtonGadgetClass)
     {
       Boolean check;
-      Arg al [1];
 
-      XtSetArg (al [0], XmNset, &check);
-      XtGetValues (widget, al, 1);
-
-      XtSetArg (al [0], XmNset, !check);
-      XtSetValues (widget, al, 1);
+      Xt_GET_VALUE (widget, XmNset, &check);
+      Xt_SET_VALUE (widget, XmNset, !check);
     }
 #endif
   lw_internal_update_other_instances (widget, closure, call_data);
--- a/lwlib/lwlib.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/lwlib.c	Sun Dec 28 14:55:02 2008 +0000
@@ -1385,7 +1385,7 @@
     }
 }
 
-XtArgVal lw_get_value_arg (widget_value* wv, String name)
+XtArgVal lw_get_value_arg (widget_value* wv, const String name)
 {
   int i;
   if (wv->args)
--- a/lwlib/lwlib.h	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/lwlib.h	Sun Dec 28 14:55:02 2008 +0000
@@ -2,6 +2,7 @@
 #define INCLUDED_lwlib_h_
 
 #include <X11/Intrinsic.h>
+#include "xt-wrappers.h"
 
 #if defined (LWLIB_MENUBARS_LUCID) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_MENUBARS_ATHENA)
 #define NEED_MENUBARS
--- a/lwlib/xlwcheckbox.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/xlwcheckbox.c	Sun Dec 28 14:55:02 2008 +0000
@@ -40,6 +40,7 @@
 #include <X11/StringDefs.h>
 #include ATHENA_XawInit_h_
 #include "../src/xmu.h"
+#include "xt-wrappers.h"
 #include "xlwcheckboxP.h"
 
 
@@ -89,10 +90,12 @@
 
 
 
-#define	offset(field)	XtOffsetOf(CheckboxRec, field)
+#define	offset(field)	XtOffsetOf(CheckboxRec, checkbox.field)
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+  Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
 static	XtResource	resources[] = {
-  {XtNtristate, XtCTristate, XtRBoolean, sizeof(Boolean),
-    offset(checkbox.tristate), XtRImmediate, (XtPointer)FALSE},
+  res (XtNtristate, XtCTristate, XtRBoolean, Boolean, tristate,
+       XtRImmediate, FALSE),
 } ;
 #undef	offset
 
@@ -127,7 +130,7 @@
 CheckboxClassRec checkboxClassRec = {
   {
     (WidgetClass) SuperClass,		/* superclass		*/
-    "Checkbox",				/* class_name		*/
+    (String) "Checkbox",		/* class_name		*/
     sizeof(CheckboxRec),		/* size			*/
     CheckboxClassInit,			/* class_initialize	*/
     NULL,				/* class_part_initialize  */
--- a/lwlib/xlwgauge.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/xlwgauge.c	Sun Dec 28 14:55:02 2008 +0000
@@ -53,6 +53,7 @@
 #include <X11/Xatom.h>
 #include <X11/StringDefs.h>
 #include ATHENA_XawInit_h_
+#include "xt-wrappers.h"
 #include "xlwgaugeP.h"
 #include "../src/xmu.h"
 #ifdef HAVE_XMU
@@ -77,33 +78,29 @@
 
 
 
-#define offset(field) XtOffsetOf(GaugeRec, field)
+#define offset(field) XtOffsetOf(GaugeRec, gauge.field)
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+  Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
 static XtResource resources[] = {
-    {XtNvalue, XtCValue, XtRInt, sizeof(int),
-	offset(gauge.value), XtRImmediate, (XtPointer)0},
-    {XtNminValue, XtCMinValue, XtRInt, sizeof(int),
-	offset(gauge.v0), XtRImmediate, (XtPointer)0},
-    {XtNmaxValue, XtCMaxValue, XtRInt, sizeof(int),
-	offset(gauge.v1), XtRImmediate, (XtPointer)100},
-    {XtNntics, XtCNTics, XtRInt, sizeof(int),
-	offset(gauge.ntics), XtRImmediate, (XtPointer) 0},
-    {XtNnlabels, XtCNLabels, XtRInt, sizeof(int),
-	offset(gauge.nlabels), XtRImmediate, (XtPointer) 0},
-    {XtNlabels, XtCLabels, XtRStringArray, sizeof(String *),
-	offset(gauge.labels), XtRStringArray, NULL},
-    {XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, sizeof(Boolean),
-	offset(gauge.autoScaleUp), XtRImmediate, FALSE},
-    {XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, sizeof(Boolean),
-	offset(gauge.autoScaleDown), XtRImmediate, FALSE},
-    {XtNorientation, XtCOrientation, XtROrientation, sizeof(XtOrientation),
-	offset(gauge.orientation), XtRImmediate, (XtPointer)XtorientHorizontal},
-    {XtNupdate, XtCInterval, XtRInt, sizeof(int),
-	offset(gauge.update), XtRImmediate, (XtPointer)0},
-    {XtNgetValue, XtCCallback, XtRCallback, sizeof(XtPointer),
-	offset(gauge.getValue), XtRImmediate, (XtPointer)NULL},
+    res (XtNvalue, XtCValue, XtRInt, int, value, XtRImmediate, 0),
+    res (XtNminValue, XtCMinValue, XtRInt, int, v0, XtRImmediate, 0),
+    res (XtNmaxValue, XtCMaxValue, XtRInt, int, v1, XtRImmediate, 100),
+    res (XtNntics, XtCNTics, XtRInt, int, ntics, XtRImmediate,  0),
+    res (XtNnlabels, XtCNLabels, XtRInt, int, nlabels, XtRImmediate,  0),
+    res (XtNlabels, XtCLabels, XtRStringArray, String *, labels,
+	 XtRStringArray, NULL),
+    res (XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, Boolean, autoScaleUp,
+	 XtRImmediate, FALSE),
+    res (XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, Boolean,
+	 autoScaleDown, XtRImmediate, FALSE),
+    res (XtNorientation, XtCOrientation, XtROrientation, XtOrientation,
+	 orientation, XtRImmediate, XtorientHorizontal),
+    res (XtNupdate, XtCInterval, XtRInt, int, update, XtRImmediate, 0),
+    res (XtNgetValue, XtCCallback, XtRCallback, XtPointer, getValue,
+	 XtRImmediate, NULL),
 };
 #undef offset
-
+#undef res
 
 
 	/* member functions */
@@ -146,8 +143,8 @@
 
 static	XtActionsRec	actionsList[] =
 {
-  {"select",	GaugeSelect},
-  {"paste",	GaugePaste},
+  { (String) "select",	GaugeSelect },
+  { (String) "paste",	GaugePaste },
 } ;
 
 
@@ -162,7 +159,7 @@
   {
 /* core_class fields */
     /* superclass	  	*/	(WidgetClass) &labelClassRec,
-    /* class_name	  	*/	"Gauge",
+    /* class_name	  	*/	(String) "Gauge",
     /* widget_size	  	*/	sizeof(GaugeRec),
     /* class_initialize   	*/	GaugeClassInit,
     /* class_part_initialize	*/	NULL,
--- a/lwlib/xlwmenu.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/xlwmenu.c	Sun Dec 28 14:55:02 2008 +0000
@@ -70,100 +70,112 @@
 
 extern Widget lw_menubar_widget;
 
-#define offset(field) XtOffset(XlwMenuWidget, field)
 static XtResource
 xlwMenuResources[] =
 {
+/* The offset macro is a standard trick.  The remaining macros are an
+   experiment to compress redundancies in resource descriptions, and shut
+   up GCC 4.3 (the String casts, which keep G++ from complaining about
+   implicit conversions from const char *). */
+#define offset(field) XtOffset(XlwMenuWidget, menu.field)
+#define fontres(name,_class,repr,type,member,value) \
+  Xt_RESOURCE (name, _class, repr, type, offset(member), XtRString, value)
+#define mflres(name,cls,member,repr,value) \
+  Xt_RESOURCE (name, cls, XmRFontList, XmFontList, offset(member), repr, value)
+#define dimres(name,cls,repr,member,value) \
+  Xt_RESOURCE (name, cls, repr, Dimension, offset(member), XtRImmediate, value)
+#define boolres(nm,cls,member,val) \
+  Xt_RESOURCE (nm, cls, XtRBoolean, Boolean, offset(member), XtRImmediate, val)
+#define cbres(name,member,value)					  \
+  Xt_RESOURCE (name, XtCCallback, XtRCallback, XtPointer, offset(member), \
+	       XtRCallback, value)
+#define pixres(name,_class,member,repr,value) \
+  Xt_RESOURCE (name, _class, XtRPixel, Pixel, offset(member), repr, value)
+#define fgpixres(name,_class,member) \
+  pixres (name, _class, member, XtRString, "XtDefaultForeground")
+#define nullpixres(name,_class,member) \
+  pixres (name, _class, member, XtRImmediate, -1)
+#define pmres(name,cls,member) \
+  Xt_RESOURCE (name, cls, XtRPixmap, Pixmap, offset(member), XtRImmediate, None)
+
 #if defined(NEED_MOTIF) && !defined(USE_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
      font from the XtRString specified here. */
-  {XmNfontList,  XmCFontList, XmRFontList, sizeof(XmFontList),
-     offset(menu.font_list),  XtRImmediate, (XtPointer)0},
-  {XtNfont,      XtCFont,     XmRFontList, sizeof(XmFontList),
-     offset(menu.font_list_2),XtRImmediate, (XtPointer)0},
-  {XmNfontList,  XmCFontList, XmRFontList, sizeof(XmFontList),
-     offset(menu.fallback_font_list),
+  mflres (XmNfontList,  XmCFontList, font_list,	  XtRImmediate, 0),
+  mflres (XtNfont,      XtCFont,     font_list_2, XtRImmediate, 0),
+  mflres (XmNfontList,  XmCFontList, fallback_font_list,
      /* We must use an iso8859-1 font here, or people without $LANG set lose.
 	It's fair to assume that those who do have $LANG set also have the
 	*fontList resource set, or at least know how to deal with this. */
-     XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"},
+     XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"),
 #else
-  {XtNfont,  XtCFont, XtRFontStruct, sizeof(XFontStruct *),
-     offset(menu.font), XtRString, (XtPointer) "XtDefaultFont"},
+  fontres (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, font,
+	   "XtDefaultFont"),
 #ifdef USE_XFT_MENUBARS
-  {XtNfcFontName,  XtCFcFontName, XtRString, sizeof (String),
-   offset(menu.fcFontName), 
-   XtRString, (XtPointer) NULL},
+  fontres (XtNfcFontName, XtCFcFontName, XtRString, String, fcFontName,
+	   "sans-serif-12:bold"),
   /* #### This needs to be fixed to give a proper type and converter for
      XftFonts.  See also xlwtabs.c. */
-  {XtNxftFont, XtCXftFont, XtRString, sizeof(XtPointer),
-	offset(menu.xftFontName), XtRString, (XtPointer) "Helvetica-12:bold" },
+  fontres (XtNxftFont, XtCXftFont, XtRString, XtPointer, xftFontName,
+	   "Helvetica-12:bold"),
 #endif
 # ifdef USE_XFONTSET
   /* #### Consider using the same method as for Motif; see the comment in
      XlwMenuInitialize(). */
-  {XtNfontSet,  XtCFontSet, XtRFontSet, sizeof(XFontSet),
-     offset(menu.font_set), XtRString, (XtPointer) "XtDefaultFontSet"},
+  fontres (XtNfontSet, XtCFontSet, XtRFontSet, XFontSet, font_set,
+	   "XtDefaultFontSet"),
 # endif
 #endif
-  {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
-     offset(menu.foreground), XtRString, (XtPointer) "XtDefaultForeground"},
-  {XtNbuttonForeground, XtCButtonForeground, XtRPixel, sizeof(Pixel),
-     offset(menu.button_foreground), XtRString, (XtPointer) "XtDefaultForeground"},
-  {XtNhighlightForeground, XtCHighlightForeground, XtRPixel, sizeof(Pixel),
-     offset(menu.highlight_foreground), XtRString, (XtPointer) "XtDefaultForeground"},
-  {XtNtitleForeground, XtCTitleForeground, XtRPixel, sizeof(Pixel),
-     offset(menu.title_foreground), XtRString, (XtPointer) "XtDefaultForeground"},
-  {XtNmargin, XtCMargin, XtRDimension,  sizeof(Dimension),
-     offset(menu.margin), XtRImmediate, (XtPointer)2},
-  {XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension),
-     offset(menu.horizontal_margin), XtRImmediate, (XtPointer)2},
-  {XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension),
-     offset(menu.vertical_margin), XtRImmediate, (XtPointer)1},
-  {XmNspacing, XmCSpacing, XmRHorizontalDimension,  sizeof(Dimension),
-     offset(menu.column_spacing), XtRImmediate, (XtPointer)4},
-  {XmNindicatorSize, XmCIndicatorSize, XtRDimension,  sizeof(Dimension),
-     offset(menu.indicator_size), XtRImmediate, (XtPointer)0},
+  fgpixres (XtNforeground, XtCForeground, foreground),
+  fgpixres (XtNbuttonForeground, XtCButtonForeground, button_foreground),
+  fgpixres (XtNhighlightForeground, XtCHighlightForeground,
+	    highlight_foreground),
+  fgpixres (XtNtitleForeground, XtCTitleForeground, title_foreground),
+  dimres (XtNmargin, XtCMargin, XtRDimension, margin, 2),
+  dimres (XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension,
+	  horizontal_margin, 2),
+  dimres (XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension,
+	  vertical_margin, 1),
+  dimres (XmNspacing, XmCSpacing, XmRHorizontalDimension, column_spacing, 4),
+  dimres (XmNindicatorSize, XmCIndicatorSize, XtRDimension, indicator_size, 0),
 #if 0
-  {XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension,
-     sizeof (Dimension), offset (menu.shadow_thickness),
-     XtRImmediate, (XtPointer) 2},
+  dimres (XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension,
+	  shadow_thickness, 2),
 #else
-  {XmNshadowThickness, XmCShadowThickness, XtRDimension,
-     sizeof (Dimension), offset (menu.shadow_thickness),
-     XtRImmediate, (XtPointer) 2},
+  dimres (XmNshadowThickness, XmCShadowThickness, XtRDimension,
+	  shadow_thickness, 2),
 #endif
-  {XmNselectColor, XmCSelectColor, XtRPixel, sizeof (Pixel),
-     offset (menu.select_color), XtRImmediate, (XtPointer)-1},
-  {XmNtopShadowColor, XmCTopShadowColor, XtRPixel, sizeof (Pixel),
-     offset (menu.top_shadow_color), XtRImmediate, (XtPointer)-1},
-  {XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel, sizeof (Pixel),
-     offset (menu.bottom_shadow_color), XtRImmediate, (XtPointer)-1},
-  {XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap, sizeof (Pixmap),
-     offset (menu.top_shadow_pixmap), XtRImmediate, (XtPointer)None},
-  {XmNbottomShadowPixmap, XmCBottomShadowPixmap, XtRPixmap, sizeof (Pixmap),
-     offset (menu.bottom_shadow_pixmap), XtRImmediate, (XtPointer)None},
-
-  {XtNopen, XtCCallback, XtRCallback, sizeof(XtPointer),
-     offset(menu.open), XtRCallback, (XtPointer)NULL},
-  {XtNselect, XtCCallback, XtRCallback, sizeof(XtPointer),
-     offset(menu.select), XtRCallback, (XtPointer)NULL},
-  {XtNmenu, XtCMenu, XtRPointer, sizeof(XtPointer),
-     offset(menu.contents), XtRImmediate, (XtPointer)NULL},
-  {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
-     offset(menu.cursor_shape), XtRString, (XtPointer) "right_ptr"},
-  {XtNhorizontal, XtCHorizontal, XtRInt, sizeof(int),
-     offset(menu.horizontal), XtRImmediate, (XtPointer)True},
-  {XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, sizeof (Boolean),
-     offset (menu.use_backing_store), XtRImmediate, (XtPointer)False},
-  {XtNbounceDown, XtCBounceDown, XtRBoolean, sizeof (Boolean),
-     offset (menu.bounce_down), XtRImmediate, (XtPointer)True},
-  {XtNresourceLabels, XtCResourceLabels, XtRBoolean, sizeof (Boolean),
-     offset (menu.lookup_labels), XtRImmediate, (XtPointer)False},
+  nullpixres (XmNselectColor, XmCSelectColor, select_color),
+  nullpixres (XmNtopShadowColor, XmCTopShadowColor, top_shadow_color),
+  nullpixres (XmNbottomShadowColor, XmCBottomShadowColor, bottom_shadow_color),
+  pmres (XmNtopShadowPixmap, XmCTopShadowPixmap, top_shadow_pixmap),
+  pmres (XmNbottomShadowPixmap, XmCBottomShadowPixmap, bottom_shadow_pixmap),
+
+  cbres (XtNopen, open, NULL),
+  cbres (XtNselect, select, NULL),
+  Xt_RESOURCE (XtNmenu, XtCMenu, XtRPointer, XtPointer, offset(contents),
+	       XtRImmediate, NULL),
+  Xt_RESOURCE (XtNcursor, XtCCursor, XtRCursor, Cursor, offset(cursor_shape),
+	       XtRString, "right_ptr"),
+  Xt_RESOURCE (XtNhorizontal, XtCHorizontal, XtRInt, int, offset(horizontal),
+	       XtRImmediate, True),
+  boolres (XtNuseBackingStore, XtCUseBackingStore, use_backing_store, False),
+  boolres (XtNbounceDown,      XtCBounceDown,      bounce_down,       True),
+  boolres (XtNresourceLabels,  XtCResourceLabels,  lookup_labels,     False),
+
+#undef offset
+#undef mflres
+#undef fontres
+#undef dimres
+#undef boolres
+#undef cbres
+#undef pixres
+#undef fgpixres
+#undef nullpixres
+#undef pmres
 };
-#undef offset
 
 static Boolean XlwMenuSetValues (Widget current, Widget request, Widget new_,
 				 ArgList args, Cardinal *num_args);
@@ -186,9 +198,9 @@
 static XtActionsRec
 xlwMenuActionsList [] =
 {
-  {"start",	Start},
-  {"drag",	Drag},
-  {"select",	Select},
+  { (String) "start",	Start},
+  { (String) "drag",	Drag},
+  { (String) "select",	Select},
 };
 
 #define SuperClass ((CoreWidgetClass)&coreClassRec)
@@ -197,7 +209,7 @@
 {
   {  /* CoreClass fields initialization */
     (WidgetClass) SuperClass,		/* superclass		  */
-    "XlwMenu",				/* class_name		  */
+    (String) "XlwMenu",			/* class_name		  */
     sizeof(XlwMenuRec),			/* size			  */
     XlwMenuClassInitialize,		/* class_initialize	  */
     NULL,				/* class_part_initialize  */
@@ -495,7 +507,7 @@
 static XtResource
 nameResource[] =
 {
-  { "labelString", "LabelString", XtRString, sizeof(String),
+  { (String) "labelString", (String) "LabelString", XtRString, sizeof(String),
     0, XtRImmediate, 0 }
 };
 
--- a/lwlib/xlwradio.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/xlwradio.c	Sun Dec 28 14:55:02 2008 +0000
@@ -55,6 +55,7 @@
 #include <X11/StringDefs.h>
 #include ATHENA_XawInit_h_
 #include "../src/xmu.h"
+#include "xt-wrappers.h"
 #include "xlwradioP.h"
 
 #define	BOX_SIZE	13
@@ -116,8 +117,8 @@
 
 static XtActionsRec actionsList[] =
 {
-  {"highlight",		RadioHighlight},
-  {"unhighlight",	RadioUnhighlight},
+  { (String) "highlight",	RadioHighlight },
+  { (String) "unhighlight",	RadioUnhighlight },
 };
 
 #define SuperClass ((ToggleWidgetClass)&toggleClassRec)
@@ -125,7 +126,7 @@
 RadioClassRec radioClassRec = {
   {
     (WidgetClass) SuperClass,		/* superclass		*/
-    "Radio",				/* class_name		*/
+    (String) "Radio",			/* class_name		*/
     sizeof(RadioRec),			/* size			*/
     RadioClassInit,			/* class_initialize	*/
     RadioClassPartInit,			/* class_part_initialize  */
--- a/lwlib/xlwscrollbar.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/xlwscrollbar.c	Sun Dec 28 14:55:02 2008 +0000
@@ -79,6 +79,7 @@
 #include <X11/bitmaps/gray>
 
 #include "lwlib-colors.h"
+#include "xt-wrappers.h"
 
 #include "xlwscrollbarP.h"
 #include "xlwscrollbar.h"
@@ -113,90 +114,79 @@
 } SliderStyle;
 
 /*-------------------------- Resources ----------------------------------*/
-#define offset(field) XtOffset(XlwScrollBarWidget, field)
 
 static XtResource resources[] = {
-    { XmNforeground, XmCForeground, XtRPixel, sizeof(Pixel),
-      offset(sb.foreground), XtRImmediate, (XtPointer) XtDefaultForeground },
+#define offset(field) XtOffset(XlwScrollBarWidget, field)
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+  Xt_RESOURCE (name, _class, intrepr, type, offset(sb.member), extrepr, value)
 
-    { XmNtopShadowColor, XmCTopShadowColor, XtRPixel,
-      sizeof(Pixel), offset(sb.topShadowColor), XtRImmediate, (XtPointer) ~0 },
-    { XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel,
-      sizeof(Pixel), offset(sb.bottomShadowColor), XtRImmediate,
-      (XtPointer)~0 },
-
-    { XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap,
-      sizeof (Pixmap), offset(sb.topShadowPixmap), XtRImmediate,
-      (XtPointer)None},
-    { XmNbottomShadowPixmap, XmCBottomShadowPixmap,
-      XtRPixmap, sizeof (Pixmap), offset(sb.bottomShadowPixmap),
-      XtRImmediate, (XtPointer)None},
+  res (XmNforeground, XmCForeground, XtRPixel, Pixel, 
+       foreground,  XtRImmediate, XtDefaultForeground),
+  res (XmNtopShadowColor, XmCTopShadowColor, XtRPixel,
+       Pixel,  topShadowColor,  XtRImmediate, ~0),
+  res (XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel,
+       Pixel,  bottomShadowColor,  XtRImmediate, ~0),
 
-    { XmNtroughColor, XmCTroughColor, XtRPixel, sizeof(Pixel),
-      offset(sb.troughColor), XtRImmediate, (XtPointer)~0 },
+  res (XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap,
+       Pixmap,  topShadowPixmap,  XtRImmediate, None),
+  res (XmNbottomShadowPixmap, XmCBottomShadowPixmap,
+       XtRPixmap, Pixmap, bottomShadowPixmap, XtRImmediate, None),
 
-    { XmNshadowThickness, XmCShadowThickness, XtRInt,
-      sizeof(int), offset(sb.shadowThickness), XtRImmediate, (XtPointer)2 },
+  res (XmNtroughColor, XmCTroughColor, XtRPixel, Pixel, troughColor,
+       XtRImmediate, ~0),
 
-    { XmNborderWidth, XmCBorderWidth, XtRDimension,
-      sizeof(Dimension), offset(core.border_width), XtRImmediate,
-      (XtPointer)0 },
+  res (XmNshadowThickness, XmCShadowThickness, XtRInt, int,
+       shadowThickness, XtRImmediate, 2),
 
-    { XmNshowArrows, XmCShowArrows, XtRBoolean,
-      sizeof(Boolean), offset(sb.showArrows), XtRImmediate, (XtPointer)True },
+  Xt_RESOURCE (XmNborderWidth, XmCBorderWidth, XtRDimension, Dimension,
+	       offset(core.border_width), XtRImmediate, 0),
 
-    { XmNinitialDelay, XmCInitialDelay, XtRInt, sizeof(int),
-      offset(sb.initialDelay), XtRImmediate, (XtPointer) 250 },
-    { XmNrepeatDelay, XmCRepeatDelay, XtRInt, sizeof(int),
-      offset(sb.repeatDelay), XtRImmediate, (XtPointer) 50 },
+  res (XmNshowArrows, XmCShowArrows, XtRBoolean, Boolean, showArrows,
+       XtRImmediate, True),
 
-    { XmNorientation, XmCOrientation, XtROrientation,
-      sizeof(unsigned char), offset(sb.orientation), XtRImmediate,
-      (XtPointer) XmVERTICAL },
+  res (XmNinitialDelay, XmCInitialDelay, XtRInt, int, initialDelay,
+       XtRImmediate, 250),
+  res (XmNrepeatDelay, XmCRepeatDelay, XtRInt, int, repeatDelay,
+       XtRImmediate, 50),
+
+  res (XmNorientation, XmCOrientation, XtROrientation,
+       unsigned char,  orientation,  XtRImmediate, XmVERTICAL),
 
-    { XmNminimum, XmCMinimum, XtRInt, sizeof(int),
-      offset(sb.minimum), XtRImmediate, (XtPointer) 0},
-    { XmNmaximum, XmCMaximum, XtRInt, sizeof(int),
-      offset(sb.maximum), XtRImmediate, (XtPointer) 100},
-    { XmNvalue, XmCValue, XtRInt, sizeof(int),
-      offset(sb.value), XtRImmediate, (XtPointer) 0},
-    { XmNsliderSize, XmCSliderSize, XtRInt, sizeof(int),
-      offset(sb.sliderSize), XtRImmediate, (XtPointer) 10},
-    { XmNincrement, XmCIncrement, XtRInt, sizeof(int),
-      offset(sb.increment), XtRImmediate, (XtPointer) 1},
-    { XmNpageIncrement, XmCPageIncrement, XtRInt, sizeof(int),
-      offset(sb.pageIncrement), XtRImmediate, (XtPointer) 10},
+  res (XmNminimum, XmCMinimum, XtRInt, int, minimum,  XtRImmediate, 0),
+  res (XmNmaximum, XmCMaximum, XtRInt, int, maximum,  XtRImmediate, 100),
+  res (XmNvalue, XmCValue, XtRInt, int, value,  XtRImmediate, 0),
+  res (XmNsliderSize, XmCSliderSize, XtRInt, int, sliderSize, XtRImmediate, 10),
+  res (XmNincrement, XmCIncrement, XtRInt, int, increment,  XtRImmediate, 1),
+  res (XmNpageIncrement, XmCPageIncrement, XtRInt, int, 
+       pageIncrement,  XtRImmediate, 10),
 
-    { XmNvalueChangedCallback, XmCValueChangedCallback,
-      XtRCallback, sizeof(XtPointer), offset(sb.valueChangedCBL),
-      XtRCallback, NULL},
-    { XmNincrementCallback, XmCIncrementCallback,
-      XtRCallback, sizeof(XtPointer), offset(sb.incrementCBL),
-      XtRCallback, NULL},
-    { XmNdecrementCallback, XmCDecrementCallback,
-      XtRCallback, sizeof(XtPointer), offset(sb.decrementCBL),
-      XtRCallback, NULL},
-    { XmNpageIncrementCallback, XmCPageIncrementCallback,
-      XtRCallback, sizeof(XtPointer), offset(sb.pageIncrementCBL),
-      XtRCallback, NULL},
-    { XmNpageDecrementCallback, XmCPageDecrementCallback,
-      XtRCallback, sizeof(XtPointer), offset(sb.pageDecrementCBL),
-      XtRCallback, NULL},
-    { XmNtoTopCallback, XmCToTopCallback, XtRCallback,
-      sizeof(XtPointer), offset(sb.toTopCBL), XtRCallback, NULL},
-    { XmNtoBottomCallback, XmCToBottomCallback, XtRCallback,
-      sizeof(XtPointer), offset(sb.toBottomCBL), XtRCallback, NULL},
-    { XmNdragCallback, XmCDragCallback, XtRCallback,
-      sizeof(XtPointer), offset(sb.dragCBL), XtRCallback, NULL},
+  res (XmNvalueChangedCallback, XmCValueChangedCallback,
+       XtRCallback, XtPointer,  valueChangedCBL, XtRCallback, NULL),
+  res (XmNincrementCallback, XmCIncrementCallback,
+       XtRCallback, XtPointer,  incrementCBL, XtRCallback, NULL),
+  res (XmNdecrementCallback, XmCDecrementCallback,
+       XtRCallback, XtPointer,  decrementCBL, XtRCallback, NULL),
+  res (XmNpageIncrementCallback, XmCPageIncrementCallback,
+       XtRCallback, XtPointer,  pageIncrementCBL, XtRCallback, NULL),
+  res (XmNpageDecrementCallback, XmCPageDecrementCallback,
+       XtRCallback, XtPointer,  pageDecrementCBL, XtRCallback, NULL),
+  res (XmNtoTopCallback, XmCToTopCallback, XtRCallback,
+       XtPointer,  toTopCBL,  XtRCallback, NULL),
+  res (XmNtoBottomCallback, XmCToBottomCallback, XtRCallback,
+       XtPointer,  toBottomCBL,  XtRCallback, NULL),
+  res (XmNdragCallback, XmCDragCallback, XtRCallback,
+       XtPointer,  dragCBL,  XtRCallback, NULL),
 
       /* "knob" is obsolete; use "slider" instead. */
-    { XmNsliderStyle, XmCSliderStyle, XtRString, sizeof(char *),
-      offset(sb.sliderStyle), XtRImmediate, NULL},
-    { XmNknobStyle, XmCKnobStyle, XtRString, sizeof(char *),
-       offset(sb.knobStyle), XtRImmediate, NULL},
+  res (XmNsliderStyle, XmCSliderStyle, XtRString, char *, 
+       sliderStyle,  XtRImmediate, NULL),
+  res (XmNknobStyle, XmCKnobStyle, XtRString, char *, 
+       knobStyle,  XtRImmediate, NULL),
 
-    { XmNarrowPosition, XmCArrowPosition, XtRString, sizeof(char *),
-      offset(sb.arrowPosition), XtRImmediate, NULL},
+  res (XmNarrowPosition, XmCArrowPosition, XtRString, char *, 
+       arrowPosition,  XtRImmediate, NULL),
+#undef  offset
+#undef  res
 };
 
 /*-------------------------- Prototypes ---------------------------------*/
@@ -218,13 +208,13 @@
 /*-------------------------- Actions Table ------------------------------*/
 static XtActionsRec actions[] =
 {
-  {"Select",		Select},
-  {"PageDownOrRight",	PageDownOrRight},
-  {"PageUpOrLeft",	PageUpOrLeft},
-  {"Drag",		Drag},
-  {"Release",		Release},
-  {"Jump",		Jump},
-  {"Abort",		Abort},
+  { (String) "Select",		Select},
+  { (String) "PageDownOrRight",	PageDownOrRight},
+  { (String) "PageUpOrLeft",	PageUpOrLeft},
+  { (String) "Drag",		Drag},
+  { (String) "Release",		Release},
+  { (String) "Jump",		Jump},
+  { (String) "Abort",		Abort},
 };
 
 /*--------------------- Default Translation Table -----------------------*/
@@ -243,7 +233,7 @@
     /* core_class fields */
     {
     /* superclass          */ (WidgetClass) &coreClassRec,
-    /* class_name          */ "XlwScrollBar",
+    /* class_name          */ (String) "XlwScrollBar",
     /* widget_size         */ sizeof(XlwScrollBarRec),
     /* class_initialize    */ NULL,
     /* class_part_init     */ NULL,
--- a/lwlib/xlwtabs.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/lwlib/xlwtabs.c	Sun Dec 28 14:55:02 2008 +0000
@@ -142,64 +142,69 @@
 	 " ;
 static	XtAccelerators	defaultAccelerators ; /* #### Never used */
 
+static XtResource resources[] = {
 #define	offset(field)	XtOffsetOf(TabsRec, tabs.field)
-static XtResource resources[] = {
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+  Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
 
-  {XtNselectInsensitive, XtCSelectInsensitive, XtRBoolean, sizeof(Boolean),
-	offset(selectInsensitive), XtRImmediate, (XtPointer) True},
-  {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
-	offset(font), XtRString, (XtPointer) XtDefaultFont},
+  res (XtNselectInsensitive, XtCSelectInsensitive, XtRBoolean, Boolean, 
+       selectInsensitive,  XtRImmediate, True),
+  res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, 
+       font,  XtRString, XtDefaultFont),
 #ifdef USE_XFT_TABS
   /* #### Maybe use "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1" here?
      or XtDefaultFont? */
-  {XtNfcFontName, XtCFcFontName, XtRString, sizeof(String),
-	offset(fcFontName), XtRString, (XtPointer) NULL },
+  res (XtNfcFontName, XtCFcFontName, XtRString, String,
+       fcFontName, XtRString, NULL),
   /* #### This needs to be fixed to give a proper type and converter for
      XftFonts.  See also xlwmenu.c. */
-  {XtNxftFont, XtCXftFont, XtRString, sizeof(String),
-	offset(xftFontName), XtRString, (XtPointer) "Helvetica-12" },
+  res (XtNxftFont, XtCXftFont, XtRString, String, 
+       xftFontName,  XtRString, "Helvetica-12"),
 #endif
-  {XtNinternalWidth, XtCWidth, XtRDimension, sizeof(Dimension),
-	offset(internalWidth), XtRImmediate, (XtPointer)4 },
-  {XtNinternalHeight, XtCHeight, XtRDimension, sizeof(Dimension),
-	offset(internalHeight), XtRImmediate, (XtPointer)4 },
-  {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension),
-	XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, (XtPointer)0},
-  {XtNtopWidget, XtCTopWidget, XtRWidget, sizeof(Widget),
-	offset(topWidget), XtRImmediate, NULL},
-  {XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer),
-	offset(callbacks), XtRCallback, NULL},
-  {XtNpopdownCallback, XtCCallback, XtRCallback, sizeof(XtPointer),
-	offset(popdownCallbacks), XtRCallback, NULL},
-  {XtNbeNiceToColormap, XtCBeNiceToColormap, XtRBoolean, sizeof(Boolean),
-	offset(be_nice_to_cmap), XtRImmediate, (XtPointer) True},
-  {XtNtopShadowContrast, XtCTopShadowContrast, XtRInt, sizeof(int),
-	offset(top_shadow_contrast), XtRImmediate, (XtPointer) 20},
-  {XtNbottomShadowContrast, XtCBottomShadowContrast, XtRInt, sizeof(int),
-	offset(bot_shadow_contrast), XtRImmediate, (XtPointer) 40},
-  {XtNinsensitiveContrast, XtCInsensitiveContrast, XtRInt, sizeof(int),
-	offset(insensitive_contrast), XtRImmediate, (XtPointer) 33},
-  {XtNaccelerators, XtCAccelerators, XtRAcceleratorTable,sizeof(XtTranslations),
-	XtOffsetOf(TabsRec,core.accelerators), XtRString, accelTable},
+  res (XtNinternalWidth, XtCWidth, XtRDimension, Dimension, 
+       internalWidth,  XtRImmediate, 4),
+  res (XtNinternalHeight, XtCHeight, XtRDimension, Dimension, 
+       internalHeight,  XtRImmediate, 4),
+  Xt_RESOURCE (XtNborderWidth, XtCBorderWidth, XtRDimension, Dimension, 
+	       XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, 0),
+  res (XtNtopWidget, XtCTopWidget, XtRWidget, Widget, 
+       topWidget,  XtRImmediate, NULL),
+  res (XtNcallback, XtCCallback, XtRCallback, XtPointer, 
+       callbacks,  XtRCallback, NULL),
+  res (XtNpopdownCallback, XtCCallback, XtRCallback, XtPointer, 
+       popdownCallbacks,  XtRCallback, NULL),
+  res (XtNbeNiceToColormap, XtCBeNiceToColormap, XtRBoolean, Boolean, 
+       be_nice_to_cmap,  XtRImmediate, True),
+  res (XtNtopShadowContrast, XtCTopShadowContrast, XtRInt, int, 
+       top_shadow_contrast,  XtRImmediate, 20),
+  res (XtNbottomShadowContrast, XtCBottomShadowContrast, XtRInt, int, 
+       bot_shadow_contrast,  XtRImmediate, 40),
+  res (XtNinsensitiveContrast, XtCInsensitiveContrast, XtRInt, int, 
+       insensitive_contrast,  XtRImmediate, 33),
+  Xt_RESOURCE (XtNaccelerators, XtCAccelerators, XtRAcceleratorTable,
+	       XtTranslations, XtOffsetOf(TabsRec,core.accelerators),
+	       XtRString, accelTable),
+#undef	offset
+#undef  res
 };
-#undef	offset
-
 
 
 	/* constraint resources */
 
+static XtResource tabsConstraintResources[] = {
 #define	offset(field)	XtOffsetOf(TabsConstraintsRec, tabs.field)
-static XtResource tabsConstraintResources[] = {
-  {XtNtabLabel, XtCLabel, XtRString, sizeof(String),
-	offset(label), XtRString, NULL},
-  {XtNtabLeftBitmap, XtCLeftBitmap, XtRBitmap, sizeof(Pixmap),
-	offset(left_bitmap), XtRImmediate, None},
-  {XtNtabForeground, XtCForeground, XtRPixel, sizeof(Pixel),
-	offset(foreground), XtRString, (XtPointer) XtDefaultForeground},
-  {XtNresizable, XtCResizable, XtRBoolean, sizeof(Boolean),
-	offset(resizable), XtRImmediate, (XtPointer) True},
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+  Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
+  res (XtNtabLabel, XtCLabel, XtRString, String, label,  XtRString, NULL),
+  res (XtNtabLeftBitmap, XtCLeftBitmap, XtRBitmap, Pixmap, left_bitmap,
+       XtRImmediate, None),
+  res (XtNtabForeground, XtCForeground, XtRPixel, Pixel, foreground,
+       XtRString, XtDefaultForeground),
+  res (XtNresizable, XtCResizable, XtRBoolean, Boolean, resizable,
+       XtRImmediate, True),
+#undef	offset
+#undef	res
 } ;
-#undef	offset
 
 
 
@@ -318,10 +323,10 @@
 
 static	XtActionsRec	actionsList[] =
   {
-    {"select",	TabsSelect},
-    {"page",	TabsPage},
-    {"highlight", TabsHighlight},
-    {"unhighlight", TabsUnhighlight},
+    { (String) "select",	TabsSelect },
+    { (String) "page",		TabsPage },
+    { (String) "highlight",	TabsHighlight },
+    { (String) "unhighlight",	TabsUnhighlight },
   } ;
 
 
@@ -341,7 +346,7 @@
   {
 /* core_class fields      */
     /* superclass         */    (WidgetClass) SuperClass,
-    /* class_name         */    "Tabs",
+    /* class_name         */    (String) "Tabs",
     /* widget_size        */    sizeof(TabsRec),
     /* class_initialize   */    TabsClassInit,
     /* class_part_init    */	NULL,			/* TODO? */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lwlib/xt-wrappers.h	Sun Dec 28 14:55:02 2008 +0000
@@ -0,0 +1,103 @@
+/* Wrappers for Xt functions and macros
+
+   Copyright (C) 2008 Free Software Foundation
+
+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. */
+
+/* Original author: Stephen J. Turnbull for 21.5.29 */
+
+/* Generic utility macros, including coping with G++ whining.
+   Used in lwlib via lwlib.h and X consoles via console-x.h.
+
+   We would prefer to find another way to shut up G++.  The issue is that
+   recent versions of the C++ standard deprecate implicit conversions
+   across function boundaries like
+
+   typedef char *String;
+   void foo (String string);
+   foo ("bar");
+
+   because "bar" should be allowed to be a read-only array of chars.  But of
+   course lots of legacy code (== X11) declares things as char * and expects
+   to assign literal strings to them.  Now, the typedef in the example is
+   important because in G++ 4.3.2 at least, this
+
+   void foo (const String string);
+   foo ("bar");
+
+   does not work as expected!  G++ still warns about this construct.  However,
+   if foo is declared
+
+   void foo (const char *string);
+
+   G++ does not complain.  (#### There are two possibilities I can think of.
+   (a) G++ is buggy.  (b) "const String" is interpreted as "char * const".)
+
+   The upshot is that to avoid warnings with Xt's String typedef, we need to
+   arrange to cast literal strings to String, rather than use "const String"
+   in declarations.  (My <X11/Intrinsic.h> says that the actual internal
+   typedef used is _XtString, so that String can be #define'd to something
+   else for the purposes of C++.  But that doesn't really help us much.)
+
+   It's not very satisfactory to do it this way -- it would be much better to
+   have const Strings where they make sense -- but it does eliminate a few
+   hundred warnings from the C++ build.  And in any case we don't control the
+   many objects declared with String components in Intrinsic.h.  The remaining
+   issues are the WEXTTEXT macro used in src/emacs.c, and Emacs.ad.h (where
+   instead of String we use const char * in src/event-Xt.c in the array that
+   #includes it).
+*/
+
+#ifndef INCLUDED_xt_wrappers_h_
+#define INCLUDED_xt_wrappers_h_
+
+/* Wrap XtResource, with the same elements as arguments.
+   The cast to String shuts up G++ 4.3's whining about const char *.
+   The invocation of sizeof should be pretty safe, and the cast to XtPointer
+   surely is, since that's how that member of XtResource is declared.  It
+   doesn't hide potential problems, because XtPointer is a "generic" type in
+   any case -- the actual object will have a different type, that will be
+   cast to XtPointer. */
+
+#define Xt_RESOURCE(name,_class,intrepr,type,member,extrepr,value)	\
+  { (String) name, (String) _class, (String) intrepr, sizeof(type),	\
+    member, extrepr, (XtPointer) value }
+
+/* Wrap XtSetArg, with the same arguments.
+   The cast to String shuts up G++ 4.3's whining about const char *. */
+
+#define Xt_SET_ARG(al, resource, x) do {	\
+    XtSetArg ((al), (String) (resource), (x));	\
+  } while (0)
+
+/* Convenience macros for getting/setting one resource value. */
+
+#define Xt_SET_VALUE(widget, resource, value) do {	\
+  Arg al;						\
+  Xt_SET_ARG (al, resource, value);			\
+  XtSetValues (widget, &al, 1);				\
+} while (0)
+
+#define Xt_GET_VALUE(widget, resource, location) do {	\
+  Arg al;						\
+  Xt_SET_ARG (al, resource, location);			\
+  XtGetValues (widget, &al, 1);				\
+} while (0)
+
+#endif /* INCLUDED_xt_wrappers_h_ */
--- a/man/ChangeLog	Sun Dec 28 14:46:24 2008 +0000
+++ b/man/ChangeLog	Sun Dec 28 14:55:02 2008 +0000
@@ -1,3 +1,15 @@
+2008-10-04  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* xemacs-faq.texi (Q5.0.7): Fix broken instructions on use of
+	antialiased fonts.
+
+2008-08-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* xemacs-faq.texi (Q5.0.7): Add a section on how one can use
+	antialiased fonts under X11; thank you Giacomo Boffi. 
+	(Q1.0.3): Clarify pronunciation using a serious phonetic
+	alphabet. 
+
 2008-07-26  Ville Skyttä  <scop@xemacs.org>
 
 	* xemacs/custom.texi, xemacs/frame.texi, xemacs/mule.texi,
--- a/man/xemacs-faq.texi	Sun Dec 28 14:46:24 2008 +0000
+++ b/man/xemacs-faq.texi	Sun Dec 28 14:55:02 2008 +0000
@@ -433,6 +433,7 @@
 * Q5.0.4::    How can I have the window title area display the full path?
 * Q5.0.5::    @samp{xemacs -name junk} doesn't work?
 * Q5.0.6::    @samp{-iconic} doesn't work.
+* Q5.0.7::    How can I use antialiased fonts under X11?
 
 5.1: Microsoft Windows
 * Q5.1.1::    Does XEmacs rename all the @samp{win32-*} symbols to @samp{w32-*}?
@@ -715,7 +716,10 @@
 @node Q1.0.3, Q1.0.4, Q1.0.2, Introduction
 @unnumberedsubsec Q1.0.3: How do you pronounce XEmacs?
 
-The most common pronounciation is @samp{Eks eemax}.
+The most common pronounciation is @samp{Eks eemax}, @samp{Eks'im&ks} in
+Kirshenbaum IPA. (See
+@uref{http://www.kirshenbaum.net/IPA/ascii-ipa.pdf} if you know the IPA
+already and want to know how to map from Kirshenbaum to it.)
 
 @node Q1.0.4, Q1.0.5, Q1.0.3, Introduction
 @unnumberedsubsec Q1.0.4: What does XEmacs look like?
@@ -6113,6 +6117,7 @@
 * Q5.0.4::    How can I have the window title area display the full path?
 * Q5.0.5::    @samp{xemacs -name junk} doesn't work?
 * Q5.0.6::    @samp{-iconic} doesn't work.
+* Q5.0.7::    How can I use antialiased fonts under X11?
 
 5.1: Microsoft Windows
 * Q5.1.1::    Does XEmacs rename all the @samp{win32-*} symbols to @samp{w32-*}?
@@ -6261,7 +6266,7 @@
 (make-frame '((name . "the-name")))
 @end lisp
 
-@node Q5.0.6, Q5.1.1, Q5.0.5, External Subsystems
+@node Q5.0.6, Q5.0.7, Q5.0.5, External Subsystems
 @unnumberedsubsec Q5.0.6: @samp{-iconic} doesn't work.
 
 When I start up XEmacs using @samp{-iconic} it doesn't work right.
@@ -6276,9 +6281,60 @@
 bugs...
 @end quotation
 
+@node Q5.0.7, Q5.1.1, Q5.0.6, External Subsystems
+@unnumberedsubsec Q5.0.7: How can I use antialiased fonts under X11?
+
+The X11 version of XEmacs can use antialiased fonts via the Xft,
+fontconfig, and freetype libraries.  To configure this you need a recent
+beta version (at least 21.5.24); the more recent, the better.  This is
+beta software, the usual caveats apply.  Rebuild xemacs using the
+following configure options, plus any others you normally use:
+
+@samp{--enable-mule --with-xft=emacs,menubars}
+
+Xft @emph{may} work without Mule but the developers working on the Xft
+code invariably build with Mule.  The tab control also supports Xft, and
+at some date the progress gauge will as well.  If they are configured in
+to XEmacs, you may add @samp{tabs} and @samp{gauges} to the value of the
+@samp{--with-xft} option (with a comma separating each value from the
+previous ones).  For further details on the XEmacs widgets that support
+XFT, see the output of @code{./configure --help}.  If you use a package
+manager from your OS distribution, you may need to install development
+packages for @file{fontconfig} and @file{Xft}, and possibly for their
+prequisites.
+
+To specify a particular antialiased font, put something like the
+following lines in your @file{~/.Xdefaults} or @file{~/.Xresources}:
+
+@example
+    XEmacs.default.attributeFont: monospace-12
+       XEmacs.bold.attributeFont: monospace-12:style=Bold
+     XEmacs.italic.attributeFont: monospace-12:style=Oblique
+XEmacs.bold-italic.attributeFont: monospace-12:style=Bold Oblique
+   XEmacs.modeline.attributeFont: sans-serif-11
+          XEmacs.menubar.xftFont: sans-serif-11
+                  XEmacs*XftFont: sans-serif-11
+@end example
+
+@strong{Warning}: These resource naming conventions are just hacks to
+get the code running; you should expect them to change.  (Sorry about
+that, but this @emph{is} beta software!)
+
+Then run @code{xrdb -merge} before starting the new, XFT-enabled
+xemacs.  You can choose the available fonts from the list given by
+@code{fc-list}; try @code{xfd -fa FONTNAME-SIZE} to preview a given
+font.  Note that ``monospace'' and ``sans-serif'' are generic aliases
+defined by fontconfig which may correspond to any of many real fonts
+based on local configuration and availability of the aliased fonts,
+and so are likely to give good results in a well-set-up system.
+
+Although Customize does not yet handle fontconfig fontspecs, you can
+pass them as strings directly to @samp{set-face-font} to set fonts from
+Lisp.
+
 @unnumberedsec 5.1: Microsoft Windows
 
-@node Q5.1.1, Q5.1.2, Q5.0.6, External Subsystems
+@node Q5.1.1, Q5.1.2, Q5.0.7, External Subsystems
 @unnumberedsubsec Q5.1.1: Does XEmacs rename all the @samp{win32-*} symbols to @samp{w32-*}?
 
 In his flavor of Emacs 20, Richard Stallman has renamed all the @samp{win32-*}
--- a/src/ChangeLog	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/ChangeLog	Sun Dec 28 14:55:02 2008 +0000
@@ -12,6 +12,159 @@
 	Make the safe-chars and safe-charsets slots available in these
 	headers. 
 
+2008-12-22  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* symbols.c (Fdefine_function): 
+	* eval.c (define_function): 
+	Record explicitly that we're defining a function in the load
+	history, in both these files. 
+
+2008-12-22  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* faces.c (Fbuilt_in_face_specifiers): 
+	Document that we're returning a copy. 
+
+2008-12-21  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* faces.c (Fbuilt_in_face_specifiers): 
+	Don't simply warn the user not to modify
+	Vbuilt_in_face_specifiers, enforce this by returning a copy of the
+	list. 
+
+2008-11-02  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	G++ 4.3 complains a lot about implicit conversions of string
+	literals (const char *) to char *.  Shut it up.
+
+	* console-x.h:
+	* EmacsFrame.c:
+	* EmacsManager.c:
+	* EmacsShell-sub.c:
+	#include ../lwlib/xt-wrappers.h.
+	Cast class name to String.
+	Cast action names to String.
+	Rewrite resources to use Xt_RESOURCE.
+
+	* console-x.h:
+	Move Xt_SET_VALUE and Xt_GET_VALUE to ../lwlib/xt-wrappers.h.
+
+	* console-x.h (describe_XRectangle):
+	* input-method-xlib.c (describe_XRectangle):
+	* emacs.c (argmatch):
+	* emacs.c (check_compatible_window_system):
+	* emodules.c (Fload_module):
+	* emodules.c (Funload_module):
+	* event-stream.c (external_debugging_print_event):
+	* file-coding.h (struct subsidiary_type):
+	* file-coding.c (struct subsidiary_type):
+	* file-coding.c (setup_eol_coding_systems):
+	* file-coding.c (make_coding_system_1):
+	* file-coding.c (make_internal_coding_system):
+	* gif_io.c (GifErrorString:
+	* gif_io.c (GetGifError):
+	* input-method-xlib.c (XIM_init_frame):
+	* mule-coding.c (ccl_putprop):
+	* print.c (printing_major_badness):
+	* redisplay.c (generate_fstring_runes):
+	Declare String or char * argument or variable as const.
+
+	* EmacsFrame.c (EmacsFrameSetCharSize):
+	* EmacsShell-sub.c (update_size_hints_internal):
+	* EmacsShell-sub.c (SuperClassRootGeometryManager):
+	* device-x.c (emacs_options):
+	* device-x.c (compute_x_app_name):
+	* device-x.c (have_xemacs_resources_in_xrdb):
+	* device-x.c (x_init_device):
+	* event-Xt.c (x_fallback_resources):
+	* event-Xt.c (widgetActionsList):
+	* event-Xt.c (emacs_Xt_event_add_widget_actions):
+	* frame-x.c (x_wm_set_cell_size):
+	* frame-x.c (x_wm_set_variable_size):
+	* frame-x.c (x_set_frame_text_value):
+	* frame-x.c (x_initialize_frame_size):
+	* frame-x.c (x_create_widgets):
+	* frame-x.c (x_set_frame_icon):
+	* frame-x.c (x_set_frame_position):
+	* frame-x.c (x_update_frame_external_traits):
+	* glyphs-x.c (x_redisplay_widget):
+	* glyphs-x.c (update_tab_widget_face):
+	* glyphs-x.c (x_widget_instantiate):
+	* glyphs-x.c (x_button_instantiate):
+	* glyphs-x.c (x_progress_gauge_redisplay):
+	* glyphs-x.c (x_tab_control_redisplay):
+	* menubar-x.c (make_dummy_xbutton_event):
+	Use Xt_SET_ARG, Xt_SET_VALUE, and Xt_GET_VALUE instead of raw Xt
+	equivalents.
+	Declare String or char * argument or local variable as const.
+	Cast string literals to char* (or equivalent).
+
+	* input-method-xlib.c:
+	Use Xt_RESOURCE.
+
+2008-11-01  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* regex.c (re_search_2): Fix at_dot by changing charpos to bytepos.
+	From Julian Bradfield <18654.1143.304851.782755@krk.inf.ed.ac.uk>.
+
+2008-11-01  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* mule-ccl.c (ccl_driver): Fix off-by-one error.
+	By Julian Bradfield in <18691.16568.526264.972026@krk.inf.ed.ac.uk>.
+
+2008-10-25  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* lisp.h (static_pro): Cast out a warning.
+	g++ 4.3 complains about the conversion of const char to char.
+	These end up in a dynarray, so we would need to define a whole new
+	class of dynarray just to handle the const char stuff.
+
+2008-08-27  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* symbols.c (Fuser_variable_p): 
+	(map_varalias_chain): 
+	Use EQ() and !EQ(), don't compare two Lisp_Objects using == and
+	!=. Fixes the union build, thank you Robert Delius Royar. 
+
+2008-08-23  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* eval.c (Fuser_variable_p): Moved to symbols.c
+	* symbols.c (Fcustom_variable_p): Moved here from custom.el. 
+	(user_variable_alias_check_fun): Mapper function used in
+	`user-variable-p'. 
+	(Fuser_variable_p): Moved here from eval.c, to allow it to examine
+	the variable alias chain. Expanded to check each entry in the
+	variable alias chain for signs of being a user variable;
+	documentation updated, noting the differences between GNU's
+	behaviour and ours (ours is a little more sensible)
+	(map_varalias_chain): New.
+	Given a C function, call it at least once for each symbol in a
+	symbol's varalias chain, signalling an error if there's a cycle,
+	and returning immediately if the function returns something other
+	than Qzero. 
+	(Fdefvaralias): Correct the use of the word "alias" in the
+	docstring and in the argument name. Motivate this in a
+	comment. Add support for a DOCSTRING argument, something GNU has
+	too, and document this
+	* gc.c (vars_of_gc): Start the docstring of
+	`garbage-collection-messages' with an asterisk, to indicate that
+	it's a user variable. 
+
+2008-08-09  Aidan Kehoe  <kehoea@parhasard.net>
+
+	Integrate Romain Francoise' 2005-09-14 (pre-GPLV3) GNU change,
+	which can allow much better performace with some stupid
+	filesystems:
+	* fileio.c (write_region_inhibit_fsync): New variable.
+	(Fwrite_region): Use it to skip call to fsync.
+	(syms_of_fileio): Initialize it.
+
+2008-08-10  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* objects-xlike-inc.c (charset_table): Remove the entry for
+	Vcharset_arabic_iso8859_7, thank you Robert Delius Royar.
+
+=======
+>>>>>>> other
 2008-08-05  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* mule-charset.c (complex_vars_of_mule_charset): 
@@ -19,6 +172,11 @@
 	* lisp.h: Remove Vcharset_arabic_iso8859_7.
 	See commentary in lisp/mule/iso-with-esc.el for motivation. 
 
+2008-08-03  Mats Lidell  <matsl@xemacs.org>
+
+	* config.h.in: Renamed USE_XFT_GAUGE to USE_XFT_GAUGES in sync
+	with configure.ac.
+
 2008-07-20  John Paul Wallington  <jpw@pobox.com>
 
 	* nt.c (Fmswindows_short_file_name, Fmswindows_long_file_name):
--- a/src/EmacsFrame.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/EmacsFrame.c	Sun Dec 28 14:55:02 2008 +0000
@@ -43,6 +43,7 @@
 #include "EmacsFrameP.h"
 #include "EmacsManager.h"	/* for EmacsManagerChangeSize */
 #include "xmu.h"
+#include "../lwlib/xt-wrappers.h"
 
 static void EmacsFrameClassInitialize (void);
 static void EmacsFrameInitialize (Widget, Widget, ArgList, Cardinal *);
@@ -60,117 +61,83 @@
 #define XtOffset(p_type,field) \
 	((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0)))
 #define offset(field) XtOffset (EmacsFrame, emacs_frame.field)
-
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+  Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
 static XtResource resources[] = {
-  { XtNgeometry, XtCGeometry,
-    XtRString, sizeof (String),
-    offset (geometry), XtRString, (XtPointer) 0 },
-  { XtNiconic, XtCIconic,
-    XtRBoolean, sizeof (Boolean),
-    offset (iconic), XtRImmediate, (XtPointer) False },
+  res (XtNgeometry, XtCGeometry, XtRString, String, geometry, XtRString, 0),
+  res (XtNiconic, XtCIconic, XtRBoolean, Boolean, iconic, XtRImmediate, False),
 
-  { XtNemacsFrame, XtCEmacsFrame,
-    XtRPointer, sizeof (XtPointer),
-    offset (frame), XtRImmediate, 0 },
-  { XtNmenubar, XtCMenubar,
-    XtRBoolean, sizeof (Boolean),
-    offset (menubar_p), XtRImmediate, (XtPointer) True },
-  { XtNinitiallyUnmapped, XtCInitiallyUnmapped,
-    XtRBoolean, sizeof (Boolean),
-    offset (initially_unmapped), XtRImmediate, (XtPointer) False },
-  { XtNminibuffer, XtCMinibuffer,
-    XtRBoolean, sizeof (Boolean),
-    offset (minibuffer), XtRImmediate, (XtPointer) True },
-  { XtNunsplittable, XtCUnsplittable,
-    XtRBoolean, sizeof (Boolean),
-    offset (unsplittable), XtRImmediate, (XtPointer) False },
-  { XtNinternalBorderWidth, XtCInternalBorderWidth,
-    XtRInt, sizeof (int),
-    offset (internal_border_width), XtRImmediate, (XtPointer)4 },
+  res (XtNemacsFrame, XtCEmacsFrame, XtRPointer, XtPointer,
+       frame, XtRImmediate, 0),
+  res (XtNmenubar, XtCMenubar, XtRBoolean, Boolean,
+       menubar_p, XtRImmediate, True),
+  res (XtNinitiallyUnmapped, XtCInitiallyUnmapped, XtRBoolean, Boolean,
+       initially_unmapped, XtRImmediate, False),
+  res (XtNminibuffer, XtCMinibuffer, XtRBoolean, Boolean,
+       minibuffer, XtRImmediate, True),
+  res (XtNunsplittable, XtCUnsplittable, XtRBoolean, Boolean,
+       unsplittable, XtRImmediate, False),
+  res (XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, int,
+       internal_border_width, XtRImmediate, 4),
 #ifdef HAVE_SCROLLBARS
-  { XtNscrollBarWidth, XtCScrollBarWidth,
-    XtRInt, sizeof (int),
-    offset (scrollbar_width), XtRImmediate, (XtPointer)-1 },
-  { XtNscrollBarHeight, XtCScrollBarHeight,
-    XtRInt, sizeof (int),
-    offset (scrollbar_height), XtRImmediate, (XtPointer)-1 },
-  { XtNscrollBarPlacement, XtCScrollBarPlacement,
-    XtRScrollBarPlacement, sizeof (unsigned char),
-    offset (scrollbar_placement), XtRImmediate,
+  res (XtNscrollBarWidth, XtCScrollBarWidth, XtRInt, int,
+       scrollbar_width, XtRImmediate, -1),
+  res (XtNscrollBarHeight, XtCScrollBarHeight, XtRInt, int,
+       scrollbar_height, XtRImmediate, -1),
+  res (XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement,
+       unsigned char, scrollbar_placement, XtRImmediate,
 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
     defined (LWLIB_SCROLLBARS_ATHENA3D)
-    (XtPointer) XtBOTTOM_RIGHT
+	       XtBOTTOM_RIGHT
 #else
-    (XtPointer) XtBOTTOM_LEFT
+	       XtBOTTOM_LEFT
 #endif
-  },
+	       ),
 #endif /* HAVE_SCROLLBARS */
 
 #ifdef HAVE_TOOLBARS
-  { XtNtopToolBarHeight, XtCTopToolBarHeight,
-    XtRInt, sizeof (int),
-    offset (top_toolbar_height), XtRImmediate, (XtPointer)-1 },
-  { XtNbottomToolBarHeight, XtCBottomToolBarHeight,
-    XtRInt, sizeof (int),
-    offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1 },
-  { XtNleftToolBarWidth, XtCLeftToolBarWidth,
-    XtRInt, sizeof (int),
-    offset (left_toolbar_width), XtRImmediate, (XtPointer)-1 },
-  { XtNrightToolBarWidth, XtCRightToolBarWidth,
-    XtRInt, sizeof (int),
-    offset (right_toolbar_width), XtRImmediate, (XtPointer)-1 },
-  { XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth,
-    XtRInt, sizeof (int),
-    offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
-  { XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth,
-    XtRInt, sizeof (int),
-    offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
-  { XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth,
-    XtRInt, sizeof (int),
-    offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
-  { XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth,
-    XtRInt, sizeof (int),
-    offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
-  { XtNtoolBarShadowThickness, XtCToolBarShadowThickness,
-    XtRDimension, sizeof (Dimension),
-    offset (toolbar_shadow_thickness), XtRImmediate, (XtPointer)2 },
+  res (XtNtopToolBarHeight, XtCTopToolBarHeight, XtRInt, int,
+       top_toolbar_height, XtRImmediate, -1),
+  res (XtNbottomToolBarHeight, XtCBottomToolBarHeight, XtRInt, int,
+       bottom_toolbar_height, XtRImmediate, -1),
+  res (XtNleftToolBarWidth, XtCLeftToolBarWidth, XtRInt, int,
+       left_toolbar_width, XtRImmediate, -1),
+  res (XtNrightToolBarWidth, XtCRightToolBarWidth, XtRInt, int,
+       right_toolbar_width, XtRImmediate, -1),
+  res (XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, XtRInt, int,
+       top_toolbar_border_width, XtRImmediate, -1),
+  res (XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, XtRInt, int,
+       bottom_toolbar_border_width, XtRImmediate, -1),
+  res (XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, XtRInt,
+       int, left_toolbar_border_width, XtRImmediate, -1),
+  res (XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, XtRInt,
+       int, right_toolbar_border_width, XtRImmediate, -1),
+  res (XtNtoolBarShadowThickness, XtCToolBarShadowThickness, XtRDimension,
+       Dimension, toolbar_shadow_thickness, XtRImmediate, 2),
 #endif /* HAVE_TOOLBARS */
 
-  { XtNinterline, XtCInterline,
-    XtRInt, sizeof (int),
-    offset (interline), XtRImmediate, (XtPointer)0 },
-  {
-    XtNfont, XtCFont,
-    XtRFontStruct, sizeof (XFontStruct *),
-    offset(font), XtRImmediate, (XtPointer)0
-  },
-  { XtNforeground, XtCForeground,
-    XtRPixel, sizeof (Pixel),
-    offset(foreground_pixel), XtRString, (XtPointer) "Black" },
-  { XtNbackground, XtCBackground,
-    XtRPixel, sizeof (Pixel),
-    offset(background_pixel), XtRString, (XtPointer) "Gray80" },
-  { XtNcursorColor, XtCForeground,
-    XtRPixel, sizeof (Pixel),
-    offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground" },
-  { XtNbarCursor, XtCBarCursor,
-    XtRBoolean, sizeof (Boolean),
-    offset (bar_cursor), XtRImmediate, (XtPointer)0 },
-  { XtNvisualBell, XtCVisualBell,
-    XtRBoolean, sizeof (Boolean),
-    offset (visual_bell), XtRImmediate, (XtPointer)0 },
-  { XtNbellVolume, XtCBellVolume,
-    XtRInt, sizeof (int),
-    offset (bell_volume), XtRImmediate, (XtPointer)0 },
-  { XtNuseBackingStore, XtCUseBackingStore,
-    XtRBoolean, sizeof (Boolean),
-    offset (use_backing_store), XtRImmediate, (XtPointer)0 },
-  { XtNpreferredWidth, XtCPreferredWidth,
-    XtRDimension, sizeof (Dimension),
-    offset (preferred_width), XtRImmediate, (XtPointer)0 },
-  { XtNpreferredHeight, XtCPreferredHeight,
-    XtRDimension, sizeof (Dimension),
-    offset (preferred_height), XtRImmediate, (XtPointer)0 },
+  res (XtNinterline, XtCInterline, XtRInt, int,
+       interline, XtRImmediate, 0),
+  res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *,
+       font, XtRImmediate, 0),
+  res (XtNforeground, XtCForeground, XtRPixel, Pixel,
+       foreground_pixel, XtRString, "Black"),
+  res (XtNbackground, XtCBackground, XtRPixel, Pixel,
+       background_pixel, XtRString, "Gray80"),
+  res (XtNcursorColor, XtCForeground, XtRPixel, Pixel,
+       cursor_color, XtRString, "XtDefaultForeground"),
+  res (XtNbarCursor, XtCBarCursor, XtRBoolean, Boolean,
+       bar_cursor, XtRImmediate, 0),
+  res (XtNvisualBell, XtCVisualBell, XtRBoolean, Boolean,
+       visual_bell, XtRImmediate, 0),
+  res (XtNbellVolume, XtCBellVolume, XtRInt, int,
+       bell_volume, XtRImmediate, 0),
+  res (XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, Boolean,
+       use_backing_store, XtRImmediate, 0),
+  res (XtNpreferredWidth, XtCPreferredWidth, XtRDimension, Dimension,
+       preferred_width, XtRImmediate, 0),
+  res (XtNpreferredHeight, XtCPreferredHeight, XtRDimension, Dimension,
+       preferred_height, XtRImmediate, 0),
 };
 
 #undef offset
@@ -181,7 +148,7 @@
 
 static XtActionsRec
 emacsFrameActionsTable [] = {
-  {"mapping",  (XtActionProc) emacs_Xt_mapping_action},
+  { (String) "mapping",  (XtActionProc) emacs_Xt_mapping_action},
 };
 
 static char
@@ -200,7 +167,7 @@
 #else
     /* superclass		*/	&widgetClassRec,
 #endif
-    /* class_name		*/	"EmacsFrame",
+    /* class_name		*/	(String) "EmacsFrame",
     /* widget_size		*/	sizeof (EmacsFrameRec),
     /* class_initialize		*/	EmacsFrameClassInitialize,
     /* class_part_initialize	*/	0,
@@ -653,8 +620,8 @@
 
   {
     Arg al [2];
-    XtSetArg (al [0], XtNwidth,  pixel_width);
-    XtSetArg (al [1], XtNheight, pixel_height);
+    Xt_SET_ARG (al [0], XtNwidth,  pixel_width);
+    Xt_SET_ARG (al [1], XtNheight, pixel_height);
     XtSetValues ((Widget) ew, al, countof (al));
   }
 }
--- a/src/EmacsManager.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/EmacsManager.c	Sun Dec 28 14:55:02 2008 +0000
@@ -32,6 +32,7 @@
 #include <Xm/RowColumn.h>
 #endif /* LWLIB_MENUBARS_MOTIF */
 #include "compiler.h"
+#include "../lwlib/xt-wrappers.h"
 
 /* For I, Emacs, am a kind god.  Unlike the goddess Athena and the
    Titan Motif, I require no ritual sacrifices to placate the lesser
@@ -39,15 +40,14 @@
 
 static XtResource resources[] = {
 #define offset(field) XtOffset(EmacsManagerWidget, emacs_manager.field)
-  { XtNresizeCallback, XtCCallback,
-    XtRCallback, sizeof (XtCallbackList),
-    offset(resize_callback), XtRImmediate, (XtPointer) 0 },
-  { XtNqueryGeometryCallback, XtCCallback,
-    XtRCallback, sizeof (XtCallbackList),
-    offset(query_geometry_callback), XtRImmediate, (XtPointer) 0 },
-  { XtNuserData, XtCUserData,
-    XtRPointer, sizeof (XtPointer),
-    offset(user_data), XtRImmediate, (XtPointer) 0 },
+#define res(name,_class,intrepr,size,member,extrepr,value) \
+  Xt_RESOURCE (name, _class, intrepr, size, offset(member), extrepr, value)
+  res (XtNresizeCallback, XtCCallback, XtRCallback, XtCallbackList,
+       resize_callback, XtRImmediate, 0),
+  res (XtNqueryGeometryCallback, XtCCallback, XtRCallback, XtCallbackList,
+       query_geometry_callback, XtRImmediate, 0),
+  res (XtNuserData, XtCUserData, XtRPointer, XtPointer,
+       user_data, XtRImmediate, 0),
 };
 
 /****************************************************************
@@ -75,7 +75,7 @@
 #else
     /* superclass         */    (WidgetClass) &compositeClassRec,
 #endif
-    /* class_name         */    "EmacsManager",
+    /* class_name         */    (String) "EmacsManager",
     /* widget_size        */    sizeof (EmacsManagerRec),
     /* class_initialize   */    ClassInitialize,
     /* class_part_init    */	NULL,
--- a/src/EmacsShell-sub.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/EmacsShell-sub.c	Sun Dec 28 14:55:02 2008 +0000
@@ -89,6 +89,7 @@
 #include <X11/Vendor.h>
 #include <X11/VendorP.h>
 #include "EmacsShellP.h"
+#include "../lwlib/xt-wrappers.h"
 
 #define ABORT abort
 
@@ -134,30 +135,28 @@
 static XtResource resources[] = {
 #define offset(field) XtOffset(EMACS_SHELL_WIDGET, emacs_shell.field)
 #define coreoffset(field) XtOffset(EMACS_SHELL_WIDGET, core.field)
+#define res(name,_class,member,size)				\
+  { (String) name, (String) _class, XtRInt, sizeof (int),	\
+    offset (member), XtRImmediate, (XtPointer)0 }
+#define motifres(name,member)					\
+  { (String) name, XtCPosition, XtRPosition, sizeof (Position),	\
+    coreoffset (member), XtRImmediate, (XtPointer)BIGSIZE }
 #ifdef LWLIB_USES_MOTIF
   /* *** BOGOSITY^10! *** The Motif VendorShell fucks around with
      the default values for X and Y, for no obvious reason.  This
      causes Shell to indicate that the defaults of (0,0) were
      program-specified, instead of letting the WM do what it wants. */
-  { XtNx, XtCPosition,
-    XtRPosition, sizeof (Position),
-    coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE },
-  { XtNy, XtCPosition,
-    XtRPosition, sizeof (Position),
-    coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE },
+  motifres (XtNx, x),
+  motifres (XtNy, y),
 #endif
-  { XtNwidthCells, XtCWidthCells,
-    XtRInt, sizeof (int),
-    offset (width_cells), XtRImmediate, (XtPointer)0 },
-  { XtNheightCells, XtCHeightCells,
-    XtRInt, sizeof (int),
-    offset (height_cells), XtRImmediate, (XtPointer)0 },
-  { XtNminWidthCells, XtCMinWidthCells,
-    XtRInt, sizeof (int),
-    offset (min_width_cells), XtRImmediate, (XtPointer)0 },
-  { XtNminHeightCells, XtCMinHeightCells,
-    XtRInt, sizeof (int),
-    offset (min_height_cells), XtRImmediate, (XtPointer)0 },
+  res (XtNwidthCells, XtCWidthCells, width_cells, 0),
+  res (XtNheightCells, XtCHeightCells, height_cells, 0),
+  res (XtNminWidthCells, XtCMinWidthCells, min_width_cells, 0),
+  res (XtNminHeightCells, XtCMinHeightCells, min_height_cells, 0),
+#undef offset
+#undef coreoffset
+#undef res
+#undef motifres
 };
 
 static CompositeClassExtensionRec compositeClassExtRec = {
@@ -259,12 +258,12 @@
   printf ("  base size set to: %d %d\n", base_width, base_height);
   fflush (stdout);
 #endif
-  XtSetArg(al [0], XtNbaseWidth, base_width);
-  XtSetArg(al [1], XtNbaseHeight, base_height);
-  XtSetArg(al [2], XtNminWidth, base_width +
-	   cell_width * w->emacs_shell.min_width_cells);
-  XtSetArg(al [3], XtNminHeight, base_height +
-	   cell_height * w->emacs_shell.min_height_cells);
+  Xt_SET_ARG(al [0], XtNbaseWidth, base_width);
+  Xt_SET_ARG(al [1], XtNbaseHeight, base_height);
+  Xt_SET_ARG(al [2], XtNminWidth, base_width +
+	     cell_width * w->emacs_shell.min_width_cells);
+  Xt_SET_ARG(al [3], XtNminHeight, base_height +
+	     cell_height * w->emacs_shell.min_height_cells);
   XtSetValues ((Widget) w, al, 4);
 }
 
--- a/src/config.h.in	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/config.h.in	Sun Dec 28 14:55:02 2008 +0000
@@ -225,7 +225,7 @@
 /* Per-widget stuff will go away? */
 #undef USE_XFT_MENUBARS
 #undef USE_XFT_TABS
-#undef USE_XFT_GAUGE
+#undef USE_XFT_GAUGES
 
 /* Defines for building X applications */
 #ifdef HAVE_X_WINDOWS
--- a/src/console-x.h	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/console-x.h	Sun Dec 28 14:55:02 2008 +0000
@@ -66,18 +66,6 @@
 # define XPointer char *
 #endif
 
-#define Xt_SET_VALUE(widget, resource, value) do {	\
-  Arg al;						\
-  XtSetArg (al, resource, value);			\
-  XtSetValues (widget, &al, 1);				\
-} while (0)
-
-#define Xt_GET_VALUE(widget, resource, location) do {	\
-  Arg al;						\
-  XtSetArg (al, resource, location);			\
-  XtGetValues (widget, &al, 1);				\
-} while (0)
-
 #ifdef __cplusplus
 #define X_CLASSFIELD c_class
 #else
@@ -212,7 +200,7 @@
 void describe_XIMStyles	 (XIMStyles *styles);
 void describe_XIC	 (XIC ic);
 void describe_event_mask (unsigned long mask);
-void describe_XRectangle (char *name, XRectangle *rect);
+void describe_XRectangle (const char *name, XRectangle *rect);
 void describe_Status	 (Status status);
 #endif /* DEBUG_XEMACS */
 #endif /* XIM_XLIB */
--- a/src/device-x.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/device-x.c	Sun Dec 28 14:55:02 2008 +0000
@@ -79,29 +79,33 @@
 
 Lisp_Object Vx_initial_argv_list; /* #### ugh! */
 
+/* Shut up G++ 4.3. */
+#define Xrm_ODR(option,resource,type,default) \
+  { (String) option, (String) resource, type, default }
+
 static XrmOptionDescRec emacs_options[] =
 {
-  {"-geometry", ".geometry", XrmoptionSepArg, NULL},
-  {"-iconic", ".iconic", XrmoptionNoArg, "yes"},
+  Xrm_ODR ("-geometry", ".geometry", XrmoptionSepArg, NULL),
+  Xrm_ODR ("-iconic", ".iconic", XrmoptionNoArg, (String) "yes"),
 
-  {"-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
-  {"-ib",                    "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
-  {"-scrollbar-width",       "*EmacsFrame.scrollBarWidth",      XrmoptionSepArg, NULL},
-  {"-scrollbar-height",      "*EmacsFrame.scrollBarHeight",     XrmoptionSepArg, NULL},
+  Xrm_ODR ("-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL),
+  Xrm_ODR ("-ib",                    "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL),
+  Xrm_ODR ("-scrollbar-width",       "*EmacsFrame.scrollBarWidth",      XrmoptionSepArg, NULL),
+  Xrm_ODR ("-scrollbar-height",      "*EmacsFrame.scrollBarHeight",     XrmoptionSepArg, NULL),
 
-  {"-privatecolormap", ".privateColormap", XrmoptionNoArg,  "yes"},
-  {"-visual",   ".EmacsVisual",	    XrmoptionSepArg, NULL},
+  Xrm_ODR ("-privatecolormap", ".privateColormap", XrmoptionNoArg,  (String) "yes"),
+  Xrm_ODR ("-visual",   ".EmacsVisual",	    XrmoptionSepArg, NULL),
 
   /* #### Beware!  If the type of the shell changes, update this. */
-  {"-T",        "*TopLevelEmacsShell.title",    XrmoptionSepArg, NULL},
-  {"-wn",       "*TopLevelEmacsShell.title",    XrmoptionSepArg, NULL},
-  {"-title",    "*TopLevelEmacsShell.title",    XrmoptionSepArg, NULL},
+  Xrm_ODR ("-T",        "*TopLevelEmacsShell.title",    XrmoptionSepArg, NULL),
+  Xrm_ODR ("-wn",       "*TopLevelEmacsShell.title",    XrmoptionSepArg, NULL),
+  Xrm_ODR ("-title",    "*TopLevelEmacsShell.title",    XrmoptionSepArg, NULL),
 
-  {"-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL},
-  {"-in",       "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL},
-  {"-mc",       "*pointerColor",                XrmoptionSepArg, NULL},
-  {"-cr",       "*cursorColor",                 XrmoptionSepArg, NULL},
-  {"-fontset",  "*FontSet",                     XrmoptionSepArg, NULL},
+  Xrm_ODR ("-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL),
+  Xrm_ODR ("-in",       "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL),
+  Xrm_ODR ("-mc",       "*pointerColor",                XrmoptionSepArg, NULL),
+  Xrm_ODR ("-cr",       "*cursorColor",                 XrmoptionSepArg, NULL),
+  Xrm_ODR ("-fontset",  "*FontSet",                     XrmoptionSepArg, NULL),
 };
 
 static const struct memory_description x_device_data_description_1 [] = {
@@ -329,7 +333,7 @@
   if (argc > 0 && argv[0] && *argv[0])
     return (ptr = strrchr (argv[0], '/')) ? ++ptr : argv[0];
 
-  return "xemacs";
+  return (Extbyte *) "xemacs";	/* shut up g++ 4.3 */
 }
 
 /*
@@ -343,7 +347,7 @@
 static int
 have_xemacs_resources_in_xrdb (Display *dpy)
 {
-  char *xdefs, *key;
+  const char *xdefs, *key;
   int len;
 
 #ifdef INFODOCK
@@ -688,9 +692,9 @@
        does not override resources defined elsewhere */
     const Extbyte *data_dir;
     Extbyte *path;
-    Extbyte *format;
+    const Extbyte *format;
     XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */
-    Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
+    const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
     Extbyte *locale_end;
 
     if (STRINGP (Vx_app_defaults_directory) &&
@@ -739,7 +743,11 @@
     }
 
   no_data_directory:
-    xfree (locale, Extbyte*);
+    {
+      /* Cast off const for G++ 4.3. */
+      Extbyte *temp = (Extbyte *) locale;
+      xfree (temp, Extbyte*);
+    }
  }
 #endif /* MULE */
 
@@ -861,9 +869,9 @@
      be the place.  Make sure it doesn't conflict with GNOME. */
   {
     Arg al[3];
-    XtSetArg (al[0], XtNvisual,   visual);
-    XtSetArg (al[1], XtNdepth,    depth);
-    XtSetArg (al[2], XtNcolormap, cmap);
+    Xt_SET_ARG (al[0], XtNvisual,   visual);
+    Xt_SET_ARG (al[1], XtNdepth,    depth);
+    Xt_SET_ARG (al[2], XtNcolormap, cmap);
 
     app_shell = XtAppCreateShell (NULL, app_class,
 				  applicationShellWidgetClass,
@@ -880,11 +888,13 @@
      and set it to the size of the root window for child placement purposes */
   {
     Arg al[5];
-    XtSetArg (al[0], XtNmappedWhenManaged, False);
-    XtSetArg (al[1], XtNx, 0);
-    XtSetArg (al[2], XtNy, 0);
-    XtSetArg (al[3], XtNwidth,  WidthOfScreen  (ScreenOfDisplay (dpy, screen)));
-    XtSetArg (al[4], XtNheight, HeightOfScreen (ScreenOfDisplay (dpy, screen)));
+    Xt_SET_ARG (al[0], XtNmappedWhenManaged, False);
+    Xt_SET_ARG (al[1], XtNx, 0);
+    Xt_SET_ARG (al[2], XtNy, 0);
+    Xt_SET_ARG (al[3], XtNwidth,
+		WidthOfScreen  (ScreenOfDisplay (dpy, screen)));
+    Xt_SET_ARG (al[4], XtNheight,
+		HeightOfScreen (ScreenOfDisplay (dpy, screen)));
     XtSetValues (app_shell, al, countof (al));
     XtRealizeWidget (app_shell);
   }
--- a/src/emacs.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/emacs.c	Sun Dec 28 14:55:02 2008 +0000
@@ -806,7 +806,7 @@
    enough information to do it right.  */
 
 static int
-argmatch (Wexttext **argv, int argc, Ascbyte *sstr, Ascbyte *lstr,
+argmatch (Wexttext **argv, int argc, const Ascbyte *sstr, const Ascbyte *lstr,
 	  int minlen, Wexttext **valptr, int *skipptr)
 {
   Wexttext *p = NULL;
@@ -862,7 +862,7 @@
 }
 
 static void
-check_compatible_window_system (Ascbyte *must)
+check_compatible_window_system (const Ascbyte *must)
 {
   if (display_use && strcmp (display_use, must))
     fatal ("Incompatible window system type `%s': `%s' already specified",
--- a/src/emodules.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/emodules.c	Sun Dec 28 14:55:02 2008 +0000
@@ -96,7 +96,7 @@
 */
        (file, name, version))
 {
-  CIbyte *mod, *mname, *mver;
+  const CIbyte *mod, *mname, *mver;
   int speccount = specpdl_depth();
 
   CHECK_STRING(file);
@@ -136,7 +136,7 @@
        (file, name, version))
 {
   int x;
-  CIbyte *mod, *mname, *mver;
+  const CIbyte *mod, *mname, *mver;
   Lisp_Object foundname = Qnil;
   struct gcpro gcpro1;
 
--- a/src/eval.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/eval.c	Sun Dec 28 14:55:02 2008 +0000
@@ -1223,7 +1223,7 @@
 define_function (Lisp_Object name, Lisp_Object defn)
 {
   Ffset (name, defn);
-  LOADHIST_ATTACH (name);
+  LOADHIST_ATTACH (Fcons (Qdefun, name));
   return name;
 }
 
@@ -1356,29 +1356,8 @@
   return sym;
 }
 
-DEFUN ("user-variable-p", Fuser_variable_p, 1, 1, 0, /*
-Return t if VARIABLE is intended to be set and modified by users.
-\(The alternative is a variable used internally in a Lisp program.)
-Determined by whether the first character of the documentation
-for the variable is `*'.
-*/
-       (variable))
-{
-  Lisp_Object documentation = Fget (variable, Qvariable_documentation, Qnil);
-
-  return
-    ((INTP (documentation) && XINT (documentation) < 0) ||
-
-     (STRINGP (documentation) &&
-      (string_byte (documentation, 0) == '*')) ||
-
-     /* If (STRING . INTEGER), a negative integer means a user variable. */
-     (CONSP (documentation)
-      && STRINGP (XCAR (documentation))
-      && INTP (XCDR (documentation))
-      && XINT (XCDR (documentation)) < 0)) ?
-    Qt : Qnil;
-}
+/* XEmacs: user-variable-p is in symbols.c, since it needs to mess around
+   with the symbol variable aliases. */
 
 DEFUN ("macroexpand-internal", Fmacroexpand_internal, 1, 2, 0, /*
 Return result of expanding macros at top level of FORM.
@@ -6582,7 +6561,6 @@
   DEFSUBR (Fdefmacro);
   DEFSUBR (Fdefvar);
   DEFSUBR (Fdefconst);
-  DEFSUBR (Fuser_variable_p);
   DEFSUBR (Flet);
   DEFSUBR (FletX);
   DEFSUBR (Fwhile);
--- a/src/event-Xt.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/event-Xt.c	Sun Dec 28 14:55:02 2008 +0000
@@ -109,7 +109,9 @@
 extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask;
 extern SELECT_TYPE process_only_mask, tty_only_mask;
 
-static const String x_fallback_resources[] =
+/* #### This should be String, but G++ 4.3 doesn't apply the const
+   specifier the same way for String (typedef'd to char*) and char*. */
+static const char * x_fallback_resources[] =
 {
   /* This file is automatically generated from the app-defaults file
      in ../etc/Emacs.ad.  These resources are consulted only if no
@@ -3126,8 +3128,8 @@
 
 static XtActionsRec widgetActionsList[] =
 {
-  {"widget-focus-in",	emacs_Xt_event_widget_focus_in	},
-  {"widget-focus-out",	emacs_Xt_event_widget_focus_out	},
+  { (String) "widget-focus-in",  emacs_Xt_event_widget_focus_in	 },
+  { (String) "widget-focus-out", emacs_Xt_event_widget_focus_out },
 };
 
 static void
--- a/src/event-stream.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/event-stream.c	Sun Dec 28 14:55:02 2008 +0000
@@ -255,7 +255,7 @@
 Fixnum debug_emacs_events;
 
 static void
-external_debugging_print_event (char *event_description, Lisp_Object event)
+external_debugging_print_event (const char *event_description, Lisp_Object event)
 {
   write_c_string (Qexternal_debugging_output, "(");
   write_c_string (Qexternal_debugging_output, event_description);
--- a/src/faces.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/faces.c	Sun Dec 28 14:55:02 2008 +0000
@@ -703,11 +703,13 @@
 
 DEFUN ("built-in-face-specifiers", Fbuilt_in_face_specifiers, 0, 0, 0, /*
 Return a list of all built-in face specifier properties.
-Don't modify this list!
+
+This is a copy; there is no way to modify XEmacs' idea of the built-in face
+specifier properties from Lisp.
 */
        ())
 {
-  return Vbuilt_in_face_specifiers;
+  return Fcopy_list(Vbuilt_in_face_specifiers);
 }
 
 /* These values are retrieved so often that we make a special
--- a/src/file-coding.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/file-coding.c	Sun Dec 28 14:55:02 2008 +0000
@@ -897,8 +897,8 @@
 
 struct subsidiary_type
 {
-  Ascbyte *extension;
-  Ascbyte *mnemonic_ext;
+  const Ascbyte *extension;
+  const Ascbyte *mnemonic_ext;
   enum eol_type eol;
 };
 
@@ -944,8 +944,8 @@
   
   for (i = 0; i < countof (coding_subsidiary_list); i++)
     {
-      Ascbyte *extension = coding_subsidiary_list[i].extension;
-      Ascbyte *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext;
+      const Ascbyte *extension = coding_subsidiary_list[i].extension;
+      const Ascbyte *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext;
       enum eol_type eol = coding_subsidiary_list[i].eol;
 
       qxestrcpy_ascii (codesys_name + len, extension);
@@ -1021,7 +1021,7 @@
    */
 
 static Lisp_Object
-make_coding_system_1 (Lisp_Object name_or_existing, Ascbyte *prefix,
+make_coding_system_1 (Lisp_Object name_or_existing, const Ascbyte *prefix,
 		      Lisp_Object type, Lisp_Object description,
 		      Lisp_Object props)
 {
@@ -1192,7 +1192,7 @@
 }
 
 Lisp_Object
-make_internal_coding_system (Lisp_Object existing, Ascbyte *prefix,
+make_internal_coding_system (Lisp_Object existing, const Ascbyte *prefix,
 			     Lisp_Object type, Lisp_Object description,
 			     Lisp_Object props)
 {
--- a/src/file-coding.h	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/file-coding.h	Sun Dec 28 14:55:02 2008 +0000
@@ -1052,7 +1052,7 @@
 Ichar decode_big5_char (int o1, int o2);
 void add_entry_to_coding_system_type_list (struct coding_system_methods *m);
 Lisp_Object make_internal_coding_system (Lisp_Object existing,
-					 Ascbyte *prefix,
+					 const Ascbyte *prefix,
 					 Lisp_Object type,
 					 Lisp_Object description,
 					 Lisp_Object props);
--- a/src/fileio.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/fileio.c	Sun Dec 28 14:55:02 2008 +0000
@@ -111,6 +111,11 @@
 
 Lisp_Object Vdirectory_sep_char;
 
+#ifdef HAVE_FSYNC
+/* Nonzero means skip the call to fsync in Fwrite-region.  */
+int write_region_inhibit_fsync;
+#endif
+
 /* These variables describe handlers that have "already" had a chance
    to handle the current operation.
 
@@ -3568,7 +3573,7 @@
        Disk full in NFS may be reported here.  */
     /* mib says that closing the file will try to write as fast as NFS can do
        it, and that means the fsync here is not crucial for autosave files.  */
-    if (!auto_saving && fsync (desc) < 0
+    if (!auto_saving && !write_region_inhibit_fsync && fsync (desc) < 0
 	/* If fsync fails with EINTR, don't treat that as serious.  */
 	&& errno != EINTR)
       {
@@ -4560,6 +4565,15 @@
 */ );
   Vauto_save_list_file_name = Qnil;
 
+#ifdef HAVE_FSYNC
+  DEFVAR_BOOL ("write-region-inhibit-fsync", &write_region_inhibit_fsync /*
+*Non-nil means don't call fsync in `write-region'.
+This variable affects calls to `write-region' as well as save commands.
+A non-nil value may result in data loss!
+*/ );
+  write_region_inhibit_fsync = 0;
+#endif
+
   DEFVAR_LISP ("auto-save-list-file-prefix", &Vauto_save_list_file_prefix /*
 Prefix for generating auto-save-list-file-name.
 Emacs's pid and the system name will be appended to
--- a/src/frame-x.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/frame-x.c	Sun Dec 28 14:55:02 2008 +0000
@@ -280,8 +280,8 @@
   if (cw <= 0 || ch <= 0)
     ABORT ();
 
-  XtSetArg (al[0], XtNwidthInc,  cw);
-  XtSetArg (al[1], XtNheightInc, ch);
+  Xt_SET_ARG (al[0], XtNwidthInc,  cw);
+  Xt_SET_ARG (al[1], XtNheightInc, ch);
   XtSetValues (wmshell, al, 2);
 }
 
@@ -298,8 +298,8 @@
   fflush (stdout);
 #endif
 
-  XtSetArg (al[0], XtNwidthCells,  width);
-  XtSetArg (al[1], XtNheightCells, height);
+  Xt_SET_ARG (al[0], XtNwidthCells,  width);
+  Xt_SET_ARG (al[1], XtNheightCells, height);
   XtSetValues (wmshell, al, 2);
 }
 
@@ -668,8 +668,8 @@
   if (!old_XtValue || strcmp (new_XtValue, old_XtValue))
     {
       Arg al[2];
-      XtSetArg (al[0], Xt_resource_name, new_XtValue);
-      XtSetArg (al[1], Xt_resource_encoding_name, encoding);
+      Xt_SET_ARG (al[0], Xt_resource_name, new_XtValue);
+      Xt_SET_ARG (al[1], Xt_resource_encoding_name, encoding);
       XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2);
     }
 }
@@ -1539,8 +1539,8 @@
       if (! (frame_flags & (WidthValue | HeightValue)))
 	{
           Arg al[2];
-	  XtSetArg (al [0], XtNwidth,  &frame_w);
-	  XtSetArg (al [1], XtNheight, &frame_h);
+	  Xt_SET_ARG (al [0], XtNwidth,  &frame_w);
+	  Xt_SET_ARG (al [1], XtNheight, &frame_h);
 	  XtGetValues (ew, al, 2);
 	  if (!frame_w && !frame_h)
 	    {
@@ -1554,8 +1554,8 @@
       if (frame_flags & (XValue | YValue))
 	{
           Arg al[2];
-	  XtSetArg (al [0], XtNwidth,  &frame_w);
-	  XtSetArg (al [1], XtNheight, &frame_h);
+	  Xt_SET_ARG (al [0], XtNwidth,  &frame_w);
+	  Xt_SET_ARG (al [1], XtNheight, &frame_h);
 	  XtGetValues (ew, al, 2);
 
 	  if (frame_flags & XNegative)
@@ -1563,8 +1563,8 @@
 	  if (frame_flags & YNegative)
 	    frame_y += frame_h;
 
-	  XtSetArg (al [0], XtNx, frame_x);
-	  XtSetArg (al [1], XtNy, frame_y);
+	  Xt_SET_ARG (al [0], XtNx, frame_x);
+	  Xt_SET_ARG (al [1], XtNy, frame_y);
 	  XtSetValues (ew, al, 2);
 	}
       return;
@@ -1869,40 +1869,40 @@
       FRAME_X_TOP_LEVEL_FRAME_P (f) = 1;
 
   ac = 0;
-  XtSetArg (al[ac], XtNallowShellResize, True); ac++;
+  Xt_SET_ARG (al[ac], XtNallowShellResize, True); ac++;
 #ifdef LWLIB_USES_MOTIF
   /* Motif sucks beans.  Without this in here, it will delete the window
      out from under us when it receives a WM_DESTROY_WINDOW message
      from the WM. */
-  XtSetArg (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
+  Xt_SET_ARG (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
 #endif
 
 #ifdef EXTERNAL_WIDGET
   if (window_id)
     {
-      XtSetArg (al[ac], XtNwindow, window_id); ac++;
+      Xt_SET_ARG (al[ac], XtNwindow, window_id); ac++;
     }
   else
 #endif /* EXTERNAL_WIDGET */
     {
-      XtSetArg (al[ac], XtNinput, True);       ac++;
-      XtSetArg (al[ac], XtNminWidthCells, 10); ac++;
-      XtSetArg (al[ac], XtNminHeightCells, 1); ac++;
-      XtSetArg (al[ac], XtNvisual, visual);    ac++;
-      XtSetArg (al[ac], XtNdepth, depth);      ac++;
-      XtSetArg (al[ac], XtNcolormap, cmap);    ac++;
+      Xt_SET_ARG (al[ac], XtNinput, True);       ac++;
+      Xt_SET_ARG (al[ac], XtNminWidthCells, 10); ac++;
+      Xt_SET_ARG (al[ac], XtNminHeightCells, 1); ac++;
+      Xt_SET_ARG (al[ac], XtNvisual, visual);    ac++;
+      Xt_SET_ARG (al[ac], XtNdepth, depth);      ac++;
+      Xt_SET_ARG (al[ac], XtNcolormap, cmap);    ac++;
     }
 
   if (!NILP (overridep))
     {
-      XtSetArg (al[ac], XtNoverrideRedirect, True);    ac++;
+      Xt_SET_ARG (al[ac], XtNoverrideRedirect, True);    ac++;
     }
 
   /* #### maybe we should check for FRAMEP instead? */
   if (!NILP (parent))
     {
       parentwid = FRAME_X_SHELL_WIDGET (XFRAME (parent));
-      XtSetArg (al[ac], XtNtransientFor, parentwid); ac++;
+      Xt_SET_ARG (al[ac], XtNtransientFor, parentwid); ac++;
     }
 
   shell = XtCreatePopupShell ("shell",
@@ -1921,9 +1921,9 @@
 
   /* Create the manager widget */
   ac = 0;
-  XtSetArg (al[ac], XtNvisual, visual); ac++;
-  XtSetArg (al[ac], XtNdepth, depth); ac++;
-  XtSetArg (al[ac], XtNcolormap, cmap); ac++;
+  Xt_SET_ARG (al[ac], XtNvisual, visual); ac++;
+  Xt_SET_ARG (al[ac], XtNdepth, depth); ac++;
+  Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++;
 
   container = XtCreateWidget ("container",
 			      emacsManagerWidgetClass, shell, al, ac);
@@ -1935,11 +1935,11 @@
 
   /* Create the text area */
   ac = 0;
-  XtSetArg (al[ac], XtNvisual, visual); ac++;
-  XtSetArg (al[ac], XtNdepth, depth); ac++;
-  XtSetArg (al[ac], XtNcolormap, cmap); ac++;
-  XtSetArg (al[ac], XtNborderWidth, 0); ac++; /* should this be settable? */
-  XtSetArg (al[ac], XtNemacsFrame,  f); ac++;
+  Xt_SET_ARG (al[ac], XtNvisual, visual); ac++;
+  Xt_SET_ARG (al[ac], XtNdepth, depth); ac++;
+  Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++;
+  Xt_SET_ARG (al[ac], XtNborderWidth, 0); ac++; /* should this be settable? */
+  Xt_SET_ARG (al[ac], XtNemacsFrame,  f); ac++;
   text = XtCreateWidget (name, emacsFrameClass, container, al, ac);
   FRAME_X_TEXT_WIDGET (f) = text;
 
@@ -2198,8 +2198,8 @@
   /* Store the X data into the widget. */
   {
     Arg al[2];
-    XtSetArg (al[0], XtNiconPixmap, x_pixmap);
-    XtSetArg (al[1], XtNiconMask,   x_mask);
+    Xt_SET_ARG (al[0], XtNiconPixmap, x_pixmap);
+    Xt_SET_ARG (al[1], XtNiconMask,   x_mask);
     XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2);
   }
 }
@@ -2264,9 +2264,9 @@
   int win_gravity;
   Arg al[3];
 
-  XtSetArg (al[0], XtNwidth,       &shell_w);
-  XtSetArg (al[1], XtNheight,      &shell_h);
-  XtSetArg (al[2], XtNborderWidth, &shell_bord);
+  Xt_SET_ARG (al[0], XtNwidth,       &shell_w);
+  Xt_SET_ARG (al[1], XtNheight,      &shell_h);
+  Xt_SET_ARG (al[2], XtNborderWidth, &shell_bord);
   XtGetValues (w, al, 3);
 
   win_gravity =
@@ -2283,9 +2283,9 @@
      come back at the right place.  We can't look at s->visible to determine
      whether it is iconified because it might not be up-to-date yet (the queue
      might not be processed). */
-  XtSetArg (al[0], XtNwinGravity, win_gravity);
-  XtSetArg (al[1], XtNx, xoff);
-  XtSetArg (al[2], XtNy, yoff);
+  Xt_SET_ARG (al[0], XtNwinGravity, win_gravity);
+  Xt_SET_ARG (al[1], XtNx, xoff);
+  Xt_SET_ARG (al[2], XtNy, yoff);
   XtSetValues (w, al, 3);
 
   /* Sometimes you will find that
@@ -2709,7 +2709,7 @@
      if (!EQ (color, Vthe_null_color_instance))
        {
 	 fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
-	 XtSetArg (al[ac], XtNforeground, (void *) fgc.pixel); ac++;
+	 Xt_SET_ARG (al[ac], XtNforeground, (void *) fgc.pixel); ac++;
        }
    }
   else if (EQ (name, Qbackground))
@@ -2720,7 +2720,7 @@
      if (!EQ (color, Vthe_null_color_instance))
        {
 	 bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
-	 XtSetArg (al[ac], XtNbackground, (void *) bgc.pixel); ac++;
+	 Xt_SET_ARG (al[ac], XtNbackground, (void *) bgc.pixel); ac++;
        }
 
      /* Really crappy way to force the modeline shadows to be
@@ -2754,15 +2754,15 @@
 #ifdef USE_XFT
 	 else if (FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font)))
 	   {
-	     XtSetArg (al[ac], XtNxftFont,
+	     Xt_SET_ARG (al[ac], XtNxftFont,
 		       (void *) FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font)));
 	     ac++;
 	   }
 #endif
 	 else if (FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)))
 	   {
-	     XtSetArg (al[ac], XtNfont,
-		       (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
+	     Xt_SET_ARG (al[ac], XtNfont,
+			 (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
 	     ac++;
 	   }
        }
--- a/src/gc.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/gc.c	Sun Dec 28 14:55:02 2008 +0000
@@ -2166,7 +2166,7 @@
 */ );
 
   DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages /*
- Non-nil means display messages at start and end of garbage collection.
+*Non-nil means display messages at start and end of garbage collection.
 */ );
   garbage_collection_messages = 0;
 
--- a/src/gif_io.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/gif_io.c	Sun Dec 28 14:55:02 2008 +0000
@@ -140,7 +140,7 @@
   return ((*(GifIO->CloseFunc))(GifIO->CloseFunc_data));
 }
 
-static char *GifErrorString[14] = {
+static const char *GifErrorString[14] = {
   "Failed to open given file",			/* D_GIF_ERR_OPEN_FAILED */
   "Failed to read from given file",		/* D_GIF_ERR_READ_FAILED */
   "Given file is NOT a GIF file",		/* D_GIF_ERR_NOT_GIF_FILE */
@@ -164,7 +164,7 @@
 *****************************************************************************/
 const char *GetGifError(int errore)
 {
-    char *Err;
+    const char *Err;
 
     switch(errore) {
 	case D_GIF_ERR_OPEN_FAILED:
--- a/src/glyphs-x.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/glyphs-x.c	Sun Dec 28 14:55:02 2008 +0000
@@ -2234,8 +2234,8 @@
   if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed)
     {
       Arg al[2];
-      XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
-      XtSetArg (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p));
+      Xt_SET_ARG (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
+      Xt_SET_ARG (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p));
       XtGetValues (FRAME_X_TEXT_WIDGET
 		   (XFRAME (IMAGE_INSTANCE_FRAME (p))), al, 2);
     }
@@ -2424,7 +2424,7 @@
 	(IMAGE_INSTANCE_WIDGET_FACE (ii),
 	 domain);
       XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
-      lw_add_widget_value_arg (val, XtNtabForeground, fcolor.pixel);
+      lw_add_widget_value_arg (val, (String) XtNtabForeground, fcolor.pixel);
       wv->change = VISIBLE_CHANGE;
       val->change = VISIBLE_CHANGE;
 
@@ -2539,8 +2539,8 @@
      offset the redisplay of the widget by the amount the text
      widget is inside the manager. */
   ac = 0;
-  XtSetArg (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++;
-  XtSetArg (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++;
+  Xt_SET_ARG (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++;
+  Xt_SET_ARG (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++;
   XtGetValues (FRAME_X_TEXT_WIDGET (f), al, ac);
 
   XtSetMappedWhenManaged (wid, TRUE);
@@ -2608,11 +2608,11 @@
       Arg al [2];
       int ac =0;
 #ifdef LWLIB_WIDGETS_MOTIF
-      XtSetArg (al [ac], XmNlabelType, XmPIXMAP);	ac++;
-      XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));
+      Xt_SET_ARG (al [ac], XmNlabelType, XmPIXMAP);	ac++;
+      Xt_SET_ARG (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));
       ac++;
 #else
-      XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));	ac++;
+      Xt_SET_ARG (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));	ac++;
 #endif
       XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac);
     }
@@ -2683,11 +2683,9 @@
 
   if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))
     {
-      Arg al [1];
       Lisp_Object val;
       val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p))->value;
-      XtSetArg (al[0], XtNvalue, XINT (val));
-      XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (p), al, 1);
+      Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (p), XtNvalue, XINT (val));
     }
 }
 
@@ -2773,7 +2771,6 @@
 		  Lisp_Object old_selected =
 		    gui_item_list_find_selected
 		    (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)));
-		  Arg al [1];
 		  char* name;
 		  unsigned int num_children, i;
 		  Widget* children;
@@ -2789,8 +2786,8 @@
 		    {
 		      if (!strcmp (XtName (children [i]), name))
 			{
-			  XtSetArg (al [0], XtNtopWidget, children [i]);
-			  XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 1);
+			  Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (ii),
+					XtNtopWidget, children [i]);
 			  break;
 			}
 		    }
--- a/src/input-method-xlib.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/input-method-xlib.c	Sun Dec 28 14:55:02 2008 +0000
@@ -286,19 +286,19 @@
   xic_vars_t xic_vars;
   XIC xic;
 
-#define res(name, class_, representation, field, default_value) \
-  { name, class_, representation, sizeof(xic_vars.field), \
-     XtOffsetOf(xic_vars_t, field), XtRString, default_value }
+#define res(name, class_, representation, field, default_value) 	\
+  Xt_RESOURCE (name, class_, representation, xic_vars.field,		\
+	       XtOffsetOf(xic_vars_t, field), XtRString, default_value)
 
   static XtResource resources[] =
   {
     /*  name              class          represent'n   field    default value */
-    res(XtNximStyles,     XtCXimStyles,  XtRXimStyles, styles,  (XtPointer) DefaultXIMStyles),
-    res(XtNfontSet,       XtCFontSet,    XtRFontSet,   fontset, (XtPointer) XtDefaultFontSet),
-    res(XtNximForeground, XtCForeground, XtRPixel,     fg,      (XtPointer) XtDefaultForeground),
-    res(XtNximBackground, XtCBackground, XtRPixel,     bg,      (XtPointer) XtDefaultBackground)
+    res(XtNximStyles,     XtCXimStyles,  XtRXimStyles, styles,  DefaultXIMStyles),
+    res(XtNfontSet,       XtCFontSet,    XtRFontSet,   fontset, XtDefaultFontSet),
+    res(XtNximForeground, XtCForeground, XtRPixel,     fg,      XtDefaultForeground),
+    res(XtNximBackground, XtCBackground, XtRPixel,     bg,      XtDefaultBackground)
   };
-
+#undef res
 
   xim = DEVICE_X_XIM (d);
 
@@ -977,7 +977,7 @@
 }
 
 void
-describe_XRectangle (char *name, XRectangle *r)
+describe_XRectangle (const char *name, XRectangle *r)
 {
   if (r == NULL)
     stderr_out ("%s: NULL\n", name);
--- a/src/lisp.h	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/lisp.h	Sun Dec 28 14:55:02 2008 +0000
@@ -3815,12 +3815,16 @@
 
 MODULE_API void staticpro_1 (Lisp_Object *, Ascbyte *);
 MODULE_API void staticpro_nodump_1 (Lisp_Object *, Ascbyte *);
-#define staticpro(ptr) staticpro_1 (ptr, #ptr)
-#define staticpro_nodump(ptr) staticpro_nodump_1 (ptr, #ptr)
+/* g++ 4.3 complains about the conversion of const char to char.
+   These end up in a dynarray, so we would need to define a whole new class
+   of dynarray just to handle the const char stuff.
+   ####Check to see how hard this might be. */
+#define staticpro(ptr) staticpro_1 (ptr, (Ascbyte *) #ptr)
+#define staticpro_nodump(ptr) staticpro_nodump_1 (ptr, (Ascbyte *) #ptr)
 
 #ifdef HAVE_SHLIB
 MODULE_API void unstaticpro_nodump_1 (Lisp_Object *, Ascbyte *);
-#define unstaticpro_nodump(ptr) unstaticpro_nodump_1 (ptr, #ptr)
+#define unstaticpro_nodump(ptr) unstaticpro_nodump_1 (ptr, (Ascbyte *) #ptr)
 #endif
 
 #else
--- a/src/menubar-x.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/menubar-x.c	Sun Dec 28 14:55:02 2008 +0000
@@ -690,13 +690,13 @@
       {
 	Widget shell = XtParent (daddy);
 
-	XtSetArg (al [0], XtNx, &shellx);
-	XtSetArg (al [1], XtNy, &shelly);
+	Xt_SET_ARG (al [0], XtNx, &shellx);
+	Xt_SET_ARG (al [1], XtNy, &shelly);
 	XtGetValues (shell, al, 2);
       }
 #endif
-      XtSetArg (al [0], XtNx, &framex);
-      XtSetArg (al [1], XtNy, &framey);
+      Xt_SET_ARG (al [0], XtNx, &framex);
+      Xt_SET_ARG (al [1], XtNy, &framey);
       XtGetValues (daddy, al, 2);
       btn->x_root = shellx + framex + btn->x;
       btn->y_root = shelly + framey + btn->y;
--- a/src/mule-ccl.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/mule-ccl.c	Sun Dec 28 14:55:02 2008 +0000
@@ -1455,7 +1455,7 @@
 		  if (XCHARSET_DIMENSION (charset_by_leading_byte (i)) == 1)
 		    i = (((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7)
 			 | (reg[rrr] & 0x7F));
-		  else if (i < MAX_LEADING_BYTE_OFFICIAL_2)
+		  else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
 		    i = ((i - FIELD1_TO_OFFICIAL_LEADING_BYTE) << 14) 
 		      | reg[rrr];
 		  else
--- a/src/mule-coding.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/mule-coding.c	Sun Dec 28 14:55:02 2008 +0000
@@ -3339,7 +3339,7 @@
 {
   Lisp_Object sym;
   struct ccl_program test_ccl;
-  Ascbyte *suffix;
+  const Ascbyte *suffix;
 
   /* Check key first.  */
   if (EQ (key, Qdecode))
--- a/src/objects-xlike-inc.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/objects-xlike-inc.c	Sun Dec 28 14:55:02 2008 +0000
@@ -358,7 +358,6 @@
     { &Vcharset_latin_iso8859_9, NULL, NULL },
     { &Vcharset_latin_iso8859_15, NULL, NULL },
     { &Vcharset_thai_tis620, NULL, NULL },
-    { &Vcharset_arabic_iso8859_6, NULL, NULL },
     { &Vcharset_hebrew_iso8859_8, "Hebrew", "he" },
     { &Vcharset_cyrillic_iso8859_5, NULL, NULL },
     /* #### these probably are not quite right */
--- a/src/print.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/print.c	Sun Dec 28 14:55:02 2008 +0000
@@ -1527,7 +1527,7 @@
 
 static void
 printing_major_badness (Lisp_Object printcharfun,
-			Ascbyte *badness_string, int type, void *val,
+			const Ascbyte *badness_string, int type, void *val,
 			enum printing_badness badness)
 {
   Ibyte buf[666];
--- a/src/redisplay.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/redisplay.c	Sun Dec 28 14:55:02 2008 +0000
@@ -4447,7 +4447,7 @@
     {
     invalid:
       {
-	char *str = GETTEXT ("*invalid*");
+	const char *str = GETTEXT ("*invalid*");
 	Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */
 
 	if (size <= *offset)
--- a/src/regex.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/regex.c	Sun Dec 28 14:55:02 2008 +0000
@@ -4313,8 +4313,8 @@
     {
       if (!BUFFERP (lispobj))
 	return -1;
-      range = (BUF_PT (XBUFFER (lispobj)) - BUF_BEGV (XBUFFER (lispobj))
-	       - startpos);
+      range = (BYTE_BUF_PT (XBUFFER (lispobj))
+	       - BYTE_BUF_BEGV (XBUFFER (lispobj)) - startpos);
       if (range < 0)
 	return -1;
     }
--- a/src/symbols.c	Sun Dec 28 14:46:24 2008 +0000
+++ b/src/symbols.c	Sun Dec 28 14:55:02 2008 +0000
@@ -84,6 +84,9 @@
 static Lisp_Object *value_slot_past_magic (Lisp_Object sym);
 static Lisp_Object follow_varalias_pointers (Lisp_Object symbol,
 					     Lisp_Object follow_past_lisp_magic);
+static Lisp_Object map_varalias_chain (Lisp_Object symbol,
+                                       Lisp_Object follow_past_lisp_magic,
+                                       Lisp_Object (*fn) (Lisp_Object arg));
 
 
 static Lisp_Object
@@ -715,7 +718,7 @@
 {
   /* This function can GC */
   Ffset (symbol, newdef);
-  LOADHIST_ATTACH (symbol);
+  LOADHIST_ATTACH (Fcons (Qdefun, symbol));
   return newdef;
 }
 
@@ -2754,6 +2757,78 @@
   else
     return local_info != 0 ? Qt : Qnil;
 }
+
+DEFUN ("custom-variable-p", Fcustom_variable_p, 1, 1, 0, /*
+Return non-nil if SYMBOL names a custom variable.
+Does not follow the variable alias chain.
+*/
+       (symbol))
+{
+  return (!(NILP (Fget(symbol, intern ("standard-value"), Qnil))) 
+          || !(NILP (Fget(symbol, intern ("custom-autoload"), Qnil)))) ?
+    Qt: Qnil;
+}
+
+static Lisp_Object
+user_variable_alias_check_fun (Lisp_Object symbol)
+{
+  Lisp_Object documentation = Fget (symbol, Qvariable_documentation, Qnil);
+      
+  if ((INTP (documentation) && XINT (documentation) < 0) ||
+      (STRINGP (documentation) &&
+       (string_byte (documentation, 0) == '*')) ||
+      /* If (STRING . INTEGER), a negative integer means a user variable. */
+      (CONSP (documentation)
+       && STRINGP (XCAR (documentation))
+       && INTP (XCDR (documentation))
+       && XINT (XCDR (documentation)) < 0) ||
+      !NILP (Fcustom_variable_p (symbol)))
+    {
+      return make_int(1);
+    }
+
+  return Qzero;
+}
+
+DEFUN ("user-variable-p", Fuser_variable_p, 1, 1, 0, /*
+Return t if SYMBOL names a variable intended to be set and modified by users.
+\(The alternative is a variable used internally in a Lisp program.)
+A symbol names a user variable if
+\(1) the first character of its documentation is `*', or
+\(2) it is customizable (`custom-variable-p' gives t), or
+\(3) it names a variable alias that eventually resolves to another user variable.
+
+The GNU Emacs implementation of `user-variable-p' returns nil if there is a
+loop in the chain of symbols.  Since this is indistinguishable from the case
+where a symbol names a non-user variable, XEmacs signals a
+`cyclic-variable-indirection' error instead; use `condition-case' to catch
+this error if you really want to avoid this.
+*/
+       (symbol))
+{
+  Lisp_Object mapped;
+
+  if (!SYMBOLP (symbol))
+    {
+      return Qnil; 
+    }
+
+  /* Called for its side-effects, we want it to signal if there's a loop. */
+  follow_varalias_pointers (symbol, Qt);
+
+  /* Look through the various aliases. */
+  mapped = map_varalias_chain (symbol, Qt, user_variable_alias_check_fun);
+  if (EQ (Qzero, mapped))
+    {
+      return Qnil;
+    }
+
+  assert (EQ (make_int (1), mapped));
+
+  return Qt;
+}
+
+
 
 
 /*
@@ -3136,20 +3211,98 @@
   return hare;
 }
 
-DEFUN ("defvaralias", Fdefvaralias, 2, 2, 0, /*
+/* Map FN over the chain of variable aliases for SYMBOL. If FN returns
+   something other than Qzero for some link in the chain, return that
+   immediately. Otherwise return Qzero (which is not a symbol).
+
+   FN may be called twice on the same symbol if the varalias chain is
+   cyclic. Prevent this by calling follow_varalias_pointers first for its
+   side-effects.
+
+   Signals a cyclic-variable-indirection error if a cyclic structure is
+   detected. */
+
+static Lisp_Object
+map_varalias_chain (Lisp_Object symbol,
+                    Lisp_Object follow_past_lisp_magic,
+                    Lisp_Object (*fn) (Lisp_Object arg))
+{
+#define VARALIAS_INDIRECTION_SUSPICION_LENGTH 16
+  Lisp_Object tortoise, hare, val, res;
+  int count;
+
+  assert (fn);
+
+  /* quick out just in case */
+  if (!SYMBOL_VALUE_MAGIC_P (XSYMBOL (symbol)->value))
+    {
+      return (fn)(symbol);
+    }
+
+  /* Compare implementation of indirect_function().  */
+  for (hare = tortoise = symbol, count = 0;
+       val = fetch_value_maybe_past_magic (hare, follow_past_lisp_magic),
+	 SYMBOL_VALUE_VARALIAS_P (val);
+       hare = symbol_value_varalias_aliasee (XSYMBOL_VALUE_VARALIAS (val)),
+	 count++)
+    {
+      res = (fn) (hare);
+      if (!EQ (Qzero, res))
+        {
+          return res;
+        }
+
+      if (count < VARALIAS_INDIRECTION_SUSPICION_LENGTH) continue;
+
+      if (count & 1)
+	tortoise = symbol_value_varalias_aliasee
+	  (XSYMBOL_VALUE_VARALIAS (fetch_value_maybe_past_magic
+				   (tortoise, follow_past_lisp_magic)));
+      if (EQ (hare, tortoise))
+        return Fsignal (Qcyclic_variable_indirection, list1 (symbol));
+    }
+
+  return (fn) (hare);
+}
+
+/*
+
+OED entry, 2nd edition, IPA transliterated using Kirshenbaum: 
+
+alias ('eIlI@s, '&lI@s), adv. and n.
+[...]
+B. n. (with pl. aliases.)
+1. Another name, an assumed name.
+1605 Camden Rem. (1614) 147 An Alias or double name cannot preiudice the honest.
+1831 Edin. Rev. LIII. 364 He has been assuming various aliases.
+1861 Macaulay Hist. Eng. V. 92 The monk who was sometimes called Harrison
+and sometimes went by the alias of Johnson.
+
+The alias is the fake name. Let's try to follow that usage in our
+documentation.
+
+*/
+
+DEFUN ("defvaralias", Fdefvaralias, 2, 3, 0, /*
 Define a variable as an alias for another variable.
 Thenceforth, any operations performed on VARIABLE will actually be
-performed on ALIAS.  Both VARIABLE and ALIAS should be symbols.
-If ALIAS is nil, remove any aliases for VARIABLE.
-ALIAS can itself be aliased, and the chain of variable aliases
+performed on ALIASED.  Both VARIABLE and ALIASED should be symbols.
+If ALIASED is nil and VARIABLE is an existing alias, remove that alias.
+ALIASED can itself be an alias, and the chain of variable aliases
 will be followed appropriately.
 If VARIABLE already has a value, this value will be shadowed
 until the alias is removed, at which point it will be restored.
 Currently VARIABLE cannot be a built-in variable, a variable that
 has a buffer-local value in any buffer, or the symbols nil or t.
-\(ALIAS, however, can be any type of variable.)
+\(ALIASED, however, can be any type of variable.)
+
+Optional argument DOCSTRING is documentation for VARIABLE in its use as an
+alias for ALIASED.  The XEmacs help code ignores this documentation, using
+the documentation of ALIASED instead, and the docstring, if specified, is
+not shadowed in the same way that the value is.  Only use it if you know
+what you're doing.
 */
-       (variable, alias))
+       (variable, aliased, docstring))
 {
   struct symbol_value_varalias *bfwd;
   Lisp_Object valcontents;
@@ -3159,7 +3312,7 @@
 
   valcontents = XSYMBOL (variable)->value;
 
-  if (NILP (alias))
+  if (NILP (aliased))
     {
       if (SYMBOL_VALUE_VARALIAS_P (valcontents))
 	{
@@ -3170,11 +3323,15 @@
       return Qnil;
     }
 
-  CHECK_SYMBOL (alias);
+  CHECK_SYMBOL (aliased);
+
+  if (!NILP (docstring))
+    Fput (variable, Qvariable_documentation, docstring);
+
   if (SYMBOL_VALUE_VARALIAS_P (valcontents))
     {
       /* transmogrify */
-      XSYMBOL_VALUE_VARALIAS (valcontents)->aliasee = alias;
+      XSYMBOL_VALUE_VARALIAS (valcontents)->aliasee = aliased;
       return Qnil;
     }
 
@@ -3186,7 +3343,7 @@
   bfwd = ALLOC_LCRECORD_TYPE (struct symbol_value_varalias,
 			      &lrecord_symbol_value_varalias);
   bfwd->magic.type = SYMVAL_VARALIAS;
-  bfwd->aliasee = alias;
+  bfwd->aliasee = aliased;
   bfwd->shadowed = valcontents;
 
   valcontents = wrap_symbol_value_magic (bfwd);
@@ -3195,8 +3352,8 @@
 }
 
 DEFUN ("variable-alias", Fvariable_alias, 1, 2, 0, /*
-If VARIABLE is aliased to another variable, return that variable.
-VARIABLE should be a symbol.  If VARIABLE is not aliased, return nil.
+If VARIABLE is an alias of another variable, return that variable.
+VARIABLE should be a symbol.  If VARIABLE is not an alias, return nil.
 Variable aliases are created with `defvaralias'.  See also
 `indirect-variable'.
 */
@@ -3755,6 +3912,8 @@
   DEFSUBR (Fkill_local_variable);
   DEFSUBR (Fkill_console_local_variable);
   DEFSUBR (Flocal_variable_p);
+  DEFSUBR (Fcustom_variable_p);
+  DEFSUBR (Fuser_variable_p);
   DEFSUBR (Fdefvaralias);
   DEFSUBR (Fvariable_alias);
   DEFSUBR (Findirect_variable);
--- a/tests/ChangeLog	Sun Dec 28 14:46:24 2008 +0000
+++ b/tests/ChangeLog	Sun Dec 28 14:55:02 2008 +0000
@@ -4,6 +4,27 @@
 	New file, testing the functionality of #'query-coding-region and
 	#'query-coding-string.
 
+2008-09-27  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* automated/regexp-tests.el: Add test for at_dot regexp.
+
+2008-09-27  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* automated/regexp-tests.el: `with-string-as-buffer-contents'
+	leaves point at end of buffer, so must move point to beginning.
+
+2008-08-27  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/regexp-tests.el: 
+	Add a few basic #'skip-chars-forward, #'skip-chars-backward
+	tests. 
+
+2008-08-10  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/mule-tests.el (featurep): Update the list of character
+	sets in etc/HELLO to reflect that we've deleted the
+	XEmacs-specific Arabic character sets.
+
 2008-05-21  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* automated/mule-tests.el (featurep): 
--- a/tests/automated/mule-tests.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/tests/automated/mule-tests.el	Sun Dec 28 14:55:02 2008 +0000
@@ -527,20 +527,20 @@
              ;; irrelevant.
              (sort (charsets-in-region (point-min) (point-max))
                    #'string<)
-             '(arabic-1-column arabic-2-column ascii chinese-big5-1
-               chinese-gb2312 cyrillic-iso8859-5 ethiopic greek-iso8859-7
-               hebrew-iso8859-8 japanese-jisx0208 japanese-jisx0212
-               katakana-jisx0201 korean-ksc5601 latin-iso8859-1
-               latin-iso8859-2 thai-xtis vietnamese-viscii-lower)))
+             '(ascii chinese-big5-1 chinese-gb2312 cyrillic-iso8859-5
+               ethiopic greek-iso8859-7 hebrew-iso8859-8 japanese-jisx0208
+               japanese-jisx0212 jit-ucs-charset-0 katakana-jisx0201
+               korean-ksc5601 latin-iso8859-1 latin-iso8859-2 thai-xtis
+               vietnamese-viscii-lower)))
     (Assert (equal 
              (sort (charsets-in-string (buffer-substring (point-min)
 							 (point-max)))
                    #'string<)
-             '(arabic-1-column arabic-2-column ascii chinese-big5-1
-               chinese-gb2312 cyrillic-iso8859-5 ethiopic greek-iso8859-7
-               hebrew-iso8859-8 japanese-jisx0208 japanese-jisx0212
-               katakana-jisx0201 korean-ksc5601 latin-iso8859-1
-               latin-iso8859-2 thai-xtis vietnamese-viscii-lower))))
+             '(ascii chinese-big5-1 chinese-gb2312 cyrillic-iso8859-5
+               ethiopic greek-iso8859-7 hebrew-iso8859-8 japanese-jisx0208
+               japanese-jisx0212 jit-ucs-charset-0 katakana-jisx0201
+               korean-ksc5601 latin-iso8859-1 latin-iso8859-2 thai-xtis
+               vietnamese-viscii-lower))))
 
   ;;---------------------------------------------------------------
   ;; Language environments, and whether the specified values are sane.
--- a/tests/automated/regexp-tests.el	Sun Dec 28 14:46:24 2008 +0000
+++ b/tests/automated/regexp-tests.el	Sun Dec 28 14:55:02 2008 +0000
@@ -522,9 +522,44 @@
 						     2))
       )))
 
+;; Not very comprehensive tests of skip-chars-forward, skip-chars-background: 
+
+(with-string-as-buffer-contents 
+    "-]-----------------------------][]]------------------------"
+  (goto-char (point-min))
+  (skip-chars-forward (skip-chars-quote "-[]"))
+  (Assert (= (point) (point-max)))
+  (skip-chars-backward (skip-chars-quote "-[]"))
+  (Assert (= (point) (point-min)))
+  ;; Testing in passing for an old bug in #'skip-chars-forward where I
+  ;; thought it was impossible to call it with a string containing only ?-
+  ;; and ?]: 
+  (Assert (= (skip-chars-forward (skip-chars-quote "-]"))
+             (position ?[ (buffer-string) :test #'=)))
+  ;; This used to error, incorrectly: 
+  (Assert (skip-chars-quote "[-")))
+
 ;; replace-match (REPLACEMENT &optional FIXEDCASE LITERAL STRING STRBUFFER)
 
 ;; #### Write some tests!  Much functionality is implicitly tested above
 ;; via `replace-regexp-in-string', but we should specifically test bogus
 ;; combinations of STRING and STRBUFFER.
 
+;; empty string at point
+;; Thanks Julian Bradford on XEmacs Beta
+;; <18652.54975.894512.880956@krk.inf.ed.ac.uk>
+(with-string-as-buffer-contents "aáa"
+  (goto-char (point-min))
+  (Assert (looking-at "\\="))
+  (Assert (= (re-search-forward "\\=") 1))
+  (forward-char 1)
+  (Assert (looking-at "\\="))
+  (Assert (= (re-search-forward "\\=") 2))
+  (forward-char 1)
+  (Assert (looking-at "\\="))
+  (Assert (= (re-search-forward "\\=") 3))
+  (forward-char 1)
+  (Assert (looking-at "\\="))
+  (Assert (= (re-search-forward "\\=") 4)))
+
+