changeset 193:f53b5ca2e663 r20-3b23

Import from CVS: tag r20-3b23
author cvs
date Mon, 13 Aug 2007 09:58:30 +0200
parents 9d35321dd38c
children 2947057885e5
files CHANGES-beta ChangeLog Makefile.in configure configure.in dynodump/Makefile.in.in etc/NEWS info/dir lib-src/Makefile.in.in lib-src/srcdir-symlink.stamp lisp/ChangeLog lisp/cl/auto-autoloads.el lisp/cl/cl-macs.el lisp/cl/cl.el lisp/custom/ChangeLog lisp/custom/cus-edit.el lisp/custom/cus-face.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/efs/Makefile lisp/hyperbole/ChangeLog lisp/hyperbole/Makefile lisp/modes/cperl-mode.el lisp/modes/lazy-shot.el lisp/modes/outl-mouse.el lisp/oobr/ChangeLog lisp/oobr/Makefile lisp/packages/compile.el lisp/packages/etags.el lisp/packages/font-lock.el lisp/packages/gnuserv.el lisp/packages/info.el lisp/packages/lazy-lock.el lisp/packages/man.el lisp/prim/faces.el lisp/prim/files.el lisp/prim/help.el lisp/prim/isearch-mode.el lisp/prim/make-docfile.el lisp/prim/novice.el lisp/prim/process.el lisp/prim/simple.el lisp/utils/auto-autoloads.el lisp/utils/autoload.el lisp/utils/redo.el lisp/utils/shadow.el lisp/w3/Makefile lisp/x11/x-menubar.el lisp/x11/x-win-sun.el lwlib/Makefile.in.in lwlib/xlwmenu.c man/ChangeLog man/Makefile man/gnats/Makefile man/internals/Makefile man/internals/internals.texi man/lispref/Makefile man/new-users-guide/Makefile man/tm/Makefile man/widget.texi man/xemacs/Makefile pkg-src/tree-x/Makefile.in.in src/ChangeLog src/Makefile.in.in src/device-x.c src/redisplay-tty.c version.sh
diffstat 69 files changed, 3804 insertions(+), 2225 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 09:57:40 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 09:58:30 2007 +0200
@@ -1,4 +1,14 @@
 							-*- indented-text -*-
+to 20.3 beta23 "Sarajevo"
+-- Other new and older Hrvoje Niksic patches
+-- 20.1 synching by Hrvoje Niksic
+-- gnuserv.el-3.10 courtesy of Hrvoje Niksic
+-- custom-1.9960
+-- Build changes to info tree
+-- cperl-mode.el-1.35-1 (XEmacs conversion by Karl Hegbloom)
+-- shadow.el -- imported from Emacs 20.1
+-- Miscellaneous bug fixes
+
 to 20.3 beta22 "Minsk"
 -- Miscellaneous (small) bug fixes
 -- Autoloads regenerated from scratch
--- a/ChangeLog	Mon Aug 13 09:57:40 2007 +0200
+++ b/ChangeLog	Mon Aug 13 09:58:30 2007 +0200
@@ -1,3 +1,31 @@
+1997-09-20  SL Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.3-beta23 is released.
+
+1997-09-19  SL Baur <steve@altair.xemacs.org>
+
+	* XEmacs 19.16-pre3 is released.
+
+1997-09-18  Colin Rafferty  <craffert@ml.com>
+
+	* etc/NEWS: Various spelling corrections and some grammar
+		  corrections (which/that).
+
+1997-09-19  Martin Buchholz  <mrb@eng.sun.com>
+
+	* src/redisplay-tty.c: Fix crashes with non-7bit tty escape
+	sequences (needs more testing).
+	* */Makefile*: 
+	- Cleanup man/*/Makefile for consistency.
+	- use $(MAKEFINFO), $(TEXI2DVI), etc...
+	- Make combination --with-srcdir + Sun make work properly.
+	- Change construct: test -d $${dir} || mkdir $${dir} 
+	   --> if test ! -d $${dir}; then mkdir $${dir}; fi
+	* lisp/x11/x-win-sun.el: Fix remaining glitches with
+	re-mappings of Sun function keys.
+	* configure.in: Detect libXaw AFTER libXpm to support libXawXpm.
+	* man/internals/internals.texi:  Fix makeinfo compilation error.
+
 1997-09-17  SL Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.3-beta22 is released.
--- a/Makefile.in	Mon Aug 13 09:57:40 2007 +0200
+++ b/Makefile.in	Mon Aug 13 09:58:30 2007 +0200
@@ -392,7 +392,9 @@
 	   shift ; \
 	 done
 	-set ${COPYDESTS} ; \
-	 for dir in ${COPYDESTS} ; do test -d $${dir} || mkdir $${dir} ; done ; \
+	 for dir in ${COPYDESTS} ; do \
+	   if test ! -d $${dir} ; then mkdir $${dir} ; fi ; \
+	 done ; \
 	 for dir in ${COPYDIR} ; do \
 	   dest=$$1 ; shift ; \
 	   test -d $${dir} \
@@ -517,7 +519,6 @@
 	$(RM) core .sbinit Makefile lock/*
 
 distclean: FRC.distclean
-	for d in lock site-lisp; do test -d $$d || mkdir $$d; done
 	for d in $(SUBDIR); do (cd $$d && $(RECURSIVE_MAKE) $@); done
 	-${top_distclean}
 
--- a/configure	Mon Aug 13 09:57:40 2007 +0200
+++ b/configure	Mon Aug 13 09:58:30 2007 +0200
@@ -5445,80 +5445,6 @@
 
 
 
-    
-echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
-echo "configure:5451: 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 5456 "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 XawScrollbarSetThumb();
-
-int main() {
-XawScrollbarSetThumb()
-; return 0; }
-EOF
-if { (eval echo configure:5467: \"$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
-  have_xaw=yes
-else
-  echo "$ac_t""no" 1>&6
-have_xaw=no
-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:5491: checking for X11/Xaw/Reports.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5494 "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:5499: \"$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"
 
@@ -5552,7 +5478,7 @@
 esac
 
 echo "checking for session-management option" 1>&6
-echo "configure:5556: checking for session-management option" >&5;
+echo "configure:5482: checking for session-management option" >&5;
 if test "$with_session" != "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SESSION
@@ -5567,15 +5493,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:5571: checking for X11/Xauth.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5574 "configure"
+echo "configure:5497: checking for X11/Xauth.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5500 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5598,12 +5524,12 @@
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:5602: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:5528: 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 5607 "configure"
+#line 5533 "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
@@ -5614,7 +5540,7 @@
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:5618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5544: \"$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
@@ -5655,15 +5581,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:5659: checking for OffiX/DragAndDrop.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5662 "configure"
+echo "configure:5585: checking for OffiX/DragAndDrop.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5588 "configure"
 #include "confdefs.h"
 #include <OffiX/DragAndDrop.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5686,12 +5612,12 @@
  }
 test -z "$with_offix" && { 
 echo $ac_n "checking for DndInitialize in -lDnd""... $ac_c" 1>&6
-echo "configure:5690: checking for DndInitialize in -lDnd" >&5
+echo "configure:5616: 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 5695 "configure"
+#line 5621 "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
@@ -5702,7 +5628,7 @@
 DndInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:5706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5632: \"$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
@@ -5741,15 +5667,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:5745: checking for ${dir}tt_c.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5748 "configure"
+echo "configure:5671: checking for ${dir}tt_c.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5674 "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:5753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5778,12 +5704,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:5782: checking "$xe_msg_checking"" >&5
+echo "configure:5708: 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 5787 "configure"
+#line 5713 "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
@@ -5794,7 +5720,7 @@
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:5798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5724: \"$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
@@ -5843,15 +5769,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:5847: checking for Dt/Dt.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 5850 "configure"
+echo "configure:5773: checking for Dt/Dt.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5776 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5874,12 +5800,12 @@
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:5878: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:5804: 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 5883 "configure"
+#line 5809 "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
@@ -5890,7 +5816,7 @@
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:5894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5820: \"$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
@@ -5937,19 +5863,19 @@
 
   
 echo $ac_n "checking for main in -lenergize""... $ac_c" 1>&6
-echo "configure:5941: checking for main in -lenergize" >&5
+echo "configure:5867: 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 5946 "configure"
+#line 5872 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5879: \"$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
@@ -5981,19 +5907,19 @@
   if test -z "$energize_version"; then
     
 echo $ac_n "checking for main in -lconn""... $ac_c" 1>&6
-echo "configure:5985: checking for main in -lconn" >&5
+echo "configure:5911: 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 5990 "configure"
+#line 5916 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5923: \"$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
@@ -6026,15 +5952,15 @@
   fi
   ac_safe=`echo "editorconn.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for editorconn.h""... $ac_c" 1>&6
-echo "configure:6030: checking for editorconn.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6033 "configure"
+echo "configure:5956: checking for editorconn.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 5959 "configure"
 #include "confdefs.h"
 #include <editorconn.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6075,11 +6001,13 @@
 fi
 
 
-echo "checking for graphics libraries" 1>&6
-echo "configure:6080: checking for graphics libraries" >&5
-test -z "$with_gif" && with_gif=yes;
-if test "$with_gif" = "yes"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
+if test "$with_x11" = "yes"; then
+
+  echo "checking for X11 graphics libraries" 1>&6
+echo "configure:6008: checking for X11 graphics libraries" >&5
+    test -z "$with_gif" && with_gif=yes;
+  if test "$with_gif" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_GIF
 EOF
 cat >> confdefs.h <<\EOF
@@ -6087,29 +6015,29 @@
 EOF
 }
 
-  extra_objs="$extra_objs dgif_lib.o gif_err.o gifalloc.o" &&  if test "$extra_verbose" = "yes"; then
+    extra_objs="$extra_objs dgif_lib.o gif_err.o gifalloc.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"dgif_lib.o gif_err.o gifalloc.o\""
  fi
-fi
-
-echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:6097: checking for Xpm - no older than 3.4f" >&5
-xe_check_libs=-lXpm
-test -z "$with_xpm" && { cat > conftest.$ac_ext <<EOF
-#line 6100 "configure"
+  fi
+
+    echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
+echo "configure:6025: checking for Xpm - no older than 3.4f" >&5
+  xe_check_libs=-lXpm
+  test -z "$with_xpm" && { cat > conftest.$ac_ext <<EOF
+#line 6028 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
-int main(int c, char **v) {
-return c == 1 ? 0 :
-  XpmIncludeVersion != XpmLibraryVersion() ? 1 :
-        XpmIncludeVersion < 30406 ? 2 :
-		0 ;
-}
-EOF
-if { (eval echo configure:6110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+  int main(int c, char **v) {
+  return c == 1 ? 0 :
+    XpmIncludeVersion != XpmLibraryVersion() ? 1 :
+	  XpmIncludeVersion < 30406 ? 2 :
+		  0 ;
+  }
+EOF
+if { (eval echo configure:6038: \"$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;
+    if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi;
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -6117,21 +6045,21 @@
   with_xpm=no
 fi
 rm -fr conftest*
-}
-xe_check_libs=
-echo "$ac_t""$with_xpm" 1>&6
-if test "$xpm_status" = "1" -o "$xpm_status" = "2"; then
-  test "$xpm_status" = "1" && problem="Xpm library version and header file version don't match!"
-  test "$xpm_status" = "2" && problem="Xpm library version is too old!"
-  echo "
-*** WARNING *** $problem
-                I'm not touching that with a 10-foot pole!
-                If you really want to use the installed version of Xpm, rerun
-                configure --with-xpm=yes, but don't blame me if XEmacs crashes!
-"
-fi
-if test "$with_xpm" = "yes"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
+  }
+  xe_check_libs=
+  echo "$ac_t""$with_xpm" 1>&6
+  if test "$xpm_status" = "1" -o "$xpm_status" = "2"; then
+    test "$xpm_status" = "1" && problem="Xpm library version and header file version don't match!"
+    test "$xpm_status" = "2" && problem="Xpm library version is too old!"
+    echo "
+  *** WARNING *** $problem
+		  I'm not touching that with a 10-foot pole!
+		  If you really want to use the installed version of Xpm, rerun
+		  configure --with-xpm=yes, but don't blame me if XEmacs crashes!
+  "
+  fi
+  if test "$with_xpm" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_XPM
 EOF
 cat >> confdefs.h <<\EOF
@@ -6139,20 +6067,20 @@
 EOF
 }
 
-  libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
-fi
-
-test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
+    libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
+  fi
+
+    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:6148: checking for compface.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6151 "configure"
+echo "configure:6076: checking for compface.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6079 "configure"
 #include "confdefs.h"
 #include <compface.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6173,14 +6101,14 @@
 with_xface=no
 fi
  }
-test -z "$with_xface" && { 
+  test -z "$with_xface" && { 
 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:6179: checking for UnGenFace in -lcompface" >&5
+echo "configure:6107: 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 6184 "configure"
+#line 6112 "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
@@ -6191,7 +6119,7 @@
 UnGenFace()
 ; return 0; }
 EOF
-if { (eval echo configure:6195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6123: \"$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
@@ -6212,9 +6140,9 @@
 fi
 
  }
-test -z "$with_xface" && with_xface=yes
-if test "$with_xface" = "yes"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
+  test -z "$with_xface" && with_xface=yes
+  if test "$with_xface" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_XFACE
 EOF
 cat >> confdefs.h <<\EOF
@@ -6222,20 +6150,20 @@
 EOF
 }
 
-  libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
-fi
-
-test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
+    libs_x="-lcompface $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lcompface\" to \$libs_x"; fi
+  fi
+
+    test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
-echo "configure:6231: checking for jpeglib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6234 "configure"
+echo "configure:6159: checking for jpeglib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6162 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6256,14 +6184,14 @@
 with_jpeg=no
 fi
  }
-test -z "$with_jpeg" && { 
+  test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:6262: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:6190: 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 6267 "configure"
+#line 6195 "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
@@ -6274,7 +6202,7 @@
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:6278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6206: \"$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
@@ -6295,9 +6223,9 @@
 fi
 
  }
-test -z "$with_jpeg" && with_jpeg=yes
-if test "$with_jpeg" = "yes"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
+  test -z "$with_jpeg" && with_jpeg=yes
+  if test "$with_jpeg" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_JPEG
 EOF
 cat >> confdefs.h <<\EOF
@@ -6305,20 +6233,20 @@
 EOF
 }
 
-  libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
-fi
-
-test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
+    libs_x="-ljpeg $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ljpeg\" to \$libs_x"; fi
+  fi
+
+    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:6314: checking for png.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6317 "configure"
+echo "configure:6242: checking for png.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6245 "configure"
 #include "confdefs.h"
 #include <png.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6339,11 +6267,11 @@
 with_png=no
 fi
  }
-test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:6344: checking for pow" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6347 "configure"
+  test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
+echo "configure:6272: checking for pow" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6275 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -6366,7 +6294,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -6385,18 +6313,18 @@
 with_png=no
 fi
  }
-if test "$with_png" != "no"; then
-  for extra_libs in "" "-lz" "-lgz"; do
-    
+  if test "$with_png" != "no"; then
+    for extra_libs in "" "-lz" "-lgz"; do
+      
 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:6395: checking "$xe_msg_checking"" >&5
+echo "configure:6323: 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 6400 "configure"
+#line 6328 "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
@@ -6407,7 +6335,7 @@
 png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:6411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6339: \"$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
@@ -6428,11 +6356,11 @@
 fi
 
 
-  done
-fi
-test -z "$with_png" && with_png=no
-if test "$with_png" = "yes"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
+    done
+  fi
+  test -z "$with_png" && with_png=no
+  if test "$with_png" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_PNG
 EOF
 cat >> confdefs.h <<\EOF
@@ -6440,11 +6368,11 @@
 EOF
 }
 
-  libs_x="$png_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$png_libs\" to \$libs_x"; fi
-fi
-
-if test "$with_tiff" = "yes"; then
-  { test "$extra_verbose" = "yes" && cat << \EOF
+    libs_x="$png_libs $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"$png_libs\" to \$libs_x"; fi
+  fi
+
+    if test "$with_tiff" = "yes"; then
+    { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TIFF
 EOF
 cat >> confdefs.h <<\EOF
@@ -6452,20 +6380,94 @@
 EOF
 }
 
-  libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
-fi
-
-  ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
+    libs_x="-ltiff $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-ltiff\" to \$libs_x"; fi
+  fi
+
+    
+echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6
+echo "configure:6389: 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 6394 "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 XawScrollbarSetThumb();
+
+int main() {
+XawScrollbarSetThumb()
+; return 0; }
+EOF
+if { (eval echo configure:6405: \"$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
+  have_xaw=yes
+else
+  echo "$ac_t""no" 1>&6
+have_xaw=no
+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:6429: checking for X11/Xaw/Reports.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6432 "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:6437: \"$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
+
+    ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:6461: checking for Xm/Xm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6464 "configure"
+echo "configure:6463: checking for Xm/Xm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6466 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6482,12 +6484,12 @@
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:6486: checking for XmStringFree in -lXm" >&5
+echo "configure:6488: 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 6491 "configure"
+#line 6493 "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
@@ -6498,7 +6500,7 @@
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:6502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6504: \"$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
@@ -6525,6 +6527,7 @@
 fi
 
 
+fi 
 
 case "$with_menubars" in "" | "yes" | "athena" )
   with_menubars="lucid" ;;
@@ -6746,7 +6749,7 @@
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:6750: checking for Mule-related features" >&5
+echo "configure:6753: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -6763,15 +6766,15 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6767: checking for $ac_hdr" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 6770 "configure"
+echo "configure:6770: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6773 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6802,12 +6805,12 @@
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:6806: checking for strerror in -lintl" >&5
+echo "configure:6809: 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 6811 "configure"
+#line 6814 "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
@@ -6818,7 +6821,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:6822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6825: \"$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
@@ -6851,19 +6854,19 @@
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:6855: checking for Mule input methods" >&5
+echo "configure:6858: 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:6859: checking for XIM" >&5
+echo "configure:6862: checking for XIM" >&5
     
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:6862: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:6865: 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 6867 "configure"
+#line 6870 "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
@@ -6874,7 +6877,7 @@
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:6878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6881: \"$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
@@ -6937,15 +6940,15 @@
     fi
   else     case "$with_xfs" in  "yes" )
       echo "checking for XFontSet" 1>&6
-echo "configure:6941: checking for XFontSet" >&5
+echo "configure:6944: checking for XFontSet" >&5
       
 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
-echo "configure:6944: checking for XmbDrawString in -lX11" >&5
+echo "configure:6947: checking for XmbDrawString in -lX11" >&5
 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 6949 "configure"
+#line 6952 "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
@@ -6956,7 +6959,7 @@
 XmbDrawString()
 ; return 0; }
 EOF
-if { (eval echo configure:6960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6963: \"$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
@@ -6995,15 +6998,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:6999: checking for wnn/jllib.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7002 "configure"
+echo "configure:7002: checking for wnn/jllib.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7005 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7028,10 +7031,10 @@
     for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7032: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7035 "configure"
+echo "configure:7035: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7038 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7054,7 +7057,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7083,12 +7086,12 @@
 
     test "$ac_cv_func_crypt" != "yes" && { 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:7087: checking for crypt in -lcrypt" >&5
+echo "configure:7090: 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 7092 "configure"
+#line 7095 "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
@@ -7099,7 +7102,7 @@
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:7103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7106: \"$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
@@ -7133,12 +7136,12 @@
   fi
     test -z "$with_wnn" && { 
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:7137: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:7140: 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 7142 "configure"
+#line 7145 "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
@@ -7149,7 +7152,7 @@
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:7153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7156: \"$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
@@ -7186,12 +7189,12 @@
  fi
     
 echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6
-echo "configure:7190: checking for jl_fi_dic_list in -lwnn" >&5
+echo "configure:7193: 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 7195 "configure"
+#line 7198 "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
@@ -7202,7 +7205,7 @@
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:7206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7209: \"$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
@@ -7234,15 +7237,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:7238: checking for canna/RK.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7241 "configure"
+echo "configure:7241: checking for canna/RK.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7244 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7265,12 +7268,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:7269: checking for RkBgnBun in -lRKC" >&5
+echo "configure:7272: 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 7274 "configure"
+#line 7277 "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
@@ -7281,7 +7284,7 @@
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:7285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7288: \"$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
@@ -7304,12 +7307,12 @@
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:7308: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:7311: 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 7313 "configure"
+#line 7316 "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
@@ -7320,7 +7323,7 @@
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:7324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7327: \"$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
@@ -7420,10 +7423,10 @@
 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 ulimit usleep utimes waitpid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7424: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7427 "configure"
+echo "configure:7427: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7430 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7446,7 +7449,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7483,10 +7486,10 @@
     for ac_func in realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7487: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7490 "configure"
+echo "configure:7490: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7493 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7509,7 +7512,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7542,16 +7545,16 @@
 esac
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:7546: checking whether netdb declares h_errno" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7548 "configure"
+echo "configure:7549: checking whether netdb declares h_errno" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7551 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:7555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7558: \"$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
@@ -7571,16 +7574,16 @@
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:7575: checking for sigsetjmp" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7577 "configure"
+echo "configure:7578: checking for sigsetjmp" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7580 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:7584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7587: \"$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
@@ -7600,11 +7603,11 @@
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:7604: checking whether localtime caches TZ" >&5
+echo "configure:7607: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 7608 "configure"
+#line 7611 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -7639,7 +7642,7 @@
   exit (0);
 }
 EOF
-if { (eval echo configure:7643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:7646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
@@ -7668,9 +7671,9 @@
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday cannot accept two arguments""... $ac_c" 1>&6
-echo "configure:7672: checking whether gettimeofday cannot accept two arguments" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7674 "configure"
+echo "configure:7675: checking whether gettimeofday cannot accept two arguments" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7677 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -7692,7 +7695,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
 else
@@ -7714,19 +7717,19 @@
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:7718: checking for inline" >&5
+echo "configure:7721: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 7723 "configure"
+#line 7726 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:7730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -7776,17 +7779,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:7780: checking for working alloca.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7783 "configure"
+echo "configure:7783: checking for working alloca.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7786 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:7790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -7810,10 +7813,10 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:7814: checking for alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7817 "configure"
+echo "configure:7817: checking for alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7820 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -7836,7 +7839,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:7840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -7875,10 +7878,10 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:7879: checking whether alloca needs Cray hooks" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7882 "configure"
+echo "configure:7882: checking whether alloca needs Cray hooks" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7885 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -7902,10 +7905,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:7906: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7909 "configure"
+echo "configure:7909: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7912 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7928,7 +7931,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7958,10 +7961,10 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:7962: checking stack direction for C alloca" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 7965 "configure"
+echo "configure:7965: checking stack direction for C alloca" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7968 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -7980,7 +7983,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:7984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:7987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
@@ -8008,15 +8011,15 @@
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:8012: checking for vfork.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8015 "configure"
+echo "configure:8015: checking for vfork.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8018 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8044,10 +8047,10 @@
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:8048: checking for working vfork" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8051 "configure"
+echo "configure:8051: checking for working vfork" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8054 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -8142,7 +8145,7 @@
   }
 }
 EOF
-if { (eval echo configure:8146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_vfork_works=yes
 else
@@ -8167,10 +8170,10 @@
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:8171: checking for working strcoll" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8174 "configure"
+echo "configure:8174: checking for working strcoll" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8177 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -8180,7 +8183,7 @@
 	strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:8184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
@@ -8207,10 +8210,10 @@
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8211: checking for $ac_func" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8214 "configure"
+echo "configure:8214: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8217 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8233,7 +8236,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8261,10 +8264,10 @@
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:8265: checking whether getpgrp takes no argument" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8268 "configure"
+echo "configure:8268: checking whether getpgrp takes no argument" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8271 "configure"
 #include "confdefs.h"
 
 /*
@@ -8319,7 +8322,7 @@
 }
 
 EOF
-if { (eval echo configure:8323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
@@ -8345,10 +8348,10 @@
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:8349: checking for working mmap" >&5
+echo "configure:8352: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 8352 "configure"
+#line 8355 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -8381,7 +8384,7 @@
   return 1;
 }
 EOF
-if { (eval echo configure:8385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
+if { (eval echo configure:8388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5
 then
   have_mmap=yes
 else
@@ -8415,15 +8418,15 @@
 
 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:8419: checking for termios.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8422 "configure"
+echo "configure:8422: checking for termios.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8425 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8466,15 +8469,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:8470: checking for termio.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8473 "configure"
+echo "configure:8473: checking for termio.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8476 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8506,10 +8509,10 @@
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:8510: checking for socket" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8513 "configure"
+echo "configure:8513: checking for socket" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8516 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -8532,7 +8535,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -8547,15 +8550,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:8551: checking for netinet/in.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8554 "configure"
+echo "configure:8554: checking for netinet/in.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8557 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8572,15 +8575,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:8576: checking for arpa/inet.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8579 "configure"
+echo "configure:8579: checking for arpa/inet.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8582 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8605,9 +8608,9 @@
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:8609: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:8612: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 8611 "configure"
+#line 8614 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -8618,7 +8621,7 @@
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:8622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8625: \"$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
@@ -8649,10 +8652,10 @@
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:8653: checking for msgget" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8656 "configure"
+echo "configure:8656: checking for msgget" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8659 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -8675,7 +8678,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -8690,15 +8693,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:8694: checking for sys/ipc.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8697 "configure"
+echo "configure:8697: checking for sys/ipc.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8700 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8715,15 +8718,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:8719: checking for sys/msg.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8722 "configure"
+echo "configure:8722: checking for sys/msg.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8725 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8761,15 +8764,15 @@
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:8765: checking for dirent.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8768 "configure"
+echo "configure:8768: checking for dirent.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8771 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8796,15 +8799,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:8800: checking for sys/dir.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8803 "configure"
+echo "configure:8803: checking for sys/dir.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8806 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8837,15 +8840,15 @@
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:8841: checking for nlist.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8844 "configure"
+echo "configure:8844: checking for nlist.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8847 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8886,7 +8889,7 @@
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:8890: checking "for sound support"" >&5
+echo "configure:8893: checking "for sound support"" >&5
 case "$with_sound" in
   native | both ) with_native_sound=yes;;
   nas    | no   ) with_native_sound=no;;
@@ -8897,15 +8900,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:8901: checking for multimedia/audio_device.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 8904 "configure"
+echo "configure:8904: checking for multimedia/audio_device.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 8907 "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:8909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8953,12 +8956,12 @@
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:8957: checking for ALopenport in -laudio" >&5
+echo "configure:8960: 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 8962 "configure"
+#line 8965 "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
@@ -8969,7 +8972,7 @@
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:8973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8976: \"$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
@@ -9000,12 +9003,12 @@
       if test -z "$native_sound_lib"; then
 	
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:9004: checking for AOpenAudio in -lAlib" >&5
+echo "configure:9007: 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 9009 "configure"
+#line 9012 "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
@@ -9016,7 +9019,7 @@
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:9020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9023: \"$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
@@ -9054,15 +9057,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:9058: checking for ${dir}/soundcard.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9061 "configure"
+echo "configure:9061: checking for ${dir}/soundcard.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9064 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9132,7 +9135,7 @@
  fi
   LIBS="-laudio $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$LIBS"; fi
       cat > conftest.$ac_ext <<EOF
-#line 9136 "configure"
+#line 9139 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -9159,7 +9162,7 @@
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:9163: checking for TTY-related features" >&5
+echo "configure:9166: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -9175,12 +9178,12 @@
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:9179: checking for tgetent in -lncurses" >&5
+echo "configure:9182: 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 9184 "configure"
+#line 9187 "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
@@ -9191,7 +9194,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9198: \"$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,15 +9227,15 @@
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:9228: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9231 "configure"
+echo "configure:9231: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9234 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9254,15 +9257,15 @@
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:9258: checking for ncurses/term.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9261 "configure"
+echo "configure:9261: checking for ncurses/term.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9264 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9269: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9292,15 +9295,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:9296: checking for ncurses/curses.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9299 "configure"
+echo "configure:9299: checking for ncurses/curses.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9302 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9335,12 +9338,12 @@
 	for lib in curses termlib termcap; do
 	  
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:9339: checking for tgetent in -l$lib" >&5
+echo "configure:9342: 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 9344 "configure"
+#line 9347 "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
@@ -9351,7 +9354,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9358: \"$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
@@ -9382,12 +9385,12 @@
       else
 	
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:9386: checking for tgetent in -lcurses" >&5
+echo "configure:9389: 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 9391 "configure"
+#line 9394 "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
@@ -9398,7 +9401,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9405: \"$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
@@ -9416,12 +9419,12 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:9420: checking for tgetent in -ltermcap" >&5
+echo "configure:9423: 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 9425 "configure"
+#line 9428 "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
@@ -9432,7 +9435,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:9436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9439: \"$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
@@ -9480,15 +9483,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:9484: checking for gpm.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9487 "configure"
+echo "configure:9487: checking for gpm.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9490 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9511,12 +9514,12 @@
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:9515: checking for Gpm_Open in -lgpm" >&5
+echo "configure:9518: 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 9520 "configure"
+#line 9523 "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
@@ -9527,7 +9530,7 @@
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:9531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9534: \"$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
@@ -9576,17 +9579,17 @@
 
 
 echo "checking for database support" 1>&6
-echo "configure:9580: checking for database support" >&5
+echo "configure:9583: 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:9585: checking for dbm_open in -lgdbm" >&5
+echo "configure:9588: 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 9590 "configure"
+#line 9593 "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
@@ -9597,7 +9600,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:9601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9604: \"$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
@@ -9619,10 +9622,10 @@
 
   if test "$with_database_gnudbm" != "yes"; then
     echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:9623: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9626 "configure"
+echo "configure:9626: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9629 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -9645,7 +9648,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -9681,10 +9684,10 @@
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:9685: checking for dbm_open" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9688 "configure"
+echo "configure:9688: checking for dbm_open" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9691 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -9707,7 +9710,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -9728,12 +9731,12 @@
   if test "$need_libdbm" != "no"; then
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:9732: checking for dbm_open in -ldbm" >&5
+echo "configure:9735: 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 9737 "configure"
+#line 9740 "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
@@ -9744,7 +9747,7 @@
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:9748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9751: \"$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
@@ -9781,10 +9784,10 @@
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:9785: checking for dbopen" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 9788 "configure"
+echo "configure:9788: checking for dbopen" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 9791 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -9807,7 +9810,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -9828,12 +9831,12 @@
   if test "$need_libdb" != "no"; then
     
 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:9832: checking for dbopen in -ldb" >&5
+echo "configure:9835: 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 9837 "configure"
+#line 9840 "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
@@ -9844,7 +9847,7 @@
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:9848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9851: \"$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
@@ -9868,7 +9871,7 @@
   if test "$with_database_berkdb" = "yes"; then
     for path in "db/db.h" "db.h"; do
 cat > conftest.$ac_ext <<EOF
-#line 9872 "configure"
+#line 9875 "configure"
 #include "confdefs.h"
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
@@ -9891,7 +9894,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_path="$path"; break
 else
@@ -9943,12 +9946,12 @@
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:9947: checking for SOCKSinit in -lsocks" >&5
+echo "configure:9950: 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 9952 "configure"
+#line 9955 "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
@@ -9959,7 +9962,7 @@
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:9963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:9966: \"$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
--- a/configure.in	Mon Aug 13 09:57:40 2007 +0200
+++ b/configure.in	Mon Aug 13 09:58:30 2007 +0200
@@ -2387,14 +2387,6 @@
   dnl #### Someone, please add a better function than main
   AC_CHECK_LIB(Xbsd, main, XE_PREPEND(-lXbsd, libs_x))
 
-  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
 
 test -z "$window_system" && window_system="none"
@@ -2491,7 +2483,7 @@
   need_motif=yes    # CDE requires Motif
 fi
 
-dnl if Energize specified, make sure we can find its need libraries/headers
+dnl if Energize specified, make sure we can find its libraries/headers
 if test "$with_energize" = "yes" ; then
   AC_DEFINE(ENERGIZE)
   AC_CHECK_LIB(energize, main, [
@@ -2512,92 +2504,104 @@
   test "$energize_version" = "3.X" && AC_DEFINE(ENERGIZE_3)
 fi
 
-dnl ------------------
-dnl Graphics libraries
-dnl ------------------
-
-AC_CHECKING(for graphics libraries)
-dnl Built-in GIF support defaults to yes
-test -z "$with_gif" && with_gif=yes;
-if test "$with_gif" = "yes"; then
-  AC_DEFINE(HAVE_GIF)
-  XE_ADD_OBJS(dgif_lib.o gif_err.o gifalloc.o)
-fi
-
-dnl Autodetect Xpm
-AC_MSG_CHECKING(for Xpm - no older than 3.4f)
-xe_check_libs=-lXpm
-test -z "$with_xpm" && { AC_TRY_RUN([#include <X11/xpm.h>
-int main(int c, char **v) {
-return c == 1 ? 0 :
-  XpmIncludeVersion != XpmLibraryVersion() ? 1 :
-        XpmIncludeVersion < 30406 ? 2 :
-		0 ;
-}], [./conftest foobar; xpm_status=$?;
-  if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi;],
-with_xpm=no, with_xpm=no)
-}
-xe_check_libs=
-AC_MSG_RESULT($with_xpm)
-if test "$xpm_status" = "1" -o "$xpm_status" = "2"; then
-  test "$xpm_status" = "1" && problem="Xpm library version and header file version don't match!"
-  test "$xpm_status" = "2" && problem="Xpm library version is too old!"
-  echo "
-*** WARNING *** $problem
-                I'm not touching that with a 10-foot pole!
-                If you really want to use the installed version of Xpm, rerun
-                configure --with-xpm=yes, but don't blame me if XEmacs crashes!
-"
-fi
-if test "$with_xpm" = "yes"; then
-  AC_DEFINE(HAVE_XPM)
-  XE_PREPEND(-lXpm, libs_x)
-fi
-
-dnl Autodetect XFACE
-test -z "$with_xface" && { AC_CHECK_HEADER(compface.h,          ,with_xface=no) }
-test -z "$with_xface" && { AC_CHECK_LIB(compface, UnGenFace,[:] ,with_xface=no) }
-test -z "$with_xface" && with_xface=yes
-if test "$with_xface" = "yes"; then
-  AC_DEFINE(HAVE_XFACE)
-  XE_PREPEND(-lcompface, libs_x)
-fi
-
-dnl autodetect JPEG
-test -z "$with_jpeg" && { AC_CHECK_HEADER(jpeglib.h,                    ,with_jpeg=no) }
-test -z "$with_jpeg" && { AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,[:],with_jpeg=no) }
-test -z "$with_jpeg" && with_jpeg=yes
-if test "$with_jpeg" = "yes"; then
-  AC_DEFINE(HAVE_JPEG)
-  XE_PREPEND(-ljpeg, libs_x)
-fi
-
-dnl autodetect PNG
-test -z "$with_png" && { AC_CHECK_HEADER(png.h, , with_png=no) }
-test -z "$with_png" && { AC_CHECK_FUNC(pow,     , with_png=no) }
-if test "$with_png" != "no"; then
-  for extra_libs in "" "-lz" "-lgz"; do
-    AC_CHECK_LIB(png, png_read_image,
-      png_libs="-lpng $extra_libs" with_png=yes; break,[:],$extra_libs)
-  done
-fi
-test -z "$with_png" && with_png=no
-if test "$with_png" = "yes"; then
-  AC_DEFINE(HAVE_PNG)
-  XE_PREPEND($png_libs, libs_x)
-fi
-
-dnl autodetect TIFF (not yet implemented)
-if test "$with_tiff" = "yes"; then
-  AC_DEFINE(HAVE_TIFF)
-  XE_PREPEND(-ltiff, libs_x)
-fi
-
-dnl autodetect Motif - but only add to libs_x later (if necessary)
+dnl ----------------------
+dnl X11 Graphics libraries
+dnl ----------------------
+
+if test "$with_x11" = "yes"; then
+
+  AC_CHECKING(for X11 graphics libraries)
+  dnl Built-in GIF support defaults to yes
+  test -z "$with_gif" && with_gif=yes;
+  if test "$with_gif" = "yes"; then
+    AC_DEFINE(HAVE_GIF)
+    XE_ADD_OBJS(dgif_lib.o gif_err.o gifalloc.o)
+  fi
+
+  dnl Autodetect Xpm
+  AC_MSG_CHECKING(for Xpm - no older than 3.4f)
+  xe_check_libs=-lXpm
+  test -z "$with_xpm" && { AC_TRY_RUN([#include <X11/xpm.h>
+  int main(int c, char **v) {
+  return c == 1 ? 0 :
+    XpmIncludeVersion != XpmLibraryVersion() ? 1 :
+	  XpmIncludeVersion < 30406 ? 2 :
+		  0 ;
+  }], [./conftest foobar; xpm_status=$?;
+    if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi;],
+  with_xpm=no, with_xpm=no)
+  }
+  xe_check_libs=
+  AC_MSG_RESULT($with_xpm)
+  if test "$xpm_status" = "1" -o "$xpm_status" = "2"; then
+    test "$xpm_status" = "1" && problem="Xpm library version and header file version don't match!"
+    test "$xpm_status" = "2" && problem="Xpm library version is too old!"
+    echo "
+  *** WARNING *** $problem
+		  I'm not touching that with a 10-foot pole!
+		  If you really want to use the installed version of Xpm, rerun
+		  configure --with-xpm=yes, but don't blame me if XEmacs crashes!
+  "
+  fi
+  if test "$with_xpm" = "yes"; then
+    AC_DEFINE(HAVE_XPM)
+    XE_PREPEND(-lXpm, libs_x)
+  fi
+
+  dnl Autodetect XFACE
+  test -z "$with_xface" && { AC_CHECK_HEADER(compface.h,          ,with_xface=no) }
+  test -z "$with_xface" && { AC_CHECK_LIB(compface, UnGenFace,[:] ,with_xface=no) }
+  test -z "$with_xface" && with_xface=yes
+  if test "$with_xface" = "yes"; then
+    AC_DEFINE(HAVE_XFACE)
+    XE_PREPEND(-lcompface, libs_x)
+  fi
+
+  dnl autodetect JPEG
+  test -z "$with_jpeg" && { AC_CHECK_HEADER(jpeglib.h,                    ,with_jpeg=no) }
+  test -z "$with_jpeg" && { AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,[:],with_jpeg=no) }
+  test -z "$with_jpeg" && with_jpeg=yes
+  if test "$with_jpeg" = "yes"; then
+    AC_DEFINE(HAVE_JPEG)
+    XE_PREPEND(-ljpeg, libs_x)
+  fi
+
+  dnl autodetect PNG
+  test -z "$with_png" && { AC_CHECK_HEADER(png.h, , with_png=no) }
+  test -z "$with_png" && { AC_CHECK_FUNC(pow,     , with_png=no) }
+  if test "$with_png" != "no"; then
+    for extra_libs in "" "-lz" "-lgz"; do
+      AC_CHECK_LIB(png, png_read_image,
+	png_libs="-lpng $extra_libs" with_png=yes; break,[:],$extra_libs)
+    done
+  fi
+  test -z "$with_png" && with_png=no
+  if test "$with_png" = "yes"; then
+    AC_DEFINE(HAVE_PNG)
+    XE_PREPEND($png_libs, libs_x)
+  fi
+
+  dnl autodetect TIFF (not yet implemented)
+  if test "$with_tiff" = "yes"; then
+    AC_DEFINE(HAVE_TIFF)
+    XE_PREPEND(-ltiff, libs_x)
+  fi
+
+  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
+
+  dnl autodetect Motif - but only add to libs_x later (if necessary)
   AC_CHECK_HEADER(Xm/Xm.h,
    [AC_CHECK_LIB(Xm, XmStringFree, have_motif=yes, have_motif=no)],
    have_motif=no)
 
+fi dnl "$with_x11" = "yes"
+
 dnl Finish ensuring that we have values for the various toolkit items.
 dnl Not all toolkits support all widgets
 dnl if Motif is available we use it for the dialog boxes.
--- a/dynodump/Makefile.in.in	Mon Aug 13 09:57:40 2007 +0200
+++ b/dynodump/Makefile.in.in	Mon Aug 13 09:58:30 2007 +0200
@@ -60,7 +60,7 @@
 ALL_CFLAGS = ${CFLAGS} ${pic_arg} ${INCLUDES}
 OBJS = _relocate.o dynodump.o syms.o uninit.o
 
-.c.o:
+%.o : %.c
 	$(CC) -c $(ALL_CFLAGS) $<
 
 all:: dynodump.so
--- a/etc/NEWS	Mon Aug 13 09:57:40 2007 +0200
+++ b/etc/NEWS	Mon Aug 13 09:58:30 2007 +0200
@@ -54,7 +54,7 @@
 opposite.
 
 A special minor mode called "outl-mouse" has been automatically enabled.  In
-this minor mode, glyphs appear which, when clicked on, will alternately hide
+this minor mode, glyphs appear that, when clicked on, will alternately hide
 or show sections of the outline.
 
 You may at any time press `C-h m' to get a listing of the outline mode key
@@ -120,7 +120,7 @@
 
 ** Quail input method is now available.
 
-Quail is a simple key-translation system which allows users to input
+Quail is a simple key-translation system that allows users to input
 any multilingual text from normal ASCII keyboard.  This means that
 XEmacs with Mule now supports a number of European languages.
 
@@ -143,7 +143,7 @@
 The behavior of the zmacs region can now be controlled in the event of
 a signaled error.  The new variable `errors-deactivate-region' may be
 set to nil to revert to the old behaviour.  As before, typing C-g
-deactivate the region.
+deactivates the region.
 
 ** Info "dir" functionality merged from Emacs-19.34
 
@@ -161,7 +161,7 @@
 ** 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
+define `#in' 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.
 
@@ -182,8 +182,8 @@
  
 ** 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.)
+previous echo area contents are restored (in case the command prints
+something useful).
 
 ** Pending-delete changes.
 
@@ -247,7 +247,7 @@
 *** Many new options and variables are now customizable.  Try
 `M-x customize-group RET gnuserv RET'.
 
-*** The `gnuattact' and `gnudoit' programs have been abandoned in
+*** The `gnuattach' and `gnudoit' programs have been abandoned in
 favor of `gnuclient', which now accepts the standard `-nw',
 `-display', `-eval' and `-f' options.
 
@@ -256,7 +256,7 @@
 *** In C, C++, Objective C and Java, Etags tags global variables by
 default.  The resulting tags files are inflated by 30% on average.
 Use --no-globals to turn this feature off.  Etags can also tag
-ariables which are members of structure-like constructs, but it does
+variables that are members of structure-like constructs, but it does
 not by default.  Use --members to turn this feature on.
 
 *** C++ member functions are now recognized as tags.
@@ -299,7 +299,7 @@
 `ada-compile-options' are used within these commands. 
 
 *** Ada mode can now work with Outline minor mode.  The outline level
-is calculated from the indenting, not from syntactic contructs.
+is calculated from the indenting, not from syntactic constructs.
 Outlining does not work if your code is not correctly indented.
 
 *** The new function `ada-gnat-style' converts the buffer to the style of
@@ -316,13 +316,13 @@
 conventions used by other free software.
 
 ** `tty-erase-char' is a new variable that reports which character
-was set up as the terminal's erase character at the tim Emacs was
+was set up as the terminal's erase character at the time Emacs was
 started.
 
 ** `insert-file-contents' can now read from a special file,
 as long as the arguments VISIT and REPLACE are nil.
 
-** `string-to-number' now accepts an optional BASE argument which
+** `string-to-number' now accepts an optional BASE argument that
 specifies which base to use.  The default base is 10.
 
 ** The TIME argument to `format-time-string' is now optional and
--- a/info/dir	Mon Aug 13 09:57:40 2007 +0200
+++ b/info/dir	Mon Aug 13 09:58:30 2007 +0200
@@ -46,7 +46,7 @@
 * send-pr::	Submitting Bug Reports
 * gnats::	GNU Problem Report Management System
 
-Packages:
+Local Packages:
 
 * CC-MODE::	Mode for editing C, C++, and Objective-C code.
 * CL::		A Common Lisp compatibility package for Emacs-Lisp.
--- a/lib-src/Makefile.in.in	Mon Aug 13 09:57:40 2007 +0200
+++ b/lib-src/Makefile.in.in	Mon Aug 13 09:58:30 2007 +0200
@@ -31,6 +31,7 @@
 @SET_MAKE@
 SHELL = /bin/sh
 RM = rm -f
+pwd = /bin/pwd
 
 CC=@CC@
 CPP=@CPP@
@@ -142,36 +143,14 @@
 .c.o:
 	${CC} -c $(cflags) $<
 
-all: ${UTILITIES} ${INSTALLABLES} ${SCRIPTS}
+all: ${UTILITIES} ${INSTALLABLES} srcdir-symlink.stamp
 
-## Make symlinks for shell scripts if using --srcdir */
-rcs2log:
-	${LN_S} ${srcdir}/$@ $@
-vcdiff:
-	${LN_S} ${srcdir}/$@ $@
-tm-au :
-	${LN_S} ${srcdir}/$@ $@
-tm-file :
-	${LN_S} ${srcdir}/$@ $@
-tm-html :
-	${LN_S} ${srcdir}/$@ $@
-tm-image :
-	${LN_S} ${srcdir}/$@ $@
-tm-mpeg :
-	${LN_S} ${srcdir}/$@ $@
-tm-plain :
-	${LN_S} ${srcdir}/$@ $@
-tm-ps :
-	${LN_S} ${srcdir}/$@ $@
-tmdecode :
-	${LN_S} ${srcdir}/$@ $@
-gzip-el.sh:
-	${LN_S} ${srcdir}/$@ $@
-install-sid:
-	${LN_S} ${srcdir}/$@ $@
-send-pr:
-	${LN_S} ${srcdir}/$@ $@
-
+## Make symlinks for shell scripts if using --srcdir
+srcdir-symlink.stamp:
+	for f in ${SCRIPTS}; do \
+		if test ! -r $$f; then ${LN_S} ${srcdir}/$$f $$f; fi; \
+	done; \
+	touch $@;
 
 #undef MOVEMAIL_NEEDS_BLESSING
 #if !defined (MAIL_USE_FLOCK) && ! defined (MAIL_USE_LOCKF)
@@ -208,15 +187,15 @@
 ${archlibdir}: all
 	@echo; echo "Installing utilities run internally by XEmacs."
 	./make-path ${archlibdir}
-	if test `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd`; then \
-	  for file in ${UTILITIES}; do \
-	    (cd .. && $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
+	if test `(cd ${archlibdir} && $(pwd))` != `$(pwd)`; then \
+	  for f in ${UTILITIES}; do \
+	    (cd .. && $(INSTALL_PROGRAM) lib-src/$$f ${archlibdir}/$$f) ; \
 	  done ; \
 	fi
-	if test `(cd ${archlibdir} && /bin/pwd)` \
-	     != `(cd ${srcdir} && /bin/pwd)`; then \
-	  for file in ${SCRIPTS}; do \
-	    (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
+	if test `(cd ${archlibdir} && $(pwd))` \
+	     != `(cd ${srcdir}     && $(pwd))`; then \
+	  for f in ${SCRIPTS}; do \
+	    (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$f ${archlibdir}/$$f); \
 	  done ; \
 	fi
 
@@ -272,22 +251,14 @@
 alloca.o: ${srcdir}/../src/alloca.c
 	${CC} -c $(cflags) ${srcdir}/../src/alloca.c
 
-#ifdef REGEXP_IN_LIBC
-REGEXOBJ =
-REGEXDEPS =
-#else
-REGEXOBJ = regex.o
-REGEXDEPS = $(REGEXOBJ) ${srcdir}/../src/regex.h
-#endif
-
 regex.o: ${srcdir}/../src/regex.c ${srcdir}/../src/regex.h
 	$(CC) -c `echo ${cflags} | sed 's/-Demacs/ /'` \
 		-DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
 
 etags_args = -I. ${cflags} -I${srcdir} -I${srcdir}/../src \
 	-DVERSION='"${version}"' ${srcdir}/etags.c \
-	$(GETOPTOBJS) $(REGEXOBJ) $(ldflags)
-etags_deps   = ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXDEPS) ../src/config.h
+	$(GETOPTOBJS) regex.o $(ldflags)
+etags_deps   = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h
 
 etags: ${etags_deps}
 	$(CC) ${etags_args} -o $@
--- a/lisp/ChangeLog	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/ChangeLog	Mon Aug 13 09:58:30 2007 +0200
@@ -1,5 +1,82 @@
+1997-09-20  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* packages/etags.el: Lots of changes.
+
+1997-09-20  SL Baur  <steve@altair.xemacs.org>
+
+	* prim/faces.el (Top Level): Back out use of the loop macro.  It now
+	isn't defined until loaddefs gets loaded.
+
+1997-09-20  Tomasz Cholewo  <tjchol01@mecca.spd.louisville.edu>
+
+	* prim/help.el (help-for-help): Make menu items style more uniform.
+
+1997-09-20  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* modes/sendmail.el: Don't define keys to mail etc.
+
+	* prim/keydefs.el: Add bindings to `compose-mail'.
+
+	* prim/simple.el: Synch mail stuff with Emacs 20.
+
+	* utils/reporter.el: Removed mail-user-agent stuff.
+
+	* x11/x-menubar.el (default-menubar): Use new semantics for
+ 	`gnuserv-frame'.
+
+	* prim/obsolete.el (string-to-sequence): Wouldn't work with TYPE
+ 	`vector'.
+
+1997-09-19  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* cl/cl.el: Don't load cl-defs.
+
+	* cl/cl-macs.el: Added autoload cookies.
+
+1997-09-19  SL Baur  <steve@altair.xemacs.org>
+
+	* packages/man.el (Manual-buffers-have-prefix): New function.
+	(manual-entry): Use it.
+	From Remek Trzaska <remek@postoffice.npac.syr.edu>
+
+1997-09-18  Colin Rafferty  <craffert@ml.com>
+
+	* prim/novice.el (disable-command): Made it modify `custom-file'
+		  instead of `user-init-file'.
+
+		  Stop multiple disable/enable-command calls from adding
+			  extra newlines.
+
+1997-09-19  Tomasz Cholewo  <tjchol01@mecca.spd.louisville.edu>
+
+	* prim/make-docfile.el: Use null, not not.
+
+1997-09-18  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>
+
+	* prim/isearch-mode.el (isearch-message): Display-message as
+	progress (this way isearch message won't appear in the message 
+	log).
+
+1997-09-18  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>
+
+	* packages/info.el (Info-elisp-ref): Use `find-function-function'.
+
+1997-09-18  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>
+
+	* packages/lazy-lock.el (lazy-lock-pre-idle-fontify-windows):
+	Don't do lazy-lock'ing if we're in the minibuffer.
+
 1997-09-17  SL Baur  <steve@altair.xemacs.org>
 
+	* oobr/Makefile (autoloads): Fix target.
+
+	* hyperbole/Makefile (autoloads): Fix target.
+
+	* utils/autoload.el (batch-update-autoloads): Obey
+	`autoload-package-name' setting.
+
+	* efs/Makefile: Correct autoloads target.
+
 	* prim/packages.el (locate-library): Simplify regexp for
 	compression suffixes.
 	Suggested by: Hrvoje Niksic <hniksic@srce.hr>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/cl/auto-autoloads.el	Mon Aug 13 09:58:30 2007 +0200
@@ -0,0 +1,331 @@
+;;; DO NOT MODIFY THIS FILE
+(if (featurep 'cl-autoloads) (error "Already loaded"))
+
+;;;### (autoloads (compiler-macroexpand define-compiler-macro ignore-errors assert check-type typep deftype cl-struct-setf-expander defstruct define-modify-macro callf2 callf letf* letf rotatef shiftf remf cl-do-pop psetf setf get-setf-method defsetf define-setf-method declare the locally multiple-value-setq multiple-value-bind lexical-let* lexical-let symbol-macrolet macrolet labels flet progv psetq do-all-symbols do-symbols dotimes dolist do* do loop return-from return block etypecase typecase ecase case load-time-value eval-when destructuring-bind function* defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs" "cl/cl-macs.el")
+
+(autoload 'cl-compile-time-init "cl-macs" nil nil nil)
+
+(autoload 'gensym "cl-macs" "\
+Generate a new uninterned symbol.
+The name is made by appending a number to PREFIX, default \"G\"." nil nil)
+
+(autoload 'gentemp "cl-macs" "\
+Generate a new interned symbol with a unique name.
+The name is made by appending a number to PREFIX, default \"G\"." nil nil)
+
+(autoload 'defun* "cl-macs" "\
+(defun* NAME ARGLIST [DOCSTRING] BODY...): define NAME as a function.
+Like normal `defun', except ARGLIST allows full Common Lisp conventions,
+and BODY is implicitly surrounded by (block NAME ...)." nil 'macro)
+
+(autoload 'defmacro* "cl-macs" "\
+(defmacro* NAME ARGLIST [DOCSTRING] BODY...): define NAME as a macro.
+Like normal `defmacro', except ARGLIST allows full Common Lisp conventions,
+and BODY is implicitly surrounded by (block NAME ...)." nil 'macro)
+
+(autoload 'function* "cl-macs" "\
+(function* SYMBOL-OR-LAMBDA): introduce a function.
+Like normal `function', except that if argument is a lambda form, its
+ARGLIST allows full Common Lisp conventions." nil 'macro)
+
+(autoload 'destructuring-bind "cl-macs" nil nil 'macro)
+
+(autoload 'eval-when "cl-macs" "\
+(eval-when (WHEN...) BODY...): control when BODY is evaluated.
+If `compile' is in WHEN, BODY is evaluated when compiled at top-level.
+If `load' is in WHEN, BODY is evaluated when loaded after top-level compile.
+If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level." nil 'macro)
+
+(autoload 'load-time-value "cl-macs" "\
+Like `progn', but evaluates the body at load time.
+The result of the body appears to the compiler as a quoted constant." nil 'macro)
+
+(autoload 'case "cl-macs" "\
+(case EXPR CLAUSES...): evals EXPR, chooses from CLAUSES on that value.
+Each clause looks like (KEYLIST BODY...).  EXPR is evaluated and compared
+against each key in each KEYLIST; the corresponding BODY is evaluated.
+If no clause succeeds, case returns nil.  A single atom may be used in
+place of a KEYLIST of one atom.  A KEYLIST of `t' or `otherwise' is
+allowed only in the final clause, and matches if no other keys match.
+Key values are compared by `eql'." nil 'macro)
+
+(autoload 'ecase "cl-macs" "\
+(ecase EXPR CLAUSES...): like `case', but error if no case fits.
+`otherwise'-clauses are not allowed." nil 'macro)
+
+(autoload 'typecase "cl-macs" "\
+(typecase EXPR CLAUSES...): evals EXPR, chooses from CLAUSES on that value.
+Each clause looks like (TYPE BODY...).  EXPR is evaluated and, if it
+satisfies TYPE, the corresponding BODY is evaluated.  If no clause succeeds,
+typecase returns nil.  A TYPE of `t' or `otherwise' is allowed only in the
+final clause, and matches if no other keys match." nil 'macro)
+
+(autoload 'etypecase "cl-macs" "\
+(etypecase EXPR CLAUSES...): like `typecase', but error if no case fits.
+`otherwise'-clauses are not allowed." nil 'macro)
+
+(autoload 'block "cl-macs" "\
+(block NAME BODY...): define a lexically-scoped block named NAME.
+NAME may be any symbol.  Code inside the BODY forms can call `return-from'
+to jump prematurely out of the block.  This differs from `catch' and `throw'
+in two respects:  First, the NAME is an unevaluated symbol rather than a
+quoted symbol or other form; and second, NAME is lexically rather than
+dynamically scoped:  Only references to it within BODY will work.  These
+references may appear inside macro expansions, but not inside functions
+called from BODY." nil 'macro)
+
+(autoload 'return "cl-macs" "\
+(return [RESULT]): return from the block named nil.
+This is equivalent to `(return-from nil RESULT)'." nil 'macro)
+
+(autoload 'return-from "cl-macs" "\
+(return-from NAME [RESULT]): return from the block named NAME.
+This jump out to the innermost enclosing `(block NAME ...)' form,
+returning RESULT from that form (or nil if RESULT is omitted).
+This is compatible with Common Lisp, but note that `defun' and
+`defmacro' do not create implicit blocks as they do in Common Lisp." nil 'macro)
+
+(autoload 'loop "cl-macs" "\
+(loop CLAUSE...): The Common Lisp `loop' macro.
+Valid clauses are:
+  for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM,
+  for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR,
+  for VAR across ARRAY, repeat NUM, with VAR = INIT, while COND, until COND,
+  always COND, never COND, thereis COND, collect EXPR into VAR,
+  append EXPR into VAR, nconc EXPR into VAR, sum EXPR into VAR,
+  count EXPR into VAR, maximize EXPR into VAR, minimize EXPR into VAR,
+  if COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...],
+  unless COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...],
+  do EXPRS..., initially EXPRS..., finally EXPRS..., return EXPR,
+  finally return EXPR, named NAME." nil 'macro)
+
+(autoload 'do "cl-macs" "\
+The Common Lisp `do' loop.
+Format is: (do ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil 'macro)
+
+(autoload 'do* "cl-macs" "\
+The Common Lisp `do*' loop.
+Format is: (do* ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil 'macro)
+
+(autoload 'dolist "cl-macs" "\
+(dolist (VAR LIST [RESULT]) BODY...): loop over a list.
+Evaluate BODY with VAR bound to each `car' from LIST, in turn.
+Then evaluate RESULT to get return value, default nil." nil 'macro)
+
+(autoload 'dotimes "cl-macs" "\
+(dotimes (VAR COUNT [RESULT]) BODY...): loop a certain number of times.
+Evaluate BODY with VAR bound to successive integers from 0, inclusive,
+to COUNT, exclusive.  Then evaluate RESULT to get return value, default
+nil." nil 'macro)
+
+(autoload 'do-symbols "cl-macs" "\
+(dosymbols (VAR [OBARRAY [RESULT]]) BODY...): loop over all symbols.
+Evaluate BODY with VAR bound to each interned symbol, or to each symbol
+from OBARRAY." nil 'macro)
+
+(autoload 'do-all-symbols "cl-macs" nil nil 'macro)
+
+(autoload 'psetq "cl-macs" "\
+(psetq SYM VAL SYM VAL ...): set SYMs to the values VALs in parallel.
+This is like `setq', except that all VAL forms are evaluated (in order)
+before assigning any symbols SYM to the corresponding values." nil 'macro)
+
+(autoload 'progv "cl-macs" "\
+(progv SYMBOLS VALUES BODY...): bind SYMBOLS to VALUES dynamically in BODY.
+The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists.
+Each SYMBOL in the first list is bound to the corresponding VALUE in the
+second list (or made unbound if VALUES is shorter than SYMBOLS); then the
+BODY forms are executed and their result is returned.  This is much like
+a `let' form, except that the list of symbols can be computed at run-time." nil 'macro)
+
+(autoload 'flet "cl-macs" "\
+(flet ((FUNC ARGLIST BODY...) ...) FORM...): make temporary function defns.
+This is an analogue of `let' that operates on the function cell of FUNC
+rather than its value cell.  The FORMs are evaluated with the specified
+function definitions in place, then the definitions are undone (the FUNCs
+go back to their previous definitions, or lack thereof)." nil 'macro)
+
+(autoload 'labels "cl-macs" "\
+(labels ((FUNC ARGLIST BODY...) ...) FORM...): make temporary func bindings.
+This is like `flet', except the bindings are lexical instead of dynamic.
+Unlike `flet', this macro is fully complaint with the Common Lisp standard." nil 'macro)
+
+(autoload 'macrolet "cl-macs" "\
+(macrolet ((NAME ARGLIST BODY...) ...) FORM...): make temporary macro defns.
+This is like `flet', but for macros instead of functions." nil 'macro)
+
+(autoload 'symbol-macrolet "cl-macs" "\
+(symbol-macrolet ((NAME EXPANSION) ...) FORM...): make symbol macro defns.
+Within the body FORMs, references to the variable NAME will be replaced
+by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...)." nil 'macro)
+
+(autoload 'lexical-let "cl-macs" "\
+(lexical-let BINDINGS BODY...): like `let', but lexically scoped.
+The main visible difference is that lambdas inside BODY will create
+lexical closures as in Common Lisp." nil 'macro)
+
+(autoload 'lexical-let* "cl-macs" "\
+(lexical-let* BINDINGS BODY...): like `let*', but lexically scoped.
+The main visible difference is that lambdas inside BODY will create
+lexical closures as in Common Lisp." nil 'macro)
+
+(autoload 'multiple-value-bind "cl-macs" "\
+(multiple-value-bind (SYM SYM...) FORM BODY): collect multiple return values.
+FORM must return a list; the BODY is then executed with the first N elements
+of this list bound (`let'-style) to each of the symbols SYM in turn.  This
+is analogous to the Common Lisp `multiple-value-bind' macro, using lists to
+simulate true multiple return values.  For compatibility, (values A B C) is
+a synonym for (list A B C)." nil 'macro)
+
+(autoload 'multiple-value-setq "cl-macs" "\
+(multiple-value-setq (SYM SYM...) FORM): collect multiple return values.
+FORM must return a list; the first N elements of this list are stored in
+each of the symbols SYM in turn.  This is analogous to the Common Lisp
+`multiple-value-setq' macro, using lists to simulate true multiple return
+values.  For compatibility, (values A B C) is a synonym for (list A B C)." nil 'macro)
+
+(autoload 'locally "cl-macs" nil nil 'macro)
+
+(autoload 'the "cl-macs" nil nil 'macro)
+
+(autoload 'declare "cl-macs" nil nil 'macro)
+
+(autoload 'define-setf-method "cl-macs" "\
+(define-setf-method NAME ARGLIST BODY...): define a `setf' method.
+This method shows how to handle `setf's to places of the form (NAME ARGS...).
+The argument forms ARGS are bound according to ARGLIST, as if NAME were
+going to be expanded as a macro, then the BODY forms are executed and must
+return a list of five elements: a temporary-variables list, a value-forms
+list, a store-variables list (of length one), a store-form, and an access-
+form.  See `defsetf' for a simpler way to define most setf-methods." nil 'macro)
+
+(autoload 'defsetf "cl-macs" "\
+(defsetf NAME FUNC): define a `setf' method.
+This macro is an easy-to-use substitute for `define-setf-method' that works
+well for simple place forms.  In the simple `defsetf' form, `setf's of
+the form (setf (NAME ARGS...) VAL) are transformed to function or macro
+calls of the form (FUNC ARGS... VAL).  Example: (defsetf aref aset).
+Alternate form: (defsetf NAME ARGLIST (STORE) BODY...).
+Here, the above `setf' call is expanded by binding the argument forms ARGS
+according to ARGLIST, binding the value form VAL to STORE, then executing
+BODY, which must return a Lisp form that does the necessary `setf' operation.
+Actually, ARGLIST and STORE may be bound to temporary variables which are
+introduced automatically to preserve proper execution order of the arguments.
+Example: (defsetf nth (n x) (v) (list 'setcar (list 'nthcdr n x) v))." nil 'macro)
+
+(autoload 'get-setf-method "cl-macs" "\
+Return a list of five values describing the setf-method for PLACE.
+PLACE may be any Lisp form which can appear as the PLACE argument to
+a macro like `setf' or `incf'." nil nil)
+
+(autoload 'setf "cl-macs" "\
+(setf PLACE VAL PLACE VAL ...): set each PLACE to the value of its VAL.
+This is a generalized version of `setq'; the PLACEs may be symbolic
+references such as (car x) or (aref x i), as well as plain symbols.
+For example, (setf (cadar x) y) is equivalent to (setcar (cdar x) y).
+The return value is the last VAL in the list." nil 'macro)
+
+(autoload 'psetf "cl-macs" "\
+(psetf PLACE VAL PLACE VAL ...): set PLACEs to the values VALs in parallel.
+This is like `setf', except that all VAL forms are evaluated (in order)
+before assigning any PLACEs to the corresponding values." nil 'macro)
+
+(autoload 'cl-do-pop "cl-macs" nil nil nil)
+
+(autoload 'remf "cl-macs" "\
+(remf PLACE TAG): remove TAG from property list PLACE.
+PLACE may be a symbol, or any generalized variable allowed by `setf'.
+The form returns true if TAG was found and removed, nil otherwise." nil 'macro)
+
+(autoload 'shiftf "cl-macs" "\
+(shiftf PLACE PLACE... VAL): shift left among PLACEs.
+Example: (shiftf A B C) sets A to B, B to C, and returns the old A.
+Each PLACE may be a symbol, or any generalized variable allowed by `setf'." nil 'macro)
+
+(autoload 'rotatef "cl-macs" "\
+(rotatef PLACE...): rotate left among PLACEs.
+Example: (rotatef A B C) sets A to B, B to C, and C to A.  It returns nil.
+Each PLACE may be a symbol, or any generalized variable allowed by `setf'." nil 'macro)
+
+(autoload 'letf "cl-macs" "\
+(letf ((PLACE VALUE) ...) BODY...): temporarily bind to PLACEs.
+This is the analogue of `let', but with generalized variables (in the
+sense of `setf') for the PLACEs.  Each PLACE is set to the corresponding
+VALUE, then the BODY forms are executed.  On exit, either normally or
+because of a `throw' or error, the PLACEs are set back to their original
+values.  Note that this macro is *not* available in Common Lisp.
+As a special case, if `(PLACE)' is used instead of `(PLACE VALUE)',
+the PLACE is not modified before executing BODY." nil 'macro)
+
+(autoload 'letf* "cl-macs" "\
+(letf* ((PLACE VALUE) ...) BODY...): temporarily bind to PLACEs.
+This is the analogue of `let*', but with generalized variables (in the
+sense of `setf') for the PLACEs.  Each PLACE is set to the corresponding
+VALUE, then the BODY forms are executed.  On exit, either normally or
+because of a `throw' or error, the PLACEs are set back to their original
+values.  Note that this macro is *not* available in Common Lisp.
+As a special case, if `(PLACE)' is used instead of `(PLACE VALUE)',
+the PLACE is not modified before executing BODY." nil 'macro)
+
+(autoload 'callf "cl-macs" "\
+(callf FUNC PLACE ARGS...): set PLACE to (FUNC PLACE ARGS...).
+FUNC should be an unquoted function name.  PLACE may be a symbol,
+or any generalized variable allowed by `setf'." nil 'macro)
+
+(autoload 'callf2 "cl-macs" "\
+(callf2 FUNC ARG1 PLACE ARGS...): set PLACE to (FUNC ARG1 PLACE ARGS...).
+Like `callf', but PLACE is the second argument of FUNC, not the first." nil 'macro)
+
+(autoload 'define-modify-macro "cl-macs" "\
+(define-modify-macro NAME ARGLIST FUNC): define a `setf'-like modify macro.
+If NAME is called, it combines its PLACE argument with the other arguments
+from ARGLIST using FUNC: (define-modify-macro incf (&optional (n 1)) +)" nil 'macro)
+
+(autoload 'defstruct "cl-macs" "\
+(defstruct (NAME OPTIONS...) (SLOT SLOT-OPTS...)...): define a struct type.
+This macro defines a new Lisp data type called NAME, which contains data
+stored in SLOTs.  This defines a `make-NAME' constructor, a `copy-NAME'
+copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors." nil 'macro)
+
+(autoload 'cl-struct-setf-expander "cl-macs" nil nil nil)
+
+(autoload 'deftype "cl-macs" "\
+(deftype NAME ARGLIST BODY...): define NAME as a new data type.
+The type name can then be used in `typecase', `check-type', etc." nil 'macro)
+
+(autoload 'typep "cl-macs" "\
+Check that OBJECT is of type TYPE.
+TYPE is a Common Lisp-style type specifier." nil nil)
+
+(autoload 'check-type "cl-macs" "\
+Verify that FORM is of type TYPE; signal an error if not.
+STRING is an optional description of the desired type." nil 'macro)
+
+(autoload 'assert "cl-macs" "\
+Verify that FORM returns non-nil; signal an error if not.
+Second arg SHOW-ARGS means to include arguments of FORM in message.
+Other args STRING and ARGS... are arguments to be passed to `error'.
+They are not evaluated unless the assertion fails.  If STRING is
+omitted, a default message listing FORM itself is used." nil 'macro)
+
+(autoload 'ignore-errors "cl-macs" "\
+Execute FORMS; if an error occurs, return nil.
+Otherwise, return result of last FORM." nil 'macro)
+
+(autoload 'define-compiler-macro "cl-macs" "\
+(define-compiler-macro FUNC ARGLIST BODY...): Define a compiler-only macro.
+This is like `defmacro', but macro expansion occurs only if the call to
+FUNC is compiled (i.e., not interpreted).  Compiler macros should be used
+for optimizing the way calls to FUNC are compiled; the form returned by
+BODY should do the same thing as a call to the normal function called
+FUNC, though possibly more efficiently.  Note that, like regular macros,
+compiler macros are expanded repeatedly until no further expansions are
+possible.  Unlike regular macros, BODY can decide to \"punt\" and leave the
+original function call alone by declaring an initial `&whole foo' parameter
+and then returning foo." nil 'macro)
+
+(autoload 'compiler-macroexpand "cl-macs" nil nil nil)
+
+;;;***
+
+(provide 'cl-autoloads)
--- a/lisp/cl/cl-macs.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/cl/cl-macs.el	Mon Aug 13 09:58:30 2007 +0200
@@ -91,6 +91,8 @@
 ;; Patch broken Emacs 18 compiler (re top-level macros).
 ;; Emacs 19 compiler doesn't need this patch.
 ;; Also, undo broken definition of `eql' that uses same bytecode as `eq'.
+
+;;;###autoload
 (defun cl-compile-time-init ()
   (setq cl-old-bc-file-form (symbol-function 'byte-compile-file-form))
   (or (fboundp 'byte-compile-flush-pending)   ; Emacs 19 compiler?
@@ -108,6 +110,8 @@
 ;;; Symbols.
 
 (defvar *gensym-counter*)
+
+;;;###autoload
 (defun gensym (&optional arg)
   "Generate a new uninterned symbol.
 The name is made by appending a number to PREFIX, default \"G\"."
@@ -117,6 +121,7 @@
 		 (setq *gensym-counter* (1+ *gensym-counter*))))))
     (make-symbol (format "%s%d" prefix num))))
 
+;;;###autoload
 (defun gentemp (&optional arg)
   "Generate a new interned symbol with a unique name.
 The name is made by appending a number to PREFIX, default \"G\"."
@@ -129,6 +134,7 @@
 
 ;;; Program structure.
 
+;;;###autoload
 (defmacro defun* (name args &rest body)
   "(defun* NAME ARGLIST [DOCSTRING] BODY...): define NAME as a function.
 Like normal `defun', except ARGLIST allows full Common Lisp conventions,
@@ -137,6 +143,7 @@
 	 (form (list* 'defun name (cdr res))))
     (if (car res) (list 'progn (car res) form) form)))
 
+;;;###autoload
 (defmacro defmacro* (name args &rest body)
   "(defmacro* NAME ARGLIST [DOCSTRING] BODY...): define NAME as a macro.
 Like normal `defmacro', except ARGLIST allows full Common Lisp conventions,
@@ -145,6 +152,7 @@
 	 (form (list* 'defmacro name (cdr res))))
     (if (car res) (list 'progn (car res) form) form)))
 
+;;;###autoload
 (defmacro function* (func)
   "(function* SYMBOL-OR-LAMBDA): introduce a function.
 Like normal `function', except that if argument is a lambda form, its
@@ -355,6 +363,7 @@
 	    (setq res (nconc res (cl-arglist-args arg))))))
       (nconc res (and args (list args))))))
 
+;;;###autoload
 (defmacro destructuring-bind (args expr &rest body)
   (let* ((bind-lets nil) (bind-forms nil) (bind-inits nil)
 	 (bind-defs nil) (bind-block 'cl-none))
@@ -368,6 +377,7 @@
 
 (defvar cl-not-toplevel nil)
 
+;;;###autoload
 (defmacro eval-when (when &rest body)
   "(eval-when (WHEN...) BODY...): control when BODY is evaluated.
 If `compile' is in WHEN, BODY is evaluated when compiled at top-level.
@@ -404,6 +414,7 @@
 The result of the body appears to the compiler as a quoted constant."
 	     (list 'quote (eval (cons 'progn body))))))
 
+;;;###autoload
 (defmacro load-time-value (form &optional read-only)
   "Like `progn', but evaluates the body at load time.
 The result of the body appears to the compiler as a quoted constant."
@@ -429,6 +440,7 @@
 
 ;;; Conditional control structures.
 
+;;;###autoload
 (defmacro case (expr &rest clauses)
   "(case EXPR CLAUSES...): evals EXPR, chooses from CLAUSES on that value.
 Each clause looks like (KEYLIST BODY...).  EXPR is evaluated and compared
@@ -462,11 +474,13 @@
     (if (eq temp expr) body
       (list 'let (list (list temp expr)) body))))
 
+;;;###autoload
 (defmacro ecase (expr &rest clauses)
   "(ecase EXPR CLAUSES...): like `case', but error if no case fits.
 `otherwise'-clauses are not allowed."
   (list* 'case expr (append clauses '((ecase-error-flag)))))
 
+;;;###autoload
 (defmacro typecase (expr &rest clauses)
   "(typecase EXPR CLAUSES...): evals EXPR, chooses from CLAUSES on that value.
 Each clause looks like (TYPE BODY...).  EXPR is evaluated and, if it
@@ -492,6 +506,7 @@
     (if (eq temp expr) body
       (list 'let (list (list temp expr)) body))))
 
+;;;###autoload
 (defmacro etypecase (expr &rest clauses)
   "(etypecase EXPR CLAUSES...): like `typecase', but error if no case fits.
 `otherwise'-clauses are not allowed."
@@ -500,6 +515,7 @@
 
 ;;; Blocks and exits.
 
+;;;###autoload
 (defmacro block (name &rest body)
   "(block NAME BODY...): define a lexically-scoped block named NAME.
 NAME may be any symbol.  Code inside the BODY forms can call `return-from'
@@ -535,11 +551,13 @@
     (if cl-found (setcdr cl-found t)))
   (byte-compile-normal-call (cons 'throw (cdr cl-form))))
 
+;;;###autoload
 (defmacro return (&optional res)
   "(return [RESULT]): return from the block named nil.
 This is equivalent to `(return-from nil RESULT)'."
   (list 'return-from nil res))
 
+;;;###autoload
 (defmacro return-from (name &optional res)
   "(return-from NAME [RESULT]): return from the block named NAME.
 This jump out to the innermost enclosing `(block NAME ...)' form,
@@ -559,6 +577,7 @@
 (defvar loop-result) (defvar loop-result-explicit)
 (defvar loop-result-var) (defvar loop-steps) (defvar loop-symbol-macs)
 
+;;;###autoload
 (defmacro loop (&rest args)
   "(loop CLAUSE...): The Common Lisp `loop' macro.
 Valid clauses are:
@@ -1120,11 +1139,13 @@
 
 ;;; Other iteration control structures.
 
+;;;###autoload
 (defmacro do (steps endtest &rest body)
   "The Common Lisp `do' loop.
 Format is: (do ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)"
   (cl-expand-do-loop steps endtest body nil))
 
+;;;###autoload
 (defmacro do* (steps endtest &rest body)
   "The Common Lisp `do*' loop.
 Format is: (do* ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)"
@@ -1151,6 +1172,7 @@
 						 (apply 'append sets)))))))
 	       (or (cdr endtest) '(nil)))))
 
+;;;###autoload
 (defmacro dolist (spec &rest body)
   "(dolist (VAR LIST [RESULT]) BODY...): loop over a list.
 Evaluate BODY with VAR bound to each `car' from LIST, in turn.
@@ -1165,6 +1187,7 @@
 		     (cons (list 'setq (car spec) nil) (cdr (cdr spec)))
 		   '(nil))))))
 
+;;;###autoload
 (defmacro dotimes (spec &rest body)
   "(dotimes (VAR COUNT [RESULT]) BODY...): loop a certain number of times.
 Evaluate BODY with VAR bound to successive integers from 0, inclusive,
@@ -1177,6 +1200,7 @@
 			(append body (list (list 'incf (car spec)))))
 		 (or (cdr (cdr spec)) '(nil))))))
 
+;;;###autoload
 (defmacro do-symbols (spec &rest body)
   "(dosymbols (VAR [OBARRAY [RESULT]]) BODY...): loop over all symbols.
 Evaluate BODY with VAR bound to each interned symbol, or to each symbol
@@ -1189,12 +1213,14 @@
 		     (and (cadr spec) (list (cadr spec))))
 	      (caddr spec))))
 
+;;;###autoload
 (defmacro do-all-symbols (spec &rest body)
   (list* 'do-symbols (list (car spec) nil (cadr spec)) body))
 
 
 ;;; Assignments.
 
+;;;###autoload
 (defmacro psetq (&rest args)
   "(psetq SYM VAL SYM VAL ...): set SYMs to the values VALs in parallel.
 This is like `setq', except that all VAL forms are evaluated (in order)
@@ -1204,6 +1230,7 @@
 
 ;;; Binding control structures.
 
+;;;###autoload
 (defmacro progv (symbols values &rest body)
   "(progv SYMBOLS VALUES BODY...): bind SYMBOLS to VALUES dynamically in BODY.
 The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists.
@@ -1217,6 +1244,7 @@
 	      '(cl-progv-after))))
 
 ;;; This should really have some way to shadow 'byte-compile properties, etc.
+;;;###autoload
 (defmacro flet (bindings &rest body)
   "(flet ((FUNC ARGLIST BODY...) ...) FORM...): make temporary function defns.
 This is an analogue of `let' that operates on the function cell of FUNC
@@ -1242,6 +1270,7 @@
 	  bindings)
 	 body))
 
+;;;###autoload
 (defmacro labels (bindings &rest body)
   "(labels ((FUNC ARGLIST BODY...) ...) FORM...): make temporary func bindings.
 This is like `flet', except the bindings are lexical instead of dynamic.
@@ -1261,6 +1290,7 @@
 
 ;; The following ought to have a better definition for use with newer
 ;; byte compilers.
+;;;###autoload
 (defmacro macrolet (bindings &rest body)
   "(macrolet ((NAME ARGLIST BODY...) ...) FORM...): make temporary macro defns.
 This is like `flet', but for macros instead of functions."
@@ -1275,6 +1305,7 @@
 			    (cons (list* name 'lambda (cdr res))
 				  cl-macro-environment))))))
 
+;;;###autoload
 (defmacro symbol-macrolet (bindings &rest body)
   "(symbol-macrolet ((NAME EXPANSION) ...) FORM...): make symbol macro defns.
 Within the body FORMs, references to the variable NAME will be replaced
@@ -1289,6 +1320,7 @@
 				cl-macro-environment)))))
 
 (defvar cl-closure-vars nil)
+;;;###autoload
 (defmacro lexical-let (bindings &rest body)
   "(lexical-let BINDINGS BODY...): like `let', but lexically scoped.
 The main visible difference is that lambdas inside BODY will create
@@ -1330,6 +1362,7 @@
 			   vars))
 	    ebody))))
 
+;;;###autoload
 (defmacro lexical-let* (bindings &rest body)
   "(lexical-let* BINDINGS BODY...): like `let*', but lexically scoped.
 The main visible difference is that lambdas inside BODY will create
@@ -1349,6 +1382,7 @@
 
 ;;; Multiple values.
 
+;;;###autoload
 (defmacro multiple-value-bind (vars form &rest body)
   "(multiple-value-bind (SYM SYM...) FORM BODY): collect multiple return values.
 FORM must return a list; the BODY is then executed with the first N elements
@@ -1364,6 +1398,7 @@
 			       vars))
 	   body)))
 
+;;;###autoload
 (defmacro multiple-value-setq (vars form)
   "(multiple-value-setq (SYM SYM...) FORM): collect multiple return values.
 FORM must return a list; the first N elements of this list are stored in
@@ -1388,7 +1423,9 @@
 
 ;;; Declarations.
 
+;;;###autoload
 (defmacro locally (&rest body) (cons 'progn body))
+;;;###autoload
 (defmacro the (type form) form)
 
 (defvar cl-proclaim-history t)    ; for future compilers
@@ -1447,6 +1484,7 @@
   (while p (cl-do-proclaim (cl-pop p) t))
   (setq cl-proclaims-deferred nil))
 
+;;;###autoload
 (defmacro declare (&rest specs)
   (if (cl-compiling-file)
       (while specs
@@ -1458,6 +1496,7 @@
 
 ;;; Generalized variables.
 
+;;;###autoload
 (defmacro define-setf-method (func args &rest body)
   "(define-setf-method NAME ARGLIST BODY...): define a `setf' method.
 This method shows how to handle `setf's to places of the form (NAME ARGS...).
@@ -1473,6 +1512,7 @@
 	  (list (cl-transform-function-property
 		 func 'setf-method (cons args body)))))
 
+;;;###autoload
 (defmacro defsetf (func arg1 &rest args)
   "(defsetf NAME FUNC): define a `setf' method.
 This macro is an easy-to-use substitute for `define-setf-method' that works
@@ -1788,6 +1828,7 @@
 	  (cons 'list (mapcar 'fifth methods)))))
 
 ;;; Getting and optimizing setf-methods.
+;;;###autoload
 (defun get-setf-method (place &optional env)
   "Return a list of five values describing the setf-method for PLACE.
 PLACE may be any Lisp form which can appear as the PLACE argument to
@@ -1855,6 +1896,7 @@
        (not (eq (car-safe (symbol-function (car form))) 'macro))))
 
 ;;; The standard modify macros.
+;;;###autoload
 (defmacro setf (&rest args)
   "(setf PLACE VAL PLACE VAL ...): set each PLACE to the value of its VAL.
 This is a generalized version of `setq'; the PLACEs may be symbolic
@@ -1871,6 +1913,7 @@
 	     (store (cl-setf-do-store (nth 1 method) (nth 1 args))))
 	(if (car method) (list 'let* (car method) store) store)))))
 
+;;;###autoload
 (defmacro psetf (&rest args)
   "(psetf PLACE VAL PLACE VAL ...): set PLACEs to the values VALs in parallel.
 This is like `setf', except that all VAL forms are evaluated (in order)
@@ -1892,6 +1935,7 @@
 	  (setq expr (list 'setf (cadr args) (list 'prog1 (car args) expr))))
 	(list 'progn expr nil)))))
 
+;;;###autoload
 (defun cl-do-pop (place)
   (if (cl-simple-expr-p place)
       (list 'prog1 (list 'car place) (list 'setf place (list 'cdr place)))
@@ -1904,6 +1948,7 @@
 		  (list 'car temp)
 		  (cl-setf-do-store (nth 1 method) (list 'cdr temp)))))))
 
+;;;###autoload
 (defmacro remf (place tag)
   "(remf PLACE TAG): remove TAG from property list PLACE.
 PLACE may be a symbol, or any generalized variable allowed by `setf'.
@@ -1924,6 +1969,7 @@
 		      t)
 		(list 'cl-do-remf tval ttag)))))
 
+;;;###autoload
 (defmacro shiftf (place &rest args)
   "(shiftf PLACE PLACE... VAL): shift left among PLACEs.
 Example: (shiftf A B C) sets A to B, B to C, and returns the old A.
@@ -1944,6 +1990,7 @@
 				 (cl-setf-do-store (nth 1 method) form))))))
       form)))
 
+;;;###autoload
 (defmacro rotatef (&rest args)
   "(rotatef PLACE...): rotate left among PLACEs.
 Example: (rotatef A B C) sets A to B, B to C, and C to A.  It returns nil.
@@ -1967,6 +2014,7 @@
 	(list 'let* (append (car method) (list (list temp (nth 2 method))))
 	      (cl-setf-do-store (nth 1 method) form) nil)))))
 
+;;;###autoload
 (defmacro letf (bindings &rest body)
   "(letf ((PLACE VALUE) ...) BODY...): temporarily bind to PLACEs.
 This is the analogue of `let', but with generalized variables (in the
@@ -2021,6 +2069,7 @@
 		rev (cdr rev))))
       (list* 'let* lets body))))
 
+;;;###autoload
 (defmacro letf* (bindings &rest body)
   "(letf* ((PLACE VALUE) ...) BODY...): temporarily bind to PLACEs.
 This is the analogue of `let*', but with generalized variables (in the
@@ -2037,6 +2086,7 @@
       (setq body (list (list* 'letf (list (cl-pop bindings)) body))))
     (car body)))
 
+;;;###autoload
 (defmacro callf (func place &rest args)
   "(callf FUNC PLACE ARGS...): set PLACE to (FUNC PLACE ARGS...).
 FUNC should be an unquoted function name.  PLACE may be a symbol,
@@ -2049,6 +2099,7 @@
 			      (list* 'funcall (list 'function func)
 				     rargs))))))
 
+;;;###autoload
 (defmacro callf2 (func arg1 place &rest args)
   "(callf2 FUNC ARG1 PLACE ARGS...): set PLACE to (FUNC ARG1 PLACE ARGS...).
 Like `callf', but PLACE is the second argument of FUNC, not the first."
@@ -2063,6 +2114,7 @@
 				(list* 'funcall (list 'function func)
 				       rargs)))))))
 
+;;;###autoload
 (defmacro define-modify-macro (name arglist func &optional doc)
   "(define-modify-macro NAME ARGLIST FUNC): define a `setf'-like modify macro.
 If NAME is called, it combines its PLACE argument with the other arguments
@@ -2077,6 +2129,7 @@
 
 ;;; Structures.
 
+;;;###autoload
 (defmacro defstruct (struct &rest descs)
   "(defstruct (NAME OPTIONS...) (SLOT SLOT-OPTS...)...): define a struct type.
 This macro defines a new Lisp data type called NAME, which contains data
@@ -2295,6 +2348,7 @@
 	     forms)
     (cons 'progn (nreverse (cons (list 'quote name) forms)))))
 
+;;;###autoload
 (defun cl-struct-setf-expander (x name accessor pred-form pos)
   (let* ((temp (gensym "--x--")) (store (gensym "--store--")))
     (list (list temp) (list x) (list store)
@@ -2320,6 +2374,7 @@
 
 ;;; Types and assertions.
 
+;;;###autoload
 (defmacro deftype (name args &rest body)
   "(deftype NAME ARGLIST BODY...): define NAME as a new data type.
 The type name can then be used in `typecase', `check-type', etc."
@@ -2362,11 +2417,13 @@
 	  ((eq (car-safe type) 'satisfies) (list (cadr type) val))
 	  (t (error "Bad type spec: %s" type)))))
 
+;;;###autoload
 (defun typep (val type)   ; See compiler macro below.
   "Check that OBJECT is of type TYPE.
 TYPE is a Common Lisp-style type specifier."
   (eval (cl-make-type-test 'val type)))
 
+;;;###autoload
 (defmacro check-type (form type &optional string)
   "Verify that FORM is of type TYPE; signal an error if not.
 STRING is an optional description of the desired type."
@@ -2380,6 +2437,7 @@
 	 (if (eq temp form) (list 'progn body nil)
 	   (list 'let (list (list temp form)) body nil)))))
 
+;;;###autoload
 (defmacro assert (form &optional show-args string &rest args)
   "Verify that FORM returns non-nil; signal an error if not.
 Second arg SHOW-ARGS means to include arguments of FORM in message.
@@ -2401,6 +2459,7 @@
 			     (list* 'list (list 'quote form) sargs))))
 	       nil))))
 
+;;;###autoload
 (defmacro ignore-errors (&rest body)
   "Execute FORMS; if an error occurs, return nil.
 Otherwise, return result of last FORM."
@@ -2493,6 +2552,7 @@
 
 ;;; Compiler macros.
 
+;;;###autoload
 (defmacro define-compiler-macro (func args &rest body)
   "(define-compiler-macro FUNC ARGLIST BODY...): Define a compiler-only macro.
 This is like `defmacro', but macro expansion occurs only if the call to
@@ -2516,6 +2576,7 @@
 	      (list 'put (list 'quote func) '(quote byte-compile)
 		    '(quote cl-byte-compile-compiler-macro)))))
 
+;;;###autoload
 (defun compiler-macroexpand (form)
   (while
       (let ((func (car-safe form)) (handler nil))
--- a/lisp/cl/cl.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/cl/cl.el	Mon Aug 13 09:58:30 2007 +0200
@@ -653,7 +653,7 @@
 (or (fboundp 'add-hook) (defalias 'add-hook 'cl-add-hook))
 
 ;; XEmacs change
-(load "cl-defs")
+;(load "cl-defs")
 
 ;;; Define data for indentation and edebug.
 (mapcar (function
--- a/lisp/custom/ChangeLog	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/custom/ChangeLog	Mon Aug 13 09:58:30 2007 +0200
@@ -1,3 +1,11 @@
+Fri Sep 19 11:21:15 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+	* Version 1.9960 released.
+
+Fri Sep 19 11:16:37 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+	* Version 1.9959 released.
+
 Mon Sep 15 19:40:19 1997  Per Abrahamsen  <abraham@dina.kvl.dk>
 
 	* Version 1.9958 released.
--- a/lisp/custom/cus-edit.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/custom/cus-edit.el	Mon Aug 13 09:58:30 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9958
+;; Version: 1.9960
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
--- a/lisp/custom/cus-face.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/custom/cus-face.el	Mon Aug 13 09:58:30 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9958
+;; Version: 1.9960
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;;; Commentary:
--- a/lisp/custom/custom.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/custom/custom.el	Mon Aug 13 09:58:30 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
-;; Version: 1.9958
+;; Version: 1.9960
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
@@ -31,8 +31,13 @@
 ;; This file only contain the code needed to declare and initialize
 ;; user options.  The code to customize options is autoloaded from
 ;; `cus-edit.el'. 
-
+;;
 ;; The code implementing face declarations is in `cus-face.el'
+;;
+;; IMPORTANT: This version of custom is for Emacs 19.34 and XEmacs
+;; 19.15 - 20.2 only.  If you use Emacs 20.1, XEmacs 20.3, or anything
+;; newer, please use the version of custom bundled with your emacs.
+;; If you use an older emacs, please upgrade.
 
 ;;; Code:
 
--- a/lisp/custom/wid-browse.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/custom/wid-browse.el	Mon Aug 13 09:58:30 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: extensions
-;; Version: 1.9958
+;; Version: 1.9960
 ;; 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:57:40 2007 +0200
+++ b/lisp/custom/wid-edit.el	Mon Aug 13 09:58:30 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: extensions
-;; Version: 1.9958
+;; Version: 1.9960
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
--- a/lisp/custom/widget-example.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/custom/widget-example.el	Mon Aug 13 09:58:30 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, extensions, faces, hypermedia
-;; Version: 1.9958
+;; Version: 1.9960
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 (require 'widget)
--- a/lisp/custom/widget.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/custom/widget.el	Mon Aug 13 09:58:30 2007 +0200
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, extensions, faces, hypermedia
-;; Version: 1.9958
+;; Version: 1.9960
 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
 
 ;; This file is part of GNU Emacs.
@@ -30,6 +30,11 @@
 ;;
 ;; This file only contain the code needed to define new widget types.
 ;; Everything else is autoloaded from `wid-edit.el'.
+;;
+;; IMPORTANT: This version of widget is for Emacs 19.34 and XEmacs
+;; 19.15 - 20.2 only.  If you use Emacs 20.1, XEmacs 20.3, or anything
+;; newer, please use the version of widget bundled with your emacs.
+;; If you use an older emacs, please upgrade.
 
 ;;; Code:
 
--- a/lisp/efs/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/efs/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -2,7 +2,7 @@
 #
 # File:         Makefile
 # Release:      $efs release: 1.15 $
-# Version:      $Revision: 1.8 $
+# Version:      $Revision: 1.9 $
 # RCS:
 # Description:  Makefile for byte-compiling efs and dired.
 # Author:       Andy Norman, HPLabs, Bristol, UK.
@@ -307,6 +307,7 @@
 auto-autoloads.el: $(EFSSRC) $(DSRC) efs-x19.15.el $(XESRC) $(MULESRC)
 	$(EMACS) -batch -q -no-site-file \
 		-eval '(setq autoload-target-directory "'`pwd`'/")' \
+		-eval '(setq autoload-package-name "efs")' \
 		-l autoload \
 		-f batch-update-autoloads $?
 
--- a/lisp/hyperbole/ChangeLog	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/hyperbole/ChangeLog	Mon Aug 13 09:58:30 2007 +0200
@@ -1,3 +1,7 @@
+1997-09-17  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile (autoloads): Fixup dependency.
+
 1997-07-08  Steven L Baur  <steve@altair.xemacs.org>
 
 	* hact.el (action:commandp): Don't reference bytecode objects as
--- a/lisp/hyperbole/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/hyperbole/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -264,5 +264,6 @@
 auto-autoloads.el: $(EL_SRC) $(EL_COMPILE) $(EL_KOTL)
 	$(EMACS) -batch -q -no-site-file \
 		-eval '(setq autoload-target-directory "'`pwd`'/")' \
+		-eval '(setq autoload-package-name "hyperbole")' \
 		-l autoload \
 		-f batch-update-autoloads $?
--- a/lisp/modes/cperl-mode.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/modes/cperl-mode.el	Mon Aug 13 09:58:30 2007 +0200
@@ -1,19 +1,21 @@
 ;;; This code started from the following message of long time ago (IZ):
 
-;;; From: olson@mcs.anl.gov (Bob Olson)
-;;; Newsgroups: comp.lang.perl
-;;; Subject: cperl-mode: Another perl mode for Gnuemacs
-;;; Date: 14 Aug 91 15:20:01 GMT
-
-;; Perl code editing commands for Emacs
+;;;; From: olson@mcs.anl.gov (Bob Olson)
+;;;; Newsgroups: comp.lang.perl
+;;;; Subject: cperl-mode: Another perl mode for Gnuemacs
+;;;; Date: 14 Aug 91 15:20:01 GMT
+
+;; Perl code editing commands for XEmacs
 ;; Copyright (C) 1985-1996 Bob Olson, Ilya Zakharevich
-
-;; This file is not (yet) part of GNU Emacs. It may be distributed
-;; either under the same terms as GNU Emacs, or under the same terms
-;; as Perl. You should have received a copy of Perl Artistic license
-;; along with the Perl distribution.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; Copyright (C) 1997 granted to FSF for changes made by
+;; Karl M. Hegbloom <karlheg@inetarena.com>
+
+;; This file is part of XEmacs. It may be distributed either under the
+;; same terms as XEmacs, or under the same terms as Perl. You should
+;; have received a copy of Perl Artistic license along with the Perl
+;; distribution.
+
+;; 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.
@@ -28,38 +30,25 @@
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
-
 ;;; Corrections made by Ilya Zakharevich ilya@math.mps.ohio-state.edu
 ;;; XEmacs changes by Peter Arius arius@informatik.uni-erlangen.de
 ;;; 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:
-
-;; (autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs" t)
-
-;;; You can either fine-tune the bells and whistles of this mode or
-;;; bulk enable them by putting
-
-;; (setq cperl-hairy t)
-
-;;; in your .emacs file. (Emacs rulers do not consider it politically
-;;; correct to make whistles enabled by default.)
+;; Original Vendor Version Number:  (mostly based on...)
+;; $Id: cperl-mode.el,v 1.13 1997/09/20 22:15:08 steve Exp $
+
+;; Increment the final digit once per XEmacs-only revision, the other
+;; for merges.  (sound ok?)
+;;;  XEmacs Version Number: 1.35-1
+
+;; This mode should autoload when you edit a perl file under XEmacs.
 
 ;;; DO NOT FORGET to read micro-docs. (available from `Perl' menu). <<<<<<
 ;;; or as help on variables `cperl-tips', `cperl-problems',         <<<<<<
-;;; `cperl-non-problems'.                                           <<<<<<
-
-;;; Additional useful commands to put into your .emacs file:
-
-;; (setq auto-mode-alist
-;;       (append '(("\\.[pP][Llm]$" . perl-mode))  auto-mode-alist ))
-;; (setq interpreter-mode-alist (append interpreter-mode-alist
-;; 				        '(("miniperl" . perl-mode))))
-
-;;; The mode information (on C-h m) provides customization help.
+;;; `cperl-non-problems', `cperl-praise'.                           <<<<<<
+
+;;; The mode information (on C-h m) provides some customization help.
 ;;; If you use font-lock feature of this mode, it is advisable to use
 ;;; either lazy-lock-mode or fast-lock-mode (available on ELisp
 ;;; archive in files lazy-lock.el and fast-lock.el). I prefer lazy-lock.
@@ -68,15 +57,16 @@
 ;;; and control flow words, one for each: comments, string, labels,
 ;;; functions definitions and packages, arrays, hashes, and variable
 ;;; definitions. If you do not see all these faces, your font-lock does
-;;; not define them, so you need to define them manually. Maybe you have 
-;;; an obsolete font-lock from 19.28 or earlier. Upgrade.
+;;; not define them, so you need to define them manually.
 
 ;;; If you have a grayscale monitor, and do not have the variable
 ;;; font-lock-display-type bound to 'grayscale, insert 
 
 ;;; (setq font-lock-display-type 'grayscale)
 
-;;; into your .emacs file.
+;;; into your .xemacs/init.el file.
+
+;;;; ? what about this `imenu' stuff?  Is it worth it?
 
 ;;;; This mode supports font-lock, imenu and mode-compile. In the
 ;;;; hairy version font-lock is on, but you should activate imenu
@@ -347,7 +337,8 @@
 ;;;; After 1.30
 ;;;  All the keywords from keywords.pl included (maybe with dummy explanation).
 ;;;  No auto-help inside strings, comment, here-docs, formats, and pods.
-;;;  Shrinkwrapping of info, regulated by `cperl-max-help-size'.
+;;;  Shrinkwrapping of info, regulated by `cperl-max-help-size',
+;;;  `cperl-shrink-wrap-info-frame'.
 ;;;  Info on variables as well.
 ;;;  Recognision of HERE-DOCS improved yet more.
 ;;;  Autonewline works on `}' without warnings.
@@ -355,8 +346,99 @@
 
 ;;;; After 1.31
 ;;;  perl-descr.el found its author - hi, Johan!
-
-(defvar cperl-extra-newline-before-brace nil
+;;;  Some support for correct indent after here-docs and friends (may
+;;;  be superseeded by eminent change to Emacs internals).
+;;;  Should work with older Emaxen as well ( `-style stuff removed).
+
+;;;; After 1.32
+
+;;;  Started to add support for `syntax-table' property (should work
+;;;  with patched Emaxen), controlled by
+;;;  `cperl-use-syntax-table-text-property'. Currently recognized:
+;;;    All quote-like operators: m, s, y, tr, qq, qw, qx, q,
+;;;    // in most frequent context: 
+;;;          after block or
+;;;                    ~ { ( = | & + - * ! , ;
+;;;          or 
+;;;                    while if unless until and or not xor split grep map
+;;;    Here-documents, formats, PODs, 
+;;;    ${...}
+;;;    'abc$'
+;;;    sub a ($); sub a ($) {}
+;;;  (provide 'cperl-mode) was missing!
+;;;  `cperl-after-expr-p' is now much smarter after `}'.
+;;;  `cperl-praise' added to mini-docs.
+;;;  Utilities try to support subs-with-prototypes.
+
+;;;; After 1.32.1
+;;;  `cperl-after-expr-p' is now much smarter after "() {}" and "word {}":
+;;;     if word is "else, map, grep".
+;;;  Updated for new values of syntax-table constants.
+;;;  Uses `help-char' (at last!) (disabled, does not work?!)
+;;;  A couple of regexps where missing _ in character classes.
+;;;  -s could be considered as start of regexp, 1../blah/ was not,
+;;;  as was not /blah/ at start of file.
+
+;;;; After 1.32.2
+;;;  "\C-hv" was wrongly "\C-hf"
+;;;  C-hv was not working on `[index()]' because of [] in skip-chars-*.
+;;;  `__PACKAGE__' supported.
+;;;  Thanks for Greg Badros: `cperl-lazy-unstall' is more complete,
+;;;  `cperl-get-help' is made compatible with `query-replace'.
+
+;;;; As of Apr 15, development version of 19.34 supports
+;;;; `syntax-table' text properties. Try setting
+;;;; `cperl-use-syntax-table-text-property'.
+
+;;;; After 1.32.3
+;;;  We scan for s{}[] as well.
+;;;  We scan for $blah'foo as well.
+;;;  The default is to use `syntax-table' text property if Emacs is good enough.
+;;;  `cperl-lineup' is put on C-M-| (=C-M-S-\\).
+;;;  Start of `cperl-beautify-regexp'.
+
+;;;; After 1.32.4
+;;; `cperl-tags-hier-init' did not work in text-mode.
+;;; `cperl-noscan-files-regexp' had a misprint.
+;;; Generation of Class Hierarchy was broken due to a bug in `x-popup-menu'
+;;;  in 19.34.
+
+;;;; After 1.33:
+;;; my,local highlight vars after {} too.
+;;; TAGS could not be created before imenu was loaded.
+;;; `cperl-indent-left-aligned-comments' created.
+;;; Logic of `cperl-indent-exp' changed a little bit, should be more
+;;;  robust w.r.t. multiline strings.
+;;; Recognition of blah'foo takes into account strings.
+;;; Added '.al' to the list of Perl extensions.
+;;; Class hierarchy is "mostly" sorted (need to rethink algorthm
+;;;  of pruning one-root-branch subtrees to get yet better sorting.)
+;;; Regeneration of TAGS was busted.
+;;; Can use `syntax-table' property when generating TAGS
+;;;  (governed by  `cperl-use-syntax-table-text-property-for-tags').
+
+(defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version))
+
+
+;;---------------------------------------------------------
+(defgroup perl nil
+  "CPerl mode 1.35 with XEmacs enhancements."
+  :prefix "cperl"
+  :group 'languages)
+
+;;-----------------------------------------------
+(defgroup cperl-indent nil
+  "CPerl indention control variables."
+  :prefix "cperl"
+  :group 'perl)
+
+(defcustom cperl-tab-always-indent t
+  "*Non-nil means TAB in CPerl mode should always reindent the current line,
+regardless of where in the line point is when the TAB command is used."
+  :type 'boolean
+  :group 'cperl-indent)
+
+(defcustom cperl-extra-newline-before-brace nil
   "*Non-nil means that if, elsif, while, until, else, for, foreach
 and do constructs look like:
 
@@ -368,130 +450,248 @@
 
 	if () {
 	}
-")
-
-(defvar cperl-indent-level 2
-  "*Indentation of CPerl statements with respect to containing block.")
-(defvar cperl-lineup-step nil
+"
+  :type 'boolean
+  :group 'cperl-indent)
+
+(defcustom cperl-indent-level 2
+  "*Indentation of CPerl statements with respect to containing block."
+  :type '(choice (const 1) (const 2) (const 4) (const 6) (const 8))
+  :group 'cperl-indent)
+
+(defcustom cperl-lineup-step nil
   "*`cperl-lineup' will always lineup at multiple of this number.
-If `nil', the value of `cperl-indent-level' will be used.")
-(defvar cperl-brace-imaginary-offset 0
+If `nil', the value of `cperl-indent-level' will be used."
+  :type '(choice (const nil) (const 1) (const 2) (const 4) (const 6) (const 8))
+  :group 'cperl-indent)
+
+(defcustom cperl-brace-imaginary-offset 0
   "*Imagined indentation of a Perl open brace that actually follows a statement.
 An open brace following other text is treated as if it were this far
-to the right of the start of its line.")
-(defvar cperl-brace-offset 0
-  "*Extra indentation for braces, compared with other text in same context.")
-(defvar cperl-label-offset -2
-  "*Offset of CPerl label lines relative to usual indentation.")
-(defvar cperl-min-label-indent 1
-  "*Minimal offset of CPerl label lines.")
-(defvar cperl-continued-statement-offset 2
-  "*Extra indent for lines not starting new statements.")
-(defvar cperl-continued-brace-offset 0
+to the right of the start of its line."
+  :type '(choice (const 0) (const 1) (const 2) (const 4) (const 6) (const 8))
+  :group 'cperl-indent)
+
+(defcustom cperl-brace-offset 0
+  "*Extra indentation for braces, compared with other text in same context."
+  :type '(choice (const 0) (const 1) (const 2) (const 4) (const 6) (const 8))
+  :group 'cperl-indent)
+
+(defcustom cperl-label-offset -2
+  "*Offset of CPerl label lines relative to usual indentation."
+  :type '(choice (const -4) (const -2) (const -1))
+  :group 'cperl-indent)
+
+(defcustom cperl-min-label-indent 1
+  "*Minimal offset of CPerl label lines."
+  :type '(choice (const 1) (const 2) (const 4))
+  :group 'cperl-indent)
+
+(defcustom cperl-continued-statement-offset 2
+  "*Extra indent for lines not starting new statements."
+  :type '(choice (const 2) (const 4) (const 6) (const 8))
+  :group 'cperl-indent)
+
+(defcustom cperl-continued-brace-offset 0
   "*Extra indent for substatements that start with open-braces.
-This is in addition to cperl-continued-statement-offset.")
-(defvar cperl-close-paren-offset -1
-  "*Extra indent for substatements that start with close-parenthesis.")
-
-(defvar cperl-auto-newline nil
+This is in addition to cperl-continued-statement-offset."
+  :type '(choice (const 0) (const 1) (const 2) (const 4) (const 6) (const 8))
+  :group 'cperl-indent)
+
+(defcustom cperl-close-paren-offset -1
+  "*Extra indent for substatements that start with close-parenthesis."
+  :type '(choice (const -4) (const -3) (const -2) (const -1) (const 0))
+  :group 'cperl-indent)
+
+(defcustom cperl-regexp-indent-step nil
+  "*indentation used when beautifying regexps.
+If `nil', the value of `cperl-indent-level' will be used."
+  :type '(choice (const nil) (const 0) (const 2) (const 4) (const 6) (const 8))
+  :group 'cperl-indent)
+
+(defcustom cperl-indent-left-aligned-comments t
+  "*Non-nil means that the comment starting in leftmost column should indent."
+  :type 'boolean
+  :group 'cperl-indent)
+
+;;-------------------------------------------
+
+(defcustom cperl-hairy nil
+  "*Not-nil means all the bells and whistles are enabled in CPerl."
+  :type 'boolean
+  :group 'perl)
+
+(defcustom cperl-auto-newline nil
   "*Non-nil means automatically newline before and after braces,
 and after colons and semicolons, inserted in CPerl code. The following
 \\[cperl-electric-backspace] will remove the inserted whitespace.
 Insertion after colons requires both this variable and 
-`cperl-auto-newline-after-colon' set.")
-
-(defvar cperl-auto-newline-after-colon nil
+`cperl-auto-newline-after-colon' set."
+  :type 'boolean
+  :group 'perl)
+
+(defcustom cperl-auto-newline-after-colon nil
   "*Non-nil means automatically newline even after colons.
-Subject to `cperl-auto-newline' setting.")
-
-(defvar cperl-tab-always-indent t
-  "*Non-nil means TAB in CPerl mode should always reindent the current line,
-regardless of where in the line point is when the TAB command is used.")
-
-(defvar cperl-font-lock nil
-  "*Non-nil (and non-null) means CPerl buffers will use font-lock-mode.
-Can be overwritten by `cperl-hairy' if nil.")
-
-(defvar cperl-electric-lbrace-space nil
-  "*Non-nil (and non-null) means { after $ in CPerl buffers should be preceeded by ` '.
-Can be overwritten by `cperl-hairy' if nil.")
-
-(defvar cperl-electric-parens-string "({[]})<"
-  "*String of parentheses that should be electric in CPerl.")
-
-(defvar cperl-electric-parens nil
+Subject to `cperl-auto-newline' setting."
+  :type 'boolean
+  :group 'perl)
+
+;;--------------------------------------
+(defgroup cperl-electric nil
+  "Customizable electric behaviour."
+  :prefix "cperl"
+  :group 'perl)
+
+(defcustom cperl-electric-lbrace-space nil
+  "*Non-nil (and non-null) means { after $ in CPerl buffers should be preceded by ` '.
+Can be overwritten by `cperl-hairy' if nil."
+  :type 'boolean
+  :group 'cperl-electric)
+
+(defcustom cperl-electric-parens-string "({[]})<"
+  "*String of parentheses that should be electric in CPerl."
+  :type 'string
+  :group 'cperl-electric)
+
+(defcustom cperl-electric-parens nil
   "*Non-nil (and non-null) means parentheses should be electric in CPerl.
-Can be overwritten by `cperl-hairy' if nil.")
-(defvar cperl-electric-parens-mark  
-  (and window-system
-       (or (and (boundp 'transient-mark-mode) ; For Emacs
-		transient-mark-mode)
-	   (and (boundp 'zmacs-regions) ; For XEmacs
-		zmacs-regions)))
+Can be overwritten by `cperl-hairy' if nil."
+  :type 'boolean
+  :group 'cperl-electric)
+
+(defcustom cperl-electric-parens-mark (and window-system
+					   (boundp 'zmacs-regions)
+					   zmacs-regions)
   "*Not-nil means that electric parens look for active mark.
-Default is yes if there is visual feedback on mark.")
-
-(defvar cperl-electric-parens-mark (and window-system transient-mark-mode)
-  "*Not-nil means that electric parens look for active mark.
-Default is yes if there is visual feedback on mark.")
-
-(defvar cperl-electric-linefeed nil
+Default is yes if there is visual feedback on mark."
+  :type 'boolean
+  :group 'cperl-electric)
+
+(defcustom cperl-electric-linefeed nil
   "*If true, LFD should be hairy in CPerl, otherwise C-c LFD is hairy.
 In any case these two mean plain and hairy linefeeds together.
-Can be overwritten by `cperl-hairy' if nil.")
-
-(defvar cperl-electric-keywords nil
+Can be overwritten by `cperl-hairy' if nil."
+  :type 'boolean
+  :group 'cperl-electric)
+
+(defcustom cperl-electric-keywords nil
   "*Not-nil (and non-null) means keywords are electric in CPerl.
-Can be overwritten by `cperl-hairy' if nil.")
-
-(defvar cperl-hairy nil
-  "*Not-nil means all the bells and whistles are enabled in CPerl.")
-
-(defvar cperl-comment-column 32
-  "*Column to put comments in CPerl (use \\[cperl-indent]' to lineup with code).")
-
-(defvar cperl-vc-header-alist '((SCCS "$sccs = '%W\%' ;")
-				(RCS "$rcs = ' $Id\$ ' ;"))
+Can be overwritten by `cperl-hairy' if nil."
+  :type 'boolean
+  :group 'cperl-electric)
+;;-------------------------
+
+(defcustom cperl-comment-column 32
+  "*Column to put comments in CPerl (use \\[cperl-indent]' to lineup with code)."
+  :type 'integer
+  :group 'perl)
+
+(defcustom cperl-vc-header-alist '((RCS "$rcs = ' $Id\$ ' ;")
+				   (CVS "$cvs = ' $Id\$ ' ;")
+				   (SCCS "$sccs = '%W\%' ;"))
   "*What to use as `vc-header-alist' in CPerl.")
 
-(defvar cperl-info-on-command-no-prompt nil
+
+(defcustom cperl-info-on-command-no-prompt nil
   "*Not-nil (and non-null) means not to prompt on C-h f.
 The opposite behaviour is always available if prefixed with C-c.
-Can be overwritten by `cperl-hairy' if nil.")
-
-(defvar cperl-lazy-help-time nil
-  "*Not-nil (and non-null) means to show lazy help after given idle time.")
-
-(defvar cperl-pod-face 'font-lock-comment-face
-  "*The result of evaluation of this expression is used for pod highlighting.")
-
-(defvar cperl-pod-head-face 'font-lock-variable-name-face
-  "*The result of evaluation of this expression is used for pod highlighting.
-Font for POD headers.")
-
-(defvar cperl-here-face 'font-lock-string-face
-  "*The result of evaluation of this expression is used for here-docs highlighting.")
-
-(defvar cperl-pod-here-fontify '(featurep 'font-lock)
-  "*Not-nil after evaluation means to highlight pod and here-docs sections.")
-
-(defvar cperl-pod-here-scan t
+Can be overwritten by `cperl-hairy' if nil."
+  :type 'boolean
+  :group 'perl)
+
+(defcustom cperl-help nil
+  "*Not-nil (and non-null) means to show Auto help."
+  :type 'boolean
+  :group 'perl)
+
+
+(defcustom cperl-font-lock (and (boundp 'font-lock-auto-fontify)
+				font-lock-auto-fontify)
+  "*Non-nil (and non-null) means CPerl buffers will use font-lock-mode.
+Can be overwritten by `cperl-hairy' if nil.  If never set, it will be
+set to the value of `font-lock-auto-fontify'."
+  :type 'boolean
+  :group 'perl)
+
+;;--------------------------------------------
+(defgroup cperl-faces nil
+  "Font lock faces for CPerl mode."
+  :group 'perl
+  :group 'faces)
+
+(defface cperl-pod-face
+    '(( ((class color) (background light)) (:foreground "brown4") )
+      ( ((class color) (background dark)) (:foreground "brown1") ))
+  "*The face used for POD highlighting."
+  :group 'cperl-faces)
+
+(defface cperl-pod-head-face
+  '(( ((class color)) (:foreground "steelblue")))
+  "*The face used for POD headers."
+  :group 'cperl-faces)
+
+(defface cperl-here-face 
+    '(( ((class color)) (:foreground "green") ))
+  "*The result of evaluation of this expression is used for here-docs highlighting."
+  :group 'cperl-faces)
+
+(defcustom cperl-pod-here-fontify '(featurep 'font-lock)
+  "*Not-nil after evaluation means to highlight pod and here-docs sections."
+  :type 'boolean
+  :group 'perl)
+
+(defcustom cperl-pod-here-scan t
   "*Not-nil means look for pod and here-docs sections during startup.
-You can always make lookup from menu or using \\[cperl-find-pods-heres].")
-
-(defvar cperl-imenu-addback nil
-  "*Not-nil means add backreferences to generated `imenu's.
-May require patched `imenu' and `imenu-go'.")
-
-(defvar cperl-max-help-size 66
-  "*Non-nil means shrink-wrapping of info-buffer allowed up to these percents.")
-
-(defvar cperl-shrink-wrap-info-frame t
-  "*Non-nil means shrink-wrapping of info-buffer-frame allowed.")
-
-(defvar cperl-info-page "perl"
-  "Name of the info page containing perl docs.
-Older version of this page was called `perl5', newer `perl'.")
+You can always make lookup from menu or using \\[cperl-find-pods-heres]."
+  :type 'boolean
+  :group 'perl)
+
+;; ToDo: perhaps `imenu' should be ported to XEmacs?
+;;(defcustom cperl-imenu-addback nil
+;;  "*Not-nil means add backreferences to generated `imenu's.
+;;May require patched `imenu' and `imenu-go'."
+;;  :type 'boolean
+;;  :group 'perl)
+
+(defcustom cperl-max-help-size 66
+  "*Non-nil means shrink-wrapping of info-buffer allowed up to these percents."
+  :type 'integer
+  :group 'perl)
+
+(defcustom cperl-shrink-wrap-info-frame t
+  "*Non-nil means shrink-wrapping of info-buffer-frame allowed."
+  :type 'boolean
+  :group 'perl)
+
+(defcustom cperl-info-page "perl"
+  "*Name of the info page containing perl docs.
+Older version of this page was called `perl5', newer `perl'."
+  :type 'string
+  :group 'perl)
+
+(defvar cperl-use-syntax-table-text-property nil
+  "Temporary kludge until I find everything connected to this so I can
+  rip it out.")
+
+;;(defcustom cperl-use-syntax-table-text-property 
+;;    (boundp 'parse-sexp-lookup-properties)
+;;  "*Non-nil means CPerl sets up and uses `syntax-table' text property."
+;;  :type 'boolean
+;;  :group 'perl)
+
+(defvar cperl-use-syntax-table-text-property-for-tags 
+  cperl-use-syntax-table-text-property
+  "*Non-nil means: set up and use `syntax-table' text property generating TAGS.")
+
+(defcustom cperl-scan-files-regexp "\\.\\([pP][Llm]\\|xs\\)$"
+  "*Regexp to match files to scan when generating TAGS."
+  :type 'regexp
+  :group 'perl)
+
+(defcustom cperl-noscan-files-regexp "/\\(\\.\\.?\\|SCCS\\|RCS\\|blib\\)$"
+  "*Regexp to match files/dirs to skip when generating TAGS."
+  :type 'regexp
+  :group 'perl)
 
 
 
@@ -503,6 +703,8 @@
 and/or
   ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
 
+ This particular version has been modified for XEmacs 20.
+
 Get support packages choose-color.el (or font-lock-extra.el before
 19.30), imenu-go.el from the same place.  \(Look for other files there
 too... ;-) Get a patch for imenu.el in 19.29.  Note that for 19.30 and
@@ -548,7 +750,8 @@
 This may be confusing, since the regexp s#//#/#\; may be highlighted
 as a comment, but it will be recognized as a regexp by the indentation
 code. Or the opposite case, when a pod section is highlighted, but
-breaks the indentation of the following code.
+may break the indentation of the following code (though indentation
+should work if the balance of delimiters is not broken by POD).
 
 The main trick (to make $ a \"backslash\") makes constructions like
 ${aaa} look like unbalanced braces. The only trick I can think of is
@@ -564,15 +767,15 @@
 Most the time, if you write your own code, you may find an equivalent
 \(and almost as readable) expression.
 
-Try to help it: add comments with embedded quotes to fix CPerl
+Try to help CPerl: add comments with embedded quotes to fix CPerl
 misunderstandings about the end of quotation:
 
 $a='500$';      # ';
 
 You won't need it too often. The reason: $ \"quotes\" the following
 character (this saves a life a lot of times in CPerl), thus due to
-Emacs parsing rules it does not consider tick after the dollar as a
-closing one, but as a usual character.
+Emacs parsing rules it does not consider tick (i.e., ' ) after a
+dollar as a closing one, but as a usual character.
 
 Now the indentation code is pretty wise. The only drawback is that it
 relies on Emacs parsing to find matching parentheses. And Emacs
@@ -607,17 +810,78 @@
 `car' before `imenu-choose-buffer-index' in `imenu'.
 ")
 
+(defvar cperl-praise 'please-ignore-this-line
+  "RMS asked me to list good things about CPerl. Here they go:
+
+0) It uses the newest `syntax-table' property ;-);
+
+1) It does 99% of Perl syntax correct (as opposed to 80-90% in Perl
+mode - but the latter number may have improved too in last years) even 
+without `syntax-table' property; When using this property, it should 
+handle 99.995% of lines correct - or somesuch.
+
+2) It is generally belived to be \"the most user-friendly Emacs
+package\" whatever it may mean (I doubt that the people who say similar
+things tried _all_ the rest of Emacs ;-), but this was not a lonely
+voice);
+
+3) Everything is customizable, one-by-one or in a big sweep;
+
+4) It has many easily-accessable \"tools\":
+        a) Can run program, check syntax, start debugger;
+        b) Can lineup vertically \"middles\" of rows, like `=' in
+                a  = b;
+                cc = d;
+        c) Can insert spaces where this impoves readability (in one
+                interactive sweep over the buffer);
+        d) Has support for imenu, including:
+                1) Separate unordered list of \"interesting places\";
+                2) Separate TOC of POD sections;
+                3) Separate list of packages;
+                4) Hierarchical view of methods in (sub)packages;
+                5) and functions (by the full name - with package);
+        e) Has an interface to INFO docs for Perl; The interface is
+                very flexible, including shrink-wrapping of
+                documentation buffer/frame;
+        f) Has a builtin list of one-line explanations for perl constructs.
+        g) Can show these explanations if you stay long enough at the
+                corresponding place (or on demand);
+        h) Has an enhanced fontification (using 3 or 4 additional faces
+                comparing to font-lock - basically, different
+                namespaces in Perl have different colors);
+        i) Can construct TAGS basing on its knowledge of Perl syntax,
+                the standard menu has 6 different way to generate
+                TAGS (if by directory, .xs files - with C-language
+                bindings - are included in the scan);
+        j) Can build a hierarchical view of classes (via imenu) basing
+                on generated TAGS file;
+        k) Has electric parentheses, electric newlines, uses Abbrev
+                for electric logical constructs
+                        while () {}
+                with different styles of expansion (context sensitive
+                to be not so bothering). Electric parentheses behave
+                \"as they should\" in a presence of a visible region.
+        l) Changes msb.el \"on the fly\" to insert a group \"Perl files\";
+
+5) The indentation engine was very smart, but most of tricks may be
+not needed anymore with the support for `syntax-table' property. Has
+progress indicator for indentation (with `imenu' loaded).
+
+6) Indent-region improves inline-comments as well;
+
+7) Fill-paragraph correctly handles multi-line comments;
+")
+
 
 
 ;;; Portability stuff:
 
-(defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version))
 (defmacro cperl-define-key (fsf-key definition &optional xemacs-key)
-  `(define-key cperl-mode-map
-     ,(if xemacs-key
-	  `(if cperl-xemacs-p ,xemacs-key ,fsf-key)
-	fsf-key)
-     ,definition))
+  (` (define-key cperl-mode-map
+       (, (if xemacs-key
+	      (` (if cperl-xemacs-p (, xemacs-key) (, fsf-key)))
+	    fsf-key))
+       (, definition))))
 
 (defvar del-back-ch (car (append (where-is-internal 'delete-backward-char)
 				 (where-is-internal 'backward-delete-char-untabify)))
@@ -664,11 +928,16 @@
   (put-text-property (max (point-min) (1- from))
 		     to cperl-do-not-fontify t))
 
+(defcustom cperl-mode-hook nil
+  "Hook run by `cperl-mode'."
+  :type 'sexp
+  :group 'perl)
+
 
 ;;; Probably it is too late to set these guys already, but it can help later:
 
 (setq auto-mode-alist
-      (append '(("\\.[pP][Llm]$" . perl-mode))  auto-mode-alist ))
+      (append '(("\\.\\([pP][Llm]\\|al\\)\\'" . perl-mode))  auto-mode-alist ))
 (and (boundp 'interpreter-mode-alist)
      (setq interpreter-mode-alist (append interpreter-mode-alist
 					  '(("miniperl" . perl-mode)))))
@@ -707,22 +976,33 @@
   (cperl-define-key ")" 'cperl-electric-rparen)
   (cperl-define-key ";" 'cperl-electric-semi)
   (cperl-define-key ":" 'cperl-electric-terminator)
+  (cperl-define-key "\C-cf" 'cperl-find-pods-heres)
   (cperl-define-key "\C-j" 'newline-and-indent)
   (cperl-define-key "\C-c\C-j" 'cperl-linefeed)
   (cperl-define-key "\C-c\C-a" 'cperl-toggle-auto-newline)
   (cperl-define-key "\C-c\C-k" 'cperl-toggle-abbrev)
   (cperl-define-key "\C-c\C-e" 'cperl-toggle-electric)
   (cperl-define-key "\e\C-q" 'cperl-indent-exp) ; Usually not bound
+  (cperl-define-key [?\C-\M-\|] 'cperl-lineup)
   ;;(cperl-define-key "\M-q" 'cperl-fill-paragraph)
   ;;(cperl-define-key "\e;" 'cperl-indent-for-comment)
-  (cperl-define-key 'backspace 'cperl-electric-backspace)
-  (cperl-define-key 'delete 'cperl-electric-delete)
+  (if cperl-xemacs-p
+      (progn
+        (cperl-define-key 'backspace 'cperl-electric-backspace)
+        (cperl-define-key 'delete 'cperl-electric-delete))
+      (cperl-define-key "\177" 'cperl-electric-backspace))
   (cperl-define-key "\t" 'cperl-indent-command)
   ;; don't clobber the backspace binding:
-  (cperl-define-key "\C-hf" 'cperl-info-on-command [(control h) f])
   (cperl-define-key "\C-c\C-hf" 'cperl-info-on-current-command
 		    [(control c) (control h) f])
-  (cperl-define-key "\C-hv" 'cperl-get-help [(control h) v])
+  (cperl-define-key "\C-hf"
+		    ;;(concat (char-to-string help-char) "f") ; does not work
+		    'cperl-info-on-command
+		    [(control h) f])
+  (cperl-define-key "\C-hv"
+		    ;;(concat (char-to-string help-char) "v") ; does not work
+		    'cperl-get-help
+		    [(control h) v])
   (if (and cperl-xemacs-p 
 	   (<= emacs-minor-version 11) (<= emacs-major-version 19))
       (progn
@@ -753,7 +1033,10 @@
 	   ["Mark function" mark-defun t]
 	   ["Indent expression" cperl-indent-exp t]
 	   ["Fill paragraph/comment" cperl-fill-paragraph t]
+	   "----"
 	   ["Line up a construction" cperl-lineup (cperl-use-region-p)]
+	   ["Beautify a regexp" cperl-beautify-regexp
+	    cperl-use-syntax-table-text-property]
 	   "----"
 	   ["Indent region" cperl-indent-region (cperl-use-region-p)]
 	   ["Comment region" cperl-comment-region (cperl-use-region-p)]
@@ -768,41 +1051,40 @@
 	   ["Debugger" cperl-db t]
 	   "----"
 	   ("Tools"
-	    ["Imenu" imenu (fboundp 'imenu)]
+;;;	    ["Imenu" imenu (fboundp 'imenu)]
 	    ["Insert spaces if needed" cperl-find-bad-style t]
 	    ["Class Hierarchy from TAGS" cperl-tags-hier-init t]
 	    ;;["Update classes" (cperl-tags-hier-init t) tags-table-list]
-	    ["Imenu on info" cperl-imenu-on-info (featurep 'imenu)]
+;;;	    ["Imenu on info" cperl-imenu-on-info (featurep 'imenu)]
 	    ("Tags"
-;;;	     ["Create tags for current file" cperl-etags t]
-;;;	     ["Add tags for current file" (cperl-etags t) t]
-;;;	     ["Create tags for Perl files in directory" (cperl-etags nil t) t]
-;;;	     ["Add tags for Perl files in directory" (cperl-etags t t) t]
-;;;	     ["Create tags for Perl files in (sub)directories" 
-;;;	      (cperl-etags nil 'recursive) t]
-;;;	     ["Add tags for Perl files in (sub)directories"
-;;;	      (cperl-etags t 'recursive) t]) 
+	     ["Create tags for current file" cperl-etags t]
+	     ["Add tags for current file" (cperl-etags t) t]
+	     ["Create tags for Perl files in directory" (cperl-etags nil t) t]
+	     ["Add tags for Perl files in directory" (cperl-etags t t) t]
+	     ["Create tags for Perl files in (sub)directories" 
+	      (cperl-etags nil 'recursive) t]
+	     ["Add tags for Perl files in (sub)directories"
+	      (cperl-etags t 'recursive) t]) 
 ;;;; cperl-write-tags (&optional file erase recurse dir inbuffer)
-	     ["Create tags for current file" (cperl-write-tags nil t) t]
-	     ["Add tags for current file" (cperl-write-tags) t]
-	     ["Create tags for Perl files in directory" 
-	      (cperl-write-tags nil t nil t) t]
-	     ["Add tags for Perl files in directory" 
-	      (cperl-write-tags nil nil nil t) t]
-	     ["Create tags for Perl files in (sub)directories" 
-	      (cperl-write-tags nil t t t) t]
-	     ["Add tags for Perl files in (sub)directories"
-	      (cperl-write-tags nil nil t t) t])
+;;;	     ["Create tags for current file" (cperl-write-tags nil t) t]
+;;;	     ["Add tags for current file" (cperl-write-tags) t]
+;;;	     ["Create tags for Perl files in directory" 
+;;;	      (cperl-write-tags nil t nil t) t]
+;;;	     ["Add tags for Perl files in directory" 
+;;;	      (cperl-write-tags nil nil nil t) t]
+;;;	     ["Create tags for Perl files in (sub)directories" 
+;;;	      (cperl-write-tags nil t t t) t]
+;;;	     ["Add tags for Perl files in (sub)directories"
+;;;	      (cperl-write-tags nil nil t t) t])
 	    ["Recalculate PODs and HEREs" cperl-find-pods-heres t]
-	    ["Define word at point" imenu-go-find-at-position 
-	     (fboundp 'imenu-go-find-at-position)]
+;;;	    ["Define word at point" imenu-go-find-at-position 
+;;;	     (fboundp 'imenu-go-find-at-position)]
 	    ["Help on function" cperl-info-on-command t]
 	    ["Help on function at point" cperl-info-on-current-command t]
 	    ["Help on symbol at point" cperl-get-help t]
-	    ["Auto-help on" cperl-lazy-install (fboundp 'run-with-idle-timer)]
-	    ["Auto-help off" cperl-lazy-unstall 
-	     (fboundp 'run-with-idle-timer)])
+	    )
 	   ("Toggle..."
+	    ["Auto-help" cperl-toggle-help :style toggle :selected cperl-help]
 	    ["Auto newline" cperl-toggle-auto-newline t]
 	    ["Electric parens" cperl-toggle-electric t]
 	    ["Electric keywords" cperl-toggle-abbrev t]
@@ -812,11 +1094,13 @@
 	    ["C++" (cperl-set-style "C++") t]
 	    ["FSF" (cperl-set-style "FSF") t]
 	    ["BSD" (cperl-set-style "BSD") t]
-	    ["Whitesmith" (cperl-set-style "Whitesmith") t])
+	    ["Whitesmith" (cperl-set-style "Whitesmith") t]
+	    )
 	   ("Micro-docs"
 	    ["Tips" (describe-variable 'cperl-tips) t]
 	    ["Problems" (describe-variable 'cperl-problems) t]
-	    ["Non-problems" (describe-variable 'cperl-non-problems) t]))))
+	    ["Non-problems" (describe-variable 'cperl-non-problems) t]
+	    ["Praise" (describe-variable 'cperl-praise) t]))))
   (error nil))
 
 (autoload 'c-macro-expand "cmacexp"
@@ -827,6 +1111,9 @@
 (defvar cperl-mode-syntax-table nil
   "Syntax table in use in Cperl-mode buffers.")
 
+(defvar cperl-string-syntax-table nil
+  "Syntax table in use in Cperl-mode string-like chunks.")
+
 (if cperl-mode-syntax-table
     ()
   (setq cperl-mode-syntax-table (make-syntax-table))
@@ -845,9 +1132,13 @@
   (modify-syntax-entry ?# "<" cperl-mode-syntax-table)
   (modify-syntax-entry ?' "\"" cperl-mode-syntax-table)
   (modify-syntax-entry ?` "\"" cperl-mode-syntax-table)
-  (modify-syntax-entry ?_ "_" cperl-mode-syntax-table)
+  (modify-syntax-entry ?_ "w" cperl-mode-syntax-table)
   (modify-syntax-entry ?: "_" cperl-mode-syntax-table)
-  (modify-syntax-entry ?| "." cperl-mode-syntax-table))
+  (modify-syntax-entry ?| "." cperl-mode-syntax-table)
+  (setq cperl-string-syntax-table (copy-syntax-table cperl-mode-syntax-table))
+  (modify-syntax-entry ?$ "." cperl-string-syntax-table)
+  (modify-syntax-entry ?# "." cperl-string-syntax-table) ; (?# comment )
+)
 
 
 
@@ -862,6 +1153,7 @@
 
 ;; provide an alias for working with emacs 19.  the perl-mode that comes
 ;; with it is really bad, and this lets us seamlessly replace it.
+;;;;;###autoload here please.
 (fset 'perl-mode 'cperl-mode)
 (defun cperl-mode ()
   "Major mode for editing Perl code.
@@ -944,6 +1236,10 @@
 is nil.  It is also possible to switch this on/off from the
 menu. Requires `run-with-idle-timer'.
 
+Use \\[cperl-lineup] to vertically lineup some construction - put the
+beginning of the region at the start of construction, and make region
+span the needed amount of lines.
+
 Variables `cperl-pod-here-scan', `cperl-pod-here-fontify',
 `cperl-pod-face', `cperl-pod-head-face' control processing of pod and
 here-docs sections. In a future version results of scan may be used
@@ -1008,12 +1304,15 @@
 	(local-set-key "\C-C\C-J" 'newline-and-indent)))
   (if (cperl-val 'cperl-info-on-command-no-prompt)
       (progn
-	;; don't clobber the backspace binding:
+	;; don't clobber the backspace binding for Ye Olde Emacs
+	;;(cperl-define-key "\C-hf" 'cperl-info-on-current-command [(control h) f])
+        (cperl-define-key "\C-hf" 'cperl-info-on-current-command [f1 f])
 	(cperl-define-key "\C-hf" 'cperl-info-on-current-command [(control h) f])
 	(cperl-define-key "\C-c\C-hf" 'cperl-info-on-command
 			  [(control c) (control h) f])))
-  (setq major-mode 'perl-mode)
-  (setq mode-name "CPerl")
+  (setq major-mode 'perl-mode
+	mode-name "CPerl"
+	cperl-mode t)
   (if (not cperl-mode-abbrev-table)
       (let ((prev-a-c abbrevs-changed))
 	(define-abbrev-table 'cperl-mode-abbrev-table '(
@@ -1049,7 +1348,7 @@
   (make-local-variable 'comment-start-skip)
   (setq comment-start-skip "#+ *")
   (make-local-variable 'defun-prompt-regexp)
-  (setq defun-prompt-regexp "^[ \t]*sub[ \t]+\\([^ \t\n{;]+\\)[ \t]*")
+  (setq defun-prompt-regexp "^[ \t]*sub[ \t]+\\([^ \t\n{(;]+\\)[ \t]*")
   (make-local-variable 'comment-indent-function)
   (setq comment-indent-function 'cperl-comment-indent)
   (make-local-variable 'parse-sexp-ignore-comments)
@@ -1071,6 +1370,11 @@
 	  '((perl-font-lock-keywords
 	     perl-font-lock-keywords-1
 	     perl-font-lock-keywords-2))))
+  (if cperl-use-syntax-table-text-property
+      (progn
+	(make-variable-buffer-local 'parse-sexp-lookup-properties)
+	;; Do not introduce variable if not needed, we check it!
+	(set 'parse-sexp-lookup-properties t)))
   (or (fboundp 'cperl-old-auto-fill-mode)
       (progn
 	(fset 'cperl-old-auto-fill-mode (symbol-function 'auto-fill-mode))
@@ -1273,7 +1577,7 @@
 	   (skip-chars-backward "$")
 	   (looking-at "\\(\\$\\$\\)*\\$\\([^\\$]\\|$\\)"))
 	 (insert ? ))
-    (if (cperl-after-expr-p nil "{};)") nil (setq cperl-auto-newline nil))
+    (if (cperl-after-expr-p nil "{;)") nil (setq cperl-auto-newline nil))
     (cperl-electric-brace arg)
     (and (cperl-val 'cperl-electric-parens)
 	 (eq last-command-char ?{)
@@ -1302,7 +1606,7 @@
 	     (>= (save-excursion (cperl-to-comment-or-eol) (point)) (point))
 	     ;;(not (save-excursion (search-backward "#" beg t)))
 	     (if (eq last-command-char ?<)
-		 (cperl-after-expr-p nil "{};(,:=")
+		 (cperl-after-expr-p nil "{;(,:=")
 	       1))
 	(progn
 	  (insert last-command-char)
@@ -1353,7 +1657,7 @@
 	(dollar (eq last-command-char ?$)))
     (and (save-excursion
 	   (backward-sexp 1)
-	   (cperl-after-expr-p nil "{};:"))
+	   (cperl-after-expr-p nil "{;:"))
 	 (save-excursion 
 	   (not 
 	    (re-search-backward
@@ -1388,7 +1692,7 @@
   (let ((beg (save-excursion (beginning-of-line) (point))))
     (and (save-excursion
 	   (backward-sexp 1)
-	   (cperl-after-expr-p nil "{};:"))
+	   (cperl-after-expr-p nil "{;:"))
 	 (save-excursion 
 	   (not 
 	    (re-search-backward
@@ -1551,7 +1855,7 @@
 
 (defun cperl-electric-backspace (arg)
   "Backspace-untabify, or remove the whitespace inserted by an electric key."
-  (interactive "*p")
+  (interactive "p")
   (if (and cperl-auto-newline 
 	   (memq last-command '(cperl-electric-semi 
 				cperl-electric-terminator
@@ -1642,7 +1946,7 @@
     (setq indent (cperl-calculate-indent nil symbol))
     (beginning-of-line)
     (setq beg (point))
-    (cond ((eq indent nil)
+    (cond ((or (eq indent nil) (eq indent t))
 	   (setq indent (current-indentation)))
 	  ;;((eq indent t)    ; Never?
 	  ;; (setq indent (cperl-calculate-indent-within-comment)))
@@ -1651,7 +1955,7 @@
 	  (t
 	   (skip-chars-forward " \t")
 	   (if (listp indent) (setq indent (car indent)))
-	   (cond ((looking-at "[A-Za-z]+:[^:]")
+	   (cond ((looking-at "[A-Za-z_][A-Za-z_0-9]*:[^:]")
 		  (and (> indent 0)
 		       (setq indent (max cperl-min-label-indent
 					 (+ indent cperl-label-offset)))))
@@ -1731,24 +2035,56 @@
 			(progn
 			  (backward-sexp)
 			  (looking-at 
-			   "sub[ \t]+[a-zA-Z0-9_:]+[ \t\n\f]*[#{]")))))))))
+			   "sub[ \t]+[a-zA-Z0-9_:]+[ \t\n\f]*\\(([^()]*)[ \t\n\f]*\\)?[#{]")))))))))
+
+(defvar cperl-look-for-prop '((pod in-pod) (here-doc-delim here-doc-group)))
 
 (defun cperl-calculate-indent (&optional parse-start symbol)
   "Return appropriate indentation for current line as Perl code.
 In usual case returns an integer: the column to indent to.
 Returns nil if line starts inside a string, t if in a comment."
   (save-excursion
-    (if (memq (get-text-property (point) 'syntax-type) '(pod here-doc)) nil
-      (beginning-of-line)
-      (let* ((indent-point (point))
-	     (case-fold-search nil)
+    (if (or
+	 (memq (get-text-property (point) 'syntax-type) 
+	       '(pod here-doc here-doc-delim format))
+	 ;; before start of POD - whitespace found since do not have 'pod!
+	 (and (looking-at "[ \t]*\n=")
+	      (error "Spaces before pod section!"))
+	 (and (not cperl-indent-left-aligned-comments)
+	      (looking-at "^#")))
+	nil
+     (beginning-of-line)
+     (let ((indent-point (point))
+	   (char-after (save-excursion
+			   (skip-chars-forward " \t")
+			   (following-char)))
+	   (in-pod (get-text-property (point) 'in-pod))
+	   (pre-indent-point (point))
+	   p prop look-prop)
+      (cond
+       (in-pod				
+	;; In the verbatim part, probably code example. What to do???
+	)
+       (t 
+	(save-excursion
+	  ;; Not in pod
+	  (cperl-backward-to-noncomment nil)
+	  (setq p (max (point-min) (1- (point)))
+		prop (get-text-property p 'syntax-type)
+		look-prop (or (nth 1 (assoc prop cperl-look-for-prop))
+			      'syntax-type))
+	  (if (memq prop '(pod here-doc format here-doc-delim))
+	      (progn
+		(goto-char (or (previous-single-property-change p look-prop) 
+			       (point-min)))
+		(beginning-of-line)
+		(setq pre-indent-point (point)))))))
+      (goto-char pre-indent-point)
+      (let* ((case-fold-search nil)
 	     (s-s (cperl-get-state))
 	     (start (nth 0 s-s))
 	     (state (nth 1 s-s))
 	     (containing-sexp (car (cdr state)))
-	     (char-after (save-excursion
-			   (skip-chars-forward " \t")
-			   (following-char)))
 	     (start-indent (save-excursion
 			     (goto-char start)
 			     (- (current-indentation)
@@ -1846,7 +2182,7 @@
 	      (t
 	       ;; Statement level.  Is it a continuation or a new statement?
 	       ;; Find previous non-comment character.
-	       (goto-char indent-point)
+	       (goto-char pre-indent-point)
 	       (cperl-backward-to-noncomment containing-sexp)
 	       ;; Back up over label lines, since they don't
 	       ;; affect whether our line is a continuation.
@@ -1938,7 +2274,7 @@
 		       (skip-chars-backward " \t")
 		       (if (and (eq (preceding-char) ?b)
 				(progn
-				  (forward-word -1)
+				  (forward-sexp -1)
 				  (looking-at "sub\\>"))
 				(setq old-indent 
 				      (nth 1 
@@ -1952,13 +2288,13 @@
 			 ;; If line starts with label, calculate label indentation
 			 (if (save-excursion
 			       (beginning-of-line)
-			       (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_]*:[^:]"))
+			       (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_0-9]*:[^:]"))
 			     (if (> (current-indentation) cperl-min-label-indent)
 				 (- (current-indentation) cperl-label-offset)
 			       (cperl-calculate-indent 
 				(if (and parse-start (<= parse-start (point)))
 				    parse-start)))
-			   (current-indentation)))))))))))))
+			   (current-indentation))))))))))))))
 
 (defvar cperl-indent-alist
   '((string nil)
@@ -2112,7 +2448,7 @@
 		     ;; If line starts with label, calculate label indentation
 		     (if (save-excursion
 			   (beginning-of-line)
-			   (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_]*:[^:]"))
+			   (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_0-9]*:[^:]"))
 			 (if (> (current-indentation) cperl-min-label-indent)
 			     (- (current-indentation) cperl-label-offset)
 			   (cperl-calculate-indent 
@@ -2142,7 +2478,9 @@
 Returns true if comment is found."
   (let (state stop-in cpoint (lim (progn (end-of-line) (point))))
       (beginning-of-line)
-      (if (re-search-forward "\\=[ \t]*\\(#\\|$\\)" lim t) 
+      (if (or 
+	   (eq (get-text-property (point) 'syntax-type) 'pod)
+	   (re-search-forward "\\=[ \t]*\\(#\\|$\\)" lim t))
 	  (if (eq (preceding-char) ?\#) (progn (backward-char 1) t))
 	;; Else
 	(while (not stop-in)
@@ -2184,6 +2522,38 @@
 	  )
 	(nth 4 state))))
 
+(defsubst cperl-1- (p)
+  (max (point-min) (1- p)))
+
+(defsubst cperl-1+ (p)
+  (min (point-max) (1+ p)))
+
+(defvar cperl-st-cfence '(14))		; Comment-fence
+(defvar cperl-st-sfence '(15))		; String-fence
+(defvar cperl-st-punct '(1))
+(defvar cperl-st-word '(2))
+
+(defun cperl-protect-defun-start (s e)
+  ;; C code looks for "^\\s(" to skip comment backward in "hard" situations
+  (save-excursion
+    (goto-char s)
+    (while (re-search-forward "^\\s(" e 'to-end)
+      (put-text-property (1- (point)) (point) 'syntax-table cperl-st-punct))))
+
+(defun cperl-commentify (bb e string)
+  (if cperl-use-syntax-table-text-property 
+      (progn
+	;; We suppose that e is _after_ the end of construction, as after eol.
+	(setq string (if string cperl-st-sfence cperl-st-cfence))
+	(put-text-property bb (1+ bb) 'syntax-table string)
+	(put-text-property bb (1+ bb) 'rear-nonsticky t)
+	(put-text-property (1- e) e 'syntax-table string)
+	(put-text-property (1- e) e 'rear-nonsticky t)
+	(if (and (eq string cperl-st-sfence) (> (- e 2) bb))
+	    (put-text-property (1+ bb) (1- e) 
+			       'syntax-table cperl-string-syntax-table))
+	(cperl-protect-defun-start bb e))))
+
 (defun cperl-find-pods-heres (&optional min max)
   "Scans the buffer for POD sections and here-documents.
 If `cperl-pod-here-fontify' is not-nil after evaluation, will fontify 
@@ -2192,11 +2562,12 @@
   (interactive)
   (or min (setq min (point-min)))
   (or max (setq max (point-max)))
-  (let (face head-face here-face b e bb tag qtag err b1 e1 argument
+  (let (face head-face here-face b e bb tag qtag err b1 e1 argument st i c
 	     (cperl-pod-here-fontify (eval cperl-pod-here-fontify))
 	     (case-fold-search nil) (inhibit-read-only t) (buffer-undo-list t)
 	     (modified (buffer-modified-p))
 	     (after-change-functions nil)
+	     (state-point (point-min)) state
 	     (search
 	      (concat
 	       "\\(\\`\n?\\|\n\n\\)=" 
@@ -2216,17 +2587,36 @@
 		 "\\)"
 	       "\\|"
 	       ;; 1+6 extra () before this:
-	       "^[ \t]*format[ \t]*\\([a-zA-Z0-9_]+\\)?[ \t]*=[ \t]*$")))
+	       "^[ \t]*\\(format\\)[ \t]*\\([a-zA-Z0-9_]+\\)?[ \t]*=[ \t]*$"
+	       (if cperl-use-syntax-table-text-property
+		   (concat
+		    "\\|"
+		    ;; 1+6+2=9 extra () before this:
+		    "\\<\\(q[wxq]?\\|[msy]\\|tr\\)\\>"
+		    "\\|"
+		    ;; 1+6+2+1=10 extra () before this:
+		    "\\([?/]\\)"	; /blah/ or ?blah?
+		    "\\|"
+		    ;; 1+6+2+1+1=11 extra () before this:
+		    "\\<sub\\>[ \t]*\\([a-zA-Z_:'0-9]+[ \t]*\\)?\\(([^()]*)\\)"
+		    "\\|"
+		    ;; 1+6+2+1+1+2=13 extra () before this:
+		    "\\$\\(['{]\\)"
+		    "\\|"
+		    ;; 1+6+2+1+1+2+1=14 extra () before this:
+		    "\\(\\<sub[ \t\n\f]+\\|[&*$@%]\\)[a-zA-Z0-9_]*'")
+		 ""))))
     (unwind-protect
 	(progn
 	  (save-excursion
 	    (message "Scanning for pods, formats and here-docs...")
 	    (if cperl-pod-here-fontify
 		;; We had evals here, do not know why...
-		(setq face cperl-pod-face
-		      head-face cperl-pod-head-face
-		      here-face cperl-here-face))
-	    (remove-text-properties min max '(syntax-type t))
+		(setq face `cperl-pod-face
+		      head-face `cperl-pod-head-face
+		      here-face `cperl-here-face))
+	    (remove-text-properties min max 
+				    '(syntax-type t in-pod t syntax-table t))
 	    ;; Need to remove face as well...
 	    (goto-char min)
 	    (while (re-search-forward search max t)
@@ -2235,20 +2625,23 @@
 		;;  "\\(\\`\n?\\|\n\n\\)=" 
 		(if (looking-at "\n*cut\\>")
 		    (progn
-		      (message "=cut is not preceeded by a pod section")
-		      (setq err (point)))
+		      (message "=cut is not preceded by a pod section")
+		      (or err (setq err (point))))
 		  (beginning-of-line)
 		
 		  (setq b (point) bb b)
 		  (or (re-search-forward "\n\n=cut\\>" max 'toend)
-		      (message "Cannot find the end of a pod section"))
-		  (beginning-of-line 3)
+		      (progn
+			(message "Cannot find the end of a pod section")
+			(or err (setq err b))))
+		  (beginning-of-line 2)	; An empty line after =cut is not POD!
 		  (setq e (point))
 		  (put-text-property b e 'in-pod t)
 		  (goto-char b)
 		  (while (re-search-forward "\n\n[ \t]" e t)
+		    ;; We start 'pod 1 char earlier to include the preceding line
 		    (beginning-of-line)
-		    (put-text-property b (point) 'syntax-type 'pod)
+		    (put-text-property (cperl-1- b) (point) 'syntax-type 'pod)
 		    (cperl-put-do-not-fontify b (point))
 		    ;;(put-text-property (max (point-min) (1- b))
 		    ;;		     (point) cperl-do-not-fontify t)
@@ -2256,7 +2649,7 @@
 		    (re-search-forward "\n\n[^ \t\f\n]" e 'toend)
 		    (beginning-of-line)
 		    (setq b (point)))
-		  (put-text-property (point) e 'syntax-type 'pod)
+		  (put-text-property (cperl-1- (point)) e 'syntax-type 'pod)
 		  (cperl-put-do-not-fontify (point) e)
 		  ;;(put-text-property (max (point-min) (1- (point)))
 		  ;;		   e cperl-do-not-fontify t)
@@ -2264,28 +2657,33 @@
 		      (progn (put-text-property (point) e 'face face)
 			     (goto-char bb)
 			     (if (looking-at 
-				  "=[a-zA-Z0-9]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$")
+				  "=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$")
 				 (put-text-property 
 				  (match-beginning 1) (match-end 1)
 				  'face head-face))
 			     (while (re-search-forward
 				     ;; One paragraph
-				     "\n\n=[a-zA-Z0-9]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$"
+				     "\n\n=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$"
 				     e 'toend)
 			       (put-text-property 
 				(match-beginning 1) (match-end 1)
 				'face head-face))))
+		  (cperl-commentify bb e nil)
 		  (goto-char e)))
 	       ;; Here document
+	       ;; We do only one here-per-line
 	       ;; 1 () ahead
 	       ;; "<<\\(\\([\"'`]\\)\\([^\"'`\n]*\\)\\3\\|\\(\\([a-zA-Z_][a-zA-Z_0-9]*\\)?\\)\\)"
 	       ((match-beginning 2)	; 1 + 1
-		;; Abort in comment (_extremely_ simplified):
+		;; Abort in comment:
 		(setq b (point))
-		(if (save-excursion
-		      (beginning-of-line)
-		      (search-forward "#" b t))
-		    nil
+		(setq state (parse-partial-sexp state-point b nil nil state)
+		      state-point b)
+		(if ;;(save-excursion
+		    ;;  (beginning-of-line)
+		    ;;  (search-forward "#" b t))
+		    (or (nth 3 state) (nth 4 state))
+		    (goto-char (match-end 2))
 		  (if (match-beginning 5) ;4 + 1
 		      (setq b1 (match-beginning 5) ; 4 + 1
 			    e1 (match-end 5)) ; 4 + 1
@@ -2310,14 +2708,21 @@
 			       ;;		      cperl-do-not-fontify t)
 			       (put-text-property b (match-beginning 0) 
 						  'face here-face)))
+			 (setq e1 (cperl-1+ (match-end 0)))
 			 (put-text-property b (match-beginning 0) 
 					    'syntax-type 'here-doc)
-			 (cperl-put-do-not-fontify b (match-beginning 0)))
-			(t (message "End of here-document `%s' not found." tag)))))
+			 (put-text-property (match-beginning 0) e1
+					    'syntax-type 'here-doc-delim)
+			 (put-text-property b e1
+					    'here-doc-group t)
+			 (cperl-commentify b e1 nil)
+			 (cperl-put-do-not-fontify b (match-end 0)))
+			(t (message "End of here-document `%s' not found." tag)
+			   (or err (setq err b))))))
 	       ;; format
-	       (t
+	       ((match-beginning 8)
 		;; 1+6=7 extra () before this:
-		;; "^[ \t]*format[ \t]*\\([a-zA-Z0-9_]+\\)?[ \t]*=[ \t]*$")))
+		;;"^[ \t]*\\(format\\)[ \t]*\\([a-zA-Z0-9_]+\\)?[ \t]*=[ \t]*$"
 		(setq b (point)
 		      name (if (match-beginning 8) ; 7 + 1
 			       (buffer-substring (match-beginning 8) ; 7 + 1
@@ -2341,6 +2746,7 @@
 			(end-of-line)
 			(put-text-property b1 (point) 
 					   'face font-lock-string-face)
+			(cperl-commentify b1 (point) nil)
 			(cperl-put-do-not-fontify b1 (point)))))
 		  (re-search-forward (concat "^[.;]$") max 'toend))
 		(beginning-of-line)
@@ -2348,8 +2754,10 @@
 		    (progn
 		      (put-text-property (point) (+ (point) 2)
 					 'face font-lock-string-face)
+		      (cperl-commentify (point) (+ (point) 2) nil)
 		      (cperl-put-do-not-fontify (point) (+ (point) 2)))
-		  (message "End of format `%s' not found." name))
+		  (message "End of format `%s' not found." name)
+		  (or err (setq err b)))
 		(forward-line)
 		(put-text-property b (point) 'syntax-type 'format)
 ;;;	       (cond ((re-search-forward (concat "^[.;]$") max 'toend)
@@ -2362,11 +2770,181 @@
 ;;;					 'syntax-type 'format)
 ;;;		      (cperl-put-do-not-fontify b (match-beginning 0)))
 ;;;		     (t (message "End of format `%s' not found." name)))
-		)))
+		)
+	       ;; Regexp:
+	       ((or (match-beginning 10) (match-beginning 11))
+		;; 1+6+2=9 extra () before this:
+		;; "\\<\\(q[wxq]?\\|[msy]\\|tr\\)\\>"
+		;; "\\|"
+		;; "\\([?/]\\)"	; /blah/ or ?blah?
+		(setq b1 (if (match-beginning 10) 10 11)
+		      argument (buffer-substring
+				(match-beginning b1) (match-end b1))
+		      b (point)
+		      i b
+		      c (char-after (match-beginning b1))
+		      bb (or
+			  (memq (char-after (1- (match-beginning b1)))
+				'(?\$ ?\@ ?\% ?\& ?\*))
+			  (and
+			   (eq (char-after (1- (match-beginning b1))) ?-)
+			   (eq c ?s))))
+		(or bb
+		    (if (eq b1 11)	; bare /blah/ or ?blah?
+			(setq argument ""
+			     bb		; Not a regexp
+			     (progn
+			       (goto-char (match-beginning b1))
+			       (cperl-backward-to-noncomment (point-min))
+			       (not (or (memq (preceding-char)
+					      (append (if (eq c ?\?)
+							  ;; $a++ ? 1 : 2
+							  "~{(=|&*!,;"
+							"~{(=|&+-*!,;") nil))
+					(and (eq (preceding-char) ?\})
+					     (cperl-after-block-p (point-min)))
+					(and (eq (char-syntax (preceding-char)) ?w)
+					     (progn
+					       (forward-sexp -1)
+					       (looking-at 
+						"\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\)\\>")))
+					(and (eq (preceding-char) ?.)
+					     (eq (char-after (- (point) 2)) ?.))
+					(bobp))))
+			     b (1- b))))
+		(or bb (setq state (parse-partial-sexp 
+				    state-point b nil nil state)
+			     state-point b))
+		(goto-char b)
+		(if (or bb (nth 3 state) (nth 4 state))
+		    (goto-char i)
+		  (skip-chars-forward " \t")
+		  ;; qtag means two-arg matcher, may be reset to
+		  ;;   2 or 3 later if some special quoting is needed.
+		  ;; e1 means matching-char matcher.
+		  (setq b (point) 
+			tag (char-after b)
+			qtag (if (string-match "^\\([sy]\\|tr\\)$" argument) t)
+			e1 (cdr (assoc tag '(( ?\( . ?\) )
+					     ( ?\[ . ?\] )
+					     ( ?\{ . ?\} )
+					     ( ?\< . ?\> )
+					     ))))
+		  ;; What if tag == ?\\  ????
+		  (or st 
+		      (progn
+			(setq st (make-syntax-table) i 0)
+			(while (< i 256)
+			  (modify-syntax-entry i "." st)
+			  (setq i (1+ i)))
+			(modify-syntax-entry ?\\ "\\" st)))
+		  ;; Whether we have an intermediate point
+		  (setq i nil)
+		  ;; Prepare the syntax table:
+		  (cond
+		   ;; $ has TeXish matching rules, so $$ equiv $...
+		   ((and qtag 
+			 (not e1) 
+			 (eq tag (char-after (cperl-1+ b)))
+			 (eq tag (char-after (+ 2 b))))
+		    (setq qtag 3))	; s///
+		   ((and qtag
+			 (not e1) 
+			 (eq tag (char-after (cperl-1+ b))))
+		    (setq qtag nil))	; s//blah/, will work anyway
+		   ((and (not e1) 
+			 (eq tag (char-after (cperl-1+ b))))
+		    (setq qtag 2))	; m//
+		   ((not e1)
+		    (modify-syntax-entry tag "$" st)) ; m/blah/, s/x//, s/x/y/
+		   (t			; s{}(), m[]
+		    (modify-syntax-entry tag (concat "(" (list e1)) st)
+		    (modify-syntax-entry e1  (concat ")" (list tag)) st)))
+		  (if (numberp qtag)
+		      (forward-char qtag)
+		    (condition-case bb
+			(progn
+			  (set-syntax-table st)
+			  (forward-sexp 1) ; Wrong if m// - taken care of...
+			  (if qtag
+			      (if e1 
+				  (progn
+				    (setq i (point))
+				    (set-syntax-table cperl-mode-syntax-table)
+				    (forward-sexp 1)) ; Should be smarter?
+				;; "$" has funny matching rules
+				(if (/= (char-after (- (point) 2)) 
+					(preceding-char))
+				    (progn
+				      ;; Commenting \\ is dangerous, what about ( ?
+				      (if (eq (following-char) ?\\) nil
+					(setq i (point)))
+				      (forward-char -1)
+				      (forward-sexp 1)))
+				)))
+		      (error (goto-char (point-max))
+			     (message
+			      "End of `%s%c ... %c' string not found: %s"
+			      argument tag (or e1 tag) bb)
+			     (or err (setq err b)))))
+		  (set-syntax-table cperl-mode-syntax-table)
+		  (if (null i)
+		      (cperl-commentify b (point) t)
+		    (cperl-commentify b i t)
+		    (if (looking-at "\\sw*e") nil ; s///e
+		      (cperl-commentify i (point) t)))
+		  (if (eq (char-syntax (following-char)) ?w)
+		      (forward-word 1))	; skip modifiers s///s
+		  (modify-syntax-entry tag "." st)
+		  (if e1 (modify-syntax-entry e1 "." st))))
+	       ((match-beginning 13)	; sub with prototypes
+		(setq b (match-beginning 0))
+		(if (memq (char-after (1- b))
+			  '(?\$ ?\@ ?\% ?\& ?\*))
+		    nil
+		  (setq state (parse-partial-sexp 
+			       state-point (1- b) nil nil state)
+			state-point (1- b))
+		  (if (or (nth 3 state) (nth 4 state))
+		      nil
+		    ;; Mark as string
+		    (cperl-commentify (match-beginning 13) (match-end 13) t))
+		  (goto-char (match-end 0))))
+	       ;; 1+6+2+1+1+2=13 extra () before this:
+	       ;;    "\\$\\(['{]\\)"
+	       ((and (match-beginning 14)
+		 (eq (preceding-char) ?\')) ; $'
+		(setq b (1- (point))
+		      state (parse-partial-sexp 
+			     state-point (1- b) nil nil state)
+		      state-point (1- b))
+		(if (nth 3 state)	; in string
+		    (progn
+		      (put-text-property (1- b) b 'syntax-table cperl-st-punct)
+		      (put-text-property (1- b) b 'rear-nonsticky t)))
+		(goto-char (1+ b)))
+	       ;; 1+6+2+1+1+2=13 extra () before this:
+	       ;;    "\\$\\(['{]\\)"
+	       ((match-beginning 14)	; ${
+		(setq bb (match-beginning 0))
+		(put-text-property bb (1+ bb) 'syntax-table cperl-st-punct)
+		(put-text-property bb (1+ bb) 'rear-nonsticky t))
+	       ;; 1+6+2+1+1+2+1=14 extra () before this:
+	       ;;    "\\(\\<sub[ \t\n\f]+\\|[&*$@%]\\)[a-zA-Z0-9_]*'")
+	       (t			; old $abc'efg syntax
+		(setq bb (match-end 0)
+		      b (match-beginning 0)
+		      state (parse-partial-sexp 
+			     state-point b nil nil state)
+		      state-point b)
+		(if (nth 3 state)	; in string
+		    nil
+		  (put-text-property (1- bb) bb 'syntax-table cperl-st-word))
+		(goto-char bb))))
 ;;;	    (while (re-search-forward "\\(\\`\n?\\|\n\n\\)=" max t)
 ;;;	      (if (looking-at "\n*cut\\>")
 ;;;		  (progn
-;;;		    (message "=cut is not preceeded by a pod section")
+;;;		    (message "=cut is not preceded by a pod section")
 ;;;		    (setq err (point)))
 ;;;		(beginning-of-line)
 		
@@ -2462,7 +3040,8 @@
 	    (message "Scan for pods, formats and here-docs completed.")))
       (and (buffer-modified-p)
 	   (not modified)
-	   (set-buffer-modified-p nil)))))
+	   (set-buffer-modified-p nil))
+      (set-syntax-table cperl-mode-syntax-table))))
 
 (defun cperl-backward-to-noncomment (lim)
   ;; Stops at lim or after non-whitespace that is not in comment
@@ -2478,13 +3057,30 @@
 	(if (< p (point)) (goto-char p))
 	(setq stop t)))))
 
+(defun cperl-after-block-p (lim)
+  ;; We suppose that the preceding char is }.
+  (save-excursion
+    (condition-case nil
+	(progn
+	  (forward-sexp -1)
+	  (cperl-backward-to-noncomment lim)
+	  (or (eq (preceding-char) ?\) ) ; if () {}
+	      (and (eq (char-syntax (preceding-char)) ?w) ; else {}
+		   (progn
+		     (forward-sexp -1)
+		     (looking-at "\\(else\\|grep\\|map\\)\\>")))
+	      (cperl-after-expr-p lim)))
+      (error nil))))
+
 (defun cperl-after-expr-p (&optional lim chars test)
   "Returns true if the position is good for start of expression.
 TEST is the expression to evaluate at the found position. If absent,
-CHARS is a string that contains good characters to have before us."
-  (let (stop p)
+CHARS is a string that contains good characters to have before us (however,
+`}' is treated \"smartly\" if it is not in the list)."
+  (let (stop p 
+	     (lim (or lim (point-min))))
     (save-excursion
-      (while (and (not stop) (> (point) (or lim 1)))
+      (while (and (not stop) (> (point) lim))
 	(skip-chars-backward " \t\n\f" lim)
 	(setq p (point))
 	(beginning-of-line)
@@ -2496,9 +3092,10 @@
 	  (setq stop t)))
       (or (bobp)
 	  (progn
-	    (backward-char 1)
 	    (if test (eval test)
-	      (memq (following-char) (append (or chars "{};") nil))))))))
+	      (or (memq (preceding-char) (append (or chars "{;") nil))
+		  (and (eq (preceding-char) ?\})
+		       (cperl-after-block-p lim)))))))))
 
 (defun cperl-backward-to-start-of-continued-exp (lim)
   (if (memq (preceding-char) (append ")]}\"'`" nil))
@@ -2520,8 +3117,8 @@
   (save-excursion
     (let ((tmp-end (progn (end-of-line) (point))) top done)
       (save-excursion
+	(beginning-of-line)
 	(while (null done)
-	  (beginning-of-line)
 	  (setq top (point))
 	  (while (= (nth 0 (parse-partial-sexp (point) tmp-end
 					       -1)) -1)
@@ -2566,7 +3163,8 @@
 						   comment-column))
 		     (setq old-comm-indent nil)))
 	    (if (and old-comm-indent
-		     (= (current-indentation) old-comm-indent))
+		     (= (current-indentation) old-comm-indent)
+		     (not (eq (get-text-property (point) 'syntax-type) 'pod)))
 		(let ((comment-column new-comm-indent))
 		  (indent-for-comment)))
 	  (progn 
@@ -2574,6 +3172,7 @@
 	    (or comm
 		(progn
 		  (if (setq old-comm-indent (and (cperl-to-comment-or-eol)
+						 (not (eq (get-text-property (point) 'syntax-type) 'pod))
 						 (current-column)))
 		      (progn (indent-for-comment)
 			     (skip-chars-backward " \t")
@@ -2584,16 +3183,16 @@
 	     (imenu-progress-message pm 100)
 	  (message nil)))))
 
-(defun cperl-slash-is-regexp (&optional pos)
-  (save-excursion
-    (goto-char (if pos pos (1- (point))))
-    (and
-     (not (memq (get-text-property (point) 'face)
-		'(font-lock-string-face font-lock-comment-face)))
-     (cperl-after-expr-p nil nil '
-		       (or (looking-at "[^]a-zA-Z0-9_)}]")
-			   (eq (get-text-property (point) 'face)
-			       'font-lock-keyword-face))))))
+;;(defun cperl-slash-is-regexp (&optional pos)
+;;  (save-excursion
+;;    (goto-char (if pos pos (1- (point))))
+;;    (and
+;;     (not (memq (get-text-property (point) 'face)
+;;		'(font-lock-string-face font-lock-comment-face)))
+;;     (cperl-after-expr-p nil nil '
+;;		       (or (looking-at "[^]a-zA-Z0-9_)}]")
+;;			   (eq (get-text-property (point) 'face)
+;;			       'font-lock-keyword-face))))))
 
 ;; Stolen from lisp-mode with a lot of improvements
 
@@ -2704,154 +3303,175 @@
       ;; Previous space could have gone:
       (or (memq (preceding-char) '(?\ ?\t)) (insert " "))))))
 
-(defvar imenu-example--function-name-regexp-perl
-      "^\\([ \t]*\\(sub\\|package\\)[ \t\n]+\\([a-zA-Z_0-9:']+\\)[ \t]*\\|=head\\([12]\\)[ \t]+\\([^\n]+\\)$\\)")
-
-(defun cperl-imenu-addback (lst &optional isback name)
-  ;; We suppose that the lst is a DAG, unless the first element only
-  ;; loops back, and ISBACK is set. Thus this function cannot be
-  ;; applied twice without ISBACK set.
-  (cond ((not cperl-imenu-addback) lst)
-	(t
-	 (or name 
-	     (setq name "+++BACK+++"))
-	 (mapcar (function (lambda (elt)
-			     (if (and (listp elt) (listp (cdr elt)))
-				 (progn
-				   ;; In the other order it goes up
-				   ;; one level only ;-(
-				   (setcdr elt (cons (cons name lst)
-						     (cdr elt)))
-				   (cperl-imenu-addback (cdr elt) t name)
-				   ))))
-		 (if isback (cdr lst) lst))
-	 lst)))
-
-(defun imenu-example--create-perl-index (&optional regexp)
-  (require 'cl)
-  (let ((index-alist '()) (index-pack-alist '()) (index-pod-alist '()) 
-	(index-unsorted-alist '()) (i-s-f (default-value 'imenu-sort-function))
-	(index-meth-alist '()) meth
-	packages ends-ranges p
-	(prev-pos 0) char fchar index index1 name (end-range 0) package)
-    (goto-char (point-min))
-    (imenu-progress-message prev-pos 0)
-    ;; Search for the function
-    (progn ;;save-match-data
-      (while (re-search-forward
-	      (or regexp imenu-example--function-name-regexp-perl)
-	      nil t)
-	(imenu-progress-message prev-pos)
-	;;(backward-up-list 1)
-	(cond
-	 ((match-beginning 2)		; package or sub
-	  (save-excursion
-	    (goto-char (match-beginning 2))
-	    (setq fchar (following-char))
-	    )
-	  (setq char (following-char) meth nil)
-	  (setq p (point))
-	  (while (and ends-ranges (>= p (car ends-ranges)))
-	    ;; delete obsolete entries
-	    (setq ends-ranges (cdr ends-ranges) packages (cdr packages)))
-	  (setq package (or (car packages) "")
-		end-range (or (car ends-ranges) 0))
-	  (if (eq fchar ?p)
-	      (setq name (buffer-substring (match-beginning 3) (match-end 3))
-		    name (progn
-			   (set-text-properties 0 (length name) nil name)
-			   name)
-		    package (concat name "::") 
-		    name (concat "package " name)
-		    end-range 
-		    (save-excursion
-		      (parse-partial-sexp (point) (point-max) -1) (point))
-		    ends-ranges (cons end-range ends-ranges)
-		    packages (cons package packages)))
-	  ;;   )
-	  ;; Skip this function name if it is a prototype declaration.
-	  (if (and (eq fchar ?s) (eq char ?\;)) nil
-	    (setq index (imenu-example--name-and-position))
-	    (if (eq fchar ?p) nil
-	      (setq name (buffer-substring (match-beginning 3) (match-end 3)))
-	      (set-text-properties 0 (length name) nil name)
-	      (cond ((string-match "[:']" name)
-		     (setq meth t))
-		    ((> p end-range) nil)
-		    (t 
-		     (setq name (concat package name) meth t))))
-	    (setcar index name)
-	    (if (eq fchar ?p) 
-		(push index index-pack-alist)
-	      (push index index-alist))
-	    (if meth (push index index-meth-alist))
-	    (push index index-unsorted-alist)))
-	 (t				; Pod section
-	  ;; (beginning-of-line)
-	  (setq index (imenu-example--name-and-position)
-		name (buffer-substring (match-beginning 5) (match-end 5)))
-	  (set-text-properties 0 (length name) nil name)
-	  (if (eq (char-after (match-beginning 4)) ?2)
-	      (setq name (concat "   " name)))
-	  (setcar index name)
-	  (setq index1 (cons (concat "=" name) (cdr index)))
-	  (push index index-pod-alist)
-	  (push index1 index-unsorted-alist)))))
-    (imenu-progress-message prev-pos 100)
-    (setq index-alist 
-	  (if (default-value 'imenu-sort-function)
-	      (sort index-alist (default-value 'imenu-sort-function))
-	      (nreverse index-alist)))
-    (and index-pod-alist
-	 (push (cons "+POD headers+..."
-		     (nreverse index-pod-alist))
-	       index-alist))
-    (and (or index-pack-alist index-meth-alist)
-	 (let ((lst index-pack-alist) hier-list pack elt group name)
-	   ;; Remove "package ", reverse and uniquify.
-	   (while lst
-	     (setq elt (car lst) lst (cdr lst) name (substring (car elt) 8))
-	     (if (assoc name hier-list) nil
-	       (setq hier-list (cons (cons name (cdr elt)) hier-list))))
-	   (setq lst index-meth-alist)
-	   (while lst
-	     (setq elt (car lst) lst (cdr lst))
-	     (cond ((string-match "\\(::\\|'\\)[_a-zA-Z0-9]+$" (car elt))
-		    (setq pack (substring (car elt) 0 (match-beginning 0)))
-		    (if (setq group (assoc pack hier-list)) 
-			(if (listp (cdr group))
-			    ;; Have some functions already
-			    (setcdr group 
-				    (cons (cons (substring 
-						 (car elt)
-						 (+ 2 (match-beginning 0)))
-						(cdr elt))
-					  (cdr group)))
-			  (setcdr group (list (cons (substring 
-						     (car elt)
-						     (+ 2 (match-beginning 0)))
-						    (cdr elt)))))
-		      (setq hier-list 
-			    (cons (cons pack 
-					(list (cons (substring 
-						     (car elt)
-						     (+ 2 (match-beginning 0)))
-						    (cdr elt))))
-				  hier-list))))))
-	   (push (cons "+Hierarchy+..."
-		       hier-list)
-		 index-alist)))
-    (and index-pack-alist
-	 (push (cons "+Packages+..."
-		     (nreverse index-pack-alist))
-	       index-alist))
-    (and (or index-pack-alist index-pod-alist 
-	     (default-value 'imenu-sort-function))
-	 index-unsorted-alist
-	 (push (cons "+Unsorted List+..."
-		     (nreverse index-unsorted-alist))
-	       index-alist))
-    (cperl-imenu-addback index-alist)))
+;;(defvar imenu-example--function-name-regexp-perl
+;;  (concat 
+;;   "^\\("
+;;       "[ \t]*\\(sub\\|package\\)[ \t\n]+\\([a-zA-Z_0-9:']+\\)[ \t]*\\(([^()]*)[ \t]*\\)?"
+;;     "\\|"
+;;       "=head\\([12]\\)[ \t]+\\([^\n]+\\)$"
+;;   "\\)"))
+
+;;(defun cperl-imenu-addback (lst &optional isback name)
+;;  ;; We suppose that the lst is a DAG, unless the first element only
+;;  ;; loops back, and ISBACK is set. Thus this function cannot be
+;;  ;; applied twice without ISBACK set.
+;;  (cond ((not cperl-imenu-addback) lst)
+;;	(t
+;;	 (or name 
+;;	     (setq name "+++BACK+++"))
+;;	 (mapcar (function (lambda (elt)
+;;			     (if (and (listp elt) (listp (cdr elt)))
+;;				 (progn
+;;				   ;; In the other order it goes up
+;;				   ;; one level only ;-(
+;;				   (setcdr elt (cons (cons name lst)
+;;						     (cdr elt)))
+;;				   (cperl-imenu-addback (cdr elt) t name)
+;;				   ))))
+;;		 (if isback (cdr lst) lst))
+;;	 lst)))
+
+;;(defun imenu-example--create-perl-index (&optional regexp)
+;;  (require 'cl)
+;;  ;; ####
+;;  (require 'imenu)			; May be called from TAGS creator
+;;  (let ((index-alist '()) (index-pack-alist '()) (index-pod-alist '()) 
+;;	(index-unsorted-alist '()) (i-s-f (default-value 'imenu-sort-function))
+;;	(index-meth-alist '()) meth
+;;	packages ends-ranges p
+;;	(prev-pos 0) char fchar index index1 name (end-range 0) package)
+;;    (goto-char (point-min))
+;;    (imenu-progress-message prev-pos 0)
+;;    ;; Search for the function
+;;    (progn ;;save-match-data
+;;      (while (re-search-forward
+;;	      (or regexp imenu-example--function-name-regexp-perl)
+;;	      nil t)
+;;	(imenu-progress-message prev-pos)
+;;	;;(backward-up-list 1)
+;;	(cond
+;;	 ((and				; Skip some noise if building tags
+;;	   (match-beginning 2)		; package or sub
+;;	   (eq (char-after (match-beginning 2)) ?p) ; package
+;;	   (not (save-match-data
+;;		  (looking-at "[ \t\n]*;"))))  ; Plain text word 'package'
+;;	  nil)
+;;	 ((and
+;;	   (match-beginning 2)		; package or sub
+;;	   ;; Skip if quoted (will not skip multi-line ''-comments :-():
+;;	   (null (get-text-property (match-beginning 1) 'syntax-table))
+;;	   (null (get-text-property (match-beginning 1) 'syntax-type))
+;;	   (null (get-text-property (match-beginning 1) 'in-pod)))
+;;	  (save-excursion
+;;	    (goto-char (match-beginning 2))
+;;	    (setq fchar (following-char))
+;;	    )
+;;	  ;; (if (looking-at "([^()]*)[ \t\n\f]*")
+;;	  ;;    (goto-char (match-end 0)))	; Messes what follows
+;;	  (setq char (following-char) 
+;;		meth nil
+;;		p (point))
+;;	  (while (and ends-ranges (>= p (car ends-ranges)))
+;;	    ;; delete obsolete entries
+;;	    (setq ends-ranges (cdr ends-ranges) packages (cdr packages)))
+;;	  (setq package (or (car packages) "")
+;;		end-range (or (car ends-ranges) 0))
+;;	  (if (eq fchar ?p)
+;;	      (setq name (buffer-substring (match-beginning 3) (match-end 3))
+;;		    name (progn
+;;			   (set-text-properties 0 (length name) nil name)
+;;			   name)
+;;		    package (concat name "::") 
+;;		    name (concat "package " name)
+;;		    end-range 
+;;		    (save-excursion
+;;		      (parse-partial-sexp (point) (point-max) -1) (point))
+;;		    ends-ranges (cons end-range ends-ranges)
+;;		    packages (cons package packages)))
+;;	  ;;   )
+;;	  ;; Skip this function name if it is a prototype declaration.
+;;	  (if (and (eq fchar ?s) (eq char ?\;)) nil
+;;	    (setq index (imenu-example--name-and-position))
+;;	    (if (eq fchar ?p) nil
+;;	      (setq name (buffer-substring (match-beginning 3) (match-end 3)))
+;;	      (set-text-properties 0 (length name) nil name)
+;;	      (cond ((string-match "[:']" name)
+;;		     (setq meth t))
+;;		    ((> p end-range) nil)
+;;		    (t 
+;;		     (setq name (concat package name) meth t))))
+;;	    (setcar index name)
+;;	    (if (eq fchar ?p) 
+;;		(push index index-pack-alist)
+;;	      (push index index-alist))
+;;	    (if meth (push index index-meth-alist))
+;;	    (push index index-unsorted-alist)))
+;;	 ((match-beginning 5)		; Pod section
+;;	  ;; (beginning-of-line)
+;;	  (setq index (imenu-example--name-and-position)
+;;		name (buffer-substring (match-beginning 6) (match-end 6)))
+;;	  (set-text-properties 0 (length name) nil name)
+;;	  (if (eq (char-after (match-beginning 5)) ?2)
+;;	      (setq name (concat "   " name)))
+;;	  (setcar index name)
+;;	  (setq index1 (cons (concat "=" name) (cdr index)))
+;;	  (push index index-pod-alist)
+;;	  (push index1 index-unsorted-alist)))))
+;;    (imenu-progress-message prev-pos 100)
+;;    (setq index-alist 
+;;	  (if (default-value 'imenu-sort-function)
+;;	      (sort index-alist (default-value 'imenu-sort-function))
+;;	      (nreverse index-alist)))
+;;    (and index-pod-alist
+;;	 (push (cons "+POD headers+..."
+;;		     (nreverse index-pod-alist))
+;;	       index-alist))
+;;    (and (or index-pack-alist index-meth-alist)
+;;	 (let ((lst index-pack-alist) hier-list pack elt group name)
+;;	   ;; Remove "package ", reverse and uniquify.
+;;	   (while lst
+;;	     (setq elt (car lst) lst (cdr lst) name (substring (car elt) 8))
+;;	     (if (assoc name hier-list) nil
+;;	       (setq hier-list (cons (cons name (cdr elt)) hier-list))))
+;;	   (setq lst index-meth-alist)
+;;	   (while lst
+;;	     (setq elt (car lst) lst (cdr lst))
+;;	     (cond ((string-match "\\(::\\|'\\)[_a-zA-Z0-9]+$" (car elt))
+;;		    (setq pack (substring (car elt) 0 (match-beginning 0)))
+;;		    (if (setq group (assoc pack hier-list)) 
+;;			(if (listp (cdr group))
+;;			    ;; Have some functions already
+;;			    (setcdr group 
+;;				    (cons (cons (substring 
+;;						 (car elt)
+;;						 (+ 2 (match-beginning 0)))
+;;						(cdr elt))
+;;					  (cdr group)))
+;;			  (setcdr group (list (cons (substring 
+;;						     (car elt)
+;;						     (+ 2 (match-beginning 0)))
+;;						    (cdr elt)))))
+;;		      (setq hier-list 
+;;			    (cons (cons pack 
+;;					(list (cons (substring 
+;;						     (car elt)
+;;						     (+ 2 (match-beginning 0)))
+;;						    (cdr elt))))
+;;				  hier-list))))))
+;;	   (push (cons "+Hierarchy+..."
+;;		       hier-list)
+;;		 index-alist)))
+;;    (and index-pack-alist
+;;	 (push (cons "+Packages+..."
+;;		     (nreverse index-pack-alist))
+;;	       index-alist))
+;;    (and (or index-pack-alist index-pod-alist 
+;;	     (default-value 'imenu-sort-function))
+;;	 index-unsorted-alist
+;;	 (push (cons "+Unsorted List+..."
+;;		     (nreverse index-unsorted-alist))
+;;	       index-alist))
+;;    (cperl-imenu-addback index-alist)))
 
 (defvar cperl-compilation-error-regexp-alist 
   ;; This look like a paranoiac regexp: could anybody find a better one? (which WORK).
@@ -2980,7 +3600,7 @@
 	      "ell\\(\\|dir\\)\\|ime\\(\\|s\\)\\)\\|u\\(c\\(\\|first\\)\\|"
 	      "time\\|mask\\|n\\(pack\\|link\\)\\)\\|v\\(alues\\|ec\\)\\|"
 	      "w\\(a\\(rn\\|it\\(pid\\|\\)\\|ntarray\\)\\|rite\\)\\|"
-	      "x\\(\\|or\\)\\|__\\(FILE__\\|LINE__\\)"
+	      "x\\(\\|or\\)\\|__\\(FILE__\\|LINE__\\|PACKAGE__\\)"
 	      "\\)\\>") 2 'font-lock-type-face)
 	    ;; In what follows we use `other' style
 	    ;; for nonoverwritable builtins
@@ -3014,7 +3634,7 @@
 	    ;;			   "\\|")
 	    '("-[rwxoRWXOezsfdlpSbctugkTBMAC]\\>\\([ \t]+_\\>\\)?" 0
 	      font-lock-function-name-face keep) ; Not very good, triggers at "[a-z]"
-	    '("\\<sub[ \t]+\\([^ \t{;]+\\)[ \t]*[{\n]" 1
+	    '("\\<sub[ \t]+\\([^ \t{;]+\\)[ \t]*\\(([^()]*)[ \t]*\\)?[#{\n]" 1
 	      font-lock-function-name-face)
 	    '("\\<\\(package\\|require\\|use\\|import\\|no\\|bootstrap\\)[ \t]+\\([a-zA-z_][a-zA-z_0-9:]*\\)[ \t;]" ; require A if B;
 	      2 font-lock-function-name-face)
@@ -3047,12 +3667,12 @@
 				   (2 '(restart 2 nil) nil t))) 
 			nil t)))	; local variables, multiple
 		  (font-lock-anchored
-		   '("^[ \t]*\\(my\\|local\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)"
+		   '("^[ \t{}]*\\(my\\|local\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)"
 		     (3 font-lock-variable-name-face)
 		     ("\\=[ \t]*,[ \t]*\\([$@%*][a-zA-Z0-9_:]+\\)"
 		      nil nil
 		      (1 font-lock-variable-name-face))))
-		  (t '("^[ \t]*\\(my\\|local\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)"
+		  (t '("^[ \t{}]*\\(my\\|local\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)"
 		       3 font-lock-variable-name-face)))
 	    '("\\<for\\(each\\)?[ \t]*\\(\\$[a-zA-Z_][a-zA-Z_0-9]*\\)[ \t]*("
 	      2 font-lock-variable-name-face)))
@@ -3352,8 +3972,10 @@
 The arguments are a string representing the desired style.
 Available styles are GNU, K&R, BSD and Whitesmith."
   (interactive 
-   (let ((list (mapcar (function (lambda (elt) (list (car elt)))) 
-		       c-style-alist)))
+   (let ((list (progn
+		 (require 'cc-styles)
+		 (mapcar (function (lambda (elt) (list (car elt)))) 
+		       c-style-alist))))
      (list (completing-read "Enter style: " list nil 'insist))))
   (let ((style (cdr (assoc style c-style-alist))) setting str sym)
     (while style
@@ -3500,43 +4122,43 @@
   (interactive)
   (cperl-info-on-command (cperl-word-at-point)))
 
-(defun cperl-imenu-info-imenu-search ()
-  (if (looking-at "^-X[ \t\n]") nil
-    (re-search-backward
-     "^\n\\([-a-zA-Z]+\\)[ \t\n]")
-    (forward-line 1)))
-
-(defun cperl-imenu-info-imenu-name ()  
-  (buffer-substring
-   (match-beginning 1) (match-end 1)))
-
-(defun cperl-imenu-on-info ()
-  (interactive)
-  (let* ((buffer (current-buffer))
-	 imenu-create-index-function
-	 imenu-prev-index-position-function 
-	 imenu-extract-index-name-function 
-	 (index-item (save-restriction
-		       (save-window-excursion
-			 (set-buffer (cperl-info-buffer nil))
-			 (setq imenu-create-index-function 
-			       'imenu-default-create-index-function
-			       imenu-prev-index-position-function
-			       'cperl-imenu-info-imenu-search
-			       imenu-extract-index-name-function
-			       'cperl-imenu-info-imenu-name)
-			 (imenu-choose-buffer-index)))))
-    (and index-item
-	 (progn
-	   (push-mark)
-	   (pop-to-buffer "*info-perl*")
-	   (cond
-	    ((markerp (cdr index-item))
-	     (goto-char (marker-position (cdr index-item))))
-	    (t
-	     (goto-char (cdr index-item))))
-	   (set-window-start (selected-window) (point))
-	   (pop-to-buffer buffer)))))
+;;(defun cperl-imenu-info-imenu-search ()
+;;  (if (looking-at "^-X[ \t\n]") nil
+;;    (re-search-backward
+;;     "^\n\\([-a-zA-Z_]+\\)[ \t\n]")
+;;    (forward-line 1)))
+
+;;(defun cperl-imenu-info-imenu-name ()  
+;;  (buffer-substring
+;;   (match-beginning 1) (match-end 1)))
+
+;;(defun cperl-imenu-on-info ()
+;;  (interactive)
+;;  (let* ((buffer (current-buffer))
+;;	 imenu-create-index-function
+;;	 imenu-prev-index-position-function 
+;;	 imenu-extract-index-name-function 
+;;	 (index-item (save-restriction
+;;		       (save-window-excursion
+;;			 (set-buffer (cperl-info-buffer nil))
+;;			 (setq imenu-create-index-function 
+;;			       'imenu-default-create-index-function
+;;			       imenu-prev-index-position-function
+;;			       'cperl-imenu-info-imenu-search
+;;			       imenu-extract-index-name-function
+;;			       'cperl-imenu-info-imenu-name)
+;;			 (imenu-choose-buffer-index)))))
+;;    (and index-item
+;;	 (progn
+;;	   (push-mark)
+;;	   (pop-to-buffer "*info-perl*")
+;;	   (cond
+;;	    ((markerp (cdr index-item))
+;;	     (goto-char (marker-position (cdr index-item))))
+;;	    (t
+;;	     (goto-char (cdr index-item))))
+;;	   (set-window-start (selected-window) (point))
+;;	   (pop-to-buffer buffer)))))
 
 (defun cperl-lineup (beg end &optional step minshift)
   "Lineup construction in a region.
@@ -3603,7 +4225,7 @@
 in subdirectories too."
   (interactive)
   (let ((cmd "etags")
-	(args '("-l" "none" "-r" "/\\<\\(package\\|sub\\)[ \\t]+\\(\\([a-zA-Z0-9:_]*::\\)?\\([a-zA-Z0-9_]+\\)[ \\t]*\\([{#]\\|$\\)\\)/\\4/"))
+	(args '("-l" "none" "-r" "/\\<\\(package\\|sub\\)[ \\t]+\\(\\([a-zA-Z0-9:_]*::\\)?\\([a-zA-Z0-9_]+\\)[ \\t]*\\(([^()]*)[ \t]*\\)?\\([{#]\\|$\\)\\)/\\4/"))
 	res)
     (if add (setq args (cons "-a" args)))
     (or files (setq files (list buffer-file-name)))
@@ -3611,7 +4233,7 @@
      ((eq all 'recursive)
       ;;(error "Not implemented: recursive")
       (setq args (append (list "-e" 
-			       "sub wanted {push @ARGV, $File::Find::name if /\\.[Pp][Llm]$/}
+			       "sub wanted {push @ARGV, $File::Find::name if /\\.[pP][Llm]$/}
 				use File::Find;
 				find(\\&wanted, '.');
 				exec @ARGV;" 
@@ -3660,7 +4282,12 @@
   (set-buffer (get-buffer-create cperl-tmp-buffer))
   (set-syntax-table cperl-mode-syntax-table)
   (buffer-disable-undo)
-  (auto-fill-mode 0))
+  (auto-fill-mode 0)
+  (if cperl-use-syntax-table-text-property-for-tags
+      (progn
+	(make-variable-buffer-local 'parse-sexp-lookup-properties)
+	;; Do not introduce variable if not needed, we check it!
+	(set 'parse-sexp-lookup-properties t))))
 
 (defun cperl-xsub-scan ()
   (require 'cl)
@@ -3710,13 +4337,16 @@
     index-alist))
 
 (defun cperl-find-tags (file xs)
-  (let (ind (b (get-buffer cperl-tmp-buffer)) lst elt pos ret)
+  (let (ind (b (get-buffer cperl-tmp-buffer)) lst elt pos ret
+	    (cperl-pod-here-fontify nil))
     (save-excursion
       (if b (set-buffer b)
 	  (cperl-setup-tmp-buf))
       (erase-buffer)
       (setq file (car (insert-file-contents file)))
       (message "Scanning file %s..." file)
+      (if cperl-use-syntax-table-text-property-for-tags
+	  (cperl-find-pods-heres))
       (if xs
 	  (setq lst (cperl-xsub-scan))
 	(setq ind (imenu-example--create-perl-index))
@@ -3783,8 +4413,7 @@
     (save-excursion
       (cond (inbuffer nil)		; Already there
 	    ((file-exists-p tags-file-name)
-	     ;;(visit-tags-table-buffer tags-file-name))
-	     (visit-tags-table-buffer))
+	     (visit-tags-table-buffer tags-file-name))
 	    (t (set-buffer (find-file-noselect tags-file-name))))
       (cond
        (dir
@@ -3793,12 +4422,15 @@
 	       (erase-buffer)
 	       (setq erase 'ignore)))
 	(let ((files 
-	       (directory-files file t (if recurse nil "\\.[Pp][Llm]$") t)))
+	       (directory-files file t 
+				(if recurse nil cperl-scan-files-regexp)
+				t)))
 	  (mapcar (function (lambda (file)
 			      (cond
-			       ((string-match "/\\.\\.?$" file) nil)
+			       ((string-match cperl-noscan-files-regexp file)
+				nil)
 			       ((not (file-directory-p file))
-				(if (string-match "\\.\\([Pp][Llm]\\|xs\\)$" file)
+				(if (string-match cperl-scan-files-regexp file)
 				    (cperl-write-tags file erase recurse nil t)))
 			       ((not recurse) nil)
 			       (t (cperl-write-tags file erase recurse t t)))))
@@ -3814,10 +4446,11 @@
 		   (progn
 		     (search-backward "\f\n")
 		     (delete-region (point)
-				    (progn 
+				    (save-excursion
 				      (forward-char 1)
-				      (search-forward "\f\n" nil 'toend)
-				      (point))))
+				      (if (search-forward "\f\n" nil 'toend)
+				       (- (point) 2)
+				       (point-max)))))
 		 (goto-char (point-max)))))
 	(insert (cperl-find-tags file xs))))
       (if inbuffer nil		; Delegate to the caller
@@ -3826,7 +4459,16 @@
 	    (initialize-new-tags-table))))))
 
 (defvar cperl-tags-hier-regexp-list
-  "^\\(\\(package\\)\\>\\|sub\\>[^\n]+::\\|[a-zA-Z_][a-zA-Z_0-9:]*(\C-?[^\n]+::\\|[ \t]*BOOT:\C-?[^\n]+::\\)")
+  (concat 
+   "^\\("
+      "\\(package\\)\\>"
+     "\\|"
+      "sub\\>[^\n]+::"
+     "\\|"
+      "[a-zA-Z_][a-zA-Z_0-9:]*(\C-?[^\n]+::" ; XSUB?
+     "\\|"
+      "[ \t]*BOOT:\C-?[^\n]+::"		; BOOT section
+   "\\)"))
 
 (defvar cperl-hierarchy '(() ())
   "Global hierarchy of classes")
@@ -3839,7 +4481,14 @@
       (setq pos (match-beginning 0) 
 	    pack (match-beginning 2))
       (beginning-of-line)
-      (if (looking-at "\\([^\n]+\\)\C-?\\([^\n]+\\)\C-a\\([0-9]+\\),\\([0-9]+\\)")
+      (if (looking-at (concat
+		       "\\([^\n]+\\)"
+		       "\C-?"
+		       "\\([^\n]+\\)"
+		       "\C-a"
+		       "\\([0-9]+\\)"
+		       ","
+		       "\\([0-9]+\\)"))
 	  (progn
 	    (setq ;;str (buffer-substring (match-beginning 1) (match-end 1))
 		  name (buffer-substring (match-beginning 2) (match-end 2))
@@ -3907,7 +4556,7 @@
 	(if window-system
 	    (x-popup-menu t (nth 2 cperl-hierarchy))
 	  (require 'tmm)
-	  (tmm-prompt t (nth 2 cperl-hierarchy))))
+	  (tmm-prompt (nth 2 cperl-hierarchy))))
   (if (and update (listp update))
       (progn (while (cdr update) (setq update (cdr update)))
 	     (setq update (car update)))) ; Get the last from the list
@@ -3918,7 +4567,7 @@
   (if (eq update -999) (cperl-tags-hier-init t)))
 
 (defun cperl-tags-treeify (to level)
-  ;; cadr of to is read-write. On start it is a cons
+  ;; cadr of `to' is read-write. On start it is a cons
   (let* ((regexp (concat "^\\(" (mapconcat 
 				 'identity
 				 (make-list level "[_a-zA-Z0-9]+")
@@ -3959,16 +4608,6 @@
 	(mapcar (function (lambda (elt)
 			  (cperl-tags-treeify elt (1+ level))))
 		(cdr to)))
-    ;; Now add back functions removed from display
-    (mapcar (function (lambda (elt)
-			(setcdr to (cons elt (cdr to)))))
-	    root-functions)
-    ;; Now add back packages removed from display
-    (mapcar (function (lambda (elt)
-			(setcdr to (cons (cons (concat "package " (car elt)) 
-					       (cdr elt)) 
-					 (cdr to)))))
-	    root-packages)
     ;;Now clean up leaders with one child only
     (mapcar (function (lambda (elt)
 			(if (not (and (listp (cdr elt)) 
@@ -3976,6 +4615,26 @@
 			    (setcar elt (car (nth 1 elt)))
 			    (setcdr elt (cdr (nth 1 elt))))))
 	    (cdr to))
+    ;; Sort the roots of subtrees
+    (if (default-value 'imenu-sort-function)
+	(setcdr to
+		(sort (cdr to) (default-value 'imenu-sort-function))))
+    ;; Now add back functions removed from display
+    (mapcar (function (lambda (elt)
+			(setcdr to (cons elt (cdr to)))))
+	    (if (default-value 'imenu-sort-function)
+		(nreverse
+		 (sort root-functions (default-value 'imenu-sort-function)))
+	      root-functions))
+    ;; Now add back packages removed from display
+    (mapcar (function (lambda (elt)
+			(setcdr to (cons (cons (concat "package " (car elt)) 
+					       (cdr elt)) 
+					 (cdr to)))))
+	    (if (default-value 'imenu-sort-function)
+		(nreverse 
+		 (sort root-packages (default-value 'imenu-sort-function)))
+	      root-packages))
     ))
 
 ;;;(x-popup-menu t
@@ -4017,7 +4676,7 @@
 			   (cons (car elt)
 				 (cperl-menu-to-keymap list))))
 		    (t
-		     (list (cdr elt) (car elt))))))
+		     (list (cdr elt) (car elt) t))))) ; t is needed in 19.34
 	   (cperl-list-fold menu "Root" imenu-max-items)))))
 
 
@@ -4032,8 +4691,8 @@
 (defvar cperl-not-bad-style-regexp 
   (mapconcat 'identity
    '("[^-\t <>=+]\\(--\\|\\+\\+\\)"	; var-- var++
-     "[a-zA-Z0-9][|&][a-zA-Z0-9$]"	; abc|def abc&def are often used.
-     "&[(a-zA-Z0-9$]"			; &subroutine &(var->field)
+     "[a-zA-Z0-9_][|&][a-zA-Z0-9_$]"	; abc|def abc&def are often used.
+     "&[(a-zA-Z0-9_$]"			; &subroutine &(var->field)
      "<\\$?\\sw+\\(\\.\\sw+\\)?>"	; <IN> <stdin.h>
      "-[a-zA-Z][ \t]+[_$\"'`]"		; -f file
      "-[0-9]"				; -5
@@ -4046,7 +4705,7 @@
      "||"
      "&&"
      "[CBIXSLFZ]<\\(\\sw\\|\\s \\|\\s_\\|[\n]\\)*>" ; C<code like text>
-     "-[a-zA-Z0-9]+[ \t]*=>"			; -option => value
+     "-[a-zA-Z_0-9]+[ \t]*=>"			; -option => value
      ;; Unaddressed trouble spots: = -abc, f(56, -abc) --- specialcased below
      ;;"[*/+-|&<.]+="
      )
@@ -4137,7 +4796,7 @@
   "Matches places in the buffer we can find help for.")
 
 (defvar cperl-message-on-help-error t)
-(defvar cperl-help-from-timer nil)
+(defvar cperl-help-from-hook nil)
 
 (defun cperl-word-at-point-hard ()
   ;; Does not save-excursion
@@ -4153,7 +4812,7 @@
   ;; Try to backtrace
   (cond
    ((looking-at "[a-zA-Z0-9_:]")	; symbol
-    (skip-chars-backward "[a-zA-Z0-9_:]")
+    (skip-chars-backward "a-zA-Z0-9_:")
     (cond 
      ((and (eq (preceding-char) ?^)	; $^I
 	   (eq (char-after (- (point) 2)) ?\$))
@@ -4171,7 +4830,7 @@
    ((and (looking-at "\\^") (eq (preceding-char) ?\$)) ; $^I
     (forward-char -1))
    ((looking-at "[-!&*+,-./<=>?\\\\^|~]")
-    (skip-chars-backward "[-!&*+,-./<=>?\\\\^|~]")
+    (skip-chars-backward "-!&*+,-./<=>?\\\\^|~")
     (cond
      ((and (eq (preceding-char) ?\$)
 	   (not (eq (char-after (- (point) 2)) ?\$))) ; $-
@@ -4195,25 +4854,29 @@
 The data for these docs is a little bit obsolete and may be in fact longer
 than a line. Your contribution to update/shorten it is appreciated."
   (interactive)
-  (save-excursion
-    (let ((word (cperl-word-at-point-hard)))
-      (if word
-	  (if (and cperl-help-from-timer ; Bail out if not in mainland
-		   (not (string-match "^#!\\|\\\\\\|^=" word)) ; Show help even in comments/strings.
-		   (or (memq (get-text-property (point) 'face)
-			     '(font-lock-comment-face font-lock-string-face))
-		       (memq (get-text-property (point) 'syntax-type)
-			     '(pod here-doc format))))
-	      nil
-	    (cperl-describe-perl-symbol word))
-	(if cperl-message-on-help-error
-	    (message "Nothing found for %s..." 
-		     (buffer-substring (point) (+ 5 (point)))))))))
+  (save-match-data			; May be called "inside" query-replace
+    (save-excursion
+      (let ((word (cperl-word-at-point-hard)))
+	(if word
+	    (if (and cperl-help-from-hook ; Bail out if not in mainland
+		     (not (string-match "^#!\\|\\\\\\|^=" word)) ; Show help even in comments/strings.
+		     (or (memq (get-text-property (point) 'face)
+			       '(font-lock-comment-face font-lock-string-face))
+			 (memq (get-text-property (point) 'syntax-type)
+			       '(pod here-doc format))))
+		nil
+	      (cperl-describe-perl-symbol word))
+	  (if cperl-message-on-help-error
+	      (message "Nothing found for %s..." 
+		       (buffer-substring (point) (min (+ 5 (point)) (point-max))))))))))
 
 ;;; Stolen from perl-descr.el by Johan Vromans:
 
 (defvar cperl-doc-buffer " *perl-doc*"
   "Where the documentation can be found.")
+(defvar cperl-last-help nil
+  "The last help message, for echo area refresh.")
+(make-variable-buffer-local 'cperl-last-help)
 
 (defun cperl-describe-perl-symbol (val)
   "Display the documentation of symbol at point, a Perl operator."
@@ -4253,9 +4916,10 @@
 	     (beginning-of-line 1)
 	     (let ((lnstart (point)))
 	       (end-of-line)
-	       (message "%s" (buffer-substring lnstart (point)))))
+	       (setq cperl-last-help
+		     (cperl-message "%s" (buffer-substring lnstart (point))))))
 	 (if cperl-message-on-help-error
-	     (message "No definition for %s" val)))))))
+	     (cperl-message "No definition for %s" val)))))))
 
 (defvar cperl-short-docs "Ignore my value"
   ;; Perl4 version was written by Johan Vromans (jvromans@squirrel.nl)
@@ -4392,7 +5056,7 @@
 @ARGV	Command line arguments (not including the command name - see $0).
 @INC	List of places to look for perl scripts during do/include/use.
 @_	Parameter array for subroutines. Also used by split unless in array context.
-\\	Creates a reference to whatever follows, like \$var.
+\\  Creates reference to what follows, like \$var, or quotes non-\w in strings.
 \\0	Octal char, e.g. \\033.
 \\E	Case modification terminator. See \\Q, \\L, and \\U.
 \\L	Lowercase until \\E . See also \l, lc.
@@ -4403,17 +5067,18 @@
 \\c	Control character, e.g. \\c[ .
 \\e	Escape character (octal 033).
 \\f	Formfeed character (octal 014).
-\\l	Lowercase the next character. See also \\L and \\u, lcfirst,
-\\n	Newline character (octal 012).
-\\r	Return character (octal 015).
+\\l	Lowercase the next character. See also \\L and \\u, lcfirst.
+\\n	Newline character (octal 012 on most systems).
+\\r	Return character (octal 015 on most systems).
 \\t	Tab character (octal 011).
-\\u	Upcase the next character. See also \\U and \\l, ucfirst,
+\\u	Upcase the next character. See also \\U and \\l, ucfirst.
 \\x	Hex character, e.g. \\x1b.
-^ ...	Bitwise exclusive or.
+... ^ ...	Bitwise exclusive or.
 __END__	Ends program source.
 __DATA__	Ends program source.
 __FILE__	Current (source) filename.
 __LINE__	Current line in current source.
+__PACKAGE__	Current package.
 ARGV	Default multi-file input filehandle. <ARGV> is a synonym for <>.
 ARGVOUT	Output filehandle with -i flag.
 BEGIN { ... }	Immediately executed (during compilation) piece of code.
@@ -4443,7 +5108,7 @@
 delete($HASH{KEY})
 die(LIST)
 do { ... }|SUBR while|until EXPR	executes at least once
-do(EXPR|SUBR([LIST]))
+do(EXPR|SUBR([LIST]))	(with while|until executes at least once)
 dump LABEL
 each(%HASH)
 endgrent
@@ -4525,10 +5190,10 @@
 oct(EXPR)
 open(FILEHANDLE[,EXPR])
 opendir(DIRHANDLE,EXPR)
-ord(EXPR)
+ord(EXPR)	ASCII value of the first char of the string.
 pack(TEMPLATE,LIST)
 package NAME	Introduces package context.
-pipe(READHANDLE,WRITEHANDLE)
+pipe(READHANDLE,WRITEHANDLE)	Create a pair of filehandles on ends of a pipe.
 pop(ARRAY)
 print [FILEHANDLE] [(LIST)]
 printf [FILEHANDLE] (FORMAT,LIST)
@@ -4611,7 +5276,7 @@
 vec(EXPR,OFFSET,BITS)
 wait
 waitpid(PID,FLAGS)
-wantarray
+wantarray	Returns true if the sub/eval is called in list context.
 warn(LIST)
 while  (EXPR) { ... }					EXPR while EXPR
 write[(EXPR|FILEHANDLE)]
@@ -4635,32 +5300,32 @@
 abs [ EXPR ]	absolute value
 ... and ...		Low-precedence synonym for &&.
 bless REFERENCE [, PACKAGE]	Makes reference into an object of a package.
-chomp		Docs missing
-chr		Docs missing
+chomp [LIST]	Strips $/ off LIST/$_. Returns count. Special if $/ eq ''!
+chr		Converts a number to char with the same ordinal.
 else		Part of if/unless {BLOCK} elsif {BLOCK} else {BLOCK}.
 elsif		Part of if/unless {BLOCK} elsif {BLOCK} else {BLOCK}.
 exists	$HASH{KEY}	True if the key exists.
-format		Docs missing
-formline	Docs missing
+format [NAME] =	 Start of output format. Ended by a single dot (.) on a line.
+formline PICTURE, LIST	Backdoor into \"format\" processing.
 glob EXPR	Synonym of <EXPR>.
 lc [ EXPR ]	Returns lowercased EXPR.
 lcfirst [ EXPR ]	Returns EXPR with lower-cased first letter.
-map		Docs missing
+map EXPR, LIST	or map {BLOCK} LIST	Applies EXPR/BLOCK to elts of LIST.
 no PACKAGE [SYMBOL1, ...]  Partial reverse for `use'. Runs `unimport' method.
-... not ...		Low-precedence synonym for ! - negation.
+not ...		Low-precedence synonym for ! - negation.
 ... or ...		Low-precedence synonym for ||.
 pos STRING    Set/Get end-position of the last match over this string, see \\G.
-quotemeta [ EXPR ]	Quote metacharacters.
-qw		Docs missing
+quotemeta [ EXPR ]	Quote regexp metacharacters.
+qw/WORD1 .../		Synonym of split('', 'WORD1 ...')
 readline FH	Synonym of <FH>.
 readpipe CMD	Synonym of `CMD`.
 ref [ EXPR ]	Type of EXPR when dereferenced.
-sysopen		Docs missing
-tie		Docs missing
-tied		Docs missing
+sysopen FH, FILENAME, MODE [, PERM]	(MODE is numeric, see Fcntl.)
+tie VAR, PACKAGE, LIST	Hide an object behind a simple Perl variable.
+tied		Returns internal object for a tied data.
 uc [ EXPR ]	Returns upcased EXPR.
 ucfirst [ EXPR ]	Returns EXPR with upcased first letter.
-untie		Docs missing
+untie VAR	Unlink an object from a simple Perl variable.
 use PACKAGE [SYMBOL1, ...]  Compile-time `require' with consequent `import'.
 ... xor ...		Low-precedence synonym for exclusive or.
 prototype \&SUB	Returns prototype of the function given a reference.
@@ -4687,37 +5352,224 @@
 					  'variable-documentation))
 	  (setq buffer-read-only t)))))
 
-(if (fboundp 'run-with-idle-timer)
-    (progn
-      (defvar cperl-help-shown nil
-	"Non-nil means that the help was already shown now.")
-
-      (defvar cperl-help-timer nil
-	"Non-nil means that the help was already shown now.")
-
-      (defun cperl-lazy-install ()
-	(interactive)
-	(make-variable-buffer-local 'cperl-help-shown)
-	(if (cperl-val cperl-lazy-help-time)
-	    (progn
-	      (add-hook 'post-command-hook 'cperl-lazy-hook)
-	      (setq cperl-help-timer 
-		    (run-with-idle-timer 
-		     (cperl-val cperl-lazy-help-time 1000000 5) 
-		     t 
-		     'cperl-get-help-defer)))))
-
-      (defun cperl-lazy-unstall ()
-	(interactive)
-	(remove-hook 'post-command-hook 'cperl-lazy-hook)
-	(cancel-timer cperl-help-timer))
-
-      (defun cperl-lazy-hook ()
-	(setq cperl-help-shown nil))
-
-      (defun cperl-get-help-defer ()
-	(if (not (eq major-mode 'perl-mode)) nil
-	  (let ((cperl-message-on-help-error nil) (cperl-help-from-timer t))
-	    (cperl-get-help)
-	    (setq cperl-help-shown t))))
-      (cperl-lazy-install)))
+(defun cperl-beautify-regexp-piece (b e embed)
+  ;; b is before the starting delimiter, e before the ending
+  ;; e should be a marker, may be changed, but remains "correct".
+  (let (s c tmp (m (make-marker)) (m1 (make-marker)) c1 spaces inline)
+    (if (not embed)
+	(goto-char (1+ b))
+      (goto-char b)
+      (cond ((looking-at "(\\?\\\\#")	; badly commented (?#)
+	     (forward-char 2)
+	     (delete-char 1)
+	     (forward-char 1))
+	    ((looking-at "(\\?[^a-zA-Z]")
+	     (forward-char 3))
+	    ((looking-at "(\\?")	; (?i)
+	     (forward-char 2))
+	    (t
+	     (forward-char 1))))
+    (setq c (1- (current-column))
+	  c1 (+ c (or cperl-regexp-indent-step cperl-indent-level)))
+    (or (looking-at "[ \t]*[\n#]")
+	(progn
+	  (insert "\n")))
+    (goto-char e)
+    (beginning-of-line)
+    (if (re-search-forward "[^ \t]" e t)
+	(progn
+	  (goto-char e)
+	  (insert "\n")
+	  (indent-to-column c)
+	  (set-marker e (point))))
+    (goto-char b)
+    (end-of-line 2)
+    (while (< (point) (marker-position e))
+      (beginning-of-line)
+      (setq s (point)
+	    inline t)
+      (skip-chars-forward " \t")
+      (delete-region s (point))
+      (indent-to-column c1)
+      (while (and
+	      inline
+	      (looking-at 
+	       (concat "\\([a-zA-Z0-9]+[^*+{?]\\)" ; 1
+		       "\\|"
+		       "\\$\\([a-zA-Z0-9_]+\\([[{]\\)?\\|[^\n \t)|]\\)" ; 2 3
+		       "\\|"
+		       "[$^]"
+		       "\\|"
+		       "\\(\\\\.\\|[^][()#|*+?\n]\\)\\([*+{?]\\??\\)?" ; 4 5
+		       "\\|"
+		       "\\(\\[\\)"	; 6
+		       "\\|"
+		       "\\((\\(\\?\\)?\\)" ; 7 8
+		       "\\|"
+		       "\\(|\\)"	; 9
+		       )))
+	(goto-char (match-end 0))
+	(setq spaces t)
+	(cond ((match-beginning 1)	; Alphanum word + junk
+	       (forward-char -1))
+	      ((or (match-beginning 3)	; $ab[12]
+		   (and (match-beginning 5) ; X* X+ X{2,3}
+			(eq (preceding-char) ?\{)))
+	       (forward-char -1)
+	       (forward-sexp 1))
+	      ((match-beginning 6)	; []
+	       (setq tmp (point))
+	       (if (looking-at "\\^?\\]")
+		   (goto-char (match-end 0)))
+	       (or (re-search-forward "\\]\\([*+{?]\\)?" e t)
+		   (progn
+		     (goto-char (1- tmp))
+		     (error "[]-group not terminated")))
+	       (if (not (eq (preceding-char) ?\{)) nil
+		 (forward-char -1)
+		 (forward-sexp 1)))
+	      ((match-beginning 7)	; ()
+	       (goto-char (match-beginning 0))
+	       (or (eq (current-column) c1)
+		   (progn
+		     (insert "\n")
+		     (indent-to-column c1)))
+	       (setq tmp (point))
+	       (forward-sexp 1)
+	       ;;	       (or (forward-sexp 1)
+	       ;;		   (progn
+	       ;;		     (goto-char tmp)
+	       ;;		     (error "()-group not terminated")))
+	       (set-marker m (1- (point)))
+	       (set-marker m1 (point))
+	       (cperl-beautify-regexp-piece tmp m t)
+	       (goto-char m1)
+	       (cond ((looking-at "[*+?]\\??")
+		      (goto-char (match-end 0)))
+		     ((eq (following-char) ?\{)
+		      (forward-sexp 1)
+		      (if (eq (following-char) ?\?)
+			  (forward-char))))
+	       (skip-chars-forward " \t")
+	       (setq spaces nil)
+	       (if (looking-at "[#\n]")
+		   (beginning-of-line 2)
+		 (insert "\n"))
+	       (end-of-line)
+	       (setq inline nil))
+	      ((match-beginning 9)	; |
+	       (forward-char -1)
+	       (setq tmp (point))
+	       (beginning-of-line)
+	       (if (re-search-forward "[^ \t]" tmp t)
+		   (progn
+		     (goto-char tmp)
+		     (insert "\n"))
+		 ;; first at line
+		 (delete-region (point) tmp))
+	       (indent-to-column c)
+	       (forward-char 1)
+	       (skip-chars-forward " \t")
+	       (setq spaces nil)
+	       (if (looking-at "[#\n]")
+		   (beginning-of-line 2)
+		 (insert "\n"))
+	       (end-of-line)
+	       (setq inline nil)))
+	(or (looking-at "[ \t\n]")
+	    (not spaces)
+	    (insert " "))
+	(skip-chars-forward " \t"))
+	(or (looking-at "[#\n]")
+	    (error "unknown code in a regexp"))
+	(and inline (end-of-line 2)))
+  ))
+
+(defun cperl-beautify-regexp ()
+  "do it. (Experimental, may change semantics, recheck afterwards.)
+We suppose that the regexp is scanned already."
+  (interactive)
+  (or cperl-use-syntax-table-text-property
+      (error "I need to have regex marked!"))
+  ;; Find the start
+  (re-search-backward "\\s|")		; Assume it is scanned already.
+  ;;(forward-char 1)
+  (let ((b (point)) (e (make-marker)) have-x delim (c (current-column))
+	(sub-p (eq (preceding-char) ?s)) s)
+    (forward-sexp 1)
+    (set-marker e (1- (point)))
+    (setq delim (preceding-char))
+    (if (and sub-p (eq delim (char-after (- (point) 2))))
+	(error "Possible s/blah// - do not know how to deal with"))
+    (if sub-p (forward-sexp 1))
+    (if (looking-at "\\sw*x") 
+	(setq have-x t)
+      (insert "x"))
+    ;; Protect fragile " ", "#"
+    (if have-x nil
+	(goto-char (1+ b))
+	(while (re-search-forward "\\(\\=\\|[^\\\\]\\)\\(\\\\\\\\\\)*[ \t\n#]" e t) ; Need to include (?#) too?
+	  (forward-char -1)
+	  (insert "\\")
+	  (forward-char 1)))
+    (cperl-beautify-regexp-piece b e nil)))
+
+
+;; Part from the original `cperl-lazy-*', and part from `eldoc'
+;; Karl M. Hegbloom <karlheg@inetarena.com>
+
+(defvar cperl-help nil
+  "Non-nil means that the lazy-help handlers are installed now.")
+
+(defun cperl-help (&optional arg)
+  (interactive "p")
+  (cond ((and arg (<= arg 0))
+	 (remove-hook 'post-command-hook 'cperl-get-help-defer)
+	 (remove-hook 'pre-command-hook 'cperl-refresh-echo-area)
+	 (setq cperl-help nil))
+	(t
+	 (add-hook 'post-command-hook 'cperl-get-help-defer)
+	 (add-hook 'pre-command-hook 'cperl-refresh-echo-area)
+	 (setq cperl-help t))))
+
+(defun cperl-toggle-help ()
+  (interactive)
+  (if cperl-help
+      (cperl-help 0)
+     (cperl-help 1)))
+
+(defun cperl-get-help-defer ()
+  (if (not (eq major-mode 'perl-mode)) nil
+      (let ((cperl-message-on-help-error nil) (cperl-help-from-hook t))
+	(cperl-get-help))))
+
+;; from `eldoc-refresh-*'
+(defun cperl-refresh-echo-area ()
+  (and cperl-last-help
+       (if (and cperl-mode
+		(not executing-kbd-macro)
+		(not cursor-in-echo-area)
+		(not (eq (selected-window) (minibuffer-window))))
+	   (cperl-message cperl-last-help)
+	 (setq cperl-last-help nil))))
+	   
+;; see `eldoc-message'
+(defun cperl-message (&rest args)
+  (let ((omessage cperl-last-help))
+    (cond ((eq (car args) cperl-last-help))
+          ((or (null args)
+               (null (car args)))
+           (setq cperl-last-help nil))
+          (t
+           (setq cperl-last-help (apply 'format args))))
+    ;; Do not put cperl-help messages in the log
+    (if cperl-last-help
+	(display-message 'no-log cperl-last-help)
+      (and omessage
+	   (clear-message 'no-log))))
+  cperl-last-help)
+
+(when cperl-help
+  (cperl-help 1))
+
+(provide 'cperl-mode)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/modes/lazy-shot.el	Mon Aug 13 09:58:30 2007 +0200
@@ -0,0 +1,136 @@
+;;; lazy-shot.el --- Lazy font locking for XEmacs
+
+;; Copyright (C) 1997 Jan Vroonhof
+
+;; Author: Jan Vroonhof <vroonhof@math.ethz.ch>
+;; Keywords: languages, faces
+
+;; 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 synched.
+
+;;; Commentary:
+
+;; This versions has basic demand lock functionality. Somebody please
+;; sync further with lazy-lock v2 from FSF, customize etc.
+;;
+;;
+;; Idea for the stealth lock function:
+;;
+;;
+;; On an Idle itimer
+;;    Loop over all buffers with lazy-lock set
+;;       mapcar-extent in the region  (point) point-max for
+;;                      one-shot-function property
+;;         If not found do the same for [point-min,point]
+;;         font-lock the found region and delete the extent
+
+;;; Code:
+
+(require 'font-lock)
+
+(defvar lazy-shot-mode nil)
+
+
+(defvar lazy-shot-step-size (* 1 124)) ;; Please test diffent sizes
+
+;;;###autoload
+(defun lazy-shot-mode (&optional arg)
+  "Toggle Lazy Lock mode.
+With arg, turn Lazy Lock mode on if and only if arg is positive."
+  (interactive "P")
+  (set (make-local-variable 'lazy-shot-mode)
+       (and (if arg (> (prefix-numeric-value arg) 0) (not lazy-shot-mode))))
+  (cond ((and lazy-shot-mode (not font-lock-mode))
+	 ;; Turned on `lazy-shot-mode' rather than `font-lock-mode'.
+	 (let ((font-lock-support-mode 'lazy-shot-mode))
+	   (font-lock-mode t)))
+	(lazy-shot-mode
+	 ;; Turn ourselves on.
+	 (lazy-shot-install))
+	(t
+	 ;; Turn ourselves off.
+	 (lazy-shot-unstall))))
+
+;;;###autoload
+(defun turn-on-lazy-shot ()
+  "Unconditionally turn on Lazy Lock mode."
+  (lazy-shot-mode t))
+
+
+(defun lazy-shot-shot-function (extent)
+   "Lazy lock the extent when it has become visisble"
+   (let ((start (extent-start-position extent))
+         (end   (extent-end-position extent))
+	 (buffer (extent-buffer extent)))
+     (delete-extent extent)
+     (save-excursion 
+       ;; This magic should really go into font-lock-fonity-region
+       (goto-char start)
+       (unless (bolp)
+	 (beginning-of-line)
+	 (setq start (point)))
+       (goto-char end)
+       (unless (bolp)
+	 (forward-line)
+	 (setq end (point)))
+       (message "Lazy-shot fontifying from %s to %s in %s" start end buffer)
+       (save-match-data
+	   (font-lock-fontify-region start end)))))
+
+(defun lazy-shot-install-extent (spos epos &optional buffer)
+  "Make an extent that will lazy-shot if it is displayed"
+     (let ((extent (make-extent spos epos buffer)))
+       (when extent
+         (set-extent-one-shot-function extent
+                       'lazy-shot-shot-function))
+       extent))
+
+(defun lazy-shot-install-extents (fontifying)
+  ;;
+  ;; Add hook if lazy-shot.el is deferring or is fontifying on scrolling.
+     (when fontifying
+     (let ((start  (point-min)))
+      (while (< start (point-max))
+         (lazy-shot-install-extent start
+           (min (point-max) (+ start lazy-shot-step-size)))
+         (setq start (+ start lazy-shot-step-size))))))
+
+(defun lazy-shot-install ()
+  (make-local-variable 'font-lock-fontified)
+  (setq font-lock-fontified t)
+  (lazy-shot-install-extents font-lock-fontified))
+
+(defun lazy-shot-unstall ()
+  ;;
+  ;; Remove the extents.
+  (map-extents 
+     (lambda (e arg) (delete-extent e) nil) 
+     nil nil nil nil nil 'one-shot-function 'lazy-shot-shot-function)
+  ;;
+  ;; Remove the fontification hooks.
+  (remove-hook 'after-change-functions 'lazy-shot-defer-after-change t)
+  ;;
+  ;; If Font Lock mode is still enabled, reinstall its hook.
+  (when font-lock-mode
+    (add-hook 'after-change-functions 'font-lock-after-change-function nil t)))
+
+
+(provide 'lazy-shot)
+
+;;; lazy-shot.el ends here
--- a/lisp/modes/outl-mouse.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/modes/outl-mouse.el	Mon Aug 13 09:58:30 2007 +0200
@@ -438,17 +438,23 @@
   "Add annotations and glyphs to all heading lines that don't have them."
   (interactive)
   (save-excursion
-    (and outline-scanning-message (message outline-scanning-message 0))
+    (and outline-scanning-message (display-message
+				   'progress
+				   (format outline-scanning-message 0)))
     (goto-char (point-min))
     (if (not (outline-on-heading-p)) (outline-next-visible-heading-safe))
     (while 
 	(progn
 	  (outline-heading-add-glyph-1)
 	  (and outline-scanning-message 
-	       (message outline-scanning-message (fume-relative-position)))
+	       (display-message
+		'progress
+		(format outline-scanning-message (fume-relative-position))))
 	  (outline-next-visible-heading-safe)))
     (and outline-scanning-message 
-	 (message "%s done" (format outline-scanning-message 100)))))
+	 (display-message
+	  'progress
+	  (format "%s done" (format outline-scanning-message 100))))))
 
 (defun outline-delete-glyphs ()
   "Remove annotations and glyphs from heading lines."
--- a/lisp/oobr/ChangeLog	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/oobr/ChangeLog	Mon Aug 13 09:58:30 2007 +0200
@@ -1,3 +1,7 @@
+1997-09-17  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile (autoloads): Fix target.
+
 1997-07-08  Steven L Baur  <steve@altair.xemacs.org>
 
 	* br-clos-ft.el (clos-scan-routine-arglist): Don't reference
--- a/lisp/oobr/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/oobr/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -298,5 +298,6 @@
 auto-autoloads.el: $(EL_COMPILE)
 	$(EMACS) -batch -q -no-site-file \
 		-eval '(setq autoload-target-directory "'`pwd`'/")' \
+		-eval '(setq autoload-package-name "oobr")' \
 		-l autoload \
 		-f batch-update-autoloads $?
--- a/lisp/packages/compile.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/packages/compile.el	Mon Aug 13 09:58:30 2007 +0200
@@ -649,14 +649,18 @@
 	      (setq compilation-in-progress 
 		    (cons proc compilation-in-progress)))
 	  ;; No asynchronous processes available.
-	  (message "Executing `%s'..." command)
+	  (display-message
+	   'progress
+	   (format "Executing `%s'..." command))
 	  ; FSF
 	  ; (setq mode-line-process ":run")
 	  ; (force-mode-line-update)
 	  (sit-for 0)			;; Force redisplay
 	  (let ((status (call-process shell-file-name nil outbuf nil "-c"
 				      command))))
-	  (message "Executing `%s'...done" command)))
+	  (display-message
+	   'progress
+	   (format "Executing `%s'...done" command))))
        (set-buffer buffer-save)))
 
     ;; Make it so the next C-x ` will use this buffer.
@@ -955,9 +959,11 @@
 			       (pos-visible-in-window-p (point-max) window))
 			  nil		; assume that the user will see it...
 			(ding t 'ready)
-			(message "Compilation process completed%s."
+			(display-message
+			 'progress
+			 (format "Compilation process completed%s."
 				 (or estatus " successfully")
-				 ))
+				 )))
 		      ;; Since the buffer and mode line will show that the
 		      ;; process is dead, we can delete it now.  Otherwise it
 		      ;; will stay around until M-x list-processes.
@@ -1637,7 +1643,7 @@
   "Parse the current buffer as grep, cc or lint error messages.
 See variable `compilation-parse-errors-function' for the interface it uses."
   (setq compilation-error-list nil)
-  (message "Parsing error messages...")
+  (display-message 'progress "Parsing error messages...")
   (let (;;text-buffer -- unused
 	orig orig-expanded parent-expanded
 	regexp enter-group leave-group error-group
@@ -1884,11 +1890,13 @@
 	     (error "compilation-parse-errors: known groups didn't match!")))
 
       (when (= (% compilation-num-errors-found message-freq) 0)
-        (message "Parsing error messages...%d (%.0f%% of buffer)"
+        (display-message
+	 'progress
+	 (format "Parsing error messages...%d (%.0f%% of buffer)"
                  compilation-num-errors-found
                  ;; Use floating-point because (* 100 (point)) frequently
                  ;; exceeds the range of Emacs Lisp integers.
-                 (/ (* 100.0 (point)) (point-max))))
+                 (/ (* 100.0 (point)) (point-max)))))
 
 ;;; This is broken - it foils the logic above which is supposed to ensure
 ;;; that all errors for the current file are found before we quit. 
@@ -1901,7 +1909,7 @@
 				    ;; We have searched the whole buffer.
 				    (point-max))))
   (setq compilation-error-list (nreverse compilation-error-list))
-  (message "Parsing error messages...done"))
+  (display-message 'progress "Parsing error messages...done"))
 
 ;; If directory DIR is a subdir of ORIG or of ORIG's parent,
 ;; return a relative name for it starting from ORIG or its parent.
--- a/lisp/packages/etags.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/packages/etags.el	Mon Aug 13 09:58:30 2007 +0200
@@ -27,96 +27,6 @@
 ;;; different people; we got one, FSF got the other.  Various
 ;;; people have said that our version is better and faster.
 
-;; Created by: Joe Wells, jbw@bucsf.bu.edu
-;; Created on: Thu Mar 22 20:17:40 1990
-;; Filename: etags.el
-;; Purpose: enhanced tags functionality
-;; Change log: 
-;;
-;; Fri Jun  7 10:50:00 1996  Doug Keller <dkeller@vnet.ibm.com>
-;;
-;;      * Added tags-auto-read-changed-tag-files to automatically re-read
-;;      changed TAGS file from disk and not ask.
-;;
-;; Mon Jun  5 00:13:13 1995  Ben Wing <wing@666.com>
-;;
-;;	* Brought over some FSF code to "temporarily visit" files,
-;;	so as to not have font-lock invoked.
-
-;; Thu Jan  6 17:10:40 1994  Norbert Kiesel <norbert@informatik.rwth-aachen.de>
-;;
-;;      * Changed all tags-fix to etags.
-;;      Recognize 'c++-c-mode and 'c++-mode.
-;;      Ensure prefix of TAGS ends with a slash.
-;;      Provide 'etags (besides 'tags).
-;;      Don't skip entries starting with whitespace (some etags-creating
-;;      programs (e.g. m2tags) produce such entries).
-;;
-;; Wed Jan  1 15:09:18 1992  Jamie Zawinski <jwz@lucid.com>
-;;
-;;      * Added Harlan's definition of visit-tags-table.  
-;;      Renamed variable tags-always-build-completion-table to
-;;      tags-build-completion-table and changed its semantics.
-;;      Made the explicit buffer-local tags file be searched 
-;;      first instead of last.
-;;
-;; Sun May 10 15:48:00 1992  Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
-;;
-;;	Inserted visit-tags-table-buffer from tags.el, handle
-;;	tag-file-name=nil, improved some doc strings and variable declarations.
-;;
-;; Fri Mar 29 01:48:06 1991  Jamie Zawinski <jwz@lucid.com>
-;;
-;;	* Made link-chasing and invisible-tags-files optional.
-;;	Renamed delete and remove-duplicates to avoid possible name conflicts.
-;;	Moved "provide" to end.  Added some documentation.
-;; 
-;; Sat Sep 22 22:28:33 1990  Joseph Wells  (jbw at bucsf.bu.edu)
-;; 
-;; 	* Added handling for case where tag is typedef name immediately
-;; 	following struct definition.
-;; 
-;; Thu Sep 13 21:09:15 1990  Joseph Wells  (jbw at bucsf.bu.edu)
-;; 
-;; 	* Fixed behavior not to bomb on missing tag table file.
-;; 
-
-;; Sat Aug 11 18:07:01 1990  Joe Wells  (jbw at dodge.uswest.com)
-;; 
-;; 	* Moved calling find-tag-default-hook into find-tag-default.  Put
-;; 	it inside a condition-case.  Use find-tag-default method when
-;; 	find-tag-default-hook fails or returns nil.
-;; 
-;; Wed Jul 25 17:16:43 1990  Joe Wells  (jbw at dodge.uswest.com)
-;; 
-;; 	* Made it an error for a buffer to have no associated tag tables.
-;; 
-
-;; enhancements:
-;;  1. default tag tables based on filename
-;;  2. multiple tag tables possible per file
-;;  3. tag name completion for find-tag
-;;  4. find-tag using regexp
-;;  5. tag name completion in the buffer
-;;  6. find-tag-default now works at beginning of tag
-;;  7. buffer-local find-tag hook (used for info enhancement)
-;;  8. buffer-local find-tag-default hook (used for info enhancement)
-;;  9. show short info on tag match in minibuffer
-;; 10. stack for backtracking from find-tag
-;; 11. widen buffers for tags-search
-;; 12. display message on successful search
-;; 13. don't pull all files into memory for tags-search
-;; 14. don't leave searched buffers on top of buffer list
-;; 15. find-tag can specify exact symbol matches
-;; 16. find-tag-default specifies an exact symbol match
-;; 17. tags-files can be invisible
-
-;; configuration variables:
-;;   tag-table-alist		controls which tables apply to which buffers
-;;   tags-file-name		a default tags table
-;;   buffer-tag-table		another way of specifying a buffer-local table
-;;   make-tags-files-invisible	whether tags tables should be very hidden
-;;   tag-mark-stack-max		how many tags-based hops to remember
 
 ;; TODO:
 ;; 1. place cursor in echo area while searching
@@ -140,44 +50,7 @@
 ;; Shinichirou Sugou <shin@sgtp.apple.juice.or.jp>
 ;; an unidentified anonymous elisp hacker
 
-;; Installation instructions:
-;;
-;; Put etags.el, symlink-fix.el, symbol-syntax.el in your load path.
-;;
-;; Put the following code in your .emacs (or lisp/default.el)
-;;
-;;(fmakunbound 'visit-tags-table) ; obsolete
-;;(fmakunbound 'find-tag)
-;;(autoload 'find-tag "etags" nil t)
-;;(fmakunbound 'find-tag-other-window)
-;;(autoload 'find-tag-other-window "etags" nil t)
-;;(fmakunbound 'lisp-complete-symbol)
-;;(autoload 'lisp-complete-symbol "etags" nil t)
-;;(fmakunbound 'tag-complete-symbol)
-;;(autoload 'tag-complete-symbol "etags" nil t)
-;;(fmakunbound 'next-file)
-;;(autoload 'next-file "etags" nil t)
-;;(fmakunbound 'tags-loop-continue)
-;;(autoload 'tags-loop-continue "etags" nil t)
-;;(fmakunbound 'tags-search)
-;;(autoload 'tags-search "etags" nil t)
-;;(fmakunbound 'tags-query-replace)
-;;(autoload 'tags-query-replace "etags" nil t)
-;;(fmakunbound 'display-tag-info)
-;;(autoload 'display-tag-info "etags" nil t)
-;;(fmakunbound 'pop-tag-mark)
-;;(autoload 'pop-tag-mark "etags" nil t)
-;;
-;;(define-key esc-map "?" 'display-tag-info)
-;;(define-key esc-map "*" 'pop-tag-mark)
-;;
-;;;; The following are not really implemented:
-;;;;(fmakunbound 'set-buffer-tag-table)
-;;;;(autoload 'set-buffer-tag-table "etags" nil t)
-;;(fmakunbound 'list-tags)
-;;;;(autoload 'list-tags "etags" nil t)
-;;(fmakunbound 'tags-apropos)
-;;;;(autoload 'tags-apropos "etags" nil t)
+(require 'thing)
 
 
 ;; Auxiliary functions
@@ -194,22 +67,6 @@
 	(push el res)))
     (nreverse res)))
 
-;; derived from generate-new-buffer
-;; now defined in C
-;(defun generate-new-buffer-name (name)
-;  "Foo"
-;  (if (not (get-buffer name))
-;      name
-;    (let ((count 1)
-;	  (template (concat name "<%d>"))
-;	  tempname)
-;      (catch 'found
-;	(while t
-;	  (setq tempname (format template count))
-;	  (if (not (get-buffer tempname))
-;	      (throw 'found tempname))
-;	  (setq count (1+ count)))))))
-
 
 ;; Tag tables for a buffer
 
@@ -245,14 +102,14 @@
 
 ;;;###autoload
 (defcustom tag-table-alist nil
-  "*A list which determines which tags files should be active for a 
-given buffer.  This is not really an association list, in that all 
-elements are checked.  The CAR of each element of this list is a 
-pattern against which the buffer's file name is compared; if it 
-matches, then the CDR of the list should be the name of the tags
-table to use.  If more than one element of this list matches the
-buffer's file name, then all of the associated tags tables will be
-used.  Earlier ones will be searched first.
+  "*A list which determines which tags files are active for a buffer.
+This is not really an association list, in that all elements are
+checked.  The CAR of each element of this list is a pattern against
+which the buffer's file name is compared; if it matches, then the CDR
+of the list should be the name of the tags table to use.  If more than
+one element of this list matches the buffer's file name, then all of
+the associated tags tables will be used.  Earlier ones will be
+searched first.
 
 If the CAR of elements of this list are strings, then they are treated
 as regular-expressions against which the file is compared (like the
@@ -292,31 +149,29 @@
 If the variable tags-file-name is set, then the tags file it names will apply
 to all buffers (for backwards compatibility.)  It is searched first.
 "
-  :type '(repeat (cons regexp sexp))
+  :type '(repeat (cons (choice :value ""
+			       (regexp :tag "Buffer regexp")
+			       (function :tag "Expression"))
+		       (string :tag "Tag file or directory")))
   :group 'etags)
 
-(defcustom buffer-tag-table nil
-  "*The name of one TAGS table to be used for this buffer in addition to the
-TAGS tables that the variable `tag-table-alist' specifies.  You can set this
-with meta-x set-buffer-tag-table.  See the documentation for the variable
-`tag-table-alist' for more information."
-  :type '(repeat (cons regexp sexp))
-  :group 'etags)
+(defvar buffer-tag-table nil
+  "*The additional name of one TAGS table to be used for this buffer.
+You can set this with meta-x set-buffer-tag-table.  See the documentation
+for the variable `tag-table-alist' for more information.")
 (make-variable-buffer-local 'buffer-tag-table)
 
 (defcustom tags-file-name nil
-  "*The name of the tags-table used by all buffers.  This is for backwards
-compatibility, and is largely supplanted by the variable tag-table-alist."
+  "*The name of the tags-table used by all buffers.
+This is for backwards compatibility, and is largely supplanted by the
+variable tag-table-alist."
   :type '(choice (const nil) string)
   :group 'etags)
-;; (setq tags-file-name nil)  ; nuke previous value.  Is this cool?
 
-;; This will be used if it's loaded; don't force it on those who don't want it.
-;;(autoload 'symlink-expand-file-name "symlink-fix")
 
 ;; XEmacs change: added tags-auto-read-changed-tag-files
 (defcustom tags-auto-read-changed-tag-files nil
-  "*If t then always re-read changed TAGS file without prompting, if nil
+  "*If non-nil, always re-read changed TAGS file without prompting, if nil
 then prompt if changed TAGS file should be re-read."
   :type 'boolean
   :group 'etags)
@@ -325,10 +180,10 @@
   "Returns a list (ordered) of the tags tables which should be used for 
 the current buffer."
   (let (result expression)
-    (if buffer-tag-table
-	(setq result (cons buffer-tag-table result)))
-    (if (file-readable-p (concat default-directory "TAGS"))
-	(setq result (cons (concat default-directory "TAGS") result)))
+    (when buffer-tag-table
+      (push buffer-tag-table result))
+    (when (file-readable-p (concat default-directory "TAGS"))
+      (push (concat default-directory "TAGS") result))
     (let ((key (or buffer-file-name
 		   (concat default-directory (buffer-name))))
 	  (alist tag-table-alist))
@@ -338,39 +193,37 @@
 	;; to the buffer-file-name.  Otherwise, evaluate it.  If the
 	;; regexp matches, or the expression evaluates non-nil, then this
 	;; item in tag-table-alist applies to this buffer.
-	(if (if (stringp expression)
-		(string-match expression key)
-	      (condition-case nil
-		  (eval expression)
-		(error nil)))
-	    ;; Now evaluate the cdr of the alist item to get the name of
-	    ;; the tag table file.
-	    (progn
-	      (setq expression 
-		    (condition-case nil
-			(eval (cdr (car alist)))
-		      (error nil)))
-	      (if (stringp expression)
-		  (setq result (cons expression result))
-		(error "Expression in tag-table-alist evaluated to non-string"))))
-	(setq alist (cdr alist))))
+	(when (if (stringp expression)
+		  (string-match expression key)
+		(condition-case nil
+		    (eval expression)
+		  (error nil)))
+	  ;; Now evaluate the cdr of the alist item to get the name of
+	  ;; the tag table file.
+	  (setq expression 
+		(condition-case nil
+		    (eval (cdr (car alist)))
+		  (error nil)))
+	  (if (stringp expression)
+	      (setq result (cons expression result))
+	    (error "Expression in tag-table-alist evaluated to non-string")))
+	(pop alist)))
     (or result tags-file-name
 	;; **** I don't know if this is the right place to do this,
 	;; **** Maybe it would be better to do this after (delq nil result).
 	(call-interactively 'visit-tags-table))
-    (if tags-file-name
-	(setq result (nconc result (list tags-file-name))))
+    (when tags-file-name
+      (setq result (nconc result (list tags-file-name))))
     (setq result
 	  (mapcar
-	   (function
-	    (lambda (name)
-	      (if (file-directory-p name)
-		  (setq name (concat (file-name-as-directory name) "TAGS")))
-	      (if (file-readable-p name)
-		  (save-excursion
-		    ;; get-tag-table-buffer has side-effects
-		    (set-buffer (get-tag-table-buffer name))
-		    buffer-file-name))))
+	   (lambda (name)
+	     (if (file-directory-p name)
+		 (setq name (concat (file-name-as-directory name) "TAGS")))
+	     (if (file-readable-p name)
+		 (save-current-buffer
+		   ;; get-tag-table-buffer has side-effects
+		   (set-buffer (get-tag-table-buffer name))
+		   buffer-file-name)))
 	   result))
     (setq result (delq nil result))
     (or result (error "Buffer has no associated tag tables"))
@@ -387,13 +240,12 @@
 				     t)))
   (if (string-equal file "") 
       (setq tags-file-name nil)
-      (progn
-        (setq file (expand-file-name file))
-        (if (file-directory-p file)
-            (setq file (expand-file-name "TAGS" file)))
-        (setq tags-file-name file))))
+    (progn
+      (setq file (expand-file-name file))
+      (if (file-directory-p file)
+	  (setq file (expand-file-name "TAGS" file)))
+      (setq tags-file-name file))))
 
-;; **** What should the semantics of this be?
 (defun set-buffer-tag-table (file)
   "In addition to the tags tables specified by the variable `tag-table-alist',
 each buffer can have one additional table.  This command sets that.
@@ -404,8 +256,8 @@
 		     nil default-directory t)))
   (or file (error "No TAGS file name supplied"))
   (setq file (expand-file-name file))
-  (if (file-directory-p file)
-      (setq file (concat file "TAGS")))
+  (when (file-directory-p file)
+    (setq file (concat file "TAGS")))
   (or (file-exists-p file) (error "TAGS file missing: %s" file))
   (setq buffer-tag-table file))
 
@@ -443,22 +295,21 @@
 	    (setq buf (find-file-noselect tag-table)
 		  check-name t)
 	  (error "No such tags file: %s" tag-table)))
-    (save-excursion
-      (set-buffer buf)
+    (with-current-buffer buf
       ;; make the TAGS buffer invisible
-      (if (and check-name
-	       make-tags-files-invisible
-	       (string-match "\\`[^ ]" (buffer-name)))
-	  (rename-buffer (generate-new-buffer-name
-			  (concat " " (buffer-name)))))
+      (when (and check-name
+		 make-tags-files-invisible
+		 (string-match "\\`[^ ]" (buffer-name)))
+	(rename-buffer (generate-new-buffer-name
+			(concat " " (buffer-name)))))
       (or (verify-visited-file-modtime buf)
           ;; XEmacs change: added tags-auto-read-changed-tag-files
 	  (cond ((or tags-auto-read-changed-tag-files (yes-or-no-p
 		  (format "Tags file %s has changed, read new contents? "
                         tag-table)))
-		 (if tags-auto-read-changed-tag-files
-		     (message "Tags file %s has changed, reading new contents..." tag-table)
-                   )
+		 (when tags-auto-read-changed-tag-files
+		   (message "Tags file %s has changed, reading new contents..."
+			    tag-table))
 		 (revert-buffer t t)
 		 (if (eq tag-table-completion-status t)
 		     (setq tag-table-completion-status nil))
@@ -506,19 +357,17 @@
        (forward-line 1)
        (end-of-line)
        (skip-chars-backward "^,\n")
-       (setq prev (point))
-       (setq size (read (current-buffer)))
+       (setq prev (point)
+	     size (read (current-buffer)))
        (goto-char prev)
        (forward-line 1)
        (forward-char size))
      (goto-char (1- prev))
-     (buffer-substring (point)
-		       (progn (beginning-of-line) (point))))))
+     (buffer-substring (point) (point-at-bol)))))
 
 (defun tag-table-files (tag-table)
   "Returns a list of the files referenced by the named TAGS table."
-  (save-excursion
-    (set-buffer (get-tag-table-buffer tag-table))
+  (with-current-buffer (get-tag-table-buffer tag-table)
     (or tag-table-files
 	(let (files prev size)
 	  (goto-char (point-min))
@@ -526,16 +375,13 @@
 	    (forward-line 1)
 	    (end-of-line)
 	    (skip-chars-backward "^,\n")
-	    (setq prev (point))
-	    (setq size (read (current-buffer)))
+	    (setq prev (point)
+		  size (read (current-buffer)))
 	    (goto-char prev)
-	    (setq files (cons (expand-file-name
-			       (buffer-substring (1- (point))
-						 (save-excursion
-						   (beginning-of-line)
-						   (point)))
-			       default-directory)
-			      files))
+	    (push (expand-file-name (buffer-substring (1- (point))
+						      (point-at-bol))
+				    default-directory)
+		  files)
 	    (forward-line 1)
 	    (forward-char size))
 	  (setq tag-table-files (nreverse files))))
@@ -545,9 +391,8 @@
 (defun buffer-tag-table-files ()
   "Returns a list of all files referenced by all TAGS tables that 
 this buffer uses."
-  (apply (function append)
-	 (mapcar (function tag-table-files)
-		 (buffer-tag-table-list))))
+  (apply #'nconc
+	 (mapcar #'tag-table-files (buffer-tag-table-list))))
 
 
 ;; Building the completion table
@@ -596,30 +441,13 @@
 (defvar tag-symbol-tables)
 (defvar buffer-tag-table-list)
 
-;; make two versions of this, macro and non-macro,
-;; and have the correct one used depending whether it's byte compiled
-;; (well I think that's a little silly -- only lusers run interpreted! -jwz)
 (defmacro intern-tag-symbol (tag)
-  (`(progn
-      (setq tag-symbol (intern (, tag) tag-completion-table)
-	    tag-symbol-tables (and (boundp tag-symbol)
-				   (symbol-value tag-symbol)))
-      (or (memq tag-table-symbol tag-symbol-tables)
-	  (set tag-symbol (cons tag-table-symbol tag-symbol-tables))))))
-
-(defun intern-tag-symbol2 (tag)
-  (setq tag-symbol (intern tag tag-completion-table)
-	tag-symbol-tables (and (boundp tag-symbol)
-			       (symbol-value tag-symbol)))
-  (or (memq tag-table-symbol tag-symbol-tables)
-      (set tag-symbol (cons tag-table-symbol tag-symbol-tables))))
-
-;; This won't be evaluated at during byte-compilation, thus ensuring the
-;; macro version will be used then.  Since the macro version is too slow
-;; to use unless its usages are byte-compiled, we want to make sure we use
-;; the non-macro version if we are using the non byte-compiled version of
-;; add-to-tag-completion-table.
-(fset 'intern-tag-symbol (symbol-function 'intern-tag-symbol2))
+  `(progn
+     (setq tag-symbol (intern ,tag tag-completion-table)
+	   tag-symbol-tables (and (boundp tag-symbol)
+				  (symbol-value tag-symbol)))
+     (or (memq tag-table-symbol tag-symbol-tables)
+	 (set tag-symbol (cons tag-table-symbol tag-symbol-tables)))))
 
 ;; Can't use "\\s " in these patterns because that will include newline
 (defconst tags-DEFUN-pattern
@@ -638,72 +466,68 @@
 	   buffer-file-name)
   (goto-char (point-min))
   (let ((tag-table-symbol (intern buffer-file-name tag-completion-table))
-	(original-syntax-table (syntax-table))
 	;; tag-table-symbol is used by intern-tag-symbol
 	filename file-type name name2 tag-symbol
-	tag-symbol-tables file-type-syntax-table)
-    (unwind-protect
-	;; loop over the files mentioned in the TAGS file
-	;; for each file, try to find its major-mode,
-	;; then process tags appropriately
-	(while (looking-at tags-file-pattern)
-	  (goto-char (match-end 0))
-	  (setq filename (buffer-substring (match-beginning 1) (match-end 1)))
-	  (setq filename (file-name-sans-versions filename))
-	  ;; clear loop variables
-	  (setq file-type nil)
-	  (setq file-type-syntax-table nil)
-	  (setq name nil name2 nil)
-	  (let ((alist auto-mode-alist)
-		(case-fold-search (eq system-type 'vax-vms)))
-	    ;; loop over pairs of regexps and major-modes
-	    (while (and (not file-type) alist)
-	      (if (string-match (car (car alist)) filename)
-		  (setq file-type (cdr (car alist))))
-	      (setq alist (cdr alist))))
-	  ;; try to find a syntax table whose name begins with the major-mode
-	  (if file-type
-	      (setq file-type-syntax-table
-		    (intern (concat (symbol-name file-type)
-				    "-syntax-table"))))
-          (message "%s..." filename)
-	  (if (and file-type-syntax-table (boundp file-type-syntax-table))
-	      (set-syntax-table (symbol-value file-type-syntax-table))
-	    (set-syntax-table (standard-syntax-table)))
-	  ;; loop over the individual tag lines
-	  (while (not (or (eobp) (eq (following-char) ?\f)))
-	    (cond ((and (or (eq file-type 'c-mode)
-			    (eq file-type 'c++-mode)
-			    (eq file-type 'c++-c-mode))
-			(let ((case-fold-search nil))
-			  (looking-at "DEFUN[ \t]")))
-		   (or (looking-at tags-DEFUN-pattern)
-		       (error "DEFUN doesn't fit pattern"))
-		   (setq name (buffer-substring (match-beginning 1)
-						(match-end 1)))
-		   (setq name2 (buffer-substring (match-beginning 2)
-						 (match-end 2))))
+	tag-symbol-tables
+	(case-fold-search nil))
+    ;; loop over the files mentioned in the TAGS file
+    ;; for each file, try to find its major-mode,
+    ;; then process tags appropriately
+    (while (looking-at tags-file-pattern)
+      (goto-char (match-end 0))
+      (setq filename (file-name-sans-versions
+		      (buffer-substring (match-beginning 1)
+					(match-end 1)))
+	    ;; Old code used to check auto-mode-alist for the proper
+	    ;; file-type.  This is too slow, as it breaks the
+	    ;; compiled-regexp caching, and slows the whole thing
+	    ;; down.  We'll use the shotgun approach with only two
+	    ;; regexps.
+	    file-type (cond ((string-match "\\.\\([cC]\\|cc\\|cxx\\)\\'"
+					   filename)
+			     'c-mode)
+			    ((string-match "\\.\\(el\\|cl\\|lisp\\)\\'"
+					   filename)
+			     'lisp-mode)
+			    (t nil)))
+      (cond ((and (eq file-type 'c-mode)
+		  c-mode-syntax-table)
+	     (set-syntax-table c-mode-syntax-table))
+	    ((eq file-type 'lisp-mode)
+	     (set-syntax-table lisp-mode-syntax-table))
+	    (t
+	     (set-syntax-table (standard-syntax-table))))
+      ;; clear loop variables
+      (setq name nil name2 nil)
+      (message "%s..." filename)
+      ;; loop over the individual tag lines
+      (while (not (or (eobp) (eq (following-char) ?\f)))
+	(cond ((and (eq file-type 'c-mode)
+		    (looking-at "DEFUN[ \t]"))
+	       (or (looking-at tags-DEFUN-pattern)
+		   (error "DEFUN doesn't fit pattern"))
+	       (setq name (buffer-substring (match-beginning 1)
+					    (match-end 1))
+		     name2 (buffer-substring (match-beginning 2)
+					     (match-end 2))))
 ;;;		  ((looking-at "\\s ")
 ;;;		   ;; skip probably bogus entry:
 ;;;		   )
-		  ((and (or (eq file-type 'c-mode)
-			    (eq file-type 'c++-mode)
-			    (eq file-type 'c++-c-mode))
-			(looking-at ".*\\["))
-		   (cond ((not (looking-at tags-array-pattern))
-			  (message "array definition doesn't fit pattern")
-			  (setq name nil))
-			 (t
-			  (setq name (buffer-substring (match-beginning 1)
-						       (match-end 1))))))
-		  ((looking-at tags-def-pattern)
-		   (setq name (buffer-substring (match-beginning 2)
-						(match-end 2)))))
-	    ;; add the tags we found to the completion table
-	    (if name (intern-tag-symbol name))
-	    (if name2 (intern-tag-symbol name2))
-	    (forward-line 1)))
-      (set-syntax-table original-syntax-table))
+	      ((and (eq file-type 'c-mode)
+		    (looking-at ".*\\["))
+	       (cond ((not (looking-at tags-array-pattern))
+		      (message "array definition doesn't fit pattern")
+		      (setq name nil))
+		     (t
+		      (setq name (buffer-substring (match-beginning 1)
+						   (match-end 1))))))
+	      ((looking-at tags-def-pattern)
+	       (setq name (buffer-substring (match-beginning 2)
+					    (match-end 2)))))
+	;; add the tags we found to the completion table
+	(and name (intern-tag-symbol name))
+	(and name2 (intern-tag-symbol name2))
+	(forward-line 1)))
     (or (eobp) (error "Bad TAGS file")))
   (message "Adding %s to tags completion table...done"
 	   buffer-file-name))
@@ -712,54 +536,27 @@
 ;; Interactive find-tag
 
 (defvar find-tag-default-hook nil
-  "****Function to call to create a default tag.
-Make it buffer-local in a mode hook.
-The function is called with no args.")
+  "Function to call to create a default tag.
+Make it buffer-local in a mode hook.  The function is called with no
+ arguments.")
 
 (defvar find-tag-hook nil
-  "****Function to call after a hook is found.
-Make it buffer-local in a mode hook.
-The function is called with no args.")
+  "Function to call after a hook is found.
+Make it buffer-local in a mode hook.  The function is called with no
+ argsuments.")
 
 ;; Return a default tag to search for, based on the text at point.
 (defun find-tag-default ()
-  (or (and (boundp 'find-tag-default-hook)
-	   (not (memq find-tag-default-hook '(nil find-tag-default)))
+  (or (and (not (memq find-tag-default-hook '(nil find-tag-default)))
 	   (condition-case data
 	       (funcall find-tag-default-hook)
 	     (error
-	      (message "value of find-tag-default-hook signalled error: %s"
-		       data)
-	      (sit-for 1)
+	      (warn "Error in find-tag-default-hook signalled error: %s"
+		    (error-message-string data))
 	      nil)))
-      (save-excursion
-	(if (not (memq (char-syntax (preceding-char)) '(?w ?_)))
-	    (while (not (looking-at "\\sw\\|\\s_\\|\\'"))
-	      (forward-char 1)))
-	(while (looking-at "\\sw\\|\\s_")
-	  (forward-char 1))
-	(if (re-search-backward "\\sw\\|\\s_" nil t)
-	    (regexp-quote
-	     (progn (forward-char 1)
-		    (buffer-substring (point)
-				      (progn (forward-sexp -1)
-					     (while (looking-at "\\s'")
-					       (forward-char 1))
-					     (point)))))
-	  nil))))
-
-;;"\\(\\s \\|\\s.\\|\\s\(\\|\\s\)\\|\\s'\\|\\s\"\\|\\s$\\|\\s/\\|\\s\\\\|\\s<\\|\\s>\\)"
-;;"[ \";]"
-
-;;(defun non-symbol-char-regexp ()
-;;  (let ((i 0)
-;;	(numchars (length (syntax-table)))
-;;	symbol-chars)
-;;    (while (< i numchars)
-;;      (if (memq (char-syntax i) '(?w ?_))
-;;	  (setq symbol-chars (cons i symbol-chars)))
-;;      (setq i (1+ i)))
-;;    (concat symbol-chars)))
+      (let ((pair (thing-symbol (point))))
+	(and pair
+	     (buffer-substring (car pair) (cdr pair))))))
 
 ;; This function depends on the following symbols being bound properly:
 ;; buffer-tag-table-list,
@@ -769,34 +566,14 @@
        (setq tag-symbol-tables (symbol-value tag-symbol))
        (catch 'found
 	 (while tag-symbol-tables
-	   (if (memq (car tag-symbol-tables) buffer-tag-table-list)
-	       (throw 'found t))
+	   (when (memq (car tag-symbol-tables) buffer-tag-table-list)
+	     (throw 'found t))
 	   (setq tag-symbol-tables (cdr tag-symbol-tables))))))
 
 (defun buffer-tag-table-symbol-list ()
-  (mapcar (function
-	   (lambda (table-name)
-	     (intern table-name tag-completion-table)))
+  (mapcar (lambda (table-name)
+	    (intern table-name tag-completion-table))
 	  (buffer-tag-table-list)))
-    
-;;(defun strip-regexp-border (pattern)
-;;  ;; Avoid displaying ugly regexp borders to the user
-;;  (cond (pattern
-;;	 (if (or (string-match "\\`\\[[^\]]+\\]" pattern)
-;;		 ;;(string-match "\\`\\\\(\\([^\\\\]\\|\\\\[^\)]\\)+\\\\)"
-;;		 ;;              pattern)
-;;		 ;;(string-match "\\`\\\\[b<>`'WsS]" pattern)
-;;		 )
-;;	     (setq pattern (substring pattern
-;;				      (match-end 0))))
-;;	 (if (or (string-match "\\[[^\]]+\\]\\'" pattern)
-;;		 ;;(string-match "\\\\(\\([^\\\\]\\|\\\\[^\)]\\)+\\\\)\\'"
-;;		 ;;              pattern)
-;;		 ;;(string-match "\\\\[b<>`'WsS]\\'" pattern)
-;;		 )
-;;	     (setq pattern (substring pattern 0
-;;				      (match-beginning 0))))))
-;;  pattern)
 
 (defvar find-tag-history nil "History list for find-tag-tag")
 
@@ -817,7 +594,7 @@
       tag-name)))
 
 (defvar last-tag-data nil
-"Information for continuing a tag search.
+  "Information for continuing a tag search.
 Is of the form (TAG POINT TAG-TABLE TAG-TABLE ...).")
 
 (defvar tags-loop-operate nil
@@ -832,8 +609,6 @@
 
 (autoload 'get-symbol-syntax-table "symbol-syntax")
 
-(require 'backquote)
-
 (defun find-tag-internal (tagname)
   (let ((next (null tagname))
 	(exact (or tags-always-exact (consp tagname)))
@@ -900,15 +675,12 @@
                                      ;; relative to the 
                                      (or (file-name-directory (car tag-tables))
                                          "./")))
-        (setq linebeg
-              (buffer-substring (1- (point))
-                                (save-excursion (beginning-of-line) (point))))
+        (setq linebeg (buffer-substring (1- (point)) (point-at-bol)))
         (search-forward ",")
         (setq startpos (read (current-buffer)))
         (setq last-tag-data (nconc (list tagname (point)) tag-tables)))
       (setq buf (find-file-noselect file))
-      (save-excursion
-        (set-buffer buf)
+      (with-current-buffer buf
         (save-excursion
           (save-restriction
             (widen)
@@ -1012,51 +784,6 @@
 
 ;; Completion on tags in the buffer
 
-;; this also exists in lisp/prim/lisp.el
-;(defun lisp-complete-symbol ()
-;  "*Perform completion on Lisp symbol preceding point.
-;That symbol is compared against the symbols that exist
-;and any additional characters determined by what is there
-;are inserted.
-;If the symbol starts just after an open-parenthesis,
-;only symbols with function definitions are considered.
-;Otherwise, all symbols with function definitions, values
-;or properties are considered."
-;  (interactive)
-;  (let ((buffer-syntax (syntax-table)))
-;    (unwind-protect
-;	(progn
-;	  (if lisp-mode-syntax-table
-;	      (set-syntax-table lisp-mode-syntax-table))
-;	  (let ((fn (save-excursion
-;		      (backward-sexp 1)
-;		      (while (= (char-syntax (following-char)) ?\')
-;			(forward-char 1))
-;		      (eq (preceding-char) ?\())))
-;	    (complete-symbol
-;	     obarray
-;	     (if fn
-;		 'fboundp
-;	       (function
-;		(lambda (sym)
-;		  (or (boundp sym)
-;		      (fboundp sym)
-;		      (symbol-plist sym)))))
-;	     (if (not fn)
-;		 ;; prettify the completion list by marking fns with " <f>"
-;		 (function
-;		  (lambda (list)
-;		    (let (new)
-;		      (while list
-;			(setq new (cons (if (fboundp (intern (car list)))
-;					    (list (car list) " <f>")
-;					  (car list))
-;					new))
-;			(setq list (cdr list)))
-;		      (nreverse new))))))))
-;      ;; unwind-protected
-;      (set-syntax-table buffer-syntax))))
-
 (defun complete-symbol (&optional table predicate prettify)
   (let* ((end (point))
 	 (beg (save-excursion
@@ -1321,9 +1048,9 @@
 	 (setq find-tag-default-hook 'emacs-lisp-default-tag))))
 ;; Run it once immediately
 (setup-emacs-lisp-default-tag-hook)
-(if (get-buffer "*scratch*")
-    (save-excursion (set-buffer "*scratch*")
-		    (setup-emacs-lisp-default-tag-hook)))
+(when (get-buffer "*scratch*")
+  (with-current-buffer "*scratch*"
+    (setup-emacs-lisp-default-tag-hook)))
 
 (defun emacs-lisp-default-tag ()
   "Function to return a default tag for Emacs-Lisp mode."
@@ -1331,36 +1058,6 @@
 		 (function-called-at-point))))
     (if tag (symbol-name tag))))
 
-;;(defun Info-find-tag-hook ()
-;;  "Function to call after finding a tag in Info-mode."
-;;  (let ((onode Info-current-node)
-;;	(ofile Info-current-file)
-;;	(opoint (point)))
-;;    (if (not (string= "*info*" (buffer-name)))
-;;	(progn				; replace current *info* file
-;;	  (kill-buffer "*info*")
-;;	  (rename-buffer "*info*")))
-;;    (or (eq major-mode 'Info-mode)
-;;	(Info-mode))
-;;    (setq Info-current-file
-;;	  (file-name-sans-versions buffer-file-name))
-;;    (Info-select-node)
-;;    (or (and (equal onode Info-current-node)
-;;	     (equal ofile Info-current-file))
-;;	(setq Info-history (cons (list ofile onode opoint)
-;;				 Info-history)))))
-;;
-;;;; Info-mode does not have a hook, so patch in the necessary calls.
-;;
-;;(require 'info)
-;;
-;;;; Only do this once
-;;(fset 'Info-mode
-;;      (append (symbol-function 'Info-mode)
-;;	      (list '(make-local-variable 'find-tag-hook)
-;;		    '(setq find-tag-hook 'Info-find-tag-hook)
-;;		    '(modify-syntax-entry ?\' "."))))
-
 
 ;; Display short info on tag in minibuffer
 
@@ -1379,8 +1076,7 @@
 	 (tag-buf (car results))
 	 (tag-point (cdr results))
 	 info lname min max fname args)
-    (save-excursion
-      (set-buffer tag-buf)
+    (with-current-buffer tag-buf
       (save-excursion
 	(save-restriction
 	  (widen)
@@ -1434,7 +1130,7 @@
 
 (defun push-mark-on-stack (stack-symbol &optional max-size)
   (let ((stack (symbol-value stack-symbol)))
-    (setq stack (cons (point-marker) stack))
+    (push (point-marker) stack)
     (cond ((and max-size
 		(> (length stack) max-size))
 	   (set-marker (car (nthcdr max-size stack)) nil)
@@ -1473,19 +1169,5 @@
      'tag-mark-stack2 'tag-mark-stack1 tag-mark-stack-max)))
 
 
-
-;; John Sturdy <jcgs@harlqn.co.uk>
-;; (defun lookup-tag (use-rec-edit)
-;;   "Show a tag from the current tags name list in the other window for
-;; reference, then restore the window layout after a pause. With prefix
-;; arg, go into a recursive edit instead of pausing."
-;;   (interactive "P")
-;;   (save-window-excursion
-;;     (save-excursion
-;;       (find-tag-other-window (completing-read "Tag name: " tags-name-list))
-;;       (if use-rec-edit
-;;           (recursive-edit)
-;;         (sit-for show-tag-time)))))
-
 (provide 'etags)
 (provide 'tags)
--- a/lisp/packages/font-lock.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/packages/font-lock.el	Mon Aug 13 09:58:30 2007 +0200
@@ -583,7 +583,9 @@
 		 ((or (null maximum-size) (<= (buffer-size) maximum-size))
 		  (font-lock-fontify-buffer))
 		 (font-lock-verbose
-		  (message "Fontifying %s... buffer too big." (buffer-name)))))
+		  (display-message
+		   'command
+		   (format "Fontifying %s... buffer too big." (buffer-name))))))
 	  (font-lock-fontified
 	   (setq font-lock-fontified nil)
 	   (remove-hook 'before-revert-hook 'font-lock-revert-setup t)
@@ -645,7 +647,8 @@
 	  (font-lock-mode 0)))
     (set (make-local-variable 'font-lock-fontified) t)
     (if (and aborted font-lock-verbose)
-	(message "Fontifying %s... aborted." (buffer-name)))
+	(display-message 'command
+			 (format "Fontifying %s... aborted." (buffer-name))))
     )
   (run-hooks 'font-lock-after-fontify-buffer-hook))
 
@@ -725,7 +728,9 @@
 (defun font-lock-unfontify-region (beg end &optional maybe-loudly)
   (if (and maybe-loudly font-lock-verbose
 	   (>= (- end beg) font-lock-message-threshold))
-      (message "Fontifying %s..." (buffer-name)))
+      (display-message
+       'progress
+       (format "Fontifying %s..." (buffer-name))))
   (let ((modified (buffer-modified-p))
 	(buffer-undo-list t) (inhibit-read-only t)
 	buffer-file-name buffer-file-truename)
@@ -976,7 +981,9 @@
       nil
     (if (and font-lock-verbose
 	     (>= (- end start) font-lock-message-threshold))
-	(message "Fontifying %s... (syntactically...)" (buffer-name)))
+	(display-message
+	 'progress
+	 (format "Fontifying %s... (syntactically...)" (buffer-name))))
     (font-lock-unfontify-region start end loudly)
     (goto-char start)
     (if (> end (point-max)) (setq end (point-max)))
@@ -1162,8 +1169,10 @@
       ;;
       ;; Fontify each item in `font-lock-keywords' from `start' to `end'.
       (while keywords
-	(if loudly (message "Fontifying %s... (regexps..%s)" bufname
-			    (make-string (setq count (1+ count)) ?.)))
+	(if loudly (display-message
+		    'progress
+		    (format "Fontifying %s... (regexps..%s)" bufname
+			    (make-string (setq count (1+ count)) ?.))))
 	;;
 	;; Find an occurrence of `matcher' from `start' to `end'.
 	(setq keyword (car keywords) matcher (car keyword))
@@ -1181,7 +1190,9 @@
 	    (font-lock-fontify-anchored-keywords (car highlights) end))
 	  (setq highlights (cdr highlights))))
 	(setq keywords (cdr keywords))))
-    (if loudly (message "Fontifying %s... done." (buffer-name)))))
+    (if loudly (display-message
+		'progress
+		(format "Fontifying %s... done." (buffer-name))))))
 
 
 ;; Various functions.
--- a/lisp/packages/gnuserv.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/packages/gnuserv.el	Mon Aug 13 09:58:30 2007 +0200
@@ -1,9 +1,9 @@
 ;;; gnuserv.el --- Lisp interface code between Emacs and gnuserv
 ;; Copyright (C) 1989-1997 Free Software Foundation, Inc.
 
-;; Version: 3.9
+;; Version: 3.10
 ;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el
-;;         Hrvoje Niksic <hniksic@srce.hr>
+;;         Hrvoje Niksic <hniksic@srce.hr>, rewritten from scratch in May 1997
 ;; Maintainer: Jan Vroonhof <vroonhof@math.ethz.ch>,
 ;;             Hrvoje Niksic <hniksic@srce.hr>
 ;; Keywords: environment, processes, terminals
@@ -63,12 +63,6 @@
 ;; Mukherjee, Ben Wing and Jan Vroonhof.  It was completely rewritten
 ;; (labeled as version 3) by Hrvoje Niksic in May 1997.
 
-;; Jan Vroonhof <vroonhof@math.ethz.ch> July/1996
-;; ported the server-temp-file-regexp feature from server.el
-;; ported server hooks from server.el
-;; ported kill-*-query functions from server.el (and made it optional)
-;; synced other behaviour with server.el
-;;
 ;; Jan Vroonhof
 ;;     Customized.
 ;;
@@ -78,6 +72,9 @@
 ;;
 ;; Mike Scheidler <c23mts@eng.delcoelect.com> July, 1997
 ;;     Added 'Done' button to the menubar.
+;;
+;; Hrvoje Niksic <hniksic@srce.hr> Sep/1997
+;;     More pervasive changes.
 
 
 ;;; Code:
@@ -92,7 +89,8 @@
 ;; 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.
+;; declaration, or the scheme fails.  I'd prefer if we could junk this
+;; sh*t, but I guess the users will appreciate compatibility.  Uh...
 
 (define-obsolete-variable-alias 'server-frame 'gnuserv-frame)
 (define-obsolete-variable-alias 'server-done-function
@@ -109,29 +107,50 @@
   '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.
-If nil, then a new frame is created for each file edited.
-If t, then the currently selected frame will be used.
-If a function, then this will be called with a symbol `x' or `tty' as the
-only argument, and its return value will be interpreted as above."
+(defcustom gnuserv-frame 'new
+  "*Determines what frame will be used to display all edited files.
+Legal values are:
+ `new'     -- a new frame will be created for each file edited;
+ `current' -- the currently selected frame will be used;
+ `main'    -- \"main\" Emacs frame will be used;
+ `visible' -- a visible frame will be used, or a new one created;
+ `special' -- a special Gnuserv frame will be created, and used for
+              all gnuserv-edited files;
+ frame     -- that particular frame will be used.
+
+If gnuclient is called using the `-nw' method (from a TTY device), the
+ behaviour will be as if gnuserv-frame were `new'.
+This variable is read by `gnuserv-frame-default-function'.  If you
+ change `gnuserv-frame-function' to anything else, this variable will
+ have no effect."
   :tag "Gnuserv Frame"
-  :type '(radio (const :tag "Create new frame each time" nil)
-		(const :tag "Use selected frame" t)
-	        (function-item :tag "Use main Emacs frame"
-			       gnuserv-main-frame-function)
-		(function-item :tag "Use visible frame, otherwise create new"
-			       gnuserv-visible-frame-function)
-		(function-item :tag "Create special Gnuserv frame and use it"
-			       gnuserv-special-frame-function)
-		(function :tag "Other"))
-   :group 'gnuserv)
+  ;; Compatibility
+  :type '(radio (const :tag "Create new frame each time" new)
+		(const :tag "Use currently selected frame" current)
+		(const :tag "Use main Emacs frame" main)
+		(const :tag "Use visible frame, otherwise create new" visible)
+		(const :tag "Create special Gnuserv frame and use it" special))
+  :group 'gnuserv)
+
+(defcustom gnuserv-frame-properties nil
+  "*Properties of the frame in which gnuclient buffers are displayed.
+Note that this is in effect only for frames created by
+`gnuserv-frame-default-function'."
+  :type '(repeat (group :inline t
+			(symbol :tag "Property")
+			(sexp :tag "Value")))
+  :group 'gnuserv)
+
+(defcustom gnuserv-frame-function 'gnuserv-frame-default-function
+  "*Function to return the appropriate frame for use by gnuclient.
+The function will be called with two arguments: the first one as
+ described by `gnuserv-frame', and the second one as the device to
+ create the frame on.
+The function must return a valid frame object."
+  :type 'function
+  :group 'gnuserv)
 
 (defcustom gnuserv-done-function 'kill-buffer 
   "*Function used to remove a buffer after editing.
@@ -142,15 +161,6 @@
 		(function :tag "Other"))
   :group 'gnuserv)
 
-(defcustom gnuserv-done-temp-file-function 'kill-buffer
-  "*Function used to remove a temporary buffer after editing.
-It is called with one BUFFER argument.  Functions such as `kill-buffer' and
-`bury-buffer' are good values. See also `gnuserv-done-temp-file-function'."
-  :type '(radio (function-item kill-buffer)
-		(function-item bury-buffer)
-		(function :tag "Other"))
-  :group 'gnuserv)
-
 (defcustom gnuserv-find-file-function 'find-file
   "*Function to visit a file with.
 It takes one argument, a file name to visit."
@@ -197,17 +207,6 @@
   :type 'boolean
   :group 'gnuserv)
 
-(defcustom gnuserv-temp-file-regexp "^/tmp/Re\\|/draft$"
-  "*Regexp which should match filenames of temporary files deleted
-and reused by the programs that invoke the Emacs server."
-  :type 'regexp
-  :group 'gnuserv)
-
-(defcustom gnuserv-make-temp-file-backup nil
-  "*Non-nil makes the server backup temporary files also."
-  :type 'boolean
-  :group 'gnuserv)
-
 
 ;;; Internal variables:
 
@@ -230,7 +229,7 @@
   (device nil)
   (frame nil))
 
-(defvar gnuserv-process nil 
+(defvar gnuserv-process nil
   "The current gnuserv process.")
 
 (defvar gnuserv-string ""
@@ -246,43 +245,53 @@
 (defvar gnuserv-devices nil
   "List of devices created by clients.")
 
+;; We want the client-infested buffers to have some modeline
+;; identification, so we'll make a "minor mode".  We don't use
+;; `add-minor-mode', as we don't want it to be togglable.
+(defvar gnuserv-minor-mode nil)
+
+(make-variable-buffer-local 'gnuserv-mode)
+(pushnew '(gnuserv-minor-mode " Server") minor-mode-alist :test 'equal)
+
 (defvar gnuserv-special-frame nil
   "Frame created specially for Server.")
 
-;; We want the client-infested buffers to have some modeline
-;; identification, so we'll make a "minor mode".
-(defvar gnuserv-minor-mode nil)
-(make-variable-buffer-local 'gnuserv-mode)
-(pushnew '(gnuserv-minor-mode " Server") minor-mode-alist
-	  :test 'equal)
-
 
-;; Sample gnuserv-frame functions
-
-(defun gnuserv-main-frame-function (type)
-  "Returns a sensible value for the main Emacs frame."
-  (if (eq type 'x)
-      (car (frame-list))
-    nil))
+;; Creating gnuserv frame.
 
-(defun gnuserv-visible-frame-function (type)
-  "Returns a frame if there is a frame that is truly visible, nil otherwise.
-This is meant in the X sense, so it will not return frames that are on another
-visual screen.  Totally visible frames are preferred.  If none found, return nil."
-  (if (eq type 'x)
-      (cond ((car (filtered-frame-list 'frame-totally-visible-p
-				       (selected-device))))
-	    ((car (filtered-frame-list (lambda (frame)
-					 ;; eq t as in not 'hidden
-					 (eq t (frame-visible-p frame)))
-				       (selected-device)))))
-    nil))
-
-(defun gnuserv-special-frame-function (type)
-  "Creates a special frame for Gnuserv and returns it on later invocations."
-  (unless (frame-live-p gnuserv-special-frame)
-    (setq gnuserv-special-frame (make-frame)))
-  gnuserv-special-frame)
+(defun gnuserv-frame-default-function (arg device)
+  "Default function to create Gnuserv frames.
+See the documentation of `gnuserv-frame' for instructions how to
+customize it."
+  ;; If we are on TTY, act as if `new' was given.
+  (if (not (device-on-window-system-p))
+      (gnuserv-frame-default-function 'new device)
+    (cond
+      ((or (eq arg 'new)
+	   ;; nil for back-compat
+	   (eq arg nil))
+       (make-frame gnuserv-frame-properties device))
+      ((or (eq arg 'current)
+	   ;; t for back-compat
+	   (eq arg t))
+       (selected-frame))
+      ((eq arg 'main)
+       (car (frame-list)))
+      ((eq arg 'visible)
+       (cond ((car (filtered-frame-list 'frame-totally-visible-p device)))
+	     ((car (filtered-frame-list (lambda (frame)
+					  ;; eq t as in not 'hidden
+					  (eq (frame-visible-p frame) t))
+					device)))
+	     (t (make-frame gnuserv-frame-properties device))))
+      ((eq arg 'special)
+       (unless (frame-live-p gnuserv-special-frame)
+	 (setq gnuserv-special-frame
+	       (make-frame gnuserv-frame-properties device))))
+      ((frame-live-p arg)
+       arg)
+      (t
+       (error "Invalid argument %s" arg)))))
 
 
 ;;; Communication functions
@@ -402,29 +411,17 @@
 	      (t     (error "Invalid flag %s" flag))))
 	  flags)
     (let* ((old-device-num (length (device-list)))
-	   (new-frame nil)
-	   (dest-frame (if (functionp gnuserv-frame)
-			   (funcall gnuserv-frame (car type))
-			 gnuserv-frame))
-	   ;; The gnuserv-frame dependencies are ugly.
-	   (device (cond ((frame-live-p dest-frame)
-			  (frame-device dest-frame))
-			 ((null dest-frame)
-			  (case (car type)
+	   (old-frame-num  (length (frame-list)))
+	   (device (case (car type)
 			    (tty (apply 'make-tty-device (cdr type)))
 			    (x   (make-x-device (cadr type)))
 			    (t   (error "Invalid device type"))))
-			 (t
-			  (selected-device))))
-	   (frame (cond ((frame-live-p dest-frame)
-			 dest-frame)
-			((null dest-frame)
-			 (setq new-frame (make-frame nil device))
-			 new-frame)
-			(t (selected-frame))))
+	   (frame (funcall gnuserv-frame-function gnuserv-frame device))
 	   (client (make-gnuclient :id gnuserv-current-client
 				   :device device
-				   :frame new-frame)))
+				   :frame (if (= (length (frame-list))
+						 old-frame-num)
+					      nil frame))))
       (setq gnuserv-current-client nil)
       ;; If the device was created by this client, push it to the list.
       (and (/= old-device-num (length (device-list)))
@@ -435,6 +432,7 @@
       (while list
 	(let ((line (caar list)) (path (cdar list)))
 	  (select-frame frame)
+	  (raise-frame frame)
 	  ;; Visit the file.
 	  (funcall (if view
 		       gnuserv-view-file-function
@@ -446,10 +444,9 @@
 	    (pushnew (current-buffer) (gnuclient-buffers client))
 	    (setq gnuserv-minor-mode t)
 	    ;; Add the "Done" button to the menubar, only in this buffer.
-	    (if (boundp 'current-menubar)
-	      (progn (set-buffer-menubar current-menubar)
-	      (add-menu-button nil ["Done" gnuserv-edit t]))
-	      ))
+	    (when (boundp 'current-menubar)
+	      (set-buffer-menubar current-menubar)
+	      (add-menu-button nil ["Done" gnuserv-edit t])))
 	  (run-hooks 'gnuserv-visit-hook)
 	  (pop list)))
       (cond
@@ -463,19 +460,19 @@
        (t
 	;; Else, the client gets a vote.
 	(push client gnuserv-clients)
-	;; Explain buffer exit options.  If dest-frame is nil, the
-	;; user can exit via `delete-frame'.  OTOH, if FLAGS are nil
-	;; and there are some buffers, the user can exit via
+	;; Explain buffer exit options.  If client-frame is non-nil,
+	;; the user can exit via `delete-frame'.  OTOH, if FLAGS are
+	;; nil and there are some buffers, the user can exit via
 	;; `gnuserv-edit'.
 	(if (and (not (or quick view))
 		 (gnuclient-buffers client))
 	    (message "%s"
 		     (substitute-command-keys
 		      "Type `\\[gnuserv-edit]' to finish editing"))
-	  (or dest-frame
-	      (message "%s"
-		       (substitute-command-keys
-			"Type `\\[delete-frame]' to finish editing")))))))))
+	  (and (gnuclient-frame client)
+	       (message "%s"
+			(substitute-command-keys
+			 "Type `\\[delete-frame]' to finish editing")))))))))
 
 
 ;;; Functions that hook into Emacs in various way to enable operation
@@ -489,10 +486,9 @@
 (defun gnuserv-buffer-clients (buffer)
   "Returns a list of clients to which BUFFER belongs."
   (let (res)
-    (dolist (client gnuserv-clients)
+    (dolist (client gnuserv-clients res)
       (when (memq buffer (gnuclient-buffers client))
-	(push client res)))
-    res))
+	(push client res)))))
 
 ;; Like `gnuserv-buffer-clients', but returns a boolean; doesn't
 ;; collect a list.
@@ -553,16 +549,6 @@
 
 (add-hook 'delete-device-hook 'gnuserv-check-device)
 
-(defun gnuserv-temp-file-p (buffer)
-  "Return non-nil if BUFFER contains a file considered temporary.
-These are files whose names suggest they are repeatedly
-reused to pass information to another program.
-
-The variable `gnuserv-temp-file-regexp' controls which filenames
-are considered temporary."
-  (and (buffer-file-name buffer)
-       (string-match gnuserv-temp-file-regexp (buffer-file-name buffer))))
-
 (defun gnuserv-kill-client (client &optional leave-frame)
   "Kill the gnuclient CLIENT.
 This will do away with all the associated buffers.  If LEAVE-FRAME,
@@ -608,10 +594,7 @@
     ;; Delete the menu button.
     (if (boundp 'current-menubar)
       (delete-menu-item '("Done")))
-    (funcall (if (gnuserv-temp-file-p buffer)
-		 gnuserv-done-temp-file-function
-	       gnuserv-done-function)
-	     buffer)))
+    (funcall gnuserv-done-function buffer)))
 
 
 ;;; Higher-level functions
@@ -650,15 +633,9 @@
   (unless (gnuserv-buffer-p buffer)
     (error "%s does not belong to a gnuserv client" buffer))
   ;; Backup/ask query.
-  (if (gnuserv-temp-file-p buffer)
-      ;; For a temp file, save, and do NOT make a non-numeric backup
-      ;; Why does server.el explicitly back up temporary files?
-      (let ((version-control nil)
-	    (buffer-backed-up (not gnuserv-make-temp-file-backup)))
-	(save-buffer))
-    (if (and (buffer-modified-p)
-	     (y-or-n-p (concat "Save file " buffer-file-name "? ")))
-	(save-buffer buffer)))
+  (if (and (buffer-modified-p)
+	   (y-or-n-p (concat "Save file " buffer-file-name "? ")))
+      (save-buffer buffer))
   (gnuserv-buffer-done-1 buffer))
 
 ;; Called by `gnuserv-start-1' to clean everything.  Hooked into
@@ -715,10 +692,9 @@
 ;;;###autoload
 (defun gnuserv-start (&optional leave-dead)
   "Allow this Emacs process to be a server for client processes.
-This starts a gnuserv communications subprocess through which
-client \"editors\" (gnuclient and gnudoit) can send editing commands to 
-this Emacs job.  See the gnuserv(1) manual page for more details.
-
+ This starts a gnuserv communications subprocess through which
+ client \"editors\" (gnuclient and gnudoit) can send editing commands to 
+ this Emacs job.  See the gnuserv(1) manual page for more details.
 Prefix arg means just kill any existing server communications subprocess."
   (interactive "P")
   (and gnuserv-process
@@ -727,21 +703,14 @@
   (gnuserv-start-1 leave-dead))
 
 (defun gnuserv-edit (&optional count)
-  "Mark the current gnuserv editing buffer as \"done\", and switch to next one.
-
+  "Mark the current gnuserv buffer as \"done\", and switch to next one.
 Run with a numeric prefix argument, repeat the operation that number
-of times.  If given a universal prefix argument, close all the buffers
-of this buffer's clients.
-
-The `gnuserv-done-function' (bound to `kill-buffer' by default) is
-called to dispose of the buffer after marking it as done.
-
-Files that match `gnuserv-temp-file-regexp' are considered temporary and
-are saved unconditionally and backed up if `gnuserv-make-temp-file-backup'
-is non-nil.  They are disposed of using `gnuserv-done-temp-file-function'
-(also bound to `kill-buffer' by default).
-
-When all of a client's buffers are marked as \"done\", the client is notified."
+ of times.  If given a universal prefix argument, close all the buffers
+ of this buffer's clients.
+The `gnuserv-done-function' (`kill-buffer' by default) is called to
+ dispose of the buffer after marking it as done.
+When all of a client's buffers are marked as \"done\", the client is
+ notified."
   (interactive "P")
   (when (null count)
     (setq count 1))
--- a/lisp/packages/info.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/packages/info.el	Mon Aug 13 09:58:30 2007 +0200
@@ -1876,7 +1876,7 @@
 (defun Info-elisp-ref (func)
   "Look up an Emacs Lisp function in the Elisp manual in the Info system.
 This command is designed to be used whether you are already in Info or not."
-  (interactive (let ((fn (function-called-at-point))
+  (interactive (let ((fn (funcall find-function-function))
 		     (enable-recursive-minibuffers t)	     
 		     val)
 		 (setq val (completing-read
--- a/lisp/packages/lazy-lock.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/packages/lazy-lock.el	Mon Aug 13 09:58:30 2007 +0200
@@ -661,13 +661,13 @@
   ;; (e) no input after waiting for `lazy-lock-continuity-time'.
   ;;
   ;; (a), (b), and (e) are automatically taken care of by `pre-idle-hook'.
-  ;; I removed (d) because there doesn't seem to be any reason for it.
   ;;
   ;; Also, we do not have to `set-buffer' and in fact it would be
   ;; incorrect to do so, since we may be being called from
   ;; `accept-process-output' or whatever.
   ;;
-  (if (memq this-command lazy-lock-ignore-commands)
+  (if (or (memq this-command lazy-lock-ignore-commands)
+	  (window-minibuffer-p (selected-window)))
       (setq lazy-lock-cache-continue nil)
     (setq lazy-lock-cache-continue t)
     ;; #### we don't yet handle frame-modified-tick on multiple frames.
--- a/lisp/packages/man.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/packages/man.el	Mon Aug 13 09:58:30 2007 +0200
@@ -77,6 +77,12 @@
   :type 'boolean
   :group 'man)
 
+(defcustom Manual-buffers-have-prefix t
+  "*When non-nil, manual page buffers are named with a prefix of `man '.
+Otherwise, their titles do not have this prefix."
+  :type 'boolean
+  :group 'man)
+
 ;;Here is information on RosettaMan, from Neal.Becker@comsat.com (Neal Becker):
 
 ;;RosettaMan is a filter for UNIX manual pages.  It takes as input man
@@ -215,6 +221,8 @@
 		     (if apropos-mode
 			 (concat (maybe-star) "man apropos " topic (maybe-star))
 		       (concat (maybe-star)
+			       (if Manual-buffers-have-prefix
+				   "man ")
 			       topic
 			       (if section (concat "(" section ")") "")
 			       (maybe-star)))))
--- a/lisp/prim/faces.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/prim/faces.el	Mon Aug 13 09:58:30 2007 +0200
@@ -1446,9 +1446,19 @@
 (make-face 'primary-selection)
 (make-face 'secondary-selection)
 
-(loop for color in '("red" "green" "blue" "yellow") do
-      (make-face (intern color) (concat color " text"))
-      (set-face-foreground (intern color) color nil 'color))
+;; The loop macro isn't defined until loaddefs.el is read
+;;(loop for color in '("red" "green" "blue" "yellow") do
+;;      (make-face (intern color) (concat color " text"))
+;;      (set-face-foreground (intern color) color nil 'color))
+(make-face 'red "red text")
+(set-face-foreground 'red "red" nil 'color)
+(make-face 'green "green text")
+(set-face-foreground 'green "green" nil 'color)
+(make-face 'blue "blue text")
+(set-face-foreground 'blue "blue" nil 'color)
+(make-face 'yellow "yellow text")
+(set-face-foreground 'yellow "yellow" nil 'color)
+
 
 ;; Make some useful faces.  This happens very early, before creating
 ;; the first non-stream device.  We initialize the tty global values here.
--- a/lisp/prim/files.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/prim/files.el	Mon Aug 13 09:58:30 2007 +0200
@@ -2039,8 +2039,9 @@
 	(make-backup-files (or (and make-backup-files (not (eq args 0)))
 			       (memq args '(16 64)))))
     (and modp (memq args '(16 64)) (setq buffer-backed-up nil))
-    (if (and modp large) (message "Saving file %s..."
-				  (buffer-file-name)))
+    (if (and modp large) (display-message
+			  'progress (format "Saving file %s..."
+					    (buffer-file-name))))
     (basic-save-buffer)
     (and modp (memq args '(4 64)) (setq buffer-backed-up nil))))
 
@@ -2174,7 +2175,7 @@
 	  ;; Support VC `implicit' locking.
 	  (vc-after-save)
 	  (run-hooks 'after-save-hook))
-      (message "(No changes need to be saved)"))))
+      (display-message 'no-log "(No changes need to be saved)"))))
 
 ;; This does the "real job" of writing a buffer into its visited file
 ;; and making a backup file.  This is what is normally done
@@ -2354,7 +2355,7 @@
 		    (setq abbrevs-changed nil)
 		    t))))
 	(or (> files-done 0) abbrevs-done
-	    (message "(No files need saving)"))))))
+	    (display-message 'no-log "(No files need saving)"))))))
 
 
 (defun not-modified (&optional arg)
@@ -2365,8 +2366,8 @@
 prints a message in the minibuffer.  Instead, use `set-buffer-modified-p'."
   (interactive "_P")
   (if arg ;; rewritten for I18N3 snarfing
-      (message "Modification-flag set")
-    (message "Modification-flag cleared"))
+      (display-message 'command "Modification-flag set")
+    (display-message 'command "Modification-flag cleared"))
   (set-buffer-modified-p arg))
 
 (defun toggle-read-only (&optional arg)
@@ -2785,8 +2786,8 @@
        (setq buffer-saved-size 0))
   (if (interactive-p)
       (if buffer-auto-save-file-name ;; rewritten for I18N3 snarfing
-	  (message "Auto-save on (in this buffer)")
-	(message "Auto-save off (in this buffer)")))
+	  (display-message 'command "Auto-save on (in this buffer)")
+	(display-message 'command "Auto-save off (in this buffer)")))
   buffer-auto-save-file-name)
 
 (defun rename-auto-save-file ()
--- a/lisp/prim/help.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/prim/help.el	Mon Aug 13 09:58:30 2007 +0200
@@ -390,13 +390,13 @@
               (if help-selects-help-window
                   (select-window helpwin))
               (cond ((eq helpwin (selected-window))
-                     (message
+                     (display-message 'command
                       (substitute-command-keys "Type \\[help-mode-quit] to remove help window, \\[scroll-up] to scroll the help.")))
                     (was-one-window
-                     (message
+                     (display-message 'command
                       (substitute-command-keys "Type \\[delete-other-windows] to remove help window, \\[scroll-other-window] to scroll the help.")))
                     (t
-                     (message
+                     (display-message 'command
                       (substitute-command-keys "Type \\[switch-to-buffer-other-window] to restore the other window, \\[scroll-other-window] to scroll the help."))))))))))
 
 (defun describe-key (key)
@@ -660,42 +660,37 @@
   "You have typed \\[help-for-help], the help character.  Type a Help option:
 \(Use SPC or DEL to scroll through this text.  Type \\<help-map>\\[help-quit] to exit the Help command.)
 
-\\[hyper-apropos]	Give a substring, and see a hypertext list of
+\\[hyper-apropos]	Type a substring; it shows a hypertext list of
         functions and variables that contain that substring.
-	See also the `apropos'  command.
-\\[command-apropos]	Give a substring, and see a list of commands
-        (functions interactively callable) that contain that substring.
-\\[describe-bindings]	Display table of all key bindings.
+	See also the `apropos' command.
+\\[command-apropos]	Type a substring; it shows a list of commands
+        (interactively callable functions) that contain that substring.
+\\[describe-bindings]	Table of all key bindings.
 \\[describe-key-briefly]	Type a command key sequence;
-        it prints the function name that sequence runs.
-\\[Info-goto-emacs-command-node]	Type a function name;
- 	it takes you to the Info node for that command.
-\\[describe-function]	Type a function name and get documentation of it.
-\\[Info-elisp-ref]	Type a function name and jump to the full documentation
+        it displays the function name that sequence runs.
+\\[Info-goto-emacs-command-node]	Type a function name; it displays the Info node for that command.
+\\[describe-function]	Type a function name; it shows its documentation.
+\\[Info-elisp-ref]	Type a function name; it jumps to the full documentation
 	in the XEmacs Lisp Programmer's Manual.
-\\[xemacs-local-faq]	To view a local copy of the XEmacs FAQ.
-\\[info]	The  info  documentation reader.
-\\[Info-query]	Info reader, prompt for topic name.
+\\[xemacs-local-faq]	Local copy of the XEmacs FAQ.
+\\[info]	Info documentation reader.
+\\[Info-query]	Type an Info file name; it displays it in Info reader.
 \\[describe-key]	Type a command key sequence;
-        it displays the full documentation.
+        it displays the documentation for the command bound to that key.
 \\[Info-goto-emacs-key-command-node]	Type a command key sequence;
-        it takes you to the Info node for the command bound to that key.
-\\[view-lossage]	Shows last 100 characters you typed.
-\\[describe-mode]	Print documentation of current major mode,
-        which describes the commands peculiar to it.
-\\[view-emacs-news]	Shows emacs news file.
-\\[finder-by-keyword]	Find packages matching a given topic keyword.
-\\[describe-pointer]	Display table of all mouse-button bindings.
-\\[describe-syntax]	Display contents of syntax table, plus explanations
-\\[help-with-tutorial]	Select the XEmacs learn-by-doing tutorial.
-\\[describe-variable]	Type name of a variable;
-        it displays the variable's documentation and value.
-\\[where-is]	Type command name;
-        it prints which keystrokes invoke that command.
+        it displays the Info node for the command bound to that key.
+\\[view-lossage]	Recent input keystrokes and minibuffer messages.
+\\[describe-mode]	Documentation of current major and minor modes.
+\\[view-emacs-news]	News of recent XEmacs changes.
+\\[finder-by-keyword]	Type a topic keyword; it finds matching packages.
+\\[describe-pointer]	Table of all mouse-button bindings.
+\\[describe-syntax]	Contents of syntax table with explanations.
+\\[help-with-tutorial]	XEmacs learn-by-doing tutorial.
+\\[describe-variable]	Type a variable name; it displays its documentation and value.
+\\[where-is]	Type a command name; it displays which keystrokes invoke that command.
 \\[describe-distribution]	XEmacs ordering information.
-\\[describe-copying]	print XEmacs copying permission (General Public License).
-\\[view-emacs-news]	print news of recent XEmacs changes.
-\\[describe-no-warranty]	print information on absence of warranty for XEmacs."
+\\[describe-no-warranty]	Information on absence of warranty for XEmacs.
+\\[describe-copying]      XEmacs copying permission (General Public License)."
   (interactive)
   (let ((help-key (copy-event last-command-event))
 	event char)
--- a/lisp/prim/isearch-mode.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/prim/isearch-mode.el	Mon Aug 13 09:58:30 2007 +0200
@@ -560,7 +560,7 @@
 	  (progn
 	    (push-mark isearch-opoint t nil isearch-buffer)
 	    (or executing-kbd-macro (> (minibuffer-depth) 0)
-		(message "Mark saved where search started"))))
+		(display-message 'command "Mark saved where search started"))))
 	)
     (setq isearch-buffer nil)
     ) ; inhibit-quit is t before here
@@ -670,7 +670,7 @@
 	      ;; word-search mode.  Otherwise unread that character and
 	      ;; read a string the normal way.
 	      (let ((cursor-in-echo-area t))
-		(message "%s" prompt)
+		(display-message 'prompt prompt)
 		(setq event (next-command-event))
 		(if (eq 'isearch-yank-word
 			(lookup-key isearch-mode-map (vector event)))
@@ -1184,7 +1184,7 @@
 	    isearch-message
 	    (isearch-message-suffix c-q-hack)
 	    )))
-    (if c-q-hack m (message "%s" m))))
+    (if c-q-hack m (display-message 'progress (format "%s" m)))))
 
 (defun isearch-message-prefix (&optional c-q-hack nonincremental)
   ;; If about to search, and previous search regexp was invalid,
--- a/lisp/prim/make-docfile.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/prim/make-docfile.el	Mon Aug 13 09:58:30 2007 +0200
@@ -124,7 +124,7 @@
       (load site-file-list t t)
       (while site-load-packages
 	(let ((arg (car site-load-packages)))
-	  (if (not (member arg processed))
+	  (if (null (member arg processed))
 	      (progn
 		(if (and (null docfile-out-of-date)
 			 (file-newer-than-file-p arg docfile))
--- a/lisp/prim/novice.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/prim/novice.el	Mon Aug 13 09:58:30 2007 +0200
@@ -138,13 +138,14 @@
    ;; Explicitly enable, in case this command is disabled by default
    ;; or in case the code we deleted was actually a comment.
    (goto-char (point-max))
-   (insert "\n(put '" (symbol-name command) " 'disabled nil)\n")
+   (or (bolp) (insert "\n"))
+   (insert "(put '" (symbol-name command) " 'disabled nil)\n")
    (save-buffer)))
 
 ;;;###autoload
 (defun disable-command (command)
   "Require special confirmation to execute COMMAND from now on.
-The user's .emacs file is altered so that this will apply
+The user's `custom-file' is altered so that this will apply
 to future sessions."
   (interactive "CDisable command: ")
   (if (not (commandp command))
@@ -152,14 +153,15 @@
   (put command 'disabled t)
   (save-excursion
    (set-buffer (find-file-noselect
-		(substitute-in-file-name user-init-file)))
+		(substitute-in-file-name custom-file)))
    (goto-char (point-min))
    (if (search-forward (concat "(put '" (symbol-name command) " ") nil t)
        (delete-region
 	(progn (beginning-of-line) (point))
 	(progn (forward-line 1) (point))))
    (goto-char (point-max))
-   (insert "\n(put '" (symbol-name command) " 'disabled t)\n")
+   (or (bolp) (insert "\n"))
+   (insert "(put '" (symbol-name command) " 'disabled t)\n")
    (save-buffer)))
 
 ;;; novice.el ends here
--- a/lisp/prim/process.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/prim/process.el	Mon Aug 13 09:58:30 2007 +0200
@@ -261,7 +261,8 @@
 			 (count-lines (point-min) (point-max))))))
 	  (cond ((= lines 0)
 		 (if success
-		     (message
+		     (display-message
+		      'command
 		      "(Shell command completed with no output)"))
 		 (kill-buffer buffer))
 		((and success (= lines 1))
--- a/lisp/prim/simple.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/prim/simple.el	Mon Aug 13 09:58:30 2007 +0200
@@ -758,7 +758,7 @@
   (let ((modified (buffer-modified-p))
 	(recent-save (recent-auto-save-p)))
     (or (eq (selected-window) (minibuffer-window))
-	(message "Undo!"))
+	(display-message 'command "Undo!"))
     (or (and (eq last-command 'undo)
 	     (eq (current-buffer) last-undo-buffer)) ; XEmacs
 	(progn (undo-start)
@@ -1155,10 +1155,14 @@
 			(error "The region is not active now")
 		      (error "The mark is not set now")))
   (if verbose (if buffer-read-only
-		  (message "Copying %d characters"
-			   (- (max beg end) (min beg end)))
-		(message "Killing %d characters"
-			 (- (max beg end) (min beg end)))))
+		  (display-message
+		   'command
+		   (format "Copying %d characters"
+			   (- (max beg end) (min beg end))))
+		(display-message
+		 'command
+		 (format "Killing %d characters"
+			 (- (max beg end) (min beg end))))))
   (cond
 
    ;; I don't like this large change in behavior -- jwz
@@ -1267,7 +1271,8 @@
   (if (interactive-p)
       (progn
 	(setq this-command 'kill-region)
-	(message "If the next command is a kill, it will append"))
+	(display-message 'command
+			 "If the next command is a kill, it will append"))
     (setq last-command 'kill-region)))
 
 (defun yank-pop (arg)
@@ -1548,7 +1553,7 @@
                            nil buffer)
               (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil)))))
   (or nomsg executing-kbd-macro (> (minibuffer-depth) 0)
-      (message "Mark set"))
+      (display-message 'command "Mark set"))
   (if activate-region
       (progn
 	(setq zmacs-region-stays t)
@@ -1825,7 +1830,7 @@
   (if arg
       (progn
         (setq goal-column nil)
-        (message "No goal column"))
+        (display-message 'command "No goal column"))
     (setq goal-column (current-column))
     (message (substitute-command-keys
 	      "Goal column %d (use \\[set-goal-column] with an arg to unset it)")
@@ -2130,10 +2135,14 @@
 	    (re-search-forward comment-start-skip)
 	    (goto-char (match-beginning 0))
 	    (setq comment-column (current-column))
-	    (message "Comment column set to %d" comment-column))
+	    (display-message
+	     'command
+	     (format "Comment column set to %d" comment-column)))
 	  (indent-for-comment))
       (setq comment-column (current-column))
-      (message "Comment column set to %d" comment-column))))
+      (display-message
+       'command
+       (format "Comment column set to %d" comment-column)))))
 
 (defun kill-comment (arg)
   "Kill the comment on this line, if any.
@@ -2584,7 +2593,7 @@
 	;; Disallow missing argument; it's probably a typo for C-x C-f.
 	(t
 	 (error "set-fill-column requires an explicit argument")))
-  (message "fill-column set to %d" fill-column))
+  (display-message 'command "fill-column set to %d" fill-column))
 
 (defcustom comment-multi-line t ; XEmacs - this works well with adaptive fill
   "*Non-nil means \\[indent-new-comment-line] should continue same comment
@@ -2870,43 +2879,45 @@
 			   (auto-show-make-point-visible)
 			   (sit-for blink-matching-delay)))
 		  (goto-char blinkpos)
-		  (message
-		   "Matches %s"
-		   ;; Show what precedes the open in its line, if anything.
-		   (if (save-excursion
-			 (skip-chars-backward " \t")
-			 (not (bolp)))
-		       (buffer-substring (progn (beginning-of-line) (point))
-					 (1+ blinkpos))
-		     ;; Show what follows the open in its line, if anything.
-		     (if (save-excursion
-			   (forward-char 1)
-			   (skip-chars-forward " \t")
-			   (not (eolp)))
-			 (buffer-substring blinkpos
-					   (progn (end-of-line) (point)))
-		       ;; Otherwise show the previous nonblank line,
-		       ;; if there is one.
-		       (if (save-excursion
-			     (skip-chars-backward "\n \t")
-			     (not (bobp)))
-			   (concat
-			    (buffer-substring (progn
-					       (skip-chars-backward "\n \t")
-					       (beginning-of-line)
-					       (point))
-					      (progn (end-of-line)
-						     (skip-chars-backward " \t")
-						     (point)))
-			    ;; Replace the newline and other whitespace with `...'.
-			    "..."
-			    (buffer-substring blinkpos (1+ blinkpos)))
-			 ;; There is nothing to show except the char itself.
-			 (buffer-substring blinkpos (1+ blinkpos))))))))
+		  (display-message
+		   'command
+		   (format
+		    "Matches %s"
+		    ;; Show what precedes the open in its line, if anything.
+		    (if (save-excursion
+			  (skip-chars-backward " \t")
+			  (not (bolp)))
+			(buffer-substring (progn (beginning-of-line) (point))
+					  (1+ blinkpos))
+		      ;; Show what follows the open in its line, if anything.
+		      (if (save-excursion
+			    (forward-char 1)
+			    (skip-chars-forward " \t")
+			    (not (eolp)))
+			  (buffer-substring blinkpos
+					    (progn (end-of-line) (point)))
+			;; Otherwise show the previous nonblank line,
+			;; if there is one.
+			(if (save-excursion
+			      (skip-chars-backward "\n \t")
+			      (not (bobp)))
+			    (concat
+			     (buffer-substring (progn
+						 (skip-chars-backward "\n \t")
+						 (beginning-of-line)
+						 (point))
+					       (progn (end-of-line)
+						      (skip-chars-backward " \t")
+						      (point)))
+			     ;; Replace the newline and other whitespace with `...'.
+			     "..."
+			     (buffer-substring blinkpos (1+ blinkpos)))
+			  ;; There is nothing to show except the char itself.
+			  (buffer-substring blinkpos (1+ blinkpos)))))))))
 	     (cond (mismatch
-		    (message "Mismatched parentheses"))
+		    (display-message 'no-log "Mismatched parentheses"))
 		   ((not blink-matching-paren-distance)
-		    (message "Unmatched parenthesis"))))))))
+		    (display-message 'no-log "Unmatched parenthesis"))))))))
 
 ;Turned off because it makes dbx bomb out.
 (setq blink-paren-function 'blink-matching-open)
@@ -3236,55 +3247,28 @@
 ;;
 ;;                                            --hniksic
 (defvar log-message-ignore-regexps
-  '(;; Often-seen messages
+  '(;; Note: adding entries to this list slows down messaging
+    ;; significantly.  Wherever possible, use message lables.
+
+    ;; Often-seen messages
     "\\`\\'"				; empty message
-    ;;"^Mark set$"
-    ;;"^\\(Beginning\\|End\\) of buffer$"
+    "\\`\\(Beginning\\|End\\) of buffer\\'"
     ;;"^Quit$"
-    ;;"^Killing [0-9]+ characters$"
-    ;; saving
-    ;;"^Saving file .*\\.\\.\\.$"		; note: cannot ignore ^Wrote, because
-					; it would kill off too much stuff.
-    ;;"^(No changes need to be saved)$"
-    ;;"^(No files need saving)$"
-    ;; undo, with the output of redo.el
-    "\\`Undo[!.]+\\'"
-    "\\`Redo[!.]+\\'"
-    ;; M-x compile
-    ;;"^Parsing error messages\\.\\.\\."
-    ;; M-!
-    ;;"^(Shell command completed with no output)"
-    ;; font-lock
-    "\\`Fontifying"
-    ;; isearch
-    ;;"^\\(Failing \\)?\\([Ww]rapped \\)?\\([Rr]egexp \\)?I-search\\( backward\\)?:"
-    ;;"^Mark saved where search started$"
-    ;; menus
-    ;;"^Selecting menu item"
     ;; completions
+    ;; Many packages print this -- impossible to categorize
     ;;"^Making completion list"
-    ;;"^Matches "				; paren-matching message
-    ;; help
-    ;;"^Type .* to \\(remove help\\|restore the other\\) window."
-    ;; VM
-    ;;"^\\(Parsing messages\\|Reading attributes\\|Generating summary\\|Building threads\\|Converting\\)\\.\\.\\. [0-9]+$"
-    ;;"^End of message"			; + Gnus
     ;; Gnus
-    ;;"^No news is no news$"
-    ;;"^No more\\( unread\\)? newsgroups$"
-    ;;"^Opening [^ ]+ server\\.\\.\\."
-    ;;"^[^:]+: Reading incoming mail"
-    ;;"^Getting mail from "
-    ;;"^\\(Generating Summary\\|Sorting threads\\|Making sparse threads\\|Scoring\\|Checking new news\\|Expiring articles\\|Sending\\)\\.\\.\\."
-    ;;"^\\(Fetching headers for\\|Retrieving newsgroup\\|Reading active file\\)"
-    ;;"^No more\\( unread\\)? articles"
-    ;;"^Deleting article "
+    ;; "^No news is no news$"
+    ;; "^No more\\( unread\\)? newsgroups$"
+    ;; "^Opening [^ ]+ server\\.\\.\\."
+    ;; "^[^:]+: Reading incoming mail"
+    ;; "^Getting mail from "
+    ;; "^\\(Generating Summary\\|Sorting threads\\|Making sparse threads\\|Scoring\\|Checking new news\\|Expiring articles\\|Sending\\)\\.\\.\\."
+    ;; "^\\(Fetching headers for\\|Retrieving newsgroup\\|Reading active file\\)"
+    ;; "^No more\\( unread\\)? articles"
+    ;; "^Deleting article "
     ;; W3
-    ;;"^Parsed [0-9]+ of [0-9]+ ([0-9]+%)"
-    ;; outl-mouse
-    ;;"^Adding glyphs\\.\\.\\."
-    ;; bbdb
-    ;;"^->"
+    ;; "^Parsed [0-9]+ of [0-9]+ ([0-9]+%)"
     )
   "List of regular expressions matching messages which shouldn't be logged.
 See `log-message'.  
--- a/lisp/utils/auto-autoloads.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/utils/auto-autoloads.el	Mon Aug 13 09:58:30 2007 +0200
@@ -856,6 +856,49 @@
 
 ;;;***
 
+;;;### (autoloads (list-load-path-shadows) "shadow" "utils/shadow.el")
+
+(autoload 'list-load-path-shadows "shadow" "\
+Display a list of Emacs Lisp files that shadow other files.
+
+This function lists potential load-path problems.  Directories in the
+`load-path' variable are searched, in order, for Emacs Lisp
+files.  When a previously encountered file name is found again, a
+message is displayed indicating that the later file is \"hidden\" by
+the earlier.
+
+For example, suppose `load-path' is set to
+
+\(\"/usr/gnu/emacs/site-lisp\" \"/usr/gnu/emacs/share/emacs/19.30/lisp\")
+
+and that each of these directories contains a file called XXX.el.  Then
+XXX.el in the site-lisp directory is referred to by all of:
+\(require 'XXX), (autoload .... \"XXX\"), (load-library \"XXX\") etc.
+
+The first XXX.el file prevents emacs from seeing the second (unless
+the second is loaded explicitly via load-file).
+
+When not intended, such shadowings can be the source of subtle
+problems.  For example, the above situation may have arisen because the
+XXX package was not distributed with versions of emacs prior to
+19.30.  An emacs maintainer downloaded XXX from elsewhere and installed
+it.  Later, XXX was updated and included in the emacs distribution.
+Unless the emacs maintainer checks for this, the new version of XXX
+will be hidden behind the old (which may no longer work with the new
+emacs version).
+
+This function performs these checks and flags all possible
+shadowings.  Because a .el file may exist without a corresponding .elc
+\(or vice-versa), these suffixes are essentially ignored.  A file
+XXX.elc in an early directory (that does not contain XXX.el) is
+considered to shadow a later file XXX.el, and vice-versa.
+
+When run interactively, the shadowings (if any) are displayed in a
+buffer called `*Shadows*'.  Shadowings are located by calling the
+\(non-interactive) companion function, `find-emacs-lisp-shadows'." t nil)
+
+;;;***
+
 ;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy skeleton-proxy-new define-skeleton) "skeleton" "utils/skeleton.el")
 
 (defvar skeleton-filter 'identity "\
--- a/lisp/utils/autoload.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/utils/autoload.el	Mon Aug 13 09:58:30 2007 +0200
@@ -580,8 +580,11 @@
 	(update-file-autoloads arg))
        (t (error "No such file or directory: %s" arg))))
     (when autoload-do-custom-save
-      (autoload-save-customization))
-    (fixup-autoload-buffer (concat (file-name-nondirectory defdir)
+      (autoload-save-customization)
+      (clrhash customized-symbols))
+    (fixup-autoload-buffer (concat (if autoload-package-name
+				       autoload-package-name
+				     (file-name-nondirectory defdir))
 				   "-autoloads"))
     (save-some-buffers t)
     ;; (message "Done")
--- a/lisp/utils/redo.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/utils/redo.el	Mon Aug 13 09:58:30 2007 +0200
@@ -90,7 +90,7 @@
 	   (eq (cdr buffer-undo-list) pending-undo-list))
        (error "No further undos to redo in this buffer"))
   (or (eq (selected-window) (minibuffer-window))
-      (message "Redo..."))
+      (display-message 'progress "Redo..."))
   (let ((modified (buffer-modified-p))
 	(recent-save (recent-auto-save-p))
 	(old-undo-list buffer-undo-list)
@@ -144,7 +144,7 @@
     (and modified (not (buffer-modified-p))
 	 (delete-auto-save-file-if-necessary recent-save))
     (or (eq (selected-window) (minibuffer-window))
-	(message "Redo!"))
+	(display-message 'progress "Redo!"))
     (setq last-buffer-undo-list buffer-undo-list)))
 
 (defun undo (&optional arg)
@@ -155,7 +155,7 @@
   (let ((modified (buffer-modified-p))
 	(recent-save (recent-auto-save-p)))
     (or (eq (selected-window) (minibuffer-window))
-	(message "Undo..."))
+	(display-message 'progress "Undo..."))
     (or (eq last-buffer-undo-list buffer-undo-list)
 	(and (null (car-safe buffer-undo-list))
 	     (eq last-buffer-undo-list (cdr-safe buffer-undo-list)))
@@ -183,7 +183,7 @@
     (and modified (not (buffer-modified-p))
 	 (delete-auto-save-file-if-necessary recent-save)))
   (or (eq (selected-window) (minibuffer-window))
-      (message "Undo!"))
+      (display-message 'progress "Undo!"))
   (setq last-buffer-undo-list buffer-undo-list))
 
 ;;; redo.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/utils/shadow.el	Mon Aug 13 09:58:30 2007 +0200
@@ -0,0 +1,233 @@
+;;; shadow.el --- Locate Emacs Lisp file shadowings.
+
+;; Copyright (C) 1995 Free Software Foundation, Inc.
+
+;; Author: Terry Jones <terry@santafe.edu>
+;; Keywords: lisp
+;; Created: 15 December 1995
+
+;; 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:
+
+;; The functions in this file detect (`find-emacs-lisp-shadows')
+;; and display (`list-load-path-shadows') potential load-path
+;; problems that arise when Emacs Lisp files "shadow" each other.
+;;
+;; For example, a file XXX.el early in one's load-path will shadow
+;; a file with the same name in a later load-path directory.  When
+;; this is unintentional, it may result in problems that could have
+;; been easily avoided.  This occurs often (to me) when installing a
+;; new version of emacs and something in the site-lisp directory
+;; has been updated and added to the emacs distribution.  The old
+;; version, now outdated, shadows the new one. This is obviously
+;; undesirable.
+;;
+;; The `list-load-path-shadows' function was run when you installed
+;; this version of emacs. To run it by hand in emacs:
+;;
+;;     M-x load-library RET shadow RET
+;;     M-x list-load-path-shadows
+;;
+;; or run it non-interactively via:
+;;
+;;     emacs -batch -l shadow.el -f list-load-path-shadows
+;;
+;; Thanks to Francesco Potorti` <pot@cnuce.cnr.it> for suggestions,
+;; rewritings & speedups.
+
+;;; Code:
+
+(defun find-emacs-lisp-shadows (&optional path)
+  "Return a list of Emacs Lisp files that create shadows.
+This function does the work for `list-load-path-shadows'.
+
+We traverse PATH looking for shadows, and return a \(possibly empty\)
+even-length list of files.  A file in this list at position 2i shadows
+the file in position 2i+1.  Emacs Lisp file suffixes \(.el and .elc\)
+are stripped from the file names in the list.
+
+See the documentation for `list-load-path-shadows' for further information."
+  
+  (or path (setq path load-path))
+
+  (let (true-names			; List of dirs considered.
+	shadows				; List of shadowings, to be returned.
+	files				; File names ever seen, with dirs.
+	dir				; The dir being currently scanned.
+	curr-files			; This dir's Emacs Lisp files.
+	orig-dir			; Where the file was first seen.
+	files-seen-this-dir		; Files seen so far in this dir.
+	file)				; The current file.
+
+  
+    (while path
+
+      (setq dir (file-truename (or (car path) ".")))
+      (if (member dir true-names)
+	  ;; We have already considered this PATH redundant directory.
+	  ;; Show the redundancy if we are interactiver, unless the PATH
+	  ;; dir is nil or "." (these redundant directories are just a
+	  ;; result of the current working directory, and are therefore
+	  ;; not always redundant).
+	  (or noninteractive
+	      (and (car path)
+		   (not (string= (car path) "."))
+		   (message "Ignoring redundant directory %s" (car path))))
+	
+	(setq true-names (append true-names (list dir)))
+	(setq dir (or (car path) "."))
+	(setq curr-files (if (file-accessible-directory-p dir)
+                               (directory-files dir nil ".\\.elc?$" t)))
+	(and curr-files
+	     (not noninteractive)
+	     (message "Checking %d files in %s..." (length curr-files) dir))
+	
+	(setq files-seen-this-dir nil)
+
+	(while curr-files
+
+	  (setq file (car curr-files))
+	  (setq file (substring
+		      file 0 (if (string= (substring file -1) "c") -4 -3)))
+
+	  ;; FILE now contains the current file name, with no suffix.
+	  (unless (or (member file files-seen-this-dir)
+		      ;; Ignore these files.
+		      (member file
+			      '("subdirs"
+				"auto-autoloads"
+				"custom-load"
+				"lpath")))
+	    ;; File has not been seen yet in this directory.
+	    ;; This test prevents us declaring that XXX.el shadows
+	    ;; XXX.elc (or vice-versa) when they are in the same directory.
+	    (setq files-seen-this-dir (cons file files-seen-this-dir))
+	      
+	    (if (setq orig-dir (assoc file files))
+		;; This file was seen before, we have a shadowing.
+		(setq shadows
+		      (append shadows
+			      (list (concat (cdr orig-dir) "/" file)
+				    (concat dir "/" file))))
+
+	      ;; Not seen before, add it to the list of seen files.
+	      (setq files (cons (cons file dir) files))))
+
+	  (setq curr-files (cdr curr-files))))
+	(setq path (cdr path)))
+
+    ;; Return the list of shadowings.
+    shadows))
+
+
+;;;###autoload
+(defun list-load-path-shadows ()
+  "Display a list of Emacs Lisp files that shadow other files.
+
+This function lists potential load-path problems.  Directories in the
+`load-path' variable are searched, in order, for Emacs Lisp
+files.  When a previously encountered file name is found again, a
+message is displayed indicating that the later file is \"hidden\" by
+the earlier.
+
+For example, suppose `load-path' is set to
+
+\(\"/usr/gnu/emacs/site-lisp\" \"/usr/gnu/emacs/share/emacs/19.30/lisp\"\)
+
+and that each of these directories contains a file called XXX.el.  Then
+XXX.el in the site-lisp directory is referred to by all of:
+\(require 'XXX\), \(autoload .... \"XXX\"\), \(load-library \"XXX\"\) etc.
+
+The first XXX.el file prevents emacs from seeing the second \(unless
+the second is loaded explicitly via load-file\).
+
+When not intended, such shadowings can be the source of subtle
+problems.  For example, the above situation may have arisen because the
+XXX package was not distributed with versions of emacs prior to
+19.30.  An emacs maintainer downloaded XXX from elsewhere and installed
+it.  Later, XXX was updated and included in the emacs distribution.
+Unless the emacs maintainer checks for this, the new version of XXX
+will be hidden behind the old \(which may no longer work with the new
+emacs version\).
+
+This function performs these checks and flags all possible
+shadowings.  Because a .el file may exist without a corresponding .elc
+\(or vice-versa\), these suffixes are essentially ignored.  A file
+XXX.elc in an early directory \(that does not contain XXX.el\) is
+considered to shadow a later file XXX.el, and vice-versa.
+
+When run interactively, the shadowings \(if any\) are displayed in a
+buffer called `*Shadows*'.  Shadowings are located by calling the
+\(non-interactive\) companion function, `find-emacs-lisp-shadows'."
+  
+  (interactive)
+  (let* ((path (copy-sequence load-path))
+	(tem path)
+	toplevs)
+    ;; If we can find simple.el in two places,
+    (while tem
+      (if (file-exists-p (expand-file-name "simple.el" (car tem)))
+	  (setq toplevs (cons (car tem) toplevs)))
+      (setq tem (cdr tem)))
+    (if (> (length toplevs) 1)
+	;; Cut off our copy of load-path right before
+	;; the second directory which has simple.el in it.
+	;; This avoids loads of duplications between the source dir
+	;; and the dir where these files were copied by installation.
+	(let ((break (nth (- (length toplevs) 2) toplevs)))
+	  (setq tem path)
+	  (while tem
+	    (if (eq (nth 1 tem) break)
+		(progn
+		  (setcdr tem nil)
+		  (setq tem nil)))
+	    (setq tem (cdr tem)))))
+
+    (let* ((shadows (find-emacs-lisp-shadows path))
+	   (n (/ (length shadows) 2))
+	   (msg (format "%s Emacs Lisp load-path shadowing%s found"
+			(if (zerop n) "No" (concat "\n" (number-to-string n)))
+			(if (= n 1) " was" "s were"))))
+      (if (interactive-p)
+	  (save-excursion
+	    ;; We are interactive.
+	    ;; Create the *Shadows* buffer and display shadowings there.
+	    (let ((output-buffer (get-buffer-create "*Shadows*")))
+	      (display-buffer output-buffer)
+	      (set-buffer output-buffer)
+	      (erase-buffer)
+	      (while shadows
+		(insert (format "%s hides %s\n" (car shadows)
+				(car (cdr shadows))))
+		(setq shadows (cdr (cdr shadows))))
+	      (insert msg "\n")))
+	;; We are non-interactive, print shadows via message.
+	(when shadows
+	  (message "This site has duplicate Lisp libraries with the same name.
+If a locally-installed Lisp library overrides a library in the Emacs release,
+that can cause trouble, and you should probably remove the locally-installed
+version unless you know what you are doing.\n"))
+	(while shadows
+	  (message "%s hides %s" (car shadows) (car (cdr shadows)))
+	  (setq shadows (cdr (cdr shadows))))
+	(message "%s" msg)))))
+
+(provide 'shadow)
+
+;;; shadow.el ends here
--- a/lisp/w3/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/w3/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -111,6 +111,7 @@
 
 auto-autoloads.el: $(SOURCES)
 	$(EMACS) -batch -q -no-site-file \
+		-eval '(setq autoload-target-directory "'`pwd`'/")' \
 		-eval '(setq autoload-package-name "w3")' \
 		-l autoload \
-		-f batch-update-directory .
+		-f batch-update-autoloads $?
--- a/lisp/x11/x-menubar.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/x11/x-menubar.el	Mon Aug 13 09:58:30 2007 +0200
@@ -320,7 +320,7 @@
        ["Make current frame gnuserv target"
 	(setq gnuserv-frame
 	      (if (equal gnuserv-frame (selected-frame))
-		  nil
+		  'new
 		(selected-frame)))
 	:style radio
 	:selected (equal gnuserv-frame (selected-frame))]
--- a/lisp/x11/x-win-sun.el	Mon Aug 13 09:57:40 2007 +0200
+++ b/lisp/x11/x-win-sun.el	Mon Aug 13 09:58:30 2007 +0200
@@ -87,82 +87,82 @@
  ;; kp-enter is ok
 ;; Sun Function keys
 (loop for (x-name from-key to-key) in
-      `(("F21" f21 pause)
-	("F22" f22 print)
-	("F23" f23 scroll_lock)
+  `(("F21" f21 pause)
+    ("F22" f22 print)
+    ("F23" f23 scroll_lock)
 
-	;; X11 R6 mappings
-	("SunProps" SunProps props)
-	("SunFront" SunFront front)
-	("SunOpen"  SunOpen  open)
-	("SunFind"  SunFind  find)
-	("Cancel"   cancel   stop)
-	("Undo"     Undo     undo)
-	("SunCopy"  SunCopy  copy)
-	("SunPaste" SunPaste paste)
-	("SunCut"   SunCut   cut)
+    ;; X11 R6 mappings
+    ("SunProps" SunProps props)
+    ("SunFront" SunFront front)
+    ("SunOpen"  SunOpen  open)
+    ("SunFind"  SunFind  find)
+    ("Cancel"   cancel   stop)
+    ("Undo"     Undo     undo)
+    ("SunCopy"  SunCopy  copy)
+    ("SunPaste" SunPaste paste)
+    ("SunCut"   SunCut   cut)
 
-	("F13" f13 props)
-	("F14" f14 undo)
-	("F15" f15 front)
-	("F16" f16 copy)
-	("F17" f17 open)
-	("F18" f18 paste)
-	("F19" f19 find)
-	("F20" f20 cut)
+    ("F13" f13 props)
+    ("F14" f14 undo)
+    ("F15" f15 front)
+    ("F16" f16 copy)
+    ("F17" f17 open)
+    ("F18" f18 paste)
+    ("F19" f19 find)
+    ("F20" f20 cut)
 
-	("F25" f25 kp-divide)
-	("F26" f26 kp-multiply)
-	("F31" f31 kp-5)
+    ("F25" f25 kp-divide)
+    ("F26" f26 kp-multiply)
+    ("F31" f31 kp-5)
 
-	;; Map f33 and r13 to end or kp-end
-	,@(cond
-	   ((not (x-keysym-on-keyboard-sans-modifiers-p "End"))
-	    '(("F33" f33 end)
-	      ("R13" r13 end)))
-	   ((not (x-keysym-on-keyboard-sans-modifiers-p "KP_End"))
-	    '(("F33" f33 kp-end)
-	      ("R13" r13 kp-end))))
+    ;; Map f33 and r13 to end or kp-end
+    ,@(cond
+       ((not (x-keysym-on-keyboard-sans-modifiers-p "End"))
+	'(("F33" f33 end)
+	  ("R13" r13 end)))
+       ((not (x-keysym-on-keyboard-sans-modifiers-p "KP_End"))
+	'(("F33" f33 kp-end)
+	  ("R13" r13 kp-end))))
 
-	,@(if (x-keysym-on-keyboard-sans-modifiers-p "F36")
-	      '(("F36" f36 stop)
-		("F37" f37 again)))
+    ,@(if (x-keysym-on-keyboard-sans-modifiers-p "F36")
+	  '(("F36" f36 stop)
+	    ("F37" f37 again)))
 
-	;; Type 4 keyboards have a real kp-subtract  and a f24 labelled `='
-	;; Type 5 keyboards have no key labelled `=' and a f24 labelled `-'
-	,@(when (x-keysym-on-keyboard-sans-modifiers-p "F24")
-	    `(("F24" f24 ,(if (x-keysym-on-keyboard-sans-modifiers-p "KP_Subtract")
-			      'kp-equal
-			    'kp-subtract))))
+    ;; Type 4 keyboards have a real kp-subtract  and a f24 labelled `='
+    ;; Type 5 keyboards have no key labelled `=' and a f24 labelled `-'
+    ,@(when (x-keysym-on-keyboard-sans-modifiers-p "F24")
+	`(("F24" f24 ,(if (x-keysym-on-keyboard-sans-modifiers-p "KP_Subtract")
+			  'kp-equal
+			'kp-subtract))))
 
-	;; Map f27 to home or kp-home, as appropriate
-	,@(cond ((not (x-keysym-on-keyboard-sans-modifiers-p "Home"))
-		 '(("F27" f27 home)))
-		((not (x-keysym-on-keyboard-sans-modifiers-p "KP_Home"))
-		 '(("F27" f27 kp-home))))
+    ;; Map f27 to home or kp-home, as appropriate
+    ,@(cond ((not (x-keysym-on-keyboard-sans-modifiers-p "Home"))
+	     '(("F27" f27 home)))
+	    ((not (x-keysym-on-keyboard-sans-modifiers-p "KP_Home"))
+	     '(("F27" f27 kp-home))))
 
-	;; Map f29 to prior or kp-prior, as appropriate
-	,@(cond ((not (x-keysym-on-keyboard-sans-modifiers-p "Prior"))
-		 '(("F29" f29 prior)))
-		((not (x-keysym-on-keyboard-sans-modifiers-p "KP_Prior"))
-		 '(("F29" f29 kp-prior))))
+    ;; Map f29 to prior or kp-prior, as appropriate
+    ,@(cond ((not (x-keysym-on-keyboard-sans-modifiers-p "Prior"))
+	     '(("F29" f29 prior)))
+	    ((not (x-keysym-on-keyboard-sans-modifiers-p "KP_Prior"))
+	     '(("F29" f29 kp-prior))))
 
-	;; Map f35 to next or kp-next, as appropriate
-	,@(cond ((not (x-keysym-on-keyboard-sans-modifiers-p "Next"))
-		 '(("F35" f35 next)))
-		((not (x-keysym-on-keyboard-sans-modifiers-p "KP_Next"))
-		 '(("F35" f35 kp-next))))
+    ;; Map f35 to next or kp-next, as appropriate
+    ,@(cond ((not (x-keysym-on-keyboard-sans-modifiers-p "Next"))
+	     '(("F35" f35 next)))
+	    ((not (x-keysym-on-keyboard-sans-modifiers-p "KP_Next"))
+	     '(("F35" f35 kp-next))))
 
-	,@(cond ((x-keysym-on-keyboard-sans-modifiers-p "apRead") ; SunOS 4.1.1
-		 '(("apRead" apRead f11) ("apEdit" apEdit f12)))
-		((x-keysym-on-keyboard-sans-modifiers-p "SunF36") ; SunOS 5
-		 '(("SunF36" SunF36 f11)
-		   ("SunF37" SunF37 f12)
-		   ("F11"    f11    stop)
-		   ("F12"    f12    again))))
-	)
-      do (when (x-keysym-on-keyboard-sans-modifiers-p x-name)
-	   (x-remap-keysyms-using-function-key-map from-key to-key)))
+    ,@(cond ((x-keysym-on-keyboard-sans-modifiers-p "apRead") ; SunOS 4.1.1
+	     '(("apRead" apRead f11) ("apEdit" apEdit f12)))
+	    ((x-keysym-on-keyboard-sans-modifiers-p "SunF36") ; SunOS 5
+	     '(("SunF36" SunF36 f11)
+	       ("SunF37" SunF37 f12)
+	       ("F11"    f11    stop)
+	       ("F12"    f12    again))))
+    )
+  do (when (x-keysym-on-keyboard-sans-modifiers-p x-name)
+       (x-remap-keysyms-using-function-key-map from-key to-key)))
 
 (unintern 'x-remap-keysyms-using-function-key-map)
 
--- a/lwlib/Makefile.in.in	Mon Aug 13 09:57:40 2007 +0200
+++ b/lwlib/Makefile.in.in	Mon Aug 13 09:58:30 2007 +0200
@@ -77,7 +77,11 @@
 cflags = $(CFLAGS) $(cppflags)
 
 ALL_CFLAGS= $(CFLAGS) $(CPPFLAGS) -I. $(c_switch_all) $(ENERGIZEP)
+#ifdef SOLARIS2
+%.o : %.c
+#else
 .c.o:
+#endif
 	$(CC) -c $(cflags) $<
 
 ## Create preprocessor output (debugging purposes only)
--- a/lwlib/xlwmenu.c	Mon Aug 13 09:57:40 2007 +0200
+++ b/lwlib/xlwmenu.c	Mon Aug 13 09:58:30 2007 +0200
@@ -390,7 +390,7 @@
 static int
 string_width_u (XlwMenuWidget mw,
 #ifdef NEED_MOTIF
-	      XmString s
+	      XmString string
 #else
 	      char *string
 #endif
@@ -398,30 +398,56 @@
 {
 #ifdef NEED_MOTIF
   Dimension width, height;
-  XmStringExtent (mw->menu.font_list, s, &width, &height);
-  return width;
+  XmString newstring;
 #else
 # ifdef USE_XFONTSET
   XRectangle ri, rl;
-  XmbTextExtents (mw->menu.font_set, string, strlen (string), &ri, &rl);
-  return rl.width;
 # else /* ! USE_XFONTSET */
   XCharStruct xcs;
-  int i,s=0,w=0;
   int drop;
-  for (i=0;string[i];++i) {
-    if (string[i]=='%'&&string[i+1]=='_') {
-      XTextExtents (mw->menu.font, &string[s], i-s, &drop, &drop, &drop, &xcs);
-      w += xcs.width;
+# endif
+#endif
+  char newchars[64];
+  char *chars;
+  int i, j;
+
+#ifdef NEED_MOTIF
+  XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars);
+#else
+  chars = string;
+#endif
+
+  for (i = j = 0; chars[i]; i++)
+    if (chars[i]=='%'&&chars[i+1]=='_')
+	    i++;
+    else
+	    newchars[j++] = chars[i];
+  newchars[j] = '\0';
+
+#ifdef NEED_MOTIF
+  newstring = XmStringLtoRCreate (newchars, XmFONTLIST_DEFAULT_TAG);
+  XmStringExtent (mw->menu.font_list, newstring, &width, &height);
+  XmStringFree(newstring);
+  return width;
+#else
+# ifdef USE_XFONTSET
+  int i, s=0, w=0;
+  for (i=0; string[i]; ++i) {
+    if (string[i]=='%' && string[i+1]=='_') {
+      XmbTextExtents(mw->menu.font_set, &string[s], i-s, &ri, &rl);
+      w += rl.width;
       s = i + 2;
       ++i;
     }
   }
   if (string[s]) {
-	  XTextExtents (mw->menu.font, &string[s], i-s, &drop, &drop, &drop, &xcs);
-	  w += xcs.width;
+    XmbTextExtents(mw->menu.font_set, &string[s], i-s, &ri, &rl);
+    w += rl.width;
   }
   return w;
+# else /* ! USE_XFONTSET */
+  XTextExtents (mw->menu.font, newchars, j, &drop, &drop, &drop, &xcs);
+  return xcs.width;
 # endif /* USE_XFONTSET */
 #endif
 }
@@ -768,6 +794,72 @@
 #endif
 }
 
+static int
+string_draw_range (
+	XlwMenuWidget mw,
+	Window window,
+	int x, int y,
+	GC gc,
+	char *string,
+	int start,
+	int end
+)
+{
+#ifdef NEED_MOTIF
+	Dimension width, height;
+	XmString newstring;
+	int c;
+
+	if (end <= start)
+		return 0;
+	c = string[end];
+	string[end] = '\0';
+	newstring = XmStringLtoRCreate (&string[start], XmFONTLIST_DEFAULT_TAG);
+	XmStringDraw (
+		XtDisplay (mw), window,
+		mw->menu.font_list,
+		newstring, gc,
+		x, y,
+		1000,	/* ???? width */
+		XmALIGNMENT_BEGINNING,
+		0, /* ???? layout_direction */
+		0
+	);
+	XmStringExtent (mw->menu.font_list, newstring, &width, &height);
+	XmStringFree (newstring);
+	string[end] = c;
+	return width;
+#else
+# ifdef USE_XFONTSET
+	XRectangle ri, rl;
+
+	if (end <= start)
+		return 0;
+	XmbDrawString (
+		XtDisplay (mw), window, mw->menu.font_set, gc,
+		x, y + mw->menu.font_ascent, &string[start], i-s
+	);
+	XmbTextExtents (
+		mw->menu.font_set, &string[start], end - start, &ri, &rl
+	);
+	return rl.width;
+# else
+	XCharStruct xcs;
+	int drop;
+
+	if (end <= start)
+		return 0;
+	XDrawString (
+		XtDisplay (mw), window, gc,
+		x, y + mw->menu.font_ascent, &string[start], end - start);
+	XTextExtents (
+		mw->menu.font, &string[start], end - start,
+		&drop, &drop, &drop, &xcs);
+	return xcs.width;
+# endif
+#endif
+}
+
 static void
 string_draw_u (XlwMenuWidget mw,
 	       Window window,
@@ -780,67 +872,31 @@
 #endif
 )
 {
+int i,s=0;
+char *chars;
+
 #ifdef NEED_MOTIF
-  XmStringDraw (XtDisplay (mw), window,
-		mw->menu.font_list,
-		string, gc,
-		x, y,
-		1000,	/* ???? width */
-		XmALIGNMENT_BEGINNING,
-		0, /* ???? layout_direction */
-		0);
+  XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars);
 #else
-  int i,s=0;
-  for (i=0;string[i];++i) {
-      if (string[i]=='%'&&string[i+1]=='_') {
-	  XCharStruct xcs;
-	  int drop;
+  chars = string;
+#endif
+  for (i=0;chars[i];++i) {
+      if (chars[i]=='%'&&chars[i+1]=='_') {
+	  int w;
+
+	  x += string_draw_range (mw, window, x, y, gc, chars, s, i);
+	  w = string_draw_range (mw, window, x, y, gc, chars, i+2, i+3);
+
 	  /* underline next character */
-	  if (i>s)
-# ifdef USE_XFONTSET
-	    XmbDrawString (XtDisplay (mw), window, mw->menu.font_set, gc,
-			   x, y + mw->menu.font_ascent, &string[s], i-s);
-# else
-	  XDrawString (XtDisplay (mw), window, gc,
-		       x, y + mw->menu.font_ascent, &string[s], i-s);
-# endif /* USE_XFONTSET */
-
-	  XTextExtents (mw->menu.font, &string[s], i-s, &drop, &drop, &drop,
-			&xcs);
-	  x += xcs.width;
-
-	  s=i+3;
-	  i+=2;
-
-# ifdef USE_XFONTSET
-	  XmbDrawString (XtDisplay (mw), window, mw->menu.font_set, gc,
-			 x, y + mw->menu.font_ascent, &string[i], 1);
-# else
-	  XDrawString (XtDisplay (mw), window, gc,
-		       x, y + mw->menu.font_ascent, &string[i], 1);
-# endif /* USE_XFONTSET */
-
-	  XTextExtents (mw->menu.font, &string[i], 1, &drop, &drop, &drop,
-			&xcs);
-
 	  XDrawLine (XtDisplay (mw), window, gc, x - 1,
 		     y + mw->menu.font_ascent + 1,
-		     x + xcs.width - 1, y + mw->menu.font_ascent + 1 );
-
-	  x += xcs.width;
+		     x + w - 1, y + mw->menu.font_ascent + 1 );
+	  x += w;
+	  s = i + 3;
+	  i += 2;
       }
   }
-  if (string[s])
-# ifdef USE_XFONTSET
-    XmbDrawString (XtDisplay (mw), window, mw->menu.font_set, gc,
-		   x, y + mw->menu.font_ascent, &string[s],
-		   strlen (&string[s]));
-# else
-  XDrawString (XtDisplay (mw), window, gc,
-	       x, y + mw->menu.font_ascent, &string[s],
-	       strlen (&string[s]));
-# endif /* USE_XFONTSET */
-#endif /* NEED_MOTIF */
+  x += string_draw_range (mw, window, x, y, gc, chars, s, i);
 }
 
 static void
--- a/man/ChangeLog	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/ChangeLog	Mon Aug 13 09:58:30 2007 +0200
@@ -1,3 +1,11 @@
+1997-09-18  SL Baur  <steve@altair.xemacs.org>
+
+	* internals/Makefile (../../info/$(NAME).info): Warn and clean up
+	if someone hasn't upgraded makeinfo.
+
+	* Makefile (EMACS): Refer to xemacs binary in source tree.
+	* tm/Makefile (EMACS): Ditto.
+
 1997-08-15  Karl M. Hegbloom <karlheg@inetarena.com>
 
 	* cl.texi (Type Predicates): Update for corrected handling of
--- a/man/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -23,15 +23,19 @@
 # inherited from the environment.
 SHELL = /bin/sh
 
-EMACS = xemacs
+EMACS = ../src/xemacs
 EMACSFLAGS = -batch -q -no-site-file 
 
 # NOTE:  You *must* have makeinfo-1.68 or later to rebuild the
 # info tree.
 MAKEINFO = makeinfo
+TEXI2DVI = texi2dvi
 
+.SUFFIXES:
 .SUFFIXES: .info .texi .dvi
 
+RECURSIVE_MAKE = $(MAKE) $(MFLAGS) MAKEINFO='$(MAKEINFO)' TEXI2DVI='$(TEXI2DVI)'
+
 # Subdirectories to make recursively.
 SUBDIR = xemacs lispref new-users-guide internals tm gnats
 
@@ -51,21 +55,21 @@
 
 all  : info
 info : $(info) $(special)
-	-for d in $(SUBDIR) ; do (cd $${d} && $(MAKE) $(MFLAGS) $@) ; done
+	-for d in $(SUBDIR) ; do (cd $${d} && $(RECURSIVE_MAKE) $@) ; done
 
-xemacs: FORCE
-	-cd $@ && $(MAKE) $(MFLAGS)
-lispref: FORCE
-	-cd $@ && $(MAKE) $(MFLAGS)
-new-users-guide: FORCE
-	-cd $@ && $(MAKE) $(MFLAGS)
-internals: FORCE
-	-cd $@ && $(MAKE) $(MFLAGS)
-tm: FORCE
-	-cd $@ && $(MAKE) $(MFLAGS)
-auctex: FORCE
-	-cd $@ && $(MAKE) $(MFLAGS)
-FORCE :
+xemacs: FRC.xemacs
+	-cd $@ && $(RECURSIVE_MAKE)
+lispref: FRC.lispref
+	-cd $@ && $(RECURSIVE_MAKE)
+new-users-guide: FRC.new-users-guide
+	-cd $@ && $(RECURSIVE_MAKE)
+internals: FRC.internals
+	-cd $@ && $(RECURSIVE_MAKE)
+tm: FRC.tm
+	-cd $@ && $(RECURSIVE_MAKE)
+gnats: FRC.gnats
+	-cd $@ && $(RECURSIVE_MAKE)
+FRC.xemacs FRC.lispref FRC.new-users-guide FRC.internals FRC.tm FRC.gnats:
 
 ../info/w3.info : w3.texi
 	-$(MAKEINFO) w3.texi -o ../info/w3.info
@@ -79,29 +83,27 @@
 		-f texinfo-format-buffer -f save-buffer
 	-mv vm.info* ../info
 
-PERL = perl
-TEXI2DVI = texi2dvi
-
 texinfo.dvi: texinfo.texi
 	$(TEXI2DVI) $<
 .texi.dvi:
 	$(TEXI2DVI) $<
 
-dvi : $(dvi) FORCE
-	for d in $(SUBDIR) ; do (cd $${d} && $(MAKE) $(MFLAGS) $@) ; done
+.PHONY: dvi
+dvi : $(dvi)
+	for d in $(SUBDIR) ; do (cd $${d} && $(RECURSIVE_MAKE) $@) ; done
 
 .PHONY: mostlyclean clean distclean realclean extraclean
 mostlyclean:
-	for d in $(SUBDIR) ; do (cd $${d} && $(MAKE) $(MFLAGS) $@) ; done
+	for d in $(SUBDIR) ; do (cd $${d} && $(RECURSIVE_MAKE) $@) ; done
 	rm -f *.toc *.aux *.log \
 	      *.cp *.cps *.fn *.fns *.ky *.kys *.pg *.pgs *.vr *.vrs *.tp *.tps
 clean: mostlyclean
-	for d in $(SUBDIR) ; do (cd $${d} && $(MAKE) $(MFLAGS) $@) ; done
+	for d in $(SUBDIR) ; do (cd $${d} && $(RECURSIVE_MAKE) $@) ; done
 	rm -f *.o core *.dvi
 distclean: clean
-	for d in $(SUBDIR) ; do (cd $${d} && $(MAKE) $(MFLAGS) $@) ; done
+	for d in $(SUBDIR) ; do (cd $${d} && $(RECURSIVE_MAKE) $@) ; done
 realclean: distclean
-	for d in $(SUBDIR) ; do (cd $${d} && $(MAKE) $(MFLAGS) $@) ; done
+	for d in $(SUBDIR) ; do (cd $${d} && $(RECURSIVE_MAKE) $@) ; done
 extraclean: distclean
-	for d in $(SUBDIR) ; do (cd $${d} && $(MAKE) $(MFLAGS) $@) ; done
+	for d in $(SUBDIR) ; do (cd $${d} && $(RECURSIVE_MAKE) $@) ; done
 	-rm -f *~ \#*
--- a/man/gnats/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/gnats/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -20,13 +20,16 @@
 VERSION=1.0
 NAME=gnats
 
+TEXI2DVI = texi2dvi
+MAKEINFO = makeinfo
+
 # Uncomment this line for permuted index.
 # permuted_index = 1 
 
 # List of all the texinfo files in the manual:
 
 srcs = categ.texi fields.texi flowchart.txt gnats.texi p-admin.texi \
-	p-inst.texi p-usage.texi s-usage.texi send-pr.texi states.text \
+	p-inst.texi p-usage.texi s-usage.texi send-pr.texi states.texi \
 	version.texi
 
 gnats_srcs = flowchart.txt gnats.texi p-admin.texi p-inst.texi \
@@ -39,16 +42,17 @@
 info : ../../info/$(NAME).info ../../info/send-pr.info
 
 ../../info/$(NAME).info: ${gnats_srcs}
-	${MAKEINFO} $(NAME).texi -o ../../info/${NAME}.info
+	$(MAKEINFO) $(NAME).texi -o ../../info/${NAME}.info
 
 ../../info/send-pr.info: ${seend_pr_srcs}
-	${MAKEINFO} send-pr.texi -o ../../info/send-pr.info
+	$(MAKEINFO) send-pr.texi -o ../../info/send-pr.info
 
 dvi : $(NAME).dvi send-pr.dvi
 
-$(NAME).dvi: $(srcs) index.texi
-	texi2dvi gnats.texi
-	texi2dvi send-pr.texi
+#$(NAME).dvi: $(srcs) index.texi
+$(NAME).dvi: $(srcs)
+	$(TEXI2DVI) gnats.texi
+	$(TEXI2DVI) send-pr.texi
 
 .PHONY: mostlyclean clean distclean realclean extraclean
 mostlyclean:
--- a/man/internals/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/internals/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -21,6 +21,9 @@
 NAME=internals
 manual = xemacs-internals-manual-19-$(VERSION)
 
+TEXI2DVI = texi2dvi
+MAKEINFO = makeinfo
+
 # Uncomment this line for permuted index.
 # permuted_index = 1 
 
@@ -32,7 +35,9 @@
 info : ../../info/$(NAME).info
 
 ../../info/$(NAME).info: $(srcs) index.texi
+	@echo "Expect a coredump if you are not using makeinfo 1.68 (or later)"
 	$(MAKEINFO) $(NAME).texi
+	@rm -f core
 
 dvi : $(NAME).dvi
 
--- a/man/internals/internals.texi	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/internals/internals.texi	Mon Aug 13 09:58:30 2007 +0200
@@ -209,7 +209,7 @@
 Buffers and Textual Representation
 
 * Introduction to Buffers::     A buffer holds a block of text such as a file.
-* A Buffer's Text::             Representation of the text in a buffer.
+* The Text in a Buffer::        Representation of the text in a buffer.
 * Buffer Lists::                Keeping track of all buffers.
 * Markers and Extents::         Tagging locations within a buffer.
 * Bufbytes and Emchars::        Representation of individual characters.
@@ -301,6 +301,7 @@
 * Through Version 18::          Unification prevails.
 * Lucid Emacs::                 One version 19 Emacs.
 * GNU Emacs 19::                The other version 19 Emacs.
+* GNU Emacs 20::                The other version 20 Emacs.
 * XEmacs::                      The continuation of Lucid Emacs.
 @end menu
 
@@ -576,6 +577,21 @@
 working on and using GNU Emacs for a long time (back as far as version
 16 or 17).
 
+@node GNU Emacs 20
+@section GNU Emacs 20
+@cindex GNU Emacs 20
+@cindex FSF Emacs
+
+On February 2, 1997 work began on GNU Emacs to integrate Mule.  The first
+release was made in September of that year.
+
+A timeline for Emacs 20 is
+
+@itemize @bullet
+@item
+version 20.1 released September 17, 1997.
+@end itemize
+
 @node XEmacs
 @section XEmacs
 @cindex XEmacs
@@ -5345,7 +5361,7 @@
 
 @menu
 * Introduction to Buffers::     A buffer holds a block of text such as a file.
-* A Buffer's Text::             Representation of the text in a buffer.
+* The Text in a Buffer::        Representation of the text in a buffer.
 * Buffer Lists::                Keeping track of all buffers.
 * Markers and Extents::         Tagging locations within a buffer.
 * Bufbytes and Emchars::        Representation of individual characters.
@@ -5405,8 +5421,8 @@
 window. (This latter distinction is explained in detail in the section
 on windows.)
 
-@node A Buffer's Text
-@section A Buffer's Text
+@node The Text in a Buffer
+@section The Text in a Buffer
 
   The text in a buffer consists of a sequence of zero or more
 characters.  A @dfn{character} is an integer that logically represents
--- a/man/lispref/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/lispref/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -22,6 +22,7 @@
 manual = elisp-manual-19-$(VERSION)
 
 TEXI2DVI = texi2dvi
+MAKEINFO = makeinfo
 
 # Uncomment this line for permuted index.
 # permuted_index = 1 
@@ -46,7 +47,7 @@
 info : ../../info/$(NAME).info
 
 ../../info/$(NAME).info: $(srcs) index.texi
-	makeinfo -o $@ $(NAME).texi
+	$(MAKEINFO) -o $@ $(NAME).texi
 
 dvi: $(NAME).dvi
 
--- a/man/new-users-guide/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/new-users-guide/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -21,6 +21,7 @@
 
 SHELL = /bin/sh
 TEXI2DVI = texi2dvi
+MAKEINFO = makeinfo
 
 # List of all the texinfo files in the manual:
 
@@ -32,7 +33,7 @@
 info : ../../info/$(NAME).info
 
 ../../info/$(NAME).info: $(srcs)
-	makeinfo -o $@ $(NAME).texi
+	$(MAKEINFO) -o $@ $(NAME).texi
 
 dvi : $(NAME).dvi
 .texi.dvi :
--- a/man/tm/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/tm/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -18,7 +18,7 @@
 # Boston, MA 02111-1307, USA.
 
 # The japanese texinfo files requires the very latest 20.0 xemacs
-EMACS = xemacs
+EMACS = ../../src/xemacs
 NAMES = tm tm-edit tm-view gnus-mime tm-mh-e
 NAMES_EN = $(NAMES:%=%-en) tm-vm-en
 NAMES_JA = $(NAMES:%=%-ja)
@@ -28,6 +28,7 @@
 DVIS  = $(NAMES_EN:%=%.dvi)
 
 TEXI2DVI = texi2dvi
+MAKEINFO = makeinfo
 
 # List of all the texinfo files in the manual:
 
--- a/man/widget.texi	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/widget.texi	Mon Aug 13 09:58:30 2007 +0200
@@ -13,7 +13,7 @@
 @comment  node-name,  next,  previous,  up
 @top The Emacs Widget Library
 
-Version: 1.9958
+Version: 1.9960
 
 @menu
 * Introduction::                
--- a/man/xemacs/Makefile	Mon Aug 13 09:57:40 2007 +0200
+++ b/man/xemacs/Makefile	Mon Aug 13 09:58:30 2007 +0200
@@ -21,6 +21,7 @@
 
 NAME=xemacs
 
+MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
 
 # List of all the texinfo files in the manual:
@@ -41,7 +42,7 @@
 	$(TEXI2DVI) $<
 
 ../../info/$(NAME).info: $(srcs)
-	makeinfo -o $@ $(NAME).texi
+	$(MAKEINFO) -o $@ $(NAME).texi
 
 .PHONY: mostlyclean clean distclean realclean extraclean
 mostlyclean:
--- a/pkg-src/tree-x/Makefile.in.in	Mon Aug 13 09:57:40 2007 +0200
+++ b/pkg-src/tree-x/Makefile.in.in	Mon Aug 13 09:58:30 2007 +0200
@@ -56,7 +56,11 @@
 xoobr: $(objs)
 	$(CC) $(CFLAGS) $(LDFLAGS) $(objs) $(ldflags) -o $@
 
-.c.o :
+#ifdef SOLARIS2
+%.o : %.c
+#else
+.c.o:
+#endif
 	$(CC) $(CFLAGS) $(cflags) -c $<
 
 install: $(progs)
--- a/src/ChangeLog	Mon Aug 13 09:57:40 2007 +0200
+++ b/src/ChangeLog	Mon Aug 13 09:58:30 2007 +0200
@@ -1,3 +1,13 @@
+1997-09-20  SL Baur  <steve@altair.xemacs.org>
+
+	* Makefile.in.in (xemacs): Adoption of shadow.el to print
+	load-path shadowings after successful dump.
+
+1997-09-20  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* redisplay.c (scroll_conservatively): New variable.
+	(redisplay_window): Use it.
+
 1997-09-16  SL Baur  <steve@altair.xemacs.org>
 
 	* events.c (Fmake_event): Add default case, remove unused variables.
--- a/src/Makefile.in.in	Mon Aug 13 09:57:40 2007 +0200
+++ b/src/Makefile.in.in	Mon Aug 13 09:58:30 2007 +0200
@@ -27,7 +27,7 @@
 
 ## For performance and consistency, no built-in rules.
 .SUFFIXES:
-.SUFFIXES: .c .o .i .h
+.SUFFIXES: .c .o .i .h .dep
 
 @SET_MAKE@
 SHELL=/bin/sh
@@ -125,7 +125,11 @@
 cflags   = $(CFLAGS) $(cppflags)
 ldflags  = $(ld_switch_all)
 
+#ifdef SOLARIS2
+%.o : %.c
+#else
 .c.o:
+#endif
 	$(CC) -c $(cflags) $<
 
 ## Create preprocessor output (debugging purposes only)
@@ -288,7 +292,9 @@
 xemacs: temacs ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp
 	@$(RM) $@ && touch SATISFIED
 	-$(DUMPENV) ./temacs -batch -l loadup.el dump
-	@if test -f $@;        then $(RM) SATISFIED; exit 0; fi; \
+	@if test -f $@;        then if test -f SATISFIED; then \
+		./xemacs -q -batch -f list-load-path-shadows; fi; \
+		$(RM) SATISFIED; exit 0; fi; \
 	 if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \
 	 $(RECURSIVE_MAKE) $@;
 
@@ -559,7 +565,7 @@
 ## users of alloca in Emacs.  Check out ../lib-src/getopt.c.  */
 
 alloca.o : ${srcdir}/alloca.c
-	$(CC) -c -Dfree=xfree -Dmalloc=xmalloc $(cflags) $<
+	$(CC) -c -Dfree=xfree -Dmalloc=xmalloc $(cflags) ${srcdir}/alloca.c
 #else
 #ifndef HAVE_ALLOCA
 alloca.o : ${srcdir}/alloca.s config.h
@@ -593,14 +599,14 @@
 
 #ifdef ENERGIZE
 energize.o: ${srcdir}/energize.c
-	$(CC) -c $(cppflags) $(cflags) $(BTL_includes) $<
+	$(CC) -c $(cppflags) $(cflags) $(BTL_includes) ${srcdir}/energize.c
 #endif /* ENERGIZE */
 
 #ifdef HAVE_NATIVE_SOUND
 sunplay.o: ${srcdir}/sunplay.c
-	$(CC) -c  $(sound_cflags) $(cflags) $<
+	$(CC) -c  $(sound_cflags) $(cflags) ${srcdir}/sunplay.c
 hpplay.o: ${srcdir}/hpplay.c
-	$(CC) -c -Demacs $(sound_cflags) $(cflags) $<
+	$(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c
 #endif /* HAVE_NATIVE_SOUND */
 
 ## System-specific programs to be made.
@@ -639,8 +645,6 @@
 .c.dep:
 	$(CC) -MM $(cflags) $< > $*.dep
 
-.SUFFIXES: .dep
-
 obj_dep = $(objs:.o=.dep)
 
 .PHONY : depend gnu-depend
--- a/src/device-x.c	Mon Aug 13 09:57:40 2007 +0200
+++ b/src/device-x.c	Mon Aug 13 09:58:30 2007 +0200
@@ -1133,12 +1133,12 @@
   switch (DefaultVisualOfScreen
 	  (DefaultScreenOfDisplay (get_x_display (device)))->class)
     {
-    case StaticGray:  return (intern ("static-gray"));
-    case GrayScale:   return (intern ("gray-scale"));
-    case StaticColor: return (intern ("static-color"));
-    case PseudoColor: return (intern ("pseudo-color"));
-    case TrueColor:   return (intern ("true-color"));
-    case DirectColor: return (intern ("direct-color"));
+    case StaticGray:  return intern ("static-gray");
+    case GrayScale:   return intern ("gray-scale");
+    case StaticColor: return intern ("static-color");
+    case PseudoColor: return intern ("pseudo-color");
+    case TrueColor:   return intern ("true-color");
+    case DirectColor: return intern ("direct-color");
     default:
       error ("display has an unknown visual class");
     }
@@ -1328,8 +1328,10 @@
      and doesn't free it until it exits? */
   result = XGrabPointer (DEVICE_X_DISPLAY (d), w,
 			 False,
-			 ButtonMotionMask | ButtonPressMask
-			 | ButtonReleaseMask | PointerMotionHintMask,
+			 ButtonMotionMask  |
+			 ButtonPressMask   |
+			 ButtonReleaseMask |
+			 PointerMotionHintMask,
 			 GrabModeAsync,	      /* Keep pointer events flowing */
 			 pointer_mode,	      /* Stall keyboard events */
 			 w,		      /* Stay in this window */
--- a/src/redisplay-tty.c	Mon Aug 13 09:57:40 2007 +0200
+++ b/src/redisplay-tty.c	Mon Aug 13 09:58:30 2007 +0200
@@ -1420,12 +1420,12 @@
 
   char **address = term_get_fkeys_arg;
 
-  for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
+  for (i = 0; i < countof (keys); i++)
     {
       char *sequence = tgetstr (keys[i].cap, address);
       if (sequence)
 	Fdefine_key (function_key_map,
-		     build_string (sequence),
+		     build_ext_string (sequence, FORMAT_BINARY),
 		     vector1 (intern (keys[i].name)));
     }
 
@@ -1441,13 +1441,13 @@
 
     if (k_semi)
       {
-	Fdefine_key (function_key_map, build_string (k_semi),
+	Fdefine_key (function_key_map, build_ext_string (k_semi, FORMAT_BINARY),
 		     vector1 (intern ("f10")));
 	k0_name = "f0";
       }
 
     if (k0)
-      Fdefine_key (function_key_map, build_string (k0),
+      Fdefine_key (function_key_map, build_ext_string (k0, FORMAT_BINARY),
 		   vector1 (intern (k0_name)));
   }
 
@@ -1471,7 +1471,7 @@
 	    {
 	      sprintf (fkey, "f%d", i);
 	      Fdefine_key (function_key_map,
-			   build_string (sequence),
+			   build_ext_string (sequence, FORMAT_BINARY),
 			   vector1 (intern (fkey)));
 	    }
 	}
@@ -1488,7 +1488,7 @@
 	  char *sequence = tgetstr (cap2, address);			\
 	  if (sequence)							\
 	    Fdefine_key (function_key_map,				\
-			 build_string (sequence),			\
+			 build_ext_string (sequence, FORMAT_BINARY),	\
 			 vector1 (intern (sym)));			\
 	}
 
--- a/version.sh	Mon Aug 13 09:57:40 2007 +0200
+++ b/version.sh	Mon Aug 13 09:58:30 2007 +0200
@@ -1,5 +1,5 @@
 #!/bin/sh
 emacs_major_version=20
 emacs_minor_version=3
-emacs_beta_version=22
-xemacs_codename="Minsk"
+emacs_beta_version=23
+xemacs_codename="Sarajevo"