changeset 167:85ec50267440 r20-3b10

Import from CVS: tag r20-3b10
author cvs
date Mon, 13 Aug 2007 09:45:46 +0200
parents 7a77eb660975
children 9851d5c6556e
files CHANGES-beta ChangeLog Makefile.in configure configure.in etc/HELLO etc/NEWS lib-src/ChangeLog lib-src/Makefile.in.in lib-src/gnuclient.c lib-src/update-autoloads.sh lib-src/update-elc.sh lisp/ChangeLog lisp/apel/auto-autoloads.el lisp/apel/custom-load.el lisp/apel/emu.el lisp/apel/file-detect.el lisp/apel/richtext.el lisp/auctex/ChangeLog lisp/auctex/Makefile lisp/auctex/custom-load.el lisp/bytecomp/custom-load.el lisp/calendar/custom-load.el lisp/cc-mode/auto-autoloads.el lisp/cc-mode/cc-langs.el lisp/cc-mode/cc-styles.el lisp/cc-mode/custom-load.el lisp/cl/custom-load.el lisp/comint/custom-load.el lisp/custom/ChangeLog lisp/custom/cus-edit.el lisp/custom/cus-face.el lisp/custom/custom-load.el lisp/custom/custom.el lisp/custom/wid-browse.el lisp/custom/wid-edit.el lisp/custom/widget-example.el lisp/custom/widget.el lisp/edebug/custom-load.el lisp/ediff/custom-load.el lisp/efs/custom-load.el lisp/egg/custom-load.el lisp/electric/custom-load.el lisp/emulators/custom-load.el lisp/eos/custom-load.el lisp/eterm/custom-load.el lisp/games/custom-load.el lisp/gnats/custom-load.el lisp/gnus/ChangeLog lisp/gnus/custom-load.el lisp/gnus/gnus-art.el lisp/gnus/gnus-group.el lisp/gnus/gnus-salt.el lisp/gnus/gnus-srvr.el lisp/gnus/gnus-start.el lisp/gnus/gnus-sum.el lisp/gnus/gnus-topic.el lisp/gnus/gnus-uu.el lisp/gnus/gnus.el lisp/gnus/message.el lisp/gnus/nnfolder.el lisp/gnus/nnml.el lisp/hm--html-menus/custom-load.el lisp/hyperbole/ChangeLog lisp/hyperbole/custom-load.el lisp/hyperbole/wrolo-menu.el lisp/ilisp/custom-load.el lisp/iso/custom-load.el lisp/its/custom-load.el lisp/language/arabic-util.el lisp/language/arabic.el lisp/language/chinese.el lisp/leim/auto-autoloads.el lisp/leim/custom-load.el lisp/locale/custom-load.el lisp/mailcrypt/custom-load.el lisp/mel/custom-load.el lisp/mh-e/custom-load.el lisp/modes/abbrev.el lisp/modes/auto-autoloads.el lisp/modes/auto-show.el lisp/modes/cperl-mode.el lisp/modes/custom-load.el lisp/modes/image-mode.el lisp/modes/linuxdoc-sgml.el lisp/modes/sgml-mode.el lisp/mu/custom-load.el lisp/mule/auto-autoloads.el lisp/mule/custom-load.el lisp/mule/mule-util.el lisp/oobr/custom-load.el lisp/packages/custom-load.el lisp/packages/gnuserv.el lisp/packages/hexl.el lisp/packages/hyper-apropos.el lisp/packages/lazy-lock.el lisp/pcl-cvs/custom-load.el lisp/prim/about.el lisp/prim/auto-autoloads.el lisp/prim/cus-load.el lisp/prim/custom-load.el lisp/prim/files.el lisp/prim/format.el lisp/prim/loaddefs.el lisp/prim/loadup.el lisp/prim/make-docfile.el lisp/prim/overlay.el lisp/prim/profile.el lisp/prim/simple.el lisp/psgml/custom-load.el lisp/rmail/custom-load.el lisp/sunpro/custom-load.el lisp/term/custom-load.el lisp/tl/auto-autoloads.el lisp/tl/char-table.el lisp/tl/chartblxmas.el lisp/tl/custom-load.el lisp/tm/custom-load.el lisp/tm/tm-ew-e.el lisp/tooltalk/custom-load.el lisp/utils/auto-autoloads.el lisp/utils/autoload.el lisp/utils/browse-url.el lisp/utils/custom-load.el lisp/utils/delbs.el lisp/utils/speedbar.el lisp/utils/speedbspec.el lisp/viper/custom-load.el lisp/vm/custom-load.el lisp/w3/custom-load.el lisp/x11/custom-load.el lisp/x11/x-menubar.el man/custom.texi man/gnus.texi man/message.texi man/widget.texi nt/config.h nt/xemacs.mak pkg-src/tree-x/Makefile pkg-src/tree-x/Makefile.in.in pkg-src/tree-x/dbl.c pkg-src/tree-x/dbl.h pkg-src/tree-x/dissolve.c pkg-src/tree-x/dissolve.h pkg-src/tree-x/draw.c pkg-src/tree-x/input.c pkg-src/tree-x/input.h pkg-src/tree-x/intf.c pkg-src/tree-x/intf.h pkg-src/tree-x/rsrc.h pkg-src/tree-x/tree.c pkg-src/tree-x/tree.h pkg-src/tree-x/usleep.c src/ChangeLog src/Makefile.in.in src/abbrev.c src/buffer.c src/buffer.h src/callproc.c src/casefiddle.c src/config.h.in src/device-x.c src/doc.c src/emacs.c src/emacsfns.h src/eval.c src/fileio.c src/fns.c src/insdel.c src/m/convex.h src/m/dpx2.h src/mule-charset.c src/print.c src/process.c src/s/bsd386.h src/s/decosf1-2.h src/s/freebsd.h src/s/gnu.h src/s/irix5-0.h src/s/netbsd.h src/s/osf1.h src/s/riscos5.h src/s/sol2.h src/s/sunos4-0.h src/s/windowsnt.h src/symbols.c src/systty.h src/undo.c src/unexelfsgi.c version.sh
diffstat 190 files changed, 8304 insertions(+), 4272 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 09:44:44 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 09:45:46 2007 +0200
@@ -1,4 +1,23 @@
 							-*- indented-text -*-
+to 20.3 beta10 "Athens"
+-- Linuxdoc-sgml.el courtesy of Arun Sharma.
+-- rewritten abbreviations from Hrvoje Niksic
+-- Gnus-5.4.60
+-- New file image-mode.el (Major mode for displaying image files)
+-- Miscellaneous Mule patches from MORIOKA Tomohiko
+-- Miscellaneous Hrvoje Niksic patches
+-- Configure/tree-x patches from Martin Buchholz
+-- Restore Show Message Log in Edit menu.
+-- `make autoloads' updated and should now work without Mule [untested].
+-- New boolean variable `x-seppuku-on-epipe' to handle case of X Server going
+   away and XEmacs not exiting.  Set to `t' to force immediate exit.
+-- custom-1.9940
+-- gnuserv.el-3.6
+-- speedbar-0.5 courtesy of Eric Ludlam
+-- Internals change -- Use fork() instead of vfork() for invoking
+   subprocesses
+-- Miscellaneous bug fixes
+
 to 20.3 beta9 "Sofia".
 -- cc-mode-5.11
 -- custom-1.9937
--- a/ChangeLog	Mon Aug 13 09:44:44 2007 +0200
+++ b/ChangeLog	Mon Aug 13 09:45:46 2007 +0200
@@ -1,3 +1,65 @@
+1997-06-29  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta10 is released.
+
+1997-06-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* lisp/language/chinese.el: Add chinese-isoir165 (CCITT Extended
+	GB).
+
+	* lisp/language/chinese.el: Modify charset DOC-strings for CNS
+	11643 to be more detailed.
+
+	* lisp/language/arabic.el: Rename `arabic-0', `arabic-1' and
+	`arabic-2' to `arabic-digit', `arabic-1-column' and
+	`arabic-2-column' to sync with Emacs/mule-19.34.94-zeta.
+
+	* src/mule-charset.c: Modify charset DOC-strings to be more
+	detailed.
+
+	Use BOX DRAWINGS characters of JIS X0208.
+
+1997-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* lisp/apel/richtext.el: Add autoload comments for
+	`richtext-encode' and `richtext-decode'.
+
+	* lisp/prim/format.el (format-alist): Add `text/richtext'.
+
+	* lisp/tl/chartblxmas.el: New file.
+
+	* lisp/x11/x-menubar.el (default-menubar): Add "Show character
+	table" for MULE menu.
+
+	* lisp/apel/emu.el: Check richtext.el is bundled.
+
+	* lisp/tl/char-table.el (view-charset): New command.
+
+	* lisp/tl/char-table.el: Rename some functions.
+
+	* lisp/packages/hexl.el (hexl-mode-exit): Run
+	`hexl-mode-exit-hook'.
+
+	* lisp/x11/x-menubar.el (default-menubar): Fix "Describe language
+	support" and "Set language environment" of mule menu.
+
+	* lisp/apel/file-detect.el: Add autoload comments for function
+	`add-path', `add-latest-path', `get-latest-path',
+	`file-installed-p', `exec-installed-p', `module-installed-p' and
+	variable `exec-suffix-list'.
+
+	* lisp/prim/format.el (format-alist): Add image/jpeg, image/gif,
+	image/png and image/x-xpm.
+
+	* lisp/modes/image-mode.el: New file.
+
+1997-06-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* lisp/tm/tm-ew-e.el (tm-eword::encode-string-1): avoid infinite
+	loop caused by long non-encoded-word element. (cf. [tm-en:1356])
+
+	(mime/field-encoding-method-alist): Add "Message-ID" as ignored.
+
 1997-06-25  Steven L Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.3-beta9 is released.
--- a/Makefile.in	Mon Aug 13 09:44:44 2007 +0200
+++ b/Makefile.in	Mon Aug 13 09:45:46 2007 +0200
@@ -208,6 +208,9 @@
 ## The makefiles of the directories in ${MAKE_SUBDIR}.
 SUBDIR_MAKEFILES = @SUBDIR_MAKEFILES@
 
+## Subdirectories to `make install-arch-dep' recursively
+INSTALL_ARCH_DEP_SUBDIR = @INSTALL_ARCH_DEP_SUBDIR@
+
 ## Subdirectories to install, and where they'll go.
 ## lib-src's makefile knows how to install it, so we don't do that here.
 ## When installing the info files, we need to do special things to
@@ -299,10 +302,11 @@
 	 echo "#define PURESIZE_ADJUSTMENT 0") > $@
 
 src:	@SRC_SUBDIR_DEPS@ FRC.src
+pkg-src/tree-x: pkg-src/FRC.tree-x
 lib-src: FRC.lib-src
 lwlib:	FRC.lwlib
 dynodump: FRC.dynodump
-FRC.src FRC.lib-src FRC.lwlib FRC.dynodump:
+FRC.src FRC.lib-src FRC.lwlib FRC.dynodump pkg-src/FRC.tree-x:
 
 .RECURSIVE: ${SUBDIR}
 
@@ -322,10 +326,13 @@
 lwlib/Makefile: ${srcdir}/lwlib/Makefile.in.in config.status
 	./config.status
 
-lwlib/config.h: ${srcdir}/lwlib/config.h.in
+pkg-src/tree-x/Makefile: ${srcdir}/pkg-src/tree-x/Makefile.in.in config.status
+	./config.status
+
+src/config.h: ${srcdir}/src/config.h.in
 	./config.status && touch $@
 
-src/config.h: ${srcdir}/src/config.h.in
+lwlib/config.h: ${srcdir}/lwlib/config.h.in
 	./config.status && touch $@
 
 ## ==================== Installation ====================
@@ -358,21 +365,18 @@
 install: all install-arch-dep install-arch-indep;
 
 install-arch-dep: mkdir
-	cd lib-src && \
-	  $(MAKE) install $(MFLAGS) prefix=${prefix} \
+	for subdir in ${INSTALL_ARCH_DEP_SUBDIR}; do \
+	( cd $${subdir} && $(MAKE) install $(MFLAGS) prefix=${prefix} \
 	    exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
-	    archlibdir=${archlibdir}
-	if [ `(cd ${archlibdir} && $(pwd))` != `(cd ./lib-src && $(pwd))` ]; \
-	then \
+	    archlibdir=${archlibdir} ) ; done
+	if test `(cd ${archlibdir} && $(pwd))` != `(cd lib-src && $(pwd))`; then \
 	   ${INSTALL_DATA} lib-src/DOC ${archlibdir}/DOC ; \
-	   for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; do \
-	     (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; \
-	   done ; \
+	   for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; \
+	     do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \
 	else true; fi
 	${INSTALL_PROGRAM} src/xemacs ${bindir}/xemacs-${version}
 	-chmod 0755 ${bindir}/xemacs-${version}
-	$(RM) ${bindir}/xemacs
-	cd ${bindir} && ${LN_S} xemacs-${version} ./xemacs
+	cd ${bindir} && $(RM) ./xemacs && ${LN_S} xemacs-${version} ./xemacs
 
 install-arch-indep: mkdir
 	-@set ${COPYDESTS} ; \
--- a/configure	Mon Aug 13 09:44:44 2007 +0200
+++ b/configure	Mon Aug 13 09:45:46 2007 +0200
@@ -209,6 +209,7 @@
 
 
 MAKE_SUBDIR="$MAKE_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$MAKE_SUBDIR"; fi
+INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR lib-src" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"lib-src\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
 
 prefix='/usr/local'
 exec_prefix='${prefix}'
@@ -830,7 +831,7 @@
 esac
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:834: checking whether ln -s works" >&5
+echo "configure:835: checking whether ln -s works" >&5
 
 rm -f conftestdata
 if ln -s X conftestdata 2>/dev/null
@@ -886,7 +887,7 @@
 
 
 echo "checking "the configuration name"" 1>&6
-echo "configure:890: checking "the configuration name"" >&5
+echo "configure:891: checking "the configuration name"" >&5
 internal_configuration=`echo $configuration | sed 's/-\(energize\|workshop\)//'`
 if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else
   exit $?
@@ -1313,7 +1314,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1317: checking for $ac_word" >&5
+echo "configure:1318: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1339,7 +1340,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1343: checking for $ac_word" >&5
+echo "configure:1344: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1384,7 +1385,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1388: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1389: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1396,11 +1397,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1400 "configure"
+#line 1401 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1420,19 +1421,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1424: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1425: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1429: checking whether we are using GNU C" >&5
+echo "configure:1430: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1446,7 +1447,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1450: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1451: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1476,7 +1477,7 @@
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1480: checking for $ac_word" >&5
+echo "configure:1481: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1502,7 +1503,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1506: checking for $ac_word" >&5
+echo "configure:1507: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1547,7 +1548,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1551: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1552: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1559,11 +1560,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1563 "configure"
+#line 1564 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1583,19 +1584,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1587: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1588: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1592: checking whether we are using GNU C" >&5
+echo "configure:1593: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1609,7 +1610,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1613: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1614: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1638,7 +1639,7 @@
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1642: checking for $ac_word" >&5
+echo "configure:1643: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1664,7 +1665,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1668: checking for $ac_word" >&5
+echo "configure:1669: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1709,7 +1710,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1713: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1714: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1721,11 +1722,11 @@
 cross_compiling=no
 
 cat > conftest.$ac_ext <<EOF
-#line 1725 "configure"
+#line 1726 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1745,19 +1746,19 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1749: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1750: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1754: checking whether we are using GNU C" >&5
+echo "configure:1755: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1771,7 +1772,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1775: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1776: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1802,7 +1803,7 @@
 test -n "$NON_GNU_CPP" -a "$with_gcc" = "no" -a -z "$CPP" && CPP="$NON_GNU_CPP"
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1806: checking how to run the C preprocessor" >&5
+echo "configure:1807: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1815,13 +1816,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1819 "configure"
+#line 1820 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1832,13 +1833,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1836 "configure"
+#line 1837 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1861,9 +1862,9 @@
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:1865: checking for AIX" >&5
-cat > conftest.$ac_ext <<EOF
-#line 1867 "configure"
+echo "configure:1866: checking for AIX" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1868 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -1890,19 +1891,20 @@
 
 
 echo $ac_n "checking whether we are using SunPro C""... $ac_c" 1>&6
-echo "configure:1894: checking whether we are using SunPro C" >&5
-cat > conftest.$ac_ext <<EOF
-#line 1896 "configure"
+echo "configure:1895: checking whether we are using SunPro C" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1897 "configure"
 #include "confdefs.h"
 
 int main() {
 #ifndef __SUNPRO_C
 #error Not a  SunPro compiler :-(
+******* ======= ******** &&&&&&&&
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:1906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   __sunpro_c=yes
 else
@@ -2187,7 +2189,7 @@
  fi
 
 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
-echo "configure:2191: checking for dynodump" >&5
+echo "configure:2193: checking for dynodump" >&5
 if test "$unexec" != "unexsol2.o"; then
   echo "$ac_t""no" 1>&6
 else
@@ -2258,19 +2260,19 @@
 
 if test "$add_runtime_path" = "yes"; then
       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
-echo "configure:2262: checking "for runtime libraries flag"" >&5
+echo "configure:2264: checking "for runtime libraries flag"" >&5
   dash_r=""
   for try_dash_r in "-R" "-R " "-rpath "; do
     xe_check_libs="${try_dash_r}/no/such/file-or-directory"
     cat > conftest.$ac_ext <<EOF
-#line 2267 "configure"
+#line 2269 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   dash_r="$try_dash_r"
 else
@@ -2364,7 +2366,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2368: checking for $ac_word" >&5
+echo "configure:2370: checking for $ac_word" >&5
 
 if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -2417,7 +2419,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2421: checking for a BSD compatible install" >&5
+echo "configure:2423: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 
   IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
@@ -2468,7 +2470,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2472: checking for $ac_word" >&5
+echo "configure:2474: checking for $ac_word" >&5
 
 if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -2499,15 +2501,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2503: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2506 "configure"
+echo "configure:2505: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2508 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2540,15 +2542,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2544: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2547 "configure"
+echo "configure:2546: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2549 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2581,15 +2583,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2585: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2588 "configure"
+echo "configure:2587: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2590 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2595: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2619,10 +2621,10 @@
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2623: checking for sys/wait.h that is POSIX.1 compatible" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2626 "configure"
+echo "configure:2625: checking for sys/wait.h that is POSIX.1 compatible" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2628 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -2638,7 +2640,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:2642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2662,10 +2664,10 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2666: checking for ANSI C header files" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2669 "configure"
+echo "configure:2668: checking for ANSI C header files" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2671 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2673,7 +2675,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2690,7 +2692,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2694 "configure"
+#line 2696 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2708,7 +2710,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
+#line 2714 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2726,7 +2728,7 @@
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 cat > conftest.$ac_ext <<EOF
-#line 2730 "configure"
+#line 2732 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2737,7 +2739,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:2743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   :
 else
@@ -2762,10 +2764,10 @@
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2766: checking whether time.h and sys/time.h may both be included" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2769 "configure"
+echo "configure:2768: checking whether time.h and sys/time.h may both be included" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2771 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2774,7 +2776,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2798,10 +2800,10 @@
 fi
 
 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:2802: checking for sys_siglist declaration in signal.h or unistd.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2805 "configure"
+echo "configure:2804: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2807 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2813,7 +2815,7 @@
 char *msg = *(sys_siglist + 1);
 ; return 0; }
 EOF
-if { (eval echo configure:2817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_siglist=yes
 else
@@ -2838,9 +2840,9 @@
 
 
 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
-echo "configure:2842: checking for struct utimbuf" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2844 "configure"
+echo "configure:2844: checking for struct utimbuf" >&5
+cat > conftest.$ac_ext <<EOF
+#line 2846 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -2859,7 +2861,7 @@
 static struct utimbuf x; x.actime = x.modtime;
 ; return 0; }
 EOF
-if { (eval echo configure:2863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -2879,10 +2881,10 @@
 rm -f conftest*
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2883: checking return type of signal handlers" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2886 "configure"
+echo "configure:2885: checking return type of signal handlers" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2888 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2899,7 +2901,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2921,10 +2923,10 @@
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2925: checking for size_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2928 "configure"
+echo "configure:2927: checking for size_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2930 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2955,10 +2957,10 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2959: checking for pid_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2962 "configure"
+echo "configure:2961: checking for pid_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2964 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2989,10 +2991,10 @@
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2993: checking for uid_t in sys/types.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 2996 "configure"
+echo "configure:2995: checking for uid_t in sys/types.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 2998 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3028,10 +3030,10 @@
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3032: checking for mode_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3035 "configure"
+echo "configure:3034: checking for mode_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3037 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3062,10 +3064,10 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3066: checking for off_t" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3069 "configure"
+echo "configure:3068: checking for off_t" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3071 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3097,9 +3099,9 @@
 
 
 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
-echo "configure:3101: checking for struct timeval" >&5
-cat > conftest.$ac_ext <<EOF
-#line 3103 "configure"
+echo "configure:3103: checking for struct timeval" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3105 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3115,7 +3117,7 @@
 static struct timeval x; x.tv_sec = x.tv_usec;
 ; return 0; }
 EOF
-if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
   HAVE_TIMEVAL=yes
@@ -3137,10 +3139,10 @@
 rm -f conftest*
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3141: checking whether struct tm is in sys/time.h or time.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3144 "configure"
+echo "configure:3143: checking whether struct tm is in sys/time.h or time.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3146 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3148,7 +3150,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3172,10 +3174,10 @@
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3176: checking for tm_zone in struct tm" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3179 "configure"
+echo "configure:3178: checking for tm_zone in struct tm" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3181 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3183,7 +3185,7 @@
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3206,10 +3208,10 @@
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3210: checking for tzname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3213 "configure"
+echo "configure:3212: checking for tzname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3215 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3219,7 +3221,7 @@
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3245,10 +3247,10 @@
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3249: checking for working const" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3252 "configure"
+echo "configure:3251: checking for working const" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3254 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3297,7 +3299,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3322,7 +3324,7 @@
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:3326: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:3328: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 
 cat > conftestmake <<\EOF
@@ -3347,12 +3349,12 @@
 
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3351: checking whether byte ordering is bigendian" >&5
+echo "configure:3353: checking whether byte ordering is bigendian" >&5
 
 ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3356 "configure"
+#line 3358 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3363,11 +3365,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3371 "configure"
+#line 3373 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3378,7 +3380,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3395,7 +3397,7 @@
 rm -f conftest*
 if test $ac_cv_c_bigendian = unknown; then
 cat > conftest.$ac_ext <<EOF
-#line 3399 "configure"
+#line 3401 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3408,7 +3410,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_bigendian=no
 else
@@ -3434,10 +3436,10 @@
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:3438: checking size of short" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3441 "configure"
+echo "configure:3440: checking size of short" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3443 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3448,7 +3450,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -3475,10 +3477,10 @@
   exit 1
 fi
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3479: checking size of int" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3482 "configure"
+echo "configure:3481: checking size of int" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3484 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3489,7 +3491,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -3510,10 +3512,10 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3514: checking size of long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3517 "configure"
+echo "configure:3516: checking size of long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3519 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3524,7 +3526,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -3545,10 +3547,10 @@
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:3549: checking size of long long" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3552 "configure"
+echo "configure:3551: checking size of long long" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3554 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3559,7 +3561,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -3580,10 +3582,10 @@
 
 
 echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:3584: checking size of void *" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 3587 "configure"
+echo "configure:3586: checking size of void *" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 3589 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3594,7 +3596,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:3600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_sizeof_void_p=`cat conftestval`
 else
@@ -3616,7 +3618,7 @@
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:3620: checking for long file names" >&5
+echo "configure:3622: checking for long file names" >&5
 
 ac_cv_sys_long_file_names=yes
 # Test for long file names in all the places we know might matter:
@@ -3663,12 +3665,12 @@
 
 
 echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
-echo "configure:3667: checking for sqrt in -lm" >&5
+echo "configure:3669: checking for sqrt in -lm" >&5
 ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lm "
 cat > conftest.$ac_ext <<EOF
-#line 3672 "configure"
+#line 3674 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3679,7 +3681,7 @@
 sqrt()
 ; return 0; }
 EOF
-if { (eval echo configure:3683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3722,7 +3724,7 @@
 
 
 echo "checking type of mail spool file locking" 1>&6
-echo "configure:3726: checking type of mail spool file locking" >&5
+echo "configure:3728: checking type of mail spool file locking" >&5
 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock
 test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf
 if   test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF
@@ -3746,12 +3748,12 @@
 
 
 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
-echo "configure:3750: checking for kstat_open in -lkstat" >&5
+echo "configure:3752: checking for kstat_open in -lkstat" >&5
 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lkstat "
 cat > conftest.$ac_ext <<EOF
-#line 3755 "configure"
+#line 3757 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3762,7 +3764,7 @@
 kstat_open()
 ; return 0; }
 EOF
-if { (eval echo configure:3766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3796,12 +3798,12 @@
 
 
 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
-echo "configure:3800: checking for kvm_read in -lkvm" >&5
+echo "configure:3802: checking for kvm_read in -lkvm" >&5
 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lkvm "
 cat > conftest.$ac_ext <<EOF
-#line 3805 "configure"
+#line 3807 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3812,7 +3814,7 @@
 kvm_read()
 ; return 0; }
 EOF
-if { (eval echo configure:3816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3846,12 +3848,12 @@
 
 
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:3850: checking for cma_open in -lpthreads" >&5
+echo "configure:3852: checking for cma_open in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpthreads "
 cat > conftest.$ac_ext <<EOF
-#line 3855 "configure"
+#line 3857 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3862,7 +3864,7 @@
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:3866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3898,7 +3900,7 @@
 fi
 
 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
-echo "configure:3902: checking whether the -xildoff compiler flag is required" >&5
+echo "configure:3904: checking whether the -xildoff compiler flag is required" >&5
 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
     then echo "$ac_t""no" 1>&6;
@@ -3909,7 +3911,7 @@
 
 if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then
   echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
-echo "configure:3913: checking for \"-z ignore\" linker flag" >&5
+echo "configure:3915: checking for \"-z ignore\" linker flag" >&5
   case "`ld -h 2>&1`" in
     *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
       ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
@@ -3919,7 +3921,7 @@
 
 
 echo "checking "for specified window system"" 1>&6
-echo "configure:3923: checking "for specified window system"" >&5
+echo "configure:3925: checking "for specified window system"" >&5
 
 if test "$x_includes $x_libraries" = "NONE NONE"; then
   if test -n "$OPENWINHOME" \
@@ -3940,7 +3942,7 @@
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:3944: checking for X" >&5
+echo "configure:3946: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4000,12 +4002,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4004 "configure"
+#line 4006 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4074,14 +4076,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4078 "configure"
+#line 4080 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -4190,17 +4192,17 @@
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:4194: checking whether -R must be followed by a space" >&5
+echo "configure:4196: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 4197 "configure"
+#line 4199 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4216,14 +4218,14 @@
       else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
 	cat > conftest.$ac_ext <<EOF
-#line 4220 "configure"
+#line 4222 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4259,12 +4261,12 @@
 else
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:4263: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:4265: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet "
 cat > conftest.$ac_ext <<EOF
-#line 4268 "configure"
+#line 4270 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4275,7 +4277,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4299,12 +4301,12 @@
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       
 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:4303: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:4305: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet_stub "
 cat > conftest.$ac_ext <<EOF
-#line 4308 "configure"
+#line 4310 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4315,7 +4317,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4344,10 +4346,10 @@
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:4348: checking for gethostbyname" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4351 "configure"
+echo "configure:4350: checking for gethostbyname" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4353 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4370,7 +4372,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -4391,12 +4393,12 @@
     if test $ac_cv_func_gethostbyname = no; then
       
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4395: checking for gethostbyname in -lnsl" >&5
+echo "configure:4397: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lnsl "
 cat > conftest.$ac_ext <<EOF
-#line 4400 "configure"
+#line 4402 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4407,7 +4409,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4437,10 +4439,10 @@
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:4441: checking for connect" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4444 "configure"
+echo "configure:4443: checking for connect" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4446 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4463,7 +4465,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -4486,12 +4488,12 @@
 xe_msg_checking="for connect in -lsocket"
 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:4490: checking "$xe_msg_checking"" >&5
+echo "configure:4492: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4495 "configure"
+#line 4497 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4502,7 +4504,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:4506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4526,10 +4528,10 @@
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:4530: checking for remove" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4533 "configure"
+echo "configure:4532: checking for remove" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4535 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -4552,7 +4554,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -4573,12 +4575,12 @@
     if test $ac_cv_func_remove = no; then
       
 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:4577: checking for remove in -lposix" >&5
+echo "configure:4579: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lposix "
 cat > conftest.$ac_ext <<EOF
-#line 4582 "configure"
+#line 4584 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4589,7 +4591,7 @@
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:4593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4613,10 +4615,10 @@
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:4617: checking for shmat" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4620 "configure"
+echo "configure:4619: checking for shmat" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4622 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -4639,7 +4641,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -4660,12 +4662,12 @@
     if test $ac_cv_func_shmat = no; then
       
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:4664: checking for shmat in -lipc" >&5
+echo "configure:4666: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lipc "
 cat > conftest.$ac_ext <<EOF
-#line 4669 "configure"
+#line 4671 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4676,7 +4678,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:4680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4710,12 +4712,12 @@
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   
 echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:4714: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:4716: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lICE "
 cat > conftest.$ac_ext <<EOF
-#line 4719 "configure"
+#line 4721 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4726,7 +4728,7 @@
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:4730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4858,7 +4860,7 @@
   fi
 
     echo "checking for X defines extracted by xmkmf" 1>&6
-echo "configure:4862: checking for X defines extracted by xmkmf" >&5
+echo "configure:4864: checking for X defines extracted by xmkmf" >&5
   rm -fr conftestdir
   if mkdir conftestdir; then
     cd conftestdir
@@ -4890,15 +4892,15 @@
 
     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
-echo "configure:4894: checking for X11/Intrinsic.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4897 "configure"
+echo "configure:4896: checking for X11/Intrinsic.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 4899 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4922,12 +4924,12 @@
 
       
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:4926: checking for XOpenDisplay in -lX11" >&5
+echo "configure:4928: checking for XOpenDisplay in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 4931 "configure"
+#line 4933 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4938,7 +4940,7 @@
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:4942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4963,12 +4965,12 @@
 xe_msg_checking="for XGetFontProperty in -lX11"
 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:4967: checking "$xe_msg_checking"" >&5
+echo "configure:4969: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 -b i486-linuxaout"
 cat > conftest.$ac_ext <<EOF
-#line 4972 "configure"
+#line 4974 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4979,7 +4981,7 @@
 XGetFontProperty()
 ; return 0; }
 EOF
-if { (eval echo configure:4983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5006,12 +5008,12 @@
 
     
 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
-echo "configure:5010: checking for XShapeSelectInput in -lXext" >&5
+echo "configure:5012: checking for XShapeSelectInput in -lXext" >&5
 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXext "
 cat > conftest.$ac_ext <<EOF
-#line 5015 "configure"
+#line 5017 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5022,7 +5024,7 @@
 XShapeSelectInput()
 ; return 0; }
 EOF
-if { (eval echo configure:5026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5046,12 +5048,12 @@
     case "$opsys" in    sunos4* ) libs_x="-u _XtToolkitInitialize -lXt $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-u _XtToolkitInitialize -lXt\" to \$libs_x"; fi ;;
    * ) 
 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
-echo "configure:5050: checking for XtOpenDisplay in -lXt" >&5
+echo "configure:5052: checking for XtOpenDisplay in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXt "
 cat > conftest.$ac_ext <<EOF
-#line 5055 "configure"
+#line 5057 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5062,7 +5064,7 @@
 XtOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5086,14 +5088,14 @@
   esac
 
   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
-echo "configure:5090: checking the version of X11 being used" >&5
+echo "configure:5092: checking the version of X11 being used" >&5
   cat > conftest.$ac_ext <<EOF
-#line 5092 "configure"
+#line 5094 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
     main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; }
 EOF
-if { (eval echo configure:5097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:5099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest foobar; x11_release=$?
 else
@@ -5117,15 +5119,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5121: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5124 "configure"
+echo "configure:5123: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5126 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5156,7 +5158,7 @@
 
 
     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
-echo "configure:5160: checking for XFree86" >&5
+echo "configure:5162: checking for XFree86" >&5
   if test -d "/usr/X386/include" -o \
           -f "/etc/XF86Config" -o \
 	  -f "/etc/X11/XF86Config" -o \
@@ -5178,12 +5180,12 @@
     * ) if test -z "$with_xmu"; then
 	  
 echo $ac_n "checking for XmuConvertStandardSelection in -lXmu""... $ac_c" 1>&6
-echo "configure:5182: checking for XmuConvertStandardSelection in -lXmu" >&5
+echo "configure:5184: checking for XmuConvertStandardSelection in -lXmu" >&5
 ac_lib_var=`echo Xmu'_'XmuConvertStandardSelection | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXmu "
 cat > conftest.$ac_ext <<EOF
-#line 5187 "configure"
+#line 5189 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5194,7 +5196,7 @@
 XmuConvertStandardSelection()
 ; return 0; }
 EOF
-if { (eval echo configure:5198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5227,19 +5229,19 @@
 
       
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:5231: checking for main in -lXbsd" >&5
+echo "configure:5233: checking for main in -lXbsd" >&5
 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXbsd "
 cat > conftest.$ac_ext <<EOF
-#line 5236 "configure"
+#line 5238 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5262,12 +5264,12 @@
 
     
 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
-echo "configure:5266: checking for XawScrollbarSetThumb in -lXaw" >&5
+echo "configure:5268: checking for XawScrollbarSetThumb in -lXaw" >&5
 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXaw "
 cat > conftest.$ac_ext <<EOF
-#line 5271 "configure"
+#line 5273 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5278,7 +5280,7 @@
 XawScrollbarSetThumb()
 ; return 0; }
 EOF
-if { (eval echo configure:5282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5299,6 +5301,40 @@
 fi
 
 
+  if test "$have_xaw" = "yes"; then
+    ac_safe=`echo "X11/Xaw/Reports.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for X11/Xaw/Reports.h""... $ac_c" 1>&6
+echo "configure:5308: checking for X11/Xaw/Reports.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5311 "configure"
+#include "confdefs.h"
+#include <X11/Xaw/Reports.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+     MAKE_SUBDIR="$MAKE_SUBDIR pkg-src/tree-x" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"pkg-src/tree-x\" to \$MAKE_SUBDIR"; fi
+     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR pkg-src/tree-x" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"pkg-src/tree-x\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  fi
 
 fi 
 test -z "$window_system" && window_system="none"
@@ -5335,15 +5371,15 @@
 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
-echo "configure:5339: checking for X11/Xauth.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5342 "configure"
+echo "configure:5375: checking for X11/Xauth.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5378 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5366,12 +5402,12 @@
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:5370: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:5406: checking for XauGetAuthByAddr in -lXau" >&5
 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXau "
 cat > conftest.$ac_ext <<EOF
-#line 5375 "configure"
+#line 5411 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5382,7 +5418,7 @@
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:5386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5423,15 +5459,15 @@
 
 test -z "$with_offix" && { ac_safe=`echo "OffiX/DragAndDrop.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for OffiX/DragAndDrop.h""... $ac_c" 1>&6
-echo "configure:5427: checking for OffiX/DragAndDrop.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5430 "configure"
+echo "configure:5463: checking for OffiX/DragAndDrop.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5466 "configure"
 #include "confdefs.h"
 #include <OffiX/DragAndDrop.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5454,12 +5490,12 @@
  }
 test -z "$with_offix" && { 
 echo $ac_n "checking for DndInitialize in -lDnd""... $ac_c" 1>&6
-echo "configure:5458: checking for DndInitialize in -lDnd" >&5
+echo "configure:5494: checking for DndInitialize in -lDnd" >&5
 ac_lib_var=`echo Dnd'_'DndInitialize | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lDnd "
 cat > conftest.$ac_ext <<EOF
-#line 5463 "configure"
+#line 5499 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5470,7 +5506,7 @@
 DndInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:5474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5509,15 +5545,15 @@
       for dir in "" "Tt/" "desktop/" ; do
     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
-echo "configure:5513: checking for ${dir}tt_c.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5516 "configure"
+echo "configure:5549: checking for ${dir}tt_c.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5552 "configure"
 #include "confdefs.h"
 #include <${dir}tt_c.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5546,12 +5582,12 @@
 xe_msg_checking="for tt_message_create in -ltt"
 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:5550: checking "$xe_msg_checking"" >&5
+echo "configure:5586: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltt $extra_libs"
 cat > conftest.$ac_ext <<EOF
-#line 5555 "configure"
+#line 5591 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5562,7 +5598,7 @@
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:5566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5611,15 +5647,15 @@
 
 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
-echo "configure:5615: checking for Dt/Dt.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5618 "configure"
+echo "configure:5651: checking for Dt/Dt.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5654 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5642,12 +5678,12 @@
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:5646: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:5682: checking for DtDndDragStart in -lDtSvc" >&5
 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lDtSvc "
 cat > conftest.$ac_ext <<EOF
-#line 5651 "configure"
+#line 5687 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5658,7 +5694,7 @@
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:5662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5691,7 +5727,7 @@
 
   libs_x="-lDtSvc $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lDtSvc\" to \$libs_x"; fi
   with_tooltalk=yes # CDE requires Tooltalk
-  with_motif=yes    # CDE requires Motif
+  need_motif=yes    # CDE requires Motif
 fi
 
 if test "$with_energize" = "yes" ; then
@@ -5705,19 +5741,19 @@
 
   
 echo $ac_n "checking for main in -lenergize""... $ac_c" 1>&6
-echo "configure:5709: checking for main in -lenergize" >&5
+echo "configure:5745: checking for main in -lenergize" >&5
 ac_lib_var=`echo energize'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lenergize "
 cat > conftest.$ac_ext <<EOF
-#line 5714 "configure"
+#line 5750 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5749,19 +5785,19 @@
   if test -z "$energize_version"; then
     
 echo $ac_n "checking for main in -lconn""... $ac_c" 1>&6
-echo "configure:5753: checking for main in -lconn" >&5
+echo "configure:5789: checking for main in -lconn" >&5
 ac_lib_var=`echo conn'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lconn "
 cat > conftest.$ac_ext <<EOF
-#line 5758 "configure"
+#line 5794 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5794,15 +5830,15 @@
   fi
   ac_safe=`echo "editorconn.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for editorconn.h""... $ac_c" 1>&6
-echo "configure:5798: checking for editorconn.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5801 "configure"
+echo "configure:5834: checking for editorconn.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5837 "configure"
 #include "confdefs.h"
 #include <editorconn.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5844,7 +5880,7 @@
 
 
 echo "checking for graphics libraries" 1>&6
-echo "configure:5848: checking for graphics libraries" >&5
+echo "configure:5884: checking for graphics libraries" >&5
 test -z "$with_gif" && with_gif=yes;
 if test "$with_gif" = "yes"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
@@ -5861,10 +5897,10 @@
 fi
 
 echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:5865: checking for Xpm - no older than 3.4f" >&5
+echo "configure:5901: checking for Xpm - no older than 3.4f" >&5
 xe_check_libs=-lXpm
 test -z "$with_xpm" && { cat > conftest.$ac_ext <<EOF
-#line 5868 "configure"
+#line 5904 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
 int main(int c, char **v) {
@@ -5874,7 +5910,7 @@
 		0 ;
 }
 EOF
-if { (eval echo configure:5878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:5914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ./conftest foobar; xpm_status=$?;
   if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi;
@@ -5912,15 +5948,15 @@
 
 test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
-echo "configure:5916: checking for compface.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5919 "configure"
+echo "configure:5952: checking for compface.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5955 "configure"
 #include "confdefs.h"
 #include <compface.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5943,12 +5979,12 @@
  }
 test -z "$with_xface" && { 
 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:5947: checking for UnGenFace in -lcompface" >&5
+echo "configure:5983: checking for UnGenFace in -lcompface" >&5
 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcompface "
 cat > conftest.$ac_ext <<EOF
-#line 5952 "configure"
+#line 5988 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5959,7 +5995,7 @@
 UnGenFace()
 ; return 0; }
 EOF
-if { (eval echo configure:5963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5995,15 +6031,15 @@
 
 test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
-echo "configure:5999: checking for jpeglib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6002 "configure"
+echo "configure:6035: checking for jpeglib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6038 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6026,12 +6062,12 @@
  }
 test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:6030: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:6066: checking for jpeg_destroy_decompress in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ljpeg "
 cat > conftest.$ac_ext <<EOF
-#line 6035 "configure"
+#line 6071 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6042,7 +6078,7 @@
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:6046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6078,15 +6114,15 @@
 
 test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for png.h""... $ac_c" 1>&6
-echo "configure:6082: checking for png.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6085 "configure"
+echo "configure:6118: checking for png.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6121 "configure"
 #include "confdefs.h"
 #include <png.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6108,10 +6144,10 @@
 fi
  }
 test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:6112: checking for pow" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6115 "configure"
+echo "configure:6148: checking for pow" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6151 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -6134,7 +6170,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -6159,12 +6195,12 @@
 xe_msg_checking="for png_read_image in -lpng"
 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:6163: checking "$xe_msg_checking"" >&5
+echo "configure:6199: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpng $extra_libs"
 cat > conftest.$ac_ext <<EOF
-#line 6168 "configure"
+#line 6204 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6175,7 +6211,7 @@
 png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:6179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6225,15 +6261,15 @@
 
   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:6229: checking for Xm/Xm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6232 "configure"
+echo "configure:6265: checking for Xm/Xm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6268 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6250,12 +6286,12 @@
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:6254: checking for XmStringFree in -lXm" >&5
+echo "configure:6290: checking for XmStringFree in -lXm" >&5
 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXm "
 cat > conftest.$ac_ext <<EOF
-#line 6259 "configure"
+#line 6295 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6266,7 +6302,7 @@
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:6270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6514,7 +6550,7 @@
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:6518: checking for Mule-related features" >&5
+echo "configure:6554: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -6531,15 +6567,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6535: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6538 "configure"
+echo "configure:6571: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6574 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6570,12 +6606,12 @@
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:6574: checking for strerror in -lintl" >&5
+echo "configure:6610: checking for strerror in -lintl" >&5
 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lintl "
 cat > conftest.$ac_ext <<EOF
-#line 6579 "configure"
+#line 6615 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6586,7 +6622,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:6590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6619,19 +6655,19 @@
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:6623: checking for Mule input methods" >&5
+echo "configure:6659: checking for Mule input methods" >&5
       test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no
   case "$with_xim" in "" | "yes" )
     echo "checking for XIM" 1>&6
-echo "configure:6627: checking for XIM" >&5
+echo "configure:6663: checking for XIM" >&5
     
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:6630: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:6666: checking for XmImMbLookupString in -lXm" >&5
 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXm "
 cat > conftest.$ac_ext <<EOF
-#line 6635 "configure"
+#line 6671 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6642,7 +6678,7 @@
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:6646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6704,15 +6740,15 @@
     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
-echo "configure:6708: checking for wnn/jllib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6711 "configure"
+echo "configure:6744: checking for wnn/jllib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6747 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6733,14 +6769,121 @@
 with_wnn=no
 fi
  }
-  test -z "$with_wnn" && { 
+    if test "$with_wnn" != "no"; then
+    for ac_func in crypt
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6777: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6780 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_func
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+}
+ 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+    test "$ac_cv_func_crypt" != "yes" && { 
+echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
+echo "configure:6832: checking for crypt in -lcrypt" >&5
+ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lcrypt "
+cat > conftest.$ac_ext <<EOF
+#line 6837 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char crypt();
+
+int main() {
+crypt()
+; return 0; }
+EOF
+if { (eval echo configure:6848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_lib
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+}
+
+  LIBS="-lcrypt $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcrypt\" to \$LIBS"; fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+ }
+  fi
+    test -z "$with_wnn" && { 
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:6739: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:6882: checking for jl_dic_list_e in -lwnn" >&5
 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn "
 cat > conftest.$ac_ext <<EOF
-#line 6744 "configure"
+#line 6887 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6751,7 +6894,7 @@
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:6755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6788,12 +6931,12 @@
  fi
     
 echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6
-echo "configure:6792: checking for jl_fi_dic_list in -lwnn" >&5
+echo "configure:6935: checking for jl_fi_dic_list in -lwnn" >&5
 ac_lib_var=`echo wnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn "
 cat > conftest.$ac_ext <<EOF
-#line 6797 "configure"
+#line 6940 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6804,7 +6947,7 @@
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:6808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6836,15 +6979,15 @@
 
     test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
-echo "configure:6840: checking for canna/RK.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6843 "configure"
+echo "configure:6983: checking for canna/RK.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6986 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6867,12 +7010,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:6871: checking for RkBgnBun in -lRKC" >&5
+echo "configure:7014: checking for RkBgnBun in -lRKC" >&5
 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lRKC "
 cat > conftest.$ac_ext <<EOF
-#line 6876 "configure"
+#line 7019 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6883,7 +7026,7 @@
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:6887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6906,12 +7049,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:6910: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:7053: checking for jrKanjiControl in -lcanna" >&5
 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcanna "
 cat > conftest.$ac_ext <<EOF
-#line 6915 "configure"
+#line 7058 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6922,7 +7065,7 @@
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:6926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7019,13 +7162,13 @@
 
 fi
 
-for ac_func in acosh asinh atanh cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset utimes waitpid
+for ac_func in acosh asinh atanh cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset usleep utimes waitpid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7026: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7029 "configure"
+echo "configure:7169: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7172 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7048,7 +7191,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7085,10 +7228,10 @@
     for ac_func in realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7089: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7092 "configure"
+echo "configure:7232: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7235 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7111,7 +7254,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7144,16 +7287,16 @@
 esac
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:7148: checking whether netdb declares h_errno" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7150 "configure"
+echo "configure:7291: checking whether netdb declares h_errno" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7293 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:7157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -7173,16 +7316,16 @@
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:7177: checking for sigsetjmp" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7179 "configure"
+echo "configure:7320: checking for sigsetjmp" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7322 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:7186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -7202,11 +7345,11 @@
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:7206: checking whether localtime caches TZ" >&5
+echo "configure:7349: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 7210 "configure"
+#line 7353 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -7241,7 +7384,7 @@
   exit (0);
 }
 EOF
-if { (eval echo configure:7245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:7388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
@@ -7270,9 +7413,9 @@
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday cannot accept two arguments""... $ac_c" 1>&6
-echo "configure:7274: checking whether gettimeofday cannot accept two arguments" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7276 "configure"
+echo "configure:7417: checking whether gettimeofday cannot accept two arguments" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7419 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -7294,7 +7437,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
 else
@@ -7316,19 +7459,19 @@
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:7320: checking for inline" >&5
+echo "configure:7463: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 7325 "configure"
+#line 7468 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:7332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -7378,17 +7521,17 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:7382: checking for working alloca.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7385 "configure"
+echo "configure:7525: checking for working alloca.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7528 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:7392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -7412,10 +7555,10 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:7416: checking for alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7419 "configure"
+echo "configure:7559: checking for alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7562 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -7438,7 +7581,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:7442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -7477,10 +7620,10 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:7481: checking whether alloca needs Cray hooks" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7484 "configure"
+echo "configure:7624: checking whether alloca needs Cray hooks" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7627 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -7504,10 +7647,10 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7508: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7511 "configure"
+echo "configure:7651: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7654 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7530,7 +7673,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7560,10 +7703,10 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:7564: checking stack direction for C alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7567 "configure"
+echo "configure:7707: checking stack direction for C alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7710 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -7582,7 +7725,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:7586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:7729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
@@ -7610,15 +7753,15 @@
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:7614: checking for vfork.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7617 "configure"
+echo "configure:7757: checking for vfork.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7760 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7646,10 +7789,10 @@
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:7650: checking for working vfork" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7653 "configure"
+echo "configure:7793: checking for working vfork" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7796 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -7744,7 +7887,7 @@
   }
 }
 EOF
-if { (eval echo configure:7748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:7891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_vfork_works=yes
 else
@@ -7769,10 +7912,10 @@
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:7773: checking for working strcoll" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7776 "configure"
+echo "configure:7916: checking for working strcoll" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7919 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -7782,7 +7925,7 @@
 	strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:7786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:7929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
@@ -7809,10 +7952,10 @@
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7813: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7816 "configure"
+echo "configure:7956: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7959 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7835,7 +7978,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7863,10 +8006,10 @@
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7867: checking whether getpgrp takes no argument" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7870 "configure"
+echo "configure:8010: checking whether getpgrp takes no argument" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8013 "configure"
 #include "confdefs.h"
 
 /*
@@ -7921,7 +8064,7 @@
 }
 
 EOF
-if { (eval echo configure:7925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
@@ -7947,10 +8090,10 @@
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:7951: checking for working mmap" >&5
+echo "configure:8094: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 7954 "configure"
+#line 8097 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -7983,7 +8126,7 @@
   return 1;
 }
 EOF
-if { (eval echo configure:7987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   have_mmap=yes
 else
@@ -8016,10 +8159,10 @@
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:8020: checking for socket" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8023 "configure"
+echo "configure:8163: checking for socket" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8166 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -8042,7 +8185,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -8057,15 +8200,15 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
-echo "configure:8061: checking for netinet/in.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8064 "configure"
+echo "configure:8204: checking for netinet/in.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8207 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8082,15 +8225,15 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
-echo "configure:8086: checking for arpa/inet.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8089 "configure"
+echo "configure:8229: checking for arpa/inet.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8232 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8115,9 +8258,9 @@
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:8119: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:8262: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 8121 "configure"
+#line 8264 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -8128,7 +8271,7 @@
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:8132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SOCKADDR_SUN_LEN
@@ -8159,10 +8302,10 @@
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:8163: checking for msgget" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8166 "configure"
+echo "configure:8306: checking for msgget" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8309 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -8185,7 +8328,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -8200,15 +8343,15 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
-echo "configure:8204: checking for sys/ipc.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8207 "configure"
+echo "configure:8347: checking for sys/ipc.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8350 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8225,15 +8368,15 @@
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
-echo "configure:8229: checking for sys/msg.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8232 "configure"
+echo "configure:8372: checking for sys/msg.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8375 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8271,15 +8414,15 @@
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:8275: checking for dirent.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8278 "configure"
+echo "configure:8418: checking for dirent.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8421 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8306,15 +8449,15 @@
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
-echo "configure:8310: checking for sys/dir.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8313 "configure"
+echo "configure:8453: checking for sys/dir.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8456 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8347,15 +8490,15 @@
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:8351: checking for nlist.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8354 "configure"
+echo "configure:8494: checking for nlist.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8497 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8459,7 +8602,7 @@
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:8463: checking "for sound support"" >&5
+echo "configure:8606: checking "for sound support"" >&5
 case "$with_sound" in
   native | both ) with_native_sound=yes;;
   nas    | no   ) with_native_sound=no;;
@@ -8470,15 +8613,15 @@
     if test -n "$native_sound_lib"; then
     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
-echo "configure:8474: checking for multimedia/audio_device.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8477 "configure"
+echo "configure:8617: checking for multimedia/audio_device.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8620 "configure"
 #include "confdefs.h"
 #include <multimedia/audio_device.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8526,12 +8669,12 @@
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:8530: checking for ALopenport in -laudio" >&5
+echo "configure:8673: checking for ALopenport in -laudio" >&5
 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -laudio "
 cat > conftest.$ac_ext <<EOF
-#line 8535 "configure"
+#line 8678 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8542,7 +8685,7 @@
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:8546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8573,12 +8716,12 @@
       if test -z "$native_sound_lib"; then
 	
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:8577: checking for AOpenAudio in -lAlib" >&5
+echo "configure:8720: checking for AOpenAudio in -lAlib" >&5
 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lAlib "
 cat > conftest.$ac_ext <<EOF
-#line 8582 "configure"
+#line 8725 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8589,7 +8732,7 @@
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:8593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8627,15 +8770,15 @@
     for dir in "machine" "sys" "linux"; do
       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
-echo "configure:8631: checking for ${dir}/soundcard.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8634 "configure"
+echo "configure:8774: checking for ${dir}/soundcard.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8777 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8705,7 +8848,7 @@
  fi
   LIBS="-laudio $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$LIBS"; fi
       cat > conftest.$ac_ext <<EOF
-#line 8709 "configure"
+#line 8852 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -8732,7 +8875,7 @@
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:8736: checking for TTY-related features" >&5
+echo "configure:8879: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -8747,15 +8890,15 @@
 
       ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:8751: checking for termios.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8754 "configure"
+echo "configure:8894: checking for termios.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8897 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8782,15 +8925,15 @@
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
-echo "configure:8786: checking for termio.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8789 "configure"
+echo "configure:8929: checking for termio.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8932 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8823,12 +8966,12 @@
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:8827: checking for tgetent in -lncurses" >&5
+echo "configure:8970: checking for tgetent in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lncurses "
 cat > conftest.$ac_ext <<EOF
-#line 8832 "configure"
+#line 8975 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8839,7 +8982,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:8843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8872,15 +9015,15 @@
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:8876: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8879 "configure"
+echo "configure:9019: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9022 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8902,15 +9045,15 @@
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:8906: checking for ncurses/term.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8909 "configure"
+echo "configure:9049: checking for ncurses/term.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9052 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8940,15 +9083,15 @@
       c_switch_site="$c_switch_site -I/usr/include/ncurses"
       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:8944: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8947 "configure"
+echo "configure:9087: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9090 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8983,12 +9126,12 @@
 	for lib in curses termlib termcap; do
 	  
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:8987: checking for tgetent in -l$lib" >&5
+echo "configure:9130: checking for tgetent in -l$lib" >&5
 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$lib "
 cat > conftest.$ac_ext <<EOF
-#line 8992 "configure"
+#line 9135 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8999,7 +9142,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9030,12 +9173,12 @@
       else
 	
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:9034: checking for tgetent in -lcurses" >&5
+echo "configure:9177: checking for tgetent in -lcurses" >&5
 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcurses "
 cat > conftest.$ac_ext <<EOF
-#line 9039 "configure"
+#line 9182 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9046,7 +9189,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9064,12 +9207,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:9068: checking for tgetent in -ltermcap" >&5
+echo "configure:9211: checking for tgetent in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltermcap "
 cat > conftest.$ac_ext <<EOF
-#line 9073 "configure"
+#line 9216 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9080,7 +9223,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9128,15 +9271,15 @@
 
     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
-echo "configure:9132: checking for gpm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9135 "configure"
+echo "configure:9275: checking for gpm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9278 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9159,12 +9302,12 @@
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:9163: checking for Gpm_Open in -lgpm" >&5
+echo "configure:9306: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgpm "
 cat > conftest.$ac_ext <<EOF
-#line 9168 "configure"
+#line 9311 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9175,7 +9318,7 @@
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:9179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9224,17 +9367,17 @@
 
 
 echo "checking for database support" 1>&6
-echo "configure:9228: checking for database support" >&5
+echo "configure:9371: checking for database support" >&5
 
 if test "$with_database_gnudbm" != "no"; then
   
 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:9233: checking for dbm_open in -lgdbm" >&5
+echo "configure:9376: checking for dbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgdbm "
 cat > conftest.$ac_ext <<EOF
-#line 9238 "configure"
+#line 9381 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9245,7 +9388,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:9249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9267,10 +9410,10 @@
 
   if test "$with_database_gnudbm" != "yes"; then
     echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:9271: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9274 "configure"
+echo "configure:9414: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9417 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -9293,7 +9436,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -9329,10 +9472,10 @@
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:9333: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9336 "configure"
+echo "configure:9476: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9479 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -9355,7 +9498,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -9376,12 +9519,12 @@
   if test "$need_libdbm" != "no"; then
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:9380: checking for dbm_open in -ldbm" >&5
+echo "configure:9523: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldbm "
 cat > conftest.$ac_ext <<EOF
-#line 9385 "configure"
+#line 9528 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9392,7 +9535,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:9396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9429,10 +9572,10 @@
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:9433: checking for dbopen" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9436 "configure"
+echo "configure:9576: checking for dbopen" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9579 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -9455,7 +9598,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -9476,12 +9619,12 @@
   if test "$need_libdb" != "no"; then
     
 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:9480: checking for dbopen in -ldb" >&5
+echo "configure:9623: checking for dbopen in -ldb" >&5
 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldb "
 cat > conftest.$ac_ext <<EOF
-#line 9485 "configure"
+#line 9628 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9492,7 +9635,7 @@
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:9496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9516,7 +9659,7 @@
   if test "$with_database_berkdb" = "yes"; then
     for path in "db/db.h" "db.h"; do
 cat > conftest.$ac_ext <<EOF
-#line 9520 "configure"
+#line 9663 "configure"
 #include "confdefs.h"
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
@@ -9534,7 +9677,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_path="$path"; break
 else
@@ -9586,12 +9729,12 @@
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:9590: checking for SOCKSinit in -lsocks" >&5
+echo "configure:9733: checking for SOCKSinit in -lsocks" >&5
 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocks "
 cat > conftest.$ac_ext <<EOF
-#line 9595 "configure"
+#line 9738 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9602,7 +9745,7 @@
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:9606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9714,7 +9857,11 @@
 SUBDIR_MAKEFILES=''
 test -d lock || mkdir lock
 for dir in $MAKE_SUBDIR; do
-  test -d "$dir" || mkdir "$dir"
+  case "$dir" in */* )     ( for d in `echo $dir | sed 's:/: :g'` ; do
+        test -d "$d" || mkdir "$d"; cd "$d"
+      done ) ;;
+   * ) test -d "$dir" || mkdir "$dir" ;;
+  esac
   
 T=""
 for W in $SUBDIR_MAKEFILES $dir/Makefile; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done
@@ -9729,6 +9876,7 @@
 
 
 
+
 for dir in src/s src/m; do
   if test ! -d "$dir" ; then
     echo Making symbolic link to "$srcdir/$dir"
@@ -9902,14 +10050,6 @@
 }
 
 fi
-test "$with_motif"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
-    Defining LWLIB_USES_MOTIF
-EOF
-cat >> confdefs.h <<\EOF
-#define LWLIB_USES_MOTIF 1
-EOF
-}
-
 test "$with_i18n3"         = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF
     Defining I18N3
 EOF
@@ -10318,6 +10458,7 @@
 s%@lwlib_objs@%$lwlib_objs%g
 s%@ALLOCA@%$ALLOCA%g
 s%@SRC_SUBDIR_DEPS@%$SRC_SUBDIR_DEPS%g
+s%@INSTALL_ARCH_DEP_SUBDIR@%$INSTALL_ARCH_DEP_SUBDIR%g
 s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
 s%@SUBDIR_MAKEFILES@%$SUBDIR_MAKEFILES%g
 s%@version@%$version%g
--- a/configure.in	Mon Aug 13 09:44:44 2007 +0200
+++ b/configure.in	Mon Aug 13 09:45:46 2007 +0200
@@ -313,6 +313,7 @@
 dnl -----------------------------
 
 XE_APPEND(lib-src, MAKE_SUBDIR)
+XE_APPEND(lib-src, INSTALL_ARCH_DEP_SUBDIR)
 
 dnl run_in_place='no'
 prefix='/usr/local'
@@ -1613,6 +1614,7 @@
 AC_MSG_CHECKING(whether we are using SunPro C)
 AC_TRY_COMPILE([],[#ifndef __SUNPRO_C
 #error Not a  SunPro compiler :-(
+******* ======= ******** &&&&&&&&
 #endif
 ], __sunpro_c=yes, __sunpro_c=no)
 AC_MSG_RESULT($__sunpro_c)
@@ -2311,6 +2313,11 @@
 
   dnl Autodetect -lXaw
   AC_CHECK_LIB(Xaw, XawScrollbarSetThumb, have_xaw=yes, have_xaw=no)
+  if test "$have_xaw" = "yes"; then
+    AC_CHECK_HEADER(X11/Xaw/Reports.h, [
+     XE_APPEND(pkg-src/tree-x, MAKE_SUBDIR)
+     XE_APPEND(pkg-src/tree-x, INSTALL_ARCH_DEP_SUBDIR)])
+  fi
 
 fi dnl $with_x11 = yes
 
@@ -2399,7 +2406,7 @@
   AC_DEFINE(HAVE_CDE)
   XE_PREPEND(-lDtSvc, libs_x)
   with_tooltalk=yes # CDE requires Tooltalk
-  with_motif=yes    # CDE requires Motif
+  need_motif=yes    # CDE requires Motif
 fi
 
 dnl if Energize specified, make sure we can find its need libraries/headers
@@ -2620,7 +2627,13 @@
 
   dnl Autodetect WNN
   test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
-  test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/jllib.h,      ,with_wnn=no) }
+  test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/jllib.h, ,with_wnn=no) }
+  dnl Detour to find crypt
+  if test "$with_wnn" != "no"; then
+    AC_CHECK_FUNCS(crypt)
+    test "$ac_cv_func_crypt" != "yes" && { AC_CHECK_LIB(crypt, crypt) }
+  fi
+  dnl Back to our regularly scheduled wnn hunting
   test -z "$with_wnn" && { AC_CHECK_LIB(wnn,jl_dic_list_e,[:],with_wnn=no) }
   test -z "$with_wnn" && with_wnn=yes
   if test "$with_wnn" = "yes"; then
@@ -2658,7 +2671,7 @@
   XE_COMPUTE_RUNPATH()
 fi
 
-AC_CHECK_FUNCS(acosh asinh atanh cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset utimes waitpid)
+AC_CHECK_FUNCS(acosh asinh atanh cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset usleep utimes waitpid)
 
 dnl realpath is buggy on linux, decosf and aix4
 
@@ -3177,10 +3190,16 @@
 SUBDIR_MAKEFILES=''
 test -d lock || mkdir lock
 for dir in $MAKE_SUBDIR; do
-  test -d "$dir" || mkdir "$dir"
+  case "$dir" in */* ) dnl Implement mkdir -p
+    ( for d in `echo $dir | sed 's:/: :g'` ; do
+        test -d "$d" || mkdir "$d"; cd "$d"
+      done ) ;;
+   * ) test -d "$dir" || mkdir "$dir" ;;
+  esac
   XE_SPACE(SUBDIR_MAKEFILES, $SUBDIR_MAKEFILES $dir/Makefile)
   XE_SPACE(internal_makefile_list, $internal_makefile_list $dir/Makefile.in)
 done
+AC_SUBST(INSTALL_ARCH_DEP_SUBDIR)
 AC_SUBST(MAKE_SUBDIR)
 AC_SUBST(SUBDIR_MAKEFILES)
 
@@ -3303,7 +3322,6 @@
 if   test "$GNU_MALLOC"        = "yes"; then AC_DEFINE(GNU_MALLOC)
 elif test "$use_system_malloc" = "yes"; then AC_DEFINE(USE_SYSTEM_MALLOC)
 fi
-test "$with_motif"         = "yes" && AC_DEFINE(LWLIB_USES_MOTIF)
 test "$with_i18n3"         = "yes" && AC_DEFINE(I18N3)
 test "$with_gcc"           = "yes" && AC_DEFINE(USE_GCC)
 test "$with_term"          = "yes" && AC_DEFINE(HAVE_TERM)
--- a/etc/HELLO	Mon Aug 13 09:44:44 2007 +0200
+++ b/etc/HELLO	Mon Aug 13 09:45:46 2007 +0200
@@ -20,7 +20,7 @@
 Maltese			Ciao
 Nederlands, Vlaams	Hallo, Dag
 Norwegian (Norsk)	Hei, God dag
-Polish			Dzien Dobry, Hej
+Polish			Cze,B6f(B!
 Russian (,L@caaZXY(B)	,L7T`PRabRcYbU(B!
 Spanish (Espa,Aq(Bol)	,A!(BHola!
 Swedish (Svenska)	Hej, Goddag
--- a/etc/NEWS	Mon Aug 13 09:44:44 2007 +0200
+++ b/etc/NEWS	Mon Aug 13 09:45:46 2007 +0200
@@ -138,6 +138,13 @@
 creating a new frame with `C-x 5 2' also raises and selects that
 frame.  The behavior of window system frames is unchanged.
 
+** Abbreviations can now contain non-word characters.
+
+This means that it is finally possible to do such simple things as
+define `#if' to expand to `#include' in C mode, `s-c-b' to
+`save-current-buffer' in Lisp mode, `call/cc' to
+`call-with-current-continuation' in Scheme mode, etc.
+
 ** `C-x n d' now runs the new command `narrow-to-defun',
 which narrows the accessible parts of the buffer to just
 the current defun.
@@ -149,9 +156,10 @@
 ** arc-mode has a new function called `archive-quit' bound to q, which
 quits archive mode in the same fashion dired-quit works.
  
-** The feature to teach the key bindings of extended commands after
-the command finishes.  The message suggesting key bindings appears
-temporarily in the echo area.  The previous echo area contents come
+** The feature to teach the key bindings of extended commands now
+prints the message after the command finishes.  After some time, the
+previous echo area contents is restored (in case the command prints
+something useful.)
 
 ** XEmacs can now save the minibuffer histories from various
 minibuffers.  To use this feature, add the line:
--- a/lib-src/ChangeLog	Mon Aug 13 09:44:44 2007 +0200
+++ b/lib-src/ChangeLog	Mon Aug 13 09:45:46 2007 +0200
@@ -1,3 +1,13 @@
+1997-06-27  Steven L Baur  <steve@altair.xemacs.org>
+
+	* update-autoloads.sh:  Major rework.  Avoid looking at MULE
+	directories if not running XEmacs/Mule.
+	- Look into all Mule directories for building autoloads.
+
+	* update-elc.sh (make_special_commands): Fix handling of
+	bytecompilation of AUCTeX to avoid looking at tex-jp.el if not
+	running MULE.
+
 1997-06-24  Steven L Baur  <steve@altair.xemacs.org>
 
 	* gnuattach: Needed executable bit set.
--- a/lib-src/Makefile.in.in	Mon Aug 13 09:44:44 2007 +0200
+++ b/lib-src/Makefile.in.in	Mon Aug 13 09:45:46 2007 +0200
@@ -128,10 +128,6 @@
 ld_libs_window_system=@ld_libs_window_system@
 ld_libs_all=@ld_libs_all@
 
-LOADLIBES=$(ld_switch_general) $(ld_libs_general)
-LOAD_X_LIBES=$(ld_switch_window_system)
-C_SWITCH_X=$(c_switch_window_system)
-
 ## We need to #define emacs to get the right versions of some files.
 
 lib_src_cppflags = -Demacs -I../src -I${srcdir} -I${srcdir}/../src $(CPPFLAGS)
--- a/lib-src/gnuclient.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/lib-src/gnuclient.c	Mon Aug 13 09:45:46 2007 +0200
@@ -78,7 +78,7 @@
 
 void initialize_signals (void);
 
-void
+static void
 tell_emacs_to_resume (int sig)
 {
   char buffer[GSERV_BUFSZ+1];
@@ -104,7 +104,7 @@
 #endif /* !SYSV_IPC */
 }
 
-void
+static void
 pass_signal_to_emacs (int sig)
 {
   if (kill (emacs_pid, sig) == -1)
@@ -196,7 +196,7 @@
 
 /* Encase the string in quotes, escape all the backslashes and quotes
    in string.  */
-char *
+static char *
 clean_string (CONST char *s)
 {
   int i = 0;
--- a/lib-src/update-autoloads.sh	Mon Aug 13 09:44:44 2007 +0200
+++ b/lib-src/update-autoloads.sh	Mon Aug 13 09:45:46 2007 +0200
@@ -1,6 +1,16 @@
 #!/bin/sh
 ### update-autoloads.sh --- update auto-autoloads.el as necessary
 
+# Author: Jamie Zawinski, Ben Wing, Martin Buchholz, Steve Baur
+# Maintainer: Steve Baur
+# Keywords: internal
+
+### This file is part of XEmacs
+
+### Commentary:
+
+### Code:
+
 set -eu
 
 # This means we're running in a Sun workspace
@@ -9,8 +19,8 @@
 # get to the right directory
 test ! -d ./lisp -a -d ../lisp && cd ..
 if test ! -d ./lisp ; then
-  echo $0: neither ./lisp/ nor ../lisp/ exist
-  exit 1
+	echo $0: neither ./lisp/ nor ../lisp/ exist
+	exit 1
 fi
 
 EMACS="./src/xemacs"
@@ -20,27 +30,50 @@
 
 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
 
-echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
+echo "Rebuilding autoloads/custom-loads in `pwd|sed 's|^/tmp_mnt||'`"
 echo "          with $REAL..."
 
+if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
+  echon()
+  {    
+    /bin/echo $* '\c'
+  }
+else
+  echon()
+  {
+    echo -n $*
+  }
+fi
+
+# Compute patterns to ignore when searching for files
+ignore_dirs=""
+
+# Only use Mule XEmacs to build Mule-specific autoloads & custom-loads.
+echon "Checking for Mule support..."
+lisp_prog='(princ (featurep (quote mule)))'
+mule_p="`$EMACS -batch -no-site-file -eval \"$lisp_prog\"`"
+if test "$mule_p" = nil ; then
+	echo No
+	ignore_dirs="$ignore_dirs its egg mule leim"
+else
+	echo Yes
+fi
+
 dirs=
 for dir in lisp/*; do
-  if test -d $dir \
-   -a $dir != lisp/CVS \
-   -a $dir != lisp/SCCS \
-   -a $dir != lisp/egg \
-   -a $dir != lisp/its \
-   -a $dir != lisp/language \
-   -a $dir != lisp/leim; then
-    dirs="$dirs $dir"
-  fi
+	if test -d $dir \
+		-a $dir != lisp/CVS \
+		-a $dir != lisp/SCCS \
+		-a $dir != lisp/language; then
+		for ignore in $ignore_dirs; do
+			if test $dir = lisp/$ignore; then
+				continue 2
+			fi
+		done
+		dirs="$dirs $dir"
+	fi
 done
-# cat > lisp/prim/auto-autoloads.el << EOF
-# ;;; Do NOT edit this file!
-# ;;; It is automatically generated using "make autoloads"
-# ;;; See update-autoloads.sh and autoload.el for more details.
-# 
-# EOF
+
 set -x
 for dir in $dirs; do
 	$EMACS -batch -q -l autoload -f batch-update-directory $dir
--- a/lib-src/update-elc.sh	Mon Aug 13 09:44:44 2007 +0200
+++ b/lib-src/update-elc.sh	Mon Aug 13 09:45:46 2007 +0200
@@ -108,7 +108,11 @@
 #make_special vm
 #make_special ediff elc
 #make_special viper elc
-make_special auctex some
+if test "$mule_p" = nil ; then
+	make_special auctex some
+else
+	make_special auctex some MULE_ELC=tex-jp.elc
+fi
 make_special cc-mode all
 make_special efs x20
 make_special eos -k		# not strictly necessary...
--- a/lisp/ChangeLog	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/ChangeLog	Mon Aug 13 09:45:46 2007 +0200
@@ -1,3 +1,181 @@
+1997-06-29  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* modes/abbrev.el (define-mode-abbrev): Would ignore EXPANSION.
+
+1997-06-28  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* modes/abbrev.el (define-abbrev): If NAME contains a non-word
+ 	character, intern a ` ' symbol in the obarray.
+
+1997-06-29  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/files.el (auto-mode-alist): Set image-mode for various
+	image file names (JPEG, GIF, PNG, and xpm).
+
+Sun Jun 29 03:02:10 1997  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* src/undo.c (record_extent):
+	  If the extent's object is a string, just return.  We
+	  can't record undo information for strings, and it is
+	  very bad to reference through a string pointer as if it 
+	  were a buffer pointer.
+
+1997-06-28  Steven L Baur  <steve@altair.xemacs.org>
+
+	* utils/delbs.el: Removed as obsolete.
+	Suggested by Gary D. Foster <Gary.Foster@Corp.Sun.COM>
+
+	* packages/hyper-apropos.el (hyper-apropos-documentation): Remove
+	obsolete alias.
+	(hyper-apropos-hyperlink): Ditto.
+	(hyper-apropos-major-heading): Ditto.
+	(hyper-apropos-section-heading): Ditto.
+	(hyper-apropos-heading): Ditto.
+	(hyper-apropos-warning): Ditto.
+	From Hrvoje Niksic <hniksic@srce.hr>
+
+	* prim/simple.el (show-message-log): Restore an oldie-but
+	prematurely-retired-goodie.
+
+	* x11/x-menubar.el (default-menubar): Restore Show Message Log
+	command in Edit menu.
+
+	* mule/mule-util.el: Change defsubst to defun for
+	string-to-sequence, string-to-list, string-to-vector,
+	nested-alist-p to shut up build time diagnostics.
+
+	* prim/loadup.el (Top level): Added instrumentation to diagnose
+	where the 0 property list is getting added at dump.  Naturally, I
+	cannot reproduce the problem now.
+
+	* modes/abbrev.el (define-abbrev): Trap nil tables (which might
+	cause bogus plists to get put into obarray).
+	Fix docstring.
+
+1997-06-27  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* modes/auto-show.el:  Customized.
+
+1997-06-27  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/make-docfile.el: [oops] Check auto-autoloads.elc for
+	out-of-dated-ness too.
+
+	* utils/autoload.el (batch-update-directory): Kill command line
+	args when done.
+	(autoload-save-customization): Print a warning message with the
+	offending symbol when we run across the elusive malformed property 
+	list ((0 0)).
+
+1997-06-26  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* prim/profile.el (profile-key-sequence): New function.
+	(pretty-print-profiling-info): Allow interactive calls.
+
+	* prim/overlay.el: Make more FSF compatible.
+	
+1997-06-27  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/loaddefs.el (debug-ignored-errors): Fix regexps.
+	From Hrvoje Niksic <hniksic@srce.hr>
+
+	* hyperbole/wrolo-menu.el (TopLevel): Fix tests so that W3's
+	id-menubar simulation doesn't bollux up feature tests.
+
+	* prim/about.el (about-xemacs): Adjust planned release date.
+
+1997-06-26  Steven L Baur  <steve@altair.xemacs.org>
+
+	* prim/cus-load.el: Use correct load name.
+	- Silence the load messages.
+
+	* mule/mule-util.el (string-to-sequence): Spelling correction.
+
+	* prim/make-docfile.el: Don't overwrite DOC file when it is
+	up-to-date.
+
+1997-06-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* language/chinese.el: Add chinese-isoir165 (CCITT Extended GB).
+
+	* language/chinese.el: Modify charset DOC-strings for CNS 11643 to
+	be more detailed.
+
+	* language/arabic.el: (require 'language/arabic-util) instead
+	of (require 'arabic) for Arabic environment.
+
+	* language/arabic-util.el: Provide `language/arabic-util' instead
+	of `arabic'.
+
+	* language/arabic.el: Rename `arabic-0', `arabic-1' and `arabic-2'
+	to `arabic-digit', `arabic-1-column' and `arabic-2-column' to sync
+	with Emacs/mule-19.34.94-zeta.
+
+	* tl/char-table.el (char-position-to-string): Use `defsubst'.
+	(char-table-1): New implementation.
+
+	Use BOX DRAWINGS characters of JIS X0208.
+
+1997-06-28  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* apel/richtext.el: Add autoload comments for `richtext-encode'
+	and `richtext-decode'.
+
+	* prim/format.el (format-alist): Add `text/richtext'.
+
+	* modes/image-mode.el (image-decode): Display description for some
+	commands when XEmacs cannot decodes current buffer as inline
+	image.
+
+	* tl/chartblxmas.el: New file.
+
+	* tl/char-table.el (view-charset): Use `view-buffer'.
+
+	* x11/x-menubar.el (default-menubar): Add "Show character table"
+	for MULE menu.
+
+	* apel/emu.el: Check richtext.el is bundled.
+
+	* tl/char-table.el: Use `charset-doc-string' directly.
+
+	* tl/char-table.el (view-charset): New command.
+
+	* tl/char-table.el: `show-char-table' -> `insert-charset-table'.
+
+	* tl/char-table.el: `show-96x96-table' ->
+	`insert-96x96-charset-table'.
+
+	* tl/char-table.el: `show-94x94-table' ->
+	`insert-94x94-charset-table'.
+
+	* tl/char-table.el: `show-96-table' -> `insert-96-charset-table'.
+
+	* tl/char-table.el: `show-94-table' -> `insert-94-charset-table'.
+
+	* tl/char-table.el: Use `insert'.
+
+	* packages/hexl.el (hexl-mode-exit): Run `hexl-mode-exit-hook'.
+
+	* x11/x-menubar.el (default-menubar): Fix "Describe language
+	support" and "Set language environment" of mule menu.
+
+	* apel/file-detect.el: Add autoload comments for function
+	`add-path', `add-latest-path', `get-latest-path',
+	`file-installed-p', `exec-installed-p', `module-installed-p' and
+	variable `exec-suffix-list'.
+
+	* prim/format.el (format-alist): Add image/jpeg, image/gif,
+	image/png and image/x-xpm.
+
+	* modes/image-mode.el: New file.
+
+1997-06-27  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* tm/tm-ew-e.el (tm-eword::encode-string-1): avoid infinite loop
+	caused by long non-encoded-word element. (cf. [tm-en:1356])
+
+	(mime/field-encoding-method-alist): Add "Message-ID" as ignored.
+
 1997-06-25  Steven L Baur  <steve@altair.xemacs.org>
 
 	* x11/x-menubar.el(default-menubar): Comment out changes to the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/apel/auto-autoloads.el	Mon Aug 13 09:45:46 2007 +0200
@@ -0,0 +1,63 @@
+;;; DO NOT MODIFY THIS FILE
+(if (not (featurep 'apel-autoloads))
+    (progn
+
+(provide 'apel-autoloads)
+))
+
+;;;### (autoloads (module-installed-p exec-installed-p file-installed-p get-latest-path add-latest-path add-path) "file-detect" "apel/file-detect.el")
+
+(autoload 'add-path "file-detect" "\
+Add PATH to `load-path' if it exists under `default-load-path'
+directories and it does not exist in `load-path'.
+
+You can use following PATH styles:
+	load-path relative: \"PATH/\"
+			(it is searched from `defaul-load-path')
+	home directory relative: \"~/PATH/\" \"~USER/PATH/\"
+	absolute path: \"/HOO/BAR/BAZ/\"
+
+You can specify following OPTIONS:
+	'all-paths	search from `load-path'
+			instead of `default-load-path'
+	'append		add PATH to the last of `load-path'" nil nil)
+
+(autoload 'add-latest-path "file-detect" "\
+Add latest path matched by PATTERN to `load-path'
+if it exists under `default-load-path' directories
+and it does not exist in `load-path'.
+
+If optional argument ALL-PATHS is specified, it is searched from all
+of load-path instead of default-load-path. [file-detect.el]" nil nil)
+
+(autoload 'get-latest-path "file-detect" "\
+Return latest directory in default-load-path
+which is matched to regexp PATTERN.
+If optional argument ALL-PATHS is specified,
+it is searched from all of load-path instead of default-load-path." nil nil)
+
+(autoload 'file-installed-p "file-detect" "\
+Return absolute-path of FILE if FILE exists in PATHS.
+If PATHS is omitted, `load-path' is used." nil nil)
+
+(defvar exec-suffix-list '("") "\
+*List of suffixes for executable.")
+
+(autoload 'exec-installed-p "file-detect" "\
+Return absolute-path of FILE if FILE exists in PATHS.
+If PATHS is omitted, `exec-path' is used.
+If suffixes is omitted, `exec-suffix-list' is used." nil nil)
+
+(autoload 'module-installed-p "file-detect" "\
+Return t if module is provided or exists in PATHS.
+If PATHS is omitted, `load-path' is used." nil nil)
+
+;;;***
+
+;;;### (autoloads (richtext-decode richtext-encode) "richtext" "apel/richtext.el")
+
+(autoload 'richtext-encode "richtext" nil nil nil)
+
+(autoload 'richtext-decode "richtext" nil nil nil)
+
+;;;***
--- a/lisp/apel/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/apel/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/apel/emu.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/apel/emu.el	Mon Aug 13 09:45:46 2007 +0200
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: emu.el,v 1.1 1997/06/03 04:18:35 steve Exp $
+;; Version: $Id: emu.el,v 1.2 1997/06/29 23:12:06 steve Exp $
 ;; Keywords: emulation, compatibility, NEmacs, MULE, Emacs/mule, XEmacs
 
 ;; This file is part of emu.
@@ -291,7 +291,10 @@
 ;;; @ for text/richtext and text/enriched
 ;;;
 
-(cond ((or running-emacs-19_29-or-later running-xemacs-19_14-or-later)
+(cond ((fboundp 'richtext-decode)
+       ;; have richtext.el
+       )
+      ((or running-emacs-19_29-or-later running-xemacs-19_14-or-later)
        ;; have enriched.el
        (autoload 'richtext-decode "richtext")
        (or (assq 'text/richtext format-alist)
--- a/lisp/apel/file-detect.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/apel/file-detect.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;; Version:
-;;	$Id: file-detect.el,v 1.1 1997/06/03 04:18:35 steve Exp $
+;;	$Id: file-detect.el,v 1.2 1997/06/29 23:12:06 steve Exp $
 ;; Keywords: install, module
 
 ;; This file is part of APEL (A Portable Emacs Library).
@@ -28,6 +28,7 @@
 
 (defvar default-load-path load-path)
 
+;;;###autoload
 (defun add-path (path &rest options)
   "Add PATH to `load-path' if it exists under `default-load-path'
 directories and it does not exist in `load-path'.
@@ -63,6 +64,7 @@
 		))
       )))
 
+;;;###autoload
 (defun add-latest-path (pattern &optional all-paths)
   "Add latest path matched by PATTERN to `load-path'
 if it exists under `default-load-path' directories
@@ -75,6 +77,7 @@
 	(add-to-list 'load-path path)
       )))
 
+;;;###autoload
 (defun get-latest-path (pattern &optional all-paths)
   "Return latest directory in default-load-path
 which is matched to regexp PATTERN.
@@ -101,6 +104,7 @@
 	(setq paths (cdr paths))
 	))))
 
+;;;###autoload
 (defun file-installed-p (file &optional paths)
   "Return absolute-path of FILE if FILE exists in PATHS.
 If PATHS is omitted, `load-path' is used."
@@ -117,9 +121,11 @@
 	(setq paths (cdr paths))
 	))))
 
+;;;###autoload
 (defvar exec-suffix-list '("")
   "*List of suffixes for executable.")
 
+;;;###autoload
 (defun exec-installed-p (file &optional paths suffixes)
   "Return absolute-path of FILE if FILE exists in PATHS.
 If PATHS is omitted, `exec-path' is used.
@@ -145,6 +151,7 @@
       (setq paths (cdr paths))
       )))
 
+;;;###autoload
 (defun module-installed-p (module &optional paths)
   "Return t if module is provided or exists in PATHS.
 If PATHS is omitted, `load-path' is used."
--- a/lisp/apel/richtext.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/apel/richtext.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;; Created: 1995/7/15
-;; Version: $Id: richtext.el,v 1.1 1997/06/03 04:18:36 steve Exp $
+;; Version: $Id: richtext.el,v 1.2 1997/06/29 23:12:06 steve Exp $
 ;; Keywords: wp, faces, MIME, multimedia
 
 ;; This file is not part of GNU Emacs yet.
@@ -76,6 +76,7 @@
 ;;; @ encoder
 ;;;
 
+;;;###autoload
 (defun richtext-encode (from to)
   (if enriched-verbose (message "Richtext: encoding document..."))
   (save-restriction
@@ -136,6 +137,7 @@
 	       ))
 	))))
 
+;;;###autoload
 (defun richtext-decode (from to)
   (if enriched-verbose (message "Richtext: decoding document..."))
   (save-excursion
--- a/lisp/auctex/ChangeLog	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/auctex/ChangeLog	Mon Aug 13 09:45:46 2007 +0200
@@ -1,3 +1,9 @@
+1997-06-27  Steven L Baur  <steve@altair.xemacs.org>
+
+	* Makefile (CONTRIBELC): Remove hardcoded dependency on
+	tex-jp.el -- only bytecompile if running XEmacs/Mule.
+	- Add byte-compilation of custom-load.el.
+	
 Sat Apr  5 09:40:23 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* Makefile (STYLESRC): Move style/*.el files to etc/auctex/style.
--- a/lisp/auctex/Makefile	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/auctex/Makefile	Mon Aug 13 09:45:46 2007 +0200
@@ -71,8 +71,9 @@
 
 MINMAPSRC = auc-menu.el maniac.el outln-18.el all.el multi-prompt.el
 
-CONTRIB = bib-cite.el tex-jp.el font-latex.el
-CONTRIBELC = bib-cite.elc tex-jp.elc font-latex.elc
+## MULE_ELC is set by update-elc.sh if bytecompiling for XEmacs/Mule
+CONTRIB = bib-cite.el font-latex.el custom-load.el
+CONTRIBELC = bib-cite.elc $(MULE_ELC) font-latex.elc custom-load.elc
 
 AUCSRC = auc-old.el tex.el tex-buf.el latex.el tex-info.el multi-prompt.el
 AUCELC = auc-old.elc tex.elc tex-buf.elc latex.elc tex-info.elc \
--- a/lisp/auctex/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/auctex/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/bytecomp/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/bytecomp/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/calendar/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/calendar/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/cc-mode/auto-autoloads.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/cc-mode/auto-autoloads.el	Mon Aug 13 09:45:46 2007 +0200
@@ -2,6 +2,13 @@
 (if (not (featurep 'cc-mode-autoloads))
     (progn
 
+;;;### (autoloads nil "cc-langs" "cc-mode/cc-langs.el")
+
+(defvar c-mode-syntax-table nil "\
+Syntax table used in c-mode buffers.")
+
+;;;***
+
 ;;;### (autoloads (java-mode objc-mode c++-mode c-mode) "cc-mode" "cc-mode/cc-mode.el")
 
 (autoload 'c-mode "cc-mode" "\
--- a/lisp/cc-mode/cc-langs.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/cc-mode/cc-langs.el	Mon Aug 13 09:45:46 2007 +0200
@@ -383,6 +383,7 @@
   ;; add bindings which are only useful for C
   )
 
+;;;###autoload
 (defvar c-mode-syntax-table nil
   "Syntax table used in c-mode buffers.")
 (if c-mode-syntax-table
--- a/lisp/cc-mode/cc-styles.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/cc-mode/cc-styles.el	Mon Aug 13 09:45:46 2007 +0200
@@ -30,6 +30,9 @@
 (eval-when-compile
   (load-file "./cc-align.el"))
 
+(require 'cc-vars)
+(require 'cc-align)
+
 
 (defconst c-style-alist
   '(("gnu"
--- a/lisp/cc-mode/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/cc-mode/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/cl/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/cl/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/comint/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/comint/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/custom/ChangeLog	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/ChangeLog	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,62 @@
+1997-06-28  Steven L Baur  <steve@altair.xemacs.org>
+
+	* cus-edit.el (customize-customized): Trap errors.
+	(customize-saved): Ditto.
+	(custom-add-parent-links): Ditto.
+	(custom-save-variables): Ditto.
+	(custom-save-faces): Ditto.
+	(customize-save-customized): Ditto.
+
+Thu Jun 26 16:49:32 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+	* Version 1.9940 released.
+
+Thu Jun 26 15:19:27 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+	* wid-edit.el (widget-field-value-create): Add comment explaining
+	why `:field-overlay' contains two markers.
+
+	* cus-edit.el (custom-browse-visibility,
+	custom-browse-visibility-action, custom-browse-group-tag,
+	custom-browse-group-tag-action, custom-browse-variable-tag-action,
+	custom-browse-face-tag, custom-browse-face-tag-action,
+	custom-browse-face-tag-action, custom-browse-alist): Changed
+	prefix from `custom-tree' to `custom-browse'.
+	(custom-variable-value-create, custom-face-value-create,
+	custom-group-value-create): Updated caller.
+
+	* cus-edit.el (custom-browse-only-groups): New option.
+	(custom-group-value-create): Use it.  Omit non-groups if non-nil.
+	Patch by Simon Marshall <Simon.Marshall@esrin.esa.it>.
+
+	* cus-edit.el (custom-help-menu): Renamed "Variable" to "Option".
+	Remove "..." from non-prompting entries.
+	Patch by Simon Marshall <Simon.Marshall@esrin.esa.it>.
+
+	* Version 1.9939 released.
+
+Thu Jun 26 15:16:15 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+	* wid-edit.el (widget-single-line-field-face): New face.
+	(widget-single-line-display-table): New variable.
+	(regexp, file): Use `widget-single-line-field-face'.
+	Patch by Hrvoje Niksic <hniksic@srce.hr>.
+	
+Wed Jun 25 20:23:52 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+	* Version 1.9938 released.
+
 Wed Jun 25 17:46:18 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
 
+	* cus-edit.el (custom-unloaded-symbol-p): New function.
+	(custom-unloaded-widget-p): New function.
+	(custom-group-value-create): Use it.
+	(customize-browse): Mention [?].
+
+	* cus-edit.el (custom-toggle-hide): Load dependencies here.
+
+	* wid-edit.el (functionp): New function.
+
 	* Version 1.9937 released.
 
 Wed Jun 25 17:29:08 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
--- a/lisp/custom/cus-edit.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/cus-edit.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9937
+;; Version: 1.9940
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
@@ -568,6 +568,11 @@
 		 (const :tag "none" nil))
   :group 'custom-browse)
 
+(defcustom custom-browse-only-groups nil
+  "If non-nil, show group members only within each customization group."
+  :type 'boolean
+  :group 'custom-browse)
+
 (defcustom custom-buffer-sort-alphabetically nil
   "If non-nil, sort members of each customization group alphabetically."
   :type 'boolean
@@ -874,7 +879,12 @@
   (interactive)
   (let ((found nil))
     (mapatoms (lambda (symbol)
-		(and (get symbol 'customized-face)
+		(and (condition-case nil
+			 (get symbol 'customized-face)
+		       (t (progn
+			    (message "Bad plist in %s"
+				     (symbol-name symbol))
+			    nil)))
 		     (custom-facep symbol)
 		     (push (list symbol 'custom-face) found))
 		(and (get symbol 'customized-value)
@@ -891,7 +901,12 @@
   (interactive)
   (let ((found nil))
     (mapatoms (lambda (symbol)
-		(and (get symbol 'saved-face)
+		(and (condition-case nil
+			 (get symbol 'saved-face)
+		       (t (progn
+			    (message "Bad plist in %s"
+				     (symbol-name symbol))
+			    nil)))
 		     (custom-facep symbol)
 		     (push (list symbol 'custom-face) found))
 		(and (get symbol 'saved-value)
@@ -1116,7 +1131,7 @@
     (switch-to-buffer (get-buffer-create name)))
   (custom-mode)
   (widget-insert "\
-Invoke [+] below to expand items, and [-] to collapse items.
+Invoke [+] or [?] below to expand items, and [-] to collapse items.
 Invoke the [Group], [Face], and [Option] buttons below to edit that
 item in another window.\n\n")
   (let ((custom-buffer-style 'tree))
@@ -1127,52 +1142,52 @@
 		   :value group))
   (goto-char (point-min)))
 
-(define-widget 'custom-tree-visibility 'item
+(define-widget 'custom-browse-visibility 'item
   "Control visibility of of items in the customize tree browser."
   :format "%[[%t]%]"
-  :action 'custom-tree-visibility-action)
-
-(defun custom-tree-visibility-action (widget &rest ignore)
+  :action 'custom-browse-visibility-action)
+
+(defun custom-browse-visibility-action (widget &rest ignore)
   (let ((custom-buffer-style 'tree))
     (custom-toggle-parent widget)))
 
-(define-widget 'custom-tree-group-tag 'push-button
+(define-widget 'custom-browse-group-tag 'push-button
   "Show parent in other window when activated."
   :tag "Group"
   :tag-glyph "folder"
-  :action 'custom-tree-group-tag-action)
-
-(defun custom-tree-group-tag-action (widget &rest ignore)
+  :action 'custom-browse-group-tag-action)
+
+(defun custom-browse-group-tag-action (widget &rest ignore)
   (let ((parent (widget-get widget :parent)))
     (customize-group-other-window (widget-value parent))))
 
-(define-widget 'custom-tree-variable-tag 'push-button
+(define-widget 'custom-browse-variable-tag 'push-button
   "Show parent in other window when activated."
   :tag "Option"
   :tag-glyph "option"
-  :action 'custom-tree-variable-tag-action)
-
-(defun custom-tree-variable-tag-action (widget &rest ignore)
+  :action 'custom-browse-variable-tag-action)
+
+(defun custom-browse-variable-tag-action (widget &rest ignore)
   (let ((parent (widget-get widget :parent)))
     (customize-variable-other-window (widget-value parent))))
 
-(define-widget 'custom-tree-face-tag 'push-button
+(define-widget 'custom-browse-face-tag 'push-button
   "Show parent in other window when activated."
   :tag "Face"
   :tag-glyph "face"
-  :action 'custom-tree-face-tag-action)
-
-(defun custom-tree-face-tag-action (widget &rest ignore)
+  :action 'custom-browse-face-tag-action)
+
+(defun custom-browse-face-tag-action (widget &rest ignore)
   (let ((parent (widget-get widget :parent)))
     (customize-face-other-window (widget-value parent))))
 
-(defconst custom-tree-alist '(("   " "space")
+(defconst custom-browse-alist '(("   " "space")
 			      (" | " "vertical")
 			      ("-\\ " "top")
 			      (" |-" "middle")
 			      (" `-" "bottom")))
 
-(defun custom-tree-insert-prefix (prefix)
+(defun custom-browse-insert-prefix (prefix)
   "Insert PREFIX.  On XEmacs convert it to line graphics."
   (if nil ; (string-match "XEmacs" emacs-version)
       (progn 
@@ -1181,7 +1196,7 @@
 	  (let ((entry (substring prefix 0 3)))
 	    (setq prefix (substring prefix 3))
 	    (let ((overlay (make-overlay (1- (point)) (point) nil t nil))
-		  (name (nth 1 (assoc entry custom-tree-alist))))
+		  (name (nth 1 (assoc entry custom-browse-alist))))
 	      (overlay-put overlay 'end-glyph (widget-glyph-find name entry))
 	      (overlay-put overlay 'start-open t)
 	      (overlay-put overlay 'end-open t)))))
@@ -1565,8 +1580,31 @@
   "Load all dependencies for WIDGET."
   (custom-load-symbol (widget-value widget)))
 
+(defun custom-unloaded-symbol-p (symbol)
+  "Return non-nil if the dependencies of SYMBOL has not yet been loaded."
+  (let ((found nil)
+	(loads (get symbol 'custom-loads))
+	load)
+    (while loads
+      (setq load (car loads)
+	    loads (cdr loads))
+      (cond ((symbolp load)
+	     (unless (featurep load)
+	       (setq found t)))
+	    ((assoc load load-history))
+	    ((assoc (locate-library load) load-history)
+	     (message nil))
+	    (t
+	     (setq found t))))
+    found))
+
+(defun custom-unloaded-widget-p (widget)
+  "Return non-nil if the dependencies of WIDGET has not yet been loaded."
+  (custom-unloaded-symbol-p (widget-value widget)))
+
 (defun custom-toggle-hide (widget)
   "Toggle visibility of WIDGET."
+  (custom-load-widget widget)
   (let ((state (widget-get widget :custom-state)))
     (cond ((memq state '(invalid modified))
 	   (error "There are unset changes"))
@@ -1621,7 +1659,13 @@
 	found)
     (insert (or initial-string "Parent groups:"))
     (mapatoms (lambda (symbol)
-		(let ((entry (assq name (get symbol 'custom-group))))
+		(let ((entry (assq name
+				   (condition-case nil
+				       (get symbol 'custom-group)
+				     (t (progn
+					  (message "Bad plist in %s"
+						   (symbol-name symbol))
+					  nil))))))
 		  (when (eq (nth 1 entry) type)
 		    (insert " ")
 		    (push (widget-create-child-and-convert 
@@ -1717,7 +1761,7 @@
     (cond ((eq custom-buffer-style 'tree)
 	   (insert prefix (if last " `--- " " |--- "))
 	   (push (widget-create-child-and-convert
-		  widget 'custom-tree-variable-tag)
+		  widget 'custom-browse-variable-tag)
 		 buttons)
 	   (insert " " tag "\n")
 	   (widget-put widget :buttons buttons))
@@ -2151,7 +2195,7 @@
     (cond ((eq custom-buffer-style 'tree)
 	   (insert prefix (if is-last " `--- " " |--- "))
 	   (push (widget-create-child-and-convert
-		  widget 'custom-tree-face-tag)
+		  widget 'custom-browse-face-tag)
 		 buttons)
 	   (insert " " tag "\n")
 	   (widget-put widget :buttons buttons))
@@ -2504,54 +2548,56 @@
 	(tag (widget-get widget :tag))
 	(symbol (widget-value widget)))
     (cond ((and (eq custom-buffer-style 'tree)
-		(eq state 'hidden))
-	   (custom-tree-insert-prefix prefix)
+		(eq state 'hidden)
+		(or (get symbol 'custom-group)
+		    (custom-unloaded-widget-p widget)))
+	   (custom-browse-insert-prefix prefix)
 	   (push (widget-create-child-and-convert
-		  widget 'custom-tree-visibility 
+		  widget 'custom-browse-visibility 
 		  ;; :tag-glyph "plus"
-		  :tag "+")
+		  :tag (if (custom-unloaded-widget-p widget) "?" "+"))
 		 buttons)
 	   (insert "-- ")
 	   ;; (widget-glyph-insert nil "-- " "horizontal")
 	   (push (widget-create-child-and-convert
-		  widget 'custom-tree-group-tag)
+		  widget 'custom-browse-group-tag)
 		 buttons)
 	   (insert " " tag "\n")
 	   (widget-put widget :buttons buttons))
 	  ((and (eq custom-buffer-style 'tree)
 		(zerop (length (get symbol 'custom-group))))
-	   (custom-tree-insert-prefix prefix)
+	   (custom-browse-insert-prefix prefix)
 	   (insert "[ ]-- ")
 	   ;; (widget-glyph-insert nil "[ ]" "empty")
 	   ;; (widget-glyph-insert nil "-- " "horizontal")
 	   (push (widget-create-child-and-convert 
-		  widget 'custom-tree-group-tag)
+		  widget 'custom-browse-group-tag)
 		 buttons)
 	   (insert " " tag "\n")
 	   (widget-put widget :buttons buttons))
 	  ((eq custom-buffer-style 'tree)
-	   (custom-tree-insert-prefix prefix)
+	   (custom-browse-insert-prefix prefix)
 	   (custom-load-widget widget)
 	   (if (zerop (length (get symbol 'custom-group)))
 	       (progn 
-		 (custom-tree-insert-prefix prefix)
+		 (custom-browse-insert-prefix prefix)
 		 (insert "[ ]-- ")
 		 ;; (widget-glyph-insert nil "[ ]" "empty")
 		 ;; (widget-glyph-insert nil "-- " "horizontal")
 		 (push (widget-create-child-and-convert 
-			widget 'custom-tree-group-tag)
+			widget 'custom-browse-group-tag)
 		       buttons)
 		 (insert " " tag "\n")
 		 (widget-put widget :buttons buttons))
 	     (push (widget-create-child-and-convert 
-		    widget 'custom-tree-visibility 
+		    widget 'custom-browse-visibility 
 		    ;; :tag-glyph "minus"
 		    :tag "-")
 		   buttons)
 	     (insert "-\\ ")
 	     ;; (widget-glyph-insert nil "-\\ " "top")
 	     (push (widget-create-child-and-convert 
-		    widget 'custom-tree-group-tag)
+		    widget 'custom-browse-group-tag)
 		   buttons)
 	     (insert " " tag "\n")
 	     (widget-put widget :buttons buttons)
@@ -2561,7 +2607,6 @@
 			      custom-browse-order-groups))
 		    (prefixes (widget-get widget :custom-prefixes))
 		    (custom-prefix-list (custom-prefix-add symbol prefixes))
-		    (length (length members))
 		    (extra-prefix (if (widget-get widget :custom-last)
 				      "   "
 				    " | "))
@@ -2570,17 +2615,18 @@
 	       (while members
 		 (setq entry (car members)
 		       members (cdr members))
-		 (push (widget-create-child-and-convert
-			widget (nth 1 entry)
-			:group widget
-			:tag (custom-unlispify-tag-name
-			      (nth 0 entry))
-			:custom-prefixes custom-prefix-list
-			:custom-level (1+ level)
-			:custom-last (null members)
-			:value (nth 0 entry)
-			:custom-prefix prefix)
-		       children))
+		 (when (or (not custom-browse-only-groups)
+			   (eq (nth 1 entry) 'custom-group))
+		   (push (widget-create-child-and-convert
+			  widget (nth 1 entry)
+			  :group widget
+			  :tag (custom-unlispify-tag-name (nth 0 entry))
+			  :custom-prefixes custom-prefix-list
+			  :custom-level (1+ level)
+			  :custom-last (null members)
+			  :value (nth 0 entry)
+			  :custom-prefix prefix)
+			 children)))
 	       (widget-put widget :children (reverse children)))
 	     (message "Creating group...done")))
 	  ;; Nested style.
@@ -2849,7 +2895,12 @@
 	(princ "\n"))
       (princ "(custom-set-variables")
       (mapatoms (lambda (symbol)
-		  (let ((value (get symbol 'saved-value))
+		  (let ((value (condition-case nil
+				   (get symbol 'saved-value)
+				 (t (progn
+				      (message "Bad plist in %s"
+					       (symbol-name symbol))
+				      nil))))
 			(requests (get symbol 'custom-requests))
 			(now (not (or (get symbol 'standard-value)
 				      (and (not (boundp symbol))
@@ -2892,7 +2943,12 @@
 	      (princ ")")
 	    (princ " t)"))))
       (mapatoms (lambda (symbol)
-		  (let ((value (get symbol 'saved-face)))
+		  (let ((value (condition-case nil
+				   (get symbol 'saved-face)
+				 (t (progn
+				      (message "Bad plist in %s"
+					       (symbol-name symbol)))
+				    nil))))
 		    (when (and (not (eq symbol 'default))
 			       ;; Don't print default face here.
 			       value)
@@ -2914,14 +2970,17 @@
   "Save all user options which have been set in this session."
   (interactive)
   (mapatoms (lambda (symbol)
-	      (let ((face (get symbol 'customized-face))
-		    (value (get symbol 'customized-value)))
-		(when face 
-		  (put symbol 'saved-face face)
-		  (put symbol 'customized-face nil))
-		(when value 
-		  (put symbol 'saved-value value)
-		  (put symbol 'customized-value nil)))))
+	      (condition-case nil
+		  (let ((face (get symbol 'customized-face))
+			(value (get symbol 'customized-value)))
+		    (when face
+		      (put symbol 'saved-face face)
+		      (put symbol 'customized-face nil))
+		    (when value
+		      (put symbol 'saved-value value)
+		      (put symbol 'customized-value nil)))
+		(t (message "Bad plist in %s"
+			    (symbol-name symbol))))))
   ;; We really should update all custom buffers here.
   (custom-save-all))
 
@@ -2941,17 +3000,17 @@
 (unless (string-match "XEmacs" emacs-version)
   (defconst custom-help-menu
     '("Customize"
-      ["Update menu..." Custom-menu-update t]
-      ["Browse..." (customize-browse 'emacs) t]
+      ["Update menu" Custom-menu-update t]
+      ["Browse" (customize-browse 'emacs) t]
       ["Group..." customize-group t]
-      ["Variable..." customize-variable t]
+      ["Option..." customize-option t]
       ["Face..." customize-face t]
       ["Saved..." customize-saved t]
       ["Set..." customize-customized t]
-      ["--" custom-menu-sep t]
+      "--"
       ["Apropos..." customize-apropos t]
       ["Group apropos..." customize-apropos-groups t]
-      ["Variable apropos..." customize-apropos-options t]
+      ["Option apropos..." customize-apropos-options t]
       ["Face apropos..." customize-apropos-faces t])
     ;; This menu should be identical to the one defined in `menu-bar.el'. 
     "Customize menu")
--- a/lisp/custom/cus-face.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/cus-face.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9937
+;; Version: 1.9940
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;;; Commentary:
--- a/lisp/custom/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -3,6 +3,7 @@
 (put 'custom-buffer 'custom-loads '("cus-edit"))
 (put 'eldoc 'custom-loads '())
 (put 'custom-faces 'custom-loads '("cus-edit"))
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/custom/custom.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/custom.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9937
+;; Version: 1.9940
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
--- a/lisp/custom/wid-browse.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/wid-browse.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: extensions
-;; Version: 1.9937
+;; Version: 1.9940
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
--- a/lisp/custom/wid-edit.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/wid-edit.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: extensions
-;; Version: 1.9937
+;; Version: 1.9940
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
@@ -54,7 +54,7 @@
       "Character position of the end of event if that exists, or nil."
       (posn-point (event-end event))))
 
-(defalias 'widget-read-event (if (string-match "XEmacs" emacs-version)
+  (defalias 'widget-read-event (if (string-match "XEmacs" emacs-version)
 				   'next-event
 				 'read-event))
 
@@ -84,6 +84,14 @@
 	   (or (memq 'click (event-modifiers event))
 	       (memq  'drag (event-modifiers event))))))
 
+  (unless (fboundp 'functionp)
+    ;; Missing from Emacs 19.34 and earlier.
+    (defun functionp (object)
+      "Non-nil of OBJECT is a type of object that can be called as a function."
+      (or (subrp object) (byte-code-function-p object)
+	  (eq (car-safe object) 'lambda)
+	  (and (symbolp object) (fboundp object)))))
+
   (unless (fboundp 'error-message-string)
     ;; Emacs function missing in XEmacs.
     (defun error-message-string (obj)
@@ -169,6 +177,28 @@
   "Face used for editable fields."
   :group 'widget-faces)
 
+(defface widget-single-line-field-face '((((class grayscale color)
+					   (background light))
+					  (:background "gray85"))
+					 (((class grayscale color)
+					   (background dark))
+					  (:background "dim gray"))
+					 (t 
+					  (:italic t)))
+  "Face used for editable fields spanning only a single line."
+  :group 'widget-faces)
+
+(defvar widget-single-line-display-table
+  (let ((table (make-display-table)))
+    (aset table 9  "^I")
+    (aset table 10 "^J")
+    table)
+  "Display table used for single-line editable fields.")
+
+(when (fboundp 'set-face-display-table)
+  (set-face-display-table 'widget-single-line-field-face
+			  widget-single-line-display-table))
+
 ;;; Utility functions.
 ;;
 ;; These are not really widget specific.
@@ -1813,6 +1843,9 @@
   (let ((size (widget-get widget :size))
 	(value (widget-get widget :value))
 	(from (point))
+	;; This is changed to a real overlay in `widget-setup'.  We
+	;; need the end points to behave differently until
+	;; `widget-setup' is called.   
 	(overlay (cons (make-marker) (make-marker))))
     (widget-put widget :field-overlay overlay)
     (insert value)
@@ -2870,6 +2903,7 @@
   "A regular expression."
   :match 'widget-regexp-match
   :validate 'widget-regexp-validate
+  :value-face 'widget-single-line-field-face
   :tag "Regexp")
 
 (defun widget-regexp-match (widget value)
@@ -2895,6 +2929,7 @@
   :complete-function 'widget-file-complete
   :prompt-value 'widget-file-prompt-value
   :format "%{%t%}: %v"
+  :value-face 'widget-single-line-field-face
   :tag "File")
 
 (defun widget-file-complete ()
--- a/lisp/custom/widget-example.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/widget-example.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, extensions, faces, hypermedia
-;; Version: 1.9937
+;; Version: 1.9940
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 (require 'widget)
--- a/lisp/custom/widget.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/custom/widget.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, extensions, faces, hypermedia
-;; Version: 1.9937
+;; Version: 1.9940
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
--- a/lisp/edebug/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/edebug/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/ediff/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/ediff/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/efs/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/efs/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/egg/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/egg/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
@@ -19,6 +21,7 @@
 (put 'calendar 'custom-loads '())
 (put 'help-appearance 'custom-loads '())
 (put 'display-time 'custom-loads '())
+(put 'lisp 'custom-loads '())
 (put 'diff 'custom-loads '())
 (put 'paren-matching 'custom-loads '())
 (put 'help 'custom-loads '())
@@ -28,14 +31,19 @@
 (put 'message-sending 'custom-loads '())
 (put 'data 'custom-loads '())
 (put 'ps-print 'custom-loads '())
+(put 'backup 'custom-loads '())
 (put 'frames 'custom-loads '())
+(put 'customize 'custom-loads '())
 (put 'abbrev 'custom-loads '())
 (put 'toolbar 'custom-loads '())
 (put 'compilation 'custom-loads '())
+(put 'dired 'custom-loads '())
 (put 'killing 'custom-loads '())
 (put 'paren-blinking 'custom-loads '())
+(put 'find-file 'custom-loads '())
 (put 'gnuserv 'custom-loads '())
 (put 'maint 'custom-loads '())
+(put 'fill-comments 'custom-loads '())
 (put 'message-mail 'custom-loads '())
 (put 'windows 'custom-loads '())
 (put 'message-various 'custom-loads '())
@@ -46,7 +54,7 @@
 (put 'diary 'custom-loads '())
 (put 'browse-url 'custom-loads '())
 (put 'message-insertion 'custom-loads '())
-(put 'hyper-apropos 'custom-loads '())
+(put 'vc 'custom-loads '())
 (put 'alloc 'custom-loads '())
 (put 'isearch 'custom-loads '())
 (put 'modeline 'custom-loads '())
@@ -54,4 +62,5 @@
 (put 'editing 'custom-loads '())
 (put 'matching 'custom-loads '())
 (put 'ps-print-color 'custom-loads '())
+(put 'undo 'custom-loads '())
 (put 'x 'custom-loads '())
--- a/lisp/electric/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/electric/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/emulators/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/emulators/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/eos/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/eos/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/eterm/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/eterm/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/games/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/games/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/gnats/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnats/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/gnus/ChangeLog	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/ChangeLog	Mon Aug 13 09:45:46 2007 +0200
@@ -1,3 +1,59 @@
+Sun Jun 29 21:32:13 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+
+	* gnus.el: Gnus v5.4.60 is released.
+
+Sun Jun 29 21:14:27 1997  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* gnus-salt.el: Customized.
+
+1997-06-27  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* gnus-salt.el (gnus-tree-show-summary): New function.
+	(gnus-tree-mode-map): Use it.
+
+Sun Jun 29 20:19:27 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* gnus-salt.el (gnus-generate-horizontal-tree): Protect against
+	nil threads.
+
+	* gnus-sum.el (gnus-adjust-marked-articles): Change.
+
+Sun Jun 29 20:19:03 1997  Scott Byer  <byer@adobe.com>
+
+	* gnus-sum.el (gnus-adjust-marked-articles): Improper lists.
+
+1997-06-24  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* gnus-sum.el (gnus-summary-search-article): Inhibit updating tree 
+	buffer.
+
+Sun Jun 29 19:36:48 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* gnus-start.el (gnus-activate-group): Ignore zero returns.
+
+	* gnus-salt.el (gnus-generate-vertical-tree): Use a safer
+	line-drawing algorithm.
+
+	* nnml.el (nnml-generate-nov-file): Articles with null bodies are
+	legal. 
+
+Sun Jun 22 15:44:02 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* gnus-art.el (article-hide-pgp): Only run hook when hiding pgp. 
+
+	* nnfolder.el (nnfolder-save-buffer): Make sure the directory
+	exists. 
+
+	* gnus-uu.el (gnus-uu-post-news-inews): Didn't work when posting
+	threaded. 
+	(gnus-uu-post-encoded): Include sequence numbers in threaded
+	posts. 
+
+Sat Jun 21 00:17:16 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+	* message.el (message-set-auto-save-file-name): Translate / in
+	buffer names.
+
 Wed Jun 18 17:26:35 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
 	* gnus.el: Gnus v5.4.59 is released.
--- a/lisp/gnus/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,9 +1,11 @@
 (put 'gnus-start 'custom-loads '("gnus-group" "gnus-int" "gnus-start" "gnus-util" "gnus"))
+(put 'extensions 'custom-loads '())
 (put 'message 'custom-loads '("message"))
 (put 'copyright 'custom-loads '())
 (put 'gnus-score-expire 'custom-loads '("gnus-kill" "gnus-score"))
 (put 'gnus-score-kill 'custom-loads '("gnus-kill"))
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'gnus-message 'custom-loads '("message"))
 (put 'mouse 'custom-loads '())
@@ -55,6 +57,7 @@
 (put 'gnus-summary-maneuvering 'custom-loads '("gnus-sum"))
 (put 'gnus-extract 'custom-loads '("gnus" "gnus-uu"))
 (put 'help 'custom-loads '())
+(put 'gnus-summary-tree 'custom-loads '("gnus-salt"))
 (put 'local 'custom-loads '())
 (put 'nnmail-split 'custom-loads '("nnmail"))
 (put 'keyboard 'custom-loads '())
@@ -96,6 +99,7 @@
 (put 'find-file 'custom-loads '())
 (put 'gnus-edit-form 'custom-loads '("gnus-eform"))
 (put 'gnus-files 'custom-loads '("gnus" "nnmail"))
+(put 'gnus-summary-pick 'custom-loads '("gnus-salt"))
 (put 'gnus-cite 'custom-loads '("gnus-cite"))
 (put 'gnus-demon 'custom-loads '("gnus-demon"))
 (put 'gnus-summary-choose 'custom-loads '("gnus-sum"))
--- a/lisp/gnus/gnus-art.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus-art.el	Mon Aug 13 09:45:46 2007 +0200
@@ -981,8 +981,8 @@
 	    (while (re-search-forward "^- " nil t)
 	      (gnus-article-hide-text-type
 	       (match-beginning 0) (match-end 0) 'pgp))
-	    (widen)))
-	(run-hooks 'gnus-article-hide-pgp-hook)))))
+	    (widen))
+	  (run-hooks 'gnus-article-hide-pgp-hook))))))
 
 (defun article-hide-pem (&optional arg)
   "Toggle hiding of any PEM headers and signatures in the current article.
@@ -1750,7 +1750,6 @@
 (gnus-define-keys gnus-article-mode-map
   " " gnus-article-goto-next-page
   "\177" gnus-article-goto-prev-page
-  [backspace] gnus-article-goto-prev-page
   [delete] gnus-article-goto-prev-page
   "\C-c^" gnus-article-refer-article
   "h" gnus-article-show-summary
--- a/lisp/gnus/gnus-group.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus-group.el	Mon Aug 13 09:45:46 2007 +0200
@@ -423,7 +423,6 @@
     "n" gnus-group-next-unread-group
     "p" gnus-group-prev-unread-group
     "\177" gnus-group-prev-unread-group
-    [backspace] gnus-group-prev-unread-group
     [delete] gnus-group-prev-unread-group
     "N" gnus-group-next-group
     "P" gnus-group-prev-group
@@ -506,7 +505,6 @@
     "r" gnus-group-rename-group
     "c" gnus-group-customize
     "\177" gnus-group-delete-group
-    [backspace] gnus-group-delete-group
     [delete] gnus-group-delete-group)
 
   (gnus-define-keys (gnus-group-soup-map "s" gnus-group-group-map)
--- a/lisp/gnus/gnus-salt.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus-salt.el	Mon Aug 13 09:45:46 2007 +0200
@@ -34,22 +34,32 @@
 (defvar gnus-pick-mode nil
   "Minor mode for providing a pick-and-read interface in Gnus summary buffers.")
 
-(defvar gnus-pick-display-summary nil
-  "*Display summary while reading.")
+(defcustom gnus-pick-display-summary nil
+  "*Display summary while reading."
+  :type 'boolean
+  :group 'gnus-summary-pick)
 
-(defvar gnus-pick-mode-hook nil
-  "Hook run in summary pick mode buffers.")
+(defcustom gnus-pick-mode-hook nil
+  "Hook run in summary pick mode buffers."
+  :type 'hook
+  :group 'gnus-summary-pick)
 
-(defvar gnus-mark-unpicked-articles-as-read nil
-  "*If non-nil, mark all unpicked articles as read.")
+(defcustom gnus-mark-unpicked-articles-as-read nil
+  "*If non-nil, mark all unpicked articles as read."
+  :type 'boolean
+  :group 'gnus-summary-pick)
 
-(defvar gnus-pick-elegant-flow t
-  "If non-nil, gnus-pick-start-reading will run gnus-summary-next-group when no articles have been picked.")
+(defcustom gnus-pick-elegant-flow t
+  "If non-nil, gnus-pick-start-reading will run gnus-summary-next-group when no articles have been picked."
+  :type 'boolean
+  :group 'gnus-summary-pick)
 
-(defvar gnus-summary-pick-line-format
+(defcustom gnus-summary-pick-line-format
   "%-5P %U\%R\%z\%I\%(%[%4L: %-20,20n%]%) %s\n"
   "*The format specification of the lines in pick buffers.
-It accepts the same format specs that `gnus-summary-line-format' does.")
+It accepts the same format specs that `gnus-summary-line-format' does."
+  :type 'string
+  :group 'gnus-summary-pick)
 
 ;;; Internal variables.
 
@@ -350,16 +360,22 @@
 ;;; gnus-tree-mode
 ;;;
 
-(defvar gnus-tree-line-format "%(%[%3,3n%]%)"
-  "Format of tree elements.")
+(defcustom gnus-tree-line-format "%(%[%3,3n%]%)"
+  "Format of tree elements."
+  :type 'string
+  :group 'gnus-summary-tree)
 
-(defvar gnus-tree-minimize-window t
+(defcustom gnus-tree-minimize-window t
   "If non-nil, minimize the tree buffer window.
 If a number, never let the tree buffer grow taller than that number of
-lines.")
+lines."
+  :type 'boolean
+  :group 'gnus-summary-tree)
 
-(defvar gnus-selected-tree-face 'modeline
-  "*Face used for highlighting selected articles in the thread tree.")
+(defcustom gnus-selected-tree-face 'modeline
+  "*Face used for highlighting selected articles in the thread tree."
+  :type 'face
+  :group 'gnus-summary-tree)
 
 (defvar gnus-tree-brackets '((?\[ . ?\]) (?\( . ?\))
 			     (?\{ . ?\}) (?< . ?>))
@@ -368,16 +384,24 @@
 (defvar gnus-tree-parent-child-edges '(?- ?\\ ?|)
   "Characters used to connect parents with children.")
 
-(defvar gnus-tree-mode-line-format "Gnus: %%b %S %Z"
-  "*The format specification for the tree mode line.")
+(defcustom gnus-tree-mode-line-format "Gnus: %%b %S %Z"
+  "*The format specification for the tree mode line."
+  :type 'string
+  :group 'gnus-summary-tree)
 
-(defvar gnus-generate-tree-function 'gnus-generate-vertical-tree
+(defcustom gnus-generate-tree-function 'gnus-generate-vertical-tree
   "*Function for generating a thread tree.
 Two predefined functions are available:
-`gnus-generate-horizontal-tree' and `gnus-generate-vertical-tree'.")
+`gnus-generate-horizontal-tree' and `gnus-generate-vertical-tree'."
+  :type '(radio (function-item gnus-generate-vertical-tree)
+		(function-item gnus-generate-horizontal-tree)
+		(function :tag "Other" nil))
+  :group 'gnus-summary-tree)
 
-(defvar gnus-tree-mode-hook nil
-  "*Hook run in tree mode buffers.")
+(defcustom gnus-tree-mode-hook nil
+  "*Hook run in tree mode buffers."
+  :type 'hook
+  :group 'gnus-summary-tree)
 
 ;;; Internal variables.
 
@@ -410,6 +434,7 @@
    "\r" gnus-tree-select-article
    gnus-mouse-2 gnus-tree-pick-article
    "\C-?" gnus-tree-read-summary-keys
+   "h" gnus-tree-show-summary
 
    "\C-c\C-i" gnus-info-find-node)
 
@@ -460,6 +485,14 @@
 	(goto-char (or (gnus-overlay-end gnus-selected-tree-overlay) 1)))
       (gnus-tree-minimize))))
 
+(defun gnus-tree-show-summary ()
+  "Reconfigure windows to show summary buffer."
+  (interactive)
+  (if (not (gnus-buffer-live-p gnus-summary-buffer))
+      (error "There is no summary buffer for this tree buffer")
+    (gnus-configure-windows 'article)
+    (gnus-summary-goto-subject gnus-current-article)))
+
 (defun gnus-tree-select-article (article)
   "Select the article under point, if any."
   (interactive (list (gnus-tree-article-number)))
@@ -646,7 +679,9 @@
   "Generate a horizontal tree."
   (let* ((dummy (stringp (car thread)))
 	 (do (or dummy
-		 (memq (mail-header-number (car thread)) gnus-tmp-limit)))
+		 (and (car thread)
+		      (memq (mail-header-number (car thread))
+			    gnus-tmp-limit))))
 	 col beg)
     (if (not do)
 	;; We don't want this article.
@@ -718,13 +753,12 @@
 	  (delete-char -1)
 	  (insert (cadr gnus-tree-parent-child-edges))
 	  (setq beg (point))
+	  (forward-char -1)
 	  ;; Draw "-" lines leftwards.
-	  (while (progn
-		   (unless (bolp)
-		     (forward-char -2))
-		   (= (following-char) ? ))
-	    (delete-char 1)
-	    (insert (car gnus-tree-parent-child-edges)))
+	  (while (= (char-after (1- (point))) ? )
+	    (delete-char -1)
+	    (insert (car gnus-tree-parent-child-edges))
+	    (forward-char -1))
 	  (goto-char beg)
 	  (gnus-tree-forward-line 1)))
       (setq dummyp nil)
--- a/lisp/gnus/gnus-srvr.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus-srvr.el	Mon Aug 13 09:45:46 2007 +0200
@@ -503,8 +503,6 @@
    "n" gnus-browse-next-group
    "p" gnus-browse-prev-group
    "\177" gnus-browse-prev-group
-   [backspace] gnus-browse-prev-group
-   [delete] gnus-browse-prev-group
    "N" gnus-browse-next-group
    "P" gnus-browse-prev-group
    "\M-n" gnus-browse-next-group
--- a/lisp/gnus/gnus-start.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus-start.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1284,12 +1284,11 @@
     "Alter the ACTIVE info for GROUP to reflect the articles in the cache."
     (when gnus-cache-active-hashtb
       (let ((cache-active (gnus-gethash group gnus-cache-active-hashtb)))
-	(and cache-active
-	     (< (car cache-active) (car active))
-	     (setcar active (car cache-active)))
-	(and cache-active
-	     (> (cdr cache-active) (cdr active))
-	     (setcdr active (cdr cache-active)))))))
+	(when cache-active
+	  (when (< (car cache-active) (car active))
+	    (setcar active (car cache-active)))
+	  (when (> (cdr cache-active) (cdr active))
+	    (setcdr active (cdr cache-active))))))))
 
 (defun gnus-activate-group (group &optional scan dont-check method)
   ;; Check whether a group has been activated or not.
@@ -1309,7 +1308,15 @@
 	     (inline (gnus-request-group group dont-check method))
 	   (error nil)
 	   (quit nil))
-	 (gnus-set-active group (setq active (gnus-parse-active)))
+	 (setq active (gnus-parse-active))
+	 ;; If there are no articles in the group, the GROUP
+	 ;; command may have responded with the `(0 . 0)'.  We
+	 ;; ignore this if we already have an active entry
+	 ;; for the group.
+	 (unless (and (zerop (car active))
+		      (zerop (cdr active))
+		      (gnus-active group))
+	   (gnus-set-active group active))
 	 ;; Return the new active info.
 	 active)))
 
--- a/lisp/gnus/gnus-sum.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus-sum.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1036,7 +1036,6 @@
   (gnus-define-keys gnus-summary-mode-map
     " " gnus-summary-next-page
     "\177" gnus-summary-prev-page
-    [backspace] gnus-summary-prev-page
     [delete] gnus-summary-prev-page
     "\r" gnus-summary-scroll-up
     "n" gnus-summary-next-unread-article
@@ -1236,7 +1235,6 @@
     " " gnus-summary-next-page
     "n" gnus-summary-next-page
     "\177" gnus-summary-prev-page
-    [backspace] gnus-summary-prev-page
     [delete] gnus-summary-prev-page
     "p" gnus-summary-prev-page
     "\r" gnus-summary-scroll-up
@@ -1309,7 +1307,6 @@
     "e" gnus-summary-expire-articles
     "\M-\C-e" gnus-summary-expire-articles-now
     "\177" gnus-summary-delete-article
-    [backspace] gnus-summary-delete-article
     [delete] gnus-summary-delete-article
     "m" gnus-summary-move-article
     "r" gnus-summary-respool-article
@@ -3829,6 +3826,10 @@
 	    (set var (delq article (symbol-value var))))))
        ;; Adjust assocs.
        ((memq mark uncompressed)
+	(when (not (listp (car (symbol-value var)))))
+	  (set var (list (symbol-value var)))
+	(when (not (listp (cdr articles)))
+	  (setq articles (list articles)))
 	(while articles
 	  (when (or (not (consp (setq article (pop articles))))
 		    (< (car article) min)
@@ -5000,7 +5001,7 @@
   (suppress-keymap gnus-dead-summary-mode-map)
   (substitute-key-definition
    'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map)
-  (let ((keys '("\C-d" "\r" "\177" [backspace] [delete])))
+  (let ((keys '("\C-d" "\r" "\177")))
     (while keys
       (define-key gnus-dead-summary-mode-map
 	(pop keys) 'gnus-summary-wake-up-the-dead))))
@@ -6344,6 +6345,7 @@
 	(gnus-mark-article-hook nil)	;Inhibit marking as read.
 	(gnus-use-article-prefetch nil)
 	(gnus-xmas-force-redisplay nil)	;Inhibit XEmacs redisplay.
+	(gnus-use-trees nil)		;Inhibit updating tree buffer.
 	(sum (current-buffer))
 	(found nil)
 	point)
--- a/lisp/gnus/gnus-topic.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus-topic.el	Mon Aug 13 09:45:46 2007 +0200
@@ -894,8 +894,6 @@
     [tab] gnus-topic-indent
     "r" gnus-topic-rename
     "\177" gnus-topic-delete
-    [backpace] gnus-topic-delete
-    [delete] gnus-topic-delete
     "h" gnus-topic-toggle-display-empty-topics)
 
   (gnus-define-keys (gnus-topic-sort-map "S" gnus-group-topic-map)
--- a/lisp/gnus/gnus-uu.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus-uu.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1777,7 +1777,7 @@
 This may not be smart, as no other decoder I have seen are able to
 follow threads when collecting uuencoded articles.  (Well, I have seen
 one package that does that - gnus-uu, but somehow, I don't think that
-counts...) Default is nil."
+counts...)  The default is nil."
   :group 'gnus-extract-post
   :type 'boolean)
 
@@ -1876,28 +1876,7 @@
 	(setq file-name gnus-uu-post-inserted-file-name)
       (setq file-name (gnus-uu-post-insert-binary)))
 
-    (if gnus-uu-post-threaded
-	(let ((message-required-news-headers
-	       (if (memq 'Message-ID message-required-news-headers)
-		   message-required-news-headers
-		 (cons 'Message-ID message-required-news-headers)))
-	      gnus-inews-article-hook)
-
-	  (setq gnus-inews-article-hook (if (listp gnus-inews-article-hook)
-					    gnus-inews-article-hook
-					  (list gnus-inews-article-hook)))
-	  (push
-	   '(lambda ()
-	      (save-excursion
-		(goto-char (point-min))
-		(if (re-search-forward "^Message-ID: \\(.*\\)$" nil t)
-		    (setq gnus-uu-post-message-id
-			  (buffer-substring
-			   (match-beginning 1) (match-end 1)))
-		  (setq gnus-uu-post-message-id nil))))
-	   gnus-inews-article-hook)
-	  (gnus-uu-post-encoded file-name t))
-      (gnus-uu-post-encoded file-name nil)))
+    (gnus-uu-post-encoded file-name gnus-uu-post-threaded))
   (setq gnus-uu-post-inserted-file-name nil)
   (when gnus-uu-winconf-post-news
     (set-window-configuration gnus-uu-winconf-post-news)))
@@ -1964,12 +1943,12 @@
       (goto-char (point-min))
       (setq length (count-lines 1 (point-max)))
       (setq parts (/ length gnus-uu-post-length))
-      (when (not (< (% length gnus-uu-post-length) 4))
-	(setq parts (1+ parts))))
+      (unless (< (% length gnus-uu-post-length) 4)
+	(incf parts)))
 
     (when gnus-uu-post-separate-description
       (forward-line -1))
-    (kill-region (point) (point-max))
+    (delete-region (point) (point-max))
 
     (goto-char (point-min))
     (re-search-forward
@@ -1978,12 +1957,13 @@
     (setq header (buffer-substring 1 (point)))
 
     (goto-char (point-min))
-    (if (not gnus-uu-post-separate-description)
-	()
-      (when (and (not threaded) (re-search-forward "^Subject: " nil t))
+    (when gnus-uu-post-separate-description
+      (when (re-search-forward "^Subject: " nil t)
 	(end-of-line)
 	(insert (format " (0/%d)" parts)))
-      (message-send))
+      (save-excursion
+	(message-send))
+      (setq gnus-uu-post-message-id (message-fetch-field "message-id")))
 
     (save-excursion
       (setq i 1)
@@ -1993,7 +1973,7 @@
 	(erase-buffer)
 	(insert header)
 	(when (and threaded gnus-uu-post-message-id)
-	  (insert (format "References: %s\n" gnus-uu-post-message-id)))
+	  (insert "References: " gnus-uu-post-message-id "\n"))
 	(insert separator)
 	(setq whole-len
 	      (- 62 (length (format top-string "" file-name i parts ""))))
@@ -2008,15 +1988,9 @@
 		  (if (= 0 (% whole-len 2)) (1- minlen) minlen) ?-)))
 
 	(goto-char (point-min))
-	(if (not (re-search-forward "^Subject: " nil t))
-	    ()
-	  (if (not threaded)
-	      (progn
-		(end-of-line)
-		(insert (format " (%d/%d)" i parts)))
-	    (when (or (and (= i 2) gnus-uu-post-separate-description)
-		      (and (= i 1) (not gnus-uu-post-separate-description)))
-	      (replace-match "Subject: Re: "))))
+	(when (re-search-forward "^Subject: " nil t)
+	  (end-of-line)
+	  (insert (format " (%d/%d)" i parts)))
 
 	(goto-char (point-max))
 	(save-excursion
@@ -2029,10 +2003,9 @@
 	    (forward-line -4))
 	  (setq end (point)))
 	(insert-buffer-substring uubuf beg end)
-	(insert beg-line)
-	(insert "\n")
+	(insert beg-line "\n")
 	(setq beg end)
-	(setq i (1+ i))
+	(incf i)
 	(goto-char (point-min))
 	(re-search-forward
 	 (concat "^" (regexp-quote mail-header-separator) "$") nil t)
@@ -2046,12 +2019,14 @@
 	(insert beg-line)
 	(insert "\n")
 	(let (message-sent-message-via)
-	  (message-send))))
+	  (save-excursion
+	    (message-send))
+	  (setq gnus-uu-post-message-id
+		(concat (message-fetch-field "references") " "
+			(message-fetch-field "message-id"))))))
 
-    (when (setq buf (get-buffer send-buffer-name))
-      (kill-buffer buf))
-    (when (setq buf (get-buffer encoded-buffer-name))
-      (kill-buffer buf))
+    (gnus-kill-buffer send-buffer-name)
+    (gnus-kill-buffer encoded-buffer-name)
 
     (when (not gnus-uu-post-separate-description)
       (set-buffer-modified-p nil)
--- a/lisp/gnus/gnus.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/gnus.el	Mon Aug 13 09:45:46 2007 +0200
@@ -143,6 +143,18 @@
   :link '(custom-manual "(gnus)Various Summary Stuff")
   :group 'gnus-summary)
 
+(defgroup gnus-summary-pick nil
+  "Pick mode in the summary buffer."
+  :link '(custom-manual "(gnus)Pick and Read")
+  :prefix "gnus-pick-"
+  :group 'gnus-summary)
+
+(defgroup gnus-summary-tree nil
+  "Tree display of threads in the summary buffer."
+  :link '(custom-manual "(gnus)Tree Display")
+  :prefix "gnus-tree-"
+  :group 'gnus-summary)
+
 ;; Belongs to gnus-uu.el
 (defgroup gnus-extract-view nil
   "Viewing extracted files."
@@ -226,7 +238,7 @@
   :link '(custom-manual "(gnus)Exiting Gnus")
   :group 'gnus)
 
-(defconst gnus-version-number "5.4.59"
+(defconst gnus-version-number "5.4.60"
   "Version number for this version of Gnus.")
 
 (defconst gnus-version (format "Gnus v%s" gnus-version-number)
--- a/lisp/gnus/message.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/message.el	Mon Aug 13 09:45:46 2007 +0200
@@ -2972,7 +2972,9 @@
 		  (concat (file-name-as-directory message-autosave-directory)
 			  "msg."
 			  (nnheader-replace-chars-in-string
-			   (buffer-name) ?* ?.))))))
+			   (nnheader-replace-chars-in-string
+			    (buffer-name) ?* ?.)
+			   ?/ ?-))))))
       (setq buffer-auto-save-file-name
 	    (save-excursion
 	      (prog1
--- a/lisp/gnus/nnfolder.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/nnfolder.el	Mon Aug 13 09:45:46 2007 +0200
@@ -763,6 +763,7 @@
   "Save the buffer."
   (when (buffer-modified-p)
     (run-hooks 'nnfolder-save-buffer-hook)
+    (gnus-make-directory (file-name-directory (buffer-file-name)))
     (save-buffer)))
 
 (provide 'nnfolder)
--- a/lisp/gnus/nnml.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/gnus/nnml.el	Mon Aug 13 09:45:46 2007 +0200
@@ -759,8 +759,7 @@
 	     (search-forward "\n\n" nil t)
 	     (setq chars (- (point-max) (point)))
 	     (max 1 (1- (point)))))
-	  (when (and (not (= 0 chars))	; none of them empty files...
-		     (not (= (point-min) (point-max))))
+	  (unless (zerop (buffer-size))
 	    (goto-char (point-min))
 	    (setq headers (nnml-parse-head chars (caar files)))
 	    (save-excursion
--- a/lisp/hm--html-menus/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/hm--html-menus/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/hyperbole/ChangeLog	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/hyperbole/ChangeLog	Mon Aug 13 09:45:46 2007 +0200
@@ -1,3 +1,8 @@
+1997-06-27  Steven L Baur  <steve@altair.xemacs.org>
+
+	* wrolo-menu.el (TopLevel): Fix tests so that W3's id-menubar
+	simulation doesn't bollux up feature tests.
+
 Thu Mar 13 22:01:52 1997  Bob Weiner  <weiner@infodock.com>
 
 * wrolo.el (rolo-toggle-datestamps): Added.
--- a/lisp/hyperbole/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/hyperbole/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/hyperbole/wrolo-menu.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/hyperbole/wrolo-menu.el	Mon Aug 13 09:45:46 2007 +0200
@@ -150,7 +150,7 @@
     (popup-menu id-popup-wrolo-menu)))
 
 (cond ((null hyperb:window-system))
-      ((fboundp 'id-menubar-set)
+      ((and (featurep 'infodock) (fboundp 'id-menubar-set))
        ;; InfoDock under a window system
        (require 'id-menubars)
        (id-menubar-set 'wrolo-mode 'id-menubar-wrolo))
--- a/lisp/ilisp/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/ilisp/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/iso/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/iso/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/its/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/its/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
@@ -19,6 +21,7 @@
 (put 'calendar 'custom-loads '())
 (put 'help-appearance 'custom-loads '())
 (put 'display-time 'custom-loads '())
+(put 'lisp 'custom-loads '())
 (put 'diff 'custom-loads '())
 (put 'paren-matching 'custom-loads '())
 (put 'help 'custom-loads '())
@@ -28,14 +31,19 @@
 (put 'message-sending 'custom-loads '())
 (put 'data 'custom-loads '())
 (put 'ps-print 'custom-loads '())
+(put 'backup 'custom-loads '())
 (put 'frames 'custom-loads '())
+(put 'customize 'custom-loads '())
 (put 'abbrev 'custom-loads '())
 (put 'toolbar 'custom-loads '())
 (put 'compilation 'custom-loads '())
+(put 'dired 'custom-loads '())
 (put 'killing 'custom-loads '())
 (put 'paren-blinking 'custom-loads '())
+(put 'find-file 'custom-loads '())
 (put 'gnuserv 'custom-loads '())
 (put 'maint 'custom-loads '())
+(put 'fill-comments 'custom-loads '())
 (put 'message-mail 'custom-loads '())
 (put 'windows 'custom-loads '())
 (put 'message-various 'custom-loads '())
@@ -46,7 +54,7 @@
 (put 'diary 'custom-loads '())
 (put 'browse-url 'custom-loads '())
 (put 'message-insertion 'custom-loads '())
-(put 'hyper-apropos 'custom-loads '())
+(put 'vc 'custom-loads '())
 (put 'alloc 'custom-loads '())
 (put 'isearch 'custom-loads '())
 (put 'modeline 'custom-loads '())
@@ -54,4 +62,5 @@
 (put 'editing 'custom-loads '())
 (put 'matching 'custom-loads '())
 (put 'ps-print-color 'custom-loads '())
+(put 'undo 'custom-loads '())
 (put 'x 'custom-loads '())
--- a/lisp/language/arabic-util.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/language/arabic-util.el	Mon Aug 13 09:45:46 2007 +0200
@@ -31,9 +31,9 @@
 
 (require 'visual-mode)
 
-(defvar arabic-mode-indicator " [2](3=a:GJ[0](B"
+(defvar arabic-mode-indicator " ›2](3=a:GJ›0](B"
   "String displayed in mode-line.
-\" Arabic\" for Arabic keyboard input, \" [2](3=a:GJ[0](B\".")
+\" Arabic\" for Arabic keyboard input, \" ›2](3=a:GJ›0](B\".")
 
 (make-variable-buffer-local 'arabic-mode-indicator)
 
@@ -63,26 +63,26 @@
 (defvar arabic-translate-table
   (cond
    ((eq arabic-input-keymap 'arabic-keymap-0)
-    [?[2](3![0](B  ?[2](3"[0](B  ?[2](3-[0](B  nil nil nil nil ?'  ?[2](3#[0](B  ?[2](3$[0](B  nil nil ?[2](3%[0](B  nil ?[2](3&[0](B  ?[2](49[0](B
-     ?(2![0](B  ?(2"[0](B  ?(2#[0](B  ?(2$[0](B  ?(2%[0](B  ?(2&[0](B  ?(2'[0](B  ?(2([0](B  ?(2)[0](B  ?(2*[0](B  ?[2](3'[0](B  ?[2](3([0](B  ?[2](3*[0](B  nil ?[2](3+[0](B  ?[2](3)[0](B
-     nil ?[2](4][0](B nil ?[2](4g[0](B ?[2](4A[0](B nil nil ?[2](4O[0](B ?[2](4-[0](B nil nil ?[2](41[0](B nil nil nil nil
-     nil nil nil ?[2](4=[0](B ?[2](4E[0](B nil nil nil ?[2](3h[0](B  nil ?[2](4I[0](B nil nil nil nil nil
-     ?[2](4M[0](B ?[2](38[0](B  ?[2](4#[0](B ?[2](4'[0](B ?[2](3B[0](B  nil ?[2](4Q[0](B ?[2](4k[0](B ?[2](3Z[0](B  nil ?[2](4)[0](B ?[2](4U[0](B ?[2](4Y[0](B ?[2](3T[0](B  ?[2](4[[0](B ?[2](3<[0](B
-     ?[2](4e[0](B ?[2](4S[0](B ?[2](3F[0](B  ?[2](45[0](B ?[2](4%[0](B nil nil ?[2](3^[0](B  ?[2](3D[0](B  ?[2](4_[0](B ?[2](3H[0](B  nil ?|  nil nil])
+    [?›2](3!›0](B  ?›2](3"›0](B  ?›2](3-›0](B  nil nil nil nil ?'  ?›2](3#›0](B  ?›2](3$›0](B  nil nil ?›2](3%›0](B  nil ?›2](3&›0](B  ?›2](49›0](B
+     ?(2!(B  ?(2"(B  ?(2#(B  ?(2$(B  ?(2%(B  ?(2&(B  ?(2'(B  ?(2((B  ?(2)(B  ?(2*(B  ?›2](3'›0](B  ?›2](3(›0](B  ?›2](3*›0](B  nil ?›2](3+›0](B  ?›2](3)›0](B
+     nil ?›2](4]›0](B nil ?›2](4g›0](B ?›2](4A›0](B nil nil ?›2](4O›0](B ?›2](4-›0](B nil nil ?›2](41›0](B nil nil nil nil
+     nil nil nil ?›2](4=›0](B ?›2](4E›0](B nil nil nil ?›2](3h›0](B  nil ?›2](4I›0](B nil nil nil nil nil
+     ?›2](4M›0](B ?›2](38›0](B  ?›2](4#›0](B ?›2](4'›0](B ?›2](3B›0](B  nil ?›2](4Q›0](B ?›2](4k›0](B ?›2](3Z›0](B  nil ?›2](4)›0](B ?›2](4U›0](B ?›2](4Y›0](B ?›2](3T›0](B  ?›2](4[›0](B ?›2](3<›0](B
+     ?›2](4e›0](B ?›2](4S›0](B ?›2](3F›0](B  ?›2](45›0](B ?›2](4%›0](B nil nil ?›2](3^›0](B  ?›2](3D›0](B  ?›2](4_›0](B ?›2](3H›0](B  nil ?|  nil nil])
    ((eq arabic-input-keymap 'arabic-keymap-1)
-    [?[2](3![0](B  ?[2](3"[0](B  nil nil nil nil nil nil ?[2](3#[0](B  ?[2](3$[0](B  nil nil ?[2](3%[0](B  nil ?[2](3&[0](B  nil
-     ?(2![0](B  ?(2"[0](B  ?(2#[0](B  ?(2$[0](B  ?(2%[0](B  ?(2&[0](B  ?(2'[0](B  ?(2([0](B  ?(2)[0](B  ?(2*[0](B  ?[2](3'[0](B  ?[2](4U[0](B ?[2](3*[0](B  nil ?[2](3+[0](B  ?[2](3)[0](B
-     nil nil ?[2](3h[0](B  nil nil nil ?[2](4e[0](B ?[2](3.[0](B  nil nil nil nil nil nil nil nil
-     nil nil nil nil nil nil ?[2](30[0](B  nil nil nil nil ?[2](4)[0](B nil ?[2](4g[0](B nil nil
-     nli ?[2](49[0](B ?[2](3H[0](B  ?[2](3D[0](B  ?[2](4_[0](B ?[2](4S[0](B ?[2](4#[0](B ?[2](38[0](B  ?[2](4%[0](B nil ?[2](4Y[0](B ?[2](4[[0](B ?[2](3T[0](B  ?[2](3^[0](B  ?[2](3F[0](B  ?[2](41[0](B
-     ?[2](4-[0](B ?[2](4A[0](B ?[2](4Q[0](B ?[2](45[0](B ?[2](4O[0](B ?[2](3Z[0](B  ?[2](3B[0](B  ?[2](4=[0](B ?[2](4E[0](B ?[2](4M[0](B ?[2](4I[0](B nil nli nil nil ])
+    [?›2](3!›0](B  ?›2](3"›0](B  nil nil nil nil nil nil ?›2](3#›0](B  ?›2](3$›0](B  nil nil ?›2](3%›0](B  nil ?›2](3&›0](B  nil
+     ?(2!(B  ?(2"(B  ?(2#(B  ?(2$(B  ?(2%(B  ?(2&(B  ?(2'(B  ?(2((B  ?(2)(B  ?(2*(B  ?›2](3'›0](B  ?›2](4U›0](B ?›2](3*›0](B  nil ?›2](3+›0](B  ?›2](3)›0](B
+     nil nil ?›2](3h›0](B  nil nil nil ?›2](4e›0](B ?›2](3.›0](B  nil nil nil nil nil nil nil nil
+     nil nil nil nil nil nil ?›2](30›0](B  nil nil nil nil ?›2](4)›0](B nil ?›2](4g›0](B nil nil
+     nli ?›2](49›0](B ?›2](3H›0](B  ?›2](3D›0](B  ?›2](4_›0](B ?›2](4S›0](B ?›2](4#›0](B ?›2](38›0](B  ?›2](4%›0](B nil ?›2](4Y›0](B ?›2](4[›0](B ?›2](3T›0](B  ?›2](3^›0](B  ?›2](3F›0](B  ?›2](41›0](B
+     ?›2](4-›0](B ?›2](4A›0](B ?›2](4Q›0](B ?›2](45›0](B ?›2](4O›0](B ?›2](3Z›0](B  ?›2](3B›0](B  ?›2](4=›0](B ?›2](4E›0](B ?›2](4M›0](B ?›2](4I›0](B nil nli nil nil ])
    (t
-    [?[2](3![0](B  ?[2](3"[0](B  ?\" ?#  ?$  ?%  ?&  ?'  ?[2](3#[0](B  ?[2](3$[0](B  ?*  ?+  ?[2](3^[0](B  ?-  ?[2](3H[0](B  ?[2](4I[0](B
-     ?(2![0](B  ?(2"[0](B  ?(2#[0](B  ?(2$[0](B  ?(2%[0](B  ?(2&[0](B  ?(2'[0](B  ?(2([0](B  ?(2)[0](B  ?(2*[0](B  ?[2](3'[0](B  ?[2](4U[0](B ?,  ?=  ?.  ?[2](3)[0](B
-     ?@  nil ?[2](3b[0](B  ?{  ?[  nil ?]  ?[2](3c[0](B  ?[2](30[0](B  nil nil ?[2](3%[0](B  ?/  ?`  ?[2](3.[0](B  nil
-     ?[2](3([0](B  nil nil nil ?[2](3d[0](B  ?'  ?}  nil nil ?[2](34[0](B  ?~  ?[2](4)[0](B ?\\ ?[2](3B[0](B  ?^  ?_
-     ?[2](3D[0](B  ?[2](49[0](B ?[2](3e[0](B  ?[2](32[0](B  ?[2](4_[0](B ?[2](4'[0](B ?[2](4#[0](B ?[2](4Y[0](B ?[2](38[0](B  ?[2](3Z[0](B  ?[2](4%[0](B ?[2](4[[0](B ?[2](3T[0](B  ?[2](3<[0](B  ?[2](4][0](B ?[2](41[0](B
-     ?[2](4-[0](B ?[2](4A[0](B ?[2](4S[0](B ?[2](45[0](B ?[2](4Q[0](B ?[2](4M[0](B ?[2](3F[0](B  ?[2](4=[0](B ?[2](3-[0](B  ?[2](4O[0](B ?[2](4![0](B ?<  ?|  ?>  nil ])))
+    [?›2](3!›0](B  ?›2](3"›0](B  ?\" ?#  ?$  ?%  ?&  ?'  ?›2](3#›0](B  ?›2](3$›0](B  ?*  ?+  ?›2](3^›0](B  ?-  ?›2](3H›0](B  ?›2](4I›0](B
+     ?(2!(B  ?(2"(B  ?(2#(B  ?(2$(B  ?(2%(B  ?(2&(B  ?(2'(B  ?(2((B  ?(2)(B  ?(2*(B  ?›2](3'›0](B  ?›2](4U›0](B ?,  ?=  ?.  ?›2](3)›0](B
+     ?@  nil ?›2](3b›0](B  ?{  ?[  nil ?]  ?›2](3c›0](B  ?›2](30›0](B  nil nil ?›2](3%›0](B  ?/  ?`  ?›2](3.›0](B  nil
+     ?›2](3(›0](B  nil nil nil ?›2](3d›0](B  ?'  ?}  nil nil ?›2](34›0](B  ?~  ?›2](4)›0](B ?\\ ?›2](3B›0](B  ?^  ?_
+     ?›2](3D›0](B  ?›2](49›0](B ?›2](3e›0](B  ?›2](32›0](B  ?›2](4_›0](B ?›2](4'›0](B ?›2](4#›0](B ?›2](4Y›0](B ?›2](38›0](B  ?›2](3Z›0](B  ?›2](4%›0](B ?›2](4[›0](B ?›2](3T›0](B  ?›2](3<›0](B  ?›2](4]›0](B ?›2](41›0](B
+     ?›2](4-›0](B ?›2](4A›0](B ?›2](4S›0](B ?›2](45›0](B ?›2](4Q›0](B ?›2](4M›0](B ?›2](3F›0](B  ?›2](4=›0](B ?›2](3-›0](B  ?›2](4O›0](B ?›2](4!›0](B ?<  ?|  ?>  nil ])))
 
 (defvar arabic-mode-map
   (let ((map (make-keymap)))
@@ -168,17 +168,17 @@
                      Keymap in Arabic-mode
  
  +----------------------------------------------------------------+
- |! [2](3"[0](B |@   |#   |$   |%   |^   |&   |*   |( [2](3#[0](B |) [2](3$[0](B |_   |+   |~   |
- |1 (2"[0](B |2 (2#[0](B |3 (2$[0](B |4 (2%[0](B |5 (2&[0](B |6 (2'[0](B |7 (2([0](B |8 (2)[0](B |9 (2*[0](B |0 (2![0](B |-   |=   |` [2](4M[0](B|
+ |! ›2](3"›0](B |@   |#   |$   |%   |^   |&   |*   |( ›2](3#›0](B |) ›2](3$›0](B |_   |+   |~   |
+ |1 (2"(B |2 (2#(B |3 (2$(B |4 (2%(B |5 (2&(B |6 (2'(B |7 (2((B |8 (2)(B |9 (2*(B |0 (2!(B |-   |=   |` ›2](4M›0](B|
  +----------------------------------------------------------------+
-   |Q   |W   |E   |R   |T [2](4E[0](B|Y   |U   |I   |O   |P   |
-   |q [2](4S[0](B|w [2](3^[0](B |e   |r [2](3F[0](B |t [2](4%[0](B|y [2](4_[0](B|u   |i   |o [2](3<[0](B |p [2](4e[0](B|
+   |Q   |W   |E   |R   |T ›2](4E›0](B|Y   |U   |I   |O   |P   |
+   |q ›2](4S›0](B|w ›2](3^›0](B |e   |r ›2](3F›0](B |t ›2](4%›0](B|y ›2](4_›0](B|u   |i   |o ›2](3<›0](B |p ›2](4e›0](B|
    +--------------------------------------------------------+
-     |A [2](4][0](B|S [2](4=[0](B|D [2](4A[0](B|F   |G [2](4O[0](B|H [2](4-[0](B|J   |K [2](41[0](B|L   |: [2](3'[0](B |\" [2](3-[0](B |
-     |a [2](38[0](B |s [2](45[0](B|d [2](3B[0](B |f [2](4Q[0](B|g [2](4k[0](B|h [2](3Z[0](B |j [2](4)[0](B|k [2](4U[0](B|l [2](4Y[0](B|; [2](3([0](B |'   |
+     |A ›2](4]›0](B|S ›2](4=›0](B|D ›2](4A›0](B|F   |G ›2](4O›0](B|H ›2](4-›0](B|J   |K ›2](41›0](B|L   |: ›2](3'›0](B |\" ›2](3-›0](B |
+     |a ›2](38›0](B |s ›2](45›0](B|d ›2](3B›0](B |f ›2](4Q›0](B|g ›2](4k›0](B|h ›2](3Z›0](B |j ›2](4)›0](B|k ›2](4U›0](B|l ›2](4Y›0](B|; ›2](3(›0](B |'   |
      +------------------------------------------------------+
-       |Z [2](4I[0](B|X [2](3h[0](B |C [2](4g[0](B|V   |B   |N   |M   |< [2](3*[0](B |> [2](3+[0](B |? [2](3)[0](B |
-       |z [2](3H[0](B |x [2](3D[0](B |c [2](4'[0](B|v   |b [2](4#[0](B|n [2](4[[0](B|m [2](3T[0](B |, [2](3%[0](B |. [2](3&[0](B |/ [2](49[0](B|
+       |Z ›2](4I›0](B|X ›2](3h›0](B |C ›2](4g›0](B|V   |B   |N   |M   |< ›2](3*›0](B |> ›2](3+›0](B |? ›2](3)›0](B |
+       |z ›2](3H›0](B |x ›2](3D›0](B |c ›2](4'›0](B|v   |b ›2](4#›0](B|n ›2](4[›0](B|m ›2](3T›0](B |, ›2](3%›0](B |. ›2](3&›0](B |/ ›2](49›0](B|
        +-------------------------------------------------+")
  
     ((eq arabic-input-keymap 'arabic-keymap-1)
@@ -186,17 +186,17 @@
                      Keymap in Arabic-mode                   +--------------+
  							    | ALT     SHIFT|
  +-------------------------------------------------+	    |ASCII   ARABIC|
-|  [2](3"[0](B |    |    |    |    |    |    |    |  [2](3#[0](B |  [2](3$[0](B |	    +--------------+
-|1 (2"[0](B |2 (2#[0](B |3 (2$[0](B |4 (2%[0](B |5 (2&[0](B |6 (2'[0](B |7 (2([0](B |8 (2)[0](B |9 (2*[0](B |0 (2![0](B |
+|  ›2](3"›0](B |    |    |    |    |    |    |    |  ›2](3#›0](B |  ›2](3$›0](B |	    +--------------+
+|1 (2"(B |2 (2#(B |3 (2$(B |4 (2%(B |5 (2&(B |6 (2'(B |7 (2((B |8 (2)(B |9 (2*(B |0 (2!(B |
 +-------------------------------------------------------------+
   |    |    |    |    |    |    |    |    |    |    |    |    |
-  |q [2](4A[0](B|w [2](4=[0](B|e [2](4S[0](B|r [2](4Q[0](B|t [2](4O[0](B|y [2](4M[0](B|u [2](3Z[0](B |i   |o [2](41[0](B|p [2](4-[0](B|[ [2](4)[0](B|] [2](4g[0](B|
+  |q ›2](4A›0](B|w ›2](4=›0](B|e ›2](4S›0](B|r ›2](4Q›0](B|t ›2](4O›0](B|y ›2](4M›0](B|u ›2](3Z›0](B |i   |o ›2](41›0](B|p ›2](4-›0](B|[ ›2](4)›0](B|] ›2](4g›0](B|
   +-----------------------------------------------------------+
-    |    |    |    |  [2](4e[0](B|  [2](3.[0](B |    |    |    |    |[2](4k[0](B [2](3'[0](B|
-    |a [2](49[0](B|s [2](45[0](B|d [2](4_[0](B|f [2](4#[0](B|g [2](38[0](B |h [2](4%[0](B|j [2](4Y[0](B|k [2](4[[0](B|l [2](3T[0](B |; [2](4U[0](B|
+    |    |    |    |  ›2](4e›0](B|  ›2](3.›0](B |    |    |    |    |›2](4k›0](B ›2](3'›0](B|
+    |a ›2](49›0](B|s ›2](45›0](B|d ›2](4_›0](B|f ›2](4#›0](B|g ›2](38›0](B |h ›2](4%›0](B|j ›2](4Y›0](B|k ›2](4[›0](B|l ›2](3T›0](B |; ›2](4U›0](B|
     +---------------------------------------------------+
-      |    |    |    |[2](3-[0](B [2](30[0](B |  [2](3h[0](B |    |    |  [2](3*[0](B |  [2](3+[0](B |  [2](3)[0](B |
-      |z [2](4I[0](B|x [2](4E[0](B|c [2](3D[0](B |v [2](3B[0](B |b [2](3H[0](B |n [2](3F[0](B |m [2](3^[0](B |, [2](3%[0](B |. [2](3&[0](B |/   |
+      |    |    |    |›2](3-›0](B ›2](30›0](B |  ›2](3h›0](B |    |    |  ›2](3*›0](B |  ›2](3+›0](B |  ›2](3)›0](B |
+      |z ›2](4I›0](B|x ›2](4E›0](B|c ›2](3D›0](B |v ›2](3B›0](B |b ›2](3H›0](B |n ›2](3F›0](B |m ›2](3^›0](B |, ›2](3%›0](B |. ›2](3&›0](B |/   |
       +-------------------------------------------------+")
 
    (t
@@ -207,17 +207,17 @@
                     +-----------------+                ||  ||
                                                        |\\  \\|
 +-----------------------------------------------------------+
-|!  [2](3"[0](B|@  @|#  #|$  $|%  %|^  ^|&  &|*  *|(  [2](3#[0](B|)  [2](3$[0](B|_  _|+  +|
-|1  (2"[0](B|2  (2#[0](B|3  (2$[0](B|4  (2%[0](B|5  (2&[0](B|6  (2'[0](B|7  (2([0](B|8  (2)[0](B|9  (2*[0](B|0  (2![0](B|-  -|=  =|
+|!  ›2](3"›0](B|@  @|#  #|$  $|%  %|^  ^|&  &|*  *|(  ›2](3#›0](B|)  ›2](3$›0](B|_  _|+  +|
+|1  (2"(B|2  (2#(B|3  (2$(B|4  (2%(B|5  (2&(B|6  (2'(B|7  (2((B|8  (2)(B|9  (2*(B|0  (2!(B|-  -|=  =|
 +-------------------------------------------------------------+
-  |Q   |W   |E   |R   |T  [2](3d[0](B|Y  [2](34[0](B|U  '|I   |O   |P  [2](3([0](B|{  <|}  >|
-  |  [2](4A[0](B|  [2](4=[0](B|  [2](4'[0](B|  [2](4S[0](B|  [2](4Q[0](B|  [2](4O[0](B|  [2](4M[0](B|   [2](3Z[0](B|  [2](41[0](B|  [2](4-[0](B|[ [2](4)[0](B|]  [2](3B[0](B|
+  |Q   |W   |E   |R   |T  ›2](3d›0](B|Y  ›2](34›0](B|U  '|I   |O   |P  ›2](3(›0](B|{  <|}  >|
+  |  ›2](4A›0](B|  ›2](4=›0](B|  ›2](4'›0](B|  ›2](4S›0](B|  ›2](4Q›0](B|  ›2](4O›0](B|  ›2](4M›0](B|   ›2](3Z›0](B|  ›2](41›0](B|  ›2](4-›0](B|[ ›2](4)›0](B|]  ›2](3B›0](B|
   +-------------------------------------------------------------+
-    |A   |S   |D  [|F  ]|G  [2](3c[0](B|H  [2](30[0](B|J   |K  [2](3%[0](B|L  /|:  [2](3'[0](B|\"  \" |~[2](3,[0](B  |
-    |  [2](49[0](B|  [2](45[0](B|  [2](4_[0](B|  [2](4#[0](B|  [2](4Y[0](B|   [2](38[0](B|  [2](4%[0](B|  [2](4[[0](B|   [2](3T[0](B|\; [2](4U[0](B|' [2](4E[0](B|`  [2](3D[0](B|
+    |A   |S   |D  [|F  ]|G  ›2](3c›0](B|H  ›2](30›0](B|J   |K  ›2](3%›0](B|L  /|:  ›2](3'›0](B|\"  \" |~›2](3,›0](B  |
+    |  ›2](49›0](B|  ›2](45›0](B|  ›2](4_›0](B|  ›2](4#›0](B|  ›2](4Y›0](B|   ›2](38›0](B|  ›2](4%›0](B|  ›2](4[›0](B|   ›2](3T›0](B|\; ›2](4U›0](B|' ›2](4E›0](B|`  ›2](3D›0](B|
     +-----------------------------------------------------------+
-      |Z  ~|X   |C  {|V  }|B  [2](3b[0](B|N  [2](3.[0](B|M  `|<  ,|>  [2](3&[0](B|?  [2](3)[0](B|
-      |  [2](4![0](B|   [2](3-[0](B|   [2](32[0](B|   [2](3F[0](B|   [2](3e[0](B|  [2](4][0](B|   [2](3<[0](B|,  [2](3^[0](B|.  [2](3H[0](B|/ [2](4I[0](B|
+      |Z  ~|X   |C  {|V  }|B  ›2](3b›0](B|N  ›2](3.›0](B|M  `|<  ,|>  ›2](3&›0](B|?  ›2](3)›0](B|
+      |  ›2](4!›0](B|   ›2](3-›0](B|   ›2](32›0](B|   ›2](3F›0](B|   ›2](3e›0](B|  ›2](4]›0](B|   ›2](3<›0](B|,  ›2](3^›0](B|.  ›2](3H›0](B|/ ›2](4I›0](B|
       +-------------------------------------------------+"))
 
   "Document shown by arabic-help (M-z).")
@@ -239,7 +239,7 @@
       (progn
 	(setq arabic-mode t
 	      arabic-input-arabic-char t
-	      arabic-mode-indicator " [2](3=a:GJ[0](B")
+	      arabic-mode-indicator " ›2](3=a:GJ›0](B")
 	(redraw-modeline t)
 	(message "M-z to display arabic keymap.")
 	(run-hooks 'arabic-mode-hooks))))
@@ -253,150 +253,150 @@
 	(redraw-modeline t))))
 
 (defconst *arabic-adding-connection-to-right*
-  '((?[2](3.[0](B  . ?[2](3/[0](B )                         (?[2](3/[0](B  . ?[2](3/[0](B )
-    (?[2](30[0](B  . ?[2](31[0](B )                         (?[2](31[0](B  . ?[2](31[0](B )
-    (?[2](32[0](B  . ?[2](33[0](B )                         (?[2](33[0](B  . ?[2](33[0](B )
-    (?[2](34[0](B  . ?[2](35[0](B )                         (?[2](35[0](B  . ?[2](35[0](B )
-    (?[2](4![0](B . ?[2](4"[0](B) (?[2](36[0](B  . ?[2](37[0](B ) (?[2](37[0](B  . ?[2](37[0](B ) (?[2](4"[0](B . ?[2](4"[0](B)
-    (?[2](36[0](B  . ?[2](37[0](B )                         (?[2](37[0](B  . ?[2](37[0](B )
-    (?[2](38[0](B  . ?[2](39[0](B )                         (?[2](39[0](B  . ?[2](39[0](B )
-    (?[2](4#[0](B . ?[2](4$[0](B) (?[2](3:[0](B  . ?[2](3;[0](B ) (?[2](3;[0](B  . ?[2](3;[0](B ) (?[2](4$[0](B . ?[2](4$[0](B)
-    (?[2](3<[0](B  . ?[2](3=[0](B )                         (?[2](3=[0](B  . ?[2](3=[0](B )
-    (?[2](4%[0](B . ?[2](4&[0](B) (?[2](3>[0](B  . ?[2](3?[0](B ) (?[2](3?[0](B  . ?[2](3?[0](B ) (?[2](4&[0](B . ?[2](4&[0](B)
-    (?[2](4'[0](B . ?[2](4([0](B) (?[2](3@[0](B  . ?[2](3A[0](B ) (?[2](3A[0](B  . ?[2](3A[0](B ) (?[2](4([0](B . ?[2](4([0](B)
-    (?[2](4)[0](B . ?[2](4,[0](B) (?[2](4*[0](B . ?[2](4+[0](B) (?[2](4+[0](B . ?[2](4+[0](B) (?[2](4,[0](B . ?[2](4,[0](B)
-    (?[2](4-[0](B . ?[2](40[0](B) (?[2](4.[0](B . ?[2](4/[0](B) (?[2](4/[0](B . ?[2](4/[0](B) (?[2](40[0](B . ?[2](40[0](B)
-    (?[2](41[0](B . ?[2](44[0](B) (?[2](42[0](B . ?[2](43[0](B) (?[2](43[0](B . ?[2](43[0](B) (?[2](44[0](B . ?[2](44[0](B)
-    (?[2](3B[0](B  . ?[2](3C[0](B )                         (?[2](3C[0](B  . ?[2](3C[0](B )
-    (?[2](3D[0](B  . ?[2](3E[0](B )                         (?[2](3E[0](B  . ?[2](3E[0](B )
-    (?[2](3F[0](B  . ?[2](3G[0](B )                         (?[2](3G[0](B  . ?[2](3G[0](B )
-    (?[2](3H[0](B  . ?[2](3I[0](B )                         (?[2](3I[0](B  . ?[2](3I[0](B )
-    (?[2](45[0](B . ?[2](48[0](B) (?[2](46[0](B . ?[2](47[0](B) (?[2](47[0](B . ?[2](47[0](B) (?[2](48[0](B . ?[2](48[0](B)
-    (?[2](49[0](B . ?[2](4<[0](B) (?[2](4:[0](B . ?[2](4;[0](B) (?[2](4;[0](B . ?[2](4;[0](B) (?[2](4<[0](B . ?[2](4<[0](B)
-    (?[2](4=[0](B . ?[2](4@[0](B) (?[2](4>[0](B . ?[2](4?[0](B) (?[2](4?[0](B . ?[2](4?[0](B) (?[2](4@[0](B . ?[2](4@[0](B)
-    (?[2](4A[0](B . ?[2](4D[0](B) (?[2](4B[0](B . ?[2](4C[0](B) (?[2](4C[0](B . ?[2](4C[0](B) (?[2](4D[0](B . ?[2](4D[0](B)
-    (?[2](4E[0](B . ?[2](4H[0](B) (?[2](4F[0](B . ?[2](4G[0](B) (?[2](4G[0](B . ?[2](4G[0](B) (?[2](4H[0](B . ?[2](4H[0](B)
-    (?[2](4I[0](B . ?[2](4L[0](B) (?[2](4J[0](B . ?[2](4K[0](B) (?[2](4K[0](B . ?[2](4K[0](B) (?[2](4L[0](B . ?[2](4L[0](B)
-    (?[2](4M[0](B . ?[2](4N[0](B) (?[2](3J[0](B  . ?[2](3K[0](B ) (?[2](3K[0](B  . ?[2](3K[0](B ) (?[2](4N[0](B . ?[2](4N[0](B)
-    (?[2](4O[0](B . ?[2](4P[0](B) (?[2](3L[0](B  . ?[2](3M[0](B ) (?[2](3M[0](B  . ?[2](3M[0](B ) (?[2](4P[0](B . ?[2](4P[0](B)
-    (?[2](4Q[0](B . ?[2](4R[0](B) (?[2](3N[0](B  . ?[2](3O[0](B ) (?[2](3O[0](B  . ?[2](3O[0](B ) (?[2](4R[0](B . ?[2](4R[0](B)
-    (?[2](4S[0](B . ?[2](4T[0](B) (?[2](3P[0](B  . ?[2](3Q[0](B ) (?[2](3Q[0](B  . ?[2](3Q[0](B ) (?[2](4T[0](B . ?[2](4T[0](B)
-    (?[2](4U[0](B . ?[2](4X[0](B) (?[2](4V[0](B . ?[2](4W[0](B) (?[2](4W[0](B . ?[2](4W[0](B) (?[2](4X[0](B . ?[2](4X[0](B)
-    (?[2](4Y[0](B . ?[2](4Z[0](B) (?[2](3R[0](B  . ?[2](3S[0](B ) (?[2](3S[0](B  . ?[2](3S[0](B ) (?[2](4Z[0](B . ?[2](4Z[0](B)
-    (?[2](3T[0](B  . ?[2](3W[0](B ) (?[2](3U[0](B  . ?[2](3V[0](B ) (?[2](3V[0](B  . ?[2](3V[0](B ) (?[2](3W[0](B  . ?[2](3W[0](B )
-    (?[2](4[[0](B . ?[2](4\[0](B) (?[2](3X[0](B  . ?[2](3Y[0](B ) (?[2](3Y[0](B  . ?[2](3Y[0](B ) (?[2](4\[0](B . ?[2](4\[0](B)
-    (?[2](3Z[0](B  . ?[2](3][0](B ) (?[2](3[[0](B  . ?[2](3\[0](B ) (?[2](3\[0](B  . ?[2](3\[0](B ) (?[2](3][0](B  . ?[2](3][0](B )
-    (?[2](3^[0](B  . ?[2](3_[0](B )                         (?[2](3_[0](B  . ?[2](3_[0](B )
-    (?[2](4][0](B . ?[2](4^[0](B)                         (?[2](4^[0](B . ?[2](4^[0](B)
-    (?[2](4_[0](B . ?[2](4`[0](B) (?[2](3`[0](B  . ?[2](3a[0](B ) (?[2](3a[0](B  . ?[2](3a[0](B ) (?[2](4`[0](B . ?[2](4`[0](B)
-    (?[2](3b[0](B  . ?[2](4a[0](B)                         (?[2](4a[0](B . ?[2](4a[0](B)
-    (?[2](3c[0](B  . ?[2](4b[0](B)                         (?[2](4b[0](B . ?[2](4b[0](B)
-    (?[2](3d[0](B  . ?[2](4c[0](B)                         (?[2](4c[0](B . ?[2](4c[0](B)
-    (?[2](3e[0](B  . ?[2](4d[0](B)                         (?[2](4d[0](B . ?[2](4d[0](B)
-    (?[2](4e[0](B . ?[2](4f[0](B) (?[2](3f[0](B  . ?[2](3g[0](B ) (?[2](3g[0](B  . ?[2](3g[0](B ) (?[2](4f[0](B . ?[2](4f[0](B)
-    (?[2](4g[0](B . ?[2](4j[0](B) (?[2](4h[0](B . ?[2](4i[0](B) (?[2](4i[0](B . ?[2](4i[0](B) (?[2](4j[0](B . ?[2](4j[0](B)
-    (?[2](3h[0](B  . ?[2](3i[0](B )                         (?[2](3i[0](B  . ?[2](3i[0](B )
-    (?[2](4k[0](B . ?[2](4n[0](B) (?[2](4l[0](B . ?[2](4m[0](B) (?[2](4m[0](B . ?[2](4m[0](B) (?[2](4n[0](B . ?[2](4n[0](B)))
+  '((?›2](3.›0](B  . ?›2](3/›0](B )                         (?›2](3/›0](B  . ?›2](3/›0](B )
+    (?›2](30›0](B  . ?›2](31›0](B )                         (?›2](31›0](B  . ?›2](31›0](B )
+    (?›2](32›0](B  . ?›2](33›0](B )                         (?›2](33›0](B  . ?›2](33›0](B )
+    (?›2](34›0](B  . ?›2](35›0](B )                         (?›2](35›0](B  . ?›2](35›0](B )
+    (?›2](4!›0](B . ?›2](4"›0](B) (?›2](36›0](B  . ?›2](37›0](B ) (?›2](37›0](B  . ?›2](37›0](B ) (?›2](4"›0](B . ?›2](4"›0](B)
+    (?›2](36›0](B  . ?›2](37›0](B )                         (?›2](37›0](B  . ?›2](37›0](B )
+    (?›2](38›0](B  . ?›2](39›0](B )                         (?›2](39›0](B  . ?›2](39›0](B )
+    (?›2](4#›0](B . ?›2](4$›0](B) (?›2](3:›0](B  . ?›2](3;›0](B ) (?›2](3;›0](B  . ?›2](3;›0](B ) (?›2](4$›0](B . ?›2](4$›0](B)
+    (?›2](3<›0](B  . ?›2](3=›0](B )                         (?›2](3=›0](B  . ?›2](3=›0](B )
+    (?›2](4%›0](B . ?›2](4&›0](B) (?›2](3>›0](B  . ?›2](3?›0](B ) (?›2](3?›0](B  . ?›2](3?›0](B ) (?›2](4&›0](B . ?›2](4&›0](B)
+    (?›2](4'›0](B . ?›2](4(›0](B) (?›2](3@›0](B  . ?›2](3A›0](B ) (?›2](3A›0](B  . ?›2](3A›0](B ) (?›2](4(›0](B . ?›2](4(›0](B)
+    (?›2](4)›0](B . ?›2](4,›0](B) (?›2](4*›0](B . ?›2](4+›0](B) (?›2](4+›0](B . ?›2](4+›0](B) (?›2](4,›0](B . ?›2](4,›0](B)
+    (?›2](4-›0](B . ?›2](40›0](B) (?›2](4.›0](B . ?›2](4/›0](B) (?›2](4/›0](B . ?›2](4/›0](B) (?›2](40›0](B . ?›2](40›0](B)
+    (?›2](41›0](B . ?›2](44›0](B) (?›2](42›0](B . ?›2](43›0](B) (?›2](43›0](B . ?›2](43›0](B) (?›2](44›0](B . ?›2](44›0](B)
+    (?›2](3B›0](B  . ?›2](3C›0](B )                         (?›2](3C›0](B  . ?›2](3C›0](B )
+    (?›2](3D›0](B  . ?›2](3E›0](B )                         (?›2](3E›0](B  . ?›2](3E›0](B )
+    (?›2](3F›0](B  . ?›2](3G›0](B )                         (?›2](3G›0](B  . ?›2](3G›0](B )
+    (?›2](3H›0](B  . ?›2](3I›0](B )                         (?›2](3I›0](B  . ?›2](3I›0](B )
+    (?›2](45›0](B . ?›2](48›0](B) (?›2](46›0](B . ?›2](47›0](B) (?›2](47›0](B . ?›2](47›0](B) (?›2](48›0](B . ?›2](48›0](B)
+    (?›2](49›0](B . ?›2](4<›0](B) (?›2](4:›0](B . ?›2](4;›0](B) (?›2](4;›0](B . ?›2](4;›0](B) (?›2](4<›0](B . ?›2](4<›0](B)
+    (?›2](4=›0](B . ?›2](4@›0](B) (?›2](4>›0](B . ?›2](4?›0](B) (?›2](4?›0](B . ?›2](4?›0](B) (?›2](4@›0](B . ?›2](4@›0](B)
+    (?›2](4A›0](B . ?›2](4D›0](B) (?›2](4B›0](B . ?›2](4C›0](B) (?›2](4C›0](B . ?›2](4C›0](B) (?›2](4D›0](B . ?›2](4D›0](B)
+    (?›2](4E›0](B . ?›2](4H›0](B) (?›2](4F›0](B . ?›2](4G›0](B) (?›2](4G›0](B . ?›2](4G›0](B) (?›2](4H›0](B . ?›2](4H›0](B)
+    (?›2](4I›0](B . ?›2](4L›0](B) (?›2](4J›0](B . ?›2](4K›0](B) (?›2](4K›0](B . ?›2](4K›0](B) (?›2](4L›0](B . ?›2](4L›0](B)
+    (?›2](4M›0](B . ?›2](4N›0](B) (?›2](3J›0](B  . ?›2](3K›0](B ) (?›2](3K›0](B  . ?›2](3K›0](B ) (?›2](4N›0](B . ?›2](4N›0](B)
+    (?›2](4O›0](B . ?›2](4P›0](B) (?›2](3L›0](B  . ?›2](3M›0](B ) (?›2](3M›0](B  . ?›2](3M›0](B ) (?›2](4P›0](B . ?›2](4P›0](B)
+    (?›2](4Q›0](B . ?›2](4R›0](B) (?›2](3N›0](B  . ?›2](3O›0](B ) (?›2](3O›0](B  . ?›2](3O›0](B ) (?›2](4R›0](B . ?›2](4R›0](B)
+    (?›2](4S›0](B . ?›2](4T›0](B) (?›2](3P›0](B  . ?›2](3Q›0](B ) (?›2](3Q›0](B  . ?›2](3Q›0](B ) (?›2](4T›0](B . ?›2](4T›0](B)
+    (?›2](4U›0](B . ?›2](4X›0](B) (?›2](4V›0](B . ?›2](4W›0](B) (?›2](4W›0](B . ?›2](4W›0](B) (?›2](4X›0](B . ?›2](4X›0](B)
+    (?›2](4Y›0](B . ?›2](4Z›0](B) (?›2](3R›0](B  . ?›2](3S›0](B ) (?›2](3S›0](B  . ?›2](3S›0](B ) (?›2](4Z›0](B . ?›2](4Z›0](B)
+    (?›2](3T›0](B  . ?›2](3W›0](B ) (?›2](3U›0](B  . ?›2](3V›0](B ) (?›2](3V›0](B  . ?›2](3V›0](B ) (?›2](3W›0](B  . ?›2](3W›0](B )
+    (?›2](4[›0](B . ?›2](4\›0](B) (?›2](3X›0](B  . ?›2](3Y›0](B ) (?›2](3Y›0](B  . ?›2](3Y›0](B ) (?›2](4\›0](B . ?›2](4\›0](B)
+    (?›2](3Z›0](B  . ?›2](3]›0](B ) (?›2](3[›0](B  . ?›2](3\›0](B ) (?›2](3\›0](B  . ?›2](3\›0](B ) (?›2](3]›0](B  . ?›2](3]›0](B )
+    (?›2](3^›0](B  . ?›2](3_›0](B )                         (?›2](3_›0](B  . ?›2](3_›0](B )
+    (?›2](4]›0](B . ?›2](4^›0](B)                         (?›2](4^›0](B . ?›2](4^›0](B)
+    (?›2](4_›0](B . ?›2](4`›0](B) (?›2](3`›0](B  . ?›2](3a›0](B ) (?›2](3a›0](B  . ?›2](3a›0](B ) (?›2](4`›0](B . ?›2](4`›0](B)
+    (?›2](3b›0](B  . ?›2](4a›0](B)                         (?›2](4a›0](B . ?›2](4a›0](B)
+    (?›2](3c›0](B  . ?›2](4b›0](B)                         (?›2](4b›0](B . ?›2](4b›0](B)
+    (?›2](3d›0](B  . ?›2](4c›0](B)                         (?›2](4c›0](B . ?›2](4c›0](B)
+    (?›2](3e›0](B  . ?›2](4d›0](B)                         (?›2](4d›0](B . ?›2](4d›0](B)
+    (?›2](4e›0](B . ?›2](4f›0](B) (?›2](3f›0](B  . ?›2](3g›0](B ) (?›2](3g›0](B  . ?›2](3g›0](B ) (?›2](4f›0](B . ?›2](4f›0](B)
+    (?›2](4g›0](B . ?›2](4j›0](B) (?›2](4h›0](B . ?›2](4i›0](B) (?›2](4i›0](B . ?›2](4i›0](B) (?›2](4j›0](B . ?›2](4j›0](B)
+    (?›2](3h›0](B  . ?›2](3i›0](B )                         (?›2](3i›0](B  . ?›2](3i›0](B )
+    (?›2](4k›0](B . ?›2](4n›0](B) (?›2](4l›0](B . ?›2](4m›0](B) (?›2](4m›0](B . ?›2](4m›0](B) (?›2](4n›0](B . ?›2](4n›0](B)))
 
 (defconst *arabic-adding-connection-to-left*
-  '((?[2](4![0](B . ?[2](36[0](B ) (?[2](36[0](B  . ?[2](36[0](B ) (?[2](37[0](B  . ?[2](37[0](B ) (?[2](4"[0](B . ?[2](37[0](B)
-    (?[2](4#[0](B . ?[2](3:[0](B ) (?[2](3:[0](B  . ?[2](3:[0](B ) (?[2](3;[0](B  . ?[2](3;[0](B ) (?[2](4$[0](B . ?[2](3;[0](B )
-    (?[2](4%[0](B . ?[2](3>[0](B ) (?[2](3>[0](B  . ?[2](3>[0](B ) (?[2](3?[0](B  . ?[2](3?[0](B ) (?[2](4&[0](B . ?[2](3?[0](B )
-    (?[2](4'[0](B . ?[2](3@[0](B ) (?[2](3@[0](B  . ?[2](3@[0](B ) (?[2](3A[0](B  . ?[2](3A[0](B ) (?[2](4([0](B . ?[2](3A[0](B )
-    (?[2](4)[0](B . ?[2](4*[0](B) (?[2](4*[0](B . ?[2](4*[0](B) (?[2](4+[0](B . ?[2](4+[0](B) (?[2](4,[0](B . ?[2](4+[0](B)
-    (?[2](4-[0](B . ?[2](4.[0](B) (?[2](4.[0](B . ?[2](4.[0](B) (?[2](4/[0](B . ?[2](4/[0](B) (?[2](40[0](B . ?[2](4/[0](B)
-    (?[2](41[0](B . ?[2](42[0](B) (?[2](42[0](B . ?[2](42[0](B) (?[2](43[0](B . ?[2](43[0](B) (?[2](44[0](B . ?[2](43[0](B)
-    (?[2](45[0](B . ?[2](46[0](B) (?[2](46[0](B . ?[2](46[0](B) (?[2](47[0](B . ?[2](47[0](B) (?[2](48[0](B . ?[2](47[0](B)
-    (?[2](49[0](B . ?[2](4:[0](B) (?[2](4:[0](B . ?[2](4:[0](B) (?[2](4;[0](B . ?[2](4;[0](B) (?[2](4<[0](B . ?[2](4;[0](B)
-    (?[2](4=[0](B . ?[2](4>[0](B) (?[2](4>[0](B . ?[2](4>[0](B) (?[2](4?[0](B . ?[2](4?[0](B) (?[2](4@[0](B . ?[2](4?[0](B)
-    (?[2](4A[0](B . ?[2](4B[0](B) (?[2](4B[0](B . ?[2](4B[0](B) (?[2](4C[0](B . ?[2](4C[0](B) (?[2](4D[0](B . ?[2](4C[0](B)
-    (?[2](4E[0](B . ?[2](4F[0](B) (?[2](4F[0](B . ?[2](4F[0](B) (?[2](4G[0](B . ?[2](4G[0](B) (?[2](4H[0](B . ?[2](4G[0](B)
-    (?[2](4I[0](B . ?[2](4J[0](B) (?[2](4J[0](B . ?[2](4J[0](B) (?[2](4K[0](B . ?[2](4K[0](B) (?[2](4L[0](B . ?[2](4K[0](B)
-    (?[2](4M[0](B . ?[2](3J[0](B ) (?[2](3J[0](B  . ?[2](3J[0](B ) (?[2](3K[0](B  . ?[2](3K[0](B ) (?[2](4N[0](B . ?[2](3K[0](B )
-    (?[2](4O[0](B . ?[2](3L[0](B ) (?[2](3L[0](B  . ?[2](3L[0](B ) (?[2](3M[0](B  . ?[2](3M[0](B ) (?[2](4P[0](B . ?[2](3M[0](B )
-    (?[2](4Q[0](B . ?[2](3N[0](B ) (?[2](3N[0](B  . ?[2](3N[0](B ) (?[2](3O[0](B  . ?[2](3O[0](B ) (?[2](4R[0](B . ?[2](3O[0](B )
-    (?[2](4S[0](B . ?[2](3P[0](B ) (?[2](3P[0](B  . ?[2](3P[0](B ) (?[2](3Q[0](B  . ?[2](3Q[0](B ) (?[2](4T[0](B . ?[2](3Q[0](B )
-    (?[2](4U[0](B . ?[2](4V[0](B) (?[2](4V[0](B . ?[2](4V[0](B) (?[2](4W[0](B . ?[2](4W[0](B) (?[2](4X[0](B . ?[2](4W[0](B)
-    (?[2](4Y[0](B . ?[2](3R[0](B ) (?[2](3R[0](B  . ?[2](3R[0](B ) (?[2](3S[0](B  . ?[2](3S[0](B ) (?[2](4Z[0](B . ?[2](3S[0](B )
-    (?[2](3T[0](B  . ?[2](3U[0](B ) (?[2](3U[0](B  . ?[2](3U[0](B ) (?[2](3V[0](B  . ?[2](3V[0](B ) (?[2](3W[0](B  . ?[2](3V[0](B )
-    (?[2](4[[0](B . ?[2](3X[0](B ) (?[2](3X[0](B  . ?[2](3X[0](B ) (?[2](3Y[0](B  . ?[2](3Y[0](B ) (?[2](4\[0](B . ?[2](3Y[0](B )
-    (?[2](3Z[0](B  . ?[2](3[[0](B ) (?[2](3[[0](B  . ?[2](3[[0](B ) (?[2](3\[0](B  . ?[2](3\[0](B ) (?[2](3][0](B  . ?[2](3\[0](B )
-    (?[2](4_[0](B . ?[2](3`[0](B ) (?[2](3`[0](B  . ?[2](3`[0](B ) (?[2](3a[0](B  . ?[2](3a[0](B ) (?[2](4`[0](B . ?[2](3a[0](B )
-    (?[2](4e[0](B . ?[2](3f[0](B ) (?[2](3f[0](B  . ?[2](3f[0](B ) (?[2](3g[0](B  . ?[2](3g[0](B ) (?[2](4f[0](B . ?[2](3g[0](B)
-    (?[2](4g[0](B . ?[2](4h[0](B) (?[2](4h[0](B . ?[2](4h[0](B) (?[2](4i[0](B . ?[2](4i[0](B) (?[2](4j[0](B . ?[2](4i[0](B)
-    (?[2](4k[0](B . ?[2](4l[0](B) (?[2](4l[0](B . ?[2](4l[0](B) (?[2](4m[0](B . ?[2](4m[0](B) (?[2](4n[0](B . ?[2](4m[0](B)))
+  '((?›2](4!›0](B . ?›2](36›0](B ) (?›2](36›0](B  . ?›2](36›0](B ) (?›2](37›0](B  . ?›2](37›0](B ) (?›2](4"›0](B . ?›2](37›0](B)
+    (?›2](4#›0](B . ?›2](3:›0](B ) (?›2](3:›0](B  . ?›2](3:›0](B ) (?›2](3;›0](B  . ?›2](3;›0](B ) (?›2](4$›0](B . ?›2](3;›0](B )
+    (?›2](4%›0](B . ?›2](3>›0](B ) (?›2](3>›0](B  . ?›2](3>›0](B ) (?›2](3?›0](B  . ?›2](3?›0](B ) (?›2](4&›0](B . ?›2](3?›0](B )
+    (?›2](4'›0](B . ?›2](3@›0](B ) (?›2](3@›0](B  . ?›2](3@›0](B ) (?›2](3A›0](B  . ?›2](3A›0](B ) (?›2](4(›0](B . ?›2](3A›0](B )
+    (?›2](4)›0](B . ?›2](4*›0](B) (?›2](4*›0](B . ?›2](4*›0](B) (?›2](4+›0](B . ?›2](4+›0](B) (?›2](4,›0](B . ?›2](4+›0](B)
+    (?›2](4-›0](B . ?›2](4.›0](B) (?›2](4.›0](B . ?›2](4.›0](B) (?›2](4/›0](B . ?›2](4/›0](B) (?›2](40›0](B . ?›2](4/›0](B)
+    (?›2](41›0](B . ?›2](42›0](B) (?›2](42›0](B . ?›2](42›0](B) (?›2](43›0](B . ?›2](43›0](B) (?›2](44›0](B . ?›2](43›0](B)
+    (?›2](45›0](B . ?›2](46›0](B) (?›2](46›0](B . ?›2](46›0](B) (?›2](47›0](B . ?›2](47›0](B) (?›2](48›0](B . ?›2](47›0](B)
+    (?›2](49›0](B . ?›2](4:›0](B) (?›2](4:›0](B . ?›2](4:›0](B) (?›2](4;›0](B . ?›2](4;›0](B) (?›2](4<›0](B . ?›2](4;›0](B)
+    (?›2](4=›0](B . ?›2](4>›0](B) (?›2](4>›0](B . ?›2](4>›0](B) (?›2](4?›0](B . ?›2](4?›0](B) (?›2](4@›0](B . ?›2](4?›0](B)
+    (?›2](4A›0](B . ?›2](4B›0](B) (?›2](4B›0](B . ?›2](4B›0](B) (?›2](4C›0](B . ?›2](4C›0](B) (?›2](4D›0](B . ?›2](4C›0](B)
+    (?›2](4E›0](B . ?›2](4F›0](B) (?›2](4F›0](B . ?›2](4F›0](B) (?›2](4G›0](B . ?›2](4G›0](B) (?›2](4H›0](B . ?›2](4G›0](B)
+    (?›2](4I›0](B . ?›2](4J›0](B) (?›2](4J›0](B . ?›2](4J›0](B) (?›2](4K›0](B . ?›2](4K›0](B) (?›2](4L›0](B . ?›2](4K›0](B)
+    (?›2](4M›0](B . ?›2](3J›0](B ) (?›2](3J›0](B  . ?›2](3J›0](B ) (?›2](3K›0](B  . ?›2](3K›0](B ) (?›2](4N›0](B . ?›2](3K›0](B )
+    (?›2](4O›0](B . ?›2](3L›0](B ) (?›2](3L›0](B  . ?›2](3L›0](B ) (?›2](3M›0](B  . ?›2](3M›0](B ) (?›2](4P›0](B . ?›2](3M›0](B )
+    (?›2](4Q›0](B . ?›2](3N›0](B ) (?›2](3N›0](B  . ?›2](3N›0](B ) (?›2](3O›0](B  . ?›2](3O›0](B ) (?›2](4R›0](B . ?›2](3O›0](B )
+    (?›2](4S›0](B . ?›2](3P›0](B ) (?›2](3P›0](B  . ?›2](3P›0](B ) (?›2](3Q›0](B  . ?›2](3Q›0](B ) (?›2](4T›0](B . ?›2](3Q›0](B )
+    (?›2](4U›0](B . ?›2](4V›0](B) (?›2](4V›0](B . ?›2](4V›0](B) (?›2](4W›0](B . ?›2](4W›0](B) (?›2](4X›0](B . ?›2](4W›0](B)
+    (?›2](4Y›0](B . ?›2](3R›0](B ) (?›2](3R›0](B  . ?›2](3R›0](B ) (?›2](3S›0](B  . ?›2](3S›0](B ) (?›2](4Z›0](B . ?›2](3S›0](B )
+    (?›2](3T›0](B  . ?›2](3U›0](B ) (?›2](3U›0](B  . ?›2](3U›0](B ) (?›2](3V›0](B  . ?›2](3V›0](B ) (?›2](3W›0](B  . ?›2](3V›0](B )
+    (?›2](4[›0](B . ?›2](3X›0](B ) (?›2](3X›0](B  . ?›2](3X›0](B ) (?›2](3Y›0](B  . ?›2](3Y›0](B ) (?›2](4\›0](B . ?›2](3Y›0](B )
+    (?›2](3Z›0](B  . ?›2](3[›0](B ) (?›2](3[›0](B  . ?›2](3[›0](B ) (?›2](3\›0](B  . ?›2](3\›0](B ) (?›2](3]›0](B  . ?›2](3\›0](B )
+    (?›2](4_›0](B . ?›2](3`›0](B ) (?›2](3`›0](B  . ?›2](3`›0](B ) (?›2](3a›0](B  . ?›2](3a›0](B ) (?›2](4`›0](B . ?›2](3a›0](B )
+    (?›2](4e›0](B . ?›2](3f›0](B ) (?›2](3f›0](B  . ?›2](3f›0](B ) (?›2](3g›0](B  . ?›2](3g›0](B ) (?›2](4f›0](B . ?›2](3g›0](B)
+    (?›2](4g›0](B . ?›2](4h›0](B) (?›2](4h›0](B . ?›2](4h›0](B) (?›2](4i›0](B . ?›2](4i›0](B) (?›2](4j›0](B . ?›2](4i›0](B)
+    (?›2](4k›0](B . ?›2](4l›0](B) (?›2](4l›0](B . ?›2](4l›0](B) (?›2](4m›0](B . ?›2](4m›0](B) (?›2](4n›0](B . ?›2](4m›0](B)))
 
 (defconst *arabic-removing-connection-from-right*
-  '((?[2](3/[0](B  . ?[2](3.[0](B )
-    (?[2](31[0](B  . ?[2](30[0](B )
-    (?[2](33[0](B  . ?[2](32[0](B )
-    (?[2](35[0](B  . ?[2](34[0](B )
-    (?[2](4"[0](B . ?[2](4![0](B) (?[2](37[0](B  . ?[2](36[0](B )
-    (?[2](39[0](B  . ?[2](38[0](B )
-    (?[2](4$[0](B . ?[2](4#[0](B) (?[2](3;[0](B  . ?[2](3:[0](B )
-    (?[2](3=[0](B  . ?[2](3<[0](B )
-    (?[2](4&[0](B . ?[2](4%[0](B) (?[2](3?[0](B  . ?[2](3>[0](B )
-    (?[2](4([0](B . ?[2](4'[0](B) (?[2](3A[0](B  . ?[2](3@[0](B )
-    (?[2](4,[0](B . ?[2](4)[0](B) (?[2](4+[0](B . ?[2](4*[0](B)
-    (?[2](40[0](B . ?[2](4-[0](B) (?[2](4/[0](B . ?[2](4.[0](B)
-    (?[2](44[0](B . ?[2](41[0](B) (?[2](43[0](B . ?[2](42[0](B)
-    (?[2](3C[0](B  . ?[2](3B[0](B )
-    (?[2](3E[0](B  . ?[2](3D[0](B )
-    (?[2](3G[0](B  . ?[2](3F[0](B )
-    (?[2](3I[0](B  . ?[2](3H[0](B )
-    (?[2](48[0](B . ?[2](45[0](B) (?[2](47[0](B . ?[2](46[0](B)
-    (?[2](4<[0](B . ?[2](49[0](B) (?[2](4;[0](B . ?[2](4:[0](B)
-    (?[2](4@[0](B . ?[2](4=[0](B) (?[2](4?[0](B . ?[2](4>[0](B)
-    (?[2](4D[0](B . ?[2](4A[0](B) (?[2](4C[0](B . ?[2](4B[0](B)
-    (?[2](4H[0](B . ?[2](4E[0](B) (?[2](4G[0](B . ?[2](4F[0](B)
-    (?[2](4L[0](B . ?[2](4I[0](B) (?[2](4K[0](B . ?[2](4J[0](B)
-    (?[2](4N[0](B . ?[2](4M[0](B) (?[2](3K[0](B  . ?[2](3J[0](B )
-    (?[2](4P[0](B . ?[2](4O[0](B) (?[2](3M[0](B  . ?[2](3L[0](B )
-    (?[2](4R[0](B . ?[2](4Q[0](B) (?[2](3O[0](B  . ?[2](3N[0](B )
-    (?[2](4T[0](B . ?[2](4S[0](B) (?[2](3Q[0](B  . ?[2](3P[0](B )
-    (?[2](4X[0](B . ?[2](4U[0](B) (?[2](4W[0](B . ?[2](4V[0](B)
-    (?[2](4Z[0](B . ?[2](4Y[0](B) (?[2](3S[0](B  . ?[2](3R[0](B )
-    (?[2](3W[0](B  . ?[2](3T[0](B ) (?[2](3V[0](B  . ?[2](3U[0](B )
-    (?[2](4\[0](B . ?[2](4[[0](B) (?[2](3Y[0](B  . ?[2](3X[0](B )
-    (?[2](3][0](B  . ?[2](3Z[0](B ) (?[2](3\[0](B  . ?[2](3[[0](B )
-    (?[2](3_[0](B  . ?[2](3^[0](B )
-    (?[2](4^[0](B . ?[2](4][0](B)
-    (?[2](4`[0](B . ?[2](4_[0](B) (?[2](3a[0](B  . ?[2](3`[0](B )
-    (?[2](4a[0](B . ?[2](3b[0](B )
-    (?[2](4b[0](B . ?[2](3c[0](B )
-    (?[2](4c[0](B . ?[2](3d[0](B )
-    (?[2](4d[0](B . ?[2](3e[0](B )
-    (?[2](4f[0](B . ?[2](4e[0](B) (?[2](3g[0](B  . ?[2](3f[0](B )
-    (?[2](4j[0](B . ?[2](4g[0](B) (?[2](4i[0](B . ?[2](4h[0](B)
-    (?[2](3i[0](B  . ?[2](3h[0](B)
-    (?[2](4n[0](B . ?[2](4k[0](B) (?[2](4m[0](B . ?[2](4l[0](B)))
+  '((?›2](3/›0](B  . ?›2](3.›0](B )
+    (?›2](31›0](B  . ?›2](30›0](B )
+    (?›2](33›0](B  . ?›2](32›0](B )
+    (?›2](35›0](B  . ?›2](34›0](B )
+    (?›2](4"›0](B . ?›2](4!›0](B) (?›2](37›0](B  . ?›2](36›0](B )
+    (?›2](39›0](B  . ?›2](38›0](B )
+    (?›2](4$›0](B . ?›2](4#›0](B) (?›2](3;›0](B  . ?›2](3:›0](B )
+    (?›2](3=›0](B  . ?›2](3<›0](B )
+    (?›2](4&›0](B . ?›2](4%›0](B) (?›2](3?›0](B  . ?›2](3>›0](B )
+    (?›2](4(›0](B . ?›2](4'›0](B) (?›2](3A›0](B  . ?›2](3@›0](B )
+    (?›2](4,›0](B . ?›2](4)›0](B) (?›2](4+›0](B . ?›2](4*›0](B)
+    (?›2](40›0](B . ?›2](4-›0](B) (?›2](4/›0](B . ?›2](4.›0](B)
+    (?›2](44›0](B . ?›2](41›0](B) (?›2](43›0](B . ?›2](42›0](B)
+    (?›2](3C›0](B  . ?›2](3B›0](B )
+    (?›2](3E›0](B  . ?›2](3D›0](B )
+    (?›2](3G›0](B  . ?›2](3F›0](B )
+    (?›2](3I›0](B  . ?›2](3H›0](B )
+    (?›2](48›0](B . ?›2](45›0](B) (?›2](47›0](B . ?›2](46›0](B)
+    (?›2](4<›0](B . ?›2](49›0](B) (?›2](4;›0](B . ?›2](4:›0](B)
+    (?›2](4@›0](B . ?›2](4=›0](B) (?›2](4?›0](B . ?›2](4>›0](B)
+    (?›2](4D›0](B . ?›2](4A›0](B) (?›2](4C›0](B . ?›2](4B›0](B)
+    (?›2](4H›0](B . ?›2](4E›0](B) (?›2](4G›0](B . ?›2](4F›0](B)
+    (?›2](4L›0](B . ?›2](4I›0](B) (?›2](4K›0](B . ?›2](4J›0](B)
+    (?›2](4N›0](B . ?›2](4M›0](B) (?›2](3K›0](B  . ?›2](3J›0](B )
+    (?›2](4P›0](B . ?›2](4O›0](B) (?›2](3M›0](B  . ?›2](3L›0](B )
+    (?›2](4R›0](B . ?›2](4Q›0](B) (?›2](3O›0](B  . ?›2](3N›0](B )
+    (?›2](4T›0](B . ?›2](4S›0](B) (?›2](3Q›0](B  . ?›2](3P›0](B )
+    (?›2](4X›0](B . ?›2](4U›0](B) (?›2](4W›0](B . ?›2](4V›0](B)
+    (?›2](4Z›0](B . ?›2](4Y›0](B) (?›2](3S›0](B  . ?›2](3R›0](B )
+    (?›2](3W›0](B  . ?›2](3T›0](B ) (?›2](3V›0](B  . ?›2](3U›0](B )
+    (?›2](4\›0](B . ?›2](4[›0](B) (?›2](3Y›0](B  . ?›2](3X›0](B )
+    (?›2](3]›0](B  . ?›2](3Z›0](B ) (?›2](3\›0](B  . ?›2](3[›0](B )
+    (?›2](3_›0](B  . ?›2](3^›0](B )
+    (?›2](4^›0](B . ?›2](4]›0](B)
+    (?›2](4`›0](B . ?›2](4_›0](B) (?›2](3a›0](B  . ?›2](3`›0](B )
+    (?›2](4a›0](B . ?›2](3b›0](B )
+    (?›2](4b›0](B . ?›2](3c›0](B )
+    (?›2](4c›0](B . ?›2](3d›0](B )
+    (?›2](4d›0](B . ?›2](3e›0](B )
+    (?›2](4f›0](B . ?›2](4e›0](B) (?›2](3g›0](B  . ?›2](3f›0](B )
+    (?›2](4j›0](B . ?›2](4g›0](B) (?›2](4i›0](B . ?›2](4h›0](B)
+    (?›2](3i›0](B  . ?›2](3h›0](B)
+    (?›2](4n›0](B . ?›2](4k›0](B) (?›2](4m›0](B . ?›2](4l›0](B)))
 
 (defconst *arabic-removing-connection-from-left*
-  '((?[2](36[0](B  . ?[2](4![0](B) (?[2](37[0](B  . ?[2](4"[0](B)
-    (?[2](3:[0](B  . ?[2](4#[0](B) (?[2](3;[0](B  . ?[2](4$[0](B)
-    (?[2](3>[0](B  . ?[2](4%[0](B) (?[2](3?[0](B  . ?[2](4&[0](B)
-    (?[2](3@[0](B  . ?[2](4'[0](B) (?[2](3A[0](B  . ?[2](4([0](B)
-    (?[2](4*[0](B . ?[2](4)[0](B) (?[2](4+[0](B . ?[2](4,[0](B)
-    (?[2](4.[0](B . ?[2](4-[0](B) (?[2](4/[0](B . ?[2](40[0](B)
-    (?[2](42[0](B . ?[2](41[0](B) (?[2](43[0](B . ?[2](44[0](B)
-    (?[2](46[0](B . ?[2](45[0](B) (?[2](47[0](B . ?[2](48[0](B)
-    (?[2](4:[0](B . ?[2](49[0](B) (?[2](4;[0](B . ?[2](4<[0](B)
-    (?[2](4>[0](B . ?[2](4=[0](B) (?[2](4?[0](B . ?[2](4@[0](B)
-    (?[2](4D[0](B . ?[2](4A[0](B) (?[2](4C[0](B . ?[2](4A[0](B)
-    (?[2](4F[0](B . ?[2](4E[0](B) (?[2](4G[0](B . ?[2](4H[0](B)
-    (?[2](4J[0](B . ?[2](4I[0](B) (?[2](4K[0](B . ?[2](4L[0](B)
-    (?[2](3J[0](B  . ?[2](4M[0](B) (?[2](3K[0](B  . ?[2](4N[0](B)
-    (?[2](3L[0](B  . ?[2](4O[0](B) (?[2](3M[0](B  . ?[2](4P[0](B)
-    (?[2](3N[0](B  . ?[2](4Q[0](B) (?[2](3O[0](B  . ?[2](4R[0](B)
-    (?[2](3P[0](B  . ?[2](4S[0](B) (?[2](3Q[0](B  . ?[2](4T[0](B)
-    (?[2](4V[0](B . ?[2](4U[0](B) (?[2](4W[0](B . ?[2](4X[0](B)
-    (?[2](3R[0](B  . ?[2](4Y[0](B) (?[2](3S[0](B  . ?[2](4Z[0](B)
-    (?[2](3U[0](B  . ?[2](3T[0](B ) (?[2](3V[0](B  . ?[2](3W[0](B )
-    (?[2](3X[0](B  . ?[2](4[[0](B) (?[2](3Y[0](B  . ?[2](4\[0](B)
-    (?[2](3[[0](B  . ?[2](3Z[0](B ) (?[2](3\[0](B  . ?[2](3][0](B )
-    (?[2](3`[0](B  . ?[2](4_[0](B) (?[2](3a[0](B  . ?[2](4`[0](B)
-    (?[2](4h[0](B . ?[2](4g[0](B) (?[2](4i[0](B . ?[2](4j[0](B)
-    (?[2](4l[0](B . ?[2](4k[0](B) (?[2](4m[0](B . ?[2](4n[0](B)))
+  '((?›2](36›0](B  . ?›2](4!›0](B) (?›2](37›0](B  . ?›2](4"›0](B)
+    (?›2](3:›0](B  . ?›2](4#›0](B) (?›2](3;›0](B  . ?›2](4$›0](B)
+    (?›2](3>›0](B  . ?›2](4%›0](B) (?›2](3?›0](B  . ?›2](4&›0](B)
+    (?›2](3@›0](B  . ?›2](4'›0](B) (?›2](3A›0](B  . ?›2](4(›0](B)
+    (?›2](4*›0](B . ?›2](4)›0](B) (?›2](4+›0](B . ?›2](4,›0](B)
+    (?›2](4.›0](B . ?›2](4-›0](B) (?›2](4/›0](B . ?›2](40›0](B)
+    (?›2](42›0](B . ?›2](41›0](B) (?›2](43›0](B . ?›2](44›0](B)
+    (?›2](46›0](B . ?›2](45›0](B) (?›2](47›0](B . ?›2](48›0](B)
+    (?›2](4:›0](B . ?›2](49›0](B) (?›2](4;›0](B . ?›2](4<›0](B)
+    (?›2](4>›0](B . ?›2](4=›0](B) (?›2](4?›0](B . ?›2](4@›0](B)
+    (?›2](4D›0](B . ?›2](4A›0](B) (?›2](4C›0](B . ?›2](4A›0](B)
+    (?›2](4F›0](B . ?›2](4E›0](B) (?›2](4G›0](B . ?›2](4H›0](B)
+    (?›2](4J›0](B . ?›2](4I›0](B) (?›2](4K›0](B . ?›2](4L›0](B)
+    (?›2](3J›0](B  . ?›2](4M›0](B) (?›2](3K›0](B  . ?›2](4N›0](B)
+    (?›2](3L›0](B  . ?›2](4O›0](B) (?›2](3M›0](B  . ?›2](4P›0](B)
+    (?›2](3N›0](B  . ?›2](4Q›0](B) (?›2](3O›0](B  . ?›2](4R›0](B)
+    (?›2](3P›0](B  . ?›2](4S›0](B) (?›2](3Q›0](B  . ?›2](4T›0](B)
+    (?›2](4V›0](B . ?›2](4U›0](B) (?›2](4W›0](B . ?›2](4X›0](B)
+    (?›2](3R›0](B  . ?›2](4Y›0](B) (?›2](3S›0](B  . ?›2](4Z›0](B)
+    (?›2](3U›0](B  . ?›2](3T›0](B ) (?›2](3V›0](B  . ?›2](3W›0](B )
+    (?›2](3X›0](B  . ?›2](4[›0](B) (?›2](3Y›0](B  . ?›2](4\›0](B)
+    (?›2](3[›0](B  . ?›2](3Z›0](B ) (?›2](3\›0](B  . ?›2](3]›0](B )
+    (?›2](3`›0](B  . ?›2](4_›0](B) (?›2](3a›0](B  . ?›2](4`›0](B)
+    (?›2](4h›0](B . ?›2](4g›0](B) (?›2](4i›0](B . ?›2](4j›0](B)
+    (?›2](4l›0](B . ?›2](4k›0](B) (?›2](4m›0](B . ?›2](4n›0](B)))
 
 (defun arabic-make-connection nil
   "If possible, tie the two characters around the cursor."
@@ -471,14 +471,14 @@
   "Insert gaaf as if it were typed from keyboard."
   (interactive "*p")
   (while (> arg 0)
-    (arabic-keyboard-insert-1-char ?[2](4k[0](B)
+    (arabic-keyboard-insert-1-char ?›2](4k›0](B)
     (setq arg (1- arg))))
 
 (defun arabic-insert-isolated-hamza (arg)
   "Insert an isolated hamza as if it were typed from keyboard."
   (interactive "*p")
   (while (> arg 0)
-    (arabic-keyboard-insert-1-char ?[2](3-[0](B)
+    (arabic-keyboard-insert-1-char ?›2](3-›0](B)
     (setq arg (1- arg))))
 
 (defun arabic-insert-madda nil
@@ -486,10 +486,10 @@
   (interactive)
   (let ((rch (visual-char-right)))
     (cond
-     ((eq rch ?[2](38[0](B ) (visual-replace-right-1-char ?[2](3.[0](B ))
-     ((eq rch ?[2](39[0](B ) (visual-replace-right-1-char ?[2](3/[0](B ))
-     ((eq rch ?[2](3e[0](B ) (visual-replace-right-1-char ?[2](3b[0](B ))
-     ((eq rch ?[2](4d[0](B) (visual-replace-right-1-char ?[2](4a[0](B))
+     ((eq rch ?›2](38›0](B ) (visual-replace-right-1-char ?›2](3.›0](B ))
+     ((eq rch ?›2](39›0](B ) (visual-replace-right-1-char ?›2](3/›0](B ))
+     ((eq rch ?›2](3e›0](B ) (visual-replace-right-1-char ?›2](3b›0](B ))
+     ((eq rch ?›2](4d›0](B) (visual-replace-right-1-char ?›2](4a›0](B))
      (t (beep)))))
 
 (defun arabic-insert-alif (arg)
@@ -501,13 +501,13 @@
       (setq rch (visual-char-right))
       (cond
        ((eq last-command 'arabic-cut-connection)
-	(visual-insert-right-1-char ?[2](38[0](B))
-       ((or (eq rch ?[2](4Y[0](B) (eq rch ?[2](3R[0](B ))
-	(visual-replace-right-1-char ?[2](3e[0](B ))
-       ((or (eq rch ?[2](3S[0](B ) (eq rch ?[2](4Z[0](B))
-	(visual-replace-right-1-char ?[2](4d[0](B))
+	(visual-insert-right-1-char ?›2](38›0](B))
+       ((or (eq rch ?›2](4Y›0](B) (eq rch ?›2](3R›0](B ))
+	(visual-replace-right-1-char ?›2](3e›0](B ))
+       ((or (eq rch ?›2](3S›0](B ) (eq rch ?›2](4Z›0](B))
+	(visual-replace-right-1-char ?›2](4d›0](B))
        (t
-	(visual-insert-left-1-char ?[2](38[0](B )
+	(visual-insert-left-1-char ?›2](38›0](B )
 	(arabic-make-connection)
 	(visual-move-to-left-1-char)))
       (setq arg (1- arg)))
@@ -522,25 +522,25 @@
       (setq rch (visual-char-right))
       (cond
        ((eq last-command 'arabic-cut-connection)
-	(visual-insert-right-1-char ?[2](3-[0](B))
-       ((eq rch ?[2](38[0](B ) (visual-replace-right-1-char ?[2](30[0](B ))
-       ((eq rch ?[2](39[0](B ) (visual-replace-right-1-char ?[2](31[0](B ))
-       ((eq rch ?[2](30[0](B ) (visual-replace-right-1-char ?[2](34[0](B ))
-       ((eq rch ?[2](31[0](B ) (visual-replace-right-1-char ?[2](35[0](B ))
-       ((eq rch ?[2](3^[0](B ) (visual-replace-right-1-char ?[2](32[0](B ))
-       ((eq rch ?[2](3_[0](B ) (visual-replace-right-1-char ?[2](33[0](B ))
-       ((eq rch ?[2](4_[0](B) (visual-replace-right-1-char ?[2](4![0](B))
-       ((eq rch ?[2](3`[0](B ) (visual-replace-right-1-char ?[2](36[0](B ))
-       ((eq rch ?[2](3a[0](B ) (visual-replace-right-1-char ?[2](37[0](B ))
-       ((eq rch ?[2](4`[0](B) (visual-replace-right-1-char ?[2](4"[0](B))
-       ((eq rch ?[2](4][0](B) (visual-replace-right-1-char ?[2](4![0](B))
-       ((eq rch ?[2](4^[0](B) (visual-replace-right-1-char ?[2](4"[0](B))
-       ((eq rch ?[2](3e[0](B ) (visual-replace-right-1-char ?[2](3c[0](B ))
-       ((eq rch ?[2](4d[0](B) (visual-replace-right-1-char ?[2](4b[0](B))
-       ((eq rch ?[2](3c[0](B ) (visual-replace-right-1-char ?[2](3d[0](B ))
-       ((eq rch ?[2](4b[0](B) (visual-replace-right-1-char ?[2](4c[0](B))
+	(visual-insert-right-1-char ?›2](3-›0](B))
+       ((eq rch ?›2](38›0](B ) (visual-replace-right-1-char ?›2](30›0](B ))
+       ((eq rch ?›2](39›0](B ) (visual-replace-right-1-char ?›2](31›0](B ))
+       ((eq rch ?›2](30›0](B ) (visual-replace-right-1-char ?›2](34›0](B ))
+       ((eq rch ?›2](31›0](B ) (visual-replace-right-1-char ?›2](35›0](B ))
+       ((eq rch ?›2](3^›0](B ) (visual-replace-right-1-char ?›2](32›0](B ))
+       ((eq rch ?›2](3_›0](B ) (visual-replace-right-1-char ?›2](33›0](B ))
+       ((eq rch ?›2](4_›0](B) (visual-replace-right-1-char ?›2](4!›0](B))
+       ((eq rch ?›2](3`›0](B ) (visual-replace-right-1-char ?›2](36›0](B ))
+       ((eq rch ?›2](3a›0](B ) (visual-replace-right-1-char ?›2](37›0](B ))
+       ((eq rch ?›2](4`›0](B) (visual-replace-right-1-char ?›2](4"›0](B))
+       ((eq rch ?›2](4]›0](B) (visual-replace-right-1-char ?›2](4!›0](B))
+       ((eq rch ?›2](4^›0](B) (visual-replace-right-1-char ?›2](4"›0](B))
+       ((eq rch ?›2](3e›0](B ) (visual-replace-right-1-char ?›2](3c›0](B ))
+       ((eq rch ?›2](4d›0](B) (visual-replace-right-1-char ?›2](4b›0](B))
+       ((eq rch ?›2](3c›0](B ) (visual-replace-right-1-char ?›2](3d›0](B ))
+       ((eq rch ?›2](4b›0](B) (visual-replace-right-1-char ?›2](4c›0](B))
        (t (arabic-cut-connection)
-	  (visual-insert-right-1-char ?[2](3-[0](B)))
+	  (visual-insert-right-1-char ?›2](3-›0](B)))
       (setq arg (1- arg)))))
 
 (defun arabic-toggle-input-char nil
@@ -550,7 +550,7 @@
       (setq arabic-input-arabic-char nil
 	    arabic-mode-indicator " Arabic")
     (setq arabic-input-arabic-char t
-	  arabic-mode-indicator " [2](3=a:GJ[0](B"))
+	  arabic-mode-indicator " ›2](3=a:GJ›0](B"))
   (redraw-modeline t))
 
 (defun arabic-newline (arg)
@@ -671,5 +671,6 @@
     (arabic-kill-word arg)))
 
 ;;;
-(provide 'arabic)
+(provide 'language/arabic-util)
+
 ;;; arabic-util.el ends here
--- a/lisp/language/arabic.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/language/arabic.el	Mon Aug 13 09:45:46 2007 +0200
@@ -28,7 +28,7 @@
 ;;; Code:
 
 ;; Three character sets for Arabic
-(make-charset 'arabic-0 "Arabic digits"
+(make-charset 'arabic-digit "Arabic digits"
 	      '(registry "MuleArabic-0"
 		dimension 1
 		chars 94
@@ -37,7 +37,7 @@
 		direction l2r
 		))
 
-(make-charset 'arabic-1 "one-column Arabic"
+(make-charset 'arabic-1-column "Arabic 1-column"
 	      '(registry "MuleArabic-1"
 		dimension 1
 		chars 94
@@ -46,7 +46,7 @@
 		direction r2l
 		))
 
-(make-charset 'arabic-2 "two-column Arabic"
+(make-charset 'arabic-2-column "Arabic 2-column"
 	      '(registry "MuleArabic-2"
 		dimension 1
 		chars 94
--- a/lisp/language/chinese.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/language/chinese.el	Mon Aug 13 09:45:46 2007 +0200
@@ -54,7 +54,7 @@
     ((make-chinese-cns11643-charset
       (name plane final)
       (make-charset
-       name (concat "Chinese CNS Plane " plane)
+       name (concat "CNS 11643 Plane " plane " (Chinese traditional)")
        `(registry 
          ,(concat "CNS11643[.-]\\(.*[.-]\\)?" plane "$")
          dimension 2
@@ -71,6 +71,18 @@
   (make-chinese-cns11643-charset 'chinese-cns11643-7 "7" ?M)
   )
 
+;; ISO-IR-165 (CCITT Extended GB)
+;;    It is based on CCITT Recommendation T.101, includes GB 2312-80 +
+;;    GB 8565-88 table A4 + 293 characters.
+(make-charset
+ 'chinese-isoir165
+ "ISO-IR-165 (CCITT Extended GB; Chinese simplified)"
+ `(registry "isoir165"
+   dimension 2
+   chars 94
+   final ?E
+   graphic 0))
+
 ;; PinYin-ZhuYin
 (make-charset 'sisheng "PinYin-ZhuYin"
 	      '(registry "sisheng_cwnn\\|OMRON_UDC_ZH"
--- a/lisp/leim/auto-autoloads.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/leim/auto-autoloads.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,3 +1,9 @@
+;;; DO NOT MODIFY THIS FILE
+(if (not (featurep 'leim-autoloads))
+    (progn
+
+(provide 'leim-autoloads)
+))
 
 ;;;### (autoloads (quail-use-package) "quail" "leim/quail.el")
 
--- a/lisp/leim/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/leim/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
@@ -19,6 +21,7 @@
 (put 'calendar 'custom-loads '())
 (put 'help-appearance 'custom-loads '())
 (put 'display-time 'custom-loads '())
+(put 'lisp 'custom-loads '())
 (put 'diff 'custom-loads '())
 (put 'paren-matching 'custom-loads '())
 (put 'help 'custom-loads '())
@@ -28,14 +31,19 @@
 (put 'message-sending 'custom-loads '())
 (put 'data 'custom-loads '())
 (put 'ps-print 'custom-loads '())
+(put 'backup 'custom-loads '())
 (put 'frames 'custom-loads '())
+(put 'customize 'custom-loads '())
 (put 'abbrev 'custom-loads '())
 (put 'toolbar 'custom-loads '())
 (put 'compilation 'custom-loads '())
+(put 'dired 'custom-loads '())
 (put 'killing 'custom-loads '())
 (put 'paren-blinking 'custom-loads '())
+(put 'find-file 'custom-loads '())
 (put 'gnuserv 'custom-loads '())
 (put 'maint 'custom-loads '())
+(put 'fill-comments 'custom-loads '())
 (put 'message-mail 'custom-loads '())
 (put 'windows 'custom-loads '())
 (put 'message-various 'custom-loads '())
@@ -46,7 +54,7 @@
 (put 'diary 'custom-loads '())
 (put 'browse-url 'custom-loads '())
 (put 'message-insertion 'custom-loads '())
-(put 'hyper-apropos 'custom-loads '())
+(put 'vc 'custom-loads '())
 (put 'alloc 'custom-loads '())
 (put 'isearch 'custom-loads '())
 (put 'modeline 'custom-loads '())
@@ -54,4 +62,5 @@
 (put 'editing 'custom-loads '())
 (put 'matching 'custom-loads '())
 (put 'ps-print-color 'custom-loads '())
+(put 'undo 'custom-loads '())
 (put 'x 'custom-loads '())
--- a/lisp/locale/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/locale/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/mailcrypt/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/mailcrypt/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/mel/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/mel/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/mh-e/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/mh-e/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/modes/abbrev.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/modes/abbrev.el	Mon Aug 13 09:45:46 2007 +0200
@@ -30,9 +30,11 @@
 ;;; Code:
 
 ;jwz: this is preloaded so don't ;;;###autoload
-(defconst only-global-abbrevs nil "\
-*t means user plans to use global abbrevs only.
-Makes the commands to define mode-specific abbrevs define global ones instead.")
+(defcustom only-global-abbrevs nil "\
+*Non-nil means user plans to use global abbrevs only.
+Makes the commands to define mode-specific abbrevs define global ones instead."
+  :type 'boolean
+  :group 'abbrev)
 
 ;;; XEmacs: the following block of code is not in FSF
 (defvar abbrev-table-name-list '()
@@ -73,7 +75,7 @@
 (defun define-abbrev (table name &optional expansion hook count)
   "Define an abbrev in TABLE named NAME, to expand to EXPANSION or call HOOK.
 NAME and EXPANSION are strings.  Hook is a function or `nil'.
-To undefine an abbrev, define with the an expansion of `nil'."
+To undefine an abbrev, define it with an expansion of `nil'."
   (or (not expansion)
       (stringp expansion)
       (setq expansion (signal 'wrong-type-argument
@@ -82,14 +84,20 @@
       (integerp count)
       (setq count (signal 'wrong-type-argument
                           (list 'fixnump count))))
+  (or (vectorp table)
+      (setq table (signal 'wrong-type-argument
+			  (list 'vectorp table))))
   (let* ((sym (intern name table))
          (oexp (and (boundp sym) (symbol-value sym)))
          (ohook (and (fboundp sym) (symbol-function sym))))
-    (if (not (and (equal ohook hook)
-                  (stringp oexp)
-                  (stringp expansion)
-                  (string-equal oexp expansion)))
-        (setq abbrevs-changed t))
+    (unless (and (equal ohook hook)
+		 (stringp oexp)
+		 (stringp expansion)
+		 (string-equal oexp expansion))
+      (setq abbrevs-changed t)
+      ;; If there is a non-word character in the string, set the flag.
+      (if (string-match "\\W" name)
+	  (set (intern " " table) nil)))
     (set sym expansion)
     (fset sym hook)
     (setplist sym (or count 0))
@@ -132,7 +140,7 @@
   (interactive "sDefine mode abbrev: \nsExpansion for %s: ")
   (define-abbrev (or local-abbrev-table
                      (error "Major mode has no abbrev table"))
-		 (downcase name) nil 0))
+		 (downcase name) expansion 0))
 
 (defun abbrev-symbol (abbrev &optional table)
   "Return the symbol representing abbrev named ABBREV.
--- a/lisp/modes/auto-autoloads.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/modes/auto-autoloads.el	Mon Aug 13 09:45:46 2007 +0200
@@ -615,6 +615,25 @@
 
 ;;;***
 
+;;;### (autoloads (image-decode-xpm image-decode-png image-decode-gif image-decode-jpeg image-mode) "image-mode" "modes/image-mode.el")
+
+(autoload 'image-mode "image-mode" "\
+\\{image-mode-map}" t nil)
+
+(autoload 'image-decode-jpeg "image-mode" "\
+Decode JPEG image between START and END." nil nil)
+
+(autoload 'image-decode-gif "image-mode" "\
+Decode GIF image between START and END." nil nil)
+
+(autoload 'image-decode-png "image-mode" "\
+Decode PNG image between START and END." nil nil)
+
+(autoload 'image-decode-xpm "image-mode" "\
+Decode XPM image between START and END." nil nil)
+
+;;;***
+
 ;;;### (autoloads (imenu imenu-add-to-menubar) "imenu" "modes/imenu.el")
 
 (defvar imenu-generic-expression nil "\
@@ -661,7 +680,7 @@
 ;;;### (autoloads (ksh-mode) "ksh-mode" "modes/ksh-mode.el")
 
 (autoload 'ksh-mode "ksh-mode" "\
-ksh-mode $Revision: 1.2 $ - Major mode for editing (Bourne, Korn or Bourne again)
+ksh-mode $Revision: 1.3 $ - Major mode for editing (Bourne, Korn or Bourne again)
 shell scripts.
 Special key bindings and commands:
 \\{ksh-mode-map}
@@ -772,6 +791,15 @@
 
 ;;;***
 
+;;;### (autoloads (linuxdoc-sgml-mode) "linuxdoc-sgml" "modes/linuxdoc-sgml.el")
+
+(autoload 'linuxdoc-sgml-mode "linuxdoc-sgml" "\
+Major mode based on SGML mode for editing linuxdoc-sgml documents.
+See the documentation on sgml-mode for more info. This mode
+understands the linuxdoc-sgml tags." t nil)
+
+;;;***
+
 ;;;### (autoloads (define-mail-alias build-mail-aliases mail-aliases-setup) "mail-abbrevs" "modes/mail-abbrevs.el")
 
 (defcustom mail-abbrev-mailrc-file nil "Name of file with mail aliases.   If nil, ~/.mailrc is used." :type '(choice (const :tag "Default" nil) file) :group 'mail-abbrevs)
@@ -1584,6 +1612,10 @@
 
 ;;;***
 
+;;;### (autoloads nil "sgml-mode" "modes/sgml-mode.el")
+
+;;;***
+
 ;;;### (autoloads (sh-mode) "sh-script" "modes/sh-script.el")
 
 (put 'sh-mode 'mode-class 'special)
@@ -2005,7 +2037,7 @@
 
 (autoload 'vhdl-mode "vhdl-mode" "\
 Major mode for editing VHDL code.
-vhdl-mode $Revision: 1.2 $
+vhdl-mode $Revision: 1.3 $
 To submit a problem report, enter `\\[vhdl-submit-bug-report]' from a
 vhdl-mode buffer.  This automatically sets up a mail buffer with version
 information already added.  You just need to add a description of the
--- a/lisp/modes/auto-show.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/modes/auto-show.el	Mon Aug 13 09:45:46 2007 +0200
@@ -58,23 +58,35 @@
 
 ;;; Code:
 
-(defvar auto-show-mode t
+(defgroup auto-show nil
+  "Perform automatic horizontal scrolling as point moves."
+  :group 'display
+  :group 'extensions)
+
+;; This is preloaded, so we don't need special :set, :require, etc.
+(defcustom auto-show-mode t
   "*Non-nil enables automatic horizontal scrolling, when lines are truncated.
 The default value is t.  To change the default, do this:
 	(set-default 'auto-show-mode nil)
 See also command `auto-show-mode'.
 This variable has no effect when lines are not being truncated.
-This variable is automatically local in each buffer where it is set.")
+This variable is automatically local in each buffer where it is set."
+  :type 'boolean
+  :group 'auto-show)
 
 (make-variable-buffer-local 'auto-show-mode)
 
-(defvar auto-show-shift-amount 8 
-  "*Extra columns to scroll. for automatic horizontal scrolling.")
+(defcustom auto-show-shift-amount 8 
+  "*Extra columns to scroll. for automatic horizontal scrolling."
+  :type 'integer
+  :group 'auto-show)
 
-(defvar auto-show-show-left-margin-threshold 50
+(defcustom auto-show-show-left-margin-threshold 50
   "*Threshold column for automatic horizontal scrolling to the right.
 If point is before this column, we try to scroll to make the left margin
-visible.  Setting this to 0 disables this feature.")
+visible.  Setting this to 0 disables this feature."
+  :type 'number
+  :group 'auto-show)
 
 (defun auto-show-truncationp ()
   "True if line truncation is enabled for the selected window."
@@ -165,13 +177,7 @@
 		    (and (= col right-col)
 			 (not (eolp))))
 		(scroll-left (+ auto-show-shift-amount 
-				(- col (+ scroll w-width))))
-	      )
-	    )
-	  )
-	)
-    )
-  )
+				(- col (+ scroll w-width))))))))))
 
 ;; XEmacs change:
 ;; #### instead of this, we kludgily call it from the C code, to make sure
--- a/lisp/modes/cperl-mode.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/modes/cperl-mode.el	Mon Aug 13 09:45:46 2007 +0200
@@ -31,8 +31,10 @@
 
 ;;; Corrections made by Ilya Zakharevich ilya@math.mps.ohio-state.edu
 ;;; XEmacs changes by Peter Arius arius@informatik.uni-erlangen.de
-
-;; $Id: cperl-mode.el,v 1.11 1997/06/14 20:31:09 steve Exp $
+;;; XEmacs 'delete key behavior handling added for XEmacs 20.x by
+;;; Gary D. Foster <Gary.Foster@corp.sun.com>
+
+;; $Id: cperl-mode.el,v 1.12 1997/06/29 23:12:54 steve Exp $
 
 ;;; To use this mode put the following into your .emacs file:
 
@@ -1563,8 +1565,13 @@
 	(delete-region (point) p))
     (backward-delete-char-untabify arg)))
 
+;; helper function for deletion, which honors the desired delete direction
+;; behavior.  Added by Gary D. Foster, <Gary.Foster@corp.sun.com> and bound
+;; to the 'delete keysym by default.
+
 (defun cperl-electric-delete (arg)
-  "Backspace-untabify, or remove the whitespace inserted by an electric key."
+  "Delete, or remove the whitespace inserted by an electric key.
+Delete direction is controlled by the setting of `delete-key-deletes-forward'."
   (interactive "*p")
   (if (and cperl-auto-newline 
 	   (memq last-command '(cperl-electric-semi 
--- a/lisp/modes/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/modes/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,7 +1,9 @@
+(put 'extensions 'custom-loads '("auto-show"))
 (put 'message 'custom-loads '("sendmail"))
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
 (put 'prolog 'custom-loads '("prolog"))
+(put 'auto-show 'custom-loads '("auto-show"))
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '("outl-mouse" "strokes"))
 (put 'reftex-defining-label-environments 'custom-loads '())
@@ -54,7 +56,7 @@
 (put 'frames 'custom-loads '("rsz-minibuf"))
 (put 'customize 'custom-loads '())
 (put 'verilog 'custom-loads '("verilog-mode"))
-(put 'abbrev 'custom-loads '())
+(put 'abbrev 'custom-loads '("abbrev"))
 (put 'f90-indent 'custom-loads '("f90"))
 (put 'strokes 'custom-loads '("strokes"))
 (put 'toolbar 'custom-loads '())
@@ -76,7 +78,7 @@
 (put 'languages 'custom-loads '("asm-mode" "fortran" "icon" "pascal" "prolog" "rexx-mode" "sh-script" "tcl" "verilog-mode" "vrml-mode" "winmgr-mode" "xrdb-mode"))
 (put 'fill 'custom-loads '())
 (put 'debug 'custom-loads '())
-(put 'display 'custom-loads '())
+(put 'display 'custom-loads '("auto-show"))
 (put 'diary 'custom-loads '())
 (put 'browse-url 'custom-loads '())
 (put 'enriched 'custom-loads '("enriched"))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/modes/image-mode.el	Mon Aug 13 09:45:46 2007 +0200
@@ -0,0 +1,165 @@
+;;; image-mode.el --- Major mode for navigate images
+
+;; Copyright (C) 1997 MORIOKA Tomohiko
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Created: 1997/6/27
+;; Version: $Id: image-mode.el,v 1.1 1997/06/29 23:12:55 steve Exp $
+;; Keywords: image, graphics
+
+;; 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.
+
+;;; Code:
+
+(defvar buffer-image-format nil)
+(make-variable-buffer-local 'buffer-image-format)
+
+(defsubst image-decode (start end type)
+  "Decode the image between START and END which is encoded in TYPE."
+  (save-excursion
+    (let ((image (make-image-instance
+		  (vector type :data (buffer-string)) nil nil 'no-error)))
+      (delete-region start end)
+      (if image
+	  (let ((glyph (make-glyph image)))
+	    (set-extent-begin-glyph (make-extent start start) glyph)
+	    (setq buffer-read-only t)
+	    )
+	(insert (format "%s is not supported!\n" type))
+	(let ((overriding-local-map image-mode-map))
+	  (insert
+	   (substitute-command-keys
+	    "
+Please type `\\[image-toggle-decoding]' if you would like to display
+raw data.
+Please type `\\[image-enter-hexl-mode]' if you would like to edit hex
+data.
+Please type `\\[image-start-external-viewer]' if you would like to
+display contents of this buffer by external viewer.\n")))
+	(call-interactively 'fill-paragraph)
+	)
+      start)))
+
+(defvar image-mode-map (make-keymap))
+(suppress-keymap image-mode-map)
+(define-key image-mode-map "v" 'image-start-external-viewer)
+(define-key image-mode-map "t" 'image-toggle-decoding)
+(define-key image-mode-map "h" 'image-enter-hexl-mode)
+(define-key image-mode-map "q" 'image-mode-quit)
+
+(defvar image-external-viewer
+  (cond ((exec-installed-p "display")	 "display")	; ImageMagic
+	((exec-installed-p "xv")	 "xv")		; xv
+	)
+  "*External viewer for image-mode.")
+
+(defun image-start-external-viewer ()
+  "Start external image viewer for current-buffer.
+It uses `image-external-viewer' as external image viewer."
+  (interactive)
+  (start-process "external image viewer" nil
+		 image-external-viewer buffer-file-name)
+  )
+
+(defun image-toggle-decoding ()
+  "Toggle image display mode in current buffer."
+  (interactive)
+  (if buffer-file-format
+      (progn
+	(setq buffer-read-only nil)
+	(erase-buffer)
+	(map-extents (function
+		      (lambda (extent maparg)
+			(delete-extent extent)
+			)) nil (point-min)(point-min))
+	(setq buffer-file-format nil)
+	(insert-file-contents-literally buffer-file-name)
+	(set-buffer-modified-p nil)
+	)
+    (format-decode-buffer buffer-image-format)
+    ))
+
+(defun image-exit-hexl-mode-function ()
+  (format-decode-buffer)
+  (remove-hook 'hexl-mode-exit-hook 'image-exit-hexl-mode-function)
+  )
+
+(defun image-enter-hexl-mode ()
+  "Enter to hexl-mode."
+  (interactive)
+  (when buffer-file-format
+    (setq buffer-read-only nil)
+    (erase-buffer)
+    (map-extents (function
+		  (lambda (extent maparg)
+		    (delete-extent extent)
+		    )) nil (point-min)(point-min))
+    (setq buffer-file-format nil)
+    (insert-file-contents-literally buffer-file-name)
+    (set-buffer-modified-p nil)
+    (add-hook 'hexl-mode-exit-hook 'image-exit-hexl-mode-function)
+    )
+  (hexl-mode)
+  )
+
+(defun image-mode-quit ()
+  "Exit image-mode."
+  (interactive)
+  (kill-buffer (current-buffer))
+  )
+
+;;;###autoload
+(defun image-mode (&optional arg)
+  "\\{image-mode-map}"
+  (interactive)
+  (setq major-mode 'image-mode)
+  (setq mode-name "Image")
+  (use-local-map image-mode-map)
+  )
+
+;;;###autoload
+(defun image-decode-jpeg (start end)
+  "Decode JPEG image between START and END."
+  (setq buffer-image-format 'image/jpeg)
+  (image-decode start end 'jpeg)
+  )
+
+;;;###autoload
+(defun image-decode-gif (start end)
+  "Decode GIF image between START and END."
+  (setq buffer-image-format 'image/gif)
+  (image-decode start end 'gif)
+  )
+
+;;;###autoload
+(defun image-decode-png (start end)
+  "Decode PNG image between START and END."
+  (setq buffer-image-format 'image/png)
+  (image-decode start end 'png)
+  )
+
+;;;###autoload
+(defun image-decode-xpm (start end)
+  "Decode XPM image between START and END."
+  (setq buffer-image-format 'image/x-xpm)
+  (image-decode start end 'xpm)
+  )
+
+(provide 'image-mode)
+
+;;; image-mode.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/modes/linuxdoc-sgml.el	Mon Aug 13 09:45:46 2007 +0200
@@ -0,0 +1,176 @@
+;;; linuxdoc-sgml.el --- sgml-mode enhancements for linuxdoc
+
+;; Copyright (C) 1996 by Free Software Foundation, Inc.
+
+;; Author: Arun Sharma <asharma@sco.com>
+;; Keywords: docs, languages
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Installation:
+;;     Make sure that this file is in your load-path and put this line
+;;     in your .emacs.
+;;     (autoload 'linuxdoc-sgml-mode "linuxdoc-sgml" t t)
+;;     (setq auto-mode-alist (cons '("\\.sgml$" . linuxdoc-sgml-mode)
+;;                                  auto-mode-alist))
+;; 
+;; Optionally:
+;;     (add-hook 'linuxdoc-sgml-mode-hook 'turn-on-font-lock)
+;; 
+;; Caveat: I've had problems getting sgml/html code to work with
+;;         lazy-lock. Currently under investigation.
+;;; Code:
+
+(require 'sgml-mode)
+
+(defvar  linuxdoc-sgml-tag-alist 
+  (let* ((htmlurl '(("ftp:") ("file:") ("finger:")
+		    ("gopher:") ("http:") ("mailto:") ("news:")
+		    ("rlogin:") ("telnet:") ("tn3270:") ("wais:")
+		    ("/cgi-bin/")))
+	 (name '(str))
+	 (id '(str)))
+    `(("abstract" \n)
+      ("article" \n)
+      ("author" t)
+      ("bf")
+      ("date" t)
+      ("descrip" \n)
+      ("enum" \n)
+      ("footnote")
+      ("htmlurl" t ("url" ,@htmlurl) ("name" ,@name))
+      ("item" t)
+      ("itemize" \n)
+      ("label" ("id" ,@id))
+      ("p" t)
+      ("quote" \n)
+      ("ref" t ("id") ("name" ,@name))
+      ("sect"   (t  (setq str (read-input "Sect: ")) "\n<p>\n"))
+      ("sect1"  (t  (setq str (read-input "Sect1: ")) "\n<p>\n"))
+      ("sect2"  (t  (setq str (read-input "Sect2: ")) "\n<p>\n"))
+      ("sect3"  (t  (setq str (read-input "Sect3: ")) "\n<p>\n"))
+      ("sect4"  (t  (setq str (read-input "Sect4: ")) "\n<p>\n"))
+      ("tag //" t)
+      ("title" (t  (setq str (read-input "Title: ")) "\n"))
+      ("toc" t)
+      ("tscreen")
+      ("tt" (nil (setq str (read-input "Text: "))))
+      ("url" t ("url" ,@htmlurl) ("name" ,@name))
+      ("verb" \n)))
+    "Linuxdoc specific tags")
+
+(defvar  linuxdoc-sgml-tag-help 
+  '(("abstract" . "Abstract of the document") 
+    ("article" . "Beginning of the article")
+    ("author" . "Name of the Author")
+    ("bf" . "Bold font")     
+    ("date" . "Date")
+    ("descrip" . "Description environment")
+    ("enum" . "Enumerated items")
+    ("footnote" . "Footnotes")
+    ("htmlurl" . "Insert a URL that shows up only in the HTML version")
+    ("item" . "An enumerated or unordered item")
+    ("itemize" . "Unordered list")
+    ("label" . "A label for cross reference")
+    ("p" . "Marks the end of the sect* tag")
+    ("quote" . "Quote a piece of text")
+    ("ref" . "Cross reference")
+    ("sect"  . "Main section heading") 
+    ("sect1" . "Level 1 section heading")
+    ("sect2" . "Level 2 section heading")
+    ("sect3" . "Level 3 section heading") 
+    ("sect4" . "Level 4 section heading")
+    ("tag //"   . "A description tag")    
+    ("title" . "Title of the document")
+    ("toc" . "The table of contents")
+    ("tscreen" . "Indents the text and uses tt font")
+    ("tt" . "Uses the tt font")     
+    ("url" . "Insert a URL")
+    ("verb" . "The text will be typed verbatim"))
+  "Help for linuxdoc specific tags")
+
+(defvar linuxdoc-sgml-tag-face-alist
+  '(("abstract" . underline)
+    ("article" . italic)
+    ("author" . italic)
+    ("bf" . bold)
+    ("date" . italic)
+    ("descrip" . font-lock-reference-face)
+    ("enum" . font-lock-type-face)
+    ("footnote" . font-lock-keyword-face)
+    ("htmlurl" . font-lock-string-face)
+    ("item" . font-lock-function-name-face)
+    ("itemize" . font-lock-type-face)
+    ("label" . font-lock-comment-face)
+    ("p" . default)
+    ("quote" . underline)
+    ("ref" . font-lock-comment-face)
+    ("sect"  . underline)
+    ("sect1" . underline)
+    ("sect2" . underline)
+    ("sect3" . underline)
+    ("sect4" . underline)
+    ("tag"   . font-lock-function-name-face)
+    ("title" . underline)
+    ("toc" . default)
+    ("tscreen" . underline)
+    ("tt" . underline)
+    ("url" . font-lock-string-face)
+    ("verb" . underline))
+    "Value of `sgml-tag-face-alist' for linuxdoc-sgml mode.")
+
+(defvar linuxdoc-sgml-font-lock-keywords
+    '(("<\\([^>]*\\)>" . font-lock-comment-face))
+    "Patterns to highlight in LD-SGML buffers.")
+
+;;;###autoload
+(defun linuxdoc-sgml-mode ()
+  "Major mode based on SGML mode for editing linuxdoc-sgml documents.
+See the documentation on sgml-mode for more info. This mode
+understands the linuxdoc-sgml tags."
+  (interactive)
+  (sgml-mode-common linuxdoc-sgml-tag-face-alist nil)
+  (use-local-map sgml-mode-map)
+  (make-local-variable 'sgml-tag-alist)
+  (make-local-variable 'sgml-face-tag-alist)
+  (make-local-variable 'sgml-tag-help)
+  (make-local-variable 'outline-regexp)
+  (make-local-variable 'outline-heading-end-regexp)
+  (make-local-variable 'outline-level)
+  (make-local-variable 'sgml-font-lock-keywords)
+  (setq mode-name "LD-SGML"
+        major-mode 'linuxdoc-sgml-mode
+	sgml-tag-alist linuxdoc-sgml-tag-alist
+	sgml-face-tag-alist linuxdoc-sgml-tag-face-alist
+	sgml-tag-help linuxdoc-sgml-tag-help
+	outline-regexp "^.*<sect[1-4]\\>"
+	outline-heading-end-regexp "<p>"
+	sgml-font-lock-keywords-1 (append sgml-font-lock-keywords-1
+					  linuxdoc-sgml-font-lock-keywords
+					  sgml-font-lock-keywords)
+					  
+	outline-level (lambda ()
+			(char-after (1- (match-end 0)))))
+  (run-hooks 'linuxdoc-sgml-mode-hook))
+
+
+(provide 'linuxdoc-sgml)
+
+;;; linuxdoc-sgml.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/modes/sgml-mode.el	Mon Aug 13 09:45:46 2007 +0200
@@ -0,0 +1,1272 @@
+;;; sgml-mode.el --- SGML- and HTML-editing modes
+
+;; Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
+
+;; Author: James Clark <jjc@clark.com>
+;; Adapted-By: ESR; Daniel.Pfeiffer@Informatik.START.dbp.de
+;; Keywords: wp, hypermedia, comm, languages
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Configurable major mode for editing document in the SGML standard general
+;; markup language.  As an example contains a mode for editing the derived
+;; HTML hypertext markup language.
+
+;;; Code:
+
+;; As long as Emacs' syntax can't be complemented with predicates to context
+;; sensitively confirm the syntax of characters, we have to live with this
+;; kludgy kind of tradeoff.
+(defvar sgml-specials '(?\")
+  "List of characters that have a special meaning for sgml-mode.
+This list is used when first loading the sgml-mode library.
+The supported characters and potential disadvantages are:
+
+  ?\\\"	Makes \" in text start a string.
+  ?'	Makes ' in text start a string.
+  ?-	Makes -- in text start a comment.
+
+When only one of ?\\\" or ?' are included, \"'\" or '\"' as it can be found in
+DTDs, start a string.  To partially avoid this problem this also makes these
+self insert as named entities depending on `sgml-quick-keys'.
+
+Including ?- has the problem of affecting dashes that have nothing to do
+with comments, so we normally turn it off.")
+
+(defvar sgml-quick-keys nil
+  "Use <, >, &, SPC and `sgml-specials' keys ``electrically'' when non-nil.
+This takes effect when first loading the library.")
+
+
+(defvar sgml-mode-map
+  (let (;;(map (list 'keymap (make-vector 256 nil)))
+	(map (make-keymap))
+	(menu-map (make-sparse-keymap "SGML")))
+    (define-key map "\t" 'indent-relative-maybe)
+    (define-key map "\C-c\C-i" 'sgml-tags-invisible)
+    (define-key map "/" 'sgml-slash)
+    (define-key map "\C-c\C-n" 'sgml-name-char)
+    (define-key map "\C-c\C-t" 'sgml-tag)
+    (define-key map "\C-c\C-a" 'sgml-attributes)
+    (define-key map "\C-c\C-b" 'sgml-skip-tag-backward)
+    (define-key map [?\C-c left] 'sgml-skip-tag-backward)
+    (define-key map "\C-c\C-f" 'sgml-skip-tag-forward)
+    (define-key map [?\C-c right] 'sgml-skip-tag-forward)
+    (define-key map "\C-c\C-d" 'sgml-delete-tag)
+    (define-key map "\C-c\^?" 'sgml-delete-tag)
+    (define-key map "\C-c?" 'sgml-tag-help)
+    (define-key map "\C-c8" 'sgml-name-8bit-mode)
+    (define-key map "\C-c\C-v" 'sgml-validate)
+    (if sgml-quick-keys
+	(progn
+	  (define-key map "&" 'sgml-name-char)
+	  (define-key map "<" 'sgml-tag)
+	  (define-key map " " 'sgml-auto-attributes)
+	  (define-key map ">" 'sgml-maybe-end-tag)
+	  (if (memq ?\" sgml-specials)
+	      (define-key map "\"" 'sgml-name-self))
+	  (if (memq ?' sgml-specials)
+	      (define-key map "'" 'sgml-name-self))))
+    (let ((c 127)
+	  ;; (map (nth 1 map))
+	  )
+      (while (< (setq c (1+ c)) 256)
+	;; (aset map c 'sgml-maybe-name-self)))
+	(define-key map (int-char c) 'sgml-maybe-name-self)))
+    (define-key map [menu-bar sgml] (cons "SGML" menu-map))
+    (define-key menu-map [sgml-validate] '("Validate" . sgml-validate))
+    (define-key menu-map [sgml-name-8bit-mode]
+      '("Toggle 8 Bit Insertion" . sgml-name-8bit-mode))
+    (define-key menu-map [sgml-tags-invisible]
+      '("Toggle Tag Visibility" . sgml-tags-invisible))
+    (define-key menu-map [sgml-tag-help]
+      '("Describe Tag" . sgml-tag-help))
+    (define-key menu-map [sgml-delete-tag]
+      '("Delete Tag" . sgml-delete-tag))
+    (define-key menu-map [sgml-skip-tag-forward]
+      '("Forward Tag" . sgml-skip-tag-forward))
+    (define-key menu-map [sgml-skip-tag-backward]
+      '("Backward Tag" . sgml-skip-tag-backward))
+    (define-key menu-map [sgml-attributes]
+      '("Insert Attributes" . sgml-attributes))
+    (define-key menu-map [sgml-tag] '("Insert Tag" . sgml-tag))
+    map)
+  "Keymap for SGML mode.  See also `sgml-specials'.")
+
+
+(defvar sgml-mode-syntax-table
+  (let ((table (copy-syntax-table text-mode-syntax-table)))
+    (modify-syntax-entry ?< "(>" table)
+    (modify-syntax-entry ?> ")<" table)
+    (if (memq ?- sgml-specials)
+	(modify-syntax-entry ?- "_ 1234" table))
+    (if (memq ?\" sgml-specials)
+	(modify-syntax-entry ?\" "\"\"" table))
+    (if (memq ?' sgml-specials)
+	(modify-syntax-entry ?\' "\"'" table))
+    table)
+  "Syntax table used in SGML mode.  See also `sgml-specials'.")
+
+
+(defvar sgml-name-8bit-mode nil
+  "*When non-`nil' insert 8 bit characters with their names.")
+
+(defvar sgml-char-names
+  [nil nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   "ensp" "excl" "quot" "num" "dollar" "percnt" "amp" "apos"
+   "lpar" "rpar" "ast" "plus" "comma" "hyphen" "period" "sol"
+   nil nil nil nil nil nil nil nil
+   nil nil "colon" "semi" "lt" "eq" "gt" "quest"
+   "commat" nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil "lsqb" nil "rsqb" "uarr" "lowbar"
+   "lsquo" nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil "lcub" "verbar" "rcub" "tilde" nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   nil nil nil nil nil nil nil nil
+   "nbsp" "iexcl" "cent" "pound" "curren" "yen" "brvbar" "sect"
+   "uml" "copy" "ordf" "laquo" "not" "shy" "reg" "macr"
+   "ring" "plusmn" "sup2" "sup3" "acute" "micro" "para" "middot"
+   "cedil" "sup1" "ordm" "raquo" "frac14" "half" "frac34" "iquest"
+   "Agrave" "Aacute" "Acirc" "Atilde" "Auml" "Aring" "AElig" "Ccedil"
+   "Egrave" "Eacute" "Ecirc" "Euml" "Igrave" "Iacute" "Icirc" "Iuml"
+   "ETH" "Ntilde" "Ograve" "Oacute" "Ocirc" "Otilde" "Ouml" nil
+   "Oslash" "Ugrave" "Uacute" "Ucirc" "Uuml" "Yacute" "THORN" "szlig"
+   "agrave" "aacute" "acirc" "atilde" "auml" "aring" "aelig" "ccedil"
+   "egrave" "eacute" "ecirc" "euml" "igrave" "iacute" "icirc" "iuml"
+   "eth" "ntilde" "ograve" "oacute" "ocirc" "otilde" "ouml" "divide"
+   "oslash" "ugrave" "uacute" "ucirc" "uuml" "yacute" "thorn" "yuml"]
+  "Vector of symbolic character names without `&' and `;'.")
+
+
+;; sgmls is a free SGML parser available from
+;; ftp.uu.net:pub/text-processing/sgml
+;; Its error messages can be parsed by next-error.
+;; The -s option suppresses output.
+
+(defvar sgml-validate-command "sgmls -s"
+  "*The command to validate an SGML document.
+The file name of current buffer file name will be appended to this,
+separated by a space.")
+
+(defvar sgml-saved-validate-command nil
+  "The command last used to validate in this buffer.")
+
+
+;;; I doubt that null end tags are used much for large elements,
+;;; so use a small distance here.
+(defconst sgml-slash-distance 1000
+  "*If non-nil, is the maximum distance to search for matching /.")
+
+(defconst sgml-start-tag-regex
+  "<[A-Za-z]\\([-.A-Za-z0-9= \n\t]\\|\"[^\"]*\"\\|'[^']*'\\)*"
+  "Regular expression that matches a non-empty start tag.
+Any terminating > or / is not matched.")
+
+
+(defvar sgml-font-lock-keywords
+  '(("<\\([!?][a-z0-9]+\\)" 1 font-lock-keyword-face)
+    ("<\\(/?[a-z0-9]+\\)" 1 font-lock-function-name-face)
+    ("[&%][-.A-Za-z0-9]+;?" . font-lock-variable-name-face)
+    ("<!--[^<>]*-->" . font-lock-comment-face))
+  "*Rules for highlighting SGML code.  See also `sgml-tag-face-alist'.")
+
+;; internal
+(defvar sgml-font-lock-keywords-1 ())
+
+(defvar sgml-face-tag-alist ()
+  "Alist of face and tag name for facemenu.")
+
+(defvar sgml-tag-face-alist ()
+  "Tag names and face or list of faces to fontify with when invisible.
+When `font-lock-maximum-decoration' is 1 this is always used for fontifying.
+When more these are fontified together with `sgml-font-lock-keywords'.")
+
+
+(defvar sgml-display-text ()
+  "Tag names as lowercase symbols, and display string when invisible.")
+
+;; internal
+(defvar sgml-tags-invisible nil)
+
+
+(defvar sgml-tag-alist
+  '(("![" ("ignore" t) ("include" t))
+    ("!attlist")
+    ("!doctype")
+    ("!element")
+    ("!entity"))
+  "*Alist of tag names for completing read and insertion rules.
+This alist is made up as
+
+  ((\"tag\" . TAGRULE)
+   ...)
+
+TAGRULE is a list of optionally `t' (no endtag) or `\\n' (separate endtag by
+newlines) or a skeleton with `nil', `t' or `\\n' in place of the interactor
+followed by an ATTRIBUTERULE (for an always present attribute) or an
+attribute alist.
+
+The attribute alist is made up as
+
+  ((\"attribute\" . ATTRIBUTERULE)
+   ...)
+
+ATTRIBUTERULE is a list of optionally `t' (no value when no input) followed by
+an optional alist of possible values.")
+
+(defvar sgml-tag-help
+  '(("!" . "Empty declaration for comment")
+    ("![" . "Embed declarations with parser directive")
+    ("!attlist" . "Tag attributes declaration")
+    ("!doctype" . "Document type (DTD) declaration")
+    ("!element" . "Tag declaration")
+    ("!entity" . "Entity (macro) declaration"))
+  "*Alist of tag name and short description.")
+
+
+;; put read-only last to enable setting this even when read-only enabled
+(or (get 'sgml-tag 'invisible)
+    (setplist 'sgml-tag
+	      (append '(invisible t
+			rear-nonsticky t
+			point-entered sgml-point-entered
+			read-only t)
+		      (symbol-plist 'sgml-tag))))
+
+
+
+(defun sgml-mode-common (sgml-tag-face-alist sgml-display-text)
+  "Common code for setting up `sgml-mode' and derived modes.
+SGML-TAG-FACE-ALIST is used for calculating `sgml-font-lock-keywords-1'.
+SGML-DISPLAY-TEXT sets up alternate text for when tags are invisible (see
+varables of same name)."
+  (kill-all-local-variables)
+  (setq local-abbrev-table text-mode-abbrev-table)
+  (set-syntax-table sgml-mode-syntax-table)
+  (make-local-variable 'indent-line-function)
+  (make-local-variable 'paragraph-start)
+  (make-local-variable 'paragraph-separate)
+  (make-local-variable 'sgml-saved-validate-command)
+  (make-local-variable 'comment-start)
+  (make-local-variable 'comment-end)
+  (make-local-variable 'comment-indent-function)
+  (make-local-variable 'comment-start-skip)
+  (make-local-variable 'comment-indent-function)
+  (make-local-variable 'sgml-tags-invisible)
+  (make-local-variable 'skeleton-transformation)
+  (make-local-variable 'skeleton-further-elements)
+  (make-local-variable 'skeleton-end-hook)
+  (make-local-variable 'font-lock-defaults)
+  (make-local-variable 'sgml-font-lock-keywords-1)
+  (make-local-variable 'facemenu-add-face-function)
+  (make-local-variable 'facemenu-end-add-face)
+  ;;(make-local-variable 'facemenu-remove-face-function)
+  (and sgml-tag-face-alist
+       (not (assq 1 sgml-tag-face-alist))
+       (nconc sgml-tag-face-alist
+	      `((1 (,(concat "<\\("
+			     (mapconcat 'car sgml-tag-face-alist "\\|")
+			     "\\)\\([ \t].+\\)?>\\(.+\\)</\\1>")
+		    3 (cdr (assoc (match-string 1) ',sgml-tag-face-alist)))))))
+  (setq indent-line-function 'indent-relative-maybe
+	;; A start or end tag by itself on a line separates a paragraph.
+	;; This is desirable because SGML discards a newline that appears
+	;; immediately after a start tag or immediately before an end tag.
+	paragraph-start "^[ \t\n]\\|\
+\\(</?\\([A-Za-z]\\([-.A-Za-z0-9= \t\n]\\|\"[^\"]*\"\\|'[^']*'\\)*\\)?>$\\)"
+	paragraph-separate "^[ \t\n]*$\\|\
+^</?\\([A-Za-z]\\([-.A-Za-z0-9= \t\n]\\|\"[^\"]*\"\\|'[^']*'\\)*\\)?>$"
+	comment-start "<!-- "
+	comment-end " -->"
+	comment-indent-function 'sgml-comment-indent
+	;; This will allow existing comments within declarations to be
+	;; recognized.
+	comment-start-skip "--[ \t]*"
+	skeleton-transformation 'identity
+	skeleton-further-elements '((completion-ignore-case t))
+	skeleton-end-hook (lambda ()
+			    (or (eolp)
+				(not (or (eq v2 '\n)
+					 (eq (car-safe v2) '\n)))
+				(newline-and-indent)))
+	sgml-font-lock-keywords-1 (cdr (assq 1 sgml-tag-face-alist))
+	font-lock-defaults '((sgml-font-lock-keywords
+			      sgml-font-lock-keywords-1)
+			     nil
+			     t)
+	facemenu-add-face-function
+	  (lambda (face end)
+	    (if (setq face (cdr (assq face sgml-face-tag-alist)))
+		(progn
+		  (setq facemenu-end-add-face (concat "</" face ">"))
+		  (concat "<" face ">"))
+	      (error "Face not configured for %s mode." mode-name))))
+  (while sgml-display-text
+    (put (car (car sgml-display-text)) 'before-string
+	 (cdr (car sgml-display-text)))
+    (setq sgml-display-text (cdr sgml-display-text)))
+  (run-hooks 'text-mode-hook 'sgml-mode-hook))
+
+;; Conflicts with psgml, don't autoload
+;; ;;;###autoload
+(defun sgml-mode (&optional function)
+  "Major mode for editing SGML documents.
+Makes > match <.  Makes / blink matching /.
+Keys <, &, SPC within <>, \" and ' can be electric depending on
+`sgml-quick-keys'.
+
+Do \\[describe-variable] sgml- SPC to see available variables.
+
+Use \\[sgml-validate] to validate your document with an SGML parser.
+\\{sgml-mode-map}"
+  (interactive)
+  (sgml-mode-common sgml-tag-face-alist sgml-display-text)
+  (use-local-map sgml-mode-map)
+  (setq mode-name "SGML"
+	major-mode 'sgml-mode))
+
+
+
+(defun sgml-comment-indent ()
+  (if (and (looking-at "--")
+	   (not (and (eq (preceding-char) ?!)
+		     (eq (char-after (- (point) 2)) ?<))))
+      (progn
+	(skip-chars-backward " \t")
+	(max comment-column (1+ (current-column))))
+    0))
+
+
+
+(defun sgml-slash (arg)
+  "Insert / and display any previous matching /.
+Two /s are treated as matching if the first / ends a net-enabling
+start tag, and the second / is the corresponding null end tag."
+  (interactive "p")
+  (insert-char ?/ arg)
+  (if (> arg 0)
+      (let ((oldpos (point))
+	    (blinkpos)
+	    (level 0))
+	(save-excursion
+	  (save-restriction
+	    (if sgml-slash-distance
+		(narrow-to-region (max (point-min)
+				       (- (point) sgml-slash-distance))
+				  oldpos))
+	    (if (and (re-search-backward sgml-start-tag-regex (point-min) t)
+		     (eq (match-end 0) (1- oldpos)))
+		()
+	      (goto-char (1- oldpos))
+	      (while (and (not blinkpos)
+			  (search-backward "/" (point-min) t))
+		(let ((tagend (save-excursion
+				(if (re-search-backward sgml-start-tag-regex
+							(point-min) t)
+				    (match-end 0)
+				  nil))))
+		  (if (eq tagend (point))
+		      (if (eq level 0)
+			  (setq blinkpos (point))
+			(setq level (1- level)))
+		    (setq level (1+ level)))))))
+	  (if blinkpos
+	      (progn
+		(goto-char blinkpos)
+		(if (pos-visible-in-window-p)
+		    (sit-for 1)
+		  (message "Matches %s"
+			   (buffer-substring (progn
+					       (beginning-of-line)
+					       (point))
+					     (1+ blinkpos))))))))))
+
+
+(defun sgml-name-char (&optional char)
+  "Insert a symbolic character name according to `sgml-char-names'.
+8 bit chars may be inserted with the meta key as in M-SPC for no break space,
+or M-- for a soft hyphen."
+  (interactive "*")
+  (insert ?&)
+  (or char
+      (setq char (read-quoted-char)))
+  (delete-backward-char 1)
+  (insert char)
+  (undo-boundary)
+  (delete-backward-char 1)
+  (insert ?&
+	  (or (aref sgml-char-names char)
+	      (format "#%d" char))
+	  ?\;))
+
+
+(defun sgml-name-self ()
+  "Insert a symbolic character name according to `sgml-char-names'."
+  (interactive "*")
+  (sgml-name-char last-command-char))
+
+
+(defun sgml-maybe-name-self ()
+  "Insert a symbolic character name according to `sgml-char-names'."
+  (interactive "*")
+  (if sgml-name-8bit-mode
+      (sgml-name-char last-command-char)
+    (self-insert-command 1)))
+
+
+(defun sgml-name-8bit-mode ()
+  "Toggle insertion of 8 bit characters."
+  (interactive)
+  (setq sgml-name-8bit-mode (not sgml-name-8bit-mode)))
+
+
+
+(define-skeleton sgml-tag
+  "Insert a tag you are prompted for, optionally with attributes.
+Completion and configuration is according to `sgml-tag-alist'.
+If you like tags and attributes in uppercase set `skeleton-transformation'
+to `upcase'."
+  (funcall skeleton-transformation
+	   (completing-read "Tag: " sgml-tag-alist))
+  ?< (setq v1 (eval str)) |
+  (("") -1 '(undo-boundary) "&lt;") |
+  (("") '(setq v2 (sgml-attributes v1 t)) ?>
+   (if (string= "![" v1)
+       (prog1 '(("") " [ " _ " ]]")
+	 (backward-char))
+     (if (or (eq v2 t)
+	     (string-match "^[/!?]" v1))
+	 ()
+       (if (symbolp v2)
+	   '(("") v2 _ v2 "</" v1 ?>)
+	 (if (eq (car v2) t)
+	     (cons '("") (cdr v2))
+	   (append '(("") (car v2))
+		   (cdr v2)
+		   '(resume: (car v2) _ "</" v1 ?>))))))))
+
+(autoload 'skeleton-read "skeleton")
+
+(defun sgml-attributes (alist &optional quiet)
+  "When at toplevel of a tag, interactively insert attributes."
+  (interactive (list (save-excursion (sgml-beginning-of-tag t))))
+  (or (stringp alist) (error "Wrong context for adding attribute"))
+  (if alist
+      (let ((completion-ignore-case t)
+	    car attribute i)
+	(setq alist (cdr (assoc (downcase alist) sgml-tag-alist)))
+	(if (or (symbolp (car alist))
+		(symbolp (car (car alist))))
+	    (setq car (car alist)
+		  alist (cdr alist)))
+	(or quiet
+	    (message "No attributes configured."))
+	(if (stringp (car alist))
+	    (progn
+	      (insert (if (eq (preceding-char) ? ) "" ? ) (car alist))
+	      (sgml-value alist))
+	  (setq i (length alist))
+	  (while (> i 0)
+	    (insert ? )
+	    (insert (funcall skeleton-transformation
+			     (setq attribute
+				   (skeleton-read '(completing-read
+						    "[Attribute]: "
+						    alist)))))
+	    (if (string= "" attribute)
+		(setq i 0)
+	      (sgml-value (assoc attribute alist))
+	      (setq i (1- i))))
+	  (if (eq (preceding-char) ? )
+	      (delete-backward-char 1)))
+	car)))
+
+(defun sgml-auto-attributes (arg)
+  "Self insert, except, when at top level of tag, prompt for attributes.
+With prefix ARG only self insert."
+  (interactive "*P")
+  (let ((point (point))
+	tag)
+    (if (or arg
+	    (not sgml-tag-alist)	; no message when nothing configured
+	    (symbolp (setq tag (save-excursion (sgml-beginning-of-tag t))))
+	    (eq (aref tag 0) ?/))
+	(self-insert-command (prefix-numeric-value arg))
+      (sgml-attributes tag)
+      (setq last-command-char ? )
+      (or (> (point) point)
+	  (self-insert-command 1)))))
+
+
+(defun sgml-tag-help (&optional tag)
+  "Display description of optional TAG or tag at point."
+  (interactive)
+  (or tag
+      (save-excursion
+	(if (eq (following-char) ?<)
+	    (forward-char))
+	(setq tag (sgml-beginning-of-tag))))
+  (or (stringp tag)
+      (error "No tag selected"))
+  (setq tag (downcase tag))
+  (message "%s"
+	   (or (cdr (assoc tag sgml-tag-help))
+	       (and (eq (aref tag 0) ?/)
+		    (cdr (assoc (substring tag 1) sgml-tag-help)))
+	       "No description available")))
+
+
+(defun sgml-maybe-end-tag ()
+  "Name self unless in position to end a tag."
+  (interactive)
+  (or (condition-case nil
+	  (save-excursion (up-list -1))
+	(error
+	 (sgml-name-self)
+	 t))
+      (condition-case nil
+	  (progn
+	    (save-excursion (up-list 1))
+	    (sgml-name-self))
+	(error (self-insert-command 1)))))
+
+
+(defun sgml-skip-tag-backward (arg)
+  "Skip to beginning of tag or matching opening tag if present.
+With prefix ARG, repeat that many times."
+  (interactive "p")
+  (while (>= arg 1)
+    (search-backward "<" nil t)
+    (if (looking-at "</\\([^ \n\t>]+\\)")
+	;; end tag, skip any nested pairs
+	(let ((case-fold-search t)
+	      (re (concat "</?" (regexp-quote (match-string 1)))))
+	  (while (and (re-search-backward re nil t)
+		      (eq (char-after (1+ (point))) ?/))
+	    (forward-char 1)
+	    (sgml-skip-tag-backward 1))))
+    (setq arg (1- arg))))
+
+(defun sgml-skip-tag-forward (arg &optional return)
+  "Skip to end of tag or matching closing tag if present.
+With prefix ARG, repeat that many times.
+Return t iff after a closing tag."
+  (interactive "p")
+  (setq return t)
+  (while (>= arg 1)
+    (skip-chars-forward "^<>")
+    (if (eq (following-char) ?>)
+	(up-list -1))
+    (if (looking-at "<\\([^/ \n\t>]+\\)")
+	;; start tag, skip any nested same pairs _and_ closing tag
+	(let ((case-fold-search t)
+	      (re (concat "</?" (regexp-quote (match-string 1))))
+	      point close)
+	  (forward-list 1)
+	  (setq point (point))
+	  (while (and (re-search-forward re nil t)
+		      (not (setq close
+				 (eq (char-after (1+ (match-beginning 0))) ?/)))
+		      (not (up-list -1))
+		      (sgml-skip-tag-forward 1))
+	    (setq close nil))
+	  (if close
+	      (up-list 1)
+	    (goto-char point)
+	    (setq return)))
+      (forward-list 1))
+    (setq arg (1- arg)))
+  return)
+
+(defun sgml-delete-tag (arg)
+  "Delete tag on or after cursor, and matching closing or opening tag.
+With prefix ARG, repeat that many times."
+  (interactive "p")
+  (while (>= arg 1)
+    (save-excursion
+      (let* (close open)
+	(if (looking-at "[ \t\n]*<")
+	    ;; just before tag
+	    (if (eq (char-after (match-end 0)) ?/)
+		;; closing tag
+		(progn
+		  (setq close (point))
+		  (goto-char (match-end 0))))
+	  ;; on tag?
+	  (or (save-excursion (setq close (sgml-beginning-of-tag)
+				    close (and (stringp close)
+					       (eq (aref close 0) ?/)
+					       (point))))
+	      ;; not on closing tag
+	      (let ((point (point)))
+		(sgml-skip-tag-backward 1)
+		(if (or (not (eq (following-char) ?<))
+			(save-excursion
+			  (forward-list 1)
+			  (<= (point) point)))
+		    (error "Not on or before tag")))))
+	(if close
+	    (progn
+	      (sgml-skip-tag-backward 1)
+	      (setq open (point))
+	      (goto-char close)
+	      (kill-sexp 1))
+	  (setq open (point))
+	  (sgml-skip-tag-forward 1)
+	  (backward-list)
+	  (forward-char)
+	  (if (eq (aref (sgml-beginning-of-tag) 0) ?/)
+	      (kill-sexp 1)))
+	(goto-char open)
+	(kill-sexp 1)))
+    (setq arg (1- arg))))
+
+
+
+(defun sgml-tags-invisible (arg)
+  "Toggle visibility of existing tags."
+  (interactive "P")
+  (let ((modified (buffer-modified-p))
+	(inhibit-read-only t)
+	(point (point-min))
+	symbol)
+    (save-excursion
+      (goto-char point)
+      (if (setq sgml-tags-invisible
+		(if arg
+		    (>= (prefix-numeric-value arg) 0)
+		  (not sgml-tags-invisible)))
+	  (while (re-search-forward "<\\([!/?A-Za-z][-A-Za-z0-9]*\\)"
+				    nil t)
+	    (setq symbol (intern-soft (downcase (match-string 1))))
+	    (goto-char (match-beginning 0))
+	    (and (get symbol 'before-string)
+		 (not (overlays-at (point)))
+		 (overlay-put (make-overlay (point)
+					    (match-beginning 1))
+			      'category symbol))
+	    (put-text-property (setq point (point)) (forward-list)
+			       'intangible (point))			
+	    (put-text-property point (point)
+			       'category 'sgml-tag))
+	(while (< (setq point (next-overlay-change point)) (point-max))
+	  (delete-overlay (car (overlays-at point))))
+	(remove-text-properties (point-min) (point-max)
+				'(category sgml-tag intangible t))))
+    (set-buffer-modified-p modified)
+    (run-hooks 'sgml-tags-invisible-hook)
+    (message "")))
+
+(defun sgml-point-entered (x y)
+  ;; Show preceding or following hidden tag, depending of cursor direction.
+  (let ((inhibit-point-motion-hooks t))
+    (save-excursion
+      (message "Invisible tag: %s"
+	       (buffer-substring
+		(point)
+		(if (or (and (> x y)
+			     (not (eq (following-char) ?<)))
+			(and (< x y)
+			     (eq (preceding-char) ?>)))
+		    (backward-list)
+		  (forward-list)))))))
+
+
+(autoload 'compile-internal "compile")
+
+(defun sgml-validate (command)
+  "Validate an SGML document.
+Runs COMMAND, a shell command, in a separate process asynchronously
+with output going to the buffer *compilation*.
+You can then use the command \\[next-error] to find the next error message
+and move to the line in the SGML document that caused it."
+  (interactive
+   (list (read-string "Validate command: "
+		      (or sgml-saved-validate-command
+			  (concat sgml-validate-command
+				  " "
+				  (let ((name (buffer-file-name)))
+				    (and name
+					 (file-name-nondirectory name))))))))
+  (setq sgml-saved-validate-command command)
+  (if (or (not compilation-ask-about-save)
+	  (y-or-n-p (message "Save buffer %s? " (buffer-name))))
+      (save-buffer))
+  (compile-internal command "No more errors"))
+
+
+(defun sgml-beginning-of-tag (&optional top-level)
+  "Skip to beginning of tag and return its name.
+Else `t'."
+  (or (if top-level
+	  (condition-case nil
+	      (up-list -1)
+	    (error t))
+	(>= (point)
+	    (if (search-backward "<" nil t)
+		(save-excursion
+		  (forward-list)
+		  (point))
+	      0)))
+      (if (looking-at "<[!?/]?[[A-Za-z][A-Za-z0-9]*")
+	  (buffer-substring-no-properties
+	   (1+ (point))
+	   (match-end 0))
+	t)))
+
+(defun sgml-value (alist)
+  (setq alist (cdr alist))
+  (if (stringp (car alist))
+      (insert "=\"" (car alist) ?\")
+    (if (eq (car alist) t)
+	(if (cdr alist)
+	    (progn
+	      (insert "=\"")
+	      (setq alist (skeleton-read '(completing-read
+					   "[Value]: " (cdr alist))))
+	      (if (string< "" alist)
+		  (insert (funcall skeleton-transformation alist) ?\")
+		(delete-backward-char 2))))
+      (insert "=\"")
+      (if alist
+	  (insert (funcall skeleton-transformation
+			   (skeleton-read '(completing-read "Value: " alist)))))
+      (insert ?\"))))
+
+(provide 'sgml-mode)
+
+(defvar html-quick-keys sgml-quick-keys
+  "Use C-c X combinations for quick insertion of frequent tags when non-nil.
+This defaults to `sgml-quick-keys'.
+This takes effect when first loading the library.")
+
+(defvar html-mode-map
+  (let (; (map (nconc (make-sparse-keymap) sgml-mode-map))
+	(map (copy-keymap sgml-mode-map))
+	(menu-map (make-sparse-keymap "HTML")))
+    (define-key map "\C-c6" 'html-headline-6)
+    (define-key map "\C-c5" 'html-headline-5)
+    (define-key map "\C-c4" 'html-headline-4)
+    (define-key map "\C-c3" 'html-headline-3)
+    (define-key map "\C-c2" 'html-headline-2)
+    (define-key map "\C-c1" 'html-headline-1)
+    (define-key map "\C-c\r" 'html-paragraph)
+    (define-key map "\C-c\n" 'html-line)
+    (define-key map "\C-c\C-c-" 'html-horizontal-rule)
+    (define-key map "\C-c\C-co" 'html-ordered-list)
+    (define-key map "\C-c\C-cu" 'html-unordered-list)
+    (define-key map "\C-c\C-cr" 'html-radio-buttons)
+    (define-key map "\C-c\C-cc" 'html-checkboxes)
+    (define-key map "\C-c\C-cl" 'html-list-item)
+    (define-key map "\C-c\C-ch" 'html-href-anchor)
+    (define-key map "\C-c\C-cn" 'html-name-anchor)
+    (define-key map "\C-c\C-ci" 'html-image)
+    (if html-quick-keys
+	(progn
+	  (define-key map "\C-c-" 'html-horizontal-rule)
+	  (define-key map "\C-co" 'html-ordered-list)
+	  (define-key map "\C-cu" 'html-unordered-list)
+	  (define-key map "\C-cr" 'html-radio-buttons)
+	  (define-key map "\C-cc" 'html-checkboxes)
+	  (define-key map "\C-cl" 'html-list-item)
+	  (define-key map "\C-ch" 'html-href-anchor)
+	  (define-key map "\C-cn" 'html-name-anchor)
+	  (define-key map "\C-ci" 'html-image)))
+    (define-key map "\C-c\C-s" 'html-autoview-mode)
+    (define-key map "\C-c\C-v" 'browse-url-of-buffer)
+    (define-key map [menu-bar html] (cons "HTML" menu-map))
+    (define-key menu-map [html-autoview-mode]
+      '("Toggle Autoviewing" . html-autoview-mode))
+    (define-key menu-map [browse-url-of-buffer]
+      '("View Buffer Contents" . browse-url-of-buffer))
+    (define-key menu-map [nil] '("--"))
+    ;;(define-key menu-map "6" '("Heading 6" . html-headline-6))
+    ;;(define-key menu-map "5" '("Heading 5" . html-headline-5))
+    ;;(define-key menu-map "4" '("Heading 4" . html-headline-4))
+    (define-key menu-map "3" '("Heading 3" . html-headline-3))
+    (define-key menu-map "2" '("Heading 2" . html-headline-2))
+    (define-key menu-map "1" '("Heading 1" . html-headline-1))
+    (define-key menu-map "l" '("Radio Buttons" . html-radio-buttons))
+    (define-key menu-map "c" '("Checkboxes" . html-checkboxes))
+    (define-key menu-map "l" '("List Item" . html-list-item))
+    (define-key menu-map "u" '("Unordered List" . html-unordered-list))
+    (define-key menu-map "o" '("Ordered List" . html-ordered-list))
+    (define-key menu-map "-" '("Horizontal Rule" . html-horizontal-rule))
+    (define-key menu-map "\n" '("Line Break" . html-line))
+    (define-key menu-map "\r" '("Paragraph" . html-paragraph))
+    (define-key menu-map "i" '("Image" . html-image))
+    (define-key menu-map "h" '("Href Anchor" . html-href-anchor))
+    (define-key menu-map "n" '("Name Anchor" . html-name-anchor))
+    map)
+  "Keymap for commands for use in HTML mode.")
+
+
+(defvar html-face-tag-alist
+  '((bold . "b")
+    (italic . "i")
+    (underline . "u")
+    (modeline . "rev"))
+  "Value of `sgml-face-tag-alist' for HTML mode.")
+
+(defvar html-tag-face-alist
+  '(("b" . bold)
+    ("big" . bold)
+    ("blink" . highlight)
+    ("cite" . italic)
+    ("em" . italic)
+    ("h1" bold underline)
+    ("h2" bold-italic underline)
+    ("h3" italic underline)
+    ("h4" . underline)
+    ("h5" . underline)
+    ("h6" . underline)
+    ("i" . italic)
+    ("rev"  . modeline)
+    ("s" . underline)
+    ("small" . default)
+    ("strong" . bold)
+    ("title" bold underline)
+    ("tt" . default)
+    ("u" . underline)
+    ("var" . italic))
+  "Value of `sgml-tag-face-alist' for HTML mode.")
+
+
+(defvar html-display-text
+  '((img . "[/]")
+    (hr . "----------")
+    (li . "o "))
+  "Value of `sgml-display-text' for HTML mode.")
+
+
+; should code exactly HTML 3 here when that is finished
+(defvar html-tag-alist
+  (let* ((1-9 '(("8") ("9")
+		("1") ("2") ("3") ("4") ("5") ("6") ("7")))
+	 (align '(("align" ("left") ("center") ("right"))))
+	 (valign '(("top") ("middle") ("bottom") ("baseline")))
+	 (rel '(("next") ("previous") ("parent") ("subdocument") ("made")))
+	 (href '("href" ("ftp:") ("file:") ("finger:") ("gopher:") ("http:")
+		 ("mailto:") ("news:") ("rlogin:") ("telnet:") ("tn3270:")
+		 ("wais:") ("/cgi-bin/")))
+	 (name '("name"))
+	 (link `(,href
+		 ("rel" ,@rel)
+		 ("rev" ,@rel)
+		 ("title")))
+	 (list '((nil \n
+		      ( "List item: "
+			"<li>" str \n))
+		 ("type" ("A") ("a") ("I") ("i") ("1"))))
+	 (cell `(t
+		 ,align
+		 ("valign" ,@valign)
+		 ("colspan" ,@1-9)
+		 ("rowspan" ,@1-9)
+		 ("nowrap" t))))
+    ;; put ,-expressions first, else byte-compile chokes (as of V19.29)
+    ;; and like this it's more efficient anyway
+    `(("a" ,name ,@link)
+      ("base" t ,@href)
+      ("dir" ,@list)
+      ("font" ("size" ("-1") ("+1") ("-2") ("+2") ,@(cdr (cdr 1-9))))
+      ("form" (\n _ \n "<input type=\"submit\" value=\"\">")
+       ("action" ,@(cdr href)) ("method" ("get") ("post")))
+      ("h1" ,@align)
+      ("h2" ,@align)
+      ("h3" ,@align)
+      ("h4" ,@align)
+      ("h5" ,@align)
+      ("h6" ,@align)
+      ("hr" t ("size" ,@1-9) ("width") ("noshade" t) ,@align)
+      ("img" t ("align" ,@valign ("texttop") ("absmiddle") ("absbottom"))
+       ("src") ("alt") ("width" "1") ("height" "1")
+       ("border" "1") ("vspace" "1") ("hspace" "1") ("ismap" t))
+      ("input" t ("size" ,@1-9) ("maxlength" ,@1-9) ("checked" t) ,name
+       ("type" ("text") ("password") ("checkbox") ("radio")
+	("submit") ("reset"))
+       ("value"))
+      ("link" t ,@link)
+      ("menu" ,@list)
+      ("ol" ,@list)
+      ("p" t ,@align)
+      ("select" (nil \n
+		     ("Text: "
+		      "<option>" str \n))
+       ,name ("size" ,@1-9) ("multiple" t))
+      ("table" (nil \n
+		    ((completing-read "Cell kind: " '(("td") ("th"))
+				      nil t "t")
+		     "<tr><" str ?> _ \n))
+       ("border" t ,@1-9) ("width" "10") ("cellpadding"))
+      ("td" ,@cell)
+      ("textarea" ,name ("rows" ,@1-9) ("cols" ,@1-9))
+      ("th" ,@cell)
+      ("ul" ,@list)
+
+      ,@sgml-tag-alist
+
+      ("abbrev")
+      ("acronym")
+      ("address")
+      ("array" (nil \n
+		    ("Item: " "<item>" str \n))
+       "align")
+      ("au")
+      ("b")
+      ("big")
+      ("blink")
+      ("blockquote" \n)
+      ("body" \n ("background" ".gif") ("bgcolor" "#") ("text" "#")
+       ("link" "#") ("alink" "#") ("vlink" "#"))
+      ("box" (nil _ "<over>" _))
+      ("br" t ("clear" ("left") ("right")))
+      ("caption" ("valign" ("top") ("bottom")))
+      ("center" \n)
+      ("cite")
+      ("code" \n)
+      ("dd" t)
+      ("del")
+      ("dfn")
+      ("dl" (nil \n
+		 ( "Term: "
+		   "<dt>" str "<dd>" _ \n)))
+      ("dt" (t _ "<dd>"))
+      ("em")
+      ("fn" "id" "fn")
+      ("head" \n)
+      ("html" (\n
+	       "<head>\n"
+	       "<title>" (setq str (read-input "Title: ")) "</title>\n"
+	       "<body>\n<h1>" str "</h1>\n" _
+	       "\n<address>\n<a href=\"mailto:"
+	       user-mail-address
+	       "\">" (user-full-name) "</a>\n</address>"))
+      ("i")
+      ("ins")
+      ("isindex" t ("action") ("prompt"))
+      ("kbd")
+      ("lang")
+      ("li" t)
+      ("math" \n)
+      ("nobr")
+      ("option" t ("value") ("label") ("selected" t))
+      ("over" t)
+      ("person")
+      ("pre" \n)
+      ("q")
+      ("rev")
+      ("s")
+      ("samp")
+      ("small")
+      ("strong")
+      ("sub")
+      ("sup")
+      ("title")
+      ("tr" t)
+      ("tt")
+      ("u")
+      ("var")
+      ("wbr" t)))
+  "*Value of `sgml-tag-alist' for HTML mode.")
+
+(defvar html-tag-help
+  `(,@sgml-tag-help
+    ("a" . "Anchor of point or link elsewhere")
+    ("abbrev" . "?")
+    ("acronym" . "?")
+    ("address" . "Formatted mail address")
+    ("array" . "Math array")
+    ("au" . "?")
+    ("b" . "Bold face")
+    ("base" . "Base address for URLs")
+    ("big" . "Font size")
+    ("blink" . "Blinking text")
+    ("blockquote" . "Indented quotation")
+    ("body" . "Document body")
+    ("box" . "Math fraction")
+    ("br" . "Line break")
+    ("caption" . "Table caption")
+    ("center" . "Centered text")
+    ("changed" . "Change bars")
+    ("cite" . "Citation of a document")
+    ("code" . "Formatted source code")
+    ("dd" . "Definition of term")
+    ("del" . "?")
+    ("dfn" . "?")
+    ("dir" . "Directory list (obsolete)")
+    ("dl" . "Definition list")
+    ("dt" . "Term to be definined")
+    ("em" . "Emphasised") 
+    ("embed" . "Embedded data in foreign format")
+    ("fig" . "Figure")
+    ("figa" . "Figure anchor")
+    ("figd" . "Figure description")
+    ("figt" . "Figure text")
+    ("fn" . "?")
+    ("font" . "Font size")
+    ("form" . "Form with input fields")
+    ("group" . "Document grouping")
+    ("h1" . "Most important section headline")
+    ("h2" . "Important section headline")
+    ("h3" . "Section headline")
+    ("h4" . "Minor section headline")
+    ("h5" . "Unimportant section headline")
+    ("h6" . "Least important section headline")
+    ("head" . "Document header")
+    ("hr" . "Horizontal rule")
+    ("html" . "HTML Document")
+    ("i" . "Italic face")
+    ("img" . "Graphic image")
+    ("input" . "Form input field")
+    ("ins" . "?")
+    ("isindex" . "Input field for index search")
+    ("kbd" . "Keybard example face")
+    ("lang" . "Natural language")
+    ("li" . "List item")
+    ("link" . "Link relationship")
+    ("math" . "Math formula")
+    ("menu" . "Menu list (obsolete)")
+    ("mh" . "Form mail header")
+    ("nextid" . "Allocate new id")
+    ("nobr" . "Text without line break")
+    ("ol" . "Ordered list")
+    ("option" . "Selection list item")
+    ("over" . "Math fraction rule")
+    ("p" . "Paragraph start")
+    ("panel" . "Floating panel")
+    ("person" . "?")
+    ("pre" . "Preformatted fixed width text")
+    ("q" . "?")
+    ("rev" . "Reverse video")
+    ("s" . "?")
+    ("samp" . "Sample text")
+    ("select" . "Selection list")
+    ("small" . "Font size")
+    ("sp" . "Nobreak space")
+    ("strong" . "Standout text")
+    ("sub" . "Subscript")
+    ("sup" . "Superscript")
+    ("table" . "Table with rows and columns")
+    ("tb" . "Table vertical break")
+    ("td" . "Table data cell")
+    ("textarea" . "Form multiline edit area")
+    ("th" . "Table header cell")
+    ("title" . "Document title")
+    ("tr" . "Table row separator")
+    ("tt" . "Typewriter face")
+    ("u" . "Underlined text")
+    ("ul" . "Unordered list")
+    ("var" . "Math variable face")
+    ("wbr" . "Enable <br> within <nobr>"))
+"*Value of `sgml-tag-help' for HTML mode.")
+
+
+;; Conflicts with psgml, don't autoload
+;; ;;;###autoload
+(defun html-mode ()
+  "Major mode based on SGML mode for editing HTML documents.
+This allows inserting skeleton costructs used in hypertext documents with
+completion.  See below for an introduction to HTML.  Use
+\\[browse-url-of-buffer] to see how this comes out.  See also `sgml-mode' on
+which this is based.
+
+Do \\[describe-variable] html- SPC and \\[describe-variable] sgml- SPC to see available variables.
+
+To write fairly well formatted pages you only need to know few things.  Most
+browsers have a function to read the source code of the page being seen, so
+you can imitate various tricks.  Here's a very short HTML primer which you
+can also view with a browser to see what happens:
+
+<title>A Title Describing Contents</title> should be on every page.  Pages can
+have <h1>Very Major Headlines</h1> through <h6>Very Minor Headlines</h6>
+<hr> Parts can be separated with horizontal rules.
+
+<p>Paragraphs only need an opening tag.  Line breaks and multiple spaces are
+ignored unless the text is <pre>preformatted.</pre>  Text can be marked as
+<b>bold</b>, <i>italic</i> or <u>underlined</u> using the normal  M-g  or
+Edit/Text Properties/Face commands.
+
+Pages can have <a name=\"SOMENAME\">named points</a> and can link other points
+to them with <a href=\"#SOMENAME\">see also somename</a>.  In the same way <a
+href=\"URL\">see also URL</a> where URL is a filename relative to current
+directory or something like http://www.cs.indiana.edu/elisp/w3/docs.html.
+
+Images in many formats can be inlined with <img src=\"URL\">.
+
+If you mainly create your own documents, `sgml-specials' might be interesting.
+But note that some HTML 2 browsers can't handle &apos;.  To work around that
+do:
+
+\(eval-after-load \"sgml-mode\" '(aset sgml-char-names ?' nil))
+\\{html-mode-map}"
+  (interactive)
+  (sgml-mode-common html-tag-face-alist html-display-text)
+  (use-local-map html-mode-map)
+  (make-local-variable 'sgml-tag-alist)
+  (make-local-variable 'sgml-face-tag-alist)
+  (make-local-variable 'sgml-tag-help)
+  (make-local-variable 'outline-regexp)
+  (make-local-variable 'outline-heading-end-regexp)
+  (make-local-variable 'outline-level)
+  (make-local-variable 'sentence-end)
+  (setq sentence-end
+	"[.?!][]\"')}]*\\(<[^>]*>\\)*\\($\\| $\\|\t\\|  \\)[ \t\n]*")
+  (setq mode-name "HTML"
+        major-mode 'html-mode
+	sgml-tag-alist html-tag-alist
+	sgml-face-tag-alist html-face-tag-alist
+	sgml-tag-help html-tag-help
+	outline-regexp "^.*<[Hh][1-6]\\>"
+	outline-heading-end-regexp "</[Hh][1-6]>"
+	outline-level (lambda ()
+			(char-after (1- (match-end 0)))))
+  (run-hooks 'html-mode-hook))
+
+
+(define-skeleton html-href-anchor
+  "HTML anchor tag with href attribute."
+  nil
+  "<a href=\"http:" _ "\"></a>")
+
+(define-skeleton html-name-anchor
+  "HTML anchor tag with name attribute."
+  nil
+  "<a name=\"" _ "\"></a>")
+
+(define-skeleton html-headline-1
+  "HTML level 1 headline tags."
+  nil
+  "<h1>" _ "</h1>")
+
+(define-skeleton html-headline-2
+  "HTML level 2 headline tags."
+  nil
+  "<h2>" _ "</h2>")
+
+(define-skeleton html-headline-3
+  "HTML level 3 headline tags."
+  nil
+  "<h3>" _ "</h3>")
+
+(define-skeleton html-headline-4
+  "HTML level 4 headline tags."
+  nil
+  "<h4>" _ "</h4>")
+
+(define-skeleton html-headline-5
+  "HTML level 5 headline tags."
+  nil
+  "<h5>" _ "</h5>")
+
+(define-skeleton html-headline-6
+  "HTML level 6 headline tags."
+  nil
+  "<h6>" _ "</h6>")
+
+(define-skeleton html-horizontal-rule
+  "HTML horizontal rule tag."
+  nil
+  "<hr>" \n)
+
+(define-skeleton html-image
+  "HTML image tag."
+  nil
+  "<img src=\"http:" _ "\">")
+
+(define-skeleton html-line
+  "HTML line break tag."
+  nil
+  "<br>" \n)
+
+(define-skeleton html-ordered-list
+  "HTML ordered list tags."
+  nil
+  ?< "ol>" \n
+  "<li>" _ \n
+  "</ol>")
+
+(define-skeleton html-unordered-list
+  "HTML unordered list tags."
+  nil
+  ?< "ul>" \n
+  "<li>" _ \n
+  "</ul>")
+
+(define-skeleton html-list-item
+  "HTML list item tag."
+  nil
+  (if (bolp) nil '\n)
+  "<li>")
+
+(define-skeleton html-paragraph
+  "HTML paragraph tag."
+  nil
+  (if (bolp) nil ?\n)
+  \n "<p>")
+
+(define-skeleton html-checkboxes
+  "Group of connected checkbox inputs."
+  nil
+  '(setq v1 (eval str))			; allow passing name as argument
+  ("Value & Text: "
+   "<input type=\"checkbox\" name=\""
+   (or v1 (setq v1 (skeleton-read "Name: ")))
+   "\" value=\"" str ?\"
+   (if v2 "" " checked") ?> str
+   (or v2 (setq v2 (if (y-or-n-p "Newline? ") "<br>" ""))) \n))
+
+(define-skeleton html-radio-buttons
+  "Group of connected radio button inputs."
+  nil
+  '(setq v1 (eval str))			; allow passing name as argument
+  ("Value & Text: "
+   "<input type=\"radio\" name=\""
+   (or v1 (setq v1 (skeleton-read "Name: ")))
+   "\" value=\"" str ?\"
+   (if v2 "" " checked") ?> str
+   (or v2 (setq v2 (if (y-or-n-p "Newline? ") "<br>" ""))) \n))
+
+
+(defun html-autoview-mode (&optional arg)
+  "Toggle automatic viewing via `html-viewer' upon saving buffer.
+With positive prefix ARG always turns viewing on, with negative ARG always off.
+Can be used as a value for `html-mode-hook'."
+  (interactive "P")
+  (if (setq arg (if arg
+		    (< (prefix-numeric-value arg) 0)
+		  (and (boundp 'after-save-hook)
+		       (memq 'browse-url-of-buffer after-save-hook))))
+      (setq after-save-hook (delq 'browse-url-of-buffer after-save-hook))
+    (make-local-hook 'after-save-hook)
+    (add-hook 'after-save-hook 'browse-url-of-buffer nil t))
+  (message "Autoviewing turned %s."
+	   (if arg "off" "on")))
+
+;;; sgml-mode.el ends here
--- a/lisp/mu/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/mu/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/mule/auto-autoloads.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/mule/auto-autoloads.el	Mon Aug 13 09:45:46 2007 +0200
@@ -96,13 +96,18 @@
 
 ;;;***
 
-;;;### (autoloads (decompose-composite-char compose-chars decompose-region compose-region set-coding-system-alist lookup-nested-alist set-nested-alist truncate-string-to-width store-substring) "mule-util" "mule/mule-util.el")
-
-(defsubst string-to-sequence (string type) "Convert STRING to a sequence of TYPE which contains characters in STRING.\nTYPE should be `list' or `vector'.\nMultibyte characters are conserned." (map type (function identity) string))
+;;;### (autoloads (decompose-composite-char compose-chars decompose-region compose-region set-coding-system-alist lookup-nested-alist set-nested-alist nested-alist-p truncate-string-to-width store-substring string-to-vector string-to-list string-to-sequence) "mule-util" "mule/mule-util.el")
 
-(defsubst string-to-list (string) "Return a list of characters in STRING." (mapcar (function identity) string))
+(autoload 'string-to-sequence "mule-util" "\
+Convert STRING to a sequence of TYPE which contains characters in STRING.
+TYPE should be `list' or `vector'.
+Multibyte characters are concerned." nil nil)
 
-(defsubst string-to-vector (string) "Return a vector of characters in STRING." (string-to-sequence string 'vector))
+(autoload 'string-to-list "mule-util" "\
+Return a list of characters in STRING." nil nil)
+
+(autoload 'string-to-vector "mule-util" "\
+Return a vector of characters in STRING." nil nil)
 
 (autoload 'store-substring "mule-util" "\
 Embed OBJ (string or character) at index IDX of STRING." nil nil)
@@ -116,7 +121,16 @@
 
 (defalias 'truncate-string 'truncate-string-to-width)
 
-(defsubst nested-alist-p (obj) "Return t if OBJ is a nesetd alist.\n\nNested alist is a list of the form (ENTRY . BRANCHES), where ENTRY is\nany Lisp object, and BRANCHES is a list of cons cells of the form\n(KEY-ELEMENT . NESTED-ALIST).\n\nYou can use a nested alist to store any Lisp object (ENTRY) for a key\nsequence KEYSEQ, where KEYSEQ is a sequence of KEY-ELEMENT.  KEYSEQ\ncan be a string, a vector, or a list." (and obj (listp obj) (listp (cdr obj))))
+(autoload 'nested-alist-p "mule-util" "\
+Return t if OBJ is a nesetd alist.
+
+Nested alist is a list of the form (ENTRY . BRANCHES), where ENTRY is
+any Lisp object, and BRANCHES is a list of cons cells of the form
+\(KEY-ELEMENT . NESTED-ALIST).
+
+You can use a nested alist to store any Lisp object (ENTRY) for a key
+sequence KEYSEQ, where KEYSEQ is a sequence of KEY-ELEMENT.  KEYSEQ
+can be a string, a vector, or a list." nil nil)
 
 (autoload 'set-nested-alist "mule-util" "\
 Set ENTRY for KEYSEQ in a nested alist ALIST.
--- a/lisp/mule/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/mule/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/mule/mule-util.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/mule/mule-util.el	Mon Aug 13 09:45:46 2007 +0200
@@ -28,20 +28,23 @@
 ;;; String manipulations while paying attention to multibyte
 ;;; characters.
 
+;; [Was defsubst]
 ;;;###autoload
-(defsubst string-to-sequence (string type)
+(defun string-to-sequence (string type)
   "Convert STRING to a sequence of TYPE which contains characters in STRING.
 TYPE should be `list' or `vector'.
-Multibyte characters are conserned."
+Multibyte characters are concerned."
   (map type (function identity) string))
 
+;; [Was defsubst]
 ;;;###autoload
-(defsubst string-to-list (string)
+(defun string-to-list (string)
   "Return a list of characters in STRING."
   (mapcar (function identity) string))
 
+;; [Was defsubst]
 ;;;###autoload
-(defsubst string-to-vector (string)
+(defun string-to-vector (string)
   "Return a vector of characters in STRING."
   (string-to-sequence string 'vector))
 
@@ -111,8 +114,9 @@
 ;;; Nested alist handler.  Nested alist is alist whose elements are
 ;;; also nested alist.
 
+;; [Was defsubst]
 ;;;###autoload
-(defsubst nested-alist-p (obj)
+(defun nested-alist-p (obj)
   "Return t if OBJ is a nesetd alist.
 
 Nested alist is a list of the form (ENTRY . BRANCHES), where ENTRY is
--- a/lisp/oobr/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/oobr/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/packages/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/packages/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -4,6 +4,7 @@
 (put 'copyright 'custom-loads '("upd-copyr"))
 (put 'eldoc 'custom-loads '())
 (put 'recent-files-menu 'custom-loads '("recent-files"))
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '("avoid"))
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/packages/gnuserv.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/packages/gnuserv.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,7 +1,7 @@
 ;;; gnuserv.el --- Lisp interface code between Emacs and gnuserv
 ;; Copyright (C) 1989-1997 Free Software Foundation, Inc.
 
-;; Version: 3.4
+;; Version: 3.6
 ;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el
 ;;         Hrvoje Niksic <hniksic@srce.hr>
 ;; Maintainer: Jan Vroonhof <vroonhof@math.ethz.ch>,
@@ -80,7 +80,7 @@
 ;;; Code:
 
 (defconst gnuserv-rcs-version
-  "$Id: gnuserv.el,v 1.11 1997/06/26 02:31:17 steve Exp $")
+  "$Id: gnuserv.el,v 1.12 1997/06/29 23:13:06 steve Exp $")
 
 (defgroup gnuserv nil
   "The gnuserv suite of programs to talk to Emacs from outside."
@@ -89,6 +89,32 @@
   :group 'terminals)
 
 
+
+;; Provide the old variables as aliases, to avoid breaking .emacs
+;; files.  However, they are obsolete and should be converted to the
+;; new forms.  This ugly crock must be before the variable
+;; declaration, or the scheme fails.
+
+(define-obsolete-variable-alias 'server-frame 'gnuserv-frame)
+(define-obsolete-variable-alias 'server-done-function
+  'gnuserv-done-function)
+(define-obsolete-variable-alias 'server-done-temp-file-function
+  'gnuserv-done-temp-file-function)
+(define-obsolete-variable-alias 'server-find-file-function
+  'gnuserv-find-file-function)
+(define-obsolete-variable-alias 'server-program
+  'gnuserv-program)
+(define-obsolete-variable-alias 'server-visit-hook
+  'gnuserv-visit-hook)
+(define-obsolete-variable-alias 'server-done-hook
+  'gnuserv-done-hook)
+(define-obsolete-variable-alias 'server-kill-quietly
+  'gnuserv-kill-quietly)
+(define-obsolete-variable-alias 'server-temp-file-regexp
+  'gnuserv-temp-file-regexp)
+(define-obsolete-variable-alias 'server-make-temp-file-backup
+  'gnuserv-make-temp-file-backup)
+
 ;;;###autoload
 (defcustom gnuserv-frame nil
   "*The frame to be used to display all edited files.
@@ -184,29 +210,6 @@
   :group 'gnuserv)
 
 
-;; The old functions are provided as aliases, to avoid breaking .emacs
-;; files.  However, they are obsolete and should be avoided.
-
-(define-obsolete-variable-alias 'server-frame 'gnuserv-frame)
-(define-obsolete-variable-alias 'server-done-function 'gnuserv-done-function)
-(define-obsolete-variable-alias 'server-done-temp-file-function
-  'gnuserv-done-temp-file-function)
-(define-obsolete-variable-alias 'server-find-file-function
-  'gnuserv-find-file-function)
-(define-obsolete-variable-alias 'server-program
-  'gnuserv-program)
-(define-obsolete-variable-alias 'server-visit-hook
-  'gnuserv-visit-hook)
-(define-obsolete-variable-alias 'server-done-hook
-  'gnuserv-done-hook)
-(define-obsolete-variable-alias 'server-kill-quietly
-  'gnuserv-kill-quietly)
-(define-obsolete-variable-alias 'server-temp-file-regexp
-  'gnuserv-temp-file-regexp)
-(define-obsolete-variable-alias 'server-make-temp-file-backup
-  'gnuserv-make-temp-file-backup)
-
-
 ;;; Internal variables:
 
 (defstruct gnuclient
@@ -288,21 +291,17 @@
 ;; We used to restart the server here, but it's too risky -- if
 ;; something goes awry, it's too easy to wind up in a loop.
 (defun gnuserv-sentinel (proc msg)
+  (let ((msgstring (concat "Gnuserv process %s; restart with `%s'"))
+	(keystring (substitute-command-keys "\\[gnuserv-start]")))
   (case (process-status proc)
     (exit
-     (message
-      (substitute-command-keys
-       "Gnuserv subprocess exited; restart with `\\[gnuserv-start]'"))
+     (message msgstring "exited" keystring)
      (gnuserv-prepare-shutdown))
     (signal
-     (message
-      (substitute-command-keys
-       "Gnuserv subprocess killed; restart with `\\[gnuserv-start]'"))
+     (message msgstring "killed" keystring)
      (gnuserv-prepare-shutdown))
     (closed
-     (message
-      (substitute-command-keys
-       "Gnuserv subprocess closed; restart with `\\[gnuserv-start]'"))
+     (message msgstring "closed" keystring))
      (gnuserv-prepare-shutdown))))
 
 ;; This function reads client requests from our current server.  Every
@@ -466,10 +465,12 @@
 	;; `gnuserv-edit'.
 	(if (and (not (or quick view))
 		 (gnuclient-buffers client))
-	    (message (substitute-command-keys
+	    (message "%s"
+		     (substitute-command-keys
 		      "Type `\\[gnuserv-edit]' to finish editing"))
 	  (or dest-frame
-	      (message (substitute-command-keys
+	      (message "%s"
+		       (substitute-command-keys
 			"Type `\\[delete-frame]' to finish editing")))))))))
 
 
@@ -543,7 +544,7 @@
 	;; we must make sure that the server kill doesn't result in
 	;; killing the device, because it would cause a device-dead
 	;; error when `delete-device' tries to do the job later.
-	(gnuserv-kill-client (car client) t))))
+	(gnuserv-kill-client client t))))
   (callf2 delq device gnuserv-devices))
 
 (add-hook 'delete-device-hook 'gnuserv-check-device)
--- a/lisp/packages/hexl.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/packages/hexl.el	Mon Aug 13 09:45:46 2007 +0200
@@ -286,7 +286,8 @@
   (use-local-map hexl-mode-old-local-map)
   (set-syntax-table hexl-mode-old-syntax-table)
   (setq major-mode hexl-mode-old-major-mode)
-  (force-mode-line-update))
+  (force-mode-line-update)
+  (run-hooks 'hexl-mode-exit-hook))
 
 (defun hexl-maybe-dehexlify-buffer ()
   "Convert a hexl format buffer to binary.
--- a/lisp/packages/hyper-apropos.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/packages/hyper-apropos.el	Mon Aug 13 09:45:46 2007 +0200
@@ -118,8 +118,6 @@
      (:foreground "gray90")))
   "Hyper-apropos documentation."
   :group 'hyper-apropos-faces)
-(define-obsolete-variable-alias
-  'hypropos-documentation 'hyper-apropos-documentation)
 
 (defface hyper-apropos-hyperlink
   '((((class color) (background light))
@@ -130,32 +128,22 @@
      (:bold t)))
   "Hyper-apropos hyperlinks."
   :group 'hyper-apropos-faces)
-(define-obsolete-variable-alias
-  'hypropos-hyperlink 'hyper-apropos-hyperlink)
 
 (defface hyper-apropos-major-heading '((t (:bold t)))
   "Hyper-apropos major heading."
   :group 'hyper-apropos-faces)
-(define-obsolete-variable-alias
-  'hypropos-major-heading 'hyper-apropos-major-heading)
 
 (defface hyper-apropos-section-heading '((t (:bold t :italic t)))
   "Hyper-apropos section heading."
   :group 'hyper-apropos-faces)
-(define-obsolete-variable-alias
-  'hypropos-section-heading 'hyper-apropos-section-heading)
 
 (defface hyper-apropos-heading '((t (:bold t)))
   "Hyper-apropos heading."
   :group 'hyper-apropos-faces)
-(define-obsolete-variable-alias
-  'hypropos-heading 'hyper-apropos-heading)
 
 (defface hyper-apropos-warning '((t (:bold t :foreground "red")))
   "Hyper-apropos warning."
   :group 'hyper-apropos-faces)
-(define-obsolete-variable-alias
-  'hypropos-warning 'hyper-apropos-warning)
 
 ;;; Internal variables below this point
 
--- a/lisp/packages/lazy-lock.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/packages/lazy-lock.el	Mon Aug 13 09:45:46 2007 +0200
@@ -3,6 +3,8 @@
 ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
 
 ;; Author: Simon Marshall <simon@gnu.ai.mit.edu>
+;; X-Modified-By: Ben Wing <ben@666.com>
+;; Maintainer: XEmacs Development Team
 ;; Keywords: faces files
 ;; Version: 1.14
 
@@ -26,13 +28,17 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; 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. (This seems very strange to me.)
+;;; Synched up with: Divergent from Official Version.
 
 ;;; Commentary:
 
+;; This version of Lazy Lock has special modifications for XEmacs by Ben Wing
+;; that have never been merged into the official version.
+
 ;; Purpose:
 ;;
 ;; To make visiting buffers in `font-lock-mode' faster by making fontification
--- a/lisp/pcl-cvs/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/pcl-cvs/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/prim/about.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/about.el	Mon Aug 13 09:45:46 2007 +0200
@@ -185,7 +185,7 @@
     (widget-insert "\n")
     (let* ((emacs-short-version (concat emacs-major-version
 					"." emacs-minor-version))
-	   (emacs-about-version (format "version %s; May 1997"
+	   (emacs-about-version (format "version %s; Oct 1997"
 					emacs-short-version)))
       (widget-insert (about-center emacs-about-version))
       (widget-create 'link :help-echo "The latest NEWS of XEmacs"
--- a/lisp/prim/auto-autoloads.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/auto-autoloads.el	Mon Aug 13 09:45:46 2007 +0200
@@ -223,17 +223,24 @@
 
 ;;;***
 
-;;;### (autoloads (profile pretty-print-profiling-info) "profile" "prim/profile.el")
+;;;### (autoloads (profile-key-sequence profile pretty-print-profiling-info) "profile" "prim/profile.el")
 
 (autoload 'pretty-print-profiling-info "profile" "\
-Print profiling info INFO to standard output in a pretty format.
+Print profiling info INFO to STREAM in a pretty format.
 If INFO is omitted, the current profiling info is retrieved using
-`get-profiling-info'." nil nil)
+`get-profiling-info'.
+If STREAM is omitted, either current buffer or standard output are used,
+ depending on whether the function was called interactively or not." t nil)
 
 (autoload 'profile "profile" "\
 Turn on profiling, execute FORMS and stop profiling.
 Returns the profiling info, printable by `pretty-print-profiling-info'." nil 'macro)
 
+(autoload 'profile-key-sequence "profile" "\
+Dispatch the key sequence KEYS and profile the execution.
+KEYS can be a vector of keypress events, a keypress event, or a character.
+The function returns the profiling info." t nil)
+
 ;;;***
 
 ;;;### (autoloads (clear-rectangle string-rectangle open-rectangle insert-rectangle yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle delete-rectangle) "rect" "prim/rect.el")
--- a/lisp/prim/cus-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/cus-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -33,7 +33,7 @@
 (let ((dir load-path))
   (while dir
     (condition-case nil
-	(load (concat (car dir) "/cus-load"))
+	(load (concat (car dir) "/custom-load") nil t)
       (file-error nil))
     (pop dir)))
 
--- a/lisp/prim/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '("mouse"))
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/prim/files.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/files.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1223,6 +1223,10 @@
     ("/app-defaults/" . xrdb-mode)
     ("\\.[^/]*wm\\'" . winmgr-mode)
     ("\\.[^/]*wm2?rc" . winmgr-mode)
+    ("\\.[Jj][Pp][Ee]?[Gg]\\'" . image-mode)
+    ("\\.[Pp][Nn][Gg]\\'" . image-mode)
+    ("\\.[Gg][Ii][Ff]\\'" . image-mode)
+    ("\\.xpm\\'" . image-mode)
     )
 "Alist of filename patterns vs. corresponding major mode functions.
 Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).
--- a/lisp/prim/format.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/format.el	Mon Aug 13 09:45:46 2007 +0200
@@ -66,10 +66,21 @@
 
 (put 'buffer-file-format 'permanent-local t)
 
-(defvar format-alist 
-  '((text/enriched "Extended MIME text/enriched format."
+(defvar format-alist
+  '((image/jpeg "JPEG image" "\377\330\377\340\000\020JFIF"
+		image-decode-jpeg nil t image-mode)
+    (image/gif "GIF image" "GIF8[79]"
+	       image-decode-gif nil t image-mode)
+    (image/png "Portable Network Graphics" "\211PNG"
+	       image-decode-png nil t image-mode)
+    (image/x-xpm "XPM image" "/\\* XPM \\*/"
+		 image-decode-xpm nil t image-mode)
+    (text/enriched "Extended MIME text/enriched format."
 		   "Content-[Tt]ype:[ \t]*text/enriched"
 		   enriched-decode enriched-encode t enriched-mode)
+    (text/richtext "Extended MIME obsolete text/richtext format."
+		   "Content-[Tt]ype:[ \t]*text/richtext"
+		   richtext-decode richtext-encode t enriched-mode)
     (plain "Standard ASCII format, no text properties."
 	   ;; Plain only exists so that there is an obvious neutral choice in
 	   ;; the completion list.
--- a/lisp/prim/loaddefs.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/loaddefs.el	Mon Aug 13 09:45:46 2007 +0200
@@ -69,12 +69,14 @@
 ;;; already has an autoload section in this file.
 ;;; **********************************************************************
 
+
 ;;; Code:
 
 ;; These variables are used by autoloadable packages.
 ;; They are defined here so that they do not get overridden
 ;; by the loading of those packages.
 
+
 ;; Names in directory that end in one of these
 ;; are ignored in completion,
 ;; making it more likely you will get a unique match.
@@ -90,74 +92,70 @@
 		  ".lof" ".blg" ".bbl" ".glo" ".idx" ".lot" ".fmt"
 		  ".diff" ".oi"))))
 
+
 (setq debug-ignored-errors
       '(beginning-of-line
 	beginning-of-buffer
 	end-of-line
         end-of-buffer
 	end-of-file buffer-read-only
-	"^Previous command was not a yank\\'"
-	"^Minibuffer window is not active\\'"
-	"^End of history; no next item\\'"
-	"^Beginning of history; no preceding item\\'"
-	"^No recursive edit is in progress\\'"
-	"^Changes to be undone are outside visible portion of buffer\\'"
-	"^No undo information in this buffer\\'"
-	"^No further undo information\\'"
-	"^Save not confirmed\\'"
-	"^Recover-file cancelled\\.\\'"
+	"\\`Previous command was not a yank\\'"
+	"\\`Minibuffer is not active for completion\\'"
+	"\\`No \\(following\\|preceding\\) item in .*-history\\'"
+	"\\`No recursive edit is in progress\\'"
+	"\\`Changes to be undone are outside visible portion of buffer\\'"
+	"\\`No further undo information\\'"
+	"\\`No undo information in this buffer\\'"
+	"\\`Buffer modified since last undo/redo, cannot redo"
+	"\\`Save not confirmed\\'"
+	"\\`Canceled\\'"
+	"\\`\\(Revert\\|Steal\\|Recover-file\\) cancelled\\.\\'"
 
 	;; comint
-	"^Not at command line\\'"
-	"^Empty input ring\\'"
-	"^No history\\'"
-	"^Not found\\'";; To common?
-	"^Current buffer has no process\\'"
+	"\\`Not at command line\\'"
+	"\\`Empty input ring\\'"
+	"\\`No history\\'"
+	"\\`Not found\\'" ;; To common?
+	"\\`Current buffer has no process\\'"
 
 	;; dabbrev
-	"^No dynamic expansion for \".*\" found\\.\\'"
-	"^No further dynamic expansions for \".*\" found\\.\\'"
-	"^No further dynamic expansions for `.*' found\\'"
+	"\\`No \\(further \\)?dynamic expansion for .* found\\.?\\'"
 
 	;; Completion
-	"^To complete, the point must be after a symbol at least [0-9]* character long\\.\\'"
-	"^The string \".*\" is too short to be saved as a completion\\.\\'"
+	"\\`To complete, the point must be after a symbol at least [0-9]* character long\\.\\'"
+	"\\`The string \".*\" is too short to be saved as a completion\\.\\'"
 
 	;; Compile
-	"^No more errors\\( yet\\|\\)\\'"
+	"\\`No more errors\\( yet\\|\\)\\'"
 
 	;; Gnus
-	"^NNTP: Connection closed\\.\\'"
+	;"\\`NNTP: Connection closed\\.\\'"
 
 	;; info
-	"^Node has no Previous\\'"
-	"^No \".*\" in index\\'"
+	"\\`Node has no Previous\\'"
+	"\\`No \".*\" in index\\'"
 
 	;; imenu
-	"^No items suitable for an index found in this buffer\\.\\'"
-	"^The mode \".*\" does not take full advantage of imenu\\.el yet\\.\\'"
+	;"\\`No items suitable for an index found in this buffer\\.\\'"
+	;"\\`The mode \".*\" does not take full advantage of imenu\\.el yet\\.\\'"
 
 	;; ispell
-	"^No word found to check!\\'"
+	"\\`No word found to check!\\'"
 
 	;; man
+	"\\`.* not found\\'"
+	"\\`No more history\\.\\'"
 
 	;; etags
-	"^No tags table in use!  Use .* to select one\\.\\'"
-	"^There is no default tag\\'"
-	"^No previous tag locations\\'"
-	"^File .* is not a valid tags table\\'"
-	"^No \\(more \\|\\)tags \\(matching\\|containing\\) "
-	"^Rerun etags: `.*' not found in "
-	"^All files processed\\.\\'"
-	"^No .* or .* in progress.\\'"
-	"^File .* not in current tags tables\\'"
-	"No tags table loaded."
-	"^Nothing to complete\\'"
+	"\\`File .* is not a valid tag table\\'"
+	"\\`File .* is not a valid tags file\\'"
+	"\\`All files processed\\.\\'"
+	"No TAGS file name supplied\\'"
+	"\\`Nothing to complete\\'"
 
 	;; BBDB
-	"^no previous record\\'"
-	"^no next record\\'"))
+	"\\`no previous record\\'"
+	"\\`no next record\\'"))
 
 (make-variable-buffer-local 'indent-tabs-mode)
 
--- a/lisp/prim/loadup.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/loadup.el	Mon Aug 13 09:45:46 2007 +0200
@@ -66,12 +66,26 @@
      (setq load-warn-when-source-newer t ; set to nil at the end
 	   load-warn-when-source-only  t)
 
+     ;; Inserted for debugging.  Something is corrupting a single symbol
+     ;; somewhere to have an integer 0 property list.  -slb 6/28/1997.
+     (defun test-atoms ()
+       (mapatoms
+	#'(lambda (symbol)
+	    (condition-case nil
+		(get symbol 'custom-group)
+	      (t (princ
+		  (format "Bad plist in %s, %s\n"
+			  (symbol-name symbol)
+			  (prin1-to-string (object-plist symbol)))))))))
+
      ;; garbage collect after loading every file in an attempt to
      ;; minimize the size of the dumped image (if we don't do this,
      ;; there will be lots of extra space in the data segment filled
      ;; with garbage-collected junk)
      (defmacro load-gc (file)
-       (list 'prog1 (list 'load file) '(garbage-collect)))
+       (list 'prog1 (list 'load file)
+	     ;; '(test-atoms)
+	     '(garbage-collect)))
      ;; Need a minimal number hardcoded to get going for now.
      ;; (load-gc "backquote")		; needed for defsubst etc.
      ;; (load-gc "bytecomp-runtime")	; define defsubst
@@ -130,9 +144,13 @@
 ;; purify-flag is nil if called from loadup-el.el.
 (when purify-flag
   (message "Finding pointers to doc strings...")
+  ;; (test-atoms) ; Debug -- Doesn't happen here
   (Snarf-documentation "DOC")
+  ;; (test-atoms) ; Debug -- Doesn't happen here
   (message "Finding pointers to doc strings...done")
-  (Verify-documentation))
+  (Verify-documentation)
+  ;; (test-atoms) ; Debug -- Doesn't happen here
+  )
 
 ;; Note: You can cause additional libraries to be preloaded
 ;; by writing a site-init.el that loads them.
--- a/lisp/prim/make-docfile.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/make-docfile.el	Mon Aug 13 09:45:46 2007 +0200
@@ -38,6 +38,7 @@
 (defvar docfile nil)
 (defvar docfile-buffer nil)
 (defvar site-file-list nil)
+(defvar docfile-out-of-date nil)
 
 ;; Gobble up the stuff we don't wish to pass on.
 (setq command-line-args (cdr (cdr (cdr (cdr command-line-args)))))
@@ -66,7 +67,11 @@
 (while command-line-args
   (let ((arg (car command-line-args)))
     (if (null (member arg processed))
-	(setq processed (cons arg processed))))
+	(progn
+	  (if (and (null docfile-out-of-date)
+		   (file-newer-than-file-p arg docfile))
+	      (setq docfile-out-of-date t))
+	  (setq processed (cons arg processed)))))
   (setq command-line-args (cdr command-line-args)))
 
 ;; Then process the list of Lisp files.
@@ -101,7 +106,11 @@
    (let ((arg (packages-add-suffix (car dumped-lisp-packages))))
      (setq arg (locate-library arg))
      (if (null (member arg processed))
-	 (setq processed (cons arg processed)))
+	 (progn
+	   (if (and (null docfile-out-of-date)
+		    (file-newer-than-file-p arg docfile))
+	       (setq docfile-out-of-date t))
+	   (setq processed (cons arg processed))))
      (setq dumped-lisp-packages (cdr dumped-lisp-packages)))))
 
 ;; Finally process the list of site-loaded files.
@@ -111,7 +120,11 @@
       (while site-load-packages
 	(let ((arg (car site-load-packages)))
 	  (if (not (member arg processed))
-	      (setq processed (cons arg processed))))
+	      (progn
+		(if (and (null docfile-out-of-date)
+			 (file-newer-than-file-p arg docfile))
+		    (setq docfile-out-of-date t))
+		(setq processed (cons arg processed)))))
 	(setq site-load-packages (cdr site-load-packages)))))
 
 (let ((autoloads (list-autoloads)))
@@ -119,7 +132,11 @@
   (while autoloads
     (let ((arg (car autoloads)))
       (if (null (member arg processed))
-	  (setq processed (cons arg processed)))
+	  (progn
+	    (if (and (null docfile-out-of-date)
+		     (file-newer-than-file-p arg docfile))
+		(setq docfile-out-of-date t))
+	    (setq processed (cons arg processed))))
       (setq autoloads (cdr autoloads)))))
 
 ;; Now fire up make-docfile and we're done
@@ -128,22 +145,26 @@
 
 ;; (print (prin1-to-string (append options processed)))
 
-(princ "Spawning make-docfile ...")
-;; (print (prin1-to-string (append options processed)))
+(if docfile-out-of-date
+    (progn
+      (princ "Spawning make-docfile ...")
+      ;; (print (prin1-to-string (append options processed)))
 
-(setq exec-path (list (concat default-directory "../lib-src")))
+      (setq exec-path (list (concat default-directory "../lib-src")))
 
-;; (locate-file-clear-hashing nil)
-(apply 'call-process-internal
-       ;; (concat default-directory "../lib-src/make-docfile")
-       "make-docfile"
-       nil
-       t
-       nil
-       (append options processed))
+      ;; (locate-file-clear-hashing nil)
+      (apply 'call-process-internal
+	     ;; (concat default-directory "../lib-src/make-docfile")
+	     "make-docfile"
+	     nil
+	     t
+	     nil
+	     (append options processed))
 
-(princ "Spawning make-docfile ...done\n")
-;; (write-region-internal (point-min) (point-max) "/tmp/DOC")
+      (princ "Spawning make-docfile ...done\n")
+      ;; (write-region-internal (point-min) (point-max) "/tmp/DOC")
+      )
+  (princ "DOC file is up to date\n"))
 
 (kill-emacs)
 
--- a/lisp/prim/overlay.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/overlay.el	Mon Aug 13 09:45:46 2007 +0200
@@ -151,7 +151,8 @@
 and also contained within the specified region.
 Empty overlays are included in the result if they are located at BEG
 or between BEG and END."
-  (mapcar-extents #'identity nil nil beg end nil 'overlay))
+  (mapcar-extents #'identity nil nil beg end
+		  'all-extents-closed-open 'overlay))
 
 (defun next-overlay-change (pos)
   "Return the next position after POS where an overlay starts or ends.
@@ -166,7 +167,7 @@
 			   (> tmp pos)))
 	      (setq next tmp))
        nil)
-     nil pos nil nil nil 'overlay)
+     nil pos nil nil 'all-extents-closed-open 'overlay)
     next))
 
 (defun previous-overlay-change (pos)
@@ -182,7 +183,7 @@
 		      (< tmp pos)))
 	 (setq prev tmp))
        nil)
-     nil nil pos nil nil 'overlay)
+     nil nil pos nil 'all-extents-closed-open 'overlay)
     prev))
 
 (defun overlay-lists ()
@@ -201,7 +202,7 @@
 		       (push overlay before)
 		     (push overlay after))
 		   nil)
-		 nil nil nil nil nil 'overlay)
+		 nil nil nil nil 'all-extents-closed-open 'overlay)
     (cons (nreverse before) (nreverse after))))
 
 (defun overlay-recenter (pos)
--- a/lisp/prim/profile.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/profile.el	Mon Aug 13 09:45:46 2007 +0200
@@ -26,26 +26,37 @@
 
 ;;; Commentary:
 
+;; `profile' macro and `profile-key-sequence' added in June 1997 by
+;; hniksic.
+
+
 ;;; Code:
 
 ;;;###autoload
-(defun pretty-print-profiling-info (&optional info)
-  "Print profiling info INFO to standard output in a pretty format.
+(defun pretty-print-profiling-info (&optional info stream)
+  "Print profiling info INFO to STREAM in a pretty format.
 If INFO is omitted, the current profiling info is retrieved using
-`get-profiling-info'."
-  (if info (setq info (copy-alist info))
+`get-profiling-info'.
+If STREAM is omitted, either current buffer or standard output are used,
+ depending on whether the function was called interactively or not."
+  (interactive)
+  (if info
+      (setq info (copy-alist info))
     (setq info (get-profiling-info)))
-  (setq info (nreverse (sort info #'cdr-less-than-cdr)))
-  (princ "Function                                               Count        %\n")
-  (princ "---------------------------------------------------------------------\n")
-  (let ((sum 0.0))
-    (dolist (info2 info)
-      (incf sum (cdr info2)))
-    (while info
-      (let ((f (caar info)))
-	(princ (format "%-50s%10d   %6.3f\n" f (cdar info)
-		       (* 100 (/ (cdar info) sum)))))
-      (setq info (cdr info)))))
+  (let ((standard-output (or stream (if (interactive-p)
+					(current-buffer)
+				      standard-output))))
+    (setq info (nreverse (sort info #'cdr-less-than-cdr)))
+    (princ "Function                                               Count        %\n")
+    (princ "---------------------------------------------------------------------\n")
+    (let ((sum 0.0))
+      (dolist (info2 info)
+	(incf sum (cdr info2)))
+      (while info
+	(let ((f (caar info)))
+	  (princ (format "%-50s%10d   %6.3f\n" f (cdar info)
+			 (* 100 (/ (cdar info) sum)))))
+	(pop info)))))
 
 ;;;###autoload
 (defmacro profile (&rest forms)
@@ -61,4 +72,17 @@
 
 (put 'profile 'lisp-indent-function 0)
 
+;;;###autoload
+(defun profile-key-sequence (keys)
+  "Dispatch the key sequence KEYS and profile the execution.
+KEYS can be a vector of keypress events, a keypress event, or a character.
+The function returns the profiling info."
+  (interactive "kProfile keystroke: ")
+  (and (characterp keys)
+       (setq keys (character-to-event keys)))
+  (or (vectorp keys)
+      (setq keys (vector keys)))
+  (profile
+    (mapc 'dispatch-event keys)))
+
 ;;; profile.el ends here
--- a/lisp/prim/simple.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/prim/simple.el	Mon Aug 13 09:45:46 2007 +0200
@@ -3290,6 +3290,11 @@
 should be logged.  Possible values include 'log-message-filter and
 'log-message-filter-errors-only.")
 
+(defun show-message-log ()
+  "Show the \" *Message-Log*\" buffer, which contains old messages and errors."
+  (interactive)
+  (pop-to-buffer " *Message-Log*"))
+
 (defun log-message-filter (label message)
   "Default value of log-message-filter-function.
 Mesages whose text matches one of the log-message-ignore-regexps
--- a/lisp/psgml/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/psgml/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -3,6 +3,7 @@
 (put 'psgml-dtd 'custom-loads '("psgml"))
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/rmail/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/rmail/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/sunpro/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/sunpro/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/term/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/term/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/tl/auto-autoloads.el	Mon Aug 13 09:45:46 2007 +0200
@@ -0,0 +1,20 @@
+;;; DO NOT MODIFY THIS FILE
+(if (not (featurep 'tl-autoloads))
+    (progn
+
+(provide 'tl-autoloads)
+))
+
+;;;### (autoloads (view-charset) "char-table" "tl/char-table.el")
+
+(autoload 'view-charset "char-table" "\
+Display character table of CHARSET." t nil)
+
+;;;***
+
+;;;### (autoloads (view-charset-by-menu) "chartblxmas" "tl/chartblxmas.el")
+
+(autoload 'view-charset-by-menu "chartblxmas" "\
+Display character table of CHARSET by pop-up menu." t nil)
+
+;;;***
--- a/lisp/tl/char-table.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/tl/char-table.el	Mon Aug 13 09:45:46 2007 +0200
@@ -3,10 +3,10 @@
 ;; Copyright (C) 1996,1997 MORIOKA Tomohiko
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: char-table.el,v 1.2 1997/02/15 22:21:24 steve Exp $
-;; Keywords: character, Emacs/mule
+;; Version: $Id: char-table.el,v 1.3 1997/06/29 23:13:25 steve Exp $
+;; Keywords: character, mule
 
-;; This file is not part of tl (Tiny Library).
+;; This file is part of tl (Tiny Library).
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
@@ -25,121 +25,161 @@
 
 ;;; Code:
 
-(defun char-position-to-string (charset r l &optional plane)
+(defsubst char-position-to-string (charset r l &optional plane)
   (char-to-string
    (if plane
        (make-char charset plane (+ (* r 16) l))
      (make-char charset (+ (* r 16) l))
      )))
 
-(defun char-table-1 (charset r l plane)
-  (let ((str (char-position-to-string charset r l plane)))
-    (concat
-     (let ((i 0)
-	   (len (- 3 (string-columns str)))
-	   (dest ""))
-       (while (< i len)
-	 (setq dest (concat dest " "))
-	 (setq i (1+ i))
-	 )
-       dest) str)))
+(defsubst char-table-1 (charset r l plane)
+  (let* ((str (char-position-to-string charset r l plane))
+	 (lp (- 3 (string-width str)))
+	 (rp (/ lp 2)))
+    (setq lp
+	  (if (= (mod lp 2) 0)
+	      rp
+	    (1+ rp)))
+    (concat (make-string lp ? ) str (make-string rp ? ))
+    ))
 
-(defun show-94-table (charset &optional plane ofs)
+(defun insert-94-charset-table (charset &optional plane ofs)
   (if (null ofs)
       (setq ofs 0)
     )
-  (princ "======================================================\n")
-  (princ (format
-	  "[%3x]: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
+  (insert (format
+	  "[%02x]$B("(B 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
 	  (or plane 0)))
-  (princ "-----+------------------------------------------------\n")
+  (insert "$B(!(!(+(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(B\n")
   (let ((j 2))
-    (princ (format "%2x%x :   " (or plane 0) (* (+ j ofs) 16)))
+    (insert (format "%02x%x$B("(B   " (or plane 0) (* (+ j ofs) 16)))
     (let ((k 1))
       (while (< k 16)
-	(princ (char-table-1 charset j k plane))
+	(insert (char-table-1 charset j k plane))
 	(setq k (+ k 1))
 	)
-      (princ "\n")
+      (insert "\n")
       )
     (setq j 3)
     (while (< j 7)
-      (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
+      (insert (format "%02x%x$B("(B" (or plane 0) (* (+ j ofs) 16)))
       (let ((k 0))
 	(while (< k 16)
-	  (princ (char-table-1 charset j k plane))
+	  (insert (char-table-1 charset j k plane))
 	  (setq k (+ k 1))
 	  )
-	(princ "\n")
+	(insert "\n")
 	)
       (setq j (+ j 1))
       )
-    (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
+    (insert (format "%02x%x$B("(B" (or plane 0) (* (+ j ofs) 16)))
     (let ((k 0))
       (while (< k 15)
-	(princ (char-table-1 charset j k plane))
+	(insert (char-table-1 charset j k plane))
 	(setq k (+ k 1))
 	)
-      (princ "\n")
+      (insert "\n")
       )
     ))
 
-(defun show-96-table (charset &optional plane ofs)
+(defun insert-96-charset-table (charset &optional plane ofs)
   (if (null ofs)
       (setq ofs 0)
     )
-  (princ "======================================================\n")
-  (princ (format
-	  "[%3x]: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
+  (insert (format
+	  "[%02x]$B("(B 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"
 	  (or plane 0)))
-  (princ "-----+------------------------------------------------\n")
+  (insert "$B(!(!(+(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(B\n")
   (let ((j 2))
     (while (< j 8)
-      (princ (format "%2x%x :" (or plane 0) (* (+ j ofs) 16)))
+      (insert (format "%02x%x$B("(B" (or plane 0) (* (+ j ofs) 16)))
       (let ((k 0))
 	(while (< k 16)
-	  (princ (char-table-1 charset j k plane))
+	  (insert (char-table-1 charset j k plane))
 	  (setq k (+ k 1))
 	  )
-	(princ "\n")
+	(insert "\n")
 	)
       (setq j (1+ j))
       )))
 
-(defun show-94x94-table (charset)
-  (let ((i 33))
+(defun insert-94x94-charset-table (charset)
+  (insert-94-charset-table charset 33)
+  (let ((i 34))
     (while (< i 127)
-      (show-94-table charset i)
+      (insert "$B(,(,(;(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B\n")
+      (insert-94-charset-table charset i)
       (setq i (1+ i))
       )))
 
-(defun show-96x96-table (charset)
-  (let ((i 32))
+(defun insert-96x96-charset-table (charset)
+  (insert-96-charset-table charset 32)
+  (let ((i 33))
     (while (< i 128)
-      (show-96-table charset i)
+      (insert "$B(,(,(;(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B\n")
+      (insert-96-charset-table charset i)
       (setq i (1+ i))
       )))
 
-(defun show-char-table (charset)
+(defun insert-charset-table (charset)
+  "Insert character table of CHARSET."
+  (insert "$B(,(,(8(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B\n")
   (let ((cc (charset-chars charset))
 	(cd (charset-dimension charset))
 	)
     (cond ((= cd 1)
 	   (cond ((= cc 94)
-		  (show-94-table charset)
+		  (insert-94-charset-table charset)
 		  )
 		 ((= cc 96)
-		  (show-96-table charset)
+		  (insert-96-charset-table charset)
 		  ))
 	   )
 	  ((= cd 2)
 	   (cond ((= cc 94)
-		  (show-94x94-table charset)
+		  (insert-94x94-charset-table charset)
 		  )
 		 ((= cc 96)
-		  (show-96x96-table charset)
+		  (insert-96x96-charset-table charset)
 		  ))
-	   ))))
+	   )))
+  (insert "$B(,(,(:(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B\n")
+  )
+
+;;;###autoload
+(defun view-charset (charset)
+  "Display character table of CHARSET."
+  (interactive
+   (list
+    (let ((charset-alist
+	   (mapcar (function
+		    (lambda (charset)
+		      (cons (charset-doc-string charset) charset)
+		      ))
+		   (charset-list))))
+      (cdr (assoc (completing-read "What charset: "
+				   charset-alist nil t nil)
+		  charset-alist))
+      )))
+  (let* ((desc (charset-doc-string charset))
+	 (buf (concat "*Charset table for "
+		      (charset-doc-string charset)
+		      "*")))
+    (unless (get-buffer buf)
+      (let ((the-buf (current-buffer)))
+	(set-buffer (get-buffer-create buf))
+	(insert (format "%s (%s)\n" desc charset))
+	(let ((msg (format "Generating char table for %s..." desc)))
+	  (message msg)
+	  (insert-charset-table charset)
+	  (message "%s Done." msg)
+	  )
+	(set-buffer-modified-p nil)
+	(goto-char (point-min))
+	(set-buffer the-buf)
+	))
+    (view-buffer buf)
+    ))
 
 
 ;;; @ end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/tl/chartblxmas.el	Mon Aug 13 09:45:46 2007 +0200
@@ -0,0 +1,100 @@
+;;; chartblxmas.el --- display table of charset by pop-up menu
+
+;; Copyright (C) 1997 MORIOKA Tomohiko
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Version: $Id: chartblxmas.el,v 1.1 1997/06/29 23:21:49 steve Exp $
+;; Keywords: character, XEmacs/mule
+
+;; 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.
+
+;;; Code:
+
+(require 'alist)
+(require 'char-table)
+
+(defun classify-charsets-by-dimension-and-chars (charset-list)
+  (let (dest)
+    (while charset-list
+      (let* ((charset (car charset-list))
+	     (chars (charset-chars charset))
+	     (dim (charset-dimension charset))
+	     (dim-alist (cdr (assq dim dest)))
+	     )
+	(setq dest
+	      (put-alist dim
+			 (put-alist chars
+				    (cons charset
+					  (cdr (assq chars dim-alist)))
+				    dim-alist)
+			 dest))
+	)
+      (setq charset-list (cdr charset-list))
+      )
+    dest))
+
+
+;;;###autoload
+(defun view-charset-by-menu ()
+  "Display character table of CHARSET by pop-up menu."
+  (interactive)
+  (popup-menu
+   (cons
+    "Character set:"
+    (mapcar (function
+	     (lambda (cat)
+	       (cons (car cat)
+		     (sort
+		      (mapcar (function
+			       (lambda (charset)
+				 (vector (charset-doc-string charset)
+					 `(view-charset ',charset)
+					 t)
+				 ))
+			      (cdr cat))
+		      (function
+		       (lambda (a b)
+			 (string< (aref a 0)(aref b 0))
+			 ))))))
+	    (sort
+	     (let ((rest
+		    (classify-charsets-by-dimension-and-chars (charset-list))
+		    ))
+	       (while rest
+		 (let* ((r (car rest))
+			(d (car r)))
+		   (setq r (cdr r))
+		   (while r
+		     (let* ((p (car r))
+			    (n (int-to-string (car p)))
+			    (s n)
+			    (i 1))
+		       (while (< i d)
+			 (setq s (concat s " x " n))
+			 (setq i (1+ i)))
+		       (set-alist 'dest (concat s " character set") (cdr p)))
+		     (setq r (cdr r))
+		     ))
+		 (setq rest (cdr rest)))
+	       dest)
+	     (function (lambda (a b)
+			 (string< (car a)(car b))
+			 )))
+	    ))))
+
+;;; chartblxmas.el ends here
--- a/lisp/tl/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/tl/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/tm/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/tm/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/tm/tm-ew-e.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/tm/tm-ew-e.el	Mon Aug 13 09:45:46 2007 +0200
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Revision: 1.4 $
+;; Version: $Revision: 1.5 $
 ;; Keywords: encoded-word, MIME, multilingual, header, mail, news
 
 ;; This file is part of tm (Tools for MIME).
@@ -35,7 +35,7 @@
 ;;;
 
 (defconst tm-ew-e/RCS-ID
-  "$Id: tm-ew-e.el,v 1.4 1997/06/14 20:31:38 steve Exp $")
+  "$Id: tm-ew-e.el,v 1.5 1997/06/29 23:13:28 steve Exp $")
 (defconst mime-eword/encoder-version (get-version-string tm-ew-e/RCS-ID))
 
 
@@ -54,6 +54,7 @@
        )
     '(("X-Nsubject" . iso-2022-jp-2)
       ("Newsgroups" . nil)
+      ("Message-ID" . nil)
       (t            . mime)
       ))
   "*Alist to specify field encoding method.
@@ -293,7 +294,8 @@
 	 string len)
     (if (null ret)
 	(cond ((and (setq string (car rword))
-		    (<= (setq len (+ (length string) column)) 76)
+		    (or (<= (setq len (+ (length string) column)) 76)
+			(<= column 1))
 		    )
 	       (setq rwl (cdr rwl))
 	       )
--- a/lisp/tooltalk/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/tooltalk/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/utils/auto-autoloads.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/utils/auto-autoloads.el	Mon Aug 13 09:45:46 2007 +0200
@@ -176,7 +176,7 @@
 
 ;;;### (autoloads (browse-url-lynx-emacs browse-url-lynx-xterm browse-url-w3 browse-url-iximosaic browse-url-grail browse-url-mosaic browse-url-netscape) "browse-url" "utils/browse-url.el")
 
-(defcustom browse-url-browser-function 'browse-url-w3 "*Function to display the current buffer in a WWW browser.\nUsed by the `browse-url-at-point', `browse-url-at-mouse', and\n`browse-url-of-file' commands." :type 'function :group 'browse-url)
+(defcustom browse-url-browser-function 'browse-url-w3 "*Function to display the current buffer in a WWW browser.\nUsed by the `browse-url-at-point', `browse-url-at-mouse', and\n`browse-url-of-file' commands." :type '(radio (function-item browse-url-w3) (function-item browse-url-netscape) (function-item browse-url-mosaic) (function-item browse-url-cci) (function-item browse-url-iximosaic) (function-item browse-url-lynx-xterm) (function-item browse-url-lynx-emacs) (function-item browse-url-grail) (function :tag "Other" nil)) :group 'browse-url)
 
 (autoload 'browse-url-netscape "browse-url" "\
 Ask the Netscape WWW browser to load URL.
@@ -998,16 +998,6 @@
 
 ;;;***
 
-;;;### (autoloads (speedbar-frame-mode) "speedbar" "utils/speedbar.el")
-
-(autoload 'speedbar-frame-mode "speedbar" "\
-Enable or disable use of a speedbar.  Positive number means turn
-on, negative turns speedbar off, and nil means toggle.  Once the
-speedbar frame is activated, a buffer in `speedbar-mode' will be
-displayed.  Currently, only one speedbar is supported at a time." t nil)
-
-;;;***
-
 ;;;### (autoloads nil "timezone" "utils/timezone.el")
 
 (define-error 'invalid-date "Invalid date string")
--- a/lisp/utils/autoload.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/utils/autoload.el	Mon Aug 13 09:45:46 2007 +0200
@@ -518,7 +518,10 @@
       (mapatoms (lambda (symbol)
 		  (let ((members (condition-case nil
 				     (get symbol 'custom-group)
-				   (t nil)))
+				   (t (progn
+					(message "Bad plist in %s"
+						 (symbol-name symbol)))
+				      nil)))
 			item where found)
 		    (when members
 		      (princ "(put '")
@@ -599,7 +602,8 @@
 	(save-some-buffers t))
       (message "Done")
       ;; (kill-emacs 0)
-      )))
+      )
+    (setq command-line-args-left nil)))
 
 (provide 'autoload)
 
--- a/lisp/utils/browse-url.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/utils/browse-url.el	Mon Aug 13 09:45:46 2007 +0200
@@ -376,7 +376,15 @@
   "*Function to display the current buffer in a WWW browser.
 Used by the `browse-url-at-point', `browse-url-at-mouse', and
 `browse-url-of-file' commands."
-  :type 'function
+  :type '(radio (function-item browse-url-w3)
+		(function-item browse-url-netscape)
+		(function-item browse-url-mosaic)
+		(function-item browse-url-cci)
+		(function-item browse-url-iximosaic)
+		(function-item browse-url-lynx-xterm)
+		(function-item browse-url-lynx-emacs)
+		(function-item browse-url-grail)
+		(function :tag "Other" nil))
   :group 'browse-url)
 
 (defcustom browse-url-netscape-command "netscape"
--- a/lisp/utils/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/utils/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,6 +1,7 @@
 (put 'extensions 'custom-loads '("eldoc"))
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '("eldoc"))
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/utils/delbs.el	Mon Aug 13 09:44:44 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-;;; delbs.el --- a small lisp package to allow you to swap around DEL/BS keys
-
-;; Copyright (C) 1997 Gary Foster
-
-;; Author: Gary Foster <Gary.Foster@corp.sun.com>
-;; Keywords: lisp, terminals
-
-;; 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.
-
-;;; Commentary:
-
-;;   This package should, *theoretically*, serve to quieten the DEL/BS rwars
-;;     a little.  By using this package, you can have DEL and BS both do the
-;;     same function (normally delete one char to the left) or you can have
-;;     then bound separately (DEL --> delete-char, BS --> delete-backward-char)
-;;     with all appropriate Meta bindings in each mode.
-;;
-;; Author: Gary Foster <Gary.Foster@corp.sun.com>
-;; Credits due to: Per Abrahamsen <abraham@dina.kvl.dk>
-
-;;; Code:
-
-(defun delbs-enable-delete-forward ()
-  "Set up the delete key to delete forward, and backspace to delete backward."
-  (interactive)
-  (define-key key-translation-map [backspace] "\C-?")
-  (define-key key-translation-map [delete] "\C-d")
-  (define-key key-translation-map [(meta backspace)] "\M-\C-?")
-  (define-key key-translation-map [(meta delete)] "\M-d"))
-  
-(defun delbs-disable-delete-forward ()
-  "Return the DEL/BS key mappings to the XEmacs default"
-  (interactive)
-  (define-key key-translation-map [backspace] [backspace])
-  (define-key key-translation-map [delete] [delete])
-  (define-key key-translation-map [(meta backspace)] [(meta backspace)])
-  (define-key key-translation-map [(meta delete)] [(meta delete)]))
-
-(provide 'delbs)
-
-;;; delbs.el ends here
--- a/lisp/utils/speedbar.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/utils/speedbar.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,200 +1,387 @@
-;;; speedbar - quick access to files and tags
-;;;
-;;; Copyright (C) 1996 Eric M. Ludlam
-;;;
-;;; Author: Eric M. Ludlam <zappo@gnu.ai.mit.edu>
-;;; RCS: $Id: speedbar.el,v 1.1 1997/02/17 06:40:14 steve Exp $
-;;; Version: 0.3.1
-;;; Keywords: file, tags, tools
-;;;
-;;; This program 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.
-;;;
-;;; This program 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 this program; if not, you can either send email to this
-;;; program's author (see below) or write to:
-;;;
-;;;              The Free Software Foundation, Inc.
-;;;              675 Mass Ave.
-;;;              Cambridge, MA 02139, USA. 
-;;;
-;;; Please send bug reports, etc. to zappo@gnu.ai.mit.edu.
-;;;
+;;; speedbar --- quick access to files and tags -*-byte-compile-warnings:nil;-*-
+
+;; Copyright (C) 1996, 1997 Eric M. Ludlam
+;;
+;; Author: Eric M. Ludlam <zappo@gnu.ai.mit.edu>
+;; Version: 0.5
+;; Keywords: file, tags, tools
+;; X-RCS: $Id: speedbar.el,v 1.2 1997/06/29 23:13:33 steve Exp $
+;;
+;; This program 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.
+;;
+;; This program 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 this program; if not, you can either send email to this
+;; program's author (see below) or write to:
+;;
+;;              The Free Software Foundation, Inc.
+;;              675 Mass Ave.
+;;              Cambridge, MA 02139, USA.
+;;
+;; Please send bug reports, etc. to zappo@gnu.ai.mit.edu.
+;;
 
-;;; Commentary: 
-;;;
-;;;   The speedbar provides a frame in which files, and locations in
-;;; files are displayed.  These items can be clicked on with mouse-2
-;;; in order to make the last active frame display that file location.
-;;;
-;;;   If you want to choose it from a menu or something, do this:
-;;;
-;;;   (autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
-;;;   (define-key-after (lookup-key global-map [menu-bar tools])
-;;;      [speedbar] '("Speedbar" . speedbar-frame-mode) [calendar])
-;;;
-;;;   To activate speedbar without the menu, type: M-x speedbar-frame-mode RET
-;;;
-;;;   Once a speedbar frame is active, it takes advantage of idle time
-;;; to keep it's contents updated.  The contents is usually a list of
-;;; files in the directory of the currently active buffer.  When
-;;; applicable, tags in the active file can be expanded.
-;;;
-;;;   Speedbar uses multiple methods for creating tags to jump to.
-;;; When the variable `speedbar-use-imenu-package' is set, then
-;;; speedbar will first try to use imenu to get tags.  If the mode of
-;;; the buffer doesn't support imenu, then etags is used.  Using Imenu
-;;; has the advantage that tags are cached, so opening and closing
-;;; tags lists is faster.  Speedbar-imenu will also load the file into
-;;; a non-selected buffer so clicking the file later will be faster.
-;;;
-;;;   To add new files types into the speedbar, modify
-;;; `speedbar-file-regexp' to include the extension of the file type
-;;; you wish to include.  If speedbar complains that the file type is
-;;; not supported, that means there is no built in support from imenu,
-;;; and the etags part wasn't set up right.
-;;;
-;;;   To add new file types to imenu, see the documentation in the
-;;; file imenu.el that comes with emacs.  To add new file types which
-;;; etags supports, you need to modify the variable
-;;; `speedbar-fetch-etags-parse-list'.  This variable is an
-;;; association list with each element of the form: (extension-regex
-;;; . parse-one-line) The extension-regex would be something like
-;;; "\\.c$" for a .c file, and the parse-one-line would be either a
-;;; regular expression where match tag 1 is the element you wish
-;;; displayed as a tag.  If you need to do something more complex,
-;;; then you can also write a function which parses one line, and put
-;;; its symbol there instead.
-;;;
-;;;    If the updates are going to slow for you, modify the variable
-;;; `speedbar-update-speed' to a longer idle time before updates.
-;;;
-;;;    If you navigate directories, you will probably notice that you
-;;; will navigate to a directory which is eventually replaced after
-;;; you go back to editing a file (unless you pull up a new file.)
-;;; The delay time before this happens is in
-;;; `speedbar-navigating-speed', and defaults to 20 seconds.
-;;;
-;;;    XEmacs users may want to change the default timeouts for
-;;; `speedbar-update-speed' to something longer as XEmacs doesn't have
-;;; idle timers, the speedbar timer keeps going off arbitrarilly while
-;;; you're typing.  It's quite pesky.
-;;;
-;;;    To get speedbar-configure-faces to work, you will need to
-;;; download my eieio package from my ftp site.
-;;;
-;;;    EIEIO is NOT required when using speedbar.  It is ONLY needed
-;;; if you want to use a fancy dialog face editor for speedbar.
+;;; Commentary:
+;;
+;;   The speedbar provides a frame in which files, and locations in
+;; files are displayed.  These items can be clicked on with mouse-2
+;; in order to make the last active frame display that file location.
+;;
+;;   To use speedbar, add this to your .emacs file:
+;;
+;;   (autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
+;;   (autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
+;;
+;;   If you want to choose it from a menu or something, do this:
+;;
+;;   (define-key-after (lookup-key global-map [menu-bar tools])
+;;      [speedbar] '("Speedbar" . speedbar-frame-mode) [calendar])
+;;
+;;   If you want to access speedbar using only the keyboard, do this:
+;;
+;;   (define-key global-map [f4] 'speedbar-get-focus)
+;;
+;;   This will let you hit f4 (or whatever key you choose) to jump
+;; focus to the speedbar frame.  Pressing RET or e to jump to a file
+;; or tag will move you back to the attached frame.  The command
+;; `speedbar-get-fucus' will also create a speedbar frame if it does
+;; not exist.
+;;
+;;   Once a speedbar frame is active, it takes advantage of idle time
+;; to keep it's contents updated.  The contents is usually a list of
+;; files in the directory of the currently active buffer.  When
+;; applicable, tags in the active file can be expanded.
+;;
+;;   To add new supported files types into speedbar, use the function
+;; `speedbar-add-supported-extension' If speedbar complains that the
+;; file type is not supported, that means there is no built in
+;; support from imenu, and the etags part wasn't set up correctly.  You
+;; may add elements to `speedbar-supported-extension-expressions' as long
+;; as it is done before speedbar is loaded.
+;;
+;;   To prevent speedbar from following you into certain directories
+;; use the function `speedbar-add-ignored-path-regexp' too add a new
+;; regular expression matching a type of path.  You may add list
+;; elements to `speedbar-ignored-path-expressions' as long as it is
+;; done before speedbar is loaded.
+;;
+;;   To add new file types to imenu, see the documentation in the
+;; file imenu.el that comes with emacs.  To add new file types which
+;; etags supports, you need to modify the variable
+;; `speedbar-fetch-etags-parse-list'.
+;;
+;;    If the updates are going too slow for you, modify the variable
+;; `speedbar-update-speed' to a longer idle time before updates.
+;;
+;;    If you navigate directories, you will probably notice that you
+;; will navigate to a directory which is eventually replaced after
+;; you go back to editing a file (unless you pull up a new file.)
+;; The delay time before this happens is in
+;; `speedbar-navigating-speed', and defaults to 10 seconds.
+;;
+;;    XEmacs users may want to change the default timeouts for
+;; `speedbar-update-speed' to something longer as XEmacs doesn't have
+;; idle timers, the speedbar timer keeps going off arbitrarilly while
+;; you're typing.  It's quite pesky.
+;;
+;;    Users of emacs previous to to v 19.31 (when idle timers
+;; where introduced) will not have speedbar updating automatically.
+;; Use "r" to refresh the display after changing directories.
+;; Remember, do not interrupt the stealthy updates or you display may
+;; not be completely refreshed.
+;;
+;;    See optional file `speedbspec.el' for additional configurations
+;; which allow speedbar to create specialized lists for special modes
+;; that are not file-related.
+;;
+;;    See optional file `speedbcfg.el' for interactive buffers
+;; allowing simple configuration of colors and features of speedbar.
+;;
+;;    AUC-TEX users: The imenu tags for AUC-TEX mode don't work very
+;; well.  Use the imenu keywords from tex-mode.el for better results.
+;;
+;; This file requires the library package assoc (association lists)
 
 ;;; Speedbar updates can be found at:
-;;; ftp://ftp.ultranet.com/pub/zappo/speedbar.*.el
-;;;
+;; ftp://ftp.ultranet.com/pub/zappo/speedbar*.tar.gz
+;;
 
-;;; HISTORY:
-;;; 0.1   Initial Revision
-;;; 0.2   Fixed problem with x-pointer-shape causing future frames not
-;;;         to be created.
-;;;       Fixed annoying habit of `speedbar-update-contents' to make
-;;;         it possible to accidentally kill the speedbar buffer.
-;;;       Clicking directory names now only changes the contents of
-;;;         the speedbar, and does not cause a dired mode to appear.
-;;;         Clicking the <+> next to the directory does cause dired to
-;;;         be run.
-;;;       Added XEmacs support, which means timer support moved to a
-;;;         platform independant call.
-;;;       Added imenu support.  Now modes are supported by imenu
-;;;         first, and etags only if the imenu call doesn't work.
-;;;         Imenu is a little faster than etags, and is more emacs
-;;;         friendly.
-;;;       Added more user control variables described in the commentary.
-;;;       Added smart recentering when nodes are opened and closed.
-;;; 0.3   x-pointer-shape fixed for emacs 19.35, so I put that check in.
-;;;       Added invisible codes to the beginning of each line.
-;;;       Added list aproach to node expansion for easier addition of new
-;;;         types of things to expand by
-;;;       Added multi-level path name support
-;;;       Added multi-level tag name support.
-;;;       Only mouse-2 is now used for node expansion
-;;;       Added keys e + - to edit expand, and contract node lines
-;;;       Added longer legal file regexp for all those modes which support
-;;;         imenu. (pascal, fortran90, ada, pearl)
-;;;       Fixed centering algorithm
-;;;       Tried to choose background independent colors.  Made more robust.
-;;;       Rearranged code into a more logical order
-;;; 0.3.1 Fixed doc & broken keybindings
-;;;       Added mode hooks.
-;;;       Improved color selection to be background mode smart
-;;;       `nil' passed to `speedbar-frame-mode' now toggles the frame as
-;;;         advertised in the doc string
-;;;       
+;;; Change log:
+;; 0.1   Initial Revision
+;; 0.2   Fixed problem with x-pointer-shape causing future frames not
+;;         to be created.
+;;       Fixed annoying habit of `speedbar-update-contents' to make
+;;         it possible to accidentally kill the speedbar buffer.
+;;       Clicking directory names now only changes the contents of
+;;         the speedbar, and does not cause a dired mode to appear.
+;;         Clicking the <+> next to the directory does cause dired to
+;;         be run.
+;;       Added XEmacs support, which means timer support moved to a
+;;         platform independant call.
+;;       Added imenu support.  Now modes are supported by imenu
+;;         first, and etags only if the imenu call doesn't work.
+;;         Imenu is a little faster than etags, and is more emacs
+;;         friendly.
+;;       Added more user control variables described in the commentary.
+;;       Added smart recentering when nodes are opened and closed.
+;; 0.3   x-pointer-shape fixed for emacs 19.35, so I put that check in.
+;;       Added invisible codes to the beginning of each line.
+;;       Added list aproach to node expansion for easier addition of new
+;;         types of things to expand by
+;;       Added multi-level path name support
+;;       Added multi-level tag name support.
+;;       Only mouse-2 is now used for node expansion
+;;       Added keys e + - to edit expand, and contract node lines
+;;       Added longer legal file regexp for all those modes which support
+;;         imenu. (pascal, fortran90, ada, pearl)
+;;       Added pascal support to etags from Dave Penkler <dave_penkler@grenoble.hp.com>
+;;       Fixed centering algorithm
+;;       Tried to choose background independent colors.  Made more robust.
+;;       Rearranged code into a more logical order
+;; 0.3.1 Fixed doc & broken keybindings
+;;       Added mode hooks.
+;;       Improved color selection to be background mode smart
+;;       `nil' passed to `speedbar-frame-mode' now toggles the frame as
+;;         advertised in the doc string
+;; 0.4a  Added modified patch from Dan Schmidt <dfan@lglass.com> allowing a
+;;         directory cache to be maintained speeding up revisiting of files.
+;;       Default raise-lower behavior is now off by default.
+;;       Added some menu items for edit expand and contract.
+;;       Pre 19.31 emacsen can run without idle timers.
+;;       Added some patch information from Farzin Guilak <farzin@protocol.com>
+;;         adding xemacs specifics, and some etags upgrades.
+;;       Added ability to set a faces symbol-value to a string
+;;         representing the desired foreground color.  (idea from
+;;         Farzin Guilak, but implemented differently)
+;;       Fixed problem with 1 character buttons.
+;;       Added support for new Imenu marker technique.
+;;       Added `speedbar-load-hooks' for things to run only once on
+;;         load such as updating one of the many lists.
+;;       Added `speedbar-supported-extension-expressions' which is a
+;;         list of extensions that speedbar will tag.  This variable
+;;         should only be updated with `speedbar-add-supported-extension'
+;;       Moved configure dialog support to a separate file so
+;;         speedbar is not dependant on eieio to run
+;;       Fixed list-contraction problem when the item was at the end
+;;         of a sublist.
+;;       Fixed XEmacs multi-frame timer selecting bug problem.
+;;       Added `speedbar-ignored-modes' which is a list of major modes
+;;         speedbar will not follow when it is displayed in the selected frame
+;; 0.4   When the file being edited is not in the list, and is a file
+;;         that should be in the list, the speedbar cache is replaced.
+;;       Temp buffers are now shown in the attached frame not the
+;;         speedbar frame
+;;       New variables `speedbar-vc-*' and `speedbar-stealthy-function-list'
+;;         added.  `speedbar-update-current-file' is now a member of
+;;         the stealthy list.  New function `speedbar-check-vc' will
+;;         examine each file and mark it if it is checked out.  To
+;;         add new version control types, override the function
+;;         `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p'.
+;;         The stealth list is interruptible so that long operations
+;;         do not interrupt someones editing flow.  Other long
+;;         speedbar updates will be added to the stealthy list in the
+;;         future should interesting ones be needed.
+;;       Added many new functions including:
+;;         `speedbar-item-byte-compile' `speedbar-item-load'
+;;         `speedbar-item-copy' `speedbar-item-rename' `speedbar-item-delete'
+;;         and `speedbar-item-info'
+;;       If the user kills the speedbar buffer in some way, the frame will
+;;         be removed.
+;; 0.4.1 Bug fixes
+;;       <mark.jeffries@nomura.co.uk> added `speedbar-update-flag',
+;;         XEmacs fixes for menus, and tag sorting, and quit key.
+;;       Modeline now updates itself based on window-width.
+;;       Frame is cached when closed to make pulling it up again faster.
+;;       Speedbars window is now marked as dedicated.
+;;       Added bindings: <grossjoh@charly.informatik.uni-dortmund.de>
+;;       Long directories are now span multiple lines autmoatically
+;;       Added `speedbar-directory-button-trim-method' to specify how to
+;;         sorten the directory button to fit on the screen.
+;; 0.4.2 Add one level of full-text cache.
+;;       Add `speedbar-get-focus' to switchto/raise the speedbar frame.
+;;       Editing thing-on-line will auto-raise the attached frame.
+;;       Bound `U' to `speedbar-up-directory' command.
+;;       Refresh will now maintain all subdirectories that were open
+;;        when the refresh was requested.  (This does not include the
+;;        tags, only the directories)
+;; 0.4.3 Bug fixes
+;; 0.4.4 Added `speedbar-ignored-path-expressions' and friends.
+;;       Configuration menu items not displayed if dialog-mode not present
+;;       Speedbar buffer now starts with a space, and is not deleted
+;;        ewhen the speedbar frame is closed.  This prevents the invisible
+;;        frame from preventing buffer switches with other buffers.
+;;       Fixed very bad bug in the -add-[extension|path] functions.
+;;       Added `speedbar-find-file-in-frame' which will always pop up a frame
+;;        that is already display a buffer selected in the speedbar buffer.
+;;       Added S-mouse2 as "power click" for always poping up a new frame.
+;;        and always rescanning with imenu (ditching the imenu cache), and
+;;        always rescanning directories.
+;; 0.4.5 XEmacs bugfixes and enhancements.
+;;       Window Title simplified.
+;; 0.4.6 Fixed problems w/ dedicated minibuffer frame.
+;;       Fixed errors reported by checkdoc.
+;; 0.5   Mode-specific contents added.  Controlled w/ the variable
+;;         `speedbar-mode-specific-contents-flag'.  See speedbspec
+;;         for info on enabling this feature.
+;;       `speedbar-load-hook' name change and pointer check against
+;;         major-mode.  Suggested by Sam Steingold <sds@ptc.com>
+;;       Quit auto-selects the attached frame.
+;;       Ranamed `speedbar-do-updates' to `speedbar-update-flag'
+;;       Passes checkdoc.
+
 ;;; TODO:
-;;; 1) Rember contents of directories when leaving them so it's faster
-;;;    when returning.
-;;; 2) List of directories to never visit.  (User might be browsing
-;;;    there temporarilly such as info files, documentation and the
-;;;    like)
-;;; 3) Implement SHIFT-mouse2 to rescan buffers with imenu.
-;;; 4) Better XEmacs support of menus and button-bar
-;;; 5) More functions to create buttons and options
-;;; 6) filtering algoritms to reduce the number of tags/files
-;;;    displayed.
-;;; 7) Build `speedbar-file-regexp' on the fly.
-;;; 8) More intelligent current file highlighting.
+;; 1) More functions to create buttons and options
+;; 2) filtering algoritms to reduce the number of tags/files displayed.
+;; 3) Timeout directories we haven't visited in a while.
+;; 4) Remeber tags when refreshing the display.  (Refresh tags too?)
+;; 5) More 'special mode support.
+;; 6) Smart way to auto-expand instead of directory switch
 
-(defvar speedbar-xemacsp (string-match "XEmacs" emacs-version))
+;;; Code:
+(require 'assoc)
+(require 'easymenu)
+
+(defvar speedbar-xemacsp (string-match "XEmacs" emacs-version)
+  "Non-nil if we are running in the XEmacs environment.")
 
 (defvar speedbar-initial-expansion-list
   '(speedbar-directory-buttons speedbar-default-directory-list)
-  "*List of functions to call to fill in the speedbar buffer whenever
-a top level update is issued.  These functions will allways get the
-default directory to use passed in as the first parameter, and a 0 as
-the second parameter.  They must assume that the cursor is at the
-postion where they start inserting buttons.")
+  "List of functions to call to fill in the speedbar buffer.
+Whenever a top level update is issued all functions in this list are
+run.  These functions will always get the default directory to use
+passed in as the first parameter, and a 0 as the second parameter.
+The 0 indicates the uppermost indentation level.  They must assume
+that the cursor is at the position where they start inserting
+buttons.")
+
+(defvar speedbar-stealthy-function-list
+  '(speedbar-update-current-file speedbar-check-vc)
+  "List of functions to periodically call stealthily.
+Each function must return nil if interrupted, or t if completed.
+Stealthy functions which have a single operation should always return
+t.  Functions which take a long time should maintain a state (where
+they are in their speedbar related calculations) and permit
+interruption.  See `speedbar-check-vc' as a good example.")
+
+(defvar speedbar-mode-specific-contents-flag t
+  "*Non-nil means speedbar will show specail-mode contents.
+This permits some modes to create customized contents for the speedbar
+frame.")
+
+(defvar speedbar-special-mode-expansion-list nil
+  "Mode specific list of functions to call to fill in speedbar.
+Some modes, such as Info or RMAIL, do not relate quite as easily into
+a simple list of files.  When this variable is non-nil and buffer-local,
+then these functions are used, creating specialized contents.  These
+functions are called each time the speedbar timer is called.  This
+allows a mode to update it's contents regularly.
+
+  Each function is called with the default and frame belonging to
+speedbar, and with one parameter; the buffer requesting
+the speedbar display.")
+
+(defvar speedbar-load-hook nil
+  "Hooks run when speedbar is loaded.")
+
+(defvar speedbar-desired-buffer nil
+  "Non-nil when speedbar is showing buttons specific a special mode.
+In this case it is the originating buffer.")
 
 (defvar speedbar-show-unknown-files nil
-  "*Non-nil shows files with a ? in the expansion tag for files we can't
-expand.  `nil' means don't show the file in the list.")
+  "*Non-nil show files we can't expand with a ? in the expand button.
+nil means don't show the file in the list.")
 
 ;; Xemacs timers aren't based on idleness.  Therefore tune it down a little
 ;; or suffer mightilly!
 (defvar speedbar-update-speed (if speedbar-xemacsp 5 1)
-  "*Time in seconds of idle time needed before speedbar will update
-it's buffer to match what you've been doing in your other frame.")
+  "*Idle time in seconds needed before speedbar will update itself.
+Updates occur to allow speedbar to display directory information
+relevant to the buffer you are currently editing.")
 (defvar speedbar-navigating-speed 10
-  "*Idle time to wait before re-running the timer proc to pick up any new
-activity if the user has started navigating directories in the speedbar.")
-
-(defvar speedbar-width 20
-  "*Initial size of the speedbar window")
+  "*Idle time to wait after navigation commands in speedbar are executed.
+Navigation commands included expanding/contracting nodes, and moving
+between different directories.")
 
-(defvar speedbar-scrollbar-width 10
-  "*Initial sizeo of the speedbar scrollbar.  The thinner, the more
-display room you will have.")
+(defvar speedbar-frame-parameters (list
+				   ;; Xemacs fails to delete speedbar
+				   ;; if minibuffer is off.
+				   ;(cons 'minibuffer
+				   ; (if speedbar-xemacsp t nil))
+				   ;; The above behavior seems to have fixed
+				   ;; itself somewhere along the line.
+				   ;; let me know if any problems arise.
+				   '(minibuffer . nil)
+				   '(width . 20)
+				   '(scroll-bar-width . 10)
+				   '(border-width . 0)
+				   '(unsplittable . t) )
+  "*Parameters to use when creating the speedbar frame.
+Parameters not listed here which will be added automatically are
+`height' which will be initialized to the height of the frame speedbar
+is attached to.  To add more frame defaults, `cons' new alist members
+onto this variable through the `speedbar-load-hook'")
 
-(defvar speedbar-raise-lower t
-  "*Non-nil means speedbar will auto raise and lower itself.  When this
-is set, you can have only a tiny strip visible under your main emacs,
-and it will raise and lower itself when you put the pointer in it.")
+(defvar speedbar-use-imenu-flag (stringp (locate-library "imenu"))
+  "*Non-nil means use imenu for file parsing.  nil to use etags.
+XEmacs doesn't support imenu, therefore the default is to use etags
+instead.  Etags support is not as robust as imenu support.")
 
-(defvar speedbar-use-imenu-package (not speedbar-xemacsp)
-  "*Optionally use the imenu package instead of etags for parsing.  This
-is experimental for performace testing.")
+(defvar speedbar-sort-tags nil
+  "*If Non-nil, sort tags in the speedbar display.  (Etags only)
+See imenu.el source for how imenu does sorting.")
+
+(defvar speedbar-directory-button-trim-method 'span
+  "*Indicates how the directory button will be displayed.
+Possible values are:
+ 'span - span large directories over multiple lines.
+ 'trim - trim large directories to only show the last few.
+ nil   - no trimming.")
 
 (defvar speedbar-before-delete-hook nil
-  "*Hooks called before deletiing the speedbar frame.")
+  "*Hooks called before deleting the speedbar frame.")
 
 (defvar speedbar-mode-hook nil
-  "*Hooks called after creating a speedbar buffer")
+  "*Hooks called after creating a speedbar buffer.")
 
 (defvar speedbar-timer-hook nil
-  "*Hooks called after running the speedbar timer function")
+  "*Hooks called after running the speedbar timer function.")
+
+(defvar speedbar-verbosity-level 1
+  "*Verbosity level of the speedbar.  0 means say nothing.
+1 means medium level verbosity.  2 and higher are higher levels of
+verbosity.")
+
+(defvar speedbar-vc-indicator " *"
+  "*Text used to mark files which are currently checked out.
+Currently only RCS is supported.  Other version control systems can be
+added by examining the function `speedbar-this-file-in-vc' and
+`speedbar-vc-check-dir-p'")
+
+(defvar speedbar-vc-do-check t
+  "*Non-nil check all files in speedbar to see if they have been checked out.
+Any file checked out is marked with `speedbar-vc-indicator'")
+
+(defvar speedbar-vc-to-do-point nil
+  "Local variable maintaining the current version control check position.")
+
+(defvar speedbar-ignored-modes nil
+  "*List of major modes which speedbar will not switch directories for.")
+
+(defvar speedbar-ignored-path-expressions
+  '("/log/$")
+  "*List of regular expressions matching directories speedbar will ignore.
+They should included paths to directories which are notoriously very
+large and take a long time to load in.  Use the function
+`speedbar-add-ignored-path-regexp' to add new items to this list after
+speedbar is loaded.  You may place anything you like in this list
+before speedbar has been loaded.")
 
 (defvar speedbar-file-unshown-regexp
   (let ((nstr "") (noext completion-ignored-extensions))
@@ -203,17 +390,100 @@
 			 (if (cdr noext) "\\|" ""))
 	    noext (cdr noext)))
     (concat nstr "\\|#[^#]+#$\\|\\.\\.?$"))
-  "*Regular expression matching files we don't want to display in a
-speedbar buffer")
+  "*Regexp matching files we don't want displayed in a speedbar buffer.
+It is generated from the variable `completion-ignored-extensions'")
+
+(defvar speedbar-supported-extension-expressions
+  (append '(".[CcHh]\\(++\\|pp\\|c\\|h\\)?" ".tex\\(i\\(nfo\\)?\\)?"
+	    ".el" ".emacs" ".p" ".java")
+	  (if speedbar-use-imenu-flag
+	      '(".f90" ".ada" ".pl" ".tcl" ".m"
+		"Makefile\\(\\.in\\)?")))
+  "*List of regular expressions which will match files supported by tagging.
+Do not prefix the `.' char with a double \\ to quote it, as the period
+will be stripped by a simplified optimizer when compiled into a
+singular expression.  This variable will be turned into
+`speedbar-file-regexp' for use with speedbar.  You should use the
+function `speedbar-add-supported-extension' to add a new extension at
+runtime, or use the configuration dialog to set it in your .emacs
+file.")
+
+(defun speedbar-extension-list-to-regex (extlist)
+  "Takes EXTLIST, a list of extensions and transforms it into regexp.
+All the preceding . are stripped for an optimized expression starting
+with . followed by extensions, followed by full-filenames."
+  (let ((regex1 nil) (regex2 nil))
+    (while extlist
+      (if (= (string-to-char (car extlist)) ?.)
+	  (setq regex1 (concat regex1 (if regex1 "\\|" "")
+			       (substring (car extlist) 1)))
+	(setq regex2 (concat regex2 (if regex2 "\\|" "") (car extlist))))
+      (setq extlist (cdr extlist)))
+    ;; concat all the sub-exressions together, making sure all types
+    ;; of parts exist during concatination.
+    (concat "\\("
+	    (if regex1 (concat "\\(\\.\\(" regex1 "\\)\\)") "")
+	    (if (and regex1 regex2) "\\|" "")
+	    (if regex2 (concat "\\(" regex2 "\\)") "")
+	    "\\)$")))
+
+(defvar speedbar-ignored-path-regexp
+  (speedbar-extension-list-to-regex speedbar-ignored-path-expressions)
+  "Regular expression matching paths speedbar will not switch to.
+Created from `speedbar-ignored-path-expressions' with the function
+`speedbar-extension-list-to-regex' (A misnamed function in this case.)
+Use the function `speedbar-add-ignored-path-regexp' to modify this
+variable.")
 
-(defvar speedbar-file-regexp 
-  (if speedbar-use-imenu-package
-      "\\(\\.\\([CchH]\\|c\\(++\\|pp\\)\\|f90\\|ada\\|pl?\\|el\\|t\\(ex\\(i\\(nfo\\)?\\)?\\|cl\\)\\|emacs\\)$\\)\\|[Mm]akefile\\(\\.in\\)?"
-    "\\.\\([CchH]\\|c\\(++\\|pp\\)\\|p\\|el\\|tex\\(i\\(nfo\\)?\\)?\\|emacs\\)$")
-  "*Regular expresson matching files we know how to expand.")
+(defvar speedbar-file-regexp
+  (speedbar-extension-list-to-regex speedbar-supported-extension-expressions)
+  "Regular expression matching files we know how to expand.
+Created from `speedbar-supported-extension-expression' with the
+function `speedbar-extension-list-to-regex'")
+
+(defun speedbar-add-supported-extension (extension)
+  "Add EXTENSION as a new supported extension for speedbar tagging.
+This should start with a `.' if it is not a complete file name, and
+the dot should NOT be quoted in with \\.  Other regular expression
+matchers are allowed however.  EXTENSION may be a single string or a
+list of strings."
+  (if (not (listp extension)) (setq extension (list extension)))
+  (while extension
+    (if (member (car extension) speedbar-supported-extension-expressions)
+	nil
+      (setq speedbar-supported-extension-expressions
+	    (cons (car extension) speedbar-supported-extension-expressions)))
+    (setq extension (cdr extension)))
+  (setq speedbar-file-regexp (speedbar-extension-list-to-regex
+			      speedbar-supported-extension-expressions)))
+
+(defun speedbar-add-ignored-path-regexp (path-expression)
+  "Add PATH-EXPRESSION as a new ignored path for speedbar tracking.
+This function will modify `speedbar-ignored-path-regexp' and add
+PATH-EXPRESSION to `speedbar-ignored-path-expressions'."
+  (if (not (listp path-expression))
+      (setq path-expression (list path-expression)))
+  (while path-expression
+    (if (member (car path-expression) speedbar-ignored-path-expressions)
+	nil
+      (setq speedbar-ignored-path-expressions
+	    (cons (car path-expression) speedbar-ignored-path-expressions)))
+    (setq path-expression (cdr path-expression)))
+  (setq speedbar-ignored-path-regexp (speedbar-extension-list-to-regex
+				      speedbar-ignored-path-expressions)))
+
+(defvar speedbar-update-flag (or (not (fboundp 'run-with-idle-timer))
+			       (not (fboundp 'start-itimer)))
+  "*Non-nil means to automatically update the display.
+When this is nil then speedbar will not follow the attached frame's path.
+When speedbar is active, use:
+
+\\<speedbar-key-map> `\\[speedbar-toggle-updates]'
+
+to toggle this value.")
 
 (defvar speedbar-syntax-table nil
-  "Syntax-table used on the speedbar")
+  "Syntax-table used on the speedbar.")
 
 (if speedbar-syntax-table
     nil
@@ -225,100 +495,193 @@
   (modify-syntax-entry ?) " " speedbar-syntax-table)
   (modify-syntax-entry ?[ " " speedbar-syntax-table)
   (modify-syntax-entry ?] " " speedbar-syntax-table))
- 
+
 
 (defvar speedbar-key-map nil
   "Keymap used in speedbar buffer.")
-(defvar speedbar-menu-map nil
-  "Keymap used in speedbar menu buffer.")
+
+(autoload 'speedbar-configure-options "speedbcfg" "Configure speedbar variables" t)
+(autoload 'speedbar-configure-faces "speedbcfg" "Configure speedbar faces" t)
 
 (if speedbar-key-map
     nil
   (setq speedbar-key-map (make-keymap))
   (suppress-keymap speedbar-key-map t)
 
+  ;; control
   (define-key speedbar-key-map "e" 'speedbar-edit-line)
+  (define-key speedbar-key-map "\C-m" 'speedbar-edit-line)
   (define-key speedbar-key-map "+" 'speedbar-expand-line)
   (define-key speedbar-key-map "-" 'speedbar-contract-line)
+  (define-key speedbar-key-map "g" 'speedbar-refresh)
+  (define-key speedbar-key-map "t" 'speedbar-toggle-updates)
+  (define-key speedbar-key-map "q" 'speedbar-close-frame)
+  (define-key speedbar-key-map "U" 'speedbar-up-directory)
+
+  ;; navigation
+  (define-key speedbar-key-map "n" 'speedbar-next)
+  (define-key speedbar-key-map "p" 'speedbar-prev)
+  (define-key speedbar-key-map " " 'speedbar-scroll-up)
+  (define-key speedbar-key-map "\C-?" 'speedbar-scroll-down)
+
+  ;; After much use, I suddenly desired in my heart to perform dired
+  ;; style operations since the directory was RIGHT THERE!
+  (define-key speedbar-key-map "I" 'speedbar-item-info)
+  (define-key speedbar-key-map "B" 'speedbar-item-byte-compile)
+  (define-key speedbar-key-map "L" 'speedbar-item-load)
+  (define-key speedbar-key-map "C" 'speedbar-item-copy)
+  (define-key speedbar-key-map "D" 'speedbar-item-delete)
+  (define-key speedbar-key-map "R" 'speedbar-item-rename)
 
   (if (string-match "XEmacs" emacs-version)
       (progn
 	;; bind mouse bindings so we can manipulate the items on each line
 	(define-key speedbar-key-map 'button2 'speedbar-click)
+	(define-key speedbar-key-map '(shift button2) 'speedbar-power-click)
+	(define-key speedbar-key-map '(meta button3) 'speedbar-mouse-item-info)
 
-	;; Xemacs users.  You probably want your own toolbar for
-	;; the speedbar frame or mode or whatever.  Make some buttons
-	;; and mail me how to do it!
-	;; Also, how do you disable all those menu items?  Email me that too
-	;; as it would be most helpful.
+	;; Setup XEmacs Menubar w/ etags specific items
+	(defvar speedbar-menu
+	  '("Speed Bar"
+	    ["Run Speedbar" (speedbar-frame-mode 1) t]
+	    ["Refresh" speedbar-refresh t]
+	    ["Allow Auto Updates"
+	     speedbar-toggle-updates
+	     :style toggle
+	     :selected speedbar-update-flag]
+	    "-----"
+	    ["Sort etags in Speedbar"
+	     (speedbar-toggle-etags "sort")
+	     :style toggle
+	     :selected speedbar-sort-tags]
+	    ["Show unknown files"
+	     (speedbar-toggle-etags "show")
+	     :style toggle
+	     :selected speedbar-show-unknown-files]
+	    "-----"
+	    ["Use C++ Tagging"
+	     (speedbar-toggle-etags "-C")
+	     :style toggle
+	     :selected (member "-C" speedbar-fetch-etags-arguments)]
+	    ["Tag preprocessor defs"
+	     (speedbar-toggle-etags "-D")
+	     :style toggle
+	     :selected (not (member "-D" speedbar-fetch-etags-arguments))]
+	    ["Use indentation"
+	     (speedbar-toggle-etags "-S")
+	     :style toggle
+	     :selected (not (member "-S" speedbar-fetch-etags-arguments))]))
+
+	(add-submenu '("Tools") speedbar-menu nil)
+
 	)
     ;; bind mouse bindings so we can manipulate the items on each line
     (define-key speedbar-key-map [mouse-2] 'speedbar-click)
-    (define-key speedbar-key-map [down-mouse-2] 'speedbar-quick-mouse)
-
-    ;; this was meant to do a rescan or something
-    ;;(define-key speedbar-key-map [shift-mouse-2] 'speedbar-hard-click)
+    ;; This is the power click for poping up new frames
+    (define-key speedbar-key-map [S-mouse-2] 'speedbar-power-click)
+    ;; This adds a small unecessary visual effect
+    ;;(define-key speedbar-key-map [down-mouse-2] 'speedbar-quick-mouse)
+    (define-key speedbar-key-map [M-mouse-2] 'speedbar-mouse-item-info)
 
     ;; disable all menus - we don't have a lot of space to play with
-    ;; in such a skinny frame.
-    (define-key speedbar-key-map [menu-bar buffer] 'undefined)
-    (define-key speedbar-key-map [menu-bar files] 'undefined)
-    (define-key speedbar-key-map [menu-bar tools] 'undefined)
-    (define-key speedbar-key-map [menu-bar edit] 'undefined)
-    (define-key speedbar-key-map [menu-bar search] 'undefined)
-    (define-key speedbar-key-map [menu-bar help-menu] 'undefined)
+    ;; in such a skinny frame.  This will cleverly find and nuke some
+    ;; user-defined menus as well if they are there.  Too bad it
+    ;; rely's on the structure of a keymap to work.
+    (let ((k (lookup-key global-map [menu-bar])))
+      (while k
+	(if (and (listp (car k)) (listp (cdr (car k))))
+	    (define-key speedbar-key-map (vector 'menu-bar (car (car k)))
+	      'undefined))
+	(setq k (cdr k))))
 
     ;; This lets the user scroll as if we had a scrollbar... well maybe not
     (define-key speedbar-key-map [mode-line mouse-2] 'speedbar-mouse-hscroll)
-
-    ;; Create a menu for speedbar
-    (setq speedbar-menu-map (make-sparse-keymap))
-    (define-key speedbar-key-map [menu-bar speedbar] 
-      (cons "Speedbar" speedbar-menu-map))
-    (define-key speedbar-menu-map [close] 
-      (cons "Close" 'speedbar-close-frame))
-    (define-key speedbar-menu-map [clonfigure] 
-      (cons "Configure Faces" 'speedbar-configure-faces))
-    (define-key speedbar-menu-map [configopt] 
-      (cons "Configure Options" 'speedbar-configure-options))
-    (define-key speedbar-menu-map [Update] 
-      (cons "Update" 'speedbar-update-contents))
     ))
 
-(put 'speedbar-configure-faces 'menu-enable '(featurep 'dialog))
-(put 'speedbar-configure-options 'menu-enable '(featurep 'dialog))
+(defvar speedbar-easymenu-definition-base
+  '("Speedbar"
+    ["Update" speedbar-refresh t]
+    ["Auto Update" speedbar-toggle-updates
+     :style toggle :selected speedbar-update-flag]
+    )
+  "Base part of the speedbar menu.")
+
+(defvar speedbar-easymenu-definition-special
+  '(["Edit Item On Line" speedbar-edit-line t]
+    ["Show All Files" speedbar-toggle-show-all-files
+     :style toggle :selected speedbar-show-unknown-files]
+    ["Expand Item" speedbar-expand-line
+     (save-excursion (beginning-of-line)
+		     (looking-at "[0-9]+: *.\\+. "))]
+    ["Contract Item" speedbar-contract-line
+     (save-excursion (beginning-of-line)
+		     (looking-at "[0-9]+: *.-. "))]
+    "----"
+    ["Item Information" speedbar-item-info t]
+    ["Load Lisp File" speedbar-item-load
+     (save-excursion
+       (beginning-of-line)
+       (looking-at "[0-9]+: *\\[[+-]\\] .+\\(\\.el\\)\\( \\*\\)?$"))]
+    ["Byte Compile File" speedbar-item-byte-compile
+     (save-excursion
+       (beginning-of-line)
+       (looking-at "[0-9]+: *\\[[+-]\\] .+\\(\\.el\\)\\( \\*\\)?$"))]
+    ["Copy Item" speedbar-item-copy
+     (save-excursion (beginning-of-line) (looking-at "[0-9]+: *\\["))]
+    ["Rename Item" speedbar-item-rename
+     (save-excursion (beginning-of-line) (looking-at "[0-9]+: *[[<]"))]
+    ["Delete Item" speedbar-item-delete
+     (save-excursion (beginning-of-line) (looking-at "[0-9]+: *[[<]"))])
+  "Additional menu items while in file-mode.")
+ 
+(defvar speedbar-easymenu-definition-trailer
+  '("----"
+    ["Close" speedbar-close-frame t])
+  "Menu items appearing at the end of the speedbar menu.")
 
 (defvar speedbar-buffer nil
   "The buffer displaying the speedbar.")
 (defvar speedbar-frame nil
   "The frame displaying speedbar.")
+(defvar speedbar-cached-frame nil
+  "The frame that was last created, then removed from the display.")
+(defvar speedbar-full-text-cache nil
+  "The last open directory is saved in it's entirety for ultra-fast switching.")
 (defvar speedbar-timer nil
   "The speedbar timer used for updating the buffer.")
 (defvar speedbar-attached-frame nil
-  "The frame which started speedbar mode.  This is the frame from
-which all data displayed in the speedbar is gathered, and in which files
-and such are displayed.")
+  "The frame which started speedbar mode.
+This is the frame from which all data displayed in the speedbar is
+gathered, and in which files and such are displayed.")
 
 (defvar speedbar-last-selected-file nil
-  "The last file which was selected in speedbar buffer")
+  "The last file which was selected in speedbar buffer.")
 
 (defvar speedbar-shown-directories nil
-  "Used to maintain list of directories simultaneously open in the current
-speedbar.")
+  "Maintain list of directories simultaneously open in the current speedbar.")
+
+(defvar speedbar-directory-contents-alist nil
+  "An association list of directories and their contents.
+Each sublist was returned by `speedbar-file-lists'.  This list is
+maintained to speed up the refresh rate when switching between
+directories.")
+
+(defvar speedbar-power-click nil
+  "Never set this by hand.  Value is t when S-mouse activity occurs.")
 
 
-;;;
 ;;; Mode definitions/ user commands
-;;;
-;;;###autoload
+;;
+;;###autoload
+(defalias 'speedbar 'speedbar-frame-mode)
 (defun speedbar-frame-mode (&optional arg)
-  "Enable or disable use of a speedbar.  Positive number means turn
-on, negative turns speedbar off, and nil means toggle.  Once the
-speedbar frame is activated, a buffer in `speedbar-mode' will be
-displayed.  Currently, only one speedbar is supported at a time."
+  "Enable or disable speedbar.  Positive ARG means turn on, negative turn off.
+nil means toggle.  Once the speedbar frame is activated, a buffer in
+`speedbar-mode' will be displayed.  Currently, only one speedbar is
+supported at a time."
   (interactive "P")
   (if (not window-system)
-      (error "Speedbar is not useful outside of a windowing environement"))
+      (error "Speedbar is not useful outside of a windowing environment"))
   ;; toggle frame on and off.
   (if (not arg) (if speedbar-frame (setq arg -1) (setq arg 1)))
   ;; turn the frame off on neg number
@@ -326,63 +689,88 @@
       (progn
 	(run-hooks 'speedbar-before-delete-hook)
 	(if (and speedbar-frame (frame-live-p speedbar-frame))
-	    (delete-frame speedbar-frame))
-	(speedbar-set-timer nil)
+	    (if speedbar-xemacsp
+		(delete-frame speedbar-frame)
+	      (setq speedbar-cached-frame speedbar-frame)
+	      (modify-frame-parameters speedbar-frame '((visibility . nil)))))
 	(setq speedbar-frame nil)
-	(if (bufferp speedbar-buffer)
-	    (kill-buffer speedbar-buffer)))
+	(speedbar-set-timer nil)
+	;; Used to delete the buffer.  This has the annoying affect of
+	;; preventing whatever took it's place from ever appearing
+	;; as the default after a C-x b was typed
+	;;(if (bufferp speedbar-buffer)
+	;;    (kill-buffer speedbar-buffer))
+	)
     ;; Set this as our currently attached frame
     (setq speedbar-attached-frame (selected-frame))
-    ;; Get the buffer to play with
-    (speedbar-mode)
     ;; Get the frame to work in
-    (if (and speedbar-frame (frame-live-p speedbar-frame))
-	(raise-frame speedbar-frame)
-      (let ((params (list 
-		     ;; Xemacs fails to delete speedbar
-		     ;; if minibuffer is off.
-		     ;; JTL <<<< Seems to be OK for 19.15.
-		     ;; removed  tool- & menubar.
-		     ;; <<<< JTL
-		     (cons 'minibuffer  nil)
-		     (cons 'width speedbar-width)
-		     (cons 'height (frame-height))
-		     (cons 'scroll-bar-width speedbar-scrollbar-width)
-		     (cons 'auto-raise speedbar-raise-lower)
-		     (cons 'auto-lower speedbar-raise-lower)
-		     '(modeline . nil)
-		     '(border-width . 0)
-		     '(unsplittable . t)
-		     '(default-toolbar-visible-p . nil)
-		     '(menubar-visible-p . nil))))
-	(setq speedbar-frame
-	      (if (< emacs-minor-version 35)
-		  (make-frame params)
-		(let ((x-pointer-shape x-pointer-top-left-arrow)
-		      (x-sensitive-text-pointer-shape x-pointer-hand2))
-		  (make-frame params)))))
-      ;; reset the selection variable
-      (setq speedbar-last-selected-file nil)
-      ;; Put the buffer into the frame
-      (save-window-excursion
-	(select-frame speedbar-frame)
-	(switch-to-buffer speedbar-buffer)
-	(setq default-minibuffer-frame speedbar-attached-frame))
-      (speedbar-set-timer speedbar-update-speed)
-      )))
+    (if (frame-live-p speedbar-cached-frame)
+	(progn
+	  (setq speedbar-frame speedbar-cached-frame)
+	  (modify-frame-parameters speedbar-frame '((visibility . t)))
+	  ;; Get the buffer to play with
+	  (speedbar-mode)
+	  (select-frame speedbar-frame)
+	  (if (not (eq (current-buffer) speedbar-buffer))
+	      (switch-to-buffer speedbar-buffer))
+	  (set-window-dedicated-p (selected-window) t)
+	  (raise-frame speedbar-frame)
+	  (speedbar-set-timer speedbar-update-speed)
+	  )
+      (if (frame-live-p speedbar-frame)
+	  (raise-frame speedbar-frame)
+	(let ((params (cons (cons 'height (frame-height))
+			    speedbar-frame-parameters)))
+	  (setq speedbar-frame
+		(if (< emacs-major-version 20) ;a bug is fixed in v20 & later
+		    (make-frame params)
+		  (let ((x-pointer-shape x-pointer-top-left-arrow)
+			(x-sensitive-text-pointer-shape x-pointer-hand2))
+		    (make-frame params)))))
+	;; reset the selection variable
+	(setq speedbar-last-selected-file nil)
+	;; Put the buffer into the frame
+	(save-window-excursion
+	  ;; Get the buffer to play with
+	  (speedbar-mode)
+	  (select-frame speedbar-frame)
+	  (switch-to-buffer speedbar-buffer)
+	  (set-window-dedicated-p (selected-window) t)
+	  ;; Turn off toolbar and menubar under XEmacs
+	  (if speedbar-xemacsp
+	      (progn
+		(set-specifier default-toolbar-visible-p
+			       (cons (selected-frame) nil))
+		;; These lines make the menu-bar go away nicely, but
+		;; they also cause xemacs much heartache.
+		;;(set-specifier menubar-visible-p (cons (selected-frame) nil))
+		;;(make-local-variable 'current-menubar)
+		;;(setq current-menubar speedbar-menu)
+		;;(add-submenu nil speedbar-menu nil)
+		)))
+	(speedbar-set-timer speedbar-update-speed)
+	))))
 
 (defun speedbar-close-frame ()
-  "Turn off speedbar mode"
+  "Turn off a currently active speedbar."
   (interactive)
-  (speedbar-frame-mode -1))
+  (speedbar-frame-mode -1)
+  (select-frame speedbar-attached-frame)
+  (other-frame 0))
+
+(defun speedbar-frame-width ()
+  "Return the width of the speedbar frame in characters.
+nil if it doesn't exist."
+  (and speedbar-frame (cdr (assoc 'width (frame-parameters speedbar-frame)))))
 
 (defun speedbar-mode ()
-  "Create and return a SPEEDBAR buffer.  The speedbar buffer allows
-the user to manage a list of directories and paths at different
-depths.  The first line represents the default path of the speedbar
-frame.  Each directory segment is a button which jumps speedbar's
-default directory to that path.  Buttons are activated by clicking
-mouse-2.
+  "Major mode for managing a display of directories and tags.
+\\<speedbar-key-map>
+The first line represents the default path of the speedbar frame.
+Each directory segment is a button which jumps speedbar's default
+directory to that path.  Buttons are activated by clicking `\\[speedbar-click]'.
+In some situations using `\\[speedbar-power-click]' is a `power click' which will
+rescan cached items, or pop up new frames.
 
 Each line starting with <+> represents a directory.  Click on the <+>
 to insert the directory listing into the current tree.  Click on the
@@ -395,39 +783,119 @@
 Files are completely ignored if they match `speedbar-file-unshown-regexp'
 which is generated from `completion-ignored-extensions'.
 
+Files with a `*' character after their name are files checked out of a
+version control system.  (currently only RCS is supported.)  New
+version control systems can be added by examining the documentation
+for `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p'
+
 Click on the [+] to display a list of tags from that file.  Click on
 the [-] to retract the list.  Click on the file name to edit the file
 in the attached frame.
 
 If you open tags, you might find a node starting with {+}, which is a
-category of tags.  Click the {+} to expand the category.  Jumpable
+category of tags.  Click the {+} to expand the category.  Jump-able
 tags start with >.  Click the name of the tag to go to that position
 in the selected file.
 
-Keybindings: \\<speedbar-key-map>
-\\[speedbar-click]  Activate the button under the mouse.
-\\[speedbar-edit-line]        Edit the file/directory on this line.  Same as clicking 
-           on the name on the selected line.)
-\\[speedbar-expand-line]        Expand the current line.  Same as clicking on the + on a line.
-\\[speedbar-contract-line]        Contract the current line.  Same as clicking on the - on a line."
-  (setq speedbar-buffer (set-buffer (get-buffer-create "SPEEDBAR")))
-  (kill-all-local-variables)
-  (setq major-mode 'speedbar-mode)
-  (setq mode-name "SB")
-  (use-local-map speedbar-key-map)
-  (set-syntax-table speedbar-syntax-table)
-  (setq mode-line-format
-	'("<< SPEEDBAR " (line-number-mode " %3l ") " >>"))
-  (setq font-lock-keywords nil) ;; no font-locking please
-  (setq truncate-lines t)
-  (if (not speedbar-xemacsp) (setq auto-show-mode nil))	;no auto-show for FSF
-  (run-hooks 'speedbar-mode-hook)
+\\{speedbar-key-map}"
+  ;; NOT interactive
+  (save-excursion
+    (setq speedbar-buffer (set-buffer (get-buffer-create " SPEEDBAR")))
+    (kill-all-local-variables)
+    (setq major-mode 'speedbar-mode)
+    (setq mode-name "Speedbar")
+    (use-local-map speedbar-key-map)
+    (set-syntax-table speedbar-syntax-table)
+    (setq font-lock-keywords nil) ;; no font-locking please
+    (setq truncate-lines t)
+    (make-local-variable 'frame-title-format)
+    (setq frame-title-format "Speedbar")
+    ;; Set this up special just for the speedbar buffer
+    (if (null default-minibuffer-frame)
+	(progn
+	  (make-local-variable 'default-minibuffer-frame)
+	  (setq default-minibuffer-frame speedbar-attached-frame)))
+    (make-local-variable 'temp-buffer-show-function)
+    (setq temp-buffer-show-function 'speedbar-temp-buffer-show-function)
+    (setq kill-buffer-hook '(lambda () (let ((skilling (boundp 'skilling)))
+					 (if skilling
+					     nil
+					   (if (eq (current-buffer)
+						   speedbar-buffer)
+					       (speedbar-frame-mode -1))))))
+    (speedbar-set-mode-line-format)
+    (if (not speedbar-xemacsp)
+	(setq auto-show-mode nil))	;no auto-show for Emacs
+    (run-hooks 'speedbar-mode-hook))
   (speedbar-update-contents)
-  )
+  speedbar-buffer)
+
+(defun speedbar-set-mode-line-format ()
+  "Set the format of the mode line based on the current speedbar environment.
+This gives visual indications of what is up.  It EXPECTS the speedbar
+frame and window to be the currently active frame and window."
+  (if (frame-live-p speedbar-frame)
+      (save-excursion
+	(set-buffer speedbar-buffer)
+	(let* ((w (or (speedbar-frame-width) 20))
+	       (p1 "<<")
+	       (p5 ">>")
+	       (p3 (if speedbar-update-flag "SPEEDBAR" "SLOWBAR"))
+	       (blank (- w (length p1) (length p3) (length p5)
+			 (if line-number-mode 4 0)))
+	       (p2 (if (> blank 0)
+		       (make-string (/ blank 2) ? )
+		     ""))
+	       (p4 (if (> blank 0)
+		       (make-string (+ (/ blank 2) (% blank 2)) ? )
+		     ""))
+	       (tf
+		(if line-number-mode
+		    (list (concat p1 p2 p3) '(line-number-mode " %3l")
+			  (concat p4 p5))
+		  (list (concat p1 p2 p3 p4 p5)))))
+	  (if (not (equal mode-line-format tf))
+	      (progn
+		(setq mode-line-format tf)
+		(force-mode-line-update)))))))
 
+(defun speedbar-temp-buffer-show-function (buffer)
+  "Placed in the variable `temp-buffer-show-function' in `speedbar-mode'.
+If a user requests help using \\[help-command] <Key> the temp BUFFER will be
+redirected into a window on the attached frame."
+  (if speedbar-attached-frame (select-frame speedbar-attached-frame))
+  (pop-to-buffer buffer nil)
+  (other-window -1)
+  (run-hooks 'temp-buffer-show-hook))
+
+(defun speedbar-reconfigure-menubar ()
+  "Reconfigure the menu-bar in a speedbar frame.
+Different menu items are displayed depending on the current display mode
+and the existence of packages."
+  (let ((km (make-sparse-keymap))
+	(cf (selected-frame))
+	(md (append speedbar-easymenu-definition-base
+		    (if speedbar-shown-directories
+			;; file display mode version
+			speedbar-easymenu-definition-special
+		      (save-excursion
+			(select-frame speedbar-attached-frame)
+			(if (local-variable-p
+			     'speedbar-easymenu-definition-special)
+			    ;; If bound locally, we can use it
+			    speedbar-easymenu-definition-special)))
+		    ;; The trailer
+		    speedbar-easymenu-definition-trailer)))
+    (easy-menu-define speedbar-menu-map speedbar-key-map "Speedbar menu" md)
+    (if speedbar-xemacsp (set-buffer-menubar (list km)))))
+
+
+;;; User Input stuff
+;;
 (defun speedbar-mouse-hscroll (e)
-  "Read a mouse event from the mode line, and horizontally scroll if the
-mouse is being clicked on the far left, or far right of the modeline."
+  "Read a mouse event E from the mode line, and horizontally scroll.
+If the mouse is being clicked on the far left, or far right of the
+mode-line.  This is only useful for non-XEmacs"
   (interactive "e")
   (let* ((xp (car (nth 2 (car (cdr e)))))
 	 (cpw (/ (frame-pixel-width)
@@ -442,17 +910,234 @@
     ;;(message "X: Pixel %d Char Pixels %d On char %d" xp cpw oc)
     ))
 
+(defun speedbar-get-focus ()
+  "Change frame focus to or from the speedbar frame.
+If the selected frame is not speedbar, then speedbar frame is
+selected.  If the speedbar frame is active, then select the attached frame."
+  (interactive)
+  (if (eq (selected-frame) speedbar-frame)
+      (if (frame-live-p speedbar-attached-frame)
+	  (select-frame speedbar-attached-frame))
+    ;; make sure we have a frame
+    (if (not (frame-live-p speedbar-frame)) (speedbar-frame-mode 1))
+    ;; go there
+    (select-frame speedbar-frame))
+  (other-frame 0))
+
+(defun speedbar-next (arg)
+  "Move to the next ARGth line in a speedbar buffer."
+  (interactive "p")
+  (forward-line (or arg 1))
+  (speedbar-item-info)
+  (speedbar-position-cursor-on-line))
+
+(defun speedbar-prev (arg)
+  "Move to the previous ARGth line in a speedbar buffer."
+  (interactive "p")
+  (speedbar-next (if arg (- arg) -1)))
+
+(defun speedbar-scroll-up (&optional arg)
+  "Page down one screen-full of the speedbar, or ARG lines."
+  (interactive "P")
+  (scroll-up arg)
+  (speedbar-position-cursor-on-line))
+
+(defun speedbar-scroll-down (&optional arg)
+  "Page up one screen-full of the speedbar, or ARG lines."
+  (interactive "P")
+  (scroll-down arg)
+  (speedbar-position-cursor-on-line))
+
+(defun speedbar-up-directory ()
+  "Keyboard accelerator for moving the default directory up one.
+Assumes that the current buffer is the speedbar buffer"
+  (interactive)
+  (setq default-directory (expand-file-name (concat default-directory "../")))
+  (speedbar-update-contents))
 
-;;;
+;;; Speedbar file activity
+;;
+(defun speedbar-refresh ()
+  "Refresh the current speedbar display, disposing of any cached data."
+  (interactive)
+  (let ((dl speedbar-shown-directories))
+    (while dl
+      (adelete 'speedbar-directory-contents-alist (car dl))
+      (setq dl (cdr dl))))
+  (if (<= 1 speedbar-verbosity-level) (message "Refreshing speedbar..."))
+  (speedbar-update-contents)
+  (speedbar-stealthy-updates)
+  ;; Reset the timer in case it got really hosed for some reason...
+  (speedbar-set-timer speedbar-update-speed)
+  (if (<= 1 speedbar-verbosity-level) (message "Refreshing speedbar...done")))
+
+(defun speedbar-item-load ()
+  "Byte compile the item under the cursor or mouse if it is a lisp file."
+  (interactive)
+  (let ((f (speedbar-line-file)))
+    (if (and (file-exists-p f) (string-match "\\.el$" f))
+	(if (and (file-exists-p (concat f "c"))
+		 (y-or-n-p (format "Load %sc? " f)))
+	    ;; If the compiled version exists, load that instead...
+	    (load-file (concat f "c"))
+	  (load-file f))
+      (error "Not a loadable file..."))))
+
+(defun speedbar-item-byte-compile ()
+  "Byte compile the item under the cursor or mouse if it is a lisp file."
+  (interactive)
+  (let ((f (speedbar-line-file))
+	(sf (selected-frame)))
+    (if (and (file-exists-p f) (string-match "\\.el$" f))
+	(progn
+	  (select-frame speedbar-attached-frame)
+	  (byte-compile-file f nil)
+	  (select-frame sf)))
+    ))
+
+(defun speedbar-mouse-item-info (event)
+  "Provide information about what the user clicked on.
+This should be bound to a mouse EVENT."
+  (interactive "e")
+  (mouse-set-point event)
+  (speedbar-item-info))
+
+(defun speedbar-item-info ()
+  "Display info in the mini-buffer about the button the mouse is over."
+  (interactive)
+  (if (not speedbar-shown-directories)
+      nil
+    (let* ((item (speedbar-line-file))
+	   (attr (if item (file-attributes item) nil)))
+      (if item (message "%s %d %s" (nth 8 attr) (nth 7 attr) item)
+	(save-excursion
+	  (beginning-of-line)
+	  (looking-at "\\([0-9]+\\):")
+	  (setq item (speedbar-line-path (string-to-int (match-string 1))))
+	  (if (re-search-forward "> \\([^ ]+\\)$"
+				 (save-excursion(end-of-line)(point)) t)
+	      (progn
+		(setq attr (get-text-property (match-beginning 1)
+					      'speedbar-token))
+		(message "Tag %s in %s at position %s"
+			 (match-string 1) item (if attr attr 0)))
+	    (message "No special info for this line.")))
+	))))
+
+(defun speedbar-item-copy ()
+  "Copy the item under the cursor.
+Files can be copied to new names or places."
+  (interactive)
+  (let ((f (speedbar-line-file)))
+    (if (not f)	(error "Not a file."))
+    (if (file-directory-p f)
+	(error "Cannot copy directory.")
+      (let* ((rt (read-file-name (format "Copy %s to: "
+					 (file-name-nondirectory f))
+				 (file-name-directory f)))
+	     (refresh (member (expand-file-name (file-name-directory rt))
+			      speedbar-shown-directories)))
+	;; Create the right file name part
+	(if (file-directory-p rt)
+	    (setq rt
+		  (concat (expand-file-name rt)
+			  (if (string-match "/$" rt) "" "/")
+			  (file-name-nondirectory f))))
+	(if (or (not (file-exists-p rt))
+		(y-or-n-p (format "Overwrite %s with %s? " rt f)))
+	    (progn
+	      (copy-file f rt t t)
+	      ;; refresh display if the new place is currently displayed.
+	      (if refresh
+		  (progn
+		    (speedbar-refresh)
+		    (if (not (speedbar-goto-this-file rt))
+			(speedbar-goto-this-file f))))
+	      ))))))
+
+(defun speedbar-item-rename ()
+  "Rename the item under the cursor or mouse.
+Files can be renamed to new names or moved to new directories."
+  (interactive)
+  (let ((f (speedbar-line-file)))
+    (if f
+	(let* ((rt (read-file-name (format "Rename %s to: "
+					   (file-name-nondirectory f))
+				   (file-name-directory f)))
+	       (refresh (member (expand-file-name (file-name-directory rt))
+				speedbar-shown-directories)))
+	  ;; Create the right file name part
+	  (if (file-directory-p rt)
+	      (setq rt
+		    (concat (expand-file-name rt)
+			    (if (string-match "/$" rt) "" "/")
+			    (file-name-nondirectory f))))
+	  (if (or (not (file-exists-p rt))
+		  (y-or-n-p (format "Overwrite %s with %s? " rt f)))
+	      (progn
+		(rename-file f rt t)
+		;; refresh display if the new place is currently displayed.
+		(if refresh
+		    (progn
+		      (speedbar-refresh)
+		      (speedbar-goto-this-file rt)
+		      )))))
+      (error "Not a file."))))
+
+(defun speedbar-item-delete ()
+  "Delete the item under the cursor.  Files are removed from disk."
+  (interactive)
+  (let ((f (speedbar-line-file)))
+    (if (not f) (error "Not a file."))
+    (if (y-or-n-p (format "Delete %s? " f))
+	(progn
+	  (if (file-directory-p f)
+	      (delete-directory f)
+	    (delete-file f))
+	  (message "Okie dokie..")
+	  (let ((p (point)))
+	    (speedbar-refresh)
+	    (goto-char p))
+	  ))
+    ))
+
+(defun speedbar-enable-update ()
+  "Enable automatic updating in speedbar via timers."
+  (interactive)
+  (setq speedbar-update-flag t)
+  (speedbar-set-mode-line-format)
+  (speedbar-set-timer speedbar-update-speed))
+
+(defun speedbar-disable-update ()
+  "Disable automatic updating and stop consuming resources."
+  (interactive)
+  (setq speedbar-update-flag nil)
+  (speedbar-set-mode-line-format)
+  (speedbar-set-timer nil))
+
+(defun speedbar-toggle-updates ()
+  "Toggle automatic update for the speedbar frame."
+  (interactive)
+  (if speedbar-update-flag
+      (speedbar-disable-update)
+    (speedbar-enable-update)))
+
+(defun speedbar-toggle-show-all-files ()
+  "Toggle display of files speedbar can not tag."
+  (interactive)
+  (setq speedbar-show-unknown-files (not speedbar-show-unknown-files))
+  (speedbar-refresh))
+
 ;;; Utility functions
-;;;
+;;
 (defun speedbar-set-timer (timeout)
-  "Unset an old timer (if there is one) and activate a new timer with the
-given timeout value."
-  (cond 
+  "Unset an old timer (if there is one) and activate a new timer with TIMEOUT.
+TIMEOUT is the number of seconds until the speedbar timer is called
+again."
+  (cond
    ;; Xemacs
    (speedbar-xemacsp
-    (if speedbar-timer 
+    (if speedbar-timer
 	(progn (delete-itimer speedbar-timer)
 	       (setq speedbar-timer nil)))
     (if timeout
@@ -460,19 +1145,24 @@
 					   'speedbar-timer-fn
 					   timeout
 					   nil))))
-   ;; GNU emacs
-   (t
-    (if speedbar-timer 
+   ;; Post 19.31 Emacs
+   ((fboundp 'run-with-idle-timer)
+    (if speedbar-timer
 	(progn (cancel-timer speedbar-timer)
 	       (setq speedbar-timer nil)))
     (if timeout
-	(setq speedbar-timer 
+	(setq speedbar-timer
 	      (run-with-idle-timer timeout nil 'speedbar-timer-fn))))
-   ))
+   ;; Older or other Emacsen with no timers.  Set up so that it's
+   ;; obvious this emacs can't handle the updates
+   (t
+    (setq speedbar-update-flag nil)))
+   ;; change this if it changed for some reason
+  (speedbar-set-mode-line-format))
 
 (defmacro speedbar-with-writable (&rest forms)
-  "Allow the buffer to be writable and evaluate forms.  Turn read-only back
-on when done."
+  "Allow the buffer to be writable and evaluate FORMS.
+Turn read only back on when done."
   (list 'let '((speedbar-with-writable-buff (current-buffer)))
 	'(toggle-read-only -1)
 	(cons 'progn forms)
@@ -480,37 +1170,99 @@
 			 (toggle-read-only 1))))
 (put 'speedbar-with-writable 'lisp-indent-function 0)
 
+(defun speedbar-select-window (buffer)
+  "Select a window in which BUFFER is show.
+If it is not shown, force it to appear in the default window."
+  (let ((win (get-buffer-window buffer speedbar-attached-frame)))
+    (if win
+	(select-window win)
+      (show-buffer (selected-window) buffer))))
+
+(defmacro speedbar-with-attached-buffer (&rest forms)
+  "Execute FORMS in the attached frame's special buffer.
+Optionally select that frame if necessary."
+  ;; Reset the timer with a new timeout when cliking a file
+  ;; in case the user was navigating directories, we can cancel
+  ;; that other timer.
+  (list
+   'progn
+   '(speedbar-set-timer speedbar-update-speed)
+   (list
+    'let '((cf (selected-frame)))
+    '(select-frame speedbar-attached-frame)
+    '(speedbar-select-window speedbar-desired-buffer)
+    (cons 'progn forms)
+    '(select-frame cf)
+    '(speedbar-maybee-jump-to-attached-frame)
+    )))
+
+(defun speedbar-insert-button (text face mouse function
+				    &optional token prevline)
+  "Insert TEXT as the next logical speedbar button.
+FACE is the face to put on the button, MOUSE is the highlight face to use.
+When the user clicks on TEXT, FUNCTION is called with the TOKEN parameter.
+This function assumes that the current buffer is the speedbar buffer.
+If PREVLINE, then put this button on the previous line.
+
+This is a convenience function for special mode that create their own
+specialized speedbar displays."
+  (goto-char (point-max))
+  (if (/= (current-column) 0) (insert "\n"))
+  (if prevline (progn (delete-char -1) (insert " "))) ;back up if desired...
+  (let ((start (point)))
+    (insert text)
+    (speedbar-make-button start (point) face mouse function token))
+  (let ((start (point)))
+    (insert "\n")
+    (put-text-property start (point) 'face nil)
+    (put-text-property start (point) 'mouse-face nil)))
+
 (defun speedbar-make-button (start end face mouse function &optional token)
-  "Create a button from START to END, with FACE as the display face
-and MOUSE and the mouse face.  When this button is clicked on FUNCTION
-will be run with the token parameter of TOKEN (any lisp object)"
+  "Create a button from START to END, with FACE as the display face.
+MOUSE is the mouse face.  When this button is clicked on FUNCTION
+will be run with the TOKEN parameter (any lisp object)"
   (put-text-property start end 'face face)
   (put-text-property start end 'mouse-face mouse)
   (put-text-property start end 'invisible nil)
   (if function (put-text-property start end 'speedbar-function function))
   (if token (put-text-property start end 'speedbar-token token))
   )
-
+
+;;; File button management
+;;
 (defun speedbar-file-lists (directory)
-  "Create file lists for DIRECTORY.  The car is the list of
-directories, the cdr is list of files not matching ignored headers."
-  (let ((default-directory directory)
-	(dir (directory-files directory nil))
-	(dirs nil)
-	(files nil))
-    (while dir
-      (if (not (string-match speedbar-file-unshown-regexp (car dir)))
-	  (if (file-directory-p (car dir))
-	      (setq dirs (cons (car dir) dirs))
-	    (setq files (cons (car dir) files))))
-      (setq dir (cdr dir)))
-    (cons (nreverse dirs) (list (nreverse files))))
-  )
+  "Create file lists for DIRECTORY.
+The car is the list of directories, the cdr is list of files not
+matching ignored headers.  Cache any directory files found in
+`speedbar-directory-contents-alist' and use that cache before scanning
+the file-system"
+  (setq directory (expand-file-name directory))
+  ;; If in powerclick mode, then the directory we are getting
+  ;; should be rescanned.
+  (if speedbar-power-click
+      (adelete 'speedbar-directory-contents-alist directory))
+  ;; find the directory, either in the cache, or build it.
+  (or (cdr-safe (assoc directory speedbar-directory-contents-alist))
+      (let ((default-directory directory)
+	    (dir (directory-files directory nil))
+	    (dirs nil)
+	    (files nil))
+	(while dir
+	  (if (not (string-match speedbar-file-unshown-regexp (car dir)))
+	      (if (file-directory-p (car dir))
+		  (setq dirs (cons (car dir) dirs))
+		(setq files (cons (car dir) files))))
+	  (setq dir (cdr dir)))
+	(let ((nl (cons (nreverse dirs) (list (nreverse files)))))
+	  (aput 'speedbar-directory-contents-alist directory nl)
+	  nl))
+      ))
 
 (defun speedbar-directory-buttons (directory index)
-  "Inserts a single button group at point for DIRECTORY.  Each directory
-path part is a different button.  If part of the path matches the user
-directory ~, then it is replaced with a ~"
+  "Insert a single button group at point for DIRECTORY.
+Each directory path part is a different button.  If part of the path
+matches the user directory ~, then it is replaced with a ~.
+INDEX is not used, but is required by the caller."
   (let* ((tilde (expand-file-name "~"))
 	 (dd (expand-file-name directory))
 	 (junk (string-match (regexp-quote tilde) dd))
@@ -530,7 +1282,37 @@
 			      (if (= (match-beginning 1) p)
 				  (expand-file-name "~/")  ;the tilde
 				(buffer-substring-no-properties
-				 p (match-end 0))))))
+				 p (match-end 0)))))
+      ;; Nuke the beginning of the directory if it's too long...
+      (cond ((eq speedbar-directory-button-trim-method 'span)
+	     (beginning-of-line)
+	     (let ((ww (or (speedbar-frame-width) 20)))
+	       (move-to-column ww nil)
+	       (while (>= (current-column) ww)
+		 (re-search-backward "/" nil t)
+		 (if (<= (current-column) 2)
+		     (progn
+		       (re-search-forward "/" nil t)
+		       (if (< (current-column) 4)
+			   (re-search-forward "/" nil t))
+		       (forward-char -1)))
+		 (if (looking-at "/?$")
+		     (beginning-of-line)
+		   (insert "/...\n ")
+		   (move-to-column ww nil)))))
+	    ((eq speedbar-directory-button-trim-method 'trim)
+	     (end-of-line)
+	     (let ((ww (or (speedbar-frame-width) 20))
+		   (tl (current-column)))
+	       (if (< ww tl)
+		   (progn
+		     (move-to-column (- tl ww))
+		     (if (re-search-backward "/" nil t)
+			 (progn
+			   (delete-region (point-min) (point))
+			   (insert "$")
+			   )))))))
+      )
     (if (string-match "^/[^/]+/$" displayme)
 	(progn
 	  (insert "  ")
@@ -541,6 +1323,7 @@
 				  'speedbar-highlight-face
 				  'speedbar-directory-buttons-follow
 				  "/"))))
+    (end-of-line)
     (insert-char ?\n 1 nil)))
 
 (defun speedbar-make-tag-line (exp-button-type
@@ -548,19 +1331,21 @@
 			       exp-button-data
 			       tag-button tag-button-function tag-button-data
 			       tag-button-face depth)
-  "Creates a tag line with BUTTON-TYPE for the small button that
-expands or contracts a node (if applicable), and BUTTON-CHAR the
-character in it (+, -, ?, etc).  BUTTON-FUNCTION is the function to
-call if it's clicked on.  Button types are 'bracket, 'angle, 'curly, or nil.
+  "Create a tag line with EXP-BUTTON-TYPE for the small expansion button.
+This is the button that expands or contracts a node (if applicable),
+and EXP-BUTTON-CHAR the character in it (+, -, ?, etc).  EXP-BUTTON-FUNCTION
+is the function to call if it's clicked on.  Button types are
+'bracket, 'angle, 'curly, or nil.  EXP-BUTTON-DATA is extra data
+attached to the text forming the expansion button.
 
-Next, TAG-BUTTON is the text of the tag.  TAG-FUNCTION is the function
-to call if clicked on, and TAG-DATA is the data to attach to the text
-field (such a tag positioning, etc).  TAG-FACE is a face used for this
-type of tag.
+Next, TAG-BUTTON is the text of the tag.  TAG-BUTTON-FUNCTION is the
+function to call if clicked on, and TAG-BUTTON-DATA is the data to
+attach to the text field (such a tag positioning, etc).
+TAG-BUTTON-FACE is a face used for this type of tag.
 
 Lastly, DEPTH shows the depth of expansion.
 
-This function assumes that the cursor is in the speecbar window at the
+This function assumes that the cursor is in the speedbar window at the
 position to insert a new item, and that the new item will end with a CR"
   (let ((start (point))
 	(end (progn
@@ -588,16 +1373,16 @@
 	(end (progn (insert tag-button) (point))))
     (insert-char ?\n 1 nil)
     (put-text-property (1- (point)) (point) 'invisible nil)
-    (speedbar-make-button start end tag-button-face 
+    (speedbar-make-button start end tag-button-face
 			  (if tag-button-function 'speedbar-highlight-face nil)
 			  tag-button-function tag-button-data))
 )
 
 (defun speedbar-change-expand-button-char (char)
-  "Change the expanson button character to CHAR for the current line."
+  "Change the expansion button character to CHAR for the current line."
   (save-excursion
     (beginning-of-line)
-    (if (re-search-forward ":\\s-*.\\([-+?]\\)" (save-excursion (end-of-line) 
+    (if (re-search-forward ":\\s-*.\\([-+?]\\)" (save-excursion (end-of-line)
 								(point)) t)
 	(speedbar-with-writable
 	  (goto-char (match-beginning 1))
@@ -605,14 +1390,13 @@
 	  (insert-char char 1 t)))))
 
 
-;;;
 ;;; Build button lists
-;;;
+;;
 (defun speedbar-insert-files-at-point (files level)
-  "Insert list of FILES starting at point, and indenting all files to LEVEL
-depth.  Tag exapndable items with a +, otherwise a ?.  Don't highlight ? as
-we don't know how to manage them.  The input parameter FILES is a cons
-cell of the form ( 'dir-list . 'file-list )"
+  "Insert list of FILES starting at point, and indenting all files to LEVEL.
+Tag expandable items with a +, otherwise a ?.  Don't highlight ? as we
+don't know how to manage them.  The input parameter FILES is a cons
+cell of the form ( 'DIRLIST . 'FILELIST )"
   ;; Start inserting all the directories
   (let ((dirs (car files)))
     (while dirs
@@ -632,175 +1416,534 @@
       (setq lst (cdr lst)))))
 
 (defun speedbar-default-directory-list (directory index)
-  "Inserts files for DIRECTORY with level INDEX at point"
+  "Insert files for DIRECTORY with level INDEX at point."
   (speedbar-insert-files-at-point
    (speedbar-file-lists directory) index)
-  )
+  (speedbar-reset-scanners)
+  (if (= index 0)
+      ;; If the shown files variable has extra directories, then
+      ;; it is our responsibility to redraw them all
+      ;; Luckilly, the nature of inserting items into this list means
+      ;; that by reversing it, we can easilly go in the right order
+      (let ((sf (cdr (reverse speedbar-shown-directories))))
+	(setq speedbar-shown-directories
+	      (list (expand-file-name default-directory)))
+	;; exand them all as we find them
+	(while sf
+	  (if (speedbar-goto-this-file (car sf))
+	      (progn
+		(beginning-of-line)
+		(if (looking-at "[0-9]+:[ ]*<")
+		    (progn
+		      (goto-char (match-end 0))
+		  (speedbar-do-function-pointer)))
+		(setq sf (cdr sf)))))
+	)))
 
 (defun speedbar-insert-generic-list (level lst expand-fun find-fun)
-  "At LEVEL, inserts a generic multi-level alist LIST.  Associations with
-lists get {+} tags (to expand into more nodes) and those with positions
-just get a > as the indicator.  {+} buttons will have the function
-EXPAND-FUN and the token is the CDR list.  The token name will have the
-function FIND-FUN and not token."
+  "At LEVEL, insert a generic multi-level alist LST.
+Associations with lists get {+} tags (to expand into more nodes) and
+those with positions just get a > as the indicator.  {+} buttons will
+have the function EXPAND-FUN and the token is the CDR list.  The token
+name will have the function FIND-FUN and not token."
   ;; Remove imenu rescan button
   (if (string= (car (car lst)) "*Rescan*")
       (setq lst (cdr lst)))
   ;; insert the parts
   (while lst
     (cond ((null (car-safe lst)) nil)	;this would be a separator
-	  ((numberp (cdr-safe (car-safe lst)))
+	  ((or (numberp (cdr-safe (car-safe lst)))
+	       (markerp (cdr-safe (car-safe lst))))
 	   (speedbar-make-tag-line nil nil nil nil ;no expand button data
 				   (car (car lst)) ;button name
-				   find-fun ;function
+				   find-fun        ;function
 				   (cdr (car lst)) ;token is position
-				   'speedbar-tag-face 
+				   'speedbar-tag-face
 				   (1+ level)))
 	  ((listp (cdr-safe (car-safe lst)))
 	   (speedbar-make-tag-line 'curly ?+ expand-fun (cdr (car lst))
 				   (car (car lst)) ;button name
-				   nil nil 'speedbar-tag-face 
+				   nil nil 'speedbar-tag-face
 				   (1+ level)))
 	  (t (message "Ooops!")))
     (setq lst (cdr lst))))
 
-;;;
 ;;; Timed functions
-;;;
+;;
 (defun speedbar-update-contents ()
-  "Update the contents of the speedbar buffer."
+  "Generically update the contents of the speedbar buffer."
   (interactive)
-  (setq speedbar-last-selected-file nil)
-  (setq speedbar-shown-directories (list (expand-file-name default-directory)))
-  (let ((cbd default-directory)
-	(funclst speedbar-initial-expansion-list))
+  ;; Set the current special buffer
+  (setq speedbar-desired-buffer nil)
+  (if (and speedbar-mode-specific-contents-flag
+	   speedbar-special-mode-expansion-list
+	   (local-variable-p
+	    'speedbar-special-mode-expansion-list))
+	   ;(eq (get major-mode 'mode-class 'special)))
+      (speedbar-update-special-contents)
+    (speedbar-update-directory-contents)))
+
+(defun speedbar-update-directory-contents ()
+  "Update the contents of the speedbar buffer based on the current directory."
+  (let ((cbd (expand-file-name default-directory))
+	(funclst speedbar-initial-expansion-list)
+	(cache speedbar-full-text-cache)
+	;; disable stealth during update
+	(speedbar-stealthy-function-list nil)
+	(use-cache nil)
+	;; Because there is a bug I can't find just yet
+	(inhibit-quit nil))
     (save-excursion
       (set-buffer speedbar-buffer)
+      ;; If we are updating contents to a where we are, then this is
+      ;; really a request to update existing contents, so we must be
+      ;; careful with our text cache!
+      (if (member cbd speedbar-shown-directories)
+	  (setq cache nil)
+	;; If this directory is NOT in the current list of available
+	;; paths, then use the cache, and set the cache to our new
+	;; value.  Make sure to unhighlight the current file, or if we
+	;; come back to this directory, it might be a different file
+	;; and then we get a mess!
+	(if (> (point-max) 1)
+	    (progn
+	      (speedbar-clear-current-file)
+	      (setq speedbar-full-text-cache
+		    (cons speedbar-shown-directories (buffer-string)))))
+
+	;; Check if our new directory is in the list of directories
+	;; show in the text-cahce
+	(if (member cbd (car cache))
+	    (setq speedbar-shown-directories (car cache)
+		  use-cache t)
+	  ;; default the shown directories to this list...
+	  (setq speedbar-shown-directories (list cbd)))
+	)
+      (setq speedbar-last-selected-file nil)
       (speedbar-with-writable
 	(setq default-directory cbd)
-	(delete-region (point-min) (point-max))
+	(erase-buffer)
+	(if use-cache
+	    (insert (cdr cache))
+	  (while funclst
+	    (funcall (car funclst) cbd 0)
+	    (setq funclst (cdr funclst)))))
+      (goto-char (point-min))))
+  (speedbar-reconfigure-menubar))
+
+(defun speedbar-update-special-contents ()
+  "Used the mode-specific variable to fill in the speedbar buffer.
+This should only be used by modes classified as special."
+  (let ((funclst speedbar-special-mode-expansion-list)
+	(specialbuff (current-buffer)))
+    (save-excursion
+      (setq speedbar-desired-buffer specialbuff)
+      (set-buffer speedbar-buffer)
+      ;; If we are leaving a directory, cache it.
+      (if (not speedbar-shown-directories)
+	  ;; Do nothing
+	  nil
+	;; Clean up directory maintenance stuff
+	(speedbar-clear-current-file)
+	(setq speedbar-full-text-cache
+	      (cons speedbar-shown-directories (buffer-string))
+	      speedbar-shown-directories nil))
+      ;; Now fill in the buffer with our newly found specialized list.
+      (speedbar-with-writable
 	(while funclst
-	  (funcall (car funclst) cbd 0)
-	  (setq funclst (cdr funclst)))))))
+	  ;; We do not erase the buffer because these functions may
+	  ;; decide NOT to update themselves.
+	  (funcall (car funclst) specialbuff)
+	  (setq funclst (cdr funclst))))
+      (goto-char (point-min))))
+  (speedbar-reconfigure-menubar))
 
 (defun speedbar-timer-fn ()
-  "Run whenever emacs is idle to update the speedbar item"
-  (if (not (and speedbar-frame 
-		(frame-live-p speedbar-frame)
-		speedbar-attached-frame 
+  "Run whenever emacs is idle to update the speedbar item."
+  (if (not (and (frame-live-p speedbar-frame)
 		(frame-live-p speedbar-attached-frame)))
       (speedbar-set-timer nil)
-    (unwind-protect
-	(if (frame-visible-p speedbar-frame)
-	    (let ((af (selected-frame)))
-	      (save-window-excursion
-		(select-frame speedbar-attached-frame)
-		;; make sure we at least choose a window to
-		;; get a good directory from
-		(if (string-match "\\*Minibuf-[0-9]+\\*" (buffer-name))
-		    (other-window 1))
-		;; Update all the contents if directories change!
-		(if (or (member (expand-file-name default-directory)
-				speedbar-shown-directories)
-			(eq af speedbar-frame)
-			(not (buffer-file-name))
-			)
-		    nil
-		  (message "Updating speedbar to: %s..." default-directory)
-		  (speedbar-update-contents)
-		  (message "Updating speedbar to: %s...done" default-directory)))))
-      ;; Reset the timer
-      (speedbar-set-timer speedbar-update-speed)
-      ;; Ok, un-underline old file, underline current file
-      (speedbar-update-current-file)))
+    (condition-case nil
+	;; Save all the match data so that we don't mess up executing fns
+	(save-match-data
+	  (if (and (frame-visible-p speedbar-frame) speedbar-update-flag)
+	      (let ((af (selected-frame)))
+		(save-window-excursion
+		  (select-frame speedbar-attached-frame)
+		  ;; make sure we at least choose a window to
+		  ;; get a good directory from
+		  (if (string-match "\\*Minibuf-[0-9]+\\*" (buffer-name))
+		      (other-window 1))
+		  ;; Update for special mode all the time!
+		  (if (and speedbar-mode-specific-contents-flag
+			   speedbar-special-mode-expansion-list
+			   (local-variable-p
+			    'speedbar-special-mode-expansion-list))
+					;(eq (get major-mode 'mode-class 'special)))
+		      (speedbar-update-special-contents)
+		    ;; Update all the contents if directories change!
+		    (if (or (member (expand-file-name default-directory)
+				    speedbar-shown-directories)
+			    (string-match speedbar-ignored-path-regexp
+					  (expand-file-name default-directory))
+			    (member major-mode speedbar-ignored-modes)
+			    (eq af speedbar-frame)
+			    (not (buffer-file-name)))
+			nil
+		      (if (<= 1 speedbar-verbosity-level)
+			  (message "Updating speedbar to: %s..."
+				   default-directory))
+		      (speedbar-update-directory-contents)
+		      (if (<= 1 speedbar-verbosity-level)
+			  (message "Updating speedbar to: %s...done"
+				   default-directory))))
+		  (select-frame af))
+		;; Now run stealthy updates of time-consuming items
+		(speedbar-stealthy-updates))))
+      ;; errors that might occur
+      (error (message "Speedbar error!")))
+    ;; Reset the timer
+    (speedbar-set-timer speedbar-update-speed))
   (run-hooks 'speedbar-timer-hook)
   )
 
+
+;;; Stealthy activities
+;;
+(defun speedbar-stealthy-updates ()
+  "For a given speedbar, run all items in the stealthy function list.
+Each item returns t if it completes successfully, or nil if
+interrupted by the user."
+  (let ((l speedbar-stealthy-function-list))
+    (unwind-protect
+	(while (and l (funcall (car l)))
+	  (sit-for 0)
+	  (setq l (cdr l)))
+      ;(message "Exit with %S" (car l))
+      )))
+
+(defun speedbar-reset-scanners ()
+  "Reset any variables used by functions in the stealthy list as state.
+If new functions are added, their state needs to be updated here."
+  (setq speedbar-vc-to-do-point t)
+  )
+
+(defun speedbar-clear-current-file ()
+  "Locate the file thought to be current, and unhighlight it."
+  (save-excursion
+    (set-buffer speedbar-buffer)
+    (if speedbar-last-selected-file
+	(speedbar-with-writable
+	  (goto-char (point-min))
+	  (if (and
+	       speedbar-last-selected-file
+	       (re-search-forward
+		(concat " \\(" (regexp-quote speedbar-last-selected-file)
+			"\\)\\(" (regexp-quote speedbar-vc-indicator)
+			"\\)?\n")
+		nil t))
+	      (put-text-property (match-beginning 1)
+				 (match-end 1)
+				 'face
+				 'speedbar-file-face))))))
+
 (defun speedbar-update-current-file ()
-  "Find out what the current file is, and update our visuals to indicate
-what it is.  This is specific to file names."
+  "Find the current file is, and update our visuals to indicate its name.
+This is specific to file names.  If the file name doesn't show up, but
+it should be in the list, then the directory cache needs to be
+updated."
   (let* ((lastf (selected-frame))
-	 (newcf (save-excursion
-		  (select-frame speedbar-attached-frame)
-		  (let ((rf (if (buffer-file-name)
-				(file-name-nondirectory (buffer-file-name))
-			      nil)))
-		    (select-frame lastf)
-		    rf)))
-	(lastb (current-buffer)))
-    (if (and newcf (not (string= newcf speedbar-last-selected-file)))
+	 (newcfd (save-excursion
+		   (select-frame speedbar-attached-frame)
+		   (let ((rf (if (buffer-file-name)
+				 (buffer-file-name)
+			       nil)))
+		     (select-frame lastf)
+		     rf)))
+	 (newcf (if newcfd (file-name-nondirectory newcfd)))
+	 (lastb (current-buffer))
+	 (sucf-recursive (boundp 'sucf-recursive)))
+    (if (and newcf
+	     ;; check here, that way we won't refresh to newcf until
+	     ;; its been written, thus saving ourselves some time
+	     (file-exists-p newcf)
+	     (not (string= newcf speedbar-last-selected-file)))
 	(progn
+	  ;; It is important to select the frame, otherwise the window
+	  ;; we want the cursor to move in will not be updated by the
+	  ;; search-forward command.
 	  (select-frame speedbar-frame)
+	  ;; Remove the old file...
+	  (speedbar-clear-current-file)
+	  ;; now highlight the new one.
 	  (set-buffer speedbar-buffer)
 	  (speedbar-with-writable
 	    (goto-char (point-min))
-	    (if (and 
-		 speedbar-last-selected-file
-		 (re-search-forward 
-		  (concat " \\(" (regexp-quote speedbar-last-selected-file) "\\)\n")
-		  nil t))
-		(put-text-property (match-beginning 1)
-				   (match-end 1)
-				   'face
-				   'speedbar-file-face))
-	    (goto-char (point-min))
-	    (if (re-search-forward 
-		 (concat " \\(" (regexp-quote newcf) "\\)\n") nil t)
-		(put-text-property (match-beginning 1)
-				   (match-end 1)
-				   'face 
-				   'speedbar-selected-face))
+	    (if (re-search-forward
+		 (concat " \\(" (regexp-quote newcf) "\\)\\("
+			 (regexp-quote speedbar-vc-indicator)
+			 "\\)?\n") nil t)
+		  ;; put the property on it
+		  (put-text-property (match-beginning 1)
+				     (match-end 1)
+				     'face
+				     'speedbar-selected-face)
+	      ;; Oops, it's not in the list.  Should it be?
+	      (if (and (string-match speedbar-file-regexp newcf)
+		       (string= (file-name-directory newcfd)
+				(expand-file-name default-directory)))
+		  ;; yes, it is (we will ignore unknowns for now...)
+		  (progn
+		    (speedbar-refresh)
+		    (if (re-search-forward
+			 (concat " \\(" (regexp-quote newcf) "\\)\n") nil t)
+			;; put the property on it
+			(put-text-property (match-beginning 1)
+					   (match-end 1)
+					   'face
+					   'speedbar-selected-face)))
+		;; if it's not in there now, whatever...
+		))
 	    (setq speedbar-last-selected-file newcf))
-	  (forward-line -1)
-	  (speedbar-position-cursor-on-line)
+	  (if (not sucf-recursive)
+	      (progn
+		(forward-line -1)
+		(speedbar-position-cursor-on-line)))
 	  (set-buffer lastb)
-	  (select-frame lastf)))))
+	  (select-frame lastf)
+	  )))
+  ;; return that we are done with this activity.
+  t)
+
+;; If it's being used, check for it
+(eval-when-compile (or (featurep 'xemacs) (require 'ange-ftp)))
+
+(defun speedbar-check-vc ()
+  "Scan all files in a directory, and for each see if it's checked out.
+See `speedbar-this-file-in-vc' and `speedbar-vc-check-dir-p' for how
+to add more types of version control systems."
+  ;; Check for to-do to be reset.  If reset but no RCS is available
+  ;; then set to nil (do nothing) otherwise, start at the beginning
+  (save-excursion
+    (set-buffer speedbar-buffer)
+    (if (and speedbar-vc-do-check (eq speedbar-vc-to-do-point t)
+	     (speedbar-vc-check-dir-p default-directory)
+	     (not (and (featurep 'ange-ftp)
+		       (string-match (car
+				      (if speedbar-xemacsp
+					  ange-ftp-path-format
+					ange-ftp-name-format))
+				     (expand-file-name default-directory)))))
+	(setq speedbar-vc-to-do-point 0))
+    (if (numberp speedbar-vc-to-do-point)
+	(progn
+	  (goto-char speedbar-vc-to-do-point)
+	  (while (and (not (input-pending-p))
+		      (re-search-forward "^\\([0-9]+\\):\\s-*\\[[+-]\\] " nil t))
+	    (setq speedbar-vc-to-do-point (point))
+	    (if (speedbar-check-vc-this-line)
+		(speedbar-with-writable
+		  (insert speedbar-vc-indicator))))
+	  (if (input-pending-p)
+	      ;; return that we are incomplete
+	      nil
+	    ;; we are done, set to-do to nil
+	    (setq speedbar-vc-to-do-point nil)
+	    ;; and return t
+	    t))
+      t)))
+
+(defun speedbar-check-vc-this-line ()
+  "Return t if the file on this line is check of of a version control system.
+The one caller-requirement is that the last regexp matching operation
+has the current depth stored in (MATCHSTRING 1), and that the cursor
+is right in front of the file name."
+  (let* ((d (string-to-int (match-string 1)))
+	 (f (speedbar-line-path d))
+	 (fn (buffer-substring-no-properties
+	      (point) (progn (end-of-line) (point))))
+	 (fulln (concat f fn)))
+    (if (<= 2 speedbar-verbosity-level)
+	(message "Speedbar vc check...%s" fulln))
+    (and (file-writable-p fulln)
+	 (speedbar-this-file-in-vc f fn))))
+
+(defun speedbar-vc-check-dir-p (path)
+  "Return t if we should bother checking PATH for version control files.
+This can be overloaded to add new types of version control systems."
+  (or
+   (file-exists-p (concat path "RCS/"))
+   ;; If SCCS is added in `speedbar-this-file-in-vc'
+   ;; (file-exists-p (concat path "SCCS/"))
+   ;; (file-exists-p (getenv "SCCSPATHTHINGIDONTREMEMBER"))
+   ))
+
+(defun speedbar-this-file-in-vc (path name)
+  "Check to see if the file in PATH with NAME is in a version control system.
+You can add new VC systems by overriding this function.  You can
+optimize this function by overriding it and only doing those checks
+that will occur on your system."
+  (or
+   (file-exists-p (concat path "RCS/" name ",v"))
+   ;; Is this right?  I don't recall
+   ;;(file-exists-p (concat path "SCCS/," fn))
+   ;;(file-exists-p (concat (getenv "SCCSPATHTHING") "/SCCS/," fn))
+   ))
 
-;;;
 ;;; Clicking Activity
-;;;
+;;
 (defun speedbar-quick-mouse (e)
-  "Since mouse events are strange, this will keep the mouse nicely
-positioned."
+  "Since mouse events are strange, this will keep the mouse nicely positioned.
+This should be bound to mouse event E."
   (interactive "e")
   (mouse-set-point e)
-  (beginning-of-line)
-  (forward-char 3)
+  (speedbar-position-cursor-on-line)
   )
 
 (defun speedbar-position-cursor-on-line ()
   "Position the cursor on a line."
-  (beginning-of-line)
-  (re-search-forward "[]>}]" (save-excursion (end-of-line) (point)) t))
+  (let ((oldpos (point)))
+    (beginning-of-line)
+    (if (looking-at "[0-9]+:\\s-*..?.? ")
+	(goto-char (1- (match-end 0)))
+      (goto-char oldpos))))
+
+(defun speedbar-power-click (e)
+  "Activate any speedbar button as a power click.
+This should be bound to mouse event E."
+  (interactive "e")
+  (let ((speedbar-power-click t))
+    (speedbar-click e)))
+
+(defun speedbar-click (e)
+  "Activate any speedbar buttons where the mouse is clicked.
+This must be bound to a mouse event.  A button is any location of text
+with a mouse face that has a text property called `speedbar-function'.
+This should be bound to mouse event E."
+  (interactive "e")
+  (mouse-set-point e)
+  (speedbar-do-function-pointer)
+  (speedbar-quick-mouse e))
+
+(defun speedbar-do-function-pointer ()
+  "Look under the cursor and examine the text properties.
+From this extract the file/tag name, token, indentation level and call
+a function if appropriate"
+  (let* ((fn (get-text-property (point) 'speedbar-function))
+	 (tok (get-text-property (point) 'speedbar-token))
+	 ;; The 1-,+ is safe because scaning starts AFTER the point
+	 ;; specified.  This lets the search include the character the
+	 ;; cursor is on.
+	 (tp (previous-single-property-change
+	      (1+ (point)) 'speedbar-function))
+	 (np (next-single-property-change
+	      (point) 'speedbar-function))
+	 (txt (buffer-substring-no-properties (or tp (point-min))
+					      (or np (point-max))))
+	 (dent (save-excursion (beginning-of-line)
+			       (string-to-number
+				(if (looking-at "[0-9]+")
+				    (buffer-substring-no-properties
+				    (match-beginning 0) (match-end 0))
+				  "0")))))
+    ;;(message "%S:%S:%S:%s" fn tok txt dent)
+    (and fn (funcall fn txt tok dent)))
+  (speedbar-position-cursor-on-line))
+
+;;; Reading info from the speedbar buffer
+;;
+(defun speedbar-line-file (&optional p)
+  "Retrieve the file or whatever from the line at P point.
+The return value is a string representing the file.  If it is a
+directory, then it is the directory name."
+  (save-excursion
+    (save-match-data
+      (beginning-of-line)
+      (if (looking-at (concat
+		       "\\([0-9]+\\): *[[<][-+][]>] \\([^ \n]+\\)\\("
+		       (regexp-quote speedbar-vc-indicator)
+		       "\\)?"))
+	  (let* ((depth (string-to-int (match-string 1)))
+		 (path (speedbar-line-path depth))
+		 (f (match-string 2)))
+	    (concat path f))
+	nil))))
+
+(defun speedbar-goto-this-file (file)
+  "If FILE is displayed, goto this line and return t.
+Otherwise do not move and return nil."
+  (let ((path (substring (file-name-directory (expand-file-name file))
+			 (length (expand-file-name default-directory))))
+	(dest (point)))
+    (save-match-data
+      (goto-char (point-min))
+      ;; scan all the directories
+      (while (and path (not (eq path t)))
+	(if (string-match "^/?\\([^/]+\\)" path)
+	    (let ((pp (match-string 1 path)))
+	      (if (save-match-data
+		    (re-search-forward (concat "> " (regexp-quote pp) "$")
+				       nil t))
+		  (setq path (substring path (match-end 1)))
+		(setq path nil)))
+	  (setq path t)))
+      ;; find the file part
+      (if (or (not path) (string= (file-name-nondirectory file) ""))
+	  ;; only had a dir part
+	  (if path
+	      (progn
+		(speedbar-position-cursor-on-line)
+		t)
+	    (goto-char dest) nil)
+	;; find the file part
+	(let ((nd (file-name-nondirectory file)))
+	  (if (re-search-forward
+	       (concat "] \\(" (regexp-quote nd)
+		       "\\)\\(" (regexp-quote speedbar-vc-indicator) "\\)?$")
+	       nil t)
+	      (progn
+		(speedbar-position-cursor-on-line)
+		t)
+	    (goto-char dest)
+	    nil))))))
 
 (defun speedbar-line-path (depth)
-  "Retrieve the pathname associated with the current line.  This may
-require traversing backwards and combinding the default directory with
-these items."
+  "Retrieve the pathname associated with the current line.
+This may require traversing backwards from DEPTH and combining the default
+directory with these items."
   (save-excursion
-    (let ((path nil))
-      (setq depth (1- depth))
-      (while (/= depth -1)
-	(if (not (re-search-backward (format "^%d:" depth) nil t))
-	    (error "Error building path of tag")
-	  (cond ((looking-at "[0-9]+:\\s-*<->\\s-+\\([^\n]+\\)$")
-		 (setq path (concat (buffer-substring-no-properties
-				     (match-beginning 1) (match-end 1))
-				    "/"
-				    path)))
-		((looking-at "[0-9]+:\\s-*[-]\\s-+\\([^\n]+\\)$")
-		 ;; This is the start of our path.
-		 (setq path (buffer-substring-no-properties
-			     (match-beginning 1) (match-end 1))))))
-	(setq depth (1- depth)))
-      (concat default-directory path))))
+    (save-match-data
+      (let ((path nil))
+	(setq depth (1- depth))
+	(while (/= depth -1)
+	  (if (not (re-search-backward (format "^%d:" depth) nil t))
+	      (error "Error building path of tag")
+	    (cond ((looking-at "[0-9]+:\\s-*<->\\s-+\\([^\n]+\\)$")
+		   (setq path (concat (buffer-substring-no-properties
+				       (match-beginning 1) (match-end 1))
+				      "/"
+				      path)))
+		  ((looking-at "[0-9]+:\\s-*[-]\\s-+\\([^\n]+\\)$")
+		   ;; This is the start of our path.
+		   (setq path (buffer-substring-no-properties
+			       (match-beginning 1) (match-end 1))))))
+	  (setq depth (1- depth)))
+	(if (and path
+		 (string-match (concat (regexp-quote speedbar-vc-indicator) "$")
+			       path))
+	    (setq path (substring path 0 (match-beginning 0))))
+	(concat default-directory path)))))
 
 (defun speedbar-edit-line ()
   "Edit whatever tag or file is on the current speedbar line."
   (interactive)
-  (beginning-of-line)
-  (re-search-forward "[]>}] [a-zA-Z0-9]" (save-excursion (end-of-line) (point)))
-  (speedbar-do-function-pointer))
+  (save-excursion
+    (beginning-of-line)
+    ;; If this fails, then it is a non-standard click, and as such,
+    ;; perfectly allowed.
+    (re-search-forward "[]>}] [a-zA-Z0-9]"
+		       (save-excursion (end-of-line) (point)) t)
+    (speedbar-do-function-pointer)))
 
 (defun speedbar-expand-line ()
   "Expand the line under the cursor."
@@ -811,64 +1954,40 @@
   (speedbar-do-function-pointer))
 
 (defun speedbar-contract-line ()
-  "Expand the line under the cursor."
+  "Contract the line under the cursor."
   (interactive)
   (beginning-of-line)
   (re-search-forward ":\\s-*.-. " (save-excursion (end-of-line) (point)))
   (forward-char -2)
   (speedbar-do-function-pointer))
 
-(defun speedbar-click (e)
-  "When the user clicks mouse 1 on our speedbar, we must decide what
-we want to do!  The entire speedbar has functions attached to
-buttons.  All we have to do is extract from the buffer the information
-we need.  See `speedbar-mode' for the type of behaviour we want to achieve"
-  (interactive "e")
-  (mouse-set-point e)
-  (speedbar-do-function-pointer))
-
-(defun speedbar-do-function-pointer ()
-  "Look under the cursor and examine the text properties.  From this extract
-the file/tag name, token, indentation level and call a function if apropriate"
-  (let* ((fn (get-text-property (point) 'speedbar-function))
-	 (tok (get-text-property (point) 'speedbar-token))
-	 ;; The 1-,+ is safe because scaning starts AFTER the point
-	 ;; specified.  This lets the search include the character the
-	 ;; cursor is on.
-	 (tp (previous-single-property-change 
-	      (if (get-text-property (1+ (point)) 'speedbar-function)
-		  (1+ (point)) (point)) 'speedbar-function))
-	 (np (next-single-property-change 
-	      (if (and (> (point) 1) (get-text-property (1- (point)) 'speedbar-function))
-		  (1- (point)) (point)) 'speedbar-function))
-	 (txt (buffer-substring-no-properties (or tp (point-min))
-					      (or np (point-max))))
-	 (dent (save-excursion (beginning-of-line) 
-			       (string-to-number 
-				(if (looking-at "[0-9]+")
-				    (buffer-substring-no-properties
-				    (match-beginning 0) (match-end 0))
-				  "0")))))
-    ;;(message "%S:%S:%S:%s" fn tok txt dent)
-    (and fn (funcall fn txt tok dent)))
-  (speedbar-position-cursor-on-line))
+(defun speedbar-maybee-jump-to-attached-frame ()
+  "Jump to the attached frame ONLY if this was not a mouse event."
+  (if (numberp last-input-char)
+      (progn
+	(select-frame speedbar-attached-frame)
+	(other-frame 0))))
 
 (defun speedbar-find-file (text token indent)
-  "Speedbar click handler for filenames.  Clicking the filename loads
-that file into the attached buffer."
+  "Speedbar click handler for filenames.
+TEXT, the file will be displayed in the attached frame.
+TOKEN is unused, but required by the click handler.  INDENT is the
+current indentation level."
   (let ((cdd (speedbar-line-path indent)))
-    (select-frame speedbar-attached-frame)
-    (find-file (concat cdd text))
-    (speedbar-update-current-file)
+    (speedbar-find-file-in-frame (concat cdd text))
+    (speedbar-stealthy-updates)
     ;; Reset the timer with a new timeout when cliking a file
     ;; in case the user was navigating directories, we can cancel
     ;; that other timer.
-    (speedbar-set-timer speedbar-update-speed)))
+    (speedbar-set-timer speedbar-update-speed))
+  (speedbar-maybee-jump-to-attached-frame))
 
 (defun speedbar-dir-follow (text token indent)
-  "Speedbar click handler for directory names.  Clicking a directory will
-cause the speedbar to list files in the selected subdirectory."
-  (setq default-directory 
+  "Speedbar click handler for directory names.
+Clicking a directory will cause the speedbar to list files in the
+the subdirectory TEXT.  TOKEN is an unused requirement.  The
+subdirectory chosen will be at INDENT level."
+  (setq default-directory
 	(concat (expand-file-name (concat (speedbar-line-path indent) text))
 		"/"))
   ;; Because we leave speedbar as the current buffer,
@@ -877,28 +1996,46 @@
   (speedbar-update-contents)
   (speedbar-set-timer speedbar-navigating-speed)
   (setq speedbar-last-selected-file nil)
-  (speedbar-update-current-file))
+  (speedbar-stealthy-updates))
 
+(defun speedbar-delete-subblock (indent)
+  "Delete text from point to indentation level INDENT or greater.
+Handles end-of-sublist smartly."
+  (speedbar-with-writable
+    (save-excursion
+      (end-of-line) (forward-char 1)
+      (while (and (not (save-excursion
+			 (re-search-forward (format "^%d:" indent)
+					    nil t)))
+		  (>= indent 0))
+	(setq indent (1- indent)))
+      (delete-region (point) (if (>= indent 0)
+				 (match-beginning 0)
+			       (point-max))))))
 
 (defun speedbar-dired (text token indent)
-  "Speedbar click handler for filenames.  Clicking the filename loads
-that file into the attached buffer."
-  (cond ((string-match "+" text)	;we have to expand this file
-	 (setq speedbar-shown-directories 
-	       (cons (expand-file-name 
+  "Speedbar click handler for directory expand button.
+Clicking this button expands or contracts a directory.  TEXT is the
+button clicked which has either a + or -.  TOKEN is the directory to be
+expanded.  INDENT is the current indentation level."
+  (cond ((string-match "+" text)	;we have to expand this dir
+	 (setq speedbar-shown-directories
+	       (cons (expand-file-name
 		      (concat (speedbar-line-path indent) token "/"))
 		     speedbar-shown-directories))
 	 (speedbar-change-expand-button-char ?-)
+	 (speedbar-reset-scanners)
 	 (save-excursion
 	   (end-of-line) (forward-char 1)
 	   (speedbar-with-writable
-	     (speedbar-default-directory-list 
+	     (speedbar-default-directory-list
 	      (concat (speedbar-line-path indent) token "/")
 	      (1+ indent)))))
 	((string-match "-" text)	;we have to contract this node
+	 (speedbar-reset-scanners)
 	 (let ((oldl speedbar-shown-directories)
 	       (newl nil)
-	       (td (expand-file-name 
+	       (td (expand-file-name
 		    (concat (speedbar-line-path indent) token))))
 	   (while oldl
 	     (if (not (string-match (concat "^" (regexp-quote td)) (car oldl)))
@@ -906,20 +2043,17 @@
 	     (setq oldl (cdr oldl)))
 	   (setq speedbar-shown-directories newl))
 	 (speedbar-change-expand-button-char ?+)
-	 (save-excursion
-	   (end-of-line) (forward-char 1)
-	   (speedbar-with-writable
-	     (if (save-excursion (re-search-forward (format "^%d:" indent) nil t))
-		 (delete-region (point) (match-beginning 0))
-	       (delete-region (point) (point-max)))))
+	 (speedbar-delete-subblock indent)
 	 )
 	(t (error "Ooops... not sure what to do.")))
   (speedbar-center-buffer-smartly)
   (setq speedbar-last-selected-file nil)
-  (save-excursion (speedbar-update-current-file)))
+  (save-excursion (speedbar-stealthy-updates)))
 
-(defun speedbar-directory-buttons-follow (text token ident)
-  "Speedbar click handler for default directory buttons."
+(defun speedbar-directory-buttons-follow (text token indent)
+  "Speedbar click handler for default directory buttons.
+TEXT is the button clicked on.  TOKEN is the directory to follow.
+INDENT is the current indentation level and is unused."
   (setq default-directory token)
   ;; Because we leave speedbar as the current buffer,
   ;; update contents will change directory without
@@ -928,13 +2062,14 @@
   (speedbar-set-timer speedbar-navigating-speed))
 
 (defun speedbar-tag-file (text token indent)
-  "The cursor is on a selected line.  Expand the tags in the specified
-file.  The parameter TXT and TOK are required, where TXT is the button
-clicked, and TOK is the file to expand."
+  "The cursor is on a selected line.  Expand the tags in the specified file.
+The parameter TEXT and TOKEN are required, where TEXT is the button
+clicked, and TOKEN is the file to expand.  INDENT is the current
+indentation level."
   (cond ((string-match "+" text)	;we have to expand this file
 	 (let* ((fn (expand-file-name (concat (speedbar-line-path indent)
 					      token)))
-		(lst (if speedbar-use-imenu-package
+		(lst (if speedbar-use-imenu-flag
 			(let ((tim (speedbar-fetch-dynamic-imenu fn)))
 			  (if (eq tim t)
 			      (speedbar-fetch-dynamic-etags fn)
@@ -952,30 +2087,30 @@
 					       'speedbar-tag-find))))))
 	((string-match "-" text)	;we have to contract this node
 	 (speedbar-change-expand-button-char ?+)
-	 (speedbar-with-writable
-	   (save-excursion
-	     (end-of-line) (forward-char 1)
-	     (if (save-excursion (re-search-forward (format "^%d:" indent) nil t))
-		 (delete-region (point) (match-beginning 0))
-	       (delete-region (point) (point-max))))))
+	 (speedbar-delete-subblock indent))
 	(t (error "Ooops... not sure what to do.")))
   (speedbar-center-buffer-smartly))
 
 (defun speedbar-tag-find (text token indent)
-  "For the tag in a file, goto that position"
+  "For the tag TEXT in a file TOKEN, goto that position.
+INDENT is the current indentation level."
   (let ((file (speedbar-line-path indent)))
-    (select-frame speedbar-attached-frame)
-    (find-file file)
-    (save-excursion (speedbar-update-current-file))
+    (speedbar-find-file-in-frame file)
+    (save-excursion (speedbar-stealthy-updates))
     ;; Reset the timer with a new timeout when cliking a file
     ;; in case the user was navigating directories, we can cancel
     ;; that other timer.
     (speedbar-set-timer speedbar-update-speed)
-    (goto-char token)))
+    (goto-char token)
+    ;;(recenter)
+    (speedbar-maybee-jump-to-attached-frame)
+    ))
 
 (defun speedbar-tag-expand (text token indent)
-  "For the tag in a file which is really a list of tags of a certain type,
-expand or contract that list."
+  "Expand a tag sublist.  Imenu will return sub-lists of specialized tag types.
+Etags does not support this feature.  TEXT will be the button
+string.  TOKEN will be the list, and INDENT is the current indentation
+level."
   (cond ((string-match "+" text)	;we have to expand this file
 	 (speedbar-change-expand-button-char ?-)
 	 (speedbar-with-writable
@@ -986,23 +2121,35 @@
 					   'speedbar-tag-find))))
 	((string-match "-" text)	;we have to contract this node
 	 (speedbar-change-expand-button-char ?+)
-	 (speedbar-with-writable
-	   (save-excursion
-	     (end-of-line) (forward-char 1)
-	     (if (save-excursion (re-search-forward (format "^%d:" indent) nil t))
-		 (delete-region (point) (match-beginning 0))))))
+	 (speedbar-delete-subblock indent))
 	(t (error "Ooops... not sure what to do.")))
   (speedbar-center-buffer-smartly))
+
+;;; Loading files into the attached frame.
+;;
+(defun speedbar-find-file-in-frame (file)
+  "This will load FILE into the speedbar attached frame.
+If the file is being displayed in a different frame already, then raise that
+frame instead."
+  (let* ((buff (find-file-noselect file))
+	 (bwin (get-buffer-window buff 0)))
+    (if bwin
+	(progn
+	  (select-window bwin)
+	  (raise-frame (window-frame bwin)))
+      (if speedbar-power-click
+	  (let ((pop-up-frames t)) (select-window (display-buffer buff)))
+	(select-frame speedbar-attached-frame)
+	(switch-to-buffer buff))))
+  )
 
-;;;
 ;;; Centering Utility
-;;;
+;;
 (defun speedbar-center-buffer-smartly ()
-  "Look at the buffer, and center it so that which the user is most
-interested in (as far as we can tell) is all visible.  This assumes
-that the cursor is on a file, or tag of a file which the user is
+  "Recenter a speedbar buffer so the current indentation level is all visible.
+This assumes that the cursor is on a file, or tag of a file which the user is
 interested in."
-  (if (<= (count-lines (point-min) (point-max)) 
+  (if (<= (count-lines (point-min) (point-max))
 	  (window-height (selected-window)))
       ;; whole buffer fits
       (let ((cp (point)))
@@ -1058,68 +2205,100 @@
 	(goto-char cp)))))
 
 
-;;;
 ;;; Tag Management -- Imenu
-;;;
+;;
+(if  (string-match "XEmacs" emacs-version)
+
+    nil
+
+(eval-when-compile (if (locate-library "imenu") (require 'imenu)))
+
 (defun speedbar-fetch-dynamic-imenu (file)
-  "Use the imenu package to load in file, and extract all the items
-tags we wish to display in the speedbar package."
-;;  (eval-when-compile (require 'imenu))
+  "Load FILE into a buffer, and generate tags using Imenu.
+Returns the tag list, or t for an error."
+  ;; Load this AND compile it in
+  (require 'imenu)
   (save-excursion
     (set-buffer (find-file-noselect file))
     (condition-case nil
-	(imenu--make-index-alist t)
+	(progn
+	  (if speedbar-power-click (setq imenu--index-alist nil))
+	  (imenu--make-index-alist t))
       (error t))))
-
+)
 
-;;;
-;;; Tag Management -- etags  (Not useful for FSF emacs)
-;;;
+;;; Tag Management -- etags  (XEmacs compatibility part)
+;;
 (defvar speedbar-fetch-etags-parse-list
-  '(("\\.\\([cChH]\\|c++\\|cpp\\|cc\\)$" . speedbar-parse-c-or-c++tag)
-    ("\\.el\\|\\.emacs" .
-     "defun\\s-+\\(\\(\\w\\|[-_]\\)+\\)\\s-*\C-?")
+  '(;; Note that java has the same parse-group as c
+    ("\\.\\([cChH]\\|c++\\|cpp\\|cc\\|hh\\|java\\)$" . speedbar-parse-c-or-c++tag)
+    ("\\.el\\|\\.emacs" . "defun\\s-+\\(\\(\\w\\|[-_]\\)+\\)\\s-*\C-?")
     ("\\.tex$" . speedbar-parse-tex-string)
     ("\\.p" .
      "\\(\\(FUNCTION\\|function\\|PROCEDURE\\|procedure\\)\\s-+\\([a-zA-Z0-9_.:]+\\)\\)\\s-*(?^?")
 
     )
-  "*Alist matching extension vs an expression which will extract the
-symbol name we wish to display as match 1.  To add a new file type, you
-would want to add a new association to the list, where the car
-is the file match, and the cdr is the way to extract an element from
-the tags output.  If the output is complex, use a function symbol
-instead of regexp.  The function should expect to be at the beginning
-of a line in the etags buffer.
+  "Associations of file extensions and expressions for extracting tags.
+To add a new file type, you would want to add a new association to the
+list, where the car is the file match, and the cdr is the way to
+extract an element from the tags output.  If the output is complex,
+use a function symbol instead of regexp.  The function should expect
+to be at the beginning of a line in the etags buffer.
 
-This variable is ignored if `speedbar-use-imenu-package' is `t'")
+This variable is ignored if `speedbar-use-imenu-flag' is t")
 
 (defvar speedbar-fetch-etags-command "etags"
   "*Command used to create an etags file.
 
-This variable is ignored if `speedbar-use-imenu-package' is `t'")
+This variable is ignored if `speedbar-use-imenu-flag' is t")
 
 (defvar speedbar-fetch-etags-arguments '("-D" "-I" "-o" "-")
-  "*List of arguments to use with `speedbar-fetch-etags-command' to create
-an etags output buffer.
+  "*List of arguments to use with `speedbar-fetch-etags-command'.
+This creates an etags output buffer.  Use `speedbar-toggle-etags' to
+modify this list conveniently.
+
+This variable is ignored if `speedbar-use-imenu-flag' is t")
+
+(defun speedbar-toggle-etags (flag)
+  "Toggle FLAG in `speedbar-fetch-etags-arguments'.
+FLAG then becomes a member of etags command line arguments.  If flag
+is \"sort\", then toggle the value of `speedbar-sort-tags'.  If it's
+value is \"show\" then toggle the value of
+`speedbar-show-unknown-files'.
 
-This variable is ignored if `speedbar-use-imenu-package' is `t'")
+  This function is a convenience function for XEmacs menu created by
+Farzin Guilak <farzin@protocol.com>"
+  (interactive)
+  (cond
+   ((equal flag "sort")
+    (setq speedbar-sort-tags (not speedbar-sort-tags)))
+   ((equal flag "show")
+    (setq speedbar-show-unknown-files (not speedbar-show-unknown-files)))
+   ((or (equal flag "-C")
+	(equal flag "-S")
+	(equal flag "-D"))
+    (if (member flag speedbar-fetch-etags-arguments)
+	(setq speedbar-fetch-etags-arguments
+	      (delete flag speedbar-fetch-etags-arguments))
+      (add-to-list 'speedbar-fetch-etags-arguments flag)))
+   (t nil)))
 
 (defun speedbar-fetch-dynamic-etags (file)
-  "For the complete file definition FILE, run etags as a subprocess,
-fetch it's output, and create a list of symbols extracted, and their
-position in FILE."
+  "For FILE, run etags and create a list of symbols extracted.
+Each symbol will be associated with it's line position in FILE."
   (let ((newlist nil))
     (unwind-protect
 	(save-excursion
 	  (if (get-buffer "*etags tmp*")
 	      (kill-buffer "*etags tmp*"))	;kill to clean it up
+	  (if (<= 1 speedbar-verbosity-level) (message "Fetching etags..."))
 	  (set-buffer (get-buffer-create "*etags tmp*"))
-	  (apply 'call-process speedbar-fetch-etags-command nil 
-		 (current-buffer) nil 
+	  (apply 'call-process speedbar-fetch-etags-command nil
+		 (current-buffer) nil
 		 (append speedbar-fetch-etags-arguments (list file)))
 	  (goto-char (point-min))
-	  (let ((expr 
+	  (if (<= 1 speedbar-verbosity-level) (message "Fetching etags..."))
+	  (let ((expr
 		 (let ((exprlst speedbar-fetch-etags-parse-list)
 		       (ans nil))
 		   (while (and (not ans) exprlst)
@@ -1136,15 +2315,34 @@
 		    (forward-line 1)))
 	      (message "Sorry, no support for a file of that extension"))))
       )
-    (reverse newlist)))
+    (if speedbar-sort-tags
+	(sort newlist (lambda (a b) (string< (car a) (car b))))
+      (reverse newlist))))
+
+;; This bit donated by Farzin Guilak <farzin@protocol.com> but I'm not
+;; sure it's needed with the different sorting method.
+;;
+;(defun speedbar-clean-etags()
+;  "Removes spaces before the ^? character, and removes `#define',
+;return types, etc. preceding tags.  This ensures that the sort operation
+;works on the tags, not the return types."
+;  (save-excursion
+;    (goto-char (point-min))
+;    (while
+;	(re-search-forward "(?[ \t](?\C-?" nil t)
+;      (replace-match "\C-?" nil nil))
+;    (goto-char (point-min))
+;    (while
+;	(re-search-forward "\\(.*[ \t]+\\)\\([^ \t\n]+.*\C-?\\)" nil t)
+;      (delete-region (match-beginning 1) (match-end 1)))))
 
 (defun speedbar-extract-one-symbol (expr)
-  "At point in current buffer, return nil, or one alist of the form
-of a dotted pair: ( symbol . position ) from etags output.  Parse the
-output using the regular expression EXPR"
+  "At point, return nil, or one alist in the form: ( symbol . position )
+The line should contain output from etags.  Parse the output using the
+regular expression EXPR"
   (let* ((sym (if (stringp expr)
 		  (if (save-excursion
-			(re-search-forward expr (save-excursion 
+			(re-search-forward expr (save-excursion
 						  (end-of-line)
 						  (point)) t))
 		      (buffer-substring-no-properties (match-beginning 1)
@@ -1157,7 +2355,7 @@
 					  t)))
 		(if (and j sym)
 		    (1+ (string-to-int (buffer-substring-no-properties
-					(match-beginning 2) 
+					(match-beginning 2)
 					(match-end 2))))
 		  0))))
     (if (/= pos 0)
@@ -1181,7 +2379,7 @@
       )))
 
 (defun speedbar-parse-tex-string ()
-  "Parse a tex string.  Only find data which is relevant"
+  "Parse a Tex string.  Only find data which is relevant."
   (save-excursion
     (let ((bound (save-excursion (end-of-line) (point))))
       (cond ((re-search-forward "\\(section\\|chapter\\|cite\\)\\s-*{[^\C-?}]*}?" bound t)
@@ -1190,107 +2388,15 @@
 	    (t nil)))))
 
 
-;;;
-;;; configuration scripts (optional)
-;;;
-(defun speedbar-configure-options ()
-  "Configure variable options for the speedbar program using dlg-config"
-  (interactive)
-  (require 'dlg-config)
-  (save-excursion
-    (select-frame speedbar-attached-frame)
-    (dlg-init)
-    (let ((oframe (create-widget "Speedbar Options" widget-frame 
-				 widget-toplevel-shell
-				 :x 2 :y -3
-				 :frame-label "Speedbar Options"))
-	)
-      (create-widget "show-unknown" widget-toggle-button oframe
-		     :x 1 :y 1 :label-value "Show files that are not supported by imenu"
-		     :state (data-object-symbol "speedbar-show-unknown-files"
-						:value speedbar-show-unknown-files
-						:symbol 'speedbar-show-unknown-files))
-      
-      (create-widget "raiselower" widget-toggle-button oframe
-		     :x 1 :y -1 :label-value "Use frame auto raise/lower property"
-		     :state (data-object-symbol "speedbar-raise-lower"
-						:value speedbar-raise-lower
-						:symbol 'speedbar-raise-lower))
-      
-      (create-widget "update-speed" widget-label oframe
-		     :x 1 :y -2 :label-value "Update Delay    :")
-      (create-widget "update-speed-txt" widget-text-field oframe
-		     :width 5 :height 1 :x -2 :y t 
-		     :value (data-object-symbol-string-to-int 
-			     "update-speed"
-			     :symbol 'speedbar-update-speed
-			     :value  (int-to-string speedbar-update-speed)))
-      (create-widget "update-speed-unit" widget-label oframe
-		     :x -3 :y t :label-value "Seconds")
-      
-      (create-widget "navigating-speed" widget-label oframe
-		     :x 1 :y -1 :label-value "Navigating Delay:")
-      (create-widget "navigating-speed-txt" widget-text-field oframe
-		     :width 5 :height 1 :x -2 :y t 
-		     :value (data-object-symbol-string-to-int 
-			     "navigating-speed"
-			     :symbol 'speedbar-navigating-speed
-			     :value  (int-to-string speedbar-navigating-speed)))
-      (create-widget "navigating-speed-unit" widget-label oframe
-		     :x -3 :y t :label-value "Seconds")
-
-      (create-widget "width" widget-label oframe
-		     :x 1 :y -2 :label-value "Display Width   :")
-      (create-widget "width-txt" widget-text-field oframe
-		     :width 5 :height 1 :x -2 :y t 
-		     :value (data-object-symbol-string-to-int 
-			     "width"
-			     :symbol 'speedbar-width
-			     :value  (int-to-string speedbar-width)))
-      (create-widget "width-unit" widget-label oframe
-		     :x -3 :y t :label-value "Characters")
-      
-      (create-widget "scrollbar-width" widget-label oframe
-		     :x 1 :y -1 :label-value "Scrollbar Width :")
-      (create-widget "scrollbar-width-txt" widget-text-field oframe
-		     :width 5 :height 1 :x -2 :y t 
-		     :value (data-object-symbol-string-to-int 
-			     "width"
-			     :symbol 'speedbar-width
-			     :value  (int-to-string speedbar-scrollbar-width)))
-      (create-widget "scrollbar-width-unit" widget-label oframe
-		     :x -3 :y t :label-value "Pixels")
-      
-      
-      )
-    (dlg-end)
-    (dialog-refresh)
-    ))
-
-(defun speedbar-configure-faces ()
-  "Configure faces for the speedbar program using dlg-config."
-  (interactive)
-  (require 'dlg-config)
-  (save-excursion
-    (select-frame speedbar-attached-frame)
-    (dlg-faces '(speedbar-button-face
-		 speedbar-file-face
-		 speedbar-directory-face
-		 speedbar-tag-face
-		 speedbar-highlight-face
-		 speedbar-selected-face))))
-
-;;;
-;;; Color loading section  This is message *Blech!*
-;;;
+;;; Color loading section  This is messy *Blech!*
+;;
 (defun speedbar-load-color (sym l-fg l-bg d-fg d-bg &optional bold italic underline)
-  "Create a color for SYM with a L-FG and L-BG color, or D-FG and
-D-BG. Optionally make BOLD, ITALIC, or UNDERLINED if applicable.  If
-the background attribute of the current frame is determined to be
-light (white, for example) then L-FG and L-BG is used.  If not, then
-D-FG and D-BG is used.  This will allocate the colors in the best
-possible mannor.  This will allow me to store multiple defaults and
-dynamically determine which colors to use."
+  "Create a color for SYM with a L-FG and L-BG color, or D-FG and D-BG.
+Optionally make BOLD, ITALIC, or UNDERLINE if applicable.  If the background
+attribute of the current frame is determined to be light (white, for example)
+then L-FG and L-BG is used.  If not, then D-FG and D-BG is used.  This will
+allocate the colors in the best possible manor.  This will allow me to store
+multiple defaults and dynamically determine which colors to use."
   (let* ((params (frame-parameters))
 	 (disp-res (if (fboundp 'x-get-resource)
 		       (if speedbar-xemacsp
@@ -1308,24 +2414,36 @@
 		   nil))
 	 (bgmode
 	  (cond (bg-res (intern (downcase bg-res)))
-		((and params 
-		      (fboundp 'x-color-values)
-		      (< (apply '+ (x-color-values
-				    (cdr (assq 'background-color params))))
-			 (/ (apply '+ (x-color-values "white")) 3)))
+		((let* ((bgc (or (cdr (assq 'background-color params))
+				 (if speedbar-xemacsp
+				     (x-get-resource ".background"
+						     "Background" 'string)
+				   (x-get-resource ".background"
+						   "Background"))
+				 ;; if no other options, default is white
+				 "white"))
+			(bgcr (if speedbar-xemacsp
+				  (color-instance-rgb-components
+				   (make-color-instance bgc))
+				(x-color-values bgc)))
+			(wcr (if speedbar-xemacsp
+				 (color-instance-rgb-components
+				  (make-color-instance "white"))
+			       (x-color-values "white"))))
+		   (< (apply '+ bgcr) (/ (apply '+ wcr) 3)))
 		 'dark)
 		(t 'light)))		;our default
 	 (set-p (function (lambda (face-name resource)
 			    (if speedbar-xemacsp
-				(x-get-resource 
+				(x-get-resource
 				 (concat face-name ".attribute" resource)
 				 (concat "Face.Attribute" resource)
 				 'string)
-			      (x-get-resource 
+			      (x-get-resource
 			       (concat face-name ".attribute" resource)
 			       (concat "Face.Attribute" resource)))
 			    )))
-	 (nbg (cond ((eq bgmode 'dark) d-bg) 
+	 (nbg (cond ((eq bgmode 'dark) d-bg)
 		    (t l-bg)))
 	 (nfg (cond ((eq bgmode 'dark) d-fg)
 		    (t l-fg))))
@@ -1336,7 +2454,7 @@
 	  (copy-face 'default sym)
 	  (if bold (condition-case nil
 		       (make-face-bold sym)
-		     (error (message "Cannot make face %s bold!" 
+		     (error (message "Cannot make face %s bold!"
 				     (symbol-name sym)))))
 	  (if italic (condition-case nil
 			 (make-face-italic sym)
@@ -1349,27 +2467,24 @@
       (let ((newface (make-face sym)))
 	;; For each attribute, check if it might already be set by Xdefaults
 	(if (and nfg (not (funcall set-p (symbol-name sym) "Foreground")))
-	    (set-face-foreground sym nfg))
+	    (set-face-foreground newface nfg))
 	(if (and nbg (not (funcall set-p (symbol-name sym) "Background")))
-	    (set-face-background sym nbg))
-	
+	    (set-face-background newface nbg))
+
 	(if bold (condition-case nil
-		     (make-face-bold sym)
+		     (make-face-bold newface)
 		   (error (message "Cannot make face %s bold!"
 				       (symbol-name sym)))))
 	(if italic (condition-case nil
-		       (make-face-italic sym)
+		       (make-face-italic newface)
 		     (error (message "Cannot make face %s italic!"
-				     (symbol-name sym)))))
-	(set-face-underline-p sym underline)
+				     (symbol-name newface)))))
+	(set-face-underline-p newface underline)
 	))))
 
-                               ;; JTL <<<<
-(if nil ;;(x-display-color-p)  ;; just a quick hack so it will run.
-                               ;; we can use customize for this.
-                               ;; <<<< JTL
+(if (x-display-color-p)
     (progn
-      (speedbar-load-color 'speedbar-button-face "green4" "default" "green3" "default")
+      (speedbar-load-color 'speedbar-button-face "green4" nil "green3" nil nil nil nil)
       (speedbar-load-color 'speedbar-file-face "cyan4" nil "cyan" nil nil nil nil)
       (speedbar-load-color 'speedbar-directory-face "blue4" nil "light blue" nil nil nil nil)
       (speedbar-load-color 'speedbar-tag-face "brown" nil "yellow" nil nil nil nil)
@@ -1388,7 +2503,13 @@
 
   ) ;; monochrome
 
-;;; end of lisp
+;; some edebug hooks
+(add-hook 'edebug-setup-hook
+	  (lambda ()
+	    (def-edebug-spec speedbar-with-writable def-body)))
+
+;; run load-time hooks
+(run-hooks 'speedbar-load-hook)
+
 (provide 'speedbar)
-
-;;; speedbar.el ends here
+;;; speedbar ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/utils/speedbspec.el	Mon Aug 13 09:45:46 2007 +0200
@@ -0,0 +1,305 @@
+;;; speedbspec --- Buffer specialized configurations for speedbar
+
+;; Copyright (C) 1997 Eric M. Ludlam
+;;
+;; Author: Eric M. Ludlam <zappo@gnu.ai.mit.edu>
+;; Version: 0.1
+;; Keywords: file, tags, tools
+;; X-RCS: $Id: speedbspec.el,v 1.1 1997/06/29 23:13:34 steve Exp $
+;;
+;; This program 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.
+;;
+;; This program 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 this program; if not, you can either send email to this
+;; program's author (see below) or write to:
+;;
+;;              The Free Software Foundation, Inc.
+;;              675 Mass Ave.
+;;              Cambridge, MA 02139, USA.
+;;
+;; Please send bug reports, etc. to zappo@gnu.ai.mit.edu.
+;;
+
+;;; Commentary:
+;;
+;;   Speedbar provides a frame in which files, and locations in
+;; files are displayed.  These functions provide some mode-specific
+;; displays for some existing emacs modes.
+;;
+;;   To provide special service to all the modes supported by this file,
+;; put the following in your .emacs file.
+;;
+;; (require 'speedbspec)
+;;
+;;   This will load in the known functions, and the mode-enabling code
+;; into 'change-major-mode-hook.
+;;
+;;   This file requires speedbar.
+
+;;; Change log:
+;;  0.1 - Initial revision requiring speedbar 0.5
+
+;;; Code:
+(require 'speedbar)
+
+;;; Generic add-new-special-mode stuff
+;;
+(defvar speedbar-localized-buffer-queue nil
+  "List of buffers to localize for speedbar.")
+
+(defun speedbar-add-localized-speedbar-support-to-q ()
+  "Add speedbar support to all buffers in `speedbar-localized-buffer-queue'."
+  (remove-hook 'post-command-hook
+	       'speedbar-add-localized-speedbar-support-to-q)
+  (while speedbar-localized-buffer-queue
+    (speedbar-add-localized-speedbar-support
+     (car speedbar-localized-buffer-queue))
+    (setq speedbar-localized-buffer-queue
+	  (cdr speedbar-localized-buffer-queue))))
+
+(defun speedbar-add-localized-speedbar-support (buffer)
+  "Add localized speedbar support to BUFFER's mode if it is available."
+  (if (not (buffer-live-p buffer))
+      nil
+    (save-excursion
+      (set-buffer buffer)
+      (save-match-data
+	(let ((ms (symbol-name major-mode))
+	      v tmp)
+	  (if (not (string-match "-mode$" ms))
+	      nil ;; do nothing to broken mode
+	    (setq ms (substring ms 0 (match-beginning 0)))
+	    (setq v (intern-soft (concat ms "-speedbar-buttons")))
+	    (if (not v)
+		nil ;; do nothing if not defined
+	      (make-local-variable 'speedbar-special-mode-expansion-list)
+	      (setq speedbar-special-mode-expansion-list (list v))
+	      (setq v (intern-soft (concat ms "-speedbar-menu-items")))
+	      (if (not v)
+		  nil ;; don't add special menus
+		(make-local-variable 'speedbar-easymenu-definition-special)
+		(setq speedbar-easymenu-definition-special
+		      (symbol-value v))))))))))
+  
+(defun speedbar-change-major-mode ()
+  "Run when the major mode is changed."
+  (setq speedbar-localized-buffer-queue
+	(add-to-list 'speedbar-localized-buffer-queue (current-buffer)))
+  (add-hook 'post-command-hook 'speedbar-add-localized-speedbar-support-to-q))
+
+(add-hook 'change-major-mode-hook 'speedbar-change-major-mode)
+(add-hook 'find-file-hooks 'speedbar-change-major-mode)
+
+;;; Info specific code
+;;
+(defvar Info-last-speedbar-node nil
+  "Last node viewed with speedbar in the form '(NODE FILE).")
+
+(defvar Info-speedbar-menu-items
+  '(["Browse Item On Line" speedbar-edit-line t])
+  "Additional menu-items to add to speedbar frame.")
+
+(defun Info-speedbar-buttons (buffer)
+  "Create a speedbar display to help navigation in an Info file.
+BUFFER is the buffer speedbar is requesting buttons for."
+  (goto-char (point-min))
+  (if (and (looking-at "<Directory>")
+	   (save-excursion
+	     (set-buffer buffer)
+	     (and (equal (car Info-last-speedbar-node) Info-current-node)
+		  (equal (cdr Info-last-speedbar-node) Info-current-file))))
+      nil
+    (erase-buffer)
+    (speedbar-insert-button "<Directory>" 'info-xref 'highlight
+			    'Info-speedbar-button
+			    'Info-directory)
+    (speedbar-insert-button "<Top>" 'info-xref 'highlight
+			    'Info-speedbar-button
+			    'Info-top-node)
+    (speedbar-insert-button "<Last>" 'info-xref 'highlight
+			    'Info-speedbar-button
+			    'Info-last)
+    (speedbar-insert-button "<Up>" 'info-xref 'highlight
+			    'Info-speedbar-button
+			    'Info-up)
+    (speedbar-insert-button "<Next>" 'info-xref 'highlight
+			    'Info-speedbar-button
+			    'Info-next)
+    (speedbar-insert-button "<Prev>" 'info-xref 'highlight
+			    'Info-speedbar-button
+			    'Info-prev)
+    (let ((completions nil))
+      (save-excursion
+	(set-buffer buffer)
+	(setq Info-last-speedbar-node
+	      (cons Info-current-node Info-current-file))
+	(goto-char (point-min))
+	;; Always skip the first one...
+	(re-search-forward "\n\\* \\([^:\t\n]*\\):" nil t)
+	(while (re-search-forward "\n\\* \\([^:\t\n]*\\):" nil t)
+	  (setq completions (cons (buffer-substring (match-beginning 1)
+						    (match-end 1))
+				  completions))))
+      (setq completions (nreverse completions))
+      (while completions
+	(speedbar-make-tag-line nil nil nil nil
+				(car completions) 'Info-speedbar-menu
+				nil 'info-node 0)
+	(setq completions (cdr completions))))))
+
+(defun Info-speedbar-button (text token indent)
+  "Called when user clicks <Directory> from speedbar.
+TEXT, TOKEN, and INDENT are unused."
+  (speedbar-with-attached-buffer
+   (funcall token)
+   (setq Info-last-speedbar-node nil)
+   (speedbar-update-contents)))
+
+(defun Info-speedbar-menu (text token indent)
+  "Goto the menu node specified in TEXT.
+TOKEN and INDENT are not used."
+  (speedbar-with-attached-buffer
+   (Info-menu text)
+   (setq Info-last-speedbar-node nil)
+   (speedbar-update-contents)))
+
+;;; RMAIL specific code
+;;
+(defvar rmail-speedbar-last-user nil
+  "The last user to be displayed in the speedbar.")
+
+(defvar rmail-speedbar-menu-items
+  '(["Browse Item On Line" speedbar-edit-line t]
+    ["Move message to folder" rmail-move-message-to-folder-on-line
+     (save-excursion (beginning-of-line)
+		     (looking-at "<M> "))])
+  "Additional menu-items to add to speedbar frame.")
+
+(defun rmail-speedbar-buttons (buffer)
+  "Create buttons for BUFFER containing rmail messages.
+Click on the address under Reply to: to reply to this person.
+Under Folders: Click a name to read it, or on the <M> to move the
+current message into that RMAIL folder."
+  (let ((from nil))
+    (save-excursion
+      (set-buffer buffer)
+      (goto-char (point-min))
+      (if (not (re-search-forward "^Reply-To: " nil t))
+	  (if (not (re-search-forward "^From:? " nil t))
+	      (setq from t)))
+      (if from
+	  nil
+	(setq from (buffer-substring (point) (save-excursion
+					       (end-of-line)
+					       (point))))))
+    (goto-char (point-min))
+    (if (and (looking-at "Reply to:")
+	     (equal from rmail-speedbar-last-user))
+	nil
+      (setq rmail-speedbar-last-user from)
+      (erase-buffer)
+      (insert "Reply To:\n")
+      (if (stringp from)
+	  (speedbar-insert-button from 'speedbar-directory-face 'highlight
+				  'rmail-speedbar-button 'rmail-reply))
+      (insert "Folders:\n")
+      (let* ((case-fold-search nil)
+	     (df (directory-files (save-excursion (set-buffer buffer)
+						  default-directory)
+				  nil "^[A-Z0-9]+\\(\\.[A-Z0-9]+\\)?$")))
+	(while df
+	  (speedbar-insert-button "<M>" 'speedbar-button-face 'highlight
+				  'rmail-speedbar-move-message (car df))
+	  (speedbar-insert-button (car df) 'speedbar-file-face 'highlight
+				  'rmail-speedbar-find-file nil t)
+	  (setq df (cdr df)))))))
+
+(defun rmail-speedbar-button (text token indent)
+  "Execute an rmail command specified by TEXT.
+The command used is TOKEN.  INDENT is not used."
+  (speedbar-with-attached-buffer
+   (funcall token t)))
+
+(defun rmail-speedbar-find-file (text token indent)
+  "Load in the rmail file TEXT.
+TOKEN and INDENT are not used."
+  (speedbar-with-attached-buffer
+   (message "Loading in RMAIL file %s..." text)
+   (find-file text)))
+
+(defun rmail-move-message-to-folder-on-line ()
+  "If the current line is a folder, move current message to it."
+  (interactive)
+  (save-excursion
+    (beginning-of-line)
+    (if (re-search-forward "<M> " (save-excursion (end-of-line) (point)) t)
+	(progn
+	  (forward-char -2)
+	  (speedbar-do-function-pointer)))))
+
+(defun rmail-speedbar-move-message (text token indent)
+  "From button TEXT, copy current message to the rmail file specified by TOKEN.
+TEXT and INDENT are not used."
+  (speedbar-with-attached-buffer
+   (message "Moving message to %s" token)
+   (rmail-output-to-rmail-file token)))
+
+;;; W3 speedbar help
+(defvar w3-speedbar-last-buffer nil
+  "The last buffer shown by w3-speedbar.")
+
+(defun w3-speedbar-buttons (buffer)
+  "Create speedbar buttons for the current web BUFFER displayed in w3 mode."
+  (save-excursion
+    (goto-char (point-min))
+    (if (and (looking-at "History:") (equal w3-speedbar-last-buffer buffer))
+	nil
+      (setq w3-speedbar-last-buffer buffer)
+      (erase-buffer)
+      (let ((links (save-excursion (set-buffer buffer) (w3-only-links)))
+	    (part nil))
+	(insert "History:\n")
+	;; This taken out of w3 which was used to create the history list,
+	;; and is here modified to create the speedbar buttons
+	(cl-maphash
+	 (function
+	  (lambda (url desc)
+	    (speedbar-insert-button (w3-speedbar-shorten-button url)
+				    'speedbar-directory-face 'highlight
+				    'w3-speedbar-link url)))
+	 url-history-list)
+	(insert "Links:\n")
+	(while links
+	  (setq part (car (cdr (member 'href (car links))))
+		links (cdr links))
+	  (speedbar-insert-button (w3-speedbar-shorten-button part)
+				  'speedbar-file-face 'highlight
+				  'w3-speedbar-link part))))))
+    
+(defun w3-speedbar-shorten-button (button)
+  "Takes text BUTTON and shortens it as much as possible."
+  ;; I should make this more complex, but I'm not sure how...
+  (let ((fnnd (file-name-nondirectory button)))
+    (if (< 0 (length fnnd))
+	fnnd
+      (if (string-match "\\(ht\\|f\\)tp://" button)
+	  (setq button (substring button (match-end 0))))
+      (if (string-match "/$" button)
+	  (setq button (substring button 0 (match-beginning 0))))
+      button)))
+
+(defun w3-speedbar-link (text token indent)
+  "Follow link described by TEXT which has the URL TOKEN.
+INDENT is not used."
+  (speedbar-with-attached-buffer (w3-fetch token)))
+
+(provide 'speedbspec)
+;;; speedbspec ends here
--- a/lisp/viper/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/viper/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/vm/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/vm/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/w3/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/w3/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,6 +1,8 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
 (put 'url 'custom-loads '("url-gw" "url-irc" "url-vars" "url"))
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/x11/custom-load.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/x11/custom-load.el	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,7 @@
+(put 'extensions 'custom-loads '())
 (put 'copyright 'custom-loads '())
 (put 'eldoc 'custom-loads '())
+(put 'auto-show 'custom-loads '())
 (put 'execute 'custom-loads '())
 (put 'mouse 'custom-loads '())
 (put 'mail-abbrevs 'custom-loads '())
--- a/lisp/x11/x-menubar.el	Mon Aug 13 09:44:44 2007 +0200
+++ b/lisp/x11/x-menubar.el	Mon Aug 13 09:45:46 2007 +0200
@@ -104,15 +104,15 @@
       ["Start Macro Recording"	start-kbd-macro	      (not defining-kbd-macro)]
       ["End Macro Recording"	end-kbd-macro		defining-kbd-macro]
       ["Execute Last Macro"	call-last-kbd-macro	last-kbd-macro]
+      "----"
+      ["Show Message Log"	show-message-log	t]
       )
      
      ,@(if (featurep 'mule)
 	   '(("Mule"
-	      ;; ["Describe language support"
-	       ;; mule-describe-language-support-prefix nil]
-	      ;; ["Set language environment"
-	       ;; mule-set-language-environment-prefix nil]
-	      ;; "--"
+	      ("Describe language support")
+	      ("Set language environment")
+	      "--"
 	      ["Toggle input method" toggle-input-method t]
 	      ["Select input method" select-input-method t]
 	      ["Describe input method" describe-input-method t]
@@ -128,6 +128,7 @@
 	      ["Set coding system of process"
 	       set-current-process-coding-system nil] ; not implemented yet
 	      "--"
+	      ["Show character table" view-charset-by-menu t]
 	      ["Show diagnosis for MULE" mule-diag nil] ; not implemented yet
 	      ["Show many languages" view-hello-file t]
 	      )))
--- a/man/custom.texi	Mon Aug 13 09:44:44 2007 +0200
+++ b/man/custom.texi	Mon Aug 13 09:45:46 2007 +0200
@@ -303,6 +303,7 @@
 @item
 Support undo using lmi's @file{gnus-undo.el}.
 
+
 @item
 Make it possible to append to `choice', `radio', and `set' options.
 
@@ -401,6 +402,11 @@
 `empty' style with just the group name, and `compact' with only one line
 per item.
 
+@item
+Newline and tab should be displayed as @samp{^J} and @samp{^I} in the
+@code{regexp} and @code{file} widgets.  I think this can be done in
+XEmacs by adding a display table to the face.
+
 @end itemize
 
 @contents
--- a/man/gnus.texi	Mon Aug 13 09:44:44 2007 +0200
+++ b/man/gnus.texi	Mon Aug 13 09:45:46 2007 +0200
@@ -1,7 +1,7 @@
 \input texinfo                  @c -*-texinfo-*-
 
 @setfilename gnus
-@settitle Gnus 5.4.59 Manual
+@settitle Gnus 5.4.60 Manual
 @synindex fn cp
 @synindex vr cp
 @synindex pg cp
@@ -309,7 +309,7 @@
 @tex
 
 @titlepage
-@title Gnus 5.4.59 Manual
+@title Gnus 5.4.60 Manual
 
 @author by Lars Magne Ingebrigtsen
 @page
@@ -345,7 +345,7 @@
 spool or your mbox file.  All at the same time, if you want to push your
 luck.
 
-This manual corresponds to Gnus 5.4.59.
+This manual corresponds to Gnus 5.4.60.
 
 @end ifinfo
 
@@ -6754,6 +6754,25 @@
                         [Paa]
 @end example
 
+If you're using horizontal trees, it might be nice to display the trees
+side-by-side with the summary buffer.  You could add something like the
+following to your @file{.gnus.el} file:
+
+@lisp
+(setq gnus-use-trees t
+      gnus-generate-tree-function 'gnus-generate-horizontal-tree
+      gnus-tree-minimize-window nil)
+(gnus-add-configuration
+ '(article
+   (vertical 1.0
+             (horizontal 0.25
+                         (summary 0.75 point)
+                         (tree 1.0))
+             (article 1.0))))
+@end lisp
+
+@xref{Windows Configuration}.
+
 
 @node Mail Group Commands
 @section Mail Group Commands
@@ -12835,7 +12854,9 @@
 instead of the normal @code{1.0} top-level spec, each additional split
 should have a frame parameter alist as the size spec.
 @xref{Frame Parameters, , Frame Parameters, elisp, The GNU Emacs Lisp
-Reference Manual}.
+Reference Manual}.  Under XEmacs, a frame property list will be
+accepted, too---for instance, @code{(height 5 width 15 left -1 top 1)}
+is such a plist.
 
 Here's a list of all possible keys for
 @code{gnus-buffer-configuration}:
--- a/man/message.texi	Mon Aug 13 09:44:44 2007 +0200
+++ b/man/message.texi	Mon Aug 13 09:45:46 2007 +0200
@@ -1,7 +1,7 @@
 \input texinfo                  @c -*-texinfo-*-
 
 @setfilename message
-@settitle Message 5.4.59 Manual
+@settitle Message 5.4.60 Manual
 @synindex fn cp
 @synindex vr cp
 @synindex pg cp
@@ -39,7 +39,7 @@
 @tex
 
 @titlepage
-@title Message 5.4.59 Manual
+@title Message 5.4.60 Manual
 
 @author by Lars Magne Ingebrigtsen
 @page
@@ -79,7 +79,7 @@
 * Key Index::         List of Message mode keys.
 @end menu
 
-This manual corresponds to Message 5.4.59.  Message is distributed with
+This manual corresponds to Message 5.4.60.  Message is distributed with
 the Gnus distribution bearing the same version number as this manual
 has. 
 
--- a/man/widget.texi	Mon Aug 13 09:44:44 2007 +0200
+++ b/man/widget.texi	Mon Aug 13 09:45:46 2007 +0200
@@ -13,7 +13,7 @@
 @comment  node-name,  next,  previous,  up
 @top The Emacs Widget Library
 
-Version: 1.9931
+Version: 1.9940
 
 @menu
 * Introduction::                
@@ -1468,7 +1468,7 @@
 The following predefined function can be used here:
 
 @defun widget-parent-action widget &optional event
-Tell @code{:parent} of @var{widget} to handle the @code{:action}.@br
+Tell @code{:parent} of @var{widget} to handle the @code{:action}.@*
 Optional @var{event} is the event that triggered the action.
 @end defun
 
@@ -1538,13 +1538,13 @@
 @section Utilities.
 
 @defun widget-prompt-value widget prompt [ value unbound ]
-Prompt for a value matching @var{widget}, using @var{prompt}.@br
+Prompt for a value matching @var{widget}, using @var{prompt}.@*
 The current value is assumed to be @var{value}, unless @var{unbound} is
 non-nil.@refill
 @end defun
 
 @defun widget-get-sibling widget
-Get the item @var{widget} is assumed to toggle.@br
+Get the item @var{widget} is assumed to toggle.@*
 This is only meaningful for radio buttons or checkboxes in a list.
 @end defun
 
--- a/nt/config.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/nt/config.h	Mon Aug 13 09:45:46 2007 +0200
@@ -105,6 +105,8 @@
 #define HAVE_LOCALE_H
 #define HAVE_X11_LOCALE_H
 #define STDC_HEADERS
+#define HAVE_LIMITS_H
+#define HAVE_GETCWD
 
 #define HAVE_LONG_FILE_NAMES
 
@@ -362,8 +364,21 @@
 */
 #undef HAVE_CDE
 
-/* Mocklisp Support. */
-#undef MOCKLISP_SUPPORT
+/* Define this if you want Mule support (multi-byte character support).
+   There may be some performance penalty, although it should be small
+   if you're working with ASCII files. */
+#define MULE
+
+/* Do we want to use X window input methods for use with Mule? (requires X11R5)
+   If so, use raw Xlib or higher level Motif interface? */
+#define HAVE_XIM
+#define XIM_XLIB
+#undef XIM_MOTIF
+
+/* Non-XIM input methods for use with Mule. */
+#undef HAVE_CANNA
+#undef HAVE_WNN
+#undef WNN6
 
 /* enable special GNU Make features in the Makefiles. */
 #undef USE_GNU_MAKE
--- a/nt/xemacs.mak	Mon Aug 13 09:44:44 2007 +0200
+++ b/nt/xemacs.mak	Mon Aug 13 09:45:46 2007 +0200
@@ -1,16 +1,18 @@
-MSDEV=F:/msdev
-X11R6=F:/utils/X11R6
+MSDEV=G:/msdev
+X11R6=G:/utils/X11R6
 XEMACS=..
 LISP=$(XEMACS)/lisp
 
+EMACS_MAJOR_VERSION=20
+EMACS_MINOR_VERSION=3
+XEMACS_CODENAME=\"Copenhagen\"
+
 #------------------------------------------------------------------------------
 
 # Generic variables
 
 INCLUDES=-I$(X11R6)/include -I$(XEMACS)/nt/inc -I$(XEMACS)/src\
  -I$(XEMACS)/lwlib -I$(MSDEV)/include
-#INCLUDES=-I$(X11R6)/include -I$(XEMACS)/src\
-# -I$(XEMACS)/lwlib -I$(MSDEV)/include
 LIBRARIES=
 
 OUTDIR=obj
@@ -114,7 +116,6 @@
  $(XEMACS)/src/console-x.c \
  $(XEMACS)/src/console.c \
  $(XEMACS)/src/data.c \
- $(XEMACS)/src/database.c \
  $(XEMACS)/src/debug.c \
  $(XEMACS)/src/device-x.c \
  $(XEMACS)/src/device.c \
@@ -171,7 +172,6 @@
  $(XEMACS)/src/menubar-x.c \
  $(XEMACS)/src/menubar.c \
  $(XEMACS)/src/minibuf.c \
- $(XEMACS)/src/mocklisp.c \
  $(XEMACS)/src/nt.c \
  $(XEMACS)/src/ntheap.c \
  $(XEMACS)/src/ntproc.c \
@@ -208,7 +208,15 @@
  $(XEMACS)/src/xselect.c \
  $(XEMACS)/src/balloon-x.c \
  $(XEMACS)/src/balloon_help.c
+
 DOC_SRCS_2=\
+ $(XEMACS)/src/input-method-xlib.c \
+ $(XEMACS)/src/mule.c \
+ $(XEMACS)/src/mule-charset.c \
+ $(XEMACS)/src/mule-ccl.c \
+ $(XEMACS)/src/mule-coding.c
+
+DOC_SRCS_3=\
  $(LISP)/version.el \
  $(LISP)/paths.el \
  $(LISP)/prim/loaddefs.elc \
@@ -268,9 +276,11 @@
  $(LISP)/bytecomp/bytecomp-runtime.elc \
  $(LISP)/prim/float-sup.elc \
  $(LISP)/prim/itimer.elc \
+ $(LISP)/prim/itimer-autosave.elc \
  $(LISP)/ediff/ediff-hook.elc \
  $(LISP)/packages/fontl-hooks.elc 
-DOC_SRCS_3= \
+
+DOC_SRCS_4= \
  $(LISP)/prim/scrollbar.elc \
  $(LISP)/prim/buffer.elc \
  $(LISP)/prim/menubar.elc \
@@ -286,12 +296,36 @@
  $(LISP)/x11/x-misc.elc \
  $(LISP)/x11/x-init.elc \
  $(LISP)/prim/dialog.elc \
- $(LISP)/prim/files-nomule.elc
-
-# MULE_LISP or NOMULE_LISP
+ $(LISP)/mule/mule-load.elc \
+ $(LISP)/mule/mule-coding.elc \
+ $(LISP)/mule/mule-charset.elc \
+ $(LISP)/mule/mule-files.elc \
+ $(LISP)/mule/mule-category.elc \
+ $(LISP)/mule/mule-misc.elc \
+ $(LISP)/mule/mule-ccl.elc \
+ $(LISP)/mule/mule-init.elc \
+ $(LISP)/mule/mule-cmds.elc \
+ $(LISP)/mule/kinsoku.elc \
+ $(LISP)/mule/mule-x-init.elc \
+ $(LISP)/mule/arabic-hooks.elc \
+ $(LISP)/mule/chinese-hooks.elc \
+ $(LISP)/mule/cyrillic-hooks.elc \
+ $(LISP)/mule/ethiopic-hooks.elc \
+ $(LISP)/mule/european-hooks.elc \
+ $(LISP)/mule/greek-hooks.elc \
+ $(LISP)/mule/hebrew-hooks.elc \
+ $(LISP)/mule/ipa-hooks.elc \
+ $(LISP)/mule/japanese-hooks.elc \
+ $(LISP)/mule/korean-hooks.elc \
+ $(LISP)/mule/thai-hooks.elc \
+ $(LISP)/mule/vietnamese-hooks-1.elc \
+ $(LISP)/mule/vietnamese-hooks-2.elc \
+ $(LISP)/prim/winnt.el \
+ $(LISP)/custom/widget.el \
+ $(LISP)/custom/custom.el \
+ $(LISP)/prim/cus-start.el
 
 MAKE_DOCFILE=$(OUTDIR)\make-docfile.exe
-SUPPORT_PROGS=$(MAKE_DOCFILE)
 
 $(MAKE_DOCFILE): $(OUTDIR)\make-docfile.obj
 	link.exe $(LIB_SRC_LFLAGS) $** $(LIB_SRC_LIBS)
@@ -299,10 +333,28 @@
 $(OUTDIR)/make-docfile.obj:	$(LIB_SRC)\make-docfile.c
 	 $(CC) $(LIB_SRC_FLAGS) $** /Fo$@
 
+RUNEMACS=$(XEMACS)/src/runemacs.exe
+
+$(RUNEMACS): $(OUTDIR)\runemacs.obj
+	link.exe /out:$@ /subsystem:windows /entry:WinMainCRTStartup \
+	/pdb:none /release /incremental:no $** \
+ 	kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
+	advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib \
+	odbccp32.lib libc.lib
+
+$(OUTDIR)\runemacs.obj:	$(XEMACS)/nt/runemacs.c
+	$(CC) /nologo -ML -w -Od -Zi -c \
+	-D_DEBUG -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN \
+	-D_NTSDK -D_M_IX86 -D_X86_ -Demacs -DHAVE_CONFIG_H -D_MSC_VER=999 \
+	$** /Fo$@
+
+SUPPORT_PROGS=$(MAKE_DOCFILE) $(RUNEMACS)
+
 $(DOC): $(OUTDIR)/make-docfile.exe
 	!$(MAKE_DOCFILE) -o $@ $(DOC_SRCS_1) 
 	!$(MAKE_DOCFILE) -a $@ $(DOC_SRCS_2)
 	!$(MAKE_DOCFILE) -a $@ $(DOC_SRCS_3)
+	!$(MAKE_DOCFILE) -a $@ $(DOC_SRCS_4)
 
 #------------------------------------------------------------------------------
 
@@ -321,10 +373,12 @@
  /nodefaultlib /force /out:$@\
  /heap:0x00100000
 
-#TEMACS_CPP=$(XEMACS)/nt/cpp/cpp.exe
 TEMACS_CPP=c:/usr/local/bin/cpp.exe
 TEMACS_CPP_FLAGS= $(INCLUDES) -D_DEBUG -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN \
- -D_NTSDK -D_M_IX86 -D_X86_ -Demacs -DHAVE_CONFIG_H -D_MSC_VER=999
+ -D_NTSDK -D_M_IX86 -D_X86_ -Demacs -DHAVE_CONFIG_H -D_MSC_VER=999 \
+ -DEMACS_MAJOR_VERSION=$(EMACS_MAJOR_VERSION) \
+ -DEMACS_MINOR_VERSION=$(EMACS_MINOR_VERSION) \
+ -DXEMACS_CODENAME=$(XEMACS_CODENAME)
 TEMACS_FLAGS=-nologo -ML -w -Od -Zi -c $(TEMACS_CPP_FLAGS)
 
 TEMACS_OBJS= \
@@ -347,7 +401,6 @@
 	$(OUTDIR)/console-x.obj \
 	$(OUTDIR)/console.obj \
 	$(OUTDIR)/data.obj \
-	$(OUTDIR)/database.obj \
 	$(OUTDIR)/debug.obj \
 	$(OUTDIR)/device-x.obj \
 	$(OUTDIR)/device.obj \
@@ -405,7 +458,11 @@
 	$(OUTDIR)/menubar-x.obj \
 	$(OUTDIR)/menubar.obj \
 	$(OUTDIR)/minibuf.obj \
-	$(OUTDIR)/mocklisp.obj \
+        $(OUTDIR)/input-method-xlib.obj \
+        $(OUTDIR)/mule.obj \
+        $(OUTDIR)/mule-charset.obj \
+        $(OUTDIR)/mule-ccl.obj \
+        $(OUTDIR)/mule-coding.obj \
 	$(OUTDIR)/nt.obj \
 	$(OUTDIR)/ntheap.obj \
 	$(OUTDIR)/ntproc.obj \
@@ -441,578 +498,358 @@
 	$(OUTDIR)/xmu.obj \
 	$(OUTDIR)/xselect.obj
 
-#$(TEMACS): $(TEMACS_SRC)/Emacs.ad.h $(TEMACS_SRC)/paths.h $(TEMACS_OBJS)
-#	link.exe $(TEMACS_LFLAGS) $(TEMACS_OBJS) $(TEMACS_LIBS)
-
 $(TEMACS): $(TEMACS_SRC)/Emacs.ad.h $(TEMACS_SRC)/paths.h $(TEMACS_OBJS)
 	link.exe @<<
   $(TEMACS_LFLAGS) $(TEMACS_OBJS) $(TEMACS_LIBS)
 <<
 
 $(OUTDIR)/abbrev.obj:	$(TEMACS_SRC)/abbrev.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#        !"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/alloc.obj:	$(TEMACS_SRC)/alloc.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/alloca.obj:	$(TEMACS_SRC)/alloca.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/balloon-x.obj:	$(TEMACS_SRC)/balloon-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/balloon_help.obj:	$(TEMACS_SRC)/balloon_help.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/blocktype.obj:	$(TEMACS_SRC)/blocktype.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/buffer.obj:	$(TEMACS_SRC)/buffer.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/bytecode.obj:	$(TEMACS_SRC)/bytecode.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/callint.obj:	$(TEMACS_SRC)/callint.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/callproc.obj:	$(TEMACS_SRC)/callproc.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/casefiddle.obj:	$(TEMACS_SRC)/casefiddle.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/casetab.obj:	$(TEMACS_SRC)/casetab.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/chartab.obj:	$(TEMACS_SRC)/chartab.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/cmdloop.obj:	$(TEMACS_SRC)/cmdloop.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/cmds.obj:	$(TEMACS_SRC)/cmds.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/console-stream.obj:	$(TEMACS_SRC)/console-stream.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/console-x.obj:	$(TEMACS_SRC)/console-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/console.obj:	$(TEMACS_SRC)/console.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/data.obj:	$(TEMACS_SRC)/data.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
-
-$(OUTDIR)/database.obj:	$(TEMACS_SRC)/database.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
-	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/debug.obj:	$(TEMACS_SRC)/debug.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/device-x.obj:	$(TEMACS_SRC)/device-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/device.obj:	$(TEMACS_SRC)/device.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/dgif_lib.obj:	$(TEMACS_SRC)/dgif_lib.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/dialog-x.obj:	$(TEMACS_SRC)/dialog-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/dialog.obj:	$(TEMACS_SRC)/dialog.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/dired.obj:	$(TEMACS_SRC)/dired.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/doc.obj:	$(TEMACS_SRC)/doc.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/doprnt.obj:	$(TEMACS_SRC)/doprnt.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/dynarr.obj:	$(TEMACS_SRC)/dynarr.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/editfns.obj:	$(TEMACS_SRC)/editfns.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/elhash.obj:	$(TEMACS_SRC)/elhash.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/emacs.obj:	$(TEMACS_SRC)/emacs.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/EmacsFrame.obj:	$(TEMACS_SRC)/EmacsFrame.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/EmacsManager.obj:	$(TEMACS_SRC)/EmacsManager.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/TopLevelEmacsShell.obj:	$(TEMACS_SRC)/EmacsShell-sub.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) -DDEFINE_TOP_LEVEL_EMACS_SHELL $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) -DDEFINE_TOP_LEVEL_EMACS_SHELL $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/TransientEmacsShell.obj: $(TEMACS_SRC)/EmacsShell-sub.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) -DDEFINE_TRANSIENT_EMACS_SHELL $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) -DDEFINE_TRANSIENT_EMACS_SHELL $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/EmacsShell.obj:	$(TEMACS_SRC)/EmacsShell.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/energize.obj:	$(TEMACS_SRC)/energize.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/eval.obj:	$(TEMACS_SRC)/eval.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/event-stream.obj:	$(TEMACS_SRC)/event-stream.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/event-unixoid.obj:	$(TEMACS_SRC)/event-unixoid.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/event-Xt.obj:	$(TEMACS_SRC)/event-Xt.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/events.obj:	$(TEMACS_SRC)/events.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/extents.obj:	$(TEMACS_SRC)/extents.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/faces.obj:	$(TEMACS_SRC)/faces.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/fileio.obj:	$(TEMACS_SRC)/fileio.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/filelock.obj:	$(TEMACS_SRC)/filelock.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/filemode.obj:	$(TEMACS_SRC)/filemode.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/floatfns.obj:	$(TEMACS_SRC)/floatfns.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/fns.obj:	$(TEMACS_SRC)/fns.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/font-lock.obj:	$(TEMACS_SRC)/font-lock.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/frame-x.obj:	$(TEMACS_SRC)/frame-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/frame.obj:	$(TEMACS_SRC)/frame.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/free-hook.obj:	$(TEMACS_SRC)/free-hook.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/general.obj:	$(TEMACS_SRC)/general.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/gif_err.obj:	$(TEMACS_SRC)/gif_err.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/gifalloc.obj:	$(TEMACS_SRC)/gifalloc.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/glyphs-x.obj:	$(TEMACS_SRC)/glyphs-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/glyphs.obj:	$(TEMACS_SRC)/glyphs.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/gmalloc.obj:	$(TEMACS_SRC)/gmalloc.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/gui-x.obj:	$(TEMACS_SRC)/gui-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/gui.obj:	$(TEMACS_SRC)/gui.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/hash.obj:	$(TEMACS_SRC)/hash.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/indent.obj:	$(TEMACS_SRC)/indent.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/inline.obj:	$(TEMACS_SRC)/inline.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/insdel.obj:	$(TEMACS_SRC)/insdel.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/intl.obj:	$(TEMACS_SRC)/intl.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/keymap.obj:	$(TEMACS_SRC)/keymap.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/lread.obj:	$(TEMACS_SRC)/lread.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/lstream.obj:	$(TEMACS_SRC)/lstream.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/macros.obj:	$(TEMACS_SRC)/macros.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/marker.obj:	$(TEMACS_SRC)/marker.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/md5.obj:	$(TEMACS_SRC)/md5.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/menubar-x.obj:	$(TEMACS_SRC)/menubar-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/menubar.obj:	$(TEMACS_SRC)/menubar.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/minibuf.obj:	$(TEMACS_SRC)/minibuf.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
-
-$(OUTDIR)/mocklisp.obj:	$(TEMACS_SRC)/mocklisp.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
-	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/msdos.obj:	$(TEMACS_SRC)/msdos.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
+
+$(OUTDIR)/input-method-xlib.obj:        $(TEMACS_SRC)/input-method-xlib.c
+        $(CC) $(TEMACS_FLAGS) $** /Fo$@
+
+$(OUTDIR)/mule.obj:     $(TEMACS_SRC)/mule.c
+        $(CC) $(TEMACS_FLAGS) $** /Fo$@
+
+$(OUTDIR)/mule-charset.obj:     $(TEMACS_SRC)/mule-charset.c
+        $(CC) $(TEMACS_FLAGS) $** /Fo$@
+
+$(OUTDIR)/mule-ccl.obj: $(TEMACS_SRC)/mule-ccl.c
+        $(CC) $(TEMACS_FLAGS) $** /Fo$@
+
+$(OUTDIR)/mule-coding.obj:      $(TEMACS_SRC)/mule-coding.c
+        $(CC) $(TEMACS_FLAGS) $** /Fo$@
 
 $(OUTDIR)/nt.obj:	$(TEMACS_SRC)/nt.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/ntheap.obj:	$(TEMACS_SRC)/ntheap.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/ntproc.obj:	$(TEMACS_SRC)/ntproc.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/objects-x.obj:	$(TEMACS_SRC)/objects-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/objects.obj:	$(TEMACS_SRC)/objects.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/opaque.obj:	$(TEMACS_SRC)/opaque.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/print.obj:	$(TEMACS_SRC)/print.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/process.obj:	$(TEMACS_SRC)/process.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/pure.obj:	$(TEMACS_SRC)/pure.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/rangetab.obj:	$(TEMACS_SRC)/rangetab.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/realpath.obj:	$(TEMACS_SRC)/realpath.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/redisplay-output.obj:	$(TEMACS_SRC)/redisplay-output.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/redisplay-x.obj:	$(TEMACS_SRC)/redisplay-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/redisplay.obj:	$(TEMACS_SRC)/redisplay.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/regex.obj:	$(TEMACS_SRC)/regex.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/scrollbar-x.obj:	$(TEMACS_SRC)/scrollbar-x.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/scrollbar.obj:	$(TEMACS_SRC)/scrollbar.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/search.obj:	$(TEMACS_SRC)/search.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/signal.obj:	$(TEMACS_SRC)/signal.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/sound.obj:	$(TEMACS_SRC)/sound.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/specifier.obj:	$(TEMACS_SRC)/specifier.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/strftime.obj:	$(TEMACS_SRC)/strftime.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/symbols.obj:	$(TEMACS_SRC)/symbols.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/syntax.obj:	$(TEMACS_SRC)/syntax.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/sysdep.obj:	$(TEMACS_SRC)/sysdep.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/termcap.obj:	$(TEMACS_SRC)/termcap.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/tparam.obj:	$(TEMACS_SRC)/tparam.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/undo.obj:	$(TEMACS_SRC)/undo.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/unexnt.obj:	$(TEMACS_SRC)/unexnt.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/vm-limit.obj:	$(TEMACS_SRC)/vm-limit.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/window.obj:	$(TEMACS_SRC)/window.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS)  $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/xgccache.obj:	$(TEMACS_SRC)/xgccache.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/xmu.obj:	$(TEMACS_SRC)/xmu.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(OUTDIR)/xselect.obj:	$(TEMACS_SRC)/xselect.c
-#	!"$(TEMACS_CPP) $(TEMACS_CPP_FLAGS) $** > $(OUTDIR)/foo.c"
 	$(CC) $(TEMACS_FLAGS) $** /Fo$@
-#	!"del $(OUTDIR)\\foo.c"
 
 $(TEMACS_SRC)/Emacs.ad.h: $(XEMACS)/etc/Emacs.ad
 	!"sed -f ad2c.sed < $(XEMACS)/etc/Emacs.ad > $(TEMACS_SRC)/Emacs.ad.h"
--- a/pkg-src/tree-x/Makefile	Mon Aug 13 09:44:44 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-#
-# SUMMARY:      Makefile for the OO-Browser
-#
-# AUTHOR:       Bob Weiner / Mark Stern
-# ORG:          InfoDock Associates / Brown U.
-#
-# ORIG-DATE:    15-Oct-90
-# LAST-MOD:     19-Oct-96 at 00:53:29 by Bob Weiner
-#
-# Copyright (C) 1990-1996  Free Software Foundation, Inc.
-# See the file BR-COPY for license information.
-#
-# This file is part of the OO-Browser.
-
-# If the usleep () system call exists on your system, uncomment the following line.
-DEFINES         = -DHAVE_USLEEP
-
-# Root directory of your X distribution.  Note how this is used in succeeding
-# variables.
-XROOT           = /usr/X11
-LD_LIBRARY_PATH = $(XROOT)/lib
-INCLUDEDIRS     = -I$(XROOT)/include
-LIBDIRS         = -L$(XROOT)/lib
-
-# Use this for the standard Athena widgets.
-XAW = -lXaw
-# Use this instead for the 3D Athena widget library.
-XAW3D = -lXaw3d
-# Set this to one of the 2 above variable names.
-DEFXAW = XAW
-# Set this to one of the 2 above variable values.
-LIBXAW = $(XAW)
-
-# C compiler
-CC		= gcc
-# Compiler flags
-CFLAGS		= -g -O $(INCLUDEDIRS) $(DEFINES) -D$(DEFXAW)
-
-#   Set XVERSION to the proper relase of X11 for your system.
-#   Use X11R5 if you system is not on X11R6 or above.
-X11R5 = 
-X11R6 = -lSM -lICE
-XVERSION = $(X11R6)
-
-#   X11 libraries used by all system configurations.
-XCOMMON = -lXmu -lXt -lX11 -lXext
-
-#   This is used for static linking on a generic platform such as SunOS 4.
-LD_STATIC   	 = -static $(LIBDIRS) $(LIBXAW) $(XCOMMON) $(XVERSION)
-#   This is used for dynamic linking under Solaris.
-LD_SOLARIS       = $(LIBDIRS) $(LIBXAW) $(XCOMMON) -lsocket $(XVERSION)
-#   This is used for dynamic linking under Linux.
-LD_LINUX         = $(LIBDIRS) $(LIBXAW) $(XCOMMON) $(XVERSION)
-
-# Set this to be the directory in which to install the X OO-Browser
-# executable.  This should be a directory in all users' search paths or the
-# value of the Emacs variable, exec-directory.
-# Use 'make install' to install the binary.
-BINDIR          = /home/infodock/lib-bin-linux-elf
-
-NAME		= xoobr
-C_FILES 	= draw.c tree.c input.c dissolve.c dbl.c intf.c usleep.c
-O_FILES		= draw.o tree.o input.o dissolve.o dbl.o intf.o usleep.o
-INC_FILES	= defs.h tree.h input.h dissolve.h dbl.h rsrc.h intf.h help.h
-SRC_FILES	= $(INC_FILES) $(C_FILES)
-
-$(NAME):	linux
-
-static:		$(O_FILES)
-		$(CC) $(CFLAGS) -o $(NAME) $(O_FILES) $(LD_STATIC)
-
-solaris:	$(O_FILES)
-		$(CC) $(CFLAGS) -DSYSV -o $(NAME) $(O_FILES) $(LD_SOLARIS)
-
-linux:		$(O_FILES)
-		$(CC) $(CFLAGS) -o $(NAME) $(O_FILES) $(LD_LINUX)
-
-
-install:	$(NAME)
-		chmod 755 $(NAME)
-		mv $(NAME) $(BINDIR)/$(NAME)
-
-clean:
-		rm -f *.o *.orig *.rej $(NAME) core *~
-
-size:
-		wc $(SRC_FILES)
-
-dbl.o: 		dbl.h 
-dissolve.o:	dissolve.h
-draw.o: 	defs.h tree.h dbl.h intf.h
-input.o: 	defs.h tree.h input.h
-intf.o: 	defs.h tree.h dbl.h intf.h rsrc.h input.h help.h
-tree.o: 	defs.h tree.h intf.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkg-src/tree-x/Makefile.in.in	Mon Aug 13 09:45:46 2007 +0200
@@ -0,0 +1,79 @@
+##
+## SUMMARY:      Makefile for the OO-Browser
+##
+## AUTHOR:       Bob Weiner / Mark Stern
+## ORG:          InfoDock Associates / Brown U.
+##
+## ORIG-DATE:    15-Oct-90
+## LAST-MOD:     19-Oct-96 at 00:53:29 by Bob Weiner
+##
+## Copyright (C) 1990-1996  Free Software Foundation, Inc.
+## See the file BR-COPY for license information.
+##
+## This file is part of the OO-Browser.
+
+#define NOT_C_CODE
+#include "../../src/config.h"
+
+SHELL = /bin/sh
+RM = rm -f
+
+## ==================== Things "configure" will edit ====================
+CC=@CC@
+CPP=@CPP@
+CFLAGS=@CFLAGS@
+CPPFLAGS=@CPPFLAGS@
+LDFLAGS=@LDFLAGS@
+
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+
+c_switch_all=@c_switch_all@
+ld_switch_all=@ld_switch_all@
+ld_libs_all=@ld_libs_all@
+
+build_top=../..
+
+#ifdef USE_GNU_MAKE
+vpath %.c @srcdir@
+vpath %.h @srcdir@
+#else
+VPATH=@srcdir@
+#endif
+
+#ifndef HAVE_USLEEP
+usleep_objs = usleep.o
+#endif
+
+progs = xoobr
+objs = draw.o tree.o input.o dissolve.o dbl.o intf.o $(usleep_objs)
+
+all : xoobr
+
+xoobr: $(objs)
+	$(CC) $(objs) $(ldflags) -o $@
+
+cflags  = $(CFLAGS) -DHAVE_CONFIG_H -I${build_top}/src $(CPPFLAGS) $(c_switch_all)
+ldflags = $(LDFLAGS) $(ld_switch_all) -lXaw $(ld_libs_all)
+
+.c.o :
+	${CC} -c $(cflags) $<
+
+install: $(progs)
+	../../lib-src/make-path ${archlibdir}
+	for file in $(progs); do \
+	  (cd ../.. && $(INSTALL_PROGRAM) pkg-src/tree-x/$${file} ${archlibdir}/$${file}) ; \
+	done
+
+clean:
+	$(RM) $(progs) *.o *.i *.orig *.rej core *~
+
+size:
+	wc *.c *.h
+
+## Dependencies
+dbl.o: 		dbl.h 
+dissolve.o:	dissolve.h
+draw.o: 	defs.h tree.h dbl.h intf.h
+input.o: 	defs.h tree.h input.h
+intf.o: 	defs.h tree.h dbl.h intf.h rsrc.h input.h help.h
+tree.o: 	defs.h tree.h intf.h
--- a/pkg-src/tree-x/dbl.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/dbl.c	Mon Aug 13 09:45:46 2007 +0200
@@ -4,14 +4,15 @@
  */
 
 
+#include <stdlib.h>
 #include "dbl.h"
 
-struct {                                               
-    unsigned short red;                                        
+struct {
+    unsigned short red;
     unsigned short green;
     unsigned short blue;
 } color[] = {
-    { 65280, 65280, 65280 }, /* white  */                      
+    { 65280, 65280, 65280 }, /* white  */
     {     0,     0, 65280 }, /* blue   */
     {     0, 65280,     0 }, /* green  */
     { 65280,     0,     0 }, /* red    */
@@ -19,18 +20,17 @@
     { 65280, 32512,     0 }, /* orange */
     { 32512, 32512, 32512 }, /* gray   */
     {     0,     0,     0 }  /* black  */
-};                       
+};
 
 /* ------------------------------------------------------------------------- */
 
 DoubleBuffer *
-DBLcreate_double_buffer (display, window, backing_store, colors, num_colors)
-   Display *display;
-   Window   window;
-   int      backing_store;
-   XColor  *colors;
-   int      num_colors;
-{                                                                
+DBLcreate_double_buffer (Display *display,
+			 Window   window,
+			 int      backing_store,
+			 XColor  *colors,
+			 int      num_colors)
+{
    int i, j, k, l, m, offset, mask, size;
    int max_planes;
 
@@ -45,7 +45,7 @@
    if ((db = (DoubleBuffer *)calloc(1, sizeof(DoubleBuffer))) == 0) {
       printf("DBLopen_double_buffer : memory allocation error\n");
       return (NULL);
-   }                                                          
+   }
 
 /* note the display */
 
@@ -69,7 +69,7 @@
       color[i].green = colors[i].green;
       color[i].blue  = colors[i].blue;
    }
-   
+
 /* see if the user wanted to limit the number of planes used
    then see how many are available,  make it a multiple of 2 */
 
@@ -130,7 +130,7 @@
          offset = offset + 1;
       }
 
-      mask = (1 << (db->num_planes >> 1)) - 1;                             
+      mask = (1 << (db->num_planes >> 1)) - 1;
 
    /* now create the surfaces that will contain plane mask and
       colormap information that we use to do double  buffering */
@@ -149,7 +149,7 @@
          surface->offset     = offset + i * (db->num_planes >> 1);
          surface->mask       = mask << surface->offset;
          surface->num_colors = 1 << db->num_planes;
-  
+
       /* compute our pixel values by taking every permutation
          of the pixel and planes returned by XAllocColorCells */
 
@@ -159,19 +159,19 @@
 
          for (j = 0; j < db->num_planes; j++) {
             for (k = (1 << j); k < (surface->num_colors); k += (2 << j)) {
-               for (l = k; l < (k + (1 << j)); l++) {                  
+               for (l = k; l < (k + (1 << j)); l++) {
                   surface->color[l].pixel |= db->planes[j];
                }
             }
          }
 
-       /* now populate those pixels with the proper  colors  so             
+       /* now populate those pixels with the proper  colors  so
           that we can do animation by banging in a new colormap */
 
          for (j = 0; j < surface->num_colors; j++) {
             k = (j & surface->mask) >> surface->offset;
 
-            surface->color[j].red   = color[k].red;                 
+            surface->color[j].red   = color[k].red;
             surface->color[j].green = color[k].green;
             surface->color[j].blue  = color[k].blue;
 
@@ -212,14 +212,14 @@
 
 /* if there are no surfaces then we are doing animation with
    a frame buffer,  so create a pixmap as our frame buffer   */
-                         
+
    if (db->num_surfaces > 0)
-      db->drawable = db->window;   
+      db->drawable = db->window;
    else {
       db->frame = XCreatePixmap(db->display, db->window,
 				db->width, db->height, db->depth);
       db->drawable = db->frame;
-   }                                                                    
+   }
 
 /* if they have requested backing store,  then create an extra
    pixmap which we can use as backing store to handle exposures */
@@ -227,7 +227,7 @@
    if (backing_store) {
       db->backing = XCreatePixmap(db->display, db->window,
 				  db->width, db->height, db->depth);
-   }                                                   
+   }
 
 /*  use the 0 pixel from one of the surfaces for the background */
 
@@ -236,9 +236,9 @@
    xgcv.line_width = 0;
    xgcv.cap_style  = CapButt;
    xgcv.join_style = JoinRound;
-   xgcvmask = GCBackground | GCLineStyle | GCLineWidth | GCCapStyle | 
+   xgcvmask = GCBackground | GCLineStyle | GCLineWidth | GCCapStyle |
               GCJoinStyle;
-   
+
    db->gc = XCreateGC(db->display, db->drawable, xgcvmask, &xgcv);
 
 /* do an initial frame to setup the colormap,  and return */
@@ -251,92 +251,84 @@
 /* ------------------------------------------------------------------------- */
 
 void
-DBLdelete_double_buffer (db)
-     DoubleBuffer *db;
+DBLdelete_double_buffer (DoubleBuffer *db)
 {
   int i;
 
   /* remove and and all surfaces that are out there */
-  
+
   for (i = 0; i < DBL_MAX_SURFACES; i++) {
     if (db->surface[i] != 0) {
-      free(db->surface[i]);                               
+      free(db->surface[i]);
     }
   }
 
   /* now clean up the various resources used for this double buffer */
-  
+
   if (db->frame != 0) {
     XFreePixmap(db->display, db->frame);
   }
-  
+
   if (db->backing != 0) {
     XFreePixmap(db->display, db->backing);
   }
-  
+
   /* if we created our own private colormap,  then free the colormap */
-  
+
   if (db->colormap != DefaultColormapOfScreen(db->screen)) {
     XFreeColormap(db->display, db->colormap);
   }
-  
+
   free (db);
 }
 
 /* ------------------------------------------------------------------------- */
 
 unsigned long
-DBLinq_background(db)
-   DoubleBuffer *db;
+DBLinq_background(DoubleBuffer *db)
 {
    if (db->num_surfaces > 0)
       return(db->surface[0]->color[0].pixel);
-   else 
+   else
       return(WhitePixelOfScreen(db->screen));
 }
 
 /* ------------------------------------------------------------------------- */
 
-DBLbegin_frame(db)
-     DoubleBuffer *db;
+void
+DBLbegin_frame(DoubleBuffer *db)
 {
-  Surface   *surface;
-  
-  /* there will be at most two surfaces optimize with "&"*/
-  
-  if (db->num_surfaces > 0) {                       
-    db->current_surface = (db->current_surface + 1) & 1;                  
-    surface = db->surface[db->current_surface];
+  /* there will be at most two surfaces optimized with "&"*/
+
+  if (db->num_surfaces > 0) {
+    db->current_surface = (db->current_surface + 1) & 1;
+
+    /* clear the back surface of the window which may actually be a pixmap */
+    
+    XSetPlaneMask (db->display, db->gc, db->surface[db->current_surface]->mask);
   }
-   
-  /* clear the back surface of the window which may actually be a pixmap */ 
-  
-  if (db->num_surfaces > 0) 
-    XSetPlaneMask (db->display, db->gc, surface->mask);
-  
+
   /* clear out the back surface or frame buffer as appropriate */
-  
+
   XSetFunction(db->display, db->gc, GXclear);
   XFillRectangle(db->display, db->drawable, db->gc,
 		 0, 0, db->width, db->height);
-  
+
   /* set writing mode back to copy */
   XSetFunction (db->display, db->gc, GXcopy);
-  
+
   XSync(db->display, False);
-}  
-         
+}
+
 
 /* ------------------------------------------------------------------------- */
-                                            
 
-DBLend_frame(db, init)
-     DoubleBuffer *db;                                                   
-     short init;
+void
+DBLend_frame(DoubleBuffer *db, short init)
 {
   Surface  *surface;
-  
-  /* if there are no drawing surfaces,  then we are doing animation   
+
+  /* if there are no drawing surfaces,  then we are doing animation
      with a frame buffer, copy the frame buffers to their viewports */
 
   if (db->num_surfaces == 0) {
@@ -344,7 +336,7 @@
         XCopyArea (db->display, db->frame, db->window,
 	           db->gc, 0,0, db->width, db->height, 0,0);
   } else {
-    
+
     /* otherwise,  we can flip the surface by banging in the new colormap */
 
     XSync(db->display, False);
@@ -357,21 +349,8 @@
     XCopyArea (db->display, db->window, db->backing,
 	       db->gc, 0,0, db->width, db->height, 0,0);
   }
-  
+
   /* make sure this all goes off to the server,  right away */
-  
+
   XSync(db->display, False);
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/pkg-src/tree-x/dbl.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/dbl.h	Mon Aug 13 09:45:46 2007 +0200
@@ -36,7 +36,7 @@
     int          depth;	        /* depth of screen in planes          */
     int          num_planes;    /* number of planes used              */
 
-/* surface information is used to do double buffering                 */ 
+/* surface information is used to do double buffering                 */
 
    int       num_surfaces;
    int       current_surface;
@@ -45,22 +45,24 @@
 /* we need to remember which pixels and planes we allocated           */
 
    int       mask;
-   long      pixels[DBL_MAX_COLORS];                                  
+   long      pixels[DBL_MAX_COLORS];
    long      planes[DBL_MAX_PLANES];
 
 /* the pixel values one should use when drawing to the viewports      */
 
-   int       num_colors; 
+   int       num_colors;
    int       colors[DBL_MAX_COLORS];
 } DoubleBuffer;
 
 
-extern DoubleBuffer  *DBLcreate_double_buffer();
-extern void           DBLdelete_double_buffer();
-extern unsigned long  DBLinq_background();
-extern char          *getenv();
+void		DBLend_frame(DoubleBuffer *db, short init);
+void		DBLbegin_frame (DoubleBuffer *db);
+void		DBLdelete_double_buffer(DoubleBuffer *db);
+unsigned long	DBLinq_background(DoubleBuffer *db);
 
-
-
-
-
+DoubleBuffer *
+DBLcreate_double_buffer (Display *display,
+			 Window   window,
+			 int      backing_store,
+			 XColor  *colors,
+			 int      num_colors);
--- a/pkg-src/tree-x/dissolve.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/dissolve.c	Mon Aug 13 09:45:46 2007 +0200
@@ -3,6 +3,18 @@
  * ----------------------------------------------------------------------------
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_USLEEP
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#else
+int usleep(unsigned long microSeconds);
+#endif /* HAVE_USLEEP */
+
 #include <X11/Xlib.h>
 
 #include "dissolve.h"
@@ -13,21 +25,21 @@
 static GC     DissolveInLineGC[NUM_LINE_STEPS];
 static GC     DissolveOutLineGC[NUM_LINE_STEPS];
 
-static unsigned char first_dash[] =  {1, 3}; 
-static unsigned char second_dash[] = {1, 1}; 
+static char first_dash[] =  {1, 3};
+static char second_dash[] = {1, 1};
 
-InitializeDissolveEffect(dpy, drawable, fg_pixel, bg_pixel)
-   Display *dpy;
-   Drawable drawable;
-   int fg_pixel;
-   int bg_pixel;
-{   
+void
+InitializeDissolveEffect(Display *dpy,
+			 Drawable drawable,
+			 int fg_pixel,
+			 int bg_pixel)
+{
    unsigned long  gcvaluemask;
    XGCValues      gcvalues;
    int i;
 
    /* make DissolveOutGC */
-   gcvalues.background = bg_pixel; 
+   gcvalues.background = bg_pixel;
    gcvalues.foreground = bg_pixel;
    gcvalues.function   = GXcopy;
    gcvalues.fill_style = FillStippled;
@@ -60,7 +72,7 @@
    XSetDashes(dpy, DissolveOutLineGC[i], 3, first_dash, 2);
    i++;
    gcvalues.line_style = LineSolid;
-   DissolveOutLineGC[i] = XCreateGC(dpy, drawable, gcvaluemask, &gcvalues);   
+   DissolveOutLineGC[i] = XCreateGC(dpy, drawable, gcvaluemask, &gcvalues);
 
    /* make DissolveInLineGC */
    i = 0;
@@ -80,55 +92,46 @@
    XSetDashes(dpy, DissolveInLineGC[i], 3, first_dash, 2);
    i++;
    gcvalues.line_style = LineSolid;
-   DissolveInLineGC[i] = XCreateGC(dpy, drawable, gcvaluemask, &gcvalues);   
+   DissolveInLineGC[i] = XCreateGC(dpy, drawable, gcvaluemask, &gcvalues);
 
    i = 0;
-   DissolvePixmaps[i] = XCreateBitmapFromData(dpy, drawable,
-					      first_bits,
-					      first_width,
-					      first_height);
+   DissolvePixmaps[i] =
+     XCreateBitmapFromData(dpy, drawable,
+			   (char *) first_bits, first_width, first_height);
    i++;
-   DissolvePixmaps[i] = XCreateBitmapFromData(dpy, drawable,
-					      second_bits,
-					      second_width,
-					      second_height);
+   DissolvePixmaps[i] =
+     XCreateBitmapFromData(dpy, drawable,
+			   (char *) second_bits, second_width, second_height);
    i++;
-   DissolvePixmaps[i] = XCreateBitmapFromData(dpy, drawable,
-					      third_bits,
-					      third_width,
-					      third_height);
+   DissolvePixmaps[i] =
+     XCreateBitmapFromData(dpy, drawable,
+			   (char *) third_bits, third_width, third_height);
    i++;
-   DissolvePixmaps[i] = XCreateBitmapFromData(dpy, drawable,
-					      fourth_bits,
-					      fourth_width,
-					      fourth_height);
+   DissolvePixmaps[i] =
+     XCreateBitmapFromData(dpy, drawable,
+			   (char *) fourth_bits, fourth_width, fourth_height);
    i++;
-   DissolvePixmaps[i] = XCreateBitmapFromData(dpy, drawable,
-					      fifth_bits,
-					      fifth_width,
-					      fifth_height);
+   DissolvePixmaps[i] =
+     XCreateBitmapFromData(dpy, drawable,
+			   (char *) fifth_bits, fifth_width, fifth_height);
    i++;
-   DissolvePixmaps[i] = XCreateBitmapFromData(dpy, drawable,
-					      sixth_bits,
-					      sixth_width,
-					      sixth_height);
+   DissolvePixmaps[i] =
+     XCreateBitmapFromData(dpy, drawable,
+			   (char *) sixth_bits, sixth_width, sixth_height);
    i++;
-   DissolvePixmaps[i] = XCreateBitmapFromData(dpy, drawable,
-					      seventh_bits,
-					      seventh_width,
-					      seventh_height);
+   DissolvePixmaps[i] =
+     XCreateBitmapFromData(dpy, drawable,
+			   (char *) seventh_bits, seventh_width, seventh_height);
    i++;
-   DissolvePixmaps[i] = XCreateBitmapFromData(dpy, drawable,
-					      eighth_bits,
-					      eighth_width,
-					      eighth_height);
+   DissolvePixmaps[i] =
+     XCreateBitmapFromData(dpy, drawable,
+			   (char *) eighth_bits, eighth_width, eighth_height);
 }
 
-DissolveRectangle(dpy, drawable, x, y, width, height, mode)
-   Display *dpy;
-   Window drawable;
-   int x, y, width, height;
-   int mode;
+#if 0 /* Currently Unused */
+void
+DissolveRectangle(Display *dpy, Window drawable,
+		  int x, int y, int width, int height, int mode)
 {
    int i;
    GC gc;
@@ -145,13 +148,13 @@
       usleep(50000);
    }
 }
-   
-DissolveRectangles(dpy, drawable, rectangles, nrectangles, mode)
-   Display *dpy;
-   Window drawable;
-   XRectangle rectangles[];
-   int nrectangles;
-   int mode;
+
+void
+DissolveRectangles(Display *dpy,
+		   Window drawable,
+		   XRectangle rectangles[],
+		   int nrectangles,
+		   int mode)
 {
    int i;
    GC gc;
@@ -169,12 +172,9 @@
    }
 }
 
-DissolveSegments(dpy, drawable, segments, nsegments, mode)
-   Display *dpy;
-   Window drawable;
-   XSegment segments[];
-   int nsegments;
-   int mode;
+void
+DissolveSegments(Display *dpy, Window drawable,
+		 XSegment segments[], int nsegments, int mode)
 {
    int i;
    GC *gc;
@@ -188,14 +188,16 @@
    }
 }
 
-DissolveTree(dpy, drawable, rectangles, nrectangles, segments, nsegments, mode)
-   Display *dpy;
-   Window drawable;
-   XRectangle rectangles[];
-   int nrectangles;
-   XSegment segments[];
-   int nsegments;
-   int mode;
+#endif /* 0 - Unused */
+
+void
+DissolveTree(Display *dpy,
+	     Window drawable,
+	     XRectangle rectangles[],
+	     int nrectangles,
+	     XSegment segments[],
+	     int nsegments,
+	     int mode)
 {
    int i;
    int j = 0;
@@ -208,7 +210,7 @@
 
    /* speed up if there are lots of nodes */
    idle = nrectangles > 50 ? 0 : 25000;
-   
+
    for (i = 0 ; i < NUM_DISSOLVE_STEPS ; i++) {
       XSetStipple(dpy, gc, DissolvePixmaps[i]);
       if (mode)
@@ -222,12 +224,13 @@
    }
 }
 
-DissolvePolygon(dpy, drawable, pts, num_pts, mode)
-   Display *dpy;
-   Window drawable;
-   XPoint *pts;
-   int num_pts;
-   int mode;
+#if 0 /* Currently Unused */
+void
+DissolvePolygon(Display *dpy,
+		Window drawable,
+		XPoint *pts,
+		int num_pts,
+		int mode)
 {
    int i;
    GC gc;
@@ -243,3 +246,4 @@
    }
 }
 
+#endif /* Currently Unused */
--- a/pkg-src/tree-x/dissolve.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/dissolve.h	Mon Aug 13 09:45:46 2007 +0200
@@ -9,56 +9,71 @@
 #define first_width 16
 #define first_height 16
 
-static char first_bits[] = {
+static unsigned char first_bits[] = {
  0x88, 0x04, 0x00, 0x80, 0x20, 0x10, 0x00, 0x81, 0x12, 0x00, 0x00, 0x00,
  0x00, 0x02, 0x82, 0x40, 0x00, 0x00, 0x12, 0x14, 0x00, 0x00, 0x0a, 0x28,
  0x40, 0x01, 0x05, 0x00, 0xa0, 0x92, 0x08, 0x00 };
 #define second_width 16
 #define second_height 16
 
-static char second_bits[] = {
+static unsigned char second_bits[] = {
  0x51, 0x20, 0x04, 0x02, 0x00, 0x88, 0x02, 0x00, 0x08, 0x09, 0x40, 0x00,
  0x04, 0x04, 0x00, 0xa0, 0x80, 0x08, 0x08, 0x00, 0x00, 0xa8, 0x00, 0x00,
  0x28, 0x28, 0x00, 0x80, 0x01, 0x00, 0x10, 0x82 };
 #define third_width 16
 #define third_height 16
 
-static char third_bits[] = {
+static unsigned char third_bits[] = {
  0x00, 0x01, 0x12, 0x44, 0x00, 0x01, 0x00, 0x08, 0x00, 0x42, 0x2a, 0x08,
  0x80, 0x00, 0x04, 0x10, 0x01, 0x04, 0x00, 0x80, 0xa9, 0x04, 0x00, 0x00,
  0x00, 0x10, 0x0a, 0x05, 0x40, 0x00, 0x00, 0x50 };
 #define fourth_width 16
 #define fourth_height 16
 
-static char fourth_bits[] = {
+static unsigned char fourth_bits[] = {
  0x02, 0x88, 0x80, 0x00, 0x04, 0x40, 0x11, 0x02, 0x40, 0x90, 0x05, 0x00,
  0x00, 0x08, 0x11, 0x01, 0x40, 0x00, 0x00, 0x41, 0x14, 0x00, 0x00, 0x12,
  0x10, 0x00, 0x40, 0x40, 0x08, 0x00, 0xa0, 0x04 };
 #define fifth_width 16
 #define fifth_height 16
 
-static char fifth_bits[] = {
+static unsigned char fifth_bits[] = {
  0x24, 0x00, 0x00, 0x08, 0x09, 0x20, 0x20, 0x04, 0x00, 0x00, 0x00, 0x85,
  0x10, 0x20, 0x40, 0x02, 0x14, 0x40, 0x00, 0x08, 0x02, 0x01, 0x10, 0x40,
  0x04, 0x04, 0x20, 0x20, 0x00, 0x00, 0x42, 0x29 };
 #define sixth_width 16
 #define sixth_height 16
 
-static char sixth_bits[] = {
+static unsigned char sixth_bits[] = {
  0x00, 0x12, 0x28, 0x00, 0x02, 0x00, 0x88, 0x00, 0x01, 0x20, 0x90, 0x02,
  0x01, 0x50, 0x20, 0x04, 0x08, 0xa0, 0x41, 0x00, 0x00, 0x00, 0x24, 0x05,
  0x00, 0x80, 0x00, 0x10, 0x10, 0x40, 0x05, 0x00 };
 #define seventh_width 16
 #define seventh_height 16
 
-static char seventh_bits[] = {
+static unsigned char seventh_bits[] = {
  0x00, 0x40, 0x01, 0x10, 0x90, 0x02, 0x00, 0x50, 0xa4, 0x04, 0x00, 0x20,
  0x20, 0x80, 0x08, 0x08, 0x00, 0x01, 0x04, 0x00, 0x40, 0x52, 0x00, 0x00,
  0x81, 0x42, 0x10, 0x00, 0x04, 0x25, 0x00, 0x00 };
 #define eighth_width 16
 #define eighth_height 16
 
-static char eighth_bits[] = {
+static unsigned char eighth_bits[] = {
  0x00, 0x00, 0x40, 0x21, 0x40, 0x04, 0x44, 0x20, 0x00, 0x00, 0x00, 0x50,
  0x4a, 0x01, 0x00, 0x00, 0x22, 0x12, 0xa0, 0x22, 0x00, 0x00, 0xc1, 0x80,
  0x02, 0x00, 0x80, 0x0a, 0x02, 0x08, 0x00, 0x00 };
+
+void
+InitializeDissolveEffect(Display *dpy,
+			 Drawable drawable,
+			 int fg_pixel,
+			 int bg_pixel);
+
+void
+DissolveTree(Display *dpy,
+	     Window drawable,
+	     XRectangle rectangles[],
+	     int nrectangles,
+	     XSegment segments[],
+	     int nsegments,
+	     int mode);
--- a/pkg-src/tree-x/draw.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/draw.c	Mon Aug 13 09:45:46 2007 +0200
@@ -4,9 +4,11 @@
  * ----------------------------------------------------------------------------
  */
 
+#include <stdlib.h>
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
 
+#include "dissolve.h"
 #include "defs.h"
 #include "tree.h"
 #include "dbl.h"
@@ -23,17 +25,10 @@
 /*				Local Variables                              */
 /* ------------------------------------------------------------------------- */
 
-static char AnimationMode = FALSE;        
+static char AnimationMode = FALSE;
 static char strbuf[BUFSIZ];
 static int  AnimationStep = ANIMATION_STEP;
 
-/* ------------------------------------------------------------------------- */
-/*			 Forward Function Declarations                       */
-/* ------------------------------------------------------------------------- */
-
-void DrawNode();
-void DrawTreeContour();
-
 
 /* ------------------------------------------------------------------------- */
 /*				   Functions                                 */
@@ -41,53 +36,52 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   BeginFrame() provides an abstraction for double buffering. It should
  *   be called prior to creating a new frame of animation.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-BeginFrame()
+BeginFrame(void)
 {
   DBLbegin_frame(TreeDrawingAreaDB);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   EndFrame() provides an abstraction for double buffering. It should
  *   be called after creating a new frame of animation.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-EndFrame()
+EndFrame(void)
 {
   DBLend_frame(TreeDrawingAreaDB, 0);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   GetDrawingSize() gets the size of the drawing area, and returns the
  *   dimensions in the arguments.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-GetDrawingSize(width, height)
-     int *width, *height;
+static void
+GetDrawingSize(int *width, int *height)
 {
   Dimension w, h;
-  
-  XtVaGetValues(TreeDrawingArea, 
-		XtNwidth, &w,
-		XtNheight, &h,
-		NULL);
+  Arg al [2];
+
+  XtSetArg (al [0], XtNwidth,  &w);
+  XtSetArg (al [1], XtNheight, &h);
+  XtGetValues(TreeDrawingArea, al, 2);
 
   *width  = (int) w;
   *height = (int) h;
@@ -95,60 +89,56 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   SetDrawingSize() sets the size of the drawing area to the given
- *   dimensions. 
- * 
+ *   dimensions.
+ *
+ * ----------------------------------------------------------------------------
+ */
+
+static void
+SetDrawingSize(int width, int height)
+{
+  Arg al [2];
+  XtSetArg (al [0], XtNwidth,   (Dimension) width);
+  XtSetArg (al [1], XtNheight,  (Dimension) height);
+  XtSetValues (TreeDrawingArea, al, 2);
+}
+
+
+/* ----------------------------------------------------------------------------
+ *
+ *   SetDrawingTree() is used to specify what tree is to be drawn in the
+ *   drawing area.
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-SetDrawingSize(width, height)
-     int width, height;
+SetDrawingTree(Tree *tree)
 {
-  XtVaSetValues(TreeDrawingArea,
-		XtNwidth, (Dimension) width,
-		XtNheight,  (Dimension) height,
-		NULL);
+  TheTree = tree;
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   SetDrawingTree() is used to specify what tree is to be drawn in the
- *   drawing area. 
- * 
- * ----------------------------------------------------------------------------
- */
-
-void
-SetDrawingTree(tree)
-   Tree *tree;
-{
-   TheTree = tree;
-}
-
-
-/* ----------------------------------------------------------------------------
- * 
+ *
  *   SetNodeLabel() sets the label text of the specified node and computes
  *   the bounding rectangle so that the layout can be determined. This
  *   function is called when new nodes are created. If TreeAlignNodes is
  *   True, the string is truncated so that the node's width is no longer
  *   than TreeParentDistance.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-SetNodeLabel(node, label)
-     Tree *node;
-     char *label;
+SetNodeLabel(Tree *node, char *label)
 {
   int         len;
   int         dummy;
   XCharStruct rtrn;
-  
+
   len = strlen(label);
   while (len > 1) {
     XTextExtents(TreeLabelFont, label, len, &dummy, &dummy, &dummy, &rtrn);
@@ -163,7 +153,7 @@
     else
       break;
   }
-  
+
   node->label.text = label;
   node->label.len  = len;
   node->label.xoffset = LABEL_MAT_WIDTH + 1,
@@ -172,30 +162,28 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   SetDrawColor() sets the drawing color of the TreeDrawingArea. 
- * 
+ *
+ *   SetDrawColor() sets the drawing color of the TreeDrawingArea.
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-SetDrawColor(color)
-     int color;
+SetDrawColor(int color)
 {
   XSetForeground(TreeDrawingAreaDB->display, TreeDrawingAreaDB->gc,
 		 TreeDrawingAreaDB->colors[color]);
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   SetLineWidth() sets the line width of lines drawn in the TreeDrawingArea.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-SetLineWidth(width)
-     unsigned int width;
+static void
+SetLineWidth(unsigned int width)
 {
   XSetLineAttributes(TreeDrawingAreaDB->display, TreeDrawingAreaDB->gc,
 		     width, LineSolid, CapButt, JoinRound);
@@ -203,16 +191,15 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   SetContours() sets the visibility of three possible contour modes: 
+ *
+ *   SetContours() sets the visibility of three possible contour modes:
  *   the outside contour, all subtree contours, or selected contours.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-SetContours(option)
-     ContourOption option;
+static void
+SetContours(ContourOption option)
 {
   if (option == NoContours) {
     switch (TreeShowContourOption) {
@@ -262,15 +249,14 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   HiliteNode() is called by Unzip() to change the color of a node. 
- * 
+ *
+ *   HiliteNode() is called by Unzip() to change the color of a node.
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-HiliteNode(tree, pos_mode)
-     Tree *tree;
+HiliteNode(Tree *tree, PosMode pos_mode)
 {
   SetDrawColor(HIGHLIGHT_COLOR);
   DrawNode(tree, pos_mode);
@@ -279,30 +265,28 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   DrawNode() takes a node and draws the node in the specified widget
  *   at its (x,y) coordinate. (x, y) indicates the upper-left corner where
  *   the node is drawn. Also, a line is drawn from the center of the left
- *   edge to the center of the parent's right edge. 'draw_mode' specifies 
+ *   edge to the center of the parent's right edge. 'draw_mode' specifies
  *   the drawing mode (whether or not the node is erased, rather than drawn).
  *   'pos_mode' determines whether or not to use the old position of the node.
  *   This flag is used in animating the movement of a node from its old
  *   position to its new position.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-DrawNode(node, pos_mode)
-     Tree     *node;
-     PosMode  pos_mode;
+DrawNode(Tree *node, PosMode pos_mode)
 {
   Widget   w;
   GC       gc;
-  
+
   w  = TreeDrawingArea;
   gc = TreeDrawingAreaDB->gc;
-  
+
   if (pos_mode == Old) {
     XDrawString(XtDisplay(w), XtWindow(w), gc,
 		node->old_pos.x + node->label.xoffset,
@@ -311,7 +295,7 @@
     XDrawRectangle(XtDisplay(w), XtWindow(w), gc,
 		   node->old_pos.x, node->old_pos.y,
 		   node->width, node->height);
-    if (node->parent) 
+    if (node->parent)
       XDrawLine(XtDisplay(w), XtWindow(w), gc,
 		node->old_pos.x - 1,
 		node->old_pos.y + (node->height / 2),
@@ -331,11 +315,11 @@
 		node->pos.x + node->label.xoffset,
 		node->pos.y + node->label.yoffset,
 		node->label.text, node->label.len);
-    
+
     XDrawRectangle(XtDisplay(w), XtWindow(w), gc,
 		   node->pos.x, node->pos.y,
 		   node->width, node->height);
-    if (node->parent) 
+    if (node->parent)
       XDrawLine(XtDisplay(w), XtWindow(w), gc,
 		node->pos.x - 1,
 		node->pos.y + (node->height / 2),
@@ -355,25 +339,20 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   DrawTreeContour() draws the contour of the specified subtree. Bridges
  *   are not traversed, so the actual subtree contour is drawn, as opposed
  *   to the merged contour. 'color' specifies the drawing color. If 'detach'
  *   is True,  the lines attaching the subtree contour to the node are not
  *   drawn.  If 'select' is true, then only subtrees that are flagged as
  *   selected are shown. If 'recursive' is True, the entire tree is traversed.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-DrawTreeContour(tree, pos_mode, color, detach, select, recursive)
-     Tree *tree;
-     PosMode pos_mode;
-     int color;
-     int detach;
-     int select;
-     int recursive;
+DrawTreeContour(Tree *tree, PosMode pos_mode,
+		int color, int detach_p, int select_p, int recursive)
 {
   Widget w = TreeDrawingArea;
   Polyline *contour, *tail;
@@ -383,11 +362,11 @@
   if (tree == NULL)
     return;
 
-  if ((select && tree->show_contour) || !select) {
+  if ((select_p && tree->show_contour) || !select_p) {
 
     SetDrawColor(color);
     SetLineWidth(TreeContourWidth);
-   
+
     /* draw upper contour */
     contour = tree->contour.upper.head;
     tail    = tree->contour.upper.tail;
@@ -400,14 +379,14 @@
       y = tree->pos.y - tree->border;
     }
 
-    if (detach) {		/* skip over attaching lines */
+    if (detach_p) {		/* skip over attaching lines */
       for (i = 0 ; i < 2 ; i++) {
 	x += contour->dx;
 	y += contour->dy;
 	contour = contour->link;
       }
     }
-    
+
     while (contour) {
       XDrawLine(XtDisplay(w), XtWindow(w), TreeDrawingAreaDB->gc,
 		x, y, x + contour->dx, y + contour->dy);
@@ -430,7 +409,7 @@
       y = tree->pos.y + tree->border + tree->height;
     }
 
-    if (detach) {		/* skip over attaching lines */
+    if (detach_p) {		/* skip over attaching lines */
       for (i = 0 ; i < 2 ; i++) {
 	x += contour->dx;
 	y += contour->dy;
@@ -449,12 +428,12 @@
 	contour = contour->link;
     }
   }
-  
+
   if (recursive) {
     FOREACH_CHILD(child, tree)
       if (!child->elision)
 	DrawTreeContour(child, pos_mode, color,
-			detach, select, recursive);
+			detach_p, select_p, recursive);
   }
 
   SetDrawColor(TREE_COLOR);
@@ -463,22 +442,20 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   DrawTree() traverses the given tree, drawing the node and connecting
  *   segments. The tree contours are also drawn at each step, if enabled.
  *   'draw_mode' specifies the drawing mode in which the tree is drawn.
  *   'pos_mode' determines whether or not to use the old position of the node.
  *   This flag is used in animating the movement of a node from its old
- *   position to its new position. DrawNode() is called to draw an individual 
+ *   position to its new position. DrawNode() is called to draw an individual
  *   node.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-DrawTree(tree, pos_mode)
-     Tree     *tree;
-     PosMode  pos_mode;
+DrawTree(Tree *tree, PosMode pos_mode)
 {
   if (tree == NULL)
     return;
@@ -497,7 +474,7 @@
   if (tree->on_path)
     HiliteNode(tree, pos_mode);
 
-  if (tree->child && !tree->elision) 
+  if (tree->child && !tree->elision)
     DrawTree(tree->child, pos_mode);
   if (tree->sibling)
     DrawTree(tree->sibling, pos_mode);
@@ -505,51 +482,48 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   ShiftTree() adjusts the positions of each node so that it moves from
  *   the "old" position towards the "new position". This is used by
  *   AnimateTree(). 'done' is set to FALSE if the tree is not in its
  *   final position; it is used to determine when to stop animating the tree.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-ShiftTree(tree, done)
-     Tree *tree;
-     int  *done;
+static void
+ShiftTree(Tree *tree, int *done)
 {
   Tree *child;
-  
+
   if (tree->old_pos.x != tree->pos.x ||
       tree->old_pos.y != tree->pos.y)
     {
       tree->old_pos.x = tree->pos.x;
       tree->old_pos.y = tree->pos.y;
     }
-  
+
   FOREACH_CHILD(child, tree)
     ShiftTree(child, done);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   AnimateTree() draws the given tree in a series of steps to give the
  *   effect of animation from the "old" layout to the "new" layout of the
- *   tree. 
- * 
+ *   tree.
+ *
  *   The algorithm used here is not efficient; the entire tree is drawn
  *   on each iteration of the animation sequence; it would be more efficient
  *   to only redraw what is necessary. However, the method used here takes
  *   advantage of existing code without modification.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-AnimateTree(tree)
-     Tree *tree;
+static void
+AnimateTree(Tree *tree)
 {
   int done = FALSE;
 
@@ -558,7 +532,7 @@
   BeginFrame();
     DrawTree(tree, Old);
   EndFrame();
-  Pause(); 
+  Pause();
   if (PauseAfterStep)
     AnimationStep = ANIMATION_STEP_STEP;
   while (!done) {
@@ -577,19 +551,18 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   AnimateZip() generates a sequence of frames that animates the Zip() step.
  *   It is similar in logical structure to Zip().
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void 
-AnimateZip(tree)
-     Tree *tree;
+static void
+AnimateZip(Tree *tree)
 {
   Tree *child;
-   
+
   /* show results of Join() step */
   if (tree->child) {
     BeginFrame();
@@ -600,8 +573,8 @@
     EndFrame();
 
     StatusMsg("Zip: merge and join contours", FALSE);
-    Pause(); 
-   
+    Pause();
+
     /* show results of AttachParent() step */
     BeginFrame();
       DrawTree(TheTree, New);
@@ -609,11 +582,11 @@
     EndFrame();
 
     StatusMsg("Zip: attach parents", FALSE);
-    Pause(); 
+    Pause();
   }
-  
+
   tree->on_path = FALSE;
-   
+
   if (tree->parent)
     AnimateZip(tree->parent);
   else {
@@ -623,26 +596,25 @@
       DrawTreeContour(TheTree, New, CONTOUR_COLOR, FALSE, FALSE, FALSE);
     EndFrame();
     StatusMsg("Zip: reassemble entire contour", FALSE);
-    Pause(); 
+    Pause();
   }
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   CountNodes() returns the number of nodes in the specified tree. 
- *   Nodes below a node that has been collapsed are ignored. 
- * 
+ *
+ *   CountNodes() returns the number of nodes in the specified tree.
+ *   Nodes below a node that has been collapsed are ignored.
+ *
  * ----------------------------------------------------------------------------
  */
 
-int
-CountNodes(tree)
-     Tree *tree;
+static int
+CountNodes(Tree *tree)
 {
   int num_nodes = 1;		/* count root of subtree */
   Tree *child;
-  
+
   if (!tree->elision) {
     FOREACH_CHILD(child, tree)
       num_nodes += CountNodes(child);
@@ -652,22 +624,19 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   CollectNodeRectangles() is a recursive function used by
  *   GetSubTreeRectangles() to collect the rectangles of descendant nodes
  *   into the pre-allocated storage passed to this function.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-CollectNodeRectangles(node, rectangles, fill)
-     Tree *node;
-     XRectangle **rectangles;
-     int fill;
+static void
+CollectNodeRectangles(Tree *node, XRectangle **rectangles, int fill)
 {
   Tree *child;
-   
+
   (*rectangles)->x = node->pos.x;
   (*rectangles)->y = node->pos.y;
   if (fill) {
@@ -678,40 +647,38 @@
     (*rectangles)->height = node->height;
   }
   (*rectangles)++;
-  
+
   if (!node->elision)
-    FOREACH_CHILD(child, node) 
+    FOREACH_CHILD(child, node)
       CollectNodeRectangles(child, rectangles, fill);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   GetSubTreeRectangles() builds an array of XRectangles that contain
- *   all the node rectangles in the tree, except the root node itself. 
+ *   all the node rectangles in the tree, except the root node itself.
  *   The array is returned in 'rectangles' and the number of rectangles
  *   is returned in 'nrectangles.' Storage for the rectangles is allocated
  *   in this function. This function is used by PickAction to determine
  *   what rectangles need to be dissolved away. 'fill', if True, specifies
- *   that the rectangles should be 1 pixel larger in each dimension to 
- *   compensate for FillRectangle behavior. 
- * 
+ *   that the rectangles should be 1 pixel larger in each dimension to
+ *   compensate for FillRectangle behavior.
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-GetSubTreeRectangles(tree, rectangles, nrectangles, fill)
-     Tree *tree;
-     XRectangle **rectangles;
-     int *nrectangles, fill;
+static void
+GetSubTreeRectangles(Tree *tree, XRectangle **rectangles,
+		     int *nrectangles, int fill)
 {
   Tree *child;
   XRectangle *crect;		/* current rectangle */
-  
+
   *nrectangles = CountNodes(tree) - 1;        /* don't count root node */
   *rectangles = (XRectangle *) malloc(sizeof(XRectangle) * *nrectangles);
   ASSERT(*rectangles, "could not allocate memory for rectangles");
-  
+
   crect = *rectangles;
   if (!tree->elision)
     FOREACH_CHILD(child, tree)
@@ -720,21 +687,19 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   CollectNodeSegments() is a recursive function used by GetSubTreeSegments()
- *   to collect the line segments connecting nodes into the pre-allocated 
+ *   to collect the line segments connecting nodes into the pre-allocated
  *   storage passed to this function.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-CollectNodeSegments(node, segments)
-     Tree *node;
-     XSegment **segments;
+static void
+CollectNodeSegments(Tree *node, XSegment **segments)
 {
   Tree *child;
-   
+
   (*segments)->x1 = node->pos.x - 1;
   (*segments)->y1 = node->pos.y + (node->height / 2),
   (*segments)->x2 = node->parent->pos.x + node->parent->width + 1;
@@ -742,28 +707,25 @@
   (*segments)++;
 
   if (!node->elision)
-    FOREACH_CHILD(child, node) 
+    FOREACH_CHILD(child, node)
       CollectNodeSegments(child, segments);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   GetSubTreeSegments() builds an array of XSegments that contain
  *   all the line segments connecting the nodes in the tree. The array is
  *   returned in 'segments' and the number of segments is returned in
  *   'nsegments.' Storage for the segments is allocated in this function.
  *   This function is used by PickAction to determine what line segments
  *   rectangles need to be dissolved away.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-GetSubTreeSegments(tree, segments, nsegments)
-     Tree *tree;
-     XSegment **segments;
-     int *nsegments;
+static void
+GetSubTreeSegments(Tree *tree, XSegment **segments, int *nsegments)
 {
   Tree *child;
   XSegment *cseg;		/* current segment */
@@ -771,7 +733,7 @@
   *nsegments = CountNodes(tree) - 1;
   *segments = (XSegment *) malloc(sizeof(XSegment) * *nsegments);
   ASSERT(*segments, "could not allocate memory for segments");
-  
+
   cseg = *segments;
   if (!tree->elision)
     FOREACH_CHILD(child, tree)
@@ -780,21 +742,20 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   ComputeSubTreeExtent() computes the extent of a subtree. This is
  *   easily computed based on the tree's contour, as in ComputeTreeSize().
- *   This extent is stored in the node, and used by SearchTree for 
- *   pick-correlation. 
- * 
+ *   This extent is stored in the node, and used by SearchTree for
+ *   pick-correlation.
+ *
  *   This function assumes that the given tree has at least one child; do not
- *   pass a leaf node to this function. 
- * 
+ *   pass a leaf node to this function.
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-ComputeSubTreeExtent(tree)
-     Tree *tree;
+ComputeSubTreeExtent(Tree *tree)
 {
   int width, height;
   int x_offset, y_offset;
@@ -808,28 +769,26 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   SearchTree() determines if a node's rectangular region encloses the
- *   specified point in (x,y). Rather than using a brute-force search 
+ *   specified point in (x,y). Rather than using a brute-force search
  *   through all node rectangles of a given tree, the subtree extents
  *   are used in a recursive fashion to drive the search as long as the
  *   given point is enclosed in an extent. In the worst case, the search
  *   time would be on the order of a brute-force search, but with complex
- *   trees, this method reduces the number of visits. 
- * 
+ *   trees, this method reduces the number of visits.
+ *
  *   The extent of a subtree is computed by ComputeSubTreeExtent() and is
  *   stored in each node of the tree.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 int
-SearchTree(tree, x, y, node)
-     Tree *tree, **node;
-     int x, y;
+SearchTree(Tree *tree, int x, int y, Tree **node)
 {
   Tree *child;
-  
+
   if (tree == NULL)
     return (FALSE);
 
@@ -839,9 +798,9 @@
     *node = tree;
     return (TRUE);
   }
-  if (tree->child && (PT_IN_EXTENT(x, y, tree->subextent))) 
+  if (tree->child && (PT_IN_EXTENT(x, y, tree->subextent)))
     FOREACH_CHILD(child, tree) {
-      if (SearchTree(child, x, y, node)) 
+      if (SearchTree(child, x, y, node))
 	return (TRUE);
     }
   return (FALSE);
@@ -849,21 +808,18 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   ExposeHandler() handles expose events in the TreeDrawingArea. This
  *   function is not intelligent; it just redraws the entire contents.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-ExposeHandler(w, client_data, event)
-     Widget   w;
-     caddr_t client_data;
-     XExposeEvent  *event;
+ExposeHandler(Widget w, XtPointer closure,
+	      XEvent *event, Boolean *continue_to_dispatch)
 {
-  
-  if (event->count == 0) {
+  if (event->xexpose.count == 0) {
     BeginFrame();
       SetContours(TreeShowContourOption);
       DrawTree(TheTree, New);
@@ -873,15 +829,14 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   ExpandCollapseNode is called to expand or collapse a node in the tree.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-ExpandCollapseNode(node)
-     Tree *node;
+ExpandCollapseNode(Tree *node)
 {
   int        width, height;
   int        old_width, old_height;
@@ -891,25 +846,25 @@
   int        nrectangles, nsegments;
   int        expand = FALSE;
   Widget     w = TreeDrawingArea;
-  
+
   StatusMsg("", TRUE);
-  
+
   /* hilite node so that we know where we are */
   /* DrawTree will hilite it as a side effect */
   if (TreeShowSteps)
     node->on_path = TRUE;
-  
+
   /* erase the contour before changing in the tree */
   if ((TreeShowContourOption != NoContours) || TreeShowSteps) {
     BeginFrame();
       DrawTree(TheTree, New);
     EndFrame();
   }
-   
+
   sprintf(strbuf, "Node `%s' selected for %s", node->label.text,
 	  node->elision ? "expansion" : "collapse");
   StatusMsg(strbuf, FALSE);
-  Pause(); 
+  Pause();
 
   if (node->parent)
     Unzip(node->parent);
@@ -920,7 +875,7 @@
         DrawTreeContour(TheTree, New, CONTOUR_COLOR, FALSE, FALSE, FALSE);
         DrawTree(TheTree, New);
       EndFrame();
-      Pause(); 
+      Pause();
     }
   }
 
@@ -934,8 +889,8 @@
 		 segments, nsegments, TRUE);
     free(rectangles);
     free(segments);
-    Pause(); 
-    
+    Pause();
+
     StatusMsg("Replace subtree contour with leaf contour", FALSE);
     node->elision = TRUE;
     if (TreeShowSteps)
@@ -947,7 +902,7 @@
       SetContours(TreeShowContourOption);
       DrawTree(TheTree, New);
     EndFrame();
-    Pause();  
+    Pause();
   } else {
     StatusMsg("Replace leaf contour with old subtree contour", FALSE);
     if (TreeShowSteps)
@@ -956,10 +911,10 @@
     node->contour = node->old_contour;
     expand = TRUE;
   }
-  
+
   if (node->parent)
     Zip(node->parent);
-  
+
   ComputeTreeSize(TheTree, &width, &height, &x_offset, &y_offset);
   PetrifyTree(TheTree, x_offset + MAT_SIZE, y_offset + MAT_SIZE);
   GetDrawingSize(&old_width, &old_height);
@@ -969,7 +924,7 @@
     BeginFrame();
       DrawTree(TheTree, Old);
     EndFrame();
-    Pause(); 
+    Pause();
     StatusMsg("Move tree to new configuration", FALSE);
     AnimateTree(TheTree);
   } else {
@@ -982,7 +937,7 @@
   if (expand) {
     StatusMsg("Expand subtree", FALSE);
     node->elision = FALSE;
-    
+
     /* erase elision marker */
     XSetFunction(TreeDrawingAreaDB->display, TreeDrawingAreaDB->gc,
 		 GXclear);
@@ -992,7 +947,7 @@
     XSetFunction(TreeDrawingAreaDB->display, TreeDrawingAreaDB->gc,
 		 GXcopy);
     node->width -= ELISION_WIDTH;
-    
+
     GetSubTreeRectangles(node, &rectangles, &nrectangles, FALSE);
     GetSubTreeSegments(node, &segments, &nsegments);
     /* dissolve the tree back in */
@@ -1001,15 +956,15 @@
 		 segments, nsegments, FALSE);
     free(rectangles);
     free(segments);
-    
+
     /* draw text of nodes */
     BeginFrame();
       SetContours(TreeShowContourOption);
       DrawTree(TheTree, New);
     EndFrame();
-    Pause(); 
+    Pause();
   }
-  
+
   if (TreeShowSteps) {
     node->on_path = FALSE;
     if (node->parent)
@@ -1017,11 +972,11 @@
     else
       node->split = FALSE;
   }
-  
+
   /* BUG: the display isn't properly updated here! */
   /* There should probably be some code here that
-     clears the tree below the node currently being 
-     collapsed or expanded. Hack added 20.03.95 (torgeir@ii.uib.no). 
+     clears the tree below the node currently being
+     collapsed or expanded. Hack added 20.03.95 (torgeir@ii.uib.no).
      I'll try to fix this later. */
 
   XClearArea(TreeDisplay, XtWindow(TreeDrawingArea), 0, 0, 0, 0, FALSE);
@@ -1030,24 +985,21 @@
     SetContours(TreeShowContourOption);
     DrawTree(TheTree, New);
   EndFrame();
-  
+
   StatusMsg("Ready", TRUE);
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   InsertNode() handles the task of inserting a new node in the tree,
  *   at the given position with respect to 'base_node'. When 'node_pos' is
  *   either Before or After, it is assumed that 'base_node' has a parent.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-InsertNode(base_node, node_pos, new_node_text)
-     Tree *base_node;
-     NodePosition node_pos;
-     char *new_node_text;
+InsertNode(Tree *base_node, NodePosition node_pos, char *new_node_text)
 {
   Tree *new_node;
   Tree *parent;
@@ -1079,11 +1031,14 @@
 	sibling = child;
 	break;
       }
+  } else {
+    parent = NULL;
+    abort();
   }
 
   if (TreeShowSteps)
     parent->on_path = TRUE;
-  
+
   if ((TreeShowContourOption != NoContours) ||
       TreeShowSteps) {
     BeginFrame();
@@ -1094,15 +1049,15 @@
   sprintf(strbuf, "Inserting `%s' as child of node `%s'",
 	  new_node_text, parent->label.text);
   StatusMsg(strbuf, FALSE);
-  Pause(); 
-   
+  Pause();
+
   /* erase the contour before changing in the tree */
-  
+
   Insert(parent, new_node, sibling);
-  
+
   ComputeTreeSize(TheTree, &width, &height, &x_offset, &y_offset);
   PetrifyTree(TheTree, x_offset + MAT_SIZE, y_offset + MAT_SIZE);
-  
+
   if (sibling)
     new_node->old_pos = sibling->old_pos;
   else if (new_node->sibling)
@@ -1111,7 +1066,7 @@
     new_node->old_pos.x = new_node->pos.x;
     new_node->old_pos.y = parent->old_pos.y;
   }
-  
+
   if (TreeShowSteps)
     new_node->split = TRUE;
 
@@ -1120,8 +1075,8 @@
     DrawTree(TheTree, Old);
   EndFrame();
   StatusMsg("Insert: add new node and contour", FALSE);
-  Pause(); 
-   
+  Pause();
+
   StatusMsg("Move tree to new configuration", FALSE);
   AnimateTree(TheTree);
 
@@ -1136,18 +1091,17 @@
   EndFrame();
 
   StatusMsg("Ready", TRUE);
-}   
+}
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   DeleteNode() handles the task of deleting a given node in the tree.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-DeleteNode(node)
-     Tree *node;
+DeleteNode(Tree *node)
 {
   Tree *parent;
 
@@ -1157,12 +1111,12 @@
   Widget      w = TreeDrawingArea;
   int  width, height;
   int  x_offset, y_offset;
-  
+
   StatusMsg("", TRUE);
 
   if (TreeShowSteps)
     node->on_path = TRUE;
-   
+
   /* erase the contour before changing in the tree */
   if ((TreeShowContourOption != NoContours) ||
       TreeShowSteps) {
@@ -1173,10 +1127,10 @@
 
   sprintf(strbuf, "Node `%s' selected for deletion", node->label.text);
   StatusMsg(strbuf, FALSE);
-  Pause(); 
-  
+  Pause();
+
   parent = node->parent;
-  
+
   if (parent)
     Unzip(parent);
   else
@@ -1195,21 +1149,21 @@
   Delete(node);
 
   BeginFrame();
-  if (TheTree) 
+  if (TheTree)
     DrawTree(TheTree, New);
   EndFrame();
-  Pause(); 
+  Pause();
 
   if (parent)
     Zip(parent);
-  
+
   if (TheTree) {
     ComputeTreeSize(TheTree, &width, &height, &x_offset, &y_offset);
     PetrifyTree(TheTree, x_offset + MAT_SIZE, y_offset + MAT_SIZE);
     StatusMsg("Move tree to new configuration", FALSE);
     AnimateTree(TheTree);
     SetDrawingSize(width + (2 * MAT_SIZE), height + (2 * MAT_SIZE));
-    Pause(); 
+    Pause();
 
     if (TreeShowSteps) {
       if (parent)
@@ -1228,19 +1182,19 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   ResetLabels() is called when the TreeAlignNodes mode is changed. 
+ *
+ *   ResetLabels() is called when the TreeAlignNodes mode is changed.
  *   When TreeParentDistance changes, the node width changes, so this
- *   function forces each node's width to be recomputed. 
- * 
+ *   function forces each node's width to be recomputed.
+ *
  * ----------------------------------------------------------------------------
  */
 
-ResetLabels(tree)
-     Tree *tree;
+void
+ResetLabels(Tree *tree)
 {
   Tree *child;
-  
+
   SetNodeLabel(tree, tree->label.text);
   FOREACH_CHILD(child, tree)
     ResetLabels(child);
@@ -1248,20 +1202,19 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   SetupTree() handles the task of setting up the specified tree in 
+ *
+ *   SetupTree() handles the task of setting up the specified tree in
  *   the drawing area.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-SetupTree(tree)
-     Tree *tree;
+SetupTree(Tree *tree)
 {
   int width, height;
   int x_offset, y_offset;
-  
+
   LayoutTree(tree);
   ComputeTreeSize(tree, &width, &height, &x_offset, &y_offset);
   PetrifyTree(tree, x_offset + MAT_SIZE, y_offset + MAT_SIZE);
@@ -1272,9 +1225,3 @@
     DrawTree(tree, New);
   EndFrame();
 }
-
-
-
-
-
-
--- a/pkg-src/tree-x/input.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/input.c	Mon Aug 13 09:45:46 2007 +0200
@@ -6,49 +6,50 @@
 
 #include <ctype.h>
 #include <string.h>
+#include <stdlib.h>
 #include "defs.h"
 #include "tree.h"
 #include "input.h"
+#include "dbl.h"
+#include "intf.h"
 
 char *EnvNm;                 /* Stores name of current Envir file */
 static int tokDepth = 0;     /* Depth in tree of current token */
 static int prevTokDepth;     /* Depth in tree of prev token */
 
-static void SaveSubtree();
+static void SaveSubtree(Tree *tree, int level, FILE *fp);
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   GetNextToken() reads the next token from the file indicated by 'fp' and
  *   returns a token. If the token is TOKEN_LABEL, the lexeme is returned
  *   in 'lexeme'. If memory could not be allocated for 'lexeme', it is NULL.
- * 
+ *
  *   The following tokens are supported:
- * 
+ *
  *     - TOKEN_LABEL: a string of characters, up to 'TOKEN-MAXSIZ'
  *       characters, delimited by number of leading spaces and newlines.
  *       If a label has more than this number of characters, the rest are
- *       ignored. 
+ *       ignored.
  *     - TOKEN_EOF
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-int
-  GetNextToken(fp, lexeme)
-FILE *fp;
-char **lexeme;
+static int
+GetNextToken(FILE *fp, char **lexeme)
 {
   static   char  lexbuf[INPUT_BUFSIZ];
   register char *curbuf = lexbuf;
   register int   charct = 0;
   register int   c;
   int done = FALSE;
-  
+
   prevTokDepth = tokDepth;
   tokDepth = 0;
-  
+
   c = getc(fp);
-  
+
   /* skip over leading whitespace */
   while (c == ' ')
     {
@@ -56,7 +57,7 @@
       c = getc(fp);
     }
   tokDepth /= 2;
-  
+
   while (1)
     {
       switch (c)
@@ -67,7 +68,6 @@
 	  *curbuf = '\0';
 	  *lexeme = strdup(lexbuf);
 	  return (TOKEN_LABEL);
-	  break;
 	default:
 	  *curbuf++ = c;
 	  charct++;
@@ -92,22 +92,20 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   SetNodeLabelAndValue() sets the label text of the specified node and
  *   stores any string value following the label and preceded by a "^^"
- *   delimiter. 
- * 
+ *   delimiter.
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-SetNodeLabelAndValue(node, label_and_value)
-   Tree *node;
-   char *label_and_value;
+SetNodeLabelAndValue(Tree *node, char *label_and_value)
 {
    char*       val;
 
-   if (val = strstr(label_and_value, "^^"))
+   if ((val = strstr(label_and_value, "^^")))
        {
            /* Set node value to string following ^^ delimiter. */
            node->value = val+2;
@@ -121,42 +119,40 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   ReadTreeFromFile() takes a filename argument and constructs
  *   a Tree from the labels in the file. If a tree could be constructed,
  *   even partially, it is returned by the function. NULL is returned if
  *   the file could not be opened or there was insufficient memory for
  *   creating the tree.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 Tree*
-  ReadTreeFromFile(fname, error)
-char *fname;
-ErrCode *error;
+ReadTreeFromFile(char *fname, ErrCode *error)
 {
   FILE *infile;
   int   inside_list = 0;	/* for semantic checking */
   int   first_child = TRUE;
-  
+
   int   token;
   char *label;
-  
+
   Tree *tree = NULL;		/* the return value of this function  */
   Tree *parent = NULL;		/* parent of 'node'                   */
   Tree *node;			/* current node                       */
   Tree *new_node;		/* new node to add after current node */
-  
+
   *error = ERR_NONE;
-  
+
   infile = fopen(fname, "r");
   if (infile == NULL)
     {
       *error = ERR_OPENFAIL;
       return (NULL);
     }
-  
+
   /* first line of file is Envir file name, save */
   token = GetNextToken(infile, &label);
   if (token == TOKEN_EOF)
@@ -175,7 +171,7 @@
 	}
       EnvNm = strdup(label);
     }
-  
+
   /* set up root node */
   token = GetNextToken(infile, &label);
   if (token == TOKEN_EOF)
@@ -210,14 +206,14 @@
       fclose(infile);
       return (NULL);
     }
-  
+
   /* add children and siblings */
   while (1)
     {
       token = GetNextToken(infile, &label);
       if (token == TOKEN_EOF)
 	break;
-      
+
       if (tokDepth > prevTokDepth)  /* then new subtree */
 	{
 	  inside_list++;
@@ -238,7 +234,7 @@
 	      node = node->parent;
 	      parent = node->parent;
 	    }
-      
+
       if (label == NULL)
 	{
 	  *error = ERR_MEMALLOC;
@@ -264,7 +260,7 @@
 	    }
 	  SetNodeLabelAndValue(new_node, label);
 	  new_node->parent = parent;
-	  
+
 	  if (first_child)
 	    {
 	      new_node->parent->child = new_node;
@@ -272,7 +268,7 @@
 	    }
 	  else
 	    node->sibling = new_node;
-	  
+
 	  node = new_node;
 /*
  *	  printf("%3d tok: '%s'; tokDepth: %d; prevTokDepth: %d; inside_list: %d\n",
@@ -286,49 +282,45 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   SaveTreeToFile() takes a tree and saves it to a file specified by 'fname.'
  *   If the file could not be opened for writing, False is returned. Otherwise,
  *   True is returned.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-SaveTreeToFile(tree, fname)
-     Tree *tree;
-     char *fname;
+int
+SaveTreeToFile(Tree *tree, char *fname)
 {
   FILE *outfile;
-  
+
   outfile = fopen(fname, "w");
   if (outfile == NULL)
     return (FALSE);
-  
+
   fprintf(outfile, "%s\n", EnvNm);   /* Save Env File Name */
   fprintf(outfile, "%s\n", tree->label.text);
   if (tree->child)
     SaveSubtree(tree->child, 0, outfile);
-  
+
   fclose(outfile);
   return (TRUE);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   SaveSubtree() is the recursive procedure that supports SaveTreeToFile().
  *
  * ----------------------------------------------------------------------------
  */
 
 static void
-  SaveSubtree(tree, level, fp)
-Tree *tree;
-int level;
-FILE *fp;
+SaveSubtree(Tree *tree, int level, FILE *fp)
 {
   int i;
-  
+
   level++;
   for ( ; tree ; tree = tree->sibling)
     {
@@ -343,5 +335,3 @@
     }
   level--;
 }
-
-
--- a/pkg-src/tree-x/input.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/input.h	Mon Aug 13 09:45:46 2007 +0200
@@ -9,7 +9,7 @@
 /*
  *  #define DELIMITER_BEGIN_LIST '{'
  *  #define DELIMITER_END_LIST   '}'
- */ 
+ */
 
 /* Possible token types in file */
 
@@ -21,7 +21,7 @@
        TOKEN_EOF };
 
 
-typedef enum { 
+typedef enum {
    ERR_OPENFAIL,
    ERR_EMPTYFILE,
    ERR_MEMALLOC,
@@ -29,9 +29,12 @@
    ERR_NOEND,
    ERR_NOROOT,
    ERR_MANYROOT,
-   ERR_NONE,
+   ERR_NONE
 } ErrCode;
 
 #define NUM_ERRS             7	/* don't count ERR_NONE */
 
 
+Tree*	ReadTreeFromFile(char *fname, ErrCode *error);
+void	SetNodeLabelAndValue(Tree *node, char *label_and_value);
+int	SaveTreeToFile(Tree *tree, char *fname);
--- a/pkg-src/tree-x/intf.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/intf.c	Mon Aug 13 09:45:46 2007 +0200
@@ -4,9 +4,22 @@
  * ----------------------------------------------------------------------------
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_USLEEP
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#else
+int usleep(unsigned long microSeconds);
+#endif /* HAVE_USLEEP */
+
 #define GLOBALS 1
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
 
@@ -33,7 +46,7 @@
   #include <X11/Xaw3d/Paned.h>
   #include <X11/Xaw3d/Panner.h>
   #include <X11/Xaw3d/Reports.h>
-#else  
+#else
   #include <X11/Xaw/Box.h>
   #include <X11/Xaw/Simple.h>
   #include <X11/Xaw/MenuButton.h>
@@ -50,7 +63,7 @@
   #include <X11/Xaw/Paned.h>
   #include <X11/Xaw/Panner.h>
   #include <X11/Xaw/Reports.h>
-  #endif
+#endif
 
 #include "defs.h"
 #include "tree.h"
@@ -59,17 +72,16 @@
 #include "rsrc.h"
 #include "input.h"
 #include "help.h"
+#include "dissolve.h"
 
 #include <X11/cursorfont.h>
 
-
 /* ------------------------------------------------------------------------- */
 /*				Global Variables                             */
 /* ------------------------------------------------------------------------- */
 
 extern char  *EnvNm;    /* Stores name of current Envir file */
 
-Atom	      wm_delete_window;
 Widget        TreeTopLevel;
 Widget        TreeDrawingArea;
 Display      *TreeDisplay;
@@ -126,7 +138,7 @@
 
 /* globals used for state values */
 
-static Widget dlgLevelScale, dlgLevelValuator, 
+static Widget dlgLevelScale, dlgLevelValuator,
               dlgSiblingValuator, dlgSiblingScale;
 static int dlgLevelValue;
 static int dlgSiblingValue;
@@ -184,25 +196,24 @@
    },
 };
 
-static void popdown_action();
-static void activate_action();
-static void quit_action();
-static void Action();
+static void popdown_action    (Widget, XEvent *, String *, Cardinal *);
+static void activate_action   (Widget, XEvent *, String *, Cardinal *);
+static void quit_action       (Widget, XEvent *, String *, Cardinal *);
 
-static void select_action();
-static void button_action();
-static void menu_popup_action();
+static void select_action     (Widget, XEvent *, String *, Cardinal *);
+static void button_action     (Widget, XEvent *, String *, Cardinal *);
+static void menu_popup_action (Widget, XEvent *, String *, Cardinal *);
 
-static void set_levelscale_CB();
-static void levelscale_CB();
-static void set_siblingscale_CB();
-static void siblingscale_CB();
-static void set_levelvalue_CB();
-static void set_siblingvalue_CB();
-static void levelvalue_CB();
-static void siblingvalue_CB();
+static void set_levelscale_CB   (Widget, XtPointer, XtPointer);
+static void     levelscale_CB   (Widget, XtPointer, XtPointer);
+static void set_levelvalue_CB   (Widget, XtPointer, XtPointer);
+static void     levelvalue_CB   (Widget, XtPointer, XtPointer);
+static void set_siblingscale_CB (Widget, XtPointer, XtPointer);
+static void     siblingscale_CB (Widget, XtPointer, XtPointer);
+static void set_siblingvalue_CB (Widget, XtPointer, XtPointer);
+static void     siblingvalue_CB (Widget, XtPointer, XtPointer);
 
-static void center_widget();
+static void center_widget(Widget w, int x, int y);
 
 static XtActionsRec local_actions[] = {
   {"wmpopdown", popdown_action},
@@ -291,7 +302,7 @@
 
 #define slider_pixmap_width 4
 #define slider_pixmap_height 4
-static char slider_pixmap_bits[] = {
+static unsigned char slider_pixmap_bits[] = {
   0x05, 0x0a, 0x05, 0x0a
 };
 
@@ -299,68 +310,60 @@
 /*			 Forward Function Declarations                       */
 /* ------------------------------------------------------------------------- */
 
-static void popup_dialog();
-
-static void Quit_CB();
+static void popup_dialog(Widget, XtGrabKind );
 
-static void Contours_CB();
-static void ShowContours_CB();
-static void Pause_CB();
-static void Speed_CB();
-
-static void Help_CB();
-static void HelpDone_CB();
-static void Scale_CB();
+static void Help_CB       (Widget, XtPointer, XtPointer);
+static void HelpDone_CB   (Widget, XtPointer, XtPointer);
+static void Scale_CB      (Widget, XtPointer, XtPointer);
 
-static void TreeMenu_CB();
-static void LayoutMenu_CB();
-static void NodeMenu_CB();
+static void TreeMenu_CB   (Widget, XtPointer, XtPointer);
+static void LayoutMenu_CB (Widget, XtPointer, XtPointer);
+static void NodeMenu_CB   (Widget, XtPointer, XtPointer);
 
-static void NodeLabel_CB();
-static void NewTree_CB();
-static void File_CB();
+static void NodeLabel_CB  (Widget, XtPointer, XtPointer);
+static void NewTree_CB    (Widget, XtPointer, XtPointer);
+static void File_CB       (Widget, XtPointer, XtPointer);
 
-static void Popdown_CB();
-static void ButtonHandler();
-
-extern void ExposeHandler();
+static void Popdown_CB    (Widget, XtPointer, XtPointer);
 
 /* ------------------------------------------------------------------------- */
 /*				   Functions                                 */
 /* ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   Status() displays the specified text in the status area.
  *   'urgent' overrides the value of TreeShowSteps.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-StatusMsg(msg, urgent)
-     char *msg;
-     int  urgent;
+StatusMsg(char *msg, int urgent)
 {
-  if (TreeShowSteps || urgent) 
-    XtVaSetValues(statusText, XtNlabel, msg, NULL);
+  if (TreeShowSteps || urgent)
+    {
+      Arg al [1];
+      XtSetArg (al [0], XtNlabel, msg);
+      XtSetValues(statusText, al, 1);
+    }
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *  Pause is a trivial function, for the benefit of interface-dependent code
  *  inside tree.c. This avoids having to include X11 stuff inside that file.
  *  PauseTime is expected to contain an integer indicating 1/10ths of a sec.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-Pause()
+Pause(void)
 {
   XEvent event;
-  
+
   if (PauseAfterStep) {
     XGrabKeyboard(TreeDisplay, XtWindow(TreeTopLevel), False,
 		  GrabModeAsync, GrabModeAsync, CurrentTime);
@@ -379,50 +382,49 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   BuildPopupMenus() builds the popup menus for use in the application
  *   window.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-BuildPopupMenus(parent)
-     Widget parent;
+static void
+BuildPopupMenus(Widget parent)
 {
   Arg      args[2];
   String   xstr;
-  
+
   labelStr[STR_NODE_COLLAPSE] = "Collapse Node";
   labelStr[STR_NODE_EXPAND]   = "Expand Node";
-  
+
   treeMenus[NODE_MENU] = XtVaCreatePopupShell("nodeMenu",
 					      simpleMenuWidgetClass,
-					      parent, 
+					      parent,
 					      XtNlabel, " ",
 					      NULL);
-  
+
   (void)  XtVaCreateManagedWidget("nodeMenuAddChild", smeLineObjectClass,
 				  treeMenus[NODE_MENU],
 				  NULL);
-  
-  nodeMenuItems[NODE_MENU_ADD_CHILD] = 
+
+  nodeMenuItems[NODE_MENU_ADD_CHILD] =
     XtVaCreateManagedWidget("nodeMenuAddChild", smeBSBObjectClass,
 			    treeMenus[NODE_MENU],
 			    XtNlabel, "Add Child",
 			    NULL);
   XtAddCallback(nodeMenuItems[NODE_MENU_ADD_CHILD],
 		XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_CHILD);
-  
-  nodeMenuItems[NODE_MENU_ADD_BEFORE] = 
+
+  nodeMenuItems[NODE_MENU_ADD_BEFORE] =
     XtVaCreateManagedWidget("nodeMenuAddSiblingBefore", smeBSBObjectClass,
 			    treeMenus[NODE_MENU],
 			    XtNlabel, "Add Sibling Before",
 			    NULL);
   XtAddCallback(nodeMenuItems[NODE_MENU_ADD_BEFORE],
 		 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ADD_BEFORE);
-		 
-   nodeMenuItems[NODE_MENU_ADD_AFTER] = 
+
+   nodeMenuItems[NODE_MENU_ADD_AFTER] =
        XtVaCreateManagedWidget("nodeMenuAddSiblingAfter", smeBSBObjectClass,
 			       treeMenus[NODE_MENU],
 			       XtNlabel, "Add Sibling After",
@@ -438,7 +440,7 @@
    XtAddCallback(nodeMenuItems[NODE_MENU_ELISION],
 		 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_ELISION);
 
-   
+
    nodeMenuItems[NODE_MENU_DELETE] =
        XtVaCreateManagedWidget("nodeMenuDeleteNode", smeBSBObjectClass,
 			       treeMenus[NODE_MENU],
@@ -447,98 +449,93 @@
    XtAddCallback(nodeMenuItems[NODE_MENU_DELETE],
 		 XtNcallback, NodeMenu_CB, (XtPointer) NODE_MENU_DELETE);
 
-		 
+
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   BuildMenubar() builds the menubar that appears in the main window.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 
-void
-BuildMenubar(parent)
-   Widget parent;
+static void
+BuildMenubar(Widget parent)
 {
-   Arg args[4];
+   Arg al[4];
    int i;
    Widget box;
 
-   box = XtVaCreateManagedWidget("menuBox",
-				 boxWidgetClass,
-				 parent,
-				 XtNshowGrip, FALSE,
-				 XtNborderWidth, 0,
-				 NULL);
-				 
+   XtSetArg (al [0], XtNshowGrip, FALSE);
+   XtSetArg (al [1], XtNborderWidth, 0);
+   box = XtCreateManagedWidget("menuBox",
+			       boxWidgetClass,
+			       parent,
+			       al, 2);
 
    /* menu button widgets */
-   treeMenuBtns[TREE_MENU] = 
-       XtVaCreateManagedWidget("treeMenuBtn",
-			       menuButtonWidgetClass,
-			       box,
-			       XtNmenuName, "treeMenu",
-			       NULL);
+   XtSetArg (al [0], XtNmenuName, "treeMenu");
+   treeMenuBtns[TREE_MENU] =
+     XtCreateManagedWidget("treeMenuBtn",
+			   menuButtonWidgetClass,
+			   box, al, 1);
+   XtSetArg (al [0], XtNmenuName, "layoutMenu");
    treeMenuBtns[LAYOUT_MENU] =
-       XtVaCreateManagedWidget("layoutMenuBtn",
-			       menuButtonWidgetClass,
-			       box,
-			       XtNmenuName, "layoutMenu",
-			       NULL);
+     XtCreateManagedWidget("layoutMenuBtn",
+			   menuButtonWidgetClass,
+			   box, al, 1);
 
-   helpBtn = XtVaCreateManagedWidget("helpBtn",
-				     commandWidgetClass,
-				     box,
-				     NULL);
+   helpBtn = XtCreateManagedWidget("helpBtn",
+				   commandWidgetClass,
+				   box, NULL, 0);
 
    XtAddCallback(helpBtn, XtNcallback, Help_CB, NULL);
 
-   /* create pulldwon menus */
+   /* create pulldown menus */
 
-   treeMenus[TREE_MENU] = XtVaCreatePopupShell("treeMenu",
+   treeMenus[TREE_MENU] = XtCreatePopupShell("treeMenu",
+					     simpleMenuWidgetClass,
+					     treeMenuBtns[TREE_MENU],
+					     NULL, 0);
+
+   treeMenus[LAYOUT_MENU] = XtCreatePopupShell("layoutMenu",
 					       simpleMenuWidgetClass,
-					       treeMenuBtns[TREE_MENU],
+					       treeMenuBtns[LAYOUT_MENU],
 					       NULL, 0);
-   treeMenus[LAYOUT_MENU] = XtVaCreatePopupShell("layoutMenu",
-						 simpleMenuWidgetClass,
-						 treeMenuBtns[LAYOUT_MENU],
-						 NULL, 0);
 
 
    /* adding menu entries */
-   
+
    /* Tree menu */
 
-   treeMenuItems[TREE_MENU_NEW] = 
-       XtVaCreateManagedWidget("treeMenuNew", smeBSBObjectClass,
-			       treeMenus[TREE_MENU],
-			       NULL);
+   treeMenuItems[TREE_MENU_NEW] =
+     XtCreateManagedWidget("treeMenuNew", smeBSBObjectClass,
+			   treeMenus[TREE_MENU], NULL, 0);
    XtAddCallback(treeMenuItems[TREE_MENU_NEW],
 		 XtNcallback, TreeMenu_CB, TREE_MENU_NEW);
-   
-   treeMenuItems[TREE_MENU_LOAD] = 
+
+   treeMenuItems[TREE_MENU_LOAD] =
        XtVaCreateManagedWidget("treeMenuLoad", smeBSBObjectClass,
 			       treeMenus[TREE_MENU],
 			       NULL);
    XtAddCallback(treeMenuItems[TREE_MENU_LOAD],
 		 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_LOAD);
-		 
-   treeMenuItems[TREE_MENU_SAVE] = 
+
+   treeMenuItems[TREE_MENU_SAVE] =
        XtVaCreateManagedWidget("treeMenuSave", smeBSBObjectClass,
 			       treeMenus[TREE_MENU],
 			       NULL);
    XtAddCallback(treeMenuItems[TREE_MENU_SAVE],
 		 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_SAVE);
-		 
-   treeMenuItems[TREE_MENU_SEP1] = 
+
+   treeMenuItems[TREE_MENU_SEP1] =
        XtVaCreateManagedWidget("treeMenuSep1", smeLineObjectClass,
 			       treeMenus[TREE_MENU],
 			       NULL);
 
 #ifdef COMMENT
-   treeMenuItems[TREE_MENU_STATS] = 
+   treeMenuItems[TREE_MENU_STATS] =
        XtVaCreateManagedWidget("treeMenuStats", smeBSBObjectClass,
 			       treeMenus[TREE_MENU],
 			       XtNlabel, labelStr[STR_SHOW_STATS],
@@ -549,25 +546,25 @@
 
    XtSetSensitive(treeMenuItems[TREE_MENU_STATS], FALSE);
 
-   treeMenuItems[TREE_MENU_SEP2] = 
+   treeMenuItems[TREE_MENU_SEP2] =
        XtVaCreateManagedWidget("treeMenuSep2", smeLineObjectClass,
 			       treeMenus[TREE_MENU],
 			       NULL);
 #endif /* COMMENT */
-   
-   treeMenuItems[TREE_MENU_QUIT] = 
+
+   treeMenuItems[TREE_MENU_QUIT] =
        XtVaCreateManagedWidget("treeMenuQuit", smeBSBObjectClass,
 			       treeMenus[TREE_MENU],
 			       NULL);
    XtAddCallback(treeMenuItems[TREE_MENU_QUIT],
 		 XtNcallback, TreeMenu_CB, (XtPointer) TREE_MENU_QUIT);
-		 
+
 
 
    /* Layout menu */
 
 #ifdef COMMENT
-   treeMenuItems[LAYOUT_MENU_FIXED] = 
+   treeMenuItems[LAYOUT_MENU_FIXED] =
        XtVaCreateManagedWidget("layoutMenuFixed", smeBSBObjectClass,
 			       treeMenus[LAYOUT_MENU],
 			       XtNleftMargin, 18,
@@ -576,7 +573,7 @@
    XtAddCallback(treeMenuItems[LAYOUT_MENU_FIXED],
 		 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_FIXED);
 
-   treeMenuItems[LAYOUT_MENU_VARIABLE] = 
+   treeMenuItems[LAYOUT_MENU_VARIABLE] =
        XtVaCreateManagedWidget("layoutMenuVariable", smeBSBObjectClass,
 			       treeMenus[LAYOUT_MENU],
 			       XtNleftMargin, 18,
@@ -586,13 +583,13 @@
 		 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_VARIABLE);
 
 
-   treeMenuItems[LAYOUT_MENU_SEP1] = 
+   treeMenuItems[LAYOUT_MENU_SEP1] =
        XtVaCreateManagedWidget("layoutSep1", smeLineObjectClass,
 			       treeMenus[LAYOUT_MENU],
 			       NULL);
 #endif /* COMMENT */
 
-   treeMenuItems[LAYOUT_MENU_SPACING] = 
+   treeMenuItems[LAYOUT_MENU_SPACING] =
        XtVaCreateManagedWidget("layoutMenuSpacing", smeBSBObjectClass,
 			       treeMenus[LAYOUT_MENU],
 			       XtNleftMargin, 18,
@@ -600,43 +597,42 @@
    XtAddCallback(treeMenuItems[LAYOUT_MENU_SPACING],
 		 XtNcallback, LayoutMenu_CB, (XtPointer) LAYOUT_MENU_SPACING);
 
-   treeMenuItems[LAYOUT_MENU_SEP2] = 
+   treeMenuItems[LAYOUT_MENU_SEP2] =
        XtVaCreateManagedWidget("layoutMenuSep2", smeLineObjectClass,
 			       treeMenus[LAYOUT_MENU],
 			       NULL);
 
    /* the following is a toggle button - we hack it using a bitmap */
-   treeMenuItems[LAYOUT_MENU_ALIGN_NODES] = 
+   treeMenuItems[LAYOUT_MENU_ALIGN_NODES] =
        XtVaCreateManagedWidget("layoutMenuAlignNodes", smeBSBObjectClass,
 			       treeMenus[LAYOUT_MENU],
 			       XtNleftMargin, 18,
 			       NULL);
    XtAddCallback(treeMenuItems[LAYOUT_MENU_ALIGN_NODES],
-		 XtNcallback, LayoutMenu_CB, 
+		 XtNcallback, LayoutMenu_CB,
 		 (XtPointer) LAYOUT_MENU_ALIGN_NODES);
 
 }
 
 /* ----------------------------------------------------------------------------
- * 
- *   BuildDialogs() builds all the dialogs used in this application. 
- * 
+ *
+ *   BuildDialogs() builds all the dialogs used in this application.
+ *
  * ----------------------------------------------------------------------------
  */
 
-
-BuildDialogs(parent)
-     Widget parent;
+static void
+BuildDialogs (Widget parent)
 {
   int	i;
-  Widget 
-    tmpwidget, dlgForm, dlgValue, 
-    dlgLevelLabel, dlgSiblingLabel, 
+  Widget
+    tmpwidget, dlgForm, dlgValue,
+    dlgLevelLabel, dlgSiblingLabel,
     dlgOkButton, dlgCancelButton;
-  
+
   labelStr[STR_LOAD_FILE] = "Name of file to load:";
   labelStr[STR_SAVE_FILE] = "Name of file to save:";
-  
+
   errStr[ERR_OPENFAIL]  = "Failed to open file.";
   errStr[ERR_EMPTYFILE] = "Input file is empty.";
   errStr[ERR_MEMALLOC]  = "Memory allocation failed.";
@@ -644,119 +640,119 @@
   errStr[ERR_NOEND] = "Beginning of list does not have a matching end.";
   errStr[ERR_NOROOT] = "Input file does not have a root label.";
   errStr[ERR_MANYROOT] = "Input file has more than one root label.";
-  
-  
+
+
   dialog[DLG_NEW] = XtVaCreatePopupShell("dlgNewTree",
 					 transientShellWidgetClass,
 					 parent,
 					 XtNresizable, TRUE,
 					 NULL);
-  
+
   tmpwidget = XtVaCreateManagedWidget("dlgNewTreeForm",
 				      dialogWidgetClass,
-				      dialog[DLG_NEW], 
+				      dialog[DLG_NEW],
 				      XtNresizable, TRUE,
 				      XtNvalue, "",
 				      NULL);
-  
-  XawDialogAddButton(tmpwidget, "dlgNewTreeOk", NewTree_CB, 
+
+  XawDialogAddButton(tmpwidget, "dlgNewTreeOk", NewTree_CB,
 		     (XtPointer) TRUE);
-  XawDialogAddButton(tmpwidget, "dlgNewTreeCancel", NewTree_CB, 
+  XawDialogAddButton(tmpwidget, "dlgNewTreeCancel", NewTree_CB,
 		     (XtPointer) FALSE);
-  
+
   dlgValue = XtNameToWidget(tmpwidget, "value");
-  
+
   XtOverrideTranslations
     (dlgValue, XtParseTranslationTable
      ("<Key>Return:dlg_activate(dlgNewTreeOk)\n"));
-  
-  
+
+
   dialog[DLG_NODE_NAME] = XtVaCreatePopupShell("dlgNodeName",
 					       transientShellWidgetClass,
 					       TreeTopLevel,
 					       XtNresizable, TRUE,
 					       NULL);
-				    
-  
+
+
   tmpwidget= XtVaCreateManagedWidget("dlgNodeNameForm",
 				     dialogWidgetClass,
-				     dialog[DLG_NODE_NAME], 
+				     dialog[DLG_NODE_NAME],
 				     XtNresizable, TRUE,
 				     XtNvalue, "",
 				     NULL);
-  
-  XawDialogAddButton(tmpwidget, "dlgNodeNameOk", NodeLabel_CB, 
+
+  XawDialogAddButton(tmpwidget, "dlgNodeNameOk", NodeLabel_CB,
 		     (XtPointer) TRUE);
-  XawDialogAddButton(tmpwidget, "dlgNodeNameCancel", NodeLabel_CB, 
+  XawDialogAddButton(tmpwidget, "dlgNodeNameCancel", NodeLabel_CB,
 		     (XtPointer) FALSE);
-  
+
   dlgValue = XtNameToWidget(tmpwidget, "value");
-  
+
   XtOverrideTranslations
     (dlgValue, XtParseTranslationTable
      ("<Key>Return: dlg_activate(dlgNodeNameOk)\n"));
-  
+
 
   dialog[DLG_FILE] = XtVaCreatePopupShell("dlgFile",
 					  transientShellWidgetClass,
-					  TreeTopLevel, 
+					  TreeTopLevel,
 					  XtNresizable, TRUE,
 					  NULL);
 
   tmpwidget = XtVaCreateManagedWidget("dlgFileForm",
 				      dialogWidgetClass,
-				      dialog[DLG_FILE], 
+				      dialog[DLG_FILE],
 				      XtNresizable, TRUE,
 				      XtNvalue, "",
 				      NULL);
-   
+
   XawDialogAddButton(tmpwidget, "dlgFileOk", File_CB, (XtPointer) TRUE);
   XawDialogAddButton(tmpwidget, "dlgFileCancel", File_CB, (XtPointer) FALSE);
 
   dlgValue = XtNameToWidget(tmpwidget, "value");
-  
+
   XtOverrideTranslations
     (dlgValue, XtParseTranslationTable
      ("<Key>Return:dlg_activate(dlgFileOk)\n"));
-  
+
 
   dialog[DLG_INFO] = XtVaCreatePopupShell("dlgInfo",
 					  transientShellWidgetClass,
-					  TreeTopLevel, 
+					  TreeTopLevel,
 					  XtNresizable, TRUE,
 					  NULL);
-  
+
   tmpwidget = XtVaCreatePopupShell("dlgInfoForm",
 				   dialogWidgetClass,
-				   dialog[DLG_INFO], 
+				   dialog[DLG_INFO],
 				   XtNresizable, TRUE,
 				   XtNvalue, "",
 				   NULL);
-  
-  XawDialogAddButton(tmpwidget, "dlgInfoButton", Popdown_CB, 
+
+  XawDialogAddButton(tmpwidget, "dlgInfoButton", Popdown_CB,
 		     (XtPointer) dialog[DLG_INFO]);
-  
-  
+
+
   dialog[DLG_ERROR] = XtVaCreatePopupShell("dlgError",
 					   transientShellWidgetClass,
-					   TreeTopLevel, 
+					   TreeTopLevel,
 					   XtNresizable, TRUE,
 					   NULL);
-   
+
   tmpwidget = XtVaCreateManagedWidget("dlgErrorForm",
 				      dialogWidgetClass,
-				      dialog[DLG_ERROR], 
+				      dialog[DLG_ERROR],
 				      XtNresizable, TRUE,
 				      XtNvalue, "",
 				      NULL);
-   
-  XawDialogAddButton(tmpwidget, "dlgErrorButton", Popdown_CB, 
+
+  XawDialogAddButton(tmpwidget, "dlgErrorButton", Popdown_CB,
 		     (XtPointer) dialog[DLG_ERROR]);
-   
+
 
   dialog[DLG_SPACING] = XtVaCreatePopupShell("dlgSpacing",
 					     transientShellWidgetClass,
-					     TreeTopLevel, 
+					     TreeTopLevel,
 					     XtNresizable, FALSE,
 					     NULL);
   dlgForm = XtVaCreateManagedWidget("dlgSpacingForm",
@@ -764,7 +760,7 @@
 				    dialog[DLG_SPACING],
 				    XtNresizable, FALSE,
 				    NULL);
-   
+
   dlgLevelLabel = XtVaCreateManagedWidget("dlgLevelLabel",
 					  labelWidgetClass,
 					  dlgForm,
@@ -789,7 +785,7 @@
 					     XtNlabel, "   ",
 					     NULL);
 
-  
+
   dlgLevelScale = XtVaCreateManagedWidget("dlgLevelScale",
 					  pannerWidgetClass,
 					  dlgForm,
@@ -809,7 +805,7 @@
 					  XtNsliderWidth, 10,
 					  XtNheight, 15,
 					  NULL);
-  
+
   XtOverrideTranslations(dlgLevelScale, XtParseTranslationTable("\
 <Btn2Down>:		start()\n\
 <Btn2Motion>:		move()\n\
@@ -863,7 +859,7 @@
 					    XtNsliderWidth, 10,
 					    XtNheight, 15,
 					    NULL);
-  
+
   XtOverrideTranslations(dlgSiblingScale, XtParseTranslationTable("\
 <Btn2Down>:		start()\n\
 <Btn2Motion>:		move()\n\
@@ -874,7 +870,7 @@
 		(XtPointer) dlgSiblingValuator);
   XtAddCallback(dlgSiblingScale, XtNreportCallback, siblingvalue_CB,
 		(XtPointer) &dlgSiblingValue);
-  
+
   dlgOkButton = XtVaCreateManagedWidget("dlgOkButton",
 					commandWidgetClass,
 					dlgForm,
@@ -885,7 +881,7 @@
 					XtNleft, XawChainLeft,
 					XtNright, XawChainLeft,
 					NULL);
-  
+
   dlgCancelButton = XtVaCreateManagedWidget("dlgCancelButton",
 					    commandWidgetClass,
 					    dlgForm,
@@ -896,30 +892,29 @@
 					    XtNleft, XawChainLeft,
 					    XtNright, XawChainLeft,
 					    NULL);
-  
+
   XtAddCallback(dlgOkButton, XtNcallback, Scale_CB, (XtPointer) TRUE);
   XtAddCallback(dlgCancelButton, XtNcallback, Scale_CB, (XtPointer) FALSE);
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   BuildHelpWindow() builds the help window that is displayed when the
  *   Help button on the application main window is pressed.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 
 static void
-BuildHelpWindow(parent)
-     Widget parent;
+BuildHelpWindow(Widget parent)
 {
   int	i;
 
   helpShell = XtVaCreatePopupShell("helpShell", transientShellWidgetClass,
 				   parent,
 				   NULL);
-  
+
   helpForm = XtVaCreateManagedWidget("helpForm",
 				     formWidgetClass,
 				     helpShell,
@@ -935,8 +930,8 @@
 					   XtNleft, XawChainLeft,
 					   XtNright, XawChainLeft,
 					   NULL);
-  
-  XtAddCallback(helpDoneButton, XtNcallback, Popdown_CB, 
+
+  XtAddCallback(helpDoneButton, XtNcallback, Popdown_CB,
 		(XtPointer) helpShell);
 
   helpTitle = XtVaCreateManagedWidget("helpTitle",
@@ -964,7 +959,7 @@
 				     XtNeditType, XawtextRead,
 				     XtNdisplayCaret, FALSE,
 				     XtNscrollVertical, XawtextScrollAlways,
-				     XtNscrollHorizontal, 
+				     XtNscrollHorizontal,
 				     XawtextScrollWhenNeeded,
 				     XtNuseStringInPlace, TRUE,
 				     XtNstring, help_text,
@@ -974,18 +969,17 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
- *   BuildApplicationWindow() assumes that TreeTopLevel has been initialized 
+ *
+ *   BuildApplicationWindow() assumes that TreeTopLevel has been initialized
  *   by XtInitialize(). TreeDrawingArea is set to the drawing area in this
  *   application window.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 
 static void
-BuildApplicationWindow(parent)
-     Widget parent;
+BuildApplicationWindow(Widget parent)
 {
   Widget	topPane, box;
 
@@ -1005,7 +999,7 @@
 
   scrolledWindow = XtVaCreateManagedWidget("scrolledWindow",
 					   viewportWidgetClass,
-					   topPane, 
+					   topPane,
 					   XtNshowGrip, FALSE,
 					   XtNallowHoriz, TRUE,
 					   XtNallowVert, TRUE,
@@ -1020,65 +1014,50 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   HandleError() is used when ReadTreeFromFile() or SaveTreeToFile() returns
- *   an error. 
- * 
+ *   an error.
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-HandleError(error, tree)
-     ErrCode error;
-     Tree *tree;
+static void
+HandleError(ErrCode error, Tree *tree)
 {
-  Widget	dlg, text;
-  
-  if (tree) {
-    dlg = XtNameToWidget(dialog[DLG_INFO], "dlgInfoForm");
-    if (dlg) {
-      XtVaSetValues(dlg, 
-		    XtNvalue, errStr[error],
-		    XtNwidth, 200,
-		    NULL);
-      text = XtNameToWidget(dlg, "value");
-      if (text) {
-	XtVaSetValues(text, XtNdisplayCaret, FALSE, NULL);
-	XtVaSetValues(XawTextGetSource(text), XtNeditType, XawtextRead, NULL);
-      }
+  Widget dlg, text;
+
+  dlg = tree ?
+    XtNameToWidget(dialog[DLG_INFO],  "dlgInfoForm") :
+    XtNameToWidget(dialog[DLG_ERROR], "dlgErrorForm");
+
+  if (dlg) {
+    Arg al [2];
+    XtSetArg (al [0], XtNvalue, errStr[error]);
+    XtSetArg (al [1], XtNwidth, 200);
+    XtSetValues(dlg, al, 2);
+    text = XtNameToWidget(dlg, "value");
+    if (text) {
+      XtSetArg (al [0], XtNdisplayCaret, FALSE);
+      XtSetValues(text, al, 1);
+      XtSetArg (al [0], XtNeditType, XawtextRead);
+      XtSetValues(XawTextGetSource(text), al, 1);
     }
-    popup_dialog(dialog[DLG_INFO], XtGrabExclusive);
-  } else {
-    dlg = XtNameToWidget(dialog[DLG_ERROR], "dlgErrorForm");
-    if (dlg) {
-      XtVaSetValues(dlg, 
-		    XtNvalue, errStr[error], 
-		    XtNwidth, 200,
-		    NULL);
-      text = XtNameToWidget(dlg, "value");
-      if (text) {
-	XtVaSetValues(text, XtNdisplayCaret, FALSE, NULL);
-	XtVaSetValues(XawTextGetSource(text), XtNeditType, XawtextRead, NULL);
-      }
-    }
-    popup_dialog(dialog[DLG_ERROR], XtGrabExclusive);
   }
+  popup_dialog (tree ? dialog[DLG_INFO] : dialog[DLG_ERROR], XtGrabExclusive);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   InitializeInterface() initializes the environment for displaying
  *   the tree and creates the necessary supporting structures for interaction
  *   and display. This function should be called only once.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-InitializeInterface(argc, argv)
-     int *argc;
-     char *argv[];
+static void
+InitializeInterface(int *argc, char *argv[])
 {
   XrmValue       rmvalue;
   char          *rmtype;
@@ -1088,6 +1067,7 @@
   Colormap       cmap;
   Pixmap         gray_pixmap;
   Atom		 wm_delete_window;
+  Arg		 al [2];
 
   /* XtSetLanguageProc is broken on some systems.
      The symptom is an error of the form:
@@ -1096,15 +1076,15 @@
 
         XtSetLanguageProc(NULL, NULL, NULL);
   */
-  
-  TreeTopLevel = XtVaAppInitialize(&app, "Xoobr", 
+
+  TreeTopLevel = XtVaAppInitialize(&app, "Xoobr",
 				   NULL, 0,
-				   argc, argv, 
-				   fallback_resources, 
+				   argc, argv,
+				   fallback_resources,
 				   NULL);
-  
+
   ASSERT(TreeTopLevel, "failed to open connection to X server");
-  
+
   TreeDisplay = XtDisplay(TreeTopLevel);
   TreeScreen  = DefaultScreen(TreeDisplay);
 
@@ -1117,9 +1097,9 @@
   /* add actions */
   XtAppAddActions(app, local_actions, 6);
   XawSimpleMenuAddGlobalActions(app);
-  
+
   TreeContourWidth = applRsrcsPtr->contour_width;
-  
+
   /* set up label font info */
   if (XrmGetResource(XtDatabase(TreeDisplay),
 		     X11_FONT_RESOURCE, X11_FONT_CLASS_RESOURCE,
@@ -1133,31 +1113,30 @@
   else
     TreeLabelFont = XLoadQueryFont(TreeDisplay, X11_DEFAULT_FONT);
   TreeLabelFont = XLoadQueryFont(TreeDisplay, "fixed");
-  
+
   check_pixmap =
     XCreateBitmapFromData(TreeDisplay, RootWindow(TreeDisplay, TreeScreen),
-			  check_bits, check_width, check_height);
-  
+			  (char *) check_bits, check_width, check_height);
+
   slider_pixmap =
     XCreateBitmapFromData(TreeDisplay, RootWindow(TreeDisplay, TreeScreen),
-			  slider_pixmap_bits, slider_pixmap_width, 
+			  (char *) slider_pixmap_bits, slider_pixmap_width,
 			  slider_pixmap_height);
-  
+
   BuildApplicationWindow(TreeTopLevel);
   BuildHelpWindow(TreeTopLevel);
   BuildPopupMenus(TreeTopLevel);
   BuildDialogs(TreeTopLevel);
-  
-  
+
+
   XtAddEventHandler(TreeDrawingArea, ExposureMask, FALSE,
 		    ExposeHandler, (XtPointer) NULL);
-  
-  XtVaSetValues(TreeDrawingArea, 
-		XtNbackground, applRsrcsPtr->background_color, 
-		NULL);
+
+  XtSetArg (al [0], XtNbackground, applRsrcsPtr->background_color);
+  XtSetValues(TreeDrawingArea, al, 1);
   
   XtRealizeWidget(TreeTopLevel);
-  
+
   XtOverrideTranslations
     (TreeTopLevel,
      XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()"));
@@ -1169,7 +1148,7 @@
 
   win = XtWindow(TreeDrawingArea);
   cmap = DefaultColormap(TreeDisplay, TreeScreen);
-  
+
   /* set up double buffer */
   colors[BACKGROUND_COLOR].pixel = applRsrcsPtr->background_color;
   XQueryColor(TreeDisplay, cmap, &(colors[BACKGROUND_COLOR]));
@@ -1183,60 +1162,61 @@
   XQueryColor(TreeDisplay, cmap, &(colors[SPLIT_COLOR]));
   colors[ACTION_COLOR].pixel = applRsrcsPtr->action_color;
   XQueryColor(TreeDisplay, cmap, &(colors[ACTION_COLOR]));
-  
-  TreeDrawingAreaDB = 
-    DBLcreate_double_buffer(TreeDisplay, 
+
+  TreeDrawingAreaDB =
+    DBLcreate_double_buffer(TreeDisplay,
 			    XtWindow(TreeDrawingArea), TRUE,
 			    colors, NUM_COLORS);
 
   ASSERT(TreeDrawingAreaDB, "could not create double buffer");
-  
+
   background = DBLinq_background(TreeDrawingAreaDB);
-  
-  
-  XtVaSetValues(TreeDrawingArea, XtNbackground, background, NULL);
-  
+
+
+  XtSetArg(al [0], XtNbackground, background);
+  XtSetValues(TreeDrawingArea, al, 1);
+
   /* also set the scrolledWindow background to same color */
-  XtVaSetValues(XtParent(TreeDrawingArea), XtNbackground, background, NULL);
-  
+  XtSetArg(al [0], XtNbackground, background);
+  XtSetValues(XtParent(TreeDrawingArea), al, 1);
+
   XSetFont(TreeDrawingAreaDB->display, TreeDrawingAreaDB->gc,
-	   TreeLabelFont->fid); 
-  
+	   TreeLabelFont->fid);
+
   gray_pixmap =
     XCreatePixmapFromBitmapData(TreeDisplay, XtWindow(TreeDrawingArea),
-				gray_bits, gray_width, gray_height,
+				(char *)gray_bits, gray_width, gray_height,
 				TreeDrawingAreaDB->colors[TREE_COLOR],
 				background,
 				DefaultDepth(TreeDisplay, TreeScreen));
-  
+
 #ifdef COMMENT
-  XtVaSetValues(treeMenuItems[LAYOUT_MENU_VARIABLE],
-		XtNleftBitmap, check_pixmap, 
-		NULL);
+  XtSetArg(al [0], XtNleftBitmap, check_pixmap);
+  XtSetValues(treeMenuItems[LAYOUT_MENU_VARIABLE], al, 1);
 #endif
 
   XSetTile(TreeDrawingAreaDB->display, TreeDrawingAreaDB->gc, gray_pixmap);
   SetDrawColor(TREE_COLOR);
-  
+
   InitializeDissolveEffect(TreeDisplay, XtWindow(TreeDrawingArea),
 			   TreeDrawingAreaDB->colors[TREE_COLOR], background);
-  
+
   PauseCursor = XCreateFontCursor(TreeDisplay, XC_watch);
-  
+
   StatusMsg("Ready", TRUE);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   UserEventLoop() is called after InitializeInterface() to handle
  *   processing of events.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-UserEventLoop()
+static void
+UserEventLoop(void)
 {
   XtAppMainLoop(app);
 }
@@ -1247,36 +1227,38 @@
 /* ------------------------------------------------------------------------- */
 
 static void
-TreeMenu_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+TreeMenu_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   long		menuItem = (long) client_data;
   Widget	dlgFileForm;
-  
+  Arg		al [2];
+
   switch (menuItem) {
   case TREE_MENU_NEW:
     popup_dialog(dialog[DLG_NEW], XtGrabExclusive);
     break;
   case TREE_MENU_LOAD:
     loading_file = 1;
-    XtVaSetValues(dialog[DLG_FILE],  XtNtitle, "Load File", NULL);
+    XtSetArg (al [0], XtNtitle, "Load File");
+    XtSetValues(dialog[DLG_FILE],  al, 1);
     dlgFileForm = XtNameToWidget(dialog[DLG_FILE], "dlgFileForm");
-    XtVaSetValues(dlgFileForm, XtNvalue, "", NULL);
+    XtSetArg (al [0], XtNvalue, "");
+    XtSetValues(dlgFileForm, al, 1);
     popup_dialog(dialog[DLG_FILE], XtGrabExclusive);
     break;
   case TREE_MENU_SAVE:
     loading_file = 0;
-    XtVaSetValues(dialog[DLG_FILE],  XtNtitle, "Save File", NULL);
+    XtSetArg (al [0], XtNtitle, "Save File");
+    XtSetValues(dialog[DLG_FILE],  al, 1);
     dlgFileForm = XtNameToWidget(dialog[DLG_FILE], "dlgFileForm");
-    XtVaSetValues(dlgFileForm, XtNvalue, "", NULL);
+    XtSetArg (al [0], XtNvalue, "");
+    XtSetValues(dlgFileForm, al, 1);
     popup_dialog(dialog[DLG_FILE], XtGrabExclusive);
     break;
   case TREE_MENU_QUIT:
     exit(0);
     break;
-    
+
   default:
     WARN("unknown menu item in TreeMenu_CB");
   }
@@ -1286,34 +1268,34 @@
 /* ------------------------------------------------------------------------- */
 
 static void
-LayoutMenu_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+LayoutMenu_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   long	menuItem = (long) client_data;
   char	tmpstr[10];
-  
+  Arg	al [2];
+
   switch (menuItem) {
 #ifdef COMMENT
   case LAYOUT_MENU_FIXED:
-    XtVaSetValues(layoutMenuItems[LAYOUT_MENU_VARIABLE],
-                  XtNleftBitmap, None, NULL);
-    XtVaSetValues(layoutMenuItems[LAYOUT_MENU_FIXED], 
-                  XtNleftBitmap, check_pixmap, NULL);
+    XtSetArg (al [0], XtNleftBitmap, None);
+    XtSetValues(layoutMenuItems[LAYOUT_MENU_VARIABLE], al, 1);
+
+    XtSetArg (al [0], XtNleftBitmap, check_pixmap);
+    XtSetValues(layoutMenuItems[LAYOUT_MENU_FIXED], al, 1);
 
     if (TreeLayoutDensity != Fixed) {
       TreeLayoutDensity = Fixed;
       DeleteTree(TheTree, TRUE);
       SetupTree(TheTree);
     }
-    break;    
+    break;
   case LAYOUT_MENU_VARIABLE:
-    XtVaSetValues(layoutMenuItems[LAYOUT_MENU_VARIABLE],
-                  XtNleftBitmap, check_pixmap, NULL);
-    XtVaSetValues(layoutMenuItems[LAYOUT_MENU_FIXED], 
-                  XtNleftBitmap, None, NULL);
-    
+    XtSetArg (al [0], XtNleftBitmap, check_pixmap);
+    XtSetValues(layoutMenuItems[LAYOUT_MENU_VARIABLE], al, 1);
+
+    XtSetArg (al [0], XtNleftBitmap, None);
+    XtSetValues(layoutMenuItems[LAYOUT_MENU_FIXED], al, 1);
+
     if (TreeLayoutDensity != Variable) {
       TreeLayoutDensity = Variable;
       DeleteTree(TheTree, TRUE);
@@ -1325,24 +1307,23 @@
     dlgLevelValue = TreeParentDistance;
     dlgSiblingValue = TreeBorderSize;
     sprintf(tmpstr, "%d  ", dlgLevelValue);
-    XtVaSetValues(dlgLevelValuator, XtNlabel, tmpstr, NULL);
+    XtSetArg (al [0], XtNlabel, tmpstr);
+    XtSetValues(dlgLevelValuator, al, 1);
 
     /* These setvalues need some adjustments... */
-    XtVaSetValues(dlgLevelScale, 
-		  XtNsliderX, (dlgLevelValue * 2),
-		  NULL);
+    XtSetArg (al [0], XtNsliderX, dlgLevelValue * 2);
+    XtSetValues(dlgLevelScale, al, 1);
     sprintf(tmpstr, "%d  ", dlgSiblingValue);
-    XtVaSetValues(dlgSiblingValuator, XtNlabel, tmpstr, NULL);
-    XtVaSetValues(dlgSiblingScale, 
-		  XtNsliderX, (dlgSiblingValue * 4),
-		  NULL);
+    XtSetArg (al [0], XtNlabel, tmpstr);
+    XtSetValues(dlgSiblingValuator, al, 1);
+    XtSetArg (al [0], XtNsliderX, dlgSiblingValue * 4);
+    XtSetValues(dlgSiblingScale, al, 1);
     popup_dialog(dialog[DLG_SPACING], XtGrabNone);
     break;
   case LAYOUT_MENU_ALIGN_NODES:
     TreeAlignNodes = !TreeAlignNodes;
-    XtVaSetValues(treeMenuItems[LAYOUT_MENU_ALIGN_NODES],
-		  XtNleftBitmap, TreeAlignNodes ? check_pixmap : None, 
-		  NULL);
+    XtSetArg (al [0], XtNleftBitmap, TreeAlignNodes ? check_pixmap : None);
+    XtSetValues(treeMenuItems[LAYOUT_MENU_ALIGN_NODES], al, 1);
     DeleteTree(TheTree, TRUE);
     ResetLabels(TheTree);
     SetupTree(TheTree);
@@ -1356,13 +1337,10 @@
 /* ------------------------------------------------------------------------- */
 
 static void
-NodeMenu_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+NodeMenu_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   long	menuItem = (long) client_data;
-   
+
   switch (menuItem) {
   case NODE_MENU_ADD_CHILD:
     NodePos = Child;
@@ -1393,10 +1371,7 @@
 /* ------------------------------------------------------------------------- */
 
 static void
-Help_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+Help_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   popup_dialog(helpShell, XtGrabNone);
 }
@@ -1405,10 +1380,7 @@
 /* ------------------------------------------------------------------------- */
 
 static void
-HelpDone_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+HelpDone_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   XtPopdown(helpShell);
 }
@@ -1417,10 +1389,7 @@
 /* ------------------------------------------------------------------------- */
 
 static void
-NodeLabel_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+NodeLabel_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   char	*node_label;
 
@@ -1429,23 +1398,20 @@
     node_label = XtMalloc(strlen(XawDialogGetValueString(XtParent(w)))
 			  * sizeof(char));
     node_label = strcpy(node_label, XawDialogGetValueString(XtParent(w)));
-    if (*node_label) 
+    if (*node_label)
       InsertNode(PopupNode, NodePos, node_label);
   }
 }
-      
+
 
 /* ------------------------------------------------------------------------- */
 
 static void
-NewTree_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+NewTree_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   char	*node_label;
   Tree	*tree;
-  
+
   XtPopdown(dialog[DLG_NEW]);
   if (client_data == (XtPointer) TRUE) {
     node_label = XtMalloc((strlen(XawDialogGetValueString(XtParent(w))) + 1)
@@ -1469,21 +1435,18 @@
 /* ------------------------------------------------------------------------- */
 
 static void
-File_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+File_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   char *fname;
   Tree *tree;
   ErrCode error;
   Arg args[1];
   int menuItem;
-  
+
   if (client_data == (XtPointer) TRUE) {
     fname = XawDialogGetValueString(XtParent(w));
-    if (*fname) { 
-      
+    if (*fname) {
+
       if (loading_file == 1) {
 	if (TheTree) {
 	  Delete(TheTree);
@@ -1511,33 +1474,30 @@
       }
     } else
       XtPopdown(dialog[DLG_FILE]);
-  } else 
-    XtPopdown(dialog[DLG_FILE]); 
+  } else
+    XtPopdown(dialog[DLG_FILE]);
 }
 
 
 /* ------------------------------------------------------------------------- */
 
 static void
-Scale_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+Scale_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
   int	level_value, sibling_value;
   float	tmp;
-    
+
   XtPopdown(dialog[DLG_SPACING]);
 
   /* check if OK button was selected */
   if (client_data) {
     level_value = dlgLevelValue;
-    
+
     sibling_value = dlgSiblingValue;
-    
+
     if (level_value != TreeParentDistance ||
 	sibling_value != TreeBorderSize) {
-      
+
       TreeParentDistance = level_value;
       TreeBorderSize = sibling_value;
       XSync(TreeDisplay, 0);
@@ -1559,39 +1519,26 @@
 /* ------------------------------------------------------------------------- */
 
 static void
-Popdown_CB(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data;
-     XtPointer call_data;
+Popdown_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
-  Widget	widget = (Widget) client_data;
-    
+  Widget widget = (Widget) client_data;
+
   XtPopdown(widget);
 }
 
 static void
-activate_action(w, event, params, num_params)
-     Widget w;
-     XButtonEvent *event;
-     String *params;
-     Cardinal *num_params;
+activate_action(Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
-  Widget	button;
-  
   if (*num_params == 1) {
-    button = XtNameToWidget(XtParent(w), params[0]);
-    
+    Widget button = XtNameToWidget(XtParent(w), params[0]);
+
     if (button)
       XtCallCallbacks(button, XtNcallback, (XtPointer) TRUE);
   }
 }
 
 static void
-quit_action(w, event, params, num_params)
-     Widget w;
-     XButtonEvent *event;
-     String *params;
-     Cardinal *num_params;
+quit_action(Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
   exit(0);
 }
@@ -1600,38 +1547,34 @@
 
 /* ------------------------------------------------------------------------- */
 
-static void 
-select_action(w, event, params, num_params)
-     Widget w;
-     XButtonEvent *event;
-     String *params;
-     Cardinal *num_params;
+static void
+select_action(Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
   Tree		*node;
   int		height;
   Boolean	edit = FALSE;
 
-  if ((*num_params > 0) && 
+  if ((*num_params > 0) &&
       (!strcmp(params[0], "EDIT") ||
        !strcmp(params[0], "edit")))
     edit = TRUE;
 
-  if (SearchTree(TheTree, event->x, event->y, &node)) {
+  if (SearchTree(TheTree, event->xbutton.x, event->xbutton.y, &node)) {
     static Tree *PrevNode = NULL;
     Tree *ParNode = NULL;
-    
+
     PopupNode = node;
     if (PrevNode != NULL)
       DrawNode(PrevNode, New);
     PrevNode = PopupNode;
-    
-    printf("%s^^%s^^%s\n", 
+
+    printf("%s^^%s^^%s\n",
 	   EnvNm,
 	   edit ? "br-edit" : "br-view",
 	   (PopupNode->value) ? PopupNode->value : PopupNode->label.text);
 
     StatusMsg(PopupNode->label.text, 1);
-    
+
     ParNode = PopupNode->parent;
     PopupNode->parent = NULL;
     HiliteNode(PopupNode, New);
@@ -1639,26 +1582,18 @@
   }
 }
 
-static void 
-menu_popup_action(w, event, params, num_params)
-     Widget w;
-     XEvent *event;
-     String *params;
-     Cardinal *num_params;
+static void
+menu_popup_action(Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
-  Widget menu;
+  char *strargs[] = {"nodeMenu", NULL};
+  Widget menu = XtNameToWidget(TreeTopLevel, params[0]);
   Boolean popup;
-  ShellWidget shell_widget;
+  ShellWidget shell_widget = (ShellWidget) menu;
 
-  char	    *strargs[] = {"nodeMenu", NULL};
-  
-  menu = XtNameToWidget(TreeTopLevel, params[0]);
-  shell_widget = (ShellWidget) menu;
-  
   if (nodeFound) {
 
-    /* This is giving me a headache. 
-     * Why does popup menus come up unselectable? 
+    /* This is giving me a headache.
+     * Why do popup menus come up unselectable?
      */
 
     XtCallActionProc(TreeDrawingArea,
@@ -1666,7 +1601,7 @@
 		     event,
 		     strargs,
 		     1);
-		 
+
 /*
     XtSetSensitive(menu, TRUE);
     XtPopupSpringLoaded(menu);
@@ -1676,100 +1611,93 @@
       printf("error: not shell widget!\n");
     } else {
       if (! shell_widget->shell.popped_up) {
-	
+
 	XtGrabKind call_data = XtGrabExclusive;
-	
+
 	XtCallCallbacks(menu, XtNpopupCallback, (XtPointer) &call_data);
-	
+
 	shell_widget->shell.popped_up = TRUE;
 	shell_widget->shell.grab_kind = XtGrabExclusive;
 	shell_widget->shell.spring_loaded = TRUE;
-	
+
 	if (shell_widget->shell.create_popup_child_proc != NULL) {
 	  (*(shell_widget->shell.create_popup_child_proc))(menu);
 	}
-	
+
 	XtAddGrab(menu, TRUE, TRUE);
-	
+
 	XtRealizeWidget(menu);
-	
+
 	XMapRaised(XtDisplay(menu), XtWindow(menu));
-	
+
       } else
-	XRaiseWindow(XtDisplay(menu), XtWindow(menu));   
+	XRaiseWindow(XtDisplay(menu), XtWindow(menu));
     }
     */
   }
 }
 
 
-static void 
-button_action(w, event, params, num_params)
-     Widget w;
-     XEvent *event;
-     String *params;
-     Cardinal *num_params;
+static void
+button_action(Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
-  Tree     *node;
-  
+  Tree *node;
+  Arg	al [2];
+
   if (SearchTree(TheTree, event->xbutton.x, event->xbutton.y, &node)) {
-    
+
     nodeFound = TRUE;
-    
+
     XtSetSensitive(nodeMenuItems[NODE_MENU_DELETE], TRUE);
 
-    XtVaSetValues(treeMenus[NODE_MENU], 
-		  XtNlabel, node->label.text, 
-		  NULL);
+    XtSetArg (al [0], XtNlabel, node->label.text);
+    XtSetValues(treeMenus[NODE_MENU], al, 1);
+
     PopupNode = node;
     if (IS_LEAF(node))  {
-      
+
       XtSetSensitive(nodeMenuItems[NODE_MENU_ELISION], FALSE);
-      
-      XtVaSetValues(nodeMenuItems[NODE_MENU_ELISION], 
-		    XtNlabel, labelStr[STR_NODE_COLLAPSE], 
-		    NULL);
-      
+
+      XtSetArg (al [0], XtNlabel, labelStr[STR_NODE_COLLAPSE]);
+      XtSetValues(nodeMenuItems[NODE_MENU_ELISION], al, 1);
+
     } else {
-      
+
       XtSetSensitive(nodeMenuItems[NODE_MENU_ELISION], TRUE);
       if (node->elision) {
-	XtVaSetValues(nodeMenuItems[NODE_MENU_ELISION],
-		      XtNlabel, labelStr[STR_NODE_EXPAND],
-		      NULL);
+	XtSetArg (al [0], XtNlabel, labelStr[STR_NODE_EXPAND]);
+	XtSetValues(nodeMenuItems[NODE_MENU_ELISION], al, 1);
       } else {
-	XtVaSetValues(nodeMenuItems[NODE_MENU_ELISION],
-		      XtNlabel, labelStr[STR_NODE_COLLAPSE],
-		      NULL);
+	XtSetArg (al [0], XtNlabel, labelStr[STR_NODE_COLLAPSE]);
+	XtSetValues(nodeMenuItems[NODE_MENU_ELISION], al, 1);
       }
     }
-    
+
     if (node->parent) {
       XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_BEFORE], TRUE);
-      XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER], TRUE);
+      XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER] , TRUE);
     } else {
       XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_BEFORE], FALSE);
-      XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER], FALSE);
+      XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER] , FALSE);
     }
-    
+
     if (node->elision) {
       XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_CHILD], FALSE);
     } else {
       XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_CHILD], TRUE);
     }
-    
+
   } else {
     nodeFound = FALSE;
 
-    XtVaSetValues(treeMenus[NODE_MENU], 
-		  XtNlabel, " ", 
-		  NULL);
+    XtSetArg (al [0], XtNlabel, " ");
+    XtSetValues(treeMenus[NODE_MENU], al, 1);
 
     XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_BEFORE], FALSE);
-    XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER], FALSE);
-    XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_CHILD], FALSE);
-    XtSetSensitive(nodeMenuItems[NODE_MENU_ELISION], FALSE);
-    XtSetSensitive(nodeMenuItems[NODE_MENU_DELETE], FALSE);
+    XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_AFTER],  FALSE);
+    XtSetSensitive(nodeMenuItems[NODE_MENU_ADD_CHILD],  FALSE);
+    XtSetSensitive(nodeMenuItems[NODE_MENU_ELISION],    FALSE);
+    XtSetSensitive(nodeMenuItems[NODE_MENU_DELETE],     FALSE);
   }
 }
 
@@ -1780,194 +1708,176 @@
 /*									     */
 /* ------------------------------------------------------------------------- */
 
-static void center_widget(w, x, y)
-Widget w;
-int x, y;
+static void center_widget(Widget w, int x, int y)
 {
   Dimension	width, height, border;
   Position	max_x, max_y;
-  
-  XtVaGetValues(w,
-		XtNwidth, &width,
-		XtNheight, &height,
-		XtNborderWidth, &border,
-		NULL);
-  
-  width += 2 * border;
+  Arg		al [3];
+
+  XtSetArg (al [0], XtNwidth,       &width);
+  XtSetArg (al [1], XtNheight,      &height);
+  XtSetArg (al [2], XtNborderWidth, &border);
+  XtGetValues(w, al, 3);
+
+  width  += 2 * border;
   height += 2 * border;
-  
+
   x -= ((Position) width / 2);
   y -= ((Position) height / 2);
-  
+
   if (x < 0) x = 0;
   if (y < 0) y = 0;
-  
+
   if (x > (max_x = (Position) (XtScreen(w)->width - width)) )
     x = max_x;
-  
+
   if (y > (max_y = (Position) (XtScreen(w)->height - height)) )
     y = max_y;
-  
-  XtVaSetValues(w,
-		XtNx, x,
-		XtNy, y,
-		NULL);
+
+  XtSetArg (al [0], XtNx, x);
+  XtSetArg (al [1], XtNy, y);
+  XtSetValues(w, al, 2);
 }
 
 #define shell_translations "<Message>WM_PROTOCOLS: wmpopdown()\n"
-		     
-static void 
-popup_dialog(shell, grab_kind)
-     Widget shell;
-     XtGrabKind grab_kind;
+
+static void
+popup_dialog(Widget shell, XtGrabKind grab_kind)
 {
   int		idummy, x, y;
+  unsigned int  uidummy;
   Window	wdummy;
+  Atom		wm_delete_window;
 
   XtOverrideTranslations(shell, XtParseTranslationTable(shell_translations));
   XtRealizeWidget(shell);
-  wm_delete_window = XInternAtom(XtDisplay(shell), "WM_DELETE_WINDOW", 
+  wm_delete_window = XInternAtom(XtDisplay(shell), "WM_DELETE_WINDOW",
 				 FALSE);
   (void) XSetWMProtocols(XtDisplay(shell), XtWindow(shell),
 			 &wm_delete_window, 1);
-  
-  XQueryPointer(TreeDisplay, DefaultRootWindow(TreeDisplay), 
+
+  XQueryPointer(TreeDisplay, DefaultRootWindow(TreeDisplay),
 		&wdummy, &wdummy,
-		&x, &y, &idummy, &idummy, &idummy);
-  
+		&x, &y, &idummy, &idummy, &uidummy);
+
   center_widget(shell, x, y);
-  
+
   XtPopup(shell, grab_kind);
 }
 
-static void 
-popdown_action(widget, event, params, num_params)
-     Widget widget;
-     XEvent *event;
-     String *params;
-     Cardinal *num_params;
+static void
+popdown_action(Widget widget, XEvent *event, String *params, Cardinal *num_params)
 {
   XtPopdown(widget);
 }
 
-static void 
-set_siblingscale_CB(widget, w, percent_ptr)
-     Widget widget;
-     XtPointer w;
-     XtPointer percent_ptr;
+static void
+set_siblingscale_CB(Widget widget, XtPointer w, XtPointer percent_ptr)
 {
   char tmpstr[10];
-  
+  Arg al [1];
+
   sprintf(tmpstr, "%d  ", (int) (*(float*) percent_ptr*MAX_BORDER_SIZE));
-  
-  XtVaSetValues((Widget) w, XtNlabel, tmpstr, NULL);
+
+  XtSetArg (al [0], XtNlabel, tmpstr);
+  XtSetValues((Widget) w, al, 1);
 }
 
-static void 
-siblingscale_CB(widget, w, report)
-     Widget widget;
-     XtPointer w;
-     XawPannerReport *report;
+static void
+siblingscale_CB(Widget widget, XtPointer w, XtPointer call_data)
 {
   char tmpstr[10];
-  
-  sprintf(tmpstr, "%d ", (int) 
-	  ((float) report->slider_x / report->slider_width 
+  XawPannerReport *report = (XawPannerReport *) call_data;
+  Arg al [1];
+
+  sprintf(tmpstr, "%d ", (int)
+	  ((float) report->slider_x / report->slider_width
 	   * MAX_BORDER_SIZE / 10));
-  
-  XtVaSetValues((Widget) w, XtNlabel, tmpstr, NULL);
+
+  XtSetArg (al [0], XtNlabel, tmpstr);
+  XtSetValues((Widget) w, al, 1);
 }
 
 static void
-set_levelscale_CB(widget, w, percent_ptr)
-     Widget widget;
-     XtPointer w;
-     XtPointer percent_ptr;
+set_levelscale_CB(Widget widget, XtPointer w, XtPointer percent_ptr)
 {
   char	tmpstr[10];
+  Arg al [1];
 
   sprintf(tmpstr, "%d  ", (int) (*(float*) percent_ptr*MAX_PARENT_DISTANCE));
 
-  XtVaSetValues((Widget) w, XtNlabel, tmpstr, NULL);
+  XtSetArg (al [0], XtNlabel, tmpstr);
+  XtSetValues((Widget) w, al, 1);
 }
 
 static void
-levelscale_CB(widget, w, report)
-     Widget widget;
-     XtPointer w;
-     XawPannerReport *report;
+levelscale_CB(Widget widget, XtPointer w, XtPointer call_data)
 {
   char	tmpstr[10];
-  
-  sprintf(tmpstr, "%d ", (int) 
-	  ((float) report->slider_x / report->slider_width 
+  XawPannerReport *report = (XawPannerReport *) call_data;
+  Arg al [1];
+
+  sprintf(tmpstr, "%d ", (int)
+	  ((float) report->slider_x / report->slider_width
 	   * MAX_PARENT_DISTANCE / 10));
-  
-  XtVaSetValues((Widget) w, XtNlabel, tmpstr, NULL);
+
+  XtSetArg (al [0], XtNlabel, tmpstr);
+  XtSetValues((Widget) w, al, 1);
 }
 
-static void 
-set_siblingvalue_CB(widget, var_ptr, percent_ptr)
-     Widget widget;
-     XtPointer var_ptr;
-     XtPointer percent_ptr;
+static void
+set_siblingvalue_CB(Widget widget, XtPointer var_ptr, XtPointer percent_ptr)
 {
   * (int *)var_ptr = (int) (*(float*) percent_ptr*MAX_BORDER_SIZE);
 }
 
-static void 
-set_levelvalue_CB(widget, var_ptr, percent_ptr)
-     Widget widget;
-     XtPointer var_ptr;
-     XtPointer percent_ptr;
+static void
+set_levelvalue_CB(Widget widget, XtPointer var_ptr, XtPointer percent_ptr)
 {
   * (int *)var_ptr = (int) (*(float*) percent_ptr*MAX_PARENT_DISTANCE);
 }
 
 
-static void 
-siblingvalue_CB(widget, var_ptr, report)
-     Widget widget;
-     XtPointer var_ptr;
-     XawPannerReport *report;
+static void
+siblingvalue_CB(Widget widget, XtPointer var_ptr, XtPointer call_data)
 {
-  * (int *) var_ptr = (int) 
-    ((float) report->slider_x / report->slider_width 
+  XawPannerReport *report = (XawPannerReport *) call_data;
+
+  * (int *) var_ptr = (int)
+    ((float) report->slider_x / report->slider_width
      * MAX_BORDER_SIZE / 10);
 }
 
-static void 
-levelvalue_CB(widget, var_ptr, report)
-     Widget widget;
-     XtPointer var_ptr;
-     XawPannerReport *report;
+static void
+levelvalue_CB(Widget widget, XtPointer var_ptr, XtPointer call_data)
 {
-  * (int *) var_ptr = (int) 
-    ((float) report->slider_x / report->slider_width 
+  XawPannerReport *report = (XawPannerReport *) call_data;
+
+  * (int *) var_ptr = (int)
+    ((float) report->slider_x / report->slider_width
      * MAX_PARENT_DISTANCE / 10);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   Main routine
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-main(argc, argv)
-     int argc;
-     char *argv[];
+int
+main(int argc, char *argv[])
 {
   Tree *tree = NULL;
   ErrCode error = ERR_NONE;
-  
+
   ProgramName = strdup(argv[0]);
   if (ProgramName == NULL) {
     fprintf(stderr, "%s: insufficient memory available\n", argv[0]);
     exit(0);
   }
-  
+
   InitializeInterface(&argc, argv);
   XSync(TreeDisplay, 0);
 
@@ -1976,8 +1886,8 @@
     if (tree) StatusMsg(argv[1], TRUE);
     if (argc > 2)
       WARN("extraneous arguments ignored");
-  } 
-     
+  }
+
   if (tree) {
     SetupTree(tree);
     XtSetSensitive(treeMenuItems[TREE_MENU_SAVE], TRUE);
@@ -1988,17 +1898,13 @@
 
   if (error != ERR_NONE)
     HandleError(error, tree);
-  
+
   StatusMsg("Left = Edit Node; Mid = View Node; Right = Node Menu", 1);
   UserEventLoop();
+
+  return 0;
 }
 
 /* ------------------------------------------------------------------------- */
 /*				  End of File                                */
 /* ------------------------------------------------------------------------- */
-
-
-
-
-
-
--- a/pkg-src/tree-x/intf.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/intf.h	Mon Aug 13 09:45:46 2007 +0200
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * File    : intf.h
- * Purpose : include file for intf.c and draw.c 
+ * Purpose : include file for intf.c and draw.c
  * ----------------------------------------------------------------------------
  */
 
@@ -33,7 +33,7 @@
 #define CONTOUR_COLOR             2
 #define HIGHLIGHT_COLOR           3
 #define SPLIT_COLOR               4
-#define ACTION_COLOR              5  
+#define ACTION_COLOR              5
 #define NUM_COLORS                6
 
 #define TREE_MENU_NEW             0
@@ -77,7 +77,7 @@
 #define STR_HIDE_CONTOUR          5
 #define STR_LOAD_FILE             6
 #define STR_SAVE_FILE             7
-#define NUM_MENU_STRS             8 
+#define NUM_MENU_STRS             8
 
 #define DLG_NEW                   0
 #define DLG_NODE_NAME             1
@@ -120,5 +120,14 @@
 extern  char          TreeShowSteps;
 extern  ContourOption TreeShowContourOption;
 extern  DensityOption TreeLayoutDensity;
-extern  char          TreeAlignNodes;   
+extern  char          TreeAlignNodes;
 extern  char          PauseAfterStep;
+
+void	Pause(void);
+void	StatusMsg(char *msg, int urgent);
+void	InsertNode(Tree *base_node, NodePosition node_pos, char *new_node_text);
+void	SetNodeLabel(Tree *node, char *label);
+void	SetDrawColor(int color);
+void	ExpandCollapseNode(Tree *node);
+void	SetDrawingTree(Tree *tree);
+void	ExposeHandler(Widget, XtPointer, XEvent*, Boolean*);
--- a/pkg-src/tree-x/rsrc.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/rsrc.h	Mon Aug 13 09:45:46 2007 +0200
@@ -3,7 +3,7 @@
 #define TrNcontourColor    "contourColor"
 #define TrNsplitColor      "splitColor"
 #define TrNhighlightColor  "highlightColor"
-#define TrNactionColor     "actionColor"   
+#define TrNactionColor     "actionColor"
 #define TrNcontourWidth    "contourWidth"
 
 #define TrCBackgroundColor "BackgroundColor"
@@ -11,7 +11,7 @@
 #define TrCContourColor    "ContourColor"
 #define TrCSplitColor      "SplitColor"
 #define TrCHighlightColor  "HighlightColor"
-#define TrCActionColor     "ActionColor"    
+#define TrCActionColor     "ActionColor"
 #define TrCContourWidth    "ContourWidth"
 
 #define TrDefaultBackgroundColor "white"
@@ -31,4 +31,3 @@
    Pixel action_color;
    int   contour_width;
 } ApplRsrcData, *ApplRsrcDataPtr;
-
--- a/pkg-src/tree-x/tree.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/tree.c	Mon Aug 13 09:45:46 2007 +0200
@@ -9,84 +9,74 @@
 #include "dbl.h"
 #include "intf.h"
 #include <string.h>
+#include <stdlib.h>
 
 /* ------------------------------------------------------------------------- */
 /*				Global Variables                             */
 /* ------------------------------------------------------------------------- */
 
-int NumLines = 0;
-int NumNodes = 0;
+static int NumLines = 0;
+static int NumNodes = 0;
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   MakeLine() allocates the memory required for a Polyline and 
+ *
+ *   MakeLine() allocates the memory required for a Polyline and
  *   initializes the fields of a Polyline to the arguments. The
  *   newly-allocated Polyline is returned by the function.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 Polyline*
-MakeLine(dx, dy, link)
-   short dx;
-   short dy;
-   Polyline *link;
+MakeLine(short dx, short dy, Polyline *line)
 {
-   Polyline *new;
-
-   new = (Polyline *) malloc(sizeof(Polyline));
-   NASSERT(new, "could not allocate memory for polyline");
+   Polyline *new_line = (Polyline *) malloc(sizeof(Polyline));
+   
+   NASSERT(new_line, "could not allocate memory for polyline");
    NumLines++;
 
-   new->dx = dx;
-   new->dy = dy;
-   new->link = link;
+   new_line->dx = dx;
+   new_line->dy = dy;
+   new_line->link = line;
 
-   return (new);
+   return new_line;
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   MakeNode() allocates the memory required for a tree node, and
  *   zeros out all the fields in the Node. It returns a pointer to the
  *   tree node upon success, and NULL upon failure.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 Tree*
-MakeNode()
+MakeNode(void)
 {
-   Tree *node;
+   Tree *node = (Tree *) malloc(sizeof(Tree));
    
-   node = (Tree *) malloc(sizeof(Tree));
    NASSERT(node, "could not allocate memory for node");
    NumNodes++;
 
    if (node == NULL)
       return (NULL);
    else {
-#ifdef SYSV
-      memset((char *) node, 0, sizeof(Tree));
-#else
-      bzero((char *) node, sizeof(Tree));
-#endif
-      return (node);
+     memset((char *) node, 0, sizeof(Tree));
+     return (node);
    }
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   MakeBridge()
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-Polyline*
-MakeBridge(line1, x1, y1, line2, x2, y2)
-   Polyline *line1, *line2;
-   int x1, x2, y1, y2;
+static Polyline*
+MakeBridge(Polyline *line1, int x1, int y1, Polyline *line2, int x2, int y2)
 {
    int dx, dy, s;
    Polyline *r;
@@ -105,27 +95,26 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   Offset() computes the necessary offset that prevents two line segments
  *   from intersecting each other. This is the "heart" of the merge step
- *   that computes how two subtree contours should be separated. 
- * 
+ *   that computes how two subtree contours should be separated.
+ *
  *   The code is taken directly from Sven Moen's paper, with changes in
- *   some variable names to give more meaning: 
- *   
+ *   some variable names to give more meaning:
+ *
  *   - px,py indicate the x- and y-coordinates of the point on the longer
  *     segment if the previous Offset() call had two unequal segments
- * 
+ *
  *   - lx,ly indicate the dx and dy values of the "lower" line segment
- * 
+ *
  *   - ux,uy indicate the dx and dy values of the "upper" line segment
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-int
-Offset(px, py, lx, ly, ux, uy)
-   int px, py, lx, ly, ux, uy;
+static int
+Offset(int px, int py, int lx, int ly, int ux, int uy)
 {
    int d, s, t;
 
@@ -165,22 +154,21 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   Merge()
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-int
-Merge(c1, c2)
-   Polygon *c1, *c2;
+static int
+Merge(Polygon *c1, Polygon *c2)
 {
    int x, y, total, d;
    Polyline *lower, *upper, *bridge;
 
    x = y = total = 0;
 
-   /*  compare lower part of upper child's contour 
+   /*  compare lower part of upper child's contour
     *  with upper part of lower child's contour
     */
    upper = c1->lower.head;
@@ -202,7 +190,7 @@
 	 upper = upper->link;
       }
    }
-	 
+
    if (lower) {
       bridge = MakeBridge(c1->upper.tail, 0, 0, lower, x, y);
       c1->upper.tail = (bridge->link) ? c2->upper.tail : bridge;
@@ -210,7 +198,7 @@
    }
    else {
       bridge = MakeBridge(c2->lower.tail, x, y, upper, 0, 0);
-      if (!bridge->link) 
+      if (!bridge->link)
 	 c1->lower.tail = bridge;
    }
    c1->lower.head = c2->lower.head;
@@ -219,17 +207,16 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   DetachParent() reverses the effects of AttachParent by removing
  *   the four line segments that connect the subtree contour to the
- *   node specified by 'tree'. 
- * 
+ *   node specified by 'tree'.
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-DetachParent(tree)
-   Tree *tree;
+static void
+DetachParent(Tree *tree)
 {
    free(tree->contour.upper.head->link);
    free(tree->contour.upper.head);
@@ -245,19 +232,17 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
- *   AttachParent() 
+ *
+ *   AttachParent()
  *   This function also establishes the position of the first child
  *   The code follows Sven Moen's version, with slight modification to
  *   support varying borders at different levels.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-AttachParent(tree, h)
-   Tree *tree;
-   int h;
+static void
+AttachParent(Tree *tree, int h)
 {
    int x, y1, y2;
 
@@ -267,7 +252,7 @@
    else
       x = tree->border + TreeParentDistance;
    y2 = (h - tree->height)/2 - tree->border;
-   y1 = y2 + tree->height + (2 * tree->border) - h; 
+   y1 = y2 + tree->height + (2 * tree->border) - h;
    tree->child->offset.x = x + tree->width;
    tree->child->offset.y = y1;
    tree->contour.upper.head = MakeLine(tree->width, 0,
@@ -279,29 +264,28 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   Split()
  *   The tree passed to Split() must have at least 1 child, because
  *   it doesn't make sense to split a leaf (there are no bridges)
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-void
-Split(tree)
-   Tree *tree;
+static void
+Split(Tree *tree)
 {
    Tree *child;
    Polyline *link;
 
    FOREACH_CHILD(child, tree) {
-      if (link = child->contour.upper.tail->link) {
+      if ((link = child->contour.upper.tail->link)) {
 	 free(link->link);
 	 free(link);
 	 child->contour.upper.tail->link = NULL;
 	 NumLines -= 2;
       }
-      if (link = child->contour.lower.tail->link) {
+      if ((link = child->contour.lower.tail->link)) {
 	 free(link->link);
 	 free(link);
 	 NumLines -= 2;
@@ -311,22 +295,21 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   Join() merges all subtree contours of the given tree and returns the
- *   height of the entire tree contour. 
- * 
+ *   height of the entire tree contour.
+ *
  * ----------------------------------------------------------------------------
  */
 
-int
-Join(tree)
-   Tree *tree;
+static int
+Join(Tree *tree)
 {
    Tree *child;
    int d, h, sum;
 
    /*   to start, set the parent's contour and height
-    *   to contour and height of first child 
+    *   to contour and height of first child
     */
    child = tree->child;
    tree->contour = child->contour;
@@ -345,39 +328,37 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   RuboutLeaf() accepts a single node (leaf) and removes its contour.
- *   The memory associated with the contour is deallocated. 
- * 
+ *   The memory associated with the contour is deallocated.
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-RuboutLeaf(tree)
-   Tree *tree;
+RuboutLeaf(Tree *tree)
 {
    free(tree->contour.upper.head);
    free(tree->contour.lower.tail);
    free(tree->contour.lower.head);
-   tree->contour.upper.head = NULL;   
-   tree->contour.upper.tail = NULL;   
-   tree->contour.lower.head = NULL;   
-   tree->contour.lower.tail = NULL;   
+   tree->contour.upper.head = NULL;
+   tree->contour.upper.tail = NULL;
+   tree->contour.lower.head = NULL;
+   tree->contour.lower.tail = NULL;
    NumLines -= 3;
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   LayoutLeaf() accepts a single node (leaf) and forms its contour. This
- *   function assumes that the width, height, and border fields of the 
+ *   function assumes that the width, height, and border fields of the
  *   node have been assigned meaningful values.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-LayoutLeaf(tree)
-   Tree *tree;
+LayoutLeaf(Tree *tree)
 {
    tree->node_height = 0;
    tree->border = TreeBorderSize;
@@ -385,7 +366,7 @@
    tree->contour.upper.tail = MakeLine(tree->width + 2 * tree->border, 0,
 				       NULL);
    tree->contour.upper.head = tree->contour.upper.tail;
-   
+
    tree->contour.lower.tail = MakeLine(0, -tree->height - 2 * tree->border,
 				       NULL);
    tree->contour.lower.head = MakeLine(tree->width + 2 * tree->border, 0,
@@ -394,20 +375,19 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   LayoutTree() traverses the given tree (in depth-first order), and forms
  *   subtree or leaf contours at each node as needed. Each node's contour is
  *   stored in its "contour" field. Elision is also supported by generating
  *   the contour for both the expanded and collapsed node. This routine
  *   also computes the tree height of each node in the tree, so that variable
  *   density layout can be demonstrated.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-LayoutTree(tree)
-   Tree *tree;
+LayoutTree(Tree *tree)
 {
    Tree *child;
    int   height = 0;
@@ -424,7 +404,7 @@
 
    if (tree->child) {
 
-      FOREACH_CHILD(child, tree) 
+      FOREACH_CHILD(child, tree)
 	 height = MAX(child->node_height, height);
       tree->node_height = height + 1;
 
@@ -443,8 +423,7 @@
 /* ------------------------------------------------------------------------- */
 
 void
-Unzip(tree)
-   Tree *tree;
+Unzip(Tree *tree)
 {
    Tree *child;
 
@@ -452,10 +431,10 @@
    if (TreeShowSteps) {
       HiliteNode(tree, New);
       tree->on_path = TRUE;
-      StatusMsg("Unzip: follow parent links up to root");
+      StatusMsg("Unzip: follow parent links up to root", 0);
       Pause();
    }
-#endif   
+#endif
 
    if (tree->parent)
       Unzip(tree->parent);
@@ -464,8 +443,8 @@
 
 #ifdef INTF
       /*   draw entire contour; do it only for root, because the last
-       *   frame drawn in this function will have already drawn the  
-       *   contour for the most recently split subtree.              
+       *   frame drawn in this function will have already drawn the
+       *   contour for the most recently split subtree.
        */
       if (TreeShowSteps) {
 	 if (tree->parent == NULL) {
@@ -473,7 +452,7 @@
 	      DrawTreeContour(tree, New, CONTOUR_COLOR, FALSE, FALSE, FALSE);
 	      DrawTree(TheTree, New);
 	    EndFrame();
-	    StatusMsg("Unzip: disassemble entire contour");
+	    StatusMsg("Unzip: disassemble entire contour", 0);
 	    Pause();
 	 }
       }
@@ -483,11 +462,15 @@
       /* draw contour as it would appear after DetachParent() */
       if (TreeShowSteps) {
 	 BeginFrame();
+#if 0 /* mrb */
 	   DrawTreeContour(tree, New, CONTOUR_COLOR, TRUE,
 			   FALSE, FALSE, FALSE);
+#endif
+	   DrawTreeContour(tree, New, CONTOUR_COLOR, TRUE,
+			   FALSE, FALSE);
 	   DrawTree(TheTree, New);
 	 EndFrame();
-	 StatusMsg("Unzip: detach parent");
+	 StatusMsg("Unzip: detach parent", 0);
 	 Pause();
       }
 #endif
@@ -501,7 +484,7 @@
            /* mark other subtree contours as split, and */
 	   /* draw only the contour on path in full     */
 	   FOREACH_CHILD(child, tree) {
-	      if (!child->on_path) 
+	      if (!child->on_path)
 		 child->split = TRUE;
 	      else
 		 DrawTreeContour(child, New, CONTOUR_COLOR,
@@ -509,7 +492,7 @@
 	   }
 	   DrawTree(TheTree, New);
 	 EndFrame();
-	 StatusMsg("Unzip: split tree");
+	 StatusMsg("Unzip: split tree", 0);
 	 Pause();
       }
 #endif
@@ -522,8 +505,7 @@
 /* ------------------------------------------------------------------------- */
 
 void
-Zip(tree)
-   Tree *tree;
+Zip(Tree *tree)
 {
    if (tree->child)
       AttachParent(tree, Join(tree));
@@ -535,16 +517,15 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   Insert() adds the specified child to parent, just after the specified
  *   sibling. If 'sibling' is Null, the child is added as the first child.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-Insert(parent, child, sibling)
-   Tree *parent, *child, *sibling;
+Insert(Tree *parent, Tree *child, Tree *sibling)
 {
    Unzip(parent);
    child->parent = parent;
@@ -563,17 +544,17 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   Delete() traverses the specified tree and frees all storage
  *   allocated to the subtree, including contours and bridges.
  *   If the tree had a preceding sibling, the preceding sibling is
  *   modified to point to the tree's succeeding sibling, if any.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-Delete(tree)
-   Tree *tree;
+void
+Delete(Tree *tree)
 {
    Tree *sibling = NULL;
    Tree *parent, *child;
@@ -591,26 +572,25 @@
       sibling->sibling = tree->sibling;
    else if (parent)
       parent->child = tree->sibling;
-   
+
    DeleteTree(tree, FALSE);
 }
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   DeleteTree() is the recursive function that supports Delete(). 
+ *
+ *   DeleteTree() is the recursive function that supports Delete().
  *   If 'contour' is True, then only the contours are recursively deleted.
  *   This flag should be True when you are regenerating a tree's layout
  *   and still want to preserve the nodes. Since contours would be deleted
  *   only due to a change in sibling or level distance, each node's border
  *   value is updated with the current value of TreeBorderSize;
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
-DeleteTree(tree, contour)
-   Tree *tree;
-   int   contour;
+void
+DeleteTree(Tree *tree, int contour)
 {
    Tree *child;
 
@@ -630,7 +610,7 @@
    else
       RuboutLeaf(tree);
 
-   if (contour) 
+   if (contour)
       tree->border = TreeBorderSize;
    else {
       free(tree->label.text);
@@ -641,18 +621,17 @@
 
 
 /* ----------------------------------------------------------------------------
- * 
- *   ComputeTreeSize() 
+ *
+ *   ComputeTreeSize()
  *   This function should be called after tree layout.
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-ComputeTreeSize(tree, width, height, x_offset, y_offset)
-   Tree *tree;
-   int *width, *height;
-   int *x_offset, *y_offset;
+ComputeTreeSize(Tree *tree,
+		int *width, int *height,
+		int *x_offset, int *y_offset)
 {
    Polyline *contour, *tail;
    int upper_min_y = 0, lower_max_y = 0;
@@ -663,7 +642,7 @@
    contour = tree->contour.upper.head;
    tail    = tree->contour.upper.tail;
    while (contour) {
-      if ((contour->dy + upper_abs_y) < upper_min_y) 
+      if ((contour->dy + upper_abs_y) < upper_min_y)
 	 upper_min_y = contour->dy + upper_abs_y;
       upper_abs_y += contour->dy;
       if (contour == tail)
@@ -696,26 +675,24 @@
 }
 
 /* ----------------------------------------------------------------------------
- * 
+ *
  *   PetrifyTree()
- * 
+ *
  * ----------------------------------------------------------------------------
  */
 
 void
-PetrifyTree(tree, x, y)
-   Tree *tree;
-   int x, y;
+PetrifyTree(Tree *tree, int x, int y)
 {
    int width, height;
    int x_offset, y_offset;
-   
+
    tree->old_pos = tree->pos;	/* used by AnimateTree */
 
    /* fix position of each node */
    tree->pos.x = x + tree->offset.x;
    tree->pos.y = y + tree->offset.y;
-   
+
    if (tree->child) {
       PetrifyTree(tree->child, tree->pos.x, tree->pos.y);
       ComputeSubTreeExtent(tree); /* for benefit of interface picking */
--- a/pkg-src/tree-x/tree.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/tree.h	Mon Aug 13 09:45:46 2007 +0200
@@ -90,13 +90,34 @@
    New
 } PosMode;			/* Position mode */
 
-extern Polyline* MakeLine();
-extern Tree*     MakeNode();
-extern Tree*     ReadTreeFromFile();
-extern void      ComputeTreeSize();
-extern void      Unzip();
-extern void      Zip();
+
+Polyline* MakeLine(short dx, short dy, Polyline *line);
+Tree*	MakeNode(void);
+void	ComputeTreeSize(Tree *tree,
+			int *width, int *height,
+			int *x_offset, int *y_offset);
+void	Unzip       (Tree *tree);
+void	Zip         (Tree *tree);
+void	PetrifyTree (Tree *tree, int x, int y);
+void	DrawTree    (Tree *tree, PosMode pos_mode);
+void	Delete      (Tree *tree);
+void	DeleteTree  (Tree *tree, int contour);
+void	Insert      (Tree *parent, Tree *child, Tree *sibling);
+void	DrawTreeContour(Tree *tree, PosMode pos_mode,
+			int color, int detach_p, int select_p, int recursive);
+void	ComputeSubTreeExtent(Tree *tree);
+void	LayoutLeaf  (Tree *tree);
+void	RuboutLeaf  (Tree *tree);
+void	HiliteNode  (Tree *tree, PosMode pos_mode);
+void	DeleteNode  (Tree *node);
+void	DrawNode    (Tree *node, PosMode pos_mode);
+void	ResetLabels (Tree *tree);
+void	SetupTree   (Tree *tree);
+int	SearchTree  (Tree *tree, int x, int y, Tree **node);
+void	LayoutTree  (Tree *tree);
+
+/* draw.c */
+void	BeginFrame (void);
+void	EndFrame   (void);
 
 extern Tree     *TheTree;
-extern int       NumLines;
-extern int       NumNodes;
--- a/pkg-src/tree-x/usleep.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/pkg-src/tree-x/usleep.c	Mon Aug 13 09:45:46 2007 +0200
@@ -5,12 +5,12 @@
  *                    call to delay for the desired number of
  *                    micro-seconds. This call returns ZERO
  *                    (which is usually ignored) on successful
- *                    completion, -1 otherwise. 
+ *                    completion, -1 otherwise.
  *
  *  ALGORITHM:
  *      1) We range check the passed in microseconds and log a
  *         warning message if appropriate. We then return without
- *         delay, flagging an error. 
+ *         delay, flagging an error.
  *      2) Load the Seconds and micro-seconds portion of the
  *         interval timer structure.
  *      3) Call select(2) with no file descriptors set, just the
@@ -24,7 +24,6 @@
  *      Michael J. Dyer   <mike@sherlock.med.ge.com>
  */
 
-#ifndef HAVE_USLEEP
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -34,38 +33,33 @@
 #include <sys/param.h>
 #include <sys/types.h>
 
-int     usleep( unsigned long int microSeconds )
+int
+usleep (unsigned long microSeconds)
 {
-        unsigned int            Seconds, uSec;
-        int                     nfds, readfds, writefds, exceptfds;
-        struct  timeval         Timer;
-
-        nfds = readfds = writefds = exceptfds = 0;
-
-        if( (microSeconds == (unsigned long) 0) 
-                || microSeconds > (unsigned long) 4000000 )
-        {
-                errno = ERANGE;         /* value out of range */
-                perror( "usleep time out of range ( 0 -> 4000000 ) " );
-                return -1;
-        }
+  unsigned int     Seconds, uSec;
+  int              nfds = 0;
+  fd_set           readfds, writefds, exceptfds;
+  struct  timeval  Timer;
 
-        Seconds = microSeconds / (unsigned long) 1000000;
-        uSec    = microSeconds % (unsigned long) 1000000;
+  if( (microSeconds == (unsigned long) 0) ||
+      microSeconds  >  (unsigned long) 4000000 )
+    {
+      errno = ERANGE;         /* value out of range */
+      perror( "usleep time out of range ( 0 -> 4000000 ) " );
+      return -1;
+    }
 
-        Timer.tv_sec            = Seconds;
-        Timer.tv_usec           = uSec;
+  Seconds = microSeconds / (unsigned long) 1000000;
+  uSec    = microSeconds % (unsigned long) 1000000;
 
-        if( select( nfds, &readfds, &writefds, &exceptfds, &Timer ) < 0 )
-        {
-                perror( "usleep (select) failed" );
-                return -1;
-        }
+  Timer.tv_sec  = Seconds;
+  Timer.tv_usec = uSec;
 
-        return 0;
+  if( select( nfds, &readfds, &writefds, &exceptfds, &Timer ) < 0 )
+    {
+      perror( "usleep (select) failed" );
+      return -1;
+    }
+
+  return 0;
 }
-#else
-/* this is to avoid a "object file has no symbol" error/warning.
-*/
-static int local_junk;
-#endif
--- a/src/ChangeLog	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/ChangeLog	Mon Aug 13 09:45:46 2007 +0200
@@ -1,3 +1,65 @@
+1997-06-28  Steven L Baur  <steve@altair.xemacs.org>
+
+	* config.h.in: Back out previous change to LOSING_BYTECODE.  It's
+	just not worth it.
+
+1997-06-27  Mike Scheidler  <c23mts@eng.delcoelect.com>
+
+	* s/sol2.h: Undefined _XOPEN_SOURCE for Solaris 2.4.
+
+1997-06-28  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* abbrev.c (abbrev_match): New function.
+	(abbrev_oblookup): New function.
+	(obarray_has_blank_p): New function.
+	(abbrev_count_case): New function.
+	(Fexpand_abbrev): Use them.  Allow abbreviations to contain
+	arbitrary characters.
+
+1997-06-28  Steven L Baur  <steve@altair.xemacs.org>
+
+	* config.h.in: LOSING_BYTECODE will not be compiled into XEmacs.
+
+	* doc.c (Fsnarf_documentation): Remove VMS dependent stuff for
+	cleanliness.
+
+1997-06-28  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* print.c (Ferror_message_string): Simplify.
+
+1997-06-27  Steven L Baur  <steve@altair.xemacs.org>
+
+	* symbols.c (Fdefine_function): Correct docstring.
+	(Fsetplist): Ditto.
+	(Ffset): Ditto.
+	(Fsetq_default): Ditto.
+
+1997-06-27  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* eval.c (skip_debugger): Removed comment and #ifdef-ed code.
+	(signal_call_debugger): Call skip_debugger after wants_debugger.
+	(signal_call_debugger): Gcpro cons sent to skip_debugger.
+
+1997-06-26  Steven L Baur  <steve@altair.xemacs.org>
+
+	* process.c (create_process): Default to fork instead of vfork.
+
+	* callproc.c (Fcall_process_internal): Default to fork instead of
+	vfork.
+
+	* emacsfns.h: Add declarations of Ferror_message_string(),
+	Frunning_temacs_p().
+
+	* eval.c: Remove declarations of Ferror_message_string(),
+	Frunning_temacs_p().
+
+	* Makefile.in.in (${libsrc}DOC): Correct dependency for the docfile.
+	(${mo_dir}emacs.po): Remove obsolete references to lisp source.
+
+1997-06-29  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+	* mule-charset.c: Modify charset DOC-strings to be more detailed.
+
 1997-06-25  Steven L Baur  <steve@altair.xemacs.org>
 
 	* alloc.c (Flist): Optimize.
--- a/src/Makefile.in.in	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/Makefile.in.in	Mon Aug 13 09:45:46 2007 +0200
@@ -275,7 +275,7 @@
 LOADPATH =  EMACSLOADPATH="${lispdir}prim"
 DUMPENV = $(LOADPATH)
 
-release: temacs ${lisp} ${libsrc}DOC $(mo_file) ${other_files}
+release: temacs ${libsrc}DOC $(mo_file) ${other_files}
 #ifdef CANNOT_DUMP
 	ln temacs xemacs
 #else
@@ -299,13 +299,15 @@
 	touch release
 #endif /* ! defined (CANNOT_DUMP) */
 
-xemacs: temacs ${libsrc}DOC ${lisp} $(mo_file) ${other_files}
+FRC.DOC:
+
+xemacs: temacs ${libsrc}DOC $(mo_file) ${other_files} dump-elcs
 	@touch SATISFIED
 	-$(DUMPENV) ./temacs -batch -l loadup.el dump
 	@if test ! -f SATISFIED; then $(MAKE) $@; fi
 	@$(RM) SATISFIED
 
-xemacs-no-site-file: temacs ${libsrc}DOC ${lisp} $(mo_file) ${other_files}
+xemacs-no-site-file: temacs ${libsrc}DOC $(mo_file) ${other_files} dump-elcs
 	@touch SATISFIED
 	-$(DUMPENV) ./temacs -batch -l loadup.el dump no-site-file
 	@if test ! -f SATISFIED; then $(MAKE) $@; fi
@@ -319,8 +321,10 @@
 	cd ../dynodump && ${MAKE} ${MFLAGS}
 #endif /* DYNODUMP */
 
-${libsrc}DOC:
-	$(RM) ${libsrc}DOC
+${libsrc}DOC: ../lib-src/make-docfile FRC.DOC
+#ifdef NO_DOC_FILE
+	if test -f $@; then touch $@ && exit 0; fi; \
+#endif
 	-${DUMPENV} ./temacs -batch -l ../prim/make-docfile.el -- \
 		-o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \
 		${obj_src} ${mallocdocsrc} ${rallocdocsrc}
@@ -348,8 +352,8 @@
    msgfmt=		 msgfmt
 #endif
 
-${mo_dir}emacs.po: ${libsrc}make-msgfile ${libsrc}make-po ${objs} ${lisp}
-	${libsrc}make-msgfile -o ${libsrc}messages ${objs} ${lisp} ${otherlisp}
+${mo_dir}emacs.po: ${libsrc}make-msgfile ${libsrc}make-po ${objs}
+	${libsrc}make-msgfile -o ${libsrc}messages ${objs}
 	cd ${libsrc} && ${xgettext} ${xgettext_args}
 	$(RM) ${mo_dir}emacs.po
 	cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po DOC
--- a/src/abbrev.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/abbrev.c	Mon Aug 13 09:45:46 2007 +0200
@@ -26,6 +26,7 @@
    FSF: Original version; a long time ago.
    JWZ or Mly: Mostly moved into Lisp; maybe 1992.
    Ben Wing: Some changes for Mule for 19.12.
+   Hrvoje Niksic: Largely rewritten in June 1997.
 */
 
 /* This file has been Mule-ized. */
@@ -70,158 +71,319 @@
 /* Character address of start of last abbrev expanded */
 int last_abbrev_point;
 
+Lisp_Object oblookup (Lisp_Object, CONST Bufbyte *, Bytecount);
+
 /* Hook to run before expanding any abbrev.  */
 Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;
 
 
-/* Expand the word before point, if it is an abbrev.
-   Returns Qt if an expansion is done. */
+/* Match the buffer text against names of symbols in obarray.  Returns
+   the matching symbol, or 0 if not found.  */
+
+static struct Lisp_Symbol *
+abbrev_match (struct buffer *buf, Lisp_Object obarray)
+{
+  Bufpos point = BUF_PT (buf);
+  Bufpos maxlen = point - BUF_BEGV (buf);
+  Charcount idx;
+
+  struct Lisp_Char_Table *chartab = XCHAR_TABLE (buf->mirror_syntax_table);
+  struct Lisp_String *abbrev;
+  struct Lisp_Vector *obvec;
+  struct Lisp_Symbol *sym;
+  Charcount abbrev_length;
+  Lisp_Object tail;
+  int i, found;
+
+  CHECK_VECTOR (obarray);
+  obvec = XVECTOR (obarray);
+
+  /* The obarray-traversing code is copied from `map_obarray'. */
+  found = 0;
+  for (i = vector_length (obvec) - 1; i >= 0; i--)
+    {
+      tail = vector_data (obvec)[i];
+      if (SYMBOLP (tail))
+	while (1)
+	  {
+	    sym = XSYMBOL (tail);
+	    if (UNBOUNDP (symbol_value (sym)) || NILP (symbol_value (sym)))
+	      {
+		/* The symbol value of nil means that abbrev got
+                   undefined. */
+		goto next;
+	      }
+	    abbrev = symbol_name (sym);
+	    abbrev_length = string_char_length (abbrev);
+	    if (abbrev_length > maxlen)
+	      {
+		/* This abbrev is too large -- it wouldn't fit. */
+		goto next;
+	      }
+	    /* If `bar' is an abbrev, and a user presses `fubar<SPC>',
+	       we don't normally want to expand it.  OTOH, if the
+	       abbrev begins with non-word syntax, it is OK to
+	       abbreviate it anywhere.  */
+	    if (abbrev_length < maxlen && abbrev_length > 0
+		&& (WORD_SYNTAX_P (chartab, string_char (abbrev, 0)))
+		&& (WORD_SYNTAX_P (chartab,
+				   BUF_FETCH_CHAR (buf, point
+						   - (abbrev_length + 1)))))
+	      {
+		goto next;
+	      }
+	    /* Match abbreviation string against buffer text.  */
+	    for (idx = abbrev_length - 1; idx >= 0; idx--)
+	      {
+		if (DOWNCASE (buf, BUF_FETCH_CHAR (buf, point -
+						   (abbrev_length - idx)))
+		    != DOWNCASE (buf, string_char (abbrev, idx)))
+		  break;
+	      }
+	    if (idx < 0)
+	      {
+		found = 1;
+		break;
+	      }
+	  next:
+	    sym = symbol_next (XSYMBOL (tail));
+	    if (!sym)
+	      break;
+	    XSETSYMBOL (tail, sym);
+	  } /* while */
+      if (found)
+	break;
+    } /* for */
+
+  return found ? sym : 0;
+}
+
+/* Take the word before point, and look it up in OBARRAY, and return
+   the symbol (or nil).  This used to be the default method of
+   searching, with the obvious limitation that the abbrevs may consist
+   only of word characters.  It is an order of magnitued faster than
+   the proper `abbrev_match', but then again, vi is an order of
+   magnitude faster than Emacs.  */
+static struct Lisp_Symbol *
+abbrev_oblookup (struct buffer *buf, Lisp_Object obarray)
+{
+  Bufpos wordstart, wordend;
+  Bufbyte *word, *p;
+  Bytecount idx;
+  Lisp_Object lookup;
+
+  CHECK_VECTOR (obarray);
+
+  if (!NILP (Vabbrev_start_location))
+    {
+      wordstart = get_buffer_pos_char (buf, Vabbrev_start_location,
+				       GB_COERCE_RANGE);
+      Vabbrev_start_location = Qnil;
+      if (wordstart != BUF_ZV (buf)
+	  && BUF_FETCH_CHAR (buf, wordstart) == '-')
+	{
+	  buffer_delete_range (buf, wordstart, wordstart + 1, 0);
+	}
+      wordend = BUF_PT (buf);
+    }
+  else
+    {
+      Bufpos point = BUF_PT (buf);
+
+      wordstart = scan_words (buf, point, -1);
+      if (!wordstart)
+	return 0;
+
+      wordend = scan_words (buf, wordstart, 1);
+      if (!wordend)
+	return 0;
+      if (wordend > BUF_ZV (buf))
+	wordend = BUF_ZV (buf);
+      if (wordend > point)
+	wordend = point;
+      /* Unlike the original function, we allow expansion only after
+	 the abbrev, not preceded by a number of spaces.  This is
+	 because of consistency with abbrev_match. */
+      if (wordend < point)
+	return 0;
+      if (wordend <= wordstart)
+	return 0;
+    }
+
+  p = word = (Bufbyte *) alloca (MAX_EMCHAR_LEN * (wordend - wordstart));
+  for (idx = wordstart; idx < wordend; idx++)
+    {
+      Emchar c = BUF_FETCH_CHAR (buf, idx);
+      if (UPPERCASEP (buf, c))
+	c = DOWNCASE (buf, c);
+      p += set_charptr_emchar (p, c);
+    }
+  lookup = oblookup (obarray, word, p - word);
+  if (SYMBOLP (lookup) && !NILP (symbol_value (XSYMBOL (lookup))))
+    return XSYMBOL (lookup);
+  else
+    return NULL;
+}
+
+/* Return non-zero if OBARRAY contains an interned symbol ` '. */
+static int
+obarray_has_blank_p (Lisp_Object obarray)
+{
+  Lisp_Object lookup;
+
+  lookup = oblookup (obarray, (Bufbyte *)" ", 1);
+  return SYMBOLP (lookup);
+}
+
+/* Analyze case in the buffer substring, and report it.  */
+static void
+abbrev_count_case (struct buffer *buf, Bufpos pos, Charcount length,
+		   int *lccount, int *uccount)
+{
+  Emchar c;
+
+  *lccount = *uccount = 0;
+  while (length--)
+    {
+      c = BUF_FETCH_CHAR (buf, pos);
+      if (UPPERCASEP (buf, c))
+	++*uccount;
+      else if (LOWERCASEP (buf, c))
+	++*lccount;
+      ++pos;
+    }
+}
 
 DEFUN ("expand-abbrev", Fexpand_abbrev, 0, 0, "", /*
-Expand the abbrev before point, if there is an abbrev there.
+Expand the abbrev before point, if any.
 Effective when explicitly called even when `abbrev-mode' is nil.
 Returns t if expansion took place.
 */
        ())
 {
   /* This function can GC */
-  REGISTER Bufbyte *buffer, *p;
-  REGISTER Bufpos wordstart, wordend, idx;
-  Charcount whitecnt;
-  Charcount uccount = 0, lccount = 0;
-  REGISTER Lisp_Object sym;
-  Lisp_Object expansion, hook, value;
   struct buffer *buf = current_buffer;
-  Lisp_Object lbuf;
   int oldmodiff = BUF_MODIFF (buf);
+  Lisp_Object pre_modiff_p;
+  Bufpos point;			/* position of point */
+  Bufpos abbrev_start;		/* position of abbreviation beginning */
 
-  XSETBUFFER (lbuf, buf);
+  struct Lisp_Symbol *(*fun) (struct buffer *, Lisp_Object);
+
+  struct Lisp_Symbol *abbrev_symbol;
+  struct Lisp_String *abbrev_string;
+  Lisp_Object expansion, count, hook;
+  Charcount abbrev_length, idx;
+  int lccount, uccount;
+
   run_hook (Qpre_abbrev_expand_hook);
   /* If the hook changes the buffer, treat that as having "done an
      expansion".  */
-  value = (BUF_MODIFF (buf) != oldmodiff ? Qt : Qnil);
+  pre_modiff_p = (BUF_MODIFF (buf) != oldmodiff ? Qt : Qnil);
 
-  wordstart = 0;
+  abbrev_symbol = NULL;
   if (!BUFFERP (Vabbrev_start_location_buffer) ||
       XBUFFER (Vabbrev_start_location_buffer) != buf)
     Vabbrev_start_location = Qnil;
-  if (!NILP (Vabbrev_start_location))
+  /* We use the more general `abbrev_match' if the obarray blank flag
+     is not set, and Vabbrev_start_location is nil.  Otherwise, use
+     `abbrev_oblookup'. */
+#define MATCHFUN(tbl) ((obarray_has_blank_p (tbl)		 \
+			&& NILP (Vabbrev_start_location))	 \
+		       ? abbrev_match : abbrev_oblookup)
+  if (!NILP (buf->abbrev_table))
     {
-      wordstart = get_buffer_pos_char (buf, Vabbrev_start_location, GB_COERCE_RANGE);
-      Vabbrev_start_location = Qnil;
-      if (wordstart < BUF_BEGV (buf) || wordstart > BUF_ZV (buf))
-        wordstart = 0;
-      if (wordstart && wordstart != BUF_ZV (buf) &&
-          BUF_FETCH_CHAR (buf, wordstart) == '-')
-	buffer_delete_range (buf, wordstart, wordstart + 1, 0);
+      fun = MATCHFUN (buf->abbrev_table);
+      abbrev_symbol = fun (buf, buf->abbrev_table);
     }
-  if (!wordstart)
-    wordstart = scan_words (buf, BUF_PT (buf), -1);
-
-  if (!wordstart)
-    return value;
+  if (!abbrev_symbol && !NILP (Vglobal_abbrev_table))
+    {
+      fun = MATCHFUN (Vglobal_abbrev_table);
+      abbrev_symbol = fun (buf, Vglobal_abbrev_table);
+    }
+  if (!abbrev_symbol)
+    return pre_modiff_p;
 
-  wordend = scan_words (buf, wordstart, 1);
-  if (!wordend)
-    return value;
-
-  if (wordend > BUF_PT (buf))
-    wordend = BUF_PT (buf);
-  whitecnt = BUF_PT (buf) - wordend;
-  if (wordend <= wordstart)
-    return value;
+  /* NOTE: we hope that `pre-abbrev-expand-hook' didn't do something
+     nasty, such as changed (or killed) the buffer.  */
+  point = BUF_PT (buf);
 
-  p = buffer = (Bufbyte *) alloca (MAX_EMCHAR_LEN*(wordend - wordstart));
-
-  for (idx = wordstart; idx < wordend; idx++)
-    {
-      REGISTER Emchar c = BUF_FETCH_CHAR (buf, idx);
-      if (UPPERCASEP (buf, c))
-	c = DOWNCASE (buf, c), uccount++;
-      else if (! NOCASEP (buf, c))
-	lccount++;
-      p += set_charptr_emchar (p, c);
-    }
+  /* OK, we're out of the must-be-fast part.  An abbreviation matched.
+     Now find the parameters, insert the expansion, and make it all
+     look pretty. */
+  abbrev_string = symbol_name (abbrev_symbol);
+  abbrev_length = string_char_length (abbrev_string);
+  abbrev_start = point - abbrev_length;
 
-  if (VECTORP (buf->abbrev_table))
-    sym = oblookup (buf->abbrev_table,
-		    buffer,
-		    p - buffer);
+  expansion = symbol_value (abbrev_symbol);
+  CHECK_STRING (expansion);
+
+  count = symbol_plist (abbrev_symbol); /* Gag */
+  if (NILP (count))
+    count = make_int (0);
   else
-    sym = Qzero;
-  if (INTP (sym) || NILP (XSYMBOL (sym)->value))
-    sym = oblookup (Vglobal_abbrev_table,
-		    buffer,
-		    p - buffer);
-  if (INTP (sym) || NILP (XSYMBOL (sym)->value))
-    return value;
+    CHECK_NATNUM (count);
+  symbol_plist (abbrev_symbol) = make_int (1 + XINT (count));
+
+  /* Count the case in the original text. */
+  abbrev_count_case (buf, abbrev_start, abbrev_length, &lccount, &uccount);
 
-  if (INTERACTIVE && !EQ (minibuf_window, Fselected_window (Qnil)))
-    {
-      /* Add an undo boundary, in case we are doing this for
-         a self-inserting command which has avoided making one so far.  */
-      BUF_SET_PT (buf, wordend);
-      Fundo_boundary ();
-    }
-  BUF_SET_PT (buf, wordstart);
+  /* Remember the last abbrev text, location, etc. */
+  XSETSYMBOL (Vlast_abbrev, abbrev_symbol);
   Vlast_abbrev_text =
-    make_string_from_buffer (buf, wordstart, wordend - wordstart);
-  buffer_delete_range (buf, wordstart, wordend, 0);
+    make_string_from_buffer (buf, abbrev_start, abbrev_length);
+  last_abbrev_point = abbrev_start;
 
-  /* Now sym is the abbrev symbol. */
-  Vlast_abbrev = sym;
-  last_abbrev_point = wordstart;
+  /* Add an undo boundary, in case we are doing this for a
+     self-inserting command which has avoided making one so far.  */
+  if (INTERACTIVE)
+    Fundo_boundary ();
 
-  if (INTP (XSYMBOL (sym)->plist))
-    XSETINT (XSYMBOL (sym)->plist,
-	     XINT (XSYMBOL (sym)->plist) + 1);	/* Increment use count */
+  /* Remove the abbrev */
+  buffer_delete_range (buf, abbrev_start, point, 0);
+  /* And insert the expansion. */
+  buffer_insert_lisp_string (buf, expansion);
+  point = BUF_PT (buf);
 
-  expansion = XSYMBOL (sym)->value;
-  buffer_insert_lisp_string (buf, expansion);
-  BUF_SET_PT (buf, BUF_PT (buf) + whitecnt);
-
+  /* Now fiddle with the case. */
   if (uccount && !lccount)
     {
       /* Abbrev was all caps */
-      /* If expansion is multiple words, normally capitalize each word */
-      /* This used to be if (!... && ... >= ...) Fcapitalize; else Fupcase
-	 but Megatest 68000 compiler can't handle that */
-      if (!abbrev_all_caps)
-	if (scan_words (buf, BUF_PT (buf), -1) >
-	    scan_words (buf, wordstart, 1))
-	  {
-	    Fupcase_initials_region (make_int (wordstart),
-				     make_int (BUF_PT (buf)),
-				     lbuf);
-	    goto caped;
-	  }
-      /* If expansion is one word, or if user says so, upcase it all. */
-      Fupcase_region (make_int (wordstart), make_int (BUF_PT (buf)),
-		      lbuf);
-    caped: ;
+      if (!abbrev_all_caps
+	  && scan_words (buf, point, -1) > scan_words (buf, abbrev_start, 1))
+	{
+	  Fupcase_initials_region (make_int (abbrev_start), make_int (point),
+				   make_buffer (buf));
+	}
+      else
+	{
+	  /* If expansion is one word, or if user says so, upcase it all. */
+	  Fupcase_region (make_int (abbrev_start), make_int (point),
+			  make_buffer (buf));
+	}
     }
   else if (uccount)
     {
       /* Abbrev included some caps.  Cap first initial of expansion */
-      Bufpos pos = wordstart;
-
+      Bufpos pos = abbrev_start;
       /* Find the initial.  */
-      while (pos < BUF_PT (buf)
-             && !WORD_SYNTAX_P (XCHAR_TABLE (buf->mirror_syntax_table),
+      while (pos < point
+	     && !WORD_SYNTAX_P (XCHAR_TABLE (buf->mirror_syntax_table),
 				BUF_FETCH_CHAR (buf, pos)))
-        pos++;
-
+	pos++;
       /* Change just that.  */
-      Fupcase_initials_region (make_int (pos), make_int (pos + 1), lbuf);
+      Fupcase_initials_region (make_int (pos), make_int (pos + 1),
+			       make_buffer (buf));
     }
 
-  hook = XSYMBOL (sym)->function;
+  hook = symbol_function (abbrev_symbol);
   if (!NILP (hook) && !UNBOUNDP (hook))
     call0 (hook);
 
   return Qt;
 }
 
+
 void
 syms_of_abbrev (void)
 {
@@ -272,7 +434,7 @@
   Vabbrev_start_location_buffer = Qnil;
 
   DEFVAR_BOOL ("abbrev-all-caps", &abbrev_all_caps /*
-*Set non-nil means expand multi-word abbrevs all caps if abbrev was so.
+*Non-nil means expand multi-word abbrevs all caps if abbrev was so.
 */ );
   abbrev_all_caps = 0;
 
--- a/src/buffer.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/buffer.c	Mon Aug 13 09:45:46 2007 +0200
@@ -994,7 +994,7 @@
 	  unbind_to (count, Qnil);
 	}
     }
-#endif                          /* CLASH_DETECTION */
+#endif /* CLASH_DETECTION */
 
   /* This is often called when the buffer contents are altered but we
      don't want to treat the changes that way (e.g. selective
@@ -1034,7 +1034,7 @@
        (buffer))
 {
   struct buffer *buf = decode_buffer (buffer, 0);
-
+  
   return make_int (BUF_MODIFF (buf));
 }
 
--- a/src/buffer.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/buffer.h	Mon Aug 13 09:45:46 2007 +0200
@@ -75,142 +75,141 @@
    */
 
 struct buffer_text
-  {
-    Bufbyte *beg;		/* Actual address of buffer contents. */    
-    Bytind gpt;			/* Index of gap in buffer. */
-    Bytind z;			/* Index of end of buffer. */
-    Bufpos bufz;		/* Equivalent as a Bufpos. */
-    int gap_size;		/* Size of buffer's gap */
-    int end_gap_size;		/* Size of buffer's end gap */
-    int modiff;			/* This counts buffer-modification events
-				   for this buffer.  It is incremented for
-				   each such event, and never otherwise
-				   changed.  */
-    int save_modiff;		/* Previous value of modiff, as of last
-				   time buffer visited or saved a file.  */
+{
+  Bufbyte *beg;		/* Actual address of buffer contents. */    
+  Bytind gpt;		/* Index of gap in buffer. */
+  Bytind z;		/* Index of end of buffer. */
+  Bufpos bufz;		/* Equivalent as a Bufpos. */
+  int gap_size;		/* Size of buffer's gap */
+  int end_gap_size;	/* Size of buffer's end gap */
+  long modiff;		/* This counts buffer-modification events
+			   for this buffer.  It is incremented for
+			   each such event, and never otherwise
+			   changed.  */
+  long save_modiff;	/* Previous value of modiff, as of last
+			   time buffer visited or saved a file.  */
 
 #ifdef MULE
-    /* We keep track of a "known" region for very fast access.
-       This information is text-only so it goes here. */
-    Bufpos mule_bufmin, mule_bufmax;
-    Bytind mule_bytmin, mule_bytmax;
-    int mule_shifter, mule_three_p;
+  /* We keep track of a "known" region for very fast access.
+     This information is text-only so it goes here. */
+  Bufpos mule_bufmin, mule_bufmax;
+  Bytind mule_bytmin, mule_bytmax;
+  int mule_shifter, mule_three_p;
 
-    /* And we also cache 16 positions for fairly fast access near those
-       positions. */
-    Bufpos mule_bufpos_cache[16];
-    Bytind mule_bytind_cache[16];
+  /* And we also cache 16 positions for fairly fast access near those
+     positions. */
+  Bufpos mule_bufpos_cache[16];
+  Bytind mule_bytind_cache[16];
 #endif
 
-    /* Change data that goes with the text. */
-    struct buffer_text_change_data *changes;
+  /* Change data that goes with the text. */
+  struct buffer_text_change_data *changes;
 
-  };
+};
 
 struct buffer
-  {
-    struct lcrecord_header header;
+{
+  struct lcrecord_header header;
 
-    /* This structure holds the coordinates of the buffer contents
-       in ordinary buffers.  In indirect buffers, this is not used.  */
-    struct buffer_text own_text;
+  /* This structure holds the coordinates of the buffer contents
+     in ordinary buffers.  In indirect buffers, this is not used.  */
+  struct buffer_text own_text;
 
-    /* This points to the `struct buffer_text' that is used for this buffer.
-       In an ordinary buffer, this is the own_text field above.
-       In an indirect buffer, this is the own_text field of another buffer.  */
-    struct buffer_text *text;
+  /* This points to the `struct buffer_text' that is used for this buffer.
+     In an ordinary buffer, this is the own_text field above.
+     In an indirect buffer, this is the own_text field of another buffer.  */
+  struct buffer_text *text;
 
-    Bytind pt;			/* Position of point in buffer. */
-    Bufpos bufpt;		/* Equivalent as a Bufpos. */
-    Bytind begv;		/* Index of beginning of accessible range. */
-    Bufpos bufbegv;		/* Equivalent as a Bufpos. */
-    Bytind zv;			/* Index of end of accessible range. */
-    Bufpos bufzv;		/* Equivalent as a Bufpos. */
+  Bytind pt;		/* Position of point in buffer. */
+  Bufpos bufpt;		/* Equivalent as a Bufpos. */
+  Bytind begv;		/* Index of beginning of accessible range. */
+  Bufpos bufbegv;	/* Equivalent as a Bufpos. */
+  Bytind zv;		/* Index of end of accessible range. */
+  Bufpos bufzv;		/* Equivalent as a Bufpos. */
 
-    int face_change;		/* This is set when a change in how the text
-				   should be displayed (e.g., font, color)
-				   is made. */
+  int face_change;	/* This is set when a change in how the text should
+			   be displayed (e.g., font, color) is made. */
 
-    /* change data indicating what portion of the text has changed
-       since the last time this was reset.  Used by redisplay.
-       Logically we should keep this with the text structure, but
-       redisplay resets it for each buffer individually and we don't
-       want interference between an indirect buffer and its base
-       buffer. */
-    struct each_buffer_change_data *changes;
+  /* change data indicating what portion of the text has changed
+     since the last time this was reset.  Used by redisplay.
+     Logically we should keep this with the text structure, but
+     redisplay resets it for each buffer individually and we don't
+     want interference between an indirect buffer and its base
+     buffer. */
+  struct each_buffer_change_data *changes;
 
 #ifdef REGION_CACHE_NEEDS_WORK
-    /* If the long line scan cache is enabled (i.e. the buffer-local
-       variable cache-long-line-scans is non-nil), newline_cache
-       points to the newline cache, and width_run_cache points to the
-       width run cache.
+  /* If the long line scan cache is enabled (i.e. the buffer-local
+     variable cache-long-line-scans is non-nil), newline_cache
+     points to the newline cache, and width_run_cache points to the
+     width run cache.
 
-       The newline cache records which stretches of the buffer are
-       known *not* to contain newlines, so that they can be skipped
-       quickly when we search for newlines.
+     The newline cache records which stretches of the buffer are
+     known *not* to contain newlines, so that they can be skipped
+     quickly when we search for newlines.
 
-       The width run cache records which stretches of the buffer are
-       known to contain characters whose widths are all the same.  If
-       the width run cache maps a character to a value > 0, that value is
-       the character's width; if it maps a character to zero, we don't
-       know what its width is.  This allows compute_motion to process
-       such regions very quickly, using algebra instead of inspecting
-       each character.   See also width_table, below.  */
-    struct region_cache *newline_cache;
-    struct region_cache *width_run_cache;
-#endif
+     The width run cache records which stretches of the buffer are
+     known to contain characters whose widths are all the same.  If
+     the width run cache maps a character to a value > 0, that value
+     is the character's width; if it maps a character to zero, we
+     don't know what its width is.  This allows compute_motion to
+     process such regions very quickly, using algebra instead of
+     inspecting each character.  See also width_table, below.  */
+  struct region_cache *newline_cache;
+  struct region_cache *width_run_cache;
+#endif /* REGION_CACHE_NEEDS_WORK */
 
-    /* The markers that refer to this buffer.  This
-       is actually a single marker -- successive elements in its marker
-       `chain' are the other markers referring to this buffer */
-    struct Lisp_Marker *markers;
+  /* The markers that refer to this buffer.  This is actually a single
+     marker -- successive elements in its marker `chain' are the other
+     markers referring to this buffer */
+  struct Lisp_Marker *markers;
 
-    /* The buffer's extent info.  This is its own type, an extent-info
-       object (done this way for ease in marking / finalizing). */
-    Lisp_Object extent_info;
+  /* The buffer's extent info.  This is its own type, an extent-info
+     object (done this way for ease in marking / finalizing). */
+  Lisp_Object extent_info;
 
-    /* ----------------------------------------------------------------- */
-    /* All the stuff above this line is the responsibility of insdel.c,
-       with some help from marker.c and extents.c.
-       All the stuff below this line is the responsibility of buffer.c. */
+  /* ----------------------------------------------------------------- */
+  /* All the stuff above this line is the responsibility of insdel.c,
+     with some help from marker.c and extents.c.
+     All the stuff below this line is the responsibility of buffer.c. */
 
-    /* In an indirect buffer, this points to the base buffer.
-       In an ordinary buffer, it is 0.
-       We DO mark through this slot. */
-    struct buffer *base_buffer;
+  /* In an indirect buffer, this points to the base buffer.
+     In an ordinary buffer, it is 0.
+     We DO mark through this slot. */
+  struct buffer *base_buffer;
 
-    /* List of indirect buffers whose base is this buffer.
-       If we are an indirect buffer, this will be nil.
-       Do NOT mark through this. */
-    Lisp_Object indirect_children;
+  /* List of indirect buffers whose base is this buffer.
+     If we are an indirect buffer, this will be nil.
+     Do NOT mark through this. */
+  Lisp_Object indirect_children;
 
-    /* Flags saying which DEFVAR_PER_BUFFER variables
-       are local to this buffer.  */
-    int local_var_flags;
+  /* Flags saying which DEFVAR_PER_BUFFER variables
+     are local to this buffer.  */
+  int local_var_flags;
 
-    /* Set to the modtime of the visited file when read or written.
-       -1 means visited file was nonexistent.
-       0 means visited file modtime unknown; in no case complain
-       about any mismatch on next save attempt.  */
-    int modtime;
+  /* Set to the modtime of the visited file when read or written.
+     -1 means visited file was nonexistent.
+     0  means visited file modtime unknown; in no case complain
+     about any mismatch on next save attempt.  */
+  int modtime;
 
-    /* the value of text->modiff at the last auto-save.  */
-    int auto_save_modified;
+  /* the value of text->modiff at the last auto-save.  */
+  int auto_save_modified;
 
-    /* The time at which we detected a failure to auto-save,
-       Or -1 if we didn't have a failure.  */
-    int auto_save_failure_time;
+  /* The time at which we detected a failure to auto-save,
+     Or -1 if we didn't have a failure.  */
+  int auto_save_failure_time;
 
-    /* Position in buffer at which display started
-       the last time this buffer was displayed.  */
-    int last_window_start;
+  /* Position in buffer at which display started
+     the last time this buffer was displayed.  */
+  int last_window_start;
 
-    /* Everything from here down must be a Lisp_Object */
+  /* Everything from here down must be a Lisp_Object */
 
 #define MARKED_SLOT(x) Lisp_Object x
 #include "bufslots.h"
 #undef MARKED_SLOT
-  };
+};
 
 DECLARE_LRECORD (buffer, struct buffer);
 #define XBUFFER(x) XRECORD (x, buffer, struct buffer)
@@ -520,8 +519,7 @@
 
 Emchar non_ascii_charptr_emchar (CONST Bufbyte *ptr);
 Bytecount non_ascii_set_charptr_emchar (Bufbyte *ptr, Emchar c);
-Bytecount non_ascii_charptr_copy_char (CONST Bufbyte *ptr,
-				       Bufbyte *ptr2);
+Bytecount non_ascii_charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2);
 
 INLINE Emchar charptr_emchar (CONST Bufbyte *ptr);
 INLINE Emchar
@@ -862,9 +860,6 @@
 
     make_bufpos(buf, bi):
 	Given a Bytind, return the equivalent Bufpos as a Lisp Object.
-
-
-
  */
 
 
@@ -1858,10 +1853,8 @@
 INLINE Emchar
 UPCASE (struct buffer *buf, Emchar ch)
 {
-  if (DOWNCASE_TABLE_OF (buf, ch) == ch)
-    return UPCASE_TABLE_OF (buf, ch);
-  else
-    return ch;
+  return (DOWNCASE_TABLE_OF (buf, ch) == ch) ?
+    UPCASE_TABLE_OF (buf, ch) : ch;
 }
 
 /* Upcase a character known to be not upper case.  */
@@ -1873,7 +1866,7 @@
 #define DOWNCASE(buf, ch) DOWNCASE_TABLE_OF (buf, ch)
 
 
-/* put it here, somewhat arbitrarily ...  its needs to be in *some*
+/* put it here, somewhat arbitrarily ...  it needs to be in *some*
    header file. */
 DECLARE_LRECORD (range_table, struct Lisp_Range_Table);
 
--- a/src/callproc.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/callproc.c	Mon Aug 13 09:45:46 2007 +0200
@@ -455,7 +455,7 @@
 #ifdef WINDOWSNT
     pid = child_setup (filefd, fd1, fd_error, new_argv, current_dir);
 #else  /* not WINDOWSNT */
-    pid = vfork ();
+    pid = fork ();
 
     if (pid == 0)
       {
@@ -496,7 +496,7 @@
     {
       if (fd[0] >= 0)
 	close (fd[0]);
-      report_file_error ("Doing vfork", Qnil);
+      report_file_error ("Doing fork", Qnil);
     }
 
   if (INTP (buffer))
@@ -627,7 +627,7 @@
 
    This function may change environ for the superior process.
    Therefore, the superior process must save and restore the value
-   of environ around the vfork and the call to this function.
+   of environ around the fork and the call to this function.
 
    ENV is the environment for the subprocess.
 
--- a/src/casefiddle.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/casefiddle.c	Mon Aug 13 09:45:46 2007 +0200
@@ -141,7 +141,7 @@
   REGISTER Bufpos i;
   Bufpos start, end;
   REGISTER Emchar c;
-  REGISTER int inword = flag == CASE_DOWN;
+  REGISTER int inword = (flag == CASE_DOWN);
   struct Lisp_Char_Table *syntax_table =
     XCHAR_TABLE (buf->mirror_syntax_table);
   int mccount;
--- a/src/config.h.in	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/config.h.in	Mon Aug 13 09:45:46 2007 +0200
@@ -65,7 +65,9 @@
 /* Used to identify the XEmacs version in stack traces. */
 #undef CANONICAL_VERSION
 
-/* #### This will be removed in 19.15. */
+/* This will be removed in 19.15. */
+/* Hah!  Try 20.3 ... */
+/* Hah!  Try never ... */
 #define LOSING_BYTECODE
 
 /* Does XEmacs support floating-point numbers? */
@@ -248,6 +250,7 @@
 #undef HAVE_STRCASECMP
 #undef HAVE_STRERROR
 #undef HAVE_TZSET
+#undef HAVE_USLEEP
 #undef HAVE_UTIMES
 #undef HAVE_WAITPID
 
--- a/src/device-x.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/device-x.c	Mon Aug 13 09:45:46 2007 +0200
@@ -55,6 +55,9 @@
 Lisp_Object Qx_error; 
 Lisp_Object Qinit_pre_x_win, Qinit_post_x_win;
 
+/* $B@ZJ"(B, n.  Japanese ritual suicide. */
+int x_seppuku_on_epipe;
+
 /* The application class of Emacs. */
 Lisp_Object Vx_emacs_application_class;
 
@@ -650,6 +653,19 @@
   if (d)
     enqueue_magic_eval_event (io_error_delete_device, dev);
 
+  /* CvE, July 16, 1996, XEmacs 19.14 */
+  /* Test for broken pipe error, which indicates X-server has gone down */
+  if (errno == EPIPE && x_seppuku_on_epipe)
+    {
+      /* Most probably X-server has gone down: Avoid infinite loop by just */
+      /* exiting */
+      /* slb:  This sounds really, really dangerous to do by default, so */
+      /* I'm adding a guard to avoid doing this as default behavior */
+      stderr_out( "\n\nXEmacs exiting on broken pipe (errno %d, %s)\n",
+		  errno, strerror(errno));
+      exit(errno);
+    }
+
   return 0;
 }
 
@@ -1438,6 +1454,14 @@
 */ );
   Vx_initial_argv_list = Qnil;
 
+  DEFVAR_BOOL ("x-seppuku-on-epipe", &x_seppuku_on_epipe /*
+When non-nil terminate XEmacs immediately on SIGPIPE from the X server.
+XEmacs doesn't terminate properly on some systems.
+When this variable is non-nil, XEmacs will commit immediate suicide
+when it gets a sigpipe from the X Server.
+*/ );
+  x_seppuku_on_epipe = 0;
+
   Fprovide (Qx);
 
   staticpro (&Vdefault_x_device);
--- a/src/doc.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/doc.c	Mon Aug 13 09:45:46 2007 +0200
@@ -36,31 +36,6 @@
 
 Lisp_Object Vdoc_file_name;
 
-#ifdef VMS
-/* For VMS versions with limited file name syntax,
-   convert the name to something VMS will allow. */
-static void
-munge_doc_file_name (char *name)
-{
-#ifndef VMS4_4
-  /* For VMS versions with limited file name syntax,
-     convert the name to something VMS will allow.  */
-  p = name;
-  while (*p)
-    {
-      if (*p == '-')
-	*p = '_';
-      p++;
-    }
-#endif /* not VMS4_4 */
-#ifdef VMS4_4
-  strcpy (name, sys_translate_unix (name));
-#endif /* VMS4_4 */
-}
-#else /* NOT VMS */
-#define munge_doc_file_name(name)
-#endif /* VMS */
-
 /* Read and return doc string from open file descriptor FD
    at position POSITION.  Does not close the file.  Returns
    string; or if error, returns a cons holding the error
@@ -233,7 +208,6 @@
 	minsize = 12;
       name_nonreloc = (char *) alloca (minsize + XSTRING_LENGTH (file) + 8);
       string_join (name_nonreloc, Vdoc_directory, file);
-      munge_doc_file_name (name_nonreloc);
     }
   else
     name_reloc = file;
@@ -251,7 +225,6 @@
 	     So check in ../lib-src. */
 	  strcpy (name_nonreloc, "../lib-src/");
 	  strcat (name_nonreloc, (char *) XSTRING_DATA (file));
-	  munge_doc_file_name (name_nonreloc);
 
 	  fd = open (name_nonreloc, O_RDONLY, 0);
 	}
@@ -463,22 +436,6 @@
   strcpy (name, (char *) XSTRING_DATA (Vdoc_directory));
 #endif /* CANNOT_DUMP */
   strcat (name, (char *) XSTRING_DATA (filename));
-#ifdef VMS
-#ifndef VMS4_4
-  /* For VMS versions with limited file name syntax,
-     convert the name to something VMS will allow.  */
-  p = name;
-  while (*p)
-    {
-      if (*p == '-')
-	*p = '_';
-      p++;
-    }
-#endif /* not VMS4_4 */
-#ifdef VMS4_4
-  strcpy (name, sys_translate_unix (name));
-#endif /* VMS4_4 */
-#endif /* VMS */
 
   fd = open (name, O_RDONLY, 0);
   if (fd < 0)
--- a/src/emacs.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/emacs.c	Mon Aug 13 09:45:46 2007 +0200
@@ -148,13 +148,6 @@
 
 int noninteractive1;
 
-/* Major & Minor version numbers are needed in temacs as of 20.3 */
-/* Version numbers and strings */
-int emacs_beta_version;
-int emacs_major_version;
-int emacs_minor_version;
-Lisp_Object Vxemacs_codename;
-
 /* Save argv and argc.  */
 char **initial_argv;
 int initial_argc;
@@ -2355,23 +2348,4 @@
 */ );
   emacs_priority = 0;
 
-  DEFVAR_INT ("emacs-major-version", &emacs_major_version /*
-Major version number of this version of Emacs, as an integer.
-Warning, this variable did not exist in Emacs versions earlier than:
-  FSF Emacs:   19.23
-  XEmacs:      19.10
-This variable was not available to temacs prior to:
-  XEmacs:      20.3
-*/ );
-  emacs_major_version = EMACS_MAJOR_VERSION;
-
-  DEFVAR_INT ("emacs-minor-version", &emacs_minor_version /*
-Minor version number of this version of Emacs, as an integer.
-Warning, this variable did not exist in Emacs versions earlier than:
-  FSF Emacs:   19.23
-  XEmacs:      19.10
-This variable was not available to temacs prior to:
-  XEMacs:      20.3
-*/ );
-  emacs_minor_version = EMACS_MINOR_VERSION;
 }
--- a/src/emacsfns.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/emacsfns.h	Mon Aug 13 09:45:46 2007 +0200
@@ -545,7 +545,7 @@
 
 extern Lisp_Object Qsave_buffers_kill_emacs;
 extern Lisp_Object Qkill_emacs_hook;
-
+extern Lisp_Object Frunning_temacs_p();
 
 /* Defined in eval.c */
 extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro;
@@ -1558,6 +1558,7 @@
 extern Lisp_Object Qprint_length, Qprint_string_length;
 void internal_object_printer (Lisp_Object obj, Lisp_Object printcharfun,
 			      int escapeflag);
+extern Lisp_Object Ferror_message_string(Lisp_Object obj);
 
 /* Defined in process.c */
 Lisp_Object Fprocess_send_eof (Lisp_Object process);
--- a/src/eval.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/eval.c	Mon Aug 13 09:45:46 2007 +0200
@@ -477,55 +477,13 @@
    and described by SIGNAL-DATA, should skip the debugger
    according to debugger-ignore-errors.  */
 
-extern Lisp_Object Frunning_temacs_p(), Ferror_message_string(Lisp_Object obj);
-
 static int
 skip_debugger (Lisp_Object conditions, Lisp_Object data)
 {
+  /* This function can GC */
   Lisp_Object tail;
   int first_string = 1;
   Lisp_Object error_message;
-#if 0
-  struct gcpro gcpro1;
-#endif
-
-  /* Comment by Hrvoje Niksic:
-     For some reason, Ferror_message_string loses in temacs.  This
-     should require some more consideration than this knee-jerk
-     solution, but it will do for now.  For those interested in
-     debugging, here is what happens:
-
-     In temacs, a condition-cased file-error occurs.  Now, we enter
-     signal_call_debugger, which is supposed to decide whether we
-     should call debugger (for example, if `debug-on-signal' requires
-     it).  signal_call_debugger calls skip_debugger, which calls
-     Ferror_message_string.  Ferror_message_string in turn calls
-     print_error_message.  For some unfathomable reason, the
-     expression
-
-        errname = Fcar (data);
-
-     fails with a `wrong-type-argument' error, which should not
-     happen, as the DATA argument is the very same Lisp_Object
-     skip_debugger was called with (which is in signal_call_debugger,
-     and the DATA argument is Fcons (FOO, BAR)).
-
-     Of course, since an error is signaled, signal_call_debugger gets
-     called again, which calls skip_debugger, and we end up with a
-     beautiful endless recursion.
-
-     The only explanation I can think of is that DATA should be
-     gc-protected during the way; I cannot test this, as I cannot
-     repeat all of this.  The crash info comes from Steve. */
-#if 0
-  if (!NILP(Frunning_temacs_p()))
-    {
-      return 0;
-    }
-#endif
-#if 0
-  GCPRO1(data);
-#endif
 
   for (tail = Vdebug_ignored_errors; CONSP (tail); tail = XCDR (tail))
     {
@@ -534,33 +492,21 @@
 	  if (first_string)
 	    {
 	      error_message = Ferror_message_string (data);
-/*	      error_message = build_string("Tell_Hrvoje"); */
 	      first_string = 0;
 	    }
-	  if (fast_lisp_string_match (XCAR (tail), error_message) >= 0) {
-#if 0
-	    UNGCPRO;
-#endif
+	  if (fast_lisp_string_match (XCAR (tail), error_message) >= 0)
 	    return 1;
-	  }
 	}
       else
 	{
 	  Lisp_Object contail;
 
           for (contail = conditions; CONSP (contail); contail = XCDR (contail))
-            if (EQ (XCAR (tail), XCAR (contail))) {
-#if 0
-	      UNGCPRO;
-#endif
+            if (EQ (XCAR (tail), XCAR (contail)))
 	      return 1;
-	    }
 	}
     }
 
-#if 0
-  UNGCPRO;
-#endif
   return 0;
 }
 
@@ -610,18 +556,18 @@
   /* This function can GC */
   Lisp_Object val = Qunbound;
   Lisp_Object all_handlers = Vcondition_handlers;
+  Lisp_Object temp_data = Qnil;
   int speccount = specpdl_depth_counter;
-  int skip_debugger_for_error = 0;
-  struct gcpro gcpro1;
-  GCPRO1 (all_handlers);
+  struct gcpro gcpro1, gcpro2;
+  GCPRO2 (all_handlers, temp_data);
 
   Vcondition_handlers = active_handlers;
 
-  skip_debugger_for_error = skip_debugger (conditions, Fcons (sig, data));
+  temp_data = Fcons (sig, data); /* needed for skip_debugger */
 
   if (!entering_debugger && !*stack_trace_displayed && !signal_vars_only
-      && !skip_debugger_for_error
-      && wants_debugger (Vstack_trace_on_error, conditions))
+      && wants_debugger (Vstack_trace_on_error, conditions)
+      && !skip_debugger (conditions, temp_data))
     {
       specbind (Qdebug_on_error, Qnil);
       specbind (Qstack_trace_on_error, Qnil);
@@ -637,10 +583,10 @@
     }
       
   if (!entering_debugger && !*debugger_entered && !signal_vars_only
-      && !skip_debugger_for_error
       && (EQ (sig, Qquit)
 	  ? debug_on_quit
-	  : wants_debugger (Vdebug_on_error, conditions)))
+	  : wants_debugger (Vdebug_on_error, conditions))
+      && !skip_debugger (conditions, temp_data))
     {
       debug_on_quit &= ~2;	/* reset critical bit */
       specbind (Qdebug_on_error, Qnil);
--- a/src/fileio.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/fileio.c	Mon Aug 13 09:45:46 2007 +0200
@@ -3372,10 +3372,12 @@
      to protect the current_buffer from being destroyed, but the
      multiple return points make this a pain in the butt. */
 
+#if 0
 #ifdef DOS_NT
   int buffer_file_type
     = NILP (current_buffer->buffer_file_type) ? O_TEXT : O_BINARY;
 #endif /* DOS_NT */
+#endif
 
 #ifdef MULE
   codesys = Fget_coding_system (codesys);
@@ -3462,7 +3464,7 @@
   if (!NILP (append))
 #ifdef DOS_NT
     desc = open ((char *) XSTRING_DATA (fn),
-                       (O_WRONLY | buffer_file_type), 0);
+                       (O_WRONLY | O_BINARY), 0);
 #else /* not DOS_NT */
     desc = open ((char *) XSTRING_DATA (fn), O_WRONLY, 0);
 #endif /* not DOS_NT */
@@ -3472,7 +3474,7 @@
     {
 #ifdef DOS_NT
       desc = open ((char *) XSTRING_DATA (fn),
-                   (O_WRONLY | O_TRUNC | O_CREAT | buffer_file_type),
+                   (O_WRONLY | O_TRUNC | O_CREAT | O_BINARY),
                    (S_IREAD | S_IWRITE));
 #else /* not DOS_NT */
       desc = creat ((char *) XSTRING_DATA (fn),
@@ -4414,7 +4416,7 @@
 		{
 #ifdef DOS_NT
 		  listdesc = open ((char *) XSTRING_DATA (listfile),
-				   O_WRONLY | O_TRUNC | O_CREAT | O_TEXT,
+				   O_WRONLY | O_TRUNC | O_CREAT | O_BINARY,
 				   S_IREAD | S_IWRITE);
 #else /* not DOS_NT */
 		  listdesc = creat ((char *) XSTRING_DATA (listfile), 0666);
--- a/src/fns.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/fns.c	Mon Aug 13 09:45:46 2007 +0200
@@ -3345,7 +3345,7 @@
   return NILP (Fmemq (feature, Vfeatures)) ? Qnil : Qt;
 }
 #else
-extern int emacs_major_version, emacs_minor_version;
+extern Lisp_Object Vemacs_major_version, Vemacs_minor_version;
 
 DEFUN ("featurep", Ffeaturep, 1, 1, 0, /*
 Return non-nil if feature expression FEXP is true.
@@ -3366,8 +3366,8 @@
 
       if (featurep_emacs_version == 0.0)
 	{
-	  featurep_emacs_version = emacs_major_version +
-	    (emacs_minor_version / 100.0);
+	  featurep_emacs_version = XINT (Vemacs_major_version) +
+	    (XINT (Vemacs_minor_version) / 100.0);
 	}
       return (featurep_emacs_version >= d) ? Qt : Qnil;
     }
@@ -3417,7 +3417,7 @@
       return Fsignal(Qinvalid_read_syntax, list1 (fexp));
     }
 }
-#endif
+#endif /* FEATUREP_SYNTAX */
 
 DEFUN ("provide", Fprovide, 1, 1, 0, /*
 Announce that FEATURE is a feature of the current Emacs.
--- a/src/insdel.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/insdel.c	Mon Aug 13 09:45:46 2007 +0200
@@ -1405,20 +1405,18 @@
 get_buffer_or_string_pos_char (Lisp_Object object, Lisp_Object pos,
 			       unsigned int flags)
 {
-  if (STRINGP (object))
-    return get_string_pos_char (object, pos, flags);
-  else
-    return get_buffer_pos_char (XBUFFER (object), pos, flags);
+  return STRINGP (object) ?
+    get_string_pos_char (object, pos, flags) :
+    get_buffer_pos_char (XBUFFER (object), pos, flags);
 }
 
 Bytind
 get_buffer_or_string_pos_byte (Lisp_Object object, Lisp_Object pos,
 			       unsigned int flags)
 {
-  if (STRINGP (object))
-    return get_string_pos_byte (object, pos, flags);
-  else
-    return get_buffer_pos_byte (XBUFFER (object), pos, flags);
+  return STRINGP (object) ?
+    get_string_pos_byte (object, pos, flags) :
+    get_buffer_pos_byte (XBUFFER (object), pos, flags);
 }
 
 void
@@ -1429,8 +1427,7 @@
   if (STRINGP (object))
     get_string_range_char (object, from, to, from_out, to_out, flags);
   else
-    get_buffer_range_char (XBUFFER (object), from, to, from_out, to_out,
-			   flags);
+    get_buffer_range_char (XBUFFER (object), from, to, from_out, to_out, flags);
 }
 
 void
@@ -1441,72 +1438,59 @@
   if (STRINGP (object))
     get_string_range_byte (object, from, to, from_out, to_out, flags);
   else
-    get_buffer_range_byte (XBUFFER (object), from, to, from_out, to_out,
-			   flags);
+    get_buffer_range_byte (XBUFFER (object), from, to, from_out, to_out, flags);
 }
 
 Bufpos
 buffer_or_string_accessible_begin_char (Lisp_Object object)
 {
-  if (STRINGP (object))
-    return 0;
-  return BUF_BEGV (XBUFFER (object));
+  return STRINGP (object) ? 0 : BUF_BEGV (XBUFFER (object));
 }
 
 Bufpos
 buffer_or_string_accessible_end_char (Lisp_Object object)
 {
-  if (STRINGP (object))
-    return string_char_length (XSTRING (object));
-  return BUF_ZV (XBUFFER (object));
+  return STRINGP (object) ?
+    string_char_length (XSTRING (object)) : BUF_ZV (XBUFFER (object));
 }
 
 Bytind
 buffer_or_string_accessible_begin_byte (Lisp_Object object)
 {
-  if (STRINGP (object))
-    return 0;
-  return BI_BUF_BEGV (XBUFFER (object));
+  return STRINGP (object) ? 0 : BI_BUF_BEGV (XBUFFER (object));
 }
 
 Bytind
 buffer_or_string_accessible_end_byte (Lisp_Object object)
 {
-  if (STRINGP (object))
-    return XSTRING_LENGTH (object);
-  return BI_BUF_ZV (XBUFFER (object));
+  return STRINGP (object) ?
+    XSTRING_LENGTH (object) : BI_BUF_ZV (XBUFFER (object));
 }
 
 Bufpos
 buffer_or_string_absolute_begin_char (Lisp_Object object)
 {
-  if (STRINGP (object))
-    return 0;
-  return BUF_BEG (XBUFFER (object));
+  return STRINGP (object) ? 0 : BUF_BEG (XBUFFER (object));
 }
 
 Bufpos
 buffer_or_string_absolute_end_char (Lisp_Object object)
 {
-  if (STRINGP (object))
-    return string_char_length (XSTRING (object));
-  return BUF_Z (XBUFFER (object));
+  return STRINGP (object) ?
+    string_char_length (XSTRING (object)) : BUF_Z (XBUFFER (object));
 }
 
 Bytind
 buffer_or_string_absolute_begin_byte (Lisp_Object object)
 {
-  if (STRINGP (object))
-    return 0;
-  return BI_BUF_BEG (XBUFFER (object));
+  return STRINGP (object) ? 0 : BI_BUF_BEG (XBUFFER (object));
 }
 
 Bytind
 buffer_or_string_absolute_end_byte (Lisp_Object object)
 {
-  if (STRINGP (object))
-    return XSTRING_LENGTH (object);
-  return BI_BUF_Z (XBUFFER (object));
+  return STRINGP (object) ?
+    XSTRING_LENGTH (object) : BI_BUF_Z (XBUFFER (object));
 }
 
 
@@ -2326,9 +2310,6 @@
 #endif
 
   buf->point_before_scroll = Qnil;
-
-  /* BUF_MODIFF (buf)++; -- should be done by callers (insert, delete range)
-     else record_first_change isn't called */
 }
 
 
--- a/src/m/convex.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/m/convex.h	Mon Aug 13 09:45:46 2007 +0200
@@ -145,9 +145,6 @@
 /* Avoid error in xrdb.c - d.m.cooke@larc.nasa.gov.  */
 #define DECLARE_GETPWUID_WITH_UID_T
 
-/* Call getpgrp properly.  */
-#define GETPGRP_NO_ARG
-
 /* Tested for both Convex C and GNUC by d.m.cooke@larc.nasa.gov.  */
 #define LIBS_MACHINE "-lC2"
 
--- a/src/m/dpx2.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/m/dpx2.h	Mon Aug 13 09:45:46 2007 +0200
@@ -153,11 +153,6 @@
 # undef USG_JOBCTRL
 #endif
 
-/*
- * but we have that
-*/
-#define GETPGRP_NO_ARG
-
 /* select also needs this header file--but not in ymakefile.  */
 #ifndef NOT_C_CODE
 #include <sys/types.h>
--- a/src/mule-charset.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/mule-charset.c	Mon Aug 13 09:45:46 2007 +0200
@@ -1241,7 +1241,7 @@
     make_charset (Qascii, LEADING_BYTE_ASCII, 1,
 		  CHARSET_TYPE_94, 1, 0, 'B',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("ASCII"),
+		  build_string ("ASCII (ISO 646 IRV)"),
 		  build_string ("iso8859-1"));
   Vcharset_control_1 =
     make_charset (Qcontrol_1, LEADING_BYTE_CONTROL_1, 2,
@@ -1253,61 +1253,61 @@
     make_charset (Qlatin_iso8859_1, LEADING_BYTE_LATIN_ISO8859_1, 2,
 		  CHARSET_TYPE_96, 1, 1, 'A',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-1"),
+		  build_string ("ISO 8859-1 (Latin-1)"),
 		  build_string ("iso8859-1"));
   Vcharset_latin_iso8859_2 =
     make_charset (Qlatin_iso8859_2, LEADING_BYTE_LATIN_ISO8859_2, 2,
 		  CHARSET_TYPE_96, 1, 1, 'B',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-2"),
+		  build_string ("ISO 8859-2 (Latin-2)"),
 		  build_string ("iso8859-2"));
   Vcharset_latin_iso8859_3 =
     make_charset (Qlatin_iso8859_3, LEADING_BYTE_LATIN_ISO8859_3, 2,
 		  CHARSET_TYPE_96, 1, 1, 'C',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-3"),
+		  build_string ("ISO 8859-3 (Latin-3)"),
 		  build_string ("iso8859-3"));
   Vcharset_latin_iso8859_4 =
     make_charset (Qlatin_iso8859_4, LEADING_BYTE_LATIN_ISO8859_4, 2,
 		  CHARSET_TYPE_96, 1, 1, 'D',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-4"),
+		  build_string ("ISO 8859-4 (Latin-4)"),
 		  build_string ("iso8859-4"));
   Vcharset_cyrillic_iso8859_5 =
     make_charset (Qcyrillic_iso8859_5, LEADING_BYTE_CYRILLIC_ISO8859_5, 2,
 		  CHARSET_TYPE_96, 1, 1, 'L',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Cyrillic"),
+		  build_string ("ISO 8859-5 (Cyrillic)"),
 		  build_string ("iso8859-5"));
   Vcharset_arabic_iso8859_6 =
     make_charset (Qarabic_iso8859_6, LEADING_BYTE_ARABIC_ISO8859_6, 2,
 		  CHARSET_TYPE_96, 1, 1, 'G',
 		  CHARSET_RIGHT_TO_LEFT,
-		  build_string ("Arabic"),
+		  build_string ("ISO 8859-6 (Arabic)"),
 		  build_string ("iso8859-6"));
   Vcharset_greek_iso8859_7 =
     make_charset (Qgreek_iso8859_7, LEADING_BYTE_GREEK_ISO8859_7, 2,
 		  CHARSET_TYPE_96, 1, 1, 'F',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Greek"),
+		  build_string ("ISO 8859-7 (Greek)"),
 		  build_string ("iso8859-7"));
   Vcharset_hebrew_iso8859_8 =
     make_charset (Qhebrew_iso8859_8, LEADING_BYTE_HEBREW_ISO8859_8, 2,
 		  CHARSET_TYPE_96, 1, 1, 'H',
 		  CHARSET_RIGHT_TO_LEFT,
-		  build_string ("Hebrew"),
+		  build_string ("ISO 8859-8 (Hebrew)"),
 		  build_string ("iso8859-8"));
   Vcharset_latin_iso8859_9 =
     make_charset (Qlatin_iso8859_9, LEADING_BYTE_LATIN_ISO8859_9, 2,
 		  CHARSET_TYPE_96, 1, 1, 'M',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-5"),
+		  build_string ("ISO 8859-9 (Latin-5)"),
 		  build_string ("iso8859-9"));
   Vcharset_thai_tis620 =
     make_charset (Qthai_tis620, LEADING_BYTE_THAI_TIS620, 2,
 		  CHARSET_TYPE_96, 1, 1, 'T',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Thai"),
+		  build_string ("TIS 620.2529 (Thai)"),
 		  build_string ("tis620"));
 
   /* Japanese */
@@ -1316,35 +1316,36 @@
 		  LEADING_BYTE_KATAKANA_JISX0201, 2,
 		  CHARSET_TYPE_94, 1, 1, 'I',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Japanese Katakana"),
+		  build_string ("JIS X0201-Katakana"),
 		  build_string ("jisx0201.1976"));
   Vcharset_latin_jisx0201 =
     make_charset (Qlatin_jisx0201,
 		  LEADING_BYTE_LATIN_JISX0201, 2,
 		  CHARSET_TYPE_94, 1, 0, 'J',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Japanese Roman"),
+		  build_string ("JIS X0201-Latin"),
 		  build_string ("jisx0201.1976"));
   Vcharset_japanese_jisx0208_1978 =
     make_charset (Qjapanese_jisx0208_1978,
 		  LEADING_BYTE_JAPANESE_JISX0208_1978, 3,
 		  CHARSET_TYPE_94X94, 2, 0, '@',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Japanese Old"),
+		  build_string
+		  ("JIS X0208-1978 (Japanese Kanji; Old Version)"),
 		  build_string ("\\(jisx0208\\|jisc6226\\).19"));
   Vcharset_japanese_jisx0208 =
     make_charset (Qjapanese_jisx0208,
 		  LEADING_BYTE_JAPANESE_JISX0208, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'B',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Japanese"),
+		  build_string ("JIS X0208-1983 (Japanese Kanji)"),
 		  build_string ("jisx0208.19\\(83\\|90\\)"));
   Vcharset_japanese_jisx0212 =
     make_charset (Qjapanese_jisx0212,
 		  LEADING_BYTE_JAPANESE_JISX0212, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'D',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Japanese Supplement"),
+		  build_string ("JIS X0212 (Japanese Supplement)"),
 		  build_string ("jisx0212"));
 
   /* Chinese */
@@ -1352,7 +1353,7 @@
     make_charset (Qchinese_gb2312, LEADING_BYTE_CHINESE_GB2312, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'A',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Chinese GB2312"),
+		  build_string ("GB 2312 (Simplified Chinese)"),
 		  build_string ("gb2312"));
 #define CHINESE_CNS_PLANE_RE(n) "cns11643[.-]\\(.*[.-]\\)?" n "$"
   Vcharset_chinese_cns11643_1 =
@@ -1360,33 +1361,37 @@
 		  LEADING_BYTE_CHINESE_CNS11643_1, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'G',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Chinese CNS Plane 1"),
+		  build_string
+		  ("CNS 11643 Plane 1 (Traditional Chinese for daily use)"),
 		  build_string (CHINESE_CNS_PLANE_RE("1")));
   Vcharset_chinese_cns11643_2 =
     make_charset (Qchinese_cns11643_2,
 		  LEADING_BYTE_CHINESE_CNS11643_2, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'H',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Chinese CNS Plane 2"),
+		  build_string
+		  ("CNS 11643 Plane 2 (Traditional Chinese for daily use)"),
 		  build_string (CHINESE_CNS_PLANE_RE("2")));
   Vcharset_chinese_big5_1 =
     make_charset (Qchinese_big5_1, LEADING_BYTE_CHINESE_BIG5_1, 3,
 		  CHARSET_TYPE_94X94, 2, 0, '0',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Chinese Big5 Level 1"),
+		  build_string
+		  ("Big5 Level 1 (Traditional Chinese for daily use)"),
 		  build_string ("big5"));
   Vcharset_chinese_big5_2 =
     make_charset (Qchinese_big5_2, LEADING_BYTE_CHINESE_BIG5_2, 3,
 		  CHARSET_TYPE_94X94, 2, 0, '1',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Chinese Big5 Level 2"),
+		  build_string
+		  ("Big5 Level 2 (Traditional Chinese for daily use)"),
 		  build_string ("big5"));
 
   Vcharset_korean_ksc5601 =
     make_charset (Qkorean_ksc5601, LEADING_BYTE_KOREAN_KSC5601, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'C',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Korean"),
+		  build_string ("KS C5601 (Hangul and Korean Hanja)"),
 		  build_string ("ksc5601"));
   /* #### For simplicity, we put composite chars into a 96x96 charset.
      This is going to lead to problems because you can run out of
--- a/src/print.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/print.c	Mon Aug 13 09:45:46 2007 +0200
@@ -597,22 +597,20 @@
 DEFUN ("error-message-string", Ferror_message_string, 1, 1, 0, /*
 Convert an error value (ERROR-SYMBOL . DATA) to an error message.
 */
-  (obj))
+  (data))
 {
-  struct buffer *old = XBUFFER(Fcurrent_buffer());
+  struct buffer *pbuf;
   Lisp_Object original, printcharfun, value;
   struct gcpro gcpro1;
 
-  print_error_message (obj, Vprin1_to_string_buffer);
+  print_error_message (data, Vprin1_to_string_buffer);
 
-  set_buffer_internal (XBUFFER (Vprin1_to_string_buffer));
-  value = Fbuffer_substring (Fpoint_min(Fcurrent_buffer()),
-			     Fpoint_max(Fcurrent_buffer()),
-			     Fcurrent_buffer());
-
+  pbuf = XBUFFER (Vprin1_to_string_buffer);
+  value = make_string_from_buffer (pbuf,
+				   BUF_BEGV (pbuf),
+				   BUF_ZV (pbuf) - BUF_BEGV (pbuf));
   GCPRO1 (value);
-  Ferase_buffer (Fcurrent_buffer());
-  set_buffer_internal (old);
+  Ferase_buffer (Vprin1_to_string_buffer);
   UNGCPRO;
 
   return value;
--- a/src/process.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/process.c	Mon Aug 13 09:45:46 2007 +0200
@@ -889,7 +889,7 @@
 #endif
 
 #ifndef WINDOWSNT
-    pid = vfork ();
+    pid = fork ();
     if (pid == 0)
 #endif /* not WINDOWSNT */
       {
@@ -1038,7 +1038,7 @@
   if (pid < 0)
     {
       close_descriptor_pair (forkin, forkout);
-      report_file_error ("Doing vfork", Qnil);
+      report_file_error ("Doing fork", Qnil);
     }
 
   p->pid = make_int (pid);
--- a/src/s/bsd386.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/bsd386.h	Mon Aug 13 09:45:46 2007 +0200
@@ -34,5 +34,3 @@
 #undef BSD
 #include <sys/param.h> /* To get BSD defined consistently.  */
 #endif
-  
-#define GETPGRP_NO_ARG 1
--- a/src/s/decosf1-2.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/decosf1-2.h	Mon Aug 13 09:45:46 2007 +0200
@@ -22,7 +22,6 @@
 #endif 
 #define LIBS_SYSTEM	"-lbsd"
 #define SYSTEM_MALLOC
-#define GETPGRP_NO_ARG
 
 /* This to get rid of the -X that ymakefile inserts */
 #undef LD_SWITCH_SYSTEM
--- a/src/s/freebsd.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/freebsd.h	Mon Aug 13 09:45:46 2007 +0200
@@ -36,13 +36,17 @@
 #define LIBS_TERMCAP "-ltermcap"
 #define LIB_GCC "-lgcc"
 
-/* freebsd has POSIX-style pgrp behavior. */
-#define GETPGRP_NO_ARG
+#ifndef NO_SHARED_LIBS
+#if 0 /* mrb */
+#define LD_SWITCH_SYSTEM "-dc -dp -e start"
+#define START_FILES "pre-crt0.o /usr/lib/crt0.o"
+#else /* mrb */
+#define ORDINARY_LINK
+#undef LD_SWITCH_SYSTEM
+#undef START_FILES
+#endif /* mrb */
 
-#ifndef NO_SHARED_LIBS
-#define LD_SWITCH_SYSTEM "-dc -dp -e start"
 #define HAVE_TEXT_START		/* No need to define `start_of_text'. */
-#define START_FILES "pre-crt0.o /usr/lib/crt0.o"
 #define UNEXEC "unexfreebsd.o"
 #define RUN_TIME_REMAP
 
--- a/src/s/gnu.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/gnu.h	Mon Aug 13 09:45:46 2007 +0200
@@ -42,8 +42,6 @@
 #define TABDLY OXTABS
 #define TAB3 OXTABS
 
-#define GETPGRP_NO_ARG
-
 /* GNU needs its own crt0, and libc defines data_start.  */
 #define ORDINARY_LINK
 #define DATA_START ({ extern int data_start; (char *) &data_start; })
--- a/src/s/irix5-0.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/irix5-0.h	Mon Aug 13 09:45:46 2007 +0200
@@ -71,9 +71,6 @@
    on this system, so inhibit use of matherr.  */
 #define NO_MATHERR
 
-/* Info from simon@lia.di.epfl.ch (Simon Leinen) suggests this is needed.  */
-#define GETPGRP_NO_ARG
-
 /* Ulimit(UL_GMEMLIM) is busted...  */
 #define ULIMIT_BREAK_VALUE 0x14000000
 
--- a/src/s/netbsd.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/netbsd.h	Mon Aug 13 09:45:46 2007 +0200
@@ -40,9 +40,7 @@
 
 #define NEED_ERRNO
 
-#define GETPGRP_NO_ARG
-
-#if 0
+#if 0 /* mrb */
 #ifndef NO_SHARED_LIBS
 /* These definitions should work for either dynamic or static linking,
    whichever is the default for `cc -nostdlib'.  */
@@ -56,7 +54,7 @@
 #define START_FILES "crt0.o"
 
 #endif /* not NO_SHARED_LIBS */
-#endif /* 0 */
+#endif /* 0 - mrb */
 
 #define HAVE_TEXT_START		/* No need to define `start_of_text'.  */
 #define ORDINARY_LINK
--- a/src/s/osf1.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/osf1.h	Mon Aug 13 09:45:46 2007 +0200
@@ -12,8 +12,6 @@
 #define C_SWITCH_SYSTEM	"-D_BSD"
 #define LIBS_SYSTEM	"-lbsd"
 
-#define GETPGRP_NO_ARG
-
 #define INTERRUPTIBLE_OPEN
 #define INTERRUPTIBLE_CLOSE
 #define INTERRUPTIBLE_IO
--- a/src/s/riscos5.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/riscos5.h	Mon Aug 13 09:45:46 2007 +0200
@@ -9,5 +9,3 @@
 extern double atof ();
 
 #define LD_SWITCH_SYSTEM "-non_shared"
-
-#define GETPGRP_NO_ARG
--- a/src/s/sol2.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/sol2.h	Mon Aug 13 09:45:46 2007 +0200
@@ -19,9 +19,11 @@
 #define _POSIX_C_SOURCE 199506L
 #endif
 #undef  _XOPEN_SOURCE
+#undef  _XOPEN_SOURCE_EXTENDED
+#if OS_RELEASE >= 55
 #define _XOPEN_SOURCE 1
-#undef  _XOPEN_SOURCE_EXTENDED
 #define _XOPEN_SOURCE_EXTENDED 1
+#endif /* >= SunOS 5.5 */
 #endif
 
 #if 1 /* mrb */
@@ -98,15 +100,16 @@
 #endif /* SunOS 5.5 */
 
 #if OS_RELEASE < 55
-/* Another missing prototype, added in Solaris 2.5 */
+/* Missing prototype, added in Solaris 2.5 */
 extern void *__builtin_alloca(size_t);
 #endif /* before SunOS 5.5 */
 
 #if OS_RELEASE < 56
-/* XEmacs: Solaris include files miss this. */
+/* Missing prototypes, added in Solaris 2.6 */
 struct timeval;
 int utimes (char *file, struct timeval *tvp);
-extern int gethostname(char *, unsigned);
+int gethostname(char *name, int namelen);
+int usleep(unsigned int useconds);
 #endif /* before SunOS 5.6 */
 
 #include <sys/utsname.h> /* warning: macro redefined: SYS_NMLN */
--- a/src/s/sunos4-0.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/sunos4-0.h	Mon Aug 13 09:45:46 2007 +0200
@@ -11,11 +11,6 @@
 #define SUNOS4
 #endif
 
-/* XEmacs addition: */
-#ifndef HAVE_SYS_TIME_H
-#define HAVE_SYS_TIME_H
-#endif
-
 #if 0  /* This may have been needed for an earlier version of Sun OS 4.
 	  It seems to cause warnings in 4.0.3 and 4.1.  */
 #define O_NDELAY        FNDELAY /* Non-blocking I/O (4.2 style) */
@@ -41,11 +36,6 @@
 #define TEXT_START 0
 #define DATA_START 0
 
-/* XEmacs change -- Sun CC needs this to default to ANSI */
-#if __SUNPRO_C
-#define C_SWITCH_SYSTEM "-Xa"
-#endif
-
 /* #### XEmacs: #define of SYSTEM_MALLOC removed.  Is this OK?  FSF says:
 
    In SunOS 4.1, a static function called by tzsetwall reportedly
@@ -70,7 +60,7 @@
 extern void tzsetwall (void);
 extern int getpagesize (void);
 
-#ifndef __SUNPRO_C
+#ifdef __SUNPRO_C
 /* Suppress zillions of warnings from outdated SunOS4 prototypes */
 /* Bother! Sun can't even get the arg types right. */
 #include <memory.h>
@@ -84,7 +74,7 @@
 #include <X11/Xlib.h>
 #define XFree(p) XFree((char*)(p))
 #endif /* X Windows */
-#endif /* !__SUNPRO_C */
+#endif /* __SUNPRO_C */
 
 #endif /* __STDC__ */
 
--- a/src/s/windowsnt.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/s/windowsnt.h	Mon Aug 13 09:45:46 2007 +0200
@@ -247,6 +247,7 @@
 #define rindex    strrchr
 #define read	  _read
 #define write	  _write
+#define getcwd    _getcwd
 
 #ifdef HAVE_NTGUI
 #define abort	win32_abort
--- a/src/symbols.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/symbols.c	Mon Aug 13 09:45:46 2007 +0200
@@ -625,7 +625,7 @@
 }
 
 DEFUN ("fset", Ffset, 2, 2, 0, /*
-Set SYMBOL's function definition to NEWVAL, and return NEWVAL.
+Set SYMBOL's function definition to NEWDEF, and return NEWDEF.
 */
        (sym, newdef))
 {
@@ -648,7 +648,7 @@
 
 /* FSFmacs */
 DEFUN ("define-function", Fdefine_function, 2, 2, 0, /*
-Set SYMBOL's function definition to NEWVAL, and return NEWVAL.
+Set SYMBOL's function definition to NEWDEF, and return NEWDEF.
 Associates the function with the current load file, if any.
 */
        (sym, newdef))
@@ -662,11 +662,17 @@
 
 
 DEFUN ("setplist", Fsetplist, 2, 2, 0, /*
-Set SYMBOL's property list to NEWVAL, and return NEWVAL.
+Set SYMBOL's property list to NEWPLIST, and return NEWPLIST.
 */
        (sym, newplist))
 {
   CHECK_SYMBOL (sym);
+#if 0 /* Inserted for debugging 6/28/1997 -slb */
+  /* Somebody is setting a property list of integer 0, who? */
+  /* Not this way apparently. */
+  if (EQ(newplist, Qzero)) abort();
+#endif
+
   XSYMBOL (sym)->plist = newplist;
   return newplist;
 }
@@ -1918,8 +1924,8 @@
 }
 
 DEFUN ("setq-default", Fsetq_default, 2, UNEVALLED, 0, /*
-Set the default value of variable VAR to VALUE.
-VAR, the variable name, is literal (not evaluated);
+Set the default value of variable SYN to VALUE.
+SYM, the variable name, is literal (not evaluated);
 VALUE is an expression and it is evaluated.
 The default value of a variable is seen in buffers
 that do not have their own values for the variable.
--- a/src/systty.h	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/systty.h	Mon Aug 13 09:45:46 2007 +0200
@@ -344,32 +344,6 @@
 
 /* EMACS_GETPGRP (arg) returns the process group of the terminal.  */
 
-/* USG systems have always used the no-arg form of getpgrp().
-   POSIX also calls for this, and thus some newer BSD systems
-   have this change.  Older BSD systems have an argument.
-   It would be nice to autodetect this, but there's unfortunately
-   no general way. */
-
-/* The above comment is crap, because AC_FUNC_GETPGRP provides just
-   such a way - mrb. */
-
-#if 0 /* mrb */
-/* XEmacs backwards-compatibility */
-#ifdef GETPGRP_NEEDS_ARG
-# undef GETPGRP_NO_ARG
-#else
-# ifdef GETPGRP_NO_ARG
-#  undef GETPGRP_NEEDS_ARG
-# endif
-#endif
-
-#if defined (USG) && !defined (GETPGRP_NEEDS_ARG)
-#  if !defined (GETPGRP_NO_ARG)
-#    define GETPGRP_NO_ARG
-#  endif
-#endif
-#endif /* 0 */
-
 #ifdef GETPGRP_VOID
 #define EMACS_GETPGRP(x) getpgrp()
 #else
--- a/src/undo.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/undo.c	Mon Aug 13 09:45:46 2007 +0200
@@ -206,19 +206,23 @@
 void
 record_extent (Lisp_Object extent, int attached)
 {
-  Lisp_Object buffer = Fextent_object (extent);
-  struct buffer *b = XBUFFER (buffer); /* !!#### */
-  Lisp_Object token;
-
-  if (!undo_prelude (b, 1))
-    return;
+  Lisp_Object obj = Fextent_object (extent);
 
-  if (attached)
-    token = extent;
+  if (BUFFERP (obj))
+    {
+      Lisp_Object token;
+      struct buffer *b = XBUFFER (obj);
+      if (!undo_prelude (b, 1))
+	return;
+      if (attached)
+	token = extent;
+      else
+	token = list3 (extent, Fextent_start_position (extent),
+		       Fextent_end_position (extent));
+      b->undo_list = Fcons (token, b->undo_list);
+    }
   else
-    token = list3 (extent, Fextent_start_position (extent),
-		   Fextent_end_position (extent));
-  b->undo_list = Fcons (token, b->undo_list);
+    return;
 }
 
 #if 0 /* FSFmacs */
--- a/src/unexelfsgi.c	Mon Aug 13 09:44:44 2007 +0200
+++ b/src/unexelfsgi.c	Mon Aug 13 09:45:46 2007 +0200
@@ -626,13 +626,14 @@
   char *old_section_names;
 
   l_Elf_Addr old_bss_addr, new_bss_addr;
+  l_Elf_Addr old_base_addr;
   l_Elf_Word old_bss_size, new_data2_size;
-  l_Elf_Off  new_data2_offset;
+  l_Elf_Off  new_data2_offset, new_base_offset;
   l_Elf_Addr new_data2_addr;
   l_Elf_Addr new_offsets_shift;
 
   int n, nn, old_bss_index, old_data_index, new_data2_index;
-  int old_mdebug_index;
+  int old_mdebug_index, old_sbss_index;
   struct stat stat_buf;
 
   /* Open the old file & map it into the address space.  */
@@ -668,6 +669,11 @@
   old_mdebug_index = find_section (".mdebug", old_section_names,
 				   old_name, old_file_h, old_section_h, 1);
 
+  /* Find the .sbss section, if any.  */
+
+  old_sbss_index = find_section (".sbss", old_section_names,
+				 old_name, old_file_h, old_section_h, 1);
+
   /* Find the old .bss section. */
 
   old_bss_index = find_section (".bss", old_section_names,
@@ -681,6 +687,7 @@
 
   old_bss_addr	    = OLD_SECTION_H (old_bss_index).sh_addr;
   old_bss_size	    = OLD_SECTION_H (old_bss_index).sh_size;
+  old_base_addr     = old_sbss_index == -1 ? old_bss_addr : OLD_SECTION_H (old_sbss_index).sh_addr;
 #if defined(emacs) || !defined(DEBUG)
   bss_end	    = (uintptr_t) sbrk (0);
   new_bss_addr	    = (l_Elf_Addr) bss_end;
@@ -691,13 +698,16 @@
   new_data2_size    = new_bss_addr - old_bss_addr;
   new_data2_offset  = OLD_SECTION_H (old_data_index).sh_offset +
     (new_data2_addr - OLD_SECTION_H (old_data_index).sh_addr);
+  new_base_offset  = OLD_SECTION_H (old_data_index).sh_offset +
+    (old_base_addr - OLD_SECTION_H (old_data_index).sh_addr);
   new_offsets_shift = new_bss_addr -
-    ((old_bss_addr & ~0xfff) + ((old_bss_addr & 0xfff) ? 0x1000 : 0));
+    ((old_base_addr & ~0xfff) + ((old_base_addr & 0xfff) ? 0x1000 : 0));
 
 #ifdef DEBUG
   fprintf (stderr, "old_bss_index %d\n", old_bss_index);
   fprintf (stderr, "old_bss_addr %x\n", old_bss_addr);
   fprintf (stderr, "old_bss_size %x\n", old_bss_size);
+  fprintf (stderr, "old_base_addr %x\n", old_base_addr);
   fprintf (stderr, "new_bss_addr %x\n", new_bss_addr);
   fprintf (stderr, "new_data2_addr %x\n", new_data2_addr);
   fprintf (stderr, "new_data2_size %x\n", new_data2_size);
@@ -774,7 +784,7 @@
 
       /* Supposedly this condition is okay for the SGI.  */
 #if 0
-      if (NEW_PROGRAM_H (n).p_vaddr + NEW_PROGRAM_H (n).p_filesz > old_bss_addr)
+      if (NEW_PROGRAM_H (n).p_vaddr + NEW_PROGRAM_H (n).p_filesz > old_base_addr)
 	fatal ("Program segment above .bss in %s\n", old_name, 0);
 #endif
 
@@ -782,11 +792,12 @@
 	  && (round_up ((NEW_PROGRAM_H (n)).p_vaddr
 			+ (NEW_PROGRAM_H (n)).p_filesz,
 			alignment)
-	      == round_up (old_bss_addr, alignment)))
+	      == round_up (old_base_addr, alignment)))
 	break;
     }
   if (n < 0)
-    fatal ("Couldn't find segment next to .bss in %s\n", old_name, 0);
+    fatal ("Couldn't find segment next to %s in %s\n",
+	   old_sbss_index == -1 ? ".sbss" : ".bss", old_name, 0);
 
   NEW_PROGRAM_H (n).p_filesz += new_offsets_shift;
   NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz;
@@ -870,7 +881,7 @@
       /* Any section that was original placed AFTER the bss
 	 section must now be adjusted by NEW_OFFSETS_SHIFT.  */
 
-      if (NEW_SECTION_H (nn).sh_offset >= new_data2_offset)
+      if (NEW_SECTION_H (nn).sh_offset >= new_base_offset)
 	NEW_SECTION_H (nn).sh_offset += new_offsets_shift;
       
       /* If any section hdr refers to the section after the new .data
@@ -897,7 +908,7 @@
 	  || NEW_SECTION_H (nn).sh_type == SHT_NOBITS)
 	continue;
       
-      /* Write out the sections. .data, .data1 nad .sbss (and data2, called
+      /* Write out the sections. .data, .data1 and .sbss (and data2, called
 	 ".data" in the strings table) get copied from the current process
 	 instead of the old file.  */
       if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data")
--- a/version.sh	Mon Aug 13 09:44:44 2007 +0200
+++ b/version.sh	Mon Aug 13 09:45:46 2007 +0200
@@ -1,5 +1,5 @@
 #!/bin/sh
 emacs_major_version=20
 emacs_minor_version=3
-emacs_beta_version=9
-xemacs_codename="Sofia"
+emacs_beta_version=10
+xemacs_codename="Athens"